@eightshift/ui-components 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -7
- package/dist/{Button-BMFbEXg1.js → Button-OQ5EIPvt.js} +8 -8
- package/dist/{SelectionManager-D-89MUJW.js → Collection-CJM_asJz.js} +345 -197
- package/dist/{Color-B-cqXgPz.js → Color-B0HgM8f4.js} +1 -1
- package/dist/{ColorSwatch-B6s54Jb3.js → ColorSwatch-Dv3Wxdl_.js} +6 -7
- package/dist/{ComboBox-VR9-vNZv.js → ComboBox-BnlZjJ3T.js} +21 -22
- package/dist/{Dialog-BlYTPzgB.js → Dialog-CIh-hX93.js} +77 -65
- package/dist/{FieldError-DKicm3R0.js → FieldError-D7A6s7O5.js} +2 -2
- package/dist/{FocusScope-EoLYfbMp.js → FocusScope-Cs5_OoeA.js} +6 -4
- package/dist/{Group-D96edUPC.js → Group-D6tr3U_n.js} +5 -6
- package/dist/{Heading-GytTjUsy.js → Heading-DiYTXoIW.js} +3 -4
- package/dist/{Hidden-D3hHnmPI.js → Hidden-DnOd_jPX.js} +2 -2
- package/dist/{Input-BXSxJ_44.js → Input-Se0m3ubj.js} +13 -11
- package/dist/{Label-BtoiUpt8.js → Label-Ca9uelsn.js} +4 -5
- package/dist/{List-Ct3nzFZG.js → List-Br274SP1.js} +16 -8
- package/dist/{ListBox-BMpo-Cem.js → ListBox-D9dFEh5A.js} +36 -23
- package/dist/{OverlayArrow-4epQ99-E.js → OverlayArrow-1jx-ZyCR.js} +75 -13
- package/dist/{Select-aab027f3.esm-C7BxKjSc.js → Select-aab027f3.esm-HFNIFFya.js} +4 -4
- package/dist/{Separator-DUhFmbD-.js → Separator-BhZycTUp.js} +9 -7
- package/dist/{Slider-QNPrj4N9.js → Slider-BZNaJylD.js} +20 -24
- package/dist/{Text-DNDWaukZ.js → Text-aOUPPvTO.js} +3 -4
- package/dist/{VisuallyHidden-BHNhi-ls.js → VisuallyHidden-ClTQo25k.js} +2 -2
- package/dist/assets/index.css +37 -0
- package/dist/assets/style-editor.css +5287 -0
- package/dist/assets/style.css +5293 -1
- package/dist/assets/wp-font-enhancements.css +8 -1
- package/dist/assets/wp-ui-enhancements.css +299 -1
- package/dist/components/animated-visibility/animated-visibility.js +17 -21
- package/dist/components/base-control/base-control.js +7 -7
- package/dist/components/breakpoint-preview/breakpoint-preview.js +50 -50
- package/dist/components/button/button.js +190 -86
- package/dist/components/checkbox/checkbox.js +44 -27
- package/dist/components/color-pickers/color-picker.js +13 -9
- package/dist/components/color-pickers/color-swatch.js +4 -4
- package/dist/components/color-pickers/gradient-editor.js +25 -24
- package/dist/components/color-pickers/solid-color-picker.js +197 -229
- package/dist/components/component-toggle/component-toggle.js +3 -3
- package/dist/components/container-panel/container-panel.js +17 -17
- package/dist/components/draggable/draggable-handle.js +6 -6
- package/dist/components/draggable/draggable.js +1414 -699
- package/dist/components/draggable-list/draggable-list-item.js +3 -3
- package/dist/components/draggable-list/draggable-list.js +12 -12
- package/dist/components/expandable/expandable.js +66 -78
- package/dist/components/index.js +2 -3
- package/dist/components/input-field/input-field.js +35 -22
- package/dist/components/layout/hstack.js +1 -1
- package/dist/components/layout/vstack.js +1 -1
- package/dist/components/link-input/link-input.js +69 -57
- package/dist/components/matrix-align/matrix-align.js +34 -86
- package/dist/components/menu/menu.js +22 -23
- package/dist/components/modal/modal.js +24 -25
- package/dist/components/notice/notice.js +32 -32
- package/dist/components/number-picker/number-picker.js +41 -40
- package/dist/components/option-select/option-select.js +9 -4
- package/dist/components/options-panel/options-panel.js +63 -28
- package/dist/components/placeholders/file-placeholder.js +6 -17
- package/dist/components/placeholders/image-placeholder.js +17 -17
- package/dist/components/placeholders/media-placeholder.js +12 -12
- package/dist/components/popover/popover.js +6 -5
- package/dist/components/radio/radio.js +60 -43
- package/dist/components/repeater/repeater-item.js +10 -10
- package/dist/components/repeater/repeater.js +8 -8
- package/dist/components/responsive/mini-responsive.js +41 -41
- package/dist/components/responsive/responsive-legacy.js +33 -33
- package/dist/components/responsive/responsive.js +48 -48
- package/dist/components/responsive-preview/responsive-preview.js +4 -4
- package/dist/components/rich-label/rich-label.js +13 -11
- package/dist/components/select/async-multi-select.js +3 -3
- package/dist/components/select/async-single-select.js +2 -2
- package/dist/components/select/custom-select-default-components.js +3 -3
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +3 -3
- package/dist/components/select/react-select-component-wrappers.js +1 -1
- package/dist/components/select/single-select.js +2 -2
- package/dist/components/select/styles.js +21 -21
- package/dist/components/select/v2/async-select.js +37 -47
- package/dist/components/select/v2/shared.js +8 -8
- package/dist/components/select/v2/single-select.js +44 -48
- package/dist/components/slider/column-config-slider.js +25 -25
- package/dist/components/slider/slider.js +173 -182
- package/dist/components/spacer/spacer.js +21 -21
- package/dist/components/tabs/tabs.js +111 -63
- package/dist/components/toggle/switch.js +27 -21
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +160 -83
- package/dist/components/tooltip/tooltip.js +25 -28
- package/dist/{context-KeRYAbEi.js → context-CDOs-GuR.js} +1 -1
- package/dist/{focusSafely-CZY36ssv.js → focusSafely-CiqTTjWy.js} +18 -17
- package/dist/icons/icons.js +52 -0
- package/dist/{index-641ee5b8.esm-DEB-c58F.js → index-641ee5b8.esm-DbdaYaxR.js} +45 -45
- package/dist/index-BRp93Yfa.js +28318 -0
- package/dist/index-CcCn9HWX.js +44 -0
- package/dist/index.js +2 -3
- package/dist/{multi-select-components-DM3GsNfb.js → multi-select-components-CkF3LyTF.js} +4 -4
- package/dist/{react-select-async.esm-Bq3N1-Wi.js → react-select-async.esm-DcVLw9X5.js} +3 -3
- package/dist/{react-select.esm-B38nY7_U.js → react-select.esm-OZ0cmTjg.js} +3 -3
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -1
- package/dist/{textSelection-G2G-nukT.js → textSelection-BlTDSskG.js} +2 -2
- package/dist/{useButton-CFtcz1T6.js → useButton-CmLbE5vg.js} +3 -3
- package/dist/{useEvent-B0yfN_Zu.js → useEvent-cLDJlznQ.js} +1 -1
- package/dist/{useFocusRing-DMAlRYjX.js → useFocusRing-CGp3guTX.js} +1 -1
- package/dist/{useFocusable-BlkOMLma.js → useFocusable-087cO5Ct.js} +9 -6
- package/dist/{useFormReset-BAEM0o25.js → useFormReset-NpLM2e3G.js} +1 -1
- package/dist/{useFormValidation-BNzOc2t9.js → useFormValidation-BWwmZQE2.js} +3 -3
- package/dist/{useLabel-D6FSp5_M.js → useLabel-C85N3Hzw.js} +2 -2
- package/dist/{useLabels-CraZ2Sej.js → useLabels-C_2wWraB.js} +1 -1
- package/dist/{useListState-C3dnPq2F.js → useListState-Z7FB_NzO.js} +1 -1
- package/dist/{useLocalizedStringFormatter-B73fhEA7.js → useLocalizedStringFormatter-BQ4TF72x.js} +1 -1
- package/dist/{useNumberField-CQP9-nH5.js → useNumberField-Bm6_BVl9.js} +10 -10
- package/dist/{useNumberFormatter-Cdctl6fg.js → useNumberFormatter-DlUVKkO7.js} +1 -1
- package/dist/{usePress-xTkcGUkt.js → usePress-rg_OQIGW.js} +15 -14
- package/dist/{useSingleSelectListState-BGXQSTy7.js → useSingleSelectListState-Cu3xtEJS.js} +2 -2
- package/dist/{useToggle-Dpw3WpSw.js → useToggle-DzlgBLAJ.js} +4 -4
- package/dist/{useToggleState-BSKwCUIW.js → useToggleState-DhSBQxkp.js} +1 -1
- package/dist/{utils-BSLBwuuO.js → utils-39D0mStj.js} +41 -93
- package/package.json +43 -41
- package/dist/GeistMonoVF.woff2 +0 -0
- package/dist/GeistVF.woff2 +0 -0
- package/dist/assets/fonts.css +0 -1
- package/dist/components/list-box/list-box.js +0 -157
- package/dist/fonts.js +0 -1
- package/dist/index-BYHhzLf-.js +0 -444
|
@@ -1,13 +1,149 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, e as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { $ as $
|
|
8
|
-
import {
|
|
9
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-
|
|
10
|
-
import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-
|
|
1
|
+
import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-DnOd_jPX.js";
|
|
2
|
+
import { r as reactDomExports } from "./index-BRp93Yfa.js";
|
|
3
|
+
import React__default, { useRef, useState, useMemo, cloneElement, useContext, useCallback, forwardRef, createContext, useEffect } from "react";
|
|
4
|
+
import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, e as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928, g as $8ae05eaa5c114e9c$export$7f54fc3180508a52, f as $bdb11010cef70236$export$f680877a34711e37 } from "./utils-39D0mStj.js";
|
|
5
|
+
import { q as $c87311424ea30a05$export$9ac100e40613ea10, w as $c87311424ea30a05$export$e1865c3bedcd822b, h as $6a99195332edec8b$export$80f3e147d781571c, k as $507fabe10e71c6fb$export$630ff653c5ada6a9, p as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./focusSafely-CiqTTjWy.js";
|
|
6
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-rg_OQIGW.js";
|
|
7
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-cLDJlznQ.js";
|
|
8
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-Cs5_OoeA.js";
|
|
9
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-CDOs-GuR.js";
|
|
10
|
+
import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-BlTDSskG.js";
|
|
11
|
+
function $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
|
|
12
|
+
const isInitialMount = useRef(true);
|
|
13
|
+
const lastDeps = useRef(null);
|
|
14
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
15
|
+
isInitialMount.current = true;
|
|
16
|
+
return () => {
|
|
17
|
+
isInitialMount.current = false;
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
21
|
+
if (isInitialMount.current) isInitialMount.current = false;
|
|
22
|
+
else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
|
|
23
|
+
lastDeps.current = dependencies;
|
|
24
|
+
}, dependencies);
|
|
25
|
+
}
|
|
26
|
+
function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
27
|
+
if (!node) return false;
|
|
28
|
+
let style = window.getComputedStyle(node);
|
|
29
|
+
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
30
|
+
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
31
|
+
return isScrollable;
|
|
32
|
+
}
|
|
33
|
+
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
34
|
+
const scrollParents = [];
|
|
35
|
+
while (node && node !== document.documentElement) {
|
|
36
|
+
if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow)) scrollParents.push(node);
|
|
37
|
+
node = node.parentElement;
|
|
38
|
+
}
|
|
39
|
+
return scrollParents;
|
|
40
|
+
}
|
|
41
|
+
let $ef06256079686ba0$var$descriptionId = 0;
|
|
42
|
+
const $ef06256079686ba0$var$descriptionNodes = /* @__PURE__ */ new Map();
|
|
43
|
+
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
|
|
44
|
+
let [id, setId] = useState();
|
|
45
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
46
|
+
if (!description) return;
|
|
47
|
+
let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
|
|
48
|
+
if (!desc) {
|
|
49
|
+
let id2 = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
|
|
50
|
+
setId(id2);
|
|
51
|
+
let node = document.createElement("div");
|
|
52
|
+
node.id = id2;
|
|
53
|
+
node.style.display = "none";
|
|
54
|
+
node.textContent = description;
|
|
55
|
+
document.body.appendChild(node);
|
|
56
|
+
desc = {
|
|
57
|
+
refCount: 0,
|
|
58
|
+
element: node
|
|
59
|
+
};
|
|
60
|
+
$ef06256079686ba0$var$descriptionNodes.set(description, desc);
|
|
61
|
+
} else setId(desc.element.id);
|
|
62
|
+
desc.refCount++;
|
|
63
|
+
return () => {
|
|
64
|
+
if (desc && --desc.refCount === 0) {
|
|
65
|
+
desc.element.remove();
|
|
66
|
+
$ef06256079686ba0$var$descriptionNodes.delete(description);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}, [
|
|
70
|
+
description
|
|
71
|
+
]);
|
|
72
|
+
return {
|
|
73
|
+
"aria-describedby": description ? id : void 0
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
77
|
+
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "left");
|
|
78
|
+
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "top");
|
|
79
|
+
let width = element.offsetWidth;
|
|
80
|
+
let height = element.offsetHeight;
|
|
81
|
+
let x = scrollView.scrollLeft;
|
|
82
|
+
let y = scrollView.scrollTop;
|
|
83
|
+
let { borderTopWidth, borderLeftWidth, scrollPaddingTop, scrollPaddingRight, scrollPaddingBottom, scrollPaddingLeft } = getComputedStyle(scrollView);
|
|
84
|
+
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
|
|
85
|
+
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
|
|
86
|
+
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
87
|
+
let maxY = borderAdjustedY + scrollView.clientHeight;
|
|
88
|
+
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
|
|
89
|
+
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
|
|
90
|
+
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
|
|
91
|
+
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
|
|
92
|
+
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
|
|
93
|
+
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
|
|
94
|
+
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
|
|
95
|
+
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
|
|
96
|
+
scrollView.scrollLeft = x;
|
|
97
|
+
scrollView.scrollTop = y;
|
|
98
|
+
}
|
|
99
|
+
function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
|
|
100
|
+
const prop = axis === "left" ? "offsetLeft" : "offsetTop";
|
|
101
|
+
let sum = 0;
|
|
102
|
+
while (child.offsetParent) {
|
|
103
|
+
sum += child[prop];
|
|
104
|
+
if (child.offsetParent === ancestor) break;
|
|
105
|
+
else if (child.offsetParent.contains(ancestor)) {
|
|
106
|
+
sum -= ancestor[prop];
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
child = child.offsetParent;
|
|
110
|
+
}
|
|
111
|
+
return sum;
|
|
112
|
+
}
|
|
113
|
+
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
114
|
+
if (targetElement && document.contains(targetElement)) {
|
|
115
|
+
let root = document.scrollingElement || document.documentElement;
|
|
116
|
+
let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
|
|
117
|
+
if (!isScrollPrevented) {
|
|
118
|
+
var _targetElement_scrollIntoView;
|
|
119
|
+
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
120
|
+
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
|
|
121
|
+
block: "nearest"
|
|
122
|
+
});
|
|
123
|
+
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
124
|
+
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
125
|
+
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
126
|
+
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, {
|
|
127
|
+
block: "center",
|
|
128
|
+
inline: "center"
|
|
129
|
+
});
|
|
130
|
+
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
|
|
131
|
+
block: "nearest"
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement);
|
|
136
|
+
for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const $5671b20cf9b562b2$export$447a38995de2c711 = "react-aria-clear-focus";
|
|
141
|
+
const $5671b20cf9b562b2$export$831c820ad60f9d12 = "react-aria-focus";
|
|
142
|
+
const $5671b20cf9b562b2$export$9db568f6321ad9dc = "react-aria-update-activedescendant";
|
|
143
|
+
function $21f1aa98acb08317$export$16792effe837dba3(e) {
|
|
144
|
+
if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
|
|
145
|
+
return e.ctrlKey;
|
|
146
|
+
}
|
|
11
147
|
class $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
|
|
12
148
|
get childNodes() {
|
|
13
149
|
throw new Error("childNodes is not supported");
|
|
@@ -135,6 +271,78 @@ class $23b9f4fcf0fe224b$export$408d25a4e12db025 {
|
|
|
135
271
|
this.lastKey = lastKey;
|
|
136
272
|
this.frozen = !isSSR;
|
|
137
273
|
}
|
|
274
|
+
// TODO: this is pretty specific to menu, will need to check if it is generic enough
|
|
275
|
+
// Will need to handle varying levels I assume but will revisit after I get searchable menu working for base menu
|
|
276
|
+
// TODO: an alternative is to simply walk the collection and add all item nodes that match the filter and any sections/separators we encounter
|
|
277
|
+
// to an array, then walk that new array and fix all the next/Prev keys while adding them to the new collection
|
|
278
|
+
filter(filterFn) {
|
|
279
|
+
let newCollection = new $23b9f4fcf0fe224b$export$408d25a4e12db025();
|
|
280
|
+
let lastNode = null;
|
|
281
|
+
for (let node of this) {
|
|
282
|
+
if (node.type === "section" && node.hasChildNodes) {
|
|
283
|
+
let clonedSection = node.clone();
|
|
284
|
+
let lastChildInSection = null;
|
|
285
|
+
for (let child of this.getChildren(node.key)) if (filterFn(child.textValue) || child.type === "header") {
|
|
286
|
+
let clonedChild = child.clone();
|
|
287
|
+
if (lastChildInSection == null) clonedSection.firstChildKey = clonedChild.key;
|
|
288
|
+
if (newCollection.firstKey == null) newCollection.firstKey = clonedSection.key;
|
|
289
|
+
if (lastChildInSection && lastChildInSection.parentKey === clonedChild.parentKey) {
|
|
290
|
+
lastChildInSection.nextKey = clonedChild.key;
|
|
291
|
+
clonedChild.prevKey = lastChildInSection.key;
|
|
292
|
+
} else clonedChild.prevKey = null;
|
|
293
|
+
clonedChild.nextKey = null;
|
|
294
|
+
newCollection.addNode(clonedChild);
|
|
295
|
+
lastChildInSection = clonedChild;
|
|
296
|
+
}
|
|
297
|
+
if (lastChildInSection) {
|
|
298
|
+
if (lastChildInSection.type !== "header") {
|
|
299
|
+
clonedSection.lastChildKey = lastChildInSection.key;
|
|
300
|
+
if (lastNode == null) clonedSection.prevKey = null;
|
|
301
|
+
else if (lastNode.type === "section" || lastNode.type === "separator") {
|
|
302
|
+
lastNode.nextKey = clonedSection.key;
|
|
303
|
+
clonedSection.prevKey = lastNode.key;
|
|
304
|
+
}
|
|
305
|
+
clonedSection.nextKey = null;
|
|
306
|
+
lastNode = clonedSection;
|
|
307
|
+
newCollection.addNode(clonedSection);
|
|
308
|
+
} else {
|
|
309
|
+
if (newCollection.firstKey === clonedSection.key) newCollection.firstKey = null;
|
|
310
|
+
newCollection.removeNode(lastChildInSection.key);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
} else if (node.type === "separator") {
|
|
314
|
+
let clonedSeparator = node.clone();
|
|
315
|
+
clonedSeparator.nextKey = null;
|
|
316
|
+
if ((lastNode === null || lastNode === void 0 ? void 0 : lastNode.type) === "section") {
|
|
317
|
+
lastNode.nextKey = clonedSeparator.key;
|
|
318
|
+
clonedSeparator.prevKey = lastNode.key;
|
|
319
|
+
lastNode = clonedSeparator;
|
|
320
|
+
newCollection.addNode(clonedSeparator);
|
|
321
|
+
}
|
|
322
|
+
} else if (filterFn(node.textValue)) {
|
|
323
|
+
let clonedNode = node.clone();
|
|
324
|
+
if (newCollection.firstKey == null) newCollection.firstKey = clonedNode.key;
|
|
325
|
+
if (lastNode != null && lastNode.type !== "section" && lastNode.type !== "separator" && lastNode.parentKey === clonedNode.parentKey) {
|
|
326
|
+
lastNode.nextKey = clonedNode.key;
|
|
327
|
+
clonedNode.prevKey = lastNode.key;
|
|
328
|
+
} else clonedNode.prevKey = null;
|
|
329
|
+
clonedNode.nextKey = null;
|
|
330
|
+
newCollection.addNode(clonedNode);
|
|
331
|
+
lastNode = clonedNode;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if ((lastNode === null || lastNode === void 0 ? void 0 : lastNode.type) === "separator" && lastNode.nextKey === null) {
|
|
335
|
+
let lastSection;
|
|
336
|
+
if (lastNode.prevKey != null) {
|
|
337
|
+
lastSection = newCollection.getItem(lastNode.prevKey);
|
|
338
|
+
lastSection.nextKey = null;
|
|
339
|
+
}
|
|
340
|
+
newCollection.removeNode(lastNode.key);
|
|
341
|
+
lastNode = lastSection;
|
|
342
|
+
}
|
|
343
|
+
newCollection.lastKey = (lastNode === null || lastNode === void 0 ? void 0 : lastNode.key) || null;
|
|
344
|
+
return newCollection;
|
|
345
|
+
}
|
|
138
346
|
constructor() {
|
|
139
347
|
this.keyMap = /* @__PURE__ */ new Map();
|
|
140
348
|
this.firstKey = null;
|
|
@@ -455,116 +663,6 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
455
663
|
addIdAndValue
|
|
456
664
|
]);
|
|
457
665
|
}
|
|
458
|
-
function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
459
|
-
if (!node) return false;
|
|
460
|
-
let style = window.getComputedStyle(node);
|
|
461
|
-
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
462
|
-
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
463
|
-
return isScrollable;
|
|
464
|
-
}
|
|
465
|
-
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
466
|
-
const scrollParents = [];
|
|
467
|
-
while (node && node !== document.documentElement) {
|
|
468
|
-
if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow)) scrollParents.push(node);
|
|
469
|
-
node = node.parentElement;
|
|
470
|
-
}
|
|
471
|
-
return scrollParents;
|
|
472
|
-
}
|
|
473
|
-
let $ef06256079686ba0$var$descriptionId = 0;
|
|
474
|
-
const $ef06256079686ba0$var$descriptionNodes = /* @__PURE__ */ new Map();
|
|
475
|
-
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
|
|
476
|
-
let [id, setId] = useState();
|
|
477
|
-
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
478
|
-
if (!description) return;
|
|
479
|
-
let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
|
|
480
|
-
if (!desc) {
|
|
481
|
-
let id2 = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
|
|
482
|
-
setId(id2);
|
|
483
|
-
let node = document.createElement("div");
|
|
484
|
-
node.id = id2;
|
|
485
|
-
node.style.display = "none";
|
|
486
|
-
node.textContent = description;
|
|
487
|
-
document.body.appendChild(node);
|
|
488
|
-
desc = {
|
|
489
|
-
refCount: 0,
|
|
490
|
-
element: node
|
|
491
|
-
};
|
|
492
|
-
$ef06256079686ba0$var$descriptionNodes.set(description, desc);
|
|
493
|
-
} else setId(desc.element.id);
|
|
494
|
-
desc.refCount++;
|
|
495
|
-
return () => {
|
|
496
|
-
if (desc && --desc.refCount === 0) {
|
|
497
|
-
desc.element.remove();
|
|
498
|
-
$ef06256079686ba0$var$descriptionNodes.delete(description);
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
}, [
|
|
502
|
-
description
|
|
503
|
-
]);
|
|
504
|
-
return {
|
|
505
|
-
"aria-describedby": description ? id : void 0
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
509
|
-
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "left");
|
|
510
|
-
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, "top");
|
|
511
|
-
let width = element.offsetWidth;
|
|
512
|
-
let height = element.offsetHeight;
|
|
513
|
-
let x = scrollView.scrollLeft;
|
|
514
|
-
let y = scrollView.scrollTop;
|
|
515
|
-
let { borderTopWidth, borderLeftWidth } = getComputedStyle(scrollView);
|
|
516
|
-
let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);
|
|
517
|
-
let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);
|
|
518
|
-
let maxX = borderAdjustedX + scrollView.clientWidth;
|
|
519
|
-
let maxY = borderAdjustedY + scrollView.clientHeight;
|
|
520
|
-
if (offsetX <= x) x = offsetX - parseInt(borderLeftWidth, 10);
|
|
521
|
-
else if (offsetX + width > maxX) x += offsetX + width - maxX;
|
|
522
|
-
if (offsetY <= borderAdjustedY) y = offsetY - parseInt(borderTopWidth, 10);
|
|
523
|
-
else if (offsetY + height > maxY) y += offsetY + height - maxY;
|
|
524
|
-
scrollView.scrollLeft = x;
|
|
525
|
-
scrollView.scrollTop = y;
|
|
526
|
-
}
|
|
527
|
-
function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
|
|
528
|
-
const prop = axis === "left" ? "offsetLeft" : "offsetTop";
|
|
529
|
-
let sum = 0;
|
|
530
|
-
while (child.offsetParent) {
|
|
531
|
-
sum += child[prop];
|
|
532
|
-
if (child.offsetParent === ancestor) break;
|
|
533
|
-
else if (child.offsetParent.contains(ancestor)) {
|
|
534
|
-
sum -= ancestor[prop];
|
|
535
|
-
break;
|
|
536
|
-
}
|
|
537
|
-
child = child.offsetParent;
|
|
538
|
-
}
|
|
539
|
-
return sum;
|
|
540
|
-
}
|
|
541
|
-
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
542
|
-
if (targetElement && document.contains(targetElement)) {
|
|
543
|
-
let root = document.scrollingElement || document.documentElement;
|
|
544
|
-
let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
|
|
545
|
-
if (!isScrollPrevented) {
|
|
546
|
-
var _targetElement_scrollIntoView;
|
|
547
|
-
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
548
|
-
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
|
|
549
|
-
block: "nearest"
|
|
550
|
-
});
|
|
551
|
-
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
552
|
-
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
553
|
-
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
554
|
-
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, {
|
|
555
|
-
block: "center",
|
|
556
|
-
inline: "center"
|
|
557
|
-
});
|
|
558
|
-
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
|
|
559
|
-
block: "nearest"
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
} else {
|
|
563
|
-
let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement);
|
|
564
|
-
for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
666
|
var shim = { exports: {} };
|
|
569
667
|
var useSyncExternalStoreShim_production = {};
|
|
570
668
|
/**
|
|
@@ -869,52 +967,6 @@ function $e1995378a142960e$var$CollectionRoot({ children }) {
|
|
|
869
967
|
value: doc
|
|
870
968
|
}, wrappedChildren) : /* @__PURE__ */ reactDomExports.createPortal(wrappedChildren, doc);
|
|
871
969
|
}
|
|
872
|
-
const $7135fc7d473fd974$export$d40e14dec8b060a8 = /* @__PURE__ */ createContext(null);
|
|
873
|
-
const $7135fc7d473fd974$export$6e2c8f0811a474ce = /* @__PURE__ */ $e1995378a142960e$export$e953bb1cd0f19726("section", (props, ref, section) => {
|
|
874
|
-
let { name, render } = useContext($7135fc7d473fd974$export$d40e14dec8b060a8);
|
|
875
|
-
console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
|
|
876
|
-
return render(props, ref, section, "react-aria-Section");
|
|
877
|
-
});
|
|
878
|
-
const $7135fc7d473fd974$export$a164736487e3f0ae = {
|
|
879
|
-
CollectionRoot({ collection, renderDropIndicator }) {
|
|
880
|
-
return $7135fc7d473fd974$var$useCollectionRender(collection, null, renderDropIndicator);
|
|
881
|
-
},
|
|
882
|
-
CollectionBranch({ collection, parent, renderDropIndicator }) {
|
|
883
|
-
return $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator);
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator) {
|
|
887
|
-
return $e948873055cbafe4$export$727c8fc270210f13({
|
|
888
|
-
items: parent ? collection.getChildren(parent.key) : collection,
|
|
889
|
-
dependencies: [
|
|
890
|
-
renderDropIndicator
|
|
891
|
-
],
|
|
892
|
-
children(node) {
|
|
893
|
-
var _collection_getItem;
|
|
894
|
-
let rendered = node.render(node);
|
|
895
|
-
if (!renderDropIndicator || node.type !== "item") return rendered;
|
|
896
|
-
let key = node.key;
|
|
897
|
-
let keyAfter = collection.getKeyAfter(key);
|
|
898
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDropIndicator({
|
|
899
|
-
type: "item",
|
|
900
|
-
key,
|
|
901
|
-
dropPosition: "before"
|
|
902
|
-
}), rendered, (keyAfter == null || ((_collection_getItem = collection.getItem(keyAfter)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.type) !== "item") && renderDropIndicator({
|
|
903
|
-
type: "item",
|
|
904
|
-
key,
|
|
905
|
-
dropPosition: "after"
|
|
906
|
-
}));
|
|
907
|
-
}
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
const $7135fc7d473fd974$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($7135fc7d473fd974$export$a164736487e3f0ae);
|
|
911
|
-
function $7135fc7d473fd974$export$90e00781bc59d8f9(focusedKey) {
|
|
912
|
-
return useMemo(() => focusedKey != null ? /* @__PURE__ */ new Set([
|
|
913
|
-
focusedKey
|
|
914
|
-
]) : null, [
|
|
915
|
-
focusedKey
|
|
916
|
-
]);
|
|
917
|
-
}
|
|
918
970
|
const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
|
|
919
971
|
function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
|
|
920
972
|
let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
|
|
@@ -972,10 +1024,6 @@ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
|
|
|
972
1024
|
function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
|
|
973
1025
|
return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
|
|
974
1026
|
}
|
|
975
|
-
function $feb5ffebff200149$export$16792effe837dba3(e) {
|
|
976
|
-
if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
|
|
977
|
-
return e.ctrlKey;
|
|
978
|
-
}
|
|
979
1027
|
const $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
|
|
980
1028
|
function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
981
1029
|
let { keyboardDelegate, selectionManager, onTypeSelect } = options;
|
|
@@ -1089,22 +1137,24 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1089
1137
|
break;
|
|
1090
1138
|
case "Home":
|
|
1091
1139
|
if (delegate.getFirstKey) {
|
|
1140
|
+
if (manager.focusedKey === null && e.shiftKey) return;
|
|
1092
1141
|
e.preventDefault();
|
|
1093
|
-
let firstKey = delegate.getFirstKey(manager.focusedKey, $
|
|
1142
|
+
let firstKey = delegate.getFirstKey(manager.focusedKey, $21f1aa98acb08317$export$16792effe837dba3(e));
|
|
1094
1143
|
manager.setFocusedKey(firstKey);
|
|
1095
1144
|
if (firstKey != null) {
|
|
1096
|
-
if ($
|
|
1145
|
+
if ($21f1aa98acb08317$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
|
|
1097
1146
|
else if (selectOnFocus) manager.replaceSelection(firstKey);
|
|
1098
1147
|
}
|
|
1099
1148
|
}
|
|
1100
1149
|
break;
|
|
1101
1150
|
case "End":
|
|
1102
1151
|
if (delegate.getLastKey) {
|
|
1152
|
+
if (manager.focusedKey === null && e.shiftKey) return;
|
|
1103
1153
|
e.preventDefault();
|
|
1104
|
-
let lastKey = delegate.getLastKey(manager.focusedKey, $
|
|
1154
|
+
let lastKey = delegate.getLastKey(manager.focusedKey, $21f1aa98acb08317$export$16792effe837dba3(e));
|
|
1105
1155
|
manager.setFocusedKey(lastKey);
|
|
1106
1156
|
if (lastKey != null) {
|
|
1107
|
-
if ($
|
|
1157
|
+
if ($21f1aa98acb08317$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
|
|
1108
1158
|
else if (selectOnFocus) manager.replaceSelection(lastKey);
|
|
1109
1159
|
}
|
|
1110
1160
|
}
|
|
@@ -1128,7 +1178,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1128
1178
|
}
|
|
1129
1179
|
break;
|
|
1130
1180
|
case "a":
|
|
1131
|
-
if ($
|
|
1181
|
+
if ($21f1aa98acb08317$export$16792effe837dba3(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
|
|
1132
1182
|
e.preventDefault();
|
|
1133
1183
|
manager.selectAll();
|
|
1134
1184
|
}
|
|
@@ -1208,6 +1258,49 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1208
1258
|
let onBlur = (e) => {
|
|
1209
1259
|
if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
|
|
1210
1260
|
};
|
|
1261
|
+
let shouldVirtualFocusFirst = useRef(false);
|
|
1262
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
|
|
1263
|
+
let { detail } = e;
|
|
1264
|
+
e.stopPropagation();
|
|
1265
|
+
manager.setFocused(true);
|
|
1266
|
+
if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === "first") shouldVirtualFocusFirst.current = true;
|
|
1267
|
+
});
|
|
1268
|
+
let updateActiveDescendant = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
1269
|
+
var _delegate_getFirstKey;
|
|
1270
|
+
var _delegate_getFirstKey1;
|
|
1271
|
+
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;
|
|
1272
|
+
if (keyToFocus == null) {
|
|
1273
|
+
var _ref_current;
|
|
1274
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(new CustomEvent($5671b20cf9b562b2$export$9db568f6321ad9dc, {
|
|
1275
|
+
cancelable: true,
|
|
1276
|
+
bubbles: true
|
|
1277
|
+
}));
|
|
1278
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
1279
|
+
} else {
|
|
1280
|
+
manager.setFocusedKey(keyToFocus);
|
|
1281
|
+
shouldVirtualFocusFirst.current = false;
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
$ca9b37712f007381$export$72ef708ab07251f1(() => {
|
|
1285
|
+
if (shouldVirtualFocusFirst.current) updateActiveDescendant();
|
|
1286
|
+
}, [
|
|
1287
|
+
manager.collection,
|
|
1288
|
+
updateActiveDescendant
|
|
1289
|
+
]);
|
|
1290
|
+
let resetFocusFirstFlag = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
|
|
1291
|
+
if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
|
|
1292
|
+
});
|
|
1293
|
+
$ca9b37712f007381$export$72ef708ab07251f1(() => {
|
|
1294
|
+
resetFocusFirstFlag();
|
|
1295
|
+
}, [
|
|
1296
|
+
manager.focusedKey,
|
|
1297
|
+
resetFocusFirstFlag
|
|
1298
|
+
]);
|
|
1299
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
|
|
1300
|
+
e.stopPropagation();
|
|
1301
|
+
manager.setFocused(false);
|
|
1302
|
+
manager.setFocusedKey(null);
|
|
1303
|
+
});
|
|
1211
1304
|
const autoFocusRef = useRef(autoFocus);
|
|
1212
1305
|
useEffect(() => {
|
|
1213
1306
|
if (autoFocusRef.current) {
|
|
@@ -1267,6 +1360,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1267
1360
|
if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
|
|
1268
1361
|
let tabIndex = void 0;
|
|
1269
1362
|
if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
|
|
1363
|
+
else tabIndex = -1;
|
|
1270
1364
|
return {
|
|
1271
1365
|
collectionProps: {
|
|
1272
1366
|
...handlers,
|
|
@@ -1275,8 +1369,9 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1275
1369
|
};
|
|
1276
1370
|
}
|
|
1277
1371
|
function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
1278
|
-
let { selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
|
|
1372
|
+
let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
|
|
1279
1373
|
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
1374
|
+
id = $bdb11010cef70236$export$f680877a34711e37(id);
|
|
1280
1375
|
let onSelect = (e) => {
|
|
1281
1376
|
if (e.pointerType === "keyboard" && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
|
|
1282
1377
|
else {
|
|
@@ -1293,16 +1388,25 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1293
1388
|
if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
|
|
1294
1389
|
else manager.replaceSelection(key);
|
|
1295
1390
|
} else if (e && e.shiftKey) manager.extendSelection(key);
|
|
1296
|
-
else if (manager.selectionBehavior === "toggle" || e && ($
|
|
1391
|
+
else if (manager.selectionBehavior === "toggle" || e && ($21f1aa98acb08317$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
|
|
1297
1392
|
manager.toggleSelection(key);
|
|
1298
1393
|
else manager.replaceSelection(key);
|
|
1299
1394
|
}
|
|
1300
1395
|
};
|
|
1301
1396
|
useEffect(() => {
|
|
1302
1397
|
let isFocused = key === manager.focusedKey;
|
|
1303
|
-
if (isFocused && manager.isFocused
|
|
1304
|
-
if (
|
|
1305
|
-
|
|
1398
|
+
if (isFocused && manager.isFocused) {
|
|
1399
|
+
if (!shouldUseVirtualFocus) {
|
|
1400
|
+
if (focus) focus();
|
|
1401
|
+
else if (document.activeElement !== ref.current && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1402
|
+
} else {
|
|
1403
|
+
var _ref_current;
|
|
1404
|
+
let updateActiveDescendant = new CustomEvent($5671b20cf9b562b2$export$9db568f6321ad9dc, {
|
|
1405
|
+
cancelable: true,
|
|
1406
|
+
bubbles: true
|
|
1407
|
+
});
|
|
1408
|
+
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.dispatchEvent(updateActiveDescendant);
|
|
1409
|
+
}
|
|
1306
1410
|
}
|
|
1307
1411
|
}, [
|
|
1308
1412
|
ref,
|
|
@@ -1356,9 +1460,11 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1356
1460
|
};
|
|
1357
1461
|
else {
|
|
1358
1462
|
itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
|
|
1359
|
-
if (e.pointerType
|
|
1463
|
+
if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
|
|
1464
|
+
};
|
|
1465
|
+
itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
|
|
1466
|
+
if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
|
|
1360
1467
|
};
|
|
1361
|
-
itemPressProps.onPress = hasPrimaryAction ? performAction : void 0;
|
|
1362
1468
|
}
|
|
1363
1469
|
} else {
|
|
1364
1470
|
itemPressProps.onPressStart = (e) => {
|
|
@@ -1403,7 +1509,8 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1403
1509
|
itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
|
|
1404
1510
|
onDoubleClick,
|
|
1405
1511
|
onDragStartCapture,
|
|
1406
|
-
onClick
|
|
1512
|
+
onClick,
|
|
1513
|
+
id
|
|
1407
1514
|
}),
|
|
1408
1515
|
isPressed,
|
|
1409
1516
|
isSelected: manager.isSelected(key),
|
|
@@ -2057,21 +2164,62 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
2057
2164
|
this.layoutDelegate = (options === null || options === void 0 ? void 0 : options.layoutDelegate) || null;
|
|
2058
2165
|
}
|
|
2059
2166
|
}
|
|
2167
|
+
const $7135fc7d473fd974$export$d40e14dec8b060a8 = /* @__PURE__ */ createContext(null);
|
|
2168
|
+
const $7135fc7d473fd974$export$a164736487e3f0ae = {
|
|
2169
|
+
CollectionRoot({ collection, renderDropIndicator }) {
|
|
2170
|
+
return $7135fc7d473fd974$var$useCollectionRender(collection, null, renderDropIndicator);
|
|
2171
|
+
},
|
|
2172
|
+
CollectionBranch({ collection, parent, renderDropIndicator }) {
|
|
2173
|
+
return $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator);
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2176
|
+
function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator) {
|
|
2177
|
+
return $e948873055cbafe4$export$727c8fc270210f13({
|
|
2178
|
+
items: parent ? collection.getChildren(parent.key) : collection,
|
|
2179
|
+
dependencies: [
|
|
2180
|
+
renderDropIndicator
|
|
2181
|
+
],
|
|
2182
|
+
children(node) {
|
|
2183
|
+
var _collection_getItem;
|
|
2184
|
+
let rendered = node.render(node);
|
|
2185
|
+
if (!renderDropIndicator || node.type !== "item") return rendered;
|
|
2186
|
+
let key = node.key;
|
|
2187
|
+
let keyAfter = collection.getKeyAfter(key);
|
|
2188
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, renderDropIndicator({
|
|
2189
|
+
type: "item",
|
|
2190
|
+
key,
|
|
2191
|
+
dropPosition: "before"
|
|
2192
|
+
}), rendered, (keyAfter == null || ((_collection_getItem = collection.getItem(keyAfter)) === null || _collection_getItem === void 0 ? void 0 : _collection_getItem.type) !== "item") && renderDropIndicator({
|
|
2193
|
+
type: "item",
|
|
2194
|
+
key,
|
|
2195
|
+
dropPosition: "after"
|
|
2196
|
+
}));
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
const $7135fc7d473fd974$export$4feb769f8ddf26c5 = /* @__PURE__ */ createContext($7135fc7d473fd974$export$a164736487e3f0ae);
|
|
2201
|
+
function $7135fc7d473fd974$export$90e00781bc59d8f9(focusedKey) {
|
|
2202
|
+
return useMemo(() => focusedKey != null ? /* @__PURE__ */ new Set([
|
|
2203
|
+
focusedKey
|
|
2204
|
+
]) : null, [
|
|
2205
|
+
focusedKey
|
|
2206
|
+
]);
|
|
2207
|
+
}
|
|
2060
2208
|
export {
|
|
2061
|
-
$
|
|
2062
|
-
$
|
|
2063
|
-
$
|
|
2064
|
-
$
|
|
2065
|
-
$
|
|
2066
|
-
$e1995378a142960e$export$
|
|
2067
|
-
$
|
|
2068
|
-
$
|
|
2069
|
-
$
|
|
2070
|
-
$
|
|
2071
|
-
$
|
|
2072
|
-
$
|
|
2073
|
-
$
|
|
2074
|
-
$
|
|
2209
|
+
$7af3f5b51489e0b5$export$253fe78d46329472 as $,
|
|
2210
|
+
$7613b1592d41b092$export$6cd28814d92fa9c9 as a,
|
|
2211
|
+
$d496c0a20b6e58ec$export$6c8a5aaad13c9852 as b,
|
|
2212
|
+
$880e95eb8b93ba9a$export$ecf600387e221c37 as c,
|
|
2213
|
+
$e1995378a142960e$export$bf788dd355e3a401 as d,
|
|
2214
|
+
$e1995378a142960e$export$fb8073518f34e6ec as e,
|
|
2215
|
+
$7135fc7d473fd974$export$4feb769f8ddf26c5 as f,
|
|
2216
|
+
$7135fc7d473fd974$export$d40e14dec8b060a8 as g,
|
|
2217
|
+
$e1995378a142960e$export$18af5c7a9e9b3664 as h,
|
|
2218
|
+
$ae20dd8cbca75726$export$d6daf82dcd84e87c as i,
|
|
2219
|
+
$7135fc7d473fd974$export$90e00781bc59d8f9 as j,
|
|
2220
|
+
$7135fc7d473fd974$export$a164736487e3f0ae as k,
|
|
2221
|
+
$cc38e7bd3fc7b213$export$2bb74740c4e19def as l,
|
|
2222
|
+
$c5a24bc478652b5f$export$1005530eda016c13 as m,
|
|
2075
2223
|
$fb3050f43d946246$export$e32c88dfddc6e1d8 as n,
|
|
2076
2224
|
$8a26561d2877236e$export$c24ed0104d07eab9 as o,
|
|
2077
2225
|
$e1995378a142960e$export$e953bb1cd0f19726 as p
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as $9446cca9a3875146$export$7d15b64cf5a3a4c4, b as $9446cca9a3875146$export$b6268554fba451f } from "./number-GajL10e1.js";
|
|
2
|
-
import { a as $5b160d28a433310d$export$c17fa47878dc55b6, b as $6db58dc88e78b024$export$2f817fcdc4b89ae0 } from "./useLocalizedStringFormatter-
|
|
2
|
+
import { a as $5b160d28a433310d$export$c17fa47878dc55b6, b as $6db58dc88e78b024$export$2f817fcdc4b89ae0 } from "./useLocalizedStringFormatter-BQ4TF72x.js";
|
|
3
3
|
import { $ as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 } from "./NumberFormatter-DA8u1Ot7.js";
|
|
4
4
|
var $eccab2b0118aef08$exports = {};
|
|
5
5
|
$eccab2b0118aef08$exports = {
|