| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684 |
- //@import '../theme/variables.scss';
- @import './variables.scss';
- @import "./animation.scss";
- $module: #{$prefix}-input;
- @keyframes #{$module}-active {
- from {
- transform: scale($motion-scale_size-inactive);
- }
- to {
- transform: scale($motion-scale_size-active);
- }
- }
- @keyframes #{$module}-inactive {
- from {
- transform: scale($motion-scale_size-active);
- }
- to {
- transform: scale($motion-scale_size-inactive);
- }
- }
- .#{$module}{
- transition: background-color $transition_duration-input-bg $transition_function-input-bg $transition_delay-input-bg,
- border $transition_duration-input-border $transition_function-input-border $transition_delay-input-border;
- transform: scale($transform_scale-input);
- }
- .#{$module}-wrapper {
- display: inline-block;
- position: relative;
- vertical-align: middle;
- @include shadow-0;
- @include font-size-regular;
- background-color: $color-input_default-bg-default;
- border: $width-input_wrapper-border $color-input_default-border-default solid;
- border-radius: $radius-input_wrapper;
- width: 100%;
- outline: none;
- cursor: text;
- box-sizing: border-box;
- color: $color-input_default-text-default;
- transition: background-color $transition_duration-input-bg $transition_function-input-bg $transition_delay-input-bg,
- border $transition_duration-input-border $transition_function-input-border $transition_delay-input-border;
- transform: scale($transform_scale-input);
- &-default {
- height: $height-input_wrapper_default;
- @include font-size-regular;
- line-height: $height-input_default;
- }
- &-small {
- height: $height-input_wrapper_small;
- @include font-size-header-6;
- line-height: $height-input_small;
- }
- &-large {
- height: $height-input_wrapper_large;
- @include font-size-header-6;
- line-height: $height-input_large;
- }
- &:hover {
- background-color: $color-input_default-bg-hover;
- border-color: $color-input_default-border-hover;
- }
- // &:active {
- // background-color: $color-input_default-bg-active;
- // }
- &-focus {
- background-color: $color-input_default-bg-focus;
- border: $color-input_default-border-focus solid $width-input_wrapper_focus-border;
- &:hover {
- background-color: $color-input_default-bg-focus;
- border-color: $color-input_default-border-focus;
- }
- &:active {
- background-color: $color-input_default-bg-active;
- border-color: $color-input_default-border-focus;
- }
- }
- &.#{$module}-readonly {
- cursor: default;
- }
- &-error {
- background-color: $color-input_danger-bg-default;
- border-color: $color-input_danger-border-default;
- &:hover {
- background-color: $color-input_danger-bg-hover;
- border-color: $color-input_danger-border-hover;
- }
- &.#{$module}-wrapper-focus {
- background-color: $color-input_danger-bg-focus;
- border-color: $color-input_danger-border-focus;
- }
- &:active {
- background-color: $color-input_danger-bg-active;
- border-color: $color-input_danger-border-focus;
- }
- }
- &-warning {
- background-color: $color-input_warning-bg-default;
- border-color: $color-input_warning-border-default;
- &:hover {
- background-color: $color-input_warning-bg-hover;
- border-color: $color-input_warning-border-hover;
- }
- &.#{$module}-wrapper-focus {
- background-color: $color-input_warning-bg-focus;
- border-color: $color-input_warning-border-focus;
- }
- &:active {
- background-color: $color-input_warning-bg-active;
- border-color: $color-input_warning-border-focus;
- }
- }
- &__with-prefix {
- display: inline-flex;
- align-items: center;
- .#{$module} {
- padding-left: 0;
- }
- }
- &__with-suffix {
- display: inline-flex;
- align-items: center;
- .#{$module} {
- padding-right: 0;
- }
- }
- &-clearable,
- &-modebtn {
- display: inline-flex;
- align-items: center;
- }
- &-hidden {
- border: none;
- }
- .#{$prefix}-icon {
- color: $color-input-icon-default;
- }
- .#{$module}-clearbtn,
- .#{$module}-modebtn {
- color: $color-input-icon-hover;
- & > svg {
- pointer-events: none;
- }
- &:hover {
- cursor: pointer;
- .#{$prefix}-icon {
- color: $color-input-icon-hover;
- }
- }
- &:focus-visible {
- border-radius: $radius-input_wrapper;
- outline: $width-input_icon-outline solid $color-input_icon-outline;
- outline-offset: $width-input_icon-outlineOffset;
- }
- }
- &__with-suffix-icon.#{$module}-wrapper-clearable:not(.#{$module}-wrapper__with-suffix-hidden) {
- .#{$module}-clearbtn {
- min-width: $width-input-icon_clear_before_suffix;
- justify-content: flex-end;
- }
- }
- &-modebtn.#{$module}-wrapper-clearable {
- .#{$module}-clearbtn {
- min-width: $width-input-icon_clear_before_modebtn;
- justify-content: center;
- }
- }
- &.#{$module}-wrapper__with-append-only {
- .#{$module} {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- &:not(:last-child) {
- border-right-style: none;
- border-radius: 0;
- }
- }
- }
- &.#{$module}-wrapper__with-prepend-only {
- .#{$module} {
- border-radius: $radius-input_wrapper 0 0 $radius-input_wrapper;
- &:not(:last-child) {
- border-right-style: none;
- border-radius: 0;
- }
- }
- }
- &.#{$module}-wrapper__with-prepend,
- &.#{$module}-wrapper__with-append {
- display: inline-flex;
- align-items: center;
- background-color: transparent;
- &:hover {
- background-color: transparent;
- }
- &.#{$module}-wrapper-focus {
- border: $width-input_wrapper_focus-border $color-input_default-border-default solid;
- background-color: transparent;
- }
- .#{$module} {
- background-color: $color-input_default-bg-default;
- border: $width-input_wrapper_focus-border transparent solid;
- &:hover {
- background-color: $color-input_default-bg-hover;
- & + .#{$module}-clearbtn,
- & ~ .#{$module}-modebtn {
- background-color: $color-input_default-bg-hover;
- }
- }
- &:focus {
- border: $width-input_wrapper_focus-border $color-input_default-border-focus solid;
- background-color: $color-input_default-bg-focus;
- &.#{$module}-sibling-clearbtn,
- &.#{$module}-sibling-modebtn {
- border-right-style: none;
- }
- &.#{$module}-sibling-modebtn {
- & + .#{$module}-clearbtn {
- border-right-style: none;
- }
- }
- & + .#{$module}-clearbtn,
- & ~ .#{$module}-modebtn {
- box-sizing: border-box;
- background-color: $color-input_default-bg-focus;
- }
- & + .#{$module}-clearbtn {
- border: $width-input_wrapper_focus-border $color-input_default-border-focus solid;
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- border-left-style: none;
- &:not(:last-child) {
- border-radius: 0;
- }
- }
- & ~ .#{$module}-modebtn {
- border: $width-input_wrapper_focus-border $color-input_default-border-focus solid;
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- border-left-style: none;
- &:not(:last-child) {
- border-radius: 0;
- }
- }
- }
- // when have prepend and append, only make the input have active bg color
- &:active {
- background-color: $color-input_default-bg-active;
- & + .#{$module}-clearbtn,
- & ~ .#{$module}-modebtn {
- background-color: $color-input_default-bg-active;
- }
- }
- &-clearbtn,
- &-modebtn,
- &-clearbtn:hover,
- &-modebtn:hover {
- background-color: $color-input_default-bg-default;
- &:last-child {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- }
- }
- }
- &.#{$module}-wrapper-error {
- border-color: transparent;
- .#{$module} {
- background-color: $color-input_danger-bg-default;
- border-color: $color-input_danger-border-default;
- &:hover {
- background-color: $color-input_danger-bg-hover;
- border-color: $color-input_danger-border-hover;
- & + .#{$module}-clearbtn,
- & + .#{$module}-modebtn {
- background-color: $color-input_danger-bg-hover;
- }
- }
- &:focus {
- background-color: $color-input_danger-bg-focus;
- border-color: $color-input_danger-border-focus;
- & + .#{$module}-clearbtn,
- & + .#{$module}-modebtn {
- background-color: $color-input_danger-bg-focus;
- border-color: $color-input_danger-border-focus;
- }
- }
- &:active {
- background-color: $color-input_danger-bg-active;
- & + .#{$module}-clearbtn,
- & + .#{$module}-modebtn {
- background-color: $color-input_danger-bg-active;
- border-color: $color-input_danger-border-focus;
- }
- }
- &-clearbtn,
- &-modebtn,
- &-clearbtn:hover,
- &-modebtn:hover {
- background-color: $color-input_danger-bg-default;
- &:last-child {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- }
- }
- }
- }
- &.#{$module}-wrapper-warning {
- border-color: transparent;
- .#{$module} {
- background-color: $color-input_warning-bg-default;
- border-color: $color-input_warning-border-default;
- &:hover {
- background-color: $color-input_warning-bg-hover;
- border-color: $color-input_warning-border-hover;
- & + .#{$module}-clearbtn,
- & + .#{$module}-modebtn {
- background-color: $color-input_warning-bg-hover;
- }
- }
- &:focus {
- background-color: $color-input_warning-bg-focus;
- border-color: $color-input_warning-border-focus;
- & + .#{$module}-clearbtn,
- & + .#{$module}-modebtn {
- background-color: $color-input_warning-bg-focus;
- border-color: $color-input_warning-border-focus;
- }
- }
- &:active {
- background-color: $color-input_warning-bg-active;
- & + .#{$module}-clearbtn,
- & + .#{$module}-modebtn {
- background-color: $color-input_warning-bg-active;
- border-color: $color-input_warning-border-focus;
- }
- }
- &-clearbtn,
- &-modebtn,
- &-clearbtn:hover,
- &-modebtn:hover {
- background-color: $color-input_warning-bg-default;
- &:last-child {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- }
- }
- }
- }
- }
- &-disabled {
- cursor: not-allowed;
- // border: $border-thickness-control $color-input_disabled-border-default solid;
- color: $color-input_disabled-text-default;
- background-color: $color-input_disabled-bg-default;
- // fix issue 670 in safari
- -webkit-text-fill-color: $color-input_disabled-text-default;
- &:hover {
- background-color: $color-input_disabled-bg-default;
- }
- .#{$module}-append,
- .#{$module}-prepend,
- .#{$module}-suffix,
- .#{$module}-prefix,
- .#{$prefix}-icon {
- color: $color-input_disabled-text-default;
- }
- }
- }
- .#{$module} {
- border: none;
- outline: none;
- width: 100%;
- color: inherit;
- padding-left: $spacing-input-paddingLeft;
- padding-right: $spacing-input-paddingRight;
- background-color: transparent;
- box-sizing: border-box;
- &[type="password"]::-ms-reveal,
- &[type="password"]::-ms-clear {
- display: none;
- }
- &::placeholder {
- color: $color-input_placeholder-text-default;
- }
- &-large {
- height: $height-input_large;
- @include font-size-header-6;
- line-height: $height-input_large;
- }
- &-small {
- height: $height-input_small;
- @include font-size-regular;
- line-height: $height-input_small;
- }
- &-default {
- height: $height-input_default;
- @include font-size-regular;
- line-height: $height-input_default;
- }
- &-disabled {
- cursor: not-allowed;
- color: inherit;
- }
- // &-prefix {
- // padding: 0 $spacing-tight;
- // display: flex;
- // align-items: center;
- // height: 100%;
- // width: auto;
- // white-space: nowrap;
- // }
- &-inset-label {
- margin-right: $spacing-input_insetLabel-marginRight;
- font-weight: $font-input_insetLabel-fontWeight;
- @include font-size-regular;
- color: $color-input_prefix-text-default;
- flex-shrink: 0;
- white-space: nowrap;
- }
- &-prefix,
- &-suffix {
- @include all-center;
- &-text {
- margin: 0 $spacing-base-tight;
- color: $color-input_prefix-text-default;
- font-weight: 600;
- white-space: nowrap;
- }
- &-icon {
- color: $color-input-icon-default;
- margin: $spacing-input_prefix_icon-marginY $spacing-input_prefix_icon-marginX;
- }
- }
- &-suffix {
- @include all-center;
- }
- &-clearbtn,
- &-modebtn {
- display: flex;
- align-items: center;
- height: 100%;
- justify-content: center;
- min-width: $width-input-icon;
- }
- &-clearbtn + &-suffix {
- & + .#{$module}-suffix-text {
- margin-left: 0;
- }
- & + .#{$module}-suffix-icon {
- margin-left: 0;
- }
- }
- &-suffix-hidden {
- display: none;
- }
- &-prepend,
- &-append {
- height: 100%;
- display: flex;
- align-items: center;
- background-color: $color-input_default-bg-default;
- color: $color-input_prefix-text-default;
- &-icon,
- &-text {
- padding: $spacing-input_prepend-paddingY $spacing-input_prepend-paddingX;
- }
- @include font-size-regular;
- flex-shrink: 0;
- }
- &-append {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- border-left: $width-input_append-border $color-input_default-border-default solid;
- }
- &-prepend {
- border-radius: $radius-input_wrapper 0 0 $radius-input_wrapper;
- border-right: $width-input_prepend-border $color-input_default-border-default solid;
- }
- &-disabled {
- &::placeholder {
- color: $color-input_disabled-text-default;
- }
- }
- &-group {
- display: inline-flex;
- align-items: center;
- align-content: center;
- flex-wrap: wrap;
- // select与autocomplete的border-radius都是基于select
- .#{$prefix}-select,
- .#{$prefix}-cascader,
- .#{$prefix}-tree-select,
- & > .#{$module}-wrapper {
- border-radius: 0;
- &:first-child {
- border-radius: $radius-input_wrapper 0 0 $radius-input_wrapper;
- }
- &:last-child {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- }
- &:not(:last-child) {
- position: relative;
- &::after {
- content: '';
- background-color: $color-input_group-border-default;
- width: $width-input_group_pseudo-border;
- // height: $inputGroup-border-height;
- position: absolute;
- right: -1px;
- top: 1px;
- bottom: 1px;
- }
- }
- }
- .#{$prefix}-input-number,
- .#{$prefix}-datepicker,
- .#{$prefix}-autocomplete {
- border-radius: 0;
- .#{$prefix}-datepicker-range-input {
- border-radius: 0;
- }
- &:first-child {
- .#{$module}-wrapper,
- .#{$prefix}-datepicker-range-input {
- border-radius: $radius-input_wrapper 0 0 $radius-input_wrapper;
- }
- }
- &:last-child {
- .#{$module}-wrapper,
- .#{$prefix}-datepicker-range-input {
- border-radius: 0 $radius-input_wrapper $radius-input_wrapper 0;
- }
- }
- &:not(:last-child) {
- position: relative;
- &::after {
- content: '';
- background-color: $color-input_group-border-default;
- width: $width-input_group_pseudo-border;
- // height: $inputGroup-border-height;
- position: absolute;
- right: -1px;
- top: 1px;
- bottom: 1px;
- }
- }
- }
- }
- &-group-wrapper {
- &-with-top-label {
- margin-top: $spacing-input_group_withTopLabel-marginTop;
- margin-bottom: $spacing-input_group_withTopLabel-marginBottom;
- .#{$prefix}-input-group {
- display: flex;
- }
- .#{$prefix}-input-group {
- .#{$prefix}-form-field {
- margin-top: 0;
- margin-bottom: 0;
- }
- }
- }
- }
- }
- @import "./rtl.scss";
|