structure adjustment
This commit is contained in:
271
lib/ui/css/dropdown.scss
Normal file
271
lib/ui/css/dropdown.scss
Normal file
@ -0,0 +1,271 @@
|
||||
@import './functions/func.scss';
|
||||
|
||||
$headerHeight: 26px;
|
||||
$caretWidth: 26px;
|
||||
$dropItemHeight: 30px;
|
||||
$scrollBarSize: 4px;
|
||||
|
||||
$searchBarHeight: 36px;
|
||||
$searchInputHeight: 26px;
|
||||
$searchIconSize: 13px;
|
||||
$listMaxHeight: 210px;
|
||||
|
||||
.drop-wrapper {
|
||||
display: inline-block;
|
||||
border: none;
|
||||
border-radius: unset;
|
||||
user-select: none;
|
||||
position: relative;
|
||||
|
||||
>.drop-header {
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--border-radius);
|
||||
background-color: var(--bg-color);
|
||||
display: flex;
|
||||
height: $headerHeight;
|
||||
transition: border-color .2s;
|
||||
|
||||
&:focus,
|
||||
&:hover {
|
||||
border-color: var(--focus-color);
|
||||
// box-shadow: 0 0 3px 1px rgba(0, 0, 0, .2);
|
||||
}
|
||||
|
||||
&:focus,
|
||||
&:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/*>.drop-select-container {
|
||||
flex: 1 1 auto;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@include scrollbar();
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: $scrollBarSize;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
>span {
|
||||
display: inline-block;
|
||||
margin: 2px;
|
||||
padding: 0 2px;
|
||||
border: 1px solid lightgray;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
background-color: white;
|
||||
font-size: $tinySize;
|
||||
border-radius: var(--border-radius);
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
>svg {
|
||||
display: none;
|
||||
width: 8px;
|
||||
height: 20px;
|
||||
fill: white;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: #1890ff;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
background-color: #1890ff;
|
||||
color: white;
|
||||
|
||||
>svg {
|
||||
display: inline-block;
|
||||
margin-left: 3px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
>label {
|
||||
flex: 1 1 auto;
|
||||
min-width: 40px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
line-height: $headerHeight;
|
||||
padding: 0 4px;
|
||||
font-weight: 400;
|
||||
font-size: var(--font-smaller-size);
|
||||
color: var(--color);
|
||||
}
|
||||
}*/
|
||||
|
||||
>.drop-text {
|
||||
flex: 1 1 auto;
|
||||
cursor: pointer;
|
||||
font-size: var(--font-size);
|
||||
// line-height: $headerHeight;
|
||||
padding: 0 6px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
border: none;
|
||||
outline: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
>input.drop-text {
|
||||
cursor: initial;
|
||||
|
||||
&::placeholder {
|
||||
font-size: var(--font-smaller-size);
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
>.drop-caret {
|
||||
flex: 0 0 auto;
|
||||
width: $caretWidth;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
display: block;
|
||||
content: '';
|
||||
border-top: 4px solid;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
height: 0;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
border-color: var(--disabled-bg-color);
|
||||
color: var(--disabled-color);
|
||||
|
||||
&:focus {
|
||||
border-color: var(--disabled-bg-color);
|
||||
// box-shadow: none;
|
||||
}
|
||||
|
||||
>.drop-text,
|
||||
>.drop-caret {
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
>.drop-box {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transform: scaleY(0);
|
||||
transform-origin: top;
|
||||
background-color: var(--bg-color);
|
||||
top: calc($headerHeight + 2px);
|
||||
z-index: 2;
|
||||
transition: transform 120ms ease, opacity 120ms ease, visibility 120ms ease;
|
||||
width: calc(100% + 2px);
|
||||
box-sizing: border-box;
|
||||
/*border: 1px solid var(--border-color);
|
||||
border-top-width: 0;*/
|
||||
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05);
|
||||
left: -1px;
|
||||
|
||||
&.slide-up {
|
||||
/*border-top-width: 1px;
|
||||
border-bottom-width: 0;*/
|
||||
transform-origin: bottom;
|
||||
top: unset;
|
||||
bottom: calc($headerHeight + 2px);
|
||||
}
|
||||
|
||||
&.active {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transform: scaleY(1);
|
||||
}
|
||||
|
||||
>.drop-search {
|
||||
box-sizing: border-box;
|
||||
height: $searchBarHeight;
|
||||
line-height: $searchBarHeight;
|
||||
padding: 0 8px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>input[type="text"] {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: $searchInputHeight;
|
||||
outline: none;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--border-radius);
|
||||
padding: 0 6px 0 22px;
|
||||
color: var(--color);
|
||||
transition: border-color .2s;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
border-color: var(--focus-color);
|
||||
}
|
||||
|
||||
// &:focus {
|
||||
// box-shadow: 0 0 3px 1px rgba(0, 0, 0, .2);
|
||||
// }
|
||||
|
||||
&::placeholder {
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
>svg {
|
||||
position: absolute;
|
||||
left: 14px;
|
||||
width: $searchIconSize;
|
||||
height: 100%;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
|
||||
>.drop-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
max-height: $listMaxHeight;
|
||||
overflow-y: auto;
|
||||
font-size: var(--font-size);
|
||||
@include scrollbar();
|
||||
|
||||
&.filtered>li:first-child {
|
||||
background-color: var(--hover-bg-color);
|
||||
}
|
||||
|
||||
>li {
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
line-height: $dropItemHeight;
|
||||
height: $dropItemHeight;
|
||||
padding: 0 10px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&:hover,
|
||||
&.selected {
|
||||
background-color: var(--hover-bg-color);
|
||||
}
|
||||
|
||||
>.checkbox-wrapper {
|
||||
height: $dropItemHeight;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user