@import '../../styles/default.scss';

.#{$pkg-prefix}-select.ant-select {
  box-shadow: none !important;

  &.ant-select-disabled {
    .ant-select-selector {
      border-color: $disabled-border-color;
      background-color: $disabled-bg-color;
    }
  }

  &.#{$pkg-prefix}-select-underlined {
    &.ant-select {
      width: 100%;

      .ant-select-selector {
        border: none;
        box-shadow: unset !important;
        // padding-left: 0px !important;
        border-bottom: 1px solid #e1e1e1;
        border-radius: 0;
  
        .ant-select-selection-search {
          left: 0px;
        }
      }
  
      &:focus {
        border-color: $active-color;
        box-shadow: none $active-color;
      }

      &.ant-select-disabled {
        .ant-select-selector {
          background-color: transparent;
          border-bottom: 1px dashed #e1e1e1;
        }
        
      }
    }
  
  }

  &.ant-select:not(.ant-select-disabled):hover .ant-select-selector,
  &.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
    border-color: $active-color;
    box-shadow: none;
  }

  &.#{$pkg-prefix}-select-summary {
    .ant-select-selection-overflow-item-rest {

      .ant-select-selection-item {
        background-color: transparent;
        border-color: transparent;
      }
    }
  }

  &.#{$pkg-prefix}-select-nointeraction {
    &.ant-select-disabled {
      .ant-select-selector {
        color: unset;
        background-color: unset;
        cursor: default;

        input {
          cursor: default;
        }
      }
    }
  }
}

.#{$pkg-prefix}-select-sortable {
  .ant-select-item {
    padding: 0;
  }
}

.#{$pkg-prefix}-select-dropdown {
  &.#{$pkg-prefix}-select-options-wrap {
    .ant-select-item-option {
      padding: 0;
    }
  }

  .ant-select-item {
    color: #555;
    // padding: 0;
    // height: 32px;
    // line-height: 32px;

    &.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
      background-color: $hover-color;
    }

    &.ant-select-item-option-selected {
      background-color: transparent;
      color: $active-color;
      font-weight: normal;

      .ant-select-item-option-state {
        display: none;
      }
    }
  }

  .#{$pkg-prefix}-select-option-wrap {
    flex: 1;
    display: flex;
    padding: 0 24px 0 12px;
    line-height: 32px;
    height: 32px;

    .ant-checkbox-checked .ant-checkbox-inner {
      color: $active-color;
      border-color: $active-color;
      background-color: $active-color;
    }

    &:hover {
      background-color: $hover-color;
    }
  }

  .#{$pkg-prefix}-select-option-check {
    margin-right: 8px;
    flex-shrink: 0;
  }

  .#{$pkg-prefix}-select-option-label {
    flex: 1;
    width: 1px; // TODO: 这个是为了让ellipsis生效
    @extend .#{$pkg-prefix}-ellipsis;
  }

  .#{$pkg-prefix}-select-option-dragsource {
    cursor: move;
    flex-shrink: 0;
    margin-left: 8px;
  }
}
