You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
5.4 KiB

6 years ago
@import '../../style/themes/default';
@import '../../style/mixins/index';
@import '../../checkbox/style/mixin';
@import './mixin';
@import './directory';
6 years ago
@tree-prefix-cls: ~'@{ant-prefix}-tree';
@tree-showline-icon-color: @text-color-secondary;
6 years ago
.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-tree-checkbox');
.@{tree-prefix-cls} {
.reset-component;
margin: 0;
padding: 0;
6 years ago
ol,
ul {
list-style: none;
margin: 0;
padding: 0;
}
li {
8 years ago
padding: 4px 0;
margin: 0;
list-style: none;
white-space: nowrap;
outline: 0;
span[draggable],
6 years ago
span[draggable='true'] {
9 years ago
user-select: none;
border-top: 2px transparent solid;
border-bottom: 2px transparent solid;
9 years ago
/* Required to make elements draggable in old WebKit */
-khtml-user-drag: element;
-webkit-user-drag: element;
line-height: @tree-title-height - 4px;
9 years ago
}
&.drag-over {
> span[draggable] {
background-color: @primary-color;
9 years ago
color: white;
opacity: 0.8;
}
}
&.drag-over-gap-top {
> span[draggable] {
border-top-color: @primary-color;
9 years ago
}
}
&.drag-over-gap-bottom {
> span[draggable] {
border-bottom-color: @primary-color;
9 years ago
}
}
&.filter-node {
> span {
color: @highlight-color !important;
font-weight: 500 !important;
9 years ago
}
}
// When node is loading
&.@{tree-prefix-cls}-treenode-loading {
span {
&.@{tree-prefix-cls}-switcher {
&.@{tree-prefix-cls}-switcher_open,
&.@{tree-prefix-cls}-switcher_close {
.@{tree-prefix-cls}-switcher-loading-icon {
display: inline-block;
position: absolute;
left: 0;
width: 24px;
height: 24px;
color: @primary-color;
transform: none;
font-size: 14px;
svg {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
}
}
:root &:after {
opacity: 0;
}
}
}
}
}
ul {
margin: 0;
padding: 0 0 0 @tree-child-padding;
}
.@{tree-prefix-cls}-node-content-wrapper {
display: inline-block;
padding: 0 5px;
border-radius: @border-radius-sm;
margin: 0;
cursor: pointer;
text-decoration: none;
vertical-align: top;
8 years ago
color: @text-color;
6 years ago
transition: all 0.3s;
height: @tree-title-height;
line-height: @tree-title-height;
&:hover {
background-color: @item-hover-bg;
}
&.@{tree-prefix-cls}-node-selected {
background-color: @primary-2;
}
}
span {
&.@{tree-prefix-cls}-checkbox {
margin: 4px 4px 0 2px;
9 years ago
}
&.@{tree-prefix-cls}-switcher,
&.@{tree-prefix-cls}-iconEle {
margin: 0;
width: 24px;
height: 24px;
line-height: @tree-title-height;
display: inline-block;
vertical-align: top;
border: 0 none;
cursor: pointer;
outline: none;
text-align: center;
}
&.@{tree-prefix-cls}-switcher {
position: relative;
8 years ago
&.@{tree-prefix-cls}-switcher-noop {
cursor: default;
8 years ago
}
&.@{tree-prefix-cls}-switcher_open {
.antTreeSwitcherIcon();
}
&.@{tree-prefix-cls}-switcher_close {
.antTreeSwitcherIcon();
.@{tree-prefix-cls}-switcher-icon {
svg {
transform: rotate(-90deg);
}
}
}
}
}
&:last-child > span {
&.@{tree-prefix-cls}-switcher,
&.@{tree-prefix-cls}-iconEle {
&:before {
display: none;
}
}
}
}
> li {
&:first-child {
padding-top: 7px;
}
&:last-child {
padding-bottom: 7px;
}
}
&-child-tree {
display: none;
&-open {
display: block;
}
}
li&-treenode-disabled {
> span:not(.@{tree-prefix-cls}-switcher),
> .@{tree-prefix-cls}-node-content-wrapper,
> .@{tree-prefix-cls}-node-content-wrapper span {
color: @disabled-color;
9 years ago
cursor: not-allowed;
}
> .@{tree-prefix-cls}-node-content-wrapper:hover {
background: transparent;
}
}
&-icon__open {
margin-right: 2px;
vertical-align: top;
}
&-icon__close {
margin-right: 2px;
vertical-align: top;
}
// Tree with line
&&-show-line {
li {
position: relative;
span {
&.@{tree-prefix-cls}-switcher {
background: @component-background;
color: @tree-showline-icon-color;
&.@{tree-prefix-cls}-switcher-noop {
6 years ago
.antTreeShowLineIcon('tree-doc-icon');
}
&.@{tree-prefix-cls}-switcher_open {
6 years ago
.antTreeShowLineIcon('tree-showline-open-icon');
}
&.@{tree-prefix-cls}-switcher_close {
6 years ago
.antTreeShowLineIcon('tree-showline-close-icon');
}
}
}
}
li:not(:last-child):before {
content: ' ';
width: 1px;
border-left: 1px solid @border-color-base;
height: 100%;
position: absolute;
left: 12px;
margin: 22px 0;
}
}
&.@{tree-prefix-cls}-icon-hide {
.@{tree-prefix-cls}-treenode-loading {
.@{tree-prefix-cls}-iconEle {
display: none;
}
}
}
}