@acusti/dropdown 0.47.0 → 0.49.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/Dropdown.d.ts +6 -3
- package/dist/Dropdown.js +364 -282
- package/dist/Dropdown.js.map +1 -1
- package/dist/styles.d.ts +1 -1
- package/package.json +4 -4
package/dist/Dropdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { SYSTEM_UI_FONT, Style } from "@acusti/styling";
|
|
4
|
-
import
|
|
4
|
+
import useBoundingClientRect from "@acusti/use-bounding-client-rect";
|
|
5
5
|
import useKeyboardEvents, { isEventTargetUsingKeyEvent } from "@acusti/use-keyboard-events";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import * as React from "react";
|
|
@@ -38,8 +38,7 @@ ${TRIGGER_SELECTOR} {
|
|
|
38
38
|
font-family: var(--uktdd-font-family);
|
|
39
39
|
}
|
|
40
40
|
${ROOT_SELECTOR} {
|
|
41
|
-
|
|
42
|
-
display: inline-block;
|
|
41
|
+
width: max-content;
|
|
43
42
|
}
|
|
44
43
|
${ROOT_SELECTOR}.disabled {
|
|
45
44
|
pointer-events: none;
|
|
@@ -49,6 +48,7 @@ ${ROOT_SELECTOR} > * {
|
|
|
49
48
|
}
|
|
50
49
|
${LABEL_SELECTOR} {
|
|
51
50
|
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
52
|
}
|
|
53
53
|
${LABEL_TEXT_SELECTOR} {
|
|
54
54
|
padding-right: var(--uktdd-label-pad-right);
|
|
@@ -56,31 +56,38 @@ ${LABEL_TEXT_SELECTOR} {
|
|
|
56
56
|
${BODY_SELECTOR} {
|
|
57
57
|
box-sizing: border-box;
|
|
58
58
|
position: absolute;
|
|
59
|
-
top:
|
|
60
|
-
|
|
59
|
+
top: anchor(bottom);
|
|
60
|
+
left: anchor(left);
|
|
61
|
+
bottom: auto;
|
|
62
|
+
right: auto;
|
|
63
|
+
position-try-fallbacks: --uktdd-top-left, --uktdd-bottom-right, --uktdd-top-right;
|
|
61
64
|
min-height: 50px;
|
|
65
|
+
max-height: var(${BODY_MAX_HEIGHT_VAR});
|
|
66
|
+
min-width: min(50px, 100%);
|
|
62
67
|
max-width: var(${BODY_MAX_WIDTH_VAR});
|
|
63
|
-
min-width: 100%;
|
|
64
68
|
overflow: auto;
|
|
65
69
|
z-index: 2;
|
|
66
70
|
padding: var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);
|
|
67
71
|
background-color: var(--uktdd-body-bg-color);
|
|
68
72
|
box-shadow: 0 8px 18px rgba(0,0,0,0.25);
|
|
69
73
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
${BODY_SELECTOR}.out-of-bounds-bottom:not(.out-of-bounds-top) {
|
|
74
|
+
@position-try --uktdd-top-left {
|
|
75
|
+
bottom: anchor(top);
|
|
76
|
+
left: anchor(left);
|
|
74
77
|
top: auto;
|
|
75
|
-
|
|
78
|
+
right: auto;
|
|
76
79
|
}
|
|
77
|
-
|
|
80
|
+
@position-try --uktdd-bottom-right {
|
|
81
|
+
top: anchor(bottom);
|
|
82
|
+
right: anchor(right);
|
|
83
|
+
bottom: auto;
|
|
78
84
|
left: auto;
|
|
79
|
-
right: 0px;
|
|
80
85
|
}
|
|
81
|
-
|
|
86
|
+
@position-try --uktdd-top-right {
|
|
87
|
+
bottom: anchor(top);
|
|
88
|
+
right: anchor(right);
|
|
89
|
+
top: auto;
|
|
82
90
|
left: auto;
|
|
83
|
-
right: 0;
|
|
84
91
|
}
|
|
85
92
|
${BODY_SELECTOR}.has-items {
|
|
86
93
|
user-select: none;
|
|
@@ -216,8 +223,9 @@ const noop = () => {
|
|
|
216
223
|
};
|
|
217
224
|
const CHILDREN_ERROR = "@acusti/dropdown requires either 1 child (the dropdown body) or 2 children: the dropdown trigger and the dropdown body.";
|
|
218
225
|
const TEXT_INPUT_SELECTOR = "input:not([type=radio]):not([type=checkbox]):not([type=range]),textarea";
|
|
226
|
+
let idCounter = 0;
|
|
219
227
|
function Dropdown(t0) {
|
|
220
|
-
const $ = c(
|
|
228
|
+
const $ = c(119);
|
|
221
229
|
const {
|
|
222
230
|
allowCreate,
|
|
223
231
|
allowEmpty: t1,
|
|
@@ -229,6 +237,8 @@ function Dropdown(t0) {
|
|
|
229
237
|
isSearchable,
|
|
230
238
|
keepOpenOnSubmit: t3,
|
|
231
239
|
label,
|
|
240
|
+
minHeightBody: t4,
|
|
241
|
+
minWidthBody: t5,
|
|
232
242
|
name,
|
|
233
243
|
onClick,
|
|
234
244
|
onClose,
|
|
@@ -244,6 +254,8 @@ function Dropdown(t0) {
|
|
|
244
254
|
const allowEmpty = t1 === void 0 ? true : t1;
|
|
245
255
|
const hasItems = t2 === void 0 ? true : t2;
|
|
246
256
|
const keepOpenOnSubmit = t3 === void 0 ? !hasItems : t3;
|
|
257
|
+
const minHeightBody = t4 === void 0 ? 30 : t4;
|
|
258
|
+
const minWidthBody = t5 === void 0 ? 100 : t5;
|
|
247
259
|
const childrenCount = Children.count(children);
|
|
248
260
|
if (childrenCount !== 1 && childrenCount !== 2) {
|
|
249
261
|
if (childrenCount === 0) {
|
|
@@ -255,19 +267,20 @@ function Dropdown(t0) {
|
|
|
255
267
|
if (childrenCount > 1) {
|
|
256
268
|
trigger = children[0];
|
|
257
269
|
}
|
|
258
|
-
let
|
|
270
|
+
let t6;
|
|
259
271
|
if ($[0] !== trigger) {
|
|
260
|
-
|
|
272
|
+
t6 = React.isValidElement(trigger);
|
|
261
273
|
$[0] = trigger;
|
|
262
|
-
$[1] =
|
|
274
|
+
$[1] = t6;
|
|
263
275
|
} else {
|
|
264
|
-
|
|
276
|
+
t6 = $[1];
|
|
265
277
|
}
|
|
266
|
-
const isTriggerFromProps =
|
|
278
|
+
const isTriggerFromProps = t6;
|
|
267
279
|
const [isOpen, setIsOpen] = useState(isOpenOnMount ?? false);
|
|
268
280
|
const [isOpening, setIsOpening] = useState(!isOpenOnMount);
|
|
281
|
+
const [dropdownElement, setDropdownElement] = useState(null);
|
|
269
282
|
const [dropdownBodyElement, setDropdownBodyElement] = useState(null);
|
|
270
|
-
const
|
|
283
|
+
const [id] = useState(_temp);
|
|
271
284
|
const inputElementRef = useRef(null);
|
|
272
285
|
const closingTimerRef = useRef(null);
|
|
273
286
|
const isOpeningTimerRef = useRef(null);
|
|
@@ -275,7 +288,6 @@ function Dropdown(t0) {
|
|
|
275
288
|
const clearEnteredCharactersTimerRef = useRef(null);
|
|
276
289
|
const enteredCharactersRef = useRef("");
|
|
277
290
|
const mouseDownPositionRef = useRef(null);
|
|
278
|
-
const outOfBounds = useIsOutOfBounds(dropdownBodyElement);
|
|
279
291
|
const allowCreateRef = useRef(allowCreate);
|
|
280
292
|
const allowEmptyRef = useRef(allowEmpty);
|
|
281
293
|
const hasItemsRef = useRef(hasItems);
|
|
@@ -286,10 +298,10 @@ function Dropdown(t0) {
|
|
|
286
298
|
const onOpenRef = useRef(onOpen);
|
|
287
299
|
const onSubmitItemRef = useRef(onSubmitItem);
|
|
288
300
|
const valueRef = useRef(value);
|
|
289
|
-
let
|
|
290
|
-
let
|
|
301
|
+
let t7;
|
|
302
|
+
let t8;
|
|
291
303
|
if ($[2] !== allowCreate || $[3] !== allowEmpty || $[4] !== hasItems || $[5] !== isOpen || $[6] !== isOpening || $[7] !== keepOpenOnSubmit || $[8] !== onClose || $[9] !== onOpen || $[10] !== onSubmitItem || $[11] !== value) {
|
|
292
|
-
|
|
304
|
+
t7 = () => {
|
|
293
305
|
allowCreateRef.current = allowCreate;
|
|
294
306
|
allowEmptyRef.current = allowEmpty;
|
|
295
307
|
hasItemsRef.current = hasItems;
|
|
@@ -301,7 +313,7 @@ function Dropdown(t0) {
|
|
|
301
313
|
onSubmitItemRef.current = onSubmitItem;
|
|
302
314
|
valueRef.current = value;
|
|
303
315
|
};
|
|
304
|
-
|
|
316
|
+
t8 = [allowCreate, allowEmpty, hasItems, isOpen, isOpening, keepOpenOnSubmit, onClose, onOpen, onSubmitItem, value];
|
|
305
317
|
$[2] = allowCreate;
|
|
306
318
|
$[3] = allowEmpty;
|
|
307
319
|
$[4] = hasItems;
|
|
@@ -312,18 +324,18 @@ function Dropdown(t0) {
|
|
|
312
324
|
$[9] = onOpen;
|
|
313
325
|
$[10] = onSubmitItem;
|
|
314
326
|
$[11] = value;
|
|
315
|
-
$[12] =
|
|
316
|
-
$[13] =
|
|
327
|
+
$[12] = t7;
|
|
328
|
+
$[13] = t8;
|
|
317
329
|
} else {
|
|
318
|
-
|
|
319
|
-
|
|
330
|
+
t7 = $[12];
|
|
331
|
+
t8 = $[13];
|
|
320
332
|
}
|
|
321
|
-
useEffect(
|
|
333
|
+
useEffect(t7, t8);
|
|
322
334
|
const isMountedRef = useRef(false);
|
|
323
|
-
let
|
|
324
|
-
let
|
|
335
|
+
let t10;
|
|
336
|
+
let t9;
|
|
325
337
|
if ($[14] !== isOpen) {
|
|
326
|
-
|
|
338
|
+
t9 = () => {
|
|
327
339
|
if (!isMountedRef.current) {
|
|
328
340
|
isMountedRef.current = true;
|
|
329
341
|
if (isOpenRef.current && onOpenRef.current) {
|
|
@@ -339,18 +351,18 @@ function Dropdown(t0) {
|
|
|
339
351
|
}
|
|
340
352
|
}
|
|
341
353
|
};
|
|
342
|
-
|
|
354
|
+
t10 = [isOpen];
|
|
343
355
|
$[14] = isOpen;
|
|
344
|
-
$[15] =
|
|
345
|
-
$[16] =
|
|
356
|
+
$[15] = t10;
|
|
357
|
+
$[16] = t9;
|
|
346
358
|
} else {
|
|
347
|
-
|
|
348
|
-
|
|
359
|
+
t10 = $[15];
|
|
360
|
+
t9 = $[16];
|
|
349
361
|
}
|
|
350
|
-
useEffect(
|
|
351
|
-
let
|
|
362
|
+
useEffect(t9, t10);
|
|
363
|
+
let t11;
|
|
352
364
|
if ($[17] !== setIsOpen || $[18] !== setIsOpening) {
|
|
353
|
-
|
|
365
|
+
t11 = () => {
|
|
354
366
|
setIsOpen(false);
|
|
355
367
|
setIsOpening(false);
|
|
356
368
|
mouseDownPositionRef.current = null;
|
|
@@ -361,26 +373,22 @@ function Dropdown(t0) {
|
|
|
361
373
|
};
|
|
362
374
|
$[17] = setIsOpen;
|
|
363
375
|
$[18] = setIsOpening;
|
|
364
|
-
$[19] =
|
|
376
|
+
$[19] = t11;
|
|
365
377
|
} else {
|
|
366
|
-
|
|
378
|
+
t11 = $[19];
|
|
367
379
|
}
|
|
368
|
-
const closeDropdown =
|
|
369
|
-
let
|
|
370
|
-
if ($[20] !== closeDropdown) {
|
|
371
|
-
|
|
380
|
+
const closeDropdown = t11;
|
|
381
|
+
let t12;
|
|
382
|
+
if ($[20] !== closeDropdown || $[21] !== dropdownElement) {
|
|
383
|
+
t12 = (event) => {
|
|
372
384
|
var _a;
|
|
373
|
-
const eventTarget = event.target;
|
|
374
385
|
if (isOpenRef.current && !keepOpenOnSubmitRef.current) {
|
|
375
|
-
|
|
376
|
-
if (!(keepOpen == null ? void 0 : keepOpen.dataset.uktKeepOpen) || keepOpen.dataset.uktKeepOpen === "false") {
|
|
377
|
-
closingTimerRef.current = setTimeout(closeDropdown, 90);
|
|
378
|
-
}
|
|
386
|
+
closingTimerRef.current = setTimeout(closeDropdown, 90);
|
|
379
387
|
}
|
|
380
388
|
if (!hasItemsRef.current) {
|
|
381
389
|
return;
|
|
382
390
|
}
|
|
383
|
-
const element = getActiveItemElement(
|
|
391
|
+
const element = getActiveItemElement(dropdownElement);
|
|
384
392
|
if (!element && !allowCreateRef.current) {
|
|
385
393
|
if (!allowEmptyRef.current) {
|
|
386
394
|
return;
|
|
@@ -414,18 +422,19 @@ function Dropdown(t0) {
|
|
|
414
422
|
}
|
|
415
423
|
};
|
|
416
424
|
$[20] = closeDropdown;
|
|
417
|
-
$[21] =
|
|
425
|
+
$[21] = dropdownElement;
|
|
426
|
+
$[22] = t12;
|
|
418
427
|
} else {
|
|
419
|
-
|
|
428
|
+
t12 = $[22];
|
|
420
429
|
}
|
|
421
|
-
const handleSubmitItem =
|
|
422
|
-
let
|
|
423
|
-
if ($[
|
|
424
|
-
|
|
430
|
+
const handleSubmitItem = t12;
|
|
431
|
+
let t13;
|
|
432
|
+
if ($[23] !== setIsOpening) {
|
|
433
|
+
t13 = (t142) => {
|
|
425
434
|
const {
|
|
426
435
|
clientX,
|
|
427
436
|
clientY
|
|
428
|
-
} =
|
|
437
|
+
} = t142;
|
|
429
438
|
currentInputMethodRef.current = "mouse";
|
|
430
439
|
const initialPosition = mouseDownPositionRef.current;
|
|
431
440
|
if (!initialPosition) {
|
|
@@ -436,22 +445,21 @@ function Dropdown(t0) {
|
|
|
436
445
|
}
|
|
437
446
|
setIsOpening(false);
|
|
438
447
|
};
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
448
|
+
$[23] = setIsOpening;
|
|
449
|
+
$[24] = t13;
|
|
441
450
|
} else {
|
|
442
|
-
|
|
451
|
+
t13 = $[24];
|
|
443
452
|
}
|
|
444
|
-
const handleMouseMove =
|
|
445
|
-
let
|
|
446
|
-
if ($[
|
|
447
|
-
|
|
453
|
+
const handleMouseMove = t13;
|
|
454
|
+
let t14;
|
|
455
|
+
if ($[25] !== dropdownElement) {
|
|
456
|
+
t14 = (event_0) => {
|
|
448
457
|
if (!hasItemsRef.current) {
|
|
449
458
|
return;
|
|
450
459
|
}
|
|
451
460
|
if (currentInputMethodRef.current !== "mouse") {
|
|
452
461
|
return;
|
|
453
462
|
}
|
|
454
|
-
const dropdownElement = dropdownElementRef.current;
|
|
455
463
|
if (!dropdownElement) {
|
|
456
464
|
return;
|
|
457
465
|
}
|
|
@@ -459,9 +467,9 @@ function Dropdown(t0) {
|
|
|
459
467
|
if (!itemElements) {
|
|
460
468
|
return;
|
|
461
469
|
}
|
|
462
|
-
const
|
|
463
|
-
const item =
|
|
464
|
-
const element_0 = item ??
|
|
470
|
+
const eventTarget = event_0.target;
|
|
471
|
+
const item = eventTarget.closest(ITEM_SELECTOR);
|
|
472
|
+
const element_0 = item ?? eventTarget;
|
|
465
473
|
for (const itemElement of itemElements) {
|
|
466
474
|
if (itemElement === element_0) {
|
|
467
475
|
setActiveItem({
|
|
@@ -472,18 +480,19 @@ function Dropdown(t0) {
|
|
|
472
480
|
}
|
|
473
481
|
}
|
|
474
482
|
};
|
|
475
|
-
$[
|
|
483
|
+
$[25] = dropdownElement;
|
|
484
|
+
$[26] = t14;
|
|
476
485
|
} else {
|
|
477
|
-
|
|
486
|
+
t14 = $[26];
|
|
478
487
|
}
|
|
479
|
-
const handleMouseOver =
|
|
480
|
-
let
|
|
481
|
-
if ($[
|
|
482
|
-
|
|
488
|
+
const handleMouseOver = t14;
|
|
489
|
+
let t15;
|
|
490
|
+
if ($[27] !== dropdownElement) {
|
|
491
|
+
t15 = (event_1) => {
|
|
483
492
|
if (!hasItemsRef.current) {
|
|
484
493
|
return;
|
|
485
494
|
}
|
|
486
|
-
const activeItem = getActiveItemElement(
|
|
495
|
+
const activeItem = getActiveItemElement(dropdownElement);
|
|
487
496
|
if (!activeItem) {
|
|
488
497
|
return;
|
|
489
498
|
}
|
|
@@ -493,14 +502,15 @@ function Dropdown(t0) {
|
|
|
493
502
|
}
|
|
494
503
|
delete activeItem.dataset.uktActive;
|
|
495
504
|
};
|
|
496
|
-
$[
|
|
505
|
+
$[27] = dropdownElement;
|
|
506
|
+
$[28] = t15;
|
|
497
507
|
} else {
|
|
498
|
-
|
|
508
|
+
t15 = $[28];
|
|
499
509
|
}
|
|
500
|
-
const handleMouseOut =
|
|
501
|
-
let
|
|
502
|
-
if ($[
|
|
503
|
-
|
|
510
|
+
const handleMouseOut = t15;
|
|
511
|
+
let t16;
|
|
512
|
+
if ($[29] !== onMouseDown || $[30] !== setIsOpen || $[31] !== setIsOpening) {
|
|
513
|
+
t16 = (event_2) => {
|
|
504
514
|
if (onMouseDown) {
|
|
505
515
|
onMouseDown(event_2);
|
|
506
516
|
}
|
|
@@ -518,26 +528,26 @@ function Dropdown(t0) {
|
|
|
518
528
|
isOpeningTimerRef.current = null;
|
|
519
529
|
}, 1e3);
|
|
520
530
|
};
|
|
521
|
-
$[
|
|
522
|
-
$[
|
|
523
|
-
$[
|
|
524
|
-
$[
|
|
531
|
+
$[29] = onMouseDown;
|
|
532
|
+
$[30] = setIsOpen;
|
|
533
|
+
$[31] = setIsOpening;
|
|
534
|
+
$[32] = t16;
|
|
525
535
|
} else {
|
|
526
|
-
|
|
536
|
+
t16 = $[32];
|
|
527
537
|
}
|
|
528
|
-
const handleMouseDown =
|
|
529
|
-
let
|
|
530
|
-
if ($[
|
|
531
|
-
|
|
538
|
+
const handleMouseDown = t16;
|
|
539
|
+
let t17;
|
|
540
|
+
if ($[33] !== closeDropdown || $[34] !== handleSubmitItem || $[35] !== onMouseUp) {
|
|
541
|
+
t17 = (event_3) => {
|
|
532
542
|
if (onMouseUp) {
|
|
533
543
|
onMouseUp(event_3);
|
|
534
544
|
}
|
|
535
545
|
if (isOpeningRef.current || !isOpenRef.current || closingTimerRef.current) {
|
|
536
546
|
return;
|
|
537
547
|
}
|
|
538
|
-
const
|
|
539
|
-
if (!
|
|
540
|
-
if (!isOpeningRef.current && inputElementRef.current !==
|
|
548
|
+
const eventTarget_0 = event_3.target;
|
|
549
|
+
if (!eventTarget_0.closest(BODY_SELECTOR)) {
|
|
550
|
+
if (!isOpeningRef.current && inputElementRef.current !== eventTarget_0.ownerDocument.activeElement) {
|
|
541
551
|
closeDropdown();
|
|
542
552
|
}
|
|
543
553
|
return;
|
|
@@ -547,26 +557,25 @@ function Dropdown(t0) {
|
|
|
547
557
|
}
|
|
548
558
|
handleSubmitItem(event_3);
|
|
549
559
|
};
|
|
550
|
-
$[
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
560
|
+
$[33] = closeDropdown;
|
|
561
|
+
$[34] = handleSubmitItem;
|
|
562
|
+
$[35] = onMouseUp;
|
|
563
|
+
$[36] = t17;
|
|
554
564
|
} else {
|
|
555
|
-
|
|
565
|
+
t17 = $[36];
|
|
556
566
|
}
|
|
557
|
-
const handleMouseUp =
|
|
558
|
-
let
|
|
559
|
-
if ($[
|
|
560
|
-
|
|
567
|
+
const handleMouseUp = t17;
|
|
568
|
+
let t18;
|
|
569
|
+
if ($[37] !== closeDropdown || $[38] !== dropdownElement || $[39] !== handleSubmitItem || $[40] !== setIsOpen) {
|
|
570
|
+
t18 = (event_4) => {
|
|
561
571
|
const {
|
|
562
572
|
altKey,
|
|
563
573
|
ctrlKey,
|
|
564
574
|
key,
|
|
565
575
|
metaKey
|
|
566
576
|
} = event_4;
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
if (!dropdownElement_0) {
|
|
577
|
+
const eventTarget_1 = event_4.target;
|
|
578
|
+
if (!dropdownElement) {
|
|
570
579
|
return;
|
|
571
580
|
}
|
|
572
581
|
const onEventHandled = () => {
|
|
@@ -574,7 +583,7 @@ function Dropdown(t0) {
|
|
|
574
583
|
event_4.preventDefault();
|
|
575
584
|
currentInputMethodRef.current = "keyboard";
|
|
576
585
|
};
|
|
577
|
-
const isEventTargetingDropdown =
|
|
586
|
+
const isEventTargetingDropdown = dropdownElement.contains(eventTarget_1);
|
|
578
587
|
if (!isOpenRef.current) {
|
|
579
588
|
if (!isEventTargetingDropdown) {
|
|
580
589
|
return;
|
|
@@ -599,7 +608,7 @@ function Dropdown(t0) {
|
|
|
599
608
|
enteredCharactersRef.current = enteredCharactersRef.current + key;
|
|
600
609
|
}
|
|
601
610
|
setActiveItem({
|
|
602
|
-
dropdownElement
|
|
611
|
+
dropdownElement,
|
|
603
612
|
isExactMatch: allowCreateRef.current,
|
|
604
613
|
text: enteredCharactersRef.current
|
|
605
614
|
});
|
|
@@ -629,12 +638,12 @@ function Dropdown(t0) {
|
|
|
629
638
|
onEventHandled();
|
|
630
639
|
if (altKey || metaKey) {
|
|
631
640
|
setActiveItem({
|
|
632
|
-
dropdownElement
|
|
641
|
+
dropdownElement,
|
|
633
642
|
index: 0
|
|
634
643
|
});
|
|
635
644
|
} else {
|
|
636
645
|
setActiveItem({
|
|
637
|
-
dropdownElement
|
|
646
|
+
dropdownElement,
|
|
638
647
|
indexAddend: -1
|
|
639
648
|
});
|
|
640
649
|
}
|
|
@@ -644,12 +653,12 @@ function Dropdown(t0) {
|
|
|
644
653
|
onEventHandled();
|
|
645
654
|
if (altKey || metaKey) {
|
|
646
655
|
setActiveItem({
|
|
647
|
-
dropdownElement
|
|
656
|
+
dropdownElement,
|
|
648
657
|
index: -1
|
|
649
658
|
});
|
|
650
659
|
} else {
|
|
651
660
|
setActiveItem({
|
|
652
|
-
dropdownElement
|
|
661
|
+
dropdownElement,
|
|
653
662
|
indexAddend: 1
|
|
654
663
|
});
|
|
655
664
|
}
|
|
@@ -657,31 +666,32 @@ function Dropdown(t0) {
|
|
|
657
666
|
}
|
|
658
667
|
}
|
|
659
668
|
};
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[
|
|
669
|
+
$[37] = closeDropdown;
|
|
670
|
+
$[38] = dropdownElement;
|
|
671
|
+
$[39] = handleSubmitItem;
|
|
672
|
+
$[40] = setIsOpen;
|
|
673
|
+
$[41] = t18;
|
|
664
674
|
} else {
|
|
665
|
-
|
|
675
|
+
t18 = $[41];
|
|
666
676
|
}
|
|
667
|
-
const handleKeyDown =
|
|
668
|
-
let
|
|
669
|
-
if ($[
|
|
670
|
-
|
|
677
|
+
const handleKeyDown = t18;
|
|
678
|
+
let t19;
|
|
679
|
+
if ($[42] !== handleKeyDown) {
|
|
680
|
+
t19 = {
|
|
671
681
|
ignoreUsedKeyboardEvents: false,
|
|
672
682
|
onKeyDown: handleKeyDown
|
|
673
683
|
};
|
|
674
|
-
$[
|
|
675
|
-
$[
|
|
684
|
+
$[42] = handleKeyDown;
|
|
685
|
+
$[43] = t19;
|
|
676
686
|
} else {
|
|
677
|
-
|
|
687
|
+
t19 = $[43];
|
|
678
688
|
}
|
|
679
|
-
useKeyboardEvents(
|
|
689
|
+
useKeyboardEvents(t19);
|
|
680
690
|
const cleanupEventListenersRef = useRef(noop);
|
|
681
|
-
let
|
|
682
|
-
if ($[
|
|
683
|
-
|
|
684
|
-
|
|
691
|
+
let t20;
|
|
692
|
+
if ($[44] !== closeDropdown || $[45] !== isOpenOnMount || $[46] !== isTriggerFromProps || $[47] !== setDropdownElement || $[48] !== setIsOpen || $[49] !== setIsOpening) {
|
|
693
|
+
t20 = (ref) => {
|
|
694
|
+
setDropdownElement(ref);
|
|
685
695
|
if (!ref) {
|
|
686
696
|
cleanupEventListenersRef.current();
|
|
687
697
|
cleanupEventListenersRef.current = noop;
|
|
@@ -699,20 +709,19 @@ function Dropdown(t0) {
|
|
|
699
709
|
}
|
|
700
710
|
inputElementRef.current = inputElement;
|
|
701
711
|
}
|
|
702
|
-
const handleGlobalMouseDown = (
|
|
712
|
+
const handleGlobalMouseDown = (t212) => {
|
|
703
713
|
const {
|
|
704
714
|
target
|
|
705
|
-
} =
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
715
|
+
} = t212;
|
|
716
|
+
const eventTarget_2 = target;
|
|
717
|
+
if (!ref.contains(eventTarget_2)) {
|
|
708
718
|
closeDropdown();
|
|
709
719
|
}
|
|
710
720
|
};
|
|
711
|
-
const handleGlobalMouseUp = (
|
|
712
|
-
var _a;
|
|
721
|
+
const handleGlobalMouseUp = (t222) => {
|
|
713
722
|
const {
|
|
714
723
|
target: target_0
|
|
715
|
-
} =
|
|
724
|
+
} = t222;
|
|
716
725
|
if (!isOpenRef.current || closingTimerRef.current) {
|
|
717
726
|
return;
|
|
718
727
|
}
|
|
@@ -724,20 +733,20 @@ function Dropdown(t0) {
|
|
|
724
733
|
}
|
|
725
734
|
return;
|
|
726
735
|
}
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
736
|
+
const eventTarget_3 = target_0;
|
|
737
|
+
if (!ref.contains(eventTarget_3)) {
|
|
729
738
|
closeDropdown();
|
|
730
739
|
}
|
|
731
740
|
};
|
|
732
|
-
const handleGlobalFocusIn = (
|
|
741
|
+
const handleGlobalFocusIn = (t232) => {
|
|
733
742
|
const {
|
|
734
743
|
target: target_1
|
|
735
|
-
} =
|
|
744
|
+
} = t232;
|
|
736
745
|
if (!isOpenRef.current) {
|
|
737
746
|
return;
|
|
738
747
|
}
|
|
739
|
-
const
|
|
740
|
-
if (
|
|
748
|
+
const eventTarget_4 = target_1;
|
|
749
|
+
if (ref.contains(eventTarget_4) || eventTarget_4.contains(ref)) {
|
|
741
750
|
return;
|
|
742
751
|
}
|
|
743
752
|
closeDropdown();
|
|
@@ -754,21 +763,17 @@ function Dropdown(t0) {
|
|
|
754
763
|
ref.focus();
|
|
755
764
|
}
|
|
756
765
|
const handleInput = (event_5) => {
|
|
757
|
-
const dropdownElement_1 = dropdownElementRef.current;
|
|
758
|
-
if (!dropdownElement_1) {
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
766
|
if (!isOpenRef.current) {
|
|
762
767
|
setIsOpen(true);
|
|
763
768
|
}
|
|
764
769
|
const input = event_5.target;
|
|
765
770
|
const isDeleting = enteredCharactersRef.current.length > input.value.length;
|
|
766
771
|
enteredCharactersRef.current = input.value;
|
|
767
|
-
if (isDeleting && input.value.length && getActiveItemElement(
|
|
772
|
+
if (isDeleting && input.value.length && getActiveItemElement(ref)) {
|
|
768
773
|
return;
|
|
769
774
|
}
|
|
770
775
|
setActiveItem({
|
|
771
|
-
dropdownElement:
|
|
776
|
+
dropdownElement: ref,
|
|
772
777
|
isExactMatch: allowCreateRef.current,
|
|
773
778
|
text: enteredCharactersRef.current
|
|
774
779
|
});
|
|
@@ -790,180 +795,257 @@ function Dropdown(t0) {
|
|
|
790
795
|
}
|
|
791
796
|
};
|
|
792
797
|
};
|
|
793
|
-
$[
|
|
794
|
-
$[
|
|
795
|
-
$[
|
|
796
|
-
$[
|
|
797
|
-
$[
|
|
798
|
-
$[
|
|
798
|
+
$[44] = closeDropdown;
|
|
799
|
+
$[45] = isOpenOnMount;
|
|
800
|
+
$[46] = isTriggerFromProps;
|
|
801
|
+
$[47] = setDropdownElement;
|
|
802
|
+
$[48] = setIsOpen;
|
|
803
|
+
$[49] = setIsOpening;
|
|
804
|
+
$[50] = t20;
|
|
799
805
|
} else {
|
|
800
|
-
|
|
806
|
+
t20 = $[50];
|
|
801
807
|
}
|
|
802
|
-
const handleRef =
|
|
808
|
+
const handleRef = t20;
|
|
803
809
|
if (!isTriggerFromProps) {
|
|
804
810
|
if (isSearchable) {
|
|
805
|
-
const
|
|
806
|
-
let
|
|
807
|
-
if ($[
|
|
808
|
-
|
|
809
|
-
$[
|
|
810
|
-
$[
|
|
811
|
+
const t212 = value ?? "";
|
|
812
|
+
let t222;
|
|
813
|
+
if ($[51] !== setIsOpen) {
|
|
814
|
+
t222 = () => setIsOpen(true);
|
|
815
|
+
$[51] = setIsOpen;
|
|
816
|
+
$[52] = t222;
|
|
811
817
|
} else {
|
|
812
|
-
|
|
818
|
+
t222 = $[52];
|
|
813
819
|
}
|
|
814
|
-
let
|
|
815
|
-
if ($[
|
|
816
|
-
|
|
817
|
-
$[
|
|
818
|
-
$[
|
|
819
|
-
$[
|
|
820
|
-
$[
|
|
821
|
-
$[
|
|
822
|
-
$[
|
|
823
|
-
$[
|
|
820
|
+
let t232;
|
|
821
|
+
if ($[53] !== disabled || $[54] !== name || $[55] !== placeholder || $[56] !== t212 || $[57] !== t222 || $[58] !== tabIndex) {
|
|
822
|
+
t232 = /* @__PURE__ */ jsx("input", { autoComplete: "off", className: TRIGGER_CLASS_NAME, defaultValue: t212, disabled, name, onFocus: t222, placeholder, ref: inputElementRef, tabIndex, type: "text" });
|
|
823
|
+
$[53] = disabled;
|
|
824
|
+
$[54] = name;
|
|
825
|
+
$[55] = placeholder;
|
|
826
|
+
$[56] = t212;
|
|
827
|
+
$[57] = t222;
|
|
828
|
+
$[58] = tabIndex;
|
|
829
|
+
$[59] = t232;
|
|
824
830
|
} else {
|
|
825
|
-
|
|
831
|
+
t232 = $[59];
|
|
826
832
|
}
|
|
827
|
-
trigger =
|
|
833
|
+
trigger = t232;
|
|
828
834
|
} else {
|
|
829
|
-
let
|
|
830
|
-
if ($[
|
|
831
|
-
|
|
832
|
-
$[
|
|
833
|
-
$[
|
|
835
|
+
let t212;
|
|
836
|
+
if ($[60] !== trigger) {
|
|
837
|
+
t212 = /* @__PURE__ */ jsx("button", { className: TRIGGER_CLASS_NAME, tabIndex: 0, children: trigger });
|
|
838
|
+
$[60] = trigger;
|
|
839
|
+
$[61] = t212;
|
|
834
840
|
} else {
|
|
835
|
-
|
|
841
|
+
t212 = $[61];
|
|
836
842
|
}
|
|
837
|
-
trigger =
|
|
843
|
+
trigger = t212;
|
|
838
844
|
}
|
|
839
845
|
}
|
|
840
846
|
if (label) {
|
|
841
|
-
let
|
|
842
|
-
if ($[
|
|
843
|
-
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
847
|
+
let t212;
|
|
848
|
+
if ($[62] !== label) {
|
|
849
|
+
t212 = /* @__PURE__ */ jsx("div", { className: LABEL_TEXT_CLASS_NAME, children: label });
|
|
850
|
+
$[62] = label;
|
|
851
|
+
$[63] = t212;
|
|
846
852
|
} else {
|
|
847
|
-
|
|
853
|
+
t212 = $[63];
|
|
848
854
|
}
|
|
849
|
-
let
|
|
850
|
-
if ($[
|
|
851
|
-
|
|
852
|
-
|
|
855
|
+
let t222;
|
|
856
|
+
if ($[64] !== t212 || $[65] !== trigger) {
|
|
857
|
+
t222 = /* @__PURE__ */ jsxs("label", { className: LABEL_CLASS_NAME, children: [
|
|
858
|
+
t212,
|
|
853
859
|
trigger
|
|
854
860
|
] });
|
|
855
|
-
$[
|
|
856
|
-
$[
|
|
857
|
-
$[
|
|
861
|
+
$[64] = t212;
|
|
862
|
+
$[65] = trigger;
|
|
863
|
+
$[66] = t222;
|
|
858
864
|
} else {
|
|
859
|
-
|
|
865
|
+
t222 = $[66];
|
|
860
866
|
}
|
|
861
|
-
trigger =
|
|
867
|
+
trigger = t222;
|
|
862
868
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
869
|
+
const dropdownRect = useBoundingClientRect(dropdownElement);
|
|
870
|
+
const dropdownBodyRect = useBoundingClientRect(dropdownBodyElement);
|
|
871
|
+
let t21;
|
|
872
|
+
if ($[67] !== dropdownBodyElement) {
|
|
873
|
+
t21 = getBoundingAncestor(dropdownBodyElement);
|
|
874
|
+
$[67] = dropdownBodyElement;
|
|
875
|
+
$[68] = t21;
|
|
876
|
+
} else {
|
|
877
|
+
t21 = $[68];
|
|
878
|
+
}
|
|
879
|
+
const boundingElement = t21;
|
|
880
|
+
const boundingElementRect = useBoundingClientRect(boundingElement);
|
|
881
|
+
let maxHeight;
|
|
882
|
+
let maxWidth;
|
|
883
|
+
if (dropdownBodyRect.top != null && dropdownRect.top != null && boundingElementRect.top != null) {
|
|
884
|
+
const maxHeightUp = dropdownBodyRect.bottom - boundingElementRect.top;
|
|
885
|
+
const maxHeightDown = boundingElementRect.bottom - dropdownBodyRect.top;
|
|
886
|
+
let t222;
|
|
887
|
+
if ($[69] !== dropdownBodyRect.top || $[70] !== dropdownRect.top || $[71] !== maxHeightDown || $[72] !== maxHeightUp) {
|
|
888
|
+
t222 = Math.round(dropdownBodyRect.top > dropdownRect.top ? maxHeightDown : maxHeightUp);
|
|
889
|
+
$[69] = dropdownBodyRect.top;
|
|
890
|
+
$[70] = dropdownRect.top;
|
|
891
|
+
$[71] = maxHeightDown;
|
|
892
|
+
$[72] = maxHeightUp;
|
|
893
|
+
$[73] = t222;
|
|
894
|
+
} else {
|
|
895
|
+
t222 = $[73];
|
|
896
|
+
}
|
|
897
|
+
maxHeight = t222;
|
|
898
|
+
const maxWidthLeft = dropdownBodyRect.right - boundingElementRect.left;
|
|
899
|
+
const maxWidthRight = boundingElementRect.right - dropdownBodyRect.left;
|
|
900
|
+
let t232;
|
|
901
|
+
if ($[74] !== dropdownBodyRect.left || $[75] !== dropdownRect.left || $[76] !== maxWidthLeft || $[77] !== maxWidthRight) {
|
|
902
|
+
t232 = Math.round(dropdownBodyRect.left > dropdownRect.left ? maxWidthRight : maxWidthLeft);
|
|
903
|
+
$[74] = dropdownBodyRect.left;
|
|
904
|
+
$[75] = dropdownRect.left;
|
|
905
|
+
$[76] = maxWidthLeft;
|
|
906
|
+
$[77] = maxWidthRight;
|
|
907
|
+
$[78] = t232;
|
|
908
|
+
} else {
|
|
909
|
+
t232 = $[78];
|
|
910
|
+
}
|
|
911
|
+
maxWidth = t232;
|
|
912
|
+
}
|
|
913
|
+
let t22;
|
|
914
|
+
if ($[79] !== maxHeight || $[80] !== minHeightBody) {
|
|
915
|
+
t22 = maxHeight != null && maxHeight > minHeightBody ? {
|
|
916
|
+
[BODY_MAX_HEIGHT_VAR]: `calc(${maxHeight}px - var(--uktdd-body-buffer))`
|
|
867
917
|
} : null;
|
|
868
|
-
$[
|
|
869
|
-
$[
|
|
918
|
+
$[79] = maxHeight;
|
|
919
|
+
$[80] = minHeightBody;
|
|
920
|
+
$[81] = t22;
|
|
870
921
|
} else {
|
|
871
|
-
|
|
922
|
+
t22 = $[81];
|
|
872
923
|
}
|
|
873
|
-
let
|
|
874
|
-
if ($[
|
|
875
|
-
|
|
876
|
-
[BODY_MAX_WIDTH_VAR]: `calc(${
|
|
924
|
+
let t23;
|
|
925
|
+
if ($[82] !== maxWidth || $[83] !== minWidthBody) {
|
|
926
|
+
t23 = maxWidth != null && maxWidth > minWidthBody ? {
|
|
927
|
+
[BODY_MAX_WIDTH_VAR]: `calc(${maxWidth}px - var(--uktdd-body-buffer))`
|
|
877
928
|
} : null;
|
|
878
|
-
$[
|
|
879
|
-
$[
|
|
929
|
+
$[82] = maxWidth;
|
|
930
|
+
$[83] = minWidthBody;
|
|
931
|
+
$[84] = t23;
|
|
880
932
|
} else {
|
|
881
|
-
|
|
933
|
+
t23 = $[84];
|
|
882
934
|
}
|
|
883
|
-
let
|
|
884
|
-
if ($[
|
|
885
|
-
|
|
935
|
+
let t24;
|
|
936
|
+
if ($[85] !== styleFromProps || $[86] !== t22 || $[87] !== t23) {
|
|
937
|
+
t24 = {
|
|
886
938
|
...styleFromProps,
|
|
887
|
-
...
|
|
888
|
-
...
|
|
939
|
+
...t22,
|
|
940
|
+
...t23
|
|
889
941
|
};
|
|
890
|
-
$[
|
|
891
|
-
$[
|
|
892
|
-
$[
|
|
893
|
-
$[
|
|
942
|
+
$[85] = styleFromProps;
|
|
943
|
+
$[86] = t22;
|
|
944
|
+
$[87] = t23;
|
|
945
|
+
$[88] = t24;
|
|
894
946
|
} else {
|
|
895
|
-
|
|
947
|
+
t24 = $[88];
|
|
896
948
|
}
|
|
897
|
-
const style =
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
949
|
+
const style = t24;
|
|
950
|
+
const anchorStyles = `[data-ukt-id="${id}"] > :first-child {
|
|
951
|
+
anchor-name: --uktdd-anchor${id};
|
|
952
|
+
}
|
|
953
|
+
[data-ukt-id="${id}"] ${BODY_SELECTOR} {
|
|
954
|
+
position-anchor: --uktdd-anchor${id};
|
|
955
|
+
}`;
|
|
956
|
+
let t25;
|
|
957
|
+
if ($[89] === Symbol.for("react.memo_cache_sentinel")) {
|
|
958
|
+
t25 = /* @__PURE__ */ jsx(Style, { href: "@acusti/dropdown/Dropdown", children: STYLES });
|
|
959
|
+
$[89] = t25;
|
|
902
960
|
} else {
|
|
903
|
-
|
|
961
|
+
t25 = $[89];
|
|
904
962
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
963
|
+
const t26 = `@acusti/dropdown/Dropdown/${id}`;
|
|
964
|
+
let t27;
|
|
965
|
+
if ($[90] !== anchorStyles || $[91] !== t26) {
|
|
966
|
+
t27 = /* @__PURE__ */ jsx(Style, { href: t26, children: anchorStyles });
|
|
967
|
+
$[90] = anchorStyles;
|
|
968
|
+
$[91] = t26;
|
|
969
|
+
$[92] = t27;
|
|
970
|
+
} else {
|
|
971
|
+
t27 = $[92];
|
|
972
|
+
}
|
|
973
|
+
let t28;
|
|
974
|
+
if ($[93] !== className || $[94] !== disabled || $[95] !== isOpen || $[96] !== isSearchable) {
|
|
975
|
+
t28 = clsx(ROOT_CLASS_NAME, className, {
|
|
908
976
|
disabled,
|
|
909
977
|
"is-open": isOpen,
|
|
910
978
|
"is-searchable": isSearchable
|
|
911
979
|
});
|
|
912
|
-
$[
|
|
913
|
-
$[
|
|
914
|
-
$[
|
|
915
|
-
$[
|
|
916
|
-
$[
|
|
980
|
+
$[93] = className;
|
|
981
|
+
$[94] = disabled;
|
|
982
|
+
$[95] = isOpen;
|
|
983
|
+
$[96] = isSearchable;
|
|
984
|
+
$[97] = t28;
|
|
917
985
|
} else {
|
|
918
|
-
|
|
986
|
+
t28 = $[97];
|
|
919
987
|
}
|
|
920
|
-
let
|
|
921
|
-
if ($[
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
"out-of-bounds-top": outOfBounds.top && !outOfBounds.bottom
|
|
929
|
-
}), ref: setDropdownBodyElement, children: childrenCount > 1 ? children[1] : children }) : null;
|
|
930
|
-
$[76] = children;
|
|
931
|
-
$[77] = childrenCount;
|
|
932
|
-
$[78] = hasItems;
|
|
933
|
-
$[79] = isOpen;
|
|
934
|
-
$[80] = outOfBounds.bottom;
|
|
935
|
-
$[81] = outOfBounds.hasLayout;
|
|
936
|
-
$[82] = outOfBounds.left;
|
|
937
|
-
$[83] = outOfBounds.right;
|
|
938
|
-
$[84] = outOfBounds.top;
|
|
939
|
-
$[85] = setDropdownBodyElement;
|
|
940
|
-
$[86] = t24;
|
|
988
|
+
let t29;
|
|
989
|
+
if ($[98] !== children || $[99] !== childrenCount || $[100] !== isOpen || $[101] !== setDropdownBodyElement) {
|
|
990
|
+
t29 = isOpen ? /* @__PURE__ */ jsx("div", { className: BODY_CLASS_NAME, ref: setDropdownBodyElement, children: childrenCount > 1 ? children[1] : children }) : null;
|
|
991
|
+
$[98] = children;
|
|
992
|
+
$[99] = childrenCount;
|
|
993
|
+
$[100] = isOpen;
|
|
994
|
+
$[101] = setDropdownBodyElement;
|
|
995
|
+
$[102] = t29;
|
|
941
996
|
} else {
|
|
942
|
-
|
|
997
|
+
t29 = $[102];
|
|
943
998
|
}
|
|
944
|
-
let
|
|
945
|
-
if ($[
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
999
|
+
let t30;
|
|
1000
|
+
if ($[103] !== handleMouseDown || $[104] !== handleMouseMove || $[105] !== handleMouseOut || $[106] !== handleMouseOver || $[107] !== handleMouseUp || $[108] !== handleRef || $[109] !== id || $[110] !== onClick || $[111] !== style || $[112] !== t28 || $[113] !== t29 || $[114] !== trigger) {
|
|
1001
|
+
t30 = /* @__PURE__ */ jsxs("div", { className: t28, "data-ukt-id": id, onClick, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseOut: handleMouseOut, onMouseOver: handleMouseOver, onMouseUp: handleMouseUp, ref: handleRef, style, children: [
|
|
1002
|
+
trigger,
|
|
1003
|
+
t29
|
|
1004
|
+
] });
|
|
1005
|
+
$[103] = handleMouseDown;
|
|
1006
|
+
$[104] = handleMouseMove;
|
|
1007
|
+
$[105] = handleMouseOut;
|
|
1008
|
+
$[106] = handleMouseOver;
|
|
1009
|
+
$[107] = handleMouseUp;
|
|
1010
|
+
$[108] = handleRef;
|
|
1011
|
+
$[109] = id;
|
|
1012
|
+
$[110] = onClick;
|
|
1013
|
+
$[111] = style;
|
|
1014
|
+
$[112] = t28;
|
|
1015
|
+
$[113] = t29;
|
|
1016
|
+
$[114] = trigger;
|
|
1017
|
+
$[115] = t30;
|
|
1018
|
+
} else {
|
|
1019
|
+
t30 = $[115];
|
|
1020
|
+
}
|
|
1021
|
+
let t31;
|
|
1022
|
+
if ($[116] !== t27 || $[117] !== t30) {
|
|
1023
|
+
t31 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1024
|
+
t25,
|
|
1025
|
+
t27,
|
|
1026
|
+
t30
|
|
952
1027
|
] });
|
|
953
|
-
$[
|
|
954
|
-
$[
|
|
955
|
-
$[
|
|
956
|
-
$[90] = handleRef;
|
|
957
|
-
$[91] = onClick;
|
|
958
|
-
$[92] = style;
|
|
959
|
-
$[93] = t23;
|
|
960
|
-
$[94] = t24;
|
|
961
|
-
$[95] = trigger;
|
|
962
|
-
$[96] = t25;
|
|
1028
|
+
$[116] = t27;
|
|
1029
|
+
$[117] = t30;
|
|
1030
|
+
$[118] = t31;
|
|
963
1031
|
} else {
|
|
964
|
-
|
|
1032
|
+
t31 = $[118];
|
|
1033
|
+
}
|
|
1034
|
+
return t31;
|
|
1035
|
+
}
|
|
1036
|
+
function _temp() {
|
|
1037
|
+
idCounter = idCounter >= 999999 ? 0 : idCounter + 1;
|
|
1038
|
+
return idCounter;
|
|
1039
|
+
}
|
|
1040
|
+
function getBoundingAncestor(element) {
|
|
1041
|
+
while (element == null ? void 0 : element.parentElement) {
|
|
1042
|
+
if (element.parentElement.tagName === "BODY") return element.parentElement;
|
|
1043
|
+
if (getComputedStyle(element.parentElement).overflowX !== "visible") {
|
|
1044
|
+
return element.parentElement;
|
|
1045
|
+
}
|
|
1046
|
+
element = element.parentElement;
|
|
965
1047
|
}
|
|
966
|
-
return
|
|
1048
|
+
return null;
|
|
967
1049
|
}
|
|
968
1050
|
export {
|
|
969
1051
|
Dropdown as default
|