PromoCursed/node_modules/.cache/babel-loader/ff24990d7971a733c498f425d93583f3908e8a8680b195b908ce6a46a958f17e.json

1 line
18 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"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 { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport RcTextArea from 'rc-textarea';\nimport getAllowClear from '../_util/getAllowClear';\nimport { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';\nimport { devUseWarning } from '../_util/warning';\nimport { 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 { triggerFocus } from './Input';\nimport useStyle from './style';\nconst TextArea = /*#__PURE__*/forwardRef((props, ref) => {\n var _a, _b;\n const {\n prefixCls: customizePrefixCls,\n bordered = true,\n size: customizeSize,\n disabled: customDisabled,\n status: customStatus,\n allowClear,\n classNames: classes,\n rootClassName,\n className,\n style,\n styles,\n variant: customVariant\n } = props,\n rest = __rest(props, [\"prefixCls\", \"bordered\", \"size\", \"disabled\", \"status\", \"allowClear\", \"classNames\", \"rootClassName\", \"className\", \"style\", \"styles\", \"variant\"]);\n if (process.env.NODE_ENV !== 'production') {\n const {\n deprecated\n } = devUseWarning('TextArea');\n deprecated(!('bordered' in props), 'bordered', 'variant');\n }\n const {\n getPrefixCls,\n direction,\n textArea\n } = React.useContext(ConfigContext);\n // ===================== Size =====================\n const mergedSize = useSize(customizeSize);\n // ===================== Disabled =====================\n const disabled = React.useContext(DisabledContext);\n const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;\n // ===================== Status =====================\n const {\n status: contextStatus,\n hasFeedback,\n feedbackIcon\n } = React.useContext(FormItemInputContext);\n const mergedStatus = getMergedStatus(contextStatus, customStatus);\n // ===================== Ref =====================\n const innerRef = React.useRef(null);\n React.useImperativeHandle(ref, () => {\n var _a;\n return {\n resizableTextArea: (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea,\n focus: option => {\n var _a, _b;\n triggerFocus((_b = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) === null || _b === void 0 ? void 0 : _b.textArea, option);\n },\n blur: () => {\n var _a;\n return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();\n }\n };\n });\n const prefixCls = getPrefixCls('input', customizePrefixCls);\n // ===================== Style =====================\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n const [variant, enableVariantCls] = useVariant('textArea', customVariant, bordered);\n const mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : textArea === null || textArea === void 0 ? void 0 : textArea.allowClear);\n return wrapCSSVar( /*#__PURE__*/React.createElement(RcTextArea, Object.assign({\n autoComplete: textArea === null || textArea === void 0 ? void 0 : textArea.autoComplete\n }, rest, {\n style: Object.assign(Object.assign({}, textArea === null |