@starasia/dropdown 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/dropdown.es.js +362 -304
- package/dist/dropdown.umd.js +21 -11
- package/package.json +1 -1
package/dist/dropdown.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import or, { useState as
|
|
2
|
-
var wr = { exports: {} },
|
|
1
|
+
import or, { useState as Z, useRef as H, useEffect as N, forwardRef as gn } from "react";
|
|
2
|
+
var wr = { exports: {} }, G = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,22 +12,22 @@ var wr = { exports: {} }, H = {};
|
|
|
12
12
|
var zr;
|
|
13
13
|
function bn() {
|
|
14
14
|
if (zr)
|
|
15
|
-
return
|
|
15
|
+
return G;
|
|
16
16
|
zr = 1;
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
for (
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
for (
|
|
25
|
-
|
|
26
|
-
return { $$typeof: p, type:
|
|
17
|
+
var u = or, p = Symbol.for("react.element"), x = Symbol.for("react.fragment"), k = Object.prototype.hasOwnProperty, f = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function P(R, w, C) {
|
|
19
|
+
var _, F = {}, E = null, L = null;
|
|
20
|
+
C !== void 0 && (E = "" + C), w.key !== void 0 && (E = "" + w.key), w.ref !== void 0 && (L = w.ref);
|
|
21
|
+
for (_ in w)
|
|
22
|
+
k.call(w, _) && !g.hasOwnProperty(_) && (F[_] = w[_]);
|
|
23
|
+
if (R && R.defaultProps)
|
|
24
|
+
for (_ in w = R.defaultProps, w)
|
|
25
|
+
F[_] === void 0 && (F[_] = w[_]);
|
|
26
|
+
return { $$typeof: p, type: R, key: E, ref: L, props: F, _owner: f.current };
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return G.Fragment = x, G.jsx = P, G.jsxs = P, G;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var X = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.development.js
|
|
@@ -40,88 +40,88 @@ var K = {};
|
|
|
40
40
|
var Nr;
|
|
41
41
|
function xn() {
|
|
42
42
|
return Nr || (Nr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var
|
|
44
|
-
function
|
|
43
|
+
var u = or, p = Symbol.for("react.element"), x = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), R = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), $ = Symbol.iterator, m = "@@iterator";
|
|
44
|
+
function o(r) {
|
|
45
45
|
if (r === null || typeof r != "object")
|
|
46
46
|
return null;
|
|
47
|
-
var n =
|
|
47
|
+
var n = $ && r[$] || r[m];
|
|
48
48
|
return typeof n == "function" ? n : null;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
50
|
+
var v = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function l(r) {
|
|
52
52
|
{
|
|
53
53
|
for (var n = arguments.length, e = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
|
|
54
54
|
e[a - 1] = arguments[a];
|
|
55
|
-
|
|
55
|
+
h("error", r, e);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function h(r, n, e) {
|
|
59
59
|
{
|
|
60
|
-
var a =
|
|
60
|
+
var a = v.ReactDebugCurrentFrame, d = a.getStackAddendum();
|
|
61
61
|
d !== "" && (n += "%s", e = e.concat([d]));
|
|
62
|
-
var
|
|
62
|
+
var c = e.map(function(s) {
|
|
63
63
|
return String(s);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
c.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, c);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var j = !1, z = !1, B = !1, ir = !1, Q = !1, rr;
|
|
69
69
|
rr = Symbol.for("react.module.reference");
|
|
70
|
-
function
|
|
71
|
-
return !!(typeof r == "string" || typeof r == "function" || r ===
|
|
70
|
+
function Y(r) {
|
|
71
|
+
return !!(typeof r == "string" || typeof r == "function" || r === k || r === g || Q || r === f || r === C || r === _ || ir || r === L || j || z || B || typeof r == "object" && r !== null && (r.$$typeof === E || r.$$typeof === F || r.$$typeof === P || r.$$typeof === R || r.$$typeof === w || // 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.
|
|
75
75
|
r.$$typeof === rr || r.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function T(r, n, e) {
|
|
78
78
|
var a = r.displayName;
|
|
79
79
|
if (a)
|
|
80
80
|
return a;
|
|
81
81
|
var d = n.displayName || n.name || "";
|
|
82
82
|
return d !== "" ? e + "(" + d + ")" : e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function O(r) {
|
|
85
85
|
return r.displayName || "Context";
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function D(r) {
|
|
88
88
|
if (r == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof r.tag == "number" &&
|
|
90
|
+
if (typeof r.tag == "number" && l("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
91
91
|
return r.displayName || r.name || null;
|
|
92
92
|
if (typeof r == "string")
|
|
93
93
|
return r;
|
|
94
94
|
switch (r) {
|
|
95
|
-
case
|
|
95
|
+
case k:
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case x:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case g:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case f:
|
|
102
102
|
return "StrictMode";
|
|
103
|
-
case
|
|
103
|
+
case C:
|
|
104
104
|
return "Suspense";
|
|
105
|
-
case
|
|
105
|
+
case _:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
108
|
if (typeof r == "object")
|
|
109
109
|
switch (r.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case R:
|
|
111
111
|
var n = r;
|
|
112
|
-
return
|
|
113
|
-
case
|
|
112
|
+
return O(n) + ".Consumer";
|
|
113
|
+
case P:
|
|
114
114
|
var e = r;
|
|
115
|
-
return
|
|
116
|
-
case
|
|
117
|
-
return
|
|
118
|
-
case
|
|
115
|
+
return O(e._context) + ".Provider";
|
|
116
|
+
case w:
|
|
117
|
+
return T(r, r.render, "ForwardRef");
|
|
118
|
+
case F:
|
|
119
119
|
var a = r.displayName || null;
|
|
120
|
-
return a !== null ? a :
|
|
121
|
-
case
|
|
122
|
-
var d = r,
|
|
120
|
+
return a !== null ? a : D(r.type) || "Memo";
|
|
121
|
+
case E: {
|
|
122
|
+
var d = r, c = d._payload, s = d._init;
|
|
123
123
|
try {
|
|
124
|
-
return
|
|
124
|
+
return D(s(c));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -129,13 +129,13 @@ function xn() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var S = Object.assign, M = 0, gr, br, xr, mr, yr, kr, Er;
|
|
133
133
|
function Rr() {
|
|
134
134
|
}
|
|
135
135
|
Rr.__reactDisabledLog = !0;
|
|
136
136
|
function Mr() {
|
|
137
137
|
{
|
|
138
|
-
if (
|
|
138
|
+
if (M === 0) {
|
|
139
139
|
gr = console.log, br = console.info, xr = console.warn, mr = console.error, yr = console.group, kr = console.groupCollapsed, Er = console.groupEnd;
|
|
140
140
|
var r = {
|
|
141
141
|
configurable: !0,
|
|
@@ -153,45 +153,45 @@ function xn() {
|
|
|
153
153
|
groupEnd: r
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
M++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
function Vr() {
|
|
160
160
|
{
|
|
161
|
-
if (
|
|
161
|
+
if (M--, M === 0) {
|
|
162
162
|
var r = {
|
|
163
163
|
configurable: !0,
|
|
164
164
|
enumerable: !0,
|
|
165
165
|
writable: !0
|
|
166
166
|
};
|
|
167
167
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
168
|
+
log: S({}, r, {
|
|
169
169
|
value: gr
|
|
170
170
|
}),
|
|
171
|
-
info:
|
|
171
|
+
info: S({}, r, {
|
|
172
172
|
value: br
|
|
173
173
|
}),
|
|
174
|
-
warn:
|
|
174
|
+
warn: S({}, r, {
|
|
175
175
|
value: xr
|
|
176
176
|
}),
|
|
177
|
-
error:
|
|
177
|
+
error: S({}, r, {
|
|
178
178
|
value: mr
|
|
179
179
|
}),
|
|
180
|
-
group:
|
|
180
|
+
group: S({}, r, {
|
|
181
181
|
value: yr
|
|
182
182
|
}),
|
|
183
|
-
groupCollapsed:
|
|
183
|
+
groupCollapsed: S({}, r, {
|
|
184
184
|
value: kr
|
|
185
185
|
}),
|
|
186
|
-
groupEnd:
|
|
186
|
+
groupEnd: S({}, r, {
|
|
187
187
|
value: Er
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
M < 0 && l("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
var sr =
|
|
194
|
+
var sr = v.ReactCurrentDispatcher, dr;
|
|
195
195
|
function nr(r, n, e) {
|
|
196
196
|
{
|
|
197
197
|
if (dr === void 0)
|
|
@@ -222,8 +222,8 @@ function xn() {
|
|
|
222
222
|
lr = !0;
|
|
223
223
|
var d = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var c;
|
|
226
|
+
c = sr.current, sr.current = null, Mr();
|
|
227
227
|
try {
|
|
228
228
|
if (n) {
|
|
229
229
|
var s = function() {
|
|
@@ -236,55 +236,55 @@ function xn() {
|
|
|
236
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
237
|
try {
|
|
238
238
|
Reflect.construct(s, []);
|
|
239
|
-
} catch (
|
|
240
|
-
a =
|
|
239
|
+
} catch (A) {
|
|
240
|
+
a = A;
|
|
241
241
|
}
|
|
242
242
|
Reflect.construct(r, [], s);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
245
|
s.call();
|
|
246
|
-
} catch (
|
|
247
|
-
a =
|
|
246
|
+
} catch (A) {
|
|
247
|
+
a = A;
|
|
248
248
|
}
|
|
249
249
|
r.call(s.prototype);
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
|
-
} catch (
|
|
255
|
-
a =
|
|
254
|
+
} catch (A) {
|
|
255
|
+
a = A;
|
|
256
256
|
}
|
|
257
257
|
r();
|
|
258
258
|
}
|
|
259
|
-
} catch (
|
|
260
|
-
if (
|
|
261
|
-
for (var i =
|
|
262
|
-
`),
|
|
263
|
-
`),
|
|
264
|
-
|
|
265
|
-
for (;
|
|
266
|
-
if (i[
|
|
267
|
-
if (
|
|
259
|
+
} catch (A) {
|
|
260
|
+
if (A && a && typeof A.stack == "string") {
|
|
261
|
+
for (var i = A.stack.split(`
|
|
262
|
+
`), I = a.stack.split(`
|
|
263
|
+
`), b = i.length - 1, y = I.length - 1; b >= 1 && y >= 0 && i[b] !== I[y]; )
|
|
264
|
+
y--;
|
|
265
|
+
for (; b >= 1 && y >= 0; b--, y--)
|
|
266
|
+
if (i[b] !== I[y]) {
|
|
267
|
+
if (b !== 1 || y !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
271
|
-
` + i[
|
|
272
|
-
return r.displayName &&
|
|
269
|
+
if (b--, y--, y < 0 || i[b] !== I[y]) {
|
|
270
|
+
var W = `
|
|
271
|
+
` + i[b].replace(" at new ", " at ");
|
|
272
|
+
return r.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", r.displayName)), typeof r == "function" && er.set(r, W), W;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (b >= 1 && y >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
lr = !1, sr.current =
|
|
279
|
+
lr = !1, sr.current = c, Vr(), Error.prepareStackTrace = d;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
282
|
-
return typeof r == "function" && er.set(r,
|
|
281
|
+
var q = r ? r.displayName || r.name : "", V = q ? nr(q) : "";
|
|
282
|
+
return typeof r == "function" && er.set(r, V), V;
|
|
283
283
|
}
|
|
284
284
|
function qr(r, n, e) {
|
|
285
285
|
return _r(r, !1);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Hr(r) {
|
|
288
288
|
var n = r.prototype;
|
|
289
289
|
return !!(n && n.isReactComponent);
|
|
290
290
|
}
|
|
@@ -292,32 +292,32 @@ function xn() {
|
|
|
292
292
|
if (r == null)
|
|
293
293
|
return "";
|
|
294
294
|
if (typeof r == "function")
|
|
295
|
-
return _r(r,
|
|
295
|
+
return _r(r, Hr(r));
|
|
296
296
|
if (typeof r == "string")
|
|
297
297
|
return nr(r);
|
|
298
298
|
switch (r) {
|
|
299
|
-
case
|
|
299
|
+
case C:
|
|
300
300
|
return nr("Suspense");
|
|
301
|
-
case
|
|
301
|
+
case _:
|
|
302
302
|
return nr("SuspenseList");
|
|
303
303
|
}
|
|
304
304
|
if (typeof r == "object")
|
|
305
305
|
switch (r.$$typeof) {
|
|
306
|
-
case
|
|
306
|
+
case w:
|
|
307
307
|
return qr(r.render);
|
|
308
|
-
case
|
|
308
|
+
case F:
|
|
309
309
|
return ar(r.type, n, e);
|
|
310
|
-
case
|
|
311
|
-
var a = r, d = a._payload,
|
|
310
|
+
case E: {
|
|
311
|
+
var a = r, d = a._payload, c = a._init;
|
|
312
312
|
try {
|
|
313
|
-
return ar(
|
|
313
|
+
return ar(c(d), n, e);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
|
-
var
|
|
320
|
+
var J = Object.prototype.hasOwnProperty, jr = {}, Cr = v.ReactDebugCurrentFrame;
|
|
321
321
|
function tr(r) {
|
|
322
322
|
if (r) {
|
|
323
323
|
var n = r._owner, e = ar(r.type, r._source, n ? n.type : null);
|
|
@@ -325,22 +325,22 @@ function xn() {
|
|
|
325
325
|
} else
|
|
326
326
|
Cr.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Jr(r, n, e, a, d) {
|
|
329
329
|
{
|
|
330
|
-
var
|
|
330
|
+
var c = Function.call.bind(J);
|
|
331
331
|
for (var s in r)
|
|
332
|
-
if (
|
|
332
|
+
if (c(r, s)) {
|
|
333
333
|
var i = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof r[s] != "function") {
|
|
336
|
-
var
|
|
337
|
-
throw
|
|
336
|
+
var I = Error((a || "React class") + ": " + e + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
+
throw I.name = "Invariant Violation", I;
|
|
338
338
|
}
|
|
339
339
|
i = r[s](n, s, a, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (
|
|
341
|
-
i =
|
|
340
|
+
} catch (b) {
|
|
341
|
+
i = b;
|
|
342
342
|
}
|
|
343
|
-
i && !(i instanceof Error) && (tr(d),
|
|
343
|
+
i && !(i instanceof Error) && (tr(d), l("%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).", a || "React class", e, s, typeof i), tr(null)), i instanceof Error && !(i.message in jr) && (jr[i.message] = !0, tr(d), l("Failed %s type: %s", e, i.message), tr(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -356,19 +356,19 @@ function xn() {
|
|
|
356
356
|
}
|
|
357
357
|
function Xr(r) {
|
|
358
358
|
try {
|
|
359
|
-
return
|
|
359
|
+
return Tr(r), !1;
|
|
360
360
|
} catch {
|
|
361
361
|
return !0;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Tr(r) {
|
|
365
365
|
return "" + r;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Or(r) {
|
|
368
368
|
if (Xr(r))
|
|
369
|
-
return
|
|
369
|
+
return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Gr(r)), Tr(r);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var K = v.ReactCurrentOwner, Zr = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
@@ -376,7 +376,7 @@ function xn() {
|
|
|
376
376
|
}, Sr, Pr, ur;
|
|
377
377
|
ur = {};
|
|
378
378
|
function Qr(r) {
|
|
379
|
-
if (
|
|
379
|
+
if (J.call(r, "ref")) {
|
|
380
380
|
var n = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
381
381
|
if (n && n.isReactWarning)
|
|
382
382
|
return !1;
|
|
@@ -384,7 +384,7 @@ function xn() {
|
|
|
384
384
|
return r.ref !== void 0;
|
|
385
385
|
}
|
|
386
386
|
function rn(r) {
|
|
387
|
-
if (
|
|
387
|
+
if (J.call(r, "key")) {
|
|
388
388
|
var n = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
389
389
|
if (n && n.isReactWarning)
|
|
390
390
|
return !1;
|
|
@@ -392,15 +392,15 @@ function xn() {
|
|
|
392
392
|
return r.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function nn(r, n) {
|
|
395
|
-
if (typeof r.ref == "string" &&
|
|
396
|
-
var e =
|
|
397
|
-
ur[e] || (
|
|
395
|
+
if (typeof r.ref == "string" && K.current && n && K.current.stateNode !== n) {
|
|
396
|
+
var e = D(K.current.type);
|
|
397
|
+
ur[e] || (l('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', D(K.current.type), r.ref), ur[e] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function en(r, n) {
|
|
401
401
|
{
|
|
402
402
|
var e = function() {
|
|
403
|
-
Sr || (Sr = !0,
|
|
403
|
+
Sr || (Sr = !0, l("%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));
|
|
404
404
|
};
|
|
405
405
|
e.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
406
406
|
get: e,
|
|
@@ -411,7 +411,7 @@ function xn() {
|
|
|
411
411
|
function an(r, n) {
|
|
412
412
|
{
|
|
413
413
|
var e = function() {
|
|
414
|
-
Pr || (Pr = !0,
|
|
414
|
+
Pr || (Pr = !0, l("%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));
|
|
415
415
|
};
|
|
416
416
|
e.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
417
417
|
get: e,
|
|
@@ -419,7 +419,7 @@ function xn() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var tn = function(r, n, e, a, d,
|
|
422
|
+
var tn = function(r, n, e, a, d, c, s) {
|
|
423
423
|
var i = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: p,
|
|
@@ -429,7 +429,7 @@ function xn() {
|
|
|
429
429
|
ref: e,
|
|
430
430
|
props: s,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
|
-
_owner:
|
|
432
|
+
_owner: c
|
|
433
433
|
};
|
|
434
434
|
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
@@ -450,24 +450,24 @@ function xn() {
|
|
|
450
450
|
};
|
|
451
451
|
function on(r, n, e, a, d) {
|
|
452
452
|
{
|
|
453
|
-
var
|
|
454
|
-
e !== void 0 && (
|
|
455
|
-
for (
|
|
456
|
-
|
|
453
|
+
var c, s = {}, i = null, I = null;
|
|
454
|
+
e !== void 0 && (Or(e), i = "" + e), rn(n) && (Or(n.key), i = "" + n.key), Qr(n) && (I = n.ref, nn(n, d));
|
|
455
|
+
for (c in n)
|
|
456
|
+
J.call(n, c) && !Zr.hasOwnProperty(c) && (s[c] = n[c]);
|
|
457
457
|
if (r && r.defaultProps) {
|
|
458
|
-
var
|
|
459
|
-
for (
|
|
460
|
-
s[
|
|
458
|
+
var b = r.defaultProps;
|
|
459
|
+
for (c in b)
|
|
460
|
+
s[c] === void 0 && (s[c] = b[c]);
|
|
461
461
|
}
|
|
462
|
-
if (i ||
|
|
463
|
-
var
|
|
464
|
-
i && en(s,
|
|
462
|
+
if (i || I) {
|
|
463
|
+
var y = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
464
|
+
i && en(s, y), I && an(s, y);
|
|
465
465
|
}
|
|
466
|
-
return tn(r, i,
|
|
466
|
+
return tn(r, i, I, d, a, K.current, s);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
var pr =
|
|
470
|
-
function
|
|
469
|
+
var pr = v.ReactCurrentOwner, Ir = v.ReactDebugCurrentFrame;
|
|
470
|
+
function U(r) {
|
|
471
471
|
if (r) {
|
|
472
472
|
var n = r._owner, e = ar(r.type, r._source, n ? n.type : null);
|
|
473
473
|
Ir.setExtraStackFrame(e);
|
|
@@ -479,10 +479,10 @@ function xn() {
|
|
|
479
479
|
function vr(r) {
|
|
480
480
|
return typeof r == "object" && r !== null && r.$$typeof === p;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Dr() {
|
|
483
483
|
{
|
|
484
484
|
if (pr.current) {
|
|
485
|
-
var r =
|
|
485
|
+
var r = D(pr.current.type);
|
|
486
486
|
if (r)
|
|
487
487
|
return `
|
|
488
488
|
|
|
@@ -505,7 +505,7 @@ Check your code at ` + n + ":" + e + ".";
|
|
|
505
505
|
var Ar = {};
|
|
506
506
|
function dn(r) {
|
|
507
507
|
{
|
|
508
|
-
var n =
|
|
508
|
+
var n = Dr();
|
|
509
509
|
if (!n) {
|
|
510
510
|
var e = typeof r == "string" ? r : r.displayName || r.name;
|
|
511
511
|
e && (n = `
|
|
@@ -515,7 +515,7 @@ Check the top-level render call using <` + e + ">.");
|
|
|
515
515
|
return n;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Fr(r, n) {
|
|
519
519
|
{
|
|
520
520
|
if (!r._store || r._store.validated || r.key != null)
|
|
521
521
|
return;
|
|
@@ -525,25 +525,25 @@ Check the top-level render call using <` + e + ">.");
|
|
|
525
525
|
return;
|
|
526
526
|
Ar[e] = !0;
|
|
527
527
|
var a = "";
|
|
528
|
-
r && r._owner && r._owner !== pr.current && (a = " It was passed a child from " +
|
|
528
|
+
r && r._owner && r._owner !== pr.current && (a = " It was passed a child from " + D(r._owner.type) + "."), U(r), l('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', e, a), U(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function $r(r, n) {
|
|
532
532
|
{
|
|
533
533
|
if (typeof r != "object")
|
|
534
534
|
return;
|
|
535
535
|
if (cr(r))
|
|
536
536
|
for (var e = 0; e < r.length; e++) {
|
|
537
537
|
var a = r[e];
|
|
538
|
-
vr(a) &&
|
|
538
|
+
vr(a) && Fr(a, n);
|
|
539
539
|
}
|
|
540
540
|
else if (vr(r))
|
|
541
541
|
r._store && (r._store.validated = !0);
|
|
542
542
|
else if (r) {
|
|
543
|
-
var d =
|
|
543
|
+
var d = o(r);
|
|
544
544
|
if (typeof d == "function" && d !== r.entries)
|
|
545
|
-
for (var
|
|
546
|
-
vr(s.value) &&
|
|
545
|
+
for (var c = d.call(r), s; !(s = c.next()).done; )
|
|
546
|
+
vr(s.value) && Fr(s.value, n);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -555,21 +555,21 @@ Check the top-level render call using <` + e + ">.");
|
|
|
555
555
|
var e;
|
|
556
556
|
if (typeof n == "function")
|
|
557
557
|
e = n.propTypes;
|
|
558
|
-
else if (typeof n == "object" && (n.$$typeof ===
|
|
558
|
+
else if (typeof n == "object" && (n.$$typeof === w || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
|
-
n.$$typeof ===
|
|
560
|
+
n.$$typeof === F))
|
|
561
561
|
e = n.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
564
|
if (e) {
|
|
565
|
-
var a =
|
|
566
|
-
|
|
565
|
+
var a = D(n);
|
|
566
|
+
Jr(e, r.props, "prop", a, r);
|
|
567
567
|
} else if (n.PropTypes !== void 0 && !fr) {
|
|
568
568
|
fr = !0;
|
|
569
|
-
var d =
|
|
570
|
-
|
|
569
|
+
var d = D(n);
|
|
570
|
+
l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved &&
|
|
572
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
function cn(r) {
|
|
@@ -577,56 +577,56 @@ Check the top-level render call using <` + e + ">.");
|
|
|
577
577
|
for (var n = Object.keys(r.props), e = 0; e < n.length; e++) {
|
|
578
578
|
var a = n[e];
|
|
579
579
|
if (a !== "children" && a !== "key") {
|
|
580
|
-
|
|
580
|
+
U(r), l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), U(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
r.ref !== null && (
|
|
584
|
+
r.ref !== null && (U(r), l("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
var
|
|
588
|
-
function Lr(r, n, e, a, d,
|
|
587
|
+
var Wr = {};
|
|
588
|
+
function Lr(r, n, e, a, d, c) {
|
|
589
589
|
{
|
|
590
|
-
var s =
|
|
590
|
+
var s = Y(r);
|
|
591
591
|
if (!s) {
|
|
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
|
|
595
|
-
|
|
596
|
-
var
|
|
597
|
-
r === null ?
|
|
594
|
+
var I = sn(d);
|
|
595
|
+
I ? i += I : i += Dr();
|
|
596
|
+
var b;
|
|
597
|
+
r === null ? b = "null" : cr(r) ? b = "array" : r !== void 0 && r.$$typeof === p ? (b = "<" + (D(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : b = typeof r, l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, i);
|
|
598
598
|
}
|
|
599
|
-
var
|
|
600
|
-
if (
|
|
601
|
-
return
|
|
599
|
+
var y = on(r, n, e, d, c);
|
|
600
|
+
if (y == null)
|
|
601
|
+
return y;
|
|
602
602
|
if (s) {
|
|
603
|
-
var
|
|
604
|
-
if (
|
|
603
|
+
var W = n.children;
|
|
604
|
+
if (W !== void 0)
|
|
605
605
|
if (a)
|
|
606
|
-
if (cr(
|
|
607
|
-
for (var
|
|
608
|
-
|
|
609
|
-
Object.freeze && Object.freeze(
|
|
606
|
+
if (cr(W)) {
|
|
607
|
+
for (var q = 0; q < W.length; q++)
|
|
608
|
+
$r(W[q], r);
|
|
609
|
+
Object.freeze && Object.freeze(W);
|
|
610
610
|
} else
|
|
611
|
-
|
|
611
|
+
l("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
612
|
else
|
|
613
|
-
|
|
613
|
+
$r(W, r);
|
|
614
614
|
}
|
|
615
|
-
if (
|
|
616
|
-
var
|
|
615
|
+
if (J.call(n, "key")) {
|
|
616
|
+
var V = D(r), A = Object.keys(n).filter(function(wn) {
|
|
617
617
|
return wn !== "key";
|
|
618
|
-
}), hr =
|
|
619
|
-
if (
|
|
620
|
-
var hn =
|
|
621
|
-
|
|
618
|
+
}), hr = A.length > 0 ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
+
if (!Wr[V + hr]) {
|
|
620
|
+
var hn = A.length > 0 ? "{" + A.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
+
l(`A props object containing a "key" prop is being spread into JSX:
|
|
622
622
|
let props = %s;
|
|
623
623
|
<%s {...props} />
|
|
624
624
|
React keys must be passed directly to JSX without using spread:
|
|
625
625
|
let props = %s;
|
|
626
|
-
<%s key={someKey} {...props} />`, hr,
|
|
626
|
+
<%s key={someKey} {...props} />`, hr, V, hn, V), Wr[V + hr] = !0;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
return r ===
|
|
629
|
+
return r === k ? cn(y) : ln(y), y;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
function un(r, n, e) {
|
|
@@ -636,8 +636,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
636
636
|
return Lr(r, n, e, !1);
|
|
637
637
|
}
|
|
638
638
|
var fn = pn, vn = un;
|
|
639
|
-
|
|
640
|
-
}()),
|
|
639
|
+
X.Fragment = k, X.jsx = fn, X.jsxs = vn;
|
|
640
|
+
}()), X;
|
|
641
641
|
}
|
|
642
642
|
process.env.NODE_ENV === "production" ? wr.exports = bn() : wr.exports = xn();
|
|
643
643
|
var t = wr.exports;
|
|
@@ -844,6 +844,12 @@ const mn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
844
844
|
white-space: nowrap; */
|
|
845
845
|
}
|
|
846
846
|
|
|
847
|
+
/* remove default focus outline when container is focused for keyboard handling */
|
|
848
|
+
.starasia-input-dropdown-lists-container:focus {
|
|
849
|
+
outline: none;
|
|
850
|
+
box-shadow: none;
|
|
851
|
+
}
|
|
852
|
+
|
|
847
853
|
.starasia-input-dropdown-lists-container-bottom {
|
|
848
854
|
top: 100%;
|
|
849
855
|
margin-top: var(--starasia-ui-dropdown-spacing-xs);
|
|
@@ -916,6 +922,10 @@ const mn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
916
922
|
/* box-shadow: 0px 0px 0px -1px #f0f0f0; */
|
|
917
923
|
}
|
|
918
924
|
|
|
925
|
+
.starasia-input-dropdwon-item.highlight {
|
|
926
|
+
background-color: rgba(100, 181, 246, 0.21);
|
|
927
|
+
}
|
|
928
|
+
|
|
919
929
|
.starasia-input-dropdwon-item-disable {
|
|
920
930
|
color: var(--starasia-ui-dropdown-color-disable) !important;
|
|
921
931
|
pointer-events: none;
|
|
@@ -1046,19 +1056,19 @@ const mn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
1046
1056
|
width: 100%;
|
|
1047
1057
|
}
|
|
1048
1058
|
`;
|
|
1049
|
-
function yn(
|
|
1050
|
-
const [p, x] =
|
|
1051
|
-
|
|
1059
|
+
function yn(u) {
|
|
1060
|
+
const [p, x] = Z(u), k = H(null), f = (g) => {
|
|
1061
|
+
k.current && !k.current.contains(g.target) && x(!1);
|
|
1052
1062
|
};
|
|
1053
|
-
return
|
|
1054
|
-
document.removeEventListener("click",
|
|
1055
|
-
}), []), { ref:
|
|
1063
|
+
return N(() => (document.addEventListener("click", f, !0), () => {
|
|
1064
|
+
document.removeEventListener("click", f, !0);
|
|
1065
|
+
}), []), { ref: k, isComponentVisible: p, setIsComponentVisible: x };
|
|
1056
1066
|
}
|
|
1057
|
-
const kn = ({ ...
|
|
1067
|
+
const kn = ({ ...u }) => /* @__PURE__ */ t.jsx(
|
|
1058
1068
|
"svg",
|
|
1059
1069
|
{
|
|
1060
1070
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1061
|
-
...
|
|
1071
|
+
...u,
|
|
1062
1072
|
viewBox: "0 0 24 24",
|
|
1063
1073
|
fill: "none",
|
|
1064
1074
|
color: "#939E99",
|
|
@@ -1073,11 +1083,11 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1073
1083
|
}
|
|
1074
1084
|
)
|
|
1075
1085
|
}
|
|
1076
|
-
), En = ({ ...
|
|
1086
|
+
), En = ({ ...u }) => /* @__PURE__ */ t.jsxs(
|
|
1077
1087
|
"svg",
|
|
1078
1088
|
{
|
|
1079
1089
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1080
|
-
...
|
|
1090
|
+
...u,
|
|
1081
1091
|
viewBox: "0 0 20 20",
|
|
1082
1092
|
fill: "none",
|
|
1083
1093
|
children: [
|
|
@@ -1105,14 +1115,14 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1105
1115
|
)
|
|
1106
1116
|
]
|
|
1107
1117
|
}
|
|
1108
|
-
), Rn = ({ isChecked:
|
|
1118
|
+
), Rn = ({ isChecked: u }) => /* @__PURE__ */ t.jsxs("div", { className: "checkbox-wrapper-30", children: [
|
|
1109
1119
|
/* @__PURE__ */ t.jsxs("span", { className: "checkbox", children: [
|
|
1110
1120
|
/* @__PURE__ */ t.jsx(
|
|
1111
1121
|
"input",
|
|
1112
1122
|
{
|
|
1113
1123
|
type: "checkbox",
|
|
1114
1124
|
style: { pointerEvents: "none" },
|
|
1115
|
-
checked:
|
|
1125
|
+
checked: u
|
|
1116
1126
|
}
|
|
1117
1127
|
),
|
|
1118
1128
|
/* @__PURE__ */ t.jsx("svg", { children: /* @__PURE__ */ t.jsx("use", { xlinkHref: "#checkbox-30", className: "checkbox" }) })
|
|
@@ -1127,42 +1137,82 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1127
1137
|
) }) })
|
|
1128
1138
|
] }), _n = gn(
|
|
1129
1139
|
({
|
|
1130
|
-
positionDropdown:
|
|
1140
|
+
positionDropdown: u,
|
|
1131
1141
|
dropdownLists: p,
|
|
1132
1142
|
isComponentVisible: x,
|
|
1133
|
-
searchAble:
|
|
1134
|
-
onSearch:
|
|
1135
|
-
value:
|
|
1136
|
-
handleChangeValue:
|
|
1137
|
-
multiSelect:
|
|
1138
|
-
searchValue:
|
|
1139
|
-
},
|
|
1140
|
-
const [
|
|
1141
|
-
return
|
|
1142
|
-
if (
|
|
1143
|
-
const o =
|
|
1144
|
-
|
|
1143
|
+
searchAble: k,
|
|
1144
|
+
onSearch: f,
|
|
1145
|
+
value: g,
|
|
1146
|
+
handleChangeValue: P,
|
|
1147
|
+
multiSelect: R,
|
|
1148
|
+
searchValue: w
|
|
1149
|
+
}, C) => {
|
|
1150
|
+
const [_, F] = Z(0), [E, L] = Z(), $ = H(null), m = H(null);
|
|
1151
|
+
return N(() => {
|
|
1152
|
+
if ($.current) {
|
|
1153
|
+
const o = $.current.getBoundingClientRect();
|
|
1154
|
+
F(o.width);
|
|
1145
1155
|
}
|
|
1146
|
-
}, [
|
|
1147
|
-
p &&
|
|
1148
|
-
if (o.label.startsWith(
|
|
1149
|
-
|
|
1156
|
+
}, [$, x]), N(() => {
|
|
1157
|
+
p && w ? p.forEach((o) => {
|
|
1158
|
+
if (o.label.startsWith(w || "")) {
|
|
1159
|
+
L(o.value);
|
|
1150
1160
|
return;
|
|
1151
1161
|
}
|
|
1152
|
-
}) :
|
|
1153
|
-
}, [
|
|
1162
|
+
}) : L(void 0);
|
|
1163
|
+
}, [w, p]), N(() => {
|
|
1164
|
+
const o = m.current || (C == null ? void 0 : C.current);
|
|
1165
|
+
if (!o || !x)
|
|
1166
|
+
return;
|
|
1167
|
+
const v = p.filter((h) => !h.disable), l = (h) => {
|
|
1168
|
+
if (h.key === "ArrowDown") {
|
|
1169
|
+
if (h.preventDefault(), !v.length)
|
|
1170
|
+
return;
|
|
1171
|
+
const j = v.findIndex((B) => B.value === E), z = j === -1 ? 0 : (j + 1) % v.length;
|
|
1172
|
+
L(v[z].value);
|
|
1173
|
+
} else if (h.key === "ArrowUp") {
|
|
1174
|
+
if (h.preventDefault(), !v.length)
|
|
1175
|
+
return;
|
|
1176
|
+
const j = v.findIndex((B) => B.value === E), z = j <= 0 ? v.length - 1 : j - 1;
|
|
1177
|
+
L(v[z].value);
|
|
1178
|
+
} else if (h.key === "Enter") {
|
|
1179
|
+
if (h.preventDefault(), !E)
|
|
1180
|
+
return;
|
|
1181
|
+
const j = p.find((z) => z.value === E);
|
|
1182
|
+
j && !j.disable && P(j.label, j.value);
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
return o.addEventListener("keydown", l), () => o.removeEventListener("keydown", l);
|
|
1186
|
+
}, [x, p, E, P, C]), N(() => {
|
|
1187
|
+
if (!E)
|
|
1188
|
+
return;
|
|
1189
|
+
const o = $.current;
|
|
1190
|
+
if (!o)
|
|
1191
|
+
return;
|
|
1192
|
+
const v = o.querySelector(`[data-value="${E}"]`);
|
|
1193
|
+
v && v.scrollIntoView && v.scrollIntoView({ block: "nearest" });
|
|
1194
|
+
}, [E]), /* @__PURE__ */ t.jsx(t.Fragment, { children: x ? /* @__PURE__ */ t.jsxs(
|
|
1154
1195
|
"div",
|
|
1155
1196
|
{
|
|
1156
1197
|
className: "starasia-input-dropdown-lists-container",
|
|
1157
1198
|
onClick: (o) => o.stopPropagation(),
|
|
1158
|
-
ref:
|
|
1199
|
+
ref: (o) => {
|
|
1200
|
+
if (m.current = o, typeof C == "function")
|
|
1201
|
+
C(o);
|
|
1202
|
+
else if (C)
|
|
1203
|
+
try {
|
|
1204
|
+
C.current = o;
|
|
1205
|
+
} catch {
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
tabIndex: 0,
|
|
1159
1209
|
children: [
|
|
1160
|
-
|
|
1210
|
+
k ? /* @__PURE__ */ t.jsxs(
|
|
1161
1211
|
"div",
|
|
1162
1212
|
{
|
|
1163
1213
|
className: "starasia-input-dropdown-container-dropdown-search",
|
|
1164
1214
|
style: {
|
|
1165
|
-
order:
|
|
1215
|
+
order: u == "bottom" ? 0 : 2,
|
|
1166
1216
|
position: "sticky",
|
|
1167
1217
|
top: 0,
|
|
1168
1218
|
bottom: 0,
|
|
@@ -1174,9 +1224,9 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1174
1224
|
"input",
|
|
1175
1225
|
{
|
|
1176
1226
|
onChange: (o) => {
|
|
1177
|
-
|
|
1227
|
+
f && f(o.target.value);
|
|
1178
1228
|
},
|
|
1179
|
-
value:
|
|
1229
|
+
value: w,
|
|
1180
1230
|
autoFocus: !0,
|
|
1181
1231
|
style: { width: "100%" }
|
|
1182
1232
|
}
|
|
@@ -1187,17 +1237,18 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1187
1237
|
/* @__PURE__ */ t.jsx(
|
|
1188
1238
|
"div",
|
|
1189
1239
|
{
|
|
1190
|
-
className: `starasia-input-dropdwon-item-container ${
|
|
1191
|
-
ref:
|
|
1192
|
-
children: p.map((o,
|
|
1193
|
-
const
|
|
1240
|
+
className: `starasia-input-dropdwon-item-container ${R ? "multi" : ""}`,
|
|
1241
|
+
ref: $,
|
|
1242
|
+
children: p.map((o, v) => {
|
|
1243
|
+
const l = !!(g != null && g.find((h) => h.value === o.value));
|
|
1194
1244
|
return /* @__PURE__ */ t.jsxs(
|
|
1195
1245
|
"div",
|
|
1196
1246
|
{
|
|
1197
|
-
|
|
1198
|
-
|
|
1247
|
+
"data-value": o.value,
|
|
1248
|
+
className: `starasia-input-dropdwon-item ${l ? "active" : " "} ${E === o.value ? "highlight" : ""} ${o.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1249
|
+
onClick: () => P(o.label, o.value),
|
|
1199
1250
|
children: [
|
|
1200
|
-
|
|
1251
|
+
R ? /* @__PURE__ */ t.jsx("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ t.jsx(Rn, { isChecked: l }) }) : null,
|
|
1201
1252
|
o.icon ? /* @__PURE__ */ t.jsx("div", { children: or.cloneElement(o.icon, {
|
|
1202
1253
|
width: 16
|
|
1203
1254
|
}) }) : null,
|
|
@@ -1205,10 +1256,10 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1205
1256
|
/* @__PURE__ */ t.jsx(
|
|
1206
1257
|
"p",
|
|
1207
1258
|
{
|
|
1208
|
-
className: `starasia-input-dropdwon-item-text ${
|
|
1259
|
+
className: `starasia-input-dropdwon-item-text ${l ? "active" : null} ${o.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1209
1260
|
style: {
|
|
1210
1261
|
textWrap: "nowrap",
|
|
1211
|
-
width: `${
|
|
1262
|
+
width: `${_ - 12}px`,
|
|
1212
1263
|
overflow: "hidden",
|
|
1213
1264
|
textOverflow: "ellipsis"
|
|
1214
1265
|
},
|
|
@@ -1218,10 +1269,10 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1218
1269
|
o.description ? /* @__PURE__ */ t.jsx(
|
|
1219
1270
|
"p",
|
|
1220
1271
|
{
|
|
1221
|
-
className: `starasia-input-dropdwon-item-text-description ${
|
|
1272
|
+
className: `starasia-input-dropdwon-item-text-description ${l ? "active" : null} ${o.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1222
1273
|
style: {
|
|
1223
1274
|
textWrap: "nowrap",
|
|
1224
|
-
width: `${
|
|
1275
|
+
width: `${_ - 12}px`,
|
|
1225
1276
|
overflow: "hidden",
|
|
1226
1277
|
textOverflow: "ellipsis"
|
|
1227
1278
|
},
|
|
@@ -1231,7 +1282,7 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1231
1282
|
] })
|
|
1232
1283
|
]
|
|
1233
1284
|
},
|
|
1234
|
-
|
|
1285
|
+
v
|
|
1235
1286
|
);
|
|
1236
1287
|
})
|
|
1237
1288
|
}
|
|
@@ -1241,98 +1292,105 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1241
1292
|
) : null });
|
|
1242
1293
|
}
|
|
1243
1294
|
), jn = ({
|
|
1244
|
-
children:
|
|
1295
|
+
children: u,
|
|
1245
1296
|
handleChangePosition: p
|
|
1246
1297
|
}) => {
|
|
1247
|
-
const x =
|
|
1248
|
-
|
|
1249
|
-
var
|
|
1250
|
-
const
|
|
1298
|
+
const x = H(null);
|
|
1299
|
+
N(() => {
|
|
1300
|
+
var P;
|
|
1301
|
+
const f = () => {
|
|
1251
1302
|
if (x.current) {
|
|
1252
|
-
let
|
|
1253
|
-
for (;
|
|
1254
|
-
|
|
1255
|
-
|
|
1303
|
+
let R = x.current.parentElement;
|
|
1304
|
+
for (; R && !k(R); )
|
|
1305
|
+
R = R.parentElement;
|
|
1306
|
+
R && p();
|
|
1256
1307
|
}
|
|
1257
1308
|
};
|
|
1258
|
-
let
|
|
1259
|
-
for (;
|
|
1260
|
-
|
|
1261
|
-
return
|
|
1262
|
-
|
|
1309
|
+
let g = (P = x.current) == null ? void 0 : P.parentElement;
|
|
1310
|
+
for (; g && !k(g); )
|
|
1311
|
+
g = g.parentElement;
|
|
1312
|
+
return g && g.addEventListener("scroll", f), f(), () => {
|
|
1313
|
+
g && g.removeEventListener("scroll", f);
|
|
1263
1314
|
};
|
|
1264
1315
|
}, []);
|
|
1265
|
-
const
|
|
1266
|
-
return /* @__PURE__ */ t.jsx("div", { ref: x, children:
|
|
1267
|
-
}, Br = "starasia-input-dropdown-styles", Cn = (
|
|
1316
|
+
const k = (f) => f && (f.scrollHeight > f.clientHeight || f.scrollWidth > f.clientWidth);
|
|
1317
|
+
return /* @__PURE__ */ t.jsx("div", { ref: x, children: u });
|
|
1318
|
+
}, Br = "starasia-input-dropdown-styles", Cn = (u) => {
|
|
1268
1319
|
if (!document.getElementById(Br)) {
|
|
1269
1320
|
const p = document.createElement("style");
|
|
1270
|
-
p.id = Br, p.textContent =
|
|
1321
|
+
p.id = Br, p.textContent = u, document.head.appendChild(p);
|
|
1271
1322
|
}
|
|
1272
1323
|
};
|
|
1273
1324
|
Cn(mn);
|
|
1274
1325
|
const Sn = ({
|
|
1275
|
-
dropdownLists:
|
|
1326
|
+
dropdownLists: u,
|
|
1276
1327
|
onChange: p,
|
|
1277
1328
|
defaultValue: x,
|
|
1278
|
-
size:
|
|
1279
|
-
multiSelect:
|
|
1280
|
-
searchAble:
|
|
1281
|
-
iconLeft:
|
|
1282
|
-
placeholder:
|
|
1283
|
-
onSearch:
|
|
1284
|
-
error:
|
|
1285
|
-
onBlur:
|
|
1286
|
-
onFocus:
|
|
1287
|
-
disable:
|
|
1288
|
-
searchValue:
|
|
1329
|
+
size: k = "md",
|
|
1330
|
+
multiSelect: f,
|
|
1331
|
+
searchAble: g,
|
|
1332
|
+
iconLeft: P,
|
|
1333
|
+
placeholder: R,
|
|
1334
|
+
onSearch: w,
|
|
1335
|
+
error: C,
|
|
1336
|
+
onBlur: _,
|
|
1337
|
+
onFocus: F,
|
|
1338
|
+
disable: E,
|
|
1339
|
+
searchValue: L
|
|
1289
1340
|
}) => {
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
}, Q = (
|
|
1293
|
-
if (!
|
|
1294
|
-
|
|
1295
|
-
else if (
|
|
1296
|
-
const
|
|
1297
|
-
...
|
|
1341
|
+
const $ = H(), [m, o] = Z([]), [v, l] = Z(""), h = H(null), { isComponentVisible: j, ref: z, setIsComponentVisible: B } = yn(!1), ir = () => {
|
|
1342
|
+
B((T) => !T);
|
|
1343
|
+
}, Q = (T, O) => {
|
|
1344
|
+
if (!f)
|
|
1345
|
+
o([{ label: T, value: O }]), p([{ label: T, value: O }]), B(!1);
|
|
1346
|
+
else if (m == null ? void 0 : m.find((S) => S.value === O)) {
|
|
1347
|
+
const S = [
|
|
1348
|
+
...m ? m.filter((M) => M.value !== O) : []
|
|
1298
1349
|
];
|
|
1299
|
-
|
|
1350
|
+
o(S), p(S);
|
|
1300
1351
|
} else {
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1352
|
+
const S = [...m || [], { label: T, value: O }];
|
|
1353
|
+
o(S), p(S);
|
|
1303
1354
|
}
|
|
1304
1355
|
};
|
|
1305
|
-
|
|
1306
|
-
JSON.stringify(
|
|
1356
|
+
N(() => {
|
|
1357
|
+
JSON.stringify($.current) === JSON.stringify(x) || ($.current = x, o($.current || []));
|
|
1307
1358
|
}, [x]);
|
|
1308
|
-
const rr = () =>
|
|
1309
|
-
/* @__PURE__ */ t.jsx("p", { style: { minWidth: "max-content" }, children:
|
|
1359
|
+
const rr = () => m.length ? f ? m == null ? void 0 : m.map((T, O) => /* @__PURE__ */ t.jsxs("div", { className: "starasia-input-dropdown-preview-item", children: [
|
|
1360
|
+
/* @__PURE__ */ t.jsx("p", { style: { minWidth: "max-content" }, children: T == null ? void 0 : T.label }, O),
|
|
1310
1361
|
/* @__PURE__ */ t.jsx(
|
|
1311
|
-
|
|
1362
|
+
Tn,
|
|
1312
1363
|
{
|
|
1313
|
-
onClick: () => Q(
|
|
1364
|
+
onClick: () => Q(T.label, T.value)
|
|
1314
1365
|
}
|
|
1315
1366
|
)
|
|
1316
|
-
] })) : /* @__PURE__ */ t.jsx("p", { style: { minWidth: "max-content" }, children:
|
|
1317
|
-
if (
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1367
|
+
] })) : /* @__PURE__ */ t.jsx("p", { style: { minWidth: "max-content" }, children: m == null ? void 0 : m[0].label }) : /* @__PURE__ */ t.jsx("p", { className: "starasia-input-dropdown-placeholder", children: R }), Y = () => {
|
|
1368
|
+
if (z.current && h.current) {
|
|
1369
|
+
const T = window.innerHeight, O = z.current.getBoundingClientRect(), D = h.current.getBoundingClientRect(), S = O.bottom + D.height;
|
|
1370
|
+
h.current.style.left = `${O.left}px`, h.current.style.width = `${O.width}px`, S >= T - 10 ? (h.current.style.top = `${O.top - D.height - 5}px`, l("top")) : (h.current.style.top = `${O.top + O.height}px`, l("bottom"));
|
|
1320
1371
|
}
|
|
1321
1372
|
};
|
|
1322
|
-
return
|
|
1323
|
-
window.removeEventListener("scroll",
|
|
1324
|
-
}), []),
|
|
1325
|
-
|
|
1326
|
-
}, [
|
|
1373
|
+
return N(() => (window.addEventListener("scroll", Y), window.addEventListener("resize", Y), () => {
|
|
1374
|
+
window.removeEventListener("scroll", Y), window.removeEventListener("resize", Y);
|
|
1375
|
+
}), []), N(() => {
|
|
1376
|
+
Y();
|
|
1377
|
+
}, [j]), N(() => {
|
|
1378
|
+
j && h.current && setTimeout(() => {
|
|
1379
|
+
try {
|
|
1380
|
+
h.current && h.current.focus();
|
|
1381
|
+
} catch {
|
|
1382
|
+
}
|
|
1383
|
+
}, 0);
|
|
1384
|
+
}, [j]), /* @__PURE__ */ t.jsx(jn, { handleChangePosition: Y, children: /* @__PURE__ */ t.jsxs(
|
|
1327
1385
|
"div",
|
|
1328
1386
|
{
|
|
1329
|
-
className: `starasia-input-dropdown-container ${
|
|
1330
|
-
ref:
|
|
1387
|
+
className: `starasia-input-dropdown-container ${E ? "disable" : ""} starasia-input-dropdown-size-${k} ${j ? "active" : ""} ${C ? "error" : ""}`,
|
|
1388
|
+
ref: z,
|
|
1331
1389
|
onClick: ir,
|
|
1332
1390
|
children: [
|
|
1333
1391
|
/* @__PURE__ */ t.jsxs("div", { className: "starasia-input-dropdown-preview-container", children: [
|
|
1334
|
-
|
|
1335
|
-
width: Yr(
|
|
1392
|
+
P ? /* @__PURE__ */ t.jsx(t.Fragment, { children: or.cloneElement(P, {
|
|
1393
|
+
width: Yr(k),
|
|
1336
1394
|
color: "#939E99",
|
|
1337
1395
|
style: {
|
|
1338
1396
|
color: "#939E99"
|
|
@@ -1343,8 +1401,8 @@ const Sn = ({
|
|
|
1343
1401
|
{
|
|
1344
1402
|
className: "starasia-input-dropdown-container-preview-item",
|
|
1345
1403
|
tabIndex: 100,
|
|
1346
|
-
onBlur:
|
|
1347
|
-
onFocus:
|
|
1404
|
+
onBlur: _,
|
|
1405
|
+
onFocus: F,
|
|
1348
1406
|
children: rr()
|
|
1349
1407
|
}
|
|
1350
1408
|
),
|
|
@@ -1352,7 +1410,7 @@ const Sn = ({
|
|
|
1352
1410
|
kn,
|
|
1353
1411
|
{
|
|
1354
1412
|
strokeWidth: 2,
|
|
1355
|
-
width: Yr(
|
|
1413
|
+
width: Yr(k),
|
|
1356
1414
|
style: { color: "#939E99" }
|
|
1357
1415
|
}
|
|
1358
1416
|
)
|
|
@@ -1360,29 +1418,29 @@ const Sn = ({
|
|
|
1360
1418
|
/* @__PURE__ */ t.jsx(
|
|
1361
1419
|
_n,
|
|
1362
1420
|
{
|
|
1363
|
-
dropdownLists:
|
|
1421
|
+
dropdownLists: u,
|
|
1364
1422
|
handleChangeValue: Q,
|
|
1365
|
-
isComponentVisible:
|
|
1366
|
-
positionDropdown:
|
|
1367
|
-
searchAble: !!
|
|
1368
|
-
value:
|
|
1369
|
-
onSearch:
|
|
1370
|
-
ref:
|
|
1371
|
-
multiSelect:
|
|
1372
|
-
searchValue:
|
|
1423
|
+
isComponentVisible: j,
|
|
1424
|
+
positionDropdown: v,
|
|
1425
|
+
searchAble: !!g,
|
|
1426
|
+
value: m,
|
|
1427
|
+
onSearch: w,
|
|
1428
|
+
ref: h,
|
|
1429
|
+
multiSelect: f,
|
|
1430
|
+
searchValue: L
|
|
1373
1431
|
}
|
|
1374
1432
|
)
|
|
1375
1433
|
]
|
|
1376
1434
|
}
|
|
1377
1435
|
) });
|
|
1378
|
-
}, Yr = (
|
|
1379
|
-
if (
|
|
1436
|
+
}, Yr = (u) => {
|
|
1437
|
+
if (u === "sm")
|
|
1380
1438
|
return 16;
|
|
1381
|
-
if (
|
|
1439
|
+
if (u === "md")
|
|
1382
1440
|
return 16;
|
|
1383
|
-
if (
|
|
1441
|
+
if (u === "lg")
|
|
1384
1442
|
return 20;
|
|
1385
|
-
},
|
|
1443
|
+
}, Tn = (u) => /* @__PURE__ */ t.jsx(
|
|
1386
1444
|
"svg",
|
|
1387
1445
|
{
|
|
1388
1446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1390,7 +1448,7 @@ const Sn = ({
|
|
|
1390
1448
|
height: "18",
|
|
1391
1449
|
viewBox: "0 0 18 18",
|
|
1392
1450
|
fill: "none",
|
|
1393
|
-
...
|
|
1451
|
+
...u,
|
|
1394
1452
|
children: /* @__PURE__ */ t.jsx(
|
|
1395
1453
|
"path",
|
|
1396
1454
|
{
|