{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"min\", \"max\", \"step\", \"defaultValue\", \"value\", \"disabled\", \"readOnly\", \"upHandler\", \"downHandler\", \"keyboard\", \"changeOnWheel\", \"controls\", \"classNames\", \"stringMode\", \"parser\", \"formatter\", \"precision\", \"decimalSeparator\", \"onChange\", \"onInput\", \"onPressEnter\", \"onStep\", \"changeOnBlur\", \"domRef\"],\n _excluded2 = [\"disabled\", \"style\", \"prefixCls\", \"value\", \"prefix\", \"suffix\", \"addonBefore\", \"addonAfter\", \"className\", \"classNames\"];\nimport getMiniDecimal, { getNumberPrecision, num2str, toFixed, validateNumber } from '@rc-component/mini-decimal';\nimport clsx from 'classnames';\nimport { BaseInput } from 'rc-input';\nimport { useLayoutUpdateEffect } from \"rc-util/es/hooks/useLayoutEffect\";\nimport proxyObject from \"rc-util/es/proxyObject\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport useCursor from \"./hooks/useCursor\";\nimport StepHandler from \"./StepHandler\";\nimport { getDecupleSteps } from \"./utils/numberUtil\";\nimport { triggerFocus } from \"rc-input/es/utils/commonUtils\";\nimport useFrame from \"./hooks/useFrame\";\n/**\n * We support `stringMode` which need handle correct type when user call in onChange\n * format max or min value\n * 1. if isInvalid return null\n * 2. if precision is undefined, return decimal\n * 3. format with precision\n * I. if max > 0, round down with precision. Example: max= 3.5, precision=0 afterFormat: 3\n * II. if max < 0, round up with precision. Example: max= -3.5, precision=0 afterFormat: -4\n * III. if min > 0, round up with precision. Example: min= 3.5, precision=0 afterFormat: 4\n * IV. if min < 0, round down with precision. Example: max= -3.5, precision=0 afterFormat: -3\n */\nvar getDecimalValue = function getDecimalValue(stringMode, decimalValue) {\n if (stringMode || decimalValue.isEmpty()) {\n return decimalValue.toString();\n }\n return decimalValue.toNumber();\n};\nvar getDecimalIfValidate = function getDecimalIfValidate(value) {\n var decimal = getMiniDecimal(value);\n return decimal.isInvalidate() ? null : decimal;\n};\nvar InternalInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n min = props.min,\n max = props.max,\n _props$step = props.step,\n step = _props$step === void 0 ? 1 : _props$step,\n defaultValue = props.defaultValue,\n value = props.value,\n disabled = props.disabled,\n readOnly = props.readOnly,\n upHandler = props.upHandler,\n downHandler = props.downHandler,\n keyboard = props.keyboard,\n _props$changeOnWheel = props.changeOnWheel,\n changeOnWheel = _props$changeOnWheel === void 0 ? false : _props$changeOnWheel,\n _props$controls = props.controls,\n controls = _props$controls === void 0 ? true : _props$controls,\n classNames = props.classNames,\n stringMode = props.stringMode,\n parser = props.parser,\n formatter = props.formatter,\n precision = props.precision,\n decimalSeparator = props.decimalSeparator,\n onChange = props.onChange,\n onInput = props.onInput,\n onPressEnter = props.onPressEnter,\n onStep = props.onStep,\n _props$changeOnBlur = props.changeOnBlur,\n changeOnBlur = _props$changeOnBlur === void 0 ? true : _props$changeOnBlur,\n domRef = props.domRef,\n inputProps = _objectWithoutProperties(props, _excluded);\n var inputClassName = \"\".concat(prefixCls, \"-input\");\n var inputRef = React.useRef(null);\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focus = _React$useState2[0],\n setFocus = _React$useState2[1];\n var userTypingRef = React.useRef(false);\n var compositionRef = React.useRef(false);\n var shiftKeyRef = React.useRef(false);\n\n // ============================ Value =============================\n // Real value control\n var _React$useState3 = React.useState(function () {\n return getMiniDecimal(value !== null && value !== void 0 ? value : defaultValue);\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n decimalValue = _React$useState4[0],\n setDecimalValue = _React$useState4[1];\n function setUncontrolledDecimalValue(newDecimal) {\n if (value === undefined) {\n setDecimalValue(newDecimal);\n }\n }\n\n // ====================== Parser & Formatter ======================\n /**\n * `precision` is used for formatter & onChange.\n * It will auto generate by `value` & `step`.\n * But it will not block user typing.\n *\n * Note: Auto generate `precision` is used for legacy logic.\n * We should remove this since we already support high precision with BigInt.\n *\n * @param number Provide which number should calculate precision\n * @param userTyping Change by user typing\n */\n var getPrecision = React.useCallback(function (numStr, userTyping) {\n if (userTyping) {\n return undefined;\n }\n if (precision >= 0) {\n return precision;\n }\n return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));\n }, [precision, step]);\n\n // >>> Parser\n var mergedParser = React.useCallback(function (num) {\n var numStr = String(num);\n if (parser) {\n return parser(numStr);\n }\n var parsedStr = numStr;\n if (decimalSeparator) {\n parsedStr = parsedStr.replace(decimalSeparator, '.');\n }\n\n // [Legacy] We still support auto convert `$ 123,456` to `123456`\n return parsedStr.replace(/[^\\w.-]+/g, '');\n }, [parser, decimalSeparator]);\n\n // >>> Formatter\n var inputValueRef = React.useRef('');\n var mergedFormatter = React.useCallback(function (number, userTyping) {\n if (formatter) {\n return formatter(number, {\n userTyping: userTyping,\n input: String(inputValueRef.current)\n });\n }\n var str = typeof number === 'number' ? num2str(number) : number;\n\n // User typing will not auto format with precision directly\n if (!userTyping) {\n var mergedPrecision = getPrecision(str, userTyping);\n if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) {\n // Separator\n var separatorStr = decimalSeparator || '.';\n str = toFixed(str, separatorStr, mergedPrecision);\n }\n }\n return str;\n }, [formatter, getPrecision, decimalSeparator]);\n\n // ========================== InputValue ==========================\n /**\n * Input text value control\n *\n * User can not update input content directly. It updates with follow rules by priority:\n * 1. controlled `value` changed\n * * [SPECIAL] Typing like `1.` should not immediately convert to `1`\n * 2. User typing with format (not precision)\n * 3. Blur or Enter trigger revalidate\n */\n var _React$useState5 = React.useState(function () {\n var initValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;\n if (decimalValue.isInvalidate() && ['string', 'number'].includes(_typeof(initValue))) {\n return Number.isNaN(initValue) ? '' : initValue;\n }\n return mergedFormatter(decimalValue.toString(), false);\n }),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n inputValue = _React$useState6[0],\n setInternalInputValue = _React$useState6[1];\n inputValueRef.current = inputValue;\n\n // Should always be string\n function setInputValue(newValue, userTyping) {\n setInternalInputValue(mergedFormatter(\n // Invalidate number is sometime passed by external control, we should let it go\n // Otherwise is controlled by internal interactive logic which check by userTyping\n // You can ref 'show limited value when input is not focused' test for more info.\n newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));\n }\n\n // >>> Max & Min limit\n var maxDecimal = React.useMemo(function () {\n return getDecimalIfValidate(max);\n }, [max, precision]);\n var minDecimal = React.useMemo(function () {\n return getDecimalIfValidate(min);\n }, [min, precision]);\n var upDisabled = React.useMemo(function () {\n if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) {\n return false;\n }\n return maxDecimal.lessEquals(decimalValue);\n }, [maxDecimal, decimalValue]);\n var downDisabled = React.useMemo(function () {\n if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) {\n return false;\n }\n return decimalValue.lessEquals(minDecimal);\n }, [minDecimal, decimalValue]);\n\n // Cursor controller\n var _useCursor = useCursor(inputRef.current, focus),\n _useCursor2 = _slicedToArray(_useCursor, 2),\n recordCursor = _useCursor2[0],\n restoreCursor = _useCursor2[1];\n\n // ============================= Data =============================\n /**\n * Find target value closet within range.\n * e.g. [11, 28]:\n * 3 => 11\n * 23 => 23\n * 99 => 28\n */\n var getRangeValue = function getRangeValue(target) {\n // target > max\n if (maxDecimal && !target.lessEquals(maxDecimal)) {\n return maxDecimal;\n }\n\n // target < min\n if (minDecimal && !minDecimal.lessEquals(target)) {\n return minDecimal;\n }\n return null;\n };\n\n /**\n * Check value is in [min, max] range\n */\n var isInRange = function isInRange(target) {\n return !getRangeValue(target);\n };\n\n /**\n * Trigger `onChange` if value validated and not equals of origin.\n * Return the value that re-align in range.\n */\n var triggerValueUpdate = function triggerValueUpdate(newValue, userTyping) {\n var updateValue = newValue;\n var isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();\n\n // Skip align value when trigger value is empty.\n // We just trigger onChange(null)\n // This should not block user typing\n if (!updateValue.isEmpty() && !userTyping) {\n // Revert value in range if needed\n updateValue = getRangeValue(updateValue) || updateValue;\n isRangeValidate = true;\n }\n if (!readOnly && !disabled && isRangeValidate) {\n var numStr = updateValue.toString();\n var mergedPrecision = getPrecision(numStr, userTyping);\n if (mergedPrecision >= 0) {\n updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision));\n\n // When to fixed. The value may out of min & max range.\n // 4 in [0, 3.8] => 3.8 => 4 (toFixed)\n if (!isInRange(updateValue)) {\n updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision, true));\n }\n }\n\n // Trigger event\n if (!updateValue.equals(decimalValue)) {\n setUncontrolledDecimalValue(updateValue);\n onChange === null || onChange === void 0 || onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));\n\n // Reformat input if value is not controlled\n if (value === undefined) {\n setInputValue(updateValue, userTyping);\n }\n }\n return updateValue;\n }\n return decimalValue;\n };\n\n // ========================== User Input ==========================\n var onNextPromise = useFrame();\n\n // >>> Collect input value\n var collectInputValue = function collectInputValue(inputStr) {\n recordCursor();\n\n // Update inputValue in case input can not parse as number\n // Refresh ref value immediately since it may used by formatter\n inputValueRef.current = inputStr;\n setInternalInputValue(inputStr);\n\n // Parse number\n if (!compositionRef.current) {\n var finalValue = mergedParser(inputStr);\n var finalDecimal = getMiniDecimal(finalValue);\n if (!finalDecimal.isNaN()) {\n triggerValueUpdate(finalDecimal, true);\n }\n }\n\n // Trigger onInput later to let user customize value if they want to handle something after onChange\n onInput === null || onInput === void 0 || onInput(inputStr);\n\n // optimize for chinese input experience\n // https://github.com/ant-design/ant-design/issues/8196\n onNextPromise(function () {\n var nextInputStr = inputStr;\n if (!parser) {\n nextInputStr = inputStr.replace(/。/g, '.');\n }\n if (nextInputStr !== inputStr) {\n collectInputValue(nextInputStr);\n }\n });\n };\n\n // >>> Composition\n var onCompositionStart = function onCompositionStart() {\n compositionRef.current = true;\n };\n var onCompositionEnd = function onCompositionEnd() {\n compositionRef.current = false;\n collectInputValue(inputRef.current.value);\n };\n\n // >>> Input\n var onInternalInput = function onInternalInput(e) {\n collectInputValue(e.target.value);\n };\n\n // ============================= Step =============================\n var onInternalStep = function onInternalStep(up) {\n var _inputRef$current;\n // Ignore step since out of range\n if (up && upDisabled || !up && downDisabled) {\n return;\n }\n\n // Clear typing status since it may be caused by up & down key.\n // We should sync with input value.\n userTypingRef.current = false;\n var stepDecimal = getMiniDecimal(shiftKeyRef.current ? getDecupleSteps(step) : step);\n if (!up) {\n stepDecimal = stepDecimal.negate();\n }\n var target = (decimalValue || getMiniDecimal(0)).add(stepDecimal.toString());\n var updatedValue = triggerValueUpdate(target, false);\n onStep === null || onStep === void 0 || onStep(getDecimalValue(stringMode, updatedValue), {\n offset: shiftKeyRef.current ? getDecupleSteps(step) : step,\n type: up ? 'up' : 'down'\n });\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();\n };\n\n // ============================ Flush =============================\n /**\n * Flush current input content to trigger value change & re-formatter input if needed.\n * This will always flush input value for update.\n * If it's invalidate, will fallback to last validate value.\n */\n var flushInputValue = function flushInputValue(userTyping) {\n var parsedValue = getMiniDecimal(mergedParser(inputValue));\n var formatValue;\n if (!parsedValue.isNaN()) {\n // Only validate value or empty value can be re-fill to inputValue\n // Reassign the formatValue within ranged of trigger control\n formatValue = triggerValueUpdate(parsedValue, userTyping);\n } else {\n formatValue = triggerValueUpdate(decimalValue, userTyping);\n }\n if (value !== undefined) {\n // Reset back with controlled value first\n setInputValue(decimalValue, false);\n } else if (!formatValue.isNaN()) {\n // Reset input back since no validate value\n setInputValue(formatValue, false);\n }\n };\n\n // Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)\n var onBeforeInput = function onBeforeInput() {\n userTypingRef.current = true;\n };\n var onKeyDown = function onKeyDown(event) {\n var key = event.key,\n shiftKey = event.shiftKey;\n userTypingRef.current = true;\n shiftKeyRef.current = shiftKey;\n if (key === 'Enter') {\n if (!compositionRef.current) {\n userTypingRef.current = false;\n }\n flushInputValue(false);\n onPressEnter === null || onPressEnter === void 0 || onPressEnter(event);\n }\n if (keyboard === false) {\n return;\n }\n\n // Do step\n if (!compositionRef.current && ['Up', 'ArrowUp', 'Down', 'ArrowDown'].includes(key)) {\n onInternalStep(key === 'Up' || key === 'ArrowUp');\n event.preventDefault();\n }\n };\n var onKeyUp = function onKeyUp() {\n userTypingRef.current = false;\n shiftKeyRef.current = false;\n };\n React.useEffect(function () {\n if (changeOnWheel && focus) {\n var onWheel = function onWheel(event) {\n // moving mouse wheel rises wheel event with deltaY < 0\n // scroll value grows from top to bottom, as screen Y coordinate\n onInternalStep(event.deltaY < 0);\n event.preventDefault();\n };\n var input = inputRef.current;\n if (input) {\n // React onWheel is passive and we can't preventDefault() in it.\n // That's why we should subscribe with DOM listener\n // https://stackoverflow.com/questions/63663025/react-onwheel-handler-cant-preventdefault-because-its-a-passive-event-listenev\n input.addEventListener('wheel', onWheel, {\n passive: false\n });\n return function () {\n return input.removeEventListener('wheel', onWheel);\n };\n }\n }\n });\n\n // >>> Focus & Blur\n var onBlur = function onBlur() {\n if (changeOnBlur) {\n flushInputValue(false);\n }\n setFocus(false);\n userTypingRef.current = false;\n };\n\n // ========================== Controlled ==========================\n // Input by precision & formatter\n useLayoutUpdateEffect(function () {\n if (!decimalValue.isInvalidate()) {\n setInputValue(decimalValue, false);\n }\n }, [precision, formatter]);\n\n // Input by value\n useLayoutUpdateEffect(function () {\n var newValue = getMiniDecimal(value);\n setDecimalValue(newValue);\n var currentParsedValue = getMiniDecimal(mergedParser(inputValue));\n\n // When user typing from `1.2` to `1.`, we should not convert to `1` immediately.\n // But let it go if user set `formatter`\n if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) {\n // Update value as effect\n setInputValue(newValue, userTypingRef.current);\n }\n }, [value]);\n\n // ============================ Cursor ============================\n useLayoutUpdateEffect(function () {\n if (formatter) {\n restoreCursor();\n }\n }, [inputValue]);\n\n // ============================ Render ============================\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: domRef,\n className: clsx(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-focused\"), focus), \"\".concat(prefixCls, \"-disabled\"), disabled), \"\".concat(prefixCls, \"-readonly\"), readOnly), \"\".concat(prefixCls, \"-not-a-number\"), decimalValue.isNaN()), \"\".concat(prefixCls, \"-out-of-range\"), !decimalValue.isInvalidate() && !isInRange(decimalValue))),\n style: style,\n onFocus: function onFocus() {\n setFocus(true);\n },\n onBlur: onBlur,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n onCompositionStart: onCompositionStart,\n onCompositionEnd: onCompositionEnd,\n onBeforeInput: onBeforeInput\n }, controls && /*#__PURE__*/React.createElement(StepHandler, {\n prefixCls: prefixCls,\n upNode: upHandler,\n downNode: downHandler,\n upDisabled: upDisabled,\n downDisabled: downDisabled,\n onStep: onInternalStep\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(inputClassName, \"-wrap\")\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n autoComplete: \"off\",\n role: \"spinbutton\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": decimalValue.isInvalidate() ? null : decimalValue.toString(),\n step: step\n }, inputProps, {\n ref: composeRef(inputRef, ref),\n className: inputClassName,\n value: inputValue,\n onChange: onInternalInput,\n disabled: disabled,\n readOnly: readOnly\n }))));\n});\nvar InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var disabled = props.disabled,\n style = props.style,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-input-number' : _props$prefixCls,\n value = props.value,\n prefix = props.prefix,\n suffix = props.suffix,\n addonBefore = props.addonBefore,\n addonAfter = props.addonAfter,\n className = props.className,\n classNames = props.classNames,\n rest = _objectWithoutProperties(props, _excluded2);\n var holderRef = React.useRef(null);\n var inputNumberDomRef = React.useRef(null);\n var inputFocusRef = React.useRef(null);\n var focus = function focus(option) {\n if (inputFocusRef.current) {\n triggerFocus(inputFocusRef.current, option);\n }\n };\n React.useImperativeHandle(ref, function () {\n return proxyObject(inputFocusRef.current, {\n nativeElement: holderRef.current.nativeElement || inputNumberDomRef.current\n });\n });\n return /*#__PURE__*/React.createElement(BaseInput, {\n className: className,\n triggerFocus: focus,\n prefixCls: prefixCls,\n value: value,\n disabled: disabled,\n style: style,\n prefix: prefix,\n suffix: suffix,\n addonAfter: addonAfter,\n addonBefore: addonBefore,\n classNames: classNames,\n components: {\n affixWrapper: 'div',\n groupWrapper: 'div',\n wrapper: 'div',\n groupAddon: 'div'\n },\n ref: holderRef\n }, /*#__PURE__*/React.createElement(InternalInputNumber, _extends({\n prefixCls: prefixCls,\n disabled: disabled,\n ref: inputFocusRef,\n domRef: inputNumberDomRef,\n className: classNames === null || classNames === void 0 ? void 0 : classNames.input\n }, rest)));\n});\nif (process.env.NODE_ENV !== 'production') {\n InputNumber.displayName = 'InputNumber';\n}\nexport default InputNumber;","map":{"version":3,"names":["_extends","_defineProperty","_typeof","_slicedToArray","_objectWithoutProperties","_excluded","_excluded2","getMiniDecimal","getNumberPrecision","num2str","toFixed","validateNumber","clsx","BaseInput","useLayoutUpdateEffect","proxyObject","composeRef","React","useCursor","StepHandler","getDecupleSteps","triggerFocus","useFrame","getDecimalValue","stringMode","decimalValue","isEmpty","toString","toNumber","getDecimalIfValidate","value","decimal","isInvalidate","InternalInputNumber","forwardRef","props","ref","prefixCls","className","style","min","max","_props$step","step","defaultValue","disabled","readOnly","upHandler","downHandler","keyboard","_props$changeOnWheel","changeOnWheel","_props$controls","controls","classNames","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","_props$changeOnBlur","changeOnBlur","domRef","inputProps","inputClassName","concat","inputRef","useRef","_React$useState","useState","_React$useState2","focus","setFocus","userTypingRef","compositionRef","shiftKeyRef","_React$useState3","_React$useState4","setDecimalValue","setUncontrolledDecimalValue","newDecimal","undefined","getPrecision","useCallback","numStr","userTyping","Math","mergedParser","num","String","parsedStr","replace","inputValueRef","mergedFormatter","number","input","current","str","mergedPrecision","separatorStr","_React$useState5","initValue","includes","Number","isNaN","_React$useState6","inputValue","setInternalInputValue","setInputValue","newValue","maxDecimal","useMemo","minDecimal","upDisabled","lessEquals","downDisabled","_useCursor","_useCursor2","recordCursor","restoreCursor","getRangeValue","target","isInRange","triggerValueUpdate","updateValue","isRangeValidate","equals","onNextPromise","collectInputValue","inputStr","finalValue","finalDecimal","nextInputStr","onCompositionStart","onCompositionEnd","onInternalInput","e","onInternalStep","up","_inputRef$current","stepDecimal","negate","add","updatedValue","offset","type","flushInputValue","parsedValue","formatValue","onBeforeInput","onKeyDown","event","key","shiftKey","preventDefault","onKeyUp","useEffect","onWheel","deltaY","addEventListener","passive","removeEventListener","onBlur","currentParsedValue","createElement","onFocus","upNode","downNode","autoComplete","role","InputNumber","_props$prefixCls","prefix","suffix","addonBefore","addonAfter","rest","holderRef","inputNumberDomRef","inputFocusRef","option","useImperativeHandle","nativeElement","components","affixWrapper","groupWrapper","wrapper","groupAddon","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-input-number/es/InputNumber.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"min\", \"max\", \"step\", \"defaultValue\", \"value\", \"disabled\", \"readOnly\", \"upHandler\", \"downHandler\", \"keyboard\", \"changeOnWheel\", \"controls\", \"classNames\", \"stringMode\", \"parser\", \"formatter\", \"precision\", \"decimalSeparator\", \"onChange\", \"onInput\", \"onPressEnter\", \"onStep\", \"changeOnBlur\", \"domRef\"],\n _excluded2 = [\"disabled\", \"style\", \"prefixCls\", \"value\", \"prefix\", \"suffix\", \"addonBefore\", \"addonAfter\", \"className\", \"classNames\"];\nimport getMiniDecimal, { getNumberPrecision, num2str, toFixed, validateNumber } from '@rc-component/mini-decimal';\nimport clsx from 'classnames';\nimport { BaseInput } from 'rc-input';\nimport { useLayoutUpdateEffect } from \"rc-util/es/hooks/useLayoutEffect\";\nimport proxyObject from \"rc-util/es/proxyObject\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport useCursor from \"./hooks/useCursor\";\nimport StepHandler from \"./StepHandler\";\nimport { getDecupleSteps } from \"./utils/numberUtil\";\nimport { triggerFocus } from \"rc-input/es/utils/commonUtils\";\nimport useFrame from \"./hooks/useFrame\";\n/**\n * We support `stringMode` which need handle correct type when user call in onChange\n * format max or min value\n * 1. if isInvalid return null\n * 2. if precision is undefined, return decimal\n * 3. format with precision\n * I. if max > 0, round down with precision. Example: max= 3.5, precision=0 afterFormat: 3\n * II. if max < 0, round up with precision. Example: max= -3.5, precision=0 afterFormat: -4\n * III. if min > 0, round up with precision. Example: min= 3.5, precision=0 afterFormat: 4\n * IV. if min < 0, round down with precision. Example: max= -3.5, precision=0 afterFormat: -3\n */\nvar getDecimalValue = function getDecimalValue(stringMode, decimalValue) {\n if (stringMode || decimalValue.isEmpty()) {\n return decimalValue.toString();\n }\n return decimalValue.toNumber();\n};\nvar getDecimalIfValidate = function getDecimalIfValidate(value) {\n var decimal = getMiniDecimal(value);\n return decimal.isInvalidate() ? null : decimal;\n};\nvar InternalInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n className = props.className,\n style = props.style,\n min = props.min,\n max = props.max,\n _props$step = props.step,\n step = _props$step === void 0 ? 1 : _props$step,\n defaultValue = props.defaultValue,\n value = props.value,\n disabled = props.disabled,\n readOnly = props.readOnly,\n upHandler = props.upHandler,\n downHandler = props.downHandler,\n keyboard = props.keyboard,\n _props$changeOnWheel = props.changeOnWheel,\n changeOnWheel = _props$changeOnWheel === void 0 ? false : _props$changeOnWheel,\n _props$controls = props.controls,\n controls = _props$controls === void 0 ? true : _props$controls,\n classNames = props.classNames,\n stringMode = props.stringMode,\n parser = props.parser,\n formatter = props.formatter,\n precision = props.precision,\n decimalSeparator = props.decimalSeparator,\n onChange = props.onChange,\n onInput = props.onInput,\n onPressEnter = props.onPressEnter,\n onStep = props.onStep,\n _props$changeOnBlur = props.changeOnBlur,\n changeOnBlur = _props$changeOnBlur === void 0 ? true : _props$changeOnBlur,\n domRef = props.domRef,\n inputProps = _objectWithoutProperties(props, _excluded);\n var inputClassName = \"\".concat(prefixCls, \"-input\");\n var inputRef = React.useRef(null);\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focus = _React$useState2[0],\n setFocus = _React$useState2[1];\n var userTypingRef = React.useRef(false);\n var compositionRef = React.useRef(false);\n var shiftKeyRef = React.useRef(false);\n\n // ============================ Value =============================\n // Real value control\n var _React$useState3 = React.useState(function () {\n return getMiniDecimal(value !== null && value !== void 0 ? value : defaultValue);\n }),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n decimalValue = _React$useState4[0],\n setDecimalValue = _React$useState4[1];\n function setUncontrolledDecimalValue(newDecimal) {\n if (value === undefined) {\n setDecimalValue(newDecimal);\n }\n }\n\n // ====================== Parser & Formatter ======================\n /**\n * `precision` is used for formatter & onChange.\n * It will auto generate by `value` & `step`.\n * But it will not block user typing.\n *\n * Note: Auto generate `precision` is used for legacy logic.\n * We should remove this since we already support high precision with BigInt.\n *\n * @param number Provide which number should calculate precision\n * @param userTyping Change by user typing\n */\n var getPrecision = React.useCallback(function (numStr, userTyping) {\n if (userTyping) {\n return undefined;\n }\n if (precision >= 0) {\n return precision;\n }\n return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));\n }, [precision, step]);\n\n // >>> Parser\n var mergedParser = React.useCallback(function (num) {\n var numStr = String(num);\n if (parser) {\n return parser(numStr);\n }\n var parsedStr = numStr;\n if (decimalSeparator) {\n parsedStr = parsedStr.replace(decimalSeparator, '.');\n }\n\n // [Legacy] We still support auto convert `$ 123,456` to `123456`\n return parsedStr.replace(/[^\\w.-]+/g, '');\n }, [parser, decimalSeparator]);\n\n // >>> Formatter\n var inputValueRef = React.useRef('');\n var mergedFormatter = React.useCallback(function (number, userTyping) {\n if (formatter) {\n return formatter(number, {\n userTyping: userTyping,\n input: String(inputValueRef.current)\n });\n }\n var str = typeof number === 'number' ? num2str(number) : number;\n\n // User typing will not auto format with precision directly\n if (!userTyping) {\n var mergedPrecision = getPrecision(str, userTyping);\n if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) {\n // Separator\n var separatorStr = decimalSeparator || '.';\n str = toFixed(str, separatorStr, mergedPrecision);\n }\n }\n return str;\n }, [formatter, getPrecision, decimalSeparator]);\n\n // ========================== InputValue ==========================\n /**\n * Input text value control\n *\n * User can not update input content directly. It updates with follow rules by priority:\n * 1. controlled `value` changed\n * * [SPECIAL] Typing like `1.` should not immediately convert to `1`\n * 2. User typing with format (not precision)\n * 3. Blur or Enter trigger revalidate\n */\n var _React$useState5 = React.useState(function () {\n var initValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;\n if (decimalValue.isInvalidate() && ['string', 'number'].includes(_typeof(initValue))) {\n return Number.isNaN(initValue) ? '' : initValue;\n }\n return mergedFormatter(decimalValue.toString(), false);\n }),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n inputValue = _React$useState6[0],\n setInternalInputValue = _React$useState6[1];\n inputValueRef.current = inputValue;\n\n // Should always be string\n function setInputValue(newValue, userTyping) {\n setInternalInputValue(mergedFormatter(\n // Invalidate number is sometime passed by external control, we should let it go\n // Otherwise is controlled by internal interactive logic which check by userTyping\n // You can ref 'show limited value when input is not focused' test for more info.\n newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));\n }\n\n // >>> Max & Min limit\n var maxDecimal = React.useMemo(function () {\n return getDecimalIfValidate(max);\n }, [max, precision]);\n var minDecimal = React.useMemo(function () {\n return getDecimalIfValidate(min);\n }, [min, precision]);\n var upDisabled = React.useMemo(function () {\n if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) {\n return false;\n }\n return maxDecimal.lessEquals(decimalValue);\n }, [maxDecimal, decimalValue]);\n var downDisabled = React.useMemo(function () {\n if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) {\n return false;\n }\n return decimalValue.lessEquals(minDecimal);\n }, [minDecimal, decimalValue]);\n\n // Cursor controller\n var _useCursor = useCursor(inputRef.current, focus),\n _useCursor2 = _slicedToArray(_useCursor, 2),\n recordCursor = _useCursor2[0],\n restoreCursor = _useCursor2[1];\n\n // ============================= Data =============================\n /**\n * Find target value closet within range.\n * e.g. [11, 28]:\n * 3 => 11\n * 23 => 23\n * 99 => 28\n */\n var getRangeValue = function getRangeValue(target) {\n // target > max\n if (maxDecimal && !target.lessEquals(maxDecimal)) {\n return maxDecimal;\n }\n\n // target < min\n if (minDecimal && !minDecimal.lessEquals(target)) {\n return minDecimal;\n }\n return null;\n };\n\n /**\n * Check value is in [min, max] range\n */\n var isInRange = function isInRange(target) {\n return !getRangeValue(target);\n };\n\n /**\n * Trigger `onChange` if value validated and not equals of origin.\n * Return the value that re-align in range.\n */\n var triggerValueUpdate = function triggerValueUpdate(newValue, userTyping) {\n var updateValue = newValue;\n var isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();\n\n // Skip align value when trigger value is empty.\n // We just trigger onChange(null)\n // This should not block user typing\n if (!updateValue.isEmpty() && !userTyping) {\n // Revert value in range if needed\n updateValue = getRangeValue(updateValue) || updateValue;\n isRangeValidate = true;\n }\n if (!readOnly && !disabled && isRangeValidate) {\n var numStr = updateValue.toString();\n var mergedPrecision = getPrecision(numStr, userTyping);\n if (mergedPrecision >= 0) {\n updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision));\n\n // When to fixed. The value may out of min & max range.\n // 4 in [0, 3.8] => 3.8 => 4 (toFixed)\n if (!isInRange(updateValue)) {\n updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision, true));\n }\n }\n\n // Trigger event\n if (!updateValue.equals(decimalValue)) {\n setUncontrolledDecimalValue(updateValue);\n onChange === null || onChange === void 0 || onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));\n\n // Reformat input if value is not controlled\n if (value === undefined) {\n setInputValue(updateValue, userTyping);\n }\n }\n return updateValue;\n }\n return decimalValue;\n };\n\n // ========================== User Input ==========================\n var onNextPromise = useFrame();\n\n // >>> Collect input value\n var collectInputValue = function collectInputValue(inputStr) {\n recordCursor();\n\n // Update inputValue in case input can not parse as number\n // Refresh ref value immediately since it may used by formatter\n inputValueRef.current = inputStr;\n setInternalInputValue(inputStr);\n\n // Parse number\n if (!compositionRef.current) {\n var finalValue = mergedParser(inputStr);\n var finalDecimal = getMiniDecimal(finalValue);\n if (!finalDecimal.isNaN()) {\n triggerValueUpdate(finalDecimal, true);\n }\n }\n\n // Trigger onInput later to let user customize value if they want to handle something after onChange\n onInput === null || onInput === void 0 || onInput(inputStr);\n\n // optimize for chinese input experience\n // https://github.com/ant-design/ant-design/issues/8196\n onNextPromise(function () {\n var nextInputStr = inputStr;\n if (!parser) {\n nextInputStr = inputStr.replace(/。/g, '.');\n }\n if (nextInputStr !== inputStr) {\n collectInputValue(nextInputStr);\n }\n });\n };\n\n // >>> Composition\n var onCompositionStart = function onCompositionStart() {\n compositionRef.current = true;\n };\n var onCompositionEnd = function onCompositionEnd() {\n compositionRef.current = false;\n collectInputValue(inputRef.current.value);\n };\n\n // >>> Input\n var onInternalInput = function onInternalInput(e) {\n collectInputValue(e.target.value);\n };\n\n // ============================= Step =============================\n var onInternalStep = function onInternalStep(up) {\n var _inputRef$current;\n // Ignore step since out of range\n if (up && upDisabled || !up && downDisabled) {\n return;\n }\n\n // Clear typing status since it may be caused by up & down key.\n // We should sync with input value.\n userTypingRef.current = false;\n var stepDecimal = getMiniDecimal(shiftKeyRef.current ? getDecupleSteps(step) : step);\n if (!up) {\n stepDecimal = stepDecimal.negate();\n }\n var target = (decimalValue || getMiniDecimal(0)).add(stepDecimal.toString());\n var updatedValue = triggerValueUpdate(target, false);\n onStep === null || onStep === void 0 || onStep(getDecimalValue(stringMode, updatedValue), {\n offset: shiftKeyRef.current ? getDecupleSteps(step) : step,\n type: up ? 'up' : 'down'\n });\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();\n };\n\n // ============================ Flush =============================\n /**\n * Flush current input content to trigger value change & re-formatter input if needed.\n * This will always flush input value for update.\n * If it's invalidate, will fallback to last validate value.\n */\n var flushInputValue = function flushInputValue(userTyping) {\n var parsedValue = getMiniDecimal(mergedParser(inputValue));\n var formatValue;\n if (!parsedValue.isNaN()) {\n // Only validate value or empty value can be re-fill to inputValue\n // Reassign the formatValue within ranged of trigger control\n formatValue = triggerValueUpdate(parsedValue, userTyping);\n } else {\n formatValue = triggerValueUpdate(decimalValue, userTyping);\n }\n if (value !== undefined) {\n // Reset back with controlled value first\n setInputValue(decimalValue, false);\n } else if (!formatValue.isNaN()) {\n // Reset input back since no validate value\n setInputValue(formatValue, false);\n }\n };\n\n // Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)\n var onBeforeInput = function onBeforeInput() {\n userTypingRef.current = true;\n };\n var onKeyDown = function onKeyDown(event) {\n var key = event.key,\n shiftKey = event.shiftKey;\n userTypingRef.current = true;\n shiftKeyRef.current = shiftKey;\n if (key === 'Enter') {\n if (!compositionRef.current) {\n userTypingRef.current = false;\n }\n flushInputValue(false);\n onPressEnter === null || onPressEnter === void 0 || onPressEnter(event);\n }\n if (keyboard === false) {\n return;\n }\n\n // Do step\n if (!compositionRef.current && ['Up', 'ArrowUp', 'Down', 'ArrowDown'].includes(key)) {\n onInternalStep(key === 'Up' || key === 'ArrowUp');\n event.preventDefault();\n }\n };\n var onKeyUp = function onKeyUp() {\n userTypingRef.current = false;\n shiftKeyRef.current = false;\n };\n React.useEffect(function () {\n if (changeOnWheel && focus) {\n var onWheel = function onWheel(event) {\n // moving mouse wheel rises wheel event with deltaY < 0\n // scroll value grows from top to bottom, as screen Y coordinate\n onInternalStep(event.deltaY < 0);\n event.preventDefault();\n };\n var input = inputRef.current;\n if (input) {\n // React onWheel is passive and we can't preventDefault() in it.\n // That's why we should subscribe with DOM listener\n // https://stackoverflow.com/questions/63663025/react-onwheel-handler-cant-preventdefault-because-its-a-passive-event-listenev\n input.addEventListener('wheel', onWheel, {\n passive: false\n });\n return function () {\n return input.removeEventListener('wheel', onWheel);\n };\n }\n }\n });\n\n // >>> Focus & Blur\n var onBlur = function onBlur() {\n if (changeOnBlur) {\n flushInputValue(false);\n }\n setFocus(false);\n userTypingRef.current = false;\n };\n\n // ========================== Controlled ==========================\n // Input by precision & formatter\n useLayoutUpdateEffect(function () {\n if (!decimalValue.isInvalidate()) {\n setInputValue(decimalValue, false);\n }\n }, [precision, formatter]);\n\n // Input by value\n useLayoutUpdateEffect(function () {\n var newValue = getMiniDecimal(value);\n setDecimalValue(newValue);\n var currentParsedValue = getMiniDecimal(mergedParser(inputValue));\n\n // When user typing from `1.2` to `1.`, we should not convert to `1` immediately.\n // But let it go if user set `formatter`\n if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) {\n // Update value as effect\n setInputValue(newValue, userTypingRef.current);\n }\n }, [value]);\n\n // ============================ Cursor ============================\n useLayoutUpdateEffect(function () {\n if (formatter) {\n restoreCursor();\n }\n }, [inputValue]);\n\n // ============================ Render ============================\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: domRef,\n className: clsx(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-focused\"), focus), \"\".concat(prefixCls, \"-disabled\"), disabled), \"\".concat(prefixCls, \"-readonly\"), readOnly), \"\".concat(prefixCls, \"-not-a-number\"), decimalValue.isNaN()), \"\".concat(prefixCls, \"-out-of-range\"), !decimalValue.isInvalidate() && !isInRange(decimalValue))),\n style: style,\n onFocus: function onFocus() {\n setFocus(true);\n },\n onBlur: onBlur,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n onCompositionStart: onCompositionStart,\n onCompositionEnd: onCompositionEnd,\n onBeforeInput: onBeforeInput\n }, controls && /*#__PURE__*/React.createElement(StepHandler, {\n prefixCls: prefixCls,\n upNode: upHandler,\n downNode: downHandler,\n upDisabled: upDisabled,\n downDisabled: downDisabled,\n onStep: onInternalStep\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(inputClassName, \"-wrap\")\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n autoComplete: \"off\",\n role: \"spinbutton\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": decimalValue.isInvalidate() ? null : decimalValue.toString(),\n step: step\n }, inputProps, {\n ref: composeRef(inputRef, ref),\n className: inputClassName,\n value: inputValue,\n onChange: onInternalInput,\n disabled: disabled,\n readOnly: readOnly\n }))));\n});\nvar InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var disabled = props.disabled,\n style = props.style,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-input-number' : _props$prefixCls,\n value = props.value,\n prefix = props.prefix,\n suffix = props.suffix,\n addonBefore = props.addonBefore,\n addonAfter = props.addonAfter,\n className = props.className,\n classNames = props.classNames,\n rest = _objectWithoutProperties(props, _excluded2);\n var holderRef = React.useRef(null);\n var inputNumberDomRef = React.useRef(null);\n var inputFocusRef = React.useRef(null);\n var focus = function focus(option) {\n if (inputFocusRef.current) {\n triggerFocus(inputFocusRef.current, option);\n }\n };\n React.useImperativeHandle(ref, function () {\n return proxyObject(inputFocusRef.current, {\n nativeElement: holderRef.current.nativeElement || inputNumberDomRef.current\n });\n });\n return /*#__PURE__*/React.createElement(BaseInput, {\n className: className,\n triggerFocus: focus,\n prefixCls: prefixCls,\n value: value,\n disabled: disabled,\n style: style,\n prefix: prefix,\n suffix: suffix,\n addonAfter: addonAfter,\n addonBefore: addonBefore,\n classNames: classNames,\n components: {\n affixWrapper: 'div',\n groupWrapper: 'div',\n wrapper: 'div',\n groupAddon: 'div'\n },\n ref: holderRef\n }, /*#__PURE__*/React.createElement(InternalInputNumber, _extends({\n prefixCls: prefixCls,\n disabled: disabled,\n ref: inputFocusRef,\n domRef: inputNumberDomRef,\n className: classNames === null || classNames === void 0 ? void 0 : classNames.input\n }, rest)));\n});\nif (process.env.NODE_ENV !== 'production') {\n InputNumber.displayName = 'InputNumber';\n}\nexport default InputNumber;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,OAAO,MAAM,mCAAmC;AACvD,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC;EAC5VC,UAAU,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW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