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.

485 lines
9.3 KiB

@select-prefix-cls: ant-select;
@duration: .3s;
10 years ago
@import "../mixins/iconfont";
//mixin
10 years ago
.selection__clear() {
cursor: pointer;
float: right;
font-weight: bold;
}
.selected_icon() {
position: relative;
&:after {
.iconfont-size-under-12px(9px);
display: inline-block;
9 years ago
content: '\e62e';
font-family: 'anticon';
font-weight: bold;
position: absolute;
top: 7px;
right: -1px;
padding-right: 14px;
color: @primary-color;
transform: scale(0.75);
}
}
.@{select-prefix-cls} {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle;
color: #666;
10 years ago
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;
}
10 years ago
&:before {
9 years ago
content: '\e603';
transition: transform 0.2s ease;
}
}
&-selection {
outline: none;
user-select: none;
box-sizing: border-box;
display: block;
background-color: #fff;
9 years ago
border-radius: @border-radius-base;
border: 1px solid #d9d9d9;
.transition(all .3s @ease-in-out);
&:hover {
.hover;
}
&:active {
.active;
}
}
10 years ago
&-disabled {
color: #ccc;
}
&-disabled &-selection {
&:hover,
&:active {
10 years ago
border-color: #d9d9d9;
}
}
&-disabled &-selection--single {
cursor: not-allowed;
}
&-selection--single {
height: 28px;
cursor: pointer;
.@{select-prefix-cls}-selection__rendered {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 10px;
padding-right: 24px;
line-height: 26px;
}
.@{select-prefix-cls}-selection__clear {
.selection__clear();
}
.@{select-prefix-cls}-selection__placeholder {
color: #ccc;
}
}
&-lg {
.ant-select-selection--single {
9 years ago
height: 32px;
.ant-select-selection__rendered {
9 years ago
line-height: 30px;
}
}
.ant-select-selection--multiple {
9 years ago
min-height: 32px;
.ant-select-selection__rendered {
li {
9 years ago
height: 24px;
.ant-select-selection__choice__content {
9 years ago
font-size: 14px;
line-height: 24px;
}
}
}
}
}
&-sm {
.ant-select-selection--single {
9 years ago
height: 22px;
.ant-select-selection__rendered {
9 years ago
line-height: 20px;
}
}
.ant-select-selection--multiple {
9 years ago
min-height: 22px;
.ant-select-selection__rendered {
li {
9 years ago
height: 14px;
.ant-select-selection__choice__content {
9 years ago
line-height: 14px;
position: relative;
top: -3px;
}
.ant-select-selection__choice__remove {
position: relative;
top: -4px;
}
9 years ago
}
}
}
}
10 years ago
&-disabled &-selection__choice__remove {
color: #ccc;
cursor: default;
&:hover {
color: #ccc;
}
}
9 years ago
&-search__field__wrap {
display: inline-block;
position: relative;
}
9 years ago
&-search__field__placeholder {
position: absolute;
top: 0;
left: 3px;
color: #aaa;
}
10 years ago
&-search--inline {
float: left;
9 years ago
.@{select-prefix-cls}-search__field__wrap {
width: 100%;
}
.@{select-prefix-cls}-search__field {
border: 0;
10 years ago
font-size: 100%;
background: transparent;
outline: 0;
}
> i {
float: right;
}
}
&-selection--multiple {
10 years ago
min-height: 28px;
cursor: text;
9 years ago
.@{select-prefix-cls}-search__field__placeholder {
top: 6px;
left: 10px;
9 years ago
}
.@{select-prefix-cls}-search--inline {
10 years ago
width: auto;
.@{select-prefix-cls}-search__field {
10 years ago
width: 0.75em;
}
}
.@{select-prefix-cls}-selection__rendered {
overflow: hidden;
text-overflow: ellipsis;
padding-left: 6px;
padding-bottom: 4px;
}
.@{select-prefix-cls}-selection__clear {
.selection__clear();
margin-top: 5px;
margin-right: 10px;
}
10 years ago
> ul > li {
margin-top: 4px;
height: 20px;
line-height: 20px;
}
.@{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;
&:hover {
padding: 0 20px 0 10px;
.@{select-prefix-cls}-selection__choice__remove {
transform: scale(1);
opacity: 1;
}
}
}
.@{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;
}
.@{select-prefix-cls}-selection__choice__remove {
10 years ago
.iconfont-mixin();
color: #919191;
line-height: 20px;
cursor: pointer;
display: inline-block;
font-weight: bold;
.iconfont-size-under-12px(8px);
position: absolute;
right: 4px;
padding: 0 0 0 8px;
transform: scale(0);
opacity: 0;
transition: opacity @duration, transform @duration;
transform-origin: 50%;
&:hover {
color: #333;
}
10 years ago
&:before {
9 years ago
content: "\e62d";
10 years ago
}
}
}
9 years ago
&-open {
.@{select-prefix-cls}-arrow {
.ie-rotate(2);
-ms-transform: rotate(180deg);
&:before {
.rotate(180deg);
}
}
9 years ago
.@{select-prefix-cls}-selection {
.active();
}
}
9 years ago
&-combobox {
.@{select-prefix-cls}-arrow {
display: none;
}
9 years ago
.@{select-prefix-cls}-search--inline {
height: 100%;
float: none;
}
.@{select-prefix-cls}-search__field__placeholder {
left: 10px;
cursor: text;
}
.@{select-prefix-cls}-search__field__wrap {
width: 100%;
height: 100%;
}
.@{select-prefix-cls}-search__field {
padding: 0 10px;
width: 100%;
height: 100%;
position: relative;
z-index: 1;
}
.@{select-prefix-cls}-selection__rendered {
padding: 0;
height: 100%;
}
}
}
.@{select-prefix-cls}-dropdown {
9 years ago
&.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
&.slide-up-appear.slide-up-appear-active&-placement-bottomLeft {
animation-name: antSlideUpIn;
}
9 years ago
&.slide-up-enter.slide-up-enter-active&-placement-topLeft,
&.slide-up-appear.slide-up-appear-active&-placement-topLeft {
animation-name: antSlideDownIn;
}
9 years ago
&.slide-up-leave.slide-up-leave-active&-placement-bottomLeft {
animation-name: antSlideUpOut;
}
9 years ago
&.slide-up-leave.slide-up-leave-active&-placement-topLeft {
animation-name: antSlideDownOut;
}
&-menu-item {
transition: background 0.3s ease;
}
9 years ago
&--single &-menu-item-selected {
.selected_icon();
9 years ago
}
&--multiple &-menu-item-selected {
.selected_icon();
}
&-hidden {
display: none;
}
background-color: white;
border: 1px solid #d9d9d9;
box-shadow: @box-shadow-base;
border-radius: @border-radius-base;
9 years ago
box-sizing: border-box;
z-index: 1070;
9 years ago
left: -9999px;
top: -9999px;
position: absolute;
outline: none;
overflow: hidden;
font-size: @font-size-base;
9 years ago
&-menu {
outline: none;
9 years ago
margin-bottom: 0;
padding-left: 0; // Override default ul/ol
list-style: none;
max-height: 250px;
overflow: auto;
10 years ago
9 years ago
&-item-group-list {
margin: 0;
padding: 0;
> .@{select-prefix-cls}-dropdown-menu-item {
padding-left: 24px;
10 years ago
}
9 years ago
}
10 years ago
9 years ago
&-item-group-title {
color: #999;
line-height: 1.5;
padding: 8px 16px;
}
9 years ago
9 years ago
&-item {
position: relative;
display: block;
9 years ago
padding: 7px 33px 7px 16px;
9 years ago
font-weight: normal;
color: #666;
white-space: nowrap;
cursor: pointer;
9 years ago
overflow: hidden;
9 years ago
9 years ago
&: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 {
9 years ago
background-color: tint(@primary-color, 90%) !important;
9 years ago
}
9 years ago
&-disabled {
color: #ccc;
cursor: not-allowed;
10 years ago
9 years ago
&:hover {
10 years ago
color: #ccc;
9 years ago
background-color: #fff;
10 years ago
cursor: not-allowed;
}
9 years ago
}
10 years ago
9 years ago
&-divider {
height: 1px;
margin: 1px 0;
overflow: hidden;
background-color: #e5e5e5;
line-height: 0;
10 years ago
}
}
}
&-container-open,
&-open {
.@{select-prefix-cls}-dropdown {
10 years ago
display: block;
}
}
9 years ago
.@{select-prefix-cls}-dropdown-search {
display: block;
padding: 4px;
.@{select-prefix-cls}-search__field__placeholder {
left: 7px;
9 years ago
top: 5px;
}
.@{select-prefix-cls}-search__field__wrap {
width: 100%;
}
.@{select-prefix-cls}-search__field {
padding: 4px 7px;
width: 100%;
box-sizing: border-box;
border: 1px solid #d9d9d9;
border-radius: 4px;
outline: none;
}
&.@{select-prefix-cls}-search--hide {
display: none;
}
}
10 years ago
}