amis/scss/components/_result-box.scss

130 lines
2.6 KiB
SCSS
Raw Normal View History

2020-05-14 20:47:05 +08:00
.#{$ns}ResultBox {
@include input-input();
@include input-border();
2020-05-14 20:47:05 +08:00
flex-wrap: wrap;
padding: 0 px2rem(3px);
min-height: var(--Form-input-height);
2020-05-14 20:47:05 +08:00
align-items: center;
&.is-error {
border-color: var(--Form-input-onError-borderColor);
background: var(--Form-input-onError-bg);
2020-05-14 20:47:05 +08:00
}
2020-07-03 17:11:32 +08:00
&.is-focused,
2020-08-14 17:45:59 +08:00
&.is-active,
2020-07-03 17:11:32 +08:00
&:focus {
outline: none;
border-color: var(--Form-input-onFocused-borderColor);
box-shadow: var(--Form-input-boxShadow);
background: var(--Form-input-onFocused-bg);
2020-05-14 20:47:05 +08:00
}
2020-07-15 20:15:38 +08:00
&.is-clickable:not(.is-disabled) {
2020-06-12 14:39:21 +08:00
cursor: pointer;
&:hover {
border-color: var(--Form-input-onFocused-borderColor);
box-shadow: var(--Form-input-boxShadow);
background: var(--Form-input-onFocused-bg);
2020-06-12 14:39:21 +08:00
}
}
2020-05-14 20:47:05 +08:00
&.is-error.is-focused {
border-color: var(--Form-input-onError-borderColor);
2020-05-14 20:47:05 +08:00
}
&.is-disabled {
color: var(--text--muted-color);
background: var(--Form-input-onDisabled-bg);
border-color: var(--Form-input-onDisabled-borderColor);
pointer-events: none;
2020-05-14 20:47:05 +08:00
}
&-singleValue {
padding: 0 calc(var(--Form-input-paddingX) - #{px2rem(3px)});
2021-09-29 19:32:31 +08:00
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
2020-05-14 20:47:05 +08:00
&-clear {
@include input-clear();
2020-05-15 16:47:08 +08:00
width: px2rem(26px);
height: px2rem(26px);
margin: 0 px2rem(-2px);
2020-07-09 17:07:50 +08:00
margin-left: auto;
2020-05-15 16:47:08 +08:00
&:hover {
background: var(--ResultBox-value-bg);
2020-05-15 16:47:08 +08:00
}
> svg {
width: px2rem(12px);
height: px2rem(12px);
}
2020-05-14 20:47:05 +08:00
}
> svg {
display: inline-block;
2020-05-15 16:47:08 +08:00
width: px2rem(14px);
color: var(--icon-color);
2020-05-14 20:47:05 +08:00
}
> a {
cursor: pointer;
}
&-value {
background: var(--ResultBox-value-bg);
color: var(--ResultBox-value-color);
font-size: var(--Form-input-fontSize);
padding: 0 var(--gap-xs);
2020-05-15 16:47:08 +08:00
min-height: px2rem(24px);
2020-05-14 20:47:05 +08:00
flex-wrap: nowrap;
display: inline-flex;
align-items: center;
margin: 2px 3px;
user-select: none;
> a {
cursor: pointer;
margin-left: var(--gap-xs);
color: var(--ResultBox-icon-color);
2020-05-14 20:47:05 +08:00
&:hover {
color: var(--ResultBox-icon--onHover-color);
2020-05-14 20:47:05 +08:00
}
2020-05-15 16:47:08 +08:00
> svg {
width: px2rem(10px);
height: px2rem(10px);
}
2020-05-14 20:47:05 +08:00
}
&:hover {
background: var(--ResultBox-value--onHover-bg);
2020-05-14 20:47:05 +08:00
}
&.is-disabled {
pointer-events: none;
color: var(--ResultBox-value--onDisabled-color);
2020-05-14 20:47:05 +08:00
> a {
color: var(--ResultBox-icon--onDisabled-color);
2020-05-14 20:47:05 +08:00
}
}
}
&-placeholder {
color: var(--Form-input-placeholderColor);
2020-05-14 20:47:05 +08:00
user-select: none;
margin-left: 8px;
}
> input {
padding-left: 8px;
min-height: 24px;
}
}