@acusti/dropdown 1.0.0-alpha.4 → 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -27
- package/dist/Dropdown.d.ts +19 -5
- package/dist/Dropdown.js +524 -426
- package/dist/Dropdown.js.map +1 -1
- package/dist/helpers.d.ts +4 -2
- package/package.json +1 -1
package/dist/Dropdown.js
CHANGED
|
@@ -9,7 +9,7 @@ var DropdownContext = createContext(null);
|
|
|
9
9
|
var MenubarContext = createContext(null);
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/Dropdown.css?inline
|
|
12
|
-
var Dropdown_default = ":root{--uktdd-font-family:system-ui, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, Helvetica, Arial, sans-serif;--uktdd-body-bg-color:#fff;--uktdd-body-bg-color-hover:#69a2f9;--uktdd-body-color-hover:#fff;--uktdd-body-buffer:10px;--uktdd-body-max-height:calc(100dvh - var(--uktdd-body-buffer));--uktdd-body-max-width:calc(100dvw - var(--uktdd-body-buffer));--uktdd-body-min-height:30px;--uktdd-body-pad-bottom:.5em;--uktdd-body-pad-left:.6875em;--uktdd-body-pad-right:.6875em;--uktdd-body-pad-top:.5em;--uktdd-body-min-width:min(50px, 100%);--uktdd-body-position-area:block-end span-inline-end;--uktdd-body-position-try-fallbacks:--uktdd-top-start, --uktdd-bottom-end, --uktdd-top-end;--uktdd-body-gap:0px;--uktdd-body-color:canvastext;--uktdd-body-bg-color-path:#dcdcdc;--uktdd-body-color-path:currentColor;--uktdd-label-pad-right:.625em;--uktdd-submenu-position-area:inline-end span-block-end;--uktdd-submenu-position-try-fallbacks:--uktdd-submenu-inline-start;--uktdd-submenu-gap:0px;--uktdd-menubar-trigger-bg-color-active:#0000001f}.uktdropdown,.uktdropdown-trigger{font-family:var(--uktdd-font-family)}.uktdropdown{anchor-scope:--uktdd-anchor;width:max-content}.uktdropdown.disabled{pointer-events:none}.uktdropdown>*{cursor:default}.uktdropdown>:first-child{anchor-name:--uktdd-anchor}.uktdropdown-label{align-items:center;display:flex}.uktdropdown-label-text{padding-right:var(--uktdd-label-pad-right)}.uktdropdown-body{box-sizing:border-box;position-anchor:--uktdd-anchor;position-area:var(--uktdd-body-position-area);position-try-
|
|
12
|
+
var Dropdown_default = ":root{--uktdd-font-family:system-ui, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, Helvetica, Arial, sans-serif;--uktdd-body-bg-color:#fff;--uktdd-body-bg-color-hover:#69a2f9;--uktdd-body-color-hover:#fff;--uktdd-body-bg-color-selected:#0000000f;--uktdd-body-buffer:10px;--uktdd-body-max-height:calc(100dvh - var(--uktdd-body-buffer));--uktdd-body-max-width:calc(100dvw - var(--uktdd-body-buffer));--uktdd-body-min-height:30px;--uktdd-body-pad-bottom:.5em;--uktdd-body-pad-left:.6875em;--uktdd-body-pad-right:.6875em;--uktdd-body-pad-top:.5em;--uktdd-body-min-width:min(50px, 100%);--uktdd-body-position-area:block-end span-inline-end;--uktdd-body-position-try-fallbacks:--uktdd-top-start, --uktdd-bottom-end, --uktdd-top-end;--uktdd-body-gap:0px;--uktdd-body-color:canvastext;--uktdd-body-bg-color-path:#dcdcdc;--uktdd-body-color-path:currentColor;--uktdd-label-pad-right:.625em;--uktdd-submenu-position-area:inline-end span-block-end;--uktdd-submenu-position-try-fallbacks:--uktdd-submenu-inline-start;--uktdd-submenu-gap:0px;--uktdd-menubar-trigger-bg-color-active:#0000001f}.uktdropdown,.uktdropdown-trigger{font-family:var(--uktdd-font-family)}.uktdropdown{anchor-scope:--uktdd-anchor;width:max-content}.uktdropdown.disabled{pointer-events:none}.uktdropdown>*{cursor:default}.uktdropdown>:first-child{anchor-name:--uktdd-anchor}.uktdropdown-label{align-items:center;display:flex}.uktdropdown-label-text{padding-right:var(--uktdd-label-pad-right)}.uktdropdown-body{box-sizing:border-box;position-anchor:--uktdd-anchor;position-area:var(--uktdd-body-position-area);position-try-fallbacks:var(--uktdd-body-position-try-fallbacks), --uktdd-fill, --uktdd-fill flip-inline, --uktdd-fill flip-block, --uktdd-fill flip-block flip-inline;min-block-size:min(var(--uktdd-body-min-height), var(--uktdd-body-max-height));max-block-size:var(--uktdd-body-max-height);min-inline-size:min(var(--uktdd-body-min-width), var(--uktdd-body-max-width));max-inline-size:var(--uktdd-body-max-width);inline-size:max-content;color:inherit;background-color:var(--uktdd-body-bg-color);flex-direction:column;display:flex;position:fixed;overflow:hidden;box-shadow:0 8px 18px #00000040}.uktdropdown-body.has-items{-webkit-user-select:none;user-select:none}.uktdropdown-body [aria-selected=true]{background-color:var(--uktdd-body-bg-color-selected)}.uktdropdown-body [data-ukt-active]{background-color:var(--uktdd-body-bg-color-hover);color:var(--uktdd-body-color-hover)}:is(.uktdropdown-body [data-ukt-active]:has([data-ukt-submenu] [data-ukt-active]),.uktdropdown-body [data-ukt-active]:has([data-ukt-submenu]:hover)){background-color:var(--uktdd-body-bg-color-path);color:var(--uktdd-body-color-path)}.uktdropdown-body [data-ukt-item][aria-disabled=true]{opacity:.5;pointer-events:none}.uktdropdown-body [data-ukt-item]{anchor-scope:--uktdd-submenu-anchor}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]{padding-inline-end:2em;position:relative}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]:after{content:\"\";border-block-start:.14em solid;border-inline-end:.14em solid;block-size:.3em;inline-size:.3em;position:absolute;inset-block-start:50%;inset-inline-end:.9em;translate:0 -50%;rotate:45deg}.uktdropdown-body :is([data-ukt-item],[data-ukt-value])[aria-haspopup=menu]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):after{rotate:-45deg}.uktdropdown-body [data-ukt-item][aria-expanded=true]{anchor-name:--uktdd-submenu-anchor}.uktdropdown-body [data-ukt-submenu]:not([popover]){display:none}.uktdropdown-body [data-ukt-submenu]{box-sizing:border-box;block-size:auto;color:var(--uktdd-body-color);position-anchor:--uktdd-submenu-anchor;position-area:var(--uktdd-submenu-position-area);position-try-fallbacks:var(--uktdd-submenu-position-try-fallbacks), --uktdd-fill, --uktdd-fill flip-inline, --uktdd-fill flip-block, --uktdd-fill flip-block flip-inline;z-index:2;margin-block:0;margin-inline:var(--uktdd-submenu-gap);--uktdd-body-gap:0;padding:var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);inline-size:max-content;max-inline-size:var(--uktdd-body-max-width);min-block-size:min(var(--uktdd-body-min-height), var(--uktdd-body-max-height));max-block-size:var(--uktdd-body-max-height);overscroll-behavior:contain;background-color:var(--uktdd-body-bg-color);border:0;list-style:none;position:fixed;inset:auto;overflow:auto;box-shadow:0 8px 18px #00000040}div.uktdropdown-body{block-size:auto;margin-block:var(--uktdd-body-gap);border:0;margin-inline:0;padding:0;inset:auto}.uktmenubar{width:max-content;font-family:var(--uktdd-font-family);align-items:stretch;display:flex}.uktmenubar .uktdropdown.is-open .uktdropdown-trigger{box-shadow:inset 0 0 0 100vmax var(--uktdd-menubar-trigger-bg-color-active)}.uktdropdown-content{box-sizing:border-box;overscroll-behavior:contain;min-block-size:0;padding:var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);overflow:auto}@position-try --uktdd-top-start{position-area: block-start span-inline-end;}@position-try --uktdd-bottom-start{position-area: block-end span-inline-end;}@position-try --uktdd-bottom-end{position-area: block-end span-inline-start;}@position-try --uktdd-top-end{position-area: block-start span-inline-start;}@position-try --uktdd-submenu-inline-start{position-area: inline-start span-block-end;}@position-try --uktdd-fill{block-size: calc(100% - var(--uktdd-body-gap) * 2);}";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/helpers.ts
|
|
15
15
|
var ITEM_SELECTOR = "[data-ukt-item], [data-ukt-value]";
|
|
@@ -29,6 +29,36 @@ var getItemLabel = (item) => {
|
|
|
29
29
|
for (const submenu of Array.from(clone.querySelectorAll(SUBMENU_SELECTOR))) submenu.remove();
|
|
30
30
|
return (clone.textContent ?? "").trim();
|
|
31
31
|
};
|
|
32
|
+
var getNodeText = (node) => {
|
|
33
|
+
let text = "";
|
|
34
|
+
Children.forEach(node, (child) => {
|
|
35
|
+
if (typeof child === "string" || typeof child === "number") text += child;
|
|
36
|
+
else if (isValidElement(child)) {
|
|
37
|
+
const childProps = child.props;
|
|
38
|
+
if (childProps["data-ukt-submenu"] !== void 0) return;
|
|
39
|
+
text += getNodeText(childProps.children);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return text;
|
|
43
|
+
};
|
|
44
|
+
var getLabelFromChildren = (children, value) => {
|
|
45
|
+
let label;
|
|
46
|
+
const visit = (node) => {
|
|
47
|
+
if (label != null) return;
|
|
48
|
+
Children.forEach(node, (child) => {
|
|
49
|
+
if (label != null || !isValidElement(child)) return;
|
|
50
|
+
const childProps = child.props;
|
|
51
|
+
const uktValue = childProps["data-ukt-value"];
|
|
52
|
+
if (uktValue != null && String(uktValue) === value) {
|
|
53
|
+
label = getNodeText(childProps.children).replace(/\s+/g, " ").trim();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
visit(childProps.children);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
visit(children);
|
|
60
|
+
return label;
|
|
61
|
+
};
|
|
32
62
|
var getItemPath = (element) => {
|
|
33
63
|
const path = [];
|
|
34
64
|
if (!element) return path;
|
|
@@ -86,9 +116,10 @@ var getDeepestExpandedItem = (dropdownElement) => {
|
|
|
86
116
|
};
|
|
87
117
|
var isItemExpanded = (item) => item.getAttribute("aria-expanded") === "true";
|
|
88
118
|
var submenuIdCounter = 0;
|
|
89
|
-
var
|
|
119
|
+
var ensureSubmenuARIA = (item, submenu) => {
|
|
90
120
|
if (!submenu.hasAttribute("role")) submenu.setAttribute("role", "menu");
|
|
91
121
|
if (!submenu.id) submenu.id = `uktdd-submenu-${++submenuIdCounter}`;
|
|
122
|
+
if (submenu.getAttribute("popover") !== "manual") submenu.setAttribute("popover", "manual");
|
|
92
123
|
if (!item.hasAttribute("aria-haspopup")) item.setAttribute("aria-haspopup", "menu");
|
|
93
124
|
if (!item.hasAttribute("aria-expanded")) item.setAttribute("aria-expanded", "false");
|
|
94
125
|
if (!item.hasAttribute("aria-controls")) item.setAttribute("aria-controls", submenu.id);
|
|
@@ -97,13 +128,23 @@ var annotateParentItems = (bodyElement) => {
|
|
|
97
128
|
if (!bodyElement) return;
|
|
98
129
|
for (const submenu of Array.from(bodyElement.querySelectorAll(SUBMENU_SELECTOR))) {
|
|
99
130
|
const item = getParentItem(submenu);
|
|
100
|
-
if (item)
|
|
131
|
+
if (item) ensureSubmenuARIA(item, submenu);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
var annotateItemRoles = (bodyElement, popupRole) => {
|
|
135
|
+
if (!bodyElement) return;
|
|
136
|
+
for (const list of Array.from(bodyElement.querySelectorAll("ul, ol"))) if (!list.hasAttribute("role") && list.querySelector("[data-ukt-item], [data-ukt-value]")) list.setAttribute("role", "presentation");
|
|
137
|
+
for (const item of Array.from(bodyElement.querySelectorAll(ITEM_SELECTOR))) {
|
|
138
|
+
if (item.hasAttribute("role") || item.matches("a[href], button, input, select, textarea")) continue;
|
|
139
|
+
const isMenuItem = popupRole === "menu" || getLevelRoot(item) != null;
|
|
140
|
+
if (!isMenuItem && getSubmenuOfItem(item)) continue;
|
|
141
|
+
item.setAttribute("role", isMenuItem ? "menuitem" : "option");
|
|
101
142
|
}
|
|
102
143
|
};
|
|
103
144
|
var expandItem = (item, onToggleSubmenu) => {
|
|
104
145
|
const submenu = getSubmenuOfItem(item);
|
|
105
146
|
if (!submenu) return;
|
|
106
|
-
|
|
147
|
+
ensureSubmenuARIA(item, submenu);
|
|
107
148
|
if (isItemExpanded(item)) return;
|
|
108
149
|
item.setAttribute("aria-expanded", "true");
|
|
109
150
|
onToggleSubmenu?.(item, true);
|
|
@@ -182,15 +223,16 @@ var setActiveItem = ({ dropdownElement, element, event, index, indexAddend, isEx
|
|
|
182
223
|
const nextActiveItem = itemElements[nextActiveIndex];
|
|
183
224
|
if (nextActiveItem == null || nextActiveItem === currentDeepest) return currentDeepest;
|
|
184
225
|
setActiveChain(dropdownElement, nextActiveItem);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
226
|
+
if (event) {
|
|
227
|
+
const label = getItemLabel(nextActiveItem);
|
|
228
|
+
onActiveItem?.({
|
|
229
|
+
element: nextActiveItem,
|
|
230
|
+
event,
|
|
231
|
+
label,
|
|
232
|
+
path: getItemPath(nextActiveItem),
|
|
233
|
+
value: nextActiveItem.dataset.uktValue ?? label
|
|
234
|
+
});
|
|
235
|
+
}
|
|
194
236
|
let { parentElement } = nextActiveItem;
|
|
195
237
|
let scrollableParent = null;
|
|
196
238
|
while (!scrollableParent && parentElement && parentElement !== dropdownElement) if (parentElement.scrollHeight > parentElement.clientHeight + 15) scrollableParent = parentElement;
|
|
@@ -280,7 +322,7 @@ function Menubar(t0) {
|
|
|
280
322
|
if (key !== "ArrowLeft" && key !== "ArrowRight") return;
|
|
281
323
|
const members_0 = getOrderedMembers();
|
|
282
324
|
if (members_0.length < 2) return;
|
|
283
|
-
if (members_0.some(_temp
|
|
325
|
+
if (members_0.some(_temp)) return;
|
|
284
326
|
const eventTarget = event.target;
|
|
285
327
|
const index_0 = members_0.findIndex((member_3) => member_3.element.contains(eventTarget));
|
|
286
328
|
if (index_0 === -1) return;
|
|
@@ -360,7 +402,7 @@ function Menubar(t0) {
|
|
|
360
402
|
} else t10 = $[14];
|
|
361
403
|
return t10;
|
|
362
404
|
}
|
|
363
|
-
function _temp
|
|
405
|
+
function _temp(member_2) {
|
|
364
406
|
return member_2.isOpen();
|
|
365
407
|
}
|
|
366
408
|
//#endregion
|
|
@@ -397,7 +439,7 @@ function Dropdown(props) {
|
|
|
397
439
|
return t0;
|
|
398
440
|
}
|
|
399
441
|
function RootDropdown(t0) {
|
|
400
|
-
const $ = c(
|
|
442
|
+
const $ = c(158);
|
|
401
443
|
const { allowCreate, allowEmpty: t1, children, className, disabled, hasItems: t2, isOpenOnMount, isSearchable, keepOpenOnSubmit: t3, label, name, onActiveItem, onClick, onClose, onMouseDown, onMouseUp, onOpen, onSubmitItem, openOnHover, placeholder, style: styleFromProps, tabIndex, value } = t0;
|
|
402
444
|
const allowEmpty = t1 === void 0 ? true : t1;
|
|
403
445
|
const hasItems = t2 === void 0 ? true : t2;
|
|
@@ -409,6 +451,18 @@ function RootDropdown(t0) {
|
|
|
409
451
|
}
|
|
410
452
|
let trigger;
|
|
411
453
|
if (childrenCount > 1) trigger = children[0];
|
|
454
|
+
const body = childrenCount > 1 ? children[1] : children;
|
|
455
|
+
const valueIdentity = typeof value === "string" ? value : value?.value;
|
|
456
|
+
let t4;
|
|
457
|
+
if ($[0] !== allowCreate || $[1] !== body || $[2] !== isSearchable || $[3] !== value) {
|
|
458
|
+
t4 = !isSearchable ? void 0 : typeof value !== "string" ? value?.label : getLabelFromChildren(body, value) ?? (allowCreate ? value : void 0);
|
|
459
|
+
$[0] = allowCreate;
|
|
460
|
+
$[1] = body;
|
|
461
|
+
$[2] = isSearchable;
|
|
462
|
+
$[3] = value;
|
|
463
|
+
$[4] = t4;
|
|
464
|
+
} else t4 = $[4];
|
|
465
|
+
const valueLabel = t4;
|
|
412
466
|
const [isOpen, setIsOpen] = useState(isOpenOnMount ?? false);
|
|
413
467
|
const [isOpening, setIsOpening] = useState(!isOpenOnMount);
|
|
414
468
|
const [dropdownElement, setDropdownElement] = useState(null);
|
|
@@ -416,6 +470,13 @@ function RootDropdown(t0) {
|
|
|
416
470
|
const popupRole = isSearchable ? "listbox" : hasItems ? "menu" : "dialog";
|
|
417
471
|
const menubar = useContext(MenubarContext);
|
|
418
472
|
const inputElementRef = useRef(null);
|
|
473
|
+
const consumerOwnsARIASelectedRef = useRef(false);
|
|
474
|
+
let t5;
|
|
475
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
476
|
+
t5 = /* @__PURE__ */ new WeakSet();
|
|
477
|
+
$[5] = t5;
|
|
478
|
+
} else t5 = $[5];
|
|
479
|
+
const annotatedBodiesRef = useRef(t5);
|
|
419
480
|
const closingTimerRef = useRef(null);
|
|
420
481
|
const isOpeningTimerRef = useRef(null);
|
|
421
482
|
const currentInputMethodRef = useRef("mouse");
|
|
@@ -424,12 +485,12 @@ function RootDropdown(t0) {
|
|
|
424
485
|
const mouseDownPositionRef = useRef(null);
|
|
425
486
|
const disclosureTimerRef = useRef(null);
|
|
426
487
|
const pendingDisclosureItemRef = useRef(null);
|
|
427
|
-
let
|
|
428
|
-
if ($[
|
|
429
|
-
|
|
430
|
-
$[
|
|
431
|
-
} else
|
|
432
|
-
const submenuRegistrationsRef = useRef(
|
|
488
|
+
let t6;
|
|
489
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
490
|
+
t6 = /* @__PURE__ */ new Set();
|
|
491
|
+
$[6] = t6;
|
|
492
|
+
} else t6 = $[6];
|
|
493
|
+
const submenuRegistrationsRef = useRef(t6);
|
|
433
494
|
const pointerRef = useRef(null);
|
|
434
495
|
const lastMouseEventRef = useRef(null);
|
|
435
496
|
const safeAreaRef = useRef(null);
|
|
@@ -445,11 +506,11 @@ function RootDropdown(t0) {
|
|
|
445
506
|
const onCloseRef = useRef(onClose);
|
|
446
507
|
const onOpenRef = useRef(onOpen);
|
|
447
508
|
const onSubmitItemRef = useRef(onSubmitItem);
|
|
448
|
-
const valueRef = useRef(
|
|
449
|
-
let
|
|
450
|
-
let
|
|
451
|
-
if ($[
|
|
452
|
-
|
|
509
|
+
const valueRef = useRef(valueIdentity);
|
|
510
|
+
let t7;
|
|
511
|
+
let t8;
|
|
512
|
+
if ($[7] !== allowCreate || $[8] !== allowEmpty || $[9] !== hasItems || $[10] !== isOpen || $[11] !== isOpening || $[12] !== keepOpenOnSubmit || $[13] !== onClose || $[14] !== onOpen || $[15] !== onSubmitItem || $[16] !== valueIdentity) {
|
|
513
|
+
t7 = () => {
|
|
453
514
|
allowCreateRef.current = allowCreate;
|
|
454
515
|
allowEmptyRef.current = allowEmpty;
|
|
455
516
|
hasItemsRef.current = hasItems;
|
|
@@ -459,9 +520,9 @@ function RootDropdown(t0) {
|
|
|
459
520
|
onCloseRef.current = onClose;
|
|
460
521
|
onOpenRef.current = onOpen;
|
|
461
522
|
onSubmitItemRef.current = onSubmitItem;
|
|
462
|
-
valueRef.current =
|
|
523
|
+
valueRef.current = valueIdentity;
|
|
463
524
|
};
|
|
464
|
-
|
|
525
|
+
t8 = [
|
|
465
526
|
allowCreate,
|
|
466
527
|
allowEmpty,
|
|
467
528
|
hasItems,
|
|
@@ -471,30 +532,30 @@ function RootDropdown(t0) {
|
|
|
471
532
|
onClose,
|
|
472
533
|
onOpen,
|
|
473
534
|
onSubmitItem,
|
|
474
|
-
|
|
535
|
+
valueIdentity
|
|
475
536
|
];
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
537
|
+
$[7] = allowCreate;
|
|
538
|
+
$[8] = allowEmpty;
|
|
539
|
+
$[9] = hasItems;
|
|
540
|
+
$[10] = isOpen;
|
|
541
|
+
$[11] = isOpening;
|
|
542
|
+
$[12] = keepOpenOnSubmit;
|
|
543
|
+
$[13] = onClose;
|
|
544
|
+
$[14] = onOpen;
|
|
545
|
+
$[15] = onSubmitItem;
|
|
546
|
+
$[16] = valueIdentity;
|
|
547
|
+
$[17] = t7;
|
|
548
|
+
$[18] = t8;
|
|
488
549
|
} else {
|
|
489
|
-
|
|
490
|
-
|
|
550
|
+
t7 = $[17];
|
|
551
|
+
t8 = $[18];
|
|
491
552
|
}
|
|
492
|
-
useEffect(
|
|
553
|
+
useEffect(t7, t8);
|
|
493
554
|
const isMountedRef = useRef(false);
|
|
494
|
-
let
|
|
495
|
-
let
|
|
496
|
-
if ($[
|
|
497
|
-
|
|
555
|
+
let t10;
|
|
556
|
+
let t9;
|
|
557
|
+
if ($[19] !== isOpen) {
|
|
558
|
+
t9 = () => {
|
|
498
559
|
if (!isMountedRef.current) {
|
|
499
560
|
isMountedRef.current = true;
|
|
500
561
|
if (isOpenRef.current && onOpenRef.current) onOpenRef.current();
|
|
@@ -503,85 +564,91 @@ function RootDropdown(t0) {
|
|
|
503
564
|
if (isOpen && onOpenRef.current) onOpenRef.current();
|
|
504
565
|
else if (!isOpen && onCloseRef.current) onCloseRef.current();
|
|
505
566
|
};
|
|
506
|
-
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
567
|
+
t10 = [isOpen];
|
|
568
|
+
$[19] = isOpen;
|
|
569
|
+
$[20] = t10;
|
|
570
|
+
$[21] = t9;
|
|
510
571
|
} else {
|
|
511
|
-
|
|
512
|
-
|
|
572
|
+
t10 = $[20];
|
|
573
|
+
t9 = $[21];
|
|
513
574
|
}
|
|
514
|
-
useEffect(
|
|
515
|
-
let
|
|
516
|
-
if ($[
|
|
517
|
-
|
|
575
|
+
useEffect(t9, t10);
|
|
576
|
+
let t11;
|
|
577
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
578
|
+
t11 = { registerSubmenu(registration) {
|
|
518
579
|
submenuRegistrationsRef.current.add(registration);
|
|
519
580
|
return () => {
|
|
520
581
|
submenuRegistrationsRef.current.delete(registration);
|
|
521
582
|
};
|
|
522
583
|
} };
|
|
523
|
-
$[
|
|
524
|
-
} else
|
|
525
|
-
const dropdownContextValue =
|
|
526
|
-
let
|
|
527
|
-
if ($[
|
|
528
|
-
|
|
584
|
+
$[22] = t11;
|
|
585
|
+
} else t11 = $[22];
|
|
586
|
+
const dropdownContextValue = t11;
|
|
587
|
+
let t12;
|
|
588
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
589
|
+
t12 = (key, payload) => {
|
|
529
590
|
if (!payload.element) return;
|
|
530
591
|
for (const registration_0 of submenuRegistrationsRef.current) if (registration_0.element.contains(payload.element)) registration_0[key]?.(payload);
|
|
531
592
|
};
|
|
532
|
-
$[
|
|
533
|
-
} else
|
|
534
|
-
const dispatchToSubmenus =
|
|
535
|
-
let
|
|
536
|
-
if ($[
|
|
537
|
-
|
|
593
|
+
$[23] = t12;
|
|
594
|
+
} else t12 = $[23];
|
|
595
|
+
const dispatchToSubmenus = t12;
|
|
596
|
+
let t13;
|
|
597
|
+
if ($[24] !== onActiveItem) {
|
|
598
|
+
t13 = (payload_0) => {
|
|
538
599
|
onActiveItem?.(payload_0);
|
|
539
600
|
dispatchToSubmenus("onActiveItem", payload_0);
|
|
540
601
|
};
|
|
541
|
-
$[
|
|
542
|
-
$[
|
|
543
|
-
} else
|
|
544
|
-
const handleActiveItem =
|
|
545
|
-
let
|
|
546
|
-
if ($[
|
|
547
|
-
|
|
602
|
+
$[24] = onActiveItem;
|
|
603
|
+
$[25] = t13;
|
|
604
|
+
} else t13 = $[25];
|
|
605
|
+
const handleActiveItem = t13;
|
|
606
|
+
let t14;
|
|
607
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
608
|
+
t14 = (item, isExpanded) => {
|
|
609
|
+
const submenu = getSubmenuOfItem(item);
|
|
610
|
+
if (submenu) {
|
|
611
|
+
const isShown = submenu.matches(":popover-open");
|
|
612
|
+
if (isExpanded && !isShown) submenu.showPopover();
|
|
613
|
+
else if (!isExpanded && isShown) submenu.hidePopover();
|
|
614
|
+
}
|
|
548
615
|
for (const registration_1 of submenuRegistrationsRef.current) if (registration_1.element === item) (isExpanded ? registration_1.onOpen : registration_1.onClose)?.();
|
|
549
616
|
};
|
|
550
|
-
$[
|
|
551
|
-
} else
|
|
552
|
-
const handleToggleSubmenu =
|
|
553
|
-
let
|
|
554
|
-
if ($[
|
|
555
|
-
|
|
617
|
+
$[26] = t14;
|
|
618
|
+
} else t14 = $[26];
|
|
619
|
+
const handleToggleSubmenu = t14;
|
|
620
|
+
let t15;
|
|
621
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
622
|
+
t15 = () => {
|
|
556
623
|
if (disclosureTimerRef.current != null) {
|
|
557
624
|
clearTimeout(disclosureTimerRef.current);
|
|
558
625
|
disclosureTimerRef.current = null;
|
|
559
626
|
}
|
|
560
627
|
pendingDisclosureItemRef.current = null;
|
|
561
628
|
};
|
|
562
|
-
$[
|
|
563
|
-
} else
|
|
564
|
-
const clearDisclosureTimer =
|
|
565
|
-
let
|
|
566
|
-
let
|
|
567
|
-
if ($[
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
$[
|
|
571
|
-
$[
|
|
629
|
+
$[27] = t15;
|
|
630
|
+
} else t15 = $[27];
|
|
631
|
+
const clearDisclosureTimer = t15;
|
|
632
|
+
let t16;
|
|
633
|
+
let t17;
|
|
634
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
635
|
+
t16 = () => clearDisclosureTimer;
|
|
636
|
+
t17 = [];
|
|
637
|
+
$[28] = t16;
|
|
638
|
+
$[29] = t17;
|
|
572
639
|
} else {
|
|
573
|
-
|
|
574
|
-
|
|
640
|
+
t16 = $[28];
|
|
641
|
+
t17 = $[29];
|
|
575
642
|
}
|
|
576
|
-
useEffect(
|
|
577
|
-
let
|
|
578
|
-
if ($[
|
|
579
|
-
|
|
643
|
+
useEffect(t16, t17);
|
|
644
|
+
let t18;
|
|
645
|
+
if ($[30] !== dropdownElement) {
|
|
646
|
+
t18 = () => {
|
|
580
647
|
if (!dropdownElement) return;
|
|
581
648
|
const activeElement = getActiveItemElement(dropdownElement);
|
|
582
649
|
collapseItemsOutsidePath(dropdownElement, activeElement, handleToggleSubmenu);
|
|
583
|
-
const
|
|
584
|
-
if (activeElement &&
|
|
650
|
+
const submenu_0 = activeElement ? getSubmenuOfItem(activeElement) : null;
|
|
651
|
+
if (activeElement && submenu_0 && !isItemExpanded(activeElement)) {
|
|
585
652
|
if (pendingDisclosureItemRef.current === activeElement) return;
|
|
586
653
|
clearDisclosureTimer();
|
|
587
654
|
pendingDisclosureItemRef.current = activeElement;
|
|
@@ -595,41 +662,41 @@ function RootDropdown(t0) {
|
|
|
595
662
|
}
|
|
596
663
|
clearDisclosureTimer();
|
|
597
664
|
};
|
|
598
|
-
$[
|
|
599
|
-
$[
|
|
600
|
-
} else
|
|
601
|
-
const syncSubmenuDisclosure =
|
|
602
|
-
let
|
|
603
|
-
if ($[
|
|
604
|
-
|
|
665
|
+
$[30] = dropdownElement;
|
|
666
|
+
$[31] = t18;
|
|
667
|
+
} else t18 = $[31];
|
|
668
|
+
const syncSubmenuDisclosure = t18;
|
|
669
|
+
let t19;
|
|
670
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
671
|
+
t19 = () => {
|
|
605
672
|
if (safeAreaTimerRef.current != null) {
|
|
606
673
|
clearTimeout(safeAreaTimerRef.current);
|
|
607
674
|
safeAreaTimerRef.current = null;
|
|
608
675
|
}
|
|
609
676
|
};
|
|
610
|
-
$[
|
|
611
|
-
} else
|
|
612
|
-
const clearSafeAreaTimer =
|
|
613
|
-
let
|
|
614
|
-
let
|
|
615
|
-
if ($[
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
$[
|
|
619
|
-
$[
|
|
677
|
+
$[32] = t19;
|
|
678
|
+
} else t19 = $[32];
|
|
679
|
+
const clearSafeAreaTimer = t19;
|
|
680
|
+
let t20;
|
|
681
|
+
let t21;
|
|
682
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
683
|
+
t20 = () => clearSafeAreaTimer;
|
|
684
|
+
t21 = [];
|
|
685
|
+
$[33] = t20;
|
|
686
|
+
$[34] = t21;
|
|
620
687
|
} else {
|
|
621
|
-
|
|
622
|
-
|
|
688
|
+
t20 = $[33];
|
|
689
|
+
t21 = $[34];
|
|
623
690
|
}
|
|
624
|
-
useEffect(
|
|
625
|
-
let
|
|
626
|
-
if ($[
|
|
627
|
-
|
|
691
|
+
useEffect(t20, t21);
|
|
692
|
+
let t22;
|
|
693
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
694
|
+
t22 = (x, y) => {
|
|
628
695
|
const safeArea = safeAreaRef.current;
|
|
629
696
|
if (!safeArea || !isItemExpanded(safeArea.parent)) return false;
|
|
630
|
-
const
|
|
631
|
-
if (!
|
|
632
|
-
const submenuRect =
|
|
697
|
+
const submenu_1 = getSubmenuOfItem(safeArea.parent);
|
|
698
|
+
if (!submenu_1) return false;
|
|
699
|
+
const submenuRect = submenu_1.getBoundingClientRect();
|
|
633
700
|
const parentRect = safeArea.parent.getBoundingClientRect();
|
|
634
701
|
const nearX = submenuRect.left >= parentRect.right - 1 ? submenuRect.left : submenuRect.right;
|
|
635
702
|
return isPointInTriangle({
|
|
@@ -643,12 +710,12 @@ function RootDropdown(t0) {
|
|
|
643
710
|
y: submenuRect.bottom
|
|
644
711
|
});
|
|
645
712
|
};
|
|
646
|
-
$[
|
|
647
|
-
} else
|
|
648
|
-
const isPointerInSafeArea =
|
|
649
|
-
let
|
|
650
|
-
if ($[
|
|
651
|
-
|
|
713
|
+
$[35] = t22;
|
|
714
|
+
} else t22 = $[35];
|
|
715
|
+
const isPointerInSafeArea = t22;
|
|
716
|
+
let t23;
|
|
717
|
+
if ($[36] !== dropdownElement || $[37] !== handleActiveItem || $[38] !== syncSubmenuDisclosure) {
|
|
718
|
+
t23 = (targetElement) => {
|
|
652
719
|
clearSafeAreaTimer();
|
|
653
720
|
safeAreaRef.current = null;
|
|
654
721
|
wasInSafeAreaRef.current = false;
|
|
@@ -665,15 +732,15 @@ function RootDropdown(t0) {
|
|
|
665
732
|
});
|
|
666
733
|
syncSubmenuDisclosure();
|
|
667
734
|
};
|
|
668
|
-
$[
|
|
669
|
-
$[
|
|
670
|
-
$[
|
|
671
|
-
$[
|
|
672
|
-
} else
|
|
673
|
-
const commitPointerTarget =
|
|
674
|
-
let
|
|
675
|
-
if ($[
|
|
676
|
-
|
|
735
|
+
$[36] = dropdownElement;
|
|
736
|
+
$[37] = handleActiveItem;
|
|
737
|
+
$[38] = syncSubmenuDisclosure;
|
|
738
|
+
$[39] = t23;
|
|
739
|
+
} else t23 = $[39];
|
|
740
|
+
const commitPointerTarget = t23;
|
|
741
|
+
let t24;
|
|
742
|
+
if ($[40] !== commitPointerTarget || $[41] !== dropdownElement) {
|
|
743
|
+
t24 = (event_0) => {
|
|
677
744
|
if (!dropdownElement || !isOpenRef.current || !hasItemsRef.current) return;
|
|
678
745
|
const pointer_0 = {
|
|
679
746
|
x: event_0.clientX,
|
|
@@ -689,8 +756,8 @@ function RootDropdown(t0) {
|
|
|
689
756
|
return;
|
|
690
757
|
}
|
|
691
758
|
const target_0 = event_0.target;
|
|
692
|
-
const
|
|
693
|
-
if (parent.contains(target_0) && !(
|
|
759
|
+
const submenu_2 = getSubmenuOfItem(parent);
|
|
760
|
+
if (parent.contains(target_0) && !(submenu_2?.contains(target_0) ?? false)) {
|
|
694
761
|
safeAreaRef.current = {
|
|
695
762
|
apex: pointer_0,
|
|
696
763
|
parent
|
|
@@ -706,37 +773,37 @@ function RootDropdown(t0) {
|
|
|
706
773
|
safeAreaTimerRef.current = setTimeout(commitPointerTarget, SAFE_AREA_TIMEOUT);
|
|
707
774
|
} else if (wasInSafeAreaRef.current) commitPointerTarget(target_0);
|
|
708
775
|
};
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
711
|
-
$[
|
|
712
|
-
} else
|
|
713
|
-
const trackSafeArea =
|
|
714
|
-
let
|
|
715
|
-
if ($[
|
|
716
|
-
|
|
776
|
+
$[40] = commitPointerTarget;
|
|
777
|
+
$[41] = dropdownElement;
|
|
778
|
+
$[42] = t24;
|
|
779
|
+
} else t24 = $[42];
|
|
780
|
+
const trackSafeArea = t24;
|
|
781
|
+
let t25;
|
|
782
|
+
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
783
|
+
t25 = () => {
|
|
717
784
|
if (hoverCloseTimerRef.current != null) {
|
|
718
785
|
clearTimeout(hoverCloseTimerRef.current);
|
|
719
786
|
hoverCloseTimerRef.current = null;
|
|
720
787
|
}
|
|
721
788
|
};
|
|
722
|
-
$[
|
|
723
|
-
} else
|
|
724
|
-
const clearHoverCloseTimer =
|
|
725
|
-
let
|
|
726
|
-
let
|
|
727
|
-
if ($[
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
789
|
+
$[43] = t25;
|
|
790
|
+
} else t25 = $[43];
|
|
791
|
+
const clearHoverCloseTimer = t25;
|
|
792
|
+
let t26;
|
|
793
|
+
let t27;
|
|
794
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
795
|
+
t26 = () => clearHoverCloseTimer;
|
|
796
|
+
t27 = [];
|
|
797
|
+
$[44] = t26;
|
|
798
|
+
$[45] = t27;
|
|
732
799
|
} else {
|
|
733
|
-
|
|
734
|
-
|
|
800
|
+
t26 = $[44];
|
|
801
|
+
t27 = $[45];
|
|
735
802
|
}
|
|
736
|
-
useEffect(
|
|
737
|
-
let
|
|
738
|
-
if ($[
|
|
739
|
-
|
|
803
|
+
useEffect(t26, t27);
|
|
804
|
+
let t28;
|
|
805
|
+
if ($[46] !== dropdownElement || $[47] !== menubar) {
|
|
806
|
+
t28 = (options) => {
|
|
740
807
|
setIsOpen(false);
|
|
741
808
|
setIsOpening(false);
|
|
742
809
|
mouseDownPositionRef.current = null;
|
|
@@ -751,51 +818,51 @@ function RootDropdown(t0) {
|
|
|
751
818
|
}
|
|
752
819
|
if (menubar && dropdownElement && !options?.keepMenubarEngaged) menubar.notifyClosed(dropdownElement);
|
|
753
820
|
};
|
|
754
|
-
$[
|
|
755
|
-
$[
|
|
756
|
-
$[
|
|
757
|
-
} else
|
|
758
|
-
const closeDropdown =
|
|
759
|
-
let
|
|
760
|
-
if ($[
|
|
761
|
-
|
|
821
|
+
$[46] = dropdownElement;
|
|
822
|
+
$[47] = menubar;
|
|
823
|
+
$[48] = t28;
|
|
824
|
+
} else t28 = $[48];
|
|
825
|
+
const closeDropdown = t28;
|
|
826
|
+
let t29;
|
|
827
|
+
if ($[49] !== openOnHover) {
|
|
828
|
+
t29 = () => {
|
|
762
829
|
clearHoverCloseTimer();
|
|
763
830
|
if (!openOnHover || isOpenRef.current) return;
|
|
764
831
|
setIsOpen(true);
|
|
765
832
|
setIsOpening(false);
|
|
766
833
|
};
|
|
767
|
-
$[
|
|
768
|
-
$[
|
|
769
|
-
} else
|
|
770
|
-
const handleDropdownMouseEnter =
|
|
771
|
-
let
|
|
772
|
-
if ($[
|
|
773
|
-
|
|
834
|
+
$[49] = openOnHover;
|
|
835
|
+
$[50] = t29;
|
|
836
|
+
} else t29 = $[50];
|
|
837
|
+
const handleDropdownMouseEnter = t29;
|
|
838
|
+
let t30;
|
|
839
|
+
if ($[51] !== closeDropdown || $[52] !== openOnHover) {
|
|
840
|
+
t30 = () => {
|
|
774
841
|
if (!openOnHover || !isOpenRef.current || hoverCloseTimerRef.current != null) return;
|
|
775
842
|
hoverCloseTimerRef.current = setTimeout(() => {
|
|
776
843
|
hoverCloseTimerRef.current = null;
|
|
777
844
|
closeDropdown();
|
|
778
845
|
}, HOVER_CLOSE_DELAY);
|
|
779
846
|
};
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
} else
|
|
784
|
-
const handleDropdownMouseLeave =
|
|
785
|
-
let
|
|
786
|
-
if ($[
|
|
787
|
-
|
|
847
|
+
$[51] = closeDropdown;
|
|
848
|
+
$[52] = openOnHover;
|
|
849
|
+
$[53] = t30;
|
|
850
|
+
} else t30 = $[53];
|
|
851
|
+
const handleDropdownMouseLeave = t30;
|
|
852
|
+
let t31;
|
|
853
|
+
if ($[54] !== dropdownElement?.firstElementChild) {
|
|
854
|
+
t31 = () => {
|
|
788
855
|
const firstChild = dropdownElement?.firstElementChild;
|
|
789
856
|
if (!firstChild) return;
|
|
790
857
|
(firstChild.matches(FOCUSABLE_SELECTOR) ? firstChild : firstChild.querySelector(FOCUSABLE_SELECTOR))?.focus();
|
|
791
858
|
};
|
|
792
|
-
$[
|
|
793
|
-
$[
|
|
794
|
-
} else
|
|
795
|
-
const focusTrigger =
|
|
796
|
-
let
|
|
797
|
-
if ($[
|
|
798
|
-
|
|
859
|
+
$[54] = dropdownElement?.firstElementChild;
|
|
860
|
+
$[55] = t31;
|
|
861
|
+
} else t31 = $[55];
|
|
862
|
+
const focusTrigger = t31;
|
|
863
|
+
let t32;
|
|
864
|
+
if ($[56] !== closeDropdown || $[57] !== dropdownElement || $[58] !== focusTrigger || $[59] !== menubar) {
|
|
865
|
+
t32 = () => {
|
|
799
866
|
if (!menubar || !dropdownElement) return;
|
|
800
867
|
return menubar.registerMember({
|
|
801
868
|
close: () => closeDropdown({ keepMenubarEngaged: true }),
|
|
@@ -805,37 +872,37 @@ function RootDropdown(t0) {
|
|
|
805
872
|
open: () => setIsOpen(true)
|
|
806
873
|
});
|
|
807
874
|
};
|
|
808
|
-
$[
|
|
809
|
-
$[
|
|
810
|
-
$[
|
|
811
|
-
$[
|
|
812
|
-
$[
|
|
813
|
-
} else
|
|
814
|
-
useEffect(
|
|
815
|
-
let
|
|
816
|
-
let
|
|
817
|
-
if ($[
|
|
818
|
-
|
|
875
|
+
$[56] = closeDropdown;
|
|
876
|
+
$[57] = dropdownElement;
|
|
877
|
+
$[58] = focusTrigger;
|
|
878
|
+
$[59] = menubar;
|
|
879
|
+
$[60] = t32;
|
|
880
|
+
} else t32 = $[60];
|
|
881
|
+
useEffect(t32);
|
|
882
|
+
let t33;
|
|
883
|
+
let t34;
|
|
884
|
+
if ($[61] !== dropdownElement || $[62] !== isOpen || $[63] !== menubar) {
|
|
885
|
+
t33 = () => {
|
|
819
886
|
if (isOpen && menubar && dropdownElement) menubar.notifyOpened(dropdownElement);
|
|
820
887
|
};
|
|
821
|
-
|
|
888
|
+
t34 = [
|
|
822
889
|
dropdownElement,
|
|
823
890
|
isOpen,
|
|
824
891
|
menubar
|
|
825
892
|
];
|
|
826
|
-
$[
|
|
827
|
-
$[
|
|
828
|
-
$[
|
|
829
|
-
$[
|
|
830
|
-
$[
|
|
893
|
+
$[61] = dropdownElement;
|
|
894
|
+
$[62] = isOpen;
|
|
895
|
+
$[63] = menubar;
|
|
896
|
+
$[64] = t33;
|
|
897
|
+
$[65] = t34;
|
|
831
898
|
} else {
|
|
832
|
-
|
|
833
|
-
|
|
899
|
+
t33 = $[64];
|
|
900
|
+
t34 = $[65];
|
|
834
901
|
}
|
|
835
|
-
useEffect(
|
|
836
|
-
let
|
|
837
|
-
if ($[
|
|
838
|
-
|
|
902
|
+
useEffect(t33, t34);
|
|
903
|
+
let t35;
|
|
904
|
+
if ($[66] !== closeDropdown || $[67] !== dropdownElement || $[68] !== handleActiveItem || $[69] !== popupRole) {
|
|
905
|
+
t35 = (event_1) => {
|
|
839
906
|
const element = hasItemsRef.current ? getActiveItemElement(dropdownElement) : null;
|
|
840
907
|
const submenuOfActive = element ? getSubmenuOfItem(element) : null;
|
|
841
908
|
if (element && submenuOfActive) {
|
|
@@ -868,6 +935,11 @@ function RootDropdown(t0) {
|
|
|
868
935
|
}
|
|
869
936
|
const nextValue = element?.dataset.uktValue ?? itemLabel;
|
|
870
937
|
if (valueRef.current && valueRef.current === nextValue) return;
|
|
938
|
+
if (element && keepOpenOnSubmitRef.current && popupRole === "listbox" && !consumerOwnsARIASelectedRef.current) {
|
|
939
|
+
const bodyElement = element.closest(".uktdropdown-body");
|
|
940
|
+
for (const selected of Array.from(bodyElement?.querySelectorAll("[aria-selected=\"true\"]") ?? [])) selected.removeAttribute("aria-selected");
|
|
941
|
+
element.setAttribute("aria-selected", "true");
|
|
942
|
+
}
|
|
871
943
|
if (element) {
|
|
872
944
|
const eventTarget = event_1.target;
|
|
873
945
|
if (element.matches(CLICKABLE_SELECTOR)) {
|
|
@@ -890,15 +962,16 @@ function RootDropdown(t0) {
|
|
|
890
962
|
onSubmitItemRef.current?.(payload_1);
|
|
891
963
|
dispatchToSubmenus("onSubmitItem", payload_1);
|
|
892
964
|
};
|
|
893
|
-
$[
|
|
894
|
-
$[
|
|
895
|
-
$[
|
|
896
|
-
$[
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
965
|
+
$[66] = closeDropdown;
|
|
966
|
+
$[67] = dropdownElement;
|
|
967
|
+
$[68] = handleActiveItem;
|
|
968
|
+
$[69] = popupRole;
|
|
969
|
+
$[70] = t35;
|
|
970
|
+
} else t35 = $[70];
|
|
971
|
+
const handleSubmitItem = t35;
|
|
972
|
+
let t36;
|
|
973
|
+
if ($[71] !== trackSafeArea) {
|
|
974
|
+
t36 = (event_2) => {
|
|
902
975
|
const { clientX, clientY } = event_2;
|
|
903
976
|
currentInputMethodRef.current = "mouse";
|
|
904
977
|
trackSafeArea(event_2);
|
|
@@ -907,13 +980,13 @@ function RootDropdown(t0) {
|
|
|
907
980
|
if (Math.abs(initialPosition.clientX - clientX) < 12 && Math.abs(initialPosition.clientY - clientY) < 12) return;
|
|
908
981
|
setIsOpening(false);
|
|
909
982
|
};
|
|
910
|
-
$[
|
|
911
|
-
$[
|
|
912
|
-
} else
|
|
913
|
-
const handleMouseMove =
|
|
914
|
-
let
|
|
915
|
-
if ($[
|
|
916
|
-
|
|
983
|
+
$[71] = trackSafeArea;
|
|
984
|
+
$[72] = t36;
|
|
985
|
+
} else t36 = $[72];
|
|
986
|
+
const handleMouseMove = t36;
|
|
987
|
+
let t37;
|
|
988
|
+
if ($[73] !== dropdownElement || $[74] !== handleActiveItem || $[75] !== syncSubmenuDisclosure) {
|
|
989
|
+
t37 = (event_3) => {
|
|
917
990
|
if (!hasItemsRef.current) return;
|
|
918
991
|
if (currentInputMethodRef.current !== "mouse") return;
|
|
919
992
|
if (!dropdownElement) return;
|
|
@@ -932,15 +1005,15 @@ function RootDropdown(t0) {
|
|
|
932
1005
|
});
|
|
933
1006
|
syncSubmenuDisclosure();
|
|
934
1007
|
};
|
|
935
|
-
$[
|
|
936
|
-
$[
|
|
937
|
-
$[
|
|
938
|
-
$[
|
|
939
|
-
} else
|
|
940
|
-
const handleMouseOver =
|
|
941
|
-
let
|
|
942
|
-
if ($[
|
|
943
|
-
|
|
1008
|
+
$[73] = dropdownElement;
|
|
1009
|
+
$[74] = handleActiveItem;
|
|
1010
|
+
$[75] = syncSubmenuDisclosure;
|
|
1011
|
+
$[76] = t37;
|
|
1012
|
+
} else t37 = $[76];
|
|
1013
|
+
const handleMouseOver = t37;
|
|
1014
|
+
let t38;
|
|
1015
|
+
if ($[77] !== dropdownElement || $[78] !== syncSubmenuDisclosure) {
|
|
1016
|
+
t38 = (event_4) => {
|
|
944
1017
|
if (!hasItemsRef.current) return;
|
|
945
1018
|
const relatedTarget = event_4.relatedTarget;
|
|
946
1019
|
if (!dropdownElement?.contains(relatedTarget)) {
|
|
@@ -956,14 +1029,14 @@ function RootDropdown(t0) {
|
|
|
956
1029
|
delete activeItem.dataset.uktActive;
|
|
957
1030
|
syncSubmenuDisclosure();
|
|
958
1031
|
};
|
|
959
|
-
$[
|
|
960
|
-
$[
|
|
961
|
-
$[
|
|
962
|
-
} else
|
|
963
|
-
const handleMouseOut =
|
|
964
|
-
let
|
|
965
|
-
if ($[
|
|
966
|
-
|
|
1032
|
+
$[77] = dropdownElement;
|
|
1033
|
+
$[78] = syncSubmenuDisclosure;
|
|
1034
|
+
$[79] = t38;
|
|
1035
|
+
} else t38 = $[79];
|
|
1036
|
+
const handleMouseOut = t38;
|
|
1037
|
+
let t39;
|
|
1038
|
+
if ($[80] !== onMouseDown) {
|
|
1039
|
+
t39 = (event_5) => {
|
|
967
1040
|
if (onMouseDown) onMouseDown(event_5);
|
|
968
1041
|
if (isOpenRef.current) return;
|
|
969
1042
|
setIsOpen(true);
|
|
@@ -977,13 +1050,13 @@ function RootDropdown(t0) {
|
|
|
977
1050
|
isOpeningTimerRef.current = null;
|
|
978
1051
|
}, 1e3);
|
|
979
1052
|
};
|
|
980
|
-
$[
|
|
981
|
-
$[
|
|
982
|
-
} else
|
|
983
|
-
const handleMouseDown =
|
|
984
|
-
let
|
|
985
|
-
if ($[
|
|
986
|
-
|
|
1053
|
+
$[80] = onMouseDown;
|
|
1054
|
+
$[81] = t39;
|
|
1055
|
+
} else t39 = $[81];
|
|
1056
|
+
const handleMouseDown = t39;
|
|
1057
|
+
let t40;
|
|
1058
|
+
if ($[82] !== closeDropdown || $[83] !== dropdownElement || $[84] !== handleActiveItem || $[85] !== handleSubmitItem || $[86] !== onMouseUp) {
|
|
1059
|
+
t40 = (event_6) => {
|
|
987
1060
|
if (onMouseUp) onMouseUp(event_6);
|
|
988
1061
|
if (isOpeningRef.current || !isOpenRef.current || closingTimerRef.current != null) return;
|
|
989
1062
|
const eventTarget_1 = event_6.target;
|
|
@@ -1007,17 +1080,17 @@ function RootDropdown(t0) {
|
|
|
1007
1080
|
}
|
|
1008
1081
|
handleSubmitItem(event_6);
|
|
1009
1082
|
};
|
|
1010
|
-
$[
|
|
1011
|
-
$[
|
|
1012
|
-
$[
|
|
1013
|
-
$[
|
|
1014
|
-
$[
|
|
1015
|
-
$[
|
|
1016
|
-
} else
|
|
1017
|
-
const handleMouseUp =
|
|
1018
|
-
let
|
|
1019
|
-
if ($[
|
|
1020
|
-
|
|
1083
|
+
$[82] = closeDropdown;
|
|
1084
|
+
$[83] = dropdownElement;
|
|
1085
|
+
$[84] = handleActiveItem;
|
|
1086
|
+
$[85] = handleSubmitItem;
|
|
1087
|
+
$[86] = onMouseUp;
|
|
1088
|
+
$[87] = t40;
|
|
1089
|
+
} else t40 = $[87];
|
|
1090
|
+
const handleMouseUp = t40;
|
|
1091
|
+
let t41;
|
|
1092
|
+
if ($[88] !== closeDropdown || $[89] !== dropdownElement || $[90] !== focusTrigger || $[91] !== handleActiveItem || $[92] !== handleSubmitItem || $[93] !== menubar || $[94] !== syncSubmenuDisclosure) {
|
|
1093
|
+
t41 = (event_7) => {
|
|
1021
1094
|
const { altKey, ctrlKey, key: key_0, metaKey } = event_7;
|
|
1022
1095
|
const eventTarget_2 = event_7.target;
|
|
1023
1096
|
if (!dropdownElement) return;
|
|
@@ -1111,12 +1184,12 @@ function RootDropdown(t0) {
|
|
|
1111
1184
|
if (!isTargetUsingKeyEvents) {
|
|
1112
1185
|
if (key_0 === "ArrowRight") {
|
|
1113
1186
|
const activeElement_0 = getActiveItemElement(dropdownElement);
|
|
1114
|
-
const
|
|
1115
|
-
if (activeElement_0 &&
|
|
1187
|
+
const submenu_3 = activeElement_0 ? getSubmenuOfItem(activeElement_0) : null;
|
|
1188
|
+
if (activeElement_0 && submenu_3) {
|
|
1116
1189
|
onEventHandled();
|
|
1117
1190
|
clearDisclosureTimer();
|
|
1118
1191
|
expandItem(activeElement_0, handleToggleSubmenu);
|
|
1119
|
-
const firstItem_0 = getItemElements(dropdownElement,
|
|
1192
|
+
const firstItem_0 = getItemElements(dropdownElement, submenu_3)?.[0];
|
|
1120
1193
|
if (firstItem_0) setActiveItem({
|
|
1121
1194
|
dropdownElement,
|
|
1122
1195
|
element: firstItem_0,
|
|
@@ -1150,29 +1223,29 @@ function RootDropdown(t0) {
|
|
|
1150
1223
|
}
|
|
1151
1224
|
}
|
|
1152
1225
|
};
|
|
1153
|
-
$[
|
|
1154
|
-
$[
|
|
1155
|
-
$[
|
|
1156
|
-
$[
|
|
1157
|
-
$[
|
|
1158
|
-
$[
|
|
1159
|
-
$[
|
|
1160
|
-
$[
|
|
1161
|
-
} else
|
|
1162
|
-
const handleKeyDown =
|
|
1163
|
-
let
|
|
1164
|
-
if ($[
|
|
1165
|
-
|
|
1226
|
+
$[88] = closeDropdown;
|
|
1227
|
+
$[89] = dropdownElement;
|
|
1228
|
+
$[90] = focusTrigger;
|
|
1229
|
+
$[91] = handleActiveItem;
|
|
1230
|
+
$[92] = handleSubmitItem;
|
|
1231
|
+
$[93] = menubar;
|
|
1232
|
+
$[94] = syncSubmenuDisclosure;
|
|
1233
|
+
$[95] = t41;
|
|
1234
|
+
} else t41 = $[95];
|
|
1235
|
+
const handleKeyDown = t41;
|
|
1236
|
+
let t42;
|
|
1237
|
+
if ($[96] !== handleKeyDown) {
|
|
1238
|
+
t42 = {
|
|
1166
1239
|
ignoreUsedKeyboardEvents: false,
|
|
1167
1240
|
onKeyDown: handleKeyDown
|
|
1168
1241
|
};
|
|
1169
|
-
$[
|
|
1170
|
-
$[
|
|
1171
|
-
} else
|
|
1172
|
-
useKeyboardEvents(
|
|
1173
|
-
let
|
|
1174
|
-
if ($[
|
|
1175
|
-
|
|
1242
|
+
$[96] = handleKeyDown;
|
|
1243
|
+
$[97] = t42;
|
|
1244
|
+
} else t42 = $[97];
|
|
1245
|
+
useKeyboardEvents(t42);
|
|
1246
|
+
let t43;
|
|
1247
|
+
if ($[98] !== closeDropdown || $[99] !== handleActiveItem || $[100] !== isOpenOnMount) {
|
|
1248
|
+
t43 = (ref) => {
|
|
1176
1249
|
setDropdownElement(ref);
|
|
1177
1250
|
if (!ref) return;
|
|
1178
1251
|
const { ownerDocument } = ref;
|
|
@@ -1182,13 +1255,13 @@ function RootDropdown(t0) {
|
|
|
1182
1255
|
else inputElement = ref.firstElementChild.querySelector(TEXT_INPUT_SELECTOR);
|
|
1183
1256
|
inputElementRef.current = inputElement;
|
|
1184
1257
|
}
|
|
1185
|
-
const handleGlobalMouseDown = (
|
|
1186
|
-
const { target: target_1 } =
|
|
1258
|
+
const handleGlobalMouseDown = (t44) => {
|
|
1259
|
+
const { target: target_1 } = t44;
|
|
1187
1260
|
const eventTarget_3 = target_1;
|
|
1188
1261
|
if (!ref.contains(eventTarget_3)) closeDropdown();
|
|
1189
1262
|
};
|
|
1190
|
-
const handleGlobalMouseUp = (
|
|
1191
|
-
const { target: target_2 } =
|
|
1263
|
+
const handleGlobalMouseUp = (t45) => {
|
|
1264
|
+
const { target: target_2 } = t45;
|
|
1192
1265
|
if (!isOpenRef.current || closingTimerRef.current != null) return;
|
|
1193
1266
|
if (isOpeningRef.current) {
|
|
1194
1267
|
setIsOpening(false);
|
|
@@ -1201,8 +1274,8 @@ function RootDropdown(t0) {
|
|
|
1201
1274
|
const eventTarget_4 = target_2;
|
|
1202
1275
|
if (!ref.contains(eventTarget_4)) closeDropdown();
|
|
1203
1276
|
};
|
|
1204
|
-
const handleGlobalFocusIn = (
|
|
1205
|
-
const { target: target_3 } =
|
|
1277
|
+
const handleGlobalFocusIn = (t46) => {
|
|
1278
|
+
const { target: target_3 } = t46;
|
|
1206
1279
|
if (!isOpenRef.current) return;
|
|
1207
1280
|
const eventTarget_5 = target_3;
|
|
1208
1281
|
if (ref.contains(eventTarget_5) || eventTarget_5.contains(ref)) return;
|
|
@@ -1244,52 +1317,78 @@ function RootDropdown(t0) {
|
|
|
1244
1317
|
if (inputElement) inputElement.removeEventListener("input", handleInput);
|
|
1245
1318
|
};
|
|
1246
1319
|
};
|
|
1247
|
-
$[
|
|
1248
|
-
$[
|
|
1249
|
-
$[
|
|
1250
|
-
$[
|
|
1251
|
-
} else
|
|
1252
|
-
const handleRef =
|
|
1253
|
-
|
|
1320
|
+
$[98] = closeDropdown;
|
|
1321
|
+
$[99] = handleActiveItem;
|
|
1322
|
+
$[100] = isOpenOnMount;
|
|
1323
|
+
$[101] = t43;
|
|
1324
|
+
} else t43 = $[101];
|
|
1325
|
+
const handleRef = t43;
|
|
1326
|
+
let t44;
|
|
1327
|
+
if ($[102] !== dropdownElement || $[103] !== popupRole || $[104] !== valueIdentity) {
|
|
1328
|
+
t44 = (ref_0) => {
|
|
1329
|
+
if (!ref_0) return;
|
|
1330
|
+
if (annotatedBodiesRef.current.has(ref_0)) return;
|
|
1331
|
+
annotatedBodiesRef.current.add(ref_0);
|
|
1332
|
+
consumerOwnsARIASelectedRef.current = ref_0.querySelector("[aria-selected]") != null;
|
|
1333
|
+
annotateParentItems(ref_0);
|
|
1334
|
+
if (popupRole !== "dialog") annotateItemRoles(ref_0, popupRole);
|
|
1335
|
+
ref_0.showPopover();
|
|
1336
|
+
if (valueIdentity != null && dropdownElement) {
|
|
1337
|
+
const selectedItem = getItemElements(dropdownElement)?.find((item_2) => item_2.dataset.uktValue === valueIdentity);
|
|
1338
|
+
if (selectedItem) {
|
|
1339
|
+
if (popupRole === "listbox" && !consumerOwnsARIASelectedRef.current) selectedItem.setAttribute("aria-selected", "true");
|
|
1340
|
+
setActiveItem({
|
|
1341
|
+
dropdownElement,
|
|
1342
|
+
element: selectedItem
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
$[102] = dropdownElement;
|
|
1348
|
+
$[103] = popupRole;
|
|
1349
|
+
$[104] = valueIdentity;
|
|
1350
|
+
$[105] = t44;
|
|
1351
|
+
} else t44 = $[105];
|
|
1352
|
+
const handleBodyRef = t44;
|
|
1254
1353
|
if (!isValidElement(trigger)) if (isSearchable) {
|
|
1255
|
-
const
|
|
1256
|
-
let
|
|
1257
|
-
if ($[
|
|
1258
|
-
|
|
1259
|
-
$[
|
|
1260
|
-
} else
|
|
1261
|
-
let
|
|
1262
|
-
if ($[
|
|
1263
|
-
|
|
1354
|
+
const t45 = valueLabel ?? "";
|
|
1355
|
+
let t46;
|
|
1356
|
+
if ($[106] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1357
|
+
t46 = () => setIsOpen(true);
|
|
1358
|
+
$[106] = t46;
|
|
1359
|
+
} else t46 = $[106];
|
|
1360
|
+
let t47;
|
|
1361
|
+
if ($[107] !== bodyId || $[108] !== disabled || $[109] !== isOpen || $[110] !== name || $[111] !== placeholder || $[112] !== popupRole || $[113] !== t45 || $[114] !== tabIndex) {
|
|
1362
|
+
t47 = /* @__PURE__ */ jsx("input", {
|
|
1264
1363
|
"aria-controls": bodyId,
|
|
1265
1364
|
"aria-expanded": isOpen,
|
|
1266
1365
|
"aria-haspopup": popupRole,
|
|
1267
1366
|
autoComplete: "off",
|
|
1268
1367
|
className: "uktdropdown-trigger",
|
|
1269
|
-
defaultValue:
|
|
1368
|
+
defaultValue: t45,
|
|
1270
1369
|
disabled,
|
|
1271
1370
|
name,
|
|
1272
|
-
onFocus:
|
|
1371
|
+
onFocus: t46,
|
|
1273
1372
|
placeholder,
|
|
1274
1373
|
ref: inputElementRef,
|
|
1275
1374
|
tabIndex,
|
|
1276
1375
|
type: "text"
|
|
1277
1376
|
});
|
|
1278
|
-
$[
|
|
1279
|
-
$[
|
|
1280
|
-
$[
|
|
1281
|
-
$[
|
|
1282
|
-
$[
|
|
1283
|
-
$[
|
|
1284
|
-
$[
|
|
1285
|
-
$[
|
|
1286
|
-
$[
|
|
1287
|
-
} else
|
|
1288
|
-
trigger =
|
|
1377
|
+
$[107] = bodyId;
|
|
1378
|
+
$[108] = disabled;
|
|
1379
|
+
$[109] = isOpen;
|
|
1380
|
+
$[110] = name;
|
|
1381
|
+
$[111] = placeholder;
|
|
1382
|
+
$[112] = popupRole;
|
|
1383
|
+
$[113] = t45;
|
|
1384
|
+
$[114] = tabIndex;
|
|
1385
|
+
$[115] = t47;
|
|
1386
|
+
} else t47 = $[115];
|
|
1387
|
+
trigger = t47;
|
|
1289
1388
|
} else {
|
|
1290
|
-
let
|
|
1291
|
-
if ($[
|
|
1292
|
-
|
|
1389
|
+
let t45;
|
|
1390
|
+
if ($[116] !== bodyId || $[117] !== isOpen || $[118] !== popupRole || $[119] !== trigger) {
|
|
1391
|
+
t45 = /* @__PURE__ */ jsx("button", {
|
|
1293
1392
|
"aria-controls": bodyId,
|
|
1294
1393
|
"aria-expanded": isOpen,
|
|
1295
1394
|
"aria-haspopup": popupRole,
|
|
@@ -1298,82 +1397,82 @@ function RootDropdown(t0) {
|
|
|
1298
1397
|
type: "button",
|
|
1299
1398
|
children: trigger
|
|
1300
1399
|
});
|
|
1301
|
-
$[
|
|
1302
|
-
$[
|
|
1303
|
-
$[
|
|
1304
|
-
$[
|
|
1305
|
-
$[
|
|
1306
|
-
} else
|
|
1307
|
-
trigger =
|
|
1400
|
+
$[116] = bodyId;
|
|
1401
|
+
$[117] = isOpen;
|
|
1402
|
+
$[118] = popupRole;
|
|
1403
|
+
$[119] = trigger;
|
|
1404
|
+
$[120] = t45;
|
|
1405
|
+
} else t45 = $[120];
|
|
1406
|
+
trigger = t45;
|
|
1308
1407
|
}
|
|
1309
1408
|
else {
|
|
1310
1409
|
const triggerProps = trigger.props;
|
|
1311
|
-
const
|
|
1312
|
-
const
|
|
1313
|
-
const
|
|
1314
|
-
const
|
|
1315
|
-
let
|
|
1316
|
-
if ($[
|
|
1317
|
-
|
|
1318
|
-
"aria-controls":
|
|
1319
|
-
"aria-expanded":
|
|
1320
|
-
"aria-haspopup":
|
|
1410
|
+
const t45 = trigger;
|
|
1411
|
+
const t46 = triggerProps["aria-controls"] ?? bodyId;
|
|
1412
|
+
const t47 = triggerProps["aria-expanded"] ?? isOpen;
|
|
1413
|
+
const t48 = triggerProps["aria-haspopup"] ?? popupRole;
|
|
1414
|
+
let t49;
|
|
1415
|
+
if ($[121] !== t45 || $[122] !== t46 || $[123] !== t47 || $[124] !== t48) {
|
|
1416
|
+
t49 = cloneElement(t45, {
|
|
1417
|
+
"aria-controls": t46,
|
|
1418
|
+
"aria-expanded": t47,
|
|
1419
|
+
"aria-haspopup": t48
|
|
1321
1420
|
});
|
|
1322
|
-
$[
|
|
1323
|
-
$[
|
|
1324
|
-
$[
|
|
1325
|
-
$[
|
|
1326
|
-
$[
|
|
1327
|
-
} else
|
|
1328
|
-
trigger =
|
|
1421
|
+
$[121] = t45;
|
|
1422
|
+
$[122] = t46;
|
|
1423
|
+
$[123] = t47;
|
|
1424
|
+
$[124] = t48;
|
|
1425
|
+
$[125] = t49;
|
|
1426
|
+
} else t49 = $[125];
|
|
1427
|
+
trigger = t49;
|
|
1329
1428
|
}
|
|
1330
1429
|
if (label != null) {
|
|
1331
|
-
let
|
|
1332
|
-
if ($[
|
|
1333
|
-
|
|
1430
|
+
let t45;
|
|
1431
|
+
if ($[126] !== label) {
|
|
1432
|
+
t45 = /* @__PURE__ */ jsx("div", {
|
|
1334
1433
|
className: "uktdropdown-label-text",
|
|
1335
1434
|
children: label
|
|
1336
1435
|
});
|
|
1337
|
-
$[
|
|
1338
|
-
$[
|
|
1339
|
-
} else
|
|
1340
|
-
let
|
|
1341
|
-
if ($[
|
|
1342
|
-
|
|
1436
|
+
$[126] = label;
|
|
1437
|
+
$[127] = t45;
|
|
1438
|
+
} else t45 = $[127];
|
|
1439
|
+
let t46;
|
|
1440
|
+
if ($[128] !== t45 || $[129] !== trigger) {
|
|
1441
|
+
t46 = /* @__PURE__ */ jsxs("label", {
|
|
1343
1442
|
className: "uktdropdown-label",
|
|
1344
|
-
children: [
|
|
1443
|
+
children: [t45, trigger]
|
|
1345
1444
|
});
|
|
1346
|
-
$[
|
|
1347
|
-
$[
|
|
1348
|
-
$[
|
|
1349
|
-
} else
|
|
1350
|
-
trigger =
|
|
1445
|
+
$[128] = t45;
|
|
1446
|
+
$[129] = trigger;
|
|
1447
|
+
$[130] = t46;
|
|
1448
|
+
} else t46 = $[130];
|
|
1449
|
+
trigger = t46;
|
|
1351
1450
|
}
|
|
1352
|
-
let
|
|
1353
|
-
if ($[
|
|
1354
|
-
|
|
1451
|
+
let t45;
|
|
1452
|
+
if ($[131] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1453
|
+
t45 = /* @__PURE__ */ jsx("style", {
|
|
1355
1454
|
href: "@acusti/dropdown/Dropdown",
|
|
1356
1455
|
precedence: "medium",
|
|
1357
1456
|
children: Dropdown_default
|
|
1358
1457
|
});
|
|
1359
|
-
$[
|
|
1360
|
-
} else
|
|
1361
|
-
let
|
|
1362
|
-
if ($[
|
|
1363
|
-
|
|
1458
|
+
$[131] = t45;
|
|
1459
|
+
} else t45 = $[131];
|
|
1460
|
+
let t46;
|
|
1461
|
+
if ($[132] !== className || $[133] !== disabled || $[134] !== isOpen || $[135] !== isSearchable) {
|
|
1462
|
+
t46 = clsx("uktdropdown", className, {
|
|
1364
1463
|
disabled,
|
|
1365
1464
|
"is-open": isOpen,
|
|
1366
1465
|
"is-searchable": isSearchable
|
|
1367
1466
|
});
|
|
1368
|
-
$[
|
|
1369
|
-
$[
|
|
1370
|
-
$[
|
|
1371
|
-
$[
|
|
1372
|
-
$[
|
|
1373
|
-
} else
|
|
1374
|
-
let
|
|
1375
|
-
if ($[
|
|
1376
|
-
|
|
1467
|
+
$[132] = className;
|
|
1468
|
+
$[133] = disabled;
|
|
1469
|
+
$[134] = isOpen;
|
|
1470
|
+
$[135] = isSearchable;
|
|
1471
|
+
$[136] = t46;
|
|
1472
|
+
} else t46 = $[136];
|
|
1473
|
+
let t47;
|
|
1474
|
+
if ($[137] !== body || $[138] !== bodyId || $[139] !== handleBodyRef || $[140] !== hasItems || $[141] !== isOpen || $[142] !== popupRole) {
|
|
1475
|
+
t47 = isOpen ? /* @__PURE__ */ jsx("div", {
|
|
1377
1476
|
className: clsx("uktdropdown-body", { "has-items": hasItems }),
|
|
1378
1477
|
id: bodyId,
|
|
1379
1478
|
popover: "manual",
|
|
@@ -1383,22 +1482,22 @@ function RootDropdown(t0) {
|
|
|
1383
1482
|
className: "uktdropdown-content",
|
|
1384
1483
|
children: /* @__PURE__ */ jsx(DropdownContext.Provider, {
|
|
1385
1484
|
value: hasItems ? dropdownContextValue : null,
|
|
1386
|
-
children:
|
|
1485
|
+
children: body
|
|
1387
1486
|
})
|
|
1388
1487
|
})
|
|
1389
1488
|
}) : null;
|
|
1390
|
-
$[
|
|
1391
|
-
$[
|
|
1392
|
-
$[
|
|
1393
|
-
$[
|
|
1394
|
-
$[
|
|
1395
|
-
$[
|
|
1396
|
-
$[
|
|
1397
|
-
} else
|
|
1398
|
-
let
|
|
1399
|
-
if ($[
|
|
1400
|
-
|
|
1401
|
-
className:
|
|
1489
|
+
$[137] = body;
|
|
1490
|
+
$[138] = bodyId;
|
|
1491
|
+
$[139] = handleBodyRef;
|
|
1492
|
+
$[140] = hasItems;
|
|
1493
|
+
$[141] = isOpen;
|
|
1494
|
+
$[142] = popupRole;
|
|
1495
|
+
$[143] = t47;
|
|
1496
|
+
} else t47 = $[143];
|
|
1497
|
+
let t48;
|
|
1498
|
+
if ($[144] !== handleDropdownMouseEnter || $[145] !== handleDropdownMouseLeave || $[146] !== handleMouseDown || $[147] !== handleMouseMove || $[148] !== handleMouseOut || $[149] !== handleMouseOver || $[150] !== handleMouseUp || $[151] !== handleRef || $[152] !== onClick || $[153] !== styleFromProps || $[154] !== t46 || $[155] !== t47 || $[156] !== trigger) {
|
|
1499
|
+
t48 = /* @__PURE__ */ jsxs(Fragment, { children: [t45, /* @__PURE__ */ jsxs("div", {
|
|
1500
|
+
className: t46,
|
|
1402
1501
|
onClick,
|
|
1403
1502
|
onMouseDown: handleMouseDown,
|
|
1404
1503
|
onMouseEnter: handleDropdownMouseEnter,
|
|
@@ -1409,29 +1508,24 @@ function RootDropdown(t0) {
|
|
|
1409
1508
|
onMouseUp: handleMouseUp,
|
|
1410
1509
|
ref: handleRef,
|
|
1411
1510
|
style: styleFromProps,
|
|
1412
|
-
children: [trigger,
|
|
1511
|
+
children: [trigger, t47]
|
|
1413
1512
|
})] });
|
|
1414
|
-
$[
|
|
1415
|
-
$[
|
|
1416
|
-
$[
|
|
1417
|
-
$[
|
|
1418
|
-
$[
|
|
1419
|
-
$[
|
|
1420
|
-
$[
|
|
1421
|
-
$[
|
|
1422
|
-
$[
|
|
1423
|
-
$[
|
|
1424
|
-
$[
|
|
1425
|
-
$[
|
|
1426
|
-
$[
|
|
1427
|
-
$[
|
|
1428
|
-
} else
|
|
1429
|
-
return
|
|
1430
|
-
}
|
|
1431
|
-
function _temp(ref_0) {
|
|
1432
|
-
if (!ref_0) return;
|
|
1433
|
-
annotateParentItems(ref_0);
|
|
1434
|
-
ref_0.showPopover();
|
|
1513
|
+
$[144] = handleDropdownMouseEnter;
|
|
1514
|
+
$[145] = handleDropdownMouseLeave;
|
|
1515
|
+
$[146] = handleMouseDown;
|
|
1516
|
+
$[147] = handleMouseMove;
|
|
1517
|
+
$[148] = handleMouseOut;
|
|
1518
|
+
$[149] = handleMouseOver;
|
|
1519
|
+
$[150] = handleMouseUp;
|
|
1520
|
+
$[151] = handleRef;
|
|
1521
|
+
$[152] = onClick;
|
|
1522
|
+
$[153] = styleFromProps;
|
|
1523
|
+
$[154] = t46;
|
|
1524
|
+
$[155] = t47;
|
|
1525
|
+
$[156] = trigger;
|
|
1526
|
+
$[157] = t48;
|
|
1527
|
+
} else t48 = $[157];
|
|
1528
|
+
return t48;
|
|
1435
1529
|
}
|
|
1436
1530
|
var INERT_SUBMENU_PROPS = [
|
|
1437
1531
|
"allowCreate",
|
|
@@ -1505,8 +1599,12 @@ function SubmenuDropdown(props) {
|
|
|
1505
1599
|
}
|
|
1506
1600
|
let t3;
|
|
1507
1601
|
if ($[9] !== body) {
|
|
1508
|
-
t3 = isValidElement(body) ? cloneElement(body, {
|
|
1602
|
+
t3 = isValidElement(body) ? cloneElement(body, {
|
|
1509
1603
|
"data-ukt-submenu": "",
|
|
1604
|
+
popover: "manual"
|
|
1605
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
1606
|
+
"data-ukt-submenu": "",
|
|
1607
|
+
popover: "manual",
|
|
1510
1608
|
children: body
|
|
1511
1609
|
});
|
|
1512
1610
|
$[9] = body;
|