@starasia/dropdown 1.0.3 → 1.0.4
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 +174 -815
- package/dist/dropdown.umd.js +2 -33
- package/package.json +6 -6
package/dist/dropdown.es.js
CHANGED
|
@@ -1,647 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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");
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import F, { useState as k, useRef as y, useEffect as b, forwardRef as M } from "react";
|
|
3
|
+
const P = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
645
4
|
* {
|
|
646
5
|
margin: 0;
|
|
647
6
|
padding: 0;
|
|
@@ -1046,23 +405,23 @@ const mn = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@3
|
|
|
1046
405
|
width: 100%;
|
|
1047
406
|
}
|
|
1048
407
|
`;
|
|
1049
|
-
function
|
|
1050
|
-
const [
|
|
1051
|
-
|
|
408
|
+
function V(a) {
|
|
409
|
+
const [i, t] = k(a), c = y(null), o = (e) => {
|
|
410
|
+
c.current && !c.current.contains(e.target) && t(!1);
|
|
1052
411
|
};
|
|
1053
|
-
return
|
|
1054
|
-
document.removeEventListener("click",
|
|
1055
|
-
}), []), { ref:
|
|
412
|
+
return b(() => (document.addEventListener("click", o, !0), () => {
|
|
413
|
+
document.removeEventListener("click", o, !0);
|
|
414
|
+
}), []), { ref: c, isComponentVisible: i, setIsComponentVisible: t };
|
|
1056
415
|
}
|
|
1057
|
-
const
|
|
416
|
+
const J = ({ ...a }) => /* @__PURE__ */ r(
|
|
1058
417
|
"svg",
|
|
1059
418
|
{
|
|
1060
419
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1061
|
-
...
|
|
420
|
+
...a,
|
|
1062
421
|
viewBox: "0 0 24 24",
|
|
1063
422
|
fill: "none",
|
|
1064
423
|
color: "#939E99",
|
|
1065
|
-
children: /* @__PURE__ */
|
|
424
|
+
children: /* @__PURE__ */ r(
|
|
1066
425
|
"path",
|
|
1067
426
|
{
|
|
1068
427
|
d: "M4 9L12 17L20 9",
|
|
@@ -1073,15 +432,15 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1073
432
|
}
|
|
1074
433
|
)
|
|
1075
434
|
}
|
|
1076
|
-
),
|
|
435
|
+
), G = ({ ...a }) => /* @__PURE__ */ p(
|
|
1077
436
|
"svg",
|
|
1078
437
|
{
|
|
1079
438
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1080
|
-
...
|
|
439
|
+
...a,
|
|
1081
440
|
viewBox: "0 0 20 20",
|
|
1082
441
|
fill: "none",
|
|
1083
442
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ r(
|
|
1085
444
|
"circle",
|
|
1086
445
|
{
|
|
1087
446
|
cx: "9.80547",
|
|
@@ -1093,7 +452,7 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1093
452
|
strokeLinejoin: "round"
|
|
1094
453
|
}
|
|
1095
454
|
),
|
|
1096
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ r(
|
|
1097
456
|
"path",
|
|
1098
457
|
{
|
|
1099
458
|
d: "M15.0153 15.4043L17.9519 18.3333",
|
|
@@ -1105,19 +464,19 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1105
464
|
)
|
|
1106
465
|
]
|
|
1107
466
|
}
|
|
1108
|
-
),
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
/* @__PURE__ */
|
|
467
|
+
), K = ({ isChecked: a }) => /* @__PURE__ */ p("div", { className: "checkbox-wrapper-30", children: [
|
|
468
|
+
/* @__PURE__ */ p("span", { className: "checkbox", children: [
|
|
469
|
+
/* @__PURE__ */ r(
|
|
1111
470
|
"input",
|
|
1112
471
|
{
|
|
1113
472
|
type: "checkbox",
|
|
1114
473
|
style: { pointerEvents: "none" },
|
|
1115
|
-
checked:
|
|
474
|
+
checked: a
|
|
1116
475
|
}
|
|
1117
476
|
),
|
|
1118
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ r("svg", { children: /* @__PURE__ */ r("use", { xlinkHref: "#checkbox-30", className: "checkbox" }) })
|
|
1119
478
|
] }),
|
|
1120
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ r("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "none" }, children: /* @__PURE__ */ r("symbol", { id: "checkbox-30", viewBox: "0 0 22 22", children: /* @__PURE__ */ r(
|
|
1121
480
|
"path",
|
|
1122
481
|
{
|
|
1123
482
|
fill: "none",
|
|
@@ -1125,58 +484,58 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1125
484
|
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
485
|
}
|
|
1127
486
|
) }) })
|
|
1128
|
-
] }),
|
|
487
|
+
] }), Q = M(
|
|
1129
488
|
({
|
|
1130
|
-
positionDropdown:
|
|
1131
|
-
dropdownLists:
|
|
1132
|
-
isComponentVisible:
|
|
1133
|
-
searchAble:
|
|
1134
|
-
onSearch:
|
|
1135
|
-
value:
|
|
1136
|
-
handleChangeValue:
|
|
1137
|
-
multiSelect:
|
|
1138
|
-
searchValue:
|
|
1139
|
-
},
|
|
1140
|
-
const [
|
|
1141
|
-
return
|
|
1142
|
-
if (
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
}
|
|
1146
|
-
}, [
|
|
1147
|
-
|
|
1148
|
-
if (
|
|
1149
|
-
|
|
489
|
+
positionDropdown: a,
|
|
490
|
+
dropdownLists: i,
|
|
491
|
+
isComponentVisible: t,
|
|
492
|
+
searchAble: c,
|
|
493
|
+
onSearch: o,
|
|
494
|
+
value: e,
|
|
495
|
+
handleChangeValue: h,
|
|
496
|
+
multiSelect: l,
|
|
497
|
+
searchValue: v
|
|
498
|
+
}, I) => {
|
|
499
|
+
const [C, R] = k(0), [$, z] = k(), w = y(null);
|
|
500
|
+
return b(() => {
|
|
501
|
+
if (w.current) {
|
|
502
|
+
const n = w.current.getBoundingClientRect();
|
|
503
|
+
R(n.width);
|
|
504
|
+
}
|
|
505
|
+
}, [w, t]), b(() => {
|
|
506
|
+
i && v ? i.forEach((n) => {
|
|
507
|
+
if (n.label.startsWith(v || "")) {
|
|
508
|
+
z(n.value);
|
|
1150
509
|
return;
|
|
1151
510
|
}
|
|
1152
|
-
}) :
|
|
1153
|
-
}, [
|
|
511
|
+
}) : z(void 0);
|
|
512
|
+
}, [v, i]), /* @__PURE__ */ r(q, { children: t ? /* @__PURE__ */ p(
|
|
1154
513
|
"div",
|
|
1155
514
|
{
|
|
1156
515
|
className: "starasia-input-dropdown-lists-container",
|
|
1157
|
-
onClick: (
|
|
1158
|
-
ref:
|
|
516
|
+
onClick: (n) => n.stopPropagation(),
|
|
517
|
+
ref: I,
|
|
1159
518
|
children: [
|
|
1160
|
-
|
|
519
|
+
c ? /* @__PURE__ */ p(
|
|
1161
520
|
"div",
|
|
1162
521
|
{
|
|
1163
522
|
className: "starasia-input-dropdown-container-dropdown-search",
|
|
1164
523
|
style: {
|
|
1165
|
-
order:
|
|
524
|
+
order: a == "bottom" ? 0 : 2,
|
|
1166
525
|
position: "sticky",
|
|
1167
526
|
top: 0,
|
|
1168
527
|
bottom: 0,
|
|
1169
528
|
zIndex: 1
|
|
1170
529
|
},
|
|
1171
530
|
children: [
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ r("div", { style: { display: "flex" }, children: /* @__PURE__ */ r(G, { strokeWidth: 2, width: 20 }) }),
|
|
532
|
+
/* @__PURE__ */ r(
|
|
1174
533
|
"input",
|
|
1175
534
|
{
|
|
1176
|
-
onChange: (
|
|
1177
|
-
|
|
535
|
+
onChange: (n) => {
|
|
536
|
+
o && o(n.target.value);
|
|
1178
537
|
},
|
|
1179
|
-
value:
|
|
538
|
+
value: v,
|
|
1180
539
|
autoFocus: !0,
|
|
1181
540
|
style: { width: "100%" }
|
|
1182
541
|
}
|
|
@@ -1184,54 +543,54 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1184
543
|
]
|
|
1185
544
|
}
|
|
1186
545
|
) : null,
|
|
1187
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ r(
|
|
1188
547
|
"div",
|
|
1189
548
|
{
|
|
1190
|
-
className: `starasia-input-dropdwon-item-container ${
|
|
1191
|
-
ref:
|
|
1192
|
-
children:
|
|
1193
|
-
const
|
|
1194
|
-
return /* @__PURE__ */
|
|
549
|
+
className: `starasia-input-dropdwon-item-container ${l ? "multi" : ""}`,
|
|
550
|
+
ref: w,
|
|
551
|
+
children: i.map((n, f) => {
|
|
552
|
+
const x = !!(e != null && e.find((E) => E.value === n.value));
|
|
553
|
+
return /* @__PURE__ */ p(
|
|
1195
554
|
"div",
|
|
1196
555
|
{
|
|
1197
|
-
className: `starasia-input-dropdwon-item ${
|
|
1198
|
-
onClick: () =>
|
|
556
|
+
className: `starasia-input-dropdwon-item ${x ? "active" : " "} ${n.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
557
|
+
onClick: () => h(n.label, n.value),
|
|
1199
558
|
children: [
|
|
1200
|
-
|
|
1201
|
-
|
|
559
|
+
l ? /* @__PURE__ */ r("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ r(K, { isChecked: x }) }) : null,
|
|
560
|
+
n.icon ? /* @__PURE__ */ r("div", { children: F.cloneElement(n.icon, {
|
|
1202
561
|
width: 16
|
|
1203
562
|
}) }) : null,
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ p("div", { children: [
|
|
564
|
+
/* @__PURE__ */ r(
|
|
1206
565
|
"p",
|
|
1207
566
|
{
|
|
1208
|
-
className: `starasia-input-dropdwon-item-text ${
|
|
567
|
+
className: `starasia-input-dropdwon-item-text ${x ? "active" : null} ${n.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1209
568
|
style: {
|
|
1210
569
|
textWrap: "nowrap",
|
|
1211
|
-
width: `${
|
|
570
|
+
width: `${C - 12}px`,
|
|
1212
571
|
overflow: "hidden",
|
|
1213
572
|
textOverflow: "ellipsis"
|
|
1214
573
|
},
|
|
1215
|
-
children:
|
|
574
|
+
children: n.label
|
|
1216
575
|
}
|
|
1217
576
|
),
|
|
1218
|
-
|
|
577
|
+
n.description ? /* @__PURE__ */ r(
|
|
1219
578
|
"p",
|
|
1220
579
|
{
|
|
1221
|
-
className: `starasia-input-dropdwon-item-text-description ${
|
|
580
|
+
className: `starasia-input-dropdwon-item-text-description ${x ? "active" : null} ${n.disable ? "starasia-input-dropdwon-item-disable" : null}`,
|
|
1222
581
|
style: {
|
|
1223
582
|
textWrap: "nowrap",
|
|
1224
|
-
width: `${
|
|
583
|
+
width: `${C - 12}px`,
|
|
1225
584
|
overflow: "hidden",
|
|
1226
585
|
textOverflow: "ellipsis"
|
|
1227
586
|
},
|
|
1228
|
-
children:
|
|
587
|
+
children: n.description
|
|
1229
588
|
}
|
|
1230
589
|
) : null
|
|
1231
590
|
] })
|
|
1232
591
|
]
|
|
1233
592
|
},
|
|
1234
|
-
|
|
593
|
+
f
|
|
1235
594
|
);
|
|
1236
595
|
})
|
|
1237
596
|
}
|
|
@@ -1240,149 +599,149 @@ const kn = ({ ...c }) => /* @__PURE__ */ t.jsx(
|
|
|
1240
599
|
}
|
|
1241
600
|
) : null });
|
|
1242
601
|
}
|
|
1243
|
-
),
|
|
1244
|
-
children:
|
|
1245
|
-
handleChangePosition:
|
|
602
|
+
), T = ({
|
|
603
|
+
children: a,
|
|
604
|
+
handleChangePosition: i
|
|
1246
605
|
}) => {
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
var
|
|
1250
|
-
const
|
|
1251
|
-
if (
|
|
1252
|
-
let
|
|
1253
|
-
for (;
|
|
1254
|
-
|
|
1255
|
-
|
|
606
|
+
const t = y(null);
|
|
607
|
+
b(() => {
|
|
608
|
+
var h;
|
|
609
|
+
const o = () => {
|
|
610
|
+
if (t.current) {
|
|
611
|
+
let l = t.current.parentElement;
|
|
612
|
+
for (; l && !c(l); )
|
|
613
|
+
l = l.parentElement;
|
|
614
|
+
l && i();
|
|
1256
615
|
}
|
|
1257
616
|
};
|
|
1258
|
-
let
|
|
1259
|
-
for (;
|
|
1260
|
-
|
|
1261
|
-
return
|
|
1262
|
-
|
|
617
|
+
let e = (h = t.current) == null ? void 0 : h.parentElement;
|
|
618
|
+
for (; e && !c(e); )
|
|
619
|
+
e = e.parentElement;
|
|
620
|
+
return e && e.addEventListener("scroll", o), o(), () => {
|
|
621
|
+
e && e.removeEventListener("scroll", o);
|
|
1263
622
|
};
|
|
1264
623
|
}, []);
|
|
1265
|
-
const
|
|
1266
|
-
return /* @__PURE__ */
|
|
1267
|
-
},
|
|
1268
|
-
if (!document.getElementById(
|
|
1269
|
-
const
|
|
1270
|
-
|
|
624
|
+
const c = (o) => o && (o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth);
|
|
625
|
+
return /* @__PURE__ */ r("div", { ref: t, children: a });
|
|
626
|
+
}, A = "starasia-input-dropdown-styles", U = (a) => {
|
|
627
|
+
if (!document.getElementById(A)) {
|
|
628
|
+
const i = document.createElement("style");
|
|
629
|
+
i.id = A, i.textContent = a, document.head.appendChild(i);
|
|
1271
630
|
}
|
|
1272
631
|
};
|
|
1273
|
-
|
|
1274
|
-
const
|
|
1275
|
-
dropdownLists:
|
|
1276
|
-
onChange:
|
|
1277
|
-
defaultValue:
|
|
1278
|
-
size:
|
|
1279
|
-
multiSelect:
|
|
1280
|
-
searchAble:
|
|
1281
|
-
iconLeft:
|
|
1282
|
-
placeholder:
|
|
1283
|
-
onSearch:
|
|
1284
|
-
error:
|
|
1285
|
-
onBlur:
|
|
1286
|
-
onFocus:
|
|
1287
|
-
disable:
|
|
1288
|
-
searchValue:
|
|
632
|
+
U(P);
|
|
633
|
+
const _ = ({
|
|
634
|
+
dropdownLists: a,
|
|
635
|
+
onChange: i,
|
|
636
|
+
defaultValue: t,
|
|
637
|
+
size: c = "md",
|
|
638
|
+
multiSelect: o,
|
|
639
|
+
searchAble: e,
|
|
640
|
+
iconLeft: h,
|
|
641
|
+
placeholder: l,
|
|
642
|
+
onSearch: v,
|
|
643
|
+
error: I,
|
|
644
|
+
onBlur: C,
|
|
645
|
+
onFocus: R,
|
|
646
|
+
disable: $,
|
|
647
|
+
searchValue: z
|
|
1289
648
|
}) => {
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
},
|
|
1293
|
-
if (!
|
|
1294
|
-
|
|
1295
|
-
else if (
|
|
1296
|
-
const
|
|
1297
|
-
...
|
|
649
|
+
const w = y(), [n, f] = k([]), [x, E] = k(""), g = y(null), { isComponentVisible: B, ref: L, setIsComponentVisible: N } = V(!1), H = () => {
|
|
650
|
+
N((s) => !s);
|
|
651
|
+
}, j = (s, d) => {
|
|
652
|
+
if (!o)
|
|
653
|
+
f([{ label: s, value: d }]), i([{ label: s, value: d }]), N(!1);
|
|
654
|
+
else if (n == null ? void 0 : n.find((u) => u.value === d)) {
|
|
655
|
+
const u = [
|
|
656
|
+
...n ? n.filter((D) => D.value !== d) : []
|
|
1298
657
|
];
|
|
1299
|
-
|
|
658
|
+
f(u), i(u);
|
|
1300
659
|
} else {
|
|
1301
|
-
const
|
|
1302
|
-
|
|
660
|
+
const u = [...n || [], { label: s, value: d }];
|
|
661
|
+
f(u), i(u);
|
|
1303
662
|
}
|
|
1304
663
|
};
|
|
1305
|
-
|
|
1306
|
-
JSON.stringify(
|
|
1307
|
-
}, [
|
|
1308
|
-
const
|
|
1309
|
-
/* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
|
|
664
|
+
b(() => {
|
|
665
|
+
JSON.stringify(w.current) === JSON.stringify(t) || (w.current = t, f(w.current || []));
|
|
666
|
+
}, [t]);
|
|
667
|
+
const O = () => n.length ? o ? n == null ? void 0 : n.map((s, d) => /* @__PURE__ */ p("div", { className: "starasia-input-dropdown-preview-item", children: [
|
|
668
|
+
/* @__PURE__ */ r("p", { style: { minWidth: "max-content" }, children: s == null ? void 0 : s.label }, d),
|
|
669
|
+
/* @__PURE__ */ r(
|
|
670
|
+
X,
|
|
1312
671
|
{
|
|
1313
|
-
onClick: () =>
|
|
672
|
+
onClick: () => j(s.label, s.value)
|
|
1314
673
|
}
|
|
1315
674
|
)
|
|
1316
|
-
] })) : /* @__PURE__ */
|
|
1317
|
-
if (
|
|
1318
|
-
const
|
|
1319
|
-
|
|
675
|
+
] })) : /* @__PURE__ */ r("p", { style: { minWidth: "max-content" }, children: n == null ? void 0 : n[0].label }) : /* @__PURE__ */ r("p", { className: "starasia-input-dropdown-placeholder", children: l }), m = () => {
|
|
676
|
+
if (L.current && g.current) {
|
|
677
|
+
const s = window.innerHeight, d = L.current.getBoundingClientRect(), W = g.current.getBoundingClientRect(), u = d.bottom + W.height;
|
|
678
|
+
g.current.style.left = `${d.left}px`, g.current.style.width = `${d.width}px`, u >= s - 10 ? (g.current.style.top = `${d.top - W.height - 5}px`, E("top")) : (g.current.style.top = `${d.top + d.height}px`, E("bottom"));
|
|
1320
679
|
}
|
|
1321
680
|
};
|
|
1322
|
-
return
|
|
1323
|
-
window.removeEventListener("scroll",
|
|
1324
|
-
}), []),
|
|
1325
|
-
|
|
1326
|
-
}, [
|
|
681
|
+
return b(() => (window.addEventListener("scroll", m), window.addEventListener("resize", m), () => {
|
|
682
|
+
window.removeEventListener("scroll", m), window.removeEventListener("resize", m);
|
|
683
|
+
}), []), b(() => {
|
|
684
|
+
m();
|
|
685
|
+
}, [B]), /* @__PURE__ */ r(T, { handleChangePosition: m, children: /* @__PURE__ */ p(
|
|
1327
686
|
"div",
|
|
1328
687
|
{
|
|
1329
|
-
className: `starasia-input-dropdown-container ${
|
|
1330
|
-
ref:
|
|
1331
|
-
onClick:
|
|
688
|
+
className: `starasia-input-dropdown-container ${$ ? "disable" : ""} starasia-input-dropdown-size-${c} ${B ? "active" : ""} ${I ? "error" : ""}`,
|
|
689
|
+
ref: L,
|
|
690
|
+
onClick: H,
|
|
1332
691
|
children: [
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
|
|
1335
|
-
width:
|
|
692
|
+
/* @__PURE__ */ p("div", { className: "starasia-input-dropdown-preview-container", children: [
|
|
693
|
+
h ? /* @__PURE__ */ r(q, { children: F.cloneElement(h, {
|
|
694
|
+
width: S(c),
|
|
1336
695
|
color: "#939E99",
|
|
1337
696
|
style: {
|
|
1338
697
|
color: "#939E99"
|
|
1339
698
|
}
|
|
1340
699
|
}) }) : null,
|
|
1341
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ r(
|
|
1342
701
|
"div",
|
|
1343
702
|
{
|
|
1344
703
|
className: "starasia-input-dropdown-container-preview-item",
|
|
1345
704
|
tabIndex: 100,
|
|
1346
|
-
onBlur:
|
|
1347
|
-
onFocus:
|
|
1348
|
-
children:
|
|
705
|
+
onBlur: C,
|
|
706
|
+
onFocus: R,
|
|
707
|
+
children: O()
|
|
1349
708
|
}
|
|
1350
709
|
),
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
|
|
710
|
+
/* @__PURE__ */ r(
|
|
711
|
+
J,
|
|
1353
712
|
{
|
|
1354
713
|
strokeWidth: 2,
|
|
1355
|
-
width:
|
|
714
|
+
width: S(c),
|
|
1356
715
|
style: { color: "#939E99" }
|
|
1357
716
|
}
|
|
1358
717
|
)
|
|
1359
718
|
] }),
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
|
|
719
|
+
/* @__PURE__ */ r(
|
|
720
|
+
Q,
|
|
1362
721
|
{
|
|
1363
|
-
dropdownLists:
|
|
1364
|
-
handleChangeValue:
|
|
1365
|
-
isComponentVisible:
|
|
1366
|
-
positionDropdown:
|
|
1367
|
-
searchAble: !!
|
|
1368
|
-
value:
|
|
1369
|
-
onSearch:
|
|
1370
|
-
ref:
|
|
1371
|
-
multiSelect:
|
|
1372
|
-
searchValue:
|
|
722
|
+
dropdownLists: a,
|
|
723
|
+
handleChangeValue: j,
|
|
724
|
+
isComponentVisible: B,
|
|
725
|
+
positionDropdown: x,
|
|
726
|
+
searchAble: !!e,
|
|
727
|
+
value: n,
|
|
728
|
+
onSearch: v,
|
|
729
|
+
ref: g,
|
|
730
|
+
multiSelect: o,
|
|
731
|
+
searchValue: z
|
|
1373
732
|
}
|
|
1374
733
|
)
|
|
1375
734
|
]
|
|
1376
735
|
}
|
|
1377
736
|
) });
|
|
1378
|
-
},
|
|
1379
|
-
if (
|
|
737
|
+
}, S = (a) => {
|
|
738
|
+
if (a === "sm")
|
|
1380
739
|
return 16;
|
|
1381
|
-
if (
|
|
740
|
+
if (a === "md")
|
|
1382
741
|
return 16;
|
|
1383
|
-
if (
|
|
742
|
+
if (a === "lg")
|
|
1384
743
|
return 20;
|
|
1385
|
-
},
|
|
744
|
+
}, X = (a) => /* @__PURE__ */ r(
|
|
1386
745
|
"svg",
|
|
1387
746
|
{
|
|
1388
747
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1390,8 +749,8 @@ const Sn = ({
|
|
|
1390
749
|
height: "18",
|
|
1391
750
|
viewBox: "0 0 18 18",
|
|
1392
751
|
fill: "none",
|
|
1393
|
-
...
|
|
1394
|
-
children: /* @__PURE__ */
|
|
752
|
+
...a,
|
|
753
|
+
children: /* @__PURE__ */ r(
|
|
1395
754
|
"path",
|
|
1396
755
|
{
|
|
1397
756
|
d: "M12 6L6 12M6.00001 6L12 12",
|
|
@@ -1404,5 +763,5 @@ const Sn = ({
|
|
|
1404
763
|
}
|
|
1405
764
|
);
|
|
1406
765
|
export {
|
|
1407
|
-
|
|
766
|
+
_ as Dropdown
|
|
1408
767
|
};
|
package/dist/dropdown.umd.js
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var hr;function Yr(){if(hr)return J;hr=1;var u=l,f=Symbol.for("react.element"),m=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,p=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function T(y,v,F){var k,O={},A=null,W=null;F!==void 0&&(A=""+F),v.key!==void 0&&(A=""+v.key),v.ref!==void 0&&(W=v.ref);for(k in v)x.call(v,k)&&!h.hasOwnProperty(k)&&(O[k]=v[k]);if(y&&y.defaultProps)for(k in v=y.defaultProps,v)O[k]===void 0&&(O[k]=v[k]);return{$$typeof:f,type:y,key:A,ref:W,props:O,_owner:p.current}}return J.Fragment=m,J.jsx=T,J.jsxs=T,J}var H={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var wr;function Mr(){return wr||(wr=1,process.env.NODE_ENV!=="production"&&function(){var u=l,f=Symbol.for("react.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),y=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),D=Symbol.iterator,o="@@iterator";function z(r){if(r===null||typeof r!="object")return null;var n=D&&r[D]||r[o];return typeof n=="function"?n:null}var P=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),a=1;a<n;a++)e[a-1]=arguments[a];L("error",r,e)}}function L(r,n,e){{var a=P.ReactDebugCurrentFrame,d=a.getStackAddendum();d!==""&&(n+="%s",e=e.concat([d]));var c=e.map(function(s){return String(s)});c.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,c)}}var K=!1,G=!1,Q=!1,or=!1,$=!1,q;q=Symbol.for("react.module.reference");function N(r){return!!(typeof r=="string"||typeof r=="function"||r===x||r===h||$||r===p||r===F||r===k||or||r===W||K||G||Q||typeof r=="object"&&r!==null&&(r.$$typeof===A||r.$$typeof===O||r.$$typeof===T||r.$$typeof===y||r.$$typeof===v||r.$$typeof===q||r.getModuleId!==void 0))}function j(r,n,e){var a=r.displayName;if(a)return a;var d=n.displayName||n.name||"";return d!==""?e+"("+d+")":e}function E(r){return r.displayName||"Context"}function C(r){if(r==null)return null;if(typeof r.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case m:return"Portal";case h:return"Profiler";case p:return"StrictMode";case F:return"Suspense";case k:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case y:var n=r;return E(n)+".Consumer";case T:var e=r;return E(e._context)+".Provider";case v:return j(r,r.render,"ForwardRef");case O:var a=r.displayName||null;return a!==null?a:C(r.type)||"Memo";case A:{var d=r,c=d._payload,s=d._init;try{return C(s(c))}catch{return null}}}return null}var R=Object.assign,Y=0,xr,mr,yr,kr,Er,Rr,jr;function _r(){}_r.__reactDisabledLog=!0;function $r(){{if(Y===0){xr=console.log,mr=console.info,yr=console.warn,kr=console.error,Er=console.group,Rr=console.groupCollapsed,jr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:_r,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Y++}}function qr(){{if(Y--,Y===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},r,{value:xr}),info:R({},r,{value:mr}),warn:R({},r,{value:yr}),error:R({},r,{value:kr}),group:R({},r,{value:Er}),groupCollapsed:R({},r,{value:Rr}),groupEnd:R({},r,{value:jr})})}Y<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ir=P.ReactCurrentDispatcher,sr;function rr(r,n,e){{if(sr===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);sr=a&&a[1]||""}return`
|
|
18
|
-
`+sr+r}}var dr=!1,nr;{var rn=typeof WeakMap=="function"?WeakMap:Map;nr=new rn}function Cr(r,n){if(!r||dr)return"";{var e=nr.get(r);if(e!==void 0)return e}var a;dr=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=ir.current,ir.current=null,$r();try{if(n){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(S){a=S}Reflect.construct(r,[],s)}else{try{s.call()}catch(S){a=S}r.call(s.prototype)}}else{try{throw Error()}catch(S){a=S}r()}}catch(S){if(S&&a&&typeof S.stack=="string"){for(var i=S.stack.split(`
|
|
19
|
-
`),_=a.stack.split(`
|
|
20
|
-
`),g=i.length-1,b=_.length-1;g>=1&&b>=0&&i[g]!==_[b];)b--;for(;g>=1&&b>=0;g--,b--)if(i[g]!==_[b]){if(g!==1||b!==1)do if(g--,b--,b<0||i[g]!==_[b]){var I=`
|
|
21
|
-
`+i[g].replace(" at new "," at ");return r.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",r.displayName)),typeof r=="function"&&nr.set(r,I),I}while(g>=1&&b>=0);break}}}finally{dr=!1,ir.current=c,qr(),Error.prepareStackTrace=d}var U=r?r.displayName||r.name:"",M=U?rr(U):"";return typeof r=="function"&&nr.set(r,M),M}function nn(r,n,e){return Cr(r,!1)}function en(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function er(r,n,e){if(r==null)return"";if(typeof r=="function")return Cr(r,en(r));if(typeof r=="string")return rr(r);switch(r){case F:return rr("Suspense");case k:return rr("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case v:return nn(r.render);case O:return er(r.type,n,e);case A:{var a=r,d=a._payload,c=a._init;try{return er(c(d),n,e)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,Sr={},Tr=P.ReactDebugCurrentFrame;function ar(r){if(r){var n=r._owner,e=er(r.type,r._source,n?n.type:null);Tr.setExtraStackFrame(e)}else Tr.setExtraStackFrame(null)}function an(r,n,e,a,d){{var c=Function.call.bind(X);for(var s in r)if(c(r,s)){var i=void 0;try{if(typeof r[s]!="function"){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`.");throw _.name="Invariant Violation",_}i=r[s](n,s,a,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(g){i=g}i&&!(i instanceof Error)&&(ar(d),w("%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),ar(null)),i instanceof Error&&!(i.message in Sr)&&(Sr[i.message]=!0,ar(d),w("Failed %s type: %s",e,i.message),ar(null))}}}var tn=Array.isArray;function cr(r){return tn(r)}function on(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,e=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return e}}function sn(r){try{return Or(r),!1}catch{return!0}}function Or(r){return""+r}function Pr(r){if(sn(r))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",on(r)),Or(r)}var Z=P.ReactCurrentOwner,dn={key:!0,ref:!0,__self:!0,__source:!0},Ir,Dr,lr;lr={};function cn(r){if(X.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function ln(r){if(X.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function un(r,n){if(typeof r.ref=="string"&&Z.current&&n&&Z.current.stateNode!==n){var e=C(Z.current.type);lr[e]||(w('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',C(Z.current.type),r.ref),lr[e]=!0)}}function pn(r,n){{var e=function(){Ir||(Ir=!0,w("%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))};e.isReactWarning=!0,Object.defineProperty(r,"key",{get:e,configurable:!0})}}function fn(r,n){{var e=function(){Dr||(Dr=!0,w("%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))};e.isReactWarning=!0,Object.defineProperty(r,"ref",{get:e,configurable:!0})}}var vn=function(r,n,e,a,d,c,s){var i={$$typeof:f,type:r,key:n,ref:e,props:s,_owner:c};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function hn(r,n,e,a,d){{var c,s={},i=null,_=null;e!==void 0&&(Pr(e),i=""+e),ln(n)&&(Pr(n.key),i=""+n.key),cn(n)&&(_=n.ref,un(n,d));for(c in n)X.call(n,c)&&!dn.hasOwnProperty(c)&&(s[c]=n[c]);if(r&&r.defaultProps){var g=r.defaultProps;for(c in g)s[c]===void 0&&(s[c]=g[c])}if(i||_){var b=typeof r=="function"?r.displayName||r.name||"Unknown":r;i&&pn(s,b),_&&fn(s,b)}return vn(r,i,_,d,a,Z.current,s)}}var ur=P.ReactCurrentOwner,Fr=P.ReactDebugCurrentFrame;function V(r){if(r){var n=r._owner,e=er(r.type,r._source,n?n.type:null);Fr.setExtraStackFrame(e)}else Fr.setExtraStackFrame(null)}var pr;pr=!1;function fr(r){return typeof r=="object"&&r!==null&&r.$$typeof===f}function Ar(){{if(ur.current){var r=C(ur.current.type);if(r)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+r+"`."}return""}}function wn(r){{if(r!==void 0){var n=r.fileName.replace(/^.*[\\\/]/,""),e=r.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+n+":"+e+"."}return""}}var Wr={};function gn(r){{var n=Ar();if(!n){var e=typeof r=="string"?r:r.displayName||r.name;e&&(n=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+e+">.")}return n}}function Lr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=gn(n);if(Wr[e])return;Wr[e]=!0;var a="";r&&r._owner&&r._owner!==ur.current&&(a=" It was passed a child from "+C(r._owner.type)+"."),V(r),w('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),V(null)}}function zr(r,n){{if(typeof r!="object")return;if(cr(r))for(var e=0;e<r.length;e++){var a=r[e];fr(a)&&Lr(a,n)}else if(fr(r))r._store&&(r._store.validated=!0);else if(r){var d=z(r);if(typeof d=="function"&&d!==r.entries)for(var c=d.call(r),s;!(s=c.next()).done;)fr(s.value)&&Lr(s.value,n)}}}function bn(r){{var n=r.type;if(n==null||typeof n=="string")return;var e;if(typeof n=="function")e=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===v||n.$$typeof===O))e=n.propTypes;else return;if(e){var a=C(n);an(e,r.props,"prop",a,r)}else if(n.PropTypes!==void 0&&!pr){pr=!0;var d=C(n);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xn(r){{for(var n=Object.keys(r.props),e=0;e<n.length;e++){var a=n[e];if(a!=="children"&&a!=="key"){V(r),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),V(null);break}}r.ref!==null&&(V(r),w("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}var Nr={};function Br(r,n,e,a,d,c){{var s=N(r);if(!s){var i="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=wn(d);_?i+=_:i+=Ar();var g;r===null?g="null":cr(r)?g="array":r!==void 0&&r.$$typeof===f?(g="<"+(C(r.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):g=typeof r,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",g,i)}var b=hn(r,n,e,d,c);if(b==null)return b;if(s){var I=n.children;if(I!==void 0)if(a)if(cr(I)){for(var U=0;U<I.length;U++)zr(I[U],r);Object.freeze&&Object.freeze(I)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zr(I,r)}if(X.call(n,"key")){var M=C(r),S=Object.keys(n).filter(function(jn){return jn!=="key"}),vr=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!Nr[M+vr]){var Rn=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
28
|
-
let props = %s;
|
|
29
|
-
<%s {...props} />
|
|
30
|
-
React keys must be passed directly to JSX without using spread:
|
|
31
|
-
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,vr,M,Rn,M),Nr[M+vr]=!0}}return r===x?xn(b):bn(b),b}}function mn(r,n,e){return Br(r,n,e,!0)}function yn(r,n,e){return Br(r,n,e,!1)}var kn=yn,En=mn;H.Fragment=x,H.jsx=kn,H.jsxs=En}()),H}process.env.NODE_ENV==="production"?tr.exports=Yr():tr.exports=Mr();var t=tr.exports;const Vr=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
1
|
+
(function(w,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(w=typeof globalThis<"u"?globalThis:w||self,n(w.Dropdown={},w.jsxRuntime,w.React))})(this,function(w,n,o){"use strict";const q=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
|
|
33
2
|
* {
|
|
34
3
|
margin: 0;
|
|
35
4
|
padding: 0;
|
|
@@ -433,4 +402,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
433
402
|
height: 100%;
|
|
434
403
|
width: 100%;
|
|
435
404
|
}
|
|
436
|
-
`;function
|
|
405
|
+
`;function A(a){const[e,t]=o.useState(a),l=o.useRef(null),i=s=>{l.current&&!l.current.contains(s.target)&&t(!1)};return o.useEffect(()=>(document.addEventListener("click",i,!0),()=>{document.removeEventListener("click",i,!0)}),[]),{ref:l,isComponentVisible:e,setIsComponentVisible:t}}const D=({...a})=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...a,viewBox:"0 0 24 24",fill:"none",color:"#939E99",children:n.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})}),F=({...a})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...a,viewBox:"0 0 20 20",fill:"none",children:[n.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),O=({isChecked:a})=>n.jsxs("div",{className:"checkbox-wrapper-30",children:[n.jsxs("span",{className:"checkbox",children:[n.jsx("input",{type:"checkbox",style:{pointerEvents:"none"},checked:a}),n.jsx("svg",{children:n.jsx("use",{xlinkHref:"#checkbox-30",className:"checkbox"})})]}),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},children:n.jsx("symbol",{id:"checkbox-30",viewBox:"0 0 22 22",children:n.jsx("path",{fill:"none",stroke:"currentColor",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"})})})]}),H=o.forwardRef(({positionDropdown:a,dropdownLists:e,isComponentVisible:t,searchAble:l,onSearch:i,value:s,handleChangeValue:g,multiSelect:p,searchValue:v},E)=>{const[k,z]=o.useState(0),[N,m]=o.useState(),h=o.useRef(null);return o.useEffect(()=>{if(h.current){const r=h.current.getBoundingClientRect();z(r.width)}},[h,t]),o.useEffect(()=>{e&&v?e.forEach(r=>{if(r.label.startsWith(v||"")){m(r.value);return}}):m(void 0)},[v,e]),n.jsx(n.Fragment,{children:t?n.jsxs("div",{className:"starasia-input-dropdown-lists-container",onClick:r=>r.stopPropagation(),ref:E,children:[l?n.jsxs("div",{className:"starasia-input-dropdown-container-dropdown-search",style:{order:a=="bottom"?0:2,position:"sticky",top:0,bottom:0,zIndex:1},children:[n.jsx("div",{style:{display:"flex"},children:n.jsx(F,{strokeWidth:2,width:20})}),n.jsx("input",{onChange:r=>{i&&i(r.target.value)},value:v,autoFocus:!0,style:{width:"100%"}})]}):null,n.jsx("div",{className:`starasia-input-dropdwon-item-container ${p?"multi":""}`,ref:h,children:e.map((r,f)=>{const x=!!(s!=null&&s.find(C=>C.value===r.value));return n.jsxs("div",{className:`starasia-input-dropdwon-item ${x?"active":" "} ${r.disable?"starasia-input-dropdwon-item-disable":null}`,onClick:()=>g(r.label,r.value),children:[p?n.jsx("div",{style:{marginRight:"8px"},children:n.jsx(O,{isChecked:x})}):null,r.icon?n.jsx("div",{children:o.cloneElement(r.icon,{width:16})}):null,n.jsxs("div",{children:[n.jsx("p",{className:`starasia-input-dropdwon-item-text ${x?"active":null} ${r.disable?"starasia-input-dropdwon-item-disable":null}`,style:{textWrap:"nowrap",width:`${k-12}px`,overflow:"hidden",textOverflow:"ellipsis"},children:r.label}),r.description?n.jsx("p",{className:`starasia-input-dropdwon-item-text-description ${x?"active":null} ${r.disable?"starasia-input-dropdwon-item-disable":null}`,style:{textWrap:"nowrap",width:`${k-12}px`,overflow:"hidden",textOverflow:"ellipsis"},children:r.description}):null]})]},f)})})]}):null})}),M=({children:a,handleChangePosition:e})=>{const t=o.useRef(null);o.useEffect(()=>{var g;const i=()=>{if(t.current){let p=t.current.parentElement;for(;p&&!l(p);)p=p.parentElement;p&&e()}};let s=(g=t.current)==null?void 0:g.parentElement;for(;s&&!l(s);)s=s.parentElement;return s&&s.addEventListener("scroll",i),i(),()=>{s&&s.removeEventListener("scroll",i)}},[]);const l=i=>i&&(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);return n.jsx("div",{ref:t,children:a})},W="starasia-input-dropdown-styles";(a=>{if(!document.getElementById(W)){const e=document.createElement("style");e.id=W,e.textContent=a,document.head.appendChild(e)}})(q);const P=({dropdownLists:a,onChange:e,defaultValue:t,size:l="md",multiSelect:i,searchAble:s,iconLeft:g,placeholder:p,onSearch:v,error:E,onBlur:k,onFocus:z,disable:N,searchValue:m})=>{const h=o.useRef(),[r,f]=o.useState([]),[x,C]=o.useState(""),b=o.useRef(null),{isComponentVisible:I,ref:B,setIsComponentVisible:S}=A(!1),V=()=>{S(d=>!d)},j=(d,c)=>{if(!i)f([{label:d,value:c}]),e([{label:d,value:c}]),S(!1);else if(r==null?void 0:r.find(u=>u.value===c)){const u=[...r?r.filter(G=>G.value!==c):[]];f(u),e(u)}else{const u=[...r||[],{label:d,value:c}];f(u),e(u)}};o.useEffect(()=>{JSON.stringify(h.current)===JSON.stringify(t)||(h.current=t,f(h.current||[]))},[t]);const J=()=>r.length?i?r==null?void 0:r.map((d,c)=>n.jsxs("div",{className:"starasia-input-dropdown-preview-item",children:[n.jsx("p",{style:{minWidth:"max-content"},children:d==null?void 0:d.label},c),n.jsx(T,{onClick:()=>j(d.label,d.value)})]})):n.jsx("p",{style:{minWidth:"max-content"},children:r==null?void 0:r[0].label}):n.jsx("p",{className:"starasia-input-dropdown-placeholder",children:p}),y=()=>{if(B.current&&b.current){const d=window.innerHeight,c=B.current.getBoundingClientRect(),L=b.current.getBoundingClientRect(),u=c.bottom+L.height;b.current.style.left=`${c.left}px`,b.current.style.width=`${c.width}px`,u>=d-10?(b.current.style.top=`${c.top-L.height-5}px`,C("top")):(b.current.style.top=`${c.top+c.height}px`,C("bottom"))}};return o.useEffect(()=>(window.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y),window.removeEventListener("resize",y)}),[]),o.useEffect(()=>{y()},[I]),n.jsx(M,{handleChangePosition:y,children:n.jsxs("div",{className:`starasia-input-dropdown-container ${N?"disable":""} starasia-input-dropdown-size-${l} ${I?"active":""} ${E?"error":""}`,ref:B,onClick:V,children:[n.jsxs("div",{className:"starasia-input-dropdown-preview-container",children:[g?n.jsx(n.Fragment,{children:o.cloneElement(g,{width:$(l),color:"#939E99",style:{color:"#939E99"}})}):null,n.jsx("div",{className:"starasia-input-dropdown-container-preview-item",tabIndex:100,onBlur:k,onFocus:z,children:J()}),n.jsx(D,{strokeWidth:2,width:$(l),style:{color:"#939E99"}})]}),n.jsx(H,{dropdownLists:a,handleChangeValue:j,isComponentVisible:I,positionDropdown:x,searchAble:!!s,value:r,onSearch:v,ref:b,multiSelect:i,searchValue:m})]})})},$=a=>{if(a==="sm")return 16;if(a==="md")return 16;if(a==="lg")return 20},T=a=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",...a,children:n.jsx("path",{d:"M12 6L6 12M6.00001 6L12 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})});w.Dropdown=P,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starasia/dropdown",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "dropdown component for starasia UI",
|
|
5
5
|
"author": "Prawito Hudoro",
|
|
6
6
|
"main": "dist/dropdown.umd.js",
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"dist/*.map",
|
|
13
13
|
"dist/*.css"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "vite --config vite.config.ts --port 3000",
|
|
17
|
-
"build": "vite build --config vite.config.ts"
|
|
18
|
-
},
|
|
19
15
|
"keywords": [],
|
|
20
16
|
"license": "ISC",
|
|
21
17
|
"type": "module",
|
|
@@ -37,5 +33,9 @@
|
|
|
37
33
|
"react-dom": "^18.2.0",
|
|
38
34
|
"@types/react": "^18.2.55",
|
|
39
35
|
"@types/react-dom": "^18.2.19"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
39
|
+
"build": "vite build --config vite.config.ts"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|