@starasia/input 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/input.es.js +161 -161
- package/dist/input.umd.js +41 -41
- package/package.json +5 -1
package/dist/input.es.js
CHANGED
|
@@ -10,20 +10,20 @@ var mr = { exports: {} }, J = {};
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
var Nr;
|
|
13
|
-
function
|
|
13
|
+
function En() {
|
|
14
14
|
if (Nr)
|
|
15
15
|
return J;
|
|
16
16
|
Nr = 1;
|
|
17
|
-
var t = tr, u = Symbol.for("react.element"), b = Symbol.for("react.fragment"),
|
|
17
|
+
var t = tr, u = Symbol.for("react.element"), b = Symbol.for("react.fragment"), x = Object.prototype.hasOwnProperty, E = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
18
|
function A(I, l, _) {
|
|
19
|
-
var p,
|
|
19
|
+
var p, w = {}, T = null, D = null;
|
|
20
20
|
_ !== void 0 && (T = "" + _), l.key !== void 0 && (T = "" + l.key), l.ref !== void 0 && (D = l.ref);
|
|
21
21
|
for (p in l)
|
|
22
|
-
|
|
22
|
+
x.call(l, p) && !d.hasOwnProperty(p) && (w[p] = l[p]);
|
|
23
23
|
if (I && I.defaultProps)
|
|
24
24
|
for (p in l = I.defaultProps, l)
|
|
25
|
-
|
|
26
|
-
return { $$typeof: u, type: I, key: T, ref: D, props:
|
|
25
|
+
w[p] === void 0 && (w[p] = l[p]);
|
|
26
|
+
return { $$typeof: u, type: I, key: T, ref: D, props: w, _owner: E.current };
|
|
27
27
|
}
|
|
28
28
|
return J.Fragment = b, J.jsx = A, J.jsxs = A, J;
|
|
29
29
|
}
|
|
@@ -38,9 +38,9 @@ var G = {};
|
|
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
40
|
var Wr;
|
|
41
|
-
function
|
|
41
|
+
function wn() {
|
|
42
42
|
return Wr || (Wr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var t = tr, u = Symbol.for("react.element"), b = Symbol.for("react.portal"),
|
|
43
|
+
var t = tr, u = Symbol.for("react.element"), b = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), I = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), X = Symbol.iterator, N = "@@iterator";
|
|
44
44
|
function ir(r) {
|
|
45
45
|
if (r === null || typeof r != "object")
|
|
46
46
|
return null;
|
|
@@ -59,16 +59,16 @@ function En() {
|
|
|
59
59
|
{
|
|
60
60
|
var e = c.ReactDebugCurrentFrame, s = e.getStackAddendum();
|
|
61
61
|
s !== "" && (n += "%s", a = a.concat([s]));
|
|
62
|
-
var
|
|
62
|
+
var f = a.map(function(o) {
|
|
63
63
|
return String(o);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
f.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, f);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
var F = !1, Y = !1, or = !1, Z = !1, Q = !1, B;
|
|
69
69
|
B = Symbol.for("react.module.reference");
|
|
70
70
|
function sr(r) {
|
|
71
|
-
return !!(typeof r == "string" || typeof r == "function" || r ===
|
|
71
|
+
return !!(typeof r == "string" || typeof r == "function" || r === x || r === d || Q || r === E || r === _ || r === p || Z || r === D || F || Y || or || typeof r == "object" && r !== null && (r.$$typeof === T || r.$$typeof === w || r.$$typeof === A || r.$$typeof === I || r.$$typeof === l || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
@@ -84,7 +84,7 @@ function En() {
|
|
|
84
84
|
function y(r) {
|
|
85
85
|
return r.displayName || "Context";
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function g(r) {
|
|
88
88
|
if (r == null)
|
|
89
89
|
return null;
|
|
90
90
|
if (typeof r.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
@@ -92,13 +92,13 @@ function En() {
|
|
|
92
92
|
if (typeof r == "string")
|
|
93
93
|
return r;
|
|
94
94
|
switch (r) {
|
|
95
|
-
case
|
|
95
|
+
case x:
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case b:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case d:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case E:
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case _:
|
|
104
104
|
return "Suspense";
|
|
@@ -115,13 +115,13 @@ function En() {
|
|
|
115
115
|
return y(a._context) + ".Provider";
|
|
116
116
|
case l:
|
|
117
117
|
return ur(r, r.render, "ForwardRef");
|
|
118
|
-
case
|
|
118
|
+
case w:
|
|
119
119
|
var e = r.displayName || null;
|
|
120
|
-
return e !== null ? e :
|
|
120
|
+
return e !== null ? e : g(r.type) || "Memo";
|
|
121
121
|
case T: {
|
|
122
|
-
var s = r,
|
|
122
|
+
var s = r, f = s._payload, o = s._init;
|
|
123
123
|
try {
|
|
124
|
-
return
|
|
124
|
+
return g(o(f));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -129,14 +129,14 @@ function En() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var m = Object.assign, j = 0, L, O, $,
|
|
132
|
+
var m = Object.assign, j = 0, L, O, $, xr, Er, wr, Rr;
|
|
133
133
|
function _r() {
|
|
134
134
|
}
|
|
135
135
|
_r.__reactDisabledLog = !0;
|
|
136
136
|
function Kr() {
|
|
137
137
|
{
|
|
138
138
|
if (j === 0) {
|
|
139
|
-
L = console.log, O = console.info, $ = console.warn,
|
|
139
|
+
L = console.log, O = console.info, $ = console.warn, xr = console.error, Er = console.group, wr = console.groupCollapsed, Rr = console.groupEnd;
|
|
140
140
|
var r = {
|
|
141
141
|
configurable: !0,
|
|
142
142
|
enumerable: !0,
|
|
@@ -175,13 +175,13 @@ function En() {
|
|
|
175
175
|
value: $
|
|
176
176
|
}),
|
|
177
177
|
error: m({}, r, {
|
|
178
|
-
value:
|
|
178
|
+
value: xr
|
|
179
179
|
}),
|
|
180
180
|
group: m({}, r, {
|
|
181
|
-
value:
|
|
181
|
+
value: Er
|
|
182
182
|
}),
|
|
183
183
|
groupCollapsed: m({}, r, {
|
|
184
|
-
value:
|
|
184
|
+
value: wr
|
|
185
185
|
}),
|
|
186
186
|
groupEnd: m({}, r, {
|
|
187
187
|
value: Rr
|
|
@@ -205,13 +205,13 @@ function En() {
|
|
|
205
205
|
` + cr + r;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var fr = !1, nr;
|
|
209
209
|
{
|
|
210
210
|
var Gr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
211
|
nr = new Gr();
|
|
212
212
|
}
|
|
213
213
|
function Cr(r, n) {
|
|
214
|
-
if (!r ||
|
|
214
|
+
if (!r || fr)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
217
217
|
var a = nr.get(r);
|
|
@@ -219,11 +219,11 @@ function En() {
|
|
|
219
219
|
return a;
|
|
220
220
|
}
|
|
221
221
|
var e;
|
|
222
|
-
|
|
222
|
+
fr = !0;
|
|
223
223
|
var s = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var f;
|
|
226
|
+
f = lr.current, lr.current = null, Kr();
|
|
227
227
|
try {
|
|
228
228
|
if (n) {
|
|
229
229
|
var o = function() {
|
|
@@ -260,23 +260,23 @@ function En() {
|
|
|
260
260
|
if (k && e && typeof k.stack == "string") {
|
|
261
261
|
for (var i = k.stack.split(`
|
|
262
262
|
`), C = e.stack.split(`
|
|
263
|
-
`),
|
|
263
|
+
`), v = i.length - 1, h = C.length - 1; v >= 1 && h >= 0 && i[v] !== C[h]; )
|
|
264
264
|
h--;
|
|
265
|
-
for (;
|
|
266
|
-
if (i[
|
|
267
|
-
if (
|
|
265
|
+
for (; v >= 1 && h >= 0; v--, h--)
|
|
266
|
+
if (i[v] !== C[h]) {
|
|
267
|
+
if (v !== 1 || h !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
269
|
+
if (v--, h--, h < 0 || i[v] !== C[h]) {
|
|
270
270
|
var P = `
|
|
271
|
-
` + i[
|
|
271
|
+
` + i[v].replace(" at new ", " at ");
|
|
272
272
|
return r.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", r.displayName)), typeof r == "function" && nr.set(r, P), P;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (v >= 1 && h >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
|
|
279
|
+
fr = !1, lr.current = f, Jr(), Error.prepareStackTrace = s;
|
|
280
280
|
}
|
|
281
281
|
var z = r ? r.displayName || r.name : "", V = z ? rr(z) : "";
|
|
282
282
|
return typeof r == "function" && nr.set(r, V), V;
|
|
@@ -305,12 +305,12 @@ function En() {
|
|
|
305
305
|
switch (r.$$typeof) {
|
|
306
306
|
case l:
|
|
307
307
|
return Hr(r.render);
|
|
308
|
-
case
|
|
308
|
+
case w:
|
|
309
309
|
return ar(r.type, n, a);
|
|
310
310
|
case T: {
|
|
311
|
-
var e = r, s = e._payload,
|
|
311
|
+
var e = r, s = e._payload, f = e._init;
|
|
312
312
|
try {
|
|
313
|
-
return ar(
|
|
313
|
+
return ar(f(s), n, a);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -327,9 +327,9 @@ function En() {
|
|
|
327
327
|
}
|
|
328
328
|
function Zr(r, n, a, e, s) {
|
|
329
329
|
{
|
|
330
|
-
var
|
|
330
|
+
var f = Function.call.bind(M);
|
|
331
331
|
for (var o in r)
|
|
332
|
-
if (
|
|
332
|
+
if (f(r, o)) {
|
|
333
333
|
var i = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof r[o] != "function") {
|
|
@@ -337,15 +337,15 @@ function En() {
|
|
|
337
337
|
throw C.name = "Invariant Violation", C;
|
|
338
338
|
}
|
|
339
339
|
i = r[o](n, o, e, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (
|
|
341
|
-
i =
|
|
340
|
+
} catch (v) {
|
|
341
|
+
i = v;
|
|
342
342
|
}
|
|
343
343
|
i && !(i instanceof Error) && (er(s), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", e || "React class", a, o, typeof i), er(null)), i instanceof Error && !(i.message in Sr) && (Sr[i.message] = !0, er(s), R("Failed %s type: %s", a, i.message), er(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
var Qr = Array.isArray;
|
|
348
|
-
function
|
|
348
|
+
function dr(r) {
|
|
349
349
|
return Qr(r);
|
|
350
350
|
}
|
|
351
351
|
function rn(r) {
|
|
@@ -393,8 +393,8 @@ function En() {
|
|
|
393
393
|
}
|
|
394
394
|
function on(r, n) {
|
|
395
395
|
if (typeof r.ref == "string" && K.current && n && K.current.stateNode !== n) {
|
|
396
|
-
var a =
|
|
397
|
-
pr[a] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
|
|
396
|
+
var a = g(K.current.type);
|
|
397
|
+
pr[a] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', g(K.current.type), r.ref), pr[a] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function sn(r, n) {
|
|
@@ -419,7 +419,7 @@ function En() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var ln = function(r, n, a, e, s,
|
|
422
|
+
var ln = function(r, n, a, e, s, f, o) {
|
|
423
423
|
var i = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: u,
|
|
@@ -429,7 +429,7 @@ function En() {
|
|
|
429
429
|
ref: a,
|
|
430
430
|
props: o,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
|
-
_owner:
|
|
432
|
+
_owner: f
|
|
433
433
|
};
|
|
434
434
|
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
@@ -450,14 +450,14 @@ function En() {
|
|
|
450
450
|
};
|
|
451
451
|
function cn(r, n, a, e, s) {
|
|
452
452
|
{
|
|
453
|
-
var
|
|
453
|
+
var f, o = {}, i = null, C = null;
|
|
454
454
|
a !== void 0 && (jr(a), i = "" + a), tn(n) && (jr(n.key), i = "" + n.key), en(n) && (C = n.ref, on(n, s));
|
|
455
|
-
for (
|
|
456
|
-
M.call(n,
|
|
455
|
+
for (f in n)
|
|
456
|
+
M.call(n, f) && !an.hasOwnProperty(f) && (o[f] = n[f]);
|
|
457
457
|
if (r && r.defaultProps) {
|
|
458
|
-
var
|
|
459
|
-
for (
|
|
460
|
-
o[
|
|
458
|
+
var v = r.defaultProps;
|
|
459
|
+
for (f in v)
|
|
460
|
+
o[f] === void 0 && (o[f] = v[f]);
|
|
461
461
|
}
|
|
462
462
|
if (i || C) {
|
|
463
463
|
var h = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
@@ -466,7 +466,7 @@ function En() {
|
|
|
466
466
|
return ln(r, i, C, s, e, K.current, o);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
var
|
|
469
|
+
var gr = c.ReactCurrentOwner, Ir = c.ReactDebugCurrentFrame;
|
|
470
470
|
function q(r) {
|
|
471
471
|
if (r) {
|
|
472
472
|
var n = r._owner, a = ar(r.type, r._source, n ? n.type : null);
|
|
@@ -474,15 +474,15 @@ function En() {
|
|
|
474
474
|
} else
|
|
475
475
|
Ir.setExtraStackFrame(null);
|
|
476
476
|
}
|
|
477
|
-
var
|
|
478
|
-
|
|
477
|
+
var vr;
|
|
478
|
+
vr = !1;
|
|
479
479
|
function hr(r) {
|
|
480
480
|
return typeof r == "object" && r !== null && r.$$typeof === u;
|
|
481
481
|
}
|
|
482
482
|
function Dr() {
|
|
483
483
|
{
|
|
484
|
-
if (
|
|
485
|
-
var r =
|
|
484
|
+
if (gr.current) {
|
|
485
|
+
var r = g(gr.current.type);
|
|
486
486
|
if (r)
|
|
487
487
|
return `
|
|
488
488
|
|
|
@@ -491,7 +491,7 @@ Check the render method of \`` + r + "`.";
|
|
|
491
491
|
return "";
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function fn(r) {
|
|
495
495
|
{
|
|
496
496
|
if (r !== void 0) {
|
|
497
497
|
var n = r.fileName.replace(/^.*[\\\/]/, ""), a = r.lineNumber;
|
|
@@ -503,7 +503,7 @@ Check your code at ` + n + ":" + a + ".";
|
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
var Ar = {};
|
|
506
|
-
function
|
|
506
|
+
function dn(r) {
|
|
507
507
|
{
|
|
508
508
|
var n = Dr();
|
|
509
509
|
if (!n) {
|
|
@@ -520,19 +520,19 @@ Check the top-level render call using <` + a + ">.");
|
|
|
520
520
|
if (!r._store || r._store.validated || r.key != null)
|
|
521
521
|
return;
|
|
522
522
|
r._store.validated = !0;
|
|
523
|
-
var a =
|
|
523
|
+
var a = dn(n);
|
|
524
524
|
if (Ar[a])
|
|
525
525
|
return;
|
|
526
526
|
Ar[a] = !0;
|
|
527
527
|
var e = "";
|
|
528
|
-
r && r._owner && r._owner !==
|
|
528
|
+
r && r._owner && r._owner !== gr.current && (e = " It was passed a child from " + g(r._owner.type) + "."), q(r), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, e), q(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function Lr(r, n) {
|
|
532
532
|
{
|
|
533
533
|
if (typeof r != "object")
|
|
534
534
|
return;
|
|
535
|
-
if (
|
|
535
|
+
if (dr(r))
|
|
536
536
|
for (var a = 0; a < r.length; a++) {
|
|
537
537
|
var e = r[a];
|
|
538
538
|
hr(e) && Fr(e, n);
|
|
@@ -542,7 +542,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
542
542
|
else if (r) {
|
|
543
543
|
var s = ir(r);
|
|
544
544
|
if (typeof s == "function" && s !== r.entries)
|
|
545
|
-
for (var
|
|
545
|
+
for (var f = s.call(r), o; !(o = f.next()).done; )
|
|
546
546
|
hr(o.value) && Fr(o.value, n);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
@@ -557,22 +557,22 @@ Check the top-level render call using <` + a + ">.");
|
|
|
557
557
|
a = n.propTypes;
|
|
558
558
|
else if (typeof n == "object" && (n.$$typeof === l || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
|
-
n.$$typeof ===
|
|
560
|
+
n.$$typeof === w))
|
|
561
561
|
a = n.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
564
|
if (a) {
|
|
565
|
-
var e =
|
|
565
|
+
var e = g(n);
|
|
566
566
|
Zr(a, r.props, "prop", e, r);
|
|
567
|
-
} else if (n.PropTypes !== void 0 && !
|
|
568
|
-
|
|
569
|
-
var s =
|
|
567
|
+
} else if (n.PropTypes !== void 0 && !vr) {
|
|
568
|
+
vr = !0;
|
|
569
|
+
var s = g(n);
|
|
570
570
|
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
571
571
|
}
|
|
572
572
|
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function gn(r) {
|
|
576
576
|
{
|
|
577
577
|
for (var n = Object.keys(r.props), a = 0; a < n.length; a++) {
|
|
578
578
|
var e = n[a];
|
|
@@ -585,25 +585,25 @@ Check the top-level render call using <` + a + ">.");
|
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
var $r = {};
|
|
588
|
-
function Vr(r, n, a, e, s,
|
|
588
|
+
function Vr(r, n, a, e, s, f) {
|
|
589
589
|
{
|
|
590
590
|
var o = sr(r);
|
|
591
591
|
if (!o) {
|
|
592
592
|
var i = "";
|
|
593
593
|
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
|
-
var C =
|
|
594
|
+
var C = fn(s);
|
|
595
595
|
C ? i += C : i += Dr();
|
|
596
|
-
var
|
|
597
|
-
r === null ?
|
|
596
|
+
var v;
|
|
597
|
+
r === null ? v = "null" : dr(r) ? v = "array" : r !== void 0 && r.$$typeof === u ? (v = "<" + (g(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : v = typeof r, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, i);
|
|
598
598
|
}
|
|
599
|
-
var h = cn(r, n, a, s,
|
|
599
|
+
var h = cn(r, n, a, s, f);
|
|
600
600
|
if (h == null)
|
|
601
601
|
return h;
|
|
602
602
|
if (o) {
|
|
603
603
|
var P = n.children;
|
|
604
604
|
if (P !== void 0)
|
|
605
605
|
if (e)
|
|
606
|
-
if (
|
|
606
|
+
if (dr(P)) {
|
|
607
607
|
for (var z = 0; z < P.length; z++)
|
|
608
608
|
Lr(P[z], r);
|
|
609
609
|
Object.freeze && Object.freeze(P);
|
|
@@ -613,8 +613,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
613
613
|
Lr(P, r);
|
|
614
614
|
}
|
|
615
615
|
if (M.call(n, "key")) {
|
|
616
|
-
var V =
|
|
617
|
-
return
|
|
616
|
+
var V = g(r), k = Object.keys(n).filter(function(xn) {
|
|
617
|
+
return xn !== "key";
|
|
618
618
|
}), br = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
619
|
if (!$r[V + br]) {
|
|
620
620
|
var mn = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
|
|
@@ -626,20 +626,20 @@ React keys must be passed directly to JSX without using spread:
|
|
|
626
626
|
<%s key={someKey} {...props} />`, br, V, mn, V), $r[V + br] = !0;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
return r ===
|
|
629
|
+
return r === x ? gn(h) : pn(h), h;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function vn(r, n, a) {
|
|
633
633
|
return Vr(r, n, a, !0);
|
|
634
634
|
}
|
|
635
635
|
function hn(r, n, a) {
|
|
636
636
|
return Vr(r, n, a, !1);
|
|
637
637
|
}
|
|
638
|
-
var bn = hn, yn =
|
|
639
|
-
G.Fragment =
|
|
638
|
+
var bn = hn, yn = vn;
|
|
639
|
+
G.Fragment = x, G.jsx = bn, G.jsxs = yn;
|
|
640
640
|
}()), G;
|
|
641
641
|
}
|
|
642
|
-
process.env.NODE_ENV === "production" ? mr.exports =
|
|
642
|
+
process.env.NODE_ENV === "production" ? mr.exports = En() : mr.exports = wn();
|
|
643
643
|
var S = mr.exports;
|
|
644
644
|
const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
645
|
|
|
@@ -660,86 +660,86 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
660
660
|
/* blue */
|
|
661
661
|
--starasia-ui-input-color-primary-blue: var(
|
|
662
662
|
--starasia-ui-color-blue-700,
|
|
663
|
-
#
|
|
663
|
+
#1976d2
|
|
664
664
|
);
|
|
665
665
|
--starasia-ui-input-color-secondary-blue: var(
|
|
666
666
|
--starasia-ui-color-blue-500,
|
|
667
|
-
#
|
|
667
|
+
#2196f3
|
|
668
668
|
);
|
|
669
669
|
--starasia-ui-input-color-tertiary-blue: var(
|
|
670
670
|
--starasia-ui-color-blue-300,
|
|
671
|
-
#
|
|
671
|
+
#64b5f6
|
|
672
672
|
);
|
|
673
673
|
--starasia-ui-input-color-quaternary-blue: var(
|
|
674
674
|
--starasia-ui-color-blue-100,
|
|
675
|
-
#
|
|
675
|
+
#bbdefb
|
|
676
676
|
);
|
|
677
677
|
--starasia-ui-input-color-quinary-blue: var(
|
|
678
678
|
--starasia-ui-color-blue-50,
|
|
679
|
-
#
|
|
679
|
+
#e3f2fd
|
|
680
680
|
);
|
|
681
681
|
/* gray */
|
|
682
682
|
--starasia-ui-input-color-primary-gray: var(
|
|
683
683
|
--starasia-ui-color-gray-700,
|
|
684
|
-
#
|
|
684
|
+
#48504c
|
|
685
685
|
);
|
|
686
686
|
--starasia-ui-input-color-secondary-gray: var(
|
|
687
687
|
--starasia-ui-color-gray-500,
|
|
688
|
-
#
|
|
688
|
+
#78867f
|
|
689
689
|
);
|
|
690
690
|
--starasia-ui-input-color-tertiary-gray: var(
|
|
691
691
|
--starasia-ui-color-gray-300,
|
|
692
|
-
#
|
|
692
|
+
#aeb6b2
|
|
693
693
|
);
|
|
694
694
|
--starasia-ui-input-color-quaternary-gray: var(
|
|
695
695
|
--starasia-ui-color-gray-100,
|
|
696
|
-
#
|
|
696
|
+
#eff3f8
|
|
697
697
|
);
|
|
698
698
|
--starasia-ui-input-color-quinary-gray: var(
|
|
699
699
|
--starasia-ui-color-gray-50,
|
|
700
|
-
#
|
|
700
|
+
#fffeff
|
|
701
701
|
);
|
|
702
702
|
/* red */
|
|
703
703
|
--starasia-ui-input-color-primary-red: var(
|
|
704
704
|
--starasia-ui-color-red-700,
|
|
705
|
-
#
|
|
705
|
+
#a4133c
|
|
706
706
|
);
|
|
707
707
|
--starasia-ui-input-color-secondary-red: var(
|
|
708
708
|
--starasia-ui-color-red-500,
|
|
709
|
-
#
|
|
709
|
+
#ff4d6d
|
|
710
710
|
);
|
|
711
711
|
--starasia-ui-input-color-tertiary-red: var(
|
|
712
712
|
--starasia-ui-color-red-300,
|
|
713
|
-
#
|
|
713
|
+
#ff8fa3
|
|
714
714
|
);
|
|
715
715
|
--starasia-ui-input-color-quaternary-red: var(
|
|
716
716
|
--starasia-ui-color-red-100,
|
|
717
|
-
#
|
|
717
|
+
#ffccd5
|
|
718
718
|
);
|
|
719
719
|
--starasia-ui-input-color-quinary-red: var(
|
|
720
720
|
--starasia-ui-color-red-50,
|
|
721
|
-
#
|
|
721
|
+
#fff0f3
|
|
722
722
|
);
|
|
723
|
-
/*
|
|
724
|
-
--starasia-ui-input-color-primary-
|
|
725
|
-
--starasia-ui-color-
|
|
726
|
-
#
|
|
723
|
+
/* orange */
|
|
724
|
+
--starasia-ui-input-color-primary-orange: var(
|
|
725
|
+
--starasia-ui-color-orange-700,
|
|
726
|
+
#986800
|
|
727
727
|
);
|
|
728
|
-
--starasia-ui-input-color-secondary-
|
|
729
|
-
--starasia-ui-color-
|
|
730
|
-
#
|
|
728
|
+
--starasia-ui-input-color-secondary-orange: var(
|
|
729
|
+
--starasia-ui-color-orange-500,
|
|
730
|
+
#d2a03a
|
|
731
731
|
);
|
|
732
|
-
--starasia-ui-input-color-tertiary-
|
|
733
|
-
--starasia-ui-color-
|
|
734
|
-
#
|
|
732
|
+
--starasia-ui-input-color-tertiary-orange: var(
|
|
733
|
+
--starasia-ui-color-orange-300,
|
|
734
|
+
#ffcb69
|
|
735
735
|
);
|
|
736
|
-
--starasia-ui-input-color-quaternary-
|
|
737
|
-
--starasia-ui-color-
|
|
738
|
-
#
|
|
736
|
+
--starasia-ui-input-color-quaternary-orange: var(
|
|
737
|
+
--starasia-ui-color-orange-100,
|
|
738
|
+
#fff5c1
|
|
739
739
|
);
|
|
740
|
-
--starasia-ui-input-color-quinary-
|
|
741
|
-
--starasia-ui-color-
|
|
742
|
-
#
|
|
740
|
+
--starasia-ui-input-color-quinary-orange: var(
|
|
741
|
+
--starasia-ui-color-orange-50,
|
|
742
|
+
#faf6e0
|
|
743
743
|
);
|
|
744
744
|
|
|
745
745
|
/* text color */
|
|
@@ -819,16 +819,16 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
819
819
|
}
|
|
820
820
|
|
|
821
821
|
.starasia-input-outline.starasia-input-container-warning {
|
|
822
|
-
border-color: var(--starasia-ui-input-color-secondary-
|
|
822
|
+
border-color: var(--starasia-ui-input-color-secondary-orange) !important;
|
|
823
823
|
}
|
|
824
824
|
|
|
825
825
|
.starasia-input-filled.starasia-input-container-warning {
|
|
826
|
-
border-color: var(--starasia-ui-input-color-secondary-
|
|
827
|
-
background-color: var(--starasia-ui-input-color-quinary-
|
|
826
|
+
border-color: var(--starasia-ui-input-color-secondary-orange) !important;
|
|
827
|
+
background-color: var(--starasia-ui-input-color-quinary-orange);
|
|
828
828
|
}
|
|
829
829
|
|
|
830
830
|
.starasia-input-flushed.starasia-input-container-warning {
|
|
831
|
-
border-color: var(--starasia-ui-input-color-secondary-
|
|
831
|
+
border-color: var(--starasia-ui-input-color-secondary-orange) !important;
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
.starasia-input-outline {
|
|
@@ -988,18 +988,18 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
988
988
|
if (t === "lg")
|
|
989
989
|
return 20;
|
|
990
990
|
}, qr = (t) => t === "default" ? "#939E99" : t === "error" ? "#EF4444" : t === "warning" ? "#EAB308" : "#939E99", zr = (t) => t === "default" ? "#939E99" : t === "error" ? "#EF4444" : t === "warning" ? "#EAB308" : "#939E99", _n = Br(
|
|
991
|
-
({ options: t, value: u, setValue: b, isComponentVisible:
|
|
991
|
+
({ options: t, value: u, setValue: b, isComponentVisible: x, onOptionChange: E }, d) => {
|
|
992
992
|
const [A, I] = H([]), l = Mr(null), _ = () => {
|
|
993
|
-
if (
|
|
994
|
-
const p = window.innerHeight,
|
|
995
|
-
l.current.style.left = `${
|
|
993
|
+
if (d != null && d.current && l.current) {
|
|
994
|
+
const p = window.innerHeight, w = d == null ? void 0 : d.current.getBoundingClientRect(), T = l.current.getBoundingClientRect(), D = w.bottom + T.height;
|
|
995
|
+
l.current.style.left = `${w.left}px`, l.current.style.width = `${w.width}px`, D >= p - 10 ? l.current.style.top = `${w.top - T.height - 5}px` : l.current.style.top = `${w.top + w.height}px`;
|
|
996
996
|
}
|
|
997
997
|
};
|
|
998
998
|
return U(() => (window.addEventListener("scroll", _), window.addEventListener("resize", _), () => {
|
|
999
999
|
window.removeEventListener("scroll", _), window.removeEventListener("resize", _);
|
|
1000
|
-
}), [
|
|
1000
|
+
}), [d, l]), U(() => {
|
|
1001
1001
|
_();
|
|
1002
|
-
}, [
|
|
1002
|
+
}, [x]), U(() => {
|
|
1003
1003
|
I(
|
|
1004
1004
|
(t == null ? void 0 : t.filter(
|
|
1005
1005
|
(p) => p.toLowerCase().startsWith(u.toLowerCase())
|
|
@@ -1020,13 +1020,13 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
1020
1020
|
zIndex: 5e4
|
|
1021
1021
|
},
|
|
1022
1022
|
children: A == null ? void 0 : A.map(
|
|
1023
|
-
(p) => Cn(p, u, b,
|
|
1023
|
+
(p) => Cn(p, u, b, E)
|
|
1024
1024
|
)
|
|
1025
1025
|
}
|
|
1026
1026
|
);
|
|
1027
1027
|
}
|
|
1028
|
-
), Cn = (t, u, b,
|
|
1029
|
-
const
|
|
1028
|
+
), Cn = (t, u, b, x) => {
|
|
1029
|
+
const E = t.toLowerCase().indexOf(u.toLowerCase());
|
|
1030
1030
|
return /* @__PURE__ */ S.jsxs(
|
|
1031
1031
|
"p",
|
|
1032
1032
|
{
|
|
@@ -1038,23 +1038,23 @@ const Rn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
1038
1038
|
cursor: "pointer"
|
|
1039
1039
|
},
|
|
1040
1040
|
onClick: () => {
|
|
1041
|
-
b(t),
|
|
1041
|
+
b(t), x && x(t);
|
|
1042
1042
|
},
|
|
1043
1043
|
children: [
|
|
1044
|
-
t.slice(0,
|
|
1045
|
-
/* @__PURE__ */ S.jsx("span", { style: { color: "#374151" }, children: t.slice(
|
|
1046
|
-
t.slice(
|
|
1044
|
+
t.slice(0, E),
|
|
1045
|
+
/* @__PURE__ */ S.jsx("span", { style: { color: "#374151" }, children: t.slice(E, E + u.length) }),
|
|
1046
|
+
t.slice(E + u.length)
|
|
1047
1047
|
]
|
|
1048
1048
|
}
|
|
1049
1049
|
);
|
|
1050
1050
|
};
|
|
1051
1051
|
function Sn(t) {
|
|
1052
|
-
const [u, b] = H(t),
|
|
1053
|
-
|
|
1052
|
+
const [u, b] = H(t), x = Mr(null), E = (d) => {
|
|
1053
|
+
x.current && !x.current.contains(d.target) && b(!1);
|
|
1054
1054
|
};
|
|
1055
|
-
return U(() => (document.addEventListener("click",
|
|
1056
|
-
document.removeEventListener("click",
|
|
1057
|
-
}), []), { ref:
|
|
1055
|
+
return U(() => (document.addEventListener("click", E, !0), () => {
|
|
1056
|
+
document.removeEventListener("click", E, !0);
|
|
1057
|
+
}), []), { ref: x, isComponentVisible: u, setIsComponentVisible: b };
|
|
1058
1058
|
}
|
|
1059
1059
|
const Ur = "starasia-input-styles", kn = (t) => {
|
|
1060
1060
|
if (!document.getElementById(Ur)) {
|
|
@@ -1073,15 +1073,15 @@ const yr = (t) => {
|
|
|
1073
1073
|
(t, u) => {
|
|
1074
1074
|
const {
|
|
1075
1075
|
leftIcon: b,
|
|
1076
|
-
rightIcon:
|
|
1077
|
-
size:
|
|
1078
|
-
status:
|
|
1076
|
+
rightIcon: x,
|
|
1077
|
+
size: E = "md",
|
|
1078
|
+
status: d = "default",
|
|
1079
1079
|
inputUse: A = "icon",
|
|
1080
1080
|
variant: I = "outline",
|
|
1081
1081
|
leftAddons: l,
|
|
1082
1082
|
rightAddons: _,
|
|
1083
1083
|
onClickLeftIcon: p,
|
|
1084
|
-
onClickRightIcon:
|
|
1084
|
+
onClickRightIcon: w,
|
|
1085
1085
|
highlightPlaceholder: T,
|
|
1086
1086
|
currency: D,
|
|
1087
1087
|
fullWidth: X = !1,
|
|
@@ -1104,7 +1104,7 @@ const yr = (t) => {
|
|
|
1104
1104
|
}, [c]), /* @__PURE__ */ S.jsxs(
|
|
1105
1105
|
"div",
|
|
1106
1106
|
{
|
|
1107
|
-
className: `starasia-input-container starasia-input-${I} starasia-input-container-${
|
|
1107
|
+
className: `starasia-input-container starasia-input-${I} starasia-input-container-${d} ${E} `,
|
|
1108
1108
|
style: {
|
|
1109
1109
|
width: X ? "auto" : "max-content",
|
|
1110
1110
|
position: "relative"
|
|
@@ -1114,12 +1114,12 @@ const yr = (t) => {
|
|
|
1114
1114
|
children: [
|
|
1115
1115
|
l ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-addons-left", children: l }) : null,
|
|
1116
1116
|
b ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-icon-left", children: tr.cloneElement(b, {
|
|
1117
|
-
width: Yr(
|
|
1118
|
-
color: qr(c.disabled ? "disable" :
|
|
1117
|
+
width: Yr(E),
|
|
1118
|
+
color: qr(c.disabled ? "disable" : d),
|
|
1119
1119
|
onClick: p,
|
|
1120
1120
|
style: {
|
|
1121
1121
|
color: `${qr(
|
|
1122
|
-
c.disabled ? "disable" :
|
|
1122
|
+
c.disabled ? "disable" : d
|
|
1123
1123
|
)}`
|
|
1124
1124
|
}
|
|
1125
1125
|
}) }) : null,
|
|
@@ -1130,20 +1130,20 @@ const yr = (t) => {
|
|
|
1130
1130
|
className: "starasia-input",
|
|
1131
1131
|
...c,
|
|
1132
1132
|
placeholder: "",
|
|
1133
|
-
disabled:
|
|
1133
|
+
disabled: d === "disable" ? !0 : c.disabled,
|
|
1134
1134
|
ref: u,
|
|
1135
1135
|
onChange: (y) => {
|
|
1136
|
-
let
|
|
1136
|
+
let g = D ? yr(y.target.value) : y.target.value;
|
|
1137
1137
|
const m = y.target.selectionStart;
|
|
1138
1138
|
if (D)
|
|
1139
1139
|
if (or === "Backspace")
|
|
1140
1140
|
if (typeof m == "number" && F[m] === ".") {
|
|
1141
|
-
let j =
|
|
1141
|
+
let j = g.slice(0, m - 1), L = g.slice(
|
|
1142
1142
|
m,
|
|
1143
|
-
|
|
1143
|
+
g.length
|
|
1144
1144
|
);
|
|
1145
|
-
|
|
1146
|
-
const O = F.length - 1, $ =
|
|
1145
|
+
g = yr(j + L);
|
|
1146
|
+
const O = F.length - 1, $ = g.length - 1;
|
|
1147
1147
|
setTimeout(
|
|
1148
1148
|
() => y.target.setSelectionRange(
|
|
1149
1149
|
m - (O - $) < 0 ? 0 : m - (O - $),
|
|
@@ -1152,7 +1152,7 @@ const yr = (t) => {
|
|
|
1152
1152
|
0
|
|
1153
1153
|
);
|
|
1154
1154
|
} else {
|
|
1155
|
-
const j = F.length - 1, L =
|
|
1155
|
+
const j = F.length - 1, L = g.length - 1;
|
|
1156
1156
|
let O = m + 1 - (j - L);
|
|
1157
1157
|
setTimeout(
|
|
1158
1158
|
() => y.target.setSelectionRange(
|
|
@@ -1163,7 +1163,7 @@ const yr = (t) => {
|
|
|
1163
1163
|
);
|
|
1164
1164
|
}
|
|
1165
1165
|
else {
|
|
1166
|
-
const j = F.length - 1, L =
|
|
1166
|
+
const j = F.length - 1, L = g.length - 1;
|
|
1167
1167
|
setTimeout(
|
|
1168
1168
|
() => y.target.setSelectionRange(
|
|
1169
1169
|
m + (L - j) - 1,
|
|
@@ -1172,11 +1172,11 @@ const yr = (t) => {
|
|
|
1172
1172
|
0
|
|
1173
1173
|
);
|
|
1174
1174
|
}
|
|
1175
|
-
Y(
|
|
1175
|
+
Y(g), y.target.value ? W(!1) : W(!0), c.onChange && c.onChange({
|
|
1176
1176
|
...y,
|
|
1177
1177
|
target: {
|
|
1178
1178
|
...y.target,
|
|
1179
|
-
value: D ? String(Tn(
|
|
1179
|
+
value: D ? String(Tn(g)) : g,
|
|
1180
1180
|
name: y.target.name
|
|
1181
1181
|
}
|
|
1182
1182
|
}), Z("");
|
|
@@ -1189,13 +1189,13 @@ const yr = (t) => {
|
|
|
1189
1189
|
),
|
|
1190
1190
|
R ? jn(c.placeholder, T) : null
|
|
1191
1191
|
] }),
|
|
1192
|
-
|
|
1193
|
-
width: Yr(
|
|
1194
|
-
color: zr(c.disabled ? "disable" :
|
|
1195
|
-
onClick:
|
|
1192
|
+
x ? /* @__PURE__ */ S.jsx("div", { className: "starasia-input-container-icon-right", children: tr.cloneElement(x, {
|
|
1193
|
+
width: Yr(E),
|
|
1194
|
+
color: zr(c.disabled ? "disable" : d),
|
|
1195
|
+
onClick: w,
|
|
1196
1196
|
style: {
|
|
1197
1197
|
color: `${zr(
|
|
1198
|
-
c.disabled ? "disable" :
|
|
1198
|
+
c.disabled ? "disable" : d
|
|
1199
1199
|
)}`
|
|
1200
1200
|
}
|
|
1201
1201
|
}) }) : null,
|
package/dist/input.umd.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var mr;function Mr(){if(mr)return J;mr=1;var t=d,u=Symbol.for("react.element"),y=Symbol.for("react.fragment"),
|
|
9
|
+
*/var mr;function Mr(){if(mr)return J;mr=1;var t=d,u=Symbol.for("react.element"),y=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,w=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function F(D,l,S){var g,R={},j=null,A=null;S!==void 0&&(j=""+S),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(A=l.ref);for(g in l)E.call(l,g)&&!p.hasOwnProperty(g)&&(R[g]=l[g]);if(D&&D.defaultProps)for(g in l=D.defaultProps,l)R[g]===void 0&&(R[g]=l[g]);return{$$typeof:u,type:D,key:j,ref:A,props:R,_owner:w.current}}return J.Fragment=y,J.jsx=F,J.jsxs=F,J}var G={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var xr;function Kr(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var t=d,u=Symbol.for("react.element"),y=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),D=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),Z=Symbol.iterator,z="@@iterator";function or(r){if(r===null||typeof r!="object")return null;var n=Z&&r[Z]||r[z];return typeof n=="function"?n:null}var c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(r){{for(var n=arguments.length,a=new Array(n>1?n-1:0),e=1;e<n;e++)a[e-1]=arguments[e];U("error",r,a)}}function U(r,n,a){{var e=c.ReactDebugCurrentFrame,s=e.getStackAddendum();s!==""&&(n+="%s",a=a.concat([s]));var f=a.map(function(o){return String(o)});f.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,f)}}var L=!1,B=!1,sr=!1,Q=!1,$=!1,H;H=Symbol.for("react.module.reference");function ur(r){return!!(typeof r=="string"||typeof r=="function"||r===E||r===p||$||r===w||r===S||r===g||Q||r===A||L||B||sr||typeof r=="object"&&r!==null&&(r.$$typeof===j||r.$$typeof===R||r.$$typeof===F||r.$$typeof===D||r.$$typeof===l||r.$$typeof===H||r.getModuleId!==void 0))}function lr(r,n,a){var e=r.displayName;if(e)return e;var s=n.displayName||n.name||"";return s!==""?a+"("+s+")":a}function m(r){return r.displayName||"Context"}function v(r){if(r==null)return null;if(typeof r.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case E:return"Fragment";case y:return"Portal";case p:return"Profiler";case w:return"StrictMode";case S:return"Suspense";case g:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case D:var n=r;return m(n)+".Consumer";case F:var a=r;return m(a._context)+".Provider";case l:return lr(r,r.render,"ForwardRef");case R:var e=r.displayName||null;return e!==null?e:v(r.type)||"Memo";case j:{var s=r,f=s._payload,o=s._init;try{return v(o(f))}catch{return null}}}return null}var x=Object.assign,O=0,V,P,W,Cr,Sr,Tr,kr;function jr(){}jr.__reactDisabledLog=!0;function $r(){{if(O===0){V=console.log,P=console.info,W=console.warn,Cr=console.error,Sr=console.group,Tr=console.groupCollapsed,kr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:jr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}O++}}function rn(){{if(O--,O===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:x({},r,{value:V}),info:x({},r,{value:P}),warn:x({},r,{value:W}),error:x({},r,{value:Cr}),group:x({},r,{value:Sr}),groupCollapsed:x({},r,{value:Tr}),groupEnd:x({},r,{value:kr})})}O<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var cr=c.ReactCurrentDispatcher,fr;function rr(r,n,a){{if(fr===void 0)try{throw Error()}catch(s){var e=s.stack.trim().match(/\n( *(at )?)/);fr=e&&e[1]||""}return`
|
|
18
18
|
`+fr+r}}var dr=!1,nr;{var nn=typeof WeakMap=="function"?WeakMap:Map;nr=new nn}function Or(r,n){if(!r||dr)return"";{var a=nr.get(r);if(a!==void 0)return a}var e;dr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=cr.current,cr.current=null,$r();try{if(n){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(k){e=k}Reflect.construct(r,[],o)}else{try{o.call()}catch(k){e=k}r.call(o.prototype)}}else{try{throw Error()}catch(k){e=k}r()}}catch(k){if(k&&e&&typeof k.stack=="string"){for(var i=k.stack.split(`
|
|
19
19
|
`),T=e.stack.split(`
|
|
20
20
|
`),h=i.length-1,b=T.length-1;h>=1&&b>=0&&i[h]!==T[b];)b--;for(;h>=1&&b>=0;h--,b--)if(i[h]!==T[b]){if(h!==1||b!==1)do if(h--,b--,b<0||i[h]!==T[b]){var I=`
|
|
21
|
-
`+i[h].replace(" at new "," at ");return r.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",r.displayName)),typeof r=="function"&&nr.set(r,I),I}while(h>=1&&b>=0);break}}}finally{dr=!1,cr.current=f,rn(),Error.prepareStackTrace=s}var K=r?r.displayName||r.name:"",Y=K?rr(K):"";return typeof r=="function"&&nr.set(r,Y),Y}function an(r,n,a){return Or(r,!1)}function en(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function ar(r,n,a){if(r==null)return"";if(typeof r=="function")return Or(r,en(r));if(typeof r=="string")return rr(r);switch(r){case S:return rr("Suspense");case
|
|
21
|
+
`+i[h].replace(" at new "," at ");return r.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",r.displayName)),typeof r=="function"&&nr.set(r,I),I}while(h>=1&&b>=0);break}}}finally{dr=!1,cr.current=f,rn(),Error.prepareStackTrace=s}var K=r?r.displayName||r.name:"",Y=K?rr(K):"";return typeof r=="function"&&nr.set(r,Y),Y}function an(r,n,a){return Or(r,!1)}function en(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function ar(r,n,a){if(r==null)return"";if(typeof r=="function")return Or(r,en(r));if(typeof r=="string")return rr(r);switch(r){case S:return rr("Suspense");case g:return rr("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case l:return an(r.render);case R:return ar(r.type,n,a);case j:{var e=r,s=e._payload,f=e._init;try{return ar(f(s),n,a)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,Pr={},Ir=c.ReactDebugCurrentFrame;function er(r){if(r){var n=r._owner,a=ar(r.type,r._source,n?n.type:null);Ir.setExtraStackFrame(a)}else Ir.setExtraStackFrame(null)}function tn(r,n,a,e,s){{var f=Function.call.bind(X);for(var o in r)if(f(r,o)){var i=void 0;try{if(typeof r[o]!="function"){var T=Error((e||"React class")+": "+a+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}i=r[o](n,o,e,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){i=h}i&&!(i instanceof Error)&&(er(s),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",e||"React class",a,o,typeof i),er(null)),i instanceof Error&&!(i.message in Pr)&&(Pr[i.message]=!0,er(s),_("Failed %s type: %s",a,i.message),er(null))}}}var on=Array.isArray;function pr(r){return on(r)}function sn(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,a=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return a}}function un(r){try{return Dr(r),!1}catch{return!0}}function Dr(r){return""+r}function Ar(r){if(un(r))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",sn(r)),Dr(r)}var q=c.ReactCurrentOwner,ln={key:!0,ref:!0,__self:!0,__source:!0},Fr,Lr,gr;gr={};function cn(r){if(X.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function fn(r){if(X.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function dn(r,n){if(typeof r.ref=="string"&&q.current&&n&&q.current.stateNode!==n){var a=v(q.current.type);gr[a]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',v(q.current.type),r.ref),gr[a]=!0)}}function pn(r,n){{var a=function(){Fr||(Fr=!0,_("%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://reactjs.org/link/special-props)",n))};a.isReactWarning=!0,Object.defineProperty(r,"key",{get:a,configurable:!0})}}function gn(r,n){{var a=function(){Lr||(Lr=!0,_("%s: `ref` 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://reactjs.org/link/special-props)",n))};a.isReactWarning=!0,Object.defineProperty(r,"ref",{get:a,configurable:!0})}}var vn=function(r,n,a,e,s,f,o){var i={$$typeof:u,type:r,key:n,ref:a,props:o,_owner:f};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:e}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function hn(r,n,a,e,s){{var f,o={},i=null,T=null;a!==void 0&&(Ar(a),i=""+a),fn(n)&&(Ar(n.key),i=""+n.key),cn(n)&&(T=n.ref,dn(n,s));for(f in n)X.call(n,f)&&!ln.hasOwnProperty(f)&&(o[f]=n[f]);if(r&&r.defaultProps){var h=r.defaultProps;for(f in h)o[f]===void 0&&(o[f]=h[f])}if(i||T){var b=typeof r=="function"?r.displayName||r.name||"Unknown":r;i&&pn(o,b),T&&gn(o,b)}return vn(r,i,T,s,e,q.current,o)}}var vr=c.ReactCurrentOwner,Vr=c.ReactDebugCurrentFrame;function M(r){if(r){var n=r._owner,a=ar(r.type,r._source,n?n.type:null);Vr.setExtraStackFrame(a)}else Vr.setExtraStackFrame(null)}var hr;hr=!1;function br(r){return typeof r=="object"&&r!==null&&r.$$typeof===u}function Nr(){{if(vr.current){var r=v(vr.current.type);if(r)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+r+"`."}return""}}function bn(r){{if(r!==void 0){var n=r.fileName.replace(/^.*[\\\/]/,""),a=r.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+n+":"+a+"."}return""}}var Wr={};function yn(r){{var n=Nr();if(!n){var a=typeof r=="string"?r:r.displayName||r.name;a&&(n=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+a+">.")}return n}}function Yr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var a=yn(n);if(Wr[a])return;Wr[a]=!0;var e="";r&&r._owner&&r._owner!==
|
|
27
|
+
Check the top-level render call using <`+a+">.")}return n}}function Yr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var a=yn(n);if(Wr[a])return;Wr[a]=!0;var e="";r&&r._owner&&r._owner!==vr.current&&(e=" It was passed a child from "+v(r._owner.type)+"."),M(r),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,e),M(null)}}function zr(r,n){{if(typeof r!="object")return;if(pr(r))for(var a=0;a<r.length;a++){var e=r[a];br(e)&&Yr(e,n)}else if(br(r))r._store&&(r._store.validated=!0);else if(r){var s=or(r);if(typeof s=="function"&&s!==r.entries)for(var f=s.call(r),o;!(o=f.next()).done;)br(o.value)&&Yr(o.value,n)}}}function mn(r){{var n=r.type;if(n==null||typeof n=="string")return;var a;if(typeof n=="function")a=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===l||n.$$typeof===R))a=n.propTypes;else return;if(a){var e=v(n);tn(a,r.props,"prop",e,r)}else if(n.PropTypes!==void 0&&!hr){hr=!0;var s=v(n);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xn(r){{for(var n=Object.keys(r.props),a=0;a<n.length;a++){var e=n[a];if(e!=="children"&&e!=="key"){M(r),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",e),M(null);break}}r.ref!==null&&(M(r),_("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}var Ur={};function Br(r,n,a,e,s,f){{var o=ur(r);if(!o){var i="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=bn(s);T?i+=T:i+=Nr();var h;r===null?h="null":pr(r)?h="array":r!==void 0&&r.$$typeof===u?(h="<"+(v(r.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):h=typeof r,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,i)}var b=hn(r,n,a,s,f);if(b==null)return b;if(o){var I=n.children;if(I!==void 0)if(e)if(pr(I)){for(var K=0;K<I.length;K++)zr(I[K],r);Object.freeze&&Object.freeze(I)}else _("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 zr(I,r)}if(X.call(n,"key")){var Y=v(r),k=Object.keys(n).filter(function(Sn){return Sn!=="key"}),yr=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!Ur[Y+yr]){var Cn=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,yr,Y,Cn,Y),Ur[Y+yr]=!0}}return r===
|
|
32
|
+
<%s key={someKey} {...props} />`,yr,Y,Cn,Y),Ur[Y+yr]=!0}}return r===E?xn(b):mn(b),b}}function En(r,n,a){return Br(r,n,a,!0)}function wn(r,n,a){return Br(r,n,a,!1)}var Rn=wn,_n=En;G.Fragment=E,G.jsx=Rn,G.jsxs=_n}()),G}process.env.NODE_ENV==="production"?tr.exports=Mr():tr.exports=Kr();var C=tr.exports;const Jr=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
33
33
|
|
|
34
34
|
* {
|
|
35
35
|
margin: 0;
|
|
@@ -48,86 +48,86 @@ React keys must be passed directly to JSX without using spread:
|
|
|
48
48
|
/* blue */
|
|
49
49
|
--starasia-ui-input-color-primary-blue: var(
|
|
50
50
|
--starasia-ui-color-blue-700,
|
|
51
|
-
#
|
|
51
|
+
#1976d2
|
|
52
52
|
);
|
|
53
53
|
--starasia-ui-input-color-secondary-blue: var(
|
|
54
54
|
--starasia-ui-color-blue-500,
|
|
55
|
-
#
|
|
55
|
+
#2196f3
|
|
56
56
|
);
|
|
57
57
|
--starasia-ui-input-color-tertiary-blue: var(
|
|
58
58
|
--starasia-ui-color-blue-300,
|
|
59
|
-
#
|
|
59
|
+
#64b5f6
|
|
60
60
|
);
|
|
61
61
|
--starasia-ui-input-color-quaternary-blue: var(
|
|
62
62
|
--starasia-ui-color-blue-100,
|
|
63
|
-
#
|
|
63
|
+
#bbdefb
|
|
64
64
|
);
|
|
65
65
|
--starasia-ui-input-color-quinary-blue: var(
|
|
66
66
|
--starasia-ui-color-blue-50,
|
|
67
|
-
#
|
|
67
|
+
#e3f2fd
|
|
68
68
|
);
|
|
69
69
|
/* gray */
|
|
70
70
|
--starasia-ui-input-color-primary-gray: var(
|
|
71
71
|
--starasia-ui-color-gray-700,
|
|
72
|
-
#
|
|
72
|
+
#48504c
|
|
73
73
|
);
|
|
74
74
|
--starasia-ui-input-color-secondary-gray: var(
|
|
75
75
|
--starasia-ui-color-gray-500,
|
|
76
|
-
#
|
|
76
|
+
#78867f
|
|
77
77
|
);
|
|
78
78
|
--starasia-ui-input-color-tertiary-gray: var(
|
|
79
79
|
--starasia-ui-color-gray-300,
|
|
80
|
-
#
|
|
80
|
+
#aeb6b2
|
|
81
81
|
);
|
|
82
82
|
--starasia-ui-input-color-quaternary-gray: var(
|
|
83
83
|
--starasia-ui-color-gray-100,
|
|
84
|
-
#
|
|
84
|
+
#eff3f8
|
|
85
85
|
);
|
|
86
86
|
--starasia-ui-input-color-quinary-gray: var(
|
|
87
87
|
--starasia-ui-color-gray-50,
|
|
88
|
-
#
|
|
88
|
+
#fffeff
|
|
89
89
|
);
|
|
90
90
|
/* red */
|
|
91
91
|
--starasia-ui-input-color-primary-red: var(
|
|
92
92
|
--starasia-ui-color-red-700,
|
|
93
|
-
#
|
|
93
|
+
#a4133c
|
|
94
94
|
);
|
|
95
95
|
--starasia-ui-input-color-secondary-red: var(
|
|
96
96
|
--starasia-ui-color-red-500,
|
|
97
|
-
#
|
|
97
|
+
#ff4d6d
|
|
98
98
|
);
|
|
99
99
|
--starasia-ui-input-color-tertiary-red: var(
|
|
100
100
|
--starasia-ui-color-red-300,
|
|
101
|
-
#
|
|
101
|
+
#ff8fa3
|
|
102
102
|
);
|
|
103
103
|
--starasia-ui-input-color-quaternary-red: var(
|
|
104
104
|
--starasia-ui-color-red-100,
|
|
105
|
-
#
|
|
105
|
+
#ffccd5
|
|
106
106
|
);
|
|
107
107
|
--starasia-ui-input-color-quinary-red: var(
|
|
108
108
|
--starasia-ui-color-red-50,
|
|
109
|
-
#
|
|
109
|
+
#fff0f3
|
|
110
110
|
);
|
|
111
|
-
/*
|
|
112
|
-
--starasia-ui-input-color-primary-
|
|
113
|
-
--starasia-ui-color-
|
|
114
|
-
#
|
|
111
|
+
/* orange */
|
|
112
|
+
--starasia-ui-input-color-primary-orange: var(
|
|
113
|
+
--starasia-ui-color-orange-700,
|
|
114
|
+
#986800
|
|
115
115
|
);
|
|
116
|
-
--starasia-ui-input-color-secondary-
|
|
117
|
-
--starasia-ui-color-
|
|
118
|
-
#
|
|
116
|
+
--starasia-ui-input-color-secondary-orange: var(
|
|
117
|
+
--starasia-ui-color-orange-500,
|
|
118
|
+
#d2a03a
|
|
119
119
|
);
|
|
120
|
-
--starasia-ui-input-color-tertiary-
|
|
121
|
-
--starasia-ui-color-
|
|
122
|
-
#
|
|
120
|
+
--starasia-ui-input-color-tertiary-orange: var(
|
|
121
|
+
--starasia-ui-color-orange-300,
|
|
122
|
+
#ffcb69
|
|
123
123
|
);
|
|
124
|
-
--starasia-ui-input-color-quaternary-
|
|
125
|
-
--starasia-ui-color-
|
|
126
|
-
#
|
|
124
|
+
--starasia-ui-input-color-quaternary-orange: var(
|
|
125
|
+
--starasia-ui-color-orange-100,
|
|
126
|
+
#fff5c1
|
|
127
127
|
);
|
|
128
|
-
--starasia-ui-input-color-quinary-
|
|
129
|
-
--starasia-ui-color-
|
|
130
|
-
#
|
|
128
|
+
--starasia-ui-input-color-quinary-orange: var(
|
|
129
|
+
--starasia-ui-color-orange-50,
|
|
130
|
+
#faf6e0
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
/* text color */
|
|
@@ -207,16 +207,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
.starasia-input-outline.starasia-input-container-warning {
|
|
210
|
-
border-color: var(--starasia-ui-input-color-secondary-
|
|
210
|
+
border-color: var(--starasia-ui-input-color-secondary-orange) !important;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
.starasia-input-filled.starasia-input-container-warning {
|
|
214
|
-
border-color: var(--starasia-ui-input-color-secondary-
|
|
215
|
-
background-color: var(--starasia-ui-input-color-quinary-
|
|
214
|
+
border-color: var(--starasia-ui-input-color-secondary-orange) !important;
|
|
215
|
+
background-color: var(--starasia-ui-input-color-quinary-orange);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
.starasia-input-flushed.starasia-input-container-warning {
|
|
219
|
-
border-color: var(--starasia-ui-input-color-secondary-
|
|
219
|
+
border-color: var(--starasia-ui-input-color-secondary-orange) !important;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
.starasia-input-outline {
|
|
@@ -368,4 +368,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
368
368
|
color: var(--starasia-ui-input-placeholder-color);
|
|
369
369
|
font-weight: var(--starasia-ui-fontWeights-normal, 300);
|
|
370
370
|
}
|
|
371
|
-
`,
|
|
371
|
+
`,Er=t=>{if(t==="sm")return 16;if(t==="md")return 16;if(t==="lg")return 20},wr=t=>t==="default"?"#939E99":t==="error"?"#EF4444":t==="warning"?"#EAB308":"#939E99",Rr=t=>t==="default"?"#939E99":t==="error"?"#EF4444":t==="warning"?"#EAB308":"#939E99",Gr=d.forwardRef(({options:t,value:u,setValue:y,isComponentVisible:E,onOptionChange:w},p)=>{const[F,D]=d.useState([]),l=d.useRef(null),S=()=>{if(p!=null&&p.current&&l.current){const g=window.innerHeight,R=p==null?void 0:p.current.getBoundingClientRect(),j=l.current.getBoundingClientRect(),A=R.bottom+j.height;l.current.style.left=`${R.left}px`,l.current.style.width=`${R.width}px`,A>=g-10?l.current.style.top=`${R.top-j.height-5}px`:l.current.style.top=`${R.top+R.height}px`}};return d.useEffect(()=>(window.addEventListener("scroll",S),window.addEventListener("resize",S),()=>{window.removeEventListener("scroll",S),window.removeEventListener("resize",S)}),[p,l]),d.useEffect(()=>{S()},[E]),d.useEffect(()=>{D((t==null?void 0:t.filter(g=>g.toLowerCase().startsWith(u.toLowerCase())))||[])},[u,t]),C.jsx("div",{ref:l,style:{position:"fixed",padding:"8px",boxSizing:"border-box",boxShadow:"0px 8px 12px 0px rgba(0, 0, 0, 0.08)",borderRadius:"8px",background:"white",overflow:"auto",zIndex:5e4},children:F==null?void 0:F.map(g=>Hr(g,u,y,w))})}),Hr=(t,u,y,E)=>{const w=t.toLowerCase().indexOf(u.toLowerCase());return C.jsxs("p",{style:{fontFamily:"Poppins",color:"#c9cecc",fontWeight:500,padding:"8px 14px",cursor:"pointer"},onClick:()=>{y(t),E&&E(t)},children:[t.slice(0,w),C.jsx("span",{style:{color:"#374151"},children:t.slice(w,w+u.length)}),t.slice(w+u.length)]})};function Xr(t){const[u,y]=d.useState(t),E=d.useRef(null),w=p=>{E.current&&!E.current.contains(p.target)&&y(!1)};return d.useEffect(()=>(document.addEventListener("click",w,!0),()=>{document.removeEventListener("click",w,!0)}),[]),{ref:E,isComponentVisible:u,setIsComponentVisible:y}}const _r="starasia-input-styles";(t=>{if(!document.getElementById(_r)){const u=document.createElement("style");u.id=_r,u.textContent=t,document.head.appendChild(u)}})(Jr);function qr(t){return Number(t.replace(/\./g,""))}const ir=t=>{let u=t.replace(/[^\d]/g,"");return u=u.replace(/^0+(?=\d)/,""),u.replace(/\B(?=(\d{3})+(?!\d))/g,".")},Zr=d.forwardRef((t,u)=>{const{leftIcon:y,rightIcon:E,size:w="md",status:p="default",inputUse:F="icon",variant:D="outline",leftAddons:l,rightAddons:S,onClickLeftIcon:g,onClickRightIcon:R,highlightPlaceholder:j,currency:A,fullWidth:Z=!1,options:z,onOptionChange:or,...c}=t;{const[_,U]=d.useState(!0),[L,B]=d.useState(""),[sr,Q]=d.useState(""),{isComponentVisible:$,ref:H,setIsComponentVisible:ur}=Xr(!1),lr=()=>{ur(m=>!m)};return d.useEffect(()=>{typeof c.value=="string"&&c.value.length||c.defaultValue||typeof c.value=="number"?U(!1):U(!0)},[c.value,c.defaultValue]),d.useEffect(()=>{B(A?ir(String(c.value)):c.value||"")},[c]),C.jsxs("div",{className:`starasia-input-container starasia-input-${D} starasia-input-container-${p} ${w} `,style:{width:Z?"auto":"max-content",position:"relative"},ref:H,onClick:lr,children:[l?C.jsx("div",{className:"starasia-input-container-addons-left",children:l}):null,y?C.jsx("div",{className:"starasia-input-container-icon-left",children:d.cloneElement(y,{width:Er(w),color:wr(c.disabled?"disable":p),onClick:g,style:{color:`${wr(c.disabled?"disable":p)}`}})}):null,C.jsxs("div",{className:"starasia-input-preview-container",children:[C.jsx("input",{className:"starasia-input",...c,placeholder:"",disabled:p==="disable"?!0:c.disabled,ref:u,onChange:m=>{let v=A?ir(m.target.value):m.target.value;const x=m.target.selectionStart;if(A)if(sr==="Backspace")if(typeof x=="number"&&L[x]==="."){let O=v.slice(0,x-1),V=v.slice(x,v.length);v=ir(O+V);const P=L.length-1,W=v.length-1;setTimeout(()=>m.target.setSelectionRange(x-(P-W)<0?0:x-(P-W),x-(P-W)<0?0:x-(P-W)),0)}else{const O=L.length-1,V=v.length-1;let P=x+1-(O-V);setTimeout(()=>m.target.setSelectionRange(P<0?0:P,P<0?0:P),0)}else{const O=L.length-1,V=v.length-1;setTimeout(()=>m.target.setSelectionRange(x+(V-O)-1,x+(V-O)-1),0)}B(v),m.target.value?U(!1):U(!0),c.onChange&&c.onChange({...m,target:{...m.target,value:A?String(qr(v)):v,name:m.target.name}}),Q("")},value:L,onKeyDown:m=>{m.key==="Backspace"&&Q(m.key),c.onKeyDown&&c.onKeyDown(m)}}),_?Qr(c.placeholder,j):null]}),E?C.jsx("div",{className:"starasia-input-container-icon-right",children:d.cloneElement(E,{width:Er(w),color:Rr(c.disabled?"disable":p),onClick:R,style:{color:`${Rr(c.disabled?"disable":p)}`}})}):null,S?C.jsx("div",{className:"starasia-input-container-addons-right",children:S}):null,L&&$&&(z!=null&&z.length)?C.jsx(Gr,{options:z,value:L,setValue:B,ref:H,isComponentVisible:$,onOptionChange:or}):null]})}}),Qr=(t,u)=>{if(!t||!u)return C.jsx("p",{className:"starasia-input-placeholder",children:t||""});const y=t.toLowerCase().indexOf(u.toLowerCase());return y===-1?C.jsx("p",{className:"starasia-input-placeholder",children:t}):C.jsxs("p",{className:"starasia-input-placeholder",children:[t.slice(0,y),C.jsx("span",{className:"starasia-input-placeholder-highlighted",children:t.slice(y,y+u.length)}),t.slice(y+u.length)]})};N.Input=Zr,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/input",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "input component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/input.umd.js",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=18.0.0"
|
|
24
24
|
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": ">=18.0.0 <20.0.0",
|
|
27
|
+
"react-dom": ">=18.0.0 <20.0.0"
|
|
28
|
+
},
|
|
25
29
|
"devDependencies": {
|
|
26
30
|
"@types/node": "^20.11.16",
|
|
27
31
|
"@vitejs/plugin-react": "^4.2.1",
|