@import "mixins/mixins";
@import "mixins/utils";
@import "common/var";
@import "input";
@import "checkbox";
@import "checkbox-group";

@include b(transfer) {
  font-size: 0;

  @include e(icon) {
    cursor: pointer;
    font-size: $--font-size-body-3;
    width: 20px;
    height: 22px;
    line-height: 22px;
    margin: auto 4px;
    text-align: center;
    color: $--color-text-3;

    .el-icon-clear {
      &:hover {
        width: 20px;
        height: 22px;
        background-color: $--color-bg-3;
        // border-radius: 50%;
        border-radius: $--border-radius-circle;
        padding-top: 3px;
      }
    }

    &:last-of-type {
      margin-right: 0;
    }
  }

  .el-checkbox-group {
    display: block;
  }

  .scrollbar{
    width: 100%;
    height: 100%;
    .el-scrollbar__wrap{
      overflow: scroll;
      height: 100%;
      overflow-x: auto;
    }
    @include when(filterable){
      height: calc(100% - 68px);
    }
  }
}


@include b(transfer-panel) {
  border: $--border-1 solid $--transfer-border-color;
  // border-radius: $--transfer-panel-border-radius;
  border-radius: $--border-radius-medium $--border-radius-none $--border-radius-none $--border-radius-medium;
  overflow: hidden;
  background: $--color-white;
  display: inline-block;
  vertical-align: middle;
  width: 50%;
  max-width: $--transfer-panel-width;
  max-height: 100%;
  box-sizing: border-box;
  position: relative;
  font-size: $--font-size-base;
  border-right: 0;
  text-align: left;

  .is-current > .el-tree-node__content .el-tree-node__wrap:not(.is-disabled) .el-tree-node__label {
    color: $--color-primary;
  }

  @include e(body) {
    height: $--transfer-panel-body-height;
    overflow: hidden;

    @include when(with-footer) {
      padding-bottom: $--transfer-panel-footer-height;
    }
  }

  .has-padding-top {
    padding-top: 8px;
  }

  @include e(list) {
    // margin: 8px 2px 0 0; // 滚动条先隐藏
    //padding-top: 8px;
    // padding: 0;
    list-style: none;
    height: 100%;
    overflow: auto;
    box-sizing: border-box;
    &.el-tree{
      //padding: 0 24px;
    }
    .el-tree-node {
      // padding: 0 24px;
      .el-checkbox__input {
        &:hover {
          // background-color: $--color-text-active;
        }
      }

      @include e(content){
        &:hover {
          background-color: $--color-secondary;
        }
      }
    }

    &-groupname {
      font-size: $--font-size-body-1;
      color: $--color-text-3;
    }
    // @include when(filterable){
    //   height: calc(100% - 68px);
    // }
  }

  @include e(item) {
    height: $--transfer-item-height;
    line-height: $--transfer-item-height;
    padding: 0 24px;
    display: flex !important;
    align-items: center;

    &.el-checkbox {
      margin-right: 0;
    }

    &.el-checkbox .el-checkbox__label {
      width: calc(100% - 28px);
      margin-left: 4px;
      @include utils-ellipsis;
      box-sizing: border-box;
    }

    &:not(.el-transfer-panel__list-groupname):hover {
      background-color: $--color-secondary;
    }
    .el-checkbox__input:hover:not(.is-disabled):not(.is-indeterminate):not(.is-checked){
      background: $--color-bg-4;
    }
    .el-checkbox__input{
      margin-left: -5px;
    }
    &.fixed-text {
      font-size: 14px;
      color: $--color-text-regular;
      &:first-child {
        margin-top: 8px;
      }
    }
  }

  .el-transfer-panel__header {
    height: $--transfer-panel-header-height;
    line-height: $--transfer-panel-header-height;
    background: $--transfer-panel-header-background-color;
    margin: 0;
    padding-left: 24px;
    border-bottom: $--border-1 solid $--transfer-border-color;
    box-sizing: border-box;
    display: flex;
    align-items: center;

    &-text {
      margin-left: 4px;
      color: $--color-primary;
    }

    .el-checkbox__input{
      margin-left: -5px;
    }

    .el-checkbox {
      display: block;
      line-height: $--transfer-panel-header-height;

      .el-checkbox__label {
        font-size: $--font-size-body-3;
        color: $--color-text-regular;
        font-weight: $--font-weight-400;
      }
    }
  }

  .el-transfer-panel__footer {
    height: $--transfer-panel-footer-height;
    background: $--color-white;
    margin: 0;
    padding: 0 24px;
    border-top: $--border-1 solid $--transfer-border-color;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: $--index-normal;
    @include utils-vertical-center;
    .el-pagination.is-background{
      span{
        color: $--color-text-regular;
      }
    }

    .el-checkbox {
      padding-left: 20px;
      color: $--color-text-regular;
    }
    .pafination-reset{
      position: absolute;
      // 覆盖范围大一点
      width: 40px;
      height: 26px;
      text-align: center;
      line-height: 26px;
      left: 65px;
      top: 2.5px;
      color: $--color-text-1;
      font-size: $--font-size-body-3;
      background:white;
    }
  }

  .el-checkbox__label {
    padding-left: 0;
  }

  .el-checkbox__inner {
    height: 14px;
    width: 14px;
    // border-radius: 3px;
    border-radius: $--border-radius-small;
  }

  .hasNoMatch{
    color: $--color-text-placeholder;
    position: absolute;
    margin: auto;
    top: 0; left: 0; bottom: 0; right: 0;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    vertical-align: center;
    span {
      width: 100%;
      display: inline-block;
    }
  }
}

