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';
|
2020-02-19 22:16:55 +08:00
|
|
|
@import './status';
|
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} {
|
2020-12-22 11:08:12 +08:00
|
|
|
.reset-component();
|
|
|
|
.reset-form();
|
2019-07-03 20:14:39 +08:00
|
|
|
|
|
|
|
.@{form-prefix-cls}-text {
|
|
|
|
display: inline-block;
|
|
|
|
padding-right: 8px;
|
|
|
|
}
|
2020-01-02 19:10:16 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
// ================================================================
|
|
|
|
// = Size =
|
|
|
|
// ================================================================
|
|
|
|
.formSize(@input-height) {
|
|
|
|
.@{form-item-prefix-cls}-label > label {
|
|
|
|
height: @input-height;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{form-item-prefix-cls}-control-input {
|
|
|
|
min-height: @input-height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-small {
|
|
|
|
.formSize(@input-height-sm);
|
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2020-02-19 22:04:25 +08:00
|
|
|
&-large {
|
|
|
|
.formSize(@input-height-lg);
|
|
|
|
}
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
|
2020-04-21 17:48:15 +08:00
|
|
|
.explainAndExtraDistance(@num) when (@num >= 0) {
|
2020-02-17 19:35:58 +08:00
|
|
|
padding-top: floor(@num);
|
|
|
|
}
|
2020-04-21 17:48:15 +08:00
|
|
|
|
|
|
|
.explainAndExtraDistance(@num) when (@num < 0) {
|
2020-08-07 13:45:35 +08:00
|
|
|
margin-top: ceil(@num);
|
|
|
|
margin-bottom: ceil(@num);
|
2020-02-17 19:35:58 +08:00
|
|
|
}
|
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
// ================================================================
|
|
|
|
// = Item =
|
|
|
|
// ================================================================
|
|
|
|
.@{form-item-prefix-cls} {
|
2020-12-22 11:08:12 +08:00
|
|
|
.reset-component();
|
2019-07-03 20:14:39 +08:00
|
|
|
|
|
|
|
margin-bottom: @form-item-margin-bottom;
|
|
|
|
vertical-align: top;
|
2021-06-04 14:44:41 +08:00
|
|
|
// We delay one frame (0.017s) here to let CSSMotion goes
|
|
|
|
transition: margin-bottom @animation-duration-slow 0.017s linear;
|
2019-07-03 20:14:39 +08:00
|
|
|
|
|
|
|
&-with-help {
|
|
|
|
margin-bottom: 0;
|
2021-06-04 14:44:41 +08:00
|
|
|
transition: none;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
|
2020-08-12 13:08:50 +08:00
|
|
|
&-hidden,
|
|
|
|
&-hidden.@{ant-prefix}-row {
|
|
|
|
// https://github.com/ant-design/ant-design/issues/26141
|
2020-07-01 14:13:47 +08:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
// ==============================================================
|
|
|
|
// = Label =
|
|
|
|
// ==============================================================
|
|
|
|
&-label {
|
|
|
|
display: inline-block;
|
2020-05-28 12:47:37 +08:00
|
|
|
flex-grow: 0;
|
2019-07-03 20:14:39 +08:00
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: right;
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
&-left {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
2021-11-26 18:15:59 +08:00
|
|
|
&-wrap {
|
|
|
|
overflow: unset;
|
|
|
|
line-height: (@line-height-base - 0.25em);
|
|
|
|
white-space: unset;
|
|
|
|
}
|
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
> label {
|
|
|
|
position: relative;
|
2019-12-13 10:38:40 +08:00
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
2021-08-18 19:17:47 +08:00
|
|
|
max-width: 100%;
|
2020-03-05 23:04:27 +08:00
|
|
|
height: @form-item-label-height;
|
2019-07-03 20:14:39 +08:00
|
|
|
color: @label-color;
|
2020-02-04 17:01:03 +08:00
|
|
|
font-size: @form-item-label-font-size;
|
2019-07-03 20:14:39 +08:00
|
|
|
|
|
|
|
> .@{iconfont-css-prefix} {
|
2020-02-04 17:01:03 +08:00
|
|
|
font-size: @form-item-label-font-size;
|
2019-07-03 20:14:39 +08:00
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
|
2020-08-21 12:58:14 +08:00
|
|
|
// Required mark
|
|
|
|
&.@{form-item-prefix-cls}-required:not(.@{form-item-prefix-cls}-required-mark-optional)::before {
|
2019-07-03 20:14:39 +08:00
|
|
|
display: inline-block;
|
|
|
|
margin-right: 4px;
|
|
|
|
color: @label-required-color;
|
2020-02-04 17:01:03 +08:00
|
|
|
font-size: @form-item-label-font-size;
|
2019-07-03 20:14:39 +08:00
|
|
|
font-family: SimSun, sans-serif;
|
|
|
|
line-height: 1;
|
|
|
|
content: '*';
|
|
|
|
|
|
|
|
.@{form-prefix-cls}-hide-required-mark & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-21 12:58:14 +08:00
|
|
|
// Optional mark
|
|
|
|
.@{form-item-prefix-cls}-optional {
|
|
|
|
display: inline-block;
|
|
|
|
margin-left: @margin-xss;
|
|
|
|
color: @text-color-secondary;
|
|
|
|
|
|
|
|
.@{form-prefix-cls}-hide-required-mark & {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-17 17:11:45 +08:00
|
|
|
// Optional mark
|
|
|
|
.@{form-item-prefix-cls}-tooltip {
|
2021-01-30 19:39:02 +08:00
|
|
|
color: @text-color-secondary;
|
2021-03-08 14:43:35 +08:00
|
|
|
cursor: help;
|
2020-09-17 17:11:45 +08:00
|
|
|
writing-mode: horizontal-tb;
|
|
|
|
margin-inline-start: @margin-xss;
|
|
|
|
}
|
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
&::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;
|
2020-03-10 22:15:27 +08:00
|
|
|
flex-grow: 1;
|
2019-07-03 20:14:39 +08:00
|
|
|
|
2020-03-19 14:32:22 +08:00
|
|
|
&:first-child:not([class^=~"'@{ant-prefix}-col-'"]):not([class*=~"' @{ant-prefix}-col-'"]) {
|
2019-07-03 20:14:39 +08:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-control-input {
|
|
|
|
position: relative;
|
2020-02-19 22:04:25 +08:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
min-height: @input-height-base;
|
|
|
|
|
|
|
|
&-content {
|
|
|
|
flex: auto;
|
2020-02-28 16:45:25 +08:00
|
|
|
max-width: 100%;
|
2020-02-19 22:04:25 +08:00
|
|
|
}
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
|
2021-06-04 14:44:41 +08:00
|
|
|
// ==============================================================
|
|
|
|
// = Explain =
|
|
|
|
// ==============================================================
|
2019-07-03 20:14:39 +08:00
|
|
|
&-explain,
|
|
|
|
&-extra {
|
|
|
|
clear: both;
|
|
|
|
color: @text-color-secondary;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
line-height: @line-height-base;
|
|
|
|
transition: color 0.3s @ease-out; // sync input color transition
|
2021-02-02 22:05:31 +08:00
|
|
|
.explainAndExtraDistance((@form-item-margin-bottom - @form-font-height) / 2);
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2020-12-02 19:41:47 +08:00
|
|
|
|
2021-06-07 14:32:07 +08:00
|
|
|
&-explain-connected {
|
2021-06-04 14:44:41 +08:00
|
|
|
height: 0;
|
|
|
|
min-height: 0;
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-extra {
|
|
|
|
min-height: @form-item-margin-bottom;
|
|
|
|
}
|
|
|
|
|
2020-12-02 19:41:47 +08:00
|
|
|
.@{ant-prefix}-input-textarea-show-count {
|
|
|
|
&::after {
|
2021-02-05 20:34:28 +08:00
|
|
|
margin-bottom: -22px;
|
2020-12-02 19:41:47 +08:00
|
|
|
}
|
|
|
|
}
|
2019-07-03 20:14:39 +08:00
|
|
|
|
2021-06-04 14:44:41 +08:00
|
|
|
&-with-help &-explain {
|
|
|
|
height: auto;
|
|
|
|
min-height: @form-item-margin-bottom;
|
|
|
|
opacity: 1;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2021-06-04 14:44:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// >>>>>>>>>> Motion <<<<<<<<<<
|
|
|
|
// Explain holder
|
|
|
|
.@{ant-prefix}-show-help {
|
|
|
|
transition: height @animation-duration-slow linear, min-height @animation-duration-slow linear,
|
|
|
|
margin-bottom @animation-duration-slow @ease-in-out,
|
|
|
|
opacity @animation-duration-slow @ease-in-out;
|
|
|
|
|
|
|
|
&-leave {
|
|
|
|
min-height: @form-item-margin-bottom;
|
|
|
|
|
|
|
|
&-active {
|
|
|
|
min-height: 0;
|
|
|
|
}
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-04 14:44:41 +08:00
|
|
|
// Explain
|
|
|
|
.@{ant-prefix}-show-help-item {
|
|
|
|
overflow: hidden;
|
|
|
|
transition: height @animation-duration-slow @ease-in-out,
|
|
|
|
opacity @animation-duration-slow @ease-in-out, transform @animation-duration-slow @ease-in-out !important;
|
2019-07-03 20:14:39 +08:00
|
|
|
|
2021-06-04 14:44:41 +08:00
|
|
|
&-appear,
|
|
|
|
&-enter {
|
2019-07-03 20:14:39 +08:00
|
|
|
transform: translateY(-5px);
|
|
|
|
opacity: 0;
|
2021-06-04 14:44:41 +08:00
|
|
|
|
|
|
|
&-active {
|
|
|
|
transform: translateY(0);
|
|
|
|
opacity: 1;
|
|
|
|
}
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
|
2021-06-04 14:44:41 +08:00
|
|
|
&-leave-active {
|
2019-07-03 20:14:39 +08:00
|
|
|
transform: translateY(-5px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// need there different zoom animation
|
|
|
|
// otherwise won't trigger anim
|
|
|
|
@keyframes diffZoomIn1 {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
2021-06-16 13:05:55 +08:00
|
|
|
opacity: 0;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
2021-06-16 13:05:55 +08:00
|
|
|
opacity: 1;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes diffZoomIn2 {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
2021-06-16 13:05:55 +08:00
|
|
|
opacity: 0;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
2021-06-16 13:05:55 +08:00
|
|
|
opacity: 1;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes diffZoomIn3 {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
2021-06-16 13:05:55 +08:00
|
|
|
opacity: 0;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2019-07-03 20:14:39 +08:00
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
2021-06-16 13:05:55 +08:00
|
|
|
opacity: 1;
|
2019-07-03 20:14:39 +08:00
|
|
|
}
|
|
|
|
}
|
2020-03-19 14:32:22 +08:00
|
|
|
|
2020-03-23 10:57:37 +08:00
|
|
|
@import './rtl';
|