numora-react 1.0.0
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/README.md +74 -0
- package/dist/index.cjs.js +469 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.esm.js +467 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +70 -0
- package/rollup.config.mjs +38 -0
- package/src/index.tsx +50 -0
- package/tsconfig.json +18 -0
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# numora
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/numora)
|
|
4
|
+
|
|
5
|
+
A lightweight, framework-agnostic numeric input library for handling currency and decimal inputs in **financial/DeFi** applications. Built with TypeScript and designed for modern web applications with:
|
|
6
|
+
|
|
7
|
+
- **Zero dependencies** - minimal footprint for your bundle
|
|
8
|
+
- **Type safety** - fully typed API for better developer experience
|
|
9
|
+
- **Framework agnostic** - use with any framework or vanilla JavaScript
|
|
10
|
+
- **Customizable** - extensive options to fit your specific needs
|
|
11
|
+
|
|
12
|
+
## Demo
|
|
13
|
+
|
|
14
|
+
Check out the [live demo](https://numora.netlify.app/) to see Numora in action.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Validates and sanitizes numeric input
|
|
19
|
+
- Limits decimal places
|
|
20
|
+
- Handles paste events
|
|
21
|
+
- Converts commas to dots
|
|
22
|
+
- Prevents multiple decimal points
|
|
23
|
+
- Customizable with various options
|
|
24
|
+
- Framework-agnostic core with adapters for popular frameworks
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install numora
|
|
30
|
+
# or
|
|
31
|
+
yarn add numora
|
|
32
|
+
# or
|
|
33
|
+
pnpm add numora
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { NumericInput } from 'numora';
|
|
40
|
+
|
|
41
|
+
// Get the container element where you want to mount the input
|
|
42
|
+
const container = document.querySelector('#my-input-container');
|
|
43
|
+
|
|
44
|
+
// Create a new NumericInput instance
|
|
45
|
+
const numericInput = new NumericInput(container, {
|
|
46
|
+
maxDecimals: 2,
|
|
47
|
+
onChange: (value) => {
|
|
48
|
+
console.log('Value changed:', value);
|
|
49
|
+
// Do something with the value
|
|
50
|
+
},
|
|
51
|
+
// ... all other input properties you want
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Options
|
|
56
|
+
|
|
57
|
+
The NumericInput constructor accepts the following options:
|
|
58
|
+
| Option | Type | Default | Description |
|
|
59
|
+
| --------------- | -------- | --------- | -------------------------------------------------------- |
|
|
60
|
+
| maxDecimals | number | 2 | Maximum number of decimal places allowed |
|
|
61
|
+
| onChange | function | undefined | Callback function that runs when the input value changes |
|
|
62
|
+
| supports all input properties | - | - | - |
|
|
63
|
+
|
|
64
|
+
## Framework Adapters
|
|
65
|
+
|
|
66
|
+
Numora is also available for popular frameworks:
|
|
67
|
+
|
|
68
|
+
- React: `numora-react` (in progress)
|
|
69
|
+
- Vue: `numora-vue` (in progress)
|
|
70
|
+
- Svelte: `numora`
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var require$$0 = require('react');
|
|
4
|
+
var numora = require('numora');
|
|
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
|
+
|
|
20
|
+
var hasRequiredReactJsxRuntime_production;
|
|
21
|
+
|
|
22
|
+
function requireReactJsxRuntime_production () {
|
|
23
|
+
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
24
|
+
hasRequiredReactJsxRuntime_production = 1;
|
|
25
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
26
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
27
|
+
function jsxProd(type, config, maybeKey) {
|
|
28
|
+
var key = null;
|
|
29
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
30
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
31
|
+
if ("key" in config) {
|
|
32
|
+
maybeKey = {};
|
|
33
|
+
for (var propName in config)
|
|
34
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
35
|
+
} else maybeKey = config;
|
|
36
|
+
config = maybeKey.ref;
|
|
37
|
+
return {
|
|
38
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
39
|
+
type: type,
|
|
40
|
+
key: key,
|
|
41
|
+
ref: void 0 !== config ? config : null,
|
|
42
|
+
props: maybeKey
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
46
|
+
reactJsxRuntime_production.jsx = jsxProd;
|
|
47
|
+
reactJsxRuntime_production.jsxs = jsxProd;
|
|
48
|
+
return reactJsxRuntime_production;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var reactJsxRuntime_development = {};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @license React
|
|
55
|
+
* react-jsx-runtime.development.js
|
|
56
|
+
*
|
|
57
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the MIT license found in the
|
|
60
|
+
* LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
var hasRequiredReactJsxRuntime_development;
|
|
64
|
+
|
|
65
|
+
function requireReactJsxRuntime_development () {
|
|
66
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
67
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
68
|
+
"production" !== process.env.NODE_ENV &&
|
|
69
|
+
(function () {
|
|
70
|
+
function getComponentNameFromType(type) {
|
|
71
|
+
if (null == type) return null;
|
|
72
|
+
if ("function" === typeof type)
|
|
73
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
74
|
+
? null
|
|
75
|
+
: type.displayName || type.name || null;
|
|
76
|
+
if ("string" === typeof type) return type;
|
|
77
|
+
switch (type) {
|
|
78
|
+
case REACT_FRAGMENT_TYPE:
|
|
79
|
+
return "Fragment";
|
|
80
|
+
case REACT_PROFILER_TYPE:
|
|
81
|
+
return "Profiler";
|
|
82
|
+
case REACT_STRICT_MODE_TYPE:
|
|
83
|
+
return "StrictMode";
|
|
84
|
+
case REACT_SUSPENSE_TYPE:
|
|
85
|
+
return "Suspense";
|
|
86
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
87
|
+
return "SuspenseList";
|
|
88
|
+
case REACT_ACTIVITY_TYPE:
|
|
89
|
+
return "Activity";
|
|
90
|
+
}
|
|
91
|
+
if ("object" === typeof type)
|
|
92
|
+
switch (
|
|
93
|
+
("number" === typeof type.tag &&
|
|
94
|
+
console.error(
|
|
95
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
96
|
+
),
|
|
97
|
+
type.$$typeof)
|
|
98
|
+
) {
|
|
99
|
+
case REACT_PORTAL_TYPE:
|
|
100
|
+
return "Portal";
|
|
101
|
+
case REACT_CONTEXT_TYPE:
|
|
102
|
+
return (type.displayName || "Context") + ".Provider";
|
|
103
|
+
case REACT_CONSUMER_TYPE:
|
|
104
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
105
|
+
case REACT_FORWARD_REF_TYPE:
|
|
106
|
+
var innerType = type.render;
|
|
107
|
+
type = type.displayName;
|
|
108
|
+
type ||
|
|
109
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
110
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
111
|
+
return type;
|
|
112
|
+
case REACT_MEMO_TYPE:
|
|
113
|
+
return (
|
|
114
|
+
(innerType = type.displayName || null),
|
|
115
|
+
null !== innerType
|
|
116
|
+
? innerType
|
|
117
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
118
|
+
);
|
|
119
|
+
case REACT_LAZY_TYPE:
|
|
120
|
+
innerType = type._payload;
|
|
121
|
+
type = type._init;
|
|
122
|
+
try {
|
|
123
|
+
return getComponentNameFromType(type(innerType));
|
|
124
|
+
} catch (x) {}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
function testStringCoercion(value) {
|
|
129
|
+
return "" + value;
|
|
130
|
+
}
|
|
131
|
+
function checkKeyStringCoercion(value) {
|
|
132
|
+
try {
|
|
133
|
+
testStringCoercion(value);
|
|
134
|
+
var JSCompiler_inline_result = !1;
|
|
135
|
+
} catch (e) {
|
|
136
|
+
JSCompiler_inline_result = true;
|
|
137
|
+
}
|
|
138
|
+
if (JSCompiler_inline_result) {
|
|
139
|
+
JSCompiler_inline_result = console;
|
|
140
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
141
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
142
|
+
("function" === typeof Symbol &&
|
|
143
|
+
Symbol.toStringTag &&
|
|
144
|
+
value[Symbol.toStringTag]) ||
|
|
145
|
+
value.constructor.name ||
|
|
146
|
+
"Object";
|
|
147
|
+
JSCompiler_temp_const.call(
|
|
148
|
+
JSCompiler_inline_result,
|
|
149
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
150
|
+
JSCompiler_inline_result$jscomp$0
|
|
151
|
+
);
|
|
152
|
+
return testStringCoercion(value);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function getTaskName(type) {
|
|
156
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
157
|
+
if (
|
|
158
|
+
"object" === typeof type &&
|
|
159
|
+
null !== type &&
|
|
160
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
161
|
+
)
|
|
162
|
+
return "<...>";
|
|
163
|
+
try {
|
|
164
|
+
var name = getComponentNameFromType(type);
|
|
165
|
+
return name ? "<" + name + ">" : "<...>";
|
|
166
|
+
} catch (x) {
|
|
167
|
+
return "<...>";
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function getOwner() {
|
|
171
|
+
var dispatcher = ReactSharedInternals.A;
|
|
172
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
173
|
+
}
|
|
174
|
+
function UnknownOwner() {
|
|
175
|
+
return Error("react-stack-top-frame");
|
|
176
|
+
}
|
|
177
|
+
function hasValidKey(config) {
|
|
178
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
179
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
180
|
+
if (getter && getter.isReactWarning) return false;
|
|
181
|
+
}
|
|
182
|
+
return void 0 !== config.key;
|
|
183
|
+
}
|
|
184
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
185
|
+
function warnAboutAccessingKey() {
|
|
186
|
+
specialPropKeyWarningShown ||
|
|
187
|
+
((specialPropKeyWarningShown = true),
|
|
188
|
+
console.error(
|
|
189
|
+
"%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)",
|
|
190
|
+
displayName
|
|
191
|
+
));
|
|
192
|
+
}
|
|
193
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
194
|
+
Object.defineProperty(props, "key", {
|
|
195
|
+
get: warnAboutAccessingKey,
|
|
196
|
+
configurable: true
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
200
|
+
var componentName = getComponentNameFromType(this.type);
|
|
201
|
+
didWarnAboutElementRef[componentName] ||
|
|
202
|
+
((didWarnAboutElementRef[componentName] = true),
|
|
203
|
+
console.error(
|
|
204
|
+
"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."
|
|
205
|
+
));
|
|
206
|
+
componentName = this.props.ref;
|
|
207
|
+
return void 0 !== componentName ? componentName : null;
|
|
208
|
+
}
|
|
209
|
+
function ReactElement(
|
|
210
|
+
type,
|
|
211
|
+
key,
|
|
212
|
+
self,
|
|
213
|
+
source,
|
|
214
|
+
owner,
|
|
215
|
+
props,
|
|
216
|
+
debugStack,
|
|
217
|
+
debugTask
|
|
218
|
+
) {
|
|
219
|
+
self = props.ref;
|
|
220
|
+
type = {
|
|
221
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
222
|
+
type: type,
|
|
223
|
+
key: key,
|
|
224
|
+
props: props,
|
|
225
|
+
_owner: owner
|
|
226
|
+
};
|
|
227
|
+
null !== (void 0 !== self ? self : null)
|
|
228
|
+
? Object.defineProperty(type, "ref", {
|
|
229
|
+
enumerable: false,
|
|
230
|
+
get: elementRefGetterWithDeprecationWarning
|
|
231
|
+
})
|
|
232
|
+
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
233
|
+
type._store = {};
|
|
234
|
+
Object.defineProperty(type._store, "validated", {
|
|
235
|
+
configurable: false,
|
|
236
|
+
enumerable: false,
|
|
237
|
+
writable: true,
|
|
238
|
+
value: 0
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
241
|
+
configurable: false,
|
|
242
|
+
enumerable: false,
|
|
243
|
+
writable: true,
|
|
244
|
+
value: null
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(type, "_debugStack", {
|
|
247
|
+
configurable: false,
|
|
248
|
+
enumerable: false,
|
|
249
|
+
writable: true,
|
|
250
|
+
value: debugStack
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(type, "_debugTask", {
|
|
253
|
+
configurable: false,
|
|
254
|
+
enumerable: false,
|
|
255
|
+
writable: true,
|
|
256
|
+
value: debugTask
|
|
257
|
+
});
|
|
258
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
259
|
+
return type;
|
|
260
|
+
}
|
|
261
|
+
function jsxDEVImpl(
|
|
262
|
+
type,
|
|
263
|
+
config,
|
|
264
|
+
maybeKey,
|
|
265
|
+
isStaticChildren,
|
|
266
|
+
source,
|
|
267
|
+
self,
|
|
268
|
+
debugStack,
|
|
269
|
+
debugTask
|
|
270
|
+
) {
|
|
271
|
+
var children = config.children;
|
|
272
|
+
if (void 0 !== children)
|
|
273
|
+
if (isStaticChildren)
|
|
274
|
+
if (isArrayImpl(children)) {
|
|
275
|
+
for (
|
|
276
|
+
isStaticChildren = 0;
|
|
277
|
+
isStaticChildren < children.length;
|
|
278
|
+
isStaticChildren++
|
|
279
|
+
)
|
|
280
|
+
validateChildKeys(children[isStaticChildren]);
|
|
281
|
+
Object.freeze && Object.freeze(children);
|
|
282
|
+
} else
|
|
283
|
+
console.error(
|
|
284
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
285
|
+
);
|
|
286
|
+
else validateChildKeys(children);
|
|
287
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
288
|
+
children = getComponentNameFromType(type);
|
|
289
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
290
|
+
return "key" !== k;
|
|
291
|
+
});
|
|
292
|
+
isStaticChildren =
|
|
293
|
+
0 < keys.length
|
|
294
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
295
|
+
: "{key: someKey}";
|
|
296
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
297
|
+
((keys =
|
|
298
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
299
|
+
console.error(
|
|
300
|
+
'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} />',
|
|
301
|
+
isStaticChildren,
|
|
302
|
+
children,
|
|
303
|
+
keys,
|
|
304
|
+
children
|
|
305
|
+
),
|
|
306
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
307
|
+
}
|
|
308
|
+
children = null;
|
|
309
|
+
void 0 !== maybeKey &&
|
|
310
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
311
|
+
hasValidKey(config) &&
|
|
312
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
313
|
+
if ("key" in config) {
|
|
314
|
+
maybeKey = {};
|
|
315
|
+
for (var propName in config)
|
|
316
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
317
|
+
} else maybeKey = config;
|
|
318
|
+
children &&
|
|
319
|
+
defineKeyPropWarningGetter(
|
|
320
|
+
maybeKey,
|
|
321
|
+
"function" === typeof type
|
|
322
|
+
? type.displayName || type.name || "Unknown"
|
|
323
|
+
: type
|
|
324
|
+
);
|
|
325
|
+
return ReactElement(
|
|
326
|
+
type,
|
|
327
|
+
children,
|
|
328
|
+
self,
|
|
329
|
+
source,
|
|
330
|
+
getOwner(),
|
|
331
|
+
maybeKey,
|
|
332
|
+
debugStack,
|
|
333
|
+
debugTask
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
function validateChildKeys(node) {
|
|
337
|
+
"object" === typeof node &&
|
|
338
|
+
null !== node &&
|
|
339
|
+
node.$$typeof === REACT_ELEMENT_TYPE &&
|
|
340
|
+
node._store &&
|
|
341
|
+
(node._store.validated = 1);
|
|
342
|
+
}
|
|
343
|
+
var React = require$$0,
|
|
344
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
345
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
346
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
347
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
348
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
349
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
350
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
351
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
352
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
353
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
354
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
355
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
356
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
357
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
358
|
+
ReactSharedInternals =
|
|
359
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
360
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
361
|
+
isArrayImpl = Array.isArray,
|
|
362
|
+
createTask = console.createTask
|
|
363
|
+
? console.createTask
|
|
364
|
+
: function () {
|
|
365
|
+
return null;
|
|
366
|
+
};
|
|
367
|
+
React = {
|
|
368
|
+
"react-stack-bottom-frame": function (callStackForError) {
|
|
369
|
+
return callStackForError();
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
var specialPropKeyWarningShown;
|
|
373
|
+
var didWarnAboutElementRef = {};
|
|
374
|
+
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
|
375
|
+
React,
|
|
376
|
+
UnknownOwner
|
|
377
|
+
)();
|
|
378
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
379
|
+
var didWarnAboutKeySpread = {};
|
|
380
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
381
|
+
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
|
|
382
|
+
var trackActualOwner =
|
|
383
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
384
|
+
return jsxDEVImpl(
|
|
385
|
+
type,
|
|
386
|
+
config,
|
|
387
|
+
maybeKey,
|
|
388
|
+
false,
|
|
389
|
+
source,
|
|
390
|
+
self,
|
|
391
|
+
trackActualOwner
|
|
392
|
+
? Error("react-stack-top-frame")
|
|
393
|
+
: unknownOwnerDebugStack,
|
|
394
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
395
|
+
);
|
|
396
|
+
};
|
|
397
|
+
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
398
|
+
var trackActualOwner =
|
|
399
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
400
|
+
return jsxDEVImpl(
|
|
401
|
+
type,
|
|
402
|
+
config,
|
|
403
|
+
maybeKey,
|
|
404
|
+
true,
|
|
405
|
+
source,
|
|
406
|
+
self,
|
|
407
|
+
trackActualOwner
|
|
408
|
+
? Error("react-stack-top-frame")
|
|
409
|
+
: unknownOwnerDebugStack,
|
|
410
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
411
|
+
);
|
|
412
|
+
};
|
|
413
|
+
})();
|
|
414
|
+
return reactJsxRuntime_development;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
var hasRequiredJsxRuntime;
|
|
418
|
+
|
|
419
|
+
function requireJsxRuntime () {
|
|
420
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
421
|
+
hasRequiredJsxRuntime = 1;
|
|
422
|
+
|
|
423
|
+
if (process.env.NODE_ENV === 'production') {
|
|
424
|
+
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
425
|
+
} else {
|
|
426
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
427
|
+
}
|
|
428
|
+
return jsxRuntime.exports;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
432
|
+
|
|
433
|
+
const DEFAULT_PROPS = {
|
|
434
|
+
autoComplete: 'off',
|
|
435
|
+
autoCorrect: 'off',
|
|
436
|
+
autoCapitalize: 'none',
|
|
437
|
+
minLength: 1,
|
|
438
|
+
placeholder: '0.0',
|
|
439
|
+
pattern: '^[0-9]*[.,]?[0-9]*$',
|
|
440
|
+
spellCheck: false,
|
|
441
|
+
step: 'any'
|
|
442
|
+
};
|
|
443
|
+
const NumericInput = /*#__PURE__*/require$$0.forwardRef(_ref => {
|
|
444
|
+
let {
|
|
445
|
+
maxDecimals = 2,
|
|
446
|
+
onChange,
|
|
447
|
+
...props
|
|
448
|
+
} = _ref;
|
|
449
|
+
function handleOnChange(e) {
|
|
450
|
+
numora.handleOnChangeNumericInput(e.nativeEvent, maxDecimals);
|
|
451
|
+
if (onChange) onChange(e);
|
|
452
|
+
}
|
|
453
|
+
function handleOnPaste(e) {
|
|
454
|
+
numora.handleOnPasteNumericInput(e.nativeEvent, maxDecimals);
|
|
455
|
+
if (onChange) onChange(e);
|
|
456
|
+
}
|
|
457
|
+
return jsxRuntimeExports.jsx("input", {
|
|
458
|
+
...DEFAULT_PROPS,
|
|
459
|
+
...props,
|
|
460
|
+
onChange: handleOnChange,
|
|
461
|
+
onPaste: handleOnPaste,
|
|
462
|
+
type: "text",
|
|
463
|
+
inputMode: "decimal"
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
NumericInput.displayName = 'NumericInput';
|
|
467
|
+
|
|
468
|
+
exports.NumericInput = NumericInput;
|
|
469
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/.pnpm/react@19.1.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\") + \".Provider\";\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(\n type,\n key,\n self,\n source,\n owner,\n props,\n debugStack,\n debugTask\n ) {\n self = 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 !== self ? self : 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 source,\n self,\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 self,\n source,\n getOwner(),\n maybeKey,\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_ELEMENT_TYPE &&\n node._store &&\n (node._store.validated = 1);\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 Symbol.for(\"react.provider\");\n var 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, source, self) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n source,\n self,\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, source, self) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n source,\n self,\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 { ChangeEvent, ClipboardEvent, forwardRef } from 'react';\nimport { handleOnChangeNumericInput, handleOnPasteNumericInput } from 'numora';\n\ninterface NumericInputProps {\n additionalStyle?: string;\n maxDecimals?: number;\n defaultValue?: string;\n autoFocus?: boolean;\n onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;\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 NumericInput = forwardRef<HTMLInputElement, NumericInputProps>(\n ({ maxDecimals = 2, onChange, ...props }: NumericInputProps) => {\n function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {\n handleOnChangeNumericInput(e.nativeEvent, maxDecimals);\n if (onChange) onChange(e);\n }\n\n function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {\n handleOnPasteNumericInput(e.nativeEvent, maxDecimals);\n if (onChange) onChange(e);\n }\n\n return (\n <input\n {...DEFAULT_PROPS}\n {...props}\n onChange={handleOnChange}\n onPaste={handleOnPaste}\n type=\"text\"\n inputMode=\"decimal\"\n />\n );\n }\n);\n\nNumericInput.displayName = 'NumericInput';\n\nexport { NumericInput };\n"],"names":["jsxRuntimeModule","require$$0","require$$1","DEFAULT_PROPS","autoComplete","autoCorrect","autoCapitalize","minLength","placeholder","pattern","spellCheck","step","NumericInput","forwardRef","_ref","maxDecimals","onChange","props","handleOnChange","e","handleOnChangeNumericInput","nativeEvent","handleOnPaste","handleOnPasteNumericInput","_jsx","onPaste","type","inputMode","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAWA,CAAA,IAAI,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC;AACjE,GAAE,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;AACpD,CAAA,SAAS,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;GACvC,IAAI,GAAG,GAAG,IAAI;GACd,MAAM,KAAK,QAAQ,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC;AAC9C,GAAE,MAAM,KAAK,MAAM,CAAC,GAAG,KAAK,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;AAClD,GAAE,IAAI,KAAK,IAAI,MAAM,EAAE;KACnB,QAAQ,GAAG,EAAE;AACjB,KAAI,KAAK,IAAI,QAAQ,IAAI,MAAM;AAC/B,OAAM,KAAK,KAAK,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,MAAM;AAC1B,GAAE,MAAM,GAAG,QAAQ,CAAC,GAAG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IAAA,GACbc,KAAK;AACTD,IAAAA,QAAQ,EAAEE,cAAc;AACxBO,IAAAA,OAAO,EAAEH,aAAa;AACtBI,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,SAAS,EAAC;AACV,GAAA,CAAA;AAEN,CAAC;AAGHf,YAAY,CAACgB,WAAW,GAAG,cAAc;;;;","x_google_ignoreList":[0,1,2]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChangeEvent, ClipboardEvent } from 'react';
|
|
2
|
+
interface NumericInputProps {
|
|
3
|
+
additionalStyle?: string;
|
|
4
|
+
maxDecimals?: number;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const NumericInput: import("react").ForwardRefExoticComponent<NumericInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export { NumericInput };
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import require$$0, { forwardRef } from 'react';
|
|
2
|
+
import { handleOnPasteNumericInput, handleOnChangeNumericInput } 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
|
+
|
|
18
|
+
var hasRequiredReactJsxRuntime_production;
|
|
19
|
+
|
|
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)
|
|
32
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
33
|
+
} else maybeKey = config;
|
|
34
|
+
config = maybeKey.ref;
|
|
35
|
+
return {
|
|
36
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
37
|
+
type: type,
|
|
38
|
+
key: key,
|
|
39
|
+
ref: void 0 !== config ? config : null,
|
|
40
|
+
props: maybeKey
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
44
|
+
reactJsxRuntime_production.jsx = jsxProd;
|
|
45
|
+
reactJsxRuntime_production.jsxs = jsxProd;
|
|
46
|
+
return reactJsxRuntime_production;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var reactJsxRuntime_development = {};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @license React
|
|
53
|
+
* react-jsx-runtime.development.js
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the MIT license found in the
|
|
58
|
+
* LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
var hasRequiredReactJsxRuntime_development;
|
|
62
|
+
|
|
63
|
+
function requireReactJsxRuntime_development () {
|
|
64
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
65
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
66
|
+
"production" !== process.env.NODE_ENV &&
|
|
67
|
+
(function () {
|
|
68
|
+
function getComponentNameFromType(type) {
|
|
69
|
+
if (null == type) return null;
|
|
70
|
+
if ("function" === typeof type)
|
|
71
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
72
|
+
? null
|
|
73
|
+
: type.displayName || type.name || null;
|
|
74
|
+
if ("string" === typeof type) return type;
|
|
75
|
+
switch (type) {
|
|
76
|
+
case REACT_FRAGMENT_TYPE:
|
|
77
|
+
return "Fragment";
|
|
78
|
+
case REACT_PROFILER_TYPE:
|
|
79
|
+
return "Profiler";
|
|
80
|
+
case REACT_STRICT_MODE_TYPE:
|
|
81
|
+
return "StrictMode";
|
|
82
|
+
case REACT_SUSPENSE_TYPE:
|
|
83
|
+
return "Suspense";
|
|
84
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
85
|
+
return "SuspenseList";
|
|
86
|
+
case REACT_ACTIVITY_TYPE:
|
|
87
|
+
return "Activity";
|
|
88
|
+
}
|
|
89
|
+
if ("object" === typeof type)
|
|
90
|
+
switch (
|
|
91
|
+
("number" === typeof type.tag &&
|
|
92
|
+
console.error(
|
|
93
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
94
|
+
),
|
|
95
|
+
type.$$typeof)
|
|
96
|
+
) {
|
|
97
|
+
case REACT_PORTAL_TYPE:
|
|
98
|
+
return "Portal";
|
|
99
|
+
case REACT_CONTEXT_TYPE:
|
|
100
|
+
return (type.displayName || "Context") + ".Provider";
|
|
101
|
+
case REACT_CONSUMER_TYPE:
|
|
102
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
103
|
+
case REACT_FORWARD_REF_TYPE:
|
|
104
|
+
var innerType = type.render;
|
|
105
|
+
type = type.displayName;
|
|
106
|
+
type ||
|
|
107
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
108
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
109
|
+
return type;
|
|
110
|
+
case REACT_MEMO_TYPE:
|
|
111
|
+
return (
|
|
112
|
+
(innerType = type.displayName || null),
|
|
113
|
+
null !== innerType
|
|
114
|
+
? innerType
|
|
115
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
116
|
+
);
|
|
117
|
+
case REACT_LAZY_TYPE:
|
|
118
|
+
innerType = type._payload;
|
|
119
|
+
type = type._init;
|
|
120
|
+
try {
|
|
121
|
+
return getComponentNameFromType(type(innerType));
|
|
122
|
+
} catch (x) {}
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
function testStringCoercion(value) {
|
|
127
|
+
return "" + value;
|
|
128
|
+
}
|
|
129
|
+
function checkKeyStringCoercion(value) {
|
|
130
|
+
try {
|
|
131
|
+
testStringCoercion(value);
|
|
132
|
+
var JSCompiler_inline_result = !1;
|
|
133
|
+
} catch (e) {
|
|
134
|
+
JSCompiler_inline_result = true;
|
|
135
|
+
}
|
|
136
|
+
if (JSCompiler_inline_result) {
|
|
137
|
+
JSCompiler_inline_result = console;
|
|
138
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
139
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
140
|
+
("function" === typeof Symbol &&
|
|
141
|
+
Symbol.toStringTag &&
|
|
142
|
+
value[Symbol.toStringTag]) ||
|
|
143
|
+
value.constructor.name ||
|
|
144
|
+
"Object";
|
|
145
|
+
JSCompiler_temp_const.call(
|
|
146
|
+
JSCompiler_inline_result,
|
|
147
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
148
|
+
JSCompiler_inline_result$jscomp$0
|
|
149
|
+
);
|
|
150
|
+
return testStringCoercion(value);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function getTaskName(type) {
|
|
154
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
155
|
+
if (
|
|
156
|
+
"object" === typeof type &&
|
|
157
|
+
null !== type &&
|
|
158
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
159
|
+
)
|
|
160
|
+
return "<...>";
|
|
161
|
+
try {
|
|
162
|
+
var name = getComponentNameFromType(type);
|
|
163
|
+
return name ? "<" + name + ">" : "<...>";
|
|
164
|
+
} catch (x) {
|
|
165
|
+
return "<...>";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function getOwner() {
|
|
169
|
+
var dispatcher = ReactSharedInternals.A;
|
|
170
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
171
|
+
}
|
|
172
|
+
function UnknownOwner() {
|
|
173
|
+
return Error("react-stack-top-frame");
|
|
174
|
+
}
|
|
175
|
+
function hasValidKey(config) {
|
|
176
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
177
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
178
|
+
if (getter && getter.isReactWarning) return false;
|
|
179
|
+
}
|
|
180
|
+
return void 0 !== config.key;
|
|
181
|
+
}
|
|
182
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
183
|
+
function warnAboutAccessingKey() {
|
|
184
|
+
specialPropKeyWarningShown ||
|
|
185
|
+
((specialPropKeyWarningShown = true),
|
|
186
|
+
console.error(
|
|
187
|
+
"%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)",
|
|
188
|
+
displayName
|
|
189
|
+
));
|
|
190
|
+
}
|
|
191
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
192
|
+
Object.defineProperty(props, "key", {
|
|
193
|
+
get: warnAboutAccessingKey,
|
|
194
|
+
configurable: true
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
198
|
+
var componentName = getComponentNameFromType(this.type);
|
|
199
|
+
didWarnAboutElementRef[componentName] ||
|
|
200
|
+
((didWarnAboutElementRef[componentName] = true),
|
|
201
|
+
console.error(
|
|
202
|
+
"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."
|
|
203
|
+
));
|
|
204
|
+
componentName = this.props.ref;
|
|
205
|
+
return void 0 !== componentName ? componentName : null;
|
|
206
|
+
}
|
|
207
|
+
function ReactElement(
|
|
208
|
+
type,
|
|
209
|
+
key,
|
|
210
|
+
self,
|
|
211
|
+
source,
|
|
212
|
+
owner,
|
|
213
|
+
props,
|
|
214
|
+
debugStack,
|
|
215
|
+
debugTask
|
|
216
|
+
) {
|
|
217
|
+
self = props.ref;
|
|
218
|
+
type = {
|
|
219
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
220
|
+
type: type,
|
|
221
|
+
key: key,
|
|
222
|
+
props: props,
|
|
223
|
+
_owner: owner
|
|
224
|
+
};
|
|
225
|
+
null !== (void 0 !== self ? self : null)
|
|
226
|
+
? Object.defineProperty(type, "ref", {
|
|
227
|
+
enumerable: false,
|
|
228
|
+
get: elementRefGetterWithDeprecationWarning
|
|
229
|
+
})
|
|
230
|
+
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
231
|
+
type._store = {};
|
|
232
|
+
Object.defineProperty(type._store, "validated", {
|
|
233
|
+
configurable: false,
|
|
234
|
+
enumerable: false,
|
|
235
|
+
writable: true,
|
|
236
|
+
value: 0
|
|
237
|
+
});
|
|
238
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
239
|
+
configurable: false,
|
|
240
|
+
enumerable: false,
|
|
241
|
+
writable: true,
|
|
242
|
+
value: null
|
|
243
|
+
});
|
|
244
|
+
Object.defineProperty(type, "_debugStack", {
|
|
245
|
+
configurable: false,
|
|
246
|
+
enumerable: false,
|
|
247
|
+
writable: true,
|
|
248
|
+
value: debugStack
|
|
249
|
+
});
|
|
250
|
+
Object.defineProperty(type, "_debugTask", {
|
|
251
|
+
configurable: false,
|
|
252
|
+
enumerable: false,
|
|
253
|
+
writable: true,
|
|
254
|
+
value: debugTask
|
|
255
|
+
});
|
|
256
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
257
|
+
return type;
|
|
258
|
+
}
|
|
259
|
+
function jsxDEVImpl(
|
|
260
|
+
type,
|
|
261
|
+
config,
|
|
262
|
+
maybeKey,
|
|
263
|
+
isStaticChildren,
|
|
264
|
+
source,
|
|
265
|
+
self,
|
|
266
|
+
debugStack,
|
|
267
|
+
debugTask
|
|
268
|
+
) {
|
|
269
|
+
var children = config.children;
|
|
270
|
+
if (void 0 !== children)
|
|
271
|
+
if (isStaticChildren)
|
|
272
|
+
if (isArrayImpl(children)) {
|
|
273
|
+
for (
|
|
274
|
+
isStaticChildren = 0;
|
|
275
|
+
isStaticChildren < children.length;
|
|
276
|
+
isStaticChildren++
|
|
277
|
+
)
|
|
278
|
+
validateChildKeys(children[isStaticChildren]);
|
|
279
|
+
Object.freeze && Object.freeze(children);
|
|
280
|
+
} else
|
|
281
|
+
console.error(
|
|
282
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
283
|
+
);
|
|
284
|
+
else validateChildKeys(children);
|
|
285
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
286
|
+
children = getComponentNameFromType(type);
|
|
287
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
288
|
+
return "key" !== k;
|
|
289
|
+
});
|
|
290
|
+
isStaticChildren =
|
|
291
|
+
0 < keys.length
|
|
292
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
293
|
+
: "{key: someKey}";
|
|
294
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
295
|
+
((keys =
|
|
296
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
297
|
+
console.error(
|
|
298
|
+
'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} />',
|
|
299
|
+
isStaticChildren,
|
|
300
|
+
children,
|
|
301
|
+
keys,
|
|
302
|
+
children
|
|
303
|
+
),
|
|
304
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
305
|
+
}
|
|
306
|
+
children = null;
|
|
307
|
+
void 0 !== maybeKey &&
|
|
308
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
309
|
+
hasValidKey(config) &&
|
|
310
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
311
|
+
if ("key" in config) {
|
|
312
|
+
maybeKey = {};
|
|
313
|
+
for (var propName in config)
|
|
314
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
315
|
+
} else maybeKey = config;
|
|
316
|
+
children &&
|
|
317
|
+
defineKeyPropWarningGetter(
|
|
318
|
+
maybeKey,
|
|
319
|
+
"function" === typeof type
|
|
320
|
+
? type.displayName || type.name || "Unknown"
|
|
321
|
+
: type
|
|
322
|
+
);
|
|
323
|
+
return ReactElement(
|
|
324
|
+
type,
|
|
325
|
+
children,
|
|
326
|
+
self,
|
|
327
|
+
source,
|
|
328
|
+
getOwner(),
|
|
329
|
+
maybeKey,
|
|
330
|
+
debugStack,
|
|
331
|
+
debugTask
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
function validateChildKeys(node) {
|
|
335
|
+
"object" === typeof node &&
|
|
336
|
+
null !== node &&
|
|
337
|
+
node.$$typeof === REACT_ELEMENT_TYPE &&
|
|
338
|
+
node._store &&
|
|
339
|
+
(node._store.validated = 1);
|
|
340
|
+
}
|
|
341
|
+
var React = require$$0,
|
|
342
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
343
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
344
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
345
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
346
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
347
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
348
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
349
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
350
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
351
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
352
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
353
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
354
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
355
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
356
|
+
ReactSharedInternals =
|
|
357
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
358
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
359
|
+
isArrayImpl = Array.isArray,
|
|
360
|
+
createTask = console.createTask
|
|
361
|
+
? console.createTask
|
|
362
|
+
: function () {
|
|
363
|
+
return null;
|
|
364
|
+
};
|
|
365
|
+
React = {
|
|
366
|
+
"react-stack-bottom-frame": function (callStackForError) {
|
|
367
|
+
return callStackForError();
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
var specialPropKeyWarningShown;
|
|
371
|
+
var didWarnAboutElementRef = {};
|
|
372
|
+
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
|
373
|
+
React,
|
|
374
|
+
UnknownOwner
|
|
375
|
+
)();
|
|
376
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
377
|
+
var didWarnAboutKeySpread = {};
|
|
378
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
379
|
+
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
|
|
380
|
+
var trackActualOwner =
|
|
381
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
382
|
+
return jsxDEVImpl(
|
|
383
|
+
type,
|
|
384
|
+
config,
|
|
385
|
+
maybeKey,
|
|
386
|
+
false,
|
|
387
|
+
source,
|
|
388
|
+
self,
|
|
389
|
+
trackActualOwner
|
|
390
|
+
? Error("react-stack-top-frame")
|
|
391
|
+
: unknownOwnerDebugStack,
|
|
392
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
393
|
+
);
|
|
394
|
+
};
|
|
395
|
+
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
396
|
+
var trackActualOwner =
|
|
397
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
398
|
+
return jsxDEVImpl(
|
|
399
|
+
type,
|
|
400
|
+
config,
|
|
401
|
+
maybeKey,
|
|
402
|
+
true,
|
|
403
|
+
source,
|
|
404
|
+
self,
|
|
405
|
+
trackActualOwner
|
|
406
|
+
? Error("react-stack-top-frame")
|
|
407
|
+
: unknownOwnerDebugStack,
|
|
408
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
409
|
+
);
|
|
410
|
+
};
|
|
411
|
+
})();
|
|
412
|
+
return reactJsxRuntime_development;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
var hasRequiredJsxRuntime;
|
|
416
|
+
|
|
417
|
+
function requireJsxRuntime () {
|
|
418
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
419
|
+
hasRequiredJsxRuntime = 1;
|
|
420
|
+
|
|
421
|
+
if (process.env.NODE_ENV === 'production') {
|
|
422
|
+
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
423
|
+
} else {
|
|
424
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
425
|
+
}
|
|
426
|
+
return jsxRuntime.exports;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
430
|
+
|
|
431
|
+
const DEFAULT_PROPS = {
|
|
432
|
+
autoComplete: 'off',
|
|
433
|
+
autoCorrect: 'off',
|
|
434
|
+
autoCapitalize: 'none',
|
|
435
|
+
minLength: 1,
|
|
436
|
+
placeholder: '0.0',
|
|
437
|
+
pattern: '^[0-9]*[.,]?[0-9]*$',
|
|
438
|
+
spellCheck: false,
|
|
439
|
+
step: 'any'
|
|
440
|
+
};
|
|
441
|
+
const NumericInput = /*#__PURE__*/forwardRef(_ref => {
|
|
442
|
+
let {
|
|
443
|
+
maxDecimals = 2,
|
|
444
|
+
onChange,
|
|
445
|
+
...props
|
|
446
|
+
} = _ref;
|
|
447
|
+
function handleOnChange(e) {
|
|
448
|
+
handleOnChangeNumericInput(e.nativeEvent, maxDecimals);
|
|
449
|
+
if (onChange) onChange(e);
|
|
450
|
+
}
|
|
451
|
+
function handleOnPaste(e) {
|
|
452
|
+
handleOnPasteNumericInput(e.nativeEvent, maxDecimals);
|
|
453
|
+
if (onChange) onChange(e);
|
|
454
|
+
}
|
|
455
|
+
return jsxRuntimeExports.jsx("input", {
|
|
456
|
+
...DEFAULT_PROPS,
|
|
457
|
+
...props,
|
|
458
|
+
onChange: handleOnChange,
|
|
459
|
+
onPaste: handleOnPaste,
|
|
460
|
+
type: "text",
|
|
461
|
+
inputMode: "decimal"
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
NumericInput.displayName = 'NumericInput';
|
|
465
|
+
|
|
466
|
+
export { NumericInput };
|
|
467
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/.pnpm/react@19.1.0/node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/.pnpm/react@19.1.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\") + \".Provider\";\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(\n type,\n key,\n self,\n source,\n owner,\n props,\n debugStack,\n debugTask\n ) {\n self = 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 !== self ? self : 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 source,\n self,\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 self,\n source,\n getOwner(),\n maybeKey,\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_ELEMENT_TYPE &&\n node._store &&\n (node._store.validated = 1);\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 Symbol.for(\"react.provider\");\n var 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, source, self) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n source,\n self,\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, source, self) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n source,\n self,\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 { ChangeEvent, ClipboardEvent, forwardRef } from 'react';\nimport { handleOnChangeNumericInput, handleOnPasteNumericInput } from 'numora';\n\ninterface NumericInputProps {\n additionalStyle?: string;\n maxDecimals?: number;\n defaultValue?: string;\n autoFocus?: boolean;\n onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;\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 NumericInput = forwardRef<HTMLInputElement, NumericInputProps>(\n ({ maxDecimals = 2, onChange, ...props }: NumericInputProps) => {\n function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {\n handleOnChangeNumericInput(e.nativeEvent, maxDecimals);\n if (onChange) onChange(e);\n }\n\n function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {\n handleOnPasteNumericInput(e.nativeEvent, maxDecimals);\n if (onChange) onChange(e);\n }\n\n return (\n <input\n {...DEFAULT_PROPS}\n {...props}\n onChange={handleOnChange}\n onPaste={handleOnPaste}\n type=\"text\"\n inputMode=\"decimal\"\n />\n );\n }\n);\n\nNumericInput.displayName = 'NumericInput';\n\nexport { NumericInput };\n"],"names":["jsxRuntimeModule","require$$0","require$$1","DEFAULT_PROPS","autoComplete","autoCorrect","autoCapitalize","minLength","placeholder","pattern","spellCheck","step","NumericInput","forwardRef","_ref","maxDecimals","onChange","props","handleOnChange","e","handleOnChangeNumericInput","nativeEvent","handleOnPaste","handleOnPasteNumericInput","_jsx","onPaste","type","inputMode","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAWA,CAAA,IAAI,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC;AACjE,GAAE,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;AACpD,CAAA,SAAS,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;GACvC,IAAI,GAAG,GAAG,IAAI;GACd,MAAM,KAAK,QAAQ,KAAK,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC;AAC9C,GAAE,MAAM,KAAK,MAAM,CAAC,GAAG,KAAK,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;AAClD,GAAE,IAAI,KAAK,IAAI,MAAM,EAAE;KACnB,QAAQ,GAAG,EAAE;AACjB,KAAI,KAAK,IAAI,QAAQ,IAAI,MAAM;AAC/B,OAAM,KAAK,KAAK,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,MAAM;AAC1B,GAAE,MAAM,GAAG,QAAQ,CAAC,GAAG;AACvB,GAAE,OAAO;KACL,QAAQ,EAAE,kBAAkB;KAC5B,IAAI,EAAE,IAAI;KACV,GAAG,EAAE,GAAG;KACR,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI;AAC1C,KAAI,KAAK,EAAE;IACR;AACH;AACA,CAAA,0BAAA,CAAA,QAAgB,GAAG,mBAAmB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2]}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "numora-react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Numora for React - Headless finance input library",
|
|
5
|
+
"homepage": "https://numora.netlify.app/",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.cjs.js",
|
|
8
|
+
"module": "dist/index.esm.js",
|
|
9
|
+
"types": "dist/types/index.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Sharqiewicz/numora"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"numeric input",
|
|
17
|
+
"currency input",
|
|
18
|
+
"input",
|
|
19
|
+
"form",
|
|
20
|
+
"form input",
|
|
21
|
+
"form currency input",
|
|
22
|
+
"form numeric input",
|
|
23
|
+
"input library",
|
|
24
|
+
"input component",
|
|
25
|
+
"input field",
|
|
26
|
+
"input form",
|
|
27
|
+
"input form field",
|
|
28
|
+
"input form field currency",
|
|
29
|
+
"input form field numeric",
|
|
30
|
+
"financial input",
|
|
31
|
+
"financial input component",
|
|
32
|
+
"financial input field",
|
|
33
|
+
"financial input form",
|
|
34
|
+
"financial input form field",
|
|
35
|
+
"financial input form field currency",
|
|
36
|
+
"financial input form field numeric"
|
|
37
|
+
],
|
|
38
|
+
"authors": [
|
|
39
|
+
{
|
|
40
|
+
"name": "Kacper Szarkiewicz",
|
|
41
|
+
"email": "contact@sharqiewicz.com",
|
|
42
|
+
"url": "https://sharqiewicz.com"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@babel/core": "^7.26.10",
|
|
48
|
+
"@babel/preset-env": "^7.26.9",
|
|
49
|
+
"@babel/preset-react": "^7.26.3",
|
|
50
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
51
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
52
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
53
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
54
|
+
"@types/react": "^19.1.0",
|
|
55
|
+
"@types/react-dom": "^19.1.2",
|
|
56
|
+
"rollup": "^4.38.0",
|
|
57
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
58
|
+
"tslib": "^2.8.1",
|
|
59
|
+
"typescript": "^5.8.2"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"numora": "^1.0.4",
|
|
63
|
+
"react": "^19.1.0",
|
|
64
|
+
"react-dom": "^19.1.0"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "rollup -c",
|
|
68
|
+
"watch": "rollup -c -w"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { ChangeEvent, ClipboardEvent, forwardRef } from 'react';
|
|
2
|
+
import { handleOnChangeNumericInput, handleOnPasteNumericInput } from 'numora';
|
|
3
|
+
|
|
4
|
+
interface NumericInputProps {
|
|
5
|
+
additionalStyle?: string;
|
|
6
|
+
maxDecimals?: number;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
onChange?: (e: ChangeEvent<HTMLInputElement> | ClipboardEvent<HTMLInputElement>) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const DEFAULT_PROPS = {
|
|
13
|
+
autoComplete: 'off',
|
|
14
|
+
autoCorrect: 'off',
|
|
15
|
+
autoCapitalize: 'none',
|
|
16
|
+
minLength: 1,
|
|
17
|
+
placeholder: '0.0',
|
|
18
|
+
pattern: '^[0-9]*[.,]?[0-9]*$',
|
|
19
|
+
spellCheck: false,
|
|
20
|
+
step: 'any',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const NumericInput = forwardRef<HTMLInputElement, NumericInputProps>(
|
|
24
|
+
({ maxDecimals = 2, onChange, ...props }: NumericInputProps) => {
|
|
25
|
+
function handleOnChange(e: ChangeEvent<HTMLInputElement>): void {
|
|
26
|
+
handleOnChangeNumericInput(e.nativeEvent, maxDecimals);
|
|
27
|
+
if (onChange) onChange(e);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function handleOnPaste(e: ClipboardEvent<HTMLInputElement>): void {
|
|
31
|
+
handleOnPasteNumericInput(e.nativeEvent, maxDecimals);
|
|
32
|
+
if (onChange) onChange(e);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<input
|
|
37
|
+
{...DEFAULT_PROPS}
|
|
38
|
+
{...props}
|
|
39
|
+
onChange={handleOnChange}
|
|
40
|
+
onPaste={handleOnPaste}
|
|
41
|
+
type="text"
|
|
42
|
+
inputMode="decimal"
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
NumericInput.displayName = 'NumericInput';
|
|
49
|
+
|
|
50
|
+
export { NumericInput };
|
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
|
+
}
|