2019-04-30 11:11:25 +08:00
|
|
|
.#{$ns}TreeControl {
|
2020-12-21 10:08:40 +08:00
|
|
|
border: 1px solid var(--Form-input-borderColor);
|
2019-12-06 09:58:08 +08:00
|
|
|
padding: 6px 12px;
|
|
|
|
border-radius: 2px;
|
|
|
|
max-height: 300px;
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
&.h-full {
|
|
|
|
max-height: none;
|
|
|
|
overflow: visible;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.no-border {
|
|
|
|
border: 0;
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Tree {
|
2019-12-06 09:58:08 +08:00
|
|
|
&-list,
|
|
|
|
&-sublist {
|
|
|
|
list-style: none;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
2021-04-09 15:25:43 +08:00
|
|
|
&-sublist {
|
|
|
|
margin-left: var(--Tree-indent);
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
|
|
|
|
&-sublist.is-folded {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-item {
|
2020-12-21 10:08:40 +08:00
|
|
|
line-height: var(--Tree-itemHeight);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
> div {
|
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
|
|
> .#{$ns}Tree-item-icons {
|
|
|
|
visibility: visible;
|
2019-05-15 16:10:20 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-11-10 11:18:22 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
> span > svg {
|
2019-11-09 17:04:48 +08:00
|
|
|
display: inline-block;
|
|
|
|
cursor: pointer;
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
|
|
|
top: 2px;
|
|
|
|
width: px2rem(16px);
|
|
|
|
height: px2rem(16px);
|
2021-04-08 23:19:23 +08:00
|
|
|
margin-left: var(--gap-xs);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-11-09 17:04:48 +08:00
|
|
|
|
2021-04-25 21:28:09 +08:00
|
|
|
&.is-disabled {
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2021-04-09 15:25:43 +08:00
|
|
|
&--outline &-sublist &-item--isLeaf {
|
|
|
|
&:before {
|
|
|
|
position: absolute;
|
|
|
|
top: -8px;
|
|
|
|
left: calc((var(--Tree-indent) - 5px) * -1);
|
|
|
|
bottom: 0px;
|
|
|
|
border-left: 1px solid var(--borderColor);
|
|
|
|
content: '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-rootItem {
|
2020-12-21 10:08:40 +08:00
|
|
|
line-height: var(--Tree-itemHeight);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-item > div:hover > .#{$ns}Tree-item-icons,
|
|
|
|
&-rootItem > div:hover > .#{$ns}Tree-item-icons {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-itemLabel {
|
2020-02-28 13:23:17 +08:00
|
|
|
display: flex;
|
2020-08-07 14:20:18 +08:00
|
|
|
align-items: center;
|
2021-09-24 11:10:20 +08:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
& > * {
|
|
|
|
position: relative;
|
|
|
|
z-index: 2;
|
|
|
|
}
|
2020-08-07 14:20:18 +08:00
|
|
|
|
2021-09-24 11:10:20 +08:00
|
|
|
&:hover:after {
|
|
|
|
position: absolute;
|
|
|
|
content: '';
|
|
|
|
z-index: 1;
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--Tree-item-onHover-bg);
|
2021-09-24 11:10:20 +08:00
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: -99999px;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-item-icons {
|
|
|
|
visibility: hidden;
|
2021-01-04 16:45:43 +08:00
|
|
|
transition: visibility var(--animation-duration) ease;
|
2019-12-06 09:58:08 +08:00
|
|
|
display: inline-block;
|
|
|
|
vertical-align: top;
|
2020-12-21 10:08:40 +08:00
|
|
|
height: var(--Tree-itemHeight);
|
|
|
|
line-height: var(--Tree-itemHeight);
|
2021-04-08 23:19:23 +08:00
|
|
|
padding-right: var(--gap-xs);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
|
|
|
> a {
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-left: var(--gap-xs);
|
2019-12-06 09:58:08 +08:00
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
> svg {
|
2020-06-09 14:44:38 +08:00
|
|
|
$svgSize: px2rem(12px);
|
2019-12-06 09:58:08 +08:00
|
|
|
width: $svgSize;
|
|
|
|
height: $svgSize;
|
2020-06-09 14:44:38 +08:00
|
|
|
top: 0;
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-11-09 17:04:48 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-itemInput {
|
2020-12-21 10:08:40 +08:00
|
|
|
padding-left: var(--Tree-itemArrowWidth);
|
2020-08-20 18:14:05 +08:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-wrap: nowrap;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
> a {
|
|
|
|
display: inline-block;
|
|
|
|
cursor: pointer;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-left: var(--gap-sm);
|
|
|
|
color: var(--icon-color);
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&:hover {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--icon-onHover-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
text-decoration: none;
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
> input {
|
2020-08-20 18:14:05 +08:00
|
|
|
flex-grow: 1;
|
|
|
|
width: 100%;
|
2019-12-06 09:58:08 +08:00
|
|
|
outline: none;
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--Form-input-bg);
|
|
|
|
border: var(--Form-input-borderWidth) solid var(--Form-input-borderColor);
|
|
|
|
border-radius: var(--Form-input-borderRadius);
|
|
|
|
line-height: var(--Form-input-lineHeight);
|
|
|
|
padding: calc(
|
|
|
|
(
|
|
|
|
var(--Tree-inputHeight) - var(--Form-input-lineHeight) *
|
|
|
|
var(--Form-input-fontSize) - #{px2rem(2px)}
|
|
|
|
) / 2
|
|
|
|
)
|
|
|
|
var(--Form-input-paddingX);
|
|
|
|
font-size: var(--Form-input-fontSize);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
|
|
|
&::placeholder {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Form-input-placeholderColor);
|
2019-05-15 16:10:20 +08:00
|
|
|
user-select: none;
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&:focus {
|
2020-12-21 10:08:40 +08:00
|
|
|
border-color: var(--Form-input-onFocused-borderColor);
|
|
|
|
box-shadow: var(--Form-input-boxShadow);
|
|
|
|
background: var(--Form-input-onFocused-bg);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-addTopBtn {
|
|
|
|
cursor: pointer;
|
2020-12-21 10:08:40 +08:00
|
|
|
height: var(--Tree-itemHeight);
|
|
|
|
line-height: var(--Tree-itemHeight);
|
2019-12-06 09:58:08 +08:00
|
|
|
display: block;
|
2019-11-10 11:18:22 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
2019-05-15 16:10:20 +08:00
|
|
|
}
|
2019-11-09 17:04:48 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&.is-disabled {
|
|
|
|
pointer-events: none;
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--text--muted-color);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
> svg {
|
|
|
|
$svgSize: px2rem(14px);
|
|
|
|
width: $svgSize;
|
|
|
|
height: $svgSize;
|
|
|
|
top: $svgSize * 0.125;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-right: var(--gap-xs);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-itemArrow {
|
|
|
|
cursor: pointer;
|
2020-12-21 10:08:40 +08:00
|
|
|
width: var(--Tree-itemArrowWidth);
|
2020-12-25 00:13:14 +08:00
|
|
|
display: inline-flex;
|
2021-04-08 23:19:23 +08:00
|
|
|
margin-right: var(--gap-xs);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
2020-06-09 14:44:38 +08:00
|
|
|
// &:before {
|
|
|
|
// font-style: normal;
|
|
|
|
// font-family: $Tree-arrowVendor;
|
|
|
|
// content: $Tree-unfoldedArrowContent;
|
|
|
|
// }
|
|
|
|
> svg {
|
2020-12-21 10:08:40 +08:00
|
|
|
width: var(--Tree-itemArrowWidth);
|
|
|
|
height: var(--Tree-itemArrowWidth);
|
2020-12-25 00:13:14 +08:00
|
|
|
display: block;
|
2021-01-04 16:45:43 +08:00
|
|
|
transition: transform var(--animation-duration);
|
2020-06-09 14:44:38 +08:00
|
|
|
top: 0;
|
2020-06-11 18:31:02 +08:00
|
|
|
transform: rotate(90deg);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
|
|
|
|
2020-06-09 14:44:38 +08:00
|
|
|
&.is-folded > svg {
|
2020-06-11 18:31:02 +08:00
|
|
|
transform: rotate(0deg);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-itemArrowPlaceholder {
|
|
|
|
display: inline-block;
|
2021-04-08 23:19:23 +08:00
|
|
|
width: calc(var(--Tree-itemArrowWidth) + var(--gap-xs));
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
2021-04-22 16:42:37 +08:00
|
|
|
&-spinner {
|
|
|
|
margin-right: var(--gap-xs);
|
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-itemIcon {
|
2020-12-25 00:13:14 +08:00
|
|
|
display: inline-flex;
|
2021-04-08 23:19:23 +08:00
|
|
|
margin-right: var(--gap-xs);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
2020-06-09 14:44:38 +08:00
|
|
|
&-rootIcon,
|
|
|
|
&-folderIcon,
|
2019-12-06 09:58:08 +08:00
|
|
|
&-leafIcon {
|
2020-06-09 14:44:38 +08:00
|
|
|
> svg {
|
2020-12-25 00:13:14 +08:00
|
|
|
top: 0;
|
2020-06-09 14:44:38 +08:00
|
|
|
width: px2rem(14px);
|
|
|
|
height: px2rem(14px);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-11-09 17:04:48 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-itemLabel {
|
|
|
|
user-select: none;
|
2019-11-09 17:04:48 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&.is-checked,
|
|
|
|
&.is-children-checked {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Tree-itemLabel--onChecked-color);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&.is-disabled {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--text--muted-color);
|
2019-11-09 17:04:48 +08:00
|
|
|
}
|
2020-06-09 14:44:38 +08:00
|
|
|
|
|
|
|
> .#{$ns}Checkbox {
|
2020-12-25 00:13:14 +08:00
|
|
|
display: inline-flex;
|
|
|
|
align-self: center;
|
2020-06-09 14:44:38 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-itemText {
|
|
|
|
cursor: pointer;
|
2020-02-28 13:23:17 +08:00
|
|
|
flex: 1 auto;
|
2020-12-21 10:08:40 +08:00
|
|
|
line-height: var(--lineHeightBase);
|
2020-06-11 13:37:17 +08:00
|
|
|
padding: px2rem(4px) 0;
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-placeholder {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--text--muted-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
}
|