@include b(transfer-view) {
  border: $--border-1 solid $--transfer-border-color;
  // border-radius: $--transfer-view-border-radius; 0 4px 4px 0
  border-radius: $--border-radius-none $--border-radius-medium $--border-radius-medium $--border-radius-none;
  overflow: hidden;
  background: $--color-white;
  display: inline-block;
  vertical-align: middle;
  width: 50%;
  max-width: $--transfer-panel-width;
  max-height: 100%;
  box-sizing: border-box;
  position: relative;
  font-size: $--font-size-base;


  @include e(body) {
    height: $--transfer-panel-body-height;
    overflow: hidden;

    @include when(with-footer) {
      padding-bottom: $--transfer-panel-footer-height;
    }

    p + p{
      margin-top: 0!important;
    }

    .scrollbar>.el-scrollbar__wrap>.el-scrollbar__view{
      p.el-transfer-view__empty {
        color: $--color-text-placeholder;
        position: absolute;
        margin: auto;
        top: 0; left: 0; bottom: 0; right: 0;
        width: 100%;
        text-align: center;
        display: flex;
        align-items: center;
        vertical-align: center;
        span {
          width: 100%;
          display: inline-block;
        }
        
      }
    }
  }

  @include e(list) {
    // margin: 8px 2px 0 0; // 滚动条先隐藏
    //margin-top: 8px;
    padding: 0;
    list-style: none;
    height: 100%;
    overflow: auto;
    box-sizing: border-box;
  }

  @include e(item) {
    height: $--transfer-item-height;
    line-height: $--transfer-item-height;
    color: $--color-text-regular;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;

    &:hover {
      background-color: $--color-secondary;
    }

    i:hover {
      // border-radius: 50%;
      border-radius: $--border-radius-circle;
      background-color: $--color-text-active;
    }

    @include m(icons) {
      display: flex;
      align-items: center;
      font-size: 0;
    }

    @include m(text) {
      font-size: $--font-size-base;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
      margin-right: 12px;

      .el-icon-dragable {
        font-size: $--font-size-title-1;
        color: $--color-text-secondary;
        margin-right: 8px;
        margin-left: 0;
      }
    }
  }

  .el-transfer-view__header {
    height: $--transfer-panel-header-height;
    line-height: $--transfer-panel-header-height;
    background: $--transfer-panel-header-background-color;
    margin: 0;
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: $--border-1 solid $--transfer-border-color;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: $--color-text-1;
    span{
      line-height: 22px;
    }
    &-text {
      margin-left: 4px;
      color: $--color-primary;
    }
  }

  .el-transfer-view__footer {
    height: $--transfer-panel-footer-height;
    background: $--color-white;
    margin: 0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: $--border-1 solid $--transfer-border-color;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: $--index-normal;
    @include utils-vertical-center;
    .el-pagination.is-background{
      span{
        color: $--color-text-regular;
      }
    }
    .pafination-reset{
      position: absolute;
      // 覆盖范围大一点
      width: 40px;
      height: 26px;
      text-align: center;
      line-height: 26px;
      left: 65px;
      top: 2.5px;
      color: $--color-text-1;
      font-size: $--font-size-body-3;
      background:white;
    }
  }
}
.el-transfer-view__filter_box,
.el-transfer-panel__filter_box {
  width: 100%;
 //display: flex;
}

.el-transfer-view__filter,
.el-transfer-panel__filter {
  text-align: center;
  padding: 16px 23px;
  box-sizing: border-box;
  display: block;
  // width: auto;

  .el-input__inner {
    height: $--transfer-filter-height;
    width: 100%;
    font-size: $--font-size-body-3;
    display: inline-block;
    box-sizing: border-box;
    // border-radius: 4px;
    border-radius: $--border-radius-medium;
    padding-right: 14px;
    padding-left: 12px;
  }
  .el-input__wrap{
    position: relative;
  }
}
