@react-aria/table 3.17.1 → 3.17.3
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/TableKeyboardDelegate.main.js +4 -0
- package/dist/TableKeyboardDelegate.main.js.map +1 -1
- package/dist/TableKeyboardDelegate.mjs +4 -0
- package/dist/TableKeyboardDelegate.module.js +4 -0
- package/dist/TableKeyboardDelegate.module.js.map +1 -1
- package/dist/es-ES.main.js +4 -4
- package/dist/es-ES.main.js.map +1 -1
- package/dist/es-ES.mjs +4 -4
- package/dist/es-ES.module.js +4 -4
- package/dist/es-ES.module.js.map +1 -1
- package/dist/useTableSelectionCheckbox.main.js +1 -1
- package/dist/useTableSelectionCheckbox.main.js.map +1 -1
- package/dist/useTableSelectionCheckbox.mjs +1 -1
- package/dist/useTableSelectionCheckbox.module.js +1 -1
- package/dist/useTableSelectionCheckbox.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/package.json +16 -16
- package/src/TableKeyboardDelegate.ts +15 -8
- package/src/useTableSelectionCheckbox.ts +1 -1
- package/src/utils.ts +1 -1
|
@@ -111,6 +111,10 @@ class $a911ff492b884835$export$da43f8f5cb04028d extends (0, $heEpC$reactariagrid
|
|
|
111
111
|
while(key != null){
|
|
112
112
|
let item = collection.getItem(key);
|
|
113
113
|
if (!item) return null;
|
|
114
|
+
if (item.textValue) {
|
|
115
|
+
let substring = item.textValue.slice(0, search.length);
|
|
116
|
+
if (this.collator.compare(substring, search) === 0) return item.key;
|
|
117
|
+
}
|
|
114
118
|
// Check each of the row header cells in this row for a match
|
|
115
119
|
for (let cell of (0, $heEpC$reactstatelycollections.getChildNodes)(item, this.collection)){
|
|
116
120
|
let column = collection.columns[cell.index];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,yCAAmB;IAErD,OAAO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,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAAG;wBAClD,gFAAgF;wBAChF,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;wBAC/D,OAAO,CAAA,qBAAA,+BAAA,SAAU,IAAI,MAAK,SACtB,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} 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 null;\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 null;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n if (!firstItem) {\n return null;\n }\n\n return super.getKeyForItemInRowByIndex(firstKey, startItem.index);\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 null;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null;\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return null;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n let superItem = superKey != null ? this.collection.getItem(superKey) : null;\n if (superItem && superItem.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 return null;\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 return null;\n }\n\n getKeyRightOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return null;\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 null;\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 ?? null;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n if (!item) {\n return null;\n }\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"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,yCAAmB;IAErD,OAAO,IAAa,EAAW;QACvC,OAAO,KAAK,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK;IAC5E;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,sEAAsE;QACtE,mDAAmD;QACnD,IAA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GAAG;wBAClD,gFAAgF;wBAChF,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;wBAC/D,OAAO,CAAA,qBAAA,+BAAA,SAAU,IAAI,MAAK,SACtB,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} 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>): boolean {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\n }\n\n getKeyBelow(key: Key): Key | null {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return null;\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 null;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n if (!firstItem) {\n return null;\n }\n\n return super.getKeyForItemInRowByIndex(firstKey, startItem.index);\n }\n\n return super.getKeyBelow(key);\n }\n\n getKeyAbove(key: Key): Key | null {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return null;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null;\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return null;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n let superItem = superKey != null ? this.collection.getItem(superKey) : null;\n if (superItem && superItem.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>): Key | null {\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 return null;\n }\n\n private findPreviousColumnKey(column: Node<T>): Key | null {\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 return null;\n }\n\n getKeyRightOf(key: Key): Key | null {\n let item = this.collection.getItem(key);\n if (!item) {\n return null;\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): Key | null {\n let item = this.collection.getItem(key);\n if (!item) {\n return null;\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): Key | null {\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 ?? null;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n if (!item) {\n return null;\n }\n\n if (item.textValue) {\n let substring = item.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n return item.key;\n }\n }\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"}
|
|
@@ -105,6 +105,10 @@ class $0ba3c81c7f1caedd$export$da43f8f5cb04028d extends (0, $eIXPM$GridKeyboardD
|
|
|
105
105
|
while(key != null){
|
|
106
106
|
let item = collection.getItem(key);
|
|
107
107
|
if (!item) return null;
|
|
108
|
+
if (item.textValue) {
|
|
109
|
+
let substring = item.textValue.slice(0, search.length);
|
|
110
|
+
if (this.collator.compare(substring, search) === 0) return item.key;
|
|
111
|
+
}
|
|
108
112
|
// Check each of the row header cells in this row for a match
|
|
109
113
|
for (let cell of (0, $eIXPM$getChildNodes)(item, this.collection)){
|
|
110
114
|
let column = collection.columns[cell.index];
|
|
@@ -105,6 +105,10 @@ class $0ba3c81c7f1caedd$export$da43f8f5cb04028d extends (0, $eIXPM$GridKeyboardD
|
|
|
105
105
|
while(key != null){
|
|
106
106
|
let item = collection.getItem(key);
|
|
107
107
|
if (!item) return null;
|
|
108
|
+
if (item.textValue) {
|
|
109
|
+
let substring = item.textValue.slice(0, search.length);
|
|
110
|
+
if (this.collator.compare(substring, search) === 0) return item.key;
|
|
111
|
+
}
|
|
108
112
|
// Check each of the row header cells in this row for a match
|
|
109
113
|
for (let cell of (0, $eIXPM$getChildNodes)(item, this.collection)){
|
|
110
114
|
let column = collection.columns[cell.index];
|
|
@@ -1 +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,OAAO;QAGT,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,GAAG;YAGlB,IAAI,WAAW,IAAI,CAAC,WAAW;YAC/B,IAAI,YAAY,MACd,OAAO;YAGT,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACxC,IAAI,CAAC,WACH,OAAO;YAGT,OAAO,KAAK,CAAC,0BAA0B,UAAU,UAAU,KAAK;QAClE;QAEA,OAAO,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,IAAI,OAAO,MACT,OAAO;QAGT,6DAA6D;QAC7D,IAAI,YAAY,WAAW,OAAO,CAAC;YAE3B;QADR,IAAI,CAAA,sBAAA,gCAAA,UAAW,IAAI,MAAK,QACtB,MAAM,CAAA,uBAAA,UAAU,SAAS,cAAnB,kCAAA,uBAAuB;QAG/B,IAAI,aAAa;QACjB,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,WAAW,OAAO,CAAC;YAC9B,IAAI,CAAC,MACH,OAAO;YAGT,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,CAAA,qBAAA,+BAAA,SAAU,IAAI,MAAK,SACtB,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} 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 null;\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 null;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n if (!firstItem) {\n return null;\n }\n\n return super.getKeyForItemInRowByIndex(firstKey, startItem.index);\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 null;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null;\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return null;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n let superItem = superKey != null ? this.collection.getItem(superKey) : null;\n if (superItem && superItem.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 return null;\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 return null;\n }\n\n getKeyRightOf(key: Key) {\n let item = this.collection.getItem(key);\n if (!item) {\n return null;\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 null;\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 ?? null;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n if (!item) {\n return null;\n }\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"}
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAOM,MAAM,kDAAiC,CAAA,GAAA,2BAAmB;IAErD,OAAO,IAAa,EAAW;QACvC,OAAO,KAAK,IAAI,KAAK,UAAU,KAAK,IAAI,KAAK,eAAe,KAAK,IAAI,KAAK;IAC5E;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,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,GAAG;YAGlB,IAAI,WAAW,IAAI,CAAC,WAAW;YAC/B,IAAI,YAAY,MACd,OAAO;YAGT,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACxC,IAAI,CAAC,WACH,OAAO;YAGT,OAAO,KAAK,CAAC,0BAA0B,UAAU,UAAU,KAAK;QAClE;QAEA,OAAO,KAAK,CAAC,YAAY;IAC3B;IAEA,YAAY,GAAQ,EAAc;QAChC,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,WACH,OAAO;QAGT,2DAA2D;QAC3D,IAAI,UAAU,IAAI,KAAK,UAAU;YAC/B,IAAI,SAAS,UAAU,SAAS,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,O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AW,OAAO,CAAC;YAC9B,IAAI,CAAC,MACH,OAAO;YAGT,IAAI,KAAK,SAAS,EAAE;gBAClB,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;gBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAC/C,OAAO,KAAK,GAAG;YAEnB;YAEA,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,CAAA,qBAAA,+BAAA,SAAU,IAAI,MAAK,SACtB,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} 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>): boolean {\n return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';\n }\n\n getKeyBelow(key: Key): Key | null {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return null;\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 null;\n }\n\n let firstItem = this.collection.getItem(firstKey);\n if (!firstItem) {\n return null;\n }\n\n return super.getKeyForItemInRowByIndex(firstKey, startItem.index);\n }\n\n return super.getKeyBelow(key);\n }\n\n getKeyAbove(key: Key): Key | null {\n let startItem = this.collection.getItem(key);\n if (!startItem) {\n return null;\n }\n\n // If focus was on a column, focus the parent column if any\n if (startItem.type === 'column') {\n let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null;\n if (parent && parent.type === 'column') {\n return parent.key;\n }\n\n return null;\n }\n\n // only return above row key if not header row\n let superKey = super.getKeyAbove(key);\n let superItem = superKey != null ? this.collection.getItem(superKey) : null;\n if (superItem && superItem.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>): Key | null {\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 return null;\n }\n\n private findPreviousColumnKey(column: Node<T>): Key | null {\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 return null;\n }\n\n getKeyRightOf(key: Key): Key | null {\n let item = this.collection.getItem(key);\n if (!item) {\n return null;\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): Key | null {\n let item = this.collection.getItem(key);\n if (!item) {\n return null;\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): Key | null {\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 ?? null;\n }\n\n let hasWrapped = false;\n while (key != null) {\n let item = collection.getItem(key);\n if (!item) {\n return null;\n }\n\n if (item.textValue) {\n let substring = item.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n return item.key;\n }\n }\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/es-ES.main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"ascending": `
|
|
3
|
-
"ascendingSort": (args)=>`ordenado por columna ${args.columnName} en
|
|
2
|
+
"ascending": `ascendente`,
|
|
3
|
+
"ascendingSort": (args)=>`ordenado por columna ${args.columnName} en sentido ascendente`,
|
|
4
4
|
"columnSize": (args)=>`${args.value} p\xedxeles`,
|
|
5
|
-
"descending": `
|
|
6
|
-
"descendingSort": (args)=>`ordenado por columna ${args.columnName} en orden
|
|
5
|
+
"descending": `descendente`,
|
|
6
|
+
"descendingSort": (args)=>`ordenado por columna ${args.columnName} en orden descendente`,
|
|
7
7
|
"resizerDescription": `Pulse Intro para empezar a redimensionar`,
|
|
8
8
|
"select": `Seleccionar`,
|
|
9
9
|
"selectAll": `Seleccionar todos`,
|
package/dist/es-ES.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,UAAU,CAAC;IAC3C,iBAAiB,CAAC,OAAS,CAAC,qBAAqB,EAAE,KAAK,UAAU,CAAC,sBAAsB,CAAC;IAC1F,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,WAAQ,CAAC;IAC/C,cAAc,CAAC,WAAW,CAAC;IAC3B,kBAAkB,CAAC,OAAS,CAAC,qBAAqB,EAAE,KAAK,UAAU,CAAC,qBAAqB,CAAC;IAC1F,sBAAsB,CAAC,wCAAwC,CAAC;IAChE,UAAU,CAAC,WAAW,CAAC;IACvB,aAAa,CAAC,iBAAiB,CAAC;IAChC,YAAY,CAAC,iBAAiB,CAAC;AACjC","sources":["packages/@react-aria/table/intl/es-ES.json"],"sourcesContent":["{\n \"ascending\": \"ascendente\",\n \"ascendingSort\": \"ordenado por columna {columnName} en sentido ascendente\",\n \"columnSize\": \"{value} píxeles\",\n \"descending\": \"descendente\",\n \"descendingSort\": \"ordenado por columna {columnName} en orden descendente\",\n \"resizerDescription\": \"Pulse Intro para empezar a redimensionar\",\n \"select\": \"Seleccionar\",\n \"selectAll\": \"Seleccionar todos\",\n \"sortable\": \"columna ordenable\"\n}\n"],"names":[],"version":3,"file":"es-ES.main.js.map"}
|
package/dist/es-ES.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var $8cc39eb66c2bf220$exports = {};
|
|
2
2
|
$8cc39eb66c2bf220$exports = {
|
|
3
|
-
"ascending": `
|
|
4
|
-
"ascendingSort": (args)=>`ordenado por columna ${args.columnName} en
|
|
3
|
+
"ascending": `ascendente`,
|
|
4
|
+
"ascendingSort": (args)=>`ordenado por columna ${args.columnName} en sentido ascendente`,
|
|
5
5
|
"columnSize": (args)=>`${args.value} p\xedxeles`,
|
|
6
|
-
"descending": `
|
|
7
|
-
"descendingSort": (args)=>`ordenado por columna ${args.columnName} en orden
|
|
6
|
+
"descending": `descendente`,
|
|
7
|
+
"descendingSort": (args)=>`ordenado por columna ${args.columnName} en orden descendente`,
|
|
8
8
|
"resizerDescription": `Pulse Intro para empezar a redimensionar`,
|
|
9
9
|
"select": `Seleccionar`,
|
|
10
10
|
"selectAll": `Seleccionar todos`,
|
package/dist/es-ES.module.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var $8cc39eb66c2bf220$exports = {};
|
|
2
2
|
$8cc39eb66c2bf220$exports = {
|
|
3
|
-
"ascending": `
|
|
4
|
-
"ascendingSort": (args)=>`ordenado por columna ${args.columnName} en
|
|
3
|
+
"ascending": `ascendente`,
|
|
4
|
+
"ascendingSort": (args)=>`ordenado por columna ${args.columnName} en sentido ascendente`,
|
|
5
5
|
"columnSize": (args)=>`${args.value} p\xedxeles`,
|
|
6
|
-
"descending": `
|
|
7
|
-
"descendingSort": (args)=>`ordenado por columna ${args.columnName} en orden
|
|
6
|
+
"descending": `descendente`,
|
|
7
|
+
"descendingSort": (args)=>`ordenado por columna ${args.columnName} en orden descendente`,
|
|
8
8
|
"resizerDescription": `Pulse Intro para empezar a redimensionar`,
|
|
9
9
|
"select": `Seleccionar`,
|
|
10
10
|
"selectAll": `Seleccionar todos`,
|
package/dist/es-ES.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,UAAU,CAAC;IAC3C,iBAAiB,CAAC,OAAS,CAAC,qBAAqB,EAAE,KAAK,UAAU,CAAC,sBAAsB,CAAC;IAC1F,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,WAAQ,CAAC;IAC/C,cAAc,CAAC,WAAW,CAAC;IAC3B,kBAAkB,CAAC,OAAS,CAAC,qBAAqB,EAAE,KAAK,UAAU,CAAC,qBAAqB,CAAC;IAC1F,sBAAsB,CAAC,wCAAwC,CAAC;IAChE,UAAU,CAAC,WAAW,CAAC;IACvB,aAAa,CAAC,iBAAiB,CAAC;IAChC,YAAY,CAAC,iBAAiB,CAAC;AACjC","sources":["packages/@react-aria/table/intl/es-ES.json"],"sourcesContent":["{\n \"ascending\": \"ascendente\",\n \"ascendingSort\": \"ordenado por columna {columnName} en sentido ascendente\",\n \"columnSize\": \"{value} píxeles\",\n \"descending\": \"descendente\",\n \"descendingSort\": \"ordenado por columna {columnName} en orden descendente\",\n \"resizerDescription\": \"Pulse Intro para empezar a redimensionar\",\n \"select\": \"Seleccionar\",\n \"selectAll\": \"Seleccionar todos\",\n \"sortable\": \"columna ordenable\"\n}\n"],"names":[],"version":3,"file":"es-ES.module.js.map"}
|
|
@@ -45,7 +45,7 @@ function $0b394e4562ac57c9$export$1003db6a7e384b99(state) {
|
|
|
45
45
|
checkboxProps: {
|
|
46
46
|
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
47
47
|
isSelected: isSelectAll,
|
|
48
|
-
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
48
|
+
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0 || state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader',
|
|
49
49
|
isIndeterminate: !isEmpty && !isSelectAll,
|
|
50
50
|
onChange: ()=>state.selectionManager.toggleSelectAll()
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAA6B,KAAsC,EAAE,KAAoB;IACvG,IAAI,OAAC,GAAG,EAAC,GAAG;IACZ,MAAM,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,6CAAuB,EAAE,OAAO;IAExD,OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,GAAG,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,0CAAe,EAAE,OAAO,MAAM;QAC1E;IACF;AACF;AAOO,SAAS,0CAA6B,KAAoB;IAC/D,IAAI,WAAC,OAAO,eAAE,WAAW,iBAAE,aAAa,EAAC,GAAG,MAAM,gBAAgB;IAClE,MAAM,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,cAAc,gBAAgB,MAAM,CAAC,kBAAkB,WAAW,WAAW;YAC7E,YAAY;YACZ,YAAY,kBAAkB,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAA6B,KAAsC,EAAE,KAAoB;IACvG,IAAI,OAAC,GAAG,EAAC,GAAG;IACZ,MAAM,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,6CAAuB,EAAE,OAAO;IAExD,OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,GAAG,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,0CAAe,EAAE,OAAO,MAAM;QAC1E;IACF;AACF;AAOO,SAAS,0CAA6B,KAAoB;IAC/D,IAAI,WAAC,OAAO,eAAE,WAAW,iBAAE,aAAa,EAAC,GAAG,MAAM,gBAAgB;IAClE,MAAM,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,cAAc,gBAAgB,MAAM,CAAC,kBAAkB,WAAW,WAAW;YAC7E,YAAY;YACZ,YAAY,kBAAkB,cAAe,MAAM,UAAU,CAAC,IAAI,KAAK,KAAM,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK;YACrJ,iBAAiB,CAAC,WAAW,CAAC;YAC9B,UAAU,IAAM,MAAM,gBAAgB,CAAC,eAAe;QACxD;IACF;AACF","sources":["packages/@react-aria/table/src/useTableSelectionCheckbox.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\nimport {AriaCheckboxProps} from '@react-types/checkbox';\nimport {getRowLabelledBy} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\nimport {useGridSelectionCheckbox} from '@react-aria/grid';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableSelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key\n}\n\nexport interface TableSelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\nexport interface TableSelectAllCheckboxAria {\n /** Props for the select all checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a table.\n * @param props - Props for the selection checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectionCheckbox<T>(props: AriaTableSelectionCheckboxProps, state: TableState<T>): TableSelectionCheckboxAria {\n let {key} = props;\n const {checkboxProps} = useGridSelectionCheckbox(props, state);\n\n return {\n checkboxProps: {\n ...checkboxProps,\n 'aria-labelledby': `${checkboxProps.id} ${getRowLabelledBy(state, key)}`\n }\n };\n}\n\n/**\n * Provides the behavior and accessibility implementation for the select all checkbox in a table.\n * @param props - Props for the select all checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectAllCheckbox<T>(state: TableState<T>): TableSelectAllCheckboxAria {\n let {isEmpty, isSelectAll, selectionMode} = state.selectionManager;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n\n return {\n checkboxProps: {\n 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),\n isSelected: isSelectAll,\n isDisabled: selectionMode !== 'multiple' || (state.collection.size === 0 || (state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader')),\n isIndeterminate: !isEmpty && !isSelectAll,\n onChange: () => state.selectionManager.toggleSelectAll()\n }\n };\n}\n"],"names":[],"version":3,"file":"useTableSelectionCheckbox.main.js.map"}
|
|
@@ -38,7 +38,7 @@ function $2a795c53a101c542$export$1003db6a7e384b99(state) {
|
|
|
38
38
|
checkboxProps: {
|
|
39
39
|
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
40
40
|
isSelected: isSelectAll,
|
|
41
|
-
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
41
|
+
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0 || state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader',
|
|
42
42
|
isIndeterminate: !isEmpty && !isSelectAll,
|
|
43
43
|
onChange: ()=>state.selectionManager.toggleSelectAll()
|
|
44
44
|
}
|
|
@@ -38,7 +38,7 @@ function $2a795c53a101c542$export$1003db6a7e384b99(state) {
|
|
|
38
38
|
checkboxProps: {
|
|
39
39
|
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
40
40
|
isSelected: isSelectAll,
|
|
41
|
-
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
41
|
+
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0 || state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader',
|
|
42
42
|
isIndeterminate: !isEmpty && !isSelectAll,
|
|
43
43
|
onChange: ()=>state.selectionManager.toggleSelectAll()
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAA6B,KAAsC,EAAE,KAAoB;IACvG,IAAI,OAAC,GAAG,EAAC,GAAG;IACZ,MAAM,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,+BAAuB,EAAE,OAAO;IAExD,OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,GAAG,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,wCAAe,EAAE,OAAO,MAAM;QAC1E;IACF;AACF;AAOO,SAAS,0CAA6B,KAAoB;IAC/D,IAAI,WAAC,OAAO,eAAE,WAAW,iBAAE,aAAa,EAAC,GAAG,MAAM,gBAAgB;IAClE,MAAM,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,cAAc,gBAAgB,MAAM,CAAC,kBAAkB,WAAW,WAAW;YAC7E,YAAY;YACZ,YAAY,kBAAkB,
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAA6B,KAAsC,EAAE,KAAoB;IACvG,IAAI,OAAC,GAAG,EAAC,GAAG;IACZ,MAAM,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,+BAAuB,EAAE,OAAO;IAExD,OAAO;QACL,eAAe;YACb,GAAG,aAAa;YAChB,mBAAmB,GAAG,cAAc,EAAE,CAAC,CAAC,EAAE,CAAA,GAAA,wCAAe,EAAE,OAAO,MAAM;QAC1E;IACF;AACF;AAOO,SAAS,0CAA6B,KAAoB;IAC/D,IAAI,WAAC,OAAO,eAAE,WAAW,iBAAE,aAAa,EAAC,GAAG,MAAM,gBAAgB;IAClE,MAAM,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAElE,OAAO;QACL,eAAe;YACb,cAAc,gBAAgB,MAAM,CAAC,kBAAkB,WAAW,WAAW;YAC7E,YAAY;YACZ,YAAY,kBAAkB,cAAe,MAAM,UAAU,CAAC,IAAI,KAAK,KAAM,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK;YACrJ,iBAAiB,CAAC,WAAW,CAAC;YAC9B,UAAU,IAAM,MAAM,gBAAgB,CAAC,eAAe;QACxD;IACF;AACF","sources":["packages/@react-aria/table/src/useTableSelectionCheckbox.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\nimport {AriaCheckboxProps} from '@react-types/checkbox';\nimport {getRowLabelledBy} from './utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\nimport {useGridSelectionCheckbox} from '@react-aria/grid';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AriaTableSelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key\n}\n\nexport interface TableSelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\nexport interface TableSelectAllCheckboxAria {\n /** Props for the select all checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\n/**\n * Provides the behavior and accessibility implementation for a selection checkbox in a table.\n * @param props - Props for the selection checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectionCheckbox<T>(props: AriaTableSelectionCheckboxProps, state: TableState<T>): TableSelectionCheckboxAria {\n let {key} = props;\n const {checkboxProps} = useGridSelectionCheckbox(props, state);\n\n return {\n checkboxProps: {\n ...checkboxProps,\n 'aria-labelledby': `${checkboxProps.id} ${getRowLabelledBy(state, key)}`\n }\n };\n}\n\n/**\n * Provides the behavior and accessibility implementation for the select all checkbox in a table.\n * @param props - Props for the select all checkbox.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableSelectAllCheckbox<T>(state: TableState<T>): TableSelectAllCheckboxAria {\n let {isEmpty, isSelectAll, selectionMode} = state.selectionManager;\n const stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/table');\n\n return {\n checkboxProps: {\n 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),\n isSelected: isSelectAll,\n isDisabled: selectionMode !== 'multiple' || (state.collection.size === 0 || (state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader')),\n isIndeterminate: !isEmpty && !isSelectAll,\n onChange: () => state.selectionManager.toggleSelectAll()\n }\n };\n}\n"],"names":[],"version":3,"file":"useTableSelectionCheckbox.module.js.map"}
|
package/dist/utils.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAU,IAAI;AAE3B,SAAS,mCAAa,GAAQ;IAC5B,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;AAEO,SAAS,0CAAqB,KAAoB,EAAE,SAAc;IACvE,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,YAAY;AAC/C;AAEO,SAAS,0CAAa,KAAoB,EAAE,MAAW,EAAE,SAAc;IAC5E,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,QAAQ,CAAC,EAAE,mCAAa,YAAY;AACvE;AAEO,SAAS,yCAAoB,KAAoB,EAAE,MAAW;IACnE,yCAAyC;IACzC,OAAO;WAAI,MAAM,UAAU,CAAC,mBAAmB;KAAC,CAAC,GAAG,CAAC,CAAA,YACnD,0CAAU,OAAO,QAAQ,YACzB,IAAI,CAAC;AACT","sources":["packages/@react-aria/table/src/utils.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\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\n\nexport const gridIds = new WeakMap<TableState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n\nexport function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(columnKey)}`;\n}\n\nexport function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key) {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(rowKey)}-${normalizeKey(columnKey)}`;\n}\n\nexport function getRowLabelledBy<T>(state: TableState<T>, rowKey: Key): string {\n // A row is labelled by it's row headers.\n return [...state.collection.rowHeaderColumnKeys].map(columnKey =>\n getCellId(state, rowKey, columnKey)\n ).join(' ');\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAU,IAAI;AAE3B,SAAS,mCAAa,GAAQ;IAC5B,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;AAEO,SAAS,0CAAqB,KAAoB,EAAE,SAAc;IACvE,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,YAAY;AAC/C;AAEO,SAAS,0CAAa,KAAoB,EAAE,MAAW,EAAE,SAAc;IAC5E,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,QAAQ,CAAC,EAAE,mCAAa,YAAY;AACvE;AAEO,SAAS,yCAAoB,KAAoB,EAAE,MAAW;IACnE,yCAAyC;IACzC,OAAO;WAAI,MAAM,UAAU,CAAC,mBAAmB;KAAC,CAAC,GAAG,CAAC,CAAA,YACnD,0CAAU,OAAO,QAAQ,YACzB,IAAI,CAAC;AACT","sources":["packages/@react-aria/table/src/utils.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\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\n\nexport const gridIds = new WeakMap<TableState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n\nexport function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(columnKey)}`;\n}\n\nexport function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(rowKey)}-${normalizeKey(columnKey)}`;\n}\n\nexport function getRowLabelledBy<T>(state: TableState<T>, rowKey: Key): string {\n // A row is labelled by it's row headers.\n return [...state.collection.rowHeaderColumnKeys].map(columnKey =>\n getCellId(state, rowKey, columnKey)\n ).join(' ');\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
|
package/dist/utils.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAU,IAAI;AAE3B,SAAS,mCAAa,GAAQ;IAC5B,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;AAEO,SAAS,0CAAqB,KAAoB,EAAE,SAAc;IACvE,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,YAAY;AAC/C;AAEO,SAAS,0CAAa,KAAoB,EAAE,MAAW,EAAE,SAAc;IAC5E,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,QAAQ,CAAC,EAAE,mCAAa,YAAY;AACvE;AAEO,SAAS,yCAAoB,KAAoB,EAAE,MAAW;IACnE,yCAAyC;IACzC,OAAO;WAAI,MAAM,UAAU,CAAC,mBAAmB;KAAC,CAAC,GAAG,CAAC,CAAA,YACnD,0CAAU,OAAO,QAAQ,YACzB,IAAI,CAAC;AACT","sources":["packages/@react-aria/table/src/utils.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\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\n\nexport const gridIds = new WeakMap<TableState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n\nexport function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(columnKey)}`;\n}\n\nexport function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key) {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(rowKey)}-${normalizeKey(columnKey)}`;\n}\n\nexport function getRowLabelledBy<T>(state: TableState<T>, rowKey: Key): string {\n // A row is labelled by it's row headers.\n return [...state.collection.rowHeaderColumnKeys].map(columnKey =>\n getCellId(state, rowKey, columnKey)\n ).join(' ');\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAU,IAAI;AAE3B,SAAS,mCAAa,GAAQ;IAC5B,IAAI,OAAO,QAAQ,UACjB,OAAO,IAAI,OAAO,CAAC,QAAQ;IAG7B,OAAO,KAAK;AACd;AAEO,SAAS,0CAAqB,KAAoB,EAAE,SAAc;IACvE,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,YAAY;AAC/C;AAEO,SAAS,0CAAa,KAAoB,EAAE,MAAW,EAAE,SAAc;IAC5E,IAAI,SAAS,0CAAQ,GAAG,CAAC;IACzB,IAAI,CAAC,QACH,MAAM,IAAI,MAAM;IAGlB,OAAO,GAAG,OAAO,CAAC,EAAE,mCAAa,QAAQ,CAAC,EAAE,mCAAa,YAAY;AACvE;AAEO,SAAS,yCAAoB,KAAoB,EAAE,MAAW;IACnE,yCAAyC;IACzC,OAAO;WAAI,MAAM,UAAU,CAAC,mBAAmB;KAAC,CAAC,GAAG,CAAC,CAAA,YACnD,0CAAU,OAAO,QAAQ,YACzB,IAAI,CAAC;AACT","sources":["packages/@react-aria/table/src/utils.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\nimport {Key} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\n\nexport const gridIds = new WeakMap<TableState<unknown>, string>();\n\nfunction normalizeKey(key: Key): string {\n if (typeof key === 'string') {\n return key.replace(/\\s*/g, '');\n }\n\n return '' + key;\n}\n\nexport function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(columnKey)}`;\n}\n\nexport function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key): string {\n let gridId = gridIds.get(state);\n if (!gridId) {\n throw new Error('Unknown grid');\n }\n\n return `${gridId}-${normalizeKey(rowKey)}-${normalizeKey(columnKey)}`;\n}\n\nexport function getRowLabelledBy<T>(state: TableState<T>, rowKey: Key): string {\n // A row is labelled by it's row headers.\n return [...state.collection.rowHeaderColumnKeys].map(columnKey =>\n getCellId(state, rowKey, columnKey)\n ).join(' ');\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/table",
|
|
3
|
-
"version": "3.17.
|
|
3
|
+
"version": "3.17.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/focus": "^3.20.
|
|
26
|
-
"@react-aria/grid": "^3.
|
|
27
|
-
"@react-aria/i18n": "^3.12.
|
|
28
|
-
"@react-aria/interactions": "^3.
|
|
29
|
-
"@react-aria/live-announcer": "^3.4.
|
|
30
|
-
"@react-aria/utils": "^3.
|
|
31
|
-
"@react-aria/visually-hidden": "^3.8.
|
|
32
|
-
"@react-stately/collections": "^3.12.
|
|
33
|
-
"@react-stately/flags": "^3.1.
|
|
34
|
-
"@react-stately/table": "^3.14.
|
|
35
|
-
"@react-types/checkbox": "^3.9.
|
|
36
|
-
"@react-types/grid": "^3.3.
|
|
37
|
-
"@react-types/shared": "^3.
|
|
38
|
-
"@react-types/table": "^3.
|
|
25
|
+
"@react-aria/focus": "^3.20.3",
|
|
26
|
+
"@react-aria/grid": "^3.14.0",
|
|
27
|
+
"@react-aria/i18n": "^3.12.9",
|
|
28
|
+
"@react-aria/interactions": "^3.25.1",
|
|
29
|
+
"@react-aria/live-announcer": "^3.4.2",
|
|
30
|
+
"@react-aria/utils": "^3.29.0",
|
|
31
|
+
"@react-aria/visually-hidden": "^3.8.23",
|
|
32
|
+
"@react-stately/collections": "^3.12.4",
|
|
33
|
+
"@react-stately/flags": "^3.1.1",
|
|
34
|
+
"@react-stately/table": "^3.14.2",
|
|
35
|
+
"@react-types/checkbox": "^3.9.4",
|
|
36
|
+
"@react-types/grid": "^3.3.2",
|
|
37
|
+
"@react-types/shared": "^3.29.1",
|
|
38
|
+
"@react-types/table": "^3.13.0",
|
|
39
39
|
"@swc/helpers": "^0.5.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9c77d4e8267ed39469c65f65da94ece7be509874"
|
|
49
49
|
}
|
|
@@ -17,11 +17,11 @@ import {TableCollection} from '@react-types/table';
|
|
|
17
17
|
|
|
18
18
|
export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {
|
|
19
19
|
|
|
20
|
-
protected isCell(node: Node<T>) {
|
|
20
|
+
protected isCell(node: Node<T>): boolean {
|
|
21
21
|
return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
getKeyBelow(key: Key) {
|
|
24
|
+
getKeyBelow(key: Key): Key | null {
|
|
25
25
|
let startItem = this.collection.getItem(key);
|
|
26
26
|
if (!startItem) {
|
|
27
27
|
return null;
|
|
@@ -51,7 +51,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
51
51
|
return super.getKeyBelow(key);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
getKeyAbove(key: Key) {
|
|
54
|
+
getKeyAbove(key: Key): Key | null {
|
|
55
55
|
let startItem = this.collection.getItem(key);
|
|
56
56
|
if (!startItem) {
|
|
57
57
|
return null;
|
|
@@ -84,7 +84,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
84
84
|
return this.collection.columns[0].key;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
private findNextColumnKey(column: Node<T>) {
|
|
87
|
+
private findNextColumnKey(column: Node<T>): Key | null {
|
|
88
88
|
// Search following columns
|
|
89
89
|
let key = this.findNextKey(column.key, item => item.type === 'column');
|
|
90
90
|
if (key != null) {
|
|
@@ -102,7 +102,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
private findPreviousColumnKey(column: Node<T>) {
|
|
105
|
+
private findPreviousColumnKey(column: Node<T>): Key | null {
|
|
106
106
|
// Search previous columns
|
|
107
107
|
let key = this.findPreviousKey(column.key, item => item.type === 'column');
|
|
108
108
|
if (key != null) {
|
|
@@ -122,7 +122,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
getKeyRightOf(key: Key) {
|
|
125
|
+
getKeyRightOf(key: Key): Key | null {
|
|
126
126
|
let item = this.collection.getItem(key);
|
|
127
127
|
if (!item) {
|
|
128
128
|
return null;
|
|
@@ -138,7 +138,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
138
138
|
return super.getKeyRightOf(key);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
getKeyLeftOf(key: Key) {
|
|
141
|
+
getKeyLeftOf(key: Key): Key | null {
|
|
142
142
|
let item = this.collection.getItem(key);
|
|
143
143
|
if (!item) {
|
|
144
144
|
return null;
|
|
@@ -154,7 +154,7 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
154
154
|
return super.getKeyLeftOf(key);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
getKeyForSearch(search: string, fromKey?: Key) {
|
|
157
|
+
getKeyForSearch(search: string, fromKey?: Key): Key | null {
|
|
158
158
|
if (!this.collator) {
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
@@ -178,6 +178,13 @@ export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableColle
|
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
if (item.textValue) {
|
|
182
|
+
let substring = item.textValue.slice(0, search.length);
|
|
183
|
+
if (this.collator.compare(substring, search) === 0) {
|
|
184
|
+
return item.key;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
181
188
|
// Check each of the row header cells in this row for a match
|
|
182
189
|
for (let cell of getChildNodes(item, this.collection)) {
|
|
183
190
|
let column = collection.columns[cell.index];
|
|
@@ -64,7 +64,7 @@ export function useTableSelectAllCheckbox<T>(state: TableState<T>): TableSelectA
|
|
|
64
64
|
checkboxProps: {
|
|
65
65
|
'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
|
|
66
66
|
isSelected: isSelectAll,
|
|
67
|
-
isDisabled: selectionMode !== 'multiple' || state.collection.size === 0,
|
|
67
|
+
isDisabled: selectionMode !== 'multiple' || (state.collection.size === 0 || (state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader')),
|
|
68
68
|
isIndeterminate: !isEmpty && !isSelectAll,
|
|
69
69
|
onChange: () => state.selectionManager.toggleSelectAll()
|
|
70
70
|
}
|
package/src/utils.ts
CHANGED
|
@@ -32,7 +32,7 @@ export function getColumnHeaderId<T>(state: TableState<T>, columnKey: Key): stri
|
|
|
32
32
|
return `${gridId}-${normalizeKey(columnKey)}`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key) {
|
|
35
|
+
export function getCellId<T>(state: TableState<T>, rowKey: Key, columnKey: Key): string {
|
|
36
36
|
let gridId = gridIds.get(state);
|
|
37
37
|
if (!gridId) {
|
|
38
38
|
throw new Error('Unknown grid');
|