@import "mixins/mixins";
@import "mixins/utils";
@import "common/var";
@import "select-dropdown";
@import "input";
@import "tag";
@import "option";
@import "option-group";
@import "scrollbar";

@include b(select) {
  display: inline-block;
  position: relative;

  .el-select__tags  {
    padding: 0 4px;
    > span {
      display: contents;
    }
  }

  // hover状态下边框颜色
  &:hover {
    .el-input__inner {
      border-color: $--select-input-border-color-hover;
    }
  }

  // 搜索框 input 样式
  .el-input__inner {
    height: $--select-height;
    line-height: $--select-height;
    padding: 0 10px;
    cursor: pointer;
    padding-right: 35px;
    border-radius: $--select-border-radius;
    color: $--select-font-color;

    // 选中结束后 搜索框focus样式
    &:focus {
      border-color: $--select-input-border-color;
      box-shadow: none;
    }
  }

  // 搜索框
  .el-input {
    // 搜索框 icon
    & .el-select__caret {
      color: $--select-input-arrow-color;
      font-size: $--select-input-arrow-size;
      transition: transform 0.3s;
      transform: rotateZ(180deg) scale(.5);
      cursor: pointer;
      line-height: $--select-height;
      display: flex;
      align-items: center;
      justify-content: center;
      &.el-icon-error {
        color: $--input-clear-color;
        cursor: pointer;
        font-size: 32px;
        &:hover {
          color: $--input-clear-color-hover;
        }
      }
      @include when(reverse) {
        transform: rotateZ(0deg) scale(.5);
      }
    }

    // 搜索框禁用情况
    &.is-disabled {
      & .el-input__inner {
        cursor: not-allowed;
        border-color: $--select-input-border-color-disabled;

        &:hover {
          border-color: $--select-input-border-color-disabled;
        }
      }
      & .el-input__icon{
        color: $--select-input-arrow-color-disabled;
      }
    }

    // focus 状态下输入框样式 边框 + 阴影
    &.is-focus {
      border-color: $--select-input-border-color-focus;
      box-shadow: $--select-input-box-shadow-focus;
      border-radius: $--select-border-radius;
      .el-input__inner {
        box-shadow: $--select-input-box-shadow-focus;
        border-radius: $--select-border-radius;
        border-color: $--select-input-border-color-focus;
      }
    }
  }

  > .el-input {
    display: block;
  }

  // 远程搜索输入框
  @include e(input) {
    border: none;
    outline: none;
    padding: 0;
    margin-left: 8px;              // Prevalue：11px
    color: $--select-font-color;
    font-size: $--select-font-size;
    appearance: none;
    height: $--select-height;
    line-height: $--select-height;
    background-color: transparent;
    @include when(small) {
      height: $--select-height-small;
      line-height: $--select-height-small;
    }
  }

  // 选中标签样式
  @include e(tags) {
    position: absolute;
    line-height: normal;
    white-space: normal;
    z-index: $--index-normal;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  .el-tag {
    margin: 2px;
    background-color: $--select-option-bg-color-hover;
    border: none;
    color: $--select-font-color;
    border-radius: 4px;
  }

  // 小号搜索框样式
  @include m(small) {
    height: $--select-height-small;
    .el-input--mini .el-input__inner {
      height: $--select-height-small;
      line-height: $--select-height-small;
    }
    .el-input {
      & .el-select__caret {
        line-height: $--select-height-small;
        &.el-icon-error {
          font-size: 28px;
        }
      }
    }
  }
}
