@eightshift/ui-components 1.7.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-VbCAu4hd.js → Button-BMFbEXg1.js} +7 -7
- package/dist/{Color-BpLubxWI.js → Color-B-cqXgPz.js} +5 -17
- package/dist/{ColorSwatch-CinC14s3.js → ColorSwatch-B6s54Jb3.js} +4 -4
- package/dist/ComboBox-VR9-vNZv.js +1886 -0
- package/dist/Dialog-BlYTPzgB.js +2177 -0
- package/dist/{FieldError-BttM1Nxd.js → FieldError-DKicm3R0.js} +2 -2
- package/dist/{FocusScope-CtCX0OGo.js → FocusScope-EoLYfbMp.js} +11 -12
- package/dist/{Group-XzWUooix.js → Group-D96edUPC.js} +5 -5
- package/dist/{Heading-DZelepHV.js → Heading-GytTjUsy.js} +1 -1
- package/dist/{Hidden-CcFqOzrp.js → Hidden-D3hHnmPI.js} +2 -2
- package/dist/{Input-CV1qVS6t.js → Input-BXSxJ_44.js} +10 -10
- package/dist/{Label-BwqMVkuV.js → Label-BtoiUpt8.js} +2 -2
- package/dist/{List-Bx2anbX-.js → List-Ct3nzFZG.js} +1 -1
- package/dist/{ListBox-DuZPdnkk.js → ListBox-BMpo-Cem.js} +19 -18
- package/dist/{NumberFormatter-U_Gx0UDq.js → NumberFormatter-DA8u1Ot7.js} +4 -6
- package/dist/OverlayArrow-4epQ99-E.js +567 -0
- package/dist/{Select-c7902d94.esm-DtzFQzf-.js → Select-aab027f3.esm-C7BxKjSc.js} +4 -4
- package/dist/{SelectionManager-x27KqnAT.js → SelectionManager-D-89MUJW.js} +276 -291
- package/dist/{Separator-BM58t3PP.js → Separator-DUhFmbD-.js} +62 -52
- package/dist/{Slider-D9Cs6yKr.js → Slider-QNPrj4N9.js} +16 -14
- package/dist/{Text-BVIXT8qq.js → Text-DNDWaukZ.js} +1 -1
- package/dist/{VisuallyHidden-WhC7vZaL.js → VisuallyHidden-BHNhi-ls.js} +2 -2
- package/dist/assets/style.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +67 -7245
- package/dist/components/base-control/base-control.js +1 -1
- package/dist/components/button/button.js +10 -7
- package/dist/components/checkbox/checkbox.js +22 -13
- package/dist/components/color-pickers/color-picker.js +1 -1
- package/dist/components/color-pickers/color-swatch.js +3 -3
- package/dist/components/color-pickers/gradient-editor.js +2 -2
- package/dist/components/color-pickers/solid-color-picker.js +21 -21
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/container-panel/container-panel.js +6 -4
- package/dist/components/draggable/draggable-handle.js +2 -2
- package/dist/components/draggable/draggable.js +2 -2
- package/dist/components/draggable-list/draggable-list-item.js +2 -2
- package/dist/components/draggable-list/draggable-list.js +2 -2
- package/dist/components/expandable/expandable.js +221 -26
- package/dist/components/index.js +8 -4
- package/dist/components/input-field/input-field.js +7 -7
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +10 -1872
- package/dist/components/list-box/list-box.js +2 -2
- package/dist/components/matrix-align/matrix-align.js +2 -2
- package/dist/components/menu/menu.js +7 -974
- package/dist/components/modal/modal.js +7 -7
- package/dist/components/number-picker/number-picker.js +10 -10
- package/dist/components/option-select/option-select.js +1 -1
- package/dist/components/options-panel/options-panel.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +2 -2
- package/dist/components/radio/radio.js +13 -13
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +2 -2
- package/dist/components/responsive/mini-responsive.js +3 -3
- package/dist/components/responsive/responsive-legacy.js +2 -2
- package/dist/components/responsive/responsive.js +2 -2
- package/dist/components/responsive-preview/responsive-preview.js +1 -1
- 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 +1 -1
- 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/v2/async-select.js +307 -0
- package/dist/components/select/v2/shared.js +24 -0
- package/dist/components/select/v2/single-select.js +993 -0
- package/dist/components/slider/column-config-slider.js +3 -3
- package/dist/components/slider/slider.js +3 -3
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +16 -16
- package/dist/components/toggle/switch.js +6 -6
- package/dist/components/toggle/toggle.js +1 -1
- package/dist/components/toggle-button/toggle-button.js +55 -12
- package/dist/components/tooltip/tooltip.js +532 -8
- package/dist/{context-Cs-ZD1nu.js → context-KeRYAbEi.js} +2 -2
- package/dist/{default-i18n-DRnM8y4w.js → default-i18n-CM1-Xvzf.js} +183 -176
- package/dist/{focusSafely-CgFLw4FA.js → focusSafely-CZY36ssv.js} +14 -14
- package/dist/icons/icons.js +131 -0
- package/dist/icons/jsx-svg.js +16 -3
- package/dist/{index-a301f526.esm-BMg114iK.js → index-641ee5b8.esm-DEB-c58F.js} +226 -75
- package/dist/index-BYHhzLf-.js +444 -0
- package/dist/index.js +7 -3
- package/dist/{multi-select-components-DTvEidE3.js → multi-select-components-DM3GsNfb.js} +112 -45
- package/dist/{react-jsx-parser.min-B5HVwW_W.js → react-jsx-parser.min-CVit0rZn.js} +5620 -7409
- package/dist/{react-select-async.esm-CxA8wpeT.js → react-select-async.esm-Bq3N1-Wi.js} +3 -3
- package/dist/{react-select.esm-CeE7o5M9.js → react-select.esm-B38nY7_U.js} +3 -3
- package/dist/{textSelection-CvK0YHTZ.js → textSelection-G2G-nukT.js} +1 -1
- package/dist/{useButton-Cy9eEev7.js → useButton-CFtcz1T6.js} +4 -4
- package/dist/{useEvent-LZebwyrb.js → useEvent-B0yfN_Zu.js} +1 -1
- package/dist/{useFocusRing-BMOTWmOx.js → useFocusRing-DMAlRYjX.js} +1 -1
- package/dist/{useFocusable-ByyKSVQv.js → useFocusable-BlkOMLma.js} +4 -4
- package/dist/{useFormReset-B8m1uz1J.js → useFormReset-BAEM0o25.js} +1 -1
- package/dist/{useFormValidationState-BjMhz_VI.js → useFormValidation-BNzOc2t9.js} +92 -88
- package/dist/{useLabel-B6uO0wVK.js → useLabel-D6FSp5_M.js} +2 -2
- package/dist/{useLabels-5dFkeiXx.js → useLabels-CraZ2Sej.js} +1 -1
- package/dist/{useListState-eKxv7HPC.js → useListState-C3dnPq2F.js} +1 -1
- package/dist/{useLocalizedStringFormatter-BaKmjFNp.js → useLocalizedStringFormatter-B73fhEA7.js} +1 -1
- package/dist/{useNumberField-DMMUTZ-h.js → useNumberField-CQP9-nH5.js} +27 -20
- package/dist/{useNumberFormatter-Cyx5Dxkf.js → useNumberFormatter-Cdctl6fg.js} +2 -2
- package/dist/{usePress-D8nPoIQm.js → usePress-xTkcGUkt.js} +4 -4
- package/dist/{useSingleSelectListState-CABciySJ.js → useSingleSelectListState-BGXQSTy7.js} +2 -2
- package/dist/{useToggle-BmltE9Zr.js → useToggle-Dpw3WpSw.js} +4 -4
- package/dist/{useToggleState-DZXLEnA_.js → useToggleState-BSKwCUIW.js} +1 -1
- package/dist/{utils-BCJajCwh.js → utils-BSLBwuuO.js} +16 -15
- package/package.json +30 -31
- package/dist/Dialog-BN5EE7UH.js +0 -934
- package/dist/index-BTCzc3zb.js +0 -28261
- package/dist/isScrollable-Dh9D9IOd.js +0 -9
- package/dist/tooltip-eKaARDoV.js +0 -1084
- package/dist/useMenuTrigger-4fwEmto8.js +0 -246
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React__default, { useMemo, cloneElement, useState, forwardRef, useContext, createContext, useRef, useCallback, useEffect } from "react";
|
|
2
|
-
import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-
|
|
3
|
-
import { r as reactDomExports } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-
|
|
8
|
-
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-
|
|
9
|
-
import { $ as $
|
|
10
|
-
import { $ as $
|
|
11
|
-
import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-CvK0YHTZ.js";
|
|
2
|
+
import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-D3hHnmPI.js";
|
|
3
|
+
import { r as reactDomExports } from "./index-BYHhzLf-.js";
|
|
4
|
+
import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, e as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-BSLBwuuO.js";
|
|
5
|
+
import { a as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-EoLYfbMp.js";
|
|
6
|
+
import { v as $c87311424ea30a05$export$e1865c3bedcd822b, o as $c87311424ea30a05$export$9ac100e40613ea10, h as $6a99195332edec8b$export$80f3e147d781571c, m as $507fabe10e71c6fb$export$630ff653c5ada6a9, n as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./focusSafely-CZY36ssv.js";
|
|
7
|
+
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-xTkcGUkt.js";
|
|
8
|
+
import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-B0yfN_Zu.js";
|
|
9
|
+
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-KeRYAbEi.js";
|
|
10
|
+
import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-G2G-nukT.js";
|
|
12
11
|
class $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
|
|
13
12
|
get childNodes() {
|
|
14
13
|
throw new Error("childNodes is not supported");
|
|
@@ -324,10 +323,7 @@ class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export
|
|
|
324
323
|
removeAttribute() {
|
|
325
324
|
}
|
|
326
325
|
constructor(type, ownerDocument) {
|
|
327
|
-
super(ownerDocument);
|
|
328
|
-
this.nodeType = 8;
|
|
329
|
-
this._index = 0;
|
|
330
|
-
this.hasSetProps = false;
|
|
326
|
+
super(ownerDocument), this.nodeType = 8, this._index = 0, this.hasSetProps = false;
|
|
331
327
|
this.node = new $23b9f4fcf0fe224b$export$d68d59712b04d9d1(type, `react-aria-${++ownerDocument.nodeId}`);
|
|
332
328
|
this.ownerDocument.startTransaction();
|
|
333
329
|
}
|
|
@@ -419,17 +415,7 @@ class $681cc3c98f569e39$export$b34a105447964f9f extends $681cc3c98f569e39$export
|
|
|
419
415
|
}
|
|
420
416
|
}
|
|
421
417
|
constructor(collection) {
|
|
422
|
-
super(null);
|
|
423
|
-
this.nodeType = 11;
|
|
424
|
-
this.ownerDocument = this;
|
|
425
|
-
this.dirtyNodes = /* @__PURE__ */ new Set();
|
|
426
|
-
this.isSSR = false;
|
|
427
|
-
this.nodeId = 0;
|
|
428
|
-
this.nodesByProps = /* @__PURE__ */ new WeakMap();
|
|
429
|
-
this.isMounted = true;
|
|
430
|
-
this.mutatedNodes = /* @__PURE__ */ new Set();
|
|
431
|
-
this.subscriptions = /* @__PURE__ */ new Set();
|
|
432
|
-
this.transactionCount = 0;
|
|
418
|
+
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.mutatedNodes = /* @__PURE__ */ new Set(), this.subscriptions = /* @__PURE__ */ new Set(), this.transactionCount = 0;
|
|
433
419
|
this.collection = collection;
|
|
434
420
|
this.collectionMutated = true;
|
|
435
421
|
}
|
|
@@ -469,6 +455,13 @@ function $e948873055cbafe4$export$727c8fc270210f13(props) {
|
|
|
469
455
|
addIdAndValue
|
|
470
456
|
]);
|
|
471
457
|
}
|
|
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
|
+
}
|
|
472
465
|
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
473
466
|
const scrollParents = [];
|
|
474
467
|
while (node && node !== document.documentElement) {
|
|
@@ -546,7 +539,7 @@ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
|
|
|
546
539
|
return sum;
|
|
547
540
|
}
|
|
548
541
|
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
549
|
-
if (document.contains(targetElement)) {
|
|
542
|
+
if (targetElement && document.contains(targetElement)) {
|
|
550
543
|
let root = document.scrollingElement || document.documentElement;
|
|
551
544
|
let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
|
|
552
545
|
if (!isScrollPrevented) {
|
|
@@ -573,64 +566,70 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
573
566
|
}
|
|
574
567
|
}
|
|
575
568
|
var shim = { exports: {} };
|
|
576
|
-
var
|
|
569
|
+
var useSyncExternalStoreShim_production = {};
|
|
577
570
|
/**
|
|
578
571
|
* @license React
|
|
579
|
-
* use-sync-external-store-shim.production.
|
|
572
|
+
* use-sync-external-store-shim.production.js
|
|
580
573
|
*
|
|
581
|
-
* Copyright (c)
|
|
574
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
582
575
|
*
|
|
583
576
|
* This source code is licensed under the MIT license found in the
|
|
584
577
|
* LICENSE file in the root directory of this source tree.
|
|
585
578
|
*/
|
|
586
|
-
var
|
|
587
|
-
function
|
|
588
|
-
if (
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
function
|
|
592
|
-
return
|
|
593
|
-
}
|
|
594
|
-
var
|
|
595
|
-
function
|
|
596
|
-
var
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
579
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
580
|
+
function requireUseSyncExternalStoreShim_production() {
|
|
581
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
582
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
583
|
+
var React = React__default;
|
|
584
|
+
function is(x, y) {
|
|
585
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
586
|
+
}
|
|
587
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
|
|
588
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
589
|
+
var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
590
|
+
useLayoutEffect(
|
|
591
|
+
function() {
|
|
592
|
+
inst.value = value;
|
|
593
|
+
inst.getSnapshot = getSnapshot;
|
|
594
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
595
|
+
},
|
|
596
|
+
[subscribe, value, getSnapshot]
|
|
597
|
+
);
|
|
598
|
+
useEffect2(
|
|
599
|
+
function() {
|
|
600
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
601
|
+
return subscribe(function() {
|
|
602
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
603
|
+
});
|
|
604
|
+
},
|
|
605
|
+
[subscribe]
|
|
606
|
+
);
|
|
607
|
+
useDebugValue(value);
|
|
608
|
+
return value;
|
|
609
|
+
}
|
|
610
|
+
function checkIfSnapshotChanged(inst) {
|
|
611
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
612
|
+
inst = inst.value;
|
|
614
613
|
try {
|
|
615
|
-
var
|
|
616
|
-
return !
|
|
617
|
-
} catch (
|
|
614
|
+
var nextValue = latestGetSnapshot();
|
|
615
|
+
return !objectIs(inst, nextValue);
|
|
616
|
+
} catch (error) {
|
|
618
617
|
return true;
|
|
619
618
|
}
|
|
620
619
|
}
|
|
621
|
-
function
|
|
622
|
-
return
|
|
620
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
621
|
+
return getSnapshot();
|
|
623
622
|
}
|
|
624
|
-
var
|
|
625
|
-
|
|
626
|
-
return
|
|
623
|
+
var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
624
|
+
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
625
|
+
return useSyncExternalStoreShim_production;
|
|
627
626
|
}
|
|
628
627
|
var useSyncExternalStoreShim_development = {};
|
|
629
628
|
/**
|
|
630
629
|
* @license React
|
|
631
630
|
* use-sync-external-store-shim.development.js
|
|
632
631
|
*
|
|
633
|
-
* Copyright (c)
|
|
632
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
634
633
|
*
|
|
635
634
|
* This source code is licensed under the MIT license found in the
|
|
636
635
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -639,128 +638,77 @@ var hasRequiredUseSyncExternalStoreShim_development;
|
|
|
639
638
|
function requireUseSyncExternalStoreShim_development() {
|
|
640
639
|
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
641
640
|
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
function printWarning(level, format, args) {
|
|
660
|
-
{
|
|
661
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
662
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
663
|
-
if (stack !== "") {
|
|
664
|
-
format += "%s";
|
|
665
|
-
args = args.concat([stack]);
|
|
666
|
-
}
|
|
667
|
-
var argsWithFormat = args.map(function(item) {
|
|
668
|
-
return String(item);
|
|
669
|
-
});
|
|
670
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
671
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
function is(x, y) {
|
|
675
|
-
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
|
|
641
|
+
"production" !== process.env.NODE_ENV && function() {
|
|
642
|
+
function is(x, y) {
|
|
643
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
644
|
+
}
|
|
645
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
646
|
+
didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
647
|
+
"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."
|
|
648
|
+
));
|
|
649
|
+
var value = getSnapshot();
|
|
650
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
651
|
+
var cachedValue = getSnapshot();
|
|
652
|
+
objectIs(value, cachedValue) || (console.error(
|
|
653
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
654
|
+
), didWarnUncachedGetSnapshot = true);
|
|
676
655
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
var
|
|
681
|
-
|
|
682
|
-
{
|
|
683
|
-
if (!didWarnOld18Alpha) {
|
|
684
|
-
if (React.startTransition !== void 0) {
|
|
685
|
-
didWarnOld18Alpha = true;
|
|
686
|
-
error("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.");
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
var value = getSnapshot();
|
|
691
|
-
{
|
|
692
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
693
|
-
var cachedValue = getSnapshot();
|
|
694
|
-
if (!objectIs(value, cachedValue)) {
|
|
695
|
-
error("The result of getSnapshot should be cached to avoid an infinite loop");
|
|
696
|
-
didWarnUncachedGetSnapshot = true;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
var _useState = useState2({
|
|
701
|
-
inst: {
|
|
702
|
-
value,
|
|
703
|
-
getSnapshot
|
|
704
|
-
}
|
|
705
|
-
}), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
706
|
-
useLayoutEffect(function() {
|
|
656
|
+
cachedValue = useState2({
|
|
657
|
+
inst: { value, getSnapshot }
|
|
658
|
+
});
|
|
659
|
+
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
660
|
+
useLayoutEffect(
|
|
661
|
+
function() {
|
|
707
662
|
inst.value = value;
|
|
708
663
|
inst.getSnapshot = getSnapshot;
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
forceUpdate({
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
function checkIfSnapshotChanged(inst) {
|
|
734
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
735
|
-
var prevValue = inst.value;
|
|
736
|
-
try {
|
|
737
|
-
var nextValue = latestGetSnapshot();
|
|
738
|
-
return !objectIs(prevValue, nextValue);
|
|
739
|
-
} catch (error2) {
|
|
740
|
-
return true;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
744
|
-
return getSnapshot();
|
|
745
|
-
}
|
|
746
|
-
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
747
|
-
var isServerEnvironment = !canUseDOM;
|
|
748
|
-
var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
749
|
-
var useSyncExternalStore$2 = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim2;
|
|
750
|
-
useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
|
|
751
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
752
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
664
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
665
|
+
},
|
|
666
|
+
[subscribe, value, getSnapshot]
|
|
667
|
+
);
|
|
668
|
+
useEffect2(
|
|
669
|
+
function() {
|
|
670
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
671
|
+
return subscribe(function() {
|
|
672
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
673
|
+
});
|
|
674
|
+
},
|
|
675
|
+
[subscribe]
|
|
676
|
+
);
|
|
677
|
+
useDebugValue(value);
|
|
678
|
+
return value;
|
|
679
|
+
}
|
|
680
|
+
function checkIfSnapshotChanged(inst) {
|
|
681
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
682
|
+
inst = inst.value;
|
|
683
|
+
try {
|
|
684
|
+
var nextValue = latestGetSnapshot();
|
|
685
|
+
return !objectIs(inst, nextValue);
|
|
686
|
+
} catch (error) {
|
|
687
|
+
return true;
|
|
753
688
|
}
|
|
754
|
-
}
|
|
755
|
-
|
|
689
|
+
}
|
|
690
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
691
|
+
return getSnapshot();
|
|
692
|
+
}
|
|
693
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
694
|
+
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;
|
|
695
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
696
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
697
|
+
}();
|
|
756
698
|
return useSyncExternalStoreShim_development;
|
|
757
699
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
700
|
+
var hasRequiredShim;
|
|
701
|
+
function requireShim() {
|
|
702
|
+
if (hasRequiredShim) return shim.exports;
|
|
703
|
+
hasRequiredShim = 1;
|
|
704
|
+
if (process.env.NODE_ENV === "production") {
|
|
705
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
706
|
+
} else {
|
|
707
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
708
|
+
}
|
|
709
|
+
return shim.exports;
|
|
762
710
|
}
|
|
763
|
-
var shimExports =
|
|
711
|
+
var shimExports = requireShim();
|
|
764
712
|
const $e1995378a142960e$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
|
|
765
713
|
const $e1995378a142960e$var$CollectionDocumentContext = /* @__PURE__ */ createContext(null);
|
|
766
714
|
function $e1995378a142960e$export$bf788dd355e3a401(props) {
|
|
@@ -923,8 +871,9 @@ function $e1995378a142960e$var$CollectionRoot({ children }) {
|
|
|
923
871
|
}
|
|
924
872
|
const $7135fc7d473fd974$export$d40e14dec8b060a8 = /* @__PURE__ */ createContext(null);
|
|
925
873
|
const $7135fc7d473fd974$export$6e2c8f0811a474ce = /* @__PURE__ */ $e1995378a142960e$export$e953bb1cd0f19726("section", (props, ref, section) => {
|
|
926
|
-
let { render } = useContext($7135fc7d473fd974$export$d40e14dec8b060a8);
|
|
927
|
-
|
|
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");
|
|
928
877
|
});
|
|
929
878
|
const $7135fc7d473fd974$export$a164736487e3f0ae = {
|
|
930
879
|
CollectionRoot({ collection, renderDropIndicator }) {
|
|
@@ -1032,7 +981,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
1032
981
|
let { keyboardDelegate, selectionManager, onTypeSelect } = options;
|
|
1033
982
|
let state = useRef({
|
|
1034
983
|
search: "",
|
|
1035
|
-
timeout:
|
|
984
|
+
timeout: void 0
|
|
1036
985
|
}).current;
|
|
1037
986
|
let onKeyDown = (e) => {
|
|
1038
987
|
let character = $fb3050f43d946246$var$getStringForKey(e.key);
|
|
@@ -1042,11 +991,13 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
1042
991
|
if (!("continuePropagation" in e)) e.stopPropagation();
|
|
1043
992
|
}
|
|
1044
993
|
state.search += character;
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
994
|
+
if (keyboardDelegate.getKeyForSearch != null) {
|
|
995
|
+
let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
|
|
996
|
+
if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
|
|
997
|
+
if (key != null) {
|
|
998
|
+
selectionManager.setFocusedKey(key);
|
|
999
|
+
if (onTypeSelect) onTypeSelect(key);
|
|
1000
|
+
}
|
|
1050
1001
|
}
|
|
1051
1002
|
clearTimeout(state.timeout);
|
|
1052
1003
|
state.timeout = setTimeout(() => {
|
|
@@ -1057,7 +1008,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
|
|
|
1057
1008
|
typeSelectProps: {
|
|
1058
1009
|
// Using a capturing listener to catch the keydown event before
|
|
1059
1010
|
// other hooks in order to handle the Spacebar event.
|
|
1060
|
-
onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown :
|
|
1011
|
+
onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0
|
|
1061
1012
|
}
|
|
1062
1013
|
};
|
|
1063
1014
|
}
|
|
@@ -1070,17 +1021,19 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1070
1021
|
let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
1071
1022
|
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
|
|
1072
1023
|
let onKeyDown = (e) => {
|
|
1024
|
+
var _ref_current;
|
|
1073
1025
|
if (e.altKey && e.key === "Tab") e.preventDefault();
|
|
1074
|
-
if (!ref.current.contains(e.target)) return;
|
|
1026
|
+
if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
|
|
1075
1027
|
const navigateToKey = (key, childFocus) => {
|
|
1076
1028
|
if (key != null) {
|
|
1077
1029
|
if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) {
|
|
1030
|
+
var _scrollRef_current;
|
|
1078
1031
|
reactDomExports.flushSync(() => {
|
|
1079
1032
|
manager.setFocusedKey(key, childFocus);
|
|
1080
1033
|
});
|
|
1081
|
-
let item = scrollRef.current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
|
|
1034
|
+
let item = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
|
|
1082
1035
|
let itemProps = manager.getItemProps(key);
|
|
1083
|
-
router.open(item, e, itemProps.href, itemProps.routerOptions);
|
|
1036
|
+
if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
|
|
1084
1037
|
return;
|
|
1085
1038
|
}
|
|
1086
1039
|
manager.setFocusedKey(key, childFocus);
|
|
@@ -1115,7 +1068,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1115
1068
|
case "ArrowLeft":
|
|
1116
1069
|
if (delegate.getKeyLeftOf) {
|
|
1117
1070
|
var _delegate_getKeyLeftOf, _delegate_getFirstKey2, _delegate_getLastKey2;
|
|
1118
|
-
let nextKey = (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey);
|
|
1071
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
|
|
1119
1072
|
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);
|
|
1120
1073
|
if (nextKey != null) {
|
|
1121
1074
|
e.preventDefault();
|
|
@@ -1126,7 +1079,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1126
1079
|
case "ArrowRight":
|
|
1127
1080
|
if (delegate.getKeyRightOf) {
|
|
1128
1081
|
var _delegate_getKeyRightOf, _delegate_getLastKey3, _delegate_getFirstKey3;
|
|
1129
|
-
let nextKey = (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey);
|
|
1082
|
+
let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
|
|
1130
1083
|
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);
|
|
1131
1084
|
if (nextKey != null) {
|
|
1132
1085
|
e.preventDefault();
|
|
@@ -1139,8 +1092,10 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1139
1092
|
e.preventDefault();
|
|
1140
1093
|
let firstKey = delegate.getFirstKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
|
|
1141
1094
|
manager.setFocusedKey(firstKey);
|
|
1142
|
-
if (
|
|
1143
|
-
|
|
1095
|
+
if (firstKey != null) {
|
|
1096
|
+
if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
|
|
1097
|
+
else if (selectOnFocus) manager.replaceSelection(firstKey);
|
|
1098
|
+
}
|
|
1144
1099
|
}
|
|
1145
1100
|
break;
|
|
1146
1101
|
case "End":
|
|
@@ -1148,12 +1103,14 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1148
1103
|
e.preventDefault();
|
|
1149
1104
|
let lastKey = delegate.getLastKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
|
|
1150
1105
|
manager.setFocusedKey(lastKey);
|
|
1151
|
-
if (
|
|
1152
|
-
|
|
1106
|
+
if (lastKey != null) {
|
|
1107
|
+
if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
|
|
1108
|
+
else if (selectOnFocus) manager.replaceSelection(lastKey);
|
|
1109
|
+
}
|
|
1153
1110
|
}
|
|
1154
1111
|
break;
|
|
1155
1112
|
case "PageDown":
|
|
1156
|
-
if (delegate.getKeyPageBelow) {
|
|
1113
|
+
if (delegate.getKeyPageBelow && manager.focusedKey != null) {
|
|
1157
1114
|
let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
|
|
1158
1115
|
if (nextKey != null) {
|
|
1159
1116
|
e.preventDefault();
|
|
@@ -1162,7 +1119,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1162
1119
|
}
|
|
1163
1120
|
break;
|
|
1164
1121
|
case "PageUp":
|
|
1165
|
-
if (delegate.getKeyPageAbove) {
|
|
1122
|
+
if (delegate.getKeyPageAbove && manager.focusedKey != null) {
|
|
1166
1123
|
let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
|
|
1167
1124
|
if (nextKey != null) {
|
|
1168
1125
|
e.preventDefault();
|
|
@@ -1190,7 +1147,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1190
1147
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
|
|
1191
1148
|
tabbable: true
|
|
1192
1149
|
});
|
|
1193
|
-
let next;
|
|
1150
|
+
let next = void 0;
|
|
1194
1151
|
let last;
|
|
1195
1152
|
do {
|
|
1196
1153
|
last = walker.lastChild();
|
|
@@ -1206,10 +1163,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1206
1163
|
top: 0,
|
|
1207
1164
|
left: 0
|
|
1208
1165
|
});
|
|
1209
|
-
$e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ?
|
|
1166
|
+
$e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ? void 0 : () => {
|
|
1167
|
+
var _scrollRef_current, _scrollRef_current1;
|
|
1168
|
+
var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
|
|
1210
1169
|
scrollPos.current = {
|
|
1211
|
-
top: scrollRef.current.scrollTop,
|
|
1212
|
-
left: scrollRef.current.scrollLeft
|
|
1170
|
+
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,
|
|
1171
|
+
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
|
|
1213
1172
|
};
|
|
1214
1173
|
});
|
|
1215
1174
|
let onFocus = (e) => {
|
|
@@ -1220,6 +1179,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1220
1179
|
if (!e.currentTarget.contains(e.target)) return;
|
|
1221
1180
|
manager.setFocused(true);
|
|
1222
1181
|
if (manager.focusedKey == null) {
|
|
1182
|
+
var _delegate_getLastKey, _delegate_getFirstKey;
|
|
1223
1183
|
let navigateToFirstKey = (key) => {
|
|
1224
1184
|
if (key != null) {
|
|
1225
1185
|
manager.setFocusedKey(key);
|
|
@@ -1228,13 +1188,13 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1228
1188
|
};
|
|
1229
1189
|
let relatedTarget = e.relatedTarget;
|
|
1230
1190
|
var _manager_lastSelectedKey, _manager_firstSelectedKey;
|
|
1231
|
-
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : delegate.getLastKey());
|
|
1232
|
-
else navigateToFirstKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : delegate.getFirstKey());
|
|
1233
|
-
} else if (!isVirtualized) {
|
|
1191
|
+
if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_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));
|
|
1192
|
+
else navigateToFirstKey((_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));
|
|
1193
|
+
} else if (!isVirtualized && scrollRef.current) {
|
|
1234
1194
|
scrollRef.current.scrollTop = scrollPos.current.top;
|
|
1235
1195
|
scrollRef.current.scrollLeft = scrollPos.current.left;
|
|
1236
1196
|
}
|
|
1237
|
-
if (manager.focusedKey != null) {
|
|
1197
|
+
if (manager.focusedKey != null && scrollRef.current) {
|
|
1238
1198
|
let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
|
|
1239
1199
|
if (element) {
|
|
1240
1200
|
if (!element.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(element);
|
|
@@ -1251,9 +1211,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1251
1211
|
const autoFocusRef = useRef(autoFocus);
|
|
1252
1212
|
useEffect(() => {
|
|
1253
1213
|
if (autoFocusRef.current) {
|
|
1214
|
+
var _delegate_getFirstKey, _delegate_getLastKey;
|
|
1254
1215
|
let focusedKey = null;
|
|
1255
|
-
|
|
1256
|
-
if (autoFocus === "
|
|
1216
|
+
var _delegate_getFirstKey1;
|
|
1217
|
+
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;
|
|
1218
|
+
var _delegate_getLastKey1;
|
|
1219
|
+
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;
|
|
1257
1220
|
let selectedKeys = manager.selectedKeys;
|
|
1258
1221
|
if (selectedKeys.size) {
|
|
1259
1222
|
for (let key of selectedKeys) if (manager.canSelectItem(key)) {
|
|
@@ -1263,12 +1226,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1263
1226
|
}
|
|
1264
1227
|
manager.setFocused(true);
|
|
1265
1228
|
manager.setFocusedKey(focusedKey);
|
|
1266
|
-
if (focusedKey == null && !shouldUseVirtualFocus) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1229
|
+
if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1267
1230
|
}
|
|
1268
1231
|
}, []);
|
|
1269
1232
|
let lastFocusedKey = useRef(manager.focusedKey);
|
|
1270
1233
|
useEffect(() => {
|
|
1271
|
-
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) &&
|
|
1234
|
+
if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && scrollRef.current && ref.current) {
|
|
1272
1235
|
let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
|
|
1273
1236
|
let element = ref.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
|
|
1274
1237
|
if (!element)
|
|
@@ -1280,7 +1243,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1280
1243
|
});
|
|
1281
1244
|
}
|
|
1282
1245
|
}
|
|
1283
|
-
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1246
|
+
if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1284
1247
|
lastFocusedKey.current = manager.focusedKey;
|
|
1285
1248
|
autoFocusRef.current = false;
|
|
1286
1249
|
});
|
|
@@ -1302,7 +1265,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
|
|
|
1302
1265
|
selectionManager: manager
|
|
1303
1266
|
});
|
|
1304
1267
|
if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
|
|
1305
|
-
let tabIndex;
|
|
1268
|
+
let tabIndex = void 0;
|
|
1306
1269
|
if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
|
|
1307
1270
|
return {
|
|
1308
1271
|
collectionProps: {
|
|
@@ -1319,7 +1282,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1319
1282
|
else {
|
|
1320
1283
|
if (manager.selectionMode === "none") return;
|
|
1321
1284
|
if (manager.isLink(key)) {
|
|
1322
|
-
if (linkBehavior === "selection") {
|
|
1285
|
+
if (linkBehavior === "selection" && ref.current) {
|
|
1323
1286
|
let itemProps2 = manager.getItemProps(key);
|
|
1324
1287
|
router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
|
|
1325
1288
|
manager.setSelectedKeys(manager.selectedKeys);
|
|
@@ -1339,7 +1302,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1339
1302
|
let isFocused = key === manager.focusedKey;
|
|
1340
1303
|
if (isFocused && manager.isFocused && !shouldUseVirtualFocus) {
|
|
1341
1304
|
if (focus) focus();
|
|
1342
|
-
else if (document.activeElement !== ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1305
|
+
else if (document.activeElement !== ref.current && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
|
|
1343
1306
|
}
|
|
1344
1307
|
}, [
|
|
1345
1308
|
ref,
|
|
@@ -1373,7 +1336,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1373
1336
|
let hadPrimaryActionOnPressStart = useRef(false);
|
|
1374
1337
|
let performAction = (e) => {
|
|
1375
1338
|
if (onAction) onAction();
|
|
1376
|
-
if (hasLinkAction) {
|
|
1339
|
+
if (hasLinkAction && ref.current) {
|
|
1377
1340
|
let itemProps2 = manager.getItemProps(key);
|
|
1378
1341
|
router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
|
|
1379
1342
|
}
|
|
@@ -1392,10 +1355,10 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
|
|
|
1392
1355
|
} else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
|
|
1393
1356
|
};
|
|
1394
1357
|
else {
|
|
1395
|
-
itemPressProps.onPressUp = hasPrimaryAction ?
|
|
1358
|
+
itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
|
|
1396
1359
|
if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
|
|
1397
1360
|
};
|
|
1398
|
-
itemPressProps.onPress = hasPrimaryAction ? performAction :
|
|
1361
|
+
itemPressProps.onPress = hasPrimaryAction ? performAction : void 0;
|
|
1399
1362
|
}
|
|
1400
1363
|
} else {
|
|
1401
1364
|
itemPressProps.onPressStart = (e) => {
|
|
@@ -1471,15 +1434,20 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
1471
1434
|
});
|
|
1472
1435
|
else if (typeof children === "function") {
|
|
1473
1436
|
if (!items) throw new Error("props.children was a function but props.items is missing");
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1437
|
+
let index = 0;
|
|
1438
|
+
for (let item of items) {
|
|
1439
|
+
yield* this.getFullNode({
|
|
1440
|
+
value: item,
|
|
1441
|
+
index
|
|
1442
|
+
}, {
|
|
1443
|
+
renderer: children
|
|
1444
|
+
});
|
|
1445
|
+
index++;
|
|
1446
|
+
}
|
|
1479
1447
|
} else {
|
|
1480
1448
|
let items2 = [];
|
|
1481
1449
|
React__default.Children.forEach(children, (child) => {
|
|
1482
|
-
items2.push(child);
|
|
1450
|
+
if (child) items2.push(child);
|
|
1483
1451
|
});
|
|
1484
1452
|
let index = 0;
|
|
1485
1453
|
for (let item of items2) {
|
|
@@ -1517,7 +1485,8 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
1517
1485
|
React__default.Children.forEach(partialNode.element.props.children, (child) => {
|
|
1518
1486
|
children.push(child);
|
|
1519
1487
|
});
|
|
1520
|
-
|
|
1488
|
+
var _partialNode_index;
|
|
1489
|
+
let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !== void 0 ? _partialNode_index : 0;
|
|
1521
1490
|
for (const child of children) yield* this.getFullNode({
|
|
1522
1491
|
element: child,
|
|
1523
1492
|
index: index++
|
|
@@ -1538,17 +1507,19 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
1538
1507
|
if (React__default.isValidElement(element)) {
|
|
1539
1508
|
let type = element.type;
|
|
1540
1509
|
if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
|
|
1541
|
-
let name =
|
|
1510
|
+
let name = element.type;
|
|
1542
1511
|
throw new Error(`Unknown element <${name}> in collection.`);
|
|
1543
1512
|
}
|
|
1544
1513
|
let childNodes = type.getCollectionNode(element.props, this.context);
|
|
1545
|
-
|
|
1514
|
+
var _partialNode_index1;
|
|
1515
|
+
let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !== void 0 ? _partialNode_index1 : 0;
|
|
1546
1516
|
let result = childNodes.next();
|
|
1547
1517
|
while (!result.done && result.value) {
|
|
1548
1518
|
let childNode = result.value;
|
|
1549
1519
|
partialNode.index = index;
|
|
1550
|
-
|
|
1551
|
-
|
|
1520
|
+
var _childNode_key;
|
|
1521
|
+
let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !== void 0 ? _childNode_key : null;
|
|
1522
|
+
if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
|
|
1552
1523
|
let nodes = this.getFullNode({
|
|
1553
1524
|
...childNode,
|
|
1554
1525
|
key: nodeKey,
|
|
@@ -1559,9 +1530,11 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
1559
1530
|
...nodes
|
|
1560
1531
|
];
|
|
1561
1532
|
for (let node2 of children) {
|
|
1562
|
-
|
|
1533
|
+
var _childNode_value, _ref;
|
|
1534
|
+
node2.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !== void 0 ? _childNode_value : partialNode.value) !== null && _ref !== void 0 ? _ref : null;
|
|
1563
1535
|
if (node2.value) this.cache.set(node2.value, node2);
|
|
1564
|
-
|
|
1536
|
+
var _parentNode_type;
|
|
1537
|
+
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.`);
|
|
1565
1538
|
index++;
|
|
1566
1539
|
yield node2;
|
|
1567
1540
|
}
|
|
@@ -1569,30 +1542,33 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
|
|
|
1569
1542
|
}
|
|
1570
1543
|
return;
|
|
1571
1544
|
}
|
|
1572
|
-
if (partialNode.key == null) return;
|
|
1545
|
+
if (partialNode.key == null || partialNode.type == null) return;
|
|
1573
1546
|
let builder = this;
|
|
1547
|
+
var _partialNode_value, _partialNode_textValue;
|
|
1574
1548
|
let node = {
|
|
1575
1549
|
type: partialNode.type,
|
|
1576
1550
|
props: partialNode.props,
|
|
1577
1551
|
key: partialNode.key,
|
|
1578
1552
|
parentKey: parentNode ? parentNode.key : null,
|
|
1579
|
-
value: partialNode.value,
|
|
1553
|
+
value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !== void 0 ? _partialNode_value : null,
|
|
1580
1554
|
level: parentNode ? parentNode.level + 1 : 0,
|
|
1581
1555
|
index: partialNode.index,
|
|
1582
1556
|
rendered: partialNode.rendered,
|
|
1583
|
-
textValue: partialNode.textValue,
|
|
1557
|
+
textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !== void 0 ? _partialNode_textValue : "",
|
|
1584
1558
|
"aria-label": partialNode["aria-label"],
|
|
1585
1559
|
wrapper: partialNode.wrapper,
|
|
1586
1560
|
shouldInvalidate: partialNode.shouldInvalidate,
|
|
1587
|
-
hasChildNodes: partialNode.hasChildNodes,
|
|
1561
|
+
hasChildNodes: partialNode.hasChildNodes || false,
|
|
1588
1562
|
childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
|
|
1589
|
-
if (!partialNode.hasChildNodes) return;
|
|
1563
|
+
if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
|
|
1590
1564
|
let index = 0;
|
|
1591
1565
|
for (let child of partialNode.childNodes()) {
|
|
1592
1566
|
if (child.key != null)
|
|
1593
1567
|
child.key = `${node.key}${child.key}`;
|
|
1594
|
-
|
|
1595
|
-
|
|
1568
|
+
let nodes = builder.getFullNode({
|
|
1569
|
+
...child,
|
|
1570
|
+
index
|
|
1571
|
+
}, builder.getChildState(state, child), node.key, node);
|
|
1596
1572
|
for (let node2 of nodes) {
|
|
1597
1573
|
index++;
|
|
1598
1574
|
yield node2;
|
|
@@ -1682,9 +1658,10 @@ function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
|
|
|
1682
1658
|
}
|
|
1683
1659
|
function $c5a24bc478652b5f$var$getAncestors(collection, node) {
|
|
1684
1660
|
let parents = [];
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1661
|
+
let currNode = node;
|
|
1662
|
+
while ((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null) {
|
|
1663
|
+
currNode = collection.getItem(currNode.parentKey);
|
|
1664
|
+
if (currNode) parents.unshift(currNode);
|
|
1688
1665
|
}
|
|
1689
1666
|
return parents;
|
|
1690
1667
|
}
|
|
@@ -1695,8 +1672,8 @@ class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
|
|
|
1695
1672
|
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : keys.anchorKey;
|
|
1696
1673
|
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : keys.currentKey;
|
|
1697
1674
|
} else {
|
|
1698
|
-
this.anchorKey = anchorKey;
|
|
1699
|
-
this.currentKey = currentKey;
|
|
1675
|
+
this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : null;
|
|
1676
|
+
this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : null;
|
|
1700
1677
|
}
|
|
1701
1678
|
}
|
|
1702
1679
|
}
|
|
@@ -1708,7 +1685,7 @@ function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
|
|
|
1708
1685
|
return true;
|
|
1709
1686
|
}
|
|
1710
1687
|
function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
|
|
1711
|
-
let { selectionMode = "none", disallowEmptySelection, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
|
|
1688
|
+
let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
|
|
1712
1689
|
let isFocusedRef = useRef(false);
|
|
1713
1690
|
let [, setFocused] = useState(false);
|
|
1714
1691
|
let focusedKeyRef = useRef(null);
|
|
@@ -1841,8 +1818,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1841
1818
|
*/
|
|
1842
1819
|
isSelected(key) {
|
|
1843
1820
|
if (this.state.selectionMode === "none") return false;
|
|
1844
|
-
|
|
1845
|
-
|
|
1821
|
+
let mappedKey = this.getKey(key);
|
|
1822
|
+
if (mappedKey == null) return false;
|
|
1823
|
+
return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
|
|
1846
1824
|
}
|
|
1847
1825
|
/**
|
|
1848
1826
|
* Whether the selection is empty.
|
|
@@ -1868,7 +1846,8 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1868
1846
|
let item = this.collection.getItem(key);
|
|
1869
1847
|
if (!first || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
|
|
1870
1848
|
}
|
|
1871
|
-
|
|
1849
|
+
var _first_key;
|
|
1850
|
+
return (_first_key = first === null || first === void 0 ? void 0 : first.key) !== null && _first_key !== void 0 ? _first_key : null;
|
|
1872
1851
|
}
|
|
1873
1852
|
get lastSelectedKey() {
|
|
1874
1853
|
let last = null;
|
|
@@ -1876,7 +1855,8 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1876
1855
|
let item = this.collection.getItem(key);
|
|
1877
1856
|
if (!last || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
|
|
1878
1857
|
}
|
|
1879
|
-
|
|
1858
|
+
var _last_key;
|
|
1859
|
+
return (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
|
|
1880
1860
|
}
|
|
1881
1861
|
get disabledKeys() {
|
|
1882
1862
|
return this.state.disabledKeys;
|
|
@@ -1893,19 +1873,20 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1893
1873
|
this.replaceSelection(toKey);
|
|
1894
1874
|
return;
|
|
1895
1875
|
}
|
|
1896
|
-
|
|
1876
|
+
let mappedToKey = this.getKey(toKey);
|
|
1877
|
+
if (mappedToKey == null) return;
|
|
1897
1878
|
let selection;
|
|
1898
1879
|
if (this.state.selectedKeys === "all") selection = new $e40ea825a81a3709$export$52baac22726c72bf([
|
|
1899
|
-
|
|
1900
|
-
],
|
|
1880
|
+
mappedToKey
|
|
1881
|
+
], mappedToKey, mappedToKey);
|
|
1901
1882
|
else {
|
|
1902
1883
|
let selectedKeys = this.state.selectedKeys;
|
|
1903
1884
|
var _selectedKeys_anchorKey;
|
|
1904
|
-
let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey :
|
|
1905
|
-
selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey,
|
|
1885
|
+
let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : mappedToKey;
|
|
1886
|
+
selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
|
|
1906
1887
|
var _selectedKeys_currentKey;
|
|
1907
|
-
for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey :
|
|
1908
|
-
for (let key of this.getKeyRange(
|
|
1888
|
+
for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : mappedToKey)) selection.delete(key);
|
|
1889
|
+
for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
|
|
1909
1890
|
}
|
|
1910
1891
|
this.state.setSelectedKeys(selection);
|
|
1911
1892
|
}
|
|
@@ -1925,7 +1906,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1925
1906
|
let key = from;
|
|
1926
1907
|
while (key != null) {
|
|
1927
1908
|
let item = this.collection.getItem(key);
|
|
1928
|
-
if (item && item.type === "item" || item.type === "cell" && this.allowsCellSelection) keys.push(key);
|
|
1909
|
+
if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
|
|
1929
1910
|
if (key === to) return keys;
|
|
1930
1911
|
key = this.collection.getKeyAfter(key);
|
|
1931
1912
|
}
|
|
@@ -1936,7 +1917,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1936
1917
|
if (!item)
|
|
1937
1918
|
return key;
|
|
1938
1919
|
if (item.type === "cell" && this.allowsCellSelection) return key;
|
|
1939
|
-
while (item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
|
|
1920
|
+
while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
|
|
1940
1921
|
if (!item || item.type !== "item") return null;
|
|
1941
1922
|
return item.key;
|
|
1942
1923
|
}
|
|
@@ -1949,14 +1930,14 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1949
1930
|
this.replaceSelection(key);
|
|
1950
1931
|
return;
|
|
1951
1932
|
}
|
|
1952
|
-
|
|
1953
|
-
if (
|
|
1933
|
+
let mappedKey = this.getKey(key);
|
|
1934
|
+
if (mappedKey == null) return;
|
|
1954
1935
|
let keys = new $e40ea825a81a3709$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
|
|
1955
|
-
if (keys.has(
|
|
1956
|
-
else if (this.canSelectItem(
|
|
1957
|
-
keys.add(
|
|
1958
|
-
keys.anchorKey =
|
|
1959
|
-
keys.currentKey =
|
|
1936
|
+
if (keys.has(mappedKey)) keys.delete(mappedKey);
|
|
1937
|
+
else if (this.canSelectItem(mappedKey)) {
|
|
1938
|
+
keys.add(mappedKey);
|
|
1939
|
+
keys.anchorKey = mappedKey;
|
|
1940
|
+
keys.currentKey = mappedKey;
|
|
1960
1941
|
}
|
|
1961
1942
|
if (this.disallowEmptySelection && keys.size === 0) return;
|
|
1962
1943
|
this.state.setSelectedKeys(keys);
|
|
@@ -1966,11 +1947,11 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1966
1947
|
*/
|
|
1967
1948
|
replaceSelection(key) {
|
|
1968
1949
|
if (this.selectionMode === "none") return;
|
|
1969
|
-
|
|
1970
|
-
if (
|
|
1971
|
-
let selection = this.canSelectItem(
|
|
1972
|
-
|
|
1973
|
-
],
|
|
1950
|
+
let mappedKey = this.getKey(key);
|
|
1951
|
+
if (mappedKey == null) return;
|
|
1952
|
+
let selection = this.canSelectItem(mappedKey) ? new $e40ea825a81a3709$export$52baac22726c72bf([
|
|
1953
|
+
mappedKey
|
|
1954
|
+
], mappedKey, mappedKey) : new $e40ea825a81a3709$export$52baac22726c72bf();
|
|
1974
1955
|
this.state.setSelectedKeys(selection);
|
|
1975
1956
|
}
|
|
1976
1957
|
/**
|
|
@@ -1980,9 +1961,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1980
1961
|
if (this.selectionMode === "none") return;
|
|
1981
1962
|
let selection = new $e40ea825a81a3709$export$52baac22726c72bf();
|
|
1982
1963
|
for (let key of keys) {
|
|
1983
|
-
|
|
1984
|
-
if (
|
|
1985
|
-
selection.add(
|
|
1964
|
+
let mappedKey = this.getKey(key);
|
|
1965
|
+
if (mappedKey != null) {
|
|
1966
|
+
selection.add(mappedKey);
|
|
1986
1967
|
if (this.selectionMode === "single") break;
|
|
1987
1968
|
}
|
|
1988
1969
|
}
|
|
@@ -1993,9 +1974,11 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
1993
1974
|
let addKeys = (key) => {
|
|
1994
1975
|
while (key != null) {
|
|
1995
1976
|
if (this.canSelectItem(key)) {
|
|
1977
|
+
var _getFirstItem;
|
|
1996
1978
|
let item = this.collection.getItem(key);
|
|
1997
|
-
if (item.type === "item") keys.push(key);
|
|
1998
|
-
|
|
1979
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === "item") keys.push(key);
|
|
1980
|
+
var _getFirstItem_key;
|
|
1981
|
+
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);
|
|
1999
1982
|
}
|
|
2000
1983
|
key = this.collection.getKeyAfter(key);
|
|
2001
1984
|
}
|
|
@@ -2075,19 +2058,21 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
|
|
|
2075
2058
|
}
|
|
2076
2059
|
}
|
|
2077
2060
|
export {
|
|
2078
|
-
$
|
|
2079
|
-
$
|
|
2080
|
-
$
|
|
2081
|
-
$
|
|
2082
|
-
$
|
|
2083
|
-
$e1995378a142960e$export$
|
|
2084
|
-
$e1995378a142960e$export$
|
|
2085
|
-
$
|
|
2086
|
-
$7135fc7d473fd974$export$
|
|
2087
|
-
$
|
|
2088
|
-
$
|
|
2089
|
-
$
|
|
2090
|
-
$
|
|
2091
|
-
$7135fc7d473fd974$export$
|
|
2092
|
-
$
|
|
2061
|
+
$7135fc7d473fd974$export$6e2c8f0811a474ce as $,
|
|
2062
|
+
$7af3f5b51489e0b5$export$253fe78d46329472 as a,
|
|
2063
|
+
$7613b1592d41b092$export$6cd28814d92fa9c9 as b,
|
|
2064
|
+
$d496c0a20b6e58ec$export$6c8a5aaad13c9852 as c,
|
|
2065
|
+
$880e95eb8b93ba9a$export$ecf600387e221c37 as d,
|
|
2066
|
+
$e1995378a142960e$export$18af5c7a9e9b3664 as e,
|
|
2067
|
+
$e1995378a142960e$export$bf788dd355e3a401 as f,
|
|
2068
|
+
$e1995378a142960e$export$fb8073518f34e6ec as g,
|
|
2069
|
+
$7135fc7d473fd974$export$4feb769f8ddf26c5 as h,
|
|
2070
|
+
$7135fc7d473fd974$export$d40e14dec8b060a8 as i,
|
|
2071
|
+
$cc38e7bd3fc7b213$export$2bb74740c4e19def as j,
|
|
2072
|
+
$ae20dd8cbca75726$export$d6daf82dcd84e87c as k,
|
|
2073
|
+
$c5a24bc478652b5f$export$1005530eda016c13 as l,
|
|
2074
|
+
$7135fc7d473fd974$export$90e00781bc59d8f9 as m,
|
|
2075
|
+
$fb3050f43d946246$export$e32c88dfddc6e1d8 as n,
|
|
2076
|
+
$8a26561d2877236e$export$c24ed0104d07eab9 as o,
|
|
2077
|
+
$e1995378a142960e$export$e953bb1cd0f19726 as p
|
|
2093
2078
|
};
|