@react-aria/grid 3.8.9-nightly.4518 → 3.8.9-nightly.4534
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/import.mjs +33 -16
- package/dist/main.js +32 -15
- package/dist/main.js.map +1 -1
- package/dist/module.js +33 -16
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/GridKeyboardDelegate.ts +10 -3
- package/src/useGrid.ts +2 -1
- package/src/useGridCell.ts +16 -8
- package/src/useGridRow.ts +4 -2
package/dist/import.mjs
CHANGED
|
@@ -34,7 +34,7 @@ import $f1316b1074463583$exports from "./zh-CN.mjs";
|
|
|
34
34
|
import $7e60654723031b6f$exports from "./zh-TW.mjs";
|
|
35
35
|
import {getNthItem as $cVkRF$getNthItem, getChildNodes as $cVkRF$getChildNodes, getLastItem as $cVkRF$getLastItem, getFirstItem as $cVkRF$getFirstItem} from "@react-stately/collections";
|
|
36
36
|
import {Rect as $cVkRF$Rect} from "@react-stately/virtualizer";
|
|
37
|
-
import {useId as $cVkRF$useId, filterDOMProps as $cVkRF$filterDOMProps, mergeProps as $cVkRF$mergeProps, useUpdateEffect as $cVkRF$useUpdateEffect, useDescription as $cVkRF$useDescription, scrollIntoViewport as $cVkRF$scrollIntoViewport, getScrollParent as $cVkRF$getScrollParent} from "@react-aria/utils";
|
|
37
|
+
import {useId as $cVkRF$useId, filterDOMProps as $cVkRF$filterDOMProps, mergeProps as $cVkRF$mergeProps, useUpdateEffect as $cVkRF$useUpdateEffect, useDescription as $cVkRF$useDescription, chain as $cVkRF$chain, scrollIntoViewport as $cVkRF$scrollIntoViewport, getScrollParent as $cVkRF$getScrollParent} from "@react-aria/utils";
|
|
38
38
|
import {useMemo as $cVkRF$useMemo, useCallback as $cVkRF$useCallback, useRef as $cVkRF$useRef} from "react";
|
|
39
39
|
import {useCollator as $cVkRF$useCollator, useLocale as $cVkRF$useLocale, useLocalizedStringFormatter as $cVkRF$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
40
40
|
import {useHasTabbableChild as $cVkRF$useHasTabbableChild, getFocusableTreeWalker as $cVkRF$getFocusableTreeWalker, focusSafely as $cVkRF$focusSafely} from "@react-aria/focus";
|
|
@@ -75,11 +75,15 @@ class $d1c300d9c497e402$export$de9feff04fda126e {
|
|
|
75
75
|
isRow(node) {
|
|
76
76
|
return node.type === "row" || node.type === "item";
|
|
77
77
|
}
|
|
78
|
+
isDisabled(item) {
|
|
79
|
+
var _item_props;
|
|
80
|
+
return this.disabledBehavior === "all" && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
|
|
81
|
+
}
|
|
78
82
|
findPreviousKey(fromKey, pred) {
|
|
79
83
|
let key = fromKey != null ? this.collection.getKeyBefore(fromKey) : this.collection.getLastKey();
|
|
80
84
|
while(key != null){
|
|
81
85
|
let item = this.collection.getItem(key);
|
|
82
|
-
if (!this.
|
|
86
|
+
if (!this.isDisabled(item) && (!pred || pred(item))) return key;
|
|
83
87
|
key = this.collection.getKeyBefore(key);
|
|
84
88
|
}
|
|
85
89
|
}
|
|
@@ -87,7 +91,7 @@ class $d1c300d9c497e402$export$de9feff04fda126e {
|
|
|
87
91
|
let key = fromKey != null ? this.collection.getKeyAfter(fromKey) : this.collection.getFirstKey();
|
|
88
92
|
while(key != null){
|
|
89
93
|
let item = this.collection.getItem(key);
|
|
90
|
-
if (!this.
|
|
94
|
+
if (!this.isDisabled(item) && (!pred || pred(item))) return key;
|
|
91
95
|
key = this.collection.getKeyAfter(key);
|
|
92
96
|
}
|
|
93
97
|
}
|
|
@@ -284,6 +288,7 @@ class $d1c300d9c497e402$export$de9feff04fda126e {
|
|
|
284
288
|
constructor(options){
|
|
285
289
|
this.collection = options.collection;
|
|
286
290
|
this.disabledKeys = options.disabledKeys;
|
|
291
|
+
this.disabledBehavior = options.disabledBehavior || "all";
|
|
287
292
|
this.ref = options.ref;
|
|
288
293
|
this.direction = options.direction;
|
|
289
294
|
this.collator = options.collator;
|
|
@@ -523,7 +528,8 @@ function $83c6e2eafa584c67$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
523
528
|
let disabledBehavior = state.selectionManager.disabledBehavior;
|
|
524
529
|
let delegate = (0, $cVkRF$useMemo)(()=>keyboardDelegate || new (0, $d1c300d9c497e402$export$de9feff04fda126e)({
|
|
525
530
|
collection: state.collection,
|
|
526
|
-
disabledKeys:
|
|
531
|
+
disabledKeys: state.disabledKeys,
|
|
532
|
+
disabledBehavior: disabledBehavior,
|
|
527
533
|
ref: ref,
|
|
528
534
|
direction: direction,
|
|
529
535
|
collator: collator,
|
|
@@ -635,16 +641,19 @@ function $83c6e2eafa584c67$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
635
641
|
* governing permissions and limitations under the License.
|
|
636
642
|
*/
|
|
637
643
|
|
|
644
|
+
|
|
638
645
|
function $4159a7a9cbb0cc18$export$96357d5a73f686fa(props, state, ref) {
|
|
646
|
+
var _node_props, _node_props1;
|
|
639
647
|
let { node: node, isVirtualized: isVirtualized, shouldSelectOnPressUp: shouldSelectOnPressUp, onAction: onAction } = props;
|
|
640
|
-
let { actions:
|
|
648
|
+
let { actions: actions } = (0, $1af922eb41e03c8f$export$e6235c0d09b995d0).get(state);
|
|
649
|
+
let onRowAction = actions.onRowAction ? ()=>actions.onRowAction(node.key) : onAction;
|
|
641
650
|
let { itemProps: itemProps, ...states } = (0, $cVkRF$useSelectableItem)({
|
|
642
651
|
selectionManager: state.selectionManager,
|
|
643
652
|
key: node.key,
|
|
644
653
|
ref: ref,
|
|
645
654
|
isVirtualized: isVirtualized,
|
|
646
655
|
shouldSelectOnPressUp: shouldSelectOnPressUp,
|
|
647
|
-
onAction: onRowAction ? ()
|
|
656
|
+
onAction: onRowAction || (node === null || node === void 0 ? void 0 : (_node_props = node.props) === null || _node_props === void 0 ? void 0 : _node_props.onAction) ? (0, $cVkRF$chain)(node === null || node === void 0 ? void 0 : (_node_props1 = node.props) === null || _node_props1 === void 0 ? void 0 : _node_props1.onAction, onRowAction) : undefined,
|
|
648
657
|
isDisabled: state.collection.size === 0
|
|
649
658
|
});
|
|
650
659
|
let isSelected = state.selectionManager.isSelected(node.key);
|
|
@@ -722,9 +731,9 @@ function $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
722
731
|
let focusable = direction === "rtl" ? walker.nextNode() : walker.previousNode();
|
|
723
732
|
// Don't focus the cell itself if focusMode is "child"
|
|
724
733
|
if (focusMode === "child" && focusable === ref.current) focusable = null;
|
|
734
|
+
e.preventDefault();
|
|
735
|
+
e.stopPropagation();
|
|
725
736
|
if (focusable) {
|
|
726
|
-
e.preventDefault();
|
|
727
|
-
e.stopPropagation();
|
|
728
737
|
(0, $cVkRF$focusSafely)(focusable);
|
|
729
738
|
(0, $cVkRF$scrollIntoViewport)(focusable, {
|
|
730
739
|
containingElement: (0, $cVkRF$getScrollParent)(ref.current)
|
|
@@ -736,9 +745,13 @@ function $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
736
745
|
// same as this one. In that case we need to handle focusing either the cell or the first/last
|
|
737
746
|
// child, depending on the focus mode.
|
|
738
747
|
let prev = keyboardDelegate.getKeyLeftOf(node.key);
|
|
739
|
-
if (prev !== node.key)
|
|
740
|
-
|
|
741
|
-
|
|
748
|
+
if (prev !== node.key) {
|
|
749
|
+
// We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
750
|
+
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
|
|
751
|
+
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
|
|
752
|
+
ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
742
755
|
if (focusMode === "cell" && direction === "rtl") {
|
|
743
756
|
(0, $cVkRF$focusSafely)(ref.current);
|
|
744
757
|
(0, $cVkRF$scrollIntoViewport)(ref.current, {
|
|
@@ -761,18 +774,22 @@ function $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
761
774
|
{
|
|
762
775
|
let focusable = direction === "rtl" ? walker.previousNode() : walker.nextNode();
|
|
763
776
|
if (focusMode === "child" && focusable === ref.current) focusable = null;
|
|
777
|
+
e.preventDefault();
|
|
778
|
+
e.stopPropagation();
|
|
764
779
|
if (focusable) {
|
|
765
|
-
e.preventDefault();
|
|
766
|
-
e.stopPropagation();
|
|
767
780
|
(0, $cVkRF$focusSafely)(focusable);
|
|
768
781
|
(0, $cVkRF$scrollIntoViewport)(focusable, {
|
|
769
782
|
containingElement: (0, $cVkRF$getScrollParent)(ref.current)
|
|
770
783
|
});
|
|
771
784
|
} else {
|
|
772
785
|
let next = keyboardDelegate.getKeyRightOf(node.key);
|
|
773
|
-
if (next !== node.key)
|
|
774
|
-
|
|
775
|
-
|
|
786
|
+
if (next !== node.key) {
|
|
787
|
+
// We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
788
|
+
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
|
|
789
|
+
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
|
|
790
|
+
ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
776
793
|
if (focusMode === "cell" && direction === "ltr") {
|
|
777
794
|
(0, $cVkRF$focusSafely)(ref.current);
|
|
778
795
|
(0, $cVkRF$scrollIntoViewport)(ref.current, {
|
package/dist/main.js
CHANGED
|
@@ -88,11 +88,15 @@ class $3187c0e19200cb16$export$de9feff04fda126e {
|
|
|
88
88
|
isRow(node) {
|
|
89
89
|
return node.type === "row" || node.type === "item";
|
|
90
90
|
}
|
|
91
|
+
isDisabled(item) {
|
|
92
|
+
var _item_props;
|
|
93
|
+
return this.disabledBehavior === "all" && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
|
|
94
|
+
}
|
|
91
95
|
findPreviousKey(fromKey, pred) {
|
|
92
96
|
let key = fromKey != null ? this.collection.getKeyBefore(fromKey) : this.collection.getLastKey();
|
|
93
97
|
while(key != null){
|
|
94
98
|
let item = this.collection.getItem(key);
|
|
95
|
-
if (!this.
|
|
99
|
+
if (!this.isDisabled(item) && (!pred || pred(item))) return key;
|
|
96
100
|
key = this.collection.getKeyBefore(key);
|
|
97
101
|
}
|
|
98
102
|
}
|
|
@@ -100,7 +104,7 @@ class $3187c0e19200cb16$export$de9feff04fda126e {
|
|
|
100
104
|
let key = fromKey != null ? this.collection.getKeyAfter(fromKey) : this.collection.getFirstKey();
|
|
101
105
|
while(key != null){
|
|
102
106
|
let item = this.collection.getItem(key);
|
|
103
|
-
if (!this.
|
|
107
|
+
if (!this.isDisabled(item) && (!pred || pred(item))) return key;
|
|
104
108
|
key = this.collection.getKeyAfter(key);
|
|
105
109
|
}
|
|
106
110
|
}
|
|
@@ -297,6 +301,7 @@ class $3187c0e19200cb16$export$de9feff04fda126e {
|
|
|
297
301
|
constructor(options){
|
|
298
302
|
this.collection = options.collection;
|
|
299
303
|
this.disabledKeys = options.disabledKeys;
|
|
304
|
+
this.disabledBehavior = options.disabledBehavior || "all";
|
|
300
305
|
this.ref = options.ref;
|
|
301
306
|
this.direction = options.direction;
|
|
302
307
|
this.collator = options.collator;
|
|
@@ -536,7 +541,8 @@ function $11d770dfabe45077$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
536
541
|
let disabledBehavior = state.selectionManager.disabledBehavior;
|
|
537
542
|
let delegate = (0, $2oePb$react.useMemo)(()=>keyboardDelegate || new (0, $3187c0e19200cb16$export$de9feff04fda126e)({
|
|
538
543
|
collection: state.collection,
|
|
539
|
-
disabledKeys:
|
|
544
|
+
disabledKeys: state.disabledKeys,
|
|
545
|
+
disabledBehavior: disabledBehavior,
|
|
540
546
|
ref: ref,
|
|
541
547
|
direction: direction,
|
|
542
548
|
collator: collator,
|
|
@@ -648,16 +654,19 @@ function $11d770dfabe45077$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
648
654
|
* governing permissions and limitations under the License.
|
|
649
655
|
*/
|
|
650
656
|
|
|
657
|
+
|
|
651
658
|
function $eed398987c639831$export$96357d5a73f686fa(props, state, ref) {
|
|
659
|
+
var _node_props, _node_props1;
|
|
652
660
|
let { node: node, isVirtualized: isVirtualized, shouldSelectOnPressUp: shouldSelectOnPressUp, onAction: onAction } = props;
|
|
653
|
-
let { actions:
|
|
661
|
+
let { actions: actions } = (0, $8ee34951196858d0$export$e6235c0d09b995d0).get(state);
|
|
662
|
+
let onRowAction = actions.onRowAction ? ()=>actions.onRowAction(node.key) : onAction;
|
|
654
663
|
let { itemProps: itemProps, ...states } = (0, $2oePb$reactariaselection.useSelectableItem)({
|
|
655
664
|
selectionManager: state.selectionManager,
|
|
656
665
|
key: node.key,
|
|
657
666
|
ref: ref,
|
|
658
667
|
isVirtualized: isVirtualized,
|
|
659
668
|
shouldSelectOnPressUp: shouldSelectOnPressUp,
|
|
660
|
-
onAction: onRowAction ? ()
|
|
669
|
+
onAction: onRowAction || (node === null || node === void 0 ? void 0 : (_node_props = node.props) === null || _node_props === void 0 ? void 0 : _node_props.onAction) ? (0, $2oePb$reactariautils.chain)(node === null || node === void 0 ? void 0 : (_node_props1 = node.props) === null || _node_props1 === void 0 ? void 0 : _node_props1.onAction, onRowAction) : undefined,
|
|
661
670
|
isDisabled: state.collection.size === 0
|
|
662
671
|
});
|
|
663
672
|
let isSelected = state.selectionManager.isSelected(node.key);
|
|
@@ -735,9 +744,9 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
735
744
|
let focusable = direction === "rtl" ? walker.nextNode() : walker.previousNode();
|
|
736
745
|
// Don't focus the cell itself if focusMode is "child"
|
|
737
746
|
if (focusMode === "child" && focusable === ref.current) focusable = null;
|
|
747
|
+
e.preventDefault();
|
|
748
|
+
e.stopPropagation();
|
|
738
749
|
if (focusable) {
|
|
739
|
-
e.preventDefault();
|
|
740
|
-
e.stopPropagation();
|
|
741
750
|
(0, $2oePb$reactariafocus.focusSafely)(focusable);
|
|
742
751
|
(0, $2oePb$reactariautils.scrollIntoViewport)(focusable, {
|
|
743
752
|
containingElement: (0, $2oePb$reactariautils.getScrollParent)(ref.current)
|
|
@@ -749,9 +758,13 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
749
758
|
// same as this one. In that case we need to handle focusing either the cell or the first/last
|
|
750
759
|
// child, depending on the focus mode.
|
|
751
760
|
let prev = keyboardDelegate.getKeyLeftOf(node.key);
|
|
752
|
-
if (prev !== node.key)
|
|
753
|
-
|
|
754
|
-
|
|
761
|
+
if (prev !== node.key) {
|
|
762
|
+
// We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
763
|
+
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
|
|
764
|
+
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
|
|
765
|
+
ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
755
768
|
if (focusMode === "cell" && direction === "rtl") {
|
|
756
769
|
(0, $2oePb$reactariafocus.focusSafely)(ref.current);
|
|
757
770
|
(0, $2oePb$reactariautils.scrollIntoViewport)(ref.current, {
|
|
@@ -774,18 +787,22 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
774
787
|
{
|
|
775
788
|
let focusable = direction === "rtl" ? walker.previousNode() : walker.nextNode();
|
|
776
789
|
if (focusMode === "child" && focusable === ref.current) focusable = null;
|
|
790
|
+
e.preventDefault();
|
|
791
|
+
e.stopPropagation();
|
|
777
792
|
if (focusable) {
|
|
778
|
-
e.preventDefault();
|
|
779
|
-
e.stopPropagation();
|
|
780
793
|
(0, $2oePb$reactariafocus.focusSafely)(focusable);
|
|
781
794
|
(0, $2oePb$reactariautils.scrollIntoViewport)(focusable, {
|
|
782
795
|
containingElement: (0, $2oePb$reactariautils.getScrollParent)(ref.current)
|
|
783
796
|
});
|
|
784
797
|
} else {
|
|
785
798
|
let next = keyboardDelegate.getKeyRightOf(node.key);
|
|
786
|
-
if (next !== node.key)
|
|
787
|
-
|
|
788
|
-
|
|
799
|
+
if (next !== node.key) {
|
|
800
|
+
// We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
801
|
+
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
|
|
802
|
+
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
|
|
803
|
+
ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
789
806
|
if (focusMode === "cell" && direction === "ltr") {
|
|
790
807
|
(0, $2oePb$reactariafocus.focusSafely)(ref.current);
|
|
791
808
|
(0, $2oePb$reactariautils.scrollIntoViewport)(ref.current, {
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAkBM,MAAM;IAmBD,OAAO,IAAa,EAAE;QAC9B,OAAO,KAAK,IAAI,KAAK;IACvB;IAEU,MAAM,IAAa,EAAE;QAC7B,OAAO,KAAK,IAAI,KAAK,SAAS,KAAK,IAAI,KAAK;IAC9C;IAEU,gBAAgB,OAAa,EAAE,IAAiC,EAAE;QAC1E,IAAI,MAAM,WAAW,OACjB,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,WAC7B,IAAI,CAAC,UAAU,CAAC,UAAU;QAE9B,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACnC,IAAI,CAAC,IAAI,CA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G,YAAY,CAAC,YAAY;QAC9B;IACF;IAGF,OAAO;uBACL;mBACA;IACF;AACF;AAEA,SAAS,2BAAK,MAAkB;IAC9B,IAAI;IACJ,IAAI;IACJ,GAAG;QACD,OAAO,OAAO,SAAS;QACvB,IAAI,MACF,OAAO;IAEX,QAAS,MAAM;IACf,OAAO;AACT;;;;;;AChQO,SAAS,0CAAyD,KAAqC,EAAE,KAAsB;IACpI,IAAI,OAAC,GAAG,EAAC,GAAG;IAEZ,IAAI,UAAU,MAAM,gBAAgB;IACpC,IAAI,aAAa,CAAA,GAAA,2BAAI;IACrB,IAAI,aAAa,CAAC,MAAM,gBAAgB,CAAC,aAAa,CAAC;IACvD,IAAI,aAAa,MAAM,gBAAgB,CAAC,UAAU,CAAC;IAEnD,IAAI,WAAW,IAAM,QAAQ,MAAM,CAAC;IAEpC,MAAM,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,gEAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,IAAI;YACJ,cAAc,gBAAgB,MAAM,CAAC;wBACrC;wBACA;sBACA;QACF;IACF;AACF;","sources":["packages/@react-aria/grid/src/index.ts","packages/@react-aria/grid/src/GridKeyboardDelegate.ts","packages/@react-aria/grid/src/useGrid.ts","packages/@react-aria/grid/src/utils.ts","packages/@react-aria/grid/src/useGridSelectionAnnouncement.ts","packages/@react-aria/grid/src/*.js","packages/@react-aria/grid/src/useHighlightSelectionDescription.ts","packages/@react-aria/grid/src/useGridRowGroup.ts","packages/@react-aria/grid/src/useGridRow.ts","packages/@react-aria/grid/src/useGridCell.ts","packages/@react-aria/grid/src/useGridSelectionCheckbox.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nexport {useGrid} from './useGrid';\nexport {useGridRowGroup} from './useGridRowGroup';\nexport {useGridRow} from './useGridRow';\nexport {useGridCell} from './useGridCell';\nexport {useGridSelectionCheckbox} from './useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\n\nexport type {GridProps, GridAria} from './useGrid';\nexport type {GridCellAria, GridCellProps} from './useGridCell';\nexport type {GridRowGroupAria} from './useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from './useGridRow';\nexport type {GridKeyboardDelegateOptions} from './GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from './useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from './useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from './useGridSelectionAnnouncement';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Direction, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes, getFirstItem, getLastItem, getNthItem} from '@react-stately/collections';\nimport {GridCollection} from '@react-types/grid';\nimport {Layout, Rect} from '@react-stately/virtualizer';\nimport {RefObject} from 'react';\n\nexport interface GridKeyboardDelegateOptions<T, C> {\n collection: C,\n disabledKeys: Set<Key>,\n ref?: RefObject<HTMLElement>,\n direction: Direction,\n collator?: Intl.Collator,\n layout?: Layout<Node<T>>,\n focusMode?: 'row' | 'cell'\n}\n\nexport class GridKeyboardDelegate<T, C extends GridCollection<T>> implements KeyboardDelegate {\n collection: C;\n protected disabledKeys: Set<Key>;\n protected ref: RefObject<HTMLElement>;\n protected direction: Direction;\n protected collator: Intl.Collator;\n protected layout: Layout<Node<T>>;\n protected focusMode;\n\n constructor(options: GridKeyboardDelegateOptions<T, C>) {\n this.collection = options.collection;\n this.disabledKeys = options.disabledKeys;\n this.ref = options.ref;\n this.direction = options.direction;\n this.collator = options.collator;\n this.layout = options.layout;\n this.focusMode = options.focusMode || 'row';\n }\n\n protected isCell(node: Node<T>) {\n return node.type === 'cell';\n }\n\n protected isRow(node: Node<T>) {\n return node.type === 'row' || node.type === 'item';\n }\n\n protected findPreviousKey(fromKey?: Key, pred?: (item: Node<T>) => boolean) {\n let key = fromKey != null\n ? this.collection.getKeyBefore(fromKey)\n : this.collection.getLastKey();\n\n while (key != null) {\n let item = this.collection.getItem(key);\n if (!this.disabledKeys.has(key) && (!pred || pred(item))) {\n return key;\n }\n\n key = this.collection.getKeyBefore(key);\n }\n }\n\n protected findNextKey(fromKey?: Key, pred?: (item: Node<T>) => boolean) {\n let key = fromKey != null\n ? this.collection.getKeyAfter(fromKey)\n : this.collection.getFirstKey();\n\n while (key != null) {\n let item = this.collection.getItem(key);\n if (!this.disabledKeys.has(key) && (!pred || pred(item))) {\n return key;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n }\n\n getKeyBelow(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus was on a cell, start searching from the parent row\n if (this.isCell(startItem)) {\n key = startItem.parentKey;\n }\n\n // Find the next item\n key = this.findNextKey(key);\n if (key != null) {\n // If focus was on a cell, focus the cell with the same index in the next row.\n if (this.isCell(startItem)) {\n let item = this.collection.getItem(key);\n return getNthItem(getChildNodes(item, this.collection), startItem.index).key;\n }\n\n // Otherwise, focus the next row\n if (this.focusMode === 'row') {\n return key;\n }\n }\n }\n\n getKeyAbove(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus is on a cell, start searching from the parent row\n if (this.isCell(startItem)) {\n key = startItem.parentKey;\n }\n\n // Find the previous item\n key = this.findPreviousKey(key);\n if (key != null) {\n // If focus was on a cell, focus the cell with the same index in the previous row.\n if (this.isCell(startItem)) {\n let item = this.collection.getItem(key);\n return getNthItem(getChildNodes(item, this.collection), startItem.index).key;\n }\n\n // Otherwise, focus the previous row\n if (this.focusMode === 'row') {\n return key;\n }\n }\n }\n\n getKeyRightOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus is on a row, focus the first child cell.\n if (this.isRow(item)) {\n let children = getChildNodes(item, this.collection);\n return this.direction === 'rtl'\n ? getLastItem(children).key\n : getFirstItem(children).key;\n }\n\n // If focus is on a cell, focus the next cell if any,\n // otherwise focus the parent row.\n if (this.isCell(item)) {\n let parent = this.collection.getItem(item.parentKey);\n let children = getChildNodes(parent, this.collection);\n let next = this.direction === 'rtl'\n ? getNthItem(children, item.index - 1)\n : getNthItem(children, item.index + 1);\n\n if (next) {\n return next.key;\n }\n\n // focus row only if focusMode is set to row\n if (this.focusMode === 'row') {\n return item.parentKey;\n }\n\n return this.direction === 'rtl' ? this.getFirstKey(key) : this.getLastKey(key);\n }\n }\n\n getKeyLeftOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus is on a row, focus the last child cell.\n if (this.isRow(item)) {\n let children = getChildNodes(item, this.collection);\n return this.direction === 'rtl'\n ? getFirstItem(children).key\n : getLastItem(children).key;\n }\n\n // If focus is on a cell, focus the previous cell if any,\n // otherwise focus the parent row.\n if (this.isCell(item)) {\n let parent = this.collection.getItem(item.parentKey);\n let children = getChildNodes(parent, this.collection);\n let prev = this.direction === 'rtl'\n ? getNthItem(children, item.index + 1)\n : getNthItem(children, item.index - 1);\n\n if (prev) {\n return prev.key;\n }\n\n // focus row only if focusMode is set to row\n if (this.focusMode === 'row') {\n return item.parentKey;\n }\n\n return this.direction === 'rtl' ? this.getLastKey(key) : this.getFirstKey(key);\n }\n }\n\n getFirstKey(key?: Key, global?: boolean) {\n let item: Node<T>;\n if (key != null) {\n item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If global flag is not set, and a cell is currently focused,\n // move focus to the first cell in the parent row.\n if (this.isCell(item) && !global) {\n let parent = this.collection.getItem(item.parentKey);\n return getFirstItem(getChildNodes(parent, this.collection)).key;\n }\n }\n\n // Find the first row\n key = this.findNextKey();\n\n // If global flag is set (or if focus mode is cell), focus the first cell in the first row.\n if ((key != null && item && this.isCell(item) && global) || this.focusMode === 'cell') {\n let item = this.collection.getItem(key);\n key = getFirstItem(getChildNodes(item, this.collection)).key;\n }\n\n // Otherwise, focus the row itself.\n return key;\n }\n\n getLastKey(key?: Key, global?: boolean) {\n let item: Node<T>;\n if (key != null) {\n item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If global flag is not set, and a cell is currently focused,\n // move focus to the last cell in the parent row.\n if (this.isCell(item) && !global) {\n let parent = this.collection.getItem(item.parentKey);\n let children = getChildNodes(parent, this.collection);\n return getLastItem(children).key;\n }\n }\n\n // Find the last row\n key = this.findPreviousKey();\n\n // If global flag is set (or if focus mode is cell), focus the last cell in the last row.\n if ((key != null && item && this.isCell(item) && global) || this.focusMode === 'cell') {\n let item = this.collection.getItem(key);\n let children = getChildNodes(item, this.collection);\n key = getLastItem(children).key;\n }\n\n // Otherwise, focus the row itself.\n return key;\n }\n\n private getItem(key: Key): HTMLElement {\n return this.ref.current.querySelector(`[data-key=\"${CSS.escape(key.toString())}\"]`);\n }\n\n private getItemRect(key: Key): Rect {\n if (this.layout) {\n return this.layout.getLayoutInfo(key)?.rect;\n }\n\n let item = this.getItem(key);\n if (item) {\n return new Rect(item.offsetLeft, item.offsetTop, item.offsetWidth, item.offsetHeight);\n }\n }\n\n private getPageHeight(): number {\n if (this.layout) {\n return this.layout.virtualizer?.visibleRect.height;\n }\n\n return this.ref?.current?.offsetHeight;\n }\n\n private getContentHeight(): number {\n if (this.layout) {\n return this.layout.getContentSize().height;\n }\n\n return this.ref?.current?.scrollHeight;\n }\n\n getKeyPageAbove(key: Key) {\n let itemRect = this.getItemRect(key);\n if (!itemRect) {\n return null;\n }\n\n let pageY = Math.max(0, itemRect.maxY - this.getPageHeight());\n\n while (itemRect && itemRect.y > pageY) {\n key = this.getKeyAbove(key);\n itemRect = this.getItemRect(key);\n }\n\n return key;\n }\n\n getKeyPageBelow(key: Key) {\n let itemRect = this.getItemRect(key);\n\n if (!itemRect) {\n return null;\n }\n\n let pageHeight = this.getPageHeight();\n let pageY = Math.min(this.getContentHeight(), itemRect.y + pageHeight);\n\n while (itemRect && itemRect.maxY < pageY) {\n let nextKey = this.getKeyBelow(key);\n itemRect = this.getItemRect(nextKey);\n\n // Guard against case where maxY of the last key is barely less than pageY due to rounding\n // and thus it attempts to set key to null\n if (nextKey != null) {\n key = nextKey;\n }\n }\n\n return key;\n }\n\n getKeyForSearch(search: string, fromKey?: Key) {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey ?? this.getFirstKey();\n\n // If the starting key is a cell, search from its parent row.\n let startItem = collection.getItem(key);\n if (startItem.type === 'cell') {\n key = startItem.parentKey;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n\n // check row text value for match\n if (item.textValue) {\n let substring = item.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n if (this.isRow(item) && this.focusMode === 'cell') {\n return getFirstItem(getChildNodes(item, this.collection)).key;\n }\n\n return item.key;\n }\n }\n\n key = this.findNextKey(key);\n\n // Wrap around when reaching the end of the collection\n if (key == null && !hasWrapped) {\n key = this.getFirstKey();\n hasWrapped = true;\n }\n }\n\n return null;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMAttributes, DOMProps, Key, KeyboardDelegate} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {GridCollection} from '@react-types/grid';\nimport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {RefObject, useCallback, useMemo} from 'react';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nimport {useSelectableCollection} from '@react-aria/selection';\n\nexport interface GridProps extends DOMProps, AriaLabelingProps {\n /** Whether the grid uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether initial grid focus should be placed on the grid row or grid cell.\n * @default 'row'\n */\n focusMode?: 'row' | 'cell',\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string,\n /**\n * The ref attached to the scrollable body. Used to provided automatic scrolling on item focus for non-virtualized grids.\n */\n scrollRef?: RefObject<HTMLElement>,\n /** Handler that is called when a user performs an action on the row. */\n onRowAction?: (key: Key) => void,\n /** Handler that is called when a user performs an action on the cell. */\n onCellAction?: (key: Key) => void\n}\n\nexport interface GridAria {\n /** Props for the grid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a grid component.\n * A grid displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the grid.\n * @param state - State for the grid, as returned by `useGridState`.\n * @param ref - The ref attached to the grid element.\n */\nexport function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>, ref: RefObject<HTMLElement>): GridAria {\n let {\n isVirtualized,\n keyboardDelegate,\n focusMode,\n scrollRef,\n getRowText,\n onRowAction,\n onCellAction\n } = props;\n let {selectionManager: manager} = state;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new GridKeyboardDelegate({\n collection: state.collection,\n disabledKeys: disabledBehavior === 'selection' ? new Set() : state.disabledKeys,\n ref,\n direction,\n collator,\n focusMode\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, focusMode]);\n\n let {collectionProps} = useSelectableCollection({\n ref,\n selectionManager: manager,\n keyboardDelegate: delegate,\n isVirtualized,\n scrollRef\n });\n\n let id = useId(props.id);\n gridMap.set(state, {keyboardDelegate: delegate, actions: {onRowAction, onCellAction}});\n\n let descriptionProps = useHighlightSelectionDescription({\n selectionManager: manager,\n hasItemActions: !!(onRowAction || onCellAction)\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n let onFocus = useCallback((e) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!e.currentTarget.contains(e.target)) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!e.currentTarget.contains(e.target)) {\n return;\n }\n\n manager.setFocused(true);\n }, [manager]);\n\n // Continue to track collection focused state even if keyboard navigation is disabled\n let navDisabledHandlers = useMemo(() => ({\n onBlur: collectionProps.onBlur,\n onFocus\n }), [onFocus, collectionProps.onBlur]);\n\n let hasTabbableChild = useHasTabbableChild(ref, {\n isDisabled: state.collection.size !== 0\n });\n\n let gridProps: DOMAttributes = mergeProps(\n domProps,\n {\n role: 'grid',\n id,\n 'aria-multiselectable': manager.selectionMode === 'multiple' ? 'true' : undefined\n },\n state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps,\n // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.\n state.collection.size === 0 && {tabIndex: hasTabbableChild ? -1 : 0},\n descriptionProps\n );\n\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size;\n gridProps['aria-colcount'] = state.collection.columnCount;\n }\n\n useGridSelectionAnnouncement({getRowText}, state);\n return {\n gridProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {GridCollection} from '@react-types/grid';\nimport type {GridState} from '@react-stately/grid';\nimport type {Key, KeyboardDelegate} from '@react-types/shared';\n\ninterface GridMapShared {\n keyboardDelegate: KeyboardDelegate,\n actions: {\n onRowAction: (key: Key) => void,\n onCellAction: (key: Key) => void\n }\n}\n\n// Used to share:\n// keyboard delegate between useGrid and useGridCell\n// onRowAction/onCellAction across hooks\nexport const gridMap = new WeakMap<GridState<unknown, GridCollection<unknown>>, GridMapShared>();\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {Collection, Key, Node, Selection} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {SelectionManager} from '@react-stately/selection';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useRef} from 'react';\nimport {useUpdateEffect} from '@react-aria/utils';\n\nexport interface GridSelectionAnnouncementProps {\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string\n}\n\ninterface GridSelectionState<T> {\n /** A collection of items in the grid. */\n collection: Collection<Node<T>>,\n /** A set of items that are disabled. */\n disabledKeys: Set<Key>,\n /** A selection manager to read and update multiple selection state. */\n selectionManager: SelectionManager\n}\n\nexport function useGridSelectionAnnouncement<T>(props: GridSelectionAnnouncementProps, state: GridSelectionState<T>) {\n let {\n getRowText = (key) => state.collection.getTextValue?.(key) ?? state.collection.getItem(key)?.textValue\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/grid');\n\n // Many screen readers do not announce when items in a grid are selected/deselected.\n // We do this using an ARIA live region.\n let selection = state.selectionManager.rawSelection;\n let lastSelection = useRef(selection);\n useUpdateEffect(() => {\n if (!state.selectionManager.isFocused) {\n lastSelection.current = selection;\n\n return;\n }\n\n let addedKeys = diffSelection(selection, lastSelection.current);\n let removedKeys = diffSelection(lastSelection.current, selection);\n\n // If adding or removing a single row from the selection, announce the name of that item.\n let isReplace = state.selectionManager.selectionBehavior === 'replace';\n let messages = [];\n\n if ((state.selectionManager.selectedKeys.size === 1 && isReplace)) {\n if (state.collection.getItem(state.selectionManager.selectedKeys.keys().next().value)) {\n let currentSelectionText = getRowText(state.selectionManager.selectedKeys.keys().next().value);\n if (currentSelectionText) {\n messages.push(stringFormatter.format('selectedItem', {item: currentSelectionText}));\n }\n }\n } else if (addedKeys.size === 1 && removedKeys.size === 0) {\n let addedText = getRowText(addedKeys.keys().next().value);\n if (addedText) {\n messages.push(stringFormatter.format('selectedItem', {item: addedText}));\n }\n } else if (removedKeys.size === 1 && addedKeys.size === 0) {\n if (state.collection.getItem(removedKeys.keys().next().value)) {\n let removedText = getRowText(removedKeys.keys().next().value);\n if (removedText) {\n messages.push(stringFormatter.format('deselectedItem', {item: removedText}));\n }\n }\n }\n\n // Announce how many items are selected, except when selecting the first item.\n if (state.selectionManager.selectionMode === 'multiple') {\n if (messages.length === 0 || selection === 'all' || selection.size > 1 || lastSelection.current === 'all' || lastSelection.current?.size > 1) {\n messages.push(selection === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selectedCount', {count: selection.size})\n );\n }\n }\n\n if (messages.length > 0) {\n announce(messages.join(' '));\n }\n\n lastSelection.current = selection;\n }, [selection]);\n}\n\nfunction diffSelection(a: Selection, b: Selection): Set<Key> {\n let res = new Set<Key>();\n if (a === 'all' || b === 'all') {\n return res;\n }\n\n for (let key of a.keys()) {\n if (!b.has(key)) {\n res.add(key);\n }\n }\n\n return res;\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {useDescription} from '@react-aria/utils';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useMemo} from 'react';\n\nexport interface HighlightSelectionDescriptionProps {\n selectionManager: MultipleSelectionManager,\n hasItemActions?: boolean\n}\n\n/**\n * Computes the description for a grid selectable collection.\n * @param props\n */\nexport function useHighlightSelectionDescription(props: HighlightSelectionDescriptionProps): AriaLabelingProps {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/grid');\n let modality = useInteractionModality();\n // null is the default if the user hasn't interacted with the table at all yet or the rest of the page\n let shouldLongPress = (modality === 'pointer' || modality === 'virtual' || modality == null)\n && typeof window !== 'undefined' && 'ontouchstart' in window;\n\n let interactionDescription = useMemo(() => {\n let selectionMode = props.selectionManager.selectionMode;\n let selectionBehavior = props.selectionManager.selectionBehavior;\n\n let message = undefined;\n if (shouldLongPress) {\n message = stringFormatter.format('longPressToSelect');\n }\n\n return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;\n }, [props.selectionManager.selectionMode, props.selectionManager.selectionBehavior, props.hasItemActions, stringFormatter, shouldLongPress]);\n\n let descriptionProps = useDescription(interactionDescription);\n return descriptionProps;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\n\nexport interface GridRowGroupAria {\n /** Props for the row group element. */\n rowGroupProps: DOMAttributes\n}\n\n/**\n * Provides the accessibility implementation for a row group in a grid.\n */\nexport function useGridRowGroup(): GridRowGroupAria {\n return {\n rowGroupProps: {\n role: 'rowgroup'\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement} from '@react-types/shared';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {RefObject} from 'react';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\n\nexport interface GridRowProps<T> {\n /** An object representing the grid row. Contains all the relevant information that makes up the grid row. */\n node: GridNode<T>,\n /** Whether the grid row is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the row.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface GridRowAria extends SelectableItemStates {\n /** Props for the grid row element. */\n rowProps: DOMAttributes,\n /** Whether the row is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a grid.\n * @param props - Props for the row.\n * @param state - State of the parent grid, as returned by `useGridState`.\n */\nexport function useGridRow<T, C extends GridCollection<T>, S extends GridState<T, C>>(props: GridRowProps<T>, state: S, ref: RefObject<FocusableElement>): GridRowAria {\n let {\n node,\n isVirtualized,\n shouldSelectOnPressUp,\n onAction\n } = props;\n\n let {actions: {onRowAction}} = gridMap.get(state);\n let {itemProps, ...states} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n shouldSelectOnPressUp,\n onAction: onRowAction ? () => onRowAction(node.key) : onAction,\n isDisabled: state.collection.size === 0\n });\n\n let isSelected = state.selectionManager.isSelected(node.key);\n\n let rowProps: DOMAttributes = {\n role: 'row',\n 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined,\n 'aria-disabled': states.isDisabled || undefined,\n ...itemProps\n };\n\n if (isVirtualized) {\n rowProps['aria-rowindex'] = node.index + 1; // aria-rowindex is 1 based\n }\n\n return {\n rowProps,\n ...states\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement} from '@react-types/shared';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {getScrollParent, mergeProps, scrollIntoViewport} from '@react-aria/utils';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {isFocusVisible} from '@react-aria/interactions';\nimport {KeyboardEvent as ReactKeyboardEvent, RefObject, useRef} from 'react';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface GridCellProps {\n /** An object representing the grid cell. Contains all the relevant information that makes up the grid cell. */\n node: GridNode<unknown>,\n /** Whether the grid cell is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether the cell or its first focusable child element should be focused when the grid cell is focused. */\n focusMode?: 'child' | 'cell',\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the cell.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface GridCellAria {\n /** Props for the grid cell element. */\n gridCellProps: DOMAttributes,\n /** Whether the cell is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a cell in a grid.\n * @param props - Props for the cell.\n * @param state - State of the parent grid, as returned by `useGridState`.\n */\nexport function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>, ref: RefObject<FocusableElement>): GridCellAria {\n let {\n node,\n isVirtualized,\n focusMode = 'child',\n shouldSelectOnPressUp,\n onAction\n } = props;\n\n let {direction} = useLocale();\n let {keyboardDelegate, actions: {onCellAction}} = gridMap.get(state);\n\n // We need to track the key of the item at the time it was last focused so that we force\n // focus to go to the item when the DOM node is reused for a different item in a virtualizer.\n let keyWhenFocused = useRef(null);\n\n // Handles focusing the cell. If there is a focusable child,\n // it is focused, otherwise the cell itself is focused.\n let focus = () => {\n let treeWalker = getFocusableTreeWalker(ref.current);\n if (focusMode === 'child') {\n // If focus is already on a focusable child within the cell, early return so we don't shift focus\n if (ref.current.contains(document.activeElement) && ref.current !== document.activeElement) {\n return;\n }\n\n let focusable = state.selectionManager.childFocusStrategy === 'last'\n ? last(treeWalker)\n : treeWalker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n return;\n }\n }\n\n if (\n (keyWhenFocused.current != null && node.key !== keyWhenFocused.current) ||\n !ref.current.contains(document.activeElement)\n ) {\n focusSafely(ref.current);\n }\n };\n\n let {itemProps, isPressed} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n focus,\n shouldSelectOnPressUp,\n onAction: onCellAction ? () => onCellAction(node.key) : onAction,\n isDisabled: state.collection.size === 0\n });\n\n let onKeyDownCapture = (e: ReactKeyboardEvent) => {\n if (!e.currentTarget.contains(e.target as Element) || state.isKeyboardNavigationDisabled) {\n return;\n }\n\n let walker = getFocusableTreeWalker(ref.current);\n walker.currentNode = document.activeElement;\n\n switch (e.key) {\n case 'ArrowLeft': {\n // Find the next focusable element within the cell.\n let focusable = direction === 'rtl'\n ? walker.nextNode() as FocusableElement\n : walker.previousNode() as FocusableElement;\n\n // Don't focus the cell itself if focusMode is \"child\"\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n if (focusable) {\n e.preventDefault();\n e.stopPropagation();\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n // If there is no next focusable child, then move to the next cell to the left of this one.\n // This will be handled by useSelectableCollection. However, if there is no cell to the left\n // of this one, only one column, and the grid doesn't focus rows, then the next key will be the\n // same as this one. In that case we need to handle focusing either the cell or the first/last\n // child, depending on the focus mode.\n let prev = keyboardDelegate.getKeyLeftOf(node.key);\n if (prev !== node.key) {\n break;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusMode === 'cell' && direction === 'rtl') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? walker.firstChild() as FocusableElement\n : last(walker);\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowRight': {\n let focusable = direction === 'rtl'\n ? walker.previousNode() as FocusableElement\n : walker.nextNode() as FocusableElement;\n\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n if (focusable) {\n e.preventDefault();\n e.stopPropagation();\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n let next = keyboardDelegate.getKeyRightOf(node.key);\n if (next !== node.key) {\n break;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusMode === 'cell' && direction === 'ltr') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? last(walker)\n : walker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n // Prevent this event from reaching cell children, e.g. menu buttons. We want arrow keys to navigate\n // to the cell above/below instead. We need to re-dispatch the event from a higher parent so it still\n // bubbles and gets handled by useSelectableCollection.\n if (!e.altKey && ref.current.contains(e.target as Element)) {\n e.stopPropagation();\n e.preventDefault();\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n }\n break;\n }\n };\n\n // Grid cells can have focusable elements inside them. In this case, focus should\n // be marshalled to that element rather than focusing the cell itself.\n let onFocus = (e) => {\n keyWhenFocused.current = node.key;\n if (e.target !== ref.current) {\n // useSelectableItem only handles setting the focused key when\n // the focused element is the gridcell itself. We also want to\n // set the focused key when a child element receives focus.\n // If focus is currently visible (e.g. the user is navigating with the keyboard),\n // then skip this. We want to restore focus to the previously focused row/cell\n // in that case since the table should act like a single tab stop.\n if (!isFocusVisible()) {\n state.selectionManager.setFocusedKey(node.key);\n }\n return;\n }\n\n // If the cell itself is focused, wait a frame so that focus finishes propagatating\n // up to the tree, and move focus to a focusable child if possible.\n requestAnimationFrame(() => {\n if (focusMode === 'child' && document.activeElement === ref.current) {\n focus();\n }\n });\n };\n\n let gridCellProps: DOMAttributes = mergeProps(itemProps, {\n role: 'gridcell',\n onKeyDownCapture,\n onFocus\n });\n\n if (isVirtualized) {\n gridCellProps['aria-colindex'] = (node.colIndex ?? node.index) + 1; // aria-colindex is 1-based\n }\n\n // When pressing with a pointer and cell selection is not enabled, usePress will be applied to the\n // row rather than the cell. However, when the row is draggable, usePress cannot preventDefault\n // on pointer down, so the browser will try to focus the cell which has a tabIndex applied.\n // To avoid this, remove the tabIndex from the cell briefly on pointer down.\n if (shouldSelectOnPressUp && gridCellProps.tabIndex != null && gridCellProps.onPointerDown == null) {\n gridCellProps.onPointerDown = (e) => {\n let el = e.currentTarget;\n let tabindex = el.getAttribute('tabindex');\n el.removeAttribute('tabindex');\n requestAnimationFrame(() => {\n el.setAttribute('tabindex', tabindex);\n });\n };\n }\n\n return {\n gridCellProps,\n isPressed\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","import {AriaCheckboxProps} from '@react-types/checkbox';\nimport {GridCollection} from '@react-types/grid';\nimport {GridState} from '@react-stately/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key} from '@react-types/shared';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaGridSelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key\n}\n\nexport interface GridSelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a grid.\n * @param props - Props for the selection checkbox.\n * @param state - State of the grid, as returned by `useGridState`.\n */\nexport function useGridSelectionCheckbox<T, C extends GridCollection<T>>(props: AriaGridSelectionCheckboxProps, state: GridState<T, C>): GridSelectionCheckboxAria {\n let {key} = props;\n\n let manager = state.selectionManager;\n let checkboxId = useId();\n let isDisabled = !state.selectionManager.canSelectItem(key);\n let isSelected = state.selectionManager.isSelected(key);\n\n let onChange = () => manager.select(key);\n\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/grid');\n\n return {\n checkboxProps: {\n id: checkboxId,\n 'aria-label': stringFormatter.format('select'),\n isSelected,\n isDisabled,\n onChange\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAmBM,MAAM;IAqBD,OAAO,IAAa,EAAE;QAC9B,OAAO,KAAK,IAAI,KAAK;IACvB;IAEU,MAAM,IAAa,EAAE;QAC7B,OAAO,KAAK,IAAI,KAAK,SAAS,KAAK,IAAI,KAAK;IAC9C;IAEQ,WAAW,IAAmB,EAAE;YACK;QAA3C,OAAO,IAAI,CAAC,gBAAgB,KAAK,SAAU,CAAA,EAAA,cAAA,KAAK,KAAK,cAAV,kCAAA,YAAY,UAAU,KAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,GAAG,CAAA;IACrG;IAEU,gBAAgB,OAAa,EAAE,IAAiC,EAAE;QAC1E,IAAI,MAAM,WAAW,OACjB,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,WAC7B,IAAI,CAAC,UAAU,CAAC,UAAU;QAE9B,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAU,CAAA,CAAC,QAAQ,KAAK,KAAI,GAC/C,OAAO;YAGT,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QACrC;IACF;IAEU,YAAY,OAAa,EAAE,IAAiC,EAAE;QACtE,IAAI,MAAM,WAAW,OACjB,IAAI,CAAC,UAAU,CAAC,WAAW,CA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A+F;IAC/F,2FAA2F;IAC3F,4EAA4E;IAC5E,IAAI,yBAAyB,cAAc,QAAQ,IAAI,QAAQ,cAAc,aAAa,IAAI,MAC5F,cAAc,aAAa,GAAG,CAAC;QAC7B,IAAI,KAAK,EAAE,aAAa;QACxB,IAAI,WAAW,GAAG,YAAY,CAAC;QAC/B,GAAG,eAAe,CAAC;QACnB,sBAAsB;YACpB,GAAG,YAAY,CAAC,YAAY;QAC9B;IACF;IAGF,OAAO;uBACL;mBACA;IACF;AACF;AAEA,SAAS,2BAAK,MAAkB;IAC9B,IAAI;IACJ,IAAI;IACJ,GAAG;QACD,OAAO,OAAO,SAAS;QACvB,IAAI,MACF,OAAO;IAEX,QAAS,MAAM;IACf,OAAO;AACT;;;;;;ACxQO,SAAS,0CAAyD,KAAqC,EAAE,KAAsB;IACpI,IAAI,OAAC,GAAG,EAAC,GAAG;IAEZ,IAAI,UAAU,MAAM,gBAAgB;IACpC,IAAI,aAAa,CAAA,GAAA,2BAAI;IACrB,IAAI,aAAa,CAAC,MAAM,gBAAgB,CAAC,aAAa,CAAC;IACvD,IAAI,aAAa,MAAM,gBAAgB,CAAC,UAAU,CAAC;IAEnD,IAAI,WAAW,IAAM,QAAQ,MAAM,CAAC;IAEpC,MAAM,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,gEAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,IAAI;YACJ,cAAc,gBAAgB,MAAM,CAAC;wBACrC;wBACA;sBACA;QACF;IACF;AACF;","sources":["packages/@react-aria/grid/src/index.ts","packages/@react-aria/grid/src/GridKeyboardDelegate.ts","packages/@react-aria/grid/src/useGrid.ts","packages/@react-aria/grid/src/utils.ts","packages/@react-aria/grid/src/useGridSelectionAnnouncement.ts","packages/@react-aria/grid/src/*.js","packages/@react-aria/grid/src/useHighlightSelectionDescription.ts","packages/@react-aria/grid/src/useGridRowGroup.ts","packages/@react-aria/grid/src/useGridRow.ts","packages/@react-aria/grid/src/useGridCell.ts","packages/@react-aria/grid/src/useGridSelectionCheckbox.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nexport {useGrid} from './useGrid';\nexport {useGridRowGroup} from './useGridRowGroup';\nexport {useGridRow} from './useGridRow';\nexport {useGridCell} from './useGridCell';\nexport {useGridSelectionCheckbox} from './useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\n\nexport type {GridProps, GridAria} from './useGrid';\nexport type {GridCellAria, GridCellProps} from './useGridCell';\nexport type {GridRowGroupAria} from './useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from './useGridRow';\nexport type {GridKeyboardDelegateOptions} from './GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from './useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from './useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from './useGridSelectionAnnouncement';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Direction, DisabledBehavior, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes, getFirstItem, getLastItem, getNthItem} from '@react-stately/collections';\nimport {GridCollection} from '@react-types/grid';\nimport {Layout, Rect} from '@react-stately/virtualizer';\nimport {RefObject} from 'react';\n\nexport interface GridKeyboardDelegateOptions<T, C> {\n collection: C,\n disabledKeys: Set<Key>,\n disabledBehavior?: DisabledBehavior,\n ref?: RefObject<HTMLElement>,\n direction: Direction,\n collator?: Intl.Collator,\n layout?: Layout<Node<T>>,\n focusMode?: 'row' | 'cell'\n}\n\nexport class GridKeyboardDelegate<T, C extends GridCollection<T>> implements KeyboardDelegate {\n collection: C;\n protected disabledKeys: Set<Key>;\n protected disabledBehavior: DisabledBehavior;\n protected ref: RefObject<HTMLElement>;\n protected direction: Direction;\n protected collator: Intl.Collator;\n protected layout: Layout<Node<T>>;\n protected focusMode;\n\n constructor(options: GridKeyboardDelegateOptions<T, C>) {\n this.collection = options.collection;\n this.disabledKeys = options.disabledKeys;\n this.disabledBehavior = options.disabledBehavior || 'all';\n this.ref = options.ref;\n this.direction = options.direction;\n this.collator = options.collator;\n this.layout = options.layout;\n this.focusMode = options.focusMode || 'row';\n }\n\n protected isCell(node: Node<T>) {\n return node.type === 'cell';\n }\n\n protected isRow(node: Node<T>) {\n return node.type === 'row' || node.type === 'item';\n }\n\n private isDisabled(item: Node<unknown>) {\n return this.disabledBehavior === 'all' && (item.props?.isDisabled || this.disabledKeys.has(item.key));\n }\n\n protected findPreviousKey(fromKey?: Key, pred?: (item: Node<T>) => boolean) {\n let key = fromKey != null\n ? this.collection.getKeyBefore(fromKey)\n : this.collection.getLastKey();\n\n while (key != null) {\n let item = this.collection.getItem(key);\n if (!this.isDisabled(item) && (!pred || pred(item))) {\n return key;\n }\n\n key = this.collection.getKeyBefore(key);\n }\n }\n\n protected findNextKey(fromKey?: Key, pred?: (item: Node<T>) => boolean) {\n let key = fromKey != null\n ? this.collection.getKeyAfter(fromKey)\n : this.collection.getFirstKey();\n\n while (key != null) {\n let item = this.collection.getItem(key);\n if (!this.isDisabled(item) && (!pred || pred(item))) {\n return key;\n }\n\n key = this.collection.getKeyAfter(key);\n }\n }\n\n getKeyBelow(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus was on a cell, start searching from the parent row\n if (this.isCell(startItem)) {\n key = startItem.parentKey;\n }\n\n // Find the next item\n key = this.findNextKey(key);\n if (key != null) {\n // If focus was on a cell, focus the cell with the same index in the next row.\n if (this.isCell(startItem)) {\n let item = this.collection.getItem(key);\n return getNthItem(getChildNodes(item, this.collection), startItem.index).key;\n }\n\n // Otherwise, focus the next row\n if (this.focusMode === 'row') {\n return key;\n }\n }\n }\n\n getKeyAbove(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus is on a cell, start searching from the parent row\n if (this.isCell(startItem)) {\n key = startItem.parentKey;\n }\n\n // Find the previous item\n key = this.findPreviousKey(key);\n if (key != null) {\n // If focus was on a cell, focus the cell with the same index in the previous row.\n if (this.isCell(startItem)) {\n let item = this.collection.getItem(key);\n return getNthItem(getChildNodes(item, this.collection), startItem.index).key;\n }\n\n // Otherwise, focus the previous row\n if (this.focusMode === 'row') {\n return key;\n }\n }\n }\n\n getKeyRightOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus is on a row, focus the first child cell.\n if (this.isRow(item)) {\n let children = getChildNodes(item, this.collection);\n return this.direction === 'rtl'\n ? getLastItem(children).key\n : getFirstItem(children).key;\n }\n\n // If focus is on a cell, focus the next cell if any,\n // otherwise focus the parent row.\n if (this.isCell(item)) {\n let parent = this.collection.getItem(item.parentKey);\n let children = getChildNodes(parent, this.collection);\n let next = this.direction === 'rtl'\n ? getNthItem(children, item.index - 1)\n : getNthItem(children, item.index + 1);\n\n if (next) {\n return next.key;\n }\n\n // focus row only if focusMode is set to row\n if (this.focusMode === 'row') {\n return item.parentKey;\n }\n\n return this.direction === 'rtl' ? this.getFirstKey(key) : this.getLastKey(key);\n }\n }\n\n getKeyLeftOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus is on a row, focus the last child cell.\n if (this.isRow(item)) {\n let children = getChildNodes(item, this.collection);\n return this.direction === 'rtl'\n ? getFirstItem(children).key\n : getLastItem(children).key;\n }\n\n // If focus is on a cell, focus the previous cell if any,\n // otherwise focus the parent row.\n if (this.isCell(item)) {\n let parent = this.collection.getItem(item.parentKey);\n let children = getChildNodes(parent, this.collection);\n let prev = this.direction === 'rtl'\n ? getNthItem(children, item.index + 1)\n : getNthItem(children, item.index - 1);\n\n if (prev) {\n return prev.key;\n }\n\n // focus row only if focusMode is set to row\n if (this.focusMode === 'row') {\n return item.parentKey;\n }\n\n return this.direction === 'rtl' ? this.getLastKey(key) : this.getFirstKey(key);\n }\n }\n\n getFirstKey(key?: Key, global?: boolean) {\n let item: Node<T>;\n if (key != null) {\n item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If global flag is not set, and a cell is currently focused,\n // move focus to the first cell in the parent row.\n if (this.isCell(item) && !global) {\n let parent = this.collection.getItem(item.parentKey);\n return getFirstItem(getChildNodes(parent, this.collection)).key;\n }\n }\n\n // Find the first row\n key = this.findNextKey();\n\n // If global flag is set (or if focus mode is cell), focus the first cell in the first row.\n if ((key != null && item && this.isCell(item) && global) || this.focusMode === 'cell') {\n let item = this.collection.getItem(key);\n key = getFirstItem(getChildNodes(item, this.collection)).key;\n }\n\n // Otherwise, focus the row itself.\n return key;\n }\n\n getLastKey(key?: Key, global?: boolean) {\n let item: Node<T>;\n if (key != null) {\n item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If global flag is not set, and a cell is currently focused,\n // move focus to the last cell in the parent row.\n if (this.isCell(item) && !global) {\n let parent = this.collection.getItem(item.parentKey);\n let children = getChildNodes(parent, this.collection);\n return getLastItem(children).key;\n }\n }\n\n // Find the last row\n key = this.findPreviousKey();\n\n // If global flag is set (or if focus mode is cell), focus the last cell in the last row.\n if ((key != null && item && this.isCell(item) && global) || this.focusMode === 'cell') {\n let item = this.collection.getItem(key);\n let children = getChildNodes(item, this.collection);\n key = getLastItem(children).key;\n }\n\n // Otherwise, focus the row itself.\n return key;\n }\n\n private getItem(key: Key): HTMLElement {\n return this.ref.current.querySelector(`[data-key=\"${CSS.escape(key.toString())}\"]`);\n }\n\n private getItemRect(key: Key): Rect {\n if (this.layout) {\n return this.layout.getLayoutInfo(key)?.rect;\n }\n\n let item = this.getItem(key);\n if (item) {\n return new Rect(item.offsetLeft, item.offsetTop, item.offsetWidth, item.offsetHeight);\n }\n }\n\n private getPageHeight(): number {\n if (this.layout) {\n return this.layout.virtualizer?.visibleRect.height;\n }\n\n return this.ref?.current?.offsetHeight;\n }\n\n private getContentHeight(): number {\n if (this.layout) {\n return this.layout.getContentSize().height;\n }\n\n return this.ref?.current?.scrollHeight;\n }\n\n getKeyPageAbove(key: Key) {\n let itemRect = this.getItemRect(key);\n if (!itemRect) {\n return null;\n }\n\n let pageY = Math.max(0, itemRect.maxY - this.getPageHeight());\n\n while (itemRect && itemRect.y > pageY) {\n key = this.getKeyAbove(key);\n itemRect = this.getItemRect(key);\n }\n\n return key;\n }\n\n getKeyPageBelow(key: Key) {\n let itemRect = this.getItemRect(key);\n\n if (!itemRect) {\n return null;\n }\n\n let pageHeight = this.getPageHeight();\n let pageY = Math.min(this.getContentHeight(), itemRect.y + pageHeight);\n\n while (itemRect && itemRect.maxY < pageY) {\n let nextKey = this.getKeyBelow(key);\n itemRect = this.getItemRect(nextKey);\n\n // Guard against case where maxY of the last key is barely less than pageY due to rounding\n // and thus it attempts to set key to null\n if (nextKey != null) {\n key = nextKey;\n }\n }\n\n return key;\n }\n\n getKeyForSearch(search: string, fromKey?: Key) {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey ?? this.getFirstKey();\n\n // If the starting key is a cell, search from its parent row.\n let startItem = collection.getItem(key);\n if (startItem.type === 'cell') {\n key = startItem.parentKey;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n\n // check row text value for match\n if (item.textValue) {\n let substring = item.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n if (this.isRow(item) && this.focusMode === 'cell') {\n return getFirstItem(getChildNodes(item, this.collection)).key;\n }\n\n return item.key;\n }\n }\n\n key = this.findNextKey(key);\n\n // Wrap around when reaching the end of the collection\n if (key == null && !hasWrapped) {\n key = this.getFirstKey();\n hasWrapped = true;\n }\n }\n\n return null;\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMAttributes, DOMProps, Key, KeyboardDelegate} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {GridCollection} from '@react-types/grid';\nimport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {RefObject, useCallback, useMemo} from 'react';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nimport {useSelectableCollection} from '@react-aria/selection';\n\nexport interface GridProps extends DOMProps, AriaLabelingProps {\n /** Whether the grid uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether initial grid focus should be placed on the grid row or grid cell.\n * @default 'row'\n */\n focusMode?: 'row' | 'cell',\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string,\n /**\n * The ref attached to the scrollable body. Used to provided automatic scrolling on item focus for non-virtualized grids.\n */\n scrollRef?: RefObject<HTMLElement>,\n /** Handler that is called when a user performs an action on the row. */\n onRowAction?: (key: Key) => void,\n /** Handler that is called when a user performs an action on the cell. */\n onCellAction?: (key: Key) => void\n}\n\nexport interface GridAria {\n /** Props for the grid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a grid component.\n * A grid displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the grid.\n * @param state - State for the grid, as returned by `useGridState`.\n * @param ref - The ref attached to the grid element.\n */\nexport function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>, ref: RefObject<HTMLElement>): GridAria {\n let {\n isVirtualized,\n keyboardDelegate,\n focusMode,\n scrollRef,\n getRowText,\n onRowAction,\n onCellAction\n } = props;\n let {selectionManager: manager} = state;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new GridKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n focusMode\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, focusMode]);\n\n let {collectionProps} = useSelectableCollection({\n ref,\n selectionManager: manager,\n keyboardDelegate: delegate,\n isVirtualized,\n scrollRef\n });\n\n let id = useId(props.id);\n gridMap.set(state, {keyboardDelegate: delegate, actions: {onRowAction, onCellAction}});\n\n let descriptionProps = useHighlightSelectionDescription({\n selectionManager: manager,\n hasItemActions: !!(onRowAction || onCellAction)\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n let onFocus = useCallback((e) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!e.currentTarget.contains(e.target)) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!e.currentTarget.contains(e.target)) {\n return;\n }\n\n manager.setFocused(true);\n }, [manager]);\n\n // Continue to track collection focused state even if keyboard navigation is disabled\n let navDisabledHandlers = useMemo(() => ({\n onBlur: collectionProps.onBlur,\n onFocus\n }), [onFocus, collectionProps.onBlur]);\n\n let hasTabbableChild = useHasTabbableChild(ref, {\n isDisabled: state.collection.size !== 0\n });\n\n let gridProps: DOMAttributes = mergeProps(\n domProps,\n {\n role: 'grid',\n id,\n 'aria-multiselectable': manager.selectionMode === 'multiple' ? 'true' : undefined\n },\n state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps,\n // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.\n state.collection.size === 0 && {tabIndex: hasTabbableChild ? -1 : 0},\n descriptionProps\n );\n\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size;\n gridProps['aria-colcount'] = state.collection.columnCount;\n }\n\n useGridSelectionAnnouncement({getRowText}, state);\n return {\n gridProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {GridCollection} from '@react-types/grid';\nimport type {GridState} from '@react-stately/grid';\nimport type {Key, KeyboardDelegate} from '@react-types/shared';\n\ninterface GridMapShared {\n keyboardDelegate: KeyboardDelegate,\n actions: {\n onRowAction: (key: Key) => void,\n onCellAction: (key: Key) => void\n }\n}\n\n// Used to share:\n// keyboard delegate between useGrid and useGridCell\n// onRowAction/onCellAction across hooks\nexport const gridMap = new WeakMap<GridState<unknown, GridCollection<unknown>>, GridMapShared>();\n","/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {Collection, Key, Node, Selection} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {SelectionManager} from '@react-stately/selection';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useRef} from 'react';\nimport {useUpdateEffect} from '@react-aria/utils';\n\nexport interface GridSelectionAnnouncementProps {\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string\n}\n\ninterface GridSelectionState<T> {\n /** A collection of items in the grid. */\n collection: Collection<Node<T>>,\n /** A set of items that are disabled. */\n disabledKeys: Set<Key>,\n /** A selection manager to read and update multiple selection state. */\n selectionManager: SelectionManager\n}\n\nexport function useGridSelectionAnnouncement<T>(props: GridSelectionAnnouncementProps, state: GridSelectionState<T>) {\n let {\n getRowText = (key) => state.collection.getTextValue?.(key) ?? state.collection.getItem(key)?.textValue\n } = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/grid');\n\n // Many screen readers do not announce when items in a grid are selected/deselected.\n // We do this using an ARIA live region.\n let selection = state.selectionManager.rawSelection;\n let lastSelection = useRef(selection);\n useUpdateEffect(() => {\n if (!state.selectionManager.isFocused) {\n lastSelection.current = selection;\n\n return;\n }\n\n let addedKeys = diffSelection(selection, lastSelection.current);\n let removedKeys = diffSelection(lastSelection.current, selection);\n\n // If adding or removing a single row from the selection, announce the name of that item.\n let isReplace = state.selectionManager.selectionBehavior === 'replace';\n let messages = [];\n\n if ((state.selectionManager.selectedKeys.size === 1 && isReplace)) {\n if (state.collection.getItem(state.selectionManager.selectedKeys.keys().next().value)) {\n let currentSelectionText = getRowText(state.selectionManager.selectedKeys.keys().next().value);\n if (currentSelectionText) {\n messages.push(stringFormatter.format('selectedItem', {item: currentSelectionText}));\n }\n }\n } else if (addedKeys.size === 1 && removedKeys.size === 0) {\n let addedText = getRowText(addedKeys.keys().next().value);\n if (addedText) {\n messages.push(stringFormatter.format('selectedItem', {item: addedText}));\n }\n } else if (removedKeys.size === 1 && addedKeys.size === 0) {\n if (state.collection.getItem(removedKeys.keys().next().value)) {\n let removedText = getRowText(removedKeys.keys().next().value);\n if (removedText) {\n messages.push(stringFormatter.format('deselectedItem', {item: removedText}));\n }\n }\n }\n\n // Announce how many items are selected, except when selecting the first item.\n if (state.selectionManager.selectionMode === 'multiple') {\n if (messages.length === 0 || selection === 'all' || selection.size > 1 || lastSelection.current === 'all' || lastSelection.current?.size > 1) {\n messages.push(selection === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selectedCount', {count: selection.size})\n );\n }\n }\n\n if (messages.length > 0) {\n announce(messages.join(' '));\n }\n\n lastSelection.current = selection;\n }, [selection]);\n}\n\nfunction diffSelection(a: Selection, b: Selection): Set<Key> {\n let res = new Set<Key>();\n if (a === 'all' || b === 'all') {\n return res;\n }\n\n for (let key of a.keys()) {\n if (!b.has(key)) {\n res.add(key);\n }\n }\n\n return res;\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {MultipleSelectionManager} from '@react-stately/selection';\nimport {useDescription} from '@react-aria/utils';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useMemo} from 'react';\n\nexport interface HighlightSelectionDescriptionProps {\n selectionManager: MultipleSelectionManager,\n hasItemActions?: boolean\n}\n\n/**\n * Computes the description for a grid selectable collection.\n * @param props\n */\nexport function useHighlightSelectionDescription(props: HighlightSelectionDescriptionProps): AriaLabelingProps {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/grid');\n let modality = useInteractionModality();\n // null is the default if the user hasn't interacted with the table at all yet or the rest of the page\n let shouldLongPress = (modality === 'pointer' || modality === 'virtual' || modality == null)\n && typeof window !== 'undefined' && 'ontouchstart' in window;\n\n let interactionDescription = useMemo(() => {\n let selectionMode = props.selectionManager.selectionMode;\n let selectionBehavior = props.selectionManager.selectionBehavior;\n\n let message = undefined;\n if (shouldLongPress) {\n message = stringFormatter.format('longPressToSelect');\n }\n\n return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;\n }, [props.selectionManager.selectionMode, props.selectionManager.selectionBehavior, props.hasItemActions, stringFormatter, shouldLongPress]);\n\n let descriptionProps = useDescription(interactionDescription);\n return descriptionProps;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\n\nexport interface GridRowGroupAria {\n /** Props for the row group element. */\n rowGroupProps: DOMAttributes\n}\n\n/**\n * Provides the accessibility implementation for a row group in a grid.\n */\nexport function useGridRowGroup(): GridRowGroupAria {\n return {\n rowGroupProps: {\n role: 'rowgroup'\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from '@react-aria/utils';\nimport {DOMAttributes, FocusableElement} from '@react-types/shared';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {RefObject} from 'react';\nimport {SelectableItemStates, useSelectableItem} from '@react-aria/selection';\n\nexport interface GridRowProps<T> {\n /** An object representing the grid row. Contains all the relevant information that makes up the grid row. */\n node: GridNode<T>,\n /** Whether the grid row is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the row.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface GridRowAria extends SelectableItemStates {\n /** Props for the grid row element. */\n rowProps: DOMAttributes,\n /** Whether the row is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row in a grid.\n * @param props - Props for the row.\n * @param state - State of the parent grid, as returned by `useGridState`.\n */\nexport function useGridRow<T, C extends GridCollection<T>, S extends GridState<T, C>>(props: GridRowProps<T>, state: S, ref: RefObject<FocusableElement>): GridRowAria {\n let {\n node,\n isVirtualized,\n shouldSelectOnPressUp,\n onAction\n } = props;\n\n let {actions} = gridMap.get(state);\n let onRowAction = actions.onRowAction ? () => actions.onRowAction(node.key) : onAction;\n let {itemProps, ...states} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n shouldSelectOnPressUp,\n onAction: onRowAction || node?.props?.onAction ? chain(node?.props?.onAction, onRowAction) : undefined,\n isDisabled: state.collection.size === 0\n });\n\n let isSelected = state.selectionManager.isSelected(node.key);\n\n let rowProps: DOMAttributes = {\n role: 'row',\n 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined,\n 'aria-disabled': states.isDisabled || undefined,\n ...itemProps\n };\n\n if (isVirtualized) {\n rowProps['aria-rowindex'] = node.index + 1; // aria-rowindex is 1 based\n }\n\n return {\n rowProps,\n ...states\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, FocusableElement} from '@react-types/shared';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {getScrollParent, mergeProps, scrollIntoViewport} from '@react-aria/utils';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {isFocusVisible} from '@react-aria/interactions';\nimport {KeyboardEvent as ReactKeyboardEvent, RefObject, useRef} from 'react';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface GridCellProps {\n /** An object representing the grid cell. Contains all the relevant information that makes up the grid cell. */\n node: GridNode<unknown>,\n /** Whether the grid cell is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether the cell or its first focusable child element should be focused when the grid cell is focused. */\n focusMode?: 'child' | 'cell',\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the cell.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface GridCellAria {\n /** Props for the grid cell element. */\n gridCellProps: DOMAttributes,\n /** Whether the cell is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a cell in a grid.\n * @param props - Props for the cell.\n * @param state - State of the parent grid, as returned by `useGridState`.\n */\nexport function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>, ref: RefObject<FocusableElement>): GridCellAria {\n let {\n node,\n isVirtualized,\n focusMode = 'child',\n shouldSelectOnPressUp,\n onAction\n } = props;\n\n let {direction} = useLocale();\n let {keyboardDelegate, actions: {onCellAction}} = gridMap.get(state);\n\n // We need to track the key of the item at the time it was last focused so that we force\n // focus to go to the item when the DOM node is reused for a different item in a virtualizer.\n let keyWhenFocused = useRef(null);\n\n // Handles focusing the cell. If there is a focusable child,\n // it is focused, otherwise the cell itself is focused.\n let focus = () => {\n let treeWalker = getFocusableTreeWalker(ref.current);\n if (focusMode === 'child') {\n // If focus is already on a focusable child within the cell, early return so we don't shift focus\n if (ref.current.contains(document.activeElement) && ref.current !== document.activeElement) {\n return;\n }\n\n let focusable = state.selectionManager.childFocusStrategy === 'last'\n ? last(treeWalker)\n : treeWalker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n return;\n }\n }\n\n if (\n (keyWhenFocused.current != null && node.key !== keyWhenFocused.current) ||\n !ref.current.contains(document.activeElement)\n ) {\n focusSafely(ref.current);\n }\n };\n\n let {itemProps, isPressed} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n focus,\n shouldSelectOnPressUp,\n onAction: onCellAction ? () => onCellAction(node.key) : onAction,\n isDisabled: state.collection.size === 0\n });\n\n let onKeyDownCapture = (e: ReactKeyboardEvent) => {\n if (!e.currentTarget.contains(e.target as Element) || state.isKeyboardNavigationDisabled) {\n return;\n }\n\n let walker = getFocusableTreeWalker(ref.current);\n walker.currentNode = document.activeElement;\n\n switch (e.key) {\n case 'ArrowLeft': {\n // Find the next focusable element within the cell.\n let focusable = direction === 'rtl'\n ? walker.nextNode() as FocusableElement\n : walker.previousNode() as FocusableElement;\n\n // Don't focus the cell itself if focusMode is \"child\"\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n // If there is no next focusable child, then move to the next cell to the left of this one.\n // This will be handled by useSelectableCollection. However, if there is no cell to the left\n // of this one, only one column, and the grid doesn't focus rows, then the next key will be the\n // same as this one. In that case we need to handle focusing either the cell or the first/last\n // child, depending on the focus mode.\n let prev = keyboardDelegate.getKeyLeftOf(node.key);\n if (prev !== node.key) {\n // We prevent the capturing event from reaching children of the cell, e.g. pickers.\n // We want arrow keys to navigate to the next cell instead. We need to re-dispatch \n // the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n break;\n }\n\n if (focusMode === 'cell' && direction === 'rtl') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? walker.firstChild() as FocusableElement\n : last(walker);\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowRight': {\n let focusable = direction === 'rtl'\n ? walker.previousNode() as FocusableElement\n : walker.nextNode() as FocusableElement;\n\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n let next = keyboardDelegate.getKeyRightOf(node.key);\n if (next !== node.key) {\n // We prevent the capturing event from reaching children of the cell, e.g. pickers.\n // We want arrow keys to navigate to the next cell instead. We need to re-dispatch \n // the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n break;\n }\n\n if (focusMode === 'cell' && direction === 'ltr') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? last(walker)\n : walker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n // Prevent this event from reaching cell children, e.g. menu buttons. We want arrow keys to navigate\n // to the cell above/below instead. We need to re-dispatch the event from a higher parent so it still\n // bubbles and gets handled by useSelectableCollection.\n if (!e.altKey && ref.current.contains(e.target as Element)) {\n e.stopPropagation();\n e.preventDefault();\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n }\n break;\n }\n };\n\n // Grid cells can have focusable elements inside them. In this case, focus should\n // be marshalled to that element rather than focusing the cell itself.\n let onFocus = (e) => {\n keyWhenFocused.current = node.key;\n if (e.target !== ref.current) {\n // useSelectableItem only handles setting the focused key when\n // the focused element is the gridcell itself. We also want to\n // set the focused key when a child element receives focus.\n // If focus is currently visible (e.g. the user is navigating with the keyboard),\n // then skip this. We want to restore focus to the previously focused row/cell\n // in that case since the table should act like a single tab stop.\n if (!isFocusVisible()) {\n state.selectionManager.setFocusedKey(node.key);\n }\n return;\n }\n\n // If the cell itself is focused, wait a frame so that focus finishes propagatating\n // up to the tree, and move focus to a focusable child if possible.\n requestAnimationFrame(() => {\n if (focusMode === 'child' && document.activeElement === ref.current) {\n focus();\n }\n });\n };\n\n let gridCellProps: DOMAttributes = mergeProps(itemProps, {\n role: 'gridcell',\n onKeyDownCapture,\n onFocus\n });\n\n if (isVirtualized) {\n gridCellProps['aria-colindex'] = (node.colIndex ?? node.index) + 1; // aria-colindex is 1-based\n }\n\n // When pressing with a pointer and cell selection is not enabled, usePress will be applied to the\n // row rather than the cell. However, when the row is draggable, usePress cannot preventDefault\n // on pointer down, so the browser will try to focus the cell which has a tabIndex applied.\n // To avoid this, remove the tabIndex from the cell briefly on pointer down.\n if (shouldSelectOnPressUp && gridCellProps.tabIndex != null && gridCellProps.onPointerDown == null) {\n gridCellProps.onPointerDown = (e) => {\n let el = e.currentTarget;\n let tabindex = el.getAttribute('tabindex');\n el.removeAttribute('tabindex');\n requestAnimationFrame(() => {\n el.setAttribute('tabindex', tabindex);\n });\n };\n }\n\n return {\n gridCellProps,\n isPressed\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n","import {AriaCheckboxProps} from '@react-types/checkbox';\nimport {GridCollection} from '@react-types/grid';\nimport {GridState} from '@react-stately/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key} from '@react-types/shared';\nimport {useId} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaGridSelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key\n}\n\nexport interface GridSelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a grid.\n * @param props - Props for the selection checkbox.\n * @param state - State of the grid, as returned by `useGridState`.\n */\nexport function useGridSelectionCheckbox<T, C extends GridCollection<T>>(props: AriaGridSelectionCheckboxProps, state: GridState<T, C>): GridSelectionCheckboxAria {\n let {key} = props;\n\n let manager = state.selectionManager;\n let checkboxId = useId();\n let isDisabled = !state.selectionManager.canSelectItem(key);\n let isSelected = state.selectionManager.isSelected(key);\n\n let onChange = () => manager.select(key);\n\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/grid');\n\n return {\n checkboxProps: {\n id: checkboxId,\n 'aria-label': stringFormatter.format('select'),\n isSelected,\n isDisabled,\n onChange\n }\n };\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|