2019-08-24 01:30:52 +08:00
|
|
|
@import './mixins/mixins.scss';
|
2020-02-11 14:44:29 +08:00
|
|
|
|
2020-02-14 23:01:06 +08:00
|
|
|
@mixin base-selection-size-mixin ($size) {
|
|
|
|
$base-selection-tag-margin: 3px;
|
|
|
|
$base-selection-height: map-get($--n-height, $size);
|
2019-09-27 16:02:20 +08:00
|
|
|
@include m($size + '-size') {
|
2020-02-09 14:14:32 +08:00
|
|
|
font-size: map-get($--n-font-size, $size);
|
2019-09-27 16:02:20 +08:00
|
|
|
@include e(placeholder) {
|
2020-02-14 23:01:06 +08:00
|
|
|
height: $base-selection-height;
|
|
|
|
line-height: $base-selection-height;
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
|
|
|
min-height: $base-selection-height;
|
|
|
|
@include b(base-selection-input-tag) {
|
|
|
|
height: $base-selection-height - 2 * $base-selection-tag-margin;
|
|
|
|
line-height: $base-selection-height - 2 * $base-selection-tag-margin;
|
2019-08-26 15:41:44 +08:00
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
|
|
|
height: $base-selection-height;
|
|
|
|
line-height: $base-selection-height;
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@include themes-mixin {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection) {
|
2019-09-27 16:02:20 +08:00
|
|
|
@include once {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include base-selection-size-mixin('small');
|
|
|
|
@include base-selection-size-mixin('medium');
|
|
|
|
@include base-selection-size-mixin('large');
|
2019-08-24 01:30:52 +08:00
|
|
|
position: relative;
|
2020-02-09 14:14:32 +08:00
|
|
|
z-index: auto;
|
2019-09-27 16:02:20 +08:00
|
|
|
box-shadow: none;
|
2020-02-14 23:01:06 +08:00
|
|
|
border-radius: $--base-selection-border-radius;
|
2019-09-27 16:02:20 +08:00
|
|
|
width: 100%;
|
2019-08-24 01:30:52 +08:00
|
|
|
max-width: 100%;
|
2019-09-27 16:02:20 +08:00
|
|
|
display: inline-block;
|
|
|
|
vertical-align: bottom;
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-radius: $--base-selection-border-radius;
|
2020-02-09 14:14:32 +08:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
border: 1px solid transparent;
|
|
|
|
pointer-events: none;
|
|
|
|
transition: .3s border-color $--n-ease-in-out-cubic-bezier, .3s box-shadow $--n-ease-in-out-cubic-bezier;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
@include e(mark) {
|
|
|
|
cursor: pointer;
|
2019-08-24 01:30:52 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
2019-09-27 16:02:20 +08:00
|
|
|
right: 14px;
|
|
|
|
}
|
|
|
|
@include m(selected) {
|
|
|
|
@include e(placeholder) {
|
|
|
|
opacity: 0;
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border: 1px solid map-get($--base-selection-border-mask-border-color, 'default');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
@include e(placeholder) {
|
|
|
|
@include once {
|
|
|
|
pointer-events: none;
|
|
|
|
position: absolute;
|
|
|
|
left: 14px;
|
|
|
|
top: 0;
|
|
|
|
opacity: 1;
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'default');
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
2019-09-27 16:02:20 +08:00
|
|
|
@include once {
|
|
|
|
cursor: pointer;
|
|
|
|
outline: none;
|
|
|
|
box-sizing: border-box;
|
|
|
|
position: relative;
|
2020-02-09 14:14:32 +08:00
|
|
|
z-index: auto;
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier, box-shadow .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
|
2020-02-14 23:01:06 +08:00
|
|
|
border-radius: $--base-selection-border-radius;
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
box-shadow: map-get($--base-selection-box-shadow, 'default');
|
|
|
|
background-color: map-get($--base-selection-background-color, 'default');
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
2019-09-27 16:02:20 +08:00
|
|
|
@include once {
|
|
|
|
display: inline-block;
|
|
|
|
width: 100%;
|
|
|
|
vertical-align: bottom;
|
|
|
|
cursor: pointer;
|
|
|
|
outline: none;
|
2020-02-09 14:14:32 +08:00
|
|
|
z-index: auto;
|
2019-09-27 16:02:20 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
position: relative;
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier, box-shadow .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
|
2020-02-14 23:01:06 +08:00
|
|
|
border-radius: $--base-selection-border-radius;
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
box-shadow: map-get($--base-selection-box-shadow, 'default');
|
|
|
|
background-color: map-get($--base-selection-background-color, 'default');
|
2019-09-27 16:02:20 +08:00
|
|
|
@include e(input) {
|
|
|
|
@include once {
|
|
|
|
outline: none;
|
|
|
|
cursor: pointer;
|
|
|
|
box-sizing: border-box;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
border:none;
|
|
|
|
width: 100%;
|
|
|
|
white-space: nowrap;
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
2019-09-27 16:02:20 +08:00
|
|
|
padding: 0 32px 0 14px;
|
|
|
|
background-color: transparent;
|
|
|
|
height: 100%;
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
color: $--base-selection-color;
|
2019-09-27 16:02:20 +08:00
|
|
|
&::placeholder {
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'default');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
@include m(placeholder) {
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'default');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
2019-09-27 16:02:20 +08:00
|
|
|
@include once {
|
|
|
|
display: flex;
|
|
|
|
padding: 3px 32px 0 14px;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
vertical-align: bottom;
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
@include b(tag) {
|
|
|
|
@include once {
|
|
|
|
margin-right: 7px;
|
|
|
|
margin-bottom: 3px;
|
|
|
|
font-size: 14px;
|
|
|
|
max-width: 100%;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
@include not-m(disabled) {
|
|
|
|
@include m(active) {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'active');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
|
|
|
background-color: map-get($--base-selection-background-color, 'active');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
|
|
|
background-color: map-get($--base-selection-background-color, 'active');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
@include once {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-input-tag) {
|
2019-09-27 16:02:20 +08:00
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
2020-02-09 14:14:32 +08:00
|
|
|
&:hover ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'hover');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2020-02-09 14:14:32 +08:00
|
|
|
&:focus ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'focus');
|
|
|
|
box-shadow: map-get($--base-selection-border-mask-box-shadow, 'focus');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
2020-02-09 14:14:32 +08:00
|
|
|
&:hover ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'hover');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2020-02-09 14:14:32 +08:00
|
|
|
&:focus ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'focus');
|
|
|
|
box-shadow: map-get($--base-selection-border-mask-box-shadow, 'focus');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(focus) {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'focus');
|
|
|
|
box-shadow: map-get($--base-selection-border-mask-box-shadow, 'focus');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
@include m(disabled) {
|
2019-09-03 19:18:16 +08:00
|
|
|
cursor: not-allowed;
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
2019-09-27 16:02:20 +08:00
|
|
|
cursor: not-allowed;
|
2020-02-14 23:01:06 +08:00
|
|
|
background-color: map-get($--base-selection-background-color, 'disabled');
|
|
|
|
box-shadow: map-get($--base-selection-box-shadow, 'disabled');
|
2019-09-27 16:02:20 +08:00
|
|
|
@include e(input) {
|
|
|
|
cursor: not-allowed;
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'disabled');
|
2019-09-27 16:02:20 +08:00
|
|
|
@include m(placeholder) {
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'disabled');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
&::placeholder {
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'disabled');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
2019-09-27 16:02:20 +08:00
|
|
|
cursor: not-allowed;
|
2020-02-14 23:01:06 +08:00
|
|
|
box-shadow: map-get($--base-selection-box-shadow, 'disabled');
|
|
|
|
background-color: map-get($--base-selection-background-color, "disabled");
|
2019-08-26 16:25:51 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
@include e(placeholder) {
|
|
|
|
cursor: not-allowed;
|
2020-02-14 23:01:06 +08:00
|
|
|
color: map-get($--base-selection-placeholder-color, 'disabled');
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
2019-09-27 16:02:20 +08:00
|
|
|
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-input-tag) {
|
2019-09-27 16:02:20 +08:00
|
|
|
@include once {
|
|
|
|
outline: none;
|
|
|
|
display: none;
|
|
|
|
position: relative;
|
|
|
|
margin-bottom: 3px;
|
|
|
|
max-width: 100%;
|
|
|
|
vertical-align: bottom;
|
|
|
|
}
|
|
|
|
@include e(input) {
|
|
|
|
@include once {
|
|
|
|
padding: 0;
|
|
|
|
background-color: transparent;
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
max-width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
width: 1em;
|
|
|
|
line-height: inherit;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
caret-color: map-get($--base-selection-caret-color, 'default');
|
|
|
|
color: $--base-selection-color;
|
2019-09-27 16:02:20 +08:00
|
|
|
}
|
|
|
|
@include once {
|
|
|
|
@include e(mirror) {
|
|
|
|
position: absolute;
|
|
|
|
padding-right: 1em;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
white-space: pre;
|
|
|
|
visibility: hidden;
|
|
|
|
user-select: none;
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
2019-08-24 01:30:52 +08:00
|
|
|
}
|
|
|
|
}
|
2019-11-06 15:57:03 +08:00
|
|
|
@include as-form-item {
|
|
|
|
@include with-status (error) {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection) {
|
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-default');
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
|
|
|
box-shadow: map-get($--base-selection-box-shadow, 'error-default');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
|
|
|
box-shadow: map-get($--base-selection-box-shadow, 'error-default');
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
|
|
|
@include not-m(disabled) {
|
|
|
|
@include m(active) {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-active');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
|
|
|
background-color: map-get($--base-selection-background-color, 'error-active');
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
|
|
|
background-color: map-get($--base-selection-background-color, 'error-active');
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-label) {
|
2020-02-09 14:14:32 +08:00
|
|
|
&:hover ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-hover');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
2020-02-09 14:14:32 +08:00
|
|
|
&:focus ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-focus');
|
|
|
|
box-shadow: map-get($--base-selection-border-mask-box-shadow, 'error-focus');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
|
|
|
}
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-tags) {
|
2020-02-09 14:14:32 +08:00
|
|
|
&:hover ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-hover');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
2020-02-09 14:14:32 +08:00
|
|
|
&:focus ~ {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-focus');
|
|
|
|
box-shadow: map-get($--base-selection-border-mask-box-shadow, 'error-focus');
|
2020-02-09 14:14:32 +08:00
|
|
|
}
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(focus) {
|
2020-02-14 23:01:06 +08:00
|
|
|
@include b(base-selection-border-mask) {
|
|
|
|
border-color: map-get($--base-selection-border-mask-border-color, 'error-focus');
|
|
|
|
box-shadow: map-get($--base-selection-border-mask-box-shadow, 'error-focus');
|
2019-11-06 15:57:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-17 18:09:46 +08:00
|
|
|
}
|