numora-react 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,9 +1,299 @@
1
1
  'use strict';
2
2
 
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
3
+ var require$$0 = require('react');
5
4
  var numora = require('numora');
6
5
 
6
+ var jsxRuntime = {exports: {}};
7
+
8
+ var reactJsxRuntime_production = {};
9
+
10
+ /**
11
+ * @license React
12
+ * react-jsx-runtime.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */
19
+ var hasRequiredReactJsxRuntime_production;
20
+ function requireReactJsxRuntime_production() {
21
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
22
+ hasRequiredReactJsxRuntime_production = 1;
23
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
24
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
25
+ function jsxProd(type, config, maybeKey) {
26
+ var key = null;
27
+ void 0 !== maybeKey && (key = "" + maybeKey);
28
+ void 0 !== config.key && (key = "" + config.key);
29
+ if ("key" in config) {
30
+ maybeKey = {};
31
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
32
+ } else maybeKey = config;
33
+ config = maybeKey.ref;
34
+ return {
35
+ $$typeof: REACT_ELEMENT_TYPE,
36
+ type: type,
37
+ key: key,
38
+ ref: void 0 !== config ? config : null,
39
+ props: maybeKey
40
+ };
41
+ }
42
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
43
+ reactJsxRuntime_production.jsx = jsxProd;
44
+ reactJsxRuntime_production.jsxs = jsxProd;
45
+ return reactJsxRuntime_production;
46
+ }
47
+
48
+ var reactJsxRuntime_development = {};
49
+
50
+ /**
51
+ * @license React
52
+ * react-jsx-runtime.development.js
53
+ *
54
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
55
+ *
56
+ * This source code is licensed under the MIT license found in the
57
+ * LICENSE file in the root directory of this source tree.
58
+ */
59
+ var hasRequiredReactJsxRuntime_development;
60
+ function requireReactJsxRuntime_development() {
61
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
62
+ hasRequiredReactJsxRuntime_development = 1;
63
+ "production" !== process.env.NODE_ENV && function () {
64
+ function getComponentNameFromType(type) {
65
+ if (null == type) return null;
66
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
67
+ if ("string" === typeof type) return type;
68
+ switch (type) {
69
+ case REACT_FRAGMENT_TYPE:
70
+ return "Fragment";
71
+ case REACT_PROFILER_TYPE:
72
+ return "Profiler";
73
+ case REACT_STRICT_MODE_TYPE:
74
+ return "StrictMode";
75
+ case REACT_SUSPENSE_TYPE:
76
+ return "Suspense";
77
+ case REACT_SUSPENSE_LIST_TYPE:
78
+ return "SuspenseList";
79
+ case REACT_ACTIVITY_TYPE:
80
+ return "Activity";
81
+ }
82
+ if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
83
+ case REACT_PORTAL_TYPE:
84
+ return "Portal";
85
+ case REACT_CONTEXT_TYPE:
86
+ return type.displayName || "Context";
87
+ case REACT_CONSUMER_TYPE:
88
+ return (type._context.displayName || "Context") + ".Consumer";
89
+ case REACT_FORWARD_REF_TYPE:
90
+ var innerType = type.render;
91
+ type = type.displayName;
92
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
93
+ return type;
94
+ case REACT_MEMO_TYPE:
95
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
96
+ case REACT_LAZY_TYPE:
97
+ innerType = type._payload;
98
+ type = type._init;
99
+ try {
100
+ return getComponentNameFromType(type(innerType));
101
+ } catch (x) {}
102
+ }
103
+ return null;
104
+ }
105
+ function testStringCoercion(value) {
106
+ return "" + value;
107
+ }
108
+ function checkKeyStringCoercion(value) {
109
+ try {
110
+ testStringCoercion(value);
111
+ var JSCompiler_inline_result = !1;
112
+ } catch (e) {
113
+ JSCompiler_inline_result = true;
114
+ }
115
+ if (JSCompiler_inline_result) {
116
+ JSCompiler_inline_result = console;
117
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
118
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
119
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
120
+ return testStringCoercion(value);
121
+ }
122
+ }
123
+ function getTaskName(type) {
124
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
125
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
126
+ try {
127
+ var name = getComponentNameFromType(type);
128
+ return name ? "<" + name + ">" : "<...>";
129
+ } catch (x) {
130
+ return "<...>";
131
+ }
132
+ }
133
+ function getOwner() {
134
+ var dispatcher = ReactSharedInternals.A;
135
+ return null === dispatcher ? null : dispatcher.getOwner();
136
+ }
137
+ function UnknownOwner() {
138
+ return Error("react-stack-top-frame");
139
+ }
140
+ function hasValidKey(config) {
141
+ if (hasOwnProperty.call(config, "key")) {
142
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
143
+ if (getter && getter.isReactWarning) return false;
144
+ }
145
+ return void 0 !== config.key;
146
+ }
147
+ function defineKeyPropWarningGetter(props, displayName) {
148
+ function warnAboutAccessingKey() {
149
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
150
+ }
151
+ warnAboutAccessingKey.isReactWarning = true;
152
+ Object.defineProperty(props, "key", {
153
+ get: warnAboutAccessingKey,
154
+ configurable: true
155
+ });
156
+ }
157
+ function elementRefGetterWithDeprecationWarning() {
158
+ var componentName = getComponentNameFromType(this.type);
159
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
160
+ componentName = this.props.ref;
161
+ return void 0 !== componentName ? componentName : null;
162
+ }
163
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
164
+ var refProp = props.ref;
165
+ type = {
166
+ $$typeof: REACT_ELEMENT_TYPE,
167
+ type: type,
168
+ key: key,
169
+ props: props,
170
+ _owner: owner
171
+ };
172
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
173
+ enumerable: false,
174
+ get: elementRefGetterWithDeprecationWarning
175
+ }) : Object.defineProperty(type, "ref", {
176
+ enumerable: false,
177
+ value: null
178
+ });
179
+ type._store = {};
180
+ Object.defineProperty(type._store, "validated", {
181
+ configurable: false,
182
+ enumerable: false,
183
+ writable: true,
184
+ value: 0
185
+ });
186
+ Object.defineProperty(type, "_debugInfo", {
187
+ configurable: false,
188
+ enumerable: false,
189
+ writable: true,
190
+ value: null
191
+ });
192
+ Object.defineProperty(type, "_debugStack", {
193
+ configurable: false,
194
+ enumerable: false,
195
+ writable: true,
196
+ value: debugStack
197
+ });
198
+ Object.defineProperty(type, "_debugTask", {
199
+ configurable: false,
200
+ enumerable: false,
201
+ writable: true,
202
+ value: debugTask
203
+ });
204
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
205
+ return type;
206
+ }
207
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
208
+ var children = config.children;
209
+ if (void 0 !== children) if (isStaticChildren) {
210
+ if (isArrayImpl(children)) {
211
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
212
+ Object.freeze && Object.freeze(children);
213
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
214
+ } else validateChildKeys(children);
215
+ if (hasOwnProperty.call(config, "key")) {
216
+ children = getComponentNameFromType(type);
217
+ var keys = Object.keys(config).filter(function (k) {
218
+ return "key" !== k;
219
+ });
220
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
221
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = true);
222
+ }
223
+ children = null;
224
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
225
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
226
+ if ("key" in config) {
227
+ maybeKey = {};
228
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
229
+ } else maybeKey = config;
230
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
231
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
232
+ }
233
+ function validateChildKeys(node) {
234
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
235
+ }
236
+ function isValidElement(object) {
237
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
238
+ }
239
+ var React = require$$0,
240
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
241
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
242
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
243
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
244
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
245
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
246
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
247
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
248
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
249
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
250
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
251
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
252
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
253
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
254
+ ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
255
+ hasOwnProperty = Object.prototype.hasOwnProperty,
256
+ isArrayImpl = Array.isArray,
257
+ createTask = console.createTask ? console.createTask : function () {
258
+ return null;
259
+ };
260
+ React = {
261
+ react_stack_bottom_frame: function (callStackForError) {
262
+ return callStackForError();
263
+ }
264
+ };
265
+ var specialPropKeyWarningShown;
266
+ var didWarnAboutElementRef = {};
267
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
268
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
269
+ var didWarnAboutKeySpread = {};
270
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
271
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
272
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
273
+ return jsxDEVImpl(type, config, maybeKey, false, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
274
+ };
275
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
276
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
277
+ return jsxDEVImpl(type, config, maybeKey, true, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
278
+ };
279
+ }();
280
+ return reactJsxRuntime_development;
281
+ }
282
+
283
+ var hasRequiredJsxRuntime;
284
+ function requireJsxRuntime() {
285
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
286
+ hasRequiredJsxRuntime = 1;
287
+ if (process.env.NODE_ENV === 'production') {
288
+ jsxRuntime.exports = requireReactJsxRuntime_production();
289
+ } else {
290
+ jsxRuntime.exports = requireReactJsxRuntime_development();
291
+ }
292
+ return jsxRuntime.exports;
293
+ }
294
+
295
+ var jsxRuntimeExports = requireJsxRuntime();
296
+
7
297
  const DEFAULT_PROPS = {
8
298
  autoComplete: 'off',
9
299
  autoCorrect: 'off',
@@ -14,22 +304,21 @@ const DEFAULT_PROPS = {
14
304
  spellCheck: false,
15
305
  step: 'any'
16
306
  };
17
- const NumoraInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18
- let {
19
- maxDecimals = 2,
20
- onChange,
21
- formatOn = numora.FormatOn.Blur,
22
- thousandSeparator = ',',
23
- thousandStyle = numora.ThousandStyle.Thousand,
24
- decimalSeparator = '.',
25
- decimalMinLength,
26
- enableCompactNotation = false,
27
- enableNegative = false,
28
- enableLeadingZeros = false,
29
- rawValueMode = false,
30
- ...props
31
- } = _ref;
32
- const [caretPositionBeforeChange, setCaretPositionBeforeChange] = React.useState();
307
+ const NumoraInput = /*#__PURE__*/require$$0.forwardRef(({
308
+ maxDecimals = 2,
309
+ onChange,
310
+ formatOn = numora.FormatOn.Blur,
311
+ thousandSeparator = ',',
312
+ thousandStyle = numora.ThousandStyle.Thousand,
313
+ decimalSeparator = '.',
314
+ decimalMinLength,
315
+ enableCompactNotation = false,
316
+ enableNegative = false,
317
+ enableLeadingZeros = false,
318
+ rawValueMode = false,
319
+ ...props
320
+ }, ref) => {
321
+ const [caretPositionBeforeChange, setCaretPositionBeforeChange] = require$$0.useState();
33
322
  const formattingOptions = {
34
323
  formatOn,
35
324
  thousandSeparator,
@@ -79,7 +368,7 @@ const NumoraInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
79
368
  props.onBlur(e);
80
369
  }
81
370
  }
82
- return jsxRuntime.jsx("input", {
371
+ return jsxRuntimeExports.jsx("input", {
83
372
  ...DEFAULT_PROPS,
84
373
  ...props,
85
374
  ref: ref,
@@ -94,13 +383,5 @@ const NumoraInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
94
383
  });
95
384
  NumoraInput.displayName = 'NumoraInput';
96
385
 
97
- Object.defineProperty(exports, "FormatOn", {
98
- enumerable: true,
99
- get: function () { return numora.FormatOn; }
100
- });
101
- Object.defineProperty(exports, "ThousandStyle", {
102
- enumerable: true,
103
- get: function () { return numora.ThousandStyle; }
104
- });
105
386
  exports.NumoraInput = NumoraInput;
106
387
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { ChangeEvent, ClipboardEvent, forwardRef } from 'react';\nimport {\n NumoraInput,\n FormatOn,\n ThousandStyle,\n FormattingOptions,\n CaretPositionInfo,\n handleOnChangeNumoraInput,\n handleOnPasteNumoraInput,\n handleOnKeyDownNumoraInput,\n} from 'numora';\n\ninterface NumoraInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {\n maxDecimals?: number;\n onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;\n\n // Formatting options\n formatOn?: FormatOn;\n thousandSeparator?: string;\n thousandStyle?: ThousandStyle;\n decimalSeparator?: string;\n decimalMinLength?: number;\n\n // Feature flags\n enableCompactNotation?: boolean;\n enableNegative?: boolean;\n enableLeadingZeros?: boolean;\n rawValueMode?: boolean;\n}\n\nconst DEFAULT_PROPS = {\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'none',\n minLength: 1,\n placeholder: '0.0',\n pattern: '^[0-9]*[.,]?[0-9]*$',\n spellCheck: false,\n step: 'any',\n};\n\nconst NumoraInput = forwardRef<HTMLInputElement, NumoraInputProps>(\n ({\n maxDecimals = 2,\n onChange,\n formatOn = FormatOn.Blur,\n thousandSeparator = ',',\n thousandStyle = ThousandStyle.Thousand,\n decimalSeparator = '.',\n decimalMinLength,\n enableCompactNotation = false,\n enableNegative = false,\n enableLeadingZeros = false,\n rawValueMode = false,\n ...props\n }: NumoraInputProps, ref: React.Ref<HTMLInputElement>) => {\n const [caretPositionBeforeChange, setCaretPositionBeforeChange] =\n React.useState<CaretPositionInfo>();\n\n const formattingOptions: FormattingOptions = {\n formatOn,\n thousandSeparator,\n ThousandStyle: thousandStyle as any,\n decimalSeparator,\n decimalMinLength,\n enableCompactNotation,\n enableNegative,\n enableLeadingZeros,\n rawValueMode,\n };\n\n function handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {\n const caretInfo = handleOnKeyDownNumoraInput(e.nativeEvent, formattingOptions);\n\n if (caretInfo) {\n setCaretPositionBeforeChange(caretInfo);\n } else {\n const input = e.currentTarget;\n setCaretPositionBeforeChange({\n selectionStart: input.selectionStart ?? 0,\n selectionEnd: input.selectionEnd ?? 0,\n });\n }\n\n if (props.onKeyDown) {\n props.onKeyDown(e);\n }\n }\n\n function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {\n handleOnChangeNumoraInput(\n e.nativeEvent,\n maxDecimals,\n caretPositionBeforeChange,\n formattingOptions\n );\n setCaretPositionBeforeChange(undefined);\n if (onChange) onChange(e);\n }\n\n function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {\n handleOnPasteNumoraInput(e.nativeEvent, maxDecimals, formattingOptions);\n if (onChange) onChange(e);\n }\n\n function handleOnFocus(e: React.FocusEvent<HTMLInputElement>): void {\n if (formatOn === FormatOn.Blur && thousandSeparator) {\n const target = e.currentTarget;\n target.value = target.value.replace(\n new RegExp(thousandSeparator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n ''\n );\n }\n\n if (props.onFocus) {\n props.onFocus(e);\n }\n }\n\n function handleOnBlur(e: React.FocusEvent<HTMLInputElement>): void {\n if (props.onBlur) {\n props.onBlur(e);\n }\n }\n\n return (\n <input\n {...DEFAULT_PROPS}\n {...props}\n ref={ref}\n onChange={handleOnChange}\n onKeyDown={handleOnKeyDown}\n onPaste={handleOnPaste}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n type=\"text\"\n inputMode=\"decimal\"\n />\n );\n }\n);\n\nNumoraInput.displayName = 'NumoraInput';\n\nexport { NumoraInput };\nexport { FormatOn, ThousandStyle } from 'numora';\nexport type { FormattingOptions, CaretPositionInfo } from 'numora';\n"],"names":["DEFAULT_PROPS","autoComplete","autoCorrect","autoCapitalize","minLength","placeholder","pattern","spellCheck","step","NumoraInput","forwardRef","_ref","ref","maxDecimals","onChange","formatOn","FormatOn","Blur","thousandSeparator","thousandStyle","ThousandStyle","Thousand","decimalSeparator","decimalMinLength","enableCompactNotation","enableNegative","enableLeadingZeros","rawValueMode","props","caretPositionBeforeChange","setCaretPositionBeforeChange","React","useState","formattingOptions","handleOnKeyDown","e","caretInfo","handleOnKeyDownNumoraInput","nativeEvent","input","currentTarget","selectionStart","selectionEnd","onKeyDown","handleOnChange","handleOnChangeNumoraInput","undefined","handleOnPaste","handleOnPasteNumoraInput","handleOnFocus","target","value","replace","RegExp","onFocus","handleOnBlur","onBlur","_jsx","onPaste","type","inputMode","displayName"],"mappings":";;;;;;AA8BA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,cAAc,EAAE,MAAM;A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sB,cACM,CAAA,OAAA,EAAA;AAAA,IAAA,GAAAzD,aAAa;AACb,IAAA,GAAA4B,KAAK;AACThB,IAAAA,GAAG,EAAEA,GAAG;AACRE,IAAAA,QAAQ,EAAE8B,cAAc;AACxBD,IAAAA,SAAS,EAAET,eAAe;AAC1BwB,IAAAA,OAAO,EAAEX,aAAa;AACtBO,IAAAA,OAAO,EAAEL,aAAa;AACtBO,IAAAA,MAAM,EAAED,YAAY;AACpBI,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,SAAS,EAAC;AAAS,GAAA,CACnB;AAEN,CAAC;AAGHnD,WAAW,CAACoD,WAAW,GAAG,aAAa;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js","../src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import React, { ChangeEvent, ClipboardEvent, forwardRef } from 'react';\nimport {\n handleOnChangeNumoraInput,\n handleOnPasteNumoraInput,\n handleOnKeyDownNumoraInput,\n FormatOn,\n ThousandStyle,\n type FormattingOptions,\n type CaretPositionInfo,\n} from 'numora';\n\ninterface NumericInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {\n maxDecimals?: number;\n onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;\n\n // Formatting options\n formatOn?: FormatOn;\n thousandSeparator?: string;\n thousandStyle?: ThousandStyle;\n decimalSeparator?: string;\n decimalMinLength?: number;\n\n // Feature flags\n enableCompactNotation?: boolean;\n enableNegative?: boolean;\n enableLeadingZeros?: boolean;\n rawValueMode?: boolean;\n}\n\nconst DEFAULT_PROPS = {\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'none',\n minLength: 1,\n placeholder: '0.0',\n pattern: '^[0-9]*[.,]?[0-9]*$',\n spellCheck: false,\n step: 'any',\n};\n\nconst NumoraInput = forwardRef<HTMLInputElement, NumericInputProps>(\n ({\n maxDecimals = 2,\n onChange,\n formatOn = FormatOn.Blur,\n thousandSeparator = ',',\n thousandStyle = ThousandStyle.Thousand,\n decimalSeparator = '.',\n decimalMinLength,\n enableCompactNotation = false,\n enableNegative = false,\n enableLeadingZeros = false,\n rawValueMode = false,\n ...props\n }: NumericInputProps, ref) => {\n const [caretPositionBeforeChange, setCaretPositionBeforeChange] =\n React.useState<CaretPositionInfo>();\n\n const formattingOptions: FormattingOptions = {\n formatOn,\n thousandSeparator,\n ThousandStyle: thousandStyle as any,\n decimalSeparator,\n decimalMinLength,\n enableCompactNotation,\n enableNegative,\n enableLeadingZeros,\n rawValueMode,\n };\n\n function handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {\n const caretInfo = handleOnKeyDownNumoraInput(e.nativeEvent, formattingOptions);\n\n if (caretInfo) {\n setCaretPositionBeforeChange(caretInfo);\n } else {\n const input = e.currentTarget;\n setCaretPositionBeforeChange({\n selectionStart: input.selectionStart ?? 0,\n selectionEnd: input.selectionEnd ?? 0,\n });\n }\n\n if (props.onKeyDown) {\n props.onKeyDown(e);\n }\n }\n\n function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {\n handleOnChangeNumoraInput(\n e.nativeEvent,\n maxDecimals,\n caretPositionBeforeChange,\n formattingOptions\n );\n setCaretPositionBeforeChange(undefined);\n if (onChange) onChange(e);\n }\n\n function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {\n handleOnPasteNumoraInput(e.nativeEvent, maxDecimals, formattingOptions);\n if (onChange) onChange(e);\n }\n\n function handleOnFocus(e: React.FocusEvent<HTMLInputElement>): void {\n if (formatOn === FormatOn.Blur && thousandSeparator) {\n const target = e.currentTarget;\n target.value = target.value.replace(\n new RegExp(thousandSeparator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n ''\n );\n }\n\n if (props.onFocus) {\n props.onFocus(e);\n }\n }\n\n function handleOnBlur(e: React.FocusEvent<HTMLInputElement>): void {\n if (props.onBlur) {\n props.onBlur(e);\n }\n }\n\n return (\n <input\n {...DEFAULT_PROPS}\n {...props}\n ref={ref}\n onChange={handleOnChange}\n onKeyDown={handleOnKeyDown}\n onPaste={handleOnPaste}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n type=\"text\"\n inputMode=\"decimal\"\n />\n );\n }\n);\n\nNumoraInput.displayName = 'NumoraInput';\n\nexport { NumoraInput };\n"],"names":["REACT_ELEMENT_TYPE","Symbol","for","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","ref","$$typeof","props","reactJsxRuntime_production","Fragment","jsx","jsxs","process","env","NODE_ENV","getComponentNameFromType","REACT_CLIENT_REFERENCE","displayName","name","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","tag","console","error","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","toStringTag","constructor","call","getTaskName","getOwner","dispatcher","ReactSharedInternals","A","UnknownOwner","Error","hasValidKey","hasOwnProperty","getter","Object","getOwnPropertyDescriptor","get","isReactWarning","defineKeyPropWarningGetter","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","_owner","enumerable","_store","writable","freeze","jsxDEVImpl","isStaticChildren","children","isArrayImpl","length","validateChildKeys","keys","filter","k","join","didWarnAboutKeySpread","node","isValidElement","validated","status","object","React","require$$0","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","react_stack_bottom_frame","callStackForError","unknownOwnerDebugStack","bind","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","recentlyCreatedOwnerStacks","jsxRuntimeModule","exports","require$$1","DEFAULT_PROPS","autoComplete","autoCorrect","autoCapitalize","minLength","placeholder","pattern","spellCheck","step","NumoraInput","forwardRef","maxDecimals","onChange","formatOn","FormatOn","Blur","thousandSeparator","thousandStyle","ThousandStyle","Thousand","decimalSeparator","decimalMinLength","enableCompactNotation","enableNegative","enableLeadingZeros","rawValueMode","caretPositionBeforeChange","setCaretPositionBeforeChange","useState","formattingOptions","handleOnKeyDown","caretInfo","handleOnKeyDownNumoraInput","nativeEvent","input","currentTarget","selectionStart","selectionEnd","onKeyDown","handleOnChange","handleOnChangeNumoraInput","undefined","handleOnPaste","handleOnPasteNumoraInput","hand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AAAA,OAAO,EAAEV,aAAa;AACtBM,IAAAA,OAAO,EAAEJ,aAAa;AACtBM,IAAAA,MAAM,EAAED,YAAY;AACpBpK,IAAAA,IAAI,EAAC,MAAM;AACXwK,IAAAA,SAAS,EAAC;AAAS,GAAA,CACnB;AAEN,CAAC;AAGH5C,WAAW,CAAC3G,WAAW,GAAG,aAAa;;;;","x_google_ignoreList":[0,1,2]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { ChangeEvent, ClipboardEvent } from 'react';
2
- import { NumoraInput, FormatOn, ThousandStyle } from 'numora';
3
- interface NumoraInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {
2
+ import { FormatOn, ThousandStyle } from 'numora';
3
+ interface NumericInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {
4
4
  maxDecimals?: number;
5
5
  onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;
6
6
  formatOn?: FormatOn;
@@ -13,7 +13,5 @@ interface NumoraInputProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
13
13
  enableLeadingZeros?: boolean;
14
14
  rawValueMode?: boolean;
15
15
  }
16
- declare const NumoraInput: React.ForwardRefExoticComponent<NumoraInputProps & React.RefAttributes<HTMLInputElement>>;
16
+ declare const NumoraInput: React.ForwardRefExoticComponent<NumericInputProps & React.RefAttributes<HTMLInputElement>>;
17
17
  export { NumoraInput };
18
- export { FormatOn, ThousandStyle } from 'numora';
19
- export type { FormattingOptions, CaretPositionInfo } from 'numora';
package/dist/index.esm.js CHANGED
@@ -1,7 +1,296 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import React, { forwardRef } from 'react';
1
+ import require$$0, { forwardRef } from 'react';
3
2
  import { FormatOn, ThousandStyle, handleOnPasteNumoraInput, handleOnKeyDownNumoraInput, handleOnChangeNumoraInput } from 'numora';
4
- export { FormatOn, ThousandStyle } from 'numora';
3
+
4
+ var jsxRuntime = {exports: {}};
5
+
6
+ var reactJsxRuntime_production = {};
7
+
8
+ /**
9
+ * @license React
10
+ * react-jsx-runtime.production.js
11
+ *
12
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ var hasRequiredReactJsxRuntime_production;
18
+ function requireReactJsxRuntime_production() {
19
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
20
+ hasRequiredReactJsxRuntime_production = 1;
21
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
22
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
23
+ function jsxProd(type, config, maybeKey) {
24
+ var key = null;
25
+ void 0 !== maybeKey && (key = "" + maybeKey);
26
+ void 0 !== config.key && (key = "" + config.key);
27
+ if ("key" in config) {
28
+ maybeKey = {};
29
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
30
+ } else maybeKey = config;
31
+ config = maybeKey.ref;
32
+ return {
33
+ $$typeof: REACT_ELEMENT_TYPE,
34
+ type: type,
35
+ key: key,
36
+ ref: void 0 !== config ? config : null,
37
+ props: maybeKey
38
+ };
39
+ }
40
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
41
+ reactJsxRuntime_production.jsx = jsxProd;
42
+ reactJsxRuntime_production.jsxs = jsxProd;
43
+ return reactJsxRuntime_production;
44
+ }
45
+
46
+ var reactJsxRuntime_development = {};
47
+
48
+ /**
49
+ * @license React
50
+ * react-jsx-runtime.development.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */
57
+ var hasRequiredReactJsxRuntime_development;
58
+ function requireReactJsxRuntime_development() {
59
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
60
+ hasRequiredReactJsxRuntime_development = 1;
61
+ "production" !== process.env.NODE_ENV && function () {
62
+ function getComponentNameFromType(type) {
63
+ if (null == type) return null;
64
+ if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
65
+ if ("string" === typeof type) return type;
66
+ switch (type) {
67
+ case REACT_FRAGMENT_TYPE:
68
+ return "Fragment";
69
+ case REACT_PROFILER_TYPE:
70
+ return "Profiler";
71
+ case REACT_STRICT_MODE_TYPE:
72
+ return "StrictMode";
73
+ case REACT_SUSPENSE_TYPE:
74
+ return "Suspense";
75
+ case REACT_SUSPENSE_LIST_TYPE:
76
+ return "SuspenseList";
77
+ case REACT_ACTIVITY_TYPE:
78
+ return "Activity";
79
+ }
80
+ if ("object" === typeof type) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
81
+ case REACT_PORTAL_TYPE:
82
+ return "Portal";
83
+ case REACT_CONTEXT_TYPE:
84
+ return type.displayName || "Context";
85
+ case REACT_CONSUMER_TYPE:
86
+ return (type._context.displayName || "Context") + ".Consumer";
87
+ case REACT_FORWARD_REF_TYPE:
88
+ var innerType = type.render;
89
+ type = type.displayName;
90
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
91
+ return type;
92
+ case REACT_MEMO_TYPE:
93
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
94
+ case REACT_LAZY_TYPE:
95
+ innerType = type._payload;
96
+ type = type._init;
97
+ try {
98
+ return getComponentNameFromType(type(innerType));
99
+ } catch (x) {}
100
+ }
101
+ return null;
102
+ }
103
+ function testStringCoercion(value) {
104
+ return "" + value;
105
+ }
106
+ function checkKeyStringCoercion(value) {
107
+ try {
108
+ testStringCoercion(value);
109
+ var JSCompiler_inline_result = !1;
110
+ } catch (e) {
111
+ JSCompiler_inline_result = true;
112
+ }
113
+ if (JSCompiler_inline_result) {
114
+ JSCompiler_inline_result = console;
115
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
116
+ var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
117
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
118
+ return testStringCoercion(value);
119
+ }
120
+ }
121
+ function getTaskName(type) {
122
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
123
+ if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
124
+ try {
125
+ var name = getComponentNameFromType(type);
126
+ return name ? "<" + name + ">" : "<...>";
127
+ } catch (x) {
128
+ return "<...>";
129
+ }
130
+ }
131
+ function getOwner() {
132
+ var dispatcher = ReactSharedInternals.A;
133
+ return null === dispatcher ? null : dispatcher.getOwner();
134
+ }
135
+ function UnknownOwner() {
136
+ return Error("react-stack-top-frame");
137
+ }
138
+ function hasValidKey(config) {
139
+ if (hasOwnProperty.call(config, "key")) {
140
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
141
+ if (getter && getter.isReactWarning) return false;
142
+ }
143
+ return void 0 !== config.key;
144
+ }
145
+ function defineKeyPropWarningGetter(props, displayName) {
146
+ function warnAboutAccessingKey() {
147
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
148
+ }
149
+ warnAboutAccessingKey.isReactWarning = true;
150
+ Object.defineProperty(props, "key", {
151
+ get: warnAboutAccessingKey,
152
+ configurable: true
153
+ });
154
+ }
155
+ function elementRefGetterWithDeprecationWarning() {
156
+ var componentName = getComponentNameFromType(this.type);
157
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
158
+ componentName = this.props.ref;
159
+ return void 0 !== componentName ? componentName : null;
160
+ }
161
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
162
+ var refProp = props.ref;
163
+ type = {
164
+ $$typeof: REACT_ELEMENT_TYPE,
165
+ type: type,
166
+ key: key,
167
+ props: props,
168
+ _owner: owner
169
+ };
170
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
171
+ enumerable: false,
172
+ get: elementRefGetterWithDeprecationWarning
173
+ }) : Object.defineProperty(type, "ref", {
174
+ enumerable: false,
175
+ value: null
176
+ });
177
+ type._store = {};
178
+ Object.defineProperty(type._store, "validated", {
179
+ configurable: false,
180
+ enumerable: false,
181
+ writable: true,
182
+ value: 0
183
+ });
184
+ Object.defineProperty(type, "_debugInfo", {
185
+ configurable: false,
186
+ enumerable: false,
187
+ writable: true,
188
+ value: null
189
+ });
190
+ Object.defineProperty(type, "_debugStack", {
191
+ configurable: false,
192
+ enumerable: false,
193
+ writable: true,
194
+ value: debugStack
195
+ });
196
+ Object.defineProperty(type, "_debugTask", {
197
+ configurable: false,
198
+ enumerable: false,
199
+ writable: true,
200
+ value: debugTask
201
+ });
202
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
203
+ return type;
204
+ }
205
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
206
+ var children = config.children;
207
+ if (void 0 !== children) if (isStaticChildren) {
208
+ if (isArrayImpl(children)) {
209
+ for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
210
+ Object.freeze && Object.freeze(children);
211
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
212
+ } else validateChildKeys(children);
213
+ if (hasOwnProperty.call(config, "key")) {
214
+ children = getComponentNameFromType(type);
215
+ var keys = Object.keys(config).filter(function (k) {
216
+ return "key" !== k;
217
+ });
218
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
219
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = true);
220
+ }
221
+ children = null;
222
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
223
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
224
+ if ("key" in config) {
225
+ maybeKey = {};
226
+ for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
227
+ } else maybeKey = config;
228
+ children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
229
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
230
+ }
231
+ function validateChildKeys(node) {
232
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
233
+ }
234
+ function isValidElement(object) {
235
+ return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
236
+ }
237
+ var React = require$$0,
238
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
239
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
240
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
241
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
242
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
243
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
244
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
245
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
246
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
247
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
248
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
249
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
250
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
251
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
252
+ ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
253
+ hasOwnProperty = Object.prototype.hasOwnProperty,
254
+ isArrayImpl = Array.isArray,
255
+ createTask = console.createTask ? console.createTask : function () {
256
+ return null;
257
+ };
258
+ React = {
259
+ react_stack_bottom_frame: function (callStackForError) {
260
+ return callStackForError();
261
+ }
262
+ };
263
+ var specialPropKeyWarningShown;
264
+ var didWarnAboutElementRef = {};
265
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
266
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
267
+ var didWarnAboutKeySpread = {};
268
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
269
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
270
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
271
+ return jsxDEVImpl(type, config, maybeKey, false, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
272
+ };
273
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
274
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
275
+ return jsxDEVImpl(type, config, maybeKey, true, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
276
+ };
277
+ }();
278
+ return reactJsxRuntime_development;
279
+ }
280
+
281
+ var hasRequiredJsxRuntime;
282
+ function requireJsxRuntime() {
283
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
284
+ hasRequiredJsxRuntime = 1;
285
+ if (process.env.NODE_ENV === 'production') {
286
+ jsxRuntime.exports = requireReactJsxRuntime_production();
287
+ } else {
288
+ jsxRuntime.exports = requireReactJsxRuntime_development();
289
+ }
290
+ return jsxRuntime.exports;
291
+ }
292
+
293
+ var jsxRuntimeExports = requireJsxRuntime();
5
294
 
6
295
  const DEFAULT_PROPS = {
7
296
  autoComplete: 'off',
@@ -13,22 +302,21 @@ const DEFAULT_PROPS = {
13
302
  spellCheck: false,
14
303
  step: 'any'
15
304
  };
16
- const NumoraInput = /*#__PURE__*/forwardRef((_ref, ref) => {
17
- let {
18
- maxDecimals = 2,
19
- onChange,
20
- formatOn = FormatOn.Blur,
21
- thousandSeparator = ',',
22
- thousandStyle = ThousandStyle.Thousand,
23
- decimalSeparator = '.',
24
- decimalMinLength,
25
- enableCompactNotation = false,
26
- enableNegative = false,
27
- enableLeadingZeros = false,
28
- rawValueMode = false,
29
- ...props
30
- } = _ref;
31
- const [caretPositionBeforeChange, setCaretPositionBeforeChange] = React.useState();
305
+ const NumoraInput = /*#__PURE__*/forwardRef(({
306
+ maxDecimals = 2,
307
+ onChange,
308
+ formatOn = FormatOn.Blur,
309
+ thousandSeparator = ',',
310
+ thousandStyle = ThousandStyle.Thousand,
311
+ decimalSeparator = '.',
312
+ decimalMinLength,
313
+ enableCompactNotation = false,
314
+ enableNegative = false,
315
+ enableLeadingZeros = false,
316
+ rawValueMode = false,
317
+ ...props
318
+ }, ref) => {
319
+ const [caretPositionBeforeChange, setCaretPositionBeforeChange] = require$$0.useState();
32
320
  const formattingOptions = {
33
321
  formatOn,
34
322
  thousandSeparator,
@@ -78,7 +366,7 @@ const NumoraInput = /*#__PURE__*/forwardRef((_ref, ref) => {
78
366
  props.onBlur(e);
79
367
  }
80
368
  }
81
- return jsx("input", {
369
+ return jsxRuntimeExports.jsx("input", {
82
370
  ...DEFAULT_PROPS,
83
371
  ...props,
84
372
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import React, { ChangeEvent, ClipboardEvent, forwardRef } from 'react';\nimport {\n NumoraInput,\n FormatOn,\n ThousandStyle,\n FormattingOptions,\n CaretPositionInfo,\n handleOnChangeNumoraInput,\n handleOnPasteNumoraInput,\n handleOnKeyDownNumoraInput,\n} from 'numora';\n\ninterface NumoraInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {\n maxDecimals?: number;\n onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;\n\n // Formatting options\n formatOn?: FormatOn;\n thousandSeparator?: string;\n thousandStyle?: ThousandStyle;\n decimalSeparator?: string;\n decimalMinLength?: number;\n\n // Feature flags\n enableCompactNotation?: boolean;\n enableNegative?: boolean;\n enableLeadingZeros?: boolean;\n rawValueMode?: boolean;\n}\n\nconst DEFAULT_PROPS = {\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'none',\n minLength: 1,\n placeholder: '0.0',\n pattern: '^[0-9]*[.,]?[0-9]*$',\n spellCheck: false,\n step: 'any',\n};\n\nconst NumoraInput = forwardRef<HTMLInputElement, NumoraInputProps>(\n ({\n maxDecimals = 2,\n onChange,\n formatOn = FormatOn.Blur,\n thousandSeparator = ',',\n thousandStyle = ThousandStyle.Thousand,\n decimalSeparator = '.',\n decimalMinLength,\n enableCompactNotation = false,\n enableNegative = false,\n enableLeadingZeros = false,\n rawValueMode = false,\n ...props\n }: NumoraInputProps, ref: React.Ref<HTMLInputElement>) => {\n const [caretPositionBeforeChange, setCaretPositionBeforeChange] =\n React.useState<CaretPositionInfo>();\n\n const formattingOptions: FormattingOptions = {\n formatOn,\n thousandSeparator,\n ThousandStyle: thousandStyle as any,\n decimalSeparator,\n decimalMinLength,\n enableCompactNotation,\n enableNegative,\n enableLeadingZeros,\n rawValueMode,\n };\n\n function handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {\n const caretInfo = handleOnKeyDownNumoraInput(e.nativeEvent, formattingOptions);\n\n if (caretInfo) {\n setCaretPositionBeforeChange(caretInfo);\n } else {\n const input = e.currentTarget;\n setCaretPositionBeforeChange({\n selectionStart: input.selectionStart ?? 0,\n selectionEnd: input.selectionEnd ?? 0,\n });\n }\n\n if (props.onKeyDown) {\n props.onKeyDown(e);\n }\n }\n\n function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {\n handleOnChangeNumoraInput(\n e.nativeEvent,\n maxDecimals,\n caretPositionBeforeChange,\n formattingOptions\n );\n setCaretPositionBeforeChange(undefined);\n if (onChange) onChange(e);\n }\n\n function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {\n handleOnPasteNumoraInput(e.nativeEvent, maxDecimals, formattingOptions);\n if (onChange) onChange(e);\n }\n\n function handleOnFocus(e: React.FocusEvent<HTMLInputElement>): void {\n if (formatOn === FormatOn.Blur && thousandSeparator) {\n const target = e.currentTarget;\n target.value = target.value.replace(\n new RegExp(thousandSeparator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n ''\n );\n }\n\n if (props.onFocus) {\n props.onFocus(e);\n }\n }\n\n function handleOnBlur(e: React.FocusEvent<HTMLInputElement>): void {\n if (props.onBlur) {\n props.onBlur(e);\n }\n }\n\n return (\n <input\n {...DEFAULT_PROPS}\n {...props}\n ref={ref}\n onChange={handleOnChange}\n onKeyDown={handleOnKeyDown}\n onPaste={handleOnPaste}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n type=\"text\"\n inputMode=\"decimal\"\n />\n );\n }\n);\n\nNumoraInput.displayName = 'NumoraInput';\n\nexport { NumoraInput };\nexport { FormatOn, ThousandStyle } from 'numora';\nexport type { FormattingOptions, CaretPositionInfo } from 'numora';\n"],"names":["DEFAULT_PROPS","autoComplete","autoCorrect","autoCapitalize","minLength","placeholder","pattern","spellCheck","step","NumoraInput","forwardRef","_ref","ref","maxDecimals","onChange","formatOn","FormatOn","Blur","thousandSeparator","thousandStyle","ThousandStyle","Thousand","decimalSeparator","decimalMinLength","enableCompactNotation","enableNegative","enableLeadingZeros","rawValueMode","props","caretPositionBeforeChange","setCaretPositionBeforeChange","React","useState","formattingOptions","handleOnKeyDown","e","caretInfo","handleOnKeyDownNumoraInput","nativeEvent","input","currentTarget","selectionStart","selectionEnd","onKeyDown","handleOnChange","handleOnChangeNumoraInput","undefined","handleOnPaste","handleOnPasteNumoraInput","handleOnFocus","target","value","replace","RegExp","onFocus","handleOnBlur","onBlur","_jsx","onPaste","type","inputMode","displayName"],"mappings":";;;;;AA8BA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,cAAc,EAAE,MAAM;AACtBC,EAAAA,SAAS,EAAE,CAAC;AACZC,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,OAAO,EAAE,qBAAqB;AAC9BC,EAAAA,UAAU,EAAE,KAAK;AACjBC,EAAAA,IAAI,EAAE;CACP;AAEKC,MAAAA,WAAW,gBAAGC,UAAU,CAC5B,CAAAC,IAAA,EAaqBC,GAAgC,KAAI;EAAA,IAbxD;AACCC,IAAAA,WAAW,GAAG,CAAC;IACfC,QAAQ;IACRC,QAAQ,GAAGC,QAAQ,CAACC,IAAI;AACxBC,IAAAA,iBAAiB,GAAG,GAAG;IACvBC,aAAa,GAAGC,aAAa,CAACC,QAAQ;AACtCC,IAAAA,gBAAgB,GAAG,GAAG;IACtBC,gBAAgB;AAChBC,IAAAA,qBAAqB,GAAG,KAAK;AAC7BC,IAAAA,cAAc,GAAG,KAAK;AACtBC,IAAAA,kBAAkB,GAAG,KAAK;AAC1BC,IAAAA,YAAY,GAAG,KAAK;IACpB,GAAG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C3B;EAEA,SAASc,aAAaA,CAACd,CAAqC,EAAA;AAC1D,IAAA,IAAIpB,QAAQ,KAAKC,QAAQ,CAACC,IAAI,IAAIC,iBAAiB,EAAE;AACnD,MAAA,MAAMgC,MAAM,GAAGf,CAAC,CAACK,aAAa;MAC9BU,MAAM,CAACC,KAAK,GAAGD,MAAM,CAACC,KAAK,CAACC,OAAO,CACjC,IAAIC,MAAM,CAACnC,iBAAiB,CAACkC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,EACzE,EAAE,CACH;AACH;IAEA,IAAIxB,KAAK,CAAC0B,OAAO,EAAE;AACjB1B,MAAAA,KAAK,CAAC0B,OAAO,CAACnB,CAAC,CAAC;AAClB;AACF;EAEA,SAASoB,YAAYA,CAACpB,CAAqC,EAAA;IACzD,IAAIP,KAAK,CAAC4B,MAAM,EAAE;AAChB5B,MAAAA,KAAK,CAAC4B,MAAM,CAACrB,CAAC,CAAC;AACjB;AACF;EAEA,OACEsB,GACM,CAAA,OAAA,EAAA;AAAA,IAAA,GAAAzD,aAAa;AACb,IAAA,GAAA4B,KAAK;AACThB,IAAAA,GAAG,EAAEA,GAAG;AACRE,IAAAA,QAAQ,EAAE8B,cAAc;AACxBD,IAAAA,SAAS,EAAET,eAAe;AAC1BwB,IAAAA,OAAO,EAAEX,aAAa;AACtBO,IAAAA,OAAO,EAAEL,aAAa;AACtBO,IAAAA,MAAM,EAAED,YAAY;AACpBI,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,SAAS,EAAC;AAAS,GAAA,CACnB;AAEN,CAAC;AAGHnD,WAAW,CAACoD,WAAW,GAAG,aAAa;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js","../src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import React, { ChangeEvent, ClipboardEvent, forwardRef } from 'react';\nimport {\n handleOnChangeNumoraInput,\n handleOnPasteNumoraInput,\n handleOnKeyDownNumoraInput,\n FormatOn,\n ThousandStyle,\n type FormattingOptions,\n type CaretPositionInfo,\n} from 'numora';\n\ninterface NumericInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {\n maxDecimals?: number;\n onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;\n\n // Formatting options\n formatOn?: FormatOn;\n thousandSeparator?: string;\n thousandStyle?: ThousandStyle;\n decimalSeparator?: string;\n decimalMinLength?: number;\n\n // Feature flags\n enableCompactNotation?: boolean;\n enableNegative?: boolean;\n enableLeadingZeros?: boolean;\n rawValueMode?: boolean;\n}\n\nconst DEFAULT_PROPS = {\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'none',\n minLength: 1,\n placeholder: '0.0',\n pattern: '^[0-9]*[.,]?[0-9]*$',\n spellCheck: false,\n step: 'any',\n};\n\nconst NumoraInput = forwardRef<HTMLInputElement, NumericInputProps>(\n ({\n maxDecimals = 2,\n onChange,\n formatOn = FormatOn.Blur,\n thousandSeparator = ',',\n thousandStyle = ThousandStyle.Thousand,\n decimalSeparator = '.',\n decimalMinLength,\n enableCompactNotation = false,\n enableNegative = false,\n enableLeadingZeros = false,\n rawValueMode = false,\n ...props\n }: NumericInputProps, ref) => {\n const [caretPositionBeforeChange, setCaretPositionBeforeChange] =\n React.useState<CaretPositionInfo>();\n\n const formattingOptions: FormattingOptions = {\n formatOn,\n thousandSeparator,\n ThousandStyle: thousandStyle as any,\n decimalSeparator,\n decimalMinLength,\n enableCompactNotation,\n enableNegative,\n enableLeadingZeros,\n rawValueMode,\n };\n\n function handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {\n const caretInfo = handleOnKeyDownNumoraInput(e.nativeEvent, formattingOptions);\n\n if (caretInfo) {\n setCaretPositionBeforeChange(caretInfo);\n } else {\n const input = e.currentTarget;\n setCaretPositionBeforeChange({\n selectionStart: input.selectionStart ?? 0,\n selectionEnd: input.selectionEnd ?? 0,\n });\n }\n\n if (props.onKeyDown) {\n props.onKeyDown(e);\n }\n }\n\n function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {\n handleOnChangeNumoraInput(\n e.nativeEvent,\n maxDecimals,\n caretPositionBeforeChange,\n formattingOptions\n );\n setCaretPositionBeforeChange(undefined);\n if (onChange) onChange(e);\n }\n\n function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {\n handleOnPasteNumoraInput(e.nativeEvent, maxDecimals, formattingOptions);\n if (onChange) onChange(e);\n }\n\n function handleOnFocus(e: React.FocusEvent<HTMLInputElement>): void {\n if (formatOn === FormatOn.Blur && thousandSeparator) {\n const target = e.currentTarget;\n target.value = target.value.replace(\n new RegExp(thousandSeparator.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n ''\n );\n }\n\n if (props.onFocus) {\n props.onFocus(e);\n }\n }\n\n function handleOnBlur(e: React.FocusEvent<HTMLInputElement>): void {\n if (props.onBlur) {\n props.onBlur(e);\n }\n }\n\n return (\n <input\n {...DEFAULT_PROPS}\n {...props}\n ref={ref}\n onChange={handleOnChange}\n onKeyDown={handleOnKeyDown}\n onPaste={handleOnPaste}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n type=\"text\"\n inputMode=\"decimal\"\n />\n );\n }\n);\n\nNumoraInput.displayName = 'NumoraInput';\n\nexport { NumoraInput };\n"],"names":["REACT_ELEMENT_TYPE","Symbol","for","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","ref","$$typeof","props","reactJsxRuntime_production","Fragment","jsx","jsxs","process","env","NODE_ENV","getComponentNameFromType","REACT_CLIENT_REFERENCE","displayName","name","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","tag","console","error","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","_context","REACT_FORWARD_REF_TYPE","innerType","render","REACT_MEMO_TYPE","REACT_LAZY_TYPE","_payload","_init","x","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","e","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","toStringTag","constructor","call","getTaskName","getOwner","dispatcher","ReactSharedInternals","A","UnknownOwner","Error","hasValidKey","hasOwnProperty","getter","Object","getOwnPropertyDescriptor","get","isReactWarning","defineKeyPropWarningGetter","warnAboutAccessingKey","specialPropKeyWarningShown","defineProperty","configurable","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","_owner","enumerable","_store","writable","freeze","jsxDEVImpl","isStaticChildren","children","isArrayImpl","length","validateChildKeys","keys","filter","k","join","didWarnAboutKeySpread","node","isValidElement","validated","status","object","React","require$$0","__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","prototype","Array","isArray","createTask","react_stack_bottom_frame","callStackForError","unknownOwnerDebugStack","bind","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","recentlyCreatedOwnerStacks","jsxRuntimeModule","exports","require$$1","DEFAULT_PROPS","autoComplete","autoCorrect","autoCapitalize","minLength","placeholder","pattern","spellCheck","step","NumoraInput","forwardRef","maxDecimals","onChange","formatOn","FormatOn","Blur","thousandSeparator","thousandStyle","ThousandStyle","Thousand","decimalSeparator","decimalMinLength","enableCompactNotation","enableNegative","enableLeadingZeros","rawValueMode","caretPositionBeforeChange","setCaretPositionBeforeChange","useState","formattingOptions","handleOnKeyDown","caretInfo","handleOnKeyDownNumoraInput","nativeEvent","input","currentTarget","selectionStart","selectionEnd","onKeyDown","handleOnChange","handleOnChangeNumoraInput","undefined","handleOnPaste","handleOnPasteNumoraInput","handleOnFocus","target","replace","RegExp","onFocus","handleOnBlur","onBlur","_jsx","onPaste","inputMode"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,EAAA,IAAIA,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CAAC,4BAA4B,CAAC;AAC/DC,IAAAA,mBAAmB,GAAGF,MAAM,CAACC,GAAG,CAAC,gBAAgB,CAAC;AACpD,EAAA,SAASE,OAAOA,CAACC,IAAI,EAAEC,MAAM,EAAEC,QAAQ,EAAE;IACvC,IAAIC,GAAG,GAAG,IAAI;IACd,MAAM,KAAKD,QAAQ,KAAKC,GAAG,GAAG,EAAE,GAAGD,QAAQ,CAAC;AAC5C,IAAA,MAAM,KAAKD,MAAM,CAACE,GAAG,KAAKA,GAAG,GAAG,EAAE,GAAGF,MAAM,CAACE,GAAG,CAAC;IAChD,IAAI,KAAK,IAAIF,MAAM,EAAE;MACnBC,QAAQ,GAAG,EAAE;AACb,MAAA,KAAK,IAAIE,QAAQ,IAAIH,MAAM,EACzB,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IAAIC,MAAM,CAAC/B,iBAAiB,CAAC8B,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,EACzE,EAAE,CACH;AACH,IAAA;IAEA,IAAI1J,KAAK,CAAC4J,OAAO,EAAE;AACjB5J,MAAAA,KAAK,CAAC4J,OAAO,CAACxH,CAAC,CAAC;AAClB,IAAA;AACF,EAAA;EAEA,SAASyH,YAAYA,CAACzH,CAAqC,EAAA;IACzD,IAAIpC,KAAK,CAAC8J,MAAM,EAAE;AAChB9J,MAAAA,KAAK,CAAC8J,MAAM,CAAC1H,CAAC,CAAC;AACjB,IAAA;AACF,EAAA;EAEA,OACE2H,qBAAA,CAAA,OAAA,EAAA;AAAA,IAAA,GACMnD,aAAa;AAAA,IAAA,GACb5G,KAAK;AACTF,IAAAA,GAAG,EAAEA,GAAG;AACR0H,IAAAA,QAAQ,EAAE2B,cAAc;AACxBD,IAAAA,SAAS,EAAER,eAAe;AAC1BsB,IAAAA,OAAO,EAAEV,aAAa;AACtBM,IAAAA,OAAO,EAAEJ,aAAa;AACtBM,IAAAA,MAAM,EAAED,YAAY;AACpBpK,IAAAA,IAAI,EAAC,MAAM;AACXwK,IAAAA,SAAS,EAAC;AAAS,GAAA,CACnB;AAEN,CAAC;AAGH5C,WAAW,CAAC3G,WAAW,GAAG,aAAa;;;;","x_google_ignoreList":[0,1,2]}
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "name": "numora-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Numora for React - Headless finance input library",
5
- "homepage": "https://numora.xyz/",
5
+ "homepage": "https://numora.netlify.app/",
6
6
  "type": "module",
7
7
  "main": "dist/index.cjs.js",
8
8
  "module": "dist/index.esm.js",
9
- "types": "dist/index.d.ts",
10
- "files": [
11
- "dist"
12
- ],
9
+ "types": "dist/types/index.d.ts",
13
10
  "sideEffects": false,
14
11
  "repository": {
15
12
  "type": "git",
@@ -46,13 +43,6 @@
46
43
  }
47
44
  ],
48
45
  "license": "MIT",
49
- "peerDependencies": {
50
- "react": "^18.0.0 || ^19.0.0",
51
- "react-dom": "^18.0.0 || ^19.0.0"
52
- },
53
- "dependencies": {
54
- "numora": "2.0.1"
55
- },
56
46
  "devDependencies": {
57
47
  "@babel/core": "^7.26.10",
58
48
  "@babel/preset-env": "^7.26.9",
@@ -66,13 +56,13 @@
66
56
  "rollup": "^4.38.0",
67
57
  "rollup-plugin-peer-deps-external": "^2.2.4",
68
58
  "tslib": "^2.8.1",
69
- "typescript": "^5.8.2",
59
+ "typescript": "^5.8.2"
60
+ },
61
+ "dependencies": {
62
+ "numora": "^1.0.4",
70
63
  "react": "^19.1.0",
71
64
  "react-dom": "^19.1.0"
72
65
  },
73
- "publishConfig": {
74
- "access": "public"
75
- },
76
66
  "scripts": {
77
67
  "build": "rollup -c",
78
68
  "watch": "rollup -c -w"
@@ -0,0 +1,38 @@
1
+ import resolve from '@rollup/plugin-node-resolve';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import babel from '@rollup/plugin-babel';
4
+ import typescript from '@rollup/plugin-typescript';
5
+ import peerDepsExternal from 'rollup-plugin-peer-deps-external';
6
+ import packageJson from './package.json' assert { type: 'json' };
7
+
8
+ export default {
9
+ input: 'src/index.tsx',
10
+ output: [
11
+ {
12
+ file: packageJson.main,
13
+ format: 'cjs',
14
+ sourcemap: true,
15
+ },
16
+ {
17
+ file: packageJson.module,
18
+ format: 'esm',
19
+ sourcemap: true,
20
+ },
21
+ ],
22
+ plugins: [
23
+ peerDepsExternal(),
24
+ resolve(),
25
+ commonjs(),
26
+ typescript({ tsconfig: './tsconfig.json' }),
27
+ babel({
28
+ exclude: 'node_modules/**',
29
+ extensions: ['.js', '.jsx', '.ts', '.tsx'],
30
+ babelHelpers: 'bundled',
31
+ presets: [
32
+ ['@babel/preset-env', { targets: 'defaults' }],
33
+ ['@babel/preset-react', { runtime: 'automatic' }],
34
+ ],
35
+ }),
36
+ ],
37
+ external: ['react', 'react-dom', 'numora'],
38
+ };
package/src/index.tsx ADDED
@@ -0,0 +1,144 @@
1
+ import React, { ChangeEvent, ClipboardEvent, forwardRef } from 'react';
2
+ import {
3
+ handleOnChangeNumoraInput,
4
+ handleOnPasteNumoraInput,
5
+ handleOnKeyDownNumoraInput,
6
+ FormatOn,
7
+ ThousandStyle,
8
+ type FormattingOptions,
9
+ type CaretPositionInfo,
10
+ } from 'numora';
11
+
12
+ interface NumericInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type' | 'inputMode'> {
13
+ maxDecimals?: number;
14
+ onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;
15
+
16
+ // Formatting options
17
+ formatOn?: FormatOn;
18
+ thousandSeparator?: string;
19
+ thousandStyle?: ThousandStyle;
20
+ decimalSeparator?: string;
21
+ decimalMinLength?: number;
22
+
23
+ // Feature flags
24
+ enableCompactNotation?: boolean;
25
+ enableNegative?: boolean;
26
+ enableLeadingZeros?: boolean;
27
+ rawValueMode?: boolean;
28
+ }
29
+
30
+ const DEFAULT_PROPS = {
31
+ autoComplete: 'off',
32
+ autoCorrect: 'off',
33
+ autoCapitalize: 'none',
34
+ minLength: 1,
35
+ placeholder: '0.0',
36
+ pattern: '^[0-9]*[.,]?[0-9]*$',
37
+ spellCheck: false,
38
+ step: 'any',
39
+ };
40
+
41
+ const NumoraInput = forwardRef<HTMLInputElement, NumericInputProps>(
42
+ ({
43
+ maxDecimals = 2,
44
+ onChange,
45
+ formatOn = FormatOn.Blur,
46
+ thousandSeparator = ',',
47
+ thousandStyle = ThousandStyle.Thousand,
48
+ decimalSeparator = '.',
49
+ decimalMinLength,
50
+ enableCompactNotation = false,
51
+ enableNegative = false,
52
+ enableLeadingZeros = false,
53
+ rawValueMode = false,
54
+ ...props
55
+ }: NumericInputProps, ref) => {
56
+ const [caretPositionBeforeChange, setCaretPositionBeforeChange] =
57
+ React.useState<CaretPositionInfo>();
58
+
59
+ const formattingOptions: FormattingOptions = {
60
+ formatOn,
61
+ thousandSeparator,
62
+ ThousandStyle: thousandStyle as any,
63
+ decimalSeparator,
64
+ decimalMinLength,
65
+ enableCompactNotation,
66
+ enableNegative,
67
+ enableLeadingZeros,
68
+ rawValueMode,
69
+ };
70
+
71
+ function handleOnKeyDown(e: React.KeyboardEvent<HTMLInputElement>): void {
72
+ const caretInfo = handleOnKeyDownNumoraInput(e.nativeEvent, formattingOptions);
73
+
74
+ if (caretInfo) {
75
+ setCaretPositionBeforeChange(caretInfo);
76
+ } else {
77
+ const input = e.currentTarget;
78
+ setCaretPositionBeforeChange({
79
+ selectionStart: input.selectionStart ?? 0,
80
+ selectionEnd: input.selectionEnd ?? 0,
81
+ });
82
+ }
83
+
84
+ if (props.onKeyDown) {
85
+ props.onKeyDown(e);
86
+ }
87
+ }
88
+
89
+ function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {
90
+ handleOnChangeNumoraInput(
91
+ e.nativeEvent,
92
+ maxDecimals,
93
+ caretPositionBeforeChange,
94
+ formattingOptions
95
+ );
96
+ setCaretPositionBeforeChange(undefined);
97
+ if (onChange) onChange(e);
98
+ }
99
+
100
+ function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {
101
+ handleOnPasteNumoraInput(e.nativeEvent, maxDecimals, formattingOptions);
102
+ if (onChange) onChange(e);
103
+ }
104
+
105
+ function handleOnFocus(e: React.FocusEvent<HTMLInputElement>): void {
106
+ if (formatOn === FormatOn.Blur && thousandSeparator) {
107
+ const target = e.currentTarget;
108
+ target.value = target.value.replace(
109
+ new RegExp(thousandSeparator.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'),
110
+ ''
111
+ );
112
+ }
113
+
114
+ if (props.onFocus) {
115
+ props.onFocus(e);
116
+ }
117
+ }
118
+
119
+ function handleOnBlur(e: React.FocusEvent<HTMLInputElement>): void {
120
+ if (props.onBlur) {
121
+ props.onBlur(e);
122
+ }
123
+ }
124
+
125
+ return (
126
+ <input
127
+ {...DEFAULT_PROPS}
128
+ {...props}
129
+ ref={ref}
130
+ onChange={handleOnChange}
131
+ onKeyDown={handleOnKeyDown}
132
+ onPaste={handleOnPaste}
133
+ onFocus={handleOnFocus}
134
+ onBlur={handleOnBlur}
135
+ type="text"
136
+ inputMode="decimal"
137
+ />
138
+ );
139
+ }
140
+ );
141
+
142
+ NumoraInput.displayName = 'NumoraInput';
143
+
144
+ export { NumoraInput };
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "jsx": "react-jsx",
6
+ "declaration": true,
7
+ "outDir": "./dist",
8
+ "rootDir": "./src",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "moduleResolution": "node",
13
+ "allowSyntheticDefaultImports": true,
14
+ "lib": ["ESNext", "DOM"]
15
+ },
16
+ "include": ["src/**/*"],
17
+ "exclude": ["node_modules", "dist"]
18
+ }