@eightshift/ui-components 1.7.2 → 1.8.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.
Files changed (111) hide show
  1. package/dist/{Button-VbCAu4hd.js → Button-Xa6Ny0p_.js} +7 -7
  2. package/dist/{Color-BpLubxWI.js → Color-VsesNqCf.js} +5 -17
  3. package/dist/{ColorSwatch-CinC14s3.js → ColorSwatch-xOFAZO_h.js} +4 -4
  4. package/dist/ComboBox-CP_SqnqT.js +1886 -0
  5. package/dist/Dialog-jcIYer1n.js +2177 -0
  6. package/dist/{FieldError-BttM1Nxd.js → FieldError-BPe3YgNH.js} +2 -2
  7. package/dist/{FocusScope-CtCX0OGo.js → FocusScope-uV-xoRHT.js} +8 -9
  8. package/dist/{Group-XzWUooix.js → Group-Bvmb49y7.js} +5 -5
  9. package/dist/{Heading-DZelepHV.js → Heading-Bfhyr4ZC.js} +1 -1
  10. package/dist/{Hidden-CcFqOzrp.js → Hidden-7ZhNuLM9.js} +2 -2
  11. package/dist/{Input-CV1qVS6t.js → Input-C2dTSp9z.js} +10 -10
  12. package/dist/{Label-BwqMVkuV.js → Label-DqNX_sAU.js} +2 -2
  13. package/dist/{List-Bx2anbX-.js → List-C7L49CxW.js} +1 -1
  14. package/dist/{ListBox-DuZPdnkk.js → ListBox-B9r1QoSm.js} +19 -18
  15. package/dist/{NumberFormatter-U_Gx0UDq.js → NumberFormatter-DA8u1Ot7.js} +4 -6
  16. package/dist/OverlayArrow-ClRhYjQu.js +567 -0
  17. package/dist/{Select-c7902d94.esm-DtzFQzf-.js → Select-aab027f3.esm-B8nEum75.js} +4 -4
  18. package/dist/{SelectionManager-x27KqnAT.js → SelectionManager-DP537Pbu.js} +177 -141
  19. package/dist/{Separator-BM58t3PP.js → Separator-Dmxzf3m_.js} +62 -52
  20. package/dist/{Slider-D9Cs6yKr.js → Slider-BgHBCyI7.js} +16 -14
  21. package/dist/{Text-BVIXT8qq.js → Text-DImhB4rT.js} +1 -1
  22. package/dist/{VisuallyHidden-WhC7vZaL.js → VisuallyHidden-wryJF4qQ.js} +2 -2
  23. package/dist/assets/style.css +1 -1
  24. package/dist/assets/wp-ui-enhancements.css +1 -1
  25. package/dist/components/animated-visibility/animated-visibility.js +141 -113
  26. package/dist/components/base-control/base-control.js +1 -1
  27. package/dist/components/button/button.js +10 -7
  28. package/dist/components/checkbox/checkbox.js +19 -11
  29. package/dist/components/color-pickers/color-picker.js +1 -1
  30. package/dist/components/color-pickers/color-swatch.js +3 -3
  31. package/dist/components/color-pickers/gradient-editor.js +2 -2
  32. package/dist/components/color-pickers/solid-color-picker.js +21 -21
  33. package/dist/components/component-toggle/component-toggle.js +1 -1
  34. package/dist/components/draggable/draggable-handle.js +2 -2
  35. package/dist/components/draggable/draggable.js +2 -2
  36. package/dist/components/draggable-list/draggable-list-item.js +2 -2
  37. package/dist/components/draggable-list/draggable-list.js +2 -2
  38. package/dist/components/expandable/expandable.js +3 -3
  39. package/dist/components/index.js +8 -4
  40. package/dist/components/input-field/input-field.js +7 -7
  41. package/dist/components/item-collection/item-collection.js +1 -1
  42. package/dist/components/link-input/link-input.js +10 -1872
  43. package/dist/components/list-box/list-box.js +2 -2
  44. package/dist/components/matrix-align/matrix-align.js +2 -2
  45. package/dist/components/menu/menu.js +7 -974
  46. package/dist/components/modal/modal.js +7 -7
  47. package/dist/components/number-picker/number-picker.js +10 -10
  48. package/dist/components/option-select/option-select.js +1 -1
  49. package/dist/components/options-panel/options-panel.js +1 -1
  50. package/dist/components/placeholders/file-placeholder.js +1 -1
  51. package/dist/components/popover/popover.js +2 -2
  52. package/dist/components/radio/radio.js +13 -13
  53. package/dist/components/repeater/repeater-item.js +1 -1
  54. package/dist/components/repeater/repeater.js +2 -2
  55. package/dist/components/responsive/mini-responsive.js +3 -3
  56. package/dist/components/responsive/responsive-legacy.js +2 -2
  57. package/dist/components/responsive/responsive.js +2 -2
  58. package/dist/components/responsive-preview/responsive-preview.js +1 -1
  59. package/dist/components/select/async-multi-select.js +3 -3
  60. package/dist/components/select/async-single-select.js +2 -2
  61. package/dist/components/select/custom-select-default-components.js +1 -1
  62. package/dist/components/select/multi-select-components.js +1 -1
  63. package/dist/components/select/multi-select.js +3 -3
  64. package/dist/components/select/react-select-component-wrappers.js +1 -1
  65. package/dist/components/select/single-select.js +2 -2
  66. package/dist/components/select/v2/async-select.js +307 -0
  67. package/dist/components/select/v2/shared.js +24 -0
  68. package/dist/components/select/v2/single-select.js +993 -0
  69. package/dist/components/slider/column-config-slider.js +3 -3
  70. package/dist/components/slider/slider.js +3 -3
  71. package/dist/components/slider/utils.js +1 -1
  72. package/dist/components/tabs/tabs.js +16 -16
  73. package/dist/components/toggle/switch.js +6 -6
  74. package/dist/components/toggle/toggle.js +1 -1
  75. package/dist/components/toggle-button/toggle-button.js +55 -12
  76. package/dist/components/tooltip/tooltip.js +532 -8
  77. package/dist/{context-Cs-ZD1nu.js → context-BI3VdU0Z.js} +2 -2
  78. package/dist/{default-i18n-DRnM8y4w.js → default-i18n-CM1-Xvzf.js} +183 -176
  79. package/dist/{focusSafely-CgFLw4FA.js → focusSafely-Cl9cN7Qx.js} +14 -14
  80. package/dist/icons/icons.js +19 -0
  81. package/dist/icons/jsx-svg.js +16 -3
  82. package/dist/{index-a301f526.esm-BMg114iK.js → index-641ee5b8.esm-BclOH4xf.js} +165 -29
  83. package/dist/{index-BTCzc3zb.js → index-D0mHceYg.js} +81 -17
  84. package/dist/index.js +7 -3
  85. package/dist/{multi-select-components-DTvEidE3.js → multi-select-components-BGQBvx-z.js} +55 -44
  86. package/dist/{react-jsx-parser.min-B5HVwW_W.js → react-jsx-parser.min-CVit0rZn.js} +5620 -7409
  87. package/dist/{react-select-async.esm-CxA8wpeT.js → react-select-async.esm-B8kK0aL4.js} +3 -3
  88. package/dist/{react-select.esm-CeE7o5M9.js → react-select.esm-ucYwBxq5.js} +3 -3
  89. package/dist/{textSelection-CvK0YHTZ.js → textSelection-DDDNsS-g.js} +1 -1
  90. package/dist/{useButton-Cy9eEev7.js → useButton-CRKy9xk2.js} +4 -4
  91. package/dist/{useEvent-LZebwyrb.js → useEvent-D54lIBrO.js} +1 -1
  92. package/dist/{useFocusRing-BMOTWmOx.js → useFocusRing-DKxoCzVD.js} +1 -1
  93. package/dist/{useFocusable-ByyKSVQv.js → useFocusable-CPKTGWPn.js} +4 -4
  94. package/dist/{useFormReset-B8m1uz1J.js → useFormReset-CTp--h9B.js} +1 -1
  95. package/dist/{useFormValidationState-BjMhz_VI.js → useFormValidation-BNBrliSj.js} +92 -88
  96. package/dist/{useLabel-B6uO0wVK.js → useLabel-CzGdEzIq.js} +2 -2
  97. package/dist/{useLabels-5dFkeiXx.js → useLabels-eGSmZC_Z.js} +1 -1
  98. package/dist/{useListState-eKxv7HPC.js → useListState-D7mE1Y00.js} +1 -1
  99. package/dist/{useLocalizedStringFormatter-BaKmjFNp.js → useLocalizedStringFormatter-BBeUyA9l.js} +1 -1
  100. package/dist/{useNumberField-DMMUTZ-h.js → useNumberField-BmEJmL3K.js} +27 -20
  101. package/dist/{useNumberFormatter-Cyx5Dxkf.js → useNumberFormatter-CTY_UZxq.js} +2 -2
  102. package/dist/{usePress-D8nPoIQm.js → usePress-BG9At5Lb.js} +4 -4
  103. package/dist/{useSingleSelectListState-CABciySJ.js → useSingleSelectListState-DeJEr7lC.js} +2 -2
  104. package/dist/{useToggle-BmltE9Zr.js → useToggle-QlyoyPYv.js} +4 -4
  105. package/dist/{useToggleState-DZXLEnA_.js → useToggleState-C1mnFRiI.js} +1 -1
  106. package/dist/{utils-BCJajCwh.js → utils-BSxcP7tv.js} +15 -14
  107. package/package.json +20 -20
  108. package/dist/Dialog-BN5EE7UH.js +0 -934
  109. package/dist/isScrollable-Dh9D9IOd.js +0 -9
  110. package/dist/tooltip-eKaARDoV.js +0 -1084
  111. 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-CcFqOzrp.js";
