1 |
- {"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport QuestionCircleOutlined from \"@ant-design/icons/es/icons/QuestionCircleOutlined\";\nimport classNames from 'classnames';\nimport convertToTooltipProps from '../_util/convertToTooltipProps';\nimport Col from '../grid/col';\nimport { useLocale } from '../locale';\nimport defaultLocale from '../locale/en_US';\nimport Tooltip from '../tooltip';\nimport { FormContext } from './context';\nconst FormItemLabel = ({\n prefixCls,\n label,\n htmlFor,\n labelCol,\n labelAlign,\n colon,\n required,\n requiredMark,\n tooltip,\n vertical\n}) => {\n var _a;\n const [formLocale] = useLocale('Form');\n const {\n labelAlign: contextLabelAlign,\n labelCol: contextLabelCol,\n labelWrap,\n colon: contextColon\n } = React.useContext(FormContext);\n if (!label) {\n return null;\n }\n const mergedLabelCol = labelCol || contextLabelCol || {};\n const mergedLabelAlign = labelAlign || contextLabelAlign;\n const labelClsBasic = `${prefixCls}-item-label`;\n const labelColClassName = classNames(labelClsBasic, mergedLabelAlign === 'left' && `${labelClsBasic}-left`, mergedLabelCol.className, {\n [`${labelClsBasic}-wrap`]: !!labelWrap\n });\n let labelChildren = label;\n // Keep label is original where there should have no colon\n const computedColon = colon === true || contextColon !== false && colon !== false;\n const haveColon = computedColon && !vertical;\n // Remove duplicated user input colon\n if (haveColon && typeof label === 'string' && label.trim()) {\n labelChildren = label.replace(/[:|:]\\s*$/, '');\n }\n // Tooltip\n const tooltipProps = convertToTooltipProps(tooltip);\n if (tooltipProps) {\n const {\n icon = /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)\n } = tooltipProps,\n restTooltipProps = __rest(tooltipProps, [\"icon\"]);\n const tooltipNode = /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, restTooltipProps), /*#__PURE__*/React.cloneElement(icon, {\n className: `${prefixCls}-item-tooltip`,\n title: '',\n onClick: e => {\n // Prevent label behavior in tooltip icon\n // https://github.com/ant-design/ant-design/issues/46154\n e.preventDefault();\n },\n tabIndex: null\n }));\n labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, tooltipNode);\n }\n // Required Mark\n const isOptionalMark = requiredMark === 'optional';\n const isRenderMark = typeof requiredMark === 'function';\n const hideRequiredMark = requiredMark === false;\n if (isRenderMark) {\n labelChildren = requiredMark(labelChildren, {\n required: !!required\n });\n } else if (isOptionalMark && !required) {\n labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-item-optional`,\n title: \"\"\n }, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.optional)));\n }\n // https://github.com/ant-design/ant-design/pull/52950#discussion_r1980880316\n let markType;\n if (hideRequiredMark) {\n markType = 'hidden';\n } else if (isOptionalMark || isRenderMark) {\n markType = 'optional';\n }\n const labelClassName = classNames({\n [`${prefixCls}-item-required`]: required,\n [`${prefixCls}-item-required-mark-${markType}`]: markType,\n [`${prefixCls}-item-no-colon`]: !computedColon\n });\n return /*#__PURE__*/React.createElement(Col, Object.assign({}, mergedLabelCol, {\n className: labelColClassName\n }), /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: htmlFor,\n className: labelClassName,\n title: typeof label === 'string' ? label : ''\n }, labelChildren));\n};\nexport default FormItemLabel;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","QuestionCircleOutlined","classNames","convertToTooltipProps","Col","useLocale","defaultLocale","Tooltip","FormContext","FormItemLabel","prefixCls","label","htmlFor","labelCol","labelAlign","colon","required","requiredMark","tooltip","vertical","_a","formLocale","contextLabelAlign","contextLabelCol","labelWrap","contextColon","useContext","mergedLabelCol","mergedLabelAlign","labelClsBasic","labelColClassName","className","labelChildren","computedColon","haveColon","trim","replace","tooltipProps","icon","createElement","restTooltipProps","tooltipNode","assign","cloneElement","title","onClick","preventDefault","tabIndex","Fragment","isOptionalMark","isRenderMark","hideRequiredMark","optional","Form","markType","labelClassName"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/form/FormItemLabel.js"],"sourcesContent":["\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport QuestionCircleOutlined from \"@ant-design/icons/es/icons/QuestionCircleOutlined\";\nimport classNames from 'classnames';\nimport convertToTooltipProps from '../_util/convertToTooltipProps';\nimport Col from '../grid/col';\nimport { useLocale } from '../locale';\nimport defaultLocale from '../locale/en_US';\nimport Tooltip from '../tooltip';\nimport { FormContext } from './context';\nconst FormItemLabel = ({\n prefixCls,\n label,\n htmlFor,\n labelCol,\n labelAlign,\n colon,\n required,\n requiredMark,\n tooltip,\n vertical\n}) => {\n var _a;\n const [formLocale] = useLocale('Form');\n const {\n labelAlign: contextLabelAlign,\n labelCol: contextLabelCol,\n labelWrap,\n colon: contextColon\n } = React.useContext(FormContext);\n if (!label) {\n return null;\n }\n const mergedLabelCol = labelCol || contextLabelCol || {};\n const mergedLabelAlign = labelAlign || contextLabelAlign;\n const labelClsBasic = `${prefixCls}-item-label`;\n const labelColClassName = classNames(labelClsBasic, mergedLabelAlign === 'left' && `${labelClsBasic}-left`, mergedLabelCol.className, {\n [`${labelClsBasic}-wrap`]: !!labelWrap\n });\n let labelChildren = label;\n // Keep label is original where there should have no colon\n const computedColon = colon === true || contextColon !== false && colon !== false;\n const haveColon = computedColon && !vertical;\n // Remove duplicated user input colon\n if (haveColon && typeof label === 'string' && label.trim()) {\n labelChildren = label.replace(/[:|:]\\s*$/, '');\n }\n // Tooltip\n const tooltipProps = convertToTooltipProps(tooltip);\n if (tooltipProps) {\n const {\n icon = /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)\n } = tooltipProps,\n restTooltipProps = __rest(tooltipProps, [\"icon\"]);\n const tooltipNode = /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, restTooltipProps), /*#__PURE__*/React.cloneElement(icon, {\n className: `${prefixCls}-item-tooltip`,\n title: '',\n onClick: e => {\n // Prevent label behavior in tooltip icon\n // https://github.com/ant-design/ant-design/issues/46154\n e.preventDefault();\n },\n tabIndex: null\n }));\n labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, tooltipNode);\n }\n // Required Mark\n const isOptionalMark = requiredMark === 'optional';\n const isRenderMark = typeof requiredMark === 'function';\n const hideRequiredMark = requiredMark === false;\n if (isRenderMark) {\n labelChildren = requiredMark(labelChildren, {\n required: !!required\n });\n } else if (isOptionalMark && !required) {\n labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-item-optional`,\n title: \"\"\n }, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.optional)));\n }\n // https://github.com/ant-design/ant-design/pull/52950#discussion_r1980880316\n let markType;\n if (hideRequiredMark) {\n markType = 'hidden';\n } else if (isOptionalMark || isRenderMark) {\n markType = 'optional';\n }\n const labelClassName = classNames({\n [`${prefixCls}-item-required`]: required,\n [`${prefixCls}-item-required-mark-${markType}`]: markType,\n [`${prefixCls}-item-no-colon`]: !computedColon\n });\n return /*#__PURE__*/React.createElement(Col, Object.assign({}, mergedLabelCol, {\n className: labelColClassName\n }), /*#__PURE__*/React.createElement(\"label\", {\n htmlFor: htmlFor,\n className: labelClassName,\n title: typeof label === 'string' ? label : ''\n }, labelChildren));\n};\nexport default FormItemLabel;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,CAAC,CAACO,OAAO,CAACL,CAAC,CAACO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAIN,MAAM,CAACC,SAAS,CAACO,oBAAoB,CAACL,IAAI,CAACP,CAAC,EAAEG,CAAC,CAACO,CAAC,CAAC,CAAC,EAAER,CAAC,CAACC,CAAC,CAACO,CAAC,CAAC,CAAC,GAAGV,CAAC,CAACG,CAAC,CAACO,CAAC,CAAC,CAAC;EACnG;EACA,OAAOR,CAAC;AACV,CAAC;AACD,OAAO,KAAKW,KAAK,MAAM,OAAO;AAC9B,OAAOC,sBAAsB,MAAM,m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