2018-12-07 16:17:45 +08:00
|
|
|
@import '../../style/mixins/index';
|
2016-04-27 20:44:36 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
@tree-prefix-cls: ~'@{ant-prefix}-tree';
|
2019-09-28 11:31:28 +08:00
|
|
|
@select-tree-prefix-cls: ~'@{ant-prefix}-select-tree';
|
2020-05-19 18:10:02 +08:00
|
|
|
@tree-motion: ~'@{ant-prefix}-motion-collapse';
|
2020-12-25 14:31:44 +08:00
|
|
|
@tree-node-padding: (@padding-xs / 2);
|
2021-01-22 18:45:14 +08:00
|
|
|
@tree-node-hightlight-color: inherit;
|
2017-03-21 09:41:02 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
.antTreeSwitcherIcon(@type: 'tree-default-open-icon') {
|
2018-08-25 15:51:07 +08:00
|
|
|
.@{tree-prefix-cls}-switcher-icon,
|
2019-09-28 11:31:28 +08:00
|
|
|
.@{select-tree-prefix-cls}-switcher-icon {
|
2016-04-27 20:44:36 +08:00
|
|
|
display: inline-block;
|
2020-10-12 15:50:02 +08:00
|
|
|
font-size: 10px;
|
2020-05-19 18:10:02 +08:00
|
|
|
vertical-align: baseline;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2018-08-25 15:51:07 +08:00
|
|
|
svg {
|
2018-12-07 16:17:45 +08:00
|
|
|
transition: transform 0.3s;
|
2018-08-25 15:51:07 +08:00
|
|
|
}
|
2017-03-28 17:51:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-29 14:15:08 +08:00
|
|
|
.drop-indicator() {
|
|
|
|
.@{tree-prefix-cls}-drop-indicator {
|
|
|
|
position: absolute;
|
|
|
|
// it should displayed over the following node
|
|
|
|
z-index: 1;
|
|
|
|
height: 2px;
|
|
|
|
background-color: @primary-color;
|
|
|
|
border-radius: 1px;
|
|
|
|
pointer-events: none;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-11-29 14:15:08 +08:00
|
|
|
&::after {
|
|
|
|
position: absolute;
|
|
|
|
top: -3px;
|
|
|
|
left: -6px;
|
|
|
|
width: 8px;
|
|
|
|
height: 8px;
|
|
|
|
background-color: transparent;
|
|
|
|
border: 2px solid @primary-color;
|
|
|
|
border-radius: 50%;
|
|
|
|
content: '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-19 18:10:02 +08:00
|
|
|
.antTreeFn(@custom-tree-prefix-cls) {
|
|
|
|
@custom-tree-node-prefix-cls: ~'@{custom-tree-prefix-cls}-treenode';
|
2020-12-22 11:08:12 +08:00
|
|
|
.reset-component();
|
2020-08-25 22:54:04 +08:00
|
|
|
background: @tree-bg;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
transition: background-color 0.3s;
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&-focused:not(:hover):not(&-active-focused) {
|
|
|
|
background: @primary-1;
|
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// =================== Virtual List ===================
|
|
|
|
&-list-holder-inner {
|
|
|
|
align-items: flex-start;
|
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&.@{custom-tree-prefix-cls}-block-node {
|
|
|
|
.@{custom-tree-prefix-cls}-list-holder-inner {
|
|
|
|
align-items: stretch;
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// >>> Title
|
|
|
|
.@{custom-tree-prefix-cls}-node-content-wrapper {
|
|
|
|
flex: auto;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
2021-09-27 15:54:06 +08:00
|
|
|
|
|
|
|
// >>> Drag
|
|
|
|
.@{custom-tree-node-prefix-cls}.dragging {
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: @tree-node-padding;
|
|
|
|
left: 0;
|
|
|
|
border: 1px solid @primary-color;
|
|
|
|
opacity: 0;
|
|
|
|
animation: ant-tree-node-fx-do-not-use 0.3s;
|
|
|
|
animation-play-state: running;
|
|
|
|
animation-fill-mode: forwards;
|
|
|
|
content: '';
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// ===================== TreeNode =====================
|
|
|
|
.@{custom-tree-node-prefix-cls} {
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-start;
|
2020-10-26 23:13:52 +08:00
|
|
|
padding: 0 0 @tree-node-padding 0;
|
2020-08-25 22:54:04 +08:00
|
|
|
outline: none;
|
|
|
|
// Disabled
|
|
|
|
&-disabled {
|
|
|
|
// >>> Title
|
|
|
|
.@{custom-tree-prefix-cls}-node-content-wrapper {
|
|
|
|
color: @disabled-color;
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: transparent;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&-active .@{custom-tree-prefix-cls}-node-content-wrapper {
|
|
|
|
background: @tree-node-hover-bg;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
2021-01-14 18:39:21 +08:00
|
|
|
|
2021-01-22 18:45:14 +08:00
|
|
|
&:not(&-disabled).filter-node .@{custom-tree-prefix-cls}-title {
|
2021-01-14 18:39:21 +08:00
|
|
|
color: @tree-node-hightlight-color;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// >>> Indent
|
|
|
|
&-indent {
|
|
|
|
align-self: stretch;
|
|
|
|
white-space: nowrap;
|
|
|
|
user-select: none;
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&-unit {
|
|
|
|
display: inline-block;
|
2020-05-19 18:10:02 +08:00
|
|
|
width: @tree-title-height;
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2021-09-27 15:54:06 +08:00
|
|
|
// >>> Drag Handler
|
|
|
|
&-draggable-icon {
|
|
|
|
width: @tree-title-height;
|
|
|
|
line-height: @tree-title-height;
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.2;
|
|
|
|
transition: opacity @animation-duration-slow;
|
|
|
|
|
|
|
|
.@{custom-tree-node-prefix-cls}:hover & {
|
|
|
|
opacity: 0.45;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// >>> Switcher
|
2020-10-30 21:10:21 +08:00
|
|
|
&-switcher {
|
2020-08-25 22:54:04 +08:00
|
|
|
.antTreeSwitcherIcon();
|
2020-10-26 23:13:52 +08:00
|
|
|
position: relative;
|
2020-08-25 22:54:04 +08:00
|
|
|
flex: none;
|
2020-10-26 23:13:52 +08:00
|
|
|
align-self: stretch;
|
2020-08-25 22:54:04 +08:00
|
|
|
width: @tree-title-height;
|
|
|
|
margin: 0;
|
|
|
|
line-height: @tree-title-height;
|
|
|
|
text-align: center;
|
|
|
|
cursor: pointer;
|
2020-10-30 21:10:21 +08:00
|
|
|
user-select: none;
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&-noop {
|
|
|
|
cursor: default;
|
|
|
|
}
|
2020-06-29 11:04:58 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&_close {
|
|
|
|
.@{custom-tree-prefix-cls}-switcher-icon {
|
|
|
|
svg {
|
|
|
|
transform: rotate(-90deg);
|
2020-06-29 11:04:58 +08:00
|
|
|
}
|
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&-loading-icon {
|
|
|
|
color: @primary-color;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&-leaf-line {
|
2020-12-15 10:24:49 +08:00
|
|
|
position: relative;
|
2020-08-25 22:54:04 +08:00
|
|
|
z-index: 1;
|
|
|
|
display: inline-block;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2021-09-08 09:27:38 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/31884
|
2020-08-25 22:54:04 +08:00
|
|
|
&::before {
|
|
|
|
position: absolute;
|
2020-10-26 23:13:52 +08:00
|
|
|
top: 0;
|
2021-09-08 09:27:38 +08:00
|
|
|
right: 12px;
|
2020-10-26 23:13:52 +08:00
|
|
|
bottom: -@tree-node-padding;
|
2020-08-25 22:54:04 +08:00
|
|
|
margin-left: -1px;
|
2021-09-08 09:27:38 +08:00
|
|
|
border-right: 1px solid @normal-color;
|
2020-08-25 22:54:04 +08:00
|
|
|
content: ' ';
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&::after {
|
|
|
|
position: absolute;
|
|
|
|
width: @tree-title-height - 14px;
|
|
|
|
height: @tree-title-height - 10px;
|
|
|
|
border-bottom: 1px solid @normal-color;
|
|
|
|
content: ' ';
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// >>> Checkbox
|
2020-12-09 16:36:14 +08:00
|
|
|
&-checkbox {
|
2020-08-25 22:54:04 +08:00
|
|
|
top: initial;
|
|
|
|
margin: ((@tree-title-height - @checkbox-size) / 2) 8px 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// >>> Title
|
|
|
|
& &-node-content-wrapper {
|
2020-11-29 14:15:08 +08:00
|
|
|
position: relative;
|
|
|
|
z-index: auto;
|
2020-08-25 22:54:04 +08:00
|
|
|
min-height: @tree-title-height;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0 4px;
|
|
|
|
color: inherit;
|
|
|
|
line-height: @tree-title-height;
|
|
|
|
background: transparent;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
cursor: pointer;
|
2020-11-29 14:15:08 +08:00
|
|
|
transition: all 0.3s, border 0s, line-height 0s, box-shadow 0s;
|
2020-08-25 22:54:04 +08:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: @tree-node-hover-bg;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&.@{custom-tree-prefix-cls}-node-selected {
|
|
|
|
background-color: @tree-node-selected-bg;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// Icon
|
|
|
|
.@{custom-tree-prefix-cls}-iconEle {
|
|
|
|
display: inline-block;
|
|
|
|
width: @tree-title-height;
|
|
|
|
height: @tree-title-height;
|
|
|
|
line-height: @tree-title-height;
|
|
|
|
text-align: center;
|
|
|
|
vertical-align: top;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&:empty {
|
|
|
|
display: none;
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
|
|
|
|
2020-12-09 16:36:14 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/28217
|
|
|
|
&-unselectable &-node-content-wrapper:hover {
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
// ==================== Draggable =====================
|
2021-09-27 15:54:06 +08:00
|
|
|
&-node-content-wrapper {
|
2020-11-29 14:15:08 +08:00
|
|
|
line-height: @tree-title-height;
|
2020-08-25 22:54:04 +08:00
|
|
|
user-select: none;
|
|
|
|
|
2020-11-29 14:15:08 +08:00
|
|
|
.drop-indicator();
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
2020-11-29 14:15:08 +08:00
|
|
|
|
|
|
|
.@{custom-tree-node-prefix-cls}.drop-container {
|
2020-08-25 22:54:04 +08:00
|
|
|
> [draggable] {
|
2020-11-29 14:15:08 +08:00
|
|
|
box-shadow: 0 0 0 2px @primary-color;
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==================== Show Line =====================
|
|
|
|
&-show-line {
|
|
|
|
// ================ Indent lines ================
|
|
|
|
.@{custom-tree-prefix-cls}-indent {
|
|
|
|
&-unit {
|
|
|
|
position: relative;
|
|
|
|
height: 100%;
|
2020-05-19 18:10:02 +08:00
|
|
|
|
2020-08-25 22:54:04 +08:00
|
|
|
&::before {
|
|
|
|
position: absolute;
|
2020-10-26 23:13:52 +08:00
|
|
|
top: 0;
|
2020-12-25 14:31:44 +08:00
|
|
|
right: (@tree-title-height / 2);
|
2020-10-26 23:13:52 +08:00
|
|
|
bottom: -@tree-node-padding;
|
2020-08-25 22:54:04 +08:00
|
|
|
border-right: 1px solid @border-color-base;
|
|
|
|
content: '';
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
|
2020-10-26 23:13:52 +08:00
|
|
|
&-end {
|
|
|
|
&::before {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
|
|
|
|
// ============== Cover Background ==============
|
|
|
|
.@{custom-tree-prefix-cls}-switcher {
|
|
|
|
background: @component-background;
|
2020-10-30 21:10:21 +08:00
|
|
|
|
|
|
|
&-line-icon {
|
2021-11-11 19:18:18 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/32813
|
|
|
|
vertical-align: -0.15em;
|
2020-10-30 21:10:21 +08:00
|
|
|
}
|
2020-08-25 22:54:04 +08:00
|
|
|
}
|
2020-05-19 18:10:02 +08:00
|
|
|
}
|
2020-06-29 11:04:58 +08:00
|
|
|
|
2021-05-27 14:48:48 +08:00
|
|
|
.@{custom-tree-node-prefix-cls}-leaf-last {
|
|
|
|
.@{custom-tree-prefix-cls}-switcher {
|
|
|
|
&-leaf-line {
|
|
|
|
&::before {
|
|
|
|
top: auto !important;
|
|
|
|
bottom: auto !important;
|
|
|
|
height: @tree-title-height - 10px !important;
|
|
|
|
}
|
2020-06-29 11:04:58 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-09-27 15:54:06 +08:00
|
|
|
|
|
|
|
@keyframes ant-tree-node-fx-do-not-use {
|
|
|
|
0% {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2021-09-27 15:54:06 +08:00
|
|
|
100% {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|