@rubenpazch/numeric-up-picker 2.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.
@@ -0,0 +1,704 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('react');
4
+
5
+ var jsxRuntime = {exports: {}};
6
+
7
+ var reactJsxRuntime_production = {};
8
+
9
+ /**
10
+ * @license React
11
+ * react-jsx-runtime.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+
19
+ var hasRequiredReactJsxRuntime_production;
20
+
21
+ function requireReactJsxRuntime_production () {
22
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
23
+ hasRequiredReactJsxRuntime_production = 1;
24
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
25
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
26
+ function jsxProd(type, config, maybeKey) {
27
+ var key = null;
28
+ void 0 !== maybeKey && (key = "" + maybeKey);
29
+ void 0 !== config.key && (key = "" + config.key);
30
+ if ("key" in config) {
31
+ maybeKey = {};
32
+ for (var propName in config)
33
+ "key" !== propName && (maybeKey[propName] = config[propName]);
34
+ } else maybeKey = config;
35
+ config = maybeKey.ref;
36
+ return {
37
+ $$typeof: REACT_ELEMENT_TYPE,
38
+ type: type,
39
+ key: key,
40
+ ref: void 0 !== config ? config : null,
41
+ props: maybeKey
42
+ };
43
+ }
44
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
45
+ reactJsxRuntime_production.jsx = jsxProd;
46
+ reactJsxRuntime_production.jsxs = jsxProd;
47
+ return reactJsxRuntime_production;
48
+ }
49
+
50
+ var reactJsxRuntime_development = {};
51
+
52
+ /**
53
+ * @license React
54
+ * react-jsx-runtime.development.js
55
+ *
56
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
57
+ *
58
+ * This source code is licensed under the MIT license found in the
59
+ * LICENSE file in the root directory of this source tree.
60
+ */
61
+
62
+ var hasRequiredReactJsxRuntime_development;
63
+
64
+ function requireReactJsxRuntime_development () {
65
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
66
+ hasRequiredReactJsxRuntime_development = 1;
67
+ "production" !== process.env.NODE_ENV &&
68
+ (function () {
69
+ function getComponentNameFromType(type) {
70
+ if (null == type) return null;
71
+ if ("function" === typeof type)
72
+ return type.$$typeof === REACT_CLIENT_REFERENCE
73
+ ? null
74
+ : type.displayName || type.name || null;
75
+ if ("string" === typeof type) return type;
76
+ switch (type) {
77
+ case REACT_FRAGMENT_TYPE:
78
+ return "Fragment";
79
+ case REACT_PROFILER_TYPE:
80
+ return "Profiler";
81
+ case REACT_STRICT_MODE_TYPE:
82
+ return "StrictMode";
83
+ case REACT_SUSPENSE_TYPE:
84
+ return "Suspense";
85
+ case REACT_SUSPENSE_LIST_TYPE:
86
+ return "SuspenseList";
87
+ case REACT_ACTIVITY_TYPE:
88
+ return "Activity";
89
+ }
90
+ if ("object" === typeof type)
91
+ switch (
92
+ ("number" === typeof type.tag &&
93
+ console.error(
94
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
95
+ ),
96
+ type.$$typeof)
97
+ ) {
98
+ case REACT_PORTAL_TYPE:
99
+ return "Portal";
100
+ case REACT_CONTEXT_TYPE:
101
+ return type.displayName || "Context";
102
+ case REACT_CONSUMER_TYPE:
103
+ return (type._context.displayName || "Context") + ".Consumer";
104
+ case REACT_FORWARD_REF_TYPE:
105
+ var innerType = type.render;
106
+ type = type.displayName;
107
+ type ||
108
+ ((type = innerType.displayName || innerType.name || ""),
109
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
110
+ return type;
111
+ case REACT_MEMO_TYPE:
112
+ return (
113
+ (innerType = type.displayName || null),
114
+ null !== innerType
115
+ ? innerType
116
+ : getComponentNameFromType(type.type) || "Memo"
117
+ );
118
+ case REACT_LAZY_TYPE:
119
+ innerType = type._payload;
120
+ type = type._init;
121
+ try {
122
+ return getComponentNameFromType(type(innerType));
123
+ } catch (x) {}
124
+ }
125
+ return null;
126
+ }
127
+ function testStringCoercion(value) {
128
+ return "" + value;
129
+ }
130
+ function checkKeyStringCoercion(value) {
131
+ try {
132
+ testStringCoercion(value);
133
+ var JSCompiler_inline_result = !1;
134
+ } catch (e) {
135
+ JSCompiler_inline_result = true;
136
+ }
137
+ if (JSCompiler_inline_result) {
138
+ JSCompiler_inline_result = console;
139
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
140
+ var JSCompiler_inline_result$jscomp$0 =
141
+ ("function" === typeof Symbol &&
142
+ Symbol.toStringTag &&
143
+ value[Symbol.toStringTag]) ||
144
+ value.constructor.name ||
145
+ "Object";
146
+ JSCompiler_temp_const.call(
147
+ JSCompiler_inline_result,
148
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
149
+ JSCompiler_inline_result$jscomp$0
150
+ );
151
+ return testStringCoercion(value);
152
+ }
153
+ }
154
+ function getTaskName(type) {
155
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
156
+ if (
157
+ "object" === typeof type &&
158
+ null !== type &&
159
+ type.$$typeof === REACT_LAZY_TYPE
160
+ )
161
+ return "<...>";
162
+ try {
163
+ var name = getComponentNameFromType(type);
164
+ return name ? "<" + name + ">" : "<...>";
165
+ } catch (x) {
166
+ return "<...>";
167
+ }
168
+ }
169
+ function getOwner() {
170
+ var dispatcher = ReactSharedInternals.A;
171
+ return null === dispatcher ? null : dispatcher.getOwner();
172
+ }
173
+ function UnknownOwner() {
174
+ return Error("react-stack-top-frame");
175
+ }
176
+ function hasValidKey(config) {
177
+ if (hasOwnProperty.call(config, "key")) {
178
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
179
+ if (getter && getter.isReactWarning) return false;
180
+ }
181
+ return void 0 !== config.key;
182
+ }
183
+ function defineKeyPropWarningGetter(props, displayName) {
184
+ function warnAboutAccessingKey() {
185
+ specialPropKeyWarningShown ||
186
+ ((specialPropKeyWarningShown = true),
187
+ console.error(
188
+ "%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)",
189
+ displayName
190
+ ));
191
+ }
192
+ warnAboutAccessingKey.isReactWarning = true;
193
+ Object.defineProperty(props, "key", {
194
+ get: warnAboutAccessingKey,
195
+ configurable: true
196
+ });
197
+ }
198
+ function elementRefGetterWithDeprecationWarning() {
199
+ var componentName = getComponentNameFromType(this.type);
200
+ didWarnAboutElementRef[componentName] ||
201
+ ((didWarnAboutElementRef[componentName] = true),
202
+ console.error(
203
+ "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."
204
+ ));
205
+ componentName = this.props.ref;
206
+ return void 0 !== componentName ? componentName : null;
207
+ }
208
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
209
+ var refProp = props.ref;
210
+ type = {
211
+ $$typeof: REACT_ELEMENT_TYPE,
212
+ type: type,
213
+ key: key,
214
+ props: props,
215
+ _owner: owner
216
+ };
217
+ null !== (void 0 !== refProp ? refProp : null)
218
+ ? Object.defineProperty(type, "ref", {
219
+ enumerable: false,
220
+ get: elementRefGetterWithDeprecationWarning
221
+ })
222
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
223
+ type._store = {};
224
+ Object.defineProperty(type._store, "validated", {
225
+ configurable: false,
226
+ enumerable: false,
227
+ writable: true,
228
+ value: 0
229
+ });
230
+ Object.defineProperty(type, "_debugInfo", {
231
+ configurable: false,
232
+ enumerable: false,
233
+ writable: true,
234
+ value: null
235
+ });
236
+ Object.defineProperty(type, "_debugStack", {
237
+ configurable: false,
238
+ enumerable: false,
239
+ writable: true,
240
+ value: debugStack
241
+ });
242
+ Object.defineProperty(type, "_debugTask", {
243
+ configurable: false,
244
+ enumerable: false,
245
+ writable: true,
246
+ value: debugTask
247
+ });
248
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
249
+ return type;
250
+ }
251
+ function jsxDEVImpl(
252
+ type,
253
+ config,
254
+ maybeKey,
255
+ isStaticChildren,
256
+ debugStack,
257
+ debugTask
258
+ ) {
259
+ var children = config.children;
260
+ if (void 0 !== children)
261
+ if (isStaticChildren)
262
+ if (isArrayImpl(children)) {
263
+ for (
264
+ isStaticChildren = 0;
265
+ isStaticChildren < children.length;
266
+ isStaticChildren++
267
+ )
268
+ validateChildKeys(children[isStaticChildren]);
269
+ Object.freeze && Object.freeze(children);
270
+ } else
271
+ console.error(
272
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
273
+ );
274
+ else validateChildKeys(children);
275
+ if (hasOwnProperty.call(config, "key")) {
276
+ children = getComponentNameFromType(type);
277
+ var keys = Object.keys(config).filter(function (k) {
278
+ return "key" !== k;
279
+ });
280
+ isStaticChildren =
281
+ 0 < keys.length
282
+ ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
283
+ : "{key: someKey}";
284
+ didWarnAboutKeySpread[children + isStaticChildren] ||
285
+ ((keys =
286
+ 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
287
+ console.error(
288
+ '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} />',
289
+ isStaticChildren,
290
+ children,
291
+ keys,
292
+ children
293
+ ),
294
+ (didWarnAboutKeySpread[children + isStaticChildren] = true));
295
+ }
296
+ children = null;
297
+ void 0 !== maybeKey &&
298
+ (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
299
+ hasValidKey(config) &&
300
+ (checkKeyStringCoercion(config.key), (children = "" + config.key));
301
+ if ("key" in config) {
302
+ maybeKey = {};
303
+ for (var propName in config)
304
+ "key" !== propName && (maybeKey[propName] = config[propName]);
305
+ } else maybeKey = config;
306
+ children &&
307
+ defineKeyPropWarningGetter(
308
+ maybeKey,
309
+ "function" === typeof type
310
+ ? type.displayName || type.name || "Unknown"
311
+ : type
312
+ );
313
+ return ReactElement(
314
+ type,
315
+ children,
316
+ maybeKey,
317
+ getOwner(),
318
+ debugStack,
319
+ debugTask
320
+ );
321
+ }
322
+ function validateChildKeys(node) {
323
+ isValidElement(node)
324
+ ? node._store && (node._store.validated = 1)
325
+ : "object" === typeof node &&
326
+ null !== node &&
327
+ node.$$typeof === REACT_LAZY_TYPE &&
328
+ ("fulfilled" === node._payload.status
329
+ ? isValidElement(node._payload.value) &&
330
+ node._payload.value._store &&
331
+ (node._payload.value._store.validated = 1)
332
+ : node._store && (node._store.validated = 1));
333
+ }
334
+ function isValidElement(object) {
335
+ return (
336
+ "object" === typeof object &&
337
+ null !== object &&
338
+ object.$$typeof === REACT_ELEMENT_TYPE
339
+ );
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
+ 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) {
380
+ var trackActualOwner =
381
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
382
+ return jsxDEVImpl(
383
+ type,
384
+ config,
385
+ maybeKey,
386
+ false,
387
+ trackActualOwner
388
+ ? Error("react-stack-top-frame")
389
+ : unknownOwnerDebugStack,
390
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
391
+ );
392
+ };
393
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
394
+ var trackActualOwner =
395
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
396
+ return jsxDEVImpl(
397
+ type,
398
+ config,
399
+ maybeKey,
400
+ true,
401
+ trackActualOwner
402
+ ? Error("react-stack-top-frame")
403
+ : unknownOwnerDebugStack,
404
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
405
+ );
406
+ };
407
+ })();
408
+ return reactJsxRuntime_development;
409
+ }
410
+
411
+ var hasRequiredJsxRuntime;
412
+
413
+ function requireJsxRuntime () {
414
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
415
+ hasRequiredJsxRuntime = 1;
416
+
417
+ if (process.env.NODE_ENV === 'production') {
418
+ jsxRuntime.exports = requireReactJsxRuntime_production();
419
+ } else {
420
+ jsxRuntime.exports = requireReactJsxRuntime_development();
421
+ }
422
+ return jsxRuntime.exports;
423
+ }
424
+
425
+ var jsxRuntimeExports = requireJsxRuntime();
426
+
427
+ var r,s={exports:{}},o={};var t,l,n={};
428
+ /**
429
+ * @license React
430
+ * react-jsx-runtime.development.js
431
+ *
432
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
433
+ *
434
+ * This source code is licensed under the MIT license found in the
435
+ * LICENSE file in the root directory of this source tree.
436
+ */function a(){return t||(t=1,"production"!==process.env.NODE_ENV&&function(){function r(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===$?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return "Fragment";case v:return "Profiler";case p:return "StrictMode";case k:return "Suspense";case y:return "SuspenseList";case C:return "Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case u:return "Portal";case g:return e.displayName||"Context";case f:return (e._context.displayName||"Context")+".Consumer";case j:var s=e.render;return (e=e.displayName)||(e=""!==(e=s.displayName||s.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case L:return null!==(s=e.displayName||null)?s:r(e.type)||"Memo";case N:s=e._payload,e=e._init;try{return r(e(s))}catch(e){}}return null}function s(e){return ""+e}function o(e){try{s(e);var r=!1;}catch(e){r=true;}if(r){var o=(r=console).error,t="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",t),s(e)}}function t(e){if(e===x)return "<>";if("object"==typeof e&&null!==e&&e.$$typeof===N)return "<...>";try{var s=r(e);return s?"<"+s+">":"<...>"}catch(e){return "<...>"}}function l(){return Error("react-stack-top-frame")}function a(){var e=r(this.type);return W[e]||(W[e]=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.")),void 0!==(e=this.props.ref)?e:null}function i(e,s,t,l,n,i){var h,m=s.children;if(void 0!==m)if(l)if(M(m)){for(l=0;l<m.length;l++)c(m[l]);Object.freeze&&Object.freeze(m);}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.");else c(m);if(z.call(s,"key")){m=r(e);var u=Object.keys(s).filter(function(e){return "key"!==e});l=0<u.length?"{key: someKey, "+u.join(": ..., ")+": ...}":"{key: someKey}",V[m+l]||(u=0<u.length?"{"+u.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} />',l,m,u,m),V[m+l]=true);}if(m=null,void 0!==t&&(o(t),m=""+t),function(e){if(z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return false}return void 0!==e.key}(s)&&(o(s.key),m=""+s.key),"key"in s)for(var x in t={},s)"key"!==x&&(t[x]=s[x]);else t=s;return m&&function(e,r){function s(){d||(d=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)",r));}s.isReactWarning=true,Object.defineProperty(e,"key",{get:s,configurable:true});}(t,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,r,s,o,t,l){var n=s.ref;return e={$$typeof:w,type:e,key:r,props:s,_owner:o},null!==(void 0!==n?n:null)?Object.defineProperty(e,"ref",{enumerable:false,get:a}):Object.defineProperty(e,"ref",{enumerable:false,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:false,enumerable:false,writable:true,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:false,enumerable:false,writable:true,value:null}),Object.defineProperty(e,"_debugStack",{configurable:false,enumerable:false,writable:true,value:t}),Object.defineProperty(e,"_debugTask",{configurable:false,enumerable:false,writable:true,value:l}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,m,t,null===(h=b.A)?null:h.getOwner(),n,i)}function c(e){h(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===N&&("fulfilled"===e._payload.status?h(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1));}function h(e){return "object"==typeof e&&null!==e&&e.$$typeof===w}var d,m=require$$0,w=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),g=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),b=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,M=Array.isArray,B=console.createTask?console.createTask:function(){return null},W={},_=(m={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(m,l)(),H=B(t(l)),V={};n.Fragment=x,n.jsx=function(e,r,s){var o=1e4>b.recentlyCreatedOwnerStacks++;return i(e,r,s,false,o?Error("react-stack-top-frame"):_,o?B(t(e)):H)},n.jsxs=function(e,r,s){var o=1e4>b.recentlyCreatedOwnerStacks++;return i(e,r,s,true,o?Error("react-stack-top-frame"):_,o?B(t(e)):H)};}()),n}var i=(l||(l=1,"production"===process.env.NODE_ENV?s.exports=function(){if(r)return o;r=1;var e=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function t(r,s,o){var t=null;if(void 0!==o&&(t=""+o),void 0!==s.key&&(t=""+s.key),"key"in s)for(var l in o={},s)"key"!==l&&(o[l]=s[l]);else o=s;return s=o.ref,{$$typeof:e,type:r,key:t,ref:void 0!==s?s:null,props:o}}return o.Fragment=s,o.jsx=t,o.jsxs=t,o}():s.exports=a()),s.exports);function m({className:e="",size:r="md"}){const s=`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${e}`;return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:s,"aria-label":"Check",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}function g({className:e="",size:r="md",color:s="currentColor"}){return i.jsx("svg",{className:`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${e}`,fill:"none",stroke:s,viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})}function R({className:e="",size:r="md",color:s="currentColor"}){return i.jsx("svg",{className:`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${e}`,fill:"none",stroke:s,viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M5 12h14"})})}function U({className:e="",size:r="md"}){const s=`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${e}`;return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,"aria-label":"Plus",children:i.jsx("path",{d:"M12 4v16m8-8H4"})})}
437
+
438
+ // CSS to hide native number input spinners
439
+ const hideSpinnersStyle = `
440
+ input[type="number"]::-webkit-outer-spin-button,
441
+ input[type="number"]::-webkit-inner-spin-button {
442
+ -webkit-appearance: none;
443
+ margin: 0;
444
+ }
445
+ input[type="number"] {
446
+ -moz-appearance: textfield;
447
+ }
448
+ `;
449
+ function NumericUpPicker({ label, value, onChange, onBlur, onFocus, placeholder, min, max, step = 0.01, error, hint, warning, disabled = false, className = '', required = false, useMinAsDefault = false, alwaysNegative = false, integerOnly = false, showSign = false, defaultToZero = false, clearable = false, onClear, }) {
450
+ // Track if the field has been touched (user has focused on it)
451
+ const [hasBeenTouched, setHasBeenTouched] = require$$0.useState(false);
452
+ const numValue = typeof value === 'string' ? parseFloat(value) || 0 : value;
453
+ // Format display value with sign if showSign is true
454
+ const displayValue = require$$0.useMemo(() => {
455
+ if (!showSign || value === '' || value === '-' || value === null || value === undefined)
456
+ return value || '';
457
+ const strValue = value.toString();
458
+ const numVal = parseFloat(strValue);
459
+ if (isNaN(numVal))
460
+ return value;
461
+ if (numVal > 0 && !strValue.startsWith('+')) {
462
+ return `+${strValue}`;
463
+ }
464
+ return value;
465
+ }, [value, showSign]);
466
+ const handleIncrement = () => {
467
+ // If value is empty or invalid, start from 0 if defaultToZero, otherwise from min (or 0 if no min)
468
+ if (value === '' || value === '-' || value === null || value === undefined) {
469
+ const startValue = defaultToZero ? 0 : min !== undefined ? min : 0;
470
+ if (integerOnly) {
471
+ onChange(Math.round(startValue).toString());
472
+ }
473
+ else {
474
+ onChange(startValue.toFixed(2));
475
+ }
476
+ return;
477
+ }
478
+ const newValue = numValue + step;
479
+ if (max === undefined || newValue <= max) {
480
+ if (integerOnly) {
481
+ onChange(Math.round(newValue).toString());
482
+ }
483
+ else {
484
+ const formattedValue = newValue.toFixed(2);
485
+ // If alwaysNegative, ensure the value has a negative sign
486
+ onChange(alwaysNegative && newValue > 0 ? `-${formattedValue}` : formattedValue);
487
+ }
488
+ }
489
+ };
490
+ const handleDecrement = () => {
491
+ // If value is empty or invalid, start from 0 if defaultToZero, otherwise from max (or 0 if no max)
492
+ if (value === '' || value === '-' || value === null || value === undefined) {
493
+ const startValue = defaultToZero ? 0 : max !== undefined ? max : 0;
494
+ if (integerOnly) {
495
+ onChange(Math.round(startValue).toString());
496
+ }
497
+ else {
498
+ onChange(startValue.toFixed(2));
499
+ }
500
+ return;
501
+ }
502
+ const newValue = numValue - step;
503
+ if (min === undefined || newValue >= min) {
504
+ if (integerOnly) {
505
+ onChange(Math.round(newValue).toString());
506
+ }
507
+ else if (alwaysNegative) {
508
+ // For alwaysNegative fields, work with absolute value
509
+ const formattedValue = Math.abs(newValue).toFixed(2);
510
+ onChange(`-${formattedValue}`);
511
+ }
512
+ else {
513
+ onChange(newValue.toFixed(2));
514
+ }
515
+ }
516
+ };
517
+ const handleKeyDown = (e) => {
518
+ // Handle arrow up/down keys for incrementing/decrementing
519
+ if (e.key === 'ArrowUp') {
520
+ e.preventDefault(); // Prevent cursor movement
521
+ handleIncrement();
522
+ }
523
+ else if (e.key === 'ArrowDown') {
524
+ e.preventDefault(); // Prevent cursor movement
525
+ handleDecrement();
526
+ }
527
+ };
528
+ const handleFocus = (e) => {
529
+ // Mark field as touched when user focuses on it
530
+ setHasBeenTouched(true);
531
+ // Auto-select all content when focusing
532
+ e.target.select();
533
+ onFocus?.();
534
+ };
535
+ const handleDirectInput = (e) => {
536
+ let inputValue = e.target.value;
537
+ // For showSign, remove the plus sign before processing
538
+ if (showSign) {
539
+ inputValue = inputValue.replace(/^\+/, '');
540
+ }
541
+ // For alwaysNegative fields, ensure value always starts with minus sign
542
+ if (alwaysNegative) {
543
+ // Remove any existing minus signs
544
+ inputValue = inputValue.replace(/-/g, '');
545
+ // Allow empty input
546
+ if (inputValue === '') {
547
+ onChange('-');
548
+ return;
549
+ }
550
+ // Add minus sign at the beginning
551
+ inputValue = `-${inputValue}`;
552
+ }
553
+ // Allow empty input (user deleted content)
554
+ if (inputValue === '' || inputValue === '-') {
555
+ onChange(inputValue);
556
+ return;
557
+ }
558
+ // Allow typing decimals and negative signs
559
+ onChange(inputValue);
560
+ };
561
+ const handleClear = () => {
562
+ onChange('');
563
+ onClear?.();
564
+ };
565
+ const handleBlurWithValidation = () => {
566
+ const inputValue = value.toString();
567
+ // If empty, handle based on required and useMinAsDefault flags
568
+ if (inputValue === '' || inputValue === '-') {
569
+ // For optional fields (!required), allow empty values
570
+ if (!required) {
571
+ onChange('');
572
+ onBlur?.();
573
+ return;
574
+ }
575
+ // For required fields, only apply useMinAsDefault if the field has been touched
576
+ if (useMinAsDefault && hasBeenTouched && min !== undefined) {
577
+ if (integerOnly) {
578
+ onChange(Math.round(min).toString());
579
+ }
580
+ else {
581
+ const formattedValue = Math.abs(min).toFixed(2);
582
+ onChange(alwaysNegative ? `-${formattedValue}` : min.toFixed(2));
583
+ }
584
+ }
585
+ else if (!useMinAsDefault && min !== undefined) {
586
+ // For required fields without useMinAsDefault, set to min
587
+ if (integerOnly) {
588
+ onChange(Math.round(min).toString());
589
+ }
590
+ else {
591
+ const formattedValue = Math.abs(min).toFixed(2);
592
+ onChange(alwaysNegative ? `-${formattedValue}` : min.toFixed(2));
593
+ }
594
+ }
595
+ else if (!hasBeenTouched) {
596
+ // If never touched, keep it empty
597
+ onChange('');
598
+ }
599
+ else {
600
+ onChange(integerOnly ? '0' : alwaysNegative ? '-0.00' : '0.00');
601
+ }
602
+ onBlur?.();
603
+ return;
604
+ }
605
+ // Parse the input value (remove negative sign if present for alwaysNegative fields)
606
+ let numericValue = alwaysNegative
607
+ ? parseFloat(inputValue.replace(/^-/, ''))
608
+ : parseFloat(inputValue);
609
+ // If not a valid number, reset to min or 0
610
+ if (isNaN(numericValue)) {
611
+ if (useMinAsDefault && min !== undefined) {
612
+ if (integerOnly) {
613
+ onChange(Math.round(min).toString());
614
+ }
615
+ else {
616
+ const formattedValue = Math.abs(min).toFixed(2);
617
+ onChange(alwaysNegative ? `-${formattedValue}` : min.toFixed(2));
618
+ }
619
+ }
620
+ else if (min !== undefined) {
621
+ if (integerOnly) {
622
+ onChange(Math.round(min).toString());
623
+ }
624
+ else {
625
+ const formattedValue = Math.abs(min).toFixed(2);
626
+ onChange(alwaysNegative ? `-${formattedValue}` : min.toFixed(2));
627
+ }
628
+ }
629
+ else {
630
+ onChange(integerOnly ? '0' : alwaysNegative ? '-0.00' : '0.00');
631
+ }
632
+ onBlur?.();
633
+ return;
634
+ }
635
+ // For alwaysNegative fields, work with absolute values for min/max comparison
636
+ if (alwaysNegative) {
637
+ // Clamp the absolute value within the absolute range
638
+ const absMin = Math.abs(max ?? -0.25); // max is the least negative (closest to 0)
639
+ const absMax = Math.abs(min ?? -10); // min is the most negative (farthest from 0)
640
+ if (numericValue < absMin) {
641
+ numericValue = absMin;
642
+ }
643
+ if (numericValue > absMax) {
644
+ numericValue = absMax;
645
+ }
646
+ onChange(`-${numericValue.toFixed(2)}`);
647
+ onBlur?.();
648
+ return;
649
+ }
650
+ // Apply useMinAsDefault logic: if value is below min, set to min
651
+ if (useMinAsDefault && min !== undefined && numericValue < min) {
652
+ onChange(integerOnly ? Math.round(min).toString() : min.toFixed(2));
653
+ onBlur?.();
654
+ return;
655
+ }
656
+ // Clamp the value within the range
657
+ let constrainedValue = numericValue;
658
+ if (min !== undefined && constrainedValue < min) {
659
+ constrainedValue = min;
660
+ }
661
+ if (max !== undefined && constrainedValue > max) {
662
+ constrainedValue = max;
663
+ }
664
+ // Format and send the constrained value
665
+ if (integerOnly) {
666
+ onChange(Math.round(constrainedValue).toString());
667
+ }
668
+ else {
669
+ onChange(constrainedValue.toFixed(2));
670
+ }
671
+ onBlur?.();
672
+ };
673
+ // Disable buttons only if value is not empty and at min/max
674
+ // When value is empty, allow both buttons (they will set to min/max)
675
+ const isEmpty = value === '' || value === '-' || value === null || value === undefined;
676
+ // For alwaysNegative fields, we compare absolute values
677
+ const isAtMin = !isEmpty &&
678
+ (alwaysNegative
679
+ ? min !== undefined && Math.abs(numValue) >= Math.abs(min)
680
+ : min !== undefined && numValue <= min);
681
+ const isAtMax = !isEmpty &&
682
+ (alwaysNegative
683
+ ? max !== undefined && Math.abs(numValue) <= Math.abs(max)
684
+ : max !== undefined && numValue >= max);
685
+ return (jsxRuntimeExports.jsxs("div", { className: className, children: [jsxRuntimeExports.jsx("style", { children: hideSpinnersStyle }), label && (jsxRuntimeExports.jsxs("label", { className: `block text-sm font-medium mb-2 ${error ? 'text-red-700' : 'text-gray-700'}`, children: [label, required && jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })] })), jsxRuntimeExports.jsxs("div", { className: `flex items-center justify-between h-12 rounded-lg border-2 transition-all ${error
686
+ ? 'border-red-500 bg-red-50'
687
+ : disabled
688
+ ? 'border-gray-300 bg-gray-100 opacity-50 cursor-not-allowed'
689
+ : 'border-gray-300 bg-gray-50'}`, children: [jsxRuntimeExports.jsx("button", { type: "button", onClick: handleDecrement, disabled: disabled || isAtMin, className: `flex-shrink-0 w-12 h-full flex items-center justify-center border-r border-gray-300 transition-all ${error
690
+ ? 'text-red-500'
691
+ : disabled || isAtMin
692
+ ? 'opacity-40 cursor-not-allowed text-gray-400'
693
+ : 'hover:bg-gray-100 active:bg-gray-200 text-gray-600'}`, title: "Decrease value", "aria-label": "Decrease", children: jsxRuntimeExports.jsx(R, { size: "md" }) }), jsxRuntimeExports.jsxs("div", { className: "flex-1 flex items-center justify-center relative", children: [jsxRuntimeExports.jsx("input", { type: "text", step: step, min: min, max: max, value: displayValue, onChange: handleDirectInput, onBlur: handleBlurWithValidation, onFocus: handleFocus, onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, className: `text-center bg-transparent text-lg font-semibold placeholder-gray-400 focus:outline-none border-none ${error ? 'text-red-700' : 'text-gray-900'} ${clearable && !isEmpty ? 'w-20 pr-6' : 'w-16'}`, style: {
694
+ WebkitAppearance: 'none',
695
+ MozAppearance: 'textfield',
696
+ appearance: 'none',
697
+ } }), clearable && !isEmpty && !disabled && (jsxRuntimeExports.jsx("button", { type: "button", onClick: handleClear, className: "absolute right-1 top-1/2 -translate-y-1/2 w-5 h-5 flex items-center justify-center rounded-full hover:bg-gray-200 active:bg-gray-300 transition-colors text-gray-500 hover:text-gray-700", title: "Clear value", "aria-label": "Clear", children: jsxRuntimeExports.jsx(g, { size: "sm", className: "w-3 h-3" }) }))] }), jsxRuntimeExports.jsx("button", { type: "button", onClick: handleIncrement, disabled: disabled || isAtMax, className: `flex-shrink-0 w-12 h-full flex items-center justify-center border-l border-gray-300 transition-all ${error
698
+ ? 'text-red-500'
699
+ : disabled || isAtMax
700
+ ? 'opacity-40 cursor-not-allowed text-gray-400'
701
+ : 'hover:bg-gray-100 active:bg-gray-200 text-gray-600'}`, title: "Increase value", "aria-label": "Increase", children: jsxRuntimeExports.jsx(U, { size: "md" }) })] }), error && (jsxRuntimeExports.jsxs("div", { className: "mt-2 flex items-start gap-1.5", children: [jsxRuntimeExports.jsx(m, { size: "sm", className: "text-red-500 flex-shrink-0 mt-0.5" }), jsxRuntimeExports.jsx("p", { className: "text-sm text-red-600 font-medium", children: error })] })), warning && !error && (jsxRuntimeExports.jsxs("div", { className: "mt-2 flex items-start gap-1.5", children: [jsxRuntimeExports.jsx("div", { className: "w-4 h-4 text-amber-500 flex-shrink-0 mt-0.5 flex items-center justify-center", children: jsxRuntimeExports.jsx("span", { className: "text-xs font-bold", children: "!" }) }), jsxRuntimeExports.jsx("p", { className: "text-sm text-amber-700", children: warning })] })), hint && !error && !warning && jsxRuntimeExports.jsx("p", { className: "mt-2 text-xs text-gray-500", children: hint })] }));
702
+ }
703
+
704
+ module.exports = NumericUpPicker;