amis/scss/components/_result-box.scss

221 lines
4.5 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(5px);
min-height: var(--Form-input-height);
2020-05-14 20:47:05 +08:00
align-items: center;
border-radius: 3px;
position: relative;
&.is-clearable {
padding-right: px2rem(55px);
}
2020-05-14 20:47:05 +08:00
&.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;
}
&-pc-arrow {
height: 100%;
margin: auto 0;
position: absolute;
right: 10px;
display: flex;
align-items: center;
transition: transform var(--animation-duration) ease;
> svg {
width: px2rem(10px);
height: px2rem(10px);
top: 0.125em;
}
}
&.is-opened &-pc-arrow {
transform: rotate(180deg);
}
2020-05-14 20:47:05 +08:00
&-clear {
@include input-clear();
height: 100%;
padding: px2rem(4px);
margin: auto 0;
position: absolute;
right: 10px;
background-color: unset;
&-wrap {
width: px2rem(16px);
height: px2rem(16px);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
&-with-arrow {
right: 33px;
}
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;
2020-05-14 20:47:05 +08:00
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);
&.icon {
top: 0;
}
2020-05-15 16:47:08 +08:00
}
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;
2020-05-14 20:47:05 +08:00
}
> input {
padding-left: 8px;
min-height: 24px;
}
&.#{$ns}TransferDropDown {
padding: 0;
> .#{$ns}ResultBox-value {
background: var(--Form-select-value-bgColor);
&:hover {
background: var(--Form-selectValue-onHover-bgColor);
}
}
}
&.is-mobile {
min-height: calc(var(--Form-input-lineHeight) * var(--fontSizeLg));
border: none;
padding: 0;
font-size: var(--fontSizeLg);
border: none;
justify-content: flex-end;
.#{$ns}ResultBox-clear {
@include input-clear();
width: px2rem(26px);
height: px2rem(26px);
margin: 0 px2rem(-2px);
margin-left: auto;
padding: px2rem(4px);
position: unset;
right: 0;
display: flex;
align-items: center;
background-color: unset;
}
.#{$ns}ResultBox-arrow {
margin-right: var(--gap-xs);
// margin-left: var(--gap-xs);
width: var(--gap-md);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
margin-left: 4px;
> svg {
transition: transform var(--animation-duration);
display: inline-block;
color: var(--Form-select-caret-iconColor);
width: 10px;
height: 10px;
top: 0;
transform: rotate(-90deg);
}
}
}
2020-05-14 20:47:05 +08:00
}