amis/scss/components/form/_nested-select.scss
2020-04-20 11:33:06 +08:00

151 lines
3.1 KiB
SCSS

.#{$ns}NestedSelect {
display: inline-flex;
vertical-align: middle;
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;
$paddingY: (
$Form-selectOption-height - $Form-input-lineHeight * $Form-input-fontSize -
$Form-select-borderWidth * 2
)/2;
padding: $paddingY 0 $paddingY $Form-select-paddingX;
cursor: pointer;
color: $Form-select-color;
&.is-disabled {
color: $text--muted-color;
background: $Form-input-onDisabled-bg;
border-color: $Form-input-onDisabled-borderColor;
}
&.is-focused,
&.is-opened {
border-color: $Form-input-onFocused-borderColor;
// border-bottom: 0;
@if ($Form-select-onFocused-color !=$Form-select-color) {
color: $Form-select-onFocused-color;
}
}
&.is-opened {
.#{$ns}Select-arrow:before {
transform: rotate(180deg);
}
}
&:not(.is-disabled):hover {
background: $Form-select-onHover-bg;
}
&-placeholder {
color: $Form-select-placeholderColor;
line-height: $Form-input-lineHeight;
}
&-valueWrap {
user-select: none;
position: relative;
flex-grow: 1;
}
.#{$ns}Select-arrow {
position: absolute;
right: 0;
top: px2rem(10px);
}
&-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%);
}
}
&-optionArrowRight {
display: inline-block;
position: absolute;
right: px2rem(10px);
svg {
width: px2rem(12px);
height: px2rem(12px);
fill: $Form-input-iconColor;
}
}
&-menuOuter {
display: flex;
}
&-menu {
width: 160px;
max-width: 160px;
max-height: px2rem(300px);
background: $Form-select-menu-bg;
color: $Form-select-menu-color;
border: $Form-select-outer-borderWidth solid
$Form-input-onFocused-borderColor;
box-shadow: $Form-select-outer-boxShadow;
overflow-y: auto;
overflow-x: hidden;
&:not(:first-child) {
border-left: 0;
}
.#{$ns}NestedSelect-option {
position: relative;
padding-left: px2rem(10px);
height: $Form-input-height;
line-height: $Form-input-height;
cursor: pointer;
display: flex;
> label {
flex: 1;
cursor: pointer;
}
&.is-active {
color: $Form-select-menu-onActive-color;
background-color: $Form-select-menu-onActive-bg;
}
&:hover {
color: $Form-select-menu-onHover-color;
background-color: $Form-select-menu-onHover-bg;
}
&:hover > .#{$ns}NestedSelect-childrenOuter {
display: block;
}
.#{$ns}Checkbox {
display: inline-block;
padding-top: 0;
}
&.checkall {
border-bottom: px2rem(1px) solid #eceff8;
}
}
}
}