2022-04-06 22:14:16 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
2022-07-19 22:53:38 +08:00
|
|
|
import { genCollapseMotion, zoomIn } from '../../style/motion';
|
2022-06-27 14:25:59 +08:00
|
|
|
import type { AliasToken, FullToken, GenerateStyle } from '../../theme';
|
2022-07-11 15:35:58 +08:00
|
|
|
import { genComponentStyleHook, mergeToken } from '../../theme';
|
|
|
|
import { resetComponent } from '../../style';
|
2022-04-06 22:14:16 +08:00
|
|
|
|
|
|
|
interface FormToken extends FullToken<'Form'> {
|
2022-03-30 14:13:36 +08:00
|
|
|
formItemCls: string;
|
|
|
|
rootPrefixCls: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const resetForm = (token: AliasToken): CSSObject => ({
|
|
|
|
legend: {
|
|
|
|
display: 'block',
|
|
|
|
width: '100%',
|
2022-06-02 22:21:21 +08:00
|
|
|
marginBottom: token.marginLG,
|
2022-03-30 14:13:36 +08:00
|
|
|
padding: 0,
|
2022-08-04 16:16:50 +08:00
|
|
|
color: token.colorTextDescription,
|
2022-03-30 14:13:36 +08:00
|
|
|
fontSize: token.fontSizeLG,
|
|
|
|
lineHeight: 'inherit',
|
|
|
|
border: 0,
|
|
|
|
borderBottom: `${token.controlLineWidth}px ${token.controlLineType} ${token.colorBorder}`,
|
|
|
|
},
|
|
|
|
|
|
|
|
label: {
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
},
|
|
|
|
|
|
|
|
'input[type="search"]': {
|
|
|
|
boxSizing: 'border-box',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Position radios and checkboxes better
|
|
|
|
'input[type="radio"], input[type="checkbox"]': {
|
|
|
|
lineHeight: 'normal',
|
|
|
|
},
|
|
|
|
|
|
|
|
'input[type="file"]': {
|
|
|
|
display: 'block',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Make range inputs behave like textual form controls
|
|
|
|
'input[type="range"]': {
|
|
|
|
display: 'block',
|
|
|
|
width: '100%',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Make multiple select elements height not fixed
|
|
|
|
'select[multiple], select[size]': {
|
|
|
|
height: 'auto',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Focus for file, radio, and checkbox
|
|
|
|
[`input[type='file']:focus,
|
|
|
|
input[type='radio']:focus,
|
|
|
|
input[type='checkbox']:focus`]: {
|
|
|
|
outline: 0,
|
2022-07-21 17:00:42 +08:00
|
|
|
boxShadow: `0 0 0 ${token.controlOutlineWidth}px ${token.controlOutline}`,
|
2022-03-30 14:13:36 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
// Adjust output element
|
|
|
|
output: {
|
|
|
|
display: 'block',
|
|
|
|
paddingTop: 15,
|
|
|
|
color: token.colorText,
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
lineHeight: token.lineHeight,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const genFormSize = (token: FormToken, height: number): CSSObject => ({
|
|
|
|
[`${token.formItemCls}-label > label`]: {
|
|
|
|
height,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${token.formItemCls}-control-input`]: {
|
|
|
|
minHeight: height,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const genFormStyle: GenerateStyle<FormToken> = token => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { componentCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
2022-04-06 22:14:16 +08:00
|
|
|
[token.componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
...resetComponent(token),
|
|
|
|
...resetForm(token),
|
|
|
|
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-text`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
display: 'inline-block',
|
|
|
|
paddingInlineEnd: token.paddingSM,
|
|
|
|
},
|
|
|
|
|
|
|
|
// ================================================================
|
|
|
|
// = Size =
|
|
|
|
// ================================================================
|
|
|
|
'&-small': {
|
|
|
|
...genFormSize(token, token.controlHeightSM),
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-large': {
|
|
|
|
...genFormSize(token, token.controlHeightLG),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const genFormItemStyle: GenerateStyle<FormToken> = token => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { formItemCls, iconCls, componentCls, rootPrefixCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
[formItemCls]: {
|
|
|
|
...resetComponent(token),
|
|
|
|
|
|
|
|
marginBottom: token.marginLG,
|
|
|
|
verticalAlign: 'top',
|
|
|
|
|
|
|
|
'&-with-help': {
|
|
|
|
transition: 'none',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`&-hidden,
|
|
|
|
&-hidden.${rootPrefixCls}-row`]: {
|
|
|
|
// https://github.com/ant-design/ant-design/issues/26141
|
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-has-warning': {
|
|
|
|
[`${formItemCls}-split`]: {
|
|
|
|
color: token.colorError,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-has-error': {
|
|
|
|
[`${formItemCls}-split`]: {
|
|
|
|
color: token.colorWarning,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// = Label =
|
|
|
|
// ==============================================================
|
|
|
|
[`${formItemCls}-label`]: {
|
|
|
|
display: 'inline-block',
|
|
|
|
flexGrow: 0,
|
|
|
|
overflow: 'hidden',
|
|
|
|
whiteSpace: 'nowrap',
|
|
|
|
textAlign: 'end',
|
|
|
|
verticalAlign: 'middle',
|
|
|
|
|
|
|
|
'&-left': {
|
|
|
|
textAlign: 'start',
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-wrap': {
|
|
|
|
overflow: 'unset',
|
|
|
|
lineHeight: `${token.lineHeight} - 0.25em`,
|
|
|
|
whiteSpace: 'unset',
|
|
|
|
},
|
|
|
|
|
|
|
|
'> label': {
|
|
|
|
position: 'relative',
|
|
|
|
display: 'inline-flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
maxWidth: '100%',
|
|
|
|
height: token.controlHeight,
|
|
|
|
color: token.colorTextHeading,
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
|
|
|
|
[`> ${iconCls}`]: {
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
verticalAlign: 'top',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Required mark
|
|
|
|
[`&${formItemCls}-required:not(${formItemCls}-required-mark-optional)::before`]: {
|
|
|
|
display: 'inline-block',
|
|
|
|
marginInlineEnd: token.marginXXS,
|
|
|
|
color: token.colorError,
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
fontFamily: 'SimSun, sans-serif',
|
|
|
|
lineHeight: 1,
|
|
|
|
content: '"*"',
|
|
|
|
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-hide-required-mark &`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// Optional mark
|
|
|
|
[`${formItemCls}-optional`]: {
|
|
|
|
display: 'inline-block',
|
|
|
|
marginInlineStart: token.marginXXS,
|
2022-08-04 16:16:50 +08:00
|
|
|
color: token.colorTextDescription,
|
2022-03-30 14:13:36 +08:00
|
|
|
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-hide-required-mark &`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// Optional mark
|
|
|
|
[`${formItemCls}-tooltip`]: {
|
2022-08-04 16:16:50 +08:00
|
|
|
color: token.colorTextDescription,
|
2022-03-30 14:13:36 +08:00
|
|
|
cursor: 'help',
|
|
|
|
writingMode: 'horizontal-tb',
|
|
|
|
marginInlineStart: token.marginXXS,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&::after': {
|
|
|
|
content: '":"',
|
|
|
|
position: 'relative',
|
|
|
|
marginBlock: 0,
|
2022-06-02 22:21:21 +08:00
|
|
|
marginInlineStart: token.marginXXS / 2,
|
2022-03-30 14:13:36 +08:00
|
|
|
marginInlineEnd: token.marginXS,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`&${formItemCls}-no-colon::after`]: {
|
|
|
|
content: '" "',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// = Input =
|
|
|
|
// ==============================================================
|
|
|
|
[`${formItemCls}-control`]: {
|
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
flexGrow: 1,
|
|
|
|
|
|
|
|
[`&:first-child:not([class^=~"'${rootPrefixCls}-col-'"]):not([class*=~"' ${rootPrefixCls}-col-'"])`]:
|
|
|
|
{
|
|
|
|
width: '100%',
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-input': {
|
|
|
|
position: 'relative',
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
minHeight: token.controlHeight,
|
|
|
|
|
|
|
|
'&-content': {
|
|
|
|
flex: 'auto',
|
|
|
|
maxWidth: '100%',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// = Explain =
|
|
|
|
// ==============================================================
|
|
|
|
[formItemCls]: {
|
|
|
|
'&-explain, &-extra': {
|
|
|
|
clear: 'both',
|
2022-08-04 16:16:50 +08:00
|
|
|
color: token.colorTextDescription,
|
2022-03-30 14:13:36 +08:00
|
|
|
fontSize: token.fontSize,
|
|
|
|
lineHeight: token.lineHeight,
|
|
|
|
transition: `color ${token.motionDurationMid} ${token.motionEaseOut}`, // sync input color transition
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-explain-connected': {
|
2022-07-19 17:51:35 +08:00
|
|
|
width: '100%',
|
2022-03-30 14:13:36 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-extra': {
|
|
|
|
minHeight: token.controlHeightSM,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-explain': {
|
|
|
|
'&-error': {
|
|
|
|
color: token.colorError,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-warning': {
|
|
|
|
color: token.colorWarning,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`&-with-help ${formItemCls}-explain`]: {
|
|
|
|
height: 'auto',
|
|
|
|
opacity: 1,
|
|
|
|
},
|
|
|
|
|
|
|
|
// ==============================================================
|
|
|
|
// = Feedback Icon =
|
|
|
|
// ==============================================================
|
|
|
|
[`${formItemCls}-feedback-icon`]: {
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
textAlign: 'center',
|
|
|
|
visibility: 'visible',
|
2022-06-21 00:34:51 +08:00
|
|
|
animationName: zoomIn,
|
2022-04-21 17:28:02 +08:00
|
|
|
animationDuration: token.motionDurationMid,
|
|
|
|
animationTimingFunction: token.motionEaseOutBack,
|
2022-03-30 14:13:36 +08:00
|
|
|
pointerEvents: 'none',
|
|
|
|
|
|
|
|
'&-success': {
|
|
|
|
color: token.colorSuccess,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-error': {
|
|
|
|
color: token.colorError,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-warning': {
|
|
|
|
color: token.colorWarning,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-validating': {
|
|
|
|
color: token.colorPrimary,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const genFormMotionStyle: GenerateStyle<FormToken> = token => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { componentCls, rootPrefixCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
2022-04-06 22:14:16 +08:00
|
|
|
[componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
// Explain holder
|
|
|
|
[`.${rootPrefixCls}-show-help`]: {
|
2022-07-19 17:51:35 +08:00
|
|
|
transition: `opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`,
|
|
|
|
|
|
|
|
'&-appear, &-enter': {
|
|
|
|
opacity: 0,
|
|
|
|
|
|
|
|
'&-active': {
|
|
|
|
opacity: 1,
|
|
|
|
},
|
|
|
|
},
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
'&-leave': {
|
2022-07-19 17:51:35 +08:00
|
|
|
opacity: 1,
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
'&-active': {
|
2022-07-19 17:51:35 +08:00
|
|
|
opacity: 0,
|
2022-03-30 14:13:36 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// Explain
|
|
|
|
[`.${rootPrefixCls}-show-help-item`]: {
|
|
|
|
overflow: 'hidden',
|
|
|
|
transition: `height ${token.motionDurationSlow} ${token.motionEaseInOut},
|
|
|
|
opacity ${token.motionDurationSlow} ${token.motionEaseInOut},
|
|
|
|
transform ${token.motionDurationSlow} ${token.motionEaseInOut} !important`,
|
|
|
|
|
|
|
|
[`&-appear,
|
|
|
|
&-enter`]: {
|
|
|
|
transform: `translateY(-5px)`,
|
|
|
|
opacity: 0,
|
|
|
|
|
|
|
|
'&-active': {
|
|
|
|
transform: 'translateY(0)',
|
|
|
|
opacity: 1,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-leave-active': {
|
|
|
|
transform: `translateY(-5px)`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const genHorizontalStyle: GenerateStyle<FormToken> = token => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { componentCls, formItemCls, rootPrefixCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-horizontal`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[`${formItemCls}-label`]: {
|
|
|
|
flexGrow: 0,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${formItemCls}-control`]: {
|
|
|
|
flex: '1 1 0',
|
|
|
|
// https://github.com/ant-design/ant-design/issues/32777
|
|
|
|
// https://github.com/ant-design/ant-design/issues/33773
|
|
|
|
minWidth: 0,
|
|
|
|
},
|
|
|
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/32980
|
|
|
|
[`${formItemCls}-label.${rootPrefixCls}-col-24 + ${formItemCls}-control`]: {
|
|
|
|
minWidth: 'unset',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const genInlineStyle: GenerateStyle<FormToken> = token => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { componentCls, formItemCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-inline`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
display: 'flex',
|
|
|
|
flexWrap: 'wrap',
|
|
|
|
|
|
|
|
[formItemCls]: {
|
|
|
|
flex: 'none',
|
|
|
|
flexWrap: 'nowrap',
|
|
|
|
marginInlineEnd: token.margin,
|
|
|
|
marginBottom: 0,
|
|
|
|
|
|
|
|
'&-with-help': {
|
|
|
|
marginBottom: token.marginLG,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`> ${formItemCls}-label,
|
|
|
|
> ${formItemCls}-control`]: {
|
|
|
|
display: 'inline-block',
|
|
|
|
verticalAlign: 'top',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`> ${formItemCls}-label`]: {
|
|
|
|
flex: 'none',
|
|
|
|
},
|
|
|
|
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-text`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
display: 'inline-block',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${formItemCls}-has-feedback`]: {
|
|
|
|
display: 'inline-block',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const makeVerticalLayoutLabel = (token: FormToken): CSSObject => ({
|
|
|
|
margin: 0,
|
|
|
|
padding: `0 0 ${token.paddingXS}px`,
|
|
|
|
whiteSpace: 'initial',
|
|
|
|
textAlign: 'start',
|
|
|
|
|
|
|
|
'> label': {
|
|
|
|
margin: 0,
|
|
|
|
|
|
|
|
'&::after': {
|
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const makeVerticalLayout = (token: FormToken): CSSObject => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { componentCls, formItemCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
[`${formItemCls} ${formItemCls}-label`]: {
|
|
|
|
...makeVerticalLayoutLabel(token),
|
|
|
|
},
|
2022-04-06 22:14:16 +08:00
|
|
|
[componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[formItemCls]: {
|
|
|
|
flexWrap: 'wrap',
|
|
|
|
|
|
|
|
[`${formItemCls}-label,
|
|
|
|
${formItemCls}-control`]: {
|
|
|
|
flex: '0 0 100%',
|
|
|
|
maxWidth: '100%',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const genVerticalStyle: GenerateStyle<FormToken> = token => {
|
2022-04-06 22:14:16 +08:00
|
|
|
const { componentCls, formItemCls, rootPrefixCls } = token;
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return {
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-vertical`]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[formItemCls]: {
|
2022-08-01 17:30:14 +08:00
|
|
|
'&-row': {
|
|
|
|
flexDirection: 'column',
|
|
|
|
},
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
'&-label > label': {
|
|
|
|
height: 'auto',
|
|
|
|
},
|
2022-07-13 17:52:42 +08:00
|
|
|
|
|
|
|
[`${componentCls}-item-control`]: {
|
|
|
|
width: '100%',
|
|
|
|
},
|
2022-03-30 14:13:36 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-04-06 22:14:16 +08:00
|
|
|
[`${componentCls}-vertical ${formItemCls}-label,
|
2022-03-30 14:13:36 +08:00
|
|
|
.${rootPrefixCls}-col-24${formItemCls}-label,
|
|
|
|
.${rootPrefixCls}-col-xl-24${formItemCls}-label`]: {
|
|
|
|
...makeVerticalLayoutLabel(token),
|
|
|
|
},
|
|
|
|
|
|
|
|
[`@media (max-width: ${token.screenSMMax}px)`]: {
|
|
|
|
...makeVerticalLayout(token),
|
2022-04-06 22:14:16 +08:00
|
|
|
[componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[`.${rootPrefixCls}-col-xs-24${formItemCls}-label`]: {
|
|
|
|
...makeVerticalLayoutLabel(token),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`@media (max-width: ${token.screenSMMax}px)`]: {
|
2022-04-06 22:14:16 +08:00
|
|
|
[componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[`.${rootPrefixCls}-col-sm-24${formItemCls}-label`]: {
|
|
|
|
...makeVerticalLayoutLabel(token),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`@media (max-width: ${token.screenMDMax}px)`]: {
|
2022-04-06 22:14:16 +08:00
|
|
|
[componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[`.${rootPrefixCls}-col-md-24${formItemCls}-label`]: {
|
|
|
|
...makeVerticalLayoutLabel(token),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`@media (max-width: ${token.screenLGMax}px)`]: {
|
2022-04-06 22:14:16 +08:00
|
|
|
[componentCls]: {
|
2022-03-30 14:13:36 +08:00
|
|
|
[`.${rootPrefixCls}-col-lg-24${formItemCls}-label`]: {
|
|
|
|
...makeVerticalLayoutLabel(token),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// ============================== Export ==============================
|
2022-04-06 22:14:16 +08:00
|
|
|
export default genComponentStyleHook('Form', (token, { rootPrefixCls }) => {
|
2022-04-11 16:04:00 +08:00
|
|
|
const formToken = mergeToken<FormToken>(token, {
|
2022-04-06 22:14:16 +08:00
|
|
|
formItemCls: `${token.componentCls}-item`,
|
2022-03-30 14:13:36 +08:00
|
|
|
rootPrefixCls,
|
2022-04-11 16:04:00 +08:00
|
|
|
});
|
2022-03-30 14:13:36 +08:00
|
|
|
|
|
|
|
return [
|
2022-04-06 22:14:16 +08:00
|
|
|
genFormStyle(formToken),
|
|
|
|
genFormItemStyle(formToken),
|
|
|
|
genFormMotionStyle(formToken),
|
|
|
|
genHorizontalStyle(formToken),
|
|
|
|
genInlineStyle(formToken),
|
|
|
|
genVerticalStyle(formToken),
|
2022-07-19 22:53:38 +08:00
|
|
|
genCollapseMotion(formToken),
|
2022-06-21 00:34:51 +08:00
|
|
|
zoomIn,
|
2022-03-30 14:13:36 +08:00
|
|
|
];
|
2022-04-06 22:14:16 +08:00
|
|
|
});
|