2019-09-12 20:15:17 +08:00
|
|
|
@import './index';
|
|
|
|
|
2020-02-02 16:57:23 +08:00
|
|
|
@select-multiple-item-border-width: 1px;
|
|
|
|
|
2020-03-09 12:04:12 +08:00
|
|
|
@select-multiple-padding: max(
|
|
|
|
@input-padding-vertical-base - @select-multiple-item-border-width -
|
|
|
|
@select-multiple-item-spacing-half,
|
|
|
|
0
|
|
|
|
);
|
2019-09-12 20:15:17 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Do not merge `height` & `line-height` under style with `selection` & `search`,
|
|
|
|
* since chrome may update to redesign with its align logic.
|
|
|
|
*/
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-multiple {
|
|
|
|
// ========================= Selector =========================
|
|
|
|
.@{select-prefix-cls}-selector {
|
|
|
|
.select-selector();
|
|
|
|
.select-search-input-without-border();
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
align-items: center;
|
|
|
|
// Multiple is little different that horizontal is follow the vertical
|
2020-02-02 16:57:23 +08:00
|
|
|
padding: @select-multiple-padding @input-padding-vertical-base;
|
2019-12-23 16:22:59 +08:00
|
|
|
|
|
|
|
.@{select-prefix-cls}-show-search& {
|
|
|
|
cursor: text;
|
|
|
|
}
|
2020-02-02 16:57:23 +08:00
|
|
|
|
|
|
|
&::after {
|
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
|
|
|
margin: @select-multiple-item-spacing-half 0;
|
|
|
|
line-height: @select-multiple-item-height;
|
|
|
|
content: '\a0';
|
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|
|
|
|
|
2020-01-15 13:26:09 +08:00
|
|
|
&.@{select-prefix-cls}-allow-clear .@{select-prefix-cls}-selector {
|
|
|
|
padding-right: @font-size-sm + @control-padding-horizontal;
|
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
// ======================== Selections ========================
|
|
|
|
.@{select-prefix-cls}-selection-item {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex: none;
|
|
|
|
box-sizing: border-box;
|
|
|
|
max-width: 100%;
|
|
|
|
|
2020-02-02 16:57:23 +08:00
|
|
|
height: @select-multiple-item-height;
|
|
|
|
margin-top: @select-multiple-item-spacing-half;
|
2019-09-12 20:15:17 +08:00
|
|
|
margin-right: @input-padding-vertical-base;
|
2020-02-02 16:57:23 +08:00
|
|
|
margin-bottom: @select-multiple-item-spacing-half;
|
2019-09-12 20:15:17 +08:00
|
|
|
padding: 0 (@padding-xs / 2) 0 @padding-xs;
|
2020-02-02 16:57:23 +08:00
|
|
|
line-height: @select-multiple-item-height - @select-multiple-item-border-width * 2;
|
2019-12-16 16:27:50 +08:00
|
|
|
background: @select-selection-item-bg;
|
|
|
|
border: 1px solid @select-selection-item-border-color;
|
2019-11-15 10:01:35 +08:00
|
|
|
border-radius: @border-radius-base;
|
2019-09-12 20:15:17 +08:00
|
|
|
cursor: default;
|
|
|
|
transition: font-size 0.3s, line-height 0.3s, height 0.3s;
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
// It's ok not to do this, but 24px makes bottom narrow in view should adjust
|
|
|
|
&-content {
|
|
|
|
display: inline-block;
|
|
|
|
margin-right: @padding-xs / 2;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-remove {
|
|
|
|
.iconfont-mixin();
|
|
|
|
|
|
|
|
display: inline-block;
|
|
|
|
color: @text-color-secondary;
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: @font-size-sm;
|
|
|
|
line-height: inherit;
|
|
|
|
cursor: pointer;
|
|
|
|
.iconfont-size-under-12px(10px);
|
|
|
|
&:hover {
|
|
|
|
color: @icon-color-hover;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================== Input ==========================
|
|
|
|
.@{select-prefix-cls}-selection-search {
|
|
|
|
position: relative;
|
|
|
|
margin-left: @select-multiple-padding / 2;
|
|
|
|
|
|
|
|
&-input,
|
|
|
|
&-mirror {
|
|
|
|
font-family: @font-family;
|
2020-01-13 19:36:27 +08:00
|
|
|
line-height: @line-height-base;
|
2019-09-12 20:15:17 +08:00
|
|
|
transition: all 0.3s;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-input {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-mirror {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 999;
|
|
|
|
white-space: nowrap;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================= Placeholder =======================
|
|
|
|
.@{select-prefix-cls}-selection-placeholder {
|
|
|
|
position: absolute;
|
2020-01-15 10:37:50 +08:00
|
|
|
top: 50%;
|
2020-01-14 11:45:26 +08:00
|
|
|
right: @input-padding-horizontal;
|
2020-01-13 23:39:42 +08:00
|
|
|
left: @input-padding-horizontal;
|
2020-01-15 10:37:50 +08:00
|
|
|
transform: translateY(-50%);
|
2019-09-12 20:15:17 +08:00
|
|
|
transition: all 0.3s;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================
|
|
|
|
// == Size ==
|
|
|
|
// ============================================================
|
|
|
|
.select-size(@suffix, @input-height) {
|
|
|
|
@merged-cls: ~'@{select-prefix-cls}-@{suffix}';
|
|
|
|
&.@{merged-cls} {
|
|
|
|
@select-selection-height: @input-height - @input-padding-vertical-base * 2;
|
|
|
|
@select-height-without-border: @input-height - @border-width-base * 2;
|
|
|
|
|
2020-02-02 16:57:23 +08:00
|
|
|
.@{select-prefix-cls}-selector::after {
|
|
|
|
line-height: @select-selection-height;
|
|
|
|
}
|
|
|
|
|
2019-09-12 20:15:17 +08:00
|
|
|
.@{select-prefix-cls}-selection-item {
|
|
|
|
height: @select-selection-height;
|
|
|
|
line-height: @select-selection-height - @border-width-base * 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{select-prefix-cls}-selection-search {
|
|
|
|
height: @select-selection-height + @select-multiple-padding;
|
|
|
|
|
|
|
|
&-input,
|
|
|
|
&-mirror {
|
|
|
|
height: @select-selection-height;
|
|
|
|
line-height: @select-selection-height - @border-width-base * 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-29 10:39:46 +08:00
|
|
|
.select-size('lg', @select-multiple-item-height-lg);
|
2019-09-12 20:15:17 +08:00
|
|
|
.select-size('sm', @input-height-sm);
|
2020-01-13 23:39:42 +08:00
|
|
|
|
|
|
|
// Size small need additional set padding
|
|
|
|
&.@{select-prefix-cls}-sm {
|
|
|
|
.@{select-prefix-cls}-selection-placeholder {
|
|
|
|
left: @input-padding-horizontal-sm;
|
|
|
|
}
|
|
|
|
}
|
2020-03-29 10:39:46 +08:00
|
|
|
&.@{select-prefix-cls}-lg {
|
|
|
|
.@{select-prefix-cls}-selection-item {
|
|
|
|
height: @select-multiple-item-height-lg;
|
|
|
|
line-height: @select-multiple-item-height-lg;
|
|
|
|
}
|
|
|
|
}
|
2019-09-12 20:15:17 +08:00
|
|
|
}
|