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;
|
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-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& {
|
|
|
|
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
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}-focused& {
|
|
|
|
.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 {
|
|
|
|
background: transparent;
|
|
|
|
border: none;
|
|
|
|
outline: 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;
|
2015-07-14 20:16:05 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2015-08-18 00:41:55 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ======================== Selection ========================
|
|
|
|
&-selection-item {
|
2016-07-24 15:15:13 +08:00
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
2019-02-15 10:48:07 +08:00
|
|
|
text-overflow: ellipsis;
|
2015-08-18 00:41:55 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ======================= Placeholder =======================
|
|
|
|
&-selection-placeholder {
|
|
|
|
opacity: 0.4;
|
2016-11-14 20:15:51 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ========================== Arrow ==========================
|
|
|
|
&-arrow {
|
|
|
|
.iconfont-mixin();
|
2017-09-23 12:11:17 +08:00
|
|
|
|
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;
|
2019-09-28 11:31:28 +08:00
|
|
|
// transform-origin: 50% 50%;
|
2019-09-12 20:15:17 +08:00
|
|
|
pointer-events: none;
|
2016-05-27 15:00:22 +08:00
|
|
|
|
2019-09-28 11:31:28 +08:00
|
|
|
.anticon {
|
|
|
|
transition: transform 0.3s;
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-open &.anticon-down {
|
|
|
|
transform: rotate(180deg);
|
|
|
|
}
|
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;
|
|
|
|
background: @component-background;
|
|
|
|
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;
|
2015-06-15 19:29:32 +08:00
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
position: absolute;
|
|
|
|
top: -9999px;
|
|
|
|
left: -9999px;
|
|
|
|
z-index: @zindex-dropdown;
|
|
|
|
box-sizing: border-box;
|
|
|
|
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;
|
|
|
|
}
|
2015-10-22 18:27:17 +08:00
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ========================= Options =========================
|
|
|
|
&-item {
|
|
|
|
position: relative;
|
|
|
|
display: block;
|
|
|
|
min-height: 32px;
|
|
|
|
padding: 5px @control-padding-horizontal;
|
|
|
|
color: @text-color;
|
|
|
|
font-weight: normal;
|
|
|
|
line-height: 22px;
|
|
|
|
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;
|
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) {
|
|
|
|
background-color: @item-hover-bg;
|
2018-02-27 17:21:33 +08:00
|
|
|
}
|
|
|
|
|
2019-05-08 15:53:32 +08:00
|
|
|
&-selected {
|
|
|
|
color: @text-color;
|
|
|
|
font-weight: @select-item-selected-font-weight;
|
2019-08-23 22:19:04 +08:00
|
|
|
background-color: @select-item-selected-bg;
|
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-09-12 20:15:17 +08:00
|
|
|
// ============================================================
|
|
|
|
// == Size ==
|
|
|
|
// ============================================================
|
|
|
|
&-lg {
|
|
|
|
font-size: @font-size-lg;
|
2015-06-09 21:16:59 +08:00
|
|
|
}
|
2015-06-14 15:52:47 +08:00
|
|
|
}
|