@import "../../style/themes/default";
@import "../../style/mixins/index";
@import "../../checkbox/style/mixin";
@import "./mixin";
@tree-prefix-cls: ~"@{ant-prefix}-tree";
@tree-showline-icon-color: @text-color-secondary;
.antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-tree-checkbox");
.@{tree-prefix-cls} {
    margin: 0;
    padding: 0;
    font-size: @font-size-base;
    span[draggable="true"] {
        user-select: none;
        border-top: 2px transparent solid;
        border-bottom: 2px transparent solid;
        margin-top: -2px;
        /* Required to make elements draggable in old WebKit */
        -khtml-user-drag: element;
        -webkit-user-drag: element;
    }
    .node-drop-slot {
        display: block;
        height: 2px;
        &.is-dragging-over {
            background-color: @primary-color;
        }
    }
    &-node {
        padding: 4px 0;
        margin: 0;
        list-style: none;
        white-space: nowrap;
        outline: 0;
        position: relative;
        .tree-children {
            margin: 0;
            padding: 0 0 0 18px;
            overflow: hidden;
        }
        .tree-node-loading {
            position: absolute;
            left: 1px;
            top: 5px;
            background: #fff;
            transition: all .3s;
            width: 24px;
            height: 24px;
            line-height: 24px;
            display: inline-block;
            vertical-align: middle;
            text-align: center;
            &:after {
                display: inline-block;
                .iconfont-font("\e6ae");
                animation: loadingCircle 1s infinite linear;
                color: @primary-color;
            }
        }
    }
    .@{tree-prefix-cls}-node-content-wrapper {
        display: inline-block;
        padding: 3px 5px;
        border-radius: @border-radius-sm;
        margin: 0;
        cursor: pointer;
        text-decoration: none;
        vertical-align: top;
        color: @text-color;
        transition: all .3s;
        position: relative;
        user-select: none;
        &:hover {
            background-color: @item-hover-bg;
        }
        &.@{tree-prefix-cls}-node-selected {
            background-color: @primary-2;
        }
        &.is-dragging-over {
            background-color: @primary-color;
            color: white;
            opacity: 0.8;
        }
    }
    span {
        &.@{tree-prefix-cls}-checkbox {
            margin: 0 4px 0 2px;
            vertical-align: middle;
        }
        &.@{tree-prefix-cls}-switcher,
        &.@{tree-prefix-cls}-iconEle {
            margin: 0;
            width: 24px;
            height: 24px;
            line-height: 24px;
            display: inline-block;
            vertical-align: middle;
            border: 0 none;
            cursor: pointer;
            outline: none;
            text-align: center;
        }
        &.@{tree-prefix-cls}-icon_loading {
            position: absolute;
            left: 0;
            top: 1px;
            background: #fff;
            transform: translateX(-100%);
            transition: all .3s;
            &:after {
                display: inline-block;
                .iconfont-font("\e6ae");
                animation: loadingCircle 1s infinite linear;
                color: @primary-color;
            }
        }
        &.@{tree-prefix-cls}-switcher {
            &.@{tree-prefix-cls}-switcher-noop {
                cursor: default;
            }
            &.@{tree-prefix-cls}-switcher_open {
                .antTreeSwitcherIcon();
            }
            &.@{tree-prefix-cls}-switcher_close {
                .antTreeSwitcherIcon();
                .ie-rotate(3);
                &:after {
                    transform: rotate(270deg) scale(0.59);
                }
            }
        }
    }
    &:last-child>span {
        &.@{tree-prefix-cls}-switcher,
        &.@{tree-prefix-cls}-iconEle {
            &:before {
                display: none;
            }
        }
    } // Tree with line
    &&-show-line {
        .ant-tree-node {
            position: relative;
            user-select: none;
            span {
                &.@{tree-prefix-cls}-switcher {
                    background: @component-background;
                    color: @text-color;
                    &.@{tree-prefix-cls}-switcher-noop {
                        .antTreeShowLineIcon("tree-doc-icon");
                    }
                    &.@{tree-prefix-cls}-switcher_open {
                        color: @tree-showline-icon-color;
                        .antTreeShowLineIcon("tree-showline-open-icon");
                    }
                    &.@{tree-prefix-cls}-switcher_close {
                        color: @tree-showline-icon-color;
                        .antTreeShowLineIcon("tree-showline-close-icon");
                    }
                }
            }
        }
        tree-node:not(:last-child) .ant-tree-node:before {
            content: ' ';
            width: 1px;
            border-left: 1px solid @border-color-base;
            height: 100%;
            position: absolute;
            left: 11px;
            margin: 24px 0;
        }
    }
}
