2019-06-14 14:46:13 +08:00
|
|
|
@import './mixins/mixins.scss';
|
2019-09-17 19:21:07 +08:00
|
|
|
@import './themes/vars.scss';
|
2019-06-14 14:46:13 +08:00
|
|
|
|
2019-10-10 18:24:51 +08:00
|
|
|
@mixin input-size-mixin ($size) {
|
|
|
|
$font-size: map-get($map: $--n-font-size, $key: $size);
|
|
|
|
$height: map-get($map: $--n-height, $key: $size);
|
|
|
|
$line-height: round($font-size * 1.5);
|
|
|
|
@include m($size + "-size") {
|
|
|
|
font-size: $font-size;
|
|
|
|
line-height: $line-height;
|
2019-09-13 16:17:46 +08:00
|
|
|
@include e(input) {
|
2019-10-10 18:24:51 +08:00
|
|
|
height: $height;
|
2019-09-13 16:17:46 +08:00
|
|
|
}
|
2019-10-17 14:03:09 +08:00
|
|
|
@include e(input, textarea, textarea-mirror, splitor) {
|
2019-10-10 18:24:51 +08:00
|
|
|
line-height: $line-height;
|
|
|
|
font-size: $font-size;
|
|
|
|
padding-top: ($height - $line-height) / 2;
|
|
|
|
padding-bottom: ($height - $line-height) / 2;
|
|
|
|
}
|
|
|
|
@include m(round) {
|
2019-10-17 14:03:09 +08:00
|
|
|
@include not-m(textarea) {
|
2019-10-10 18:24:51 +08:00
|
|
|
border-radius: $height / 2;
|
|
|
|
padding-left: $height / 2;
|
|
|
|
}
|
2019-06-18 18:09:42 +08:00
|
|
|
}
|
2019-06-14 14:46:13 +08:00
|
|
|
}
|
2019-10-10 18:24:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@include themes-mixin {
|
|
|
|
@include b(input) {
|
2019-10-10 18:39:51 +08:00
|
|
|
@include once {
|
2019-10-17 14:03:09 +08:00
|
|
|
box-sizing: border-box;
|
2019-10-10 18:39:51 +08:00
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
display: inline-block;
|
2019-10-17 14:03:09 +08:00
|
|
|
border-radius: $--input-border-radius;
|
|
|
|
transition: box-shadow .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
|
|
|
|
padding-left: 14px;
|
|
|
|
padding-right: 14px;
|
2019-10-10 18:39:51 +08:00
|
|
|
@include input-size-mixin("small");
|
|
|
|
@include input-size-mixin("medium");
|
|
|
|
@include input-size-mixin("large");
|
|
|
|
@include e(icon) {
|
2019-10-19 19:52:47 +08:00
|
|
|
transition: opacity .3s $default-cubic-bezier;
|
2019-10-10 18:39:51 +08:00
|
|
|
position: absolute;
|
|
|
|
line-height: $--input-icon-size;
|
2019-10-10 18:24:51 +08:00
|
|
|
height: $--input-icon-size;
|
|
|
|
width: $--input-icon-size;
|
2019-10-10 18:39:51 +08:00
|
|
|
i {
|
2019-10-10 18:24:51 +08:00
|
|
|
height: $--input-icon-size;
|
|
|
|
width: $--input-icon-size;
|
2019-10-10 18:39:51 +08:00
|
|
|
&::before {
|
2019-10-19 19:52:47 +08:00
|
|
|
transition: color .3s $default-cubic-bezier;
|
2019-10-10 18:39:51 +08:00
|
|
|
font-size: $--input-icon-size;
|
|
|
|
line-height: $--input-icon-size;
|
|
|
|
height: $--input-icon-size;
|
|
|
|
width: $--input-icon-size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
top: calc(50% - 9px);
|
|
|
|
}
|
|
|
|
@include e(cancel-mark) {
|
|
|
|
position: absolute;
|
|
|
|
right: 14px;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
|
|
|
line-height: 12px;
|
|
|
|
}
|
|
|
|
@include e(textarea, textarea-mirror) {
|
2019-10-17 14:03:09 +08:00
|
|
|
display: block;
|
2019-10-10 18:39:51 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
font-family: inherit;
|
|
|
|
font-size: inherit;
|
|
|
|
line-height: 1.5;
|
|
|
|
margin: 0;
|
|
|
|
resize: vertical;
|
|
|
|
}
|
|
|
|
@include e(textarea) {
|
|
|
|
@include m(autosize) {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
height: 100%;
|
2019-10-15 18:55:49 +08:00
|
|
|
resize: none;
|
2019-10-10 18:39:51 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@include e(textarea-mirror) {
|
2019-10-15 18:55:49 +08:00
|
|
|
overflow: hidden;
|
2019-10-10 18:39:51 +08:00
|
|
|
visibility: hidden;
|
|
|
|
position: static;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
}
|
|
|
|
@include m(clearable) {
|
2019-10-17 14:03:09 +08:00
|
|
|
padding-right: 32px;
|
2019-10-10 18:39:51 +08:00
|
|
|
}
|
|
|
|
@include m(icon) {
|
2019-10-17 14:03:09 +08:00
|
|
|
@include m(left-icon) {
|
2019-10-10 18:39:51 +08:00
|
|
|
padding-left: 38px!important;
|
2019-10-17 14:03:09 +08:00
|
|
|
@include e(icon) {
|
|
|
|
left: 0;
|
|
|
|
margin-left: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(right-icon) {
|
|
|
|
padding-right: 38px!important;
|
|
|
|
@include e(icon) {
|
|
|
|
right: 0;
|
|
|
|
margin-right: 12px;
|
|
|
|
}
|
2019-10-10 18:24:51 +08:00
|
|
|
}
|
2019-08-23 14:20:10 +08:00
|
|
|
}
|
2019-10-17 14:03:09 +08:00
|
|
|
@include m(split) {
|
|
|
|
display: inline-flex;
|
|
|
|
@include e(input) {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
background-color: map-get($--input-background-color, 'default');
|
|
|
|
box-shadow: map-get($--input-box-shadow, 'default');
|
|
|
|
&:hover {
|
|
|
|
box-shadow: map-get($--input-box-shadow, 'hover');
|
|
|
|
}
|
|
|
|
@include m(focus) {
|
|
|
|
box-shadow: map-get($--input-box-shadow, 'focus');
|
|
|
|
background-color: map-get($--input-background-color, 'focus');
|
|
|
|
}
|
|
|
|
@include m(textarea) {
|
|
|
|
padding-left: 0;
|
|
|
|
padding-right: 0;
|
|
|
|
@include e(textarea, textarea-mirror) {
|
|
|
|
padding-left: 14px;
|
|
|
|
padding-right: 14px;
|
|
|
|
}
|
2019-10-10 18:24:51 +08:00
|
|
|
}
|
2019-10-11 17:23:39 +08:00
|
|
|
@include e(icon) {
|
2019-10-17 14:03:09 +08:00
|
|
|
opacity: 1;
|
|
|
|
@include m(hide-icon) {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
2019-10-11 17:23:39 +08:00
|
|
|
i {
|
|
|
|
&::before {
|
|
|
|
color: $--input-icon-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-10 18:24:51 +08:00
|
|
|
@include e(input, textarea) {
|
2019-10-10 18:39:51 +08:00
|
|
|
@include once {
|
|
|
|
-webkit-appearance: none;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border: none;
|
|
|
|
font-size: inherit;
|
|
|
|
outline: none;
|
|
|
|
font-family: $--n-font-family;
|
|
|
|
width: 100%;
|
2019-10-17 14:03:09 +08:00
|
|
|
transition: color .3s $default-cubic-bezier;
|
2019-10-10 18:39:51 +08:00
|
|
|
}
|
2019-10-10 18:24:51 +08:00
|
|
|
color: map-get($--input-color, 'default');
|
|
|
|
caret-color: $--input-caret-color;
|
2019-10-17 14:03:09 +08:00
|
|
|
background-color: transparent;
|
2019-10-10 18:24:51 +08:00
|
|
|
&::placeholder {
|
|
|
|
transition: color .3s $default-cubic-bezier;
|
|
|
|
color: map-get($--input-placeholder-color, 'default');
|
|
|
|
opacity: 1;
|
2019-08-23 14:20:10 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-17 14:03:09 +08:00
|
|
|
@include e(splitor) {
|
|
|
|
transition: color .3s $default-cubic-bezier;
|
|
|
|
color: map-get($--input-color, 'default');
|
2019-10-17 22:16:30 +08:00
|
|
|
padding-left: 14px;
|
|
|
|
padding-right: 14px;
|
2019-10-17 14:03:09 +08:00
|
|
|
}
|
2019-10-10 18:24:51 +08:00
|
|
|
@include m(disabled) {
|
2019-10-17 14:03:09 +08:00
|
|
|
cursor: not-allowed;
|
|
|
|
box-shadow: map-get($--input-box-shadow, 'disabled') !important;
|
|
|
|
background-color: map-get($--input-background-color, 'disabled');
|
2019-10-10 18:24:51 +08:00
|
|
|
@include e(input, textarea) {
|
2019-10-17 22:16:30 +08:00
|
|
|
cursor: not-allowed;
|
2019-10-10 18:24:51 +08:00
|
|
|
color: map-get($--input-color, 'disabled');
|
|
|
|
&::placeholder {
|
|
|
|
color: map-get($--input-placeholder-color, 'disabled');
|
|
|
|
}
|
2019-08-23 14:20:10 +08:00
|
|
|
}
|
2019-10-17 14:03:09 +08:00
|
|
|
@include e(splitor) {
|
|
|
|
color: map-get($--input-color, 'disabled');
|
|
|
|
}
|
2019-06-21 11:49:15 +08:00
|
|
|
}
|
2019-09-13 16:17:46 +08:00
|
|
|
}
|
2019-06-14 14:46:13 +08:00
|
|
|
}
|