2021-09-07 16:14:20 +08:00
|
|
|
@import (reference) '../../style/themes/index';
|
|
|
|
|
|
|
|
@form-prefix-cls: ~'@{ant-prefix}-form';
|
|
|
|
@form-item-prefix-cls: ~'@{form-prefix-cls}-item';
|
2020-02-19 22:04:25 +08:00
|
|
|
|
|
|
|
.@{form-item-prefix-cls} {
|
|
|
|
// ================================================================
|
|
|
|
// = Status =
|
|
|
|
// ================================================================
|
2021-10-22 13:35:36 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
/* Some non-status related component style is in `components.less` */
|
|
|
|
|
2020-09-11 21:27:51 +08:00
|
|
|
// ========================= Explain =========================
|
2021-10-22 13:35:36 +08:00
|
|
|
|
2020-09-11 21:27:51 +08:00
|
|
|
/* To support leave along ErrorList. We add additional className to handle explain style */
|
|
|
|
&-explain {
|
2021-06-04 14:44:41 +08:00
|
|
|
&-error {
|
2020-09-11 21:27:51 +08:00
|
|
|
color: @error-color;
|
|
|
|
}
|
|
|
|
|
2021-06-04 14:44:41 +08:00
|
|
|
&-warning {
|
2020-09-11 21:27:51 +08:00
|
|
|
color: @warning-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&-has-feedback {
|
|
|
|
// ========================= Input =========================
|
|
|
|
.@{ant-prefix}-input {
|
|
|
|
padding-right: 24px;
|
|
|
|
}
|
|
|
|
// https://github.com/ant-design/ant-design/issues/19884
|
|
|
|
.@{ant-prefix}-input-affix-wrapper {
|
|
|
|
.@{ant-prefix}-input-suffix {
|
|
|
|
padding-right: 18px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fix issue: https://github.com/ant-design/ant-design/issues/7854
|
|
|
|
.@{ant-prefix}-input-search:not(.@{ant-prefix}-input-search-enter-button) {
|
|
|
|
.@{ant-prefix}-input-suffix {
|
|
|
|
right: 28px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== Switch =========================
|
|
|
|
.@{ant-prefix}-switch {
|
|
|
|
margin: 2px 0 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== Select =========================
|
|
|
|
// Fix overlapping between feedback icon and <Select>'s arrow.
|
|
|
|
// https://github.com/ant-design/ant-design/issues/4431
|
|
|
|
> .@{ant-prefix}-select .@{ant-prefix}-select-arrow,
|
2020-07-21 16:18:31 +08:00
|
|
|
> .@{ant-prefix}-select .@{ant-prefix}-select-clear,
|
2020-02-19 22:04:25 +08:00
|
|
|
:not(.@{ant-prefix}-input-group-addon) > .@{ant-prefix}-select .@{ant-prefix}-select-arrow,
|
2021-08-31 13:09:03 +08:00
|
|
|
:not(.@{ant-prefix}-input-group-addon) > .@{ant-prefix}-select .@{ant-prefix}-select-clear,
|
|
|
|
:not(.@{ant-prefix}-input-number-group-addon)
|
|
|
|
> .@{ant-prefix}-select
|
|
|
|
.@{ant-prefix}-select-arrow,
|
|
|
|
:not(.@{ant-prefix}-input-number-group-addon)
|
|
|
|
> .@{ant-prefix}-select
|
|
|
|
.@{ant-prefix}-select-clear {
|
2020-07-21 16:18:31 +08:00
|
|
|
right: 32px;
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
> .@{ant-prefix}-select .@{ant-prefix}-select-selection-selected-value,
|
|
|
|
:not(.@{ant-prefix}-input-group-addon)
|
2021-08-31 13:09:03 +08:00
|
|
|
> .@{ant-prefix}-select
|
|
|
|
.@{ant-prefix}-select-selection-selected-value,
|
|
|
|
:not(.@{ant-prefix}-input-number-group-addon)
|
2020-02-19 22:04:25 +08:00
|
|
|
> .@{ant-prefix}-select
|
|
|
|
.@{ant-prefix}-select-selection-selected-value {
|
|
|
|
padding-right: 42px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================= Cascader ========================
|
|
|
|
.@{ant-prefix}-cascader-picker {
|
|
|
|
&-arrow {
|
2020-07-21 16:18:31 +08:00
|
|
|
margin-right: 19px;
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&-clear {
|
2020-07-21 16:18:31 +08:00
|
|
|
right: 32px;
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== Picker =========================
|
|
|
|
// Fix issue: https://github.com/ant-design/ant-design/issues/4783
|
|
|
|
.@{ant-prefix}-picker {
|
|
|
|
padding-right: @input-padding-horizontal-base + @font-size-base * 1.3;
|
|
|
|
|
|
|
|
&-large {
|
|
|
|
padding-right: @input-padding-horizontal-lg + @font-size-base * 1.3;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-small {
|
|
|
|
padding-right: @input-padding-horizontal-sm + @font-size-base * 1.3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ===================== Status Group ======================
|
|
|
|
&.@{form-item-prefix-cls} {
|
|
|
|
&-has-success,
|
|
|
|
&-has-warning,
|
|
|
|
&-has-error,
|
|
|
|
&-is-validating {
|
|
|
|
// ====================== Icon ======================
|
|
|
|
.@{form-item-prefix-cls}-children-icon {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
right: 0;
|
|
|
|
z-index: 1;
|
|
|
|
width: @input-height-base;
|
|
|
|
height: 20px;
|
|
|
|
margin-top: -10px;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
line-height: 20px;
|
|
|
|
text-align: center;
|
|
|
|
visibility: visible;
|
|
|
|
animation: zoomIn 0.3s @ease-out-back;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== Success ========================
|
|
|
|
&-has-success {
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
color: @success-color;
|
|
|
|
animation-name: diffZoomIn1 !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== Warning ========================
|
|
|
|
&-has-warning {
|
2021-09-01 10:56:50 +08:00
|
|
|
.form-control-validation(@warning-color; @warning-color; @form-warning-input-bg; @warning-color-hover; @warning-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
color: @warning-color;
|
|
|
|
animation-name: diffZoomIn3 !important;
|
|
|
|
}
|
|
|
|
|
2020-11-08 15:26:28 +08:00
|
|
|
// Select
|
|
|
|
.@{ant-prefix}-select:not(.@{ant-prefix}-select-disabled):not(.@{ant-prefix}-select-customize-input) {
|
2020-02-19 22:04:25 +08:00
|
|
|
.@{ant-prefix}-select-selector {
|
2020-10-16 22:25:36 +08:00
|
|
|
background-color: @form-warning-input-bg;
|
2020-02-19 22:04:25 +08:00
|
|
|
border-color: @warning-color !important;
|
|
|
|
}
|
|
|
|
&.@{ant-prefix}-select-open .@{ant-prefix}-select-selector,
|
|
|
|
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@warning-color, @warning-color-hover, @warning-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-08 15:26:28 +08:00
|
|
|
// InputNumber, TimePicker
|
2020-02-19 22:04:25 +08:00
|
|
|
.@{ant-prefix}-input-number,
|
|
|
|
.@{ant-prefix}-picker {
|
2020-10-16 22:25:36 +08:00
|
|
|
background-color: @form-warning-input-bg;
|
2020-02-19 22:04:25 +08:00
|
|
|
border-color: @warning-color;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&-focused,
|
|
|
|
&:focus {
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@warning-color, @warning-color-hover, @warning-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&:not([disabled]):hover {
|
2020-10-16 22:25:36 +08:00
|
|
|
background-color: @form-warning-input-bg;
|
2020-02-19 22:04:25 +08:00
|
|
|
border-color: @warning-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-cascader-picker:focus .@{ant-prefix}-cascader-input {
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@warning-color, @warning-color-hover, @warning-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================= Error =========================
|
|
|
|
&-has-error {
|
2021-09-01 10:56:50 +08:00
|
|
|
.form-control-validation(@error-color; @error-color; @form-error-input-bg; @error-color-hover; @error-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
color: @error-color;
|
|
|
|
animation-name: diffZoomIn2 !important;
|
|
|
|
}
|
|
|
|
|
2020-11-08 15:26:28 +08:00
|
|
|
// Select
|
|
|
|
.@{ant-prefix}-select:not(.@{ant-prefix}-select-disabled):not(.@{ant-prefix}-select-customize-input) {
|
2020-02-19 22:04:25 +08:00
|
|
|
.@{ant-prefix}-select-selector {
|
2020-10-16 22:25:36 +08:00
|
|
|
background-color: @form-error-input-bg;
|
2020-02-19 22:04:25 +08:00
|
|
|
border-color: @error-color !important;
|
|
|
|
}
|
|
|
|
&.@{ant-prefix}-select-open .@{ant-prefix}-select-selector,
|
|
|
|
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@error-color, @error-color-hover, @error-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// fixes https://github.com/ant-design/ant-design/issues/20482
|
2021-08-31 13:09:03 +08:00
|
|
|
.@{ant-prefix}-input-group-addon,
|
|
|
|
.@{ant-prefix}-input-number-group-addon {
|
|
|
|
.@{ant-prefix}-select {
|
|
|
|
&.@{ant-prefix}-select-single:not(.@{ant-prefix}-select-customize-input)
|
|
|
|
.@{ant-prefix}-select-selector {
|
|
|
|
background-color: inherit;
|
|
|
|
border: 0;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-select.@{ant-prefix}-select-auto-complete {
|
|
|
|
.@{ant-prefix}-input:focus {
|
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-08 15:26:28 +08:00
|
|
|
// InputNumber, TimePicker
|
2020-02-19 22:04:25 +08:00
|
|
|
.@{ant-prefix}-input-number,
|
|
|
|
.@{ant-prefix}-picker {
|
2020-10-16 22:25:36 +08:00
|
|
|
background-color: @form-error-input-bg;
|
2020-02-19 22:04:25 +08:00
|
|
|
border-color: @error-color;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&-focused,
|
|
|
|
&:focus {
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@error-color, @error-color-hover, @error-color-outline);
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&:not([disabled]):hover {
|
2020-10-16 22:25:36 +08:00
|
|
|
background-color: @form-error-input-bg;
|
2020-02-19 22:04:25 +08:00
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-16 22:25:36 +08:00
|
|
|
.@{ant-prefix}-mention-wrapper {
|
|
|
|
.@{ant-prefix}-mention-editor {
|
|
|
|
&,
|
|
|
|
&:not([disabled]):hover {
|
|
|
|
background-color: @form-error-input-bg;
|
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.@{ant-prefix}-mention-active:not([disabled]) .@{ant-prefix}-mention-editor,
|
|
|
|
.@{ant-prefix}-mention-editor:not([disabled]):focus {
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@error-color, @error-color-hover, @error-color-outline);
|
2020-10-16 22:25:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-05 15:56:31 +08:00
|
|
|
// Cascader
|
2021-05-24 18:18:44 +08:00
|
|
|
.@{ant-prefix}-cascader-picker {
|
|
|
|
&:hover
|
|
|
|
.@{ant-prefix}-cascader-picker-label:hover
|
|
|
|
+ .@{ant-prefix}-cascader-input.@{ant-prefix}-input {
|
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus .@{ant-prefix}-cascader-input {
|
|
|
|
background-color: @form-error-input-bg;
|
2021-09-01 10:56:50 +08:00
|
|
|
.active(@error-color, @error-color-hover, @error-color-outline);
|
2021-05-24 18:18:44 +08:00
|
|
|
}
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
|
2021-10-05 15:56:31 +08:00
|
|
|
// Transfer
|
2020-02-19 22:04:25 +08:00
|
|
|
.@{ant-prefix}-transfer {
|
|
|
|
&-list {
|
|
|
|
border-color: @error-color;
|
|
|
|
|
|
|
|
&-search:not([disabled]) {
|
|
|
|
border-color: @input-border-color;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
.hover();
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
.active();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-09-22 17:04:48 +08:00
|
|
|
|
2021-10-05 15:56:31 +08:00
|
|
|
// Radio.Group
|
2020-09-22 17:04:48 +08:00
|
|
|
.@{ant-prefix}-radio-button-wrapper {
|
|
|
|
border-color: @error-color !important;
|
|
|
|
|
|
|
|
&:not(:first-child) {
|
|
|
|
&::before {
|
|
|
|
background-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-05 15:56:31 +08:00
|
|
|
|
|
|
|
// Mentions
|
|
|
|
.@{ant-prefix}-mentions {
|
|
|
|
border-color: @error-color !important;
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2021-10-05 15:56:31 +08:00
|
|
|
&-focused,
|
|
|
|
&:focus {
|
|
|
|
.active(@error-color, @error-color-hover, @error-color-outline);
|
|
|
|
}
|
|
|
|
}
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ====================== Validating =======================
|
|
|
|
&-is-validating {
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
display: inline-block;
|
|
|
|
color: @primary-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|