2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 20:02:01 +08:00
|
|
|
@import '../../style/mixins/index';
|
|
|
|
@import '../../input/style/mixin';
|
|
|
|
@import '../../button/style/mixin';
|
|
|
|
@import '../../grid/style/mixin';
|
2019-07-03 20:14:39 +08:00
|
|
|
@import './components';
|
|
|
|
@import './inline';
|
|
|
|
@import './horizontal';
|
|
|
|
@import './vertical';
|
2018-12-07 20:02:01 +08:00
|
|
|
@import './mixin';
|
|
|
|
|
|
|
|
@form-prefix-cls: ~'@{ant-prefix}-form';
|
2019-07-03 20:14:39 +08:00
|
|
|
@form-item-prefix-cls: ~'@{form-prefix-cls}-item';
|
|
|
|
@form-font-height: ceil(@font-size-base * @line-height-base);
|
|
|
|
|
|
|
|
.@{form-prefix-cls} {
|
|
|
|
.reset-component;
|
|
|
|
.reset-form;
|
|
|
|
|
|
|
|
.@{form-prefix-cls}-text {
|
|
|
|
display: inline-block;
|
|
|
|
padding-right: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ================================================================
|
|
|
|
// = Item =
|
|
|
|
// ================================================================
|
|
|
|
.@{form-item-prefix-cls} {
|
|
|
|
.reset-component;
|
|
|
|
|
|
|
|
margin-bottom: @form-item-margin-bottom;
|
|
|
|
vertical-align: top;
|
|
|
|
|
|
|
|
&-with-help {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// = Label =
|
|
|
|
// ==============================================================
|
|
|
|
&-label {
|
|
|
|
display: inline-block;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: right;
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
&-left {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
> label {
|
|
|
|
position: relative;
|
2019-12-13 10:38:40 +08:00
|
|
|
// display: inline;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
height: 100%;
|
|
|
|
max-height: @input-height-base;
|
2019-07-03 20:14:39 +08:00
|
|
|
color: @label-color;
|
|
|
|
|
|
|
|
> .@{iconfont-css-prefix} {
|
|
|
|
font-size: @font-size-base;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.@{form-item-prefix-cls}-required::before {
|
|
|
|
display: inline-block;
|
|
|
|
margin-right: 4px;
|
|
|
|
color: @label-required-color;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
font-family: SimSun, sans-serif;
|
|
|
|
line-height: 1;
|
|
|
|
content: '*';
|
|
|
|
|
|
|
|
.@{form-prefix-cls}-hide-required-mark & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
& when (@form-item-trailing-colon=true) {
|
|
|
|
content: ':';
|
|
|
|
}
|
|
|
|
& when not (@form-item-trailing-colon=true) {
|
|
|
|
content: ' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
top: -0.5px;
|
2019-10-14 17:21:22 +08:00
|
|
|
margin: 0 @form-item-label-colon-margin-right 0 @form-item-label-colon-margin-left;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&.@{form-item-prefix-cls}-no-colon::after {
|
|
|
|
content: ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// = Input =
|
|
|
|
// ==============================================================
|
|
|
|
&-control {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
&:first-child:not([class^=~"'@{ant-prefix}-col-'"]):not([class*=~"' @{ant-prefix}-col-'"]) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-control-input {
|
|
|
|
position: relative;
|
|
|
|
.clearfix;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-explain,
|
|
|
|
&-extra {
|
|
|
|
clear: both;
|
|
|
|
min-height: @form-item-margin-bottom;
|
|
|
|
padding-top: floor((@form-item-margin-bottom - @form-font-height) / 2);
|
|
|
|
color: @text-color-secondary;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
line-height: @line-height-base;
|
|
|
|
transition: color 0.3s @ease-out; // sync input color transition
|
|
|
|
}
|
|
|
|
|
|
|
|
// ================================================================
|
|
|
|
// = Status =
|
|
|
|
// ================================================================
|
|
|
|
/* Some non-status related component style is in `components.less` */
|
|
|
|
|
|
|
|
&-has-feedback {
|
|
|
|
// ========================= Input =========================
|
|
|
|
.@{ant-prefix}-input {
|
|
|
|
padding-right: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-input-password-icon {
|
|
|
|
margin-right: 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== 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,
|
|
|
|
> .@{ant-prefix}-select .@{ant-prefix}-select-selection__clear,
|
|
|
|
:not(.@{ant-prefix}-input-group-addon) > .@{ant-prefix}-select .@{ant-prefix}-select-arrow,
|
|
|
|
:not(.@{ant-prefix}-input-group-addon)
|
|
|
|
> .@{ant-prefix}-select
|
|
|
|
.@{ant-prefix}-select-selection__clear {
|
|
|
|
right: 28px;
|
|
|
|
}
|
|
|
|
> .@{ant-prefix}-select .@{ant-prefix}-select-selection-selected-value,
|
|
|
|
:not(.@{ant-prefix}-input-group-addon)
|
|
|
|
> .@{ant-prefix}-select
|
|
|
|
.@{ant-prefix}-select-selection-selected-value {
|
|
|
|
padding-right: 42px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================= Cascader ========================
|
|
|
|
.@{ant-prefix}-cascader-picker {
|
|
|
|
&-arrow {
|
|
|
|
margin-right: 17px;
|
|
|
|
}
|
|
|
|
&-clear {
|
|
|
|
right: 28px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== Picker =========================
|
|
|
|
// Fix issue: https://github.com/ant-design/ant-design/issues/4783
|
2019-12-11 23:32:19 +08:00
|
|
|
.@{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;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ===================== 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;
|
|
|
|
|
|
|
|
& svg {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
margin: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================== 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 {
|
|
|
|
.form-control-validation(@warning-color; @warning-color; @form-warning-input-bg);
|
|
|
|
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
color: @warning-color;
|
|
|
|
animation-name: diffZoomIn3 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
//select
|
|
|
|
.@{ant-prefix}-select {
|
2019-12-19 16:23:30 +08:00
|
|
|
.@{ant-prefix}-select-selector {
|
2019-12-20 18:29:39 +08:00
|
|
|
border-color: @warning-color !important;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2019-12-19 16:23:30 +08:00
|
|
|
&.@{ant-prefix}-select-open .@{ant-prefix}-select-selector,
|
|
|
|
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
|
2019-07-03 20:14:39 +08:00
|
|
|
.active(@warning-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//input-number, timepicker
|
|
|
|
.@{ant-prefix}-input-number,
|
2019-12-11 23:32:19 +08:00
|
|
|
.@{ant-prefix}-picker {
|
2019-07-03 20:14:39 +08:00
|
|
|
border-color: @warning-color;
|
|
|
|
&-focused,
|
|
|
|
&:focus {
|
|
|
|
.active(@warning-color);
|
|
|
|
}
|
|
|
|
&:not([disabled]):hover {
|
|
|
|
border-color: @warning-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-cascader-picker:focus .@{ant-prefix}-cascader-input {
|
|
|
|
.active(@warning-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========================= Error =========================
|
|
|
|
&-has-error {
|
|
|
|
.form-control-validation(@error-color; @error-color; @form-error-input-bg);
|
|
|
|
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
color: @error-color;
|
|
|
|
animation-name: diffZoomIn2 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
//select
|
|
|
|
.@{ant-prefix}-select {
|
2019-12-19 16:23:30 +08:00
|
|
|
.@{ant-prefix}-select-selector {
|
2019-12-20 18:29:39 +08:00
|
|
|
border-color: @error-color !important;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2019-12-19 16:23:30 +08:00
|
|
|
&.@{ant-prefix}-select-open .@{ant-prefix}-select-selector,
|
|
|
|
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
|
2019-07-03 20:14:39 +08:00
|
|
|
.active(@error-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-select.@{ant-prefix}-select-auto-complete {
|
|
|
|
.@{ant-prefix}-input:focus {
|
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-input-group-addon .@{ant-prefix}-select {
|
2019-12-19 16:23:30 +08:00
|
|
|
&-selector {
|
2019-07-03 20:14:39 +08:00
|
|
|
border-color: transparent;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//input-number, timepicker
|
|
|
|
.@{ant-prefix}-input-number,
|
2019-12-11 23:32:19 +08:00
|
|
|
.@{ant-prefix}-picker {
|
2019-07-03 20:14:39 +08:00
|
|
|
border-color: @error-color;
|
|
|
|
&-focused,
|
|
|
|
&:focus {
|
|
|
|
.active(@error-color);
|
|
|
|
}
|
|
|
|
&:not([disabled]):hover {
|
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.@{ant-prefix}-mention-wrapper {
|
|
|
|
.@{ant-prefix}-mention-editor {
|
|
|
|
&,
|
|
|
|
&:not([disabled]):hover {
|
|
|
|
border-color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.@{ant-prefix}-mention-active:not([disabled]) .@{ant-prefix}-mention-editor,
|
|
|
|
.@{ant-prefix}-mention-editor:not([disabled]):focus {
|
|
|
|
.active(@error-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{ant-prefix}-cascader-picker:focus .@{ant-prefix}-cascader-input {
|
|
|
|
.active(@error-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
// transfer
|
|
|
|
.@{ant-prefix}-transfer {
|
|
|
|
&-list {
|
|
|
|
border-color: @error-color;
|
|
|
|
|
|
|
|
&-search:not([disabled]) {
|
|
|
|
border-color: @input-border-color;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
.hover();
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
.active();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Patch to keep error explain color
|
|
|
|
&-has-error-leave {
|
|
|
|
.@{form-item-prefix-cls}-explain {
|
|
|
|
color: @error-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ====================== Validating =======================
|
|
|
|
&-is-validating {
|
|
|
|
&.@{form-item-prefix-cls}-has-feedback .@{form-item-prefix-cls}-children-icon {
|
|
|
|
display: inline-block;
|
|
|
|
color: @primary-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.show-help-motion(@className, @keyframeName, @duration: @animation-duration-slow) {
|
|
|
|
.make-motion(@className, @keyframeName, @duration);
|
|
|
|
.@{className}-enter,
|
|
|
|
.@{className}-appear {
|
|
|
|
opacity: 0;
|
|
|
|
animation-timing-function: @ease-in-out;
|
|
|
|
}
|
|
|
|
.@{className}-leave {
|
|
|
|
animation-timing-function: @ease-in-out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.show-help-motion(show-help, antShowHelp, 0.3s);
|
|
|
|
|
|
|
|
@keyframes antShowHelpIn {
|
|
|
|
0% {
|
|
|
|
transform: translateY(-5px);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
transform: translateY(0);
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antShowHelpOut {
|
|
|
|
to {
|
|
|
|
transform: translateY(-5px);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// need there different zoom animation
|
|
|
|
// otherwise won't trigger anim
|
|
|
|
@keyframes diffZoomIn1 {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes diffZoomIn2 {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes diffZoomIn3 {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|