add Cascader

add Cascader
This commit is contained in:
梁灏 2016-11-15 19:17:54 +08:00
parent 6ff31952a6
commit c463ab8757
9 changed files with 345 additions and 60 deletions

View file

@ -0,0 +1,85 @@
@cascader-prefix-cls: ~"@{css-prefix}cascader";
@cascader-item-prefix-cls: ~"@{css-prefix}cascader-menu-item";
.@{cascader-prefix-cls} {
position: relative;
.@{css-prefix}input{
display: block;
cursor: pointer;
}
.@{cascader-prefix-cls}-arrow:nth-of-type(1) {
display: none;
cursor: pointer;
}
&:hover {
.@{cascader-prefix-cls}-arrow:nth-of-type(1) {
display: inline-block;
}
}
&-show-clear:hover .@{cascader-prefix-cls}-arrow:nth-of-type(2){
display: none;
}
&-arrow {
position: absolute;
top: 50%;
right: 8px;
line-height: 1;
margin-top: -6px;
font-size: @font-size-base;
color: @subsidiary-color;
.transition(all @transition-time @ease-in-out);
}
.@{select-dropdown-prefix-cls} {
padding: 0;
white-space: nowrap;
}
.select-item(@cascader-prefix-cls, @cascader-item-prefix-cls);
&-menu{
display: inline-block;
min-width: 100px;
height: 180px;
margin: 0;
padding: 5px 0;
vertical-align: top;
list-style: none;
border-right: 1px solid @border-color-split;
overflow: auto;
&:first-child {
}
&:last-child {
border-right-color: transparent;
margin-right: -1px;
}
&:only-child {
}
& &-item{
position: relative;
padding-right: 24px;
.transition(all @transition-time @ease-in-out);
i{
font-size: @font-size-small;
position: absolute;
right: 15px;
top: 50%;
margin-top: -6px;
}
&-active{
background-color: @background-color-select-hover;
font-weight: bold;
}
}
}
}

View file

@ -25,4 +25,5 @@
@import "tooltip";
@import "poptip";
@import "input";
@import "slider";
@import "slider";
@import "cascader";

View file

@ -183,50 +183,7 @@
}
}
.@{select-item-prefix-cls} {
margin: 0;
padding: 7px 16px;
clear: both;
color: @text-color;
font-size: @font-size-small !important;
//border-radius: @btn-border-radius-small;
white-space: nowrap;
cursor: pointer;
.transition(background @transition-time @ease-in-out);
&:hover{
background: @background-color-select-hover;
}
&-focus {
background: @background-color-select-hover;
}
&-disabled {
color: @btn-disable-color;
cursor: @cursor-disabled;
&:hover {
color: @btn-disable-color;
background-color: #fff;
cursor: @cursor-disabled;
}
}
&-selected ,&-selected:hover{
color: #fff;
background: @selected-color;
}
&-selected&-focus {
background: shade(@selected-color, 10%);
}
}
.@{select-prefix-cls}-large .@{select-item-prefix-cls}{
padding: 7px 16px 8px;
font-size: @font-size-base !important;
}
.select-item(@select-prefix-cls, @select-item-prefix-cls);
.@{select-prefix-cls}-multiple .@{select-item-prefix-cls} {
&-selected{