2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 20:02:01 +08:00
|
|
|
@import '../../style/mixins/index';
|
|
|
|
@import '../../input/style/mixin';
|
2015-12-02 14:59:48 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
@import './single';
|
|
|
|
@import './multiple';
|
2016-02-26 17:12:56 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
@select-prefix-cls: ~'@{ant-prefix}-select';
|
|
|
|
@select-height-without-border: @input-height-base - 2 * @border-width-base;
|
2020-03-16 15:15:28 +08:00
|
|
|
@select-dropdown-edge-child-vertical-padding: @dropdown-edge-child-vertical-padding;
|
2019-04-15 10:52:00 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.select-selector() {
|
2015-06-09 21:16:59 +08:00
|
|
|
position: relative;
|
2019-11-06 11:23:40 +08:00
|
|
|
background-color: @select-background;
|
2019-09-12 20:15:17 +08:00
|
|
|
border: @border-width-base @border-style-base @select-border-color;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
transition: all 0.3s @ease-in-out;
|
2015-07-09 17:47:21 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
input {
|
|
|
|
cursor: pointer;
|
2015-06-09 21:16:59 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}-show-search& {
|
2020-03-30 16:16:51 +08:00
|
|
|
cursor: text;
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
input {
|
|
|
|
cursor: auto;
|
2016-10-19 14:27:38 +08:00
|
|
|
}
|
2015-06-11 19:23:35 +08:00
|
|
|
}
|
2018-05-06 14:54:27 +08:00
|
|
|
|
2020-08-28 23:08:33 +08:00
|
|
|
.@{select-prefix-cls}-focused:not(.@{select-prefix-cls}-disabled)& {
|
2019-09-12 20:15:17 +08:00
|
|
|
.active();
|
2018-05-06 14:54:27 +08:00
|
|
|
}
|
2015-06-11 19:23:35 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}-disabled& {
|
2017-01-01 22:20:06 +08:00
|
|
|
color: @disabled-color;
|
2017-04-29 04:04:41 +08:00
|
|
|
background: @input-disabled-bg;
|
2016-02-05 13:55:14 +08:00
|
|
|
cursor: not-allowed;
|
2015-06-15 19:29:32 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
input {
|
|
|
|
cursor: not-allowed;
|
2015-08-08 19:11:10 +08:00
|
|
|
}
|
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
2015-08-08 19:11:10 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
/* Reset search input style */
|
|
|
|
.select-search-input-without-border() {
|
|
|
|
.@{select-prefix-cls}-selection-search-input {
|
2020-06-01 10:59:30 +08:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2019-09-12 20:15:17 +08:00
|
|
|
background: transparent;
|
|
|
|
border: none;
|
|
|
|
outline: none;
|
2020-09-05 00:38:39 +08:00
|
|
|
appearance: none;
|
|
|
|
|
|
|
|
&::-webkit-search-cancel-button {
|
|
|
|
display: none;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
}
|
2015-08-08 19:11:10 +08:00
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
2015-08-08 19:11:10 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls} {
|
|
|
|
.reset-component;
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2020-03-30 16:16:51 +08:00
|
|
|
cursor: pointer;
|
2019-12-20 18:29:39 +08:00
|
|
|
|
|
|
|
&:not(.@{select-prefix-cls}-disabled):hover &-selector {
|
|
|
|
.hover();
|
|
|
|
}
|
2015-08-18 00:41:55 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ======================== Selection ========================
|
|
|
|
&-selection-item {
|
2020-03-09 19:31:58 +08:00
|
|
|
flex: 1;
|
2016-07-24 15:15:13 +08:00
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
2019-02-15 10:48:07 +08:00
|
|
|
text-overflow: ellipsis;
|
2020-04-08 12:31:37 +08:00
|
|
|
|
|
|
|
// IE11 css hack. `*::-ms-backdrop,` is a must have
|
|
|
|
@media all and (-ms-high-contrast: none) {
|
|
|
|
*::-ms-backdrop,
|
|
|
|
& {
|
|
|
|
flex: auto;
|
|
|
|
}
|
|
|
|
}
|
2015-08-18 00:41:55 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ======================= Placeholder =======================
|
|
|
|
&-selection-placeholder {
|
2020-03-09 19:31:58 +08:00
|
|
|
flex: 1;
|
2020-01-14 11:45:26 +08:00
|
|
|
overflow: hidden;
|
2020-09-09 14:55:59 +08:00
|
|
|
color: @input-placeholder-color;
|
2020-01-14 11:45:26 +08:00
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2020-04-08 12:31:37 +08:00
|
|
|
|
|
|
|
// IE11 css hack. `*::-ms-backdrop,` is a must have
|
|
|
|
@media all and (-ms-high-contrast: none) {
|
|
|
|
*::-ms-backdrop,
|
|
|
|
& {
|
|
|
|
flex: auto;
|
|
|
|
}
|
|
|
|
}
|
2016-11-14 20:15:51 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ========================== Arrow ==========================
|
|
|
|
&-arrow {
|
|
|
|
.iconfont-mixin();
|
2016-10-13 15:54:25 +08:00
|
|
|
position: absolute;
|
2019-09-28 11:31:28 +08:00
|
|
|
top: 53%;
|
2019-09-12 20:15:17 +08:00
|
|
|
right: @control-padding-horizontal - 1px;
|
|
|
|
width: @font-size-sm;
|
|
|
|
height: @font-size-sm;
|
|
|
|
margin-top: -@font-size-sm / 2;
|
|
|
|
color: @disabled-color;
|
|
|
|
font-size: @font-size-sm;
|
|
|
|
line-height: 1;
|
|
|
|
text-align: center;
|
2020-04-21 18:03:47 +08:00
|
|
|
pointer-events: none;
|
2016-05-27 15:00:22 +08:00
|
|
|
|
2020-04-21 18:03:47 +08:00
|
|
|
.@{iconfont-css-prefix} {
|
2019-12-20 18:29:39 +08:00
|
|
|
vertical-align: top;
|
2019-09-28 11:31:28 +08:00
|
|
|
transition: transform 0.3s;
|
|
|
|
|
2019-12-20 18:29:39 +08:00
|
|
|
> svg {
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
|
2020-06-24 23:28:54 +08:00
|
|
|
&:not(.@{select-prefix-cls}-suffix) {
|
2020-04-21 18:03:47 +08:00
|
|
|
pointer-events: auto;
|
|
|
|
}
|
2020-04-15 11:29:38 +08:00
|
|
|
}
|
2020-08-04 11:48:13 +08:00
|
|
|
|
|
|
|
.@{select-prefix-cls}-disabled & {
|
|
|
|
cursor: not-allowed;
|
|
|
|
}
|
2015-07-14 20:16:05 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ========================== Clear ==========================
|
|
|
|
&-clear {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
right: @control-padding-horizontal - 1px;
|
|
|
|
z-index: 1;
|
|
|
|
display: inline-block;
|
|
|
|
width: @font-size-sm;
|
|
|
|
height: @font-size-sm;
|
|
|
|
margin-top: -@font-size-sm / 2;
|
|
|
|
color: @disabled-color;
|
|
|
|
font-size: @font-size-sm;
|
|
|
|
font-style: normal;
|
|
|
|
line-height: 1;
|
|
|
|
text-align: center;
|
|
|
|
text-transform: none;
|
2019-12-04 12:28:37 +08:00
|
|
|
background: @select-clear-background;
|
2019-09-12 20:15:17 +08:00
|
|
|
cursor: pointer;
|
|
|
|
opacity: 0;
|
|
|
|
transition: color 0.3s ease, opacity 0.15s ease;
|
|
|
|
text-rendering: auto;
|
|
|
|
&::before {
|
|
|
|
display: block;
|
2015-07-15 19:59:54 +08:00
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
&:hover {
|
|
|
|
color: @text-color-secondary;
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}:hover & {
|
|
|
|
opacity: 1;
|
2017-09-27 22:32:49 +08:00
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
2017-09-27 22:32:49 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ========================== Popup ==========================
|
|
|
|
&-dropdown {
|
|
|
|
.reset-component;
|
|
|
|
position: absolute;
|
|
|
|
top: -9999px;
|
|
|
|
left: -9999px;
|
|
|
|
z-index: @zindex-dropdown;
|
|
|
|
box-sizing: border-box;
|
2020-03-16 15:15:28 +08:00
|
|
|
padding: @select-dropdown-edge-child-vertical-padding 0;
|
2019-09-12 20:15:17 +08:00
|
|
|
overflow: hidden;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
// Fix select render lag of long text in chrome
|
|
|
|
// https://github.com/ant-design/ant-design/issues/11456
|
|
|
|
// https://github.com/ant-design/ant-design/issues/11843
|
|
|
|
font-variant: initial;
|
|
|
|
background-color: @select-dropdown-bg;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
outline: none;
|
|
|
|
box-shadow: @box-shadow-base;
|
2015-09-10 12:07:58 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
|
|
|
|
&.slide-up-appear.slide-up-appear-active&-placement-bottomLeft {
|
|
|
|
animation-name: antSlideUpIn;
|
2015-06-09 21:16:59 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&.slide-up-enter.slide-up-enter-active&-placement-topLeft,
|
|
|
|
&.slide-up-appear.slide-up-appear-active&-placement-topLeft {
|
|
|
|
animation-name: antSlideDownIn;
|
2015-06-09 21:16:59 +08:00
|
|
|
}
|
2017-03-27 17:37:39 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&.slide-up-leave.slide-up-leave-active&-placement-bottomLeft {
|
|
|
|
animation-name: antSlideUpOut;
|
2017-03-27 17:37:39 +08:00
|
|
|
}
|
2018-04-28 23:38:05 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&.slide-up-leave.slide-up-leave-active&-placement-topLeft {
|
|
|
|
animation-name: antSlideDownOut;
|
2015-07-21 10:59:47 +08:00
|
|
|
}
|
2015-07-20 21:32:31 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&-hidden {
|
2015-08-20 17:27:40 +08:00
|
|
|
display: none;
|
|
|
|
}
|
2020-05-19 14:45:57 +08:00
|
|
|
|
|
|
|
&-empty {
|
|
|
|
color: @disabled-color;
|
|
|
|
}
|
2015-10-22 18:27:17 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ========================= Options =========================
|
2019-12-20 18:29:39 +08:00
|
|
|
.item() {
|
2019-09-12 20:15:17 +08:00
|
|
|
position: relative;
|
|
|
|
display: block;
|
2020-03-29 10:39:46 +08:00
|
|
|
min-height: @select-dropdown-height;
|
2019-12-25 19:09:17 +08:00
|
|
|
padding: @select-dropdown-vertical-padding @control-padding-horizontal;
|
2019-09-12 20:15:17 +08:00
|
|
|
color: @text-color;
|
|
|
|
font-weight: normal;
|
2019-12-25 19:09:17 +08:00
|
|
|
font-size: @select-dropdown-font-size;
|
|
|
|
line-height: @select-dropdown-line-height;
|
2019-12-20 18:29:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-item-empty {
|
|
|
|
.item();
|
2020-05-19 14:45:57 +08:00
|
|
|
color: @disabled-color;
|
2019-12-20 18:29:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-item {
|
|
|
|
.item();
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
cursor: pointer;
|
|
|
|
transition: background 0.3s ease;
|
2015-07-14 20:16:05 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// =========== Group ============
|
|
|
|
&-group {
|
2019-02-15 10:48:07 +08:00
|
|
|
color: @text-color-secondary;
|
2017-10-29 14:21:00 +08:00
|
|
|
font-size: @font-size-sm;
|
2020-03-25 11:01:49 +08:00
|
|
|
cursor: default;
|
2015-08-23 15:42:38 +08:00
|
|
|
}
|
2015-08-01 17:51:55 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// =========== Option ===========
|
|
|
|
&-option {
|
|
|
|
display: flex;
|
2018-07-23 18:50:07 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&-content {
|
|
|
|
flex: auto;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2017-05-03 22:57:14 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&-state {
|
|
|
|
flex: none;
|
2018-02-27 18:27:31 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
&-active:not(&-disabled) {
|
2019-10-08 14:48:47 +08:00
|
|
|
background-color: @select-item-active-bg;
|
2018-02-27 17:21:33 +08:00
|
|
|
}
|
|
|
|
|
2019-11-18 22:06:49 +08:00
|
|
|
&-selected:not(&-disabled) {
|
2020-07-07 18:07:42 +08:00
|
|
|
color: @select-item-selected-color;
|
2019-05-08 15:53:32 +08:00
|
|
|
font-weight: @select-item-selected-font-weight;
|
2019-08-23 22:19:04 +08:00
|
|
|
background-color: @select-item-selected-bg;
|
2019-12-23 16:22:59 +08:00
|
|
|
|
|
|
|
.@{select-prefix-cls}-item-option-state {
|
|
|
|
color: @primary-color;
|
|
|
|
}
|
2019-05-08 15:53:32 +08:00
|
|
|
}
|
|
|
|
|
2015-08-23 15:42:38 +08:00
|
|
|
&-disabled {
|
2017-01-01 22:20:06 +08:00
|
|
|
color: @disabled-color;
|
2015-08-23 15:42:38 +08:00
|
|
|
cursor: not-allowed;
|
2016-04-13 17:00:29 +08:00
|
|
|
}
|
2019-12-20 18:29:39 +08:00
|
|
|
|
|
|
|
&-grouped {
|
|
|
|
padding-left: @control-padding-horizontal * 2;
|
|
|
|
}
|
2016-04-13 17:00:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ============================================================
|
|
|
|
// == Size ==
|
|
|
|
// ============================================================
|
|
|
|
&-lg {
|
|
|
|
font-size: @font-size-lg;
|
2015-06-09 21:16:59 +08:00
|
|
|
}
|
2020-02-06 10:02:02 +08:00
|
|
|
|
|
|
|
// no border style
|
|
|
|
&-borderless &-selector {
|
|
|
|
background-color: transparent !important;
|
|
|
|
border-color: transparent !important;
|
|
|
|
box-shadow: none !important;
|
|
|
|
}
|
2015-06-14 15:52:47 +08:00
|
|
|
}
|
2020-03-19 12:13:24 +08:00
|
|
|
|
|
|
|
@import './rtl';
|