1 line
22 KiB
JSON
1 line
22 KiB
JSON
|
{"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 DownOutlined from \"@ant-design/icons/es/icons/DownOutlined\";\nimport UpOutlined from \"@ant-design/icons/es/icons/UpOutlined\";\nimport classNames from 'classnames';\nimport RcInputNumber from 'rc-input-number';\nimport ContextIsolator from '../_util/ContextIsolator';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport { devUseWarning } from '../_util/warning';\nimport ConfigProvider, { ConfigContext } from '../config-provider';\nimport DisabledContext from '../config-provider/DisabledContext';\nimport useCSSVarCls from '../config-provider/hooks/useCSSVarCls';\nimport useSize from '../config-provider/hooks/useSize';\nimport { FormItemInputContext } from '../form/context';\nimport useVariant from '../form/hooks/useVariants';\nimport { useCompactItemContext } from '../space/Compact';\nimport useStyle from './style';\nconst InputNumber = /*#__PURE__*/React.forwardRef((props, ref) => {\n if (process.env.NODE_ENV !== 'production') {\n const typeWarning = devUseWarning('InputNumber');\n typeWarning.deprecated(!('bordered' in props), 'bordered', 'variant');\n typeWarning(!(props.type === 'number' && props.changeOnWheel), 'usage', 'When `type=number` is used together with `changeOnWheel`, changeOnWheel may not work properly. Please delete `type=number` if it is not necessary.');\n }\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const inputRef = React.useRef(null);\n React.useImperativeHandle(ref, () => inputRef.current);\n const {\n className,\n rootClassName,\n size: customizeSize,\n disabled: customDisabled,\n prefixCls: customizePrefixCls,\n addonBefore,\n addonAfter,\n prefix,\n suffix,\n bordered,\n readOnly,\n status: customStatus,\n controls,\n variant: customVariant\n } = props,\n others = __rest(props, [\"className\", \"rootClassName\", \"size\", \"disabled\", \"prefixCls\", \"addonBefore\", \"addonAfter\", \"prefix\", \"suffix\", \"bordered\", \"readOnly\", \"status\", \"controls\", \"variant\"]);\n const prefixCls = getPrefixCls('input-number', customizePrefixCls);\n // Style\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n const {\n compactSize,\n compactItemClassnames\n } = useCompactItemContext(prefixCls, direction);\n let upIcon = /*#__PURE__*/React.createElement(UpOutlined, {\n className: `${prefixCls}-handler-up-inner`\n });\n let downIcon = /*#__PURE__*/React.createElement(DownOutlined, {\n className: `${prefixCls}-handler-down-inner`\n });\n const controlsTemp = typeof controls === 'boolean' ? controls : undefined;\n if (typeof controls === 'object') {\n upIcon = typeof controls.upIcon === 'undefined' ? upIcon : ( /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-handler-up-inner`\n }, controls.upIcon));\n downIcon = typeof controls.downIcon === 'undefined' ? downIcon : ( /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-handler-down-inner`\n }, controls.downIcon));\n }\n const {\n hasFeedback,\n status: contextStatus,\n isFormItemInput,\n feedbackIcon\n } = React.useContext(FormItemInputContext);\n const mergedStatus = getMergedStatus(contextStatus, customStatus);\n const mergedSize = useSize(ctx => {\n var _a;\n return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;\n });\n
|