@starasia/dropdown 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -0
- package/dist/Checkbox.d.ts +6 -0
- package/dist/Dropdown.d.ts +3 -0
- package/dist/DropdownList.d.ts +18 -0
- package/dist/ScrollAwareWrapper.d.ts +6 -0
- package/dist/dropdown.es.js +1408 -0
- package/dist/dropdown.umd.js +436 -0
- package/dist/index.d.ts +2 -0
- package/dist/interface.d.ts +31 -0
- package/dist/useComponentVisible.d.ts +5 -0
- package/package.json +37 -0
|
@@ -0,0 +1,1408 @@
|
|
|
1
|
+
import or, { useState as G, useRef as X, useEffect as B, forwardRef as gn } from "react";
|
|
2
|
+
var wr = { exports: {} }, H = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var zr;
|
|
13
|
+
function bn() {
|
|
14
|
+
if (zr)
|
|
15
|
+
return H;
|
|
16
|
+
zr = 1;
|
|
17
|
+
var c = or, p = Symbol.for("react.element"), x = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, u = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function O(m, f, F) {
|
|
19
|
+
var y, T = {}, A = null, D = null;
|
|
20
|
+
F !== void 0 && (A = "" + F), f.key !== void 0 && (A = "" + f.key), f.ref !== void 0 && (D = f.ref);
|
|
21
|
+
for (y in f)
|
|
22
|
+
b.call(f, y) && !v.hasOwnProperty(y) && (T[y] = f[y]);
|
|
23
|
+
if (m && m.defaultProps)
|
|
24
|
+
for (y in f = m.defaultProps, f)
|
|
25
|
+
T[y] === void 0 && (T[y] = f[y]);
|
|
26
|
+
return { $$typeof: p, type: m, key: A, ref: D, props: T, _owner: u.current };
|
|
27
|
+
}
|
|
28
|
+
return H.Fragment = x, H.jsx = O, H.jsxs = O, H;
|
|
29
|
+
}
|
|
30
|
+
var K = {};
|
|
31
|
+
/**
|
|
32
|
+
* @license React
|
|
33
|
+
* react-jsx-runtime.development.js
|
|
34
|
+
*
|
|
35
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
var Nr;
|
|
41
|
+
function xn() {
|
|
42
|
+
return Nr || (Nr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var c = or, p = Symbol.for("react.element"), x = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), m = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), I = Symbol.iterator, o = "@@iterator";
|
|
44
|
+
function $(r) {
|
|
45
|
+
if (r === null || typeof r != "object")
|
|
46
|
+
return null;
|
|
47
|
+
var n = I && r[I] || r[o];
|
|
48
|
+
return typeof n == "function" ? n : null;
|
|
49
|
+
}
|
|
50
|
+
var S = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function h(r) {
|
|
52
|
+
{
|
|
53
|
+
for (var n = arguments.length, e = new Array(n > 1 ? n - 1 : 0), a = 1; a < n; a++)
|
|
54
|
+
e[a - 1] = arguments[a];
|
|
55
|
+
W("error", r, e);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function W(r, n, e) {
|
|
59
|
+
{
|
|
60
|
+
var a = S.ReactDebugCurrentFrame, d = a.getStackAddendum();
|
|
61
|
+
d !== "" && (n += "%s", e = e.concat([d]));
|
|
62
|
+
var l = e.map(function(s) {
|
|
63
|
+
return String(s);
|
|
64
|
+
});
|
|
65
|
+
l.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, l);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var V = !1, U = !1, Z = !1, ir = !1, Q = !1, rr;
|
|
69
|
+
rr = Symbol.for("react.module.reference");
|
|
70
|
+
function L(r) {
|
|
71
|
+
return !!(typeof r == "string" || typeof r == "function" || r === b || r === v || Q || r === u || r === F || r === y || ir || r === D || V || U || Z || typeof r == "object" && r !== null && (r.$$typeof === A || r.$$typeof === T || r.$$typeof === O || r.$$typeof === m || r.$$typeof === f || // This needs to include all possible module reference object
|
|
72
|
+
// types supported by any Flight configuration anywhere since
|
|
73
|
+
// we don't know which Flight build this will end up being used
|
|
74
|
+
// with.
|
|
75
|
+
r.$$typeof === rr || r.getModuleId !== void 0));
|
|
76
|
+
}
|
|
77
|
+
function R(r, n, e) {
|
|
78
|
+
var a = r.displayName;
|
|
79
|
+
if (a)
|
|
80
|
+
return a;
|
|
81
|
+
var d = n.displayName || n.name || "";
|
|
82
|
+
return d !== "" ? e + "(" + d + ")" : e;
|
|
83
|
+
}
|
|
84
|
+
function k(r) {
|
|
85
|
+
return r.displayName || "Context";
|
|
86
|
+
}
|
|
87
|
+
function j(r) {
|
|
88
|
+
if (r == null)
|
|
89
|
+
return null;
|
|
90
|
+
if (typeof r.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
91
|
+
return r.displayName || r.name || null;
|
|
92
|
+
if (typeof r == "string")
|
|
93
|
+
return r;
|
|
94
|
+
switch (r) {
|
|
95
|
+
case b:
|
|
96
|
+
return "Fragment";
|
|
97
|
+
case x:
|
|
98
|
+
return "Portal";
|
|
99
|
+
case v:
|
|
100
|
+
return "Profiler";
|
|
101
|
+
case u:
|
|
102
|
+
return "StrictMode";
|
|
103
|
+
case F:
|
|
104
|
+
return "Suspense";
|
|
105
|
+
case y:
|
|
106
|
+
return "SuspenseList";
|
|
107
|
+
}
|
|
108
|
+
if (typeof r == "object")
|
|
109
|
+
switch (r.$$typeof) {
|
|
110
|
+
case m:
|
|
111
|
+
var n = r;
|
|
112
|
+
return k(n) + ".Consumer";
|
|
113
|
+
case O:
|
|
114
|
+
var e = r;
|
|
115
|
+
return k(e._context) + ".Provider";
|
|
116
|
+
case f:
|
|
117
|
+
return R(r, r.render, "ForwardRef");
|
|
118
|
+
case T:
|
|
119
|
+
var a = r.displayName || null;
|
|
120
|
+
return a !== null ? a : j(r.type) || "Memo";
|
|
121
|
+
case A: {
|
|
122
|
+
var d = r, l = d._payload, s = d._init;
|
|
123
|
+
try {
|
|
124
|
+
return j(s(l));
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var E = Object.assign, z = 0, gr, br, xr, mr, yr, kr, Er;
|
|
133
|
+
function Rr() {
|
|
134
|
+
}
|
|
135
|
+
Rr.__reactDisabledLog = !0;
|
|
136
|
+
function Mr() {
|
|
137
|
+
{
|
|
138
|
+
if (z === 0) {
|
|
139
|
+
gr = console.log, br = console.info, xr = console.warn, mr = console.error, yr = console.group, kr = console.groupCollapsed, Er = console.groupEnd;
|
|
140
|
+
var r = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
value: Rr,
|
|
144
|
+
writable: !0
|
|
145
|
+
};
|
|
146
|
+
Object.defineProperties(console, {
|
|
147
|
+
info: r,
|
|
148
|
+
log: r,
|
|
149
|
+
warn: r,
|
|
150
|
+
error: r,
|
|
151
|
+
group: r,
|
|
152
|
+
groupCollapsed: r,
|
|
153
|
+
groupEnd: r
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
z++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function Vr() {
|
|
160
|
+
{
|
|
161
|
+
if (z--, z === 0) {
|
|
162
|
+
var r = {
|
|
163
|
+
configurable: !0,
|
|
164
|
+
enumerable: !0,
|
|
165
|
+
writable: !0
|
|
166
|
+
};
|
|
167
|
+
Object.defineProperties(console, {
|
|
168
|
+
log: E({}, r, {
|
|
169
|
+
value: gr
|
|
170
|
+
}),
|
|
171
|
+
info: E({}, r, {
|
|
172
|
+
value: br
|
|
173
|
+
}),
|
|
174
|
+
warn: E({}, r, {
|
|
175
|
+
value: xr
|
|
176
|
+
}),
|
|
177
|
+
error: E({}, r, {
|
|
178
|
+
value: mr
|
|
179
|
+
}),
|
|
180
|
+
group: E({}, r, {
|
|
181
|
+
value: yr
|
|
182
|
+
}),
|
|
183
|
+
groupCollapsed: E({}, r, {
|
|
184
|
+
value: kr
|
|
185
|
+
}),
|
|
186
|
+
groupEnd: E({}, r, {
|
|
187
|
+
value: Er
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
z < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
var sr = S.ReactCurrentDispatcher, dr;
|
|
195
|
+
function nr(r, n, e) {
|
|
196
|
+
{
|
|
197
|
+
if (dr === void 0)
|
|
198
|
+
try {
|
|
199
|
+
throw Error();
|
|
200
|
+
} catch (d) {
|
|
201
|
+
var a = d.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
dr = a && a[1] || "";
|
|
203
|
+
}
|
|
204
|
+
return `
|
|
205
|
+
` + dr + r;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
var lr = !1, er;
|
|
209
|
+
{
|
|
210
|
+
var Ur = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
er = new Ur();
|
|
212
|
+
}
|
|
213
|
+
function _r(r, n) {
|
|
214
|
+
if (!r || lr)
|
|
215
|
+
return "";
|
|
216
|
+
{
|
|
217
|
+
var e = er.get(r);
|
|
218
|
+
if (e !== void 0)
|
|
219
|
+
return e;
|
|
220
|
+
}
|
|
221
|
+
var a;
|
|
222
|
+
lr = !0;
|
|
223
|
+
var d = Error.prepareStackTrace;
|
|
224
|
+
Error.prepareStackTrace = void 0;
|
|
225
|
+
var l;
|
|
226
|
+
l = sr.current, sr.current = null, Mr();
|
|
227
|
+
try {
|
|
228
|
+
if (n) {
|
|
229
|
+
var s = function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
};
|
|
232
|
+
if (Object.defineProperty(s.prototype, "props", {
|
|
233
|
+
set: function() {
|
|
234
|
+
throw Error();
|
|
235
|
+
}
|
|
236
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
+
try {
|
|
238
|
+
Reflect.construct(s, []);
|
|
239
|
+
} catch (C) {
|
|
240
|
+
a = C;
|
|
241
|
+
}
|
|
242
|
+
Reflect.construct(r, [], s);
|
|
243
|
+
} else {
|
|
244
|
+
try {
|
|
245
|
+
s.call();
|
|
246
|
+
} catch (C) {
|
|
247
|
+
a = C;
|
|
248
|
+
}
|
|
249
|
+
r.call(s.prototype);
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
try {
|
|
253
|
+
throw Error();
|
|
254
|
+
} catch (C) {
|
|
255
|
+
a = C;
|
|
256
|
+
}
|
|
257
|
+
r();
|
|
258
|
+
}
|
|
259
|
+
} catch (C) {
|
|
260
|
+
if (C && a && typeof C.stack == "string") {
|
|
261
|
+
for (var i = C.stack.split(`
|
|
262
|
+
`), _ = a.stack.split(`
|
|
263
|
+
`), w = i.length - 1, g = _.length - 1; w >= 1 && g >= 0 && i[w] !== _[g]; )
|
|
264
|
+
g--;
|
|
265
|
+
for (; w >= 1 && g >= 0; w--, g--)
|
|
266
|
+
if (i[w] !== _[g]) {
|
|
267
|
+
if (w !== 1 || g !== 1)
|
|
268
|
+
do
|
|
269
|
+
if (w--, g--, g < 0 || i[w] !== _[g]) {
|
|
270
|
+
var P = `
|
|
271
|
+
` + i[w].replace(" at new ", " at ");
|
|
272
|
+
return r.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", r.displayName)), typeof r == "function" && er.set(r, P), P;
|
|
273
|
+
}
|
|
274
|
+
while (w >= 1 && g >= 0);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} finally {
|
|
279
|
+
lr = !1, sr.current = l, Vr(), Error.prepareStackTrace = d;
|
|
280
|
+
}
|
|
281
|
+
var M = r ? r.displayName || r.name : "", N = M ? nr(M) : "";
|
|
282
|
+
return typeof r == "function" && er.set(r, N), N;
|
|
283
|
+
}
|
|
284
|
+
function qr(r, n, e) {
|
|
285
|
+
return _r(r, !1);
|
|
286
|
+
}
|
|
287
|
+
function Jr(r) {
|
|
288
|
+
var n = r.prototype;
|
|
289
|
+
return !!(n && n.isReactComponent);
|
|
290
|
+
}
|
|
291
|
+
function ar(r, n, e) {
|
|
292
|
+
if (r == null)
|
|
293
|
+
return "";
|
|
294
|
+
if (typeof r == "function")
|
|
295
|
+
return _r(r, Jr(r));
|
|
296
|
+
if (typeof r == "string")
|
|
297
|
+
return nr(r);
|
|
298
|
+
switch (r) {
|
|
299
|
+
case F:
|
|
300
|
+
return nr("Suspense");
|
|
301
|
+
case y:
|
|
302
|
+
return nr("SuspenseList");
|
|
303
|
+
}
|
|
304
|
+
if (typeof r == "object")
|
|
305
|
+
switch (r.$$typeof) {
|
|
306
|
+
case f:
|
|
307
|
+
return qr(r.render);
|
|
308
|
+
case T:
|
|
309
|
+
return ar(r.type, n, e);
|
|
310
|
+
case A: {
|
|
311
|
+
var a = r, d = a._payload, l = a._init;
|
|
312
|
+
try {
|
|
313
|
+
return ar(l(d), n, e);
|
|
314
|
+
} catch {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
var q = Object.prototype.hasOwnProperty, jr = {}, Cr = S.ReactDebugCurrentFrame;
|
|
321
|
+
function tr(r) {
|
|
322
|
+
if (r) {
|
|
323
|
+
var n = r._owner, e = ar(r.type, r._source, n ? n.type : null);
|
|
324
|
+
Cr.setExtraStackFrame(e);
|
|
325
|
+
} else
|
|
326
|
+
Cr.setExtraStackFrame(null);
|
|
327
|
+
}
|
|
328
|
+
function Hr(r, n, e, a, d) {
|
|
329
|
+
{
|
|
330
|
+
var l = Function.call.bind(q);
|
|
331
|
+
for (var s in r)
|
|
332
|
+
if (l(r, s)) {
|
|
333
|
+
var i = void 0;
|
|
334
|
+
try {
|
|
335
|
+
if (typeof r[s] != "function") {
|
|
336
|
+
var _ = 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 _.name = "Invariant Violation", _;
|
|
338
|
+
}
|
|
339
|
+
i = r[s](n, s, a, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (w) {
|
|
341
|
+
i = w;
|
|
342
|
+
}
|
|
343
|
+
i && !(i instanceof Error) && (tr(d), h("%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), h("Failed %s type: %s", e, i.message), tr(null));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var Kr = Array.isArray;
|
|
348
|
+
function cr(r) {
|
|
349
|
+
return Kr(r);
|
|
350
|
+
}
|
|
351
|
+
function Gr(r) {
|
|
352
|
+
{
|
|
353
|
+
var n = typeof Symbol == "function" && Symbol.toStringTag, e = n && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
354
|
+
return e;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function Xr(r) {
|
|
358
|
+
try {
|
|
359
|
+
return Or(r), !1;
|
|
360
|
+
} catch {
|
|
361
|
+
return !0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function Or(r) {
|
|
365
|
+
return "" + r;
|
|
366
|
+
}
|
|
367
|
+
function Tr(r) {
|
|
368
|
+
if (Xr(r))
|
|
369
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Gr(r)), Or(r);
|
|
370
|
+
}
|
|
371
|
+
var J = S.ReactCurrentOwner, Zr = {
|
|
372
|
+
key: !0,
|
|
373
|
+
ref: !0,
|
|
374
|
+
__self: !0,
|
|
375
|
+
__source: !0
|
|
376
|
+
}, Sr, Pr, ur;
|
|
377
|
+
ur = {};
|
|
378
|
+
function Qr(r) {
|
|
379
|
+
if (q.call(r, "ref")) {
|
|
380
|
+
var n = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
381
|
+
if (n && n.isReactWarning)
|
|
382
|
+
return !1;
|
|
383
|
+
}
|
|
384
|
+
return r.ref !== void 0;
|
|
385
|
+
}
|
|
386
|
+
function rn(r) {
|
|
387
|
+
if (q.call(r, "key")) {
|
|
388
|
+
var n = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
389
|
+
if (n && n.isReactWarning)
|
|
390
|
+
return !1;
|
|
391
|
+
}
|
|
392
|
+
return r.key !== void 0;
|
|
393
|
+
}
|
|
394
|
+
function nn(r, n) {
|
|
395
|
+
if (typeof r.ref == "string" && J.current && n && J.current.stateNode !== n) {
|
|
396
|
+
var e = j(J.current.type);
|
|
397
|
+
ur[e] || (h('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', j(J.current.type), r.ref), ur[e] = !0);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function en(r, n) {
|
|
401
|
+
{
|
|
402
|
+
var e = function() {
|
|
403
|
+
Sr || (Sr = !0, h("%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
|
+
};
|
|
405
|
+
e.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
406
|
+
get: e,
|
|
407
|
+
configurable: !0
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function an(r, n) {
|
|
412
|
+
{
|
|
413
|
+
var e = function() {
|
|
414
|
+
Pr || (Pr = !0, h("%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
|
+
};
|
|
416
|
+
e.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
417
|
+
get: e,
|
|
418
|
+
configurable: !0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var tn = function(r, n, e, a, d, l, s) {
|
|
423
|
+
var i = {
|
|
424
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
+
$$typeof: p,
|
|
426
|
+
// Built-in properties that belong on the element
|
|
427
|
+
type: r,
|
|
428
|
+
key: n,
|
|
429
|
+
ref: e,
|
|
430
|
+
props: s,
|
|
431
|
+
// Record the component responsible for creating this element.
|
|
432
|
+
_owner: l
|
|
433
|
+
};
|
|
434
|
+
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
435
|
+
configurable: !1,
|
|
436
|
+
enumerable: !1,
|
|
437
|
+
writable: !0,
|
|
438
|
+
value: !1
|
|
439
|
+
}), Object.defineProperty(i, "_self", {
|
|
440
|
+
configurable: !1,
|
|
441
|
+
enumerable: !1,
|
|
442
|
+
writable: !1,
|
|
443
|
+
value: a
|
|
444
|
+
}), Object.defineProperty(i, "_source", {
|
|
445
|
+
configurable: !1,
|
|
446
|
+
enumerable: !1,
|
|
447
|
+
writable: !1,
|
|
448
|
+
value: d
|
|
449
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
450
|
+
};
|
|
451
|
+
function on(r, n, e, a, d) {
|
|
452
|
+
{
|
|
453
|
+
var l, s = {}, i = null, _ = null;
|
|
454
|
+
e !== void 0 && (Tr(e), i = "" + e), rn(n) && (Tr(n.key), i = "" + n.key), Qr(n) && (_ = n.ref, nn(n, d));
|
|
455
|
+
for (l in n)
|
|
456
|
+
q.call(n, l) && !Zr.hasOwnProperty(l) && (s[l] = n[l]);
|
|
457
|
+
if (r && r.defaultProps) {
|
|
458
|
+
var w = r.defaultProps;
|
|
459
|
+
for (l in w)
|
|
460
|
+
s[l] === void 0 && (s[l] = w[l]);
|
|
461
|
+
}
|
|
462
|
+
if (i || _) {
|
|
463
|
+
var g = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
464
|
+
i && en(s, g), _ && an(s, g);
|
|
465
|
+
}
|
|
466
|
+
return tn(r, i, _, d, a, J.current, s);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
var pr = S.ReactCurrentOwner, Ir = S.ReactDebugCurrentFrame;
|
|
470
|
+
function Y(r) {
|
|
471
|
+
if (r) {
|
|
472
|
+
var n = r._owner, e = ar(r.type, r._source, n ? n.type : null);
|
|
473
|
+
Ir.setExtraStackFrame(e);
|
|
474
|
+
} else
|
|
475
|
+
Ir.setExtraStackFrame(null);
|
|
476
|
+
}
|
|
477
|
+
var fr;
|
|
478
|
+
fr = !1;
|
|
479
|
+
function vr(r) {
|
|
480
|
+
return typeof r == "object" && r !== null && r.$$typeof === p;
|
|
481
|
+
}
|
|
482
|
+
function Fr() {
|
|
483
|
+
{
|
|
484
|
+
if (pr.current) {
|
|
485
|
+
var r = j(pr.current.type);
|
|
486
|
+
if (r)
|
|
487
|
+
return `
|
|
488
|
+
|
|
489
|
+
Check the render method of \`` + r + "`.";
|
|
490
|
+
}
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function sn(r) {
|
|
495
|
+
{
|
|
496
|
+
if (r !== void 0) {
|
|
497
|
+
var n = r.fileName.replace(/^.*[\\\/]/, ""), e = r.lineNumber;
|
|
498
|
+
return `
|
|
499
|
+
|
|
500
|
+
Check your code at ` + n + ":" + e + ".";
|
|
501
|
+
}
|
|
502
|
+
return "";
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
var Ar = {};
|
|
506
|
+
function dn(r) {
|
|
507
|
+
{
|
|
508
|
+
var n = Fr();
|
|
509
|
+
if (!n) {
|
|
510
|
+
var e = typeof r == "string" ? r : r.displayName || r.name;
|
|
511
|
+
e && (n = `
|
|
512
|
+
|
|
513
|
+
Check the top-level render call using <` + e + ">.");
|
|
514
|
+
}
|
|
515
|
+
return n;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function Dr(r, n) {
|
|
519
|
+
{
|
|
520
|
+
if (!r._store || r._store.validated || r.key != null)
|
|
521
|
+
return;
|
|
522
|
+
r._store.validated = !0;
|
|
523
|
+
var e = dn(n);
|
|
524
|
+
if (Ar[e])
|
|
525
|
+
return;
|
|
526
|
+
Ar[e] = !0;
|
|
527
|
+
var a = "";
|
|
528
|
+
r && r._owner && r._owner !== pr.current && (a = " It was passed a child from " + j(r._owner.type) + "."), Y(r), h('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), Y(null);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function Wr(r, n) {
|
|
532
|
+
{
|
|
533
|
+
if (typeof r != "object")
|
|
534
|
+
return;
|
|
535
|
+
if (cr(r))
|
|
536
|
+
for (var e = 0; e < r.length; e++) {
|
|
537
|
+
var a = r[e];
|
|
538
|
+
vr(a) && Dr(a, n);
|
|
539
|
+
}
|
|
540
|
+
else if (vr(r))
|
|
541
|
+
r._store && (r._store.validated = !0);
|
|
542
|
+
else if (r) {
|
|
543
|
+
var d = $(r);
|
|
544
|
+
if (typeof d == "function" && d !== r.entries)
|
|
545
|
+
for (var l = d.call(r), s; !(s = l.next()).done; )
|
|
546
|
+
vr(s.value) && Dr(s.value, n);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function ln(r) {
|
|
551
|
+
{
|
|
552
|
+
var n = r.type;
|
|
553
|
+
if (n == null || typeof n == "string")
|
|
554
|
+
return;
|
|
555
|
+
var e;
|
|
556
|
+
if (typeof n == "function")
|
|
557
|
+
e = n.propTypes;
|
|
558
|
+
else if (typeof n == "object" && (n.$$typeof === f || // Note: Memo only checks outer props here.
|
|
559
|
+
// Inner props are checked in the reconciler.
|
|
560
|
+
n.$$typeof === T))
|
|
561
|
+
e = n.propTypes;
|
|
562
|
+
else
|
|
563
|
+
return;
|
|
564
|
+
if (e) {
|
|
565
|
+
var a = j(n);
|
|
566
|
+
Hr(e, r.props, "prop", a, r);
|
|
567
|
+
} else if (n.PropTypes !== void 0 && !fr) {
|
|
568
|
+
fr = !0;
|
|
569
|
+
var d = j(n);
|
|
570
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
|
|
571
|
+
}
|
|
572
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
function cn(r) {
|
|
576
|
+
{
|
|
577
|
+
for (var n = Object.keys(r.props), e = 0; e < n.length; e++) {
|
|
578
|
+
var a = n[e];
|
|
579
|
+
if (a !== "children" && a !== "key") {
|
|
580
|
+
Y(r), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), Y(null);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
r.ref !== null && (Y(r), h("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
var $r = {};
|
|
588
|
+
function Lr(r, n, e, a, d, l) {
|
|
589
|
+
{
|
|
590
|
+
var s = L(r);
|
|
591
|
+
if (!s) {
|
|
592
|
+
var i = "";
|
|
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 _ = sn(d);
|
|
595
|
+
_ ? i += _ : i += Fr();
|
|
596
|
+
var w;
|
|
597
|
+
r === null ? w = "null" : cr(r) ? w = "array" : r !== void 0 && r.$$typeof === p ? (w = "<" + (j(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : w = typeof r, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", w, i);
|
|
598
|
+
}
|
|
599
|
+
var g = on(r, n, e, d, l);
|
|
600
|
+
if (g == null)
|
|
601
|
+
return g;
|
|
602
|
+
if (s) {
|
|
603
|
+
var P = n.children;
|
|
604
|
+
if (P !== void 0)
|
|
605
|
+
if (a)
|
|
606
|
+
if (cr(P)) {
|
|
607
|
+
for (var M = 0; M < P.length; M++)
|
|
608
|
+
Wr(P[M], r);
|
|
609
|
+
Object.freeze && Object.freeze(P);
|
|
610
|
+
} else
|
|
611
|
+
h("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
|
+
else
|
|
613
|
+
Wr(P, r);
|
|
614
|
+
}
|
|
615
|
+
if (q.call(n, "key")) {
|
|
616
|
+
var N = j(r), C = Object.keys(n).filter(function(wn) {
|
|
617
|
+
return wn !== "key";
|
|
618
|
+
}), hr = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
+
if (!$r[N + hr]) {
|
|
620
|
+
var hn = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
+
h(`A props object containing a "key" prop is being spread into JSX:
|
|
622
|
+
let props = %s;
|
|
623
|
+
<%s {...props} />
|
|
624
|
+
React keys must be passed directly to JSX without using spread:
|
|
625
|
+
let props = %s;
|
|
626
|
+
<%s key={someKey} {...props} />`, hr, N, hn, N), $r[N + hr] = !0;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return r === b ? cn(g) : ln(g), g;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function un(r, n, e) {
|
|
633
|
+
return Lr(r, n, e, !0);
|
|
634
|
+
}
|
|
635
|
+
function pn(r, n, e) {
|
|
636
|
+
return Lr(r, n, e, !1);
|
|
637
|
+
}
|
|
638
|
+
var fn = pn, vn = un;
|
|
639
|
+
K.Fragment = b, K.jsx = fn, K.jsxs = vn;
|
|
640
|
+
}()), K;
|
|
641
|
+
}
|
|
642
|
+
process.env.NODE_ENV === "production" ? wr.exports = bn() : wr.exports = xn();
|
|
643
|
+
var t = wr.exports;
|
|
644
|
+
const mn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
|
+
* {
|
|
646
|
+
margin: 0;
|
|
647
|
+
padding: 0;
|
|
648
|
+
font-family: "Poppins", sans-serif;
|
|
649
|
+
box-sizing: border-box;
|
|
650
|
+
}
|
|
651
|
+
:root {
|
|
652
|
+
/* color */
|
|
653
|
+
/* blue */
|
|
654
|
+
--starasia-ui-dropdown-color-primary-blue: var(
|
|
655
|
+
--starasia-ui-color-blue-700,
|
|
656
|
+
#1d4ed8
|
|
657
|
+
);
|
|
658
|
+
--starasia-ui-dropdown-color-secondary-blue: var(
|
|
659
|
+
--starasia-ui-color-blue-500,
|
|
660
|
+
#3b82f6
|
|
661
|
+
);
|
|
662
|
+
--starasia-ui-dropdown-color-tertiary-blue: var(
|
|
663
|
+
--starasia-ui-color-blue-300,
|
|
664
|
+
#93c5fd
|
|
665
|
+
);
|
|
666
|
+
--starasia-ui-dropdown-color-quaternary-blue: var(
|
|
667
|
+
--starasia-ui-color-blue-100,
|
|
668
|
+
#dbeafe
|
|
669
|
+
);
|
|
670
|
+
--starasia-ui-dropdown-color-quinary-blue: var(
|
|
671
|
+
--starasia-ui-color-blue-50,
|
|
672
|
+
#eff6ff
|
|
673
|
+
);
|
|
674
|
+
/* gray */
|
|
675
|
+
--starasia-ui-dropdown-color-primary-gray: var(
|
|
676
|
+
--starasia-ui-color-gray-700,
|
|
677
|
+
#374151
|
|
678
|
+
);
|
|
679
|
+
--starasia-ui-dropdown-color-secondary-gray: var(
|
|
680
|
+
--starasia-ui-color-gray-500,
|
|
681
|
+
#6b7280
|
|
682
|
+
);
|
|
683
|
+
--starasia-ui-dropdown-color-tertiary-gray: var(
|
|
684
|
+
--starasia-ui-color-gray-300,
|
|
685
|
+
#d1d5db
|
|
686
|
+
);
|
|
687
|
+
--starasia-ui-dropdown-color-quaternary-gray: var(
|
|
688
|
+
--starasia-ui-color-gray-100,
|
|
689
|
+
#f3f4f6
|
|
690
|
+
);
|
|
691
|
+
--starasia-ui-dropdown-color-quinary-gray: var(
|
|
692
|
+
--starasia-ui-color-gray-50,
|
|
693
|
+
#f9fafb
|
|
694
|
+
);
|
|
695
|
+
/* bg color */
|
|
696
|
+
--starasia-ui-dropdown-background-color-primary: var(
|
|
697
|
+
--starasia-ui-dropdown-color-secondary-blue,
|
|
698
|
+
#3b82f6
|
|
699
|
+
);
|
|
700
|
+
--starasia-ui-dropdown-background-color-secondary: var(
|
|
701
|
+
--starasia-ui-dropdown-color-quinary-blue,
|
|
702
|
+
#eff6ff
|
|
703
|
+
);
|
|
704
|
+
|
|
705
|
+
/* disalble color */
|
|
706
|
+
--starasia-ui-dropdown-color-disable: var(
|
|
707
|
+
--starasia-ui-dropdown-color-tertiary-gray,
|
|
708
|
+
#d1d5db
|
|
709
|
+
);
|
|
710
|
+
|
|
711
|
+
/* border color */
|
|
712
|
+
--starasia-ui-dropdown-border-color-primary: var(
|
|
713
|
+
--starasia-ui-color-blue-500,
|
|
714
|
+
#3b82f6
|
|
715
|
+
);
|
|
716
|
+
--starasia-ui-dropdown-border-color-secondary: var(
|
|
717
|
+
--starasia-ui-color-gray-300,
|
|
718
|
+
#d1d5db
|
|
719
|
+
);
|
|
720
|
+
--starasia-ui-dropdown-border-color-tertiary: rgba(120, 134, 127, 0.2);
|
|
721
|
+
|
|
722
|
+
--starasia-ui-dropdown-color-secondary-red: var(
|
|
723
|
+
--starasia-ui-color-red-500,
|
|
724
|
+
#ef4444
|
|
725
|
+
);
|
|
726
|
+
|
|
727
|
+
/* plachoder color */
|
|
728
|
+
--starasia-ui-dropdown-placholder-color: var(
|
|
729
|
+
--starasia-ui-color-gray-200,
|
|
730
|
+
#c9cecc
|
|
731
|
+
);
|
|
732
|
+
|
|
733
|
+
/* border width */
|
|
734
|
+
--starasia-ui-dropdown-border-width: var(--starasia-ui-border, 1px);
|
|
735
|
+
|
|
736
|
+
/* spacing */
|
|
737
|
+
--starasia-ui-dropdown-spacing-xs: var(--starasia-ui-spacing-xs, 4px);
|
|
738
|
+
--starasia-ui-dropdown-spacing-sm: var(--starasia-ui-spacing-sm, 8px);
|
|
739
|
+
|
|
740
|
+
/* shadow */
|
|
741
|
+
--starasia-ui-dropdown-box-shadow: 0px 0px 0px 2px rgba(100, 181, 246, 0.2);
|
|
742
|
+
|
|
743
|
+
/* below is for size,above is */
|
|
744
|
+
--starasia-ui-dropdown-fontWeight-normal: var(
|
|
745
|
+
--starasia-ui-fontWeights-normal,
|
|
746
|
+
300
|
|
747
|
+
);
|
|
748
|
+
/* dropdown size sm */
|
|
749
|
+
--starasia-ui-dropdown-height-sm: var(--starasia-ui-h-8, 32px);
|
|
750
|
+
--starasia-ui-dropdown-border-radius-sm: var(--starasia-ui-radii-md, 8px);
|
|
751
|
+
--starasia-ui-dropdown-padding-inline-sm: var(--starasia-ui-spacing-sm, 8px);
|
|
752
|
+
|
|
753
|
+
/* dropdown size md */
|
|
754
|
+
--starasia-ui-dropdown-height-md: 38px;
|
|
755
|
+
--starasia-ui-dropdown-border-radius-md: var(--starasia-ui-radii-md, 8px);
|
|
756
|
+
--starasia-ui-dropdown-padding-inline-md: var(--starasia-ui-spacing-3, 12px);
|
|
757
|
+
|
|
758
|
+
/* dropdown size lg */
|
|
759
|
+
--starasia-ui-dropdown-height-lg: var(--starasia-ui-h-12, 48px);
|
|
760
|
+
--starasia-ui-dropdown-border-radius-lg: var(--starasia-ui-radii-lg, 12px);
|
|
761
|
+
--starasia-ui-dropdown-padding-inline-lg: var(--starasia-ui-spacing-3, 12px);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.starasia-input-dropdown-size-sm {
|
|
765
|
+
--baseFont: var(--starasia-ui-fontSizes-sm, 12px);
|
|
766
|
+
--height: var(--starasia-ui-dropdown-height-sm);
|
|
767
|
+
--borderRadius: var(--starasia-ui-dropdown-border-radius-sm);
|
|
768
|
+
--paddingInline: var(--starasia-ui-dropdown-padding-inline-sm);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.starasia-input-dropdown-size-md {
|
|
772
|
+
--baseFont: var(--starasia-ui-fontSizes-md, 14px);
|
|
773
|
+
--height: var(--starasia-ui-dropdown-height-md);
|
|
774
|
+
--borderRadius: var(--starasia-ui-dropdown-border-radius-md);
|
|
775
|
+
--paddingInline: var(--starasia-ui-dropdown-padding-inline-md);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
.starasia-input-dropdown-size-lg {
|
|
779
|
+
--baseFont: var(--starasia-ui-fontSizes-lg, 16px);
|
|
780
|
+
--height: var(--starasia-ui-dropdown-height-lg);
|
|
781
|
+
--borderRadius: var(--starasia-ui-dropdown-border-radius-lg);
|
|
782
|
+
--paddingInline: var(--starasia-ui-dropdown-padding-inline-lg);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.starasia-input-dropdown-container {
|
|
786
|
+
position: relative;
|
|
787
|
+
min-height: var(--height);
|
|
788
|
+
padding-inline: var(--paddingInline);
|
|
789
|
+
display: flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
border: var(--starasia-ui-dropdown-border-width) solid
|
|
792
|
+
rgba(120, 134, 127, 0.2);
|
|
793
|
+
border-radius: var(--borderRadius);
|
|
794
|
+
background-color: white;
|
|
795
|
+
font-size: var(--baseFont);
|
|
796
|
+
cursor: pointer;
|
|
797
|
+
}
|
|
798
|
+
.starasia-input-dropdown-container.disable {
|
|
799
|
+
background-color: #f2f3f2;
|
|
800
|
+
cursor: not-allowed;
|
|
801
|
+
pointer-events: none;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.starasia-input-dropdown-container.error {
|
|
805
|
+
border-color: var(--starasia-ui-dropdown-color-secondary-red) !important;
|
|
806
|
+
}
|
|
807
|
+
.starasia-input-dropdown-container.active {
|
|
808
|
+
border-color: var(--starasia-ui-dropdown-border-color-primary);
|
|
809
|
+
box-shadow: var(--starasia-ui-dropdown-box-shadow);
|
|
810
|
+
background-color: white;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.starasia-input-dropdown-preview-container {
|
|
814
|
+
display: flex;
|
|
815
|
+
flex-direction: row;
|
|
816
|
+
gap: var(--starasia-ui-dropdown-spacing-sm);
|
|
817
|
+
align-items: center;
|
|
818
|
+
justify-content: space-between;
|
|
819
|
+
width: 100%;
|
|
820
|
+
overflow-y: hidden;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.starasia-input-dropdown-lists-container {
|
|
824
|
+
/* position: absolute; */
|
|
825
|
+
position: fixed;
|
|
826
|
+
/* left: 0; */
|
|
827
|
+
padding: var(--starasia-ui-dropdown-spacing-sm);
|
|
828
|
+
border: var(--starasia-ui-dropdown-border-width) solid
|
|
829
|
+
var(--starasia-ui-dropdown-border-color-tertiary);
|
|
830
|
+
border-radius: var(--borderRadius);
|
|
831
|
+
background-color: #fffeff;
|
|
832
|
+
box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.08);
|
|
833
|
+
max-height: 312px;
|
|
834
|
+
overflow-y: auto;
|
|
835
|
+
z-index: 999;
|
|
836
|
+
width: 100%;
|
|
837
|
+
/* width: max-content; */
|
|
838
|
+
/* min-width: 100%; */
|
|
839
|
+
display: flex;
|
|
840
|
+
flex-direction: column;
|
|
841
|
+
gap: var(--starasia-ui-dropdown-spacing-sm);
|
|
842
|
+
/* overflow: hidden;
|
|
843
|
+
text-overflow: ellipsis;
|
|
844
|
+
white-space: nowrap; */
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.starasia-input-dropdown-lists-container-bottom {
|
|
848
|
+
top: 100%;
|
|
849
|
+
margin-top: var(--starasia-ui-dropdown-spacing-xs);
|
|
850
|
+
}
|
|
851
|
+
.starasia-input-dropdown-lists-container-top {
|
|
852
|
+
bottom: 100%;
|
|
853
|
+
margin-bottom: var(--starasia-ui-dropdown-spacing-xs);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
.starasia-input-dropdown-container-dropdown-search {
|
|
857
|
+
display: flex;
|
|
858
|
+
align-items: center;
|
|
859
|
+
height: var(--height);
|
|
860
|
+
min-height: var(--height);
|
|
861
|
+
max-height: var(--height);
|
|
862
|
+
border: var(--starasia-ui-dropdown-border-width) solid
|
|
863
|
+
var(--starasia-ui-dropdown-border-color-secondary);
|
|
864
|
+
border-radius: var(--borderRadius);
|
|
865
|
+
gap: var(--starasia-ui-dropdown-spacing-sm);
|
|
866
|
+
padding-inline: var(--paddingInline);
|
|
867
|
+
background: white;
|
|
868
|
+
& input {
|
|
869
|
+
flex: 1;
|
|
870
|
+
outline: none;
|
|
871
|
+
background-color: transparent;
|
|
872
|
+
border: none;
|
|
873
|
+
font-size: inherit;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
.starasia-input-dropdwon-item-container {
|
|
878
|
+
display: flex;
|
|
879
|
+
flex-direction: column;
|
|
880
|
+
/* overflow: hidden; */
|
|
881
|
+
|
|
882
|
+
/* gap: var(--starasia-ui-dropdown-spacing-xs); */
|
|
883
|
+
}
|
|
884
|
+
.starasia-input-dropdwon-item-container.multi {
|
|
885
|
+
display: flex;
|
|
886
|
+
flex-direction: column;
|
|
887
|
+
gap: 8px;
|
|
888
|
+
/* overflow: hidden; */
|
|
889
|
+
|
|
890
|
+
/* gap: var(--starasia-ui-dropdown-spacing-xs); */
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.starasia-input-dropdwon-item {
|
|
894
|
+
/* max-height: var(--height); */
|
|
895
|
+
max-height: 58px;
|
|
896
|
+
box-sizing: border-box;
|
|
897
|
+
padding-inline: var(--paddingInline);
|
|
898
|
+
display: flex;
|
|
899
|
+
align-items: center;
|
|
900
|
+
cursor: pointer;
|
|
901
|
+
gap: var(--starasia-ui-dropdown-spacing-xs);
|
|
902
|
+
padding-block: var(--paddingInline);
|
|
903
|
+
border-radius: var(--starasia-ui-dropdown-border-radius-sm);
|
|
904
|
+
/* min-width: max-content; */
|
|
905
|
+
overflow: hidden;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
.starasia-input-dropdwon-item:hover {
|
|
909
|
+
background-color: rgba(100, 181, 246, 0.21);
|
|
910
|
+
}
|
|
911
|
+
.starasia-input-dropdwon-item.active {
|
|
912
|
+
/* color: var(--starasia-ui-dropdown-background-color-primary); */
|
|
913
|
+
/* border-radius: var(--borderRadius); */
|
|
914
|
+
background-color: rgba(100, 181, 246, 0.21);
|
|
915
|
+
/* background: var(--starasia-ui-dropdown-background-color-secondary); */
|
|
916
|
+
/* box-shadow: 0px 0px 0px -1px #f0f0f0; */
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.starasia-input-dropdwon-item-disable {
|
|
920
|
+
color: var(--starasia-ui-dropdown-color-disable) !important;
|
|
921
|
+
pointer-events: none;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.starasia-input-dropdown-container-preview-item {
|
|
925
|
+
flex: 1;
|
|
926
|
+
display: flex;
|
|
927
|
+
gap: var(--starasia-ui-dropdown-spacing-xs);
|
|
928
|
+
flex-wrap: wrap;
|
|
929
|
+
align-items: center;
|
|
930
|
+
overflow-y: auto;
|
|
931
|
+
padding-block: 4px;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.starasia-input-dropdown-preview-item {
|
|
935
|
+
border: var(--starasia-ui-dropdown-border-width) solid
|
|
936
|
+
var(--starasia-ui-dropdown-border-color-primary);
|
|
937
|
+
padding-inline: var(--paddingInline);
|
|
938
|
+
border-radius: var(--borderRadius);
|
|
939
|
+
background-color: var(--starasia-ui-dropdown-background-color-secondary);
|
|
940
|
+
color: var(--starasia-ui-dropdown-background-color-primary);
|
|
941
|
+
height: max-content;
|
|
942
|
+
font-size: var(--baseFont);
|
|
943
|
+
display: flex;
|
|
944
|
+
align-items: center;
|
|
945
|
+
gap: 2;
|
|
946
|
+
}
|
|
947
|
+
.starasia-input-dropdown-placeholder {
|
|
948
|
+
color: var(--starasia-ui-dropdown-placholder-color);
|
|
949
|
+
font-weight: var(--starasia-ui-dropdown-fontWeight-normal);
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.starasia-input-dropdwon-item-text {
|
|
953
|
+
color: #181a19;
|
|
954
|
+
/* font-size: 14px; */
|
|
955
|
+
font-size: inherit;
|
|
956
|
+
font-weight: 500;
|
|
957
|
+
}
|
|
958
|
+
.starasia-input-dropdwon-item-text.active {
|
|
959
|
+
color: #1976d2;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.starasia-input-dropdwon-item-text-description {
|
|
963
|
+
color: #78867f;
|
|
964
|
+
/* font-size: 14px; */
|
|
965
|
+
font-size: inherit;
|
|
966
|
+
font-weight: 400;
|
|
967
|
+
}
|
|
968
|
+
.starasia-input-dropdwon-item-text-description.active {
|
|
969
|
+
color: #1976d2;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/* for checkbox */
|
|
973
|
+
.checkbox-wrapper-30 .checkbox {
|
|
974
|
+
--bg: #fff;
|
|
975
|
+
--brdr: #d1d6ee;
|
|
976
|
+
--brdr-actv: #1976d2;
|
|
977
|
+
--brdr-hovr: #bbc1e1;
|
|
978
|
+
--dur: calc((var(--size, 2) / 2) * 0.6s);
|
|
979
|
+
display: inline-block;
|
|
980
|
+
/* width: calc(var(--size, 1) * 22px); */
|
|
981
|
+
width: 16px;
|
|
982
|
+
height: 16px;
|
|
983
|
+
position: relative;
|
|
984
|
+
}
|
|
985
|
+
.checkbox-wrapper-30 .checkbox:after {
|
|
986
|
+
content: "";
|
|
987
|
+
width: 100%;
|
|
988
|
+
padding-top: 100%;
|
|
989
|
+
display: block;
|
|
990
|
+
}
|
|
991
|
+
.checkbox-wrapper-30 .checkbox > * {
|
|
992
|
+
position: absolute;
|
|
993
|
+
}
|
|
994
|
+
.checkbox-wrapper-30 .checkbox input {
|
|
995
|
+
-webkit-appearance: none;
|
|
996
|
+
-moz-appearance: none;
|
|
997
|
+
-webkit-tap-highlight-color: transparent;
|
|
998
|
+
cursor: pointer;
|
|
999
|
+
background-color: var(--newBgClr, var(--bg));
|
|
1000
|
+
border-radius: calc(var(--size, 1) * 4px);
|
|
1001
|
+
border: calc(var(--newBrdr, var(--size, 1)) * 1px) solid;
|
|
1002
|
+
color: var(--newBrdrClr, var(--brdr));
|
|
1003
|
+
outline: none;
|
|
1004
|
+
margin: 0;
|
|
1005
|
+
padding: 0;
|
|
1006
|
+
transition: all calc(var(--dur) / 3) linear;
|
|
1007
|
+
}
|
|
1008
|
+
.checkbox-wrapper-30 .checkbox input:hover,
|
|
1009
|
+
.checkbox-wrapper-30 .checkbox input:checked {
|
|
1010
|
+
--newBrdr: calc(var(--size, 1) * 2);
|
|
1011
|
+
}
|
|
1012
|
+
.checkbox-wrapper-30 .checkbox input:hover {
|
|
1013
|
+
--newBrdrClr: var(--brdr-hovr);
|
|
1014
|
+
}
|
|
1015
|
+
.checkbox-wrapper-30 .checkbox input:checked {
|
|
1016
|
+
--newBrdrClr: var(--brdr-actv);
|
|
1017
|
+
--newBgClr: var(--brdr-actv);
|
|
1018
|
+
/* transition-delay: calc(var(--dur) / 1.3); */
|
|
1019
|
+
}
|
|
1020
|
+
.checkbox-wrapper-30 .checkbox input:checked + svg {
|
|
1021
|
+
--dashArray: 16 93;
|
|
1022
|
+
--dashOffset: 109;
|
|
1023
|
+
}
|
|
1024
|
+
.checkbox-wrapper-30 .checkbox input:checked + svg {
|
|
1025
|
+
color: white;
|
|
1026
|
+
/* transition-delay: calc(var(--dur) / 1.3); */
|
|
1027
|
+
transition-delay: 0.1s;
|
|
1028
|
+
}
|
|
1029
|
+
.checkbox-wrapper-30 .checkbox svg {
|
|
1030
|
+
fill: none;
|
|
1031
|
+
left: 0;
|
|
1032
|
+
pointer-events: none;
|
|
1033
|
+
stroke: var(--stroke, var(--border-active));
|
|
1034
|
+
stroke-dasharray: var(--dashArray, 93);
|
|
1035
|
+
stroke-dashoffset: var(--dashOffset, 94);
|
|
1036
|
+
stroke-linecap: round;
|
|
1037
|
+
stroke-linejoin: round;
|
|
1038
|
+
stroke-width: 2px;
|
|
1039
|
+
top: 0;
|
|
1040
|
+
transition: stroke-dasharray var(--dur), stroke-dashoffset var(--dur);
|
|
1041
|
+
}
|
|
1042
|
+
.checkbox-wrapper-30 .checkbox svg,
|
|
1043
|
+
.checkbox-wrapper-30 .checkbox input {
|
|
1044
|
+
display: block;
|
|
1045
|
+
height: 100%;
|
|
1046
|
+
width: 100%;
|
|
1047
|
+
}
|
|
1048
|
+
`;
|
|
1049
|
+
function yn(c) {
|
|
1050
|
+
const [p, x] = G(c), b = X(null), u = (v) => {
|
|
1051
|
+
b.current && !b.current.contains(v.target) && x(!1);
|
|
1052
|
+
};
|
|
1053
|
+
return B(() => (document.addEventListener("click", u, !0), () => {
|
|
1054
|
+
document.removeEventListener("click", u, !0);
|
|
1055
|
+
}), []), { ref: b, isComponentVisible: p, setIsComponentVisible: x };
|
|
1056
|
+
}
|
|
1057
|
+
const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
1058
|
+
"svg",
|
|
1059
|
+
{
|
|
1060
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1061
|
+
...c,
|
|
1062
|
+
viewBox: "0 0 24 24",
|
|
1063
|
+
fill: "none",
|
|
1064
|
+
color: "#939E99",
|
|
1065
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1066
|
+
"path",
|
|
1067
|
+
{
|
|
1068
|
+
d: "M4 9L12 17L20 9",
|
|
1069
|
+
stroke: "currentColor",
|
|
1070
|
+
strokeLinecap: "round",
|
|
1071
|
+
strokeLinejoin: "round",
|
|
1072
|
+
strokeWidth: 1.5
|
|
1073
|
+
}
|
|
1074
|
+
)
|
|
1075
|
+
}
|
|
1076
|
+
), En = ({ ...c }) => /* @__PURE__ */ t.jsxs(
|
|
1077
|
+
"svg",
|
|
1078
|
+
{
|
|
1079
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1080
|
+
...c,
|
|
1081
|
+
viewBox: "0 0 20 20",
|
|
1082
|
+
fill: "none",
|
|
1083
|
+
children: [
|
|
1084
|
+
/* @__PURE__ */ t.jsx(
|
|
1085
|
+
"circle",
|
|
1086
|
+
{
|
|
1087
|
+
cx: "9.80547",
|
|
1088
|
+
cy: "9.8055",
|
|
1089
|
+
r: "7.49047",
|
|
1090
|
+
stroke: "currentColor",
|
|
1091
|
+
strokeWidth: "1.3",
|
|
1092
|
+
strokeLinecap: "round",
|
|
1093
|
+
strokeLinejoin: "round"
|
|
1094
|
+
}
|
|
1095
|
+
),
|
|
1096
|
+
/* @__PURE__ */ t.jsx(
|
|
1097
|
+
"path",
|
|
1098
|
+
{
|
|
1099
|
+
d: "M15.0153 15.4043L17.9519 18.3333",
|
|
1100
|
+
stroke: "currentColor",
|
|
1101
|
+
strokeWidth: "1.3",
|
|
1102
|
+
strokeLinecap: "round",
|
|
1103
|
+
strokeLinejoin: "round"
|
|
1104
|
+
}
|
|
1105
|
+
)
|
|
1106
|
+
]
|
|
1107
|
+
}
|
|
1108
|
+
), Rn = ({ isChecked: c }) => /* @__PURE__ */ t.jsxs("div", { className: "checkbox-wrapper-30", children: [
|
|
1109
|
+
/* @__PURE__ */ t.jsxs("span", { className: "checkbox", children: [
|
|
1110
|
+
/* @__PURE__ */ t.jsx(
|
|
1111
|
+
"input",
|
|
1112
|
+
{
|
|
1113
|
+
type: "checkbox",
|
|
1114
|
+
style: { pointerEvents: "none" },
|
|
1115
|
+
checked: c
|
|
1116
|
+
}
|
|
1117
|
+
),
|
|
1118
|
+
/* @__PURE__ */ t.jsx("svg", { children: /* @__PURE__ */ t.jsx("use", { xlinkHref: "#checkbox-30", className: "checkbox" }) })
|
|
1119
|
+
] }),
|
|
1120
|
+
/* @__PURE__ */ t.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "none" }, children: /* @__PURE__ */ t.jsx("symbol", { id: "checkbox-30", viewBox: "0 0 22 22", children: /* @__PURE__ */ t.jsx(
|
|
1121
|
+
"path",
|
|
1122
|
+
{
|
|
1123
|
+
fill: "none",
|
|
1124
|
+
stroke: "currentColor",
|
|
1125
|
+
d: "M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"
|
|
1126
|
+
}
|
|
1127
|
+
) }) })
|
|
1128
|
+
] }), _n = gn(
|
|
1129
|
+
({
|
|
1130
|
+
positionDropdown: c,
|
|
1131
|
+
dropdownLists: p,
|
|
1132
|
+
isComponentVisible: x,
|
|
1133
|
+
searchAble: b,
|
|
1134
|
+
onSearch: u,
|
|
1135
|
+
value: v,
|
|
1136
|
+
handleChangeValue: O,
|
|
1137
|
+
multiSelect: m,
|
|
1138
|
+
searchValue: f
|
|
1139
|
+
}, F) => {
|
|
1140
|
+
const [y, T] = G(0), [A, D] = G(), I = X(null);
|
|
1141
|
+
return B(() => {
|
|
1142
|
+
if (I.current) {
|
|
1143
|
+
const o = I.current.getBoundingClientRect();
|
|
1144
|
+
T(o.width);
|
|
1145
|
+
}
|
|
1146
|
+
}, [I, x]), B(() => {
|
|
1147
|
+
p && f ? p.forEach((o) => {
|
|
1148
|
+
if (o.label.startsWith(f || "")) {
|
|
1149
|
+
D(o.value);
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
}) : D(void 0);
|
|
1153
|
+
}, [f, p]), /* @__PURE__ */ t.jsx(t.Fragment, { children: x ? /* @__PURE__ */ t.jsxs(
|
|
1154
|
+
"div",
|
|
1155
|
+
{
|
|
1156
|
+
className: "starasia-input-dropdown-lists-container",
|
|
1157
|
+
onClick: (o) => o.stopPropagation(),
|
|
1158
|
+
ref: F,
|
|
1159
|
+
children: [
|
|
1160
|
+
b ? /* @__PURE__ */ t.jsxs(
|
|
1161
|
+
"div",
|
|
1162
|
+
{
|
|
1163
|
+
className: "starasia-input-dropdown-container-dropdown-search",
|
|
1164
|
+
style: {
|
|
1165
|
+
order: c == "bottom" ? 0 : 2,
|
|
1166
|
+
position: "sticky",
|
|
1167
|
+
top: 0,
|
|
1168
|
+
bottom: 0,
|
|
1169
|
+
zIndex: 1
|
|
1170
|
+
},
|
|
1171
|
+
children: [
|
|
1172
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "flex" }, children: /* @__PURE__ */ t.jsx(En, { strokeWidth: 2, width: 20 }) }),
|
|
1173
|
+
/* @__PURE__ */ t.jsx(
|
|
1174
|
+
"input",
|
|
1175
|
+
{
|
|
1176
|
+
onChange: (o) => {
|
|
1177
|
+
u && u(o.target.value);
|
|
1178
|
+
},
|
|
1179
|
+
value: f,
|
|
1180
|
+
autoFocus: !0,
|
|
1181
|
+
style: { width: "100%" }
|
|
1182
|
+
}
|
|
1183
|
+
)
|
|
1184
|
+
]
|
|
1185
|
+
}
|
|
1186
|
+
) : null,
|
|
1187
|
+
/* @__PURE__ */ t.jsx(
|
|
1188
|
+
"div",
|
|
1189
|
+
{
|
|
1190
|
+
className: `starasia-input-dropdwon-item-container ${m ? "multi" : ""}`,
|
|
1191
|
+
ref: I,
|
|
1192
|
+
children: p.map((o, $) => {
|
|
1193
|
+
const S = !!(v != null && v.find((h) => h.value === o.value));
|
|
1194
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1195
|
+
"div",
|
|
1196
|
+
{
|
|
1197
|
+
className: `starasia-input-dropdwon-item ${S ? "active" : " "} ${o.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1198
|
+
onClick: () => O(o.label, o.value),
|
|
1199
|
+
children: [
|
|
1200
|
+
m ? /* @__PURE__ */ t.jsx("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ t.jsx(Rn, { isChecked: S }) }) : null,
|
|
1201
|
+
o.icon ? /* @__PURE__ */ t.jsx("div", { children: or.cloneElement(o.icon, {
|
|
1202
|
+
width: 16
|
|
1203
|
+
}) }) : null,
|
|
1204
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1205
|
+
/* @__PURE__ */ t.jsx(
|
|
1206
|
+
"p",
|
|
1207
|
+
{
|
|
1208
|
+
className: `starasia-input-dropdwon-item-text ${S ? "active" : null} ${o.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1209
|
+
style: {
|
|
1210
|
+
textWrap: "nowrap",
|
|
1211
|
+
width: `${y - 12}px`,
|
|
1212
|
+
overflow: "hidden",
|
|
1213
|
+
textOverflow: "ellipsis"
|
|
1214
|
+
},
|
|
1215
|
+
children: o.label
|
|
1216
|
+
}
|
|
1217
|
+
),
|
|
1218
|
+
o.description ? /* @__PURE__ */ t.jsx(
|
|
1219
|
+
"p",
|
|
1220
|
+
{
|
|
1221
|
+
className: `starasia-input-dropdwon-item-text-description ${S ? "active" : null} ${o.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1222
|
+
style: {
|
|
1223
|
+
textWrap: "nowrap",
|
|
1224
|
+
width: `${y - 12}px`,
|
|
1225
|
+
overflow: "hidden",
|
|
1226
|
+
textOverflow: "ellipsis"
|
|
1227
|
+
},
|
|
1228
|
+
children: o.description
|
|
1229
|
+
}
|
|
1230
|
+
) : null
|
|
1231
|
+
] })
|
|
1232
|
+
]
|
|
1233
|
+
},
|
|
1234
|
+
$
|
|
1235
|
+
);
|
|
1236
|
+
})
|
|
1237
|
+
}
|
|
1238
|
+
)
|
|
1239
|
+
]
|
|
1240
|
+
}
|
|
1241
|
+
) : null });
|
|
1242
|
+
}
|
|
1243
|
+
), jn = ({
|
|
1244
|
+
children: c,
|
|
1245
|
+
handleChangePosition: p
|
|
1246
|
+
}) => {
|
|
1247
|
+
const x = X(null);
|
|
1248
|
+
B(() => {
|
|
1249
|
+
var O;
|
|
1250
|
+
const u = () => {
|
|
1251
|
+
if (x.current) {
|
|
1252
|
+
let m = x.current.parentElement;
|
|
1253
|
+
for (; m && !b(m); )
|
|
1254
|
+
m = m.parentElement;
|
|
1255
|
+
m && p();
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1258
|
+
let v = (O = x.current) == null ? void 0 : O.parentElement;
|
|
1259
|
+
for (; v && !b(v); )
|
|
1260
|
+
v = v.parentElement;
|
|
1261
|
+
return v && v.addEventListener("scroll", u), u(), () => {
|
|
1262
|
+
v && v.removeEventListener("scroll", u);
|
|
1263
|
+
};
|
|
1264
|
+
}, []);
|
|
1265
|
+
const b = (u) => u && (u.scrollHeight > u.clientHeight || u.scrollWidth > u.clientWidth);
|
|
1266
|
+
return /* @__PURE__ */ t.jsx("div", { ref: x, children: c });
|
|
1267
|
+
}, Br = "starasia-input-dropdown-styles", Cn = (c) => {
|
|
1268
|
+
if (!document.getElementById(Br)) {
|
|
1269
|
+
const p = document.createElement("style");
|
|
1270
|
+
p.id = Br, p.textContent = c, document.head.appendChild(p);
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
Cn(mn);
|
|
1274
|
+
const Sn = ({
|
|
1275
|
+
dropdownLists: c,
|
|
1276
|
+
onChange: p,
|
|
1277
|
+
defaultValue: x,
|
|
1278
|
+
size: b = "md",
|
|
1279
|
+
multiSelect: u,
|
|
1280
|
+
searchAble: v,
|
|
1281
|
+
iconLeft: O,
|
|
1282
|
+
placeholder: m,
|
|
1283
|
+
onSearch: f,
|
|
1284
|
+
error: F,
|
|
1285
|
+
onBlur: y,
|
|
1286
|
+
onFocus: T,
|
|
1287
|
+
disable: A,
|
|
1288
|
+
searchValue: D
|
|
1289
|
+
}) => {
|
|
1290
|
+
const I = X(), [o, $] = G([]), [S, h] = G(""), W = X(null), { isComponentVisible: V, ref: U, setIsComponentVisible: Z } = yn(!1), ir = () => {
|
|
1291
|
+
Z((R) => !R);
|
|
1292
|
+
}, Q = (R, k) => {
|
|
1293
|
+
if (!u)
|
|
1294
|
+
$([{ label: R, value: k }]), p([{ label: R, value: k }]), Z(!1);
|
|
1295
|
+
else if (o == null ? void 0 : o.find((E) => E.value === k)) {
|
|
1296
|
+
const E = [
|
|
1297
|
+
...o ? o.filter((z) => z.value !== k) : []
|
|
1298
|
+
];
|
|
1299
|
+
$(E), p(E);
|
|
1300
|
+
} else {
|
|
1301
|
+
const E = [...o || [], { label: R, value: k }];
|
|
1302
|
+
$(E), p(E);
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1305
|
+
B(() => {
|
|
1306
|
+
JSON.stringify(I.current) === JSON.stringify(x) || (I.current = x, $(I.current || []));
|
|
1307
|
+
}, [x]);
|
|
1308
|
+
const rr = () => o.length ? u ? o == null ? void 0 : o.map((R, k) => /* @__PURE__ */ t.jsxs("div", { className: "starasia-input-dropdown-preview-item", children: [
|
|
1309
|
+
/* @__PURE__ */ t.jsx("p", { style: { minWidth: "max-content" }, children: R == null ? void 0 : R.label }, k),
|
|
1310
|
+
/* @__PURE__ */ t.jsx(
|
|
1311
|
+
On,
|
|
1312
|
+
{
|
|
1313
|
+
onClick: () => Q(R.label, R.value)
|
|
1314
|
+
}
|
|
1315
|
+
)
|
|
1316
|
+
] })) : /* @__PURE__ */ t.jsx("p", { style: { minWidth: "max-content" }, children: o == null ? void 0 : o[0].label }) : /* @__PURE__ */ t.jsx("p", { className: "starasia-input-dropdown-placeholder", children: m }), L = () => {
|
|
1317
|
+
if (U.current && W.current) {
|
|
1318
|
+
const R = window.innerHeight, k = U.current.getBoundingClientRect(), j = W.current.getBoundingClientRect(), E = k.bottom + j.height;
|
|
1319
|
+
W.current.style.left = `${k.left}px`, W.current.style.width = `${k.width}px`, E >= R - 10 ? (W.current.style.top = `${k.top - j.height - 5}px`, h("top")) : (W.current.style.top = `${k.top + k.height}px`, h("bottom"));
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
return B(() => (window.addEventListener("scroll", L), window.addEventListener("resize", L), () => {
|
|
1323
|
+
window.removeEventListener("scroll", L), window.removeEventListener("resize", L);
|
|
1324
|
+
}), []), B(() => {
|
|
1325
|
+
L();
|
|
1326
|
+
}, [V]), /* @__PURE__ */ t.jsx(jn, { handleChangePosition: L, children: /* @__PURE__ */ t.jsxs(
|
|
1327
|
+
"div",
|
|
1328
|
+
{
|
|
1329
|
+
className: `starasia-input-dropdown-container ${A ? "disable" : ""} starasia-input-dropdown-size-${b} ${V ? "active" : ""} ${F ? "error" : ""}`,
|
|
1330
|
+
ref: U,
|
|
1331
|
+
onClick: ir,
|
|
1332
|
+
children: [
|
|
1333
|
+
/* @__PURE__ */ t.jsxs("div", { className: "starasia-input-dropdown-preview-container", children: [
|
|
1334
|
+
O ? /* @__PURE__ */ t.jsx(t.Fragment, { children: or.cloneElement(O, {
|
|
1335
|
+
width: Yr(b),
|
|
1336
|
+
color: "#939E99",
|
|
1337
|
+
style: {
|
|
1338
|
+
color: "#939E99"
|
|
1339
|
+
}
|
|
1340
|
+
}) }) : null,
|
|
1341
|
+
/* @__PURE__ */ t.jsx(
|
|
1342
|
+
"div",
|
|
1343
|
+
{
|
|
1344
|
+
className: "starasia-input-dropdown-container-preview-item",
|
|
1345
|
+
tabIndex: 100,
|
|
1346
|
+
onBlur: y,
|
|
1347
|
+
onFocus: T,
|
|
1348
|
+
children: rr()
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
/* @__PURE__ */ t.jsx(
|
|
1352
|
+
kn,
|
|
1353
|
+
{
|
|
1354
|
+
strokeWidth: 2,
|
|
1355
|
+
width: Yr(b),
|
|
1356
|
+
style: { color: "#939E99" }
|
|
1357
|
+
}
|
|
1358
|
+
)
|
|
1359
|
+
] }),
|
|
1360
|
+
/* @__PURE__ */ t.jsx(
|
|
1361
|
+
_n,
|
|
1362
|
+
{
|
|
1363
|
+
dropdownLists: c,
|
|
1364
|
+
handleChangeValue: Q,
|
|
1365
|
+
isComponentVisible: V,
|
|
1366
|
+
positionDropdown: S,
|
|
1367
|
+
searchAble: !!v,
|
|
1368
|
+
value: o,
|
|
1369
|
+
onSearch: f,
|
|
1370
|
+
ref: W,
|
|
1371
|
+
multiSelect: u,
|
|
1372
|
+
searchValue: D
|
|
1373
|
+
}
|
|
1374
|
+
)
|
|
1375
|
+
]
|
|
1376
|
+
}
|
|
1377
|
+
) });
|
|
1378
|
+
}, Yr = (c) => {
|
|
1379
|
+
if (c === "sm")
|
|
1380
|
+
return 16;
|
|
1381
|
+
if (c === "md")
|
|
1382
|
+
return 16;
|
|
1383
|
+
if (c === "lg")
|
|
1384
|
+
return 20;
|
|
1385
|
+
}, On = (c) => /* @__PURE__ */ t.jsx(
|
|
1386
|
+
"svg",
|
|
1387
|
+
{
|
|
1388
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1389
|
+
width: "18",
|
|
1390
|
+
height: "18",
|
|
1391
|
+
viewBox: "0 0 18 18",
|
|
1392
|
+
fill: "none",
|
|
1393
|
+
...c,
|
|
1394
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1395
|
+
"path",
|
|
1396
|
+
{
|
|
1397
|
+
d: "M12 6L6 12M6.00001 6L12 12",
|
|
1398
|
+
stroke: "currentColor",
|
|
1399
|
+
"stroke-width": "1.5",
|
|
1400
|
+
"stroke-linecap": "round",
|
|
1401
|
+
"stroke-linejoin": "round"
|
|
1402
|
+
}
|
|
1403
|
+
)
|
|
1404
|
+
}
|
|
1405
|
+
);
|
|
1406
|
+
export {
|
|
1407
|
+
Sn as Dropdown
|
|
1408
|
+
};
|