123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421 |
- //@import '../theme/variables.scss';
- @import './variables.scss';
- @import './mixin.scss';
- $module: #{$prefix}-select;
- $single: #{$module}-single;
- $filterable: #{$module}-filterable;
- $multiple: #{$module}-multiple;
- .#{$module} {
- box-sizing: border-box;
- border-radius: $radius-select;
- border: $width-select-border solid $color-select-border-default;
- height: $height-select_default;
- font-weight: $font-select-fontWeight;
- background-color: $color-select-bg-default;
- // display: inline-block;
- display: inline-flex;
- vertical-align: middle;
- position: relative;
- outline: none;
- cursor: pointer;
- &:hover {
- background-color: $color-select-bg-hover;
- }
- &:active {
- background-color: $color-select-bg-active;
- }
- &:focus {
- border: $border-thickness-control-focus solid $color-select_default-border-focus;
- outline: 0;
- }
- &-small {
- height: $height-select_small;
- line-height: $height-select_small;
- }
- &-large {
- min-height: $height-select_large;
- line-height: $height-select_large;
- }
- &-open,
- &-focus {
- border: $border-thickness-control-focus solid $color-select_default-border-focus;
- outline: 0;
- &:hover {
- background-color: $color-select-bg-default;
- }
- }
-
- &-warning {
- background-color: $color-select_warning-bg-default;
- border-color: $color-select_warning-border-default;
- &:hover {
- background-color: $color-select_warning-bg-hover;
- border-color: $color-select_warning-border-hover;
- }
- &:focus {
- background-color: $color-select_warning-bg-focus;
- border-color: $color-select_warning-border-focus;
- }
- &:active {
- background-color: $color-select_warning-bg-active;
- border-color: $color-select_warning-border-active;
- }
- }
- &-error {
- background-color: $color-select_danger-bg-default;
- border-color: $color-select_danger-border-default;
- &:hover {
- background-color: $color-select_danger-bg-hover;
- border-color: $color-select_danger-border-hover;
- }
- &:focus {
- background-color: $color-select_danger-bg-focus;
- border-color: $color-select_danger-border-focus;
- }
- &:active {
- background-color: $color-select_danger-bg-active;
- border-color: $color-select_danger-border-active;
- }
- }
- &-disabled {
- cursor: not-allowed;
- background-color: $color-select_input_disabled-bg;
- // border: 1px solid $color-select_input_disabled-border;
- &:hover {
- background-color: $color-select_input_disabled-bg-hover;
- }
- &:focus {
- border: $border-thickness-control-focus solid $color-select_default-border-focus;
- }
- .#{$module}-selection,
- .#{$module}-selection-placeholder {
- color: $color-select_input_disabled-text;
- cursor: not-allowed;
- }
- .#{$module}-arrow,
- .#{$module}-prefix,
- .#{$module}-suffix {
- color: $color-select_input_disabled-text;
- }
- .#{$prefix}-tag {
- color: $color-select_input_disabled-text;
- background-color: transparent;
- }
- }
- &-selection {
- @include font-size-regular;
- height: 100%;
- display: flex;
- align-items: center;
- flex-grow: 1;
- overflow: hidden;
- margin-left: $spacing-select_selection-marginLeft;
- // margin-right: $width-select_icon_right;
- cursor: pointer;
- color: $color-select_main-text-default;
- &-text {
- // display: inline-flex;
- // align-items: center;
- // height: 100%;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- &-inactive {
- display: flex;
- opacity: $opacity-select_selection_text_inactive;
- }
- &-hide {
- display: none;
- }
- }
- &-placeholder {
- color: $color-select_input_placeholder-text;
- }
- .#{$prefix}-tag {
- &:nth-of-type(1) {
- margin-left: 0;
- }
- @include select-tag-margin;
- }
- .#{$prefix}-tag-group {
- height: inherit;
- .#{$prefix}-tag {
- @include select-tag-margin;
- }
- }
- }
- &-content-wrapper {
- white-space: nowrap;
- overflow: hidden;
- display: flex;
- align-items: center;
- height: 100%;
- }
- &-multiple {
- // 这里要设置为 auto,可能存在换行
- height: auto;
- .#{$module}-selection {
- margin-left: $spacing-select_multiple_selection-marginLeft;
- // &-placeholder {
- // padding-left: $spacing-base-tight - $spacing-extra-tight;
- // }
- }
- .#{$module}-content-wrapper {
- width: 100%;
- min-height: $height-select_multiple_content_wrapper-minHeight;
- flex-wrap: wrap;
- &-empty {
- margin-left: $spacing-select_multiple_content_wrapper_empty-marginLeft;
- }
- .#{$prefix}-tag-group {
- display: flex;
- align-items: center;
- }
- &-one-line {
- flex-wrap: nowrap;
- .#{$prefix}-tag-group {
- flex-wrap: nowrap;
- justify-content: flex-start;
- overflow: hidden;
- flex-shrink: 0;
- }
- }
- }
- .#{$module}-inline-label-wrapper {
- flex-shrink: 0;
- }
- }
- &-multiple.#{$module}-large {
- .#{$module}-content-wrapper {
- min-height: $height-select_large - 2;
- }
- }
- &-multiple.#{$module}-small {
- .#{$module}-content-wrapper {
- min-height: $height-select_small - 2;
- }
- }
- &-arrow {
- display: flex;
- align-items: center;
- justify-content: center;
- width: $width-select_arrow;
- color: $color-select-icon-default;
- flex-shrink: 0;
- &-empty {
- // 不显示arrow时,右侧留出12px空白
- display: flex;
- width: $width-select_arrow_empty;
- }
- }
- &-prefix,
- &-suffix {
- @include all-center;
- &-text {
- margin: $spacing-select_prefix_suffix_text-marginY $spacing-select_prefix_suffix_text-marginX;
- }
- &-icon {
- color: $color-select-icon-default;
- margin: $spacing-select_prefix_suffix_icon-marginY $spacing-select_prefix_suffix_icon-marginX;
- }
- }
- &-suffix {
- @include all-center;
- }
- &-clear {
- @include all-center;
- width: $width-select_clear-icon;
- color: $color-select_clearBtn-text-default;
- flex-shrink: 0;
- &:hover {
- color: $color-select_clearBtn-text-hover;
- }
- }
- &-inset-label-wrapper {
- display: inline;
- }
- &-inset-label {
- margin-right: $spacing-base-tight;
- font-weight: $font-select_inset_label-fontWeight;
- @include font-size-regular;
- color: $color-select_inset_label-text;
- flex-shrink: 0;
- white-space: nowrap;
- }
- &-create-tips {
- color: $color-select_create_tips-text;
- margin-right: $spacing-select_create_tips-marginRight;
- }
- }
- .#{$module}-with-prefix {
- .#{$module}-selection {
- margin-left: 0;
- }
- }
- // 单选且可输入
- .#{$single}.#{$filterable} {
- .#{$module}-content-wrapper {
- flex-grow: 1;
- height: 100%;
- overflow: hidden;
- position: relative;
- }
- .#{$prefix}-input-wrapper {
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- border: none;
- background-color: transparent;
- }
- .#{$prefix}-input-wrapper-focus {
- border: none;
- }
- .#{$prefix}-input {
- padding-left: 0;
- padding-right: 0;
- height: 100%; // 自定义renderSelectedItem时,Select的整体高度可能不是默认的32px
- }
- }
- // 多选且可输入
- .#{$multiple}.#{$filterable} {
- .#{$module}-content-wrapper {
- flex-grow: 1;
- height: 100%;
- overflow: hidden;
- position: relative;
- &-empty {
- .#{$prefix}-input-wrapper {
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- }
- }
- }
- .#{$prefix}-input-wrapper {
- // position: absolute;
- // top: 0;
- // left: 0;
- height: 100%;
- width: 100%;
- border: none;
- background-color: transparent;
- }
- .#{$prefix}-input-wrapper-focus {
- border: none;
- }
- .#{$prefix}-input {
- padding-left: 0;
- padding-right: 0;
- }
- }
- .#{$module}-option-list {
- overflow-x: hidden;
- overflow-y: auto;
- &-chosen {
- .#{$module}-option-icon {
- display: flex;
- }
- }
- }
- .#{$module}-group {
- color: $color-select_group-text;
- padding-top: $spacing-select_group-paddingTop;
- margin-top: $spacing-select_group-marginTop;
- padding-bottom: $spacing-select_group-paddingBottom;
- padding-left: $spacing-select_group-paddingLeft;
- padding-right: $spacing-select_group-paddingRight;
- @include font-size-small;
- cursor: default;
- // &:nth-of-type(1) {
- // margin-top: $spacing-extra-tight;
- // }
- &:not(:nth-of-type(1)) {
- border-top: $width-select_group_top-border solid $color-select_option-border-default;
- }
- }
- .#{$module}-loading-wrapper {
- padding-left: $spacing-select_loading_wrapper-paddingLeft;
- padding-right: $spacing-select_loading_wrapper-paddingRight;
- padding-top: $spacing-select_loading_wrapper-paddingTop;
- padding-bottom: $spacing-select_loading_wrapper-paddingBottom;
- cursor: not-allowed;
- }
- @import './rtl.scss';
|