2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 16:17:45 +08:00
|
|
|
@import '../../style/mixins/index';
|
|
|
|
@import '../../checkbox/style/mixin';
|
|
|
|
@import './mixin';
|
|
|
|
@import './directory';
|
2016-04-27 20:44:36 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
@tree-prefix-cls: ~'@{ant-prefix}-tree';
|
2017-06-01 16:54:47 +08:00
|
|
|
@tree-showline-icon-color: @text-color-secondary;
|
2019-02-21 11:17:52 +08:00
|
|
|
@tree-node-padding: 4px;
|
2017-06-01 16:54:47 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-tree-checkbox');
|
2016-04-27 20:44:36 +08:00
|
|
|
|
2015-08-20 16:55:42 +08:00
|
|
|
.@{tree-prefix-cls} {
|
2019-04-24 20:09:49 +08:00
|
|
|
/* see https://github.com/ant-design/ant-design/issues/16259 */
|
|
|
|
&-checkbox-checked::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 16.67%;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 66.67%;
|
|
|
|
}
|
|
|
|
|
2017-09-22 18:33:29 +08:00
|
|
|
.reset-component;
|
2019-04-15 10:52:00 +08:00
|
|
|
|
2015-08-16 20:04:42 +08:00
|
|
|
margin: 0;
|
2017-07-20 17:17:56 +08:00
|
|
|
padding: 0;
|
2017-09-27 22:32:49 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
ol,
|
|
|
|
ul {
|
2017-09-27 22:32:49 +08:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2019-02-15 10:48:07 +08:00
|
|
|
list-style: none;
|
2017-09-27 22:32:49 +08:00
|
|
|
}
|
|
|
|
|
2015-08-03 16:07:21 +08:00
|
|
|
li {
|
2016-12-30 14:32:34 +08:00
|
|
|
margin: 0;
|
2019-02-21 11:17:52 +08:00
|
|
|
padding: @tree-node-padding 0;
|
2015-08-16 20:04:42 +08:00
|
|
|
white-space: nowrap;
|
2019-02-15 10:48:07 +08:00
|
|
|
list-style: none;
|
2015-08-16 20:04:42 +08:00
|
|
|
outline: 0;
|
2017-04-27 15:25:08 +08:00
|
|
|
span[draggable],
|
2018-12-07 16:17:45 +08:00
|
|
|
span[draggable='true'] {
|
2019-02-15 10:48:07 +08:00
|
|
|
line-height: @tree-title-height - 4px;
|
2017-02-16 15:35:22 +08:00
|
|
|
border-top: 2px transparent solid;
|
|
|
|
border-bottom: 2px transparent solid;
|
2019-02-15 10:48:07 +08:00
|
|
|
user-select: none;
|
2016-01-07 19:05:55 +08:00
|
|
|
/* Required to make elements draggable in old WebKit */
|
|
|
|
-khtml-user-drag: element;
|
|
|
|
-webkit-user-drag: element;
|
|
|
|
}
|
|
|
|
&.drag-over {
|
2017-04-27 15:25:08 +08:00
|
|
|
> span[draggable] {
|
2016-01-07 19:05:55 +08:00
|
|
|
color: white;
|
2019-02-15 10:48:07 +08:00
|
|
|
background-color: @primary-color;
|
2016-01-07 19:05:55 +08:00
|
|
|
opacity: 0.8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.drag-over-gap-top {
|
2017-04-27 15:25:08 +08:00
|
|
|
> span[draggable] {
|
2017-02-16 15:35:22 +08:00
|
|
|
border-top-color: @primary-color;
|
2016-01-07 19:05:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
&.drag-over-gap-bottom {
|
2017-04-27 15:25:08 +08:00
|
|
|
> span[draggable] {
|
2017-02-16 15:35:22 +08:00
|
|
|
border-bottom-color: @primary-color;
|
2016-01-07 19:05:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
&.filter-node {
|
2017-04-27 15:25:08 +08:00
|
|
|
> span {
|
2017-08-04 17:58:32 +08:00
|
|
|
color: @highlight-color !important;
|
2017-08-17 22:10:40 +08:00
|
|
|
font-weight: 500 !important;
|
2016-01-07 19:05:55 +08:00
|
|
|
}
|
|
|
|
}
|
2018-06-04 11:20:17 +08:00
|
|
|
|
|
|
|
// When node is loading
|
|
|
|
&.@{tree-prefix-cls}-treenode-loading {
|
|
|
|
span {
|
|
|
|
&.@{tree-prefix-cls}-switcher {
|
|
|
|
&.@{tree-prefix-cls}-switcher_open,
|
|
|
|
&.@{tree-prefix-cls}-switcher_close {
|
2018-08-17 16:36:33 +08:00
|
|
|
.@{tree-prefix-cls}-switcher-loading-icon {
|
2018-06-04 11:20:17 +08:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
2019-02-15 10:48:07 +08:00
|
|
|
display: inline-block;
|
2018-06-04 11:20:17 +08:00
|
|
|
width: 24px;
|
2019-04-10 17:44:39 +08:00
|
|
|
height: @tree-title-height;
|
2018-06-04 11:20:17 +08:00
|
|
|
color: @primary-color;
|
|
|
|
font-size: 14px;
|
2019-02-15 10:48:07 +08:00
|
|
|
transform: none;
|
2018-09-01 20:11:13 +08:00
|
|
|
svg {
|
2018-08-17 16:36:33 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
margin: auto;
|
|
|
|
}
|
2018-06-04 11:20:17 +08:00
|
|
|
}
|
|
|
|
|
2019-02-15 10:48:07 +08:00
|
|
|
:root &::after {
|
2018-06-04 11:20:17 +08:00
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-10 20:23:18 +08:00
|
|
|
ul {
|
2015-08-16 20:04:42 +08:00
|
|
|
margin: 0;
|
2018-06-04 11:20:17 +08:00
|
|
|
padding: 0 0 0 @tree-child-padding;
|
2015-08-03 16:07:21 +08:00
|
|
|
}
|
2017-04-27 15:25:08 +08:00
|
|
|
.@{tree-prefix-cls}-node-content-wrapper {
|
2015-08-10 20:23:18 +08:00
|
|
|
display: inline-block;
|
2019-02-15 10:48:07 +08:00
|
|
|
height: @tree-title-height;
|
2015-08-16 20:04:42 +08:00
|
|
|
margin: 0;
|
2019-02-15 10:48:07 +08:00
|
|
|
padding: 0 5px;
|
|
|
|
color: @text-color;
|
|
|
|
line-height: @tree-title-height;
|
2015-08-16 20:04:42 +08:00
|
|
|
text-decoration: none;
|
|
|
|
vertical-align: top;
|
2019-02-15 10:48:07 +08:00
|
|
|
border-radius: @border-radius-sm;
|
|
|
|
cursor: pointer;
|
2018-12-07 16:17:45 +08:00
|
|
|
transition: all 0.3s;
|
2016-01-30 16:53:49 +08:00
|
|
|
&:hover {
|
2017-05-03 22:57:14 +08:00
|
|
|
background-color: @item-hover-bg;
|
2016-01-30 16:53:49 +08:00
|
|
|
}
|
|
|
|
&.@{tree-prefix-cls}-node-selected {
|
2017-01-01 22:20:06 +08:00
|
|
|
background-color: @primary-2;
|
2016-01-30 16:53:49 +08:00
|
|
|
}
|
2015-08-03 16:07:21 +08:00
|
|
|
}
|
2015-08-10 20:23:18 +08:00
|
|
|
span {
|
2015-08-20 16:55:42 +08:00
|
|
|
&.@{tree-prefix-cls}-checkbox {
|
2019-04-10 17:44:39 +08:00
|
|
|
top: initial;
|
|
|
|
height: @tree-title-height;
|
|
|
|
margin: 0 4px 0 2px;
|
|
|
|
padding: ((@tree-title-height - 16px) / 2) 0;
|
2015-08-19 12:18:10 +08:00
|
|
|
}
|
2015-08-20 16:55:42 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher,
|
|
|
|
&.@{tree-prefix-cls}-iconEle {
|
2019-02-15 10:48:07 +08:00
|
|
|
display: inline-block;
|
2017-05-18 14:28:48 +08:00
|
|
|
width: 24px;
|
2019-04-10 17:44:39 +08:00
|
|
|
height: @tree-title-height;
|
2019-02-15 10:48:07 +08:00
|
|
|
margin: 0;
|
2018-06-04 11:20:17 +08:00
|
|
|
line-height: @tree-title-height;
|
2019-02-15 10:48:07 +08:00
|
|
|
text-align: center;
|
2018-05-21 20:44:17 +08:00
|
|
|
vertical-align: top;
|
2015-08-16 20:04:42 +08:00
|
|
|
border: 0 none;
|
|
|
|
outline: none;
|
2019-02-15 10:48:07 +08:00
|
|
|
cursor: pointer;
|
2015-08-16 20:04:42 +08:00
|
|
|
}
|
2018-06-04 11:20:17 +08:00
|
|
|
|
2015-08-20 16:55:42 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher {
|
2018-06-04 11:20:17 +08:00
|
|
|
position: relative;
|
|
|
|
|
2016-08-17 17:12:40 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher-noop {
|
2017-03-21 09:41:02 +08:00
|
|
|
cursor: default;
|
2016-08-17 17:12:40 +08:00
|
|
|
}
|
2017-07-28 11:38:39 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher_open {
|
2017-03-28 17:51:45 +08:00
|
|
|
.antTreeSwitcherIcon();
|
2015-08-16 20:04:42 +08:00
|
|
|
}
|
2017-07-28 11:38:39 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher_close {
|
2017-03-28 17:51:45 +08:00
|
|
|
.antTreeSwitcherIcon();
|
2018-08-17 16:04:11 +08:00
|
|
|
.@{tree-prefix-cls}-switcher-icon {
|
2018-08-25 15:51:07 +08:00
|
|
|
svg {
|
|
|
|
transform: rotate(-90deg);
|
|
|
|
}
|
2017-03-28 17:51:45 +08:00
|
|
|
}
|
2017-03-21 09:41:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&:last-child > span {
|
|
|
|
&.@{tree-prefix-cls}-switcher,
|
|
|
|
&.@{tree-prefix-cls}-iconEle {
|
2019-02-15 10:48:07 +08:00
|
|
|
&::before {
|
2017-03-21 09:41:02 +08:00
|
|
|
display: none;
|
2015-08-10 20:23:18 +08:00
|
|
|
}
|
|
|
|
}
|
2015-08-03 16:07:21 +08:00
|
|
|
}
|
2015-08-10 20:23:18 +08:00
|
|
|
}
|
2018-06-04 11:20:17 +08:00
|
|
|
|
2016-12-30 14:32:34 +08:00
|
|
|
> li {
|
|
|
|
&:first-child {
|
|
|
|
padding-top: 7px;
|
|
|
|
}
|
|
|
|
&:last-child {
|
|
|
|
padding-bottom: 7px;
|
|
|
|
}
|
|
|
|
}
|
2015-08-24 18:12:07 +08:00
|
|
|
&-child-tree {
|
2019-02-21 11:17:52 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/14958
|
|
|
|
> li {
|
|
|
|
// Provide additional padding between top child node and parent node
|
|
|
|
&:first-child {
|
|
|
|
padding-top: 2 * @tree-node-padding;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide additional padding between last child node and next parent node
|
|
|
|
&:last-child {
|
|
|
|
padding-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
2015-08-24 18:12:07 +08:00
|
|
|
}
|
2017-06-01 16:54:47 +08:00
|
|
|
li&-treenode-disabled {
|
2018-03-09 15:04:09 +08:00
|
|
|
> span:not(.@{tree-prefix-cls}-switcher),
|
2017-04-27 15:25:08 +08:00
|
|
|
> .@{tree-prefix-cls}-node-content-wrapper,
|
2018-03-09 15:04:09 +08:00
|
|
|
> .@{tree-prefix-cls}-node-content-wrapper span {
|
2017-01-01 22:20:06 +08:00
|
|
|
color: @disabled-color;
|
2016-01-07 19:05:55 +08:00
|
|
|
cursor: not-allowed;
|
2015-08-03 16:07:21 +08:00
|
|
|
}
|
2017-06-01 16:54:47 +08:00
|
|
|
> .@{tree-prefix-cls}-node-content-wrapper:hover {
|
|
|
|
background: transparent;
|
|
|
|
}
|
2015-08-03 16:07:21 +08:00
|
|
|
}
|
|
|
|
&-icon__open {
|
|
|
|
margin-right: 2px;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
&-icon__close {
|
|
|
|
margin-right: 2px;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
2017-03-21 09:41:02 +08:00
|
|
|
// Tree with line
|
|
|
|
&&-show-line {
|
|
|
|
li {
|
|
|
|
position: relative;
|
|
|
|
span {
|
|
|
|
&.@{tree-prefix-cls}-switcher {
|
2017-10-18 17:16:14 +08:00
|
|
|
color: @tree-showline-icon-color;
|
2019-02-15 10:48:07 +08:00
|
|
|
background: @component-background;
|
2017-03-21 09:41:02 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher-noop {
|
2018-12-07 16:17:45 +08:00
|
|
|
.antTreeShowLineIcon('tree-doc-icon');
|
2017-03-28 17:51:45 +08:00
|
|
|
}
|
2017-07-28 11:38:39 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher_open {
|
2018-12-07 16:17:45 +08:00
|
|
|
.antTreeShowLineIcon('tree-showline-open-icon');
|
2017-03-28 17:51:45 +08:00
|
|
|
}
|
2017-07-28 11:38:39 +08:00
|
|
|
&.@{tree-prefix-cls}-switcher_close {
|
2018-12-07 16:17:45 +08:00
|
|
|
.antTreeShowLineIcon('tree-showline-close-icon');
|
2017-03-21 09:41:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-02-15 10:48:07 +08:00
|
|
|
li:not(:last-child)::before {
|
2017-03-21 09:41:02 +08:00
|
|
|
position: absolute;
|
2017-05-18 14:28:48 +08:00
|
|
|
left: 12px;
|
2019-02-15 10:48:07 +08:00
|
|
|
width: 1px;
|
|
|
|
height: 100%;
|
2019-06-12 12:20:32 +08:00
|
|
|
height: calc(100% - 22px); // Remove additional height if support
|
|
|
|
margin: 22px 0 0;
|
2019-02-15 10:48:07 +08:00
|
|
|
border-left: 1px solid @border-color-base;
|
|
|
|
content: ' ';
|
2017-03-21 09:41:02 +08:00
|
|
|
}
|
|
|
|
}
|
2018-06-04 11:20:17 +08:00
|
|
|
|
|
|
|
&.@{tree-prefix-cls}-icon-hide {
|
|
|
|
.@{tree-prefix-cls}-treenode-loading {
|
|
|
|
.@{tree-prefix-cls}-iconEle {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-08 12:36:46 +08:00
|
|
|
|
|
|
|
&.@{tree-prefix-cls}-block-node {
|
|
|
|
li {
|
|
|
|
.@{tree-prefix-cls}-node-content-wrapper {
|
|
|
|
width: ~'calc(100% - 24px)';
|
|
|
|
}
|
|
|
|
span {
|
|
|
|
&.@{tree-prefix-cls}-checkbox {
|
|
|
|
+ .@{tree-prefix-cls}-node-content-wrapper {
|
|
|
|
width: ~'calc(100% - 46px)';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-08-10 20:23:18 +08:00
|
|
|
}
|