@import '../../style/themes/default.less';

.ele-basic-select {
  position: relative;
  cursor: pointer;

  .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled) .ant-input {
    cursor: pointer;
  }

  &:hover .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled) {
    border-color: @primary-color-hover;
  }

  // 箭头和清空图标
  .ele-select-clear,
  .ele-select-arrow {
    color: @disabled-color;
    font-size: 12px;
    vertical-align: 0;
    transition: color 0.3s ease;
  }

  .ele-select-clear:hover {
    color: @text-color-secondary;
  }

  &:not(:hover) .ele-select-clear,
  &:hover .ele-select-clear + .ele-select-arrow {
    display: none;
  }

  // 多选
  &.ele-select-multiple {
    padding: 2px 24px 2px 4px;

    & > .ant-input-affix-wrapper {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
    }
  }

  // 多选标签
  .ele-select-tags {
    display: flex;
    flex-wrap: wrap;
    min-height: 28px;
    position: relative;
    z-index: 1;
  }

  .ele-select-tag {
    flex: none;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: @select-multiple-item-height;
    line-height: (@select-multiple-item-height - 2px);
    padding: 0 (@padding-xs / 2) 0 @padding-xs;
    margin: @select-multiple-item-spacing-half @input-padding-vertical-base
      @select-multiple-item-spacing-half 0;
    background: @select-selection-item-bg;
    border: 1px solid @select-selection-item-border-color;
    border-radius: @border-radius-base;
    transition: font-size 0.3s, line-height 0.3s, height 0.3s;
    user-select: none;
    max-width: 100%;
    cursor: default;

    .ele-select-tag-text {
      margin-right: (@padding-xs / 2);
    }

    .ele-select-tag-close {
      color: @text-color-secondary;
      font-weight: bold;
      font-size: 10px;

      &:hover {
        color: @icon-color-hover;
      }
    }
  }

  .ant-input-affix-wrapper-disabled + .ele-select-tags {
    cursor: not-allowed;

    .ele-select-tag {
      color: @select-multiple-item-disabled-color;
      border-color: @select-multiple-item-disabled-border-color;
      cursor: not-allowed;
    }
  }
}
