ant-design/style/components/treeSelect.less

570 lines
12 KiB
Plaintext
Raw Normal View History

2015-12-31 14:38:35 +08:00
@tree-select-tree-prefix-cls: ant-tree-select-tree;
.antCheckboxFn(@checkbox-prefix-cls: ant-tree-select-tree-checkbox);
@import "../mixins/iconfont";
2016-01-28 15:29:29 +08:00
2015-12-31 14:38:35 +08:00
.@{tree-select-tree-prefix-cls} {
margin: 0;
2016-01-28 19:16:24 +08:00
padding: 8px;
2015-12-31 14:38:35 +08:00
font-size: 12px;
li {
padding: 0;
2016-01-30 16:53:49 +08:00
margin: 8px 0;
2015-12-31 14:38:35 +08:00
list-style: none;
white-space: nowrap;
outline: 0;
2016-01-07 19:05:55 +08:00
&.filter-node {
> a {
2016-01-28 15:29:29 +08:00
color: @error-color!important;
2016-01-07 19:05:55 +08:00
font-weight: bold!important;
}
}
2015-12-31 14:38:35 +08:00
ul {
margin: 0;
padding: 0 0 0 18px;
}
a {
display: inline-block;
2016-01-28 15:29:29 +08:00
padding: 1px 5px;
2015-12-31 14:38:35 +08:00
border-radius: 2px;
margin: 0;
cursor: pointer;
text-decoration: none;
vertical-align: top;
color: #666;
2016-01-30 16:53:49 +08:00
transition: all 0.3s ease;
&:hover {
background-color: tint(@primary-color, 90%);
}
&.@{tree-select-tree-prefix-cls}-node-selected {
background-color: tint(@primary-color, 80%);
}
2015-12-31 14:38:35 +08:00
}
span {
&.@{tree-select-tree-prefix-cls}-checkbox {
2016-01-30 16:53:49 +08:00
margin: 2px 4px 0 0;
2015-12-31 14:38:35 +08:00
}
&.@{tree-select-tree-prefix-cls}-switcher,
&.@{tree-select-tree-prefix-cls}-iconEle {
margin: 0;
width: 16px;
2016-01-30 16:53:49 +08:00
height: 16px;
line-height: 16px;
2015-12-31 14:38:35 +08:00
display: inline-block;
vertical-align: middle;
border: 0 none;
cursor: pointer;
outline: none;
}
&.@{tree-select-tree-prefix-cls}-icon_loading {
&:after {
content: '\e6a1';
display: inline-block;
font-family: 'anticon';
font-weight: bold;
.animation(loadingCircle 1s infinite linear);
margin-top: 8px;
}
}
&.@{tree-select-tree-prefix-cls}-switcher {
&.@{tree-select-tree-prefix-cls}-roots_open,
&.@{tree-select-tree-prefix-cls}-center_open,
&.@{tree-select-tree-prefix-cls}-bottom_open,
&.@{tree-select-tree-prefix-cls}-noline_open {
.antTreeSwitcherIcon();
}
&.@{tree-select-tree-prefix-cls}-roots_close,
&.@{tree-select-tree-prefix-cls}-center_close,
&.@{tree-select-tree-prefix-cls}-bottom_close,
&.@{tree-select-tree-prefix-cls}-noline_close {
.antTreeSwitcherIcon();
.ie-rotate(3);
&:after {
transform: rotate(270deg) scale(0.5);
}
}
}
}
}
&-child-tree {
display: none;
&-open {
display: block;
}
}
&-treenode-disabled {
>span,
2016-01-07 19:05:55 +08:00
>a,
>a span {
color: #ccc;
cursor: not-allowed;
2015-12-31 14:38:35 +08:00
}
}
&-icon__open {
margin-right: 2px;
vertical-align: top;
}
&-icon__close {
margin-right: 2px;
vertical-align: top;
}
}
@tree-select-prefix-cls: ant-tree-select;
@duration: .3s;
@import "../mixins/iconfont";
//mixin
.selection__clear() {
cursor: pointer;
float: right;
font-weight: bold;
}
.@{tree-select-prefix-cls} {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
color: #666;
font-size: @font-size-base;
> ul > li > a {
padding: 0;
background-color: #fff;
}
// arrow
&-arrow {
.iconfont-mixin();
position: absolute;
top: 50%;
right: 8px;
line-height: 1;
margin-top: -5px;
.iconfont-size-under-12px(8px);
* {
display: none;
}
&:before {
content: '\e603';
transition: transform 0.2s ease;
}
}
&-selection {
outline: none;
user-select: none;
box-sizing: border-box;
display: block;
background-color: #fff;
border-radius: @border-radius-base;
2016-01-30 16:53:49 +08:00
border: 1px solid @border-color-base;
2015-12-31 14:38:35 +08:00
.transition(all .3s @ease-in-out);
&:hover {
.hover;
}
&:active {
.active;
}
}
&-disabled {
color: #ccc;
}
&-disabled &-selection {
&:hover,
&:active {
2016-01-30 16:53:49 +08:00
border-color: @border-color-base;
2015-12-31 14:38:35 +08:00
}
}
&-disabled &-selection--single {
2016-02-02 14:06:37 +08:00
background: #f4f4f4;
2015-12-31 14:38:35 +08:00
cursor: not-allowed;
}
&-selection--single {
height: 28px;
cursor: pointer;
.@{tree-select-prefix-cls}-selection__rendered {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 8px;
padding-right: 24px;
line-height: 26px;
}
.@{tree-select-prefix-cls}-selection__clear {
.selection__clear();
}
.@{tree-select-prefix-cls}-selection__placeholder {
color: #ccc;
}
}
&-lg {
.@{tree-select-prefix-cls}-selection--single {
2015-12-31 14:38:35 +08:00
height: 32px;
.@{tree-select-prefix-cls}-selection__rendered {
2015-12-31 14:38:35 +08:00
line-height: 30px;
}
}
.@{tree-select-prefix-cls}-selection--multiple {
2015-12-31 14:38:35 +08:00
min-height: 32px;
.@{tree-select-prefix-cls}-selection__rendered {
2015-12-31 14:38:35 +08:00
li {
height: 24px;
.@{tree-select-prefix-cls}-selection__choice__content {
2015-12-31 14:38:35 +08:00
font-size: 14px;
line-height: 24px;
}
}
}
}
}
&-sm {
.@{tree-select-prefix-cls}-selection {
border-radius: @border-radius-sm;
}
.@{tree-select-prefix-cls}-selection--single {
2015-12-31 14:38:35 +08:00
height: 22px;
.@{tree-select-prefix-cls}-selection__rendered {
2015-12-31 14:38:35 +08:00
line-height: 20px;
}
}
.@{tree-select-prefix-cls}-selection--multiple {
2015-12-31 14:38:35 +08:00
min-height: 22px;
.@{tree-select-prefix-cls}-selection__rendered {
2015-12-31 14:38:35 +08:00
li {
height: 14px;
.@{tree-select-prefix-cls}-selection__choice__content {
2015-12-31 14:38:35 +08:00
line-height: 14px;
position: relative;
top: -3px;
}
.@{tree-select-prefix-cls}-selection__choice__remove {
2015-12-31 14:38:35 +08:00
position: relative;
top: -4px;
}
}
}
}
}
&-disabled &-selection__choice__remove {
color: #ccc;
cursor: default;
&:hover {
color: #ccc;
}
}
&-search__field__wrap {
display: inline-block;
position: relative;
}
&-search__field__placeholder {
position: absolute;
top: 0;
left: 3px;
color: #aaa;
}
&-search--inline {
float: left;
.@{tree-select-prefix-cls}-search__field__wrap {
width: 100%;
}
.@{tree-select-prefix-cls}-search__field {
border: 0;
font-size: 100%;
background: transparent;
outline: 0;
}
> i {
float: right;
}
}
&-selection--multiple {
min-height: 28px;
cursor: text;
.@{tree-select-prefix-cls}-search__field__placeholder {
top: 6px;
left: 10px;
}
.@{tree-select-prefix-cls}-search--inline {
width: auto;
.@{tree-select-prefix-cls}-search__field {
width: 0.75em;
}
}
.@{tree-select-prefix-cls}-selection__rendered {
overflow: hidden;
text-overflow: ellipsis;
padding-left: 6px;
padding-bottom: 4px;
}
.@{tree-select-prefix-cls}-selection__clear {
.selection__clear();
margin-top: 5px;
margin-right: 10px;
}
> ul > li {
margin-top: 4px;
height: 20px;
line-height: 20px;
}
.@{tree-select-prefix-cls}-selection__choice {
background-color: #f3f3f3;
border-radius: 4px;
cursor: default;
float: left;
padding: 0 15px;
margin-right: 4px;
max-width: 99%;
position: relative;
overflow: hidden;
transition: padding @duration @ease-in-out;
padding: 0 20px 0 10px;
}
.@{tree-select-prefix-cls}-selection__choice__content {
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
transition: margin @duration @ease-in-out;
}
.@{tree-select-prefix-cls}-selection__choice__remove {
.iconfont-mixin();
color: #999;
line-height: 20px;
cursor: pointer;
display: inline-block;
font-weight: bold;
transition: all 0.3s @ease-in-out;
.iconfont-size-under-12px(8px);
position: absolute;
right: 4px;
padding: 0 0 0 8px;
&:hover {
color: #404040;
}
&:before {
content: "\e62d";
}
}
}
&-open {
.@{tree-select-prefix-cls}-arrow {
.ie-rotate(2);
-ms-transform: rotate(180deg);
&:before {
.rotate(180deg);
}
}
.@{tree-select-prefix-cls}-selection {
.active();
}
}
&-combobox {
.@{tree-select-prefix-cls}-arrow {
display: none;
}
.@{tree-select-prefix-cls}-search--inline {
height: 100%;
float: none;
}
.@{tree-select-prefix-cls}-search__field__placeholder {
left: 10px;
cursor: text;
}
.@{tree-select-prefix-cls}-search__field__wrap {
width: 100%;
height: 100%;
}
.@{tree-select-prefix-cls}-search__field {
padding: 0 10px;
width: 100%;
height: 100%;
position: relative;
z-index: 1;
}
.@{tree-select-prefix-cls}-selection__rendered {
padding: 0;
height: 100%;
}
}
}
.@{tree-select-prefix-cls}-dropdown {
&.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
&.slide-up-appear.slide-up-appear-active&-placement-bottomLeft {
animation-name: antSlideUpIn;
}
&.slide-up-enter.slide-up-enter-active&-placement-topLeft,
&.slide-up-appear.slide-up-appear-active&-placement-topLeft {
animation-name: antSlideDownIn;
}
&.slide-up-leave.slide-up-leave-active&-placement-bottomLeft {
animation-name: antSlideUpOut;
}
&.slide-up-leave.slide-up-leave-active&-placement-topLeft {
animation-name: antSlideDownOut;
}
&-hidden {
display: none;
}
background-color: white;
2016-01-30 16:53:49 +08:00
border: 1px solid @border-color-base;
2015-12-31 14:38:35 +08:00
box-shadow: @box-shadow-base;
border-radius: @border-radius-base;
box-sizing: border-box;
z-index: 1070;
left: -9999px;
top: -9999px;
position: absolute;
outline: none;
overflow: hidden;
font-size: @font-size-base;
&-menu {
outline: none;
margin-bottom: 0;
padding-left: 0; // Override default ul/ol
list-style: none;
max-height: 250px;
overflow: auto;
&-item-group-list {
margin: 0;
padding: 0;
> .@{tree-select-prefix-cls}-dropdown-menu-item {
padding-left: 24px;
}
}
&-item-group-title {
color: #999;
line-height: 1.5;
padding: 8px 15px;
}
&-item {
position: relative;
display: block;
padding: 7px 15px;
font-weight: normal;
color: #666;
white-space: nowrap;
cursor: pointer;
overflow: hidden;
transition: background 0.3s ease;
&:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
&:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
&:hover,
&-active {
background-color: tint(@primary-color, 90%);
}
&-selected {
background-color: tint(@primary-color, 80%);
&:hover {
background-color: tint(@primary-color, 80%);
}
}
&-disabled {
color: #ccc;
cursor: not-allowed;
&:hover {
color: #ccc;
background-color: #fff;
cursor: not-allowed;
}
}
&-divider {
height: 1px;
margin: 1px 0;
overflow: hidden;
background-color: #e5e5e5;
line-height: 0;
}
}
}
&-container-open,
&-open {
.@{tree-select-prefix-cls}-dropdown {
display: block;
}
}
.@{tree-select-prefix-cls}-dropdown-search {
display: block;
padding: 4px;
.@{tree-select-prefix-cls}-search__field__placeholder {
left: 7px;
top: 5px;
}
.@{tree-select-prefix-cls}-search__field__wrap {
width: 100%;
}
.@{tree-select-prefix-cls}-search__field {
padding: 4px 7px;
width: 100%;
box-sizing: border-box;
2016-01-30 16:53:49 +08:00
border: 1px solid @border-color-base;
2015-12-31 14:38:35 +08:00
border-radius: 4px;
outline: none;
}
&.@{tree-select-prefix-cls}-search--hide {
display: none;
}
}
}