2020-05-26 20:28:09 +08:00
|
|
|
.#{$ns}SearchBox {
|
|
|
|
display: inline-flex;
|
|
|
|
flex-direction: row;
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
line-height: var(--Form-input-lineHeight);
|
|
|
|
font-size: var(--Form-input-fontSize);
|
2020-05-26 20:28:09 +08:00
|
|
|
flex-wrap: nowrap;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
height: 30px;
|
|
|
|
width: 30px;
|
2022-05-18 10:03:56 +08:00
|
|
|
padding-left: 8px;
|
2020-05-26 20:28:09 +08:00
|
|
|
|
2021-01-04 16:45:43 +08:00
|
|
|
transition: all var(--animation-duration) ease-in-out;
|
2020-12-21 10:08:40 +08:00
|
|
|
border: var(--Form-input-borderWidth) solid transparent;
|
|
|
|
border-radius: var(--Form-input-borderRadius);
|
2022-05-18 10:03:56 +08:00
|
|
|
overflow: hidden;
|
2020-05-26 20:28:09 +08:00
|
|
|
|
|
|
|
&:hover {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--Form-input-onHover-bg);
|
2020-05-26 20:28:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&.is-active {
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--Form-input-bg);
|
|
|
|
border: var(--Form-input-borderWidth) solid var(--Form-input-borderColor);
|
2022-07-11 17:01:19 +08:00
|
|
|
width: var(--SearchBox-width);
|
2020-05-26 20:28:09 +08:00
|
|
|
> input {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
2022-05-18 10:03:56 +08:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border-color: var(--SearchBox-hover-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-focused {
|
|
|
|
border-color: var(--SearchBox-focus-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-searchBtn {
|
2022-07-11 17:01:19 +08:00
|
|
|
display: inline-block;
|
|
|
|
padding: #{px2rem(5px)} #{px2rem(10px)};
|
2022-05-18 10:03:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-activeBtn,
|
|
|
|
&-cancelBtn {
|
|
|
|
margin-right: 8px;
|
2020-05-26 20:28:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-activeBtn,
|
2020-11-05 12:36:09 +08:00
|
|
|
&-searchBtn,
|
2020-05-26 20:28:09 +08:00
|
|
|
&-cancelBtn {
|
|
|
|
cursor: pointer;
|
2022-05-18 10:03:56 +08:00
|
|
|
color: var(--SearchBox-search-icon-color);
|
2020-05-26 20:28:09 +08:00
|
|
|
|
|
|
|
&:hover {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--icon-onHover-color);
|
2020-05-26 20:28:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-05 12:36:09 +08:00
|
|
|
&.is-disabled &-activeBtn,
|
|
|
|
&.is-disabled &-searchBtn,
|
|
|
|
&.is-disabled &-cancelBtn {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--icon-onDisabled-color);
|
2020-11-05 12:36:09 +08:00
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2022-05-18 10:03:56 +08:00
|
|
|
&.is-disabled {
|
|
|
|
background-color: var(--SearchBox-disabled-color);
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border-color: var(--Form-input-borderColor);
|
|
|
|
}
|
|
|
|
|
|
|
|
> input {
|
|
|
|
cursor: not-allowed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-26 20:28:09 +08:00
|
|
|
> input {
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
background: transparent;
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Form-input-color);
|
2020-05-26 20:28:09 +08:00
|
|
|
|
|
|
|
width: 0;
|
2020-12-21 10:08:40 +08:00
|
|
|
height: calc(var(--Form-input-lineHeight) * var(--Form-input-fontSize));
|
2020-05-26 20:28:09 +08:00
|
|
|
|
|
|
|
&::placeholder {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Form-input-placeholderColor);
|
2020-05-26 20:28:09 +08:00
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-18 10:03:56 +08:00
|
|
|
&-clearable {
|
|
|
|
display: flex;
|
|
|
|
width: var(--SearchBox-clearable-icon-size);
|
|
|
|
height: var(--SearchBox-clearable-icon-size);
|
|
|
|
color: var(--SearchBox-clearable-icon-color);
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--Form-input-clearBtn-color-onHover);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-26 20:28:09 +08:00
|
|
|
height: 30px;
|
2022-05-18 10:03:56 +08:00
|
|
|
|
|
|
|
&--enhance.is-active &-searchBtn {
|
|
|
|
height: 100%;
|
|
|
|
color: var(--SearchBox-enhonce-icon-color);
|
|
|
|
background: var(--SearchBox-hover-color);
|
2022-07-26 21:05:36 +08:00
|
|
|
|
|
|
|
&:hover {
|
2022-10-19 10:38:52 +08:00
|
|
|
background: var(--button-primary-hover-bg-color);
|
2022-07-26 21:05:36 +08:00
|
|
|
}
|
2022-05-18 10:03:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&--enhance &-clearable {
|
|
|
|
margin-right: var(--SearchBox-enhonce-clearable-gap);
|
|
|
|
}
|
|
|
|
|
|
|
|
&--enhance.is-active.is-disabled &-searchBtn {
|
|
|
|
background: var(--SearchBox-enhonce-disabled-color);
|
|
|
|
color: var(--SearchBox-enhonce-disabled-search-color);
|
|
|
|
}
|
2020-05-26 20:28:09 +08:00
|
|
|
}
|
2022-07-11 17:01:19 +08:00
|
|
|
|
|
|
|
.#{$ns}SearchBox-history {
|
|
|
|
& > .is-history {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}SearchBox-history-dropdown {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
z-index: 998;
|
|
|
|
padding: var(--gap-sm) 0;
|
|
|
|
width: 100%;
|
|
|
|
max-width: var(--SearchBox-history-dropdown-maxWidth);
|
|
|
|
min-height: #{px2rem(72px)};
|
|
|
|
max-height: var(--SearchBox-history-dropdown-maxHeight);
|
|
|
|
background: var(--white);
|
|
|
|
border: var(--borderWidth) solid var(--borderColor);
|
|
|
|
border-top: none;
|
|
|
|
border-radius: var(--borderRadius);
|
|
|
|
box-shadow: var(--boxShadow);
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
&.is-active {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
header {
|
|
|
|
display: flex;
|
|
|
|
flex-flow: row nowrap;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
padding: 0 var(--gap-md);
|
|
|
|
margin-bottom: #{px2rem(10px)};
|
|
|
|
|
|
|
|
h4 {
|
|
|
|
font-size: var(--fontSizeBase);
|
|
|
|
height: #{px2rem(24px)};
|
|
|
|
line-height: #{px2rem(24px)};
|
|
|
|
font-weight: bold;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
display: inline-block;
|
|
|
|
font-size: var(--fontSizeSm);
|
|
|
|
cursor: pointer;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}SearchBox-history-content {
|
|
|
|
display: flex;
|
|
|
|
flex-flow: row wrap;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0 var(--gap-md);
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: auto;
|
|
|
|
max-height: calc(
|
|
|
|
var(--SearchBox-history-dropdown-maxHeight) - 38px - var(--gap-sm) * 2
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}SearchBox-history-tag {
|
|
|
|
display: inlin-flex;
|
|
|
|
height: var(--Tag-height);
|
|
|
|
padding: 0 var(--gap-sm);
|
|
|
|
flex-flow: row nowrap;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
font-size: var(--Tag-content-fontSize);
|
|
|
|
max-width: 160px;
|
|
|
|
border-radius: var(--Tag-borderRadius);
|
|
|
|
background-color: var(--Tag-default-color);
|
|
|
|
color: var(--Tag-fontColor);
|
|
|
|
margin-bottom: var(--gap-sm);
|
|
|
|
margin-right: var(--gap-sm);
|
|
|
|
max-width: 96px;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
&-text {
|
|
|
|
display: inline-block;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
line-height: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-close {
|
|
|
|
margin-left: var(--gap-sm);
|
|
|
|
margin-right: var(--gap-xs);
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
i {
|
|
|
|
font-size: #{px2rem(8px)};
|
|
|
|
}
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
width: #{px2rem(8px)};
|
|
|
|
height: #{px2rem(8px)};
|
|
|
|
position: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
&:active {
|
|
|
|
opacity: 0.3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|