2020-03-05 12:17:50 +08:00
|
|
|
@import '../../style/themes/index';
|
|
|
|
@import '../../style/mixins/index';
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
@input-rtl-cls: ~'@{ant-prefix}-input-rtl';
|
|
|
|
|
2020-03-05 12:17:50 +08:00
|
|
|
@input-affix-with-clear-btn-width: 38px;
|
|
|
|
|
|
|
|
// size mixins for input
|
|
|
|
.input-lg() {
|
|
|
|
padding: @input-padding-vertical-lg @input-padding-horizontal-lg;
|
|
|
|
font-size: @font-size-lg;
|
|
|
|
}
|
|
|
|
|
|
|
|
.input-sm() {
|
|
|
|
padding: @input-padding-vertical-sm @input-padding-horizontal-sm;
|
|
|
|
}
|
|
|
|
|
|
|
|
// input status
|
|
|
|
// == when focus or actived
|
|
|
|
.active(@color: @outline-color) {
|
2020-03-08 15:12:21 +08:00
|
|
|
& when (@theme = dark) {
|
|
|
|
border-color: @color;
|
|
|
|
}
|
|
|
|
& when not (@theme = dark) {
|
|
|
|
border-color: ~`colorPalette('@{color}', 5) `;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
border-right-width: @border-width-base !important;
|
|
|
|
outline: 0;
|
|
|
|
box-shadow: @input-outline-offset @outline-blur-size @outline-width fade(@color, 20%);
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
.@{input-rtl-cls} & {
|
|
|
|
border-right-width: 0;
|
|
|
|
border-left-width: @border-width-base !important;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// == when hoverd
|
|
|
|
.hover(@color: @input-hover-border-color) {
|
|
|
|
border-color: @color;
|
|
|
|
border-right-width: @border-width-base !important;
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
.@{input-rtl-cls} & {
|
|
|
|
border-right-width: 0;
|
|
|
|
border-left-width: @border-width-base !important;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.disabled() {
|
|
|
|
color: @disabled-color;
|
|
|
|
background-color: @input-disabled-bg;
|
|
|
|
cursor: not-allowed;
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
.hover(@input-border-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Basic style for input
|
|
|
|
.input() {
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
width: 100%;
|
2020-03-08 15:12:21 +08:00
|
|
|
min-width: 0;
|
2020-03-05 12:17:50 +08:00
|
|
|
padding: @input-padding-vertical-base @input-padding-horizontal-base;
|
|
|
|
color: @input-color;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
line-height: @line-height-base;
|
|
|
|
background-color: @input-bg;
|
|
|
|
background-image: none;
|
|
|
|
border: @border-width-base @border-style-base @input-border-color;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
transition: all 0.3s;
|
|
|
|
.placeholder(); // Reset placeholder
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
.hover();
|
|
|
|
}
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
&:focus,
|
|
|
|
&-focused {
|
2020-03-05 12:17:50 +08:00
|
|
|
.active();
|
|
|
|
}
|
|
|
|
|
|
|
|
&-disabled {
|
|
|
|
.disabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
&[disabled] {
|
|
|
|
.disabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reset height for `textarea`s
|
|
|
|
textarea& {
|
|
|
|
max-width: 100%; // prevent textearea resize from coming out of its container
|
|
|
|
height: auto;
|
|
|
|
min-height: @input-height-base;
|
|
|
|
line-height: @line-height-base;
|
|
|
|
vertical-align: bottom;
|
|
|
|
transition: all 0.3s, height 0s;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Size
|
|
|
|
&-lg {
|
|
|
|
.input-lg();
|
|
|
|
}
|
|
|
|
|
|
|
|
&-sm {
|
|
|
|
.input-sm();
|
|
|
|
}
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
&-rtl {
|
|
|
|
direction: rtl;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// label input
|
|
|
|
.input-group(@inputClass) {
|
|
|
|
position: relative;
|
|
|
|
display: table;
|
|
|
|
width: 100%;
|
|
|
|
border-collapse: separate;
|
|
|
|
border-spacing: 0;
|
|
|
|
|
|
|
|
// Undo padding and float of grid classes
|
|
|
|
&[class*='col-'] {
|
|
|
|
float: none;
|
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> [class*='col-'] {
|
|
|
|
padding-right: 8px;
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
padding-right: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-addon,
|
|
|
|
&-wrap,
|
|
|
|
> .@{inputClass} {
|
|
|
|
display: table-cell;
|
|
|
|
|
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-addon,
|
|
|
|
&-wrap {
|
|
|
|
width: 1px; // To make addon/wrap as small as possible
|
|
|
|
white-space: nowrap;
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap > * {
|
|
|
|
display: block !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{inputClass} {
|
|
|
|
float: left;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 0;
|
|
|
|
text-align: inherit;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
z-index: 1; // Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png
|
|
|
|
border-right-width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
z-index: 1;
|
|
|
|
border-right-width: 1px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-addon {
|
|
|
|
position: relative;
|
|
|
|
padding: 0 @input-padding-horizontal-base;
|
|
|
|
color: @input-color;
|
|
|
|
font-weight: normal;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
text-align: center;
|
|
|
|
background-color: @input-addon-bg;
|
|
|
|
border: @border-width-base @border-style-base @input-border-color;
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
|
|
// Reset Select's style in addon
|
|
|
|
.@{ant-prefix}-select {
|
|
|
|
margin: -(@input-padding-vertical-base + 1px) (-@input-padding-horizontal-base);
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
&.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input)
|
|
|
|
.@{ant-prefix}-select-selector {
|
2020-03-05 12:17:50 +08:00
|
|
|
background-color: inherit;
|
|
|
|
border: @border-width-base @border-style-base transparent;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-open,
|
|
|
|
&-focused {
|
2020-03-08 15:12:21 +08:00
|
|
|
.@{ant-prefix}-select-selector {
|
2020-03-05 12:17:50 +08:00
|
|
|
color: @primary-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Expand addon icon click area
|
|
|
|
// https://github.com/ant-design/ant-design/issues/3714
|
|
|
|
> i:only-child::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
content: '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reset rounded corners
|
|
|
|
> .@{inputClass}:first-child,
|
|
|
|
&-addon:first-child {
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
|
|
|
|
// Reset Select's style in addon
|
2020-03-08 15:12:21 +08:00
|
|
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector {
|
2020-03-05 12:17:50 +08:00
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
> .@{inputClass}-rtl:first-child,
|
|
|
|
&-rtl &-addon:first-child {
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
|
2020-03-05 12:17:50 +08:00
|
|
|
> .@{inputClass}-affix-wrapper {
|
|
|
|
&:not(:first-child) .@{inputClass} {
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:not(:last-child) .@{inputClass} {
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-addon:first-child {
|
|
|
|
border-right: 0;
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
.@{inputClass}-group-rtl & {
|
|
|
|
border-right: @border-width-base @border-style-base @input-border-color;
|
|
|
|
border-left: 0;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-addon:last-child {
|
|
|
|
border-left: 0;
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
.@{inputClass}-group-rtl & {
|
|
|
|
border-right: 0;
|
|
|
|
border-left: @border-width-base @border-style-base @input-border-color;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
> .@{inputClass}:last-child,
|
|
|
|
&-addon:last-child {
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
.@{inputClass}-group-rtl & {
|
|
|
|
border-radius: @border-radius-base;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
|
|
|
|
2020-03-05 12:17:50 +08:00
|
|
|
// Reset Select's style in addon
|
2020-03-08 15:12:21 +08:00
|
|
|
.@{ant-prefix}-select .@{ant-prefix}-select-selector {
|
2020-03-05 12:17:50 +08:00
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sizing options
|
|
|
|
&-lg .@{inputClass},
|
|
|
|
&-lg > &-addon {
|
|
|
|
.input-lg();
|
|
|
|
}
|
|
|
|
|
|
|
|
&-sm .@{inputClass},
|
|
|
|
&-sm > &-addon {
|
|
|
|
.input-sm();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fix https://github.com/ant-design/ant-design/issues/5754
|
2020-03-08 15:12:21 +08:00
|
|
|
&-lg .@{ant-prefix}-select-single .ant-select-selector {
|
2020-03-05 12:17:50 +08:00
|
|
|
height: @input-height-lg;
|
|
|
|
}
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
&-sm .@{ant-prefix}-select-single .ant-select-selector {
|
2020-03-05 12:17:50 +08:00
|
|
|
height: @input-height-sm;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{inputClass}-affix-wrapper {
|
2020-03-08 15:12:21 +08:00
|
|
|
&:not(:first-child) {
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:not(:last-child) {
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&&-compact {
|
|
|
|
display: block;
|
|
|
|
.clearfix;
|
|
|
|
|
|
|
|
&-addon,
|
|
|
|
&-wrap,
|
|
|
|
> .@{inputClass} {
|
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
border-right-width: @border-width-base;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
& > * {
|
|
|
|
display: inline-block;
|
|
|
|
float: none;
|
|
|
|
vertical-align: top; // https://github.com/ant-design/ant-design-pro/issues/139
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > *:not(:last-child) {
|
|
|
|
margin-right: -@border-width-base;
|
|
|
|
border-right-width: @border-width-base;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Undo float for .ant-input-group .ant-input
|
|
|
|
.@{inputClass} {
|
|
|
|
float: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
// reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
|
2020-03-08 15:12:21 +08:00
|
|
|
& > .@{ant-prefix}-select > .@{ant-prefix}-select-selector,
|
2020-03-05 12:17:50 +08:00
|
|
|
& > .@{ant-prefix}-calendar-picker .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-select-auto-complete .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-cascader-picker .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-mention-wrapper .@{ant-prefix}-mention-editor,
|
|
|
|
& > .@{ant-prefix}-time-picker .@{ant-prefix}-time-picker-input,
|
|
|
|
& > .@{ant-prefix}-input-group-wrapper .@{ant-prefix}-input {
|
|
|
|
border-right-width: @border-width-base;
|
|
|
|
border-radius: 0;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-08 15:12:21 +08:00
|
|
|
// update z-index for arrow icon
|
|
|
|
& > .@{ant-prefix}-select > .@{ant-prefix}-select-arrow {
|
|
|
|
z-index: 1; // https://github.com/ant-design/ant-design/issues/20371
|
|
|
|
}
|
|
|
|
|
2020-03-05 12:17:50 +08:00
|
|
|
& > *:first-child,
|
2020-03-08 15:12:21 +08:00
|
|
|
& > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selector,
|
2020-03-05 12:17:50 +08:00
|
|
|
& > .@{ant-prefix}-calendar-picker:first-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-mention-wrapper:first-child .@{ant-prefix}-mention-editor,
|
|
|
|
& > .@{ant-prefix}-time-picker:first-child .@{ant-prefix}-time-picker-input {
|
|
|
|
border-top-left-radius: @border-radius-base;
|
|
|
|
border-bottom-left-radius: @border-radius-base;
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
.@{inputClass}-group-rtl& {
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-top-right-radius: @border-radius-base;
|
|
|
|
border-bottom-right-radius: @border-radius-base;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
& > *:last-child,
|
2020-03-08 15:12:21 +08:00
|
|
|
& > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selector,
|
2020-03-05 12:17:50 +08:00
|
|
|
& > .@{ant-prefix}-calendar-picker:last-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-select-auto-complete:last-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input,
|
|
|
|
& > .@{ant-prefix}-mention-wrapper:last-child .@{ant-prefix}-mention-editor,
|
|
|
|
& > .@{ant-prefix}-time-picker:last-child .@{ant-prefix}-time-picker-input {
|
|
|
|
border-right-width: @border-width-base;
|
|
|
|
border-top-right-radius: @border-radius-base;
|
|
|
|
border-bottom-right-radius: @border-radius-base;
|
2020-03-08 15:12:21 +08:00
|
|
|
|
|
|
|
.@{inputClass}-group-rtl& {
|
|
|
|
border-right-width: 0;
|
|
|
|
border-left-width: @border-width-base;
|
|
|
|
border-top-left-radius: @border-radius-base;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
border-bottom-left-radius: @border-radius-base;
|
|
|
|
}
|
2020-03-05 12:17:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/12493
|
|
|
|
& > .@{ant-prefix}-select-auto-complete .@{ant-prefix}-input {
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|