@eightshift/ui-components 5.0.0 → 5.0.2
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/Button-BpwTmkAe.js +185 -0
- package/dist/Collection-n5d0zIgb.js +2398 -0
- package/dist/Color-lVhk8V_G.js +2452 -0
- package/dist/ColorSwatch-DntWEAC3.js +64 -0
- package/dist/ComboBox-BJpTEATT.js +1915 -0
- package/dist/Dialog-O9uw63D7.js +2317 -0
- package/dist/FieldError-DHrSdE_Q.js +42 -0
- package/dist/FocusScope-BEPI2m7u.js +831 -0
- package/dist/Form-Cq3fu75_.js +5 -0
- package/dist/Group-DDPhPPTQ.js +48 -0
- package/dist/Heading-ba38ScjJ.js +16 -0
- package/dist/Hidden-rE6uR-lr.js +41 -0
- package/dist/Input-BmDS8Juy.js +133 -0
- package/dist/Label-JS_ob-kh.js +17 -0
- package/dist/List-CZMUbkFU.js +593 -0
- package/dist/ListBox-BTxlCGcc.js +664 -0
- package/dist/NumberFormatter-DA8u1Ot7.js +140 -0
- package/dist/OverlayArrow-5aDgmImj.js +637 -0
- package/dist/RSPContexts-2lR5GG9p.js +14 -0
- package/dist/Select-aab027f3.esm-BKIJGje-.js +2469 -0
- package/dist/Separator-CaTBkETC.js +332 -0
- package/dist/Slider-C-S1oEH9.js +853 -0
- package/dist/Text-BuJgePCv.js +16 -0
- package/dist/VisuallyHidden-BYi0pekx.js +48 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/assets/index.css +57 -0
- package/dist/assets/style-admin.css +5908 -0
- package/dist/assets/style-editor.css +5908 -0
- package/dist/assets/style.css +5914 -0
- package/dist/assets/wp-font-enhancements.css +8 -0
- package/dist/assets/wp-ui-enhancements.css +396 -0
- package/dist/components/animated-visibility/animated-visibility.js +105 -0
- package/dist/components/base-control/base-control.js +86 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +161 -0
- package/dist/components/button/button.js +387 -0
- package/dist/components/checkbox/checkbox.js +323 -0
- package/dist/components/color-pickers/color-picker.js +272 -0
- package/dist/components/color-pickers/color-swatch.js +59 -0
- package/dist/components/color-pickers/gradient-editor.js +534 -0
- package/dist/components/color-pickers/solid-color-picker.js +1567 -0
- package/dist/components/component-toggle/component-toggle.js +161 -0
- package/dist/components/container-panel/container-panel.js +131 -0
- package/dist/components/draggable/draggable-context.js +5 -0
- package/dist/components/draggable/draggable-handle.js +46 -0
- package/dist/components/draggable/draggable.js +7320 -0
- package/dist/components/draggable-list/draggable-list-context.js +5 -0
- package/dist/components/draggable-list/draggable-list-item.js +77 -0
- package/dist/components/draggable-list/draggable-list.js +151 -0
- package/dist/components/expandable/expandable.js +342 -0
- package/dist/components/index.js +137 -0
- package/dist/components/input-field/input-field.js +231 -0
- package/dist/components/item-collection/item-collection.js +59 -0
- package/dist/components/layout/hstack.js +30 -0
- package/dist/components/layout/vstack.js +30 -0
- package/dist/components/link-input/link-input.js +284 -0
- package/dist/components/matrix-align/matrix-align.js +134 -0
- package/dist/components/menu/menu.js +285 -0
- package/dist/components/modal/modal.js +305 -0
- package/dist/components/notice/notice.js +123 -0
- package/dist/components/number-picker/number-picker.js +292 -0
- package/dist/components/option-select/option-select.js +264 -0
- package/dist/components/options-panel/options-panel.js +158 -0
- package/dist/components/placeholders/file-placeholder.js +42 -0
- package/dist/components/placeholders/image-placeholder.js +88 -0
- package/dist/components/placeholders/media-placeholder.js +63 -0
- package/dist/components/popover/popover.js +207 -0
- package/dist/components/radio/radio.js +582 -0
- package/dist/components/repeater/repeater-context.js +5 -0
- package/dist/components/repeater/repeater-item.js +119 -0
- package/dist/components/repeater/repeater.js +280 -0
- package/dist/components/responsive/mini-responsive.js +498 -0
- package/dist/components/responsive/responsive-legacy.js +343 -0
- package/dist/components/responsive/responsive.js +583 -0
- package/dist/components/responsive-preview/responsive-preview.js +123 -0
- package/dist/components/rich-label/rich-label.js +66 -0
- package/dist/components/select/async-multi-select.js +157 -0
- package/dist/components/select/async-single-select.js +137 -0
- package/dist/components/select/custom-select-default-components.js +38 -0
- package/dist/components/select/multi-select-components.js +8 -0
- package/dist/components/select/multi-select.js +151 -0
- package/dist/components/select/react-select-component-wrappers.js +90 -0
- package/dist/components/select/shared.js +26 -0
- package/dist/components/select/single-select.js +131 -0
- package/dist/components/select/styles.js +49 -0
- package/dist/components/select/v2/async-select.js +297 -0
- package/dist/components/select/v2/shared.js +24 -0
- package/dist/components/select/v2/single-select.js +1004 -0
- package/dist/components/slider/column-config-slider.js +210 -0
- package/dist/components/slider/slider.js +345 -0
- package/dist/components/slider/utils.js +94 -0
- package/dist/components/spacer/spacer.js +97 -0
- package/dist/components/tabs/tabs.js +703 -0
- package/dist/components/toggle/switch.js +156 -0
- package/dist/components/toggle/toggle.js +64 -0
- package/dist/components/toggle-button/toggle-button.js +343 -0
- package/dist/components/tooltip/tooltip.js +527 -0
- package/dist/context-BbYZoHvX.js +92 -0
- package/dist/default-i18n-CT_oS1Fy.js +922 -0
- package/dist/filterDOMProps-EDDcM64A.js +28 -0
- package/dist/icons/block-icon.js +42 -0
- package/dist/icons/generic-color-swatch.js +113 -0
- package/dist/icons/icons.js +30495 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/jsx-svg.js +50 -0
- package/dist/index-641ee5b8.esm-BPU8rMZr.js +3137 -0
- package/dist/index-BljRBEr_.js +44 -0
- package/dist/index-CFozsmNS.js +28321 -0
- package/dist/index.js +139 -0
- package/dist/lite-DVmmD_-j.js +7 -0
- package/dist/modifiers.esm-BuJQPI1X.js +31 -0
- package/dist/multi-select-components-Sp-JEFEX.js +3744 -0
- package/dist/number-GajL10e1.js +36 -0
- package/dist/react-jsx-parser.min-DZCiis5V.js +11753 -0
- package/dist/react-select-async.esm-D937XTWW.js +107 -0
- package/dist/react-select.esm-Ciai3aKf.js +15 -0
- package/dist/style-admin.js +1 -0
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -0
- package/dist/textSelection-8DpK8fJl.js +46 -0
- package/dist/useButton-Bt3BffJm.js +50 -0
- package/dist/useEvent-ICdlokG-.js +23 -0
- package/dist/useFocusRing-Bv0UJQl8.js +107 -0
- package/dist/useFormReset-D2YaWRIA.js +22 -0
- package/dist/useFormValidation-Dy0PXJg5.js +224 -0
- package/dist/useHover-C2SkI1Fn.js +895 -0
- package/dist/useLabel-BPCd5c7-.js +27 -0
- package/dist/useLabels-B7-lUnAF.js +23 -0
- package/dist/useListState-DkyH7elT.js +168 -0
- package/dist/useLocalizedStringFormatter-C9GO0IDB.js +121 -0
- package/dist/useNumberField-CU1_u8ze.js +1215 -0
- package/dist/useNumberFormatter-CZ9QUnRt.js +13 -0
- package/dist/usePress-BrJylgPR.js +688 -0
- package/dist/useSingleSelectListState-C4sorv2p.js +38 -0
- package/dist/useToggle-CDa3YAZI.js +59 -0
- package/dist/useToggleState-ibcBUHnB.js +19 -0
- package/dist/utilities/array-helpers.js +56 -0
- package/dist/utilities/debounce-throttle.js +123 -0
- package/dist/utilities/es-dash.js +382 -0
- package/dist/utilities/index.js +27 -0
- package/dist/utilities/text-helpers.js +136 -0
- package/dist/utils-CZt7LCbO.js +403 -0
- package/dist/wp/wp-font-enhancements.js +1 -0
- package/dist/wp/wp-ui-enhancements.js +1 -0
- package/package.json +24 -24
|
@@ -0,0 +1,2398 @@
|
|
|
1
|
+
import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-rE6uR-lr.js";
|
|
2
|
+
import { r as reactDomExports } from "./index-CFozsmNS.js";
|
|
3
|
+
import { B as $c87311424ea30a05$export$9ac100e40613ea10, g as $03deb23ff14920c4$export$4eaf04e54aa8eed6, d as $431fbd86ca7dc216$export$b204af158042fbac, z as $7215afc6de606d6b$export$de79e2c695e052f3, J as $f645667febf57a63$export$f9762fab77588ecb, i as $d4ee10de306f2510$export$cd4e5573fbe2b576, K as $c87311424ea30a05$export$e1865c3bedcd822b, u as $3ad3f6e1647bc98d$export$80f3e147d781571c, x as $507fabe10e71c6fb$export$630ff653c5ada6a9, b as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-C2SkI1Fn.js";
|
|
4
|
+
import React__default, { useRef, useState, useMemo, cloneElement, forwardRef, useContext, createContext, useCallback, useEffect, isValidElement } from "react";
|
|
5
|
+
import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $3ef42575df84b30b$export$9d1611c77c2fe928, n as $b5e257d569688ac6$export$535bd6ca7f90a273, e as $bdb11010cef70236$export$f680877a34711e37, f as $8ae05eaa5c114e9c$export$7f54fc3180508a52 } from "./utils-CZt7LCbO.js";
|
|
6
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-BrJylgPR.js";
|
|
7
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-ICdlokG-.js";
|
|
8
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-BEPI2m7u.js";
|
|
9
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BbYZoHvX.js";
|
|
10
|
+
function $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
|
|
11
|
+
const isInitialMount = useRef(true);
|
|
12
|
+
const lastDeps = useRef(null);
|
|
13
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
14
|
+
isInitialMount.current = true;
|
|
15
|
+
return () => {
|
|
16
|
+
isInitialMount.current = false;
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
20
|
+
if (isInitialMount.current) isInitialMount.current = false;
|
|
21
|
+
else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
|
|
22
|
+
lastDeps.current = dependencies;
|
|
23
|
+
}, dependencies);
|
|
24
|
+
}
|
|
25
|
+
function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
26
|
+
if (!node) return false;
|
|
27
|
+
let style = window.getComputedStyle(node);
|
|
28
|
+
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
29
|
+
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
30
|
+
return isScrollable;
|
|
31
|
+
}
|
|
32
|
+
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
33
|
+
const scrollParents = [];
|
|
34
|
+
while (node && node !== document.documentElement) {
|
|
35
|
+
if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow)) scrollParents.push(node);
|
|
36
|
+
node = node.parentElement;
|
|
37
|
+
}
|
|
38
|
+
return scrollParents;
|
|
39
|
+
}
|
|
40
|
+
let $ef06256079686ba0$var$descriptionId = 0;
|
|
41
|
+
const $ef06256079686ba0$var$descriptionNodes = /* @__PURE__ */ new Map();
|
|
42
|
+
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
|
|
43
|
+
let [id, setId] = useState();
|
|
44
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
45
|
+
if (!description) return;
|
|
46
|
+
let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
|
|
47
|
+
if (!desc) {
|
|
48
|
+
let id2 = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
|
|
49
|
+
setId(id2);
|
|
50
|
+
let node = document.createElement("div");
|
|
51
|
+
node.id = id2;
|
|
52
|
+
node.style.display = "none";
|
|
53
|
+
node.textContent = description;
|
|
54
|
+
document.body.appendChild(node);
|
|
55
|
+
desc = {
|
|
56
|
+
refCount: 0,
|
|
57
|
+
element: node
|
|
58
|
+
};
|
|
59
|
+
$ef06256079686ba0$var$descriptionNodes.set(description, desc);
|
|
60
|
+
} else setId(desc.element.id);
|
|
61
|
+
desc.refCount++;
|
|
62
|
+
return () => {
|
|
63
|
+
if (desc && --desc.refCount === 0) {
|
|
64
|
+
desc.element.remove();
|
|
65
|
+
$ef06256079686ba0$var$descriptionNodes.delete(description);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, [
|
|
69
|
+
description
|
|
70
|
+
]);
|
|
71
|
+
return {
|
|
72
|
+
"aria-describedby": description ? id : void 0
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
76
|
+
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "left");
|
|
77
|
+
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "top");
|
|
78
|
+
let width = element.offsetWidth;
|
|
79
|
+
let height = element.offsetHeight;
|
|
80
|
+
let x = scrollView.scrollLeft;
|
|
81
|
+
let y = scrollView.scrollTop;
|
|
82
|
+
let { borderTopWidth, borderLeftWidth, scrollPaddingTop, scrollPaddingRight, scrollPaddingBottom, scrollPaddingLeft } = getComputedStyle(scrollView);
|
|
83
|
+
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
|
|
84
|
+
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
|
|
85
|
+
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
86
|
+
let maxY = borderAdjustedY + scrollView.clientHeight;
|
|
87
|
+
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
|
|
88
|
+
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
|
|
89
|
+
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
|
|
90
|
+
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
|
|
91
|
+
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
92
|
+
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
|
|
93
|
+
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
94
|
+
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
|
|
95
|
+
scrollView.scrollLeft = x;
|
|
96
|
+
scrollView.scrollTop = y;
|
|
97
|
+
}
|
|
98
|
+
function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
|
|
99
|
+
const prop = axis === "left" ? "offsetLeft" : "offsetTop";
|
|
100
|
+
let sum = 0;
|
|
101
|
+
while (child.offsetParent) {
|
|
102
|
+
sum += child[prop];
|
|
103
|
+
if (child.offsetParent === ancestor) break;
|
|
104
|
+
else if (child.offsetParent.contains(ancestor)) {
|
|
105
|
+
sum -= ancestor[prop];
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
child = child.offsetParent;
|
|
109
|
+
}
|
|
110
|
+
return sum;
|
|
111
|
+
}
|
|
112
|
+
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
113
|
+
if (targetElement && document.contains(targetElement)) {
|
|
114
|
+
let root = document.scrollingElement || document.documentElement;
|
|
115
|
+
let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
|
|
116
|
+
if (!isScrollPrevented) {
|
|
117
|
+
var _targetElement_scrollIntoView;
|
|
118
|
+
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
119
|
+
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
|
|
120
|
+
block: "nearest"
|
|
121
|
+
});
|
|
122
|
+
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
123
|
+
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
124
|
+
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
125
|
+
opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
|
|
126
|
+
block: "center",
|
|
127
|
+
inline: "center"
|
|
128
|
+
});
|
|
129
|
+
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
|
|
130
|
+
block: "nearest"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement);
|
|
135
|
+
for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const $5671b20cf9b562b2$export$447a38995de2c711 = "react-aria-clear-focus";
|
|
140
|
+
const $5671b20cf9b562b2$export$831c820ad60f9d12 = "react-aria-focus";
|
|
141
|
+
function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
142
|
+
if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
|
|
143
|
+
return e.ctrlKey;
|
|
144
|
+
}
|
|
145
|
+
class $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
|
|
146
|
+
get childNodes() {
|
|
147
|
+
throw new Error("childNodes is not supported");
|
|
148
|
+
}
|
|
149
|
+
clone() {
|
|
150
|
+
let node = new $23b9f4fcf0fe224b$export$d68d59712b04d9d1(this.type, this.key);
|
|
151
|
+
node.value = this.value;
|
|
152
|
+
node.level = this.level;
|
|
153
|
+
node.hasChildNodes = this.hasChildNodes;
|
|
154
|
+
node.rendered = this.rendered;
|
|
155
|
+
node.textValue = this.textValue;
|
|
156
|
+
node["aria-label"] = this["aria-label"];
|
|
157
|
+
node.index = this.index;
|
|
158
|
+
node.parentKey = this.parentKey;
|
|
159
|
+
node.prevKey = this.prevKey;
|
|
160
|
+
node.nextKey = this.nextKey;
|
|
161
|
+
node.firstChildKey = this.firstChildKey;
|
|
162
|
+
node.lastChildKey = this.lastChildKey;
|
|
163
|
+
node.props = this.props;
|
|
164
|
+
node.render = this.render;
|
|
165
|
+
node.colSpan = this.colSpan;
|
|
166
|
+
node.colIndex = this.colIndex;
|
|
167
|
+
return node;
|
|
168
|
+
}
|
|
169
|
+
constructor(type, key) {
|
|
170
|
+
this.value = null;
|
|
171
|
+
this.level = 0;
|
|
172
|
+
this.hasChildNodes = false;
|
|
173
|
+
this.rendered = null;
|
|
174
|
+
this.textValue = "";
|
|
175
|
+
this["aria-label"] = void 0;
|
|
176
|
+
this.index = 0;
|
|
177
|
+
this.parentKey = null;
|
|
178
|
+
this.prevKey = null;
|
|
179
|
+
this.nextKey = null;
|
|
180
|
+
this.firstChildKey = null;
|
|
181
|
+
this.lastChildKey = null;
|
|
182
|
+
this.props = {};
|
|
183
|
+
this.colSpan = null;
|
|
184
|
+
this.colIndex = null;
|
|
185
|
+
this.type = type;
|
|
186
|
+
this.key = key;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
|
|
190
|
+
get size() {
|
|
191
|
+
return this.keyMap.size;
|
|
192
|
+
}
|
|
193
|
+
getKeys() {
|
|
194
|
+
return this.keyMap.keys();
|
|
195
|
+
}
|
|
196
|
+
*[Symbol.iterator]() {
|
|
197
|
+
let node = this.firstKey != null ? this.keyMap.get(this.firstKey) : void 0;
|
|
198
|
+
while (node) {
|
|
199
|
+
yield node;
|
|
200
|
+
node = node.nextKey != null ? this.keyMap.get(node.nextKey) : void 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
getChildren(key) {
|
|
204
|
+
let keyMap = this.keyMap;
|
|
205
|
+
return {
|
|
206
|
+
*[Symbol.iterator]() {
|
|
207
|
+
let parent = keyMap.get(key);
|
|
208
|
+
let node = (parent === null || parent === void 0 ? void 0 : parent.firstChildKey) != null ? keyMap.get(parent.firstChildKey) : null;
|
|
209
|
+
while (node) {
|
|
210
|
+
yield node;
|
|
211
|
+
node = node.nextKey != null ? keyMap.get(node.nextKey) : void 0;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
getKeyBefore(key) {
|
|
217
|
+
let node = this.keyMap.get(key);
|
|
218
|
+
if (!node) return null;
|
|
219
|
+
if (node.prevKey != null) {
|
|
220
|
+
node = this.keyMap.get(node.prevKey);
|
|
221
|
+
while (node && node.type !== "item" && node.lastChildKey != null) node = this.keyMap.get(node.lastChildKey);
|
|
222
|
+
var _node_key;
|
|
223
|
+
return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
|
|
224
|
+
}
|
|
225
|
+
return node.parentKey;
|
|
226
|
+
}
|
|
227
|
+
getKeyAfter(key) {
|
|
228
|
+
let node = this.keyMap.get(key);
|
|
229
|
+
if (!node) return null;
|
|
230
|
+
if (node.type !== "item" && node.firstChildKey != null) return node.firstChildKey;
|
|
231
|
+
while (node) {
|
|
232
|
+
if (node.nextKey != null) return node.nextKey;
|
|
233
|
+
if (node.parentKey != null) node = this.keyMap.get(node.parentKey);
|
|
234
|
+
else return null;
|
|
235
|
+
}
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
getFirstKey() {
|
|
239
|
+
return this.firstKey;
|
|
240
|
+
}
|
|
241
|
+
getLastKey() {
|
|
242
|
+
let node = this.lastKey != null ? this.keyMap.get(this.lastKey) : null;
|
|
243
|
+
while ((node === null || node === void 0 ? void 0 : node.lastChildKey) != null) node = this.keyMap.get(node.lastChildKey);
|
|
244
|
+
var _node_key;
|
|
245
|
+
return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
|
|
246
|
+
}
|
|
247
|
+
getItem(key) {
|
|
248
|
+
var _this_keyMap_get;
|
|
249
|
+
return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
|
|
250
|
+
}
|
|
251
|
+
at() {
|
|
252
|
+
throw new Error("Not implemented");
|
|
253
|
+
}
|
|
254
|
+
clone() {
|
|
255
|
+
let Constructor = this.constructor;
|
|
256
|
+
let collection = new Constructor();
|
|
257
|
+
collection.keyMap = new Map(this.keyMap);
|
|
258
|
+
collection.firstKey = this.firstKey;
|
|
259
|
+
collection.lastKey = this.lastKey;
|
|
260
|
+
return collection;
|
|
261
|
+
}
|
|
262
|
+
addNode(node) {
|
|
263
|
+
if (this.frozen) throw new Error("Cannot add a node to a frozen collection");
|
|
264
|
+
this.keyMap.set(node.key, node);
|
|
265
|
+
}
|
|
266
|
+
removeNode(key) {
|
|
267
|
+
if (this.frozen) throw new Error("Cannot remove a node to a frozen collection");
|
|
268
|
+
this.keyMap.delete(key);
|
|
269
|
+
}
|
|
270
|
+
commit(firstKey, lastKey, isSSR = false) {
|
|
271
|
+
if (this.frozen) throw new Error("Cannot commit a frozen collection");
|
|
272
|
+
this.firstKey = firstKey;
|
|
273
|
+
this.lastKey = lastKey;
|
|
274
|
+
this.frozen = !isSSR;
|
|
275
|
+
}
|
|
276
|
+
// TODO: this is pretty specific to menu, will need to check if it is generic enough
|
|
277
|
+
// Will need to handle varying levels I assume but will revisit after I get searchable menu working for base menu
|
|
278
|
+
// TODO: an alternative is to simply walk the collection and add all item nodes that match the filter and any sections/separators we encounter
|
|
279
|
+
// to an array, then walk that new array and fix all the next/Prev keys while adding them to the new collection
|
|
280
|
+
UNSTABLE_filter(filterFn) {
|
|
281
|
+
let newCollection = new $23b9f4fcf0fe224b$export$408d25a4e12db025();
|
|
282
|
+
let lastNode = null;
|
|
283
|
+
for (let node of this) {
|
|
284
|
+
if (node.type === "section" && node.hasChildNodes) {
|
|
285
|
+
let clonedSection = node.clone();
|
|
286
|
+
let lastChildInSection = null;
|
|
287
|
+
for (let child of this.getChildren(node.key)) if ($23b9f4fcf0fe224b$var$shouldKeepNode(child, filterFn, this, newCollection)) {
|
|
288
|
+
let clonedChild = child.clone();
|
|
289
|
+
if (lastChildInSection == null) clonedSection.firstChildKey = clonedChild.key;
|
|
290
|
+
if (newCollection.firstKey == null) newCollection.firstKey = clonedSection.key;
|
|
291
|
+
if (lastChildInSection && lastChildInSection.parentKey === clonedChild.parentKey) {
|
|
292
|
+
lastChildInSection.nextKey = clonedChild.key;
|
|
293
|
+
clonedChild.prevKey = lastChildInSection.key;
|
|
294
|
+
} else clonedChild.prevKey = null;
|
|
295
|
+
clonedChild.nextKey = null;
|
|
296
|
+
newCollection.addNode(clonedChild);
|
|
297
|
+
lastChildInSection = clonedChild;
|
|
298
|
+
}
|
|
299
|
+
if (lastChildInSection) {
|
|
300
|
+
if (lastChildInSection.type !== "header") {
|
|
301
|
+
clonedSection.lastChildKey = lastChildInSection.key;
|
|
302
|
+
if (lastNode == null) clonedSection.prevKey = null;
|
|
303
|
+
else if (lastNode.type === "section" || lastNode.type === "separator") {
|
|
304
|
+
lastNode.nextKey = clonedSection.key;
|
|
305
|
+
clonedSection.prevKey = lastNode.key;
|
|
306
|
+
}
|
|
307
|
+
clonedSection.nextKey = null;
|
|
308
|
+
lastNode = clonedSection;
|
|
309
|
+
newCollection.addNode(clonedSection);
|
|
310
|
+
} else {
|
|
311
|
+
if (newCollection.firstKey === clonedSection.key) newCollection.firstKey = null;
|
|
312
|
+
newCollection.removeNode(lastChildInSection.key);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
} else if (node.type === "separator") {
|
|
316
|
+
let clonedSeparator = node.clone();
|
|
317
|
+
clonedSeparator.nextKey = null;
|
|
318
|
+
if ((lastNode === null || lastNode === void 0 ? void 0 : lastNode.type) === "section") {
|
|
319
|
+
lastNode.nextKey = clonedSeparator.key;
|
|
320
|
+
clonedSeparator.prevKey = lastNode.key;
|
|
321
|
+
lastNode = clonedSeparator;
|
|
322
|
+
newCollection.addNode(clonedSeparator);
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
let clonedNode = node.clone();
|
|
326
|
+
if ($23b9f4fcf0fe224b$var$shouldKeepNode(clonedNode, filterFn, this, newCollection)) {
|
|
327
|
+
if (newCollection.firstKey == null) newCollection.firstKey = clonedNode.key;
|
|
328
|
+
if (lastNode != null && lastNode.type !== "section" && lastNode.type !== "separator" && lastNode.parentKey === clonedNode.parentKey) {
|
|
329
|
+
lastNode.nextKey = clonedNode.key;
|
|
330
|
+
clonedNode.prevKey = lastNode.key;
|
|
331
|
+
} else clonedNode.prevKey = null;
|
|
332
|
+
clonedNode.nextKey = null;
|
|
333
|
+
newCollection.addNode(clonedNode);
|
|
334
|
+
lastNode = clonedNode;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if ((lastNode === null || lastNode === void 0 ? void 0 : lastNode.type) === "separator" && lastNode.nextKey === null) {
|
|
339
|
+
let lastSection;
|
|
340
|
+
if (lastNode.prevKey != null) {
|
|
341
|
+
lastSection = newCollection.getItem(lastNode.prevKey);
|
|
342
|
+
lastSection.nextKey = null;
|
|
343
|
+
}
|
|
344
|
+
newCollection.removeNode(lastNode.key);
|
|
345
|
+
lastNode = lastSection;
|
|
346
|
+
}
|
|
347
|
+
newCollection.lastKey = (lastNode === null || lastNode === void 0 ? void 0 : lastNode.key) || null;
|
|
348
|
+
return newCollection;
|
|
349
|
+
}
|
|
350
|
+
constructor() {
|
|
351
|
+
this.keyMap = /* @__PURE__ */ new Map();
|
|
352
|
+
this.firstKey = null;
|
|
353
|
+
this.lastKey = null;
|
|
354
|
+
this.frozen = false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function $23b9f4fcf0fe224b$var$shouldKeepNode(node, filterFn, oldCollection, newCollection) {
|
|
358
|
+
if (node.type === "subdialogtrigger" || node.type === "submenutrigger") {
|
|
359
|
+
let triggerChild = [
|
|
360
|
+
...oldCollection.getChildren(node.key)
|
|
361
|
+
][0];
|
|
362
|
+
if (triggerChild && filterFn(triggerChild.textValue)) {
|
|
363
|
+
let clonedChild = triggerChild.clone();
|
|
364
|
+
newCollection.addNode(clonedChild);
|
|
365
|
+
return true;
|
|
366
|
+
} else return false;
|
|
367
|
+
} else if (node.type === "header") return true;
|
|
368
|
+
else return filterFn(node.textValue);
|
|
369
|
+
}
|
|
370
|
+
class $681cc3c98f569e39$export$410b0c854570d131 {
|
|
371
|
+
*[Symbol.iterator]() {
|
|
372
|
+
let node = this.firstChild;
|
|
373
|
+
while (node) {
|
|
374
|
+
yield node;
|
|
375
|
+
node = node.nextSibling;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
get firstChild() {
|
|
379
|
+
return this._firstChild;
|
|
380
|
+
}
|
|
381
|
+
set firstChild(firstChild) {
|
|
382
|
+
this._firstChild = firstChild;
|
|
383
|
+
this.ownerDocument.markDirty(this);
|
|
384
|
+
}
|
|
385
|
+
get lastChild() {
|
|
386
|
+
return this._lastChild;
|
|
387
|
+
}
|
|
388
|
+
set lastChild(lastChild) {
|
|
389
|
+
this._lastChild = lastChild;
|
|
390
|
+
this.ownerDocument.markDirty(this);
|
|
391
|
+
}
|
|
392
|
+
get previousSibling() {
|
|
393
|
+
return this._previousSibling;
|
|
394
|
+
}
|
|
395
|
+
set previousSibling(previousSibling) {
|
|
396
|
+
this._previousSibling = previousSibling;
|
|
397
|
+
this.ownerDocument.markDirty(this);
|
|
398
|
+
}
|
|
399
|
+
get nextSibling() {
|
|
400
|
+
return this._nextSibling;
|
|
401
|
+
}
|
|
402
|
+
set nextSibling(nextSibling) {
|
|
403
|
+
this._nextSibling = nextSibling;
|
|
404
|
+
this.ownerDocument.markDirty(this);
|
|
405
|
+
}
|
|
406
|
+
get parentNode() {
|
|
407
|
+
return this._parentNode;
|
|
408
|
+
}
|
|
409
|
+
set parentNode(parentNode) {
|
|
410
|
+
this._parentNode = parentNode;
|
|
411
|
+
this.ownerDocument.markDirty(this);
|
|
412
|
+
}
|
|
413
|
+
get isConnected() {
|
|
414
|
+
var _this_parentNode;
|
|
415
|
+
return ((_this_parentNode = this.parentNode) === null || _this_parentNode === void 0 ? void 0 : _this_parentNode.isConnected) || false;
|
|
416
|
+
}
|
|
417
|
+
invalidateChildIndices(child) {
|
|
418
|
+
if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
|
|
419
|
+
this._minInvalidChildIndex = child;
|
|
420
|
+
this.ownerDocument.markDirty(this);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
updateChildIndices() {
|
|
424
|
+
let node = this._minInvalidChildIndex;
|
|
425
|
+
while (node) {
|
|
426
|
+
node.index = node.previousSibling ? node.previousSibling.index + 1 : 0;
|
|
427
|
+
node = node.nextSibling;
|
|
428
|
+
}
|
|
429
|
+
this._minInvalidChildIndex = null;
|
|
430
|
+
}
|
|
431
|
+
appendChild(child) {
|
|
432
|
+
if (child.parentNode) child.parentNode.removeChild(child);
|
|
433
|
+
if (this.firstChild == null) this.firstChild = child;
|
|
434
|
+
if (this.lastChild) {
|
|
435
|
+
this.lastChild.nextSibling = child;
|
|
436
|
+
child.index = this.lastChild.index + 1;
|
|
437
|
+
child.previousSibling = this.lastChild;
|
|
438
|
+
} else {
|
|
439
|
+
child.previousSibling = null;
|
|
440
|
+
child.index = 0;
|
|
441
|
+
}
|
|
442
|
+
child.parentNode = this;
|
|
443
|
+
child.nextSibling = null;
|
|
444
|
+
this.lastChild = child;
|
|
445
|
+
this.ownerDocument.markDirty(this);
|
|
446
|
+
if (this.isConnected) this.ownerDocument.queueUpdate();
|
|
447
|
+
}
|
|
448
|
+
insertBefore(newNode, referenceNode) {
|
|
449
|
+
if (referenceNode == null) return this.appendChild(newNode);
|
|
450
|
+
if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
|
|
451
|
+
newNode.nextSibling = referenceNode;
|
|
452
|
+
newNode.previousSibling = referenceNode.previousSibling;
|
|
453
|
+
newNode.index = referenceNode.index - 1;
|
|
454
|
+
if (this.firstChild === referenceNode) this.firstChild = newNode;
|
|
455
|
+
else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
|
|
456
|
+
referenceNode.previousSibling = newNode;
|
|
457
|
+
newNode.parentNode = referenceNode.parentNode;
|
|
458
|
+
this.invalidateChildIndices(newNode);
|
|
459
|
+
if (this.isConnected) this.ownerDocument.queueUpdate();
|
|
460
|
+
}
|
|
461
|
+
removeChild(child) {
|
|
462
|
+
if (child.parentNode !== this || !this.ownerDocument.isMounted) return;
|
|
463
|
+
if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
|
|
464
|
+
if (child.nextSibling) {
|
|
465
|
+
this.invalidateChildIndices(child.nextSibling);
|
|
466
|
+
child.nextSibling.previousSibling = child.previousSibling;
|
|
467
|
+
}
|
|
468
|
+
if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
|
|
469
|
+
if (this.firstChild === child) this.firstChild = child.nextSibling;
|
|
470
|
+
if (this.lastChild === child) this.lastChild = child.previousSibling;
|
|
471
|
+
child.parentNode = null;
|
|
472
|
+
child.nextSibling = null;
|
|
473
|
+
child.previousSibling = null;
|
|
474
|
+
child.index = 0;
|
|
475
|
+
this.ownerDocument.markDirty(child);
|
|
476
|
+
if (this.isConnected) this.ownerDocument.queueUpdate();
|
|
477
|
+
}
|
|
478
|
+
addEventListener() {
|
|
479
|
+
}
|
|
480
|
+
removeEventListener() {
|
|
481
|
+
}
|
|
482
|
+
get previousVisibleSibling() {
|
|
483
|
+
let node = this.previousSibling;
|
|
484
|
+
while (node && node.isHidden) node = node.previousSibling;
|
|
485
|
+
return node;
|
|
486
|
+
}
|
|
487
|
+
get nextVisibleSibling() {
|
|
488
|
+
let node = this.nextSibling;
|
|
489
|
+
while (node && node.isHidden) node = node.nextSibling;
|
|
490
|
+
return node;
|
|
491
|
+
}
|
|
492
|
+
get firstVisibleChild() {
|
|
493
|
+
let node = this.firstChild;
|
|
494
|
+
while (node && node.isHidden) node = node.nextSibling;
|
|
495
|
+
return node;
|
|
496
|
+
}
|
|
497
|
+
get lastVisibleChild() {
|
|
498
|
+
let node = this.lastChild;
|
|
499
|
+
while (node && node.isHidden) node = node.previousSibling;
|
|
500
|
+
return node;
|
|
501
|
+
}
|
|
502
|
+
constructor(ownerDocument) {
|
|
503
|
+
this._firstChild = null;
|
|
504
|
+
this._lastChild = null;
|
|
505
|
+
this._previousSibling = null;
|
|
506
|
+
this._nextSibling = null;
|
|
507
|
+
this._parentNode = null;
|
|
508
|
+
this._minInvalidChildIndex = null;
|
|
509
|
+
this.ownerDocument = ownerDocument;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export$410b0c854570d131 {
|
|
513
|
+
get index() {
|
|
514
|
+
return this._index;
|
|
515
|
+
}
|
|
516
|
+
set index(index) {
|
|
517
|
+
this._index = index;
|
|
518
|
+
this.ownerDocument.markDirty(this);
|
|
519
|
+
}
|
|
520
|
+
get level() {
|
|
521
|
+
if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (this.node.type === "item" ? 1 : 0);
|
|
522
|
+
return 0;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Lazily gets a mutable instance of a Node. If the node has already
|
|
526
|
+
* been cloned during this update cycle, it just returns the existing one.
|
|
527
|
+
*/
|
|
528
|
+
getMutableNode() {
|
|
529
|
+
if (!this.isMutated) {
|
|
530
|
+
this.node = this.node.clone();
|
|
531
|
+
this.isMutated = true;
|
|
532
|
+
}
|
|
533
|
+
this.ownerDocument.markDirty(this);
|
|
534
|
+
return this.node;
|
|
535
|
+
}
|
|
536
|
+
updateNode() {
|
|
537
|
+
var _this_previousVisibleSibling, _this_firstVisibleChild, _this_lastVisibleChild;
|
|
538
|
+
let nextSibling = this.nextVisibleSibling;
|
|
539
|
+
let node = this.getMutableNode();
|
|
540
|
+
node.index = this.index;
|
|
541
|
+
node.level = this.level;
|
|
542
|
+
node.parentKey = this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd ? this.parentNode.node.key : null;
|
|
543
|
+
var _this_previousVisibleSibling_node_key;
|
|
544
|
+
node.prevKey = (_this_previousVisibleSibling_node_key = (_this_previousVisibleSibling = this.previousVisibleSibling) === null || _this_previousVisibleSibling === void 0 ? void 0 : _this_previousVisibleSibling.node.key) !== null && _this_previousVisibleSibling_node_key !== void 0 ? _this_previousVisibleSibling_node_key : null;
|
|
545
|
+
var _nextSibling_node_key;
|
|
546
|
+
node.nextKey = (_nextSibling_node_key = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.node.key) !== null && _nextSibling_node_key !== void 0 ? _nextSibling_node_key : null;
|
|
547
|
+
node.hasChildNodes = !!this.firstChild;
|
|
548
|
+
var _this_firstVisibleChild_node_key;
|
|
549
|
+
node.firstChildKey = (_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild === void 0 ? void 0 : _this_firstVisibleChild.node.key) !== null && _this_firstVisibleChild_node_key !== void 0 ? _this_firstVisibleChild_node_key : null;
|
|
550
|
+
var _this_lastVisibleChild_node_key;
|
|
551
|
+
node.lastChildKey = (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild === void 0 ? void 0 : _this_lastVisibleChild.node.key) !== null && _this_lastVisibleChild_node_key !== void 0 ? _this_lastVisibleChild_node_key : null;
|
|
552
|
+
if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
|
|
553
|
+
var _node_colIndex, _node_colSpan;
|
|
554
|
+
let nextColIndex = ((_node_colIndex = node.colIndex) !== null && _node_colIndex !== void 0 ? _node_colIndex : node.index) + ((_node_colSpan = node.colSpan) !== null && _node_colSpan !== void 0 ? _node_colSpan : 1);
|
|
555
|
+
if (nextColIndex !== nextSibling.node.colIndex) {
|
|
556
|
+
let siblingNode = nextSibling.getMutableNode();
|
|
557
|
+
siblingNode.colIndex = nextColIndex;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
setProps(obj, ref, rendered, render) {
|
|
562
|
+
let node = this.getMutableNode();
|
|
563
|
+
let { value: value1, textValue, id, ...props } = obj;
|
|
564
|
+
props.ref = ref;
|
|
565
|
+
node.props = props;
|
|
566
|
+
node.rendered = rendered;
|
|
567
|
+
node.render = render;
|
|
568
|
+
node.value = value1;
|
|
569
|
+
node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
|
|
570
|
+
if (id != null && id !== node.key) {
|
|
571
|
+
if (this.hasSetProps) throw new Error("Cannot change the id of an item");
|
|
572
|
+
node.key = id;
|
|
573
|
+
}
|
|
574
|
+
if (props.colSpan != null) node.colSpan = props.colSpan;
|
|
575
|
+
this.hasSetProps = true;
|
|
576
|
+
if (this.isConnected) this.ownerDocument.queueUpdate();
|
|
577
|
+
}
|
|
578
|
+
get style() {
|
|
579
|
+
let element = this;
|
|
580
|
+
return {
|
|
581
|
+
get display() {
|
|
582
|
+
return element.isHidden ? "none" : "";
|
|
583
|
+
},
|
|
584
|
+
set display(value) {
|
|
585
|
+
let isHidden = value === "none";
|
|
586
|
+
if (element.isHidden !== isHidden) {
|
|
587
|
+
var _element_parentNode, _element_parentNode1;
|
|
588
|
+
if (((_element_parentNode = element.parentNode) === null || _element_parentNode === void 0 ? void 0 : _element_parentNode.firstVisibleChild) === element || ((_element_parentNode1 = element.parentNode) === null || _element_parentNode1 === void 0 ? void 0 : _element_parentNode1.lastVisibleChild) === element) element.ownerDocument.markDirty(element.parentNode);
|
|
589
|
+
let prev = element.previousVisibleSibling;
|
|
590
|
+
let next = element.nextVisibleSibling;
|
|
591
|
+
if (prev) element.ownerDocument.markDirty(prev);
|
|
592
|
+
if (next) element.ownerDocument.markDirty(next);
|
|
593
|
+
element.isHidden = isHidden;
|
|
594
|
+
element.ownerDocument.markDirty(element);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
hasAttribute() {
|
|
600
|
+
}
|
|
601
|
+
setAttribute() {
|
|
602
|
+
}
|
|
603
|
+
setAttributeNS() {
|
|
604
|
+
}
|
|
605
|
+
removeAttribute() {
|
|
606
|
+
}
|
|
607
|
+
constructor(type, ownerDocument) {
|
|
608
|
+
super(ownerDocument), this.nodeType = 8, this.isMutated = true, this._index = 0, this.hasSetProps = false, this.isHidden = false;
|
|
609
|
+
this.node = new $23b9f4fcf0fe224b$export$d68d59712b04d9d1(type, `react-aria-${++ownerDocument.nodeId}`);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export$410b0c854570d131 {
|
|
613
|
+
get isConnected() {
|
|
614
|
+
return this.isMounted;
|
|
615
|
+
}
|
|
616
|
+
createElement(type) {
|
|
617
|
+
return new $681cc3c98f569e39$export$dc064fe9e59310fd(type, this);
|
|
618
|
+
}
|
|
619
|
+
getMutableCollection() {
|
|
620
|
+
if (!this.nextCollection) this.nextCollection = this.collection.clone();
|
|
621
|
+
return this.nextCollection;
|
|
622
|
+
}
|
|
623
|
+
markDirty(node) {
|
|
624
|
+
this.dirtyNodes.add(node);
|
|
625
|
+
}
|
|
626
|
+
addNode(element) {
|
|
627
|
+
if (element.isHidden) return;
|
|
628
|
+
let collection = this.getMutableCollection();
|
|
629
|
+
if (!collection.getItem(element.node.key)) for (let child of element) this.addNode(child);
|
|
630
|
+
collection.addNode(element.node);
|
|
631
|
+
}
|
|
632
|
+
removeNode(node) {
|
|
633
|
+
for (let child of node) this.removeNode(child);
|
|
634
|
+
let collection = this.getMutableCollection();
|
|
635
|
+
collection.removeNode(node.node.key);
|
|
636
|
+
}
|
|
637
|
+
/** Finalizes the collection update, updating all nodes and freezing the collection. */
|
|
638
|
+
getCollection() {
|
|
639
|
+
if (this.inSubscription) return this.collection.clone();
|
|
640
|
+
this.queuedRender = false;
|
|
641
|
+
this.updateCollection();
|
|
642
|
+
return this.collection;
|
|
643
|
+
}
|
|
644
|
+
updateCollection() {
|
|
645
|
+
for (let element of this.dirtyNodes) if (element instanceof $681cc3c98f569e39$export$dc064fe9e59310fd && (!element.isConnected || element.isHidden)) this.removeNode(element);
|
|
646
|
+
else element.updateChildIndices();
|
|
647
|
+
for (let element of this.dirtyNodes) if (element instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) {
|
|
648
|
+
if (element.isConnected && !element.isHidden) {
|
|
649
|
+
element.updateNode();
|
|
650
|
+
this.addNode(element);
|
|
651
|
+
}
|
|
652
|
+
element.isMutated = false;
|
|
653
|
+
}
|
|
654
|
+
this.dirtyNodes.clear();
|
|
655
|
+
if (this.nextCollection) {
|
|
656
|
+
var _this_firstVisibleChild, _this_lastVisibleChild;
|
|
657
|
+
var _this_firstVisibleChild_node_key, _this_lastVisibleChild_node_key;
|
|
658
|
+
this.nextCollection.commit((_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild === void 0 ? void 0 : _this_firstVisibleChild.node.key) !== null && _this_firstVisibleChild_node_key !== void 0 ? _this_firstVisibleChild_node_key : null, (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild === void 0 ? void 0 : _this_lastVisibleChild.node.key) !== null && _this_lastVisibleChild_node_key !== void 0 ? _this_lastVisibleChild_node_key : null, this.isSSR);
|
|
659
|
+
if (!this.isSSR) {
|
|
660
|
+
this.collection = this.nextCollection;
|
|
661
|
+
this.nextCollection = null;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
queueUpdate() {
|
|
666
|
+
if (this.dirtyNodes.size === 0 || this.queuedRender) return;
|
|
667
|
+
this.queuedRender = true;
|
|
668
|
+
this.inSubscription = true;
|
|
669
|
+
for (let fn of this.subscriptions) fn();
|
|
670
|
+
this.inSubscription = false;
|
|
671
|
+
}
|
|
672
|
+
subscribe(fn) {
|
|
673
|
+
this.subscriptions.add(fn);
|
|
674
|
+
return () => this.subscriptions.delete(fn);
|
|
675
|
+
}
|
|
676
|
+
resetAfterSSR() {
|
|
677
|
+
if (this.isSSR) {
|
|
678
|
+
this.isSSR = false;
|
|
679
|
+
this.firstChild = null;
|
|
680
|
+
this.lastChild = null;
|
|
681
|
+
this.nodeId = 0;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
constructor(collection) {
|
|
685
|
+
super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = /* @__PURE__ */ new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = /* @__PURE__ */ new WeakMap(), this.isMounted = true, this.nextCollection = null, this.subscriptions = /* @__PURE__ */ new Set(), this.queuedRender = false, this.inSubscription = false;
|
|
686
|
+
this.collection = collection;
|
|
687
|
+
this.nextCollection = collection;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
691
|
+
let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
|
|
692
|
+
let cache = useMemo(() => /* @__PURE__ */ new WeakMap(), dependencies);
|
|
693
|
+
return useMemo(() => {
|
|
694
|
+
if (items && typeof children === "function") {
|
|
695
|
+
let res = [];
|
|
696
|
+
for (let item of items) {
|
|
697
|
+
let rendered = cache.get(item);
|
|
698
|
+
if (!rendered) {
|
|
699
|
+
rendered = children(item);
|
|
700
|
+
var _rendered_props_id, _ref;
|
|
701
|
+
let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
|
|
702
|
+
if (key == null) throw new Error("Could not determine key for item");
|
|
703
|
+
if (idScope) key = idScope + ":" + key;
|
|
704
|
+
rendered = cloneElement(rendered, addIdAndValue ? {
|
|
705
|
+
key,
|
|
706
|
+
id: key,
|
|
707
|
+
value: item
|
|
708
|
+
} : {
|
|
709
|
+
key
|
|
710
|
+
});
|
|
711
|
+
cache.set(item, rendered);
|
|
712
|
+
}
|
|
713
|
+
res.push(rendered);
|
|
714
|
+
}
|
|
715
|
+
return res;
|
|
716
|
+
} else if (typeof children !== "function") return children;
|
|
717
|
+
}, [
|
|
718
|
+
children,
|
|
719
|
+
items,
|
|
720
|
+
cache,
|
|
721
|
+
idScope,
|
|
722
|
+
addIdAndValue
|
|
723
|
+
]);
|
|
724
|
+
}
|
|
725
|
+
const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
|
|
726
|
+
function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
|
|
727
|
+
let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
|
|
728
|
+
const timeRef = useRef(void 0);
|
|
729
|
+
let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
|
|
730
|
+
let { pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
|
|
731
|
+
isDisabled,
|
|
732
|
+
onPressStart(e) {
|
|
733
|
+
e.continuePropagation();
|
|
734
|
+
if (e.pointerType === "mouse" || e.pointerType === "touch") {
|
|
735
|
+
if (onLongPressStart) onLongPressStart({
|
|
736
|
+
...e,
|
|
737
|
+
type: "longpressstart"
|
|
738
|
+
});
|
|
739
|
+
timeRef.current = setTimeout(() => {
|
|
740
|
+
e.target.dispatchEvent(new PointerEvent("pointercancel", {
|
|
741
|
+
bubbles: true
|
|
742
|
+
}));
|
|
743
|
+
if ($431fbd86ca7dc216$export$b204af158042fbac(e.target).activeElement !== e.target) $7215afc6de606d6b$export$de79e2c695e052f3(e.target);
|
|
744
|
+
if (onLongPress) onLongPress({
|
|
745
|
+
...e,
|
|
746
|
+
type: "longpress"
|
|
747
|
+
});
|
|
748
|
+
timeRef.current = void 0;
|
|
749
|
+
}, threshold);
|
|
750
|
+
if (e.pointerType === "touch") {
|
|
751
|
+
let onContextMenu = (e2) => {
|
|
752
|
+
e2.preventDefault();
|
|
753
|
+
};
|
|
754
|
+
addGlobalListener(e.target, "contextmenu", onContextMenu, {
|
|
755
|
+
once: true
|
|
756
|
+
});
|
|
757
|
+
addGlobalListener(window, "pointerup", () => {
|
|
758
|
+
setTimeout(() => {
|
|
759
|
+
removeGlobalListener(e.target, "contextmenu", onContextMenu);
|
|
760
|
+
}, 30);
|
|
761
|
+
}, {
|
|
762
|
+
once: true
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
onPressEnd(e) {
|
|
768
|
+
if (timeRef.current) clearTimeout(timeRef.current);
|
|
769
|
+
if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd({
|
|
770
|
+
...e,
|
|
771
|
+
type: "longpressend"
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
let descriptionProps = $ef06256079686ba0$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0);
|
|
776
|
+
return {
|
|
777
|
+
longPressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, descriptionProps)
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
var shim = { exports: {} };
|
|
781
|
+
var useSyncExternalStoreShim_production = {};
|
|
782
|
+
/**
|
|
783
|
+
* @license React
|
|
784
|
+
* use-sync-external-store-shim.production.js
|
|
785
|
+
*
|
|
786
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
787
|
+
*
|
|
788
|
+
* This source code is licensed under the MIT license found in the
|
|
789
|
+
* LICENSE file in the root directory of this source tree.
|
|
790
|
+
*/
|
|
791
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
792
|
+
function requireUseSyncExternalStoreShim_production() {
|
|
793
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
794
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
795
|
+
var React = React__default;
|
|
796
|
+
function is(x, y) {
|
|
797
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
798
|
+
}
|
|
799
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
|
|
800
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
801
|
+
var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
802
|
+
useLayoutEffect(
|
|
803
|
+
function() {
|
|
804
|
+
inst.value = value;
|
|
805
|
+
inst.getSnapshot = getSnapshot;
|
|
806
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
807
|
+
},
|
|
808
|
+
[subscribe, value, getSnapshot]
|
|
809
|
+
);
|
|
810
|
+
useEffect2(
|
|
811
|
+
function() {
|
|
812
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
813
|
+
return subscribe(function() {
|
|
814
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
815
|
+
});
|
|
816
|
+
},
|
|
817
|
+
[subscribe]
|
|
818
|
+
);
|
|
819
|
+
useDebugValue(value);
|
|
820
|
+
return value;
|
|
821
|
+
}
|
|
822
|
+
function checkIfSnapshotChanged(inst) {
|
|
823
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
824
|
+
inst = inst.value;
|
|
825
|
+
try {
|
|
826
|
+
var nextValue = latestGetSnapshot();
|
|
827
|
+
return !objectIs(inst, nextValue);
|
|
828
|
+
} catch (error) {
|
|
829
|
+
return true;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
833
|
+
return getSnapshot();
|
|
834
|
+
}
|
|
835
|
+
var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
836
|
+
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
837
|
+
return useSyncExternalStoreShim_production;
|
|
838
|
+
}
|
|
839
|
+
var useSyncExternalStoreShim_development = {};
|
|
840
|
+
/**
|
|
841
|
+
* @license React
|
|
842
|
+
* use-sync-external-store-shim.development.js
|
|
843
|
+
*
|
|
844
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
845
|
+
*
|
|
846
|
+
* This source code is licensed under the MIT license found in the
|
|
847
|
+
* LICENSE file in the root directory of this source tree.
|
|
848
|
+
*/
|
|
849
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
850
|
+
function requireUseSyncExternalStoreShim_development() {
|
|
851
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
852
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
853
|
+
"production" !== process.env.NODE_ENV && function() {
|
|
854
|
+
function is(x, y) {
|
|
855
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
856
|
+
}
|
|
857
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
858
|
+
didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
859
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
860
|
+
));
|
|
861
|
+
var value = getSnapshot();
|
|
862
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
863
|
+
var cachedValue = getSnapshot();
|
|
864
|
+
objectIs(value, cachedValue) || (console.error(
|
|
865
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
866
|
+
), didWarnUncachedGetSnapshot = true);
|
|
867
|
+
}
|
|
868
|
+
cachedValue = useState2({
|
|
869
|
+
inst: { value, getSnapshot }
|
|
870
|
+
});
|
|
871
|
+
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
872
|
+
useLayoutEffect(
|
|
873
|
+
function() {
|
|
874
|
+
inst.value = value;
|
|
875
|
+
inst.getSnapshot = getSnapshot;
|
|
876
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
877
|
+
},
|
|
878
|
+
[subscribe, value, getSnapshot]
|
|
879
|
+
);
|
|
880
|
+
useEffect2(
|
|
881
|
+
function() {
|
|
882
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
883
|
+
return subscribe(function() {
|
|
884
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
885
|
+
});
|
|
886
|
+
},
|
|
887
|
+
[subscribe]
|
|
888
|
+
);
|
|
889
|
+
useDebugValue(value);
|
|
890
|
+
return value;
|
|
891
|
+
}
|
|
892
|
+
function checkIfSnapshotChanged(inst) {
|
|
893
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
894
|
+
inst = inst.value;
|
|
895
|
+
try {
|
|
896
|
+
var nextValue = latestGetSnapshot();
|
|
897
|
+
return !objectIs(inst, nextValue);
|
|
898
|
+
} catch (error) {
|
|
899
|
+
return true;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
903
|
+
return getSnapshot();
|
|
904
|
+
}
|
|
905
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
906
|
+
var React = React__default, objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
907
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
908
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
909
|
+
}();
|
|
910
|
+
return useSyncExternalStoreShim_development;
|
|
911
|
+
}
|
|
912
|
+
var hasRequiredShim;
|
|
913
|
+
function requireShim() {
|
|
914
|
+
if (hasRequiredShim) return shim.exports;
|
|
915
|
+
hasRequiredShim = 1;
|
|
916
|
+
if (process.env.NODE_ENV === "production") {
|
|
917
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
918
|
+
} else {
|
|
919
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
920
|
+
}
|
|
921
|
+
return shim.exports;
|
|
922
|
+
}
|
|
923
|
+
var shimExports = requireShim();
|
|
924
|
+
const $e1995378a142960e$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
|
|
925
|
+
const $e1995378a142960e$var$CollectionDocumentContext = /* @__PURE__ */ createContext(null);
|
|
926
|
+
function $e1995378a142960e$export$bf788dd355e3a401(props) {
|
|
927
|
+
let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
|
|
928
|
+
if (doc)
|
|
929
|
+
return props.content;
|
|
930
|
+
let { collection, document: document2 } = $e1995378a142960e$var$useCollectionDocument(props.createCollection);
|
|
931
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement($f39a9eba43920ace$export$8dc98ba7eadeaa56, null, /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionDocumentContext.Provider, {
|
|
932
|
+
value: document2
|
|
933
|
+
}, props.content)), /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionInner, {
|
|
934
|
+
render: props.children,
|
|
935
|
+
collection
|
|
936
|
+
}));
|
|
937
|
+
}
|
|
938
|
+
function $e1995378a142960e$var$CollectionInner({ collection, render }) {
|
|
939
|
+
return render(collection);
|
|
940
|
+
}
|
|
941
|
+
function $e1995378a142960e$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
|
|
942
|
+
let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
|
|
943
|
+
let isSSRRef = useRef(isSSR);
|
|
944
|
+
isSSRRef.current = isSSR;
|
|
945
|
+
let getSnapshotWrapper = useCallback(() => {
|
|
946
|
+
return isSSRRef.current ? getServerSnapshot() : getSnapshot();
|
|
947
|
+
}, [
|
|
948
|
+
getSnapshot,
|
|
949
|
+
getServerSnapshot
|
|
950
|
+
]);
|
|
951
|
+
return shimExports.useSyncExternalStore(subscribe, getSnapshotWrapper);
|
|
952
|
+
}
|
|
953
|
+
const $e1995378a142960e$var$useSyncExternalStore = typeof React__default["useSyncExternalStore"] === "function" ? React__default["useSyncExternalStore"] : $e1995378a142960e$var$useSyncExternalStoreFallback;
|
|
954
|
+
function $e1995378a142960e$var$useCollectionDocument(createCollection) {
|
|
955
|
+
let [document2] = useState(() => new $681cc3c98f569e39$export$b34a105447964f9f((createCollection === null || createCollection === void 0 ? void 0 : createCollection()) || new $23b9f4fcf0fe224b$export$408d25a4e12db025()));
|
|
956
|
+
let subscribe = useCallback((fn) => document2.subscribe(fn), [
|
|
957
|
+
document2
|
|
958
|
+
]);
|
|
959
|
+
let getSnapshot = useCallback(() => {
|
|
960
|
+
let collection2 = document2.getCollection();
|
|
961
|
+
if (document2.isSSR)
|
|
962
|
+
document2.resetAfterSSR();
|
|
963
|
+
return collection2;
|
|
964
|
+
}, [
|
|
965
|
+
document2
|
|
966
|
+
]);
|
|
967
|
+
let getServerSnapshot = useCallback(() => {
|
|
968
|
+
document2.isSSR = true;
|
|
969
|
+
return document2.getCollection();
|
|
970
|
+
}, [
|
|
971
|
+
document2
|
|
972
|
+
]);
|
|
973
|
+
let collection = $e1995378a142960e$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
974
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
975
|
+
document2.isMounted = true;
|
|
976
|
+
return () => {
|
|
977
|
+
document2.isMounted = false;
|
|
978
|
+
};
|
|
979
|
+
}, [
|
|
980
|
+
document2
|
|
981
|
+
]);
|
|
982
|
+
return {
|
|
983
|
+
collection,
|
|
984
|
+
document: document2
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
const $e1995378a142960e$var$SSRContext = /* @__PURE__ */ createContext(null);
|
|
988
|
+
function $e1995378a142960e$var$useSSRCollectionNode(Type, props, ref, rendered, children, render) {
|
|
989
|
+
let itemRef = useCallback((element) => {
|
|
990
|
+
element === null || element === void 0 ? void 0 : element.setProps(props, ref, rendered, render);
|
|
991
|
+
}, [
|
|
992
|
+
props,
|
|
993
|
+
ref,
|
|
994
|
+
rendered,
|
|
995
|
+
render
|
|
996
|
+
]);
|
|
997
|
+
let parentNode = useContext($e1995378a142960e$var$SSRContext);
|
|
998
|
+
if (parentNode) {
|
|
999
|
+
let element = parentNode.ownerDocument.nodesByProps.get(props);
|
|
1000
|
+
if (!element) {
|
|
1001
|
+
element = parentNode.ownerDocument.createElement(Type);
|
|
1002
|
+
element.setProps(props, ref, rendered, render);
|
|
1003
|
+
parentNode.appendChild(element);
|
|
1004
|
+
parentNode.ownerDocument.updateCollection();
|
|
1005
|
+
parentNode.ownerDocument.nodesByProps.set(props, element);
|
|
1006
|
+
}
|
|
1007
|
+
return children ? /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$SSRContext.Provider, {
|
|
1008
|
+
value: element
|
|
1009
|
+
}, children) : null;
|
|
1010
|
+
}
|
|
1011
|
+
return /* @__PURE__ */ React__default.createElement(Type, {
|
|
1012
|
+
ref: itemRef
|
|
1013
|
+
}, children);
|
|
1014
|
+
}
|
|
1015
|
+
function $e1995378a142960e$export$18af5c7a9e9b3664(type, render) {
|
|
1016
|
+
let Component = ({ node }) => render(node.props, node.props.ref, node);
|
|
1017
|
+
let Result = forwardRef((props, ref) => {
|
|
1018
|
+
let focusableProps = useContext($f645667febf57a63$export$f9762fab77588ecb);
|
|
1019
|
+
let isShallow = useContext($e1995378a142960e$var$ShallowRenderContext);
|
|
1020
|
+
if (!isShallow) {
|
|
1021
|
+
if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
|
|
1022
|
+
return render(props, ref);
|
|
1023
|
+
}
|
|
1024
|
+
return $e1995378a142960e$var$useSSRCollectionNode(type, props, ref, "children" in props ? props.children : null, null, (node) => (
|
|
1025
|
+
// Forward FocusableContext to real DOM tree so tooltips work.
|
|
1026
|
+
/* @__PURE__ */ React__default.createElement($f645667febf57a63$export$f9762fab77588ecb.Provider, {
|
|
1027
|
+
value: focusableProps
|
|
1028
|
+
}, /* @__PURE__ */ React__default.createElement(Component, {
|
|
1029
|
+
node
|
|
1030
|
+
}))
|
|
1031
|
+
));
|
|
1032
|
+
});
|
|
1033
|
+
Result.displayName = render.name;
|
|
1034
|
+
return Result;
|
|
1035
|
+
}
|
|
1036
|
+
function $e1995378a142960e$export$e953bb1cd0f19726(type, render, useChildren = $e1995378a142960e$var$useCollectionChildren) {
|
|
1037
|
+
let Component = ({ node }) => render(node.props, node.props.ref, node);
|
|
1038
|
+
let Result = forwardRef((props, ref) => {
|
|
1039
|
+
let children = useChildren(props);
|
|
1040
|
+
var _useSSRCollectionNode;
|
|
1041
|
+
return (_useSSRCollectionNode = $e1995378a142960e$var$useSSRCollectionNode(type, props, ref, null, children, (node) => /* @__PURE__ */ React__default.createElement(Component, {
|
|
1042
|
+
node
|
|
1043
|
+
}))) !== null && _useSSRCollectionNode !== void 0 ? _useSSRCollectionNode : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null);
|
|
1044
|
+
});
|
|
1045
|
+
Result.displayName = render.name;
|
|
1046
|
+
return Result;
|
|
1047
|
+
}
|
|
1048
|
+
function $e1995378a142960e$var$useCollectionChildren(options) {
|
|
1049
|
+
return $e948873055cbafe4$export$727c8fc270210f13({
|
|
1050
|
+
...options,
|
|
1051
|
+
addIdAndValue: true
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
const $e1995378a142960e$var$CollectionContext = /* @__PURE__ */ createContext(null);
|
|
1055
|
+
function $e1995378a142960e$export$fb8073518f34e6ec(props) {
|
|
1056
|
+
let ctx = useContext($e1995378a142960e$var$CollectionContext);
|
|
1057
|
+
let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
|
|
1058
|
+
let idScope = props.idScope || (ctx === null || ctx === void 0 ? void 0 : ctx.idScope);
|
|
1059
|
+
let children = $e1995378a142960e$var$useCollectionChildren({
|
|
1060
|
+
...props,
|
|
1061
|
+
idScope,
|
|
1062
|
+
dependencies
|
|
1063
|
+
});
|
|
1064
|
+
let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
|
|
1065
|
+
if (doc) children = /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionRoot, null, children);
|
|
1066
|
+
ctx = useMemo(() => ({
|
|
1067
|
+
dependencies,
|
|
1068
|
+
idScope
|
|
1069
|
+
}), [
|
|
1070
|
+
idScope,
|
|
1071
|
+
...dependencies
|
|
1072
|
+
]);
|
|
1073
|
+
return /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionContext.Provider, {
|
|
1074
|
+
value: ctx
|
|
1075
|
+
}, children);
|
|
1076
|
+
}
|
|
1077
|
+
function $e1995378a142960e$var$CollectionRoot({ children }) {
|
|
1078
|
+
let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
|
|
1079
|
+
let wrappedChildren = useMemo(() => /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$CollectionDocumentContext.Provider, {
|
|
1080
|
+
value: null
|
|
1081
|
+
}, /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$ShallowRenderContext.Provider, {
|
|
1082
|
+
value: true
|
|
1083
|
+
}, children)), [
|
|
1084
|
+
children
|
|
1085
|
+
]);
|
|
1086
|
+
return $b5e257d569688ac6$export$535bd6ca7f90a273() ? /* @__PURE__ */ React__default.createElement($e1995378a142960e$var$SSRContext.Provider, {
|
|
1087
|
+
value: doc
|
|
1088
|
+
}, wrappedChildren) : /* @__PURE__ */ reactDomExports.createPortal(wrappedChildren, doc);
|
|
1089
|
+
}
|
|
1090
|
+
function $55f9b1ae81f22853$export$76e4e37e5339496d(to) {
|
|
1091
|
+
let from = $55f9b1ae81f22853$export$759df0d867455a91($431fbd86ca7dc216$export$b204af158042fbac(to));
|
|
1092
|
+
if (from !== to) {
|
|
1093
|
+
if (from) $55f9b1ae81f22853$export$6c5dc7e81d2cc29a(from, to);
|
|
1094
|
+
if (to) $55f9b1ae81f22853$export$2b35b76d2e30e129(to, from);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
function $55f9b1ae81f22853$export$6c5dc7e81d2cc29a(from, to) {
|
|
1098
|
+
from.dispatchEvent(new FocusEvent("blur", {
|
|
1099
|
+
relatedTarget: to
|
|
1100
|
+
}));
|
|
1101
|
+
from.dispatchEvent(new FocusEvent("focusout", {
|
|
1102
|
+
bubbles: true,
|
|
1103
|
+
relatedTarget: to
|
|
1104
|
+
}));
|
|
1105
|
+
}
|
|
1106
|
+
function $55f9b1ae81f22853$export$2b35b76d2e30e129(to, from) {
|
|
1107
|
+
to.dispatchEvent(new FocusEvent("focus", {
|
|
1108
|
+
relatedTarget: from
|
|
1109
|
+
}));
|
|
1110
|
+
to.dispatchEvent(new FocusEvent("focusin", {
|
|
1111
|
+
bubbles: true,
|
|
1112
|
+
relatedTarget: from
|
|
1113
|
+
}));
|
|
1114
|
+
}
|
|
1115
|
+
function $55f9b1ae81f22853$export$759df0d867455a91(document2) {
|
|
1116
|
+
let activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(document2);
|
|
1117
|
+
let activeDescendant = activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute("aria-activedescendant");
|
|
1118
|
+
if (activeDescendant) return document2.getElementById(activeDescendant) || activeElement;
|
|
1119
|
+
return activeElement;
|
|
1120
|
+
}
|
|
1121
|
+
function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
|
|
1122
|
+
return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
|
|
1123
|
+
}
|
|
1124
|
+
function $feb5ffebff200149$export$c3d8340acf92597f(collectionRef, key) {
|
|
1125
|
+
var _collectionRef_current, _collectionRef_current1;
|
|
1126
|
+
let selector = `[data-key="${CSS.escape(String(key))}"]`;
|
|
1127
|
+
let collection = (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dataset.collection;
|
|
1128
|
+
if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
|
|
1129
|
+
return (_collectionRef_current1 = collectionRef.current) === null || _collectionRef_current1 === void 0 ? void 0 : _collectionRef_current1.querySelector(selector);
|
|
1130
|
+
}
|
|
1131
|
+
const $feb5ffebff200149$var$collectionMap = /* @__PURE__ */ new WeakMap();
|
|
1132
|
+
function $feb5ffebff200149$export$881eb0d9f3605d9d(collection) {
|
|
1133
|
+
let id = $bdb11010cef70236$export$f680877a34711e37();
|
|
1134
|
+
$feb5ffebff200149$var$collectionMap.set(collection, id);
|
|
1135
|
+
return id;
|
|
1136
|
+
}
|
|
1137
|
+
function $feb5ffebff200149$export$6aeb1680a0ae8741(collection) {
|
|
1138
|
+
return $feb5ffebff200149$var$collectionMap.get(collection);
|
|
1139
|
+
}
|
|
1140
|
+
const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
|
|
1141
|
+
function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
1142
|
+
let { keyboardDelegate, selectionManager, onTypeSelect } = options;
|
|
1143
|
+
let state = useRef({
|
|
1144
|
+
search: "",
|
|
1145
|
+
timeout: void 0
|
|
1146
|
+
}).current;
|
|
1147
|
+
let onKeyDown = (e) => {
|
|
1148
|
+
let character = $fb3050f43d946246$var$getStringForKey(e.key);
|
|
1149
|
+
if (!character || e.ctrlKey || e.metaKey || !e.currentTarget.contains(e.target)) return;
|
|
1150
|
+
if (character === " " && state.search.trim().length > 0) {
|
|
1151
|
+
e.preventDefault();
|
|
1152
|
+
if (!("continuePropagation" in e)) e.stopPropagation();
|
|
1153
|
+
}
|
|
1154
|
+
state.search += character;
|
|
1155
|
+
if (keyboardDelegate.getKeyForSearch != null) {
|
|
1156
|
+
let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
|
|
1157
|
+
if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
|
|
1158
|
+
if (key != null) {
|
|
1159
|
+
selectionManager.setFocusedKey(key);
|
|
1160
|
+
if (onTypeSelect) onTypeSelect(key);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
clearTimeout(state.timeout);
|
|
1164
|
+
state.timeout = setTimeout(() => {
|
|
1165
|
+
state.search = "";
|
|
1166
|
+
}, $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
|
|
1167
|
+
};
|
|
1168
|
+
return {
|
|
1169
|
+
typeSelectProps: {
|
|
1170
|
+
// Using a capturing listener to catch the keydown event before
|
|
1171
|
+
// other hooks in order to handle the Spacebar event.
|
|
1172
|
+
onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
function $fb3050f43d946246$var$getStringForKey(key) {
|
|
1177
|
+
if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
|
|
1178
|
+
return "";
|
|
1179
|
+
}
|
|
1180
|
+
function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
1181
|
+
let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, escapeKeyBehavior = "clearSelection", selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, isVirtualized, scrollRef = ref, linkBehavior = "action" } = options;
|
|
1182
|
+
let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
1183
|
+
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
1184
|
+
let onKeyDown = (e) => {
|
|
1185
|
+
var _ref_current;
|
|
1186
|
+
if (e.altKey && e.key === "Tab") e.preventDefault();
|
|
1187
|
+
if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
|
|
1188
|
+
const navigateToKey = (key, childFocus) => {
|
|
1189
|
+
if (key != null) {
|
|
1190
|
+
if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) {
|
|
1191
|
+
reactDomExports.flushSync(() => {
|
|
1192
|
+
manager.setFocusedKey(key, childFocus);
|
|
1193
|
+
});
|
|
1194
|
+
let item = $feb5ffebff200149$export$c3d8340acf92597f(ref, key);
|
|
1195
|
+
let itemProps = manager.getItemProps(key);
|
|
1196
|
+
if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
manager.setFocusedKey(key, childFocus);
|
|
1200
|
+
if (manager.isLink(key) && linkBehavior === "override") return;
|
|
1201
|
+
if (e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(key);
|
|
1202
|
+
else if (selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
switch (e.key) {
|
|
1206
|
+
case "ArrowDown":
|
|
1207
|
+
if (delegate.getKeyBelow) {
|
|
1208
|
+
var _delegate_getKeyBelow, _delegate_getFirstKey, _delegate_getFirstKey1;
|
|
1209
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
1210
|
+
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
|
|
1211
|
+
if (nextKey != null) {
|
|
1212
|
+
e.preventDefault();
|
|
1213
|
+
navigateToKey(nextKey);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
break;
|
|
1217
|
+
case "ArrowUp":
|
|
1218
|
+
if (delegate.getKeyAbove) {
|
|
1219
|
+
var _delegate_getKeyAbove, _delegate_getLastKey, _delegate_getLastKey1;
|
|
1220
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
|
|
1221
|
+
if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
|
|
1222
|
+
if (nextKey != null) {
|
|
1223
|
+
e.preventDefault();
|
|
1224
|
+
navigateToKey(nextKey);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
break;
|
|
1228
|
+
case "ArrowLeft":
|
|
1229
|
+
if (delegate.getKeyLeftOf) {
|
|
1230
|
+
var _delegate_getKeyLeftOf, _delegate_getFirstKey2, _delegate_getLastKey2;
|
|
1231
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
|
|
1232
|
+
if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
|
|
1233
|
+
if (nextKey != null) {
|
|
1234
|
+
e.preventDefault();
|
|
1235
|
+
navigateToKey(nextKey, direction === "rtl" ? "first" : "last");
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
break;
|
|
1239
|
+
case "ArrowRight":
|
|
1240
|
+
if (delegate.getKeyRightOf) {
|
|
1241
|
+
var _delegate_getKeyRightOf, _delegate_getLastKey3, _delegate_getFirstKey3;
|
|
1242
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
|
|
1243
|
+
if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
|
|
1244
|
+
if (nextKey != null) {
|
|
1245
|
+
e.preventDefault();
|
|
1246
|
+
navigateToKey(nextKey, direction === "rtl" ? "last" : "first");
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
break;
|
|
1250
|
+
case "Home":
|
|
1251
|
+
if (delegate.getFirstKey) {
|
|
1252
|
+
if (manager.focusedKey === null && e.shiftKey) return;
|
|
1253
|
+
e.preventDefault();
|
|
1254
|
+
let firstKey = delegate.getFirstKey(manager.focusedKey, $21f1aa98acb08317$export$16792effe837dba3(e));
|
|
1255
|
+
manager.setFocusedKey(firstKey);
|
|
1256
|
+
if (firstKey != null) {
|
|
1257
|
+
if ($21f1aa98acb08317$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
|
|
1258
|
+
else if (selectOnFocus) manager.replaceSelection(firstKey);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
break;
|
|
1262
|
+
case "End":
|
|
1263
|
+
if (delegate.getLastKey) {
|
|
1264
|
+
if (manager.focusedKey === null && e.shiftKey) return;
|
|
1265
|
+
e.preventDefault();
|
|
1266
|
+
let lastKey = delegate.getLastKey(manager.focusedKey, $21f1aa98acb08317$export$16792effe837dba3(e));
|
|
1267
|
+
manager.setFocusedKey(lastKey);
|
|
1268
|
+
if (lastKey != null) {
|
|
1269
|
+
if ($21f1aa98acb08317$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
|
|
1270
|
+
else if (selectOnFocus) manager.replaceSelection(lastKey);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
break;
|
|
1274
|
+
case "PageDown":
|
|
1275
|
+
if (delegate.getKeyPageBelow && manager.focusedKey != null) {
|
|
1276
|
+
let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
|
|
1277
|
+
if (nextKey != null) {
|
|
1278
|
+
e.preventDefault();
|
|
1279
|
+
navigateToKey(nextKey);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
break;
|
|
1283
|
+
case "PageUp":
|
|
1284
|
+
if (delegate.getKeyPageAbove && manager.focusedKey != null) {
|
|
1285
|
+
let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
|
|
1286
|
+
if (nextKey != null) {
|
|
1287
|
+
e.preventDefault();
|
|
1288
|
+
navigateToKey(nextKey);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
break;
|
|
1292
|
+
case "a":
|
|
1293
|
+
if ($21f1aa98acb08317$export$16792effe837dba3(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
|
|
1294
|
+
e.preventDefault();
|
|
1295
|
+
manager.selectAll();
|
|
1296
|
+
}
|
|
1297
|
+
break;
|
|
1298
|
+
case "Escape":
|
|
1299
|
+
if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
|
|
1300
|
+
e.stopPropagation();
|
|
1301
|
+
e.preventDefault();
|
|
1302
|
+
manager.clearSelection();
|
|
1303
|
+
}
|
|
1304
|
+
break;
|
|
1305
|
+
case "Tab":
|
|
1306
|
+
if (!allowsTabNavigation) {
|
|
1307
|
+
if (e.shiftKey) ref.current.focus();
|
|
1308
|
+
else {
|
|
1309
|
+
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
|
|
1310
|
+
tabbable: true
|
|
1311
|
+
});
|
|
1312
|
+
let next = void 0;
|
|
1313
|
+
let last;
|
|
1314
|
+
do {
|
|
1315
|
+
last = walker.lastChild();
|
|
1316
|
+
if (last) next = last;
|
|
1317
|
+
} while (last);
|
|
1318
|
+
if (next && !next.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(next);
|
|
1319
|
+
}
|
|
1320
|
+
break;
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
let scrollPos = useRef({
|
|
1325
|
+
top: 0,
|
|
1326
|
+
left: 0
|
|
1327
|
+
});
|
|
1328
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ? void 0 : () => {
|
|
1329
|
+
var _scrollRef_current, _scrollRef_current1;
|
|
1330
|
+
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
|
|
1331
|
+
scrollPos.current = {
|
|
1332
|
+
top: (_scrollRef_current_scrollTop = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTop) !== null && _scrollRef_current_scrollTop !== void 0 ? _scrollRef_current_scrollTop : 0,
|
|
1333
|
+
left: (_scrollRef_current_scrollLeft = (_scrollRef_current1 = scrollRef.current) === null || _scrollRef_current1 === void 0 ? void 0 : _scrollRef_current1.scrollLeft) !== null && _scrollRef_current_scrollLeft !== void 0 ? _scrollRef_current_scrollLeft : 0
|
|
1334
|
+
};
|
|
1335
|
+
});
|
|
1336
|
+
let onFocus = (e) => {
|
|
1337
|
+
if (manager.isFocused) {
|
|
1338
|
+
if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
1342
|
+
manager.setFocused(true);
|
|
1343
|
+
if (manager.focusedKey == null) {
|
|
1344
|
+
var _delegate_getLastKey, _delegate_getFirstKey;
|
|
1345
|
+
let navigateToKey = (key) => {
|
|
1346
|
+
if (key != null) {
|
|
1347
|
+
manager.setFocusedKey(key);
|
|
1348
|
+
if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
let relatedTarget = e.relatedTarget;
|
|
1352
|
+
var _manager_lastSelectedKey, _manager_firstSelectedKey;
|
|
1353
|
+
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate));
|
|
1354
|
+
else navigateToKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate));
|
|
1355
|
+
} else if (!isVirtualized && scrollRef.current) {
|
|
1356
|
+
scrollRef.current.scrollTop = scrollPos.current.top;
|
|
1357
|
+
scrollRef.current.scrollLeft = scrollPos.current.left;
|
|
1358
|
+
}
|
|
1359
|
+
if (manager.focusedKey != null && scrollRef.current) {
|
|
1360
|
+
let element = $feb5ffebff200149$export$c3d8340acf92597f(ref, manager.focusedKey);
|
|
1361
|
+
if (element instanceof HTMLElement) {
|
|
1362
|
+
if (!element.contains(document.activeElement) && !shouldUseVirtualFocus) $7215afc6de606d6b$export$de79e2c695e052f3(element);
|
|
1363
|
+
let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
|
|
1364
|
+
if (modality === "keyboard") $2f04cbc44ee30ce0$export$c826860796309d1b(element, {
|
|
1365
|
+
containingElement: ref.current
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
let onBlur = (e) => {
|
|
1371
|
+
if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
|
|
1372
|
+
};
|
|
1373
|
+
let shouldVirtualFocusFirst = useRef(false);
|
|
1374
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
|
|
1375
|
+
let { detail } = e;
|
|
1376
|
+
e.stopPropagation();
|
|
1377
|
+
manager.setFocused(true);
|
|
1378
|
+
if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === "first") shouldVirtualFocusFirst.current = true;
|
|
1379
|
+
});
|
|
1380
|
+
let updateActiveDescendant = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
1381
|
+
var _delegate_getFirstKey;
|
|
1382
|
+
var _delegate_getFirstKey1;
|
|
1383
|
+
let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
1384
|
+
if (keyToFocus == null) {
|
|
1385
|
+
$55f9b1ae81f22853$export$76e4e37e5339496d(ref.current);
|
|
1386
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
1387
|
+
} else {
|
|
1388
|
+
manager.setFocusedKey(keyToFocus);
|
|
1389
|
+
shouldVirtualFocusFirst.current = false;
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
$ca9b37712f007381$export$72ef708ab07251f1(() => {
|
|
1393
|
+
if (shouldVirtualFocusFirst.current) updateActiveDescendant();
|
|
1394
|
+
}, [
|
|
1395
|
+
manager.collection,
|
|
1396
|
+
updateActiveDescendant
|
|
1397
|
+
]);
|
|
1398
|
+
let resetFocusFirstFlag = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
1399
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
1400
|
+
});
|
|
1401
|
+
$ca9b37712f007381$export$72ef708ab07251f1(() => {
|
|
1402
|
+
resetFocusFirstFlag();
|
|
1403
|
+
}, [
|
|
1404
|
+
manager.focusedKey,
|
|
1405
|
+
resetFocusFirstFlag
|
|
1406
|
+
]);
|
|
1407
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
|
|
1408
|
+
var _e_detail;
|
|
1409
|
+
e.stopPropagation();
|
|
1410
|
+
manager.setFocused(false);
|
|
1411
|
+
if ((_e_detail = e.detail) === null || _e_detail === void 0 ? void 0 : _e_detail.clearFocusKey) manager.setFocusedKey(null);
|
|
1412
|
+
});
|
|
1413
|
+
const autoFocusRef = useRef(autoFocus);
|
|
1414
|
+
const didAutoFocusRef = useRef(false);
|
|
1415
|
+
useEffect(() => {
|
|
1416
|
+
if (autoFocusRef.current) {
|
|
1417
|
+
var _delegate_getFirstKey, _delegate_getLastKey;
|
|
1418
|
+
let focusedKey = null;
|
|
1419
|
+
var _delegate_getFirstKey1;
|
|
1420
|
+
if (autoFocus === "first") focusedKey = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
|
|
1421
|
+
var _delegate_getLastKey1;
|
|
1422
|
+
if (autoFocus === "last") focusedKey = (_delegate_getLastKey1 = (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate)) !== null && _delegate_getLastKey1 !== void 0 ? _delegate_getLastKey1 : null;
|
|
1423
|
+
let selectedKeys = manager.selectedKeys;
|
|
1424
|
+
if (selectedKeys.size) {
|
|
1425
|
+
for (let key of selectedKeys) if (manager.canSelectItem(key)) {
|
|
1426
|
+
focusedKey = key;
|
|
1427
|
+
break;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
manager.setFocused(true);
|
|
1431
|
+
manager.setFocusedKey(focusedKey);
|
|
1432
|
+
if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
|
|
1433
|
+
if (manager.collection.size > 0) {
|
|
1434
|
+
autoFocusRef.current = false;
|
|
1435
|
+
didAutoFocusRef.current = true;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
});
|
|
1439
|
+
let lastFocusedKey = useRef(manager.focusedKey);
|
|
1440
|
+
let raf = useRef(null);
|
|
1441
|
+
useEffect(() => {
|
|
1442
|
+
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {
|
|
1443
|
+
let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
|
|
1444
|
+
let element = $feb5ffebff200149$export$c3d8340acf92597f(ref, manager.focusedKey);
|
|
1445
|
+
if (!(element instanceof HTMLElement))
|
|
1446
|
+
return;
|
|
1447
|
+
if (modality === "keyboard" || didAutoFocusRef.current) {
|
|
1448
|
+
if (raf.current) cancelAnimationFrame(raf.current);
|
|
1449
|
+
raf.current = requestAnimationFrame(() => {
|
|
1450
|
+
if (scrollRef.current) {
|
|
1451
|
+
$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
|
|
1452
|
+
if (modality !== "virtual") $2f04cbc44ee30ce0$export$c826860796309d1b(element, {
|
|
1453
|
+
containingElement: ref.current
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
|
|
1460
|
+
lastFocusedKey.current = manager.focusedKey;
|
|
1461
|
+
didAutoFocusRef.current = false;
|
|
1462
|
+
});
|
|
1463
|
+
useEffect(() => {
|
|
1464
|
+
return () => {
|
|
1465
|
+
if (raf.current) cancelAnimationFrame(raf.current);
|
|
1466
|
+
};
|
|
1467
|
+
}, []);
|
|
1468
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
|
|
1469
|
+
e.preventDefault();
|
|
1470
|
+
manager.setFocused(true);
|
|
1471
|
+
});
|
|
1472
|
+
let handlers = {
|
|
1473
|
+
onKeyDown,
|
|
1474
|
+
onFocus,
|
|
1475
|
+
onBlur,
|
|
1476
|
+
onMouseDown(e) {
|
|
1477
|
+
if (scrollRef.current === e.target)
|
|
1478
|
+
e.preventDefault();
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
let { typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
|
|
1482
|
+
keyboardDelegate: delegate,
|
|
1483
|
+
selectionManager: manager
|
|
1484
|
+
});
|
|
1485
|
+
if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
|
|
1486
|
+
let tabIndex = void 0;
|
|
1487
|
+
if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
|
|
1488
|
+
let collectionId = $feb5ffebff200149$export$881eb0d9f3605d9d(manager.collection);
|
|
1489
|
+
return {
|
|
1490
|
+
collectionProps: $3ef42575df84b30b$export$9d1611c77c2fe928(handlers, {
|
|
1491
|
+
tabIndex,
|
|
1492
|
+
"data-collection": collectionId
|
|
1493
|
+
})
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
1497
|
+
let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
|
|
1498
|
+
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
1499
|
+
id = $bdb11010cef70236$export$f680877a34711e37(id);
|
|
1500
|
+
let onSelect = (e) => {
|
|
1501
|
+
if (e.pointerType === "keyboard" && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
|
|
1502
|
+
else {
|
|
1503
|
+
if (manager.selectionMode === "none") return;
|
|
1504
|
+
if (manager.isLink(key)) {
|
|
1505
|
+
if (linkBehavior === "selection" && ref.current) {
|
|
1506
|
+
let itemProps2 = manager.getItemProps(key);
|
|
1507
|
+
router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
|
|
1508
|
+
manager.setSelectedKeys(manager.selectedKeys);
|
|
1509
|
+
return;
|
|
1510
|
+
} else if (linkBehavior === "override" || linkBehavior === "none") return;
|
|
1511
|
+
}
|
|
1512
|
+
if (manager.selectionMode === "single") {
|
|
1513
|
+
if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
|
|
1514
|
+
else manager.replaceSelection(key);
|
|
1515
|
+
} else if (e && e.shiftKey) manager.extendSelection(key);
|
|
1516
|
+
else if (manager.selectionBehavior === "toggle" || e && ($21f1aa98acb08317$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
|
|
1517
|
+
manager.toggleSelection(key);
|
|
1518
|
+
else manager.replaceSelection(key);
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
useEffect(() => {
|
|
1522
|
+
let isFocused = key === manager.focusedKey;
|
|
1523
|
+
if (isFocused && manager.isFocused) {
|
|
1524
|
+
if (!shouldUseVirtualFocus) {
|
|
1525
|
+
if (focus) focus();
|
|
1526
|
+
else if (document.activeElement !== ref.current && ref.current) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
|
|
1527
|
+
} else $55f9b1ae81f22853$export$76e4e37e5339496d(ref.current);
|
|
1528
|
+
}
|
|
1529
|
+
}, [
|
|
1530
|
+
ref,
|
|
1531
|
+
key,
|
|
1532
|
+
manager.focusedKey,
|
|
1533
|
+
manager.childFocusStrategy,
|
|
1534
|
+
manager.isFocused,
|
|
1535
|
+
shouldUseVirtualFocus
|
|
1536
|
+
]);
|
|
1537
|
+
isDisabled = isDisabled || manager.isDisabled(key);
|
|
1538
|
+
let itemProps = {};
|
|
1539
|
+
if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
|
|
1540
|
+
tabIndex: key === manager.focusedKey ? 0 : -1,
|
|
1541
|
+
onFocus(e) {
|
|
1542
|
+
if (e.target === ref.current) manager.setFocusedKey(key);
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
else if (isDisabled) itemProps.onMouseDown = (e) => {
|
|
1546
|
+
e.preventDefault();
|
|
1547
|
+
};
|
|
1548
|
+
let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
|
|
1549
|
+
let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
|
|
1550
|
+
let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
|
|
1551
|
+
let allowsActions = (onAction || hasLinkAction) && !isDisabled;
|
|
1552
|
+
let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
|
|
1553
|
+
let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
|
|
1554
|
+
let hasAction = hasPrimaryAction || hasSecondaryAction;
|
|
1555
|
+
let modality = useRef(null);
|
|
1556
|
+
let longPressEnabled = hasAction && allowsSelection;
|
|
1557
|
+
let longPressEnabledOnPressStart = useRef(false);
|
|
1558
|
+
let hadPrimaryActionOnPressStart = useRef(false);
|
|
1559
|
+
let performAction = (e) => {
|
|
1560
|
+
if (onAction) onAction();
|
|
1561
|
+
if (hasLinkAction && ref.current) {
|
|
1562
|
+
let itemProps2 = manager.getItemProps(key);
|
|
1563
|
+
router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
let itemPressProps = {
|
|
1567
|
+
ref
|
|
1568
|
+
};
|
|
1569
|
+
if (shouldSelectOnPressUp) {
|
|
1570
|
+
itemPressProps.onPressStart = (e) => {
|
|
1571
|
+
modality.current = e.pointerType;
|
|
1572
|
+
longPressEnabledOnPressStart.current = longPressEnabled;
|
|
1573
|
+
if (e.pointerType === "keyboard" && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
|
|
1574
|
+
};
|
|
1575
|
+
if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e) => {
|
|
1576
|
+
if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
|
|
1577
|
+
if (e.pointerType === "keyboard" && !$880e95eb8b93ba9a$var$isActionKey()) return;
|
|
1578
|
+
performAction(e);
|
|
1579
|
+
} else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
|
|
1580
|
+
};
|
|
1581
|
+
else {
|
|
1582
|
+
itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
|
|
1583
|
+
if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
|
|
1584
|
+
};
|
|
1585
|
+
itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
|
|
1586
|
+
if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
} else {
|
|
1590
|
+
itemPressProps.onPressStart = (e) => {
|
|
1591
|
+
modality.current = e.pointerType;
|
|
1592
|
+
longPressEnabledOnPressStart.current = longPressEnabled;
|
|
1593
|
+
hadPrimaryActionOnPressStart.current = hasPrimaryAction;
|
|
1594
|
+
if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey()))) onSelect(e);
|
|
1595
|
+
};
|
|
1596
|
+
itemPressProps.onPress = (e) => {
|
|
1597
|
+
if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
|
|
1598
|
+
if (hasAction) performAction(e);
|
|
1599
|
+
else if (allowsSelection) onSelect(e);
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
itemProps["data-collection"] = $feb5ffebff200149$export$6aeb1680a0ae8741(manager.collection);
|
|
1604
|
+
itemProps["data-key"] = key;
|
|
1605
|
+
itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
|
|
1606
|
+
if (shouldUseVirtualFocus) itemPressProps = $3ef42575df84b30b$export$9d1611c77c2fe928(itemPressProps, {
|
|
1607
|
+
onPressStart(e) {
|
|
1608
|
+
if (e.pointerType !== "touch") {
|
|
1609
|
+
manager.setFocused(true);
|
|
1610
|
+
manager.setFocusedKey(key);
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
onPress(e) {
|
|
1614
|
+
if (e.pointerType === "touch") {
|
|
1615
|
+
manager.setFocused(true);
|
|
1616
|
+
manager.setFocusedKey(key);
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21(itemPressProps);
|
|
1621
|
+
let onDoubleClick = hasSecondaryAction ? (e) => {
|
|
1622
|
+
if (modality.current === "mouse") {
|
|
1623
|
+
e.stopPropagation();
|
|
1624
|
+
e.preventDefault();
|
|
1625
|
+
performAction(e);
|
|
1626
|
+
}
|
|
1627
|
+
} : void 0;
|
|
1628
|
+
let { longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
|
|
1629
|
+
isDisabled: !longPressEnabled,
|
|
1630
|
+
onLongPress(e) {
|
|
1631
|
+
if (e.pointerType === "touch") {
|
|
1632
|
+
onSelect(e);
|
|
1633
|
+
manager.setSelectionBehavior("toggle");
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
let onDragStartCapture = (e) => {
|
|
1638
|
+
if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
|
|
1639
|
+
};
|
|
1640
|
+
let onClick = manager.isLink(key) ? (e) => {
|
|
1641
|
+
if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening) e.preventDefault();
|
|
1642
|
+
} : void 0;
|
|
1643
|
+
return {
|
|
1644
|
+
itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(
|
|
1645
|
+
itemProps,
|
|
1646
|
+
allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {},
|
|
1647
|
+
longPressEnabled ? longPressProps : {},
|
|
1648
|
+
{
|
|
1649
|
+
onDoubleClick,
|
|
1650
|
+
onDragStartCapture,
|
|
1651
|
+
onClick,
|
|
1652
|
+
id
|
|
1653
|
+
},
|
|
1654
|
+
// Prevent DOM focus from moving on mouse down when using virtual focus
|
|
1655
|
+
shouldUseVirtualFocus ? {
|
|
1656
|
+
onMouseDown: (e) => e.preventDefault()
|
|
1657
|
+
} : void 0
|
|
1658
|
+
),
|
|
1659
|
+
isPressed,
|
|
1660
|
+
isSelected: manager.isSelected(key),
|
|
1661
|
+
isFocused: manager.isFocused && manager.focusedKey === key,
|
|
1662
|
+
isDisabled,
|
|
1663
|
+
allowsSelection,
|
|
1664
|
+
hasAction
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
function $880e95eb8b93ba9a$var$isActionKey() {
|
|
1668
|
+
let event = window.event;
|
|
1669
|
+
return (event === null || event === void 0 ? void 0 : event.key) === "Enter";
|
|
1670
|
+
}
|
|
1671
|
+
function $880e95eb8b93ba9a$var$isSelectionKey() {
|
|
1672
|
+
let event = window.event;
|
|
1673
|
+
return (event === null || event === void 0 ? void 0 : event.key) === " " || (event === null || event === void 0 ? void 0 : event.code) === "Space";
|
|
1674
|
+
}
|
|
1675
|
+
class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
1676
|
+
build(props, context) {
|
|
1677
|
+
this.context = context;
|
|
1678
|
+
return $eb2240fc39a57fa5$var$iterable(() => this.iterateCollection(props));
|
|
1679
|
+
}
|
|
1680
|
+
*iterateCollection(props) {
|
|
1681
|
+
let { children, items } = props;
|
|
1682
|
+
if (React__default.isValidElement(children) && children.type === React__default.Fragment) yield* this.iterateCollection({
|
|
1683
|
+
children: children.props.children,
|
|
1684
|
+
items
|
|
1685
|
+
});
|
|
1686
|
+
else if (typeof children === "function") {
|
|
1687
|
+
if (!items) throw new Error("props.children was a function but props.items is missing");
|
|
1688
|
+
let index = 0;
|
|
1689
|
+
for (let item of items) {
|
|
1690
|
+
yield* this.getFullNode({
|
|
1691
|
+
value: item,
|
|
1692
|
+
index
|
|
1693
|
+
}, {
|
|
1694
|
+
renderer: children
|
|
1695
|
+
});
|
|
1696
|
+
index++;
|
|
1697
|
+
}
|
|
1698
|
+
} else {
|
|
1699
|
+
let items2 = [];
|
|
1700
|
+
React__default.Children.forEach(children, (child) => {
|
|
1701
|
+
if (child) items2.push(child);
|
|
1702
|
+
});
|
|
1703
|
+
let index = 0;
|
|
1704
|
+
for (let item of items2) {
|
|
1705
|
+
let nodes = this.getFullNode({
|
|
1706
|
+
element: item,
|
|
1707
|
+
index
|
|
1708
|
+
}, {});
|
|
1709
|
+
for (let node of nodes) {
|
|
1710
|
+
index++;
|
|
1711
|
+
yield node;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
getKey(item, partialNode, state, parentKey) {
|
|
1717
|
+
if (item.key != null) return item.key;
|
|
1718
|
+
if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
|
|
1719
|
+
let v = partialNode.value;
|
|
1720
|
+
if (v != null) {
|
|
1721
|
+
var _v_key;
|
|
1722
|
+
let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
|
|
1723
|
+
if (key == null) throw new Error("No key found for item");
|
|
1724
|
+
return key;
|
|
1725
|
+
}
|
|
1726
|
+
return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
|
|
1727
|
+
}
|
|
1728
|
+
getChildState(state, partialNode) {
|
|
1729
|
+
return {
|
|
1730
|
+
renderer: partialNode.renderer || state.renderer
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
*getFullNode(partialNode, state, parentKey, parentNode) {
|
|
1734
|
+
if (React__default.isValidElement(partialNode.element) && partialNode.element.type === React__default.Fragment) {
|
|
1735
|
+
let children = [];
|
|
1736
|
+
React__default.Children.forEach(partialNode.element.props.children, (child) => {
|
|
1737
|
+
children.push(child);
|
|
1738
|
+
});
|
|
1739
|
+
var _partialNode_index;
|
|
1740
|
+
let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !== void 0 ? _partialNode_index : 0;
|
|
1741
|
+
for (const child of children) yield* this.getFullNode({
|
|
1742
|
+
element: child,
|
|
1743
|
+
index: index++
|
|
1744
|
+
}, state, parentKey, parentNode);
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
let element = partialNode.element;
|
|
1748
|
+
if (!element && partialNode.value && state && state.renderer) {
|
|
1749
|
+
let cached = this.cache.get(partialNode.value);
|
|
1750
|
+
if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
|
|
1751
|
+
cached.index = partialNode.index;
|
|
1752
|
+
cached.parentKey = parentNode ? parentNode.key : null;
|
|
1753
|
+
yield cached;
|
|
1754
|
+
return;
|
|
1755
|
+
}
|
|
1756
|
+
element = state.renderer(partialNode.value);
|
|
1757
|
+
}
|
|
1758
|
+
if (React__default.isValidElement(element)) {
|
|
1759
|
+
let type = element.type;
|
|
1760
|
+
if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
|
|
1761
|
+
let name = element.type;
|
|
1762
|
+
throw new Error(`Unknown element <${name}> in collection.`);
|
|
1763
|
+
}
|
|
1764
|
+
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
1765
|
+
var _partialNode_index1;
|
|
1766
|
+
let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !== void 0 ? _partialNode_index1 : 0;
|
|
1767
|
+
let result = childNodes.next();
|
|
1768
|
+
while (!result.done && result.value) {
|
|
1769
|
+
let childNode = result.value;
|
|
1770
|
+
partialNode.index = index;
|
|
1771
|
+
var _childNode_key;
|
|
1772
|
+
let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !== void 0 ? _childNode_key : null;
|
|
1773
|
+
if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
|
|
1774
|
+
let nodes = this.getFullNode({
|
|
1775
|
+
...childNode,
|
|
1776
|
+
key: nodeKey,
|
|
1777
|
+
index,
|
|
1778
|
+
wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
|
|
1779
|
+
}, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
|
|
1780
|
+
let children = [
|
|
1781
|
+
...nodes
|
|
1782
|
+
];
|
|
1783
|
+
for (let node2 of children) {
|
|
1784
|
+
var _childNode_value, _ref;
|
|
1785
|
+
node2.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !== void 0 ? _childNode_value : partialNode.value) !== null && _ref !== void 0 ? _ref : null;
|
|
1786
|
+
if (node2.value) this.cache.set(node2.value, node2);
|
|
1787
|
+
var _parentNode_type;
|
|
1788
|
+
if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node2.type)}> in <${$eb2240fc39a57fa5$var$capitalize((_parentNode_type = parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) !== null && _parentNode_type !== void 0 ? _parentNode_type : "unknown parent type")}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
|
|
1789
|
+
index++;
|
|
1790
|
+
yield node2;
|
|
1791
|
+
}
|
|
1792
|
+
result = childNodes.next(children);
|
|
1793
|
+
}
|
|
1794
|
+
return;
|
|
1795
|
+
}
|
|
1796
|
+
if (partialNode.key == null || partialNode.type == null) return;
|
|
1797
|
+
let builder = this;
|
|
1798
|
+
var _partialNode_value, _partialNode_textValue;
|
|
1799
|
+
let node = {
|
|
1800
|
+
type: partialNode.type,
|
|
1801
|
+
props: partialNode.props,
|
|
1802
|
+
key: partialNode.key,
|
|
1803
|
+
parentKey: parentNode ? parentNode.key : null,
|
|
1804
|
+
value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !== void 0 ? _partialNode_value : null,
|
|
1805
|
+
level: parentNode ? parentNode.level + 1 : 0,
|
|
1806
|
+
index: partialNode.index,
|
|
1807
|
+
rendered: partialNode.rendered,
|
|
1808
|
+
textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !== void 0 ? _partialNode_textValue : "",
|
|
1809
|
+
"aria-label": partialNode["aria-label"],
|
|
1810
|
+
wrapper: partialNode.wrapper,
|
|
1811
|
+
shouldInvalidate: partialNode.shouldInvalidate,
|
|
1812
|
+
hasChildNodes: partialNode.hasChildNodes || false,
|
|
1813
|
+
childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
|
|
1814
|
+
if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
|
|
1815
|
+
let index = 0;
|
|
1816
|
+
for (let child of partialNode.childNodes()) {
|
|
1817
|
+
if (child.key != null)
|
|
1818
|
+
child.key = `${node.key}${child.key}`;
|
|
1819
|
+
let nodes = builder.getFullNode({
|
|
1820
|
+
...child,
|
|
1821
|
+
index
|
|
1822
|
+
}, builder.getChildState(state, child), node.key, node);
|
|
1823
|
+
for (let node2 of nodes) {
|
|
1824
|
+
index++;
|
|
1825
|
+
yield node2;
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
})
|
|
1829
|
+
};
|
|
1830
|
+
yield node;
|
|
1831
|
+
}
|
|
1832
|
+
constructor() {
|
|
1833
|
+
this.cache = /* @__PURE__ */ new WeakMap();
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
function $eb2240fc39a57fa5$var$iterable(iterator) {
|
|
1837
|
+
let cache = [];
|
|
1838
|
+
let iterable = null;
|
|
1839
|
+
return {
|
|
1840
|
+
*[Symbol.iterator]() {
|
|
1841
|
+
for (let item of cache) yield item;
|
|
1842
|
+
if (!iterable) iterable = iterator();
|
|
1843
|
+
for (let item of iterable) {
|
|
1844
|
+
cache.push(item);
|
|
1845
|
+
yield item;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
}
|
|
1850
|
+
function $eb2240fc39a57fa5$var$compose(outer, inner) {
|
|
1851
|
+
if (outer && inner) return (element) => outer(inner(element));
|
|
1852
|
+
if (outer) return outer;
|
|
1853
|
+
if (inner) return inner;
|
|
1854
|
+
}
|
|
1855
|
+
function $eb2240fc39a57fa5$var$capitalize(str) {
|
|
1856
|
+
return str[0].toUpperCase() + str.slice(1);
|
|
1857
|
+
}
|
|
1858
|
+
function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context) {
|
|
1859
|
+
let builder = useMemo(() => new $eb2240fc39a57fa5$export$bf788dd355e3a401(), []);
|
|
1860
|
+
let { children, items, collection } = props;
|
|
1861
|
+
let result = useMemo(() => {
|
|
1862
|
+
if (collection) return collection;
|
|
1863
|
+
let nodes = builder.build({
|
|
1864
|
+
children,
|
|
1865
|
+
items
|
|
1866
|
+
}, context);
|
|
1867
|
+
return factory(nodes);
|
|
1868
|
+
}, [
|
|
1869
|
+
builder,
|
|
1870
|
+
children,
|
|
1871
|
+
items,
|
|
1872
|
+
collection,
|
|
1873
|
+
context,
|
|
1874
|
+
factory
|
|
1875
|
+
]);
|
|
1876
|
+
return result;
|
|
1877
|
+
}
|
|
1878
|
+
function $c5a24bc478652b5f$export$1005530eda016c13(node, collection) {
|
|
1879
|
+
if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
|
|
1880
|
+
return node.childNodes;
|
|
1881
|
+
}
|
|
1882
|
+
function $c5a24bc478652b5f$export$fbdeaa6a76694f71(iterable) {
|
|
1883
|
+
return $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable);
|
|
1884
|
+
}
|
|
1885
|
+
function $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, index) {
|
|
1886
|
+
for (let item of iterable) {
|
|
1887
|
+
return item;
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
|
|
1891
|
+
if (a.parentKey === b.parentKey) return a.index - b.index;
|
|
1892
|
+
let aAncestors = [
|
|
1893
|
+
...$c5a24bc478652b5f$var$getAncestors(collection, a),
|
|
1894
|
+
a
|
|
1895
|
+
];
|
|
1896
|
+
let bAncestors = [
|
|
1897
|
+
...$c5a24bc478652b5f$var$getAncestors(collection, b),
|
|
1898
|
+
b
|
|
1899
|
+
];
|
|
1900
|
+
let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
|
|
1901
|
+
if (firstNonMatchingAncestor !== -1) {
|
|
1902
|
+
a = aAncestors[firstNonMatchingAncestor];
|
|
1903
|
+
b = bAncestors[firstNonMatchingAncestor];
|
|
1904
|
+
return a.index - b.index;
|
|
1905
|
+
}
|
|
1906
|
+
if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
|
|
1907
|
+
else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
|
|
1908
|
+
return -1;
|
|
1909
|
+
}
|
|
1910
|
+
function $c5a24bc478652b5f$var$getAncestors(collection, node) {
|
|
1911
|
+
let parents = [];
|
|
1912
|
+
let currNode = node;
|
|
1913
|
+
while ((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null) {
|
|
1914
|
+
currNode = collection.getItem(currNode.parentKey);
|
|
1915
|
+
if (currNode) parents.unshift(currNode);
|
|
1916
|
+
}
|
|
1917
|
+
return parents;
|
|
1918
|
+
}
|
|
1919
|
+
class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
|
|
1920
|
+
constructor(keys, anchorKey, currentKey) {
|
|
1921
|
+
super(keys);
|
|
1922
|
+
if (keys instanceof $e40ea825a81a3709$export$52baac22726c72bf) {
|
|
1923
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : keys.anchorKey;
|
|
1924
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : keys.currentKey;
|
|
1925
|
+
} else {
|
|
1926
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : null;
|
|
1927
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : null;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
|
|
1932
|
+
if (setA.size !== setB.size) return false;
|
|
1933
|
+
for (let item of setA) {
|
|
1934
|
+
if (!setB.has(item)) return false;
|
|
1935
|
+
}
|
|
1936
|
+
return true;
|
|
1937
|
+
}
|
|
1938
|
+
function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
|
|
1939
|
+
let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
|
|
1940
|
+
let isFocusedRef = useRef(false);
|
|
1941
|
+
let [, setFocused] = useState(false);
|
|
1942
|
+
let focusedKeyRef = useRef(null);
|
|
1943
|
+
let childFocusStrategyRef = useRef(null);
|
|
1944
|
+
let [, setFocusedKey] = useState(null);
|
|
1945
|
+
let selectedKeysProp = useMemo(() => $7af3f5b51489e0b5$var$convertSelection(props.selectedKeys), [
|
|
1946
|
+
props.selectedKeys
|
|
1947
|
+
]);
|
|
1948
|
+
let defaultSelectedKeys = useMemo(() => $7af3f5b51489e0b5$var$convertSelection(props.defaultSelectedKeys, new $e40ea825a81a3709$export$52baac22726c72bf()), [
|
|
1949
|
+
props.defaultSelectedKeys
|
|
1950
|
+
]);
|
|
1951
|
+
let [selectedKeys, setSelectedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
|
|
1952
|
+
let disabledKeysProp = useMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
1953
|
+
props.disabledKeys
|
|
1954
|
+
]);
|
|
1955
|
+
let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);
|
|
1956
|
+
if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0) setSelectionBehavior("replace");
|
|
1957
|
+
let lastSelectionBehavior = useRef(selectionBehaviorProp);
|
|
1958
|
+
useEffect(() => {
|
|
1959
|
+
if (selectionBehaviorProp !== lastSelectionBehavior.current) {
|
|
1960
|
+
setSelectionBehavior(selectionBehaviorProp);
|
|
1961
|
+
lastSelectionBehavior.current = selectionBehaviorProp;
|
|
1962
|
+
}
|
|
1963
|
+
}, [
|
|
1964
|
+
selectionBehaviorProp
|
|
1965
|
+
]);
|
|
1966
|
+
return {
|
|
1967
|
+
selectionMode,
|
|
1968
|
+
disallowEmptySelection,
|
|
1969
|
+
selectionBehavior,
|
|
1970
|
+
setSelectionBehavior,
|
|
1971
|
+
get isFocused() {
|
|
1972
|
+
return isFocusedRef.current;
|
|
1973
|
+
},
|
|
1974
|
+
setFocused(f) {
|
|
1975
|
+
isFocusedRef.current = f;
|
|
1976
|
+
setFocused(f);
|
|
1977
|
+
},
|
|
1978
|
+
get focusedKey() {
|
|
1979
|
+
return focusedKeyRef.current;
|
|
1980
|
+
},
|
|
1981
|
+
get childFocusStrategy() {
|
|
1982
|
+
return childFocusStrategyRef.current;
|
|
1983
|
+
},
|
|
1984
|
+
setFocusedKey(k, childFocusStrategy = "first") {
|
|
1985
|
+
focusedKeyRef.current = k;
|
|
1986
|
+
childFocusStrategyRef.current = childFocusStrategy;
|
|
1987
|
+
setFocusedKey(k);
|
|
1988
|
+
},
|
|
1989
|
+
selectedKeys,
|
|
1990
|
+
setSelectedKeys(keys) {
|
|
1991
|
+
if (allowDuplicateSelectionEvents || !$7af3f5b51489e0b5$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
|
|
1992
|
+
},
|
|
1993
|
+
disabledKeys: disabledKeysProp,
|
|
1994
|
+
disabledBehavior
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
function $7af3f5b51489e0b5$var$convertSelection(selection, defaultValue) {
|
|
1998
|
+
if (!selection) return defaultValue;
|
|
1999
|
+
return selection === "all" ? "all" : new $e40ea825a81a3709$export$52baac22726c72bf(selection);
|
|
2000
|
+
}
|
|
2001
|
+
class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
2002
|
+
/**
|
|
2003
|
+
* The type of selection that is allowed in the collection.
|
|
2004
|
+
*/
|
|
2005
|
+
get selectionMode() {
|
|
2006
|
+
return this.state.selectionMode;
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether the collection allows empty selection.
|
|
2010
|
+
*/
|
|
2011
|
+
get disallowEmptySelection() {
|
|
2012
|
+
return this.state.disallowEmptySelection;
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* The selection behavior for the collection.
|
|
2016
|
+
*/
|
|
2017
|
+
get selectionBehavior() {
|
|
2018
|
+
return this.state.selectionBehavior;
|
|
2019
|
+
}
|
|
2020
|
+
/**
|
|
2021
|
+
* Sets the selection behavior for the collection.
|
|
2022
|
+
*/
|
|
2023
|
+
setSelectionBehavior(selectionBehavior) {
|
|
2024
|
+
this.state.setSelectionBehavior(selectionBehavior);
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Whether the collection is currently focused.
|
|
2028
|
+
*/
|
|
2029
|
+
get isFocused() {
|
|
2030
|
+
return this.state.isFocused;
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Sets whether the collection is focused.
|
|
2034
|
+
*/
|
|
2035
|
+
setFocused(isFocused) {
|
|
2036
|
+
this.state.setFocused(isFocused);
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* The current focused key in the collection.
|
|
2040
|
+
*/
|
|
2041
|
+
get focusedKey() {
|
|
2042
|
+
return this.state.focusedKey;
|
|
2043
|
+
}
|
|
2044
|
+
/** Whether the first or last child of the focused key should receive focus. */
|
|
2045
|
+
get childFocusStrategy() {
|
|
2046
|
+
return this.state.childFocusStrategy;
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* Sets the focused key.
|
|
2050
|
+
*/
|
|
2051
|
+
setFocusedKey(key, childFocusStrategy) {
|
|
2052
|
+
if (key == null || this.collection.getItem(key)) this.state.setFocusedKey(key, childFocusStrategy);
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* The currently selected keys in the collection.
|
|
2056
|
+
*/
|
|
2057
|
+
get selectedKeys() {
|
|
2058
|
+
return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* The raw selection value for the collection.
|
|
2062
|
+
* Either 'all' for select all, or a set of keys.
|
|
2063
|
+
*/
|
|
2064
|
+
get rawSelection() {
|
|
2065
|
+
return this.state.selectedKeys;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Returns whether a key is selected.
|
|
2069
|
+
*/
|
|
2070
|
+
isSelected(key) {
|
|
2071
|
+
if (this.state.selectionMode === "none") return false;
|
|
2072
|
+
let mappedKey = this.getKey(key);
|
|
2073
|
+
if (mappedKey == null) return false;
|
|
2074
|
+
return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Whether the selection is empty.
|
|
2078
|
+
*/
|
|
2079
|
+
get isEmpty() {
|
|
2080
|
+
return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Whether all items in the collection are selected.
|
|
2084
|
+
*/
|
|
2085
|
+
get isSelectAll() {
|
|
2086
|
+
if (this.isEmpty) return false;
|
|
2087
|
+
if (this.state.selectedKeys === "all") return true;
|
|
2088
|
+
if (this._isSelectAll != null) return this._isSelectAll;
|
|
2089
|
+
let allKeys = this.getSelectAllKeys();
|
|
2090
|
+
let selectedKeys = this.state.selectedKeys;
|
|
2091
|
+
this._isSelectAll = allKeys.every((k) => selectedKeys.has(k));
|
|
2092
|
+
return this._isSelectAll;
|
|
2093
|
+
}
|
|
2094
|
+
get firstSelectedKey() {
|
|
2095
|
+
let first = null;
|
|
2096
|
+
for (let key of this.state.selectedKeys) {
|
|
2097
|
+
let item = this.collection.getItem(key);
|
|
2098
|
+
if (!first || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
|
|
2099
|
+
}
|
|
2100
|
+
var _first_key;
|
|
2101
|
+
return (_first_key = first === null || first === void 0 ? void 0 : first.key) !== null && _first_key !== void 0 ? _first_key : null;
|
|
2102
|
+
}
|
|
2103
|
+
get lastSelectedKey() {
|
|
2104
|
+
let last = null;
|
|
2105
|
+
for (let key of this.state.selectedKeys) {
|
|
2106
|
+
let item = this.collection.getItem(key);
|
|
2107
|
+
if (!last || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
|
|
2108
|
+
}
|
|
2109
|
+
var _last_key;
|
|
2110
|
+
return (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
|
|
2111
|
+
}
|
|
2112
|
+
get disabledKeys() {
|
|
2113
|
+
return this.state.disabledKeys;
|
|
2114
|
+
}
|
|
2115
|
+
get disabledBehavior() {
|
|
2116
|
+
return this.state.disabledBehavior;
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Extends the selection to the given key.
|
|
2120
|
+
*/
|
|
2121
|
+
extendSelection(toKey) {
|
|
2122
|
+
if (this.selectionMode === "none") return;
|
|
2123
|
+
if (this.selectionMode === "single") {
|
|
2124
|
+
this.replaceSelection(toKey);
|
|
2125
|
+
return;
|
|
2126
|
+
}
|
|
2127
|
+
let mappedToKey = this.getKey(toKey);
|
|
2128
|
+
if (mappedToKey == null) return;
|
|
2129
|
+
let selection;
|
|
2130
|
+
if (this.state.selectedKeys === "all") selection = new $e40ea825a81a3709$export$52baac22726c72bf([
|
|
2131
|
+
mappedToKey
|
|
2132
|
+
], mappedToKey, mappedToKey);
|
|
2133
|
+
else {
|
|
2134
|
+
let selectedKeys = this.state.selectedKeys;
|
|
2135
|
+
var _selectedKeys_anchorKey;
|
|
2136
|
+
let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : mappedToKey;
|
|
2137
|
+
selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
|
|
2138
|
+
var _selectedKeys_currentKey;
|
|
2139
|
+
for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : mappedToKey)) selection.delete(key);
|
|
2140
|
+
for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
|
|
2141
|
+
}
|
|
2142
|
+
this.state.setSelectedKeys(selection);
|
|
2143
|
+
}
|
|
2144
|
+
getKeyRange(from, to) {
|
|
2145
|
+
let fromItem = this.collection.getItem(from);
|
|
2146
|
+
let toItem = this.collection.getItem(to);
|
|
2147
|
+
if (fromItem && toItem) {
|
|
2148
|
+
if ($c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
|
|
2149
|
+
return this.getKeyRangeInternal(to, from);
|
|
2150
|
+
}
|
|
2151
|
+
return [];
|
|
2152
|
+
}
|
|
2153
|
+
getKeyRangeInternal(from, to) {
|
|
2154
|
+
var _this_layoutDelegate;
|
|
2155
|
+
if ((_this_layoutDelegate = this.layoutDelegate) === null || _this_layoutDelegate === void 0 ? void 0 : _this_layoutDelegate.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
|
|
2156
|
+
let keys = [];
|
|
2157
|
+
let key = from;
|
|
2158
|
+
while (key != null) {
|
|
2159
|
+
let item = this.collection.getItem(key);
|
|
2160
|
+
if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
|
|
2161
|
+
if (key === to) return keys;
|
|
2162
|
+
key = this.collection.getKeyAfter(key);
|
|
2163
|
+
}
|
|
2164
|
+
return [];
|
|
2165
|
+
}
|
|
2166
|
+
getKey(key) {
|
|
2167
|
+
let item = this.collection.getItem(key);
|
|
2168
|
+
if (!item)
|
|
2169
|
+
return key;
|
|
2170
|
+
if (item.type === "cell" && this.allowsCellSelection) return key;
|
|
2171
|
+
while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
|
|
2172
|
+
if (!item || item.type !== "item") return null;
|
|
2173
|
+
return item.key;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Toggles whether the given key is selected.
|
|
2177
|
+
*/
|
|
2178
|
+
toggleSelection(key) {
|
|
2179
|
+
if (this.selectionMode === "none") return;
|
|
2180
|
+
if (this.selectionMode === "single" && !this.isSelected(key)) {
|
|
2181
|
+
this.replaceSelection(key);
|
|
2182
|
+
return;
|
|
2183
|
+
}
|
|
2184
|
+
let mappedKey = this.getKey(key);
|
|
2185
|
+
if (mappedKey == null) return;
|
|
2186
|
+
let keys = new $e40ea825a81a3709$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
|
|
2187
|
+
if (keys.has(mappedKey)) keys.delete(mappedKey);
|
|
2188
|
+
else if (this.canSelectItem(mappedKey)) {
|
|
2189
|
+
keys.add(mappedKey);
|
|
2190
|
+
keys.anchorKey = mappedKey;
|
|
2191
|
+
keys.currentKey = mappedKey;
|
|
2192
|
+
}
|
|
2193
|
+
if (this.disallowEmptySelection && keys.size === 0) return;
|
|
2194
|
+
this.state.setSelectedKeys(keys);
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Replaces the selection with only the given key.
|
|
2198
|
+
*/
|
|
2199
|
+
replaceSelection(key) {
|
|
2200
|
+
if (this.selectionMode === "none") return;
|
|
2201
|
+
let mappedKey = this.getKey(key);
|
|
2202
|
+
if (mappedKey == null) return;
|
|
2203
|
+
let selection = this.canSelectItem(mappedKey) ? new $e40ea825a81a3709$export$52baac22726c72bf([
|
|
2204
|
+
mappedKey
|
|
2205
|
+
], mappedKey, mappedKey) : new $e40ea825a81a3709$export$52baac22726c72bf();
|
|
2206
|
+
this.state.setSelectedKeys(selection);
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* Replaces the selection with the given keys.
|
|
2210
|
+
*/
|
|
2211
|
+
setSelectedKeys(keys) {
|
|
2212
|
+
if (this.selectionMode === "none") return;
|
|
2213
|
+
let selection = new $e40ea825a81a3709$export$52baac22726c72bf();
|
|
2214
|
+
for (let key of keys) {
|
|
2215
|
+
let mappedKey = this.getKey(key);
|
|
2216
|
+
if (mappedKey != null) {
|
|
2217
|
+
selection.add(mappedKey);
|
|
2218
|
+
if (this.selectionMode === "single") break;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
this.state.setSelectedKeys(selection);
|
|
2222
|
+
}
|
|
2223
|
+
getSelectAllKeys() {
|
|
2224
|
+
let keys = [];
|
|
2225
|
+
let addKeys = (key) => {
|
|
2226
|
+
while (key != null) {
|
|
2227
|
+
if (this.canSelectItem(key)) {
|
|
2228
|
+
var _getFirstItem;
|
|
2229
|
+
let item = this.collection.getItem(key);
|
|
2230
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === "item") keys.push(key);
|
|
2231
|
+
var _getFirstItem_key;
|
|
2232
|
+
if ((item === null || item === void 0 ? void 0 : item.hasChildNodes) && (this.allowsCellSelection || item.type !== "item")) addKeys((_getFirstItem_key = (_getFirstItem = $c5a24bc478652b5f$export$fbdeaa6a76694f71($c5a24bc478652b5f$export$1005530eda016c13(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null);
|
|
2233
|
+
}
|
|
2234
|
+
key = this.collection.getKeyAfter(key);
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
addKeys(this.collection.getFirstKey());
|
|
2238
|
+
return keys;
|
|
2239
|
+
}
|
|
2240
|
+
/**
|
|
2241
|
+
* Selects all items in the collection.
|
|
2242
|
+
*/
|
|
2243
|
+
selectAll() {
|
|
2244
|
+
if (!this.isSelectAll && this.selectionMode === "multiple") this.state.setSelectedKeys("all");
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Removes all keys from the selection.
|
|
2248
|
+
*/
|
|
2249
|
+
clearSelection() {
|
|
2250
|
+
if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $e40ea825a81a3709$export$52baac22726c72bf());
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Toggles between select all and an empty selection.
|
|
2254
|
+
*/
|
|
2255
|
+
toggleSelectAll() {
|
|
2256
|
+
if (this.isSelectAll) this.clearSelection();
|
|
2257
|
+
else this.selectAll();
|
|
2258
|
+
}
|
|
2259
|
+
select(key, e) {
|
|
2260
|
+
if (this.selectionMode === "none") return;
|
|
2261
|
+
if (this.selectionMode === "single") {
|
|
2262
|
+
if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
|
|
2263
|
+
else this.replaceSelection(key);
|
|
2264
|
+
} else if (this.selectionBehavior === "toggle" || e && (e.pointerType === "touch" || e.pointerType === "virtual"))
|
|
2265
|
+
this.toggleSelection(key);
|
|
2266
|
+
else this.replaceSelection(key);
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Returns whether the current selection is equal to the given selection.
|
|
2270
|
+
*/
|
|
2271
|
+
isSelectionEqual(selection) {
|
|
2272
|
+
if (selection === this.state.selectedKeys) return true;
|
|
2273
|
+
let selectedKeys = this.selectedKeys;
|
|
2274
|
+
if (selection.size !== selectedKeys.size) return false;
|
|
2275
|
+
for (let key of selection) {
|
|
2276
|
+
if (!selectedKeys.has(key)) return false;
|
|
2277
|
+
}
|
|
2278
|
+
for (let key of selectedKeys) {
|
|
2279
|
+
if (!selection.has(key)) return false;
|
|
2280
|
+
}
|
|
2281
|
+
return true;
|
|
2282
|
+
}
|
|
2283
|
+
canSelectItem(key) {
|
|
2284
|
+
var _item_props;
|
|
2285
|
+
if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false;
|
|
2286
|
+
let item = this.collection.getItem(key);
|
|
2287
|
+
if (!item || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || item.type === "cell" && !this.allowsCellSelection) return false;
|
|
2288
|
+
return true;
|
|
2289
|
+
}
|
|
2290
|
+
isDisabled(key) {
|
|
2291
|
+
var _this_collection_getItem_props, _this_collection_getItem;
|
|
2292
|
+
return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.isDisabled));
|
|
2293
|
+
}
|
|
2294
|
+
isLink(key) {
|
|
2295
|
+
var _this_collection_getItem_props, _this_collection_getItem;
|
|
2296
|
+
return !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.href);
|
|
2297
|
+
}
|
|
2298
|
+
getItemProps(key) {
|
|
2299
|
+
var _this_collection_getItem;
|
|
2300
|
+
return (_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : _this_collection_getItem.props;
|
|
2301
|
+
}
|
|
2302
|
+
withCollection(collection) {
|
|
2303
|
+
return new $d496c0a20b6e58ec$export$6c8a5aaad13c9852(collection, this.state, {
|
|
2304
|
+
allowsCellSelection: this.allowsCellSelection,
|
|
2305
|
+
layoutDelegate: this.layoutDelegate || void 0
|
|
2306
|
+
});
|
|
2307
|
+
}
|
|
2308
|
+
constructor(collection, state, options) {
|
|
2309
|
+
this.collection = collection;
|
|
2310
|
+
this.state = state;
|
|
2311
|
+
var _options_allowsCellSelection;
|
|
2312
|
+
this.allowsCellSelection = (_options_allowsCellSelection = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && _options_allowsCellSelection !== void 0 ? _options_allowsCellSelection : false;
|
|
2313
|
+
this._isSelectAll = null;
|
|
2314
|
+
this.layoutDelegate = (options === null || options === void 0 ? void 0 : options.layoutDelegate) || null;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
const $7135fc7d473fd974$export$d40e14dec8b060a8 = /* @__PURE__ */ createContext(null);
|
|
2318
|
+
const $7135fc7d473fd974$export$a164736487e3f0ae = {
|
|
2319
|
+
CollectionRoot({ collection, renderDropIndicator }) {
|
|
2320
|
+
return $7135fc7d473fd974$var$useCollectionRender(collection, null, renderDropIndicator);
|
|
2321
|
+
},
|
|
2322
|
+
CollectionBranch({ collection, parent, renderDropIndicator }) {
|
|
2323
|
+
return $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator);
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator) {
|
|
2327
|
+
return $e948873055cbafe4$export$727c8fc270210f13({
|
|
2328
|
+
items: parent ? collection.getChildren(parent.key) : collection,
|
|
2329
|
+
dependencies: [
|
|
2330
|
+
renderDropIndicator
|
|
2331
|
+
],
|
|
2332
|
+
children(node) {
|
|
2333
|
+
let rendered = node.render(node);
|
|
2334
|
+
if (!renderDropIndicator || node.type !== "item") return rendered;
|
|
2335
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDropIndicator({
|
|
2336
|
+
type: "item",
|
|
2337
|
+
key: node.key,
|
|
2338
|
+
dropPosition: "before"
|
|
2339
|
+
}), rendered, $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropIndicator));
|
|
2340
|
+
}
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropIndicator) {
|
|
2344
|
+
let key = node.key;
|
|
2345
|
+
let keyAfter = collection.getKeyAfter(key);
|
|
2346
|
+
let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
|
|
2347
|
+
while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== "item") {
|
|
2348
|
+
keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
|
|
2349
|
+
nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
|
|
2350
|
+
}
|
|
2351
|
+
let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
|
|
2352
|
+
while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
|
|
2353
|
+
let afterIndicators = [];
|
|
2354
|
+
if (nextItemInSameLevel == null) {
|
|
2355
|
+
let current = node;
|
|
2356
|
+
while (current && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
|
|
2357
|
+
let indicator = renderDropIndicator({
|
|
2358
|
+
type: "item",
|
|
2359
|
+
key: current.key,
|
|
2360
|
+
dropPosition: "after"
|
|
2361
|
+
});
|
|
2362
|
+
if (/* @__PURE__ */ isValidElement(indicator)) afterIndicators.push(/* @__PURE__ */ cloneElement(indicator, {
|
|
2363
|
+
key: `${current.key}-after`
|
|
2364
|
+
}));
|
|
2365
|
+
current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
return afterIndicators;
|
|
2369
|
+
}
|
|
2370
|
+
const $7135fc7d473fd974$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($7135fc7d473fd974$export$a164736487e3f0ae);
|
|
2371
|
+
function $7135fc7d473fd974$export$90e00781bc59d8f9(focusedKey) {
|
|
2372
|
+
return useMemo(() => focusedKey != null ? /* @__PURE__ */ new Set([
|
|
2373
|
+
focusedKey
|
|
2374
|
+
]) : null, [
|
|
2375
|
+
focusedKey
|
|
2376
|
+
]);
|
|
2377
|
+
}
|
|
2378
|
+
export {
|
|
2379
|
+
$7af3f5b51489e0b5$export$253fe78d46329472 as $,
|
|
2380
|
+
$7613b1592d41b092$export$6cd28814d92fa9c9 as a,
|
|
2381
|
+
$d496c0a20b6e58ec$export$6c8a5aaad13c9852 as b,
|
|
2382
|
+
$880e95eb8b93ba9a$export$ecf600387e221c37 as c,
|
|
2383
|
+
$e1995378a142960e$export$18af5c7a9e9b3664 as d,
|
|
2384
|
+
$e1995378a142960e$export$bf788dd355e3a401 as e,
|
|
2385
|
+
$e1995378a142960e$export$fb8073518f34e6ec as f,
|
|
2386
|
+
$7135fc7d473fd974$export$4feb769f8ddf26c5 as g,
|
|
2387
|
+
$7135fc7d473fd974$export$d40e14dec8b060a8 as h,
|
|
2388
|
+
$ae20dd8cbca75726$export$d6daf82dcd84e87c as i,
|
|
2389
|
+
$7135fc7d473fd974$export$a164736487e3f0ae as j,
|
|
2390
|
+
$7135fc7d473fd974$export$90e00781bc59d8f9 as k,
|
|
2391
|
+
$cc38e7bd3fc7b213$export$2bb74740c4e19def as l,
|
|
2392
|
+
$feb5ffebff200149$export$c3d8340acf92597f as m,
|
|
2393
|
+
$c5a24bc478652b5f$export$1005530eda016c13 as n,
|
|
2394
|
+
$fb3050f43d946246$export$e32c88dfddc6e1d8 as o,
|
|
2395
|
+
$55f9b1ae81f22853$export$2b35b76d2e30e129 as p,
|
|
2396
|
+
$8a26561d2877236e$export$c24ed0104d07eab9 as q,
|
|
2397
|
+
$e1995378a142960e$export$e953bb1cd0f19726 as r
|
|
2398
|
+
};
|