3
- import { r as reactDomExports } from "./index-BTCzc3zb.js";
4
- import { j as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, d as $b5e257d569688ac6$export$535bd6ca7f90a273, c as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-BCJajCwh.js";
5
- import { b as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-CtCX0OGo.js";
6
- import { w as $c87311424ea30a05$export$e1865c3bedcd822b, n as $c87311424ea30a05$export$9ac100e40613ea10, h as $6a99195332edec8b$export$80f3e147d781571c, u as $507fabe10e71c6fb$export$630ff653c5ada6a9, m as $7215afc6de606d6b$export$de79e2c695e052f3, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./focusSafely-CgFLw4FA.js";
7
- import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-D8nPoIQm.js";
8
- import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-LZebwyrb.js";
9
- import { $ as $cc38e7bd3fc7b213$export$2bb74740c4e19def } from "./isScrollable-Dh9D9IOd.js";
10
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-Cs-ZD1nu.js";
11
- import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-CvK0YHTZ.js";
2
+ import { a as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-7ZhNuLM9.js";
3
+ import { r as reactDomExports } from "./index-D0mHceYg.js";
4
+ import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, e as $b5e257d569688ac6$export$535bd6ca7f90a273, d as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-BSxcP7tv.js";
5
+ import { b as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-uV-xoRHT.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-Cl9cN7Qx.js";
7
+ import { $ as $f6c31cce2adf654f$export$45712eceda6fad21, b as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, c as $ea8dcbcb9ea1b556$export$95185d699e05d4d7 } from "./usePress-BG9At5Lb.js";
8
+ import { $ as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-D54lIBrO.js";
9
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-BI3VdU0Z.js";
10
+ import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "./textSelection-DDDNsS-g.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) {
@@ -755,12 +748,18 @@ function requireUseSyncExternalStoreShim_development() {
755
748
  }
756
749
  return useSyncExternalStoreShim_development;
757
750
  }
758
- if (process.env.NODE_ENV === "production") {
759
- shim.exports = requireUseSyncExternalStoreShim_production_min();
760
- } else {
761
- shim.exports = requireUseSyncExternalStoreShim_development();
751
+ var hasRequiredShim;
752
+ function requireShim() {
753
+ if (hasRequiredShim) return shim.exports;
754
+ hasRequiredShim = 1;
755
+ if (process.env.NODE_ENV === "production") {
756
+ shim.exports = requireUseSyncExternalStoreShim_production_min();
757
+ } else {
758
+ shim.exports = requireUseSyncExternalStoreShim_development();
759
+ }
760
+ return shim.exports;
762
761
  }
763
- var shimExports = shim.exports;
762
+ var shimExports = requireShim();
764
763
  const $e1995378a142960e$var$ShallowRenderContext = /* @__PURE__ */ createContext(false);
765
764
  const $e1995378a142960e$var$CollectionDocumentContext = /* @__PURE__ */ createContext(null);
766
765
  function $e1995378a142960e$export$bf788dd355e3a401(props) {
@@ -923,8 +922,9 @@ function $e1995378a142960e$var$CollectionRoot({ children }) {
923
922
  }
924
923
  const $7135fc7d473fd974$export$d40e14dec8b060a8 = /* @__PURE__ */ createContext(null);
925
924
  const $7135fc7d473fd974$export$6e2c8f0811a474ce = /* @__PURE__ */ $e1995378a142960e$export$e953bb1cd0f19726("section", (props, ref, section) => {
926
- let { render } = useContext($7135fc7d473fd974$export$d40e14dec8b060a8);
927
- return render(props, ref, section);
925
+ let { name, render } = useContext($7135fc7d473fd974$export$d40e14dec8b060a8);
926
+ console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
927
+ return render(props, ref, section, "react-aria-Section");
928
928
  });
929
929
  const $7135fc7d473fd974$export$a164736487e3f0ae = {
930
930
  CollectionRoot({ collection, renderDropIndicator }) {
@@ -1032,7 +1032,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
1032
1032
  let { keyboardDelegate, selectionManager, onTypeSelect } = options;
1033
1033
  let state = useRef({
1034
1034
  search: "",
1035
- timeout: null
1035
+ timeout: void 0
1036
1036
  }).current;
1037
1037
  let onKeyDown = (e) => {
1038
1038
  let character = $fb3050f43d946246$var$getStringForKey(e.key);
@@ -1042,11 +1042,13 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
1042
1042
  if (!("continuePropagation" in e)) e.stopPropagation();
1043
1043
  }
1044
1044
  state.search += character;
1045
- let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
1046
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
1047
- if (key != null) {
1048
- selectionManager.setFocusedKey(key);
1049
- if (onTypeSelect) onTypeSelect(key);
1045
+ if (keyboardDelegate.getKeyForSearch != null) {
1046
+ let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
1047
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
1048
+ if (key != null) {
1049
+ selectionManager.setFocusedKey(key);
1050
+ if (onTypeSelect) onTypeSelect(key);
1051
+ }
1050
1052
  }
1051
1053
  clearTimeout(state.timeout);
1052
1054
  state.timeout = setTimeout(() => {
@@ -1057,7 +1059,7 @@ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
1057
1059
  typeSelectProps: {
1058
1060
  // Using a capturing listener to catch the keydown event before
1059
1061
  // other hooks in order to handle the Spacebar event.
1060
- onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null
1062
+ onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0
1061
1063
  }
1062
1064
  };
1063
1065
  }
@@ -1070,17 +1072,19 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1070
1072
  let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
1071
1073
  let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
1072
1074
  let onKeyDown = (e) => {
1075
+ var _ref_current;
1073
1076
  if (e.altKey && e.key === "Tab") e.preventDefault();
1074
- if (!ref.current.contains(e.target)) return;
1077
+ if (!((_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.contains(e.target))) return;
1075
1078
  const navigateToKey = (key, childFocus) => {
1076
1079
  if (key != null) {
1077
1080
  if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) {
1081
+ var _scrollRef_current;
1078
1082
  reactDomExports.flushSync(() => {
1079
1083
  manager.setFocusedKey(key, childFocus);
1080
1084
  });
1081
- let item = scrollRef.current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
1085
+ let item = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.querySelector(`[data-key="${CSS.escape(key.toString())}"]`);
1082
1086
  let itemProps = manager.getItemProps(key);
1083
- router.open(item, e, itemProps.href, itemProps.routerOptions);
1087
+ if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
1084
1088
  return;
1085
1089
  }
1086
1090
  manager.setFocusedKey(key, childFocus);
@@ -1115,7 +1119,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1115
1119
  case "ArrowLeft":
1116
1120
  if (delegate.getKeyLeftOf) {
1117
1121
  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);
1122
+ let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
1119
1123
  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
1124
  if (nextKey != null) {
1121
1125
  e.preventDefault();
@@ -1126,7 +1130,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1126
1130
  case "ArrowRight":
1127
1131
  if (delegate.getKeyRightOf) {
1128
1132
  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);
1133
+ let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
1130
1134
  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
1135
  if (nextKey != null) {
1132
1136
  e.preventDefault();
@@ -1139,8 +1143,10 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1139
1143
  e.preventDefault();
1140
1144
  let firstKey = delegate.getFirstKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
1141
1145
  manager.setFocusedKey(firstKey);
1142
- if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
1143
- else if (selectOnFocus) manager.replaceSelection(firstKey);
1146
+ if (firstKey != null) {
1147
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
1148
+ else if (selectOnFocus) manager.replaceSelection(firstKey);
1149
+ }
1144
1150
  }
1145
1151
  break;
1146
1152
  case "End":
@@ -1148,12 +1154,14 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1148
1154
  e.preventDefault();
1149
1155
  let lastKey = delegate.getLastKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
1150
1156
  manager.setFocusedKey(lastKey);
1151
- if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
1152
- else if (selectOnFocus) manager.replaceSelection(lastKey);
1157
+ if (lastKey != null) {
1158
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
1159
+ else if (selectOnFocus) manager.replaceSelection(lastKey);
1160
+ }
1153
1161
  }
1154
1162
  break;
1155
1163
  case "PageDown":
1156
- if (delegate.getKeyPageBelow) {
1164
+ if (delegate.getKeyPageBelow && manager.focusedKey != null) {
1157
1165
  let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
1158
1166
  if (nextKey != null) {
1159
1167
  e.preventDefault();
@@ -1162,7 +1170,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1162
1170
  }
1163
1171
  break;
1164
1172
  case "PageUp":
1165
- if (delegate.getKeyPageAbove) {
1173
+ if (delegate.getKeyPageAbove && manager.focusedKey != null) {
1166
1174
  let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
1167
1175
  if (nextKey != null) {
1168
1176
  e.preventDefault();
@@ -1190,7 +1198,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1190
1198
  let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
1191
1199
  tabbable: true
1192
1200
  });
1193
- let next;
1201
+ let next = void 0;
1194
1202
  let last;
1195
1203
  do {
1196
1204
  last = walker.lastChild();
@@ -1206,10 +1214,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1206
1214
  top: 0,
1207
1215
  left: 0
1208
1216
  });
1209
- $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ? null : () => {
1217
+ $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", isVirtualized ? void 0 : () => {
1218
+ var _scrollRef_current, _scrollRef_current1;
1219
+ var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
1210
1220
  scrollPos.current = {
1211
- top: scrollRef.current.scrollTop,
1212
- left: scrollRef.current.scrollLeft
1221
+ 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,
1222
+ 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
1223
  };
1214
1224
  });
1215
1225
  let onFocus = (e) => {
@@ -1220,6 +1230,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1220
1230
  if (!e.currentTarget.contains(e.target)) return;
1221
1231
  manager.setFocused(true);
1222
1232
  if (manager.focusedKey == null) {
1233
+ var _delegate_getLastKey, _delegate_getFirstKey;
1223
1234
  let navigateToFirstKey = (key) => {
1224
1235
  if (key != null) {
1225
1236
  manager.setFocusedKey(key);
@@ -1228,13 +1239,13 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1228
1239
  };
1229
1240
  let relatedTarget = e.relatedTarget;
1230
1241
  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) {
1242
+ 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));
1243
+ 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));
1244
+ } else if (!isVirtualized && scrollRef.current) {
1234
1245
  scrollRef.current.scrollTop = scrollPos.current.top;
1235
1246
  scrollRef.current.scrollLeft = scrollPos.current.left;
1236
1247
  }
1237
- if (manager.focusedKey != null) {
1248
+ if (manager.focusedKey != null && scrollRef.current) {
1238
1249
  let element = scrollRef.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
1239
1250
  if (element) {
1240
1251
  if (!element.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(element);
@@ -1251,9 +1262,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1251
1262
  const autoFocusRef = useRef(autoFocus);
1252
1263
  useEffect(() => {
1253
1264
  if (autoFocusRef.current) {
1265
+ var _delegate_getFirstKey, _delegate_getLastKey;
1254
1266
  let focusedKey = null;
1255
- if (autoFocus === "first") focusedKey = delegate.getFirstKey();
1256
- if (autoFocus === "last") focusedKey = delegate.getLastKey();
1267
+ var _delegate_getFirstKey1;
1268
+ 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;
1269
+ var _delegate_getLastKey1;
1270
+ 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
1271
  let selectedKeys = manager.selectedKeys;
1258
1272
  if (selectedKeys.size) {
1259
1273
  for (let key of selectedKeys) if (manager.canSelectItem(key)) {
@@ -1263,12 +1277,12 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1263
1277
  }
1264
1278
  manager.setFocused(true);
1265
1279
  manager.setFocusedKey(focusedKey);
1266
- if (focusedKey == null && !shouldUseVirtualFocus) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1280
+ if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1267
1281
  }
1268
1282
  }, []);
1269
1283
  let lastFocusedKey = useRef(manager.focusedKey);
1270
1284
  useEffect(() => {
1271
- if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
1285
+ if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || autoFocusRef.current) && scrollRef.current && ref.current) {
1272
1286
  let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
1273
1287
  let element = ref.current.querySelector(`[data-key="${CSS.escape(manager.focusedKey.toString())}"]`);
1274
1288
  if (!element)
@@ -1280,7 +1294,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1280
1294
  });
1281
1295
  }
1282
1296
  }
1283
- if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1297
+ if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1284
1298
  lastFocusedKey.current = manager.focusedKey;
1285
1299
  autoFocusRef.current = false;
1286
1300
  });
@@ -1302,7 +1316,7 @@ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
1302
1316
  selectionManager: manager
1303
1317
  });
1304
1318
  if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
1305
- let tabIndex;
1319
+ let tabIndex = void 0;
1306
1320
  if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
1307
1321
  return {
1308
1322
  collectionProps: {
@@ -1319,7 +1333,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
1319
1333
  else {
1320
1334
  if (manager.selectionMode === "none") return;
1321
1335
  if (manager.isLink(key)) {
1322
- if (linkBehavior === "selection") {
1336
+ if (linkBehavior === "selection" && ref.current) {
1323
1337
  let itemProps2 = manager.getItemProps(key);
1324
1338
  router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
1325
1339
  manager.setSelectedKeys(manager.selectedKeys);
@@ -1339,7 +1353,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
1339
1353
  let isFocused = key === manager.focusedKey;
1340
1354
  if (isFocused && manager.isFocused && !shouldUseVirtualFocus) {
1341
1355
  if (focus) focus();
1342
- else if (document.activeElement !== ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1356
+ else if (document.activeElement !== ref.current && ref.current) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
1343
1357
  }
1344
1358
  }, [
1345
1359
  ref,
@@ -1373,7 +1387,7 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
1373
1387
  let hadPrimaryActionOnPressStart = useRef(false);
1374
1388
  let performAction = (e) => {
1375
1389
  if (onAction) onAction();
1376
- if (hasLinkAction) {
1390
+ if (hasLinkAction && ref.current) {
1377
1391
  let itemProps2 = manager.getItemProps(key);
1378
1392
  router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
1379
1393
  }
@@ -1392,10 +1406,10 @@ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
1392
1406
  } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
1393
1407
  };
1394
1408
  else {
1395
- itemPressProps.onPressUp = hasPrimaryAction ? null : (e) => {
1409
+ itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
1396
1410
  if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
1397
1411
  };
1398
- itemPressProps.onPress = hasPrimaryAction ? performAction : null;
1412
+ itemPressProps.onPress = hasPrimaryAction ? performAction : void 0;
1399
1413
  }
1400
1414
  } else {
1401
1415
  itemPressProps.onPressStart = (e) => {
@@ -1471,15 +1485,20 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
1471
1485
  });
1472
1486
  else if (typeof children === "function") {
1473
1487
  if (!items) throw new Error("props.children was a function but props.items is missing");
1474
- for (let item of props.items) yield* this.getFullNode({
1475
- value: item
1476
- }, {
1477
- renderer: children
1478
- });
1488
+ let index = 0;
1489
+ for (let item of items) {
1490
+ yield* this.getFullNode({
1491
+ value: item,
1492
+ index
1493
+ }, {
1494
+ renderer: children
1495
+ });
1496
+ index++;
1497
+ }
1479
1498
  } else {
1480
1499
  let items2 = [];
1481
1500
  React__default.Children.forEach(children, (child) => {
1482
- items2.push(child);
1501
+ if (child) items2.push(child);
1483
1502
  });
1484
1503
  let index = 0;
1485
1504
  for (let item of items2) {
@@ -1517,7 +1536,8 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
1517
1536
  React__default.Children.forEach(partialNode.element.props.children, (child) => {
1518
1537
  children.push(child);
1519
1538
  });
1520
- let index = partialNode.index;
1539
+ var _partialNode_index;
1540
+ let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !== void 0 ? _partialNode_index : 0;
1521
1541
  for (const child of children) yield* this.getFullNode({
1522
1542
  element: child,
1523
1543
  index: index++
@@ -1538,17 +1558,19 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
1538
1558
  if (React__default.isValidElement(element)) {
1539
1559
  let type = element.type;
1540
1560
  if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
1541
- let name = typeof element.type === "function" ? element.type.name : element.type;
1561
+ let name = element.type;
1542
1562
  throw new Error(`Unknown element <${name}> in collection.`);
1543
1563
  }
1544
1564
  let childNodes = type.getCollectionNode(element.props, this.context);
1545
- let index = partialNode.index;
1565
+ var _partialNode_index1;
1566
+ let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !== void 0 ? _partialNode_index1 : 0;
1546
1567
  let result = childNodes.next();
1547
1568
  while (!result.done && result.value) {
1548
1569
  let childNode = result.value;
1549
1570
  partialNode.index = index;
1550
- let nodeKey = childNode.key;
1551
- if (!nodeKey) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
1571
+ var _childNode_key;
1572
+ let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !== void 0 ? _childNode_key : null;
1573
+ if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
1552
1574
  let nodes = this.getFullNode({
1553
1575
  ...childNode,
1554
1576
  key: nodeKey,
@@ -1559,9 +1581,11 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
1559
1581
  ...nodes
1560
1582
  ];
1561
1583
  for (let node2 of children) {
1562
- node2.value = childNode.value || partialNode.value;
1584
+ var _childNode_value, _ref;
1585
+ node2.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !== void 0 ? _childNode_value : partialNode.value) !== null && _ref !== void 0 ? _ref : null;
1563
1586
  if (node2.value) this.cache.set(node2.value, node2);
1564
- if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node2.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
1587
+ var _parentNode_type;
1588
+ 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
1589
  index++;
1566
1590
  yield node2;
1567
1591
  }
@@ -1569,30 +1593,33 @@ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
1569
1593
  }
1570
1594
  return;
1571
1595
  }
1572
- if (partialNode.key == null) return;
1596
+ if (partialNode.key == null || partialNode.type == null) return;
1573
1597
  let builder = this;
1598
+ var _partialNode_value, _partialNode_textValue;
1574
1599
  let node = {
1575
1600
  type: partialNode.type,
1576
1601
  props: partialNode.props,
1577
1602
  key: partialNode.key,
1578
1603
  parentKey: parentNode ? parentNode.key : null,
1579
- value: partialNode.value,
1604
+ value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !== void 0 ? _partialNode_value : null,
1580
1605
  level: parentNode ? parentNode.level + 1 : 0,
1581
1606
  index: partialNode.index,
1582
1607
  rendered: partialNode.rendered,
1583
- textValue: partialNode.textValue,
1608
+ textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !== void 0 ? _partialNode_textValue : "",
1584
1609
  "aria-label": partialNode["aria-label"],
1585
1610
  wrapper: partialNode.wrapper,
1586
1611
  shouldInvalidate: partialNode.shouldInvalidate,
1587
- hasChildNodes: partialNode.hasChildNodes,
1612
+ hasChildNodes: partialNode.hasChildNodes || false,
1588
1613
  childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
1589
- if (!partialNode.hasChildNodes) return;
1614
+ if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
1590
1615
  let index = 0;
1591
1616
  for (let child of partialNode.childNodes()) {
1592
1617
  if (child.key != null)
1593
1618
  child.key = `${node.key}${child.key}`;
1594
- child.index = index;
1595
- let nodes = builder.getFullNode(child, builder.getChildState(state, child), node.key, node);
1619
+ let nodes = builder.getFullNode({
1620
+ ...child,
1621
+ index
1622
+ }, builder.getChildState(state, child), node.key, node);
1596
1623
  for (let node2 of nodes) {
1597
1624
  index++;
1598
1625
  yield node2;
@@ -1682,9 +1709,10 @@ function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
1682
1709
  }
1683
1710
  function $c5a24bc478652b5f$var$getAncestors(collection, node) {
1684
1711
  let parents = [];
1685
- while ((node === null || node === void 0 ? void 0 : node.parentKey) != null) {
1686
- node = collection.getItem(node.parentKey);
1687
- parents.unshift(node);
1712
+ let currNode = node;
1713
+ while ((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null) {
1714
+ currNode = collection.getItem(currNode.parentKey);
1715
+ if (currNode) parents.unshift(currNode);
1688
1716
  }
1689
1717
  return parents;
1690
1718
  }
@@ -1695,8 +1723,8 @@ class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
1695
1723
  this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : keys.anchorKey;
1696
1724
  this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : keys.currentKey;
1697
1725
  } else {
1698
- this.anchorKey = anchorKey;
1699
- this.currentKey = currentKey;
1726
+ this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : null;
1727
+ this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : null;
1700
1728
  }
1701
1729
  }
1702
1730
  }
@@ -1708,7 +1736,7 @@ function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
1708
1736
  return true;
1709
1737
  }
1710
1738
  function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
1711
- let { selectionMode = "none", disallowEmptySelection, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
1739
+ let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
1712
1740
  let isFocusedRef = useRef(false);
1713
1741
  let [, setFocused] = useState(false);
1714
1742
  let focusedKeyRef = useRef(null);
@@ -1841,8 +1869,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1841
1869
  */
1842
1870
  isSelected(key) {
1843
1871
  if (this.state.selectionMode === "none") return false;
1844
- key = this.getKey(key);
1845
- return this.state.selectedKeys === "all" ? this.canSelectItem(key) : this.state.selectedKeys.has(key);
1872
+ let mappedKey = this.getKey(key);
1873
+ if (mappedKey == null) return false;
1874
+ return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
1846
1875
  }
1847
1876
  /**
1848
1877
  * Whether the selection is empty.
@@ -1868,7 +1897,8 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1868
1897
  let item = this.collection.getItem(key);
1869
1898
  if (!first || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
1870
1899
  }
1871
- return first === null || first === void 0 ? void 0 : first.key;
1900
+ var _first_key;
1901
+ return (_first_key = first === null || first === void 0 ? void 0 : first.key) !== null && _first_key !== void 0 ? _first_key : null;
1872
1902
  }
1873
1903
  get lastSelectedKey() {
1874
1904
  let last = null;
@@ -1876,7 +1906,8 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1876
1906
  let item = this.collection.getItem(key);
1877
1907
  if (!last || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
1878
1908
  }
1879
- return last === null || last === void 0 ? void 0 : last.key;
1909
+ var _last_key;
1910
+ return (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
1880
1911
  }
1881
1912
  get disabledKeys() {
1882
1913
  return this.state.disabledKeys;
@@ -1893,19 +1924,20 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1893
1924
  this.replaceSelection(toKey);
1894
1925
  return;
1895
1926
  }
1896
- toKey = this.getKey(toKey);
1927
+ let mappedToKey = this.getKey(toKey);
1928
+ if (mappedToKey == null) return;
1897
1929
  let selection;
1898
1930
  if (this.state.selectedKeys === "all") selection = new $e40ea825a81a3709$export$52baac22726c72bf([
1899
- toKey
1900
- ], toKey, toKey);
1931
+ mappedToKey
1932
+ ], mappedToKey, mappedToKey);
1901
1933
  else {
1902
1934
  let selectedKeys = this.state.selectedKeys;
1903
1935
  var _selectedKeys_anchorKey;
1904
- let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : toKey;
1905
- selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, toKey);
1936
+ let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : mappedToKey;
1937
+ selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
1906
1938
  var _selectedKeys_currentKey;
1907
- for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : toKey)) selection.delete(key);
1908
- for (let key of this.getKeyRange(toKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
1939
+ for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : mappedToKey)) selection.delete(key);
1940
+ for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
1909
1941
  }
1910
1942
  this.state.setSelectedKeys(selection);
1911
1943
  }
@@ -1925,7 +1957,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1925
1957
  let key = from;
1926
1958
  while (key != null) {
1927
1959
  let item = this.collection.getItem(key);
1928
- if (item && item.type === "item" || item.type === "cell" && this.allowsCellSelection) keys.push(key);
1960
+ if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
1929
1961
  if (key === to) return keys;
1930
1962
  key = this.collection.getKeyAfter(key);
1931
1963
  }
@@ -1936,7 +1968,7 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1936
1968
  if (!item)
1937
1969
  return key;
1938
1970
  if (item.type === "cell" && this.allowsCellSelection) return key;
1939
- while (item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
1971
+ while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
1940
1972
  if (!item || item.type !== "item") return null;
1941
1973
  return item.key;
1942
1974
  }
@@ -1949,14 +1981,14 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1949
1981
  this.replaceSelection(key);
1950
1982
  return;
1951
1983
  }
1952
- key = this.getKey(key);
1953
- if (key == null) return;
1984
+ let mappedKey = this.getKey(key);
1985
+ if (mappedKey == null) return;
1954
1986
  let keys = new $e40ea825a81a3709$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
1955
- if (keys.has(key)) keys.delete(key);
1956
- else if (this.canSelectItem(key)) {
1957
- keys.add(key);
1958
- keys.anchorKey = key;
1959
- keys.currentKey = key;
1987
+ if (keys.has(mappedKey)) keys.delete(mappedKey);
1988
+ else if (this.canSelectItem(mappedKey)) {
1989
+ keys.add(mappedKey);
1990
+ keys.anchorKey = mappedKey;
1991
+ keys.currentKey = mappedKey;
1960
1992
  }
1961
1993
  if (this.disallowEmptySelection && keys.size === 0) return;
1962
1994
  this.state.setSelectedKeys(keys);
@@ -1966,11 +1998,11 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1966
1998
  */
1967
1999
  replaceSelection(key) {
1968
2000
  if (this.selectionMode === "none") return;
1969
- key = this.getKey(key);
1970
- if (key == null) return;
1971
- let selection = this.canSelectItem(key) ? new $e40ea825a81a3709$export$52baac22726c72bf([
1972
- key
1973
- ], key, key) : new $e40ea825a81a3709$export$52baac22726c72bf();
2001
+ let mappedKey = this.getKey(key);
2002
+ if (mappedKey == null) return;
2003
+ let selection = this.canSelectItem(mappedKey) ? new $e40ea825a81a3709$export$52baac22726c72bf([
2004
+ mappedKey
2005
+ ], mappedKey, mappedKey) : new $e40ea825a81a3709$export$52baac22726c72bf();
1974
2006
  this.state.setSelectedKeys(selection);
1975
2007
  }
1976
2008
  /**
@@ -1980,9 +2012,9 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1980
2012
  if (this.selectionMode === "none") return;
1981
2013
  let selection = new $e40ea825a81a3709$export$52baac22726c72bf();
1982
2014
  for (let key of keys) {
1983
- key = this.getKey(key);
1984
- if (key != null) {
1985
- selection.add(key);
2015
+ let mappedKey = this.getKey(key);
2016
+ if (mappedKey != null) {
2017
+ selection.add(mappedKey);
1986
2018
  if (this.selectionMode === "single") break;
1987
2019
  }
1988
2020
  }
@@ -1993,9 +2025,11 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1993
2025
  let addKeys = (key) => {
1994
2026
  while (key != null) {
1995
2027
  if (this.canSelectItem(key)) {
2028
+ var _getFirstItem;
1996
2029
  let item = this.collection.getItem(key);
1997
- if (item.type === "item") keys.push(key);
1998
- if (item.hasChildNodes && (this.allowsCellSelection || item.type !== "item")) addKeys($c5a24bc478652b5f$export$fbdeaa6a76694f71($c5a24bc478652b5f$export$1005530eda016c13(item, this.collection)).key);
2030
+ if ((item === null || item === void 0 ? void 0 : item.type) === "item") keys.push(key);
2031
+ var _getFirstItem_key;
2032
+ 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
2033
  }
2000
2034
  key = this.collection.getKeyAfter(key);
2001
2035
  }
@@ -2075,19 +2109,21 @@ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
2075
2109
  }
2076
2110
  }
2077
2111
  export {
2078
- $7af3f5b51489e0b5$export$253fe78d46329472 as $,
2079
- $7613b1592d41b092$export$6cd28814d92fa9c9 as a,
2080
- $d496c0a20b6e58ec$export$6c8a5aaad13c9852 as b,
2081
- $880e95eb8b93ba9a$export$ecf600387e221c37 as c,
2082
- $e1995378a142960e$export$18af5c7a9e9b3664 as d,
2083
- $e1995378a142960e$export$bf788dd355e3a401 as e,
2084
- $e1995378a142960e$export$fb8073518f34e6ec as f,
2085
- $7135fc7d473fd974$export$4feb769f8ddf26c5 as g,
2086
- $7135fc7d473fd974$export$d40e14dec8b060a8 as h,
2087
- $ae20dd8cbca75726$export$d6daf82dcd84e87c as i,
2088
- $c5a24bc478652b5f$export$1005530eda016c13 as j,
2089
- $7135fc7d473fd974$export$90e00781bc59d8f9 as k,
2090
- $e1995378a142960e$export$e953bb1cd0f19726 as l,
2091
- $7135fc7d473fd974$export$6e2c8f0811a474ce as m,
2092
- $8a26561d2877236e$export$c24ed0104d07eab9 as n
2112
+ $7135fc7d473fd974$export$6e2c8f0811a474ce as $,
2113
+ $7af3f5b51489e0b5$export$253fe78d46329472 as a,
2114
+ $7613b1592d41b092$export$6cd28814d92fa9c9 as b,
2115
+ $d496c0a20b6e58ec$export$6c8a5aaad13c9852 as c,
2116
+ $880e95eb8b93ba9a$export$ecf600387e221c37 as d,
2117
+ $e1995378a142960e$export$18af5c7a9e9b3664 as e,
2118
+ $e1995378a142960e$export$bf788dd355e3a401 as f,
2119
+ $e1995378a142960e$export$fb8073518f34e6ec as g,
2120
+ $7135fc7d473fd974$export$4feb769f8ddf26c5 as h,
2121
+ $7135fc7d473fd974$export$d40e14dec8b060a8 as i,
2122
+ $cc38e7bd3fc7b213$export$2bb74740c4e19def as j,
2123
+ $ae20dd8cbca75726$export$d6daf82dcd84e87c as k,
2124
+ $c5a24bc478652b5f$export$1005530eda016c13 as l,
2125
+ $7135fc7d473fd974$export$90e00781bc59d8f9 as m,
2126
+ $fb3050f43d946246$export$e32c88dfddc6e1d8 as n,
2127
+ $8a26561d2877236e$export$c24ed0104d07eab9 as o,
2128
+ $e1995378a142960e$export$e953bb1cd0f19726 as p
2093
2129
  };