2021-09-07 16:14:20 +08:00
|
|
|
@import (reference) '../../style/themes/index';
|
|
|
|
@select-prefix-cls: ~'@{ant-prefix}-select';
|
2019-09-12 20:15:17 +08:00
|
|
|
|
2020-03-12 21:43:05 +08:00
|
|
|
@selection-item-padding: ceil(@font-size-base * 1.25);
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}-single {
|
|
|
|
// ========================= Selector =========================
|
|
|
|
.@{select-prefix-cls}-selector {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-search {
|
2019-12-30 22:49:19 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: @input-padding-horizontal-base;
|
|
|
|
bottom: 0;
|
|
|
|
left: @input-padding-horizontal-base;
|
2019-09-12 20:15:17 +08:00
|
|
|
|
|
|
|
&-input {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-item,
|
|
|
|
.@{select-prefix-cls}-selection-placeholder {
|
2019-12-30 22:49:19 +08:00
|
|
|
padding: 0;
|
|
|
|
line-height: @select-height-without-border;
|
2019-09-12 20:15:17 +08:00
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
|
|
// Firefox inline-block position calculation is not same as Chrome & Safari. Patch this:
|
|
|
|
@supports (-moz-appearance: meterbar) {
|
|
|
|
& {
|
|
|
|
line-height: @select-height-without-border;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-30 22:49:19 +08:00
|
|
|
|
2020-05-15 09:53:14 +08:00
|
|
|
.@{select-prefix-cls}-selection-item {
|
|
|
|
position: relative;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-placeholder {
|
2021-12-02 14:40:03 +08:00
|
|
|
transition: none;
|
2020-05-15 09:53:14 +08:00
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
2020-03-04 23:40:02 +08:00
|
|
|
// For common baseline align
|
2019-12-30 22:49:19 +08:00
|
|
|
&::after,
|
2021-10-22 13:35:36 +08:00
|
|
|
/* For '' value baseline align */
|
2020-03-04 23:40:02 +08:00
|
|
|
.@{select-prefix-cls}-selection-item::after,
|
2021-10-22 13:35:36 +08:00
|
|
|
/* For undefined value baseline align */
|
2019-12-30 22:49:19 +08:00
|
|
|
.@{select-prefix-cls}-selection-placeholder::after {
|
2020-03-04 23:40:02 +08:00
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
2020-03-11 12:30:03 +08:00
|
|
|
visibility: hidden;
|
2019-12-30 22:49:19 +08:00
|
|
|
content: '\a0';
|
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// With arrow should provides `padding-right` to show the arrow
|
2019-12-30 22:49:19 +08:00
|
|
|
&.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search {
|
|
|
|
right: @input-padding-horizontal-base + @font-size-base;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item,
|
|
|
|
&.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder {
|
2020-03-12 21:43:05 +08:00
|
|
|
padding-right: @selection-item-padding;
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Opacity selection if open
|
|
|
|
&.@{select-prefix-cls}-open .@{select-prefix-cls}-selection-item {
|
2020-09-09 14:55:59 +08:00
|
|
|
color: @input-placeholder-color;
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ========================== Input ==========================
|
|
|
|
// We only change the style of non-customize input which is only support by `combobox` mode.
|
|
|
|
|
|
|
|
// Not customize
|
|
|
|
&:not(.@{select-prefix-cls}-customize-input) {
|
|
|
|
.@{select-prefix-cls}-selector {
|
|
|
|
width: 100%;
|
|
|
|
height: @input-height-base;
|
|
|
|
padding: 0 @input-padding-horizontal-base;
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-search-input {
|
|
|
|
height: @select-height-without-border;
|
|
|
|
}
|
2020-07-09 18:40:40 +08:00
|
|
|
|
|
|
|
&::after {
|
|
|
|
line-height: @select-height-without-border;
|
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-06 14:54:52 +08:00
|
|
|
&.@{select-prefix-cls}-customize-input {
|
|
|
|
.@{select-prefix-cls}-selector {
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-search {
|
|
|
|
position: static;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-placeholder {
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
|
|
|
padding: 0 @input-padding-horizontal-base;
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ============================================================
|
|
|
|
// == Size ==
|
|
|
|
// ============================================================
|
|
|
|
.select-size(@suffix, @input-height) {
|
|
|
|
@merged-cls: ~'@{select-prefix-cls}-@{suffix}';
|
|
|
|
|
|
|
|
&.@{merged-cls}:not(.@{select-prefix-cls}-customize-input) {
|
|
|
|
.@{select-prefix-cls}-selector {
|
|
|
|
height: @input-height;
|
|
|
|
|
2020-07-09 18:40:40 +08:00
|
|
|
&::after,
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}-selection-item,
|
|
|
|
.@{select-prefix-cls}-selection-placeholder {
|
2020-04-12 15:33:43 +08:00
|
|
|
line-height: @input-height - 2 * @border-width-base;
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Not customize
|
|
|
|
&:not(.@{select-prefix-cls}-customize-input) {
|
|
|
|
.@{select-prefix-cls}-selection-search-input {
|
|
|
|
height: @input-height - 2 * @border-width-base;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-29 10:39:46 +08:00
|
|
|
.select-size('lg', @select-single-item-height-lg);
|
2019-09-12 20:15:17 +08:00
|
|
|
.select-size('sm', @input-height-sm);
|
|
|
|
|
|
|
|
// Size small need additional set padding
|
|
|
|
&.@{select-prefix-cls}-sm {
|
|
|
|
&:not(.@{select-prefix-cls}-customize-input) {
|
2019-12-30 22:49:19 +08:00
|
|
|
.@{select-prefix-cls}-selection-search {
|
|
|
|
right: @input-padding-horizontal-sm;
|
|
|
|
left: @input-padding-horizontal-sm;
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
2019-12-28 22:39:18 +08:00
|
|
|
|
|
|
|
.@{select-prefix-cls}-selector {
|
2019-12-30 22:49:19 +08:00
|
|
|
padding: 0 @input-padding-horizontal-sm;
|
|
|
|
}
|
|
|
|
|
|
|
|
// With arrow should provides `padding-right` to show the arrow
|
|
|
|
&.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-search {
|
|
|
|
right: @input-padding-horizontal-sm + @font-size-base * 1.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-item,
|
|
|
|
&.@{select-prefix-cls}-show-arrow .@{select-prefix-cls}-selection-placeholder {
|
|
|
|
padding-right: @font-size-base * 1.5;
|
2019-12-28 22:39:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-03-29 10:39:46 +08:00
|
|
|
|
|
|
|
&.@{select-prefix-cls}-lg {
|
|
|
|
&:not(.@{select-prefix-cls}-customize-input) {
|
|
|
|
.@{select-prefix-cls}-selector {
|
|
|
|
padding: 0 @input-padding-horizontal-lg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|