naive-ui/styles/BasePicker.scss

254 lines
6.2 KiB
SCSS

@import './mixins/mixins.scss';
@import './themes/vars.scss';
@include b(base-picker) {
position: relative;
box-shadow: none;
border-radius: $select-border-radius;
width: 100%;
max-width: 100%;
display: inline-block;
vertical-align: bottom;
.n-base-picker__mark {
cursor: pointer;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 14px;
}
.n-base-picker__placeholder {
pointer-events: none;
position: absolute;
left: 14px;
top: 0;
color: $select-placeholder-color;
opacity: 1;
}
.n-base-picker-label, .n-base-picker-tags {
cursor: pointer;
// outline: none;
box-sizing: border-box;
position: relative;
transition: box-shadow .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
border-radius: $select-border-radius;
background-color: $select-background-color;
}
.n-base-picker-label {
display: inline-block;
width: 100%;
vertical-align: bottom;
.n-base-picker-label__input {
// outline: none;
cursor: pointer;
box-sizing: border-box;
text-overflow: ellipsis;
overflow: hidden;
border:none;
width: 100%;
white-space: nowrap;
color: $select-text-color;
transition: color .3s $default-cubic-bezier;
padding: 0 32px 0 14px;
background-color: transparent;
height: 100%;
&::placeholder {
color: $select-placeholder-color;
}
&.n-base-picker-label__input--placeholder {
color: $select-placeholder-color;
}
}
}
.n-base-picker-tags {
display: flex;
padding: 3px 32px 0 14px;
flex-wrap: wrap;
align-items: center;
width: 100%;
vertical-align: bottom;
.n-base-picker-tag {
vertical-align: bottom;
box-sizing: border-box;
position: relative;
display: inline-block;
border: 1px solid #63E2B7FF;
color: #63E2B7FF;
border-radius: 4px;
margin-right: 7px;
margin-bottom: 3px;
font-size: 14px;
max-width: 100%;
.n-base-picker-tag__content {
transform: translateY(-1px);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.n-base-picker-tag__icon {
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
i::before {
color: #63E2B7FF;
}
}
}
}
&.n-base-picker--selected {
.n-base-picker__placeholder {
opacity: 0;
}
}
&.n-base-picker--active {
.n-base-picker-label, .n-base-picker-tags {
box-shadow: inset 0 0 0 1px $select-border-color--active, 0px 0px 10px 1px #366555;
background-color: $select-background-color--active;
}
.n-base-picker-input-tag {
width: unset;
}
}
&.n-base-picker--small-size {
font-size: 14px;
.n-base-picker__placeholder {
height: $small-height;
line-height: $small-height;
}
.n-base-picker-tags {
min-height: $small-height;
.n-base-picker-tag {
font-size: 13px;
padding: 0px 22px 0 7px;
height: 22px;
line-height: 22px;
}
.n-base-picker-input-tag {
height: 20px;
line-height: 20px;
}
}
.n-base-picker-label {
height: $small-height;
line-height: $small-height;
}
}
&.n-base-picker--default-size, &.n-base-picker--medium-size {
font-size: 14px;
.n-base-picker__placeholder {
height: $medium-height;
line-height: $medium-height;
}
.n-base-picker-tags {
min-height: $medium-height;
.n-base-picker-tag {
padding: 0px 20px 0 7px;
height: 28px;
line-height: 28px;
}
.n-base-picker-input-tag {
height: 28px;
line-height: 28px;
}
}
.n-base-picker-label {
height: $medium-height;
line-height: $medium-height;
}
}
&.n-base-picker--large-size {
font-size: 15px;
.n-base-picker__placeholder {
height: $large-height;
line-height: $large-height;
}
.n-base-picker-tags {
min-height: $large-height;
.n-base-picker-tag {
padding: 0px 20px 0 7px;
height: 32px;
line-height: 32px;
}
.n-base-picker-input-tag {
height: 32px;
line-height: 32px;
}
}
.n-base-picker-label {
height: $large-height;
line-height: $large-height;
}
}
&.n-base-picker--disabled {
cursor: not-allowed;
.n-base-picker-label, .n-base-picker-tags {
cursor: not-allowed;
background-color: rgba(255, 255, 255, 0.08);
}
.n-base-picker-tag {
cursor: not-allowed;
border-color: rgba(255, 255, 255, 0.20);
color: rgba(255, 255, 255, 0.20);
}
.n-base-picker__placeholder {
cursor: not-allowed;
color: rgba(255, 255, 255, 0.20);
}
.n-base-picker-label__input {
cursor: not-allowed;
color: rgba(255, 255, 255, 0.20);
&.n-base-picker-label__input--placeholder {
color: rgba(255, 255, 255, 0.20);
}
&::placeholder {
color: rgba(255, 255, 255, 0.20);
}
}
}
&.n-base-picker--focus {
.n-base-picker-label, .n-base-picker-tags {
box-shadow: inset 0 0 0 1px $select-border-color--active;
}
}
&:not(.n-base-picker--disabled) {
.n-base-picker-label:hover, .n-base-picker-tags:hover {
box-shadow: inset 0 0 0 1px $select-border-color--active;
}
.n-base-picker-label:focus, .n-base-picker-tags:focus {
box-shadow: inset 0 0 0 1px $select-border-color--active;
}
}
}
@include b(base-picker-input-tag) {
// outline: none;
width: 0;
position: relative;
margin-bottom: 3px;
display: inline-block;
max-width: 100%;
vertical-align: bottom;
.n-base-picker-input-tag__input {
padding: 0;
background-color: transparent;
// outline: none;
border: none;
max-width: 100%;
caret-color: $input-caret-color;
color: $select-text-color;
height: 100%;
width: 1em;
line-height: inherit;
cursor: pointer;
}
.n-base-picker-input-tag__mirror {
position: absolute;
padding-right: 1em;
left: 0;
top: 0;
white-space: pre;
visibility: hidden;
user-select: none;
opacity: 0;
}
}