@react-aria/table 3.13.6-nightly.4552 → 3.13.6-nightly.4558

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/TableKeyboardDelegate.main.js +132 -0
  2. package/dist/TableKeyboardDelegate.main.js.map +1 -0
  3. package/dist/TableKeyboardDelegate.mjs +127 -0
  4. package/dist/TableKeyboardDelegate.module.js +127 -0
  5. package/dist/TableKeyboardDelegate.module.js.map +1 -0
  6. package/dist/ar-AE.mjs +1 -1
  7. package/dist/bg-BG.mjs +1 -1
  8. package/dist/cs-CZ.mjs +1 -1
  9. package/dist/da-DK.mjs +1 -1
  10. package/dist/de-DE.mjs +1 -1
  11. package/dist/el-GR.mjs +1 -1
  12. package/dist/en-US.mjs +1 -1
  13. package/dist/es-ES.mjs +1 -1
  14. package/dist/et-EE.mjs +1 -1
  15. package/dist/fi-FI.mjs +1 -1
  16. package/dist/fr-FR.mjs +1 -1
  17. package/dist/he-IL.mjs +1 -1
  18. package/dist/hr-HR.mjs +1 -1
  19. package/dist/hu-HU.mjs +1 -1
  20. package/dist/import.mjs +8 -779
  21. package/dist/intlStrings.main.js +108 -0
  22. package/dist/intlStrings.main.js.map +1 -0
  23. package/dist/intlStrings.mjs +110 -0
  24. package/dist/intlStrings.module.js +110 -0
  25. package/dist/intlStrings.module.js.map +1 -0
  26. package/dist/it-IT.mjs +1 -1
  27. package/dist/ja-JP.mjs +1 -1
  28. package/dist/ko-KR.mjs +1 -1
  29. package/dist/lt-LT.mjs +1 -1
  30. package/dist/lv-LV.mjs +1 -1
  31. package/dist/main.js +15 -786
  32. package/dist/main.js.map +1 -1
  33. package/dist/module.js +8 -779
  34. package/dist/module.js.map +1 -1
  35. package/dist/nb-NO.mjs +1 -1
  36. package/dist/nl-NL.mjs +1 -1
  37. package/dist/pl-PL.mjs +1 -1
  38. package/dist/pt-BR.mjs +1 -1
  39. package/dist/pt-PT.mjs +1 -1
  40. package/dist/ro-RO.mjs +1 -1
  41. package/dist/ru-RU.mjs +1 -1
  42. package/dist/sk-SK.mjs +1 -1
  43. package/dist/sl-SI.mjs +1 -1
  44. package/dist/sr-SP.mjs +1 -1
  45. package/dist/sv-SE.mjs +1 -1
  46. package/dist/tr-TR.mjs +1 -1
  47. package/dist/uk-UA.mjs +1 -1
  48. package/dist/useTable.main.js +111 -0
  49. package/dist/useTable.main.js.map +1 -0
  50. package/dist/useTable.mjs +106 -0
  51. package/dist/useTable.module.js +106 -0
  52. package/dist/useTable.module.js.map +1 -0
  53. package/dist/useTableCell.main.js +36 -0
  54. package/dist/useTableCell.main.js.map +1 -0
  55. package/dist/useTableCell.mjs +31 -0
  56. package/dist/useTableCell.module.js +31 -0
  57. package/dist/useTableCell.module.js.map +1 -0
  58. package/dist/useTableColumnHeader.main.js +93 -0
  59. package/dist/useTableColumnHeader.main.js.map +1 -0
  60. package/dist/useTableColumnHeader.mjs +88 -0
  61. package/dist/useTableColumnHeader.module.js +88 -0
  62. package/dist/useTableColumnHeader.module.js.map +1 -0
  63. package/dist/useTableColumnResize.main.js +216 -0
  64. package/dist/useTableColumnResize.main.js.map +1 -0
  65. package/dist/useTableColumnResize.mjs +211 -0
  66. package/dist/useTableColumnResize.module.js +211 -0
  67. package/dist/useTableColumnResize.module.js.map +1 -0
  68. package/dist/useTableHeaderRow.main.js +32 -0
  69. package/dist/useTableHeaderRow.main.js.map +1 -0
  70. package/dist/useTableHeaderRow.mjs +27 -0
  71. package/dist/useTableHeaderRow.module.js +27 -0
  72. package/dist/useTableHeaderRow.module.js.map +1 -0
  73. package/dist/useTableRow.main.js +80 -0
  74. package/dist/useTableRow.main.js.map +1 -0
  75. package/dist/useTableRow.mjs +75 -0
  76. package/dist/useTableRow.module.js +75 -0
  77. package/dist/useTableRow.module.js.map +1 -0
  78. package/dist/useTableSelectionCheckbox.main.js +56 -0
  79. package/dist/useTableSelectionCheckbox.main.js.map +1 -0
  80. package/dist/useTableSelectionCheckbox.mjs +50 -0
  81. package/dist/useTableSelectionCheckbox.module.js +50 -0
  82. package/dist/useTableSelectionCheckbox.module.js.map +1 -0
  83. package/dist/utils.main.js +43 -0
  84. package/dist/utils.main.js.map +1 -0
  85. package/dist/utils.mjs +35 -0
  86. package/dist/utils.module.js +35 -0
  87. package/dist/utils.module.js.map +1 -0
  88. package/dist/zh-CN.mjs +1 -1
  89. package/dist/zh-TW.mjs +1 -1
  90. package/package.json +17 -17
@@ -0,0 +1,132 @@
1
+ var $heEpC$reactstatelycollections = require("@react-stately/collections");
2
+ var $heEpC$reactariagrid = require("@react-aria/grid");
3
+
4
+
5
+ function $parcel$export(e, n, v, s) {
6
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
+ }
8
+
9
+ $parcel$export(module.exports, "TableKeyboardDelegate", () => $a911ff492b884835$export$da43f8f5cb04028d);
10
+ /*
11
+ * Copyright 2022 Adobe. All rights reserved.
12
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License. You may obtain a copy
14
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software distributed under
17
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
+ * OF ANY KIND, either express or implied. See the License for the specific language
19
+ * governing permissions and limitations under the License.
20
+ */
21
+
22
+ class $a911ff492b884835$export$da43f8f5cb04028d extends (0, $heEpC$reactariagrid.GridKeyboardDelegate) {
23
+ isCell(node) {
24
+ return node.type === "cell" || node.type === "rowheader" || node.type === "column";
25
+ }
26
+ getKeyBelow(key) {
27
+ let startItem = this.collection.getItem(key);
28
+ if (!startItem) return;
29
+ // If focus was on a column, then focus the first child column if any,
30
+ // or find the corresponding cell in the first row.
31
+ if (startItem.type === "column") {
32
+ let child = (0, $heEpC$reactstatelycollections.getFirstItem)((0, $heEpC$reactstatelycollections.getChildNodes)(startItem, this.collection));
33
+ if (child) return child.key;
34
+ let firstKey = this.getFirstKey();
35
+ if (firstKey == null) return;
36
+ let firstItem = this.collection.getItem(firstKey);
37
+ return (0, $heEpC$reactstatelycollections.getNthItem)((0, $heEpC$reactstatelycollections.getChildNodes)(firstItem, this.collection), startItem.index).key;
38
+ }
39
+ return super.getKeyBelow(key);
40
+ }
41
+ getKeyAbove(key) {
42
+ let startItem = this.collection.getItem(key);
43
+ if (!startItem) return;
44
+ // If focus was on a column, focus the parent column if any
45
+ if (startItem.type === "column") {
46
+ let parent = this.collection.getItem(startItem.parentKey);
47
+ if (parent && parent.type === "column") return parent.key;
48
+ return;
49
+ }
50
+ // only return above row key if not header row
51
+ let superKey = super.getKeyAbove(key);
52
+ if (superKey != null && this.collection.getItem(superKey).type !== "headerrow") return superKey;
53
+ // If no item was found, and focus was on a cell, then focus the
54
+ // corresponding column header.
55
+ if (this.isCell(startItem)) return this.collection.columns[startItem.index].key;
56
+ // If focus was on a row, then focus the first column header.
57
+ return this.collection.columns[0].key;
58
+ }
59
+ findNextColumnKey(column) {
60
+ // Search following columns
61
+ let key = this.findNextKey(column.key, (item)=>item.type === "column");
62
+ if (key != null) return key;
63
+ // Wrap around to the first column
64
+ let row = this.collection.headerRows[column.level];
65
+ for (let item of (0, $heEpC$reactstatelycollections.getChildNodes)(row, this.collection)){
66
+ if (item.type === "column") return item.key;
67
+ }
68
+ }
69
+ findPreviousColumnKey(column) {
70
+ // Search previous columns
71
+ let key = this.findPreviousKey(column.key, (item)=>item.type === "column");
72
+ if (key != null) return key;
73
+ // Wrap around to the last column
74
+ let row = this.collection.headerRows[column.level];
75
+ let childNodes = [
76
+ ...(0, $heEpC$reactstatelycollections.getChildNodes)(row, this.collection)
77
+ ];
78
+ for(let i = childNodes.length - 1; i >= 0; i--){
79
+ let item = childNodes[i];
80
+ if (item.type === "column") return item.key;
81
+ }
82
+ }
83
+ getKeyRightOf(key) {
84
+ let item = this.collection.getItem(key);
85
+ if (!item) return;
86
+ // If focus was on a column, then focus the next column
87
+ if (item.type === "column") return this.direction === "rtl" ? this.findPreviousColumnKey(item) : this.findNextColumnKey(item);
88
+ return super.getKeyRightOf(key);
89
+ }
90
+ getKeyLeftOf(key) {
91
+ let item = this.collection.getItem(key);
92
+ if (!item) return;
93
+ // If focus was on a column, then focus the previous column
94
+ if (item.type === "column") return this.direction === "rtl" ? this.findNextColumnKey(item) : this.findPreviousColumnKey(item);
95
+ return super.getKeyLeftOf(key);
96
+ }
97
+ getKeyForSearch(search, fromKey) {
98
+ if (!this.collator) return null;
99
+ let collection = this.collection;
100
+ let key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
101
+ if (key == null) return null;
102
+ // If the starting key is a cell, search from its parent row.
103
+ let startItem = collection.getItem(key);
104
+ if (startItem.type === "cell") key = startItem.parentKey;
105
+ let hasWrapped = false;
106
+ while(key != null){
107
+ let item = collection.getItem(key);
108
+ // Check each of the row header cells in this row for a match
109
+ for (let cell of (0, $heEpC$reactstatelycollections.getChildNodes)(item, this.collection)){
110
+ let column = collection.columns[cell.index];
111
+ if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {
112
+ let substring = cell.textValue.slice(0, search.length);
113
+ if (this.collator.compare(substring, search) === 0) {
114
+ // If we started on a cell, end on the matching cell. Otherwise, end on the row.
115
+ let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;
116
+ return fromItem.type === "cell" ? cell.key : item.key;
117
+ }
118
+ }
119
+ }
120
+ key = this.getKeyBelow(key);
121
+ // Wrap around when reaching the end of the collection
122
+ if (key == null && !hasWrapped) {
123
+ key = this.getFirstKey();
124
+ hasWrapped = true;
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ }
130
+
131
+
132
+ //# sourceMappingURL=TableKeyboardDelegate.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,yCAAmB;IAErD,OAAO,IAAa,EAAE;QAC9B,OAAO,KAAK,IAAI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;YACF;YAEA,MAAM,IAAI,CAAC,WAAW,CAAC;YAEvB,sDAAsD;YACtD,IAAI,OAAO,QAAQ,CAAC,YAAY;gBAC9B,MAAM,IAAI,CAAC,WAAW;gBACtB,aAAa;YACf;QACF;QAEA,OAAO;IACT;AACF","sources":["packages/@react-aria/table/src/TableKeyboardDelegate.ts"],"sourcesContent":["/*\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 {getChildNodes, getFirstItem, getNthItem} from '@react-stately/collections';\nimport {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key, Node} from '@react-types/shared';\nimport {TableCollection} from '@react-types/table';\n\nexport class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {\n\n protected isCell(node: Node<T>) {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\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 column, then focus the first child column if any,\n // or find the corresponding cell in the first row.\n if (startItem.type === 'column') {\n let child = getFirstItem(getChildNodes(startItem, this.collection));\n if (child) {\n return child.key;\n }\n\n let firstKey = this.getFirstKey();\n if (firstKey == null) {\n return;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n return getNthItem(getChildNodes(firstItem, this.collection), startItem.index).key;\n }\n\n return super.getKeyBelow(key);\n }\n\n getKeyAbove(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = this.collection.getItem(startItem.parentKey);\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') {\n return superKey;\n }\n\n // If no item was found, and focus was on a cell, then focus the\n // corresponding column header.\n if (this.isCell(startItem)) {\n return this.collection.columns[startItem.index].key;\n }\n\n // If focus was on a row, then focus the first column header.\n return this.collection.columns[0].key;\n }\n\n private findNextColumnKey(column: Node<T>) {\n // Search following columns\n let key = this.findNextKey(column.key, item => item.type === 'column');\n if (key != null) {\n return key;\n }\n\n // Wrap around to the first column\n let row = this.collection.headerRows[column.level];\n for (let item of getChildNodes(row, this.collection)) {\n if (item.type === 'column') {\n return item.key;\n }\n }\n }\n\n private findPreviousColumnKey(column: Node<T>) {\n // Search previous columns\n let key = this.findPreviousKey(column.key, item => item.type === 'column');\n if (key != null) {\n return key;\n }\n\n // Wrap around to the last column\n let row = this.collection.headerRows[column.level];\n let childNodes = [...getChildNodes(row, this.collection)];\n for (let i = childNodes.length - 1; i >= 0; i--) {\n let item = childNodes[i];\n if (item.type === 'column') {\n return item.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 was on a column, then focus the next column\n if (item.type === 'column') {\n return this.direction === 'rtl'\n ? this.findPreviousColumnKey(item)\n : this.findNextColumnKey(item);\n }\n\n return super.getKeyRightOf(key);\n }\n\n getKeyLeftOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus was on a column, then focus the previous column\n if (item.type === 'column') {\n return this.direction === 'rtl'\n ? this.findNextColumnKey(item)\n : this.findPreviousColumnKey(item);\n }\n\n return super.getKeyLeftOf(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 if (key == null) {\n return null;\n }\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 each of the row header cells in this row for a match\n for (let cell of getChildNodes(item, this.collection)) {\n let column = collection.columns[cell.index];\n if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {\n let substring = cell.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n // If we started on a cell, end on the matching cell. Otherwise, end on the row.\n let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;\n return fromItem.type === 'cell'\n ? cell.key\n : item.key;\n }\n }\n }\n\n key = this.getKeyBelow(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"],"names":[],"version":3,"file":"TableKeyboardDelegate.main.js.map"}
@@ -0,0 +1,127 @@
1
+ import {getFirstItem as $eIXPM$getFirstItem, getChildNodes as $eIXPM$getChildNodes, getNthItem as $eIXPM$getNthItem} from "@react-stately/collections";
2
+ import {GridKeyboardDelegate as $eIXPM$GridKeyboardDelegate} from "@react-aria/grid";
3
+
4
+ /*
5
+ * Copyright 2022 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */
15
+
16
+ class $0ba3c81c7f1caedd$export$da43f8f5cb04028d extends (0, $eIXPM$GridKeyboardDelegate) {
17
+ isCell(node) {
18
+ return node.type === "cell" || node.type === "rowheader" || node.type === "column";
19
+ }
20
+ getKeyBelow(key) {
21
+ let startItem = this.collection.getItem(key);
22
+ if (!startItem) return;
23
+ // If focus was on a column, then focus the first child column if any,
24
+ // or find the corresponding cell in the first row.
25
+ if (startItem.type === "column") {
26
+ let child = (0, $eIXPM$getFirstItem)((0, $eIXPM$getChildNodes)(startItem, this.collection));
27
+ if (child) return child.key;
28
+ let firstKey = this.getFirstKey();
29
+ if (firstKey == null) return;
30
+ let firstItem = this.collection.getItem(firstKey);
31
+ return (0, $eIXPM$getNthItem)((0, $eIXPM$getChildNodes)(firstItem, this.collection), startItem.index).key;
32
+ }
33
+ return super.getKeyBelow(key);
34
+ }
35
+ getKeyAbove(key) {
36
+ let startItem = this.collection.getItem(key);
37
+ if (!startItem) return;
38
+ // If focus was on a column, focus the parent column if any
39
+ if (startItem.type === "column") {
40
+ let parent = this.collection.getItem(startItem.parentKey);
41
+ if (parent && parent.type === "column") return parent.key;
42
+ return;
43
+ }
44
+ // only return above row key if not header row
45
+ let superKey = super.getKeyAbove(key);
46
+ if (superKey != null && this.collection.getItem(superKey).type !== "headerrow") return superKey;
47
+ // If no item was found, and focus was on a cell, then focus the
48
+ // corresponding column header.
49
+ if (this.isCell(startItem)) return this.collection.columns[startItem.index].key;
50
+ // If focus was on a row, then focus the first column header.
51
+ return this.collection.columns[0].key;
52
+ }
53
+ findNextColumnKey(column) {
54
+ // Search following columns
55
+ let key = this.findNextKey(column.key, (item)=>item.type === "column");
56
+ if (key != null) return key;
57
+ // Wrap around to the first column
58
+ let row = this.collection.headerRows[column.level];
59
+ for (let item of (0, $eIXPM$getChildNodes)(row, this.collection)){
60
+ if (item.type === "column") return item.key;
61
+ }
62
+ }
63
+ findPreviousColumnKey(column) {
64
+ // Search previous columns
65
+ let key = this.findPreviousKey(column.key, (item)=>item.type === "column");
66
+ if (key != null) return key;
67
+ // Wrap around to the last column
68
+ let row = this.collection.headerRows[column.level];
69
+ let childNodes = [
70
+ ...(0, $eIXPM$getChildNodes)(row, this.collection)
71
+ ];
72
+ for(let i = childNodes.length - 1; i >= 0; i--){
73
+ let item = childNodes[i];
74
+ if (item.type === "column") return item.key;
75
+ }
76
+ }
77
+ getKeyRightOf(key) {
78
+ let item = this.collection.getItem(key);
79
+ if (!item) return;
80
+ // If focus was on a column, then focus the next column
81
+ if (item.type === "column") return this.direction === "rtl" ? this.findPreviousColumnKey(item) : this.findNextColumnKey(item);
82
+ return super.getKeyRightOf(key);
83
+ }
84
+ getKeyLeftOf(key) {
85
+ let item = this.collection.getItem(key);
86
+ if (!item) return;
87
+ // If focus was on a column, then focus the previous column
88
+ if (item.type === "column") return this.direction === "rtl" ? this.findNextColumnKey(item) : this.findPreviousColumnKey(item);
89
+ return super.getKeyLeftOf(key);
90
+ }
91
+ getKeyForSearch(search, fromKey) {
92
+ if (!this.collator) return null;
93
+ let collection = this.collection;
94
+ let key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
95
+ if (key == null) return null;
96
+ // If the starting key is a cell, search from its parent row.
97
+ let startItem = collection.getItem(key);
98
+ if (startItem.type === "cell") key = startItem.parentKey;
99
+ let hasWrapped = false;
100
+ while(key != null){
101
+ let item = collection.getItem(key);
102
+ // Check each of the row header cells in this row for a match
103
+ for (let cell of (0, $eIXPM$getChildNodes)(item, this.collection)){
104
+ let column = collection.columns[cell.index];
105
+ if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {
106
+ let substring = cell.textValue.slice(0, search.length);
107
+ if (this.collator.compare(substring, search) === 0) {
108
+ // If we started on a cell, end on the matching cell. Otherwise, end on the row.
109
+ let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;
110
+ return fromItem.type === "cell" ? cell.key : item.key;
111
+ }
112
+ }
113
+ }
114
+ key = this.getKeyBelow(key);
115
+ // Wrap around when reaching the end of the collection
116
+ if (key == null && !hasWrapped) {
117
+ key = this.getFirstKey();
118
+ hasWrapped = true;
119
+ }
120
+ }
121
+ return null;
122
+ }
123
+ }
124
+
125
+
126
+ export {$0ba3c81c7f1caedd$export$da43f8f5cb04028d as TableKeyboardDelegate};
127
+ //# sourceMappingURL=TableKeyboardDelegate.mjs.map
@@ -0,0 +1,127 @@
1
+ import {getFirstItem as $eIXPM$getFirstItem, getChildNodes as $eIXPM$getChildNodes, getNthItem as $eIXPM$getNthItem} from "@react-stately/collections";
2
+ import {GridKeyboardDelegate as $eIXPM$GridKeyboardDelegate} from "@react-aria/grid";
3
+
4
+ /*
5
+ * Copyright 2022 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */
15
+
16
+ class $0ba3c81c7f1caedd$export$da43f8f5cb04028d extends (0, $eIXPM$GridKeyboardDelegate) {
17
+ isCell(node) {
18
+ return node.type === "cell" || node.type === "rowheader" || node.type === "column";
19
+ }
20
+ getKeyBelow(key) {
21
+ let startItem = this.collection.getItem(key);
22
+ if (!startItem) return;
23
+ // If focus was on a column, then focus the first child column if any,
24
+ // or find the corresponding cell in the first row.
25
+ if (startItem.type === "column") {
26
+ let child = (0, $eIXPM$getFirstItem)((0, $eIXPM$getChildNodes)(startItem, this.collection));
27
+ if (child) return child.key;
28
+ let firstKey = this.getFirstKey();
29
+ if (firstKey == null) return;
30
+ let firstItem = this.collection.getItem(firstKey);
31
+ return (0, $eIXPM$getNthItem)((0, $eIXPM$getChildNodes)(firstItem, this.collection), startItem.index).key;
32
+ }
33
+ return super.getKeyBelow(key);
34
+ }
35
+ getKeyAbove(key) {
36
+ let startItem = this.collection.getItem(key);
37
+ if (!startItem) return;
38
+ // If focus was on a column, focus the parent column if any
39
+ if (startItem.type === "column") {
40
+ let parent = this.collection.getItem(startItem.parentKey);
41
+ if (parent && parent.type === "column") return parent.key;
42
+ return;
43
+ }
44
+ // only return above row key if not header row
45
+ let superKey = super.getKeyAbove(key);
46
+ if (superKey != null && this.collection.getItem(superKey).type !== "headerrow") return superKey;
47
+ // If no item was found, and focus was on a cell, then focus the
48
+ // corresponding column header.
49
+ if (this.isCell(startItem)) return this.collection.columns[startItem.index].key;
50
+ // If focus was on a row, then focus the first column header.
51
+ return this.collection.columns[0].key;
52
+ }
53
+ findNextColumnKey(column) {
54
+ // Search following columns
55
+ let key = this.findNextKey(column.key, (item)=>item.type === "column");
56
+ if (key != null) return key;
57
+ // Wrap around to the first column
58
+ let row = this.collection.headerRows[column.level];
59
+ for (let item of (0, $eIXPM$getChildNodes)(row, this.collection)){
60
+ if (item.type === "column") return item.key;
61
+ }
62
+ }
63
+ findPreviousColumnKey(column) {
64
+ // Search previous columns
65
+ let key = this.findPreviousKey(column.key, (item)=>item.type === "column");
66
+ if (key != null) return key;
67
+ // Wrap around to the last column
68
+ let row = this.collection.headerRows[column.level];
69
+ let childNodes = [
70
+ ...(0, $eIXPM$getChildNodes)(row, this.collection)
71
+ ];
72
+ for(let i = childNodes.length - 1; i >= 0; i--){
73
+ let item = childNodes[i];
74
+ if (item.type === "column") return item.key;
75
+ }
76
+ }
77
+ getKeyRightOf(key) {
78
+ let item = this.collection.getItem(key);
79
+ if (!item) return;
80
+ // If focus was on a column, then focus the next column
81
+ if (item.type === "column") return this.direction === "rtl" ? this.findPreviousColumnKey(item) : this.findNextColumnKey(item);
82
+ return super.getKeyRightOf(key);
83
+ }
84
+ getKeyLeftOf(key) {
85
+ let item = this.collection.getItem(key);
86
+ if (!item) return;
87
+ // If focus was on a column, then focus the previous column
88
+ if (item.type === "column") return this.direction === "rtl" ? this.findNextColumnKey(item) : this.findPreviousColumnKey(item);
89
+ return super.getKeyLeftOf(key);
90
+ }
91
+ getKeyForSearch(search, fromKey) {
92
+ if (!this.collator) return null;
93
+ let collection = this.collection;
94
+ let key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
95
+ if (key == null) return null;
96
+ // If the starting key is a cell, search from its parent row.
97
+ let startItem = collection.getItem(key);
98
+ if (startItem.type === "cell") key = startItem.parentKey;
99
+ let hasWrapped = false;
100
+ while(key != null){
101
+ let item = collection.getItem(key);
102
+ // Check each of the row header cells in this row for a match
103
+ for (let cell of (0, $eIXPM$getChildNodes)(item, this.collection)){
104
+ let column = collection.columns[cell.index];
105
+ if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {
106
+ let substring = cell.textValue.slice(0, search.length);
107
+ if (this.collator.compare(substring, search) === 0) {
108
+ // If we started on a cell, end on the matching cell. Otherwise, end on the row.
109
+ let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;
110
+ return fromItem.type === "cell" ? cell.key : item.key;
111
+ }
112
+ }
113
+ }
114
+ key = this.getKeyBelow(key);
115
+ // Wrap around when reaching the end of the collection
116
+ if (key == null && !hasWrapped) {
117
+ key = this.getFirstKey();
118
+ hasWrapped = true;
119
+ }
120
+ }
121
+ return null;
122
+ }
123
+ }
124
+
125
+
126
+ export {$0ba3c81c7f1caedd$export$da43f8f5cb04028d as TableKeyboardDelegate};
127
+ //# sourceMappingURL=TableKeyboardDelegate.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,2BAAmB;IAErD,OAAO,IAAa,EAAE;QAC9B,OAAO,KAAK,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK;IAC5E;IAEA,YAAY,GAAQ,EAAE;QACpB,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH;QAGF,sEAAsE;QACtE,mDAAmD;QACnD,IAAI,UAAU,IAAI,KAAK,UAAU;YAC/B,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE,CAAA,GAAA,oBAAY,EAAE,WAAW,IAAI,CAAC,UAAU;YACjE,IAAI,OACF,OAAO,MAAM,GA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C7C,IAAI,CAAC,IAAI,CAAC,QAAQ,EAChB,OAAO;QAGT,IAAI,aAAa,IAAI,CAAC,UAAU;QAChC,IAAI,MAAM,oBAAA,qBAAA,UAAW,IAAI,CAAC,WAAW;QACrC,IAAI,OAAO,MACT,OAAO;QAGT,6DAA6D;QAC7D,IAAI,YAAY,WAAW,OAAO,CAAC;QACnC,IAAI,UAAU,IAAI,KAAK,QACrB,MAAM,UAAU,SAAS;QAG3B,IAAI,aAAa;QACjB,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,WAAW,OAAO,CAAC;YAE9B,6DAA6D;YAC7D,KAAK,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE,MAAM,IAAI,CAAC,UAAU,EAAG;gBACrD,IAAI,SAAS,WAAW,OAAO,CAAC,KAAK,KAAK,CAAC;gBAC3C,IAAI,WAAW,mBAAmB,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,KAAK,SAAS,EAAE;oBACpE,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;oBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAAG;wBAClD,gFAAgF;wBAChF,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;wBAC/D,OAAO,SAAS,IAAI,KAAK,SACrB,KAAK,GAAG,GACR,KAAK,GAAG;oBACd;gBACF;YACF;YAEA,MAAM,IAAI,CAAC,WAAW,CAAC;YAEvB,sDAAsD;YACtD,IAAI,OAAO,QAAQ,CAAC,YAAY;gBAC9B,MAAM,IAAI,CAAC,WAAW;gBACtB,aAAa;YACf;QACF;QAEA,OAAO;IACT;AACF","sources":["packages/@react-aria/table/src/TableKeyboardDelegate.ts"],"sourcesContent":["/*\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 {getChildNodes, getFirstItem, getNthItem} from '@react-stately/collections';\nimport {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key, Node} from '@react-types/shared';\nimport {TableCollection} from '@react-types/table';\n\nexport class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {\n\n protected isCell(node: Node<T>) {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\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 column, then focus the first child column if any,\n // or find the corresponding cell in the first row.\n if (startItem.type === 'column') {\n let child = getFirstItem(getChildNodes(startItem, this.collection));\n if (child) {\n return child.key;\n }\n\n let firstKey = this.getFirstKey();\n if (firstKey == null) {\n return;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n return getNthItem(getChildNodes(firstItem, this.collection), startItem.index).key;\n }\n\n return super.getKeyBelow(key);\n }\n\n getKeyAbove(key: Key) {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = this.collection.getItem(startItem.parentKey);\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n if (superKey != null && this.collection.getItem(superKey).type !== 'headerrow') {\n return superKey;\n }\n\n // If no item was found, and focus was on a cell, then focus the\n // corresponding column header.\n if (this.isCell(startItem)) {\n return this.collection.columns[startItem.index].key;\n }\n\n // If focus was on a row, then focus the first column header.\n return this.collection.columns[0].key;\n }\n\n private findNextColumnKey(column: Node<T>) {\n // Search following columns\n let key = this.findNextKey(column.key, item => item.type === 'column');\n if (key != null) {\n return key;\n }\n\n // Wrap around to the first column\n let row = this.collection.headerRows[column.level];\n for (let item of getChildNodes(row, this.collection)) {\n if (item.type === 'column') {\n return item.key;\n }\n }\n }\n\n private findPreviousColumnKey(column: Node<T>) {\n // Search previous columns\n let key = this.findPreviousKey(column.key, item => item.type === 'column');\n if (key != null) {\n return key;\n }\n\n // Wrap around to the last column\n let row = this.collection.headerRows[column.level];\n let childNodes = [...getChildNodes(row, this.collection)];\n for (let i = childNodes.length - 1; i >= 0; i--) {\n let item = childNodes[i];\n if (item.type === 'column') {\n return item.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 was on a column, then focus the next column\n if (item.type === 'column') {\n return this.direction === 'rtl'\n ? this.findPreviousColumnKey(item)\n : this.findNextColumnKey(item);\n }\n\n return super.getKeyRightOf(key);\n }\n\n getKeyLeftOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return;\n }\n\n // If focus was on a column, then focus the previous column\n if (item.type === 'column') {\n return this.direction === 'rtl'\n ? this.findNextColumnKey(item)\n : this.findPreviousColumnKey(item);\n }\n\n return super.getKeyLeftOf(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 if (key == null) {\n return null;\n }\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 each of the row header cells in this row for a match\n for (let cell of getChildNodes(item, this.collection)) {\n let column = collection.columns[cell.index];\n if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {\n let substring = cell.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n // If we started on a cell, end on the matching cell. Otherwise, end on the row.\n let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;\n return fromItem.type === 'cell'\n ? cell.key\n : item.key;\n }\n }\n }\n\n key = this.getKeyBelow(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"],"names":[],"version":3,"file":"TableKeyboardDelegate.module.js.map"}
package/dist/ar-AE.mjs CHANGED
@@ -13,4 +13,4 @@ $ce3de3ff2fd66848$exports = {
13
13
 
14
14
 
15
15
  export {$ce3de3ff2fd66848$exports as default};
16
- //# sourceMappingURL=ar-AE.module.js.map
16
+ //# sourceMappingURL=ar-AE.mjs.map
package/dist/bg-BG.mjs CHANGED
@@ -13,4 +13,4 @@ $cb80dcce530985b9$exports = {
13
13
 
14
14
 
15
15
  export {$cb80dcce530985b9$exports as default};
16
- //# sourceMappingURL=bg-BG.module.js.map
16
+ //# sourceMappingURL=bg-BG.mjs.map
package/dist/cs-CZ.mjs CHANGED
@@ -13,4 +13,4 @@ $68ac86749db4c0fb$exports = {
13
13
 
14
14
 
15
15
  export {$68ac86749db4c0fb$exports as default};
16
- //# sourceMappingURL=cs-CZ.module.js.map
16
+ //# sourceMappingURL=cs-CZ.mjs.map
package/dist/da-DK.mjs CHANGED
@@ -13,4 +13,4 @@ $9a6cbac08487e661$exports = {
13
13
 
14
14
 
15
15
  export {$9a6cbac08487e661$exports as default};
16
- //# sourceMappingURL=da-DK.module.js.map
16
+ //# sourceMappingURL=da-DK.mjs.map
package/dist/de-DE.mjs CHANGED
@@ -13,4 +13,4 @@ $c963661d89486e72$exports = {
13
13
 
14
14
 
15
15
  export {$c963661d89486e72$exports as default};
16
- //# sourceMappingURL=de-DE.module.js.map
16
+ //# sourceMappingURL=de-DE.mjs.map
package/dist/el-GR.mjs CHANGED
@@ -13,4 +13,4 @@ $ac03861c6e8605f4$exports = {
13
13
 
14
14
 
15
15
  export {$ac03861c6e8605f4$exports as default};
16
- //# sourceMappingURL=el-GR.module.js.map
16
+ //# sourceMappingURL=el-GR.mjs.map
package/dist/en-US.mjs CHANGED
@@ -13,4 +13,4 @@ $09e6b82e0d6e466a$exports = {
13
13
 
14
14
 
15
15
  export {$09e6b82e0d6e466a$exports as default};
16
- //# sourceMappingURL=en-US.module.js.map
16
+ //# sourceMappingURL=en-US.mjs.map
package/dist/es-ES.mjs CHANGED
@@ -13,4 +13,4 @@ $8cc39eb66c2bf220$exports = {
13
13
 
14
14
 
15
15
  export {$8cc39eb66c2bf220$exports as default};
16
- //# sourceMappingURL=es-ES.module.js.map
16
+ //# sourceMappingURL=es-ES.mjs.map
package/dist/et-EE.mjs CHANGED
@@ -13,4 +13,4 @@ $4e11db3c25a38112$exports = {
13
13
 
14
14
 
15
15
  export {$4e11db3c25a38112$exports as default};
16
- //# sourceMappingURL=et-EE.module.js.map
16
+ //# sourceMappingURL=et-EE.mjs.map
package/dist/fi-FI.mjs CHANGED
@@ -13,4 +13,4 @@ $da1e751a92575e02$exports = {
13
13
 
14
14
 
15
15
  export {$da1e751a92575e02$exports as default};
16
- //# sourceMappingURL=fi-FI.module.js.map
16
+ //# sourceMappingURL=fi-FI.mjs.map
package/dist/fr-FR.mjs CHANGED
@@ -13,4 +13,4 @@ $1b5d6c6c47d55106$exports = {
13
13
 
14
14
 
15
15
  export {$1b5d6c6c47d55106$exports as default};
16
- //# sourceMappingURL=fr-FR.module.js.map
16
+ //# sourceMappingURL=fr-FR.mjs.map
package/dist/he-IL.mjs CHANGED
@@ -13,4 +13,4 @@ $7c18ba27b86d3308$exports = {
13
13
 
14
14
 
15
15
  export {$7c18ba27b86d3308$exports as default};
16
- //# sourceMappingURL=he-IL.module.js.map
16
+ //# sourceMappingURL=he-IL.mjs.map
package/dist/hr-HR.mjs CHANGED
@@ -13,4 +13,4 @@ $2cb40998e20e8a46$exports = {
13
13
 
14
14
 
15
15
  export {$2cb40998e20e8a46$exports as default};
16
- //# sourceMappingURL=hr-HR.module.js.map
16
+ //# sourceMappingURL=hr-HR.mjs.map
package/dist/hu-HU.mjs CHANGED
@@ -13,4 +13,4 @@ $189e23eec1d6aa3a$exports = {
13
13
 
14
14
 
15
15
  export {$189e23eec1d6aa3a$exports as default};
16
- //# sourceMappingURL=hu-HU.module.js.map
16
+ //# sourceMappingURL=hu-HU.mjs.map