@commander-services/cmd-dropdown-portal 1.7.7 → 1.9.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/dist/index.es.js DELETED
@@ -1,709 +0,0 @@
1
- import * as xe from "react";
2
- import A, { useState as fr } from "react";
3
- import dr from "react-dom";
4
- var K = { exports: {} }, L = {};
5
- /**
6
- * @license React
7
- * react-jsx-runtime.production.min.js
8
- *
9
- * Copyright (c) Facebook, Inc. and its affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- */
14
- var Ce;
15
- function vr() {
16
- if (Ce) return L;
17
- Ce = 1;
18
- var f = A, d = Symbol.for("react.element"), y = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, k = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function C(w, v, R) {
20
- var c, m = {}, p = null, T = null;
21
- R !== void 0 && (p = "" + R), v.key !== void 0 && (p = "" + v.key), v.ref !== void 0 && (T = v.ref);
22
- for (c in v) h.call(v, c) && !j.hasOwnProperty(c) && (m[c] = v[c]);
23
- if (w && w.defaultProps) for (c in v = w.defaultProps, v) m[c] === void 0 && (m[c] = v[c]);
24
- return { $$typeof: d, type: w, key: p, ref: T, props: m, _owner: k.current };
25
- }
26
- return L.Fragment = y, L.jsx = C, L.jsxs = C, L;
27
- }
28
- var W = {};
29
- /**
30
- * @license React
31
- * react-jsx-runtime.development.js
32
- *
33
- * Copyright (c) Facebook, Inc. and its affiliates.
34
- *
35
- * This source code is licensed under the MIT license found in the
36
- * LICENSE file in the root directory of this source tree.
37
- */
38
- var Pe;
39
- function pr() {
40
- return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
41
- var f = A, d = Symbol.for("react.element"), y = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), w = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), $ = Symbol.iterator, V = "@@iterator";
42
- function J(e) {
43
- if (e === null || typeof e != "object")
44
- return null;
45
- var r = $ && e[$] || e[V];
46
- return typeof r == "function" ? r : null;
47
- }
48
- var O = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
- function E(e) {
50
- {
51
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
52
- t[n - 1] = arguments[n];
53
- ke("error", e, t);
54
- }
55
- }
56
- function ke(e, r, t) {
57
- {
58
- var n = O.ReactDebugCurrentFrame, i = n.getStackAddendum();
59
- i !== "" && (r += "%s", t = t.concat([i]));
60
- var u = t.map(function(o) {
61
- return String(o);
62
- });
63
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
64
- }
65
- }
66
- var je = !1, De = !1, Fe = !1, Ae = !1, Ie = !1, re;
67
- re = Symbol.for("react.module.reference");
68
- function Ye(e) {
69
- return !!(typeof e == "string" || typeof e == "function" || e === h || e === j || Ie || e === k || e === R || e === c || Ae || e === T || je || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === m || e.$$typeof === C || e.$$typeof === w || e.$$typeof === v || // This needs to include all possible module reference object
70
- // types supported by any Flight configuration anywhere since
71
- // we don't know which Flight build this will end up being used
72
- // with.
73
- e.$$typeof === re || e.getModuleId !== void 0));
74
- }
75
- function Le(e, r, t) {
76
- var n = e.displayName;
77
- if (n)
78
- return n;
79
- var i = r.displayName || r.name || "";
80
- return i !== "" ? t + "(" + i + ")" : t;
81
- }
82
- function te(e) {
83
- return e.displayName || "Context";
84
- }
85
- function P(e) {
86
- if (e == null)
87
- return null;
88
- if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
89
- return e.displayName || e.name || null;
90
- if (typeof e == "string")
91
- return e;
92
- switch (e) {
93
- case h:
94
- return "Fragment";
95
- case y:
96
- return "Portal";
97
- case j:
98
- return "Profiler";
99
- case k:
100
- return "StrictMode";
101
- case R:
102
- return "Suspense";
103
- case c:
104
- return "SuspenseList";
105
- }
106
- if (typeof e == "object")
107
- switch (e.$$typeof) {
108
- case w:
109
- var r = e;
110
- return te(r) + ".Consumer";
111
- case C:
112
- var t = e;
113
- return te(t._context) + ".Provider";
114
- case v:
115
- return Le(e, e.render, "ForwardRef");
116
- case m:
117
- var n = e.displayName || null;
118
- return n !== null ? n : P(e.type) || "Memo";
119
- case p: {
120
- var i = e, u = i._payload, o = i._init;
121
- try {
122
- return P(o(u));
123
- } catch {
124
- return null;
125
- }
126
- }
127
- }
128
- return null;
129
- }
130
- var S = Object.assign, I = 0, ne, ae, oe, ie, ue, se, le;
131
- function ce() {
132
- }
133
- ce.__reactDisabledLog = !0;
134
- function We() {
135
- {
136
- if (I === 0) {
137
- ne = console.log, ae = console.info, oe = console.warn, ie = console.error, ue = console.group, se = console.groupCollapsed, le = console.groupEnd;
138
- var e = {
139
- configurable: !0,
140
- enumerable: !0,
141
- value: ce,
142
- writable: !0
143
- };
144
- Object.defineProperties(console, {
145
- info: e,
146
- log: e,
147
- warn: e,
148
- error: e,
149
- group: e,
150
- groupCollapsed: e,
151
- groupEnd: e
152
- });
153
- }
154
- I++;
155
- }
156
- }
157
- function $e() {
158
- {
159
- if (I--, I === 0) {
160
- var e = {
161
- configurable: !0,
162
- enumerable: !0,
163
- writable: !0
164
- };
165
- Object.defineProperties(console, {
166
- log: S({}, e, {
167
- value: ne
168
- }),
169
- info: S({}, e, {
170
- value: ae
171
- }),
172
- warn: S({}, e, {
173
- value: oe
174
- }),
175
- error: S({}, e, {
176
- value: ie
177
- }),
178
- group: S({}, e, {
179
- value: ue
180
- }),
181
- groupCollapsed: S({}, e, {
182
- value: se
183
- }),
184
- groupEnd: S({}, e, {
185
- value: le
186
- })
187
- });
188
- }
189
- I < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
- }
191
- }
192
- var q = O.ReactCurrentDispatcher, z;
193
- function B(e, r, t) {
194
- {
195
- if (z === void 0)
196
- try {
197
- throw Error();
198
- } catch (i) {
199
- var n = i.stack.trim().match(/\n( *(at )?)/);
200
- z = n && n[1] || "";
201
- }
202
- return `
203
- ` + z + e;
204
- }
205
- }
206
- var H = !1, M;
207
- {
208
- var Ve = typeof WeakMap == "function" ? WeakMap : Map;
209
- M = new Ve();
210
- }
211
- function fe(e, r) {
212
- if (!e || H)
213
- return "";
214
- {
215
- var t = M.get(e);
216
- if (t !== void 0)
217
- return t;
218
- }
219
- var n;
220
- H = !0;
221
- var i = Error.prepareStackTrace;
222
- Error.prepareStackTrace = void 0;
223
- var u;
224
- u = q.current, q.current = null, We();
225
- try {
226
- if (r) {
227
- var o = function() {
228
- throw Error();
229
- };
230
- if (Object.defineProperty(o.prototype, "props", {
231
- set: function() {
232
- throw Error();
233
- }
234
- }), typeof Reflect == "object" && Reflect.construct) {
235
- try {
236
- Reflect.construct(o, []);
237
- } catch (b) {
238
- n = b;
239
- }
240
- Reflect.construct(e, [], o);
241
- } else {
242
- try {
243
- o.call();
244
- } catch (b) {
245
- n = b;
246
- }
247
- e.call(o.prototype);
248
- }
249
- } else {
250
- try {
251
- throw Error();
252
- } catch (b) {
253
- n = b;
254
- }
255
- e();
256
- }
257
- } catch (b) {
258
- if (b && n && typeof b.stack == "string") {
259
- for (var a = b.stack.split(`
260
- `), g = n.stack.split(`
261
- `), s = a.length - 1, l = g.length - 1; s >= 1 && l >= 0 && a[s] !== g[l]; )
262
- l--;
263
- for (; s >= 1 && l >= 0; s--, l--)
264
- if (a[s] !== g[l]) {
265
- if (s !== 1 || l !== 1)
266
- do
267
- if (s--, l--, l < 0 || a[s] !== g[l]) {
268
- var _ = `
269
- ` + a[s].replace(" at new ", " at ");
270
- return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, _), _;
271
- }
272
- while (s >= 1 && l >= 0);
273
- break;
274
- }
275
- }
276
- } finally {
277
- H = !1, q.current = u, $e(), Error.prepareStackTrace = i;
278
- }
279
- var F = e ? e.displayName || e.name : "", x = F ? B(F) : "";
280
- return typeof e == "function" && M.set(e, x), x;
281
- }
282
- function Be(e, r, t) {
283
- return fe(e, !1);
284
- }
285
- function Me(e) {
286
- var r = e.prototype;
287
- return !!(r && r.isReactComponent);
288
- }
289
- function U(e, r, t) {
290
- if (e == null)
291
- return "";
292
- if (typeof e == "function")
293
- return fe(e, Me(e));
294
- if (typeof e == "string")
295
- return B(e);
296
- switch (e) {
297
- case R:
298
- return B("Suspense");
299
- case c:
300
- return B("SuspenseList");
301
- }
302
- if (typeof e == "object")
303
- switch (e.$$typeof) {
304
- case v:
305
- return Be(e.render);
306
- case m:
307
- return U(e.type, r, t);
308
- case p: {
309
- var n = e, i = n._payload, u = n._init;
310
- try {
311
- return U(u(i), r, t);
312
- } catch {
313
- }
314
- }
315
- }
316
- return "";
317
- }
318
- var Y = Object.prototype.hasOwnProperty, de = {}, ve = O.ReactDebugCurrentFrame;
319
- function N(e) {
320
- if (e) {
321
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
322
- ve.setExtraStackFrame(t);
323
- } else
324
- ve.setExtraStackFrame(null);
325
- }
326
- function Ue(e, r, t, n, i) {
327
- {
328
- var u = Function.call.bind(Y);
329
- for (var o in e)
330
- if (u(e, o)) {
331
- var a = void 0;
332
- try {
333
- if (typeof e[o] != "function") {
334
- var g = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
- throw g.name = "Invariant Violation", g;
336
- }
337
- a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
- } catch (s) {
339
- a = s;
340
- }
341
- a && !(a instanceof Error) && (N(i), E("%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).", n || "React class", t, o, typeof a), N(null)), a instanceof Error && !(a.message in de) && (de[a.message] = !0, N(i), E("Failed %s type: %s", t, a.message), N(null));
342
- }
343
- }
344
- }
345
- var Ne = Array.isArray;
346
- function G(e) {
347
- return Ne(e);
348
- }
349
- function Ke(e) {
350
- {
351
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
352
- return t;
353
- }
354
- }
355
- function Je(e) {
356
- try {
357
- return pe(e), !1;
358
- } catch {
359
- return !0;
360
- }
361
- }
362
- function pe(e) {
363
- return "" + e;
364
- }
365
- function me(e) {
366
- if (Je(e))
367
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), pe(e);
368
- }
369
- var Ee = O.ReactCurrentOwner, qe = {
370
- key: !0,
371
- ref: !0,
372
- __self: !0,
373
- __source: !0
374
- }, ge, be;
375
- function ze(e) {
376
- if (Y.call(e, "ref")) {
377
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
378
- if (r && r.isReactWarning)
379
- return !1;
380
- }
381
- return e.ref !== void 0;
382
- }
383
- function He(e) {
384
- if (Y.call(e, "key")) {
385
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
386
- if (r && r.isReactWarning)
387
- return !1;
388
- }
389
- return e.key !== void 0;
390
- }
391
- function Ge(e, r) {
392
- typeof e.ref == "string" && Ee.current;
393
- }
394
- function Xe(e, r) {
395
- {
396
- var t = function() {
397
- ge || (ge = !0, E("%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)", r));
398
- };
399
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
400
- get: t,
401
- configurable: !0
402
- });
403
- }
404
- }
405
- function Ze(e, r) {
406
- {
407
- var t = function() {
408
- be || (be = !0, E("%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)", r));
409
- };
410
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
411
- get: t,
412
- configurable: !0
413
- });
414
- }
415
- }
416
- var Qe = function(e, r, t, n, i, u, o) {
417
- var a = {
418
- // This tag allows us to uniquely identify this as a React Element
419
- $$typeof: d,
420
- // Built-in properties that belong on the element
421
- type: e,
422
- key: r,
423
- ref: t,
424
- props: o,
425
- // Record the component responsible for creating this element.
426
- _owner: u
427
- };
428
- return a._store = {}, Object.defineProperty(a._store, "validated", {
429
- configurable: !1,
430
- enumerable: !1,
431
- writable: !0,
432
- value: !1
433
- }), Object.defineProperty(a, "_self", {
434
- configurable: !1,
435
- enumerable: !1,
436
- writable: !1,
437
- value: n
438
- }), Object.defineProperty(a, "_source", {
439
- configurable: !1,
440
- enumerable: !1,
441
- writable: !1,
442
- value: i
443
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
444
- };
445
- function er(e, r, t, n, i) {
446
- {
447
- var u, o = {}, a = null, g = null;
448
- t !== void 0 && (me(t), a = "" + t), He(r) && (me(r.key), a = "" + r.key), ze(r) && (g = r.ref, Ge(r, i));
449
- for (u in r)
450
- Y.call(r, u) && !qe.hasOwnProperty(u) && (o[u] = r[u]);
451
- if (e && e.defaultProps) {
452
- var s = e.defaultProps;
453
- for (u in s)
454
- o[u] === void 0 && (o[u] = s[u]);
455
- }
456
- if (a || g) {
457
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
458
- a && Xe(o, l), g && Ze(o, l);
459
- }
460
- return Qe(e, a, g, i, n, Ee.current, o);
461
- }
462
- }
463
- var X = O.ReactCurrentOwner, ye = O.ReactDebugCurrentFrame;
464
- function D(e) {
465
- if (e) {
466
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
467
- ye.setExtraStackFrame(t);
468
- } else
469
- ye.setExtraStackFrame(null);
470
- }
471
- var Z;
472
- Z = !1;
473
- function Q(e) {
474
- return typeof e == "object" && e !== null && e.$$typeof === d;
475
- }
476
- function he() {
477
- {
478
- if (X.current) {
479
- var e = P(X.current.type);
480
- if (e)
481
- return `
482
-
483
- Check the render method of \`` + e + "`.";
484
- }
485
- return "";
486
- }
487
- }
488
- function rr(e) {
489
- return "";
490
- }
491
- var Re = {};
492
- function tr(e) {
493
- {
494
- var r = he();
495
- if (!r) {
496
- var t = typeof e == "string" ? e : e.displayName || e.name;
497
- t && (r = `
498
-
499
- Check the top-level render call using <` + t + ">.");
500
- }
501
- return r;
502
- }
503
- }
504
- function _e(e, r) {
505
- {
506
- if (!e._store || e._store.validated || e.key != null)
507
- return;
508
- e._store.validated = !0;
509
- var t = tr(r);
510
- if (Re[t])
511
- return;
512
- Re[t] = !0;
513
- var n = "";
514
- e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + P(e._owner.type) + "."), D(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
515
- }
516
- }
517
- function we(e, r) {
518
- {
519
- if (typeof e != "object")
520
- return;
521
- if (G(e))
522
- for (var t = 0; t < e.length; t++) {
523
- var n = e[t];
524
- Q(n) && _e(n, r);
525
- }
526
- else if (Q(e))
527
- e._store && (e._store.validated = !0);
528
- else if (e) {
529
- var i = J(e);
530
- if (typeof i == "function" && i !== e.entries)
531
- for (var u = i.call(e), o; !(o = u.next()).done; )
532
- Q(o.value) && _e(o.value, r);
533
- }
534
- }
535
- }
536
- function nr(e) {
537
- {
538
- var r = e.type;
539
- if (r == null || typeof r == "string")
540
- return;
541
- var t;
542
- if (typeof r == "function")
543
- t = r.propTypes;
544
- else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
545
- // Inner props are checked in the reconciler.
546
- r.$$typeof === m))
547
- t = r.propTypes;
548
- else
549
- return;
550
- if (t) {
551
- var n = P(r);
552
- Ue(t, e.props, "prop", n, e);
553
- } else if (r.PropTypes !== void 0 && !Z) {
554
- Z = !0;
555
- var i = P(r);
556
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
557
- }
558
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
559
- }
560
- }
561
- function ar(e) {
562
- {
563
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
564
- var n = r[t];
565
- if (n !== "children" && n !== "key") {
566
- D(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
567
- break;
568
- }
569
- }
570
- e.ref !== null && (D(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
571
- }
572
- }
573
- var Te = {};
574
- function Oe(e, r, t, n, i, u) {
575
- {
576
- var o = Ye(e);
577
- if (!o) {
578
- var a = "";
579
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
580
- var g = rr();
581
- g ? a += g : a += he();
582
- var s;
583
- e === null ? s = "null" : G(e) ? s = "array" : e !== void 0 && e.$$typeof === d ? (s = "<" + (P(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
584
- }
585
- var l = er(e, r, t, i, u);
586
- if (l == null)
587
- return l;
588
- if (o) {
589
- var _ = r.children;
590
- if (_ !== void 0)
591
- if (n)
592
- if (G(_)) {
593
- for (var F = 0; F < _.length; F++)
594
- we(_[F], e);
595
- Object.freeze && Object.freeze(_);
596
- } else
597
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
598
- else
599
- we(_, e);
600
- }
601
- if (Y.call(r, "key")) {
602
- var x = P(e), b = Object.keys(r).filter(function(cr) {
603
- return cr !== "key";
604
- }), ee = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
605
- if (!Te[x + ee]) {
606
- var lr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
607
- E(`A props object containing a "key" prop is being spread into JSX:
608
- let props = %s;
609
- <%s {...props} />
610
- React keys must be passed directly to JSX without using spread:
611
- let props = %s;
612
- <%s key={someKey} {...props} />`, ee, x, lr, x), Te[x + ee] = !0;
613
- }
614
- }
615
- return e === h ? ar(l) : nr(l), l;
616
- }
617
- }
618
- function or(e, r, t) {
619
- return Oe(e, r, t, !0);
620
- }
621
- function ir(e, r, t) {
622
- return Oe(e, r, t, !1);
623
- }
624
- var ur = ir, sr = or;
625
- W.Fragment = h, W.jsx = ur, W.jsxs = sr;
626
- }()), W;
627
- }
628
- var Se;
629
- function mr() {
630
- return Se || (Se = 1, process.env.NODE_ENV === "production" ? K.exports = vr() : K.exports = pr()), K.exports;
631
- }
632
- var Er = mr();
633
- const gr = (f, d) => {
634
- const y = (h) => {
635
- f.current && !f.current.contains(h.target) && d(h);
636
- };
637
- xe.useEffect(() => (document.addEventListener("click", y, { capture: !0 }), () => {
638
- document.removeEventListener("click", y, { capture: !0 });
639
- }));
640
- }, br = "Escape", yr = (f, d) => {
641
- const y = ({ key: h }) => {
642
- h === f && d();
643
- };
644
- xe.useEffect(() => (document.addEventListener("keyup", y), () => {
645
- document.removeEventListener("keyup", y);
646
- }), []);
647
- }, hr = () => ({ useOutsideClick: gr, useKeyPress: yr, ESCAPE_KEY: br }), Rr = hr;
648
- function Tr(f) {
649
- const [d, y] = fr(null), { useOutsideClick: h, useKeyPress: k, ESCAPE_KEY: j } = Rr(), C = A.useRef(), w = () => {
650
- setTimeout(function() {
651
- f.handleOpen(!1);
652
- }, 50);
653
- };
654
- h(C, () => {
655
- w();
656
- }), k(j, () => {
657
- w();
658
- });
659
- const v = (c, m) => {
660
- const p = c.getBoundingClientRect(), T = m.getBoundingClientRect();
661
- return p.bottom >= T.top && p.bottom <= T.bottom;
662
- }, R = A.useCallback(() => {
663
- const c = document.getElementById(f.elementId), m = document.getElementById("cmd-modal-body") || document.getElementById("cmd-page-wrapper-body");
664
- if (c && (!m || v(c, m))) {
665
- const p = c.getBoundingClientRect(), T = f.maxDropdownHeight || 360, $ = window.innerHeight - p.bottom, V = p.left, J = p.bottom, O = p.width;
666
- $ >= T || !m ? y({
667
- // top: rect.bottom + window.scrollY,
668
- top: J,
669
- left: V,
670
- width: O,
671
- bottom: void 0
672
- }) : y({
673
- bottom: window.innerHeight - p.top - window.scrollY + 3,
674
- left: V,
675
- width: O,
676
- top: void 0
677
- });
678
- } else
679
- y(null);
680
- }, []);
681
- return A.useEffect(() => (window.addEventListener("scroll", R, { capture: !0 }), window.addEventListener("resize", R, { capture: !0 }), () => {
682
- window.removeEventListener("scroll", R, { capture: !0 }), window.removeEventListener("resize", R, { capture: !0 });
683
- }), [R]), A.useEffect(() => {
684
- R();
685
- }, [f.elementId]), d ? dr.createPortal(
686
- /* @__PURE__ */ Er.jsx(
687
- "div",
688
- {
689
- className: "font-poppins",
690
- id: `cmd-dropdown-portal-${f.elementId}`,
691
- ref: C,
692
- style: {
693
- position: "absolute",
694
- left: d.left,
695
- zIndex: 999,
696
- ...d.top !== void 0 ? { top: d.top } : {},
697
- ...d.bottom !== void 0 ? { bottom: d.bottom } : {},
698
- ...f.keepWidth ? {} : { width: d.width }
699
- },
700
- children: f.children
701
- }
702
- ),
703
- f.target || document.body
704
- ) : null;
705
- }
706
- export {
707
- Tr as default
708
- };
709
- //# sourceMappingURL=index.es.js.map