2019-04-30 11:11:25 +08:00
|
|
|
.#{$ns}Select {
|
|
|
|
display: inline-flex;
|
|
|
|
vertical-align: middle;
|
2019-06-26 17:57:23 +08:00
|
|
|
text-align: left;
|
2019-04-30 11:11:25 +08:00
|
|
|
outline: none;
|
|
|
|
position: relative;
|
|
|
|
border: $Form-select-borderWidth solid $Form-select-borderColor;
|
|
|
|
background: $Form-select-bg;
|
|
|
|
border-radius: $Form-select-borderRadius;
|
|
|
|
height: $Form-selectOption-height;
|
2019-11-08 10:26:21 +08:00
|
|
|
$paddingY: ($Form-selectOption-height - $Form-input-lineHeight * $Form-input-fontSize - $Form-select-borderWidth * 2)/2;
|
2019-04-30 11:11:25 +08:00
|
|
|
padding: $paddingY 0 $paddingY $Form-select-paddingX;
|
|
|
|
cursor: pointer;
|
|
|
|
color: $Form-select-color;
|
|
|
|
|
2019-08-26 15:08:26 +08:00
|
|
|
&:hover {
|
2019-04-30 11:11:25 +08:00
|
|
|
background: $Form-select-onHover-bg;
|
2019-08-12 21:14:33 +08:00
|
|
|
border-color: $Form-select-onHover-borderColor;
|
|
|
|
|
|
|
|
.#{$ns}Select-arrow:before {
|
|
|
|
color: $Form-select-caret-onHover-iconColor;
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&.is-disabled {
|
|
|
|
color: $text--muted-color;
|
|
|
|
background: $Form-input-onDisabled-bg;
|
|
|
|
border-color: $Form-input-onDisabled-borderColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-valueWrap {
|
|
|
|
user-select: none;
|
|
|
|
position: relative;
|
|
|
|
flex-grow: 1;
|
|
|
|
line-height: 1;
|
2019-06-03 09:58:42 +08:00
|
|
|
max-width: 100%;
|
2019-06-04 17:09:40 +08:00
|
|
|
overflow: hidden;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placeholder {
|
|
|
|
color: $Form-select-placeholderColor;
|
|
|
|
line-height: $Form-input-lineHeight;
|
2019-08-26 15:12:21 +08:00
|
|
|
user-select: none;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
|
|
&-value {
|
|
|
|
line-height: $Form-input-lineHeight * $Form-input-fontSize;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--searchable {
|
2019-11-08 10:26:21 +08:00
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
.#{$ns}Select-placeholder,
|
|
|
|
.#{$ns}Select-value {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&--multi {
|
|
|
|
height: auto;
|
|
|
|
min-height: $Form-selectOption-height;
|
|
|
|
|
|
|
|
.#{$ns}Select-valueWrap {
|
|
|
|
margin-bottom: -$gap-xs;
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
>input {
|
2019-04-30 11:11:25 +08:00
|
|
|
display: inline-block;
|
|
|
|
width: px2rem(100px);
|
|
|
|
margin-bottom: $gap-xs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
.#{$ns}Select-values+.#{$ns}Select-input {
|
2019-04-30 11:11:25 +08:00
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Select-value {
|
|
|
|
position: static;
|
|
|
|
user-select: none;
|
2019-11-08 10:26:21 +08:00
|
|
|
line-height: $Form-input-lineHeight * $Form-input-fontSize - px2rem(2px);
|
2019-04-30 11:11:25 +08:00
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
|
|
|
font-size: $Form-selectValue-fontSize;
|
|
|
|
color: $Form-selectValue-color;
|
|
|
|
background: $Form-selectValue-bg;
|
|
|
|
border: px2rem(1px) solid $Form-selectValue-borderColor;
|
|
|
|
border-radius: px2rem(2px);
|
|
|
|
margin-right: $gap-xs;
|
|
|
|
margin-bottom: $gap-xs;
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Select-valueLabel {
|
|
|
|
padding: 0 $gap-xs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-valueIcon {
|
|
|
|
cursor: pointer;
|
|
|
|
border-right: px2rem(1px) solid $Form-selectValue-borderColor;
|
|
|
|
padding: 1px 5px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: darken($Form-selectValue-bg, 5%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-arrow {
|
|
|
|
margin-right: $gap-xs;
|
2019-09-05 00:07:41 +08:00
|
|
|
// margin-left: $gap-xs;
|
2019-04-30 11:11:25 +08:00
|
|
|
width: px2rem(20px);
|
|
|
|
text-align: center;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
line-height: 1;
|
|
|
|
|
|
|
|
&:before {
|
2019-05-15 16:10:20 +08:00
|
|
|
transition: transform 0.3s;
|
2019-04-30 11:11:25 +08:00
|
|
|
content: $Form-select-caret-icon;
|
|
|
|
font-family: $Form-select-caret-vender;
|
|
|
|
font-size: $Form-select-caret-fontSize;
|
|
|
|
display: inline-block;
|
|
|
|
color: $Form-select-caret-iconColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-opened &-arrow:before {
|
|
|
|
transform: rotate(180deg);
|
|
|
|
}
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
// &-menuOuter {
|
|
|
|
// position: absolute;
|
|
|
|
// background: $Form-select-menu-bg;
|
|
|
|
// color: $Form-select-menu-color;
|
|
|
|
// border: $Form-select-outer-borderWidth solid $Form-input-onFocused-borderColor;
|
|
|
|
// left: px2rem(-1px);
|
|
|
|
// right: px2rem(-1px);
|
|
|
|
// min-width: 100%;
|
|
|
|
// top: $Form-select-outer-top;
|
|
|
|
// z-index: 10;
|
|
|
|
// box-shadow: $Form-select-outer-boxShadow;
|
|
|
|
// }
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
|
|
&-menu {
|
|
|
|
max-height: px2rem(300px);
|
|
|
|
overflow: auto;
|
2019-05-23 16:08:53 +08:00
|
|
|
user-select: none;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
&-input {
|
|
|
|
cursor: pointer;
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
margin: 0 $Form-select-paddingX;
|
|
|
|
padding: ($Form-input-height - $Form-input-lineHeight * $Form-input-fontSize)/2 0;
|
|
|
|
line-height: $Form-input-lineHeight;
|
|
|
|
border-bottom: 1px solid $borderColor;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-05-27 12:22:01 +08:00
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
>svg {
|
|
|
|
fill: #999;
|
|
|
|
width: px2rem(14px);
|
2019-11-08 14:23:56 +08:00
|
|
|
min-width: px2rem(14px);
|
2019-11-08 10:26:21 +08:00
|
|
|
height: px2rem(14px);
|
|
|
|
margin-right: px2rem(5px);
|
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
>input {
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
flex-grow: 1;
|
|
|
|
background: transparent;
|
|
|
|
font-size: px2rem(12px);
|
2019-05-27 12:22:01 +08:00
|
|
|
}
|
2019-05-19 11:45:40 +08:00
|
|
|
}
|
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
&-option {
|
2019-11-08 10:26:21 +08:00
|
|
|
cursor: pointer;
|
2019-11-08 16:20:50 +08:00
|
|
|
min-width: px2rem(150px);
|
2019-11-08 10:26:21 +08:00
|
|
|
padding: ($Form-select-menu-height - $Form-input-lineHeight * $Form-input-fontSize)/2 $Form-select-paddingX;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
&.is-active {
|
|
|
|
color: $Form-select-menu-onActive-color;
|
|
|
|
background-color: $Form-select-menu-onActive-bg;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-highlight {
|
|
|
|
color: $Form-select-menu-onHover-color;
|
|
|
|
background-color: $Form-select-menu-onHover-bg;
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
&.is-disabled {
|
|
|
|
color: $Form-select-menu-onDisabled-color;
|
|
|
|
background-color: $Form-select-menu-onDisabled-bg;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--placeholder {
|
|
|
|
color: $Form-input-placeholderColor;
|
|
|
|
}
|
2019-11-08 10:26:21 +08:00
|
|
|
|
|
|
|
>label {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
>a {
|
|
|
|
float: right;
|
|
|
|
margin-left: px2rem(5px);
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-highlight>a {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-noResult {
|
|
|
|
color: $Form-select-placeholderColor;
|
|
|
|
line-height: $Form-input-lineHeight;
|
|
|
|
user-select: none;
|
|
|
|
margin: 5px 0 0;
|
|
|
|
padding: ($Form-select-menu-height - $Form-input-lineHeight * $Form-input-fontSize)/2 $Form-select-paddingX;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-option-hl {
|
|
|
|
color: $red;
|
|
|
|
}
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
&-addBtn {
|
|
|
|
display: block;
|
|
|
|
cursor: pointer;
|
|
|
|
padding: ($Form-select-menu-height - $Form-input-lineHeight * $Form-input-fontSize)/2 $Form-select-paddingX;
|
|
|
|
|
|
|
|
>svg {
|
|
|
|
width: px2rem(14px);
|
|
|
|
height: px2rem(14px);
|
|
|
|
margin-right: $Checkbox-gap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
&.is-focused,
|
|
|
|
&.is-opened {
|
|
|
|
border-color: $Form-input-onFocused-borderColor;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
|
|
@if ($Form-select-onFocused-color !=$Form-select-color) {
|
2019-04-30 11:11:25 +08:00
|
|
|
color: $Form-select-onFocused-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-spinner {
|
|
|
|
line-height: $Form-input-lineHeight * $Form-input-fontSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-clear {
|
|
|
|
padding: px2rem(3px);
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
|
|
|
|
|
|
svg {
|
|
|
|
fill: $Form-input-iconColor;
|
|
|
|
width: px2rem(10px);
|
|
|
|
height: px2rem(10px);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover svg {
|
|
|
|
fill: darken($color: $Form-input-iconColor, $amount: 20%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Select-popover {
|
2019-11-08 10:26:21 +08:00
|
|
|
margin-top: px2rem(2px);
|
2019-04-30 11:11:25 +08:00
|
|
|
background: $Form-select-menu-bg;
|
|
|
|
color: $Form-select-menu-color;
|
2019-11-08 10:26:21 +08:00
|
|
|
border: $Form-select-outer-borderWidth solid $Form-input-onFocused-borderColor;
|
2019-04-30 11:11:25 +08:00
|
|
|
box-shadow: $Form-select-outer-boxShadow;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
min-width: px2rem(100px);
|
2019-11-08 10:26:21 +08:00
|
|
|
z-index: 2;
|
|
|
|
|
|
|
|
&.#{$ns}PopOver--leftTopLeftBottom {
|
|
|
|
margin-top: px2rem(-2px);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-11-08 10:26:21 +08:00
|
|
|
.#{$ns}SelectControl:not(.is-inline)>.#{$ns}Select {
|
2019-04-30 11:11:25 +08:00
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 需要能撑开
|
|
|
|
@include media-breakpoint-up(sm) {
|
2019-11-08 10:26:21 +08:00
|
|
|
|
|
|
|
.#{$ns}Form-control--sizeXs>.#{$ns}Select,
|
|
|
|
.#{$ns}Form-control--sizeSm>.#{$ns}Select,
|
|
|
|
.#{$ns}Form-control--sizeMd>.#{$ns}Select,
|
|
|
|
.#{$ns}Form-control--sizeLg>.#{$ns}Select {
|
2019-04-30 11:11:25 +08:00
|
|
|
min-width: 100%;
|
|
|
|
display: inline-flex !important;
|
|
|
|
}
|
2019-11-08 10:26:21 +08:00
|
|
|
}
|