1 line
44 KiB
JSON
1 line
44 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genCollapseMotion, zoomIn } from '../../style/motion';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\nimport genFormValidateMotionStyle from './explain';\nconst resetForm = token => ({\n legend: {\n display: 'block',\n width: '100%',\n marginBottom: token.marginLG,\n padding: 0,\n color: token.colorTextDescription,\n fontSize: token.fontSizeLG,\n lineHeight: 'inherit',\n border: 0,\n borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorder}`\n },\n 'input[type=\"search\"]': {\n boxSizing: 'border-box'\n },\n // Position radios and checkboxes better\n 'input[type=\"radio\"], input[type=\"checkbox\"]': {\n lineHeight: 'normal'\n },\n 'input[type=\"file\"]': {\n display: 'block'\n },\n // Make range inputs behave like textual form controls\n 'input[type=\"range\"]': {\n display: 'block',\n width: '100%'\n },\n // Make multiple select elements height not fixed\n 'select[multiple], select[size]': {\n height: 'auto'\n },\n // Focus for file, radio, and checkbox\n [`input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus`]: {\n outline: 0,\n boxShadow: `0 0 0 ${unit(token.controlOutlineWidth)} ${token.controlOutline}`\n },\n // Adjust output element\n output: {\n display: 'block',\n paddingTop: 15,\n color: token.colorText,\n fontSize: token.fontSize,\n lineHeight: token.lineHeight\n }\n});\nconst genFormSize = (token, height) => {\n const {\n formItemCls\n } = token;\n return {\n [formItemCls]: {\n [`${formItemCls}-label > label`]: {\n height\n },\n [`${formItemCls}-control-input`]: {\n minHeight: height\n }\n }\n };\n};\nconst genFormStyle = token => {\n const {\n componentCls\n } = token;\n return {\n [token.componentCls]: Object.assign(Object.assign(Object.assign({}, resetComponent(token)), resetForm(token)), {\n [`${componentCls}-text`]: {\n display: 'inline-block',\n paddingInlineEnd: token.paddingSM\n },\n // ================================================================\n // = Size =\n // ================================================================\n '&-small': Object.assign({}, genFormSize(token, token.controlHeightSM)),\n '&-large': Object.assign({}, genFormSize(token, token.controlHeightLG))\n })\n };\n};\nconst genFormItemStyle = token => {\n const {\n formItemCls,\n iconCls,\n componentCls,\n rootPrefixCls,\n antCls,\n labelRequiredMarkColor,\n labelColor,\n labelFontSize,\n labelHeight,\n labelColonMarginInlineStart,\n labelColonMarginInlineEnd,\n itemMarginBottom\n } = token;\n return {\n [formItemCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n marginBottom: itemMarginBottom,\n verticalAlign: 'top',\n '&-with-help': {\n transition: 'none'\n },\n [`&-hidden,\n &-hidden${antCls}-row`]: {\n // https://github.com/ant-design/ant-design/issues/26141\n display: 'none'\n },\n '&-has-warning': {\n [`${formItemCls}-split`]: {\n color: token.colorError\n }\n },\n '&-has-error': {\n [`${formItemCls}-split`]: {\n color: token.colorWarning\n }\n },\n // ==============================================================\n // = Label =\n // ==============================================================\n [`${formItemCls}-label`]: {\n flexGrow: 0,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textAlign: 'end',\n verticalAlign: 'middle',\n '&-left': {\n textAlign: 'start'\n },\n '&-wrap': {\n overflow: 'unset',\n lineHeight: token.lineHeight,\n
|