@react-aria/table 3.0.0-beta.0 → 3.0.0-nightly-641446f65-240905

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 (240) 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.main.js +14 -0
  7. package/dist/ar-AE.main.js.map +1 -0
  8. package/dist/ar-AE.mjs +16 -0
  9. package/dist/ar-AE.module.js +16 -0
  10. package/dist/ar-AE.module.js.map +1 -0
  11. package/dist/bg-BG.main.js +14 -0
  12. package/dist/bg-BG.main.js.map +1 -0
  13. package/dist/bg-BG.mjs +16 -0
  14. package/dist/bg-BG.module.js +16 -0
  15. package/dist/bg-BG.module.js.map +1 -0
  16. package/dist/cs-CZ.main.js +14 -0
  17. package/dist/cs-CZ.main.js.map +1 -0
  18. package/dist/cs-CZ.mjs +16 -0
  19. package/dist/cs-CZ.module.js +16 -0
  20. package/dist/cs-CZ.module.js.map +1 -0
  21. package/dist/da-DK.main.js +14 -0
  22. package/dist/da-DK.main.js.map +1 -0
  23. package/dist/da-DK.mjs +16 -0
  24. package/dist/da-DK.module.js +16 -0
  25. package/dist/da-DK.module.js.map +1 -0
  26. package/dist/de-DE.main.js +14 -0
  27. package/dist/de-DE.main.js.map +1 -0
  28. package/dist/de-DE.mjs +16 -0
  29. package/dist/de-DE.module.js +16 -0
  30. package/dist/de-DE.module.js.map +1 -0
  31. package/dist/el-GR.main.js +14 -0
  32. package/dist/el-GR.main.js.map +1 -0
  33. package/dist/el-GR.mjs +16 -0
  34. package/dist/el-GR.module.js +16 -0
  35. package/dist/el-GR.module.js.map +1 -0
  36. package/dist/en-US.main.js +14 -0
  37. package/dist/en-US.main.js.map +1 -0
  38. package/dist/en-US.mjs +16 -0
  39. package/dist/en-US.module.js +16 -0
  40. package/dist/en-US.module.js.map +1 -0
  41. package/dist/es-ES.main.js +14 -0
  42. package/dist/es-ES.main.js.map +1 -0
  43. package/dist/es-ES.mjs +16 -0
  44. package/dist/es-ES.module.js +16 -0
  45. package/dist/es-ES.module.js.map +1 -0
  46. package/dist/et-EE.main.js +14 -0
  47. package/dist/et-EE.main.js.map +1 -0
  48. package/dist/et-EE.mjs +16 -0
  49. package/dist/et-EE.module.js +16 -0
  50. package/dist/et-EE.module.js.map +1 -0
  51. package/dist/fi-FI.main.js +14 -0
  52. package/dist/fi-FI.main.js.map +1 -0
  53. package/dist/fi-FI.mjs +16 -0
  54. package/dist/fi-FI.module.js +16 -0
  55. package/dist/fi-FI.module.js.map +1 -0
  56. package/dist/fr-FR.main.js +14 -0
  57. package/dist/fr-FR.main.js.map +1 -0
  58. package/dist/fr-FR.mjs +16 -0
  59. package/dist/fr-FR.module.js +16 -0
  60. package/dist/fr-FR.module.js.map +1 -0
  61. package/dist/he-IL.main.js +14 -0
  62. package/dist/he-IL.main.js.map +1 -0
  63. package/dist/he-IL.mjs +16 -0
  64. package/dist/he-IL.module.js +16 -0
  65. package/dist/he-IL.module.js.map +1 -0
  66. package/dist/hr-HR.main.js +14 -0
  67. package/dist/hr-HR.main.js.map +1 -0
  68. package/dist/hr-HR.mjs +16 -0
  69. package/dist/hr-HR.module.js +16 -0
  70. package/dist/hr-HR.module.js.map +1 -0
  71. package/dist/hu-HU.main.js +14 -0
  72. package/dist/hu-HU.main.js.map +1 -0
  73. package/dist/hu-HU.mjs +16 -0
  74. package/dist/hu-HU.module.js +16 -0
  75. package/dist/hu-HU.module.js.map +1 -0
  76. package/dist/import.mjs +34 -0
  77. package/dist/intlStrings.main.js +108 -0
  78. package/dist/intlStrings.main.js.map +1 -0
  79. package/dist/intlStrings.mjs +110 -0
  80. package/dist/intlStrings.module.js +110 -0
  81. package/dist/intlStrings.module.js.map +1 -0
  82. package/dist/it-IT.main.js +14 -0
  83. package/dist/it-IT.main.js.map +1 -0
  84. package/dist/it-IT.mjs +16 -0
  85. package/dist/it-IT.module.js +16 -0
  86. package/dist/it-IT.module.js.map +1 -0
  87. package/dist/ja-JP.main.js +14 -0
  88. package/dist/ja-JP.main.js.map +1 -0
  89. package/dist/ja-JP.mjs +16 -0
  90. package/dist/ja-JP.module.js +16 -0
  91. package/dist/ja-JP.module.js.map +1 -0
  92. package/dist/ko-KR.main.js +14 -0
  93. package/dist/ko-KR.main.js.map +1 -0
  94. package/dist/ko-KR.mjs +16 -0
  95. package/dist/ko-KR.module.js +16 -0
  96. package/dist/ko-KR.module.js.map +1 -0
  97. package/dist/lt-LT.main.js +14 -0
  98. package/dist/lt-LT.main.js.map +1 -0
  99. package/dist/lt-LT.mjs +16 -0
  100. package/dist/lt-LT.module.js +16 -0
  101. package/dist/lt-LT.module.js.map +1 -0
  102. package/dist/lv-LV.main.js +14 -0
  103. package/dist/lv-LV.main.js.map +1 -0
  104. package/dist/lv-LV.mjs +16 -0
  105. package/dist/lv-LV.module.js +16 -0
  106. package/dist/lv-LV.module.js.map +1 -0
  107. package/dist/main.js +26 -466
  108. package/dist/main.js.map +1 -1
  109. package/dist/module.js +12 -422
  110. package/dist/module.js.map +1 -1
  111. package/dist/nb-NO.main.js +14 -0
  112. package/dist/nb-NO.main.js.map +1 -0
  113. package/dist/nb-NO.mjs +16 -0
  114. package/dist/nb-NO.module.js +16 -0
  115. package/dist/nb-NO.module.js.map +1 -0
  116. package/dist/nl-NL.main.js +14 -0
  117. package/dist/nl-NL.main.js.map +1 -0
  118. package/dist/nl-NL.mjs +16 -0
  119. package/dist/nl-NL.module.js +16 -0
  120. package/dist/nl-NL.module.js.map +1 -0
  121. package/dist/pl-PL.main.js +14 -0
  122. package/dist/pl-PL.main.js.map +1 -0
  123. package/dist/pl-PL.mjs +16 -0
  124. package/dist/pl-PL.module.js +16 -0
  125. package/dist/pl-PL.module.js.map +1 -0
  126. package/dist/pt-BR.main.js +14 -0
  127. package/dist/pt-BR.main.js.map +1 -0
  128. package/dist/pt-BR.mjs +16 -0
  129. package/dist/pt-BR.module.js +16 -0
  130. package/dist/pt-BR.module.js.map +1 -0
  131. package/dist/pt-PT.main.js +14 -0
  132. package/dist/pt-PT.main.js.map +1 -0
  133. package/dist/pt-PT.mjs +16 -0
  134. package/dist/pt-PT.module.js +16 -0
  135. package/dist/pt-PT.module.js.map +1 -0
  136. package/dist/ro-RO.main.js +14 -0
  137. package/dist/ro-RO.main.js.map +1 -0
  138. package/dist/ro-RO.mjs +16 -0
  139. package/dist/ro-RO.module.js +16 -0
  140. package/dist/ro-RO.module.js.map +1 -0
  141. package/dist/ru-RU.main.js +14 -0
  142. package/dist/ru-RU.main.js.map +1 -0
  143. package/dist/ru-RU.mjs +16 -0
  144. package/dist/ru-RU.module.js +16 -0
  145. package/dist/ru-RU.module.js.map +1 -0
  146. package/dist/sk-SK.main.js +14 -0
  147. package/dist/sk-SK.main.js.map +1 -0
  148. package/dist/sk-SK.mjs +16 -0
  149. package/dist/sk-SK.module.js +16 -0
  150. package/dist/sk-SK.module.js.map +1 -0
  151. package/dist/sl-SI.main.js +14 -0
  152. package/dist/sl-SI.main.js.map +1 -0
  153. package/dist/sl-SI.mjs +16 -0
  154. package/dist/sl-SI.module.js +16 -0
  155. package/dist/sl-SI.module.js.map +1 -0
  156. package/dist/sr-SP.main.js +14 -0
  157. package/dist/sr-SP.main.js.map +1 -0
  158. package/dist/sr-SP.mjs +16 -0
  159. package/dist/sr-SP.module.js +16 -0
  160. package/dist/sr-SP.module.js.map +1 -0
  161. package/dist/sv-SE.main.js +14 -0
  162. package/dist/sv-SE.main.js.map +1 -0
  163. package/dist/sv-SE.mjs +16 -0
  164. package/dist/sv-SE.module.js +16 -0
  165. package/dist/sv-SE.module.js.map +1 -0
  166. package/dist/tr-TR.main.js +14 -0
  167. package/dist/tr-TR.main.js.map +1 -0
  168. package/dist/tr-TR.mjs +16 -0
  169. package/dist/tr-TR.module.js +16 -0
  170. package/dist/tr-TR.module.js.map +1 -0
  171. package/dist/types.d.ts +102 -43
  172. package/dist/types.d.ts.map +1 -1
  173. package/dist/uk-UA.main.js +14 -0
  174. package/dist/uk-UA.main.js.map +1 -0
  175. package/dist/uk-UA.mjs +16 -0
  176. package/dist/uk-UA.module.js +16 -0
  177. package/dist/uk-UA.module.js.map +1 -0
  178. package/dist/useTable.main.js +113 -0
  179. package/dist/useTable.main.js.map +1 -0
  180. package/dist/useTable.mjs +108 -0
  181. package/dist/useTable.module.js +108 -0
  182. package/dist/useTable.module.js.map +1 -0
  183. package/dist/useTableCell.main.js +36 -0
  184. package/dist/useTableCell.main.js.map +1 -0
  185. package/dist/useTableCell.mjs +31 -0
  186. package/dist/useTableCell.module.js +31 -0
  187. package/dist/useTableCell.module.js.map +1 -0
  188. package/dist/useTableColumnHeader.main.js +93 -0
  189. package/dist/useTableColumnHeader.main.js.map +1 -0
  190. package/dist/useTableColumnHeader.mjs +88 -0
  191. package/dist/useTableColumnHeader.module.js +88 -0
  192. package/dist/useTableColumnHeader.module.js.map +1 -0
  193. package/dist/useTableColumnResize.main.js +216 -0
  194. package/dist/useTableColumnResize.main.js.map +1 -0
  195. package/dist/useTableColumnResize.mjs +211 -0
  196. package/dist/useTableColumnResize.module.js +211 -0
  197. package/dist/useTableColumnResize.module.js.map +1 -0
  198. package/dist/useTableHeaderRow.main.js +32 -0
  199. package/dist/useTableHeaderRow.main.js.map +1 -0
  200. package/dist/useTableHeaderRow.mjs +27 -0
  201. package/dist/useTableHeaderRow.module.js +27 -0
  202. package/dist/useTableHeaderRow.module.js.map +1 -0
  203. package/dist/useTableRow.main.js +81 -0
  204. package/dist/useTableRow.main.js.map +1 -0
  205. package/dist/useTableRow.mjs +76 -0
  206. package/dist/useTableRow.module.js +76 -0
  207. package/dist/useTableRow.module.js.map +1 -0
  208. package/dist/useTableSelectionCheckbox.main.js +56 -0
  209. package/dist/useTableSelectionCheckbox.main.js.map +1 -0
  210. package/dist/useTableSelectionCheckbox.mjs +50 -0
  211. package/dist/useTableSelectionCheckbox.module.js +50 -0
  212. package/dist/useTableSelectionCheckbox.module.js.map +1 -0
  213. package/dist/utils.main.js +43 -0
  214. package/dist/utils.main.js.map +1 -0
  215. package/dist/utils.mjs +35 -0
  216. package/dist/utils.module.js +35 -0
  217. package/dist/utils.module.js.map +1 -0
  218. package/dist/zh-CN.main.js +14 -0
  219. package/dist/zh-CN.main.js.map +1 -0
  220. package/dist/zh-CN.mjs +16 -0
  221. package/dist/zh-CN.module.js +16 -0
  222. package/dist/zh-CN.module.js.map +1 -0
  223. package/dist/zh-TW.main.js +14 -0
  224. package/dist/zh-TW.main.js.map +1 -0
  225. package/dist/zh-TW.mjs +16 -0
  226. package/dist/zh-TW.module.js +16 -0
  227. package/dist/zh-TW.module.js.map +1 -0
  228. package/package.json +25 -17
  229. package/src/TableKeyboardDelegate.ts +18 -10
  230. package/src/index.ts +21 -7
  231. package/src/useTable.ts +65 -44
  232. package/src/useTableCell.ts +59 -0
  233. package/src/useTableColumnHeader.ts +58 -25
  234. package/src/useTableColumnResize.ts +275 -0
  235. package/src/useTableHeaderRow.ts +42 -0
  236. package/src/useTableRow.ts +60 -6
  237. package/src/useTableSelectionCheckbox.ts +20 -27
  238. package/src/utils.ts +1 -1
  239. package/LICENSE +0 -201
  240. package/src/useTableRowHeader.ts +0 -51
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;ACFD;;;;;;;;;;;AAeO,MAAMG,6CAAO,GAAG,IAAIC,OAAJ,EAAhB;;AAEP,SAASC,+CAAT,CAAsBC,GAAtB,EAAwC;AACtC,MAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AAC3B,WA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G,KAAtC,EAAmF;AACxF,MAAI;AAAC8G,IAAAA,OAAD;AAAUC,IAAAA;AAAV,MAAyB/G,KAAK,CAACuG,gBAAnC;AACA,SAAO;AACLK,IAAAA,aAAa,EAAE;AACb,oBAAc,YADD;AAEbH,MAAAA,UAAU,EAAEM,WAFC;AAGbC,MAAAA,eAAe,EAAE,CAACF,OAAD,IAAY,CAACC,WAHjB;AAIbL,MAAAA,QAAQ,EAAE,MAAM1G,KAAK,CAACuG,gBAAN,CAAuBU,eAAvB;AAJH;AADV,GAAP;AAQD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/table/src/utils.ts","./packages/@react-aria/table/src/TableKeyboardDelegate.ts","./packages/@react-aria/table/src/useTable.ts","./packages/@react-aria/table/src/useTableColumnHeader.ts","./packages/@react-aria/table/src/useTableRow.ts","./packages/@react-aria/table/src/useTableRowHeader.ts","./packages/@react-aria/table/src/useTableSelectionCheckbox.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Key} from 'react';\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","/*\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 {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key} from 'react';\nimport {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 = [...startItem.childNodes][0];\n if (child) {\n return child.key;\n }\n\n let firstItem = this.collection.getItem(this.getFirstKey());\n return [...firstItem.childNodes][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 && 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 row.childNodes) {\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 = [...row.childNodes];\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\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 item.childNodes) {\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","/*\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 {GridAria, GridProps, useGrid} from '@react-aria/grid';\nimport {gridIds} from './utils';\nimport {Layout} from '@react-stately/virtualizer';\nimport {Node} from '@react-types/shared';\nimport {TableKeyboardDelegate} from './TableKeyboardDelegate';\nimport {TableState} from '@react-stately/table';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useId} from '@react-aria/utils';\nimport {useMemo} from 'react';\n\ninterface TableProps<T> extends GridProps {\n /** The layout object for the table. Computes what content is visible and how to position and style them. */\n layout?: Layout<Node<T>>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table component.\n * A table displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n */\nexport function useTable<T>(props: TableProps<T>, state: TableState<T>): GridAria {\n let {\n ref,\n keyboardDelegate,\n isVirtualized,\n layout\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let delegate = useMemo(() => keyboardDelegate || new TableKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref,\n direction,\n collator,\n layout\n }), [keyboardDelegate, state.collection, state.disabledKeys, ref, direction, collator, layout]);\n\n let id = useId();\n gridIds.set(state, id);\n\n let {gridProps} = useGrid({\n ...props,\n id,\n keyboardDelegate: delegate,\n getRowText(key) {\n let added = state.collection.getItem(key);\n\n // If the row has a textValue, use that.\n if (added.textValue != null) {\n return added.textValue;\n }\n\n // Otherwise combine the text of each of the row header columns.\n let rowHeaderColumnKeys = state.collection.rowHeaderColumnKeys;\n if (rowHeaderColumnKeys) {\n let text = [];\n for (let cell of added.childNodes) {\n let column = state.collection.columns[cell.index];\n if (rowHeaderColumnKeys.has(column.key) && cell.textValue) {\n text.push(cell.textValue);\n }\n\n if (text.length === rowHeaderColumnKeys.size) {\n break;\n }\n }\n\n return text.join(' ');\n }\n\n return '';\n }\n }, state);\n\n // Override to include header rows\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size + state.collection.headerRows.length;\n }\n\n return {\n gridProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getColumnHeaderId} from './utils';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {mergeProps} from '@react-aria/utils';\nimport {Node} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\nimport {useFocusable} from '@react-aria/focus';\nimport {useGridCell} from '@react-aria/grid';\nimport {usePress} from '@react-aria/interactions';\n\n\ninterface ColumnHeaderProps {\n /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */\n node: Node<unknown>,\n /** The ref attached to the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). */\n ref: RefObject<HTMLElement>,\n /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** The number of columns the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) should span. */\n colspan?: number,\n /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is disabled. */\n isDisabled?: boolean\n}\n\ninterface ColumnHeaderAria {\n /** Props for the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) element. */\n columnHeaderProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a column header in a table.\n * @param props - Props for the column header.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableColumnHeader<T>(props: ColumnHeaderProps, state: TableState<T>): ColumnHeaderAria {\n let {node, colspan, ref, isDisabled} = props;\n let {gridCellProps} = useGridCell(props, state);\n\n let {pressProps} = usePress({\n isDisabled: !node.props.allowsSorting || isDisabled,\n onPress() {\n state.sort(node.key);\n }\n });\n\n // Needed to pick up the focusable context, enabling things like Tooltips for example\n let {focusableProps} = useFocusable({}, ref);\n let ariaSort: HTMLAttributes<HTMLElement>['aria-sort'] = null;\n if (node.props.allowsSorting) {\n ariaSort = state.sortDescriptor?.column === node.key ? state.sortDescriptor.direction : 'none';\n }\n\n return {\n columnHeaderProps: {\n ...mergeProps(gridCellProps, pressProps, focusableProps),\n role: 'columnheader',\n id: getColumnHeaderId(state, node.key),\n 'aria-colspan': colspan && colspan > 1 ? colspan : null,\n 'aria-sort': ariaSort\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '@react-aria/grid';\nimport {TableCollection} from '@react-types/table';\nimport {TableState} from '@react-stately/table';\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(props: GridRowProps<T>, state: TableState<T>): GridRowAria {\n let {node} = props;\n let {rowProps} = useGridRow<T, TableCollection<T>, TableState<T>>(props, state);\n return {\n rowProps: {\n ...rowProps,\n 'aria-labelledby': getRowLabelledBy(state, node.key)\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getCellId} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {TableState} from '@react-stately/table';\nimport {useGridCell} from '@react-aria/grid';\n\ninterface RowHeaderProps {\n /** An object representing the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader). Contains all the relevant information that makes up the row header. */\n node: GridNode<unknown>,\n /** The ref attached to the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader). */\n ref: RefObject<HTMLElement>,\n /** Whether the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) is disabled. */\n isDisabled?: boolean\n}\n\ninterface RowHeaderAria {\n /** Props for the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) element. */\n rowHeaderProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row header in a table.\n * @param props - Props for the row header.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRowHeader<T>(props: RowHeaderProps, state: TableState<T>): RowHeaderAria {\n let {gridCellProps} = useGridCell(props, state);\n\n let columnKey = props.node.column.key;\n return {\n rowHeaderProps: {\n ...gridCellProps,\n role: 'rowheader',\n id: getCellId(state, props.node.parentKey, columnKey)\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxProps} from '@react-types/checkbox';\nimport {getRowLabelledBy} from './utils';\nimport {Key} from 'react';\nimport {TableState} from '@react-stately/table';\nimport {useId} from '@react-aria/utils';\n\ninterface SelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key,\n /** Whether the checkbox is disabled. */\n isDisabled?: boolean\n}\n\ninterface SelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\ninterface SelectAllCheckboxAria {\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: SelectionCheckboxProps, state: TableState<T>): SelectionCheckboxAria {\n let {\n key,\n isDisabled\n } = props;\n\n let manager = state.selectionManager;\n let checkboxId = useId();\n let isSelected = state.selectionManager.isSelected(key) && !isDisabled;\n\n let onChange = () => manager.select(key);\n\n return {\n checkboxProps: {\n id: checkboxId,\n 'aria-label': 'Select',\n 'aria-labelledby': `${checkboxId} ${getRowLabelledBy(state, key)}`,\n isSelected,\n onChange\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>): SelectAllCheckboxAria {\n let {isEmpty, isSelectAll} = state.selectionManager;\n return {\n checkboxProps: {\n 'aria-label': 'Select All',\n isSelected: isSelectAll,\n isIndeterminate: !isEmpty && !isSelectAll,\n onChange: () => state.selectionManager.toggleSelectAll()\n }\n };\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","gridIds","WeakMap","normalizeKey","key","replace","getColumnHeaderId","state","columnKey","gridId","get","Error","getCellId","rowKey","getRowLabelledBy","collection","rowHeaderColumnKeys","map","join","TableKeyboardDelegate","GridKeyboardDelegate","isCell","node","type","getKeyBelow","startItem","getItem","child","childNodes","firstItem","getFirstKey","index","getKeyAbove","parent","parentKey","superKey","columns","findNextColumnKey","column","findNextKey","item","row","headerRows","level","findPreviousColumnKey","findPreviousKey","i","length","getKeyRightOf","direction","getKeyLeftOf","getKeyForSearch","search","fromKey","collator","hasWrapped","cell","has","textValue","substring","slice","compare","fromItem","useTable","props","ref","keyboardDelegate","isVirtualized","layout","useCollator","usage","sensitivity","useLocale","delegate","useMemo","disabledKeys","id","useId","set","gridProps","useGrid","getRowText","added","text","push","size","useTableColumnHeader","colspan","isDisabled","gridCellProps","useGridCell","pressProps","usePress","allowsSorting","onPress","sort","focusableProps","useFocusable","ariaSort","sortDescriptor","columnHeaderProps","mergeProps","role","useTableRow","rowProps","useGridRow","useTableRowHeader","rowHeaderProps","useTableSelectionCheckbox","manager","selectionManager","checkboxId","isSelected","onChange","select","checkboxProps","useTableSelectAllCheckbox","isEmpty","isSelectAll","isIndeterminate","toggleSelectAll"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaM,SAAS;IACd,OAAO,CAAA,GAAA,oCAAc;AACvB","sources":["packages/@react-aria/table/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTable} from './useTable';\nexport {useTableColumnHeader} from './useTableColumnHeader';\nexport {useTableRow} from './useTableRow';\nexport {useTableHeaderRow} from './useTableHeaderRow';\nexport {useTableCell} from './useTableCell';\nexport {useTableSelectionCheckbox, useTableSelectAllCheckbox} from './useTableSelectionCheckbox';\nexport {useTableColumnResize} from './useTableColumnResize';\n\n// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...\n// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';\nimport {GridRowGroupAria, useGridRowGroup} from '@react-aria/grid';\nexport function useTableRowGroup(): GridRowGroupAria {\n return useGridRowGroup();\n}\n\nexport type {AriaTableProps} from './useTable';\nexport type {GridAria, GridRowAria, GridRowProps} from '@react-aria/grid';\nexport type {AriaTableColumnHeaderProps, TableColumnHeaderAria} from './useTableColumnHeader';\nexport type {AriaTableCellProps, TableCellAria} from './useTableCell';\nexport type {TableHeaderRowAria} from './useTableHeaderRow';\nexport type {AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria, TableSelectAllCheckboxAria} from './useTableSelectionCheckbox';\nexport type {AriaTableColumnResizeProps, TableColumnResizeAria} from './useTableColumnResize';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,11 +1,11 @@
1
- import { usePress } from "@react-aria/interactions";
2
- import { useFocusable } from "@react-aria/focus";
3
- import { useMemo } from "react";
4
- import { useId, mergeProps } from "@react-aria/utils";
5
- import { useCollator, useLocale } from "@react-aria/i18n";
6
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
7
- import { useGridCell as useTableCell, useGridRowGroup as useTableRowGroup, useGrid, GridKeyboardDelegate, useGridRow } from "@react-aria/grid";
8
- export { useTableCell, useTableRowGroup };
1
+ import {useTable as $6e31608fbba75bab$export$25bceaac3c7e4dc7} from "./useTable.module.js";
2
+ import {useTableColumnHeader as $f329116d8ad0aba0$export$9514819a8c81e960} from "./useTableColumnHeader.module.js";
3
+ import {useTableRow as $b2db214c022798eb$export$7f2f6ae19e707aa5} from "./useTableRow.module.js";
4
+ import {useTableHeaderRow as $f917ee10f4c32dab$export$1b95a7d2d517b841} from "./useTableHeaderRow.module.js";
5
+ import {useTableCell as $7713593715703b24$export$49571c903d73624c} from "./useTableCell.module.js";
6
+ import {useTableSelectAllCheckbox as $2a795c53a101c542$export$1003db6a7e384b99, useTableSelectionCheckbox as $2a795c53a101c542$export$16ea7f650bd7c1bb} from "./useTableSelectionCheckbox.module.js";
7
+ import {useTableColumnResize as $e91ef4e5004e3774$export$52994e973806c219} from "./useTableColumnResize.module.js";
8
+ import {useGridRowGroup as $lJcFS$useGridRowGroup} from "@react-aria/grid";
9
9
 
10
10
  /*
11
11
  * Copyright 2020 Adobe. All rights reserved.
@@ -17,428 +17,18 @@ export { useTableCell, useTableRowGroup };
17
17
  * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
18
  * OF ANY KIND, either express or implied. See the License for the specific language
19
19
  * governing permissions and limitations under the License.
20
- */
21
- const $fd8271485d8e52f870169aca977a9c1$export$gridIds = new WeakMap();
20
+ */
22
21
 
23
- function $fd8271485d8e52f870169aca977a9c1$var$normalizeKey(key) {
24
- if (typeof key === 'string') {
25
- return key.replace(/\s*/g, '');
26
- }
27
22
 
28
- return '' + key;
29
- }
30
-
31
- function $fd8271485d8e52f870169aca977a9c1$export$getColumnHeaderId(state, columnKey) {
32
- let gridId = $fd8271485d8e52f870169aca977a9c1$export$gridIds.get(state);
33
-
34
- if (!gridId) {
35
- throw new Error('Unknown grid');
36
- }
37
23
 
38
- return gridId + "-" + $fd8271485d8e52f870169aca977a9c1$var$normalizeKey(columnKey);
39
- }
40
24
 
41
- function $fd8271485d8e52f870169aca977a9c1$export$getCellId(state, rowKey, columnKey) {
42
- let gridId = $fd8271485d8e52f870169aca977a9c1$export$gridIds.get(state);
43
25
 
44
- if (!gridId) {
45
- throw new Error('Unknown grid');
46
- }
47
26
 
48
- return gridId + "-" + $fd8271485d8e52f870169aca977a9c1$var$normalizeKey(rowKey) + "-" + $fd8271485d8e52f870169aca977a9c1$var$normalizeKey(columnKey);
49
- }
50
27
 
51
- function $fd8271485d8e52f870169aca977a9c1$export$getRowLabelledBy(state, rowKey) {
52
- // A row is labelled by it's row headers.
53
- return [...state.collection.rowHeaderColumnKeys].map(columnKey => $fd8271485d8e52f870169aca977a9c1$export$getCellId(state, rowKey, columnKey)).join(' ');
28
+ function $0047e6c294ea075f$export$6fb1613bd7b28198() {
29
+ return (0, $lJcFS$useGridRowGroup)();
54
30
  }
55
31
 
56
- class $dabf6db3fde4ddfaf13a80216b120e5f$export$TableKeyboardDelegate extends GridKeyboardDelegate {
57
- isCell(node) {
58
- return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';
59
- }
60
-
61
- getKeyBelow(key) {
62
- let startItem = this.collection.getItem(key);
63
-
64
- if (!startItem) {
65
- return;
66
- } // If focus was on a column, then focus the first child column if any,
67
- // or find the corresponding cell in the first row.
68
-
69
-
70
- if (startItem.type === 'column') {
71
- let child = [...startItem.childNodes][0];
72
-
73
- if (child) {
74
- return child.key;
75
- }
76
-
77
- let firstItem = this.collection.getItem(this.getFirstKey());
78
- return [...firstItem.childNodes][startItem.index].key;
79
- }
80
-
81
- return super.getKeyBelow(key);
82
- }
83
-
84
- getKeyAbove(key) {
85
- let startItem = this.collection.getItem(key);
86
-
87
- if (!startItem) {
88
- return;
89
- } // If focus was on a column, focus the parent column if any
90
-
91
-
92
- if (startItem.type === 'column') {
93
- let parent = this.collection.getItem(startItem.parentKey);
94
-
95
- if (parent && parent.type === 'column') {
96
- return parent.key;
97
- }
98
-
99
- return;
100
- } // only return above row key if not header row
101
-
102
-
103
- let superKey = super.getKeyAbove(key);
104
-
105
- if (superKey && this.collection.getItem(superKey).type !== 'headerrow') {
106
- return superKey;
107
- } // If no item was found, and focus was on a cell, then focus the
108
- // corresponding column header.
109
-
110
-
111
- if (this.isCell(startItem)) {
112
- return this.collection.columns[startItem.index].key;
113
- } // If focus was on a row, then focus the first column header.
114
-
115
-
116
- return this.collection.columns[0].key;
117
- }
118
-
119
- findNextColumnKey(column) {
120
- // Search following columns
121
- let key = this.findNextKey(column.key, item => item.type === 'column');
122
-
123
- if (key != null) {
124
- return key;
125
- } // Wrap around to the first column
126
-
127
-
128
- let row = this.collection.headerRows[column.level];
129
-
130
- for (let item of row.childNodes) {
131
- if (item.type === 'column') {
132
- return item.key;
133
- }
134
- }
135
- }
136
-
137
- findPreviousColumnKey(column) {
138
- // Search previous columns
139
- let key = this.findPreviousKey(column.key, item => item.type === 'column');
140
-
141
- if (key != null) {
142
- return key;
143
- } // Wrap around to the last column
144
-
145
-
146
- let row = this.collection.headerRows[column.level];
147
- let childNodes = [...row.childNodes];
148
-
149
- for (let i = childNodes.length - 1; i >= 0; i--) {
150
- let item = childNodes[i];
151
-
152
- if (item.type === 'column') {
153
- return item.key;
154
- }
155
- }
156
- }
157
-
158
- getKeyRightOf(key) {
159
- let item = this.collection.getItem(key);
160
-
161
- if (!item) {
162
- return;
163
- } // If focus was on a column, then focus the next column
164
-
165
-
166
- if (item.type === 'column') {
167
- return this.direction === 'rtl' ? this.findPreviousColumnKey(item) : this.findNextColumnKey(item);
168
- }
169
-
170
- return super.getKeyRightOf(key);
171
- }
172
-
173
- getKeyLeftOf(key) {
174
- let item = this.collection.getItem(key);
175
-
176
- if (!item) {
177
- return;
178
- } // If focus was on a column, then focus the previous column
179
-
180
-
181
- if (item.type === 'column') {
182
- return this.direction === 'rtl' ? this.findNextColumnKey(item) : this.findPreviousColumnKey(item);
183
- }
184
-
185
- return super.getKeyLeftOf(key);
186
- }
187
-
188
- getKeyForSearch(search, fromKey) {
189
- if (!this.collator) {
190
- return null;
191
- }
192
32
 
193
- let collection = this.collection;
194
- let key = fromKey != null ? fromKey : this.getFirstKey(); // If the starting key is a cell, search from its parent row.
195
-
196
- let startItem = collection.getItem(key);
197
-
198
- if (startItem.type === 'cell') {
199
- key = startItem.parentKey;
200
- }
201
-
202
- let hasWrapped = false;
203
-
204
- while (key != null) {
205
- let item = collection.getItem(key); // Check each of the row header cells in this row for a match
206
-
207
- for (let cell of item.childNodes) {
208
- let column = collection.columns[cell.index];
209
-
210
- if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {
211
- let substring = cell.textValue.slice(0, search.length);
212
-
213
- if (this.collator.compare(substring, search) === 0) {
214
- // If we started on a cell, end on the matching cell. Otherwise, end on the row.
215
- let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;
216
- return fromItem.type === 'cell' ? cell.key : item.key;
217
- }
218
- }
219
- }
220
-
221
- key = this.getKeyBelow(key); // Wrap around when reaching the end of the collection
222
-
223
- if (key == null && !hasWrapped) {
224
- key = this.getFirstKey();
225
- hasWrapped = true;
226
- }
227
- }
228
-
229
- return null;
230
- }
231
-
232
- }
233
-
234
- /**
235
- * Provides the behavior and accessibility implementation for a table component.
236
- * A table displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.
237
- * @param props - Props for the table.
238
- * @param state - State for the table, as returned by `useTableState`.
239
- */
240
- export function useTable(props, state) {
241
- let {
242
- ref,
243
- keyboardDelegate,
244
- isVirtualized,
245
- layout
246
- } = props; // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
247
- // When virtualized, the layout object will be passed in as a prop and override this.
248
-
249
- let collator = useCollator({
250
- usage: 'search',
251
- sensitivity: 'base'
252
- });
253
- let {
254
- direction
255
- } = useLocale();
256
- let delegate = useMemo(() => keyboardDelegate || new $dabf6db3fde4ddfaf13a80216b120e5f$export$TableKeyboardDelegate({
257
- collection: state.collection,
258
- disabledKeys: state.disabledKeys,
259
- ref,
260
- direction,
261
- collator,
262
- layout
263
- }), [keyboardDelegate, state.collection, state.disabledKeys, ref, direction, collator, layout]);
264
- let id = useId();
265
- $fd8271485d8e52f870169aca977a9c1$export$gridIds.set(state, id);
266
- let {
267
- gridProps
268
- } = useGrid(_babelRuntimeHelpersEsmExtends({}, props, {
269
- id,
270
- keyboardDelegate: delegate,
271
-
272
- getRowText(key) {
273
- let added = state.collection.getItem(key); // If the row has a textValue, use that.
274
-
275
- if (added.textValue != null) {
276
- return added.textValue;
277
- } // Otherwise combine the text of each of the row header columns.
278
-
279
-
280
- let rowHeaderColumnKeys = state.collection.rowHeaderColumnKeys;
281
-
282
- if (rowHeaderColumnKeys) {
283
- let text = [];
284
-
285
- for (let cell of added.childNodes) {
286
- let column = state.collection.columns[cell.index];
287
-
288
- if (rowHeaderColumnKeys.has(column.key) && cell.textValue) {
289
- text.push(cell.textValue);
290
- }
291
-
292
- if (text.length === rowHeaderColumnKeys.size) {
293
- break;
294
- }
295
- }
296
-
297
- return text.join(' ');
298
- }
299
-
300
- return '';
301
- }
302
-
303
- }), state); // Override to include header rows
304
-
305
- if (isVirtualized) {
306
- gridProps['aria-rowcount'] = state.collection.size + state.collection.headerRows.length;
307
- }
308
-
309
- return {
310
- gridProps
311
- };
312
- }
313
-
314
- /**
315
- * Provides the behavior and accessibility implementation for a column header in a table.
316
- * @param props - Props for the column header.
317
- * @param state - State of the table, as returned by `useTableState`.
318
- */
319
- export function useTableColumnHeader(props, state) {
320
- let {
321
- node,
322
- colspan,
323
- ref,
324
- isDisabled
325
- } = props;
326
- let {
327
- gridCellProps
328
- } = useTableCell(props, state);
329
- let {
330
- pressProps
331
- } = usePress({
332
- isDisabled: !node.props.allowsSorting || isDisabled,
333
-
334
- onPress() {
335
- state.sort(node.key);
336
- }
337
-
338
- }); // Needed to pick up the focusable context, enabling things like Tooltips for example
339
-
340
- let {
341
- focusableProps
342
- } = useFocusable({}, ref);
343
- let ariaSort = null;
344
-
345
- if (node.props.allowsSorting) {
346
- var _state$sortDescriptor;
347
-
348
- ariaSort = ((_state$sortDescriptor = state.sortDescriptor) == null ? void 0 : _state$sortDescriptor.column) === node.key ? state.sortDescriptor.direction : 'none';
349
- }
350
-
351
- return {
352
- columnHeaderProps: _babelRuntimeHelpersEsmExtends({}, mergeProps(gridCellProps, pressProps, focusableProps), {
353
- role: 'columnheader',
354
- id: $fd8271485d8e52f870169aca977a9c1$export$getColumnHeaderId(state, node.key),
355
- 'aria-colspan': colspan && colspan > 1 ? colspan : null,
356
- 'aria-sort': ariaSort
357
- })
358
- };
359
- }
360
-
361
- /**
362
- * Provides the behavior and accessibility implementation for a row in a table.
363
- * @param props - Props for the row.
364
- * @param state - State of the table, as returned by `useTableState`.
365
- */
366
- export function useTableRow(props, state) {
367
- let {
368
- node
369
- } = props;
370
- let {
371
- rowProps
372
- } = useGridRow(props, state);
373
- return {
374
- rowProps: _babelRuntimeHelpersEsmExtends({}, rowProps, {
375
- 'aria-labelledby': $fd8271485d8e52f870169aca977a9c1$export$getRowLabelledBy(state, node.key)
376
- })
377
- };
378
- }
379
-
380
- /**
381
- * Provides the behavior and accessibility implementation for a row header in a table.
382
- * @param props - Props for the row header.
383
- * @param state - State of the table, as returned by `useTableState`.
384
- */
385
- export function useTableRowHeader(props, state) {
386
- let {
387
- gridCellProps
388
- } = useTableCell(props, state);
389
- let columnKey = props.node.column.key;
390
- return {
391
- rowHeaderProps: _babelRuntimeHelpersEsmExtends({}, gridCellProps, {
392
- role: 'rowheader',
393
- id: $fd8271485d8e52f870169aca977a9c1$export$getCellId(state, props.node.parentKey, columnKey)
394
- })
395
- };
396
- }
397
-
398
- /**
399
- * Provides the behavior and accessibility implementation for a selection checkbox in a table.
400
- * @param props - Props for the selection checkbox.
401
- * @param state - State of the table, as returned by `useTableState`.
402
- */
403
- export function useTableSelectionCheckbox(props, state) {
404
- let {
405
- key,
406
- isDisabled
407
- } = props;
408
- let manager = state.selectionManager;
409
- let checkboxId = useId();
410
- let isSelected = state.selectionManager.isSelected(key) && !isDisabled;
411
-
412
- let onChange = () => manager.select(key);
413
-
414
- return {
415
- checkboxProps: {
416
- id: checkboxId,
417
- 'aria-label': 'Select',
418
- 'aria-labelledby': checkboxId + " " + $fd8271485d8e52f870169aca977a9c1$export$getRowLabelledBy(state, key),
419
- isSelected,
420
- onChange
421
- }
422
- };
423
- }
424
- /**
425
- * Provides the behavior and accessibility implementation for the select all checkbox in a table.
426
- * @param props - Props for the select all checkbox.
427
- * @param state - State of the table, as returned by `useTableState`.
428
- */
429
-
430
- export function useTableSelectAllCheckbox(state) {
431
- let {
432
- isEmpty,
433
- isSelectAll
434
- } = state.selectionManager;
435
- return {
436
- checkboxProps: {
437
- 'aria-label': 'Select All',
438
- isSelected: isSelectAll,
439
- isIndeterminate: !isEmpty && !isSelectAll,
440
- onChange: () => state.selectionManager.toggleSelectAll()
441
- }
442
- };
443
- }
33
+ export {$0047e6c294ea075f$export$6fb1613bd7b28198 as useTableRowGroup, $6e31608fbba75bab$export$25bceaac3c7e4dc7 as useTable, $f329116d8ad0aba0$export$9514819a8c81e960 as useTableColumnHeader, $b2db214c022798eb$export$7f2f6ae19e707aa5 as useTableRow, $f917ee10f4c32dab$export$1b95a7d2d517b841 as useTableHeaderRow, $7713593715703b24$export$49571c903d73624c as useTableCell, $2a795c53a101c542$export$16ea7f650bd7c1bb as useTableSelectionCheckbox, $2a795c53a101c542$export$1003db6a7e384b99 as useTableSelectAllCheckbox, $e91ef4e5004e3774$export$52994e973806c219 as useTableColumnResize};
444
34
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;;AAeO,MAAMA,+CAAO,GAAG,IAAIC,OAAJ,EAAhB;;AAEP,SAASC,iDAAT,CAAsBC,GAAtB,EAAwC;AACtC,MAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AAC3B,WAAOA,GAAG,CAACC,OAAJ,CAAY,MAAZ,EAAoB,EAApB,CAAP;AACD;;AAED,SAAO,KAAKD,GAAZ;AACD;;AAEM,SAASE,yDAAT,CAA8BC,KAA9B,EAAoDC,SAApD,EAA4E;AACjF,MAAIC,MAAM,GAAGR,+CAAO,CAACS,GAAR,CAAYH,KAAZ,CAAb;;AACA,MAAI,CAACE,MAAL,EAAa;AACX,UAAM,IAAIE,KAAJ,CAAU,cAAV,CAAN;AACD;;AAED,SAAUF,MAAV,SAAoBN,iDAAY,CAACK,SAAD,CAAhC;AACD;;AAEM,SAASI,iDAA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src/TableKeyboardDelegate.ts","./packages/@react-aria/table/src/useTable.ts","./packages/@react-aria/table/src/useTableColumnHeader.ts","./packages/@react-aria/table/src/useTableRow.ts","./packages/@react-aria/table/src/useTableRowHeader.ts","./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 {Key} from 'react';\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","/*\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 {GridKeyboardDelegate} from '@react-aria/grid';\nimport {Key} from 'react';\nimport {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 = [...startItem.childNodes][0];\n if (child) {\n return child.key;\n }\n\n let firstItem = this.collection.getItem(this.getFirstKey());\n return [...firstItem.childNodes][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 && 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 row.childNodes) {\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 = [...row.childNodes];\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\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 item.childNodes) {\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","/*\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 {GridAria, GridProps, useGrid} from '@react-aria/grid';\nimport {gridIds} from './utils';\nimport {Layout} from '@react-stately/virtualizer';\nimport {Node} from '@react-types/shared';\nimport {TableKeyboardDelegate} from './TableKeyboardDelegate';\nimport {TableState} from '@react-stately/table';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useId} from '@react-aria/utils';\nimport {useMemo} from 'react';\n\ninterface TableProps<T> extends GridProps {\n /** The layout object for the table. Computes what content is visible and how to position and style them. */\n layout?: Layout<Node<T>>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a table component.\n * A table displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n */\nexport function useTable<T>(props: TableProps<T>, state: TableState<T>): GridAria {\n let {\n ref,\n keyboardDelegate,\n isVirtualized,\n layout\n } = props;\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let delegate = useMemo(() => keyboardDelegate || new TableKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref,\n direction,\n collator,\n layout\n }), [keyboardDelegate, state.collection, state.disabledKeys, ref, direction, collator, layout]);\n\n let id = useId();\n gridIds.set(state, id);\n\n let {gridProps} = useGrid({\n ...props,\n id,\n keyboardDelegate: delegate,\n getRowText(key) {\n let added = state.collection.getItem(key);\n\n // If the row has a textValue, use that.\n if (added.textValue != null) {\n return added.textValue;\n }\n\n // Otherwise combine the text of each of the row header columns.\n let rowHeaderColumnKeys = state.collection.rowHeaderColumnKeys;\n if (rowHeaderColumnKeys) {\n let text = [];\n for (let cell of added.childNodes) {\n let column = state.collection.columns[cell.index];\n if (rowHeaderColumnKeys.has(column.key) && cell.textValue) {\n text.push(cell.textValue);\n }\n\n if (text.length === rowHeaderColumnKeys.size) {\n break;\n }\n }\n\n return text.join(' ');\n }\n\n return '';\n }\n }, state);\n\n // Override to include header rows\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size + state.collection.headerRows.length;\n }\n\n return {\n gridProps\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getColumnHeaderId} from './utils';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {mergeProps} from '@react-aria/utils';\nimport {Node} from '@react-types/shared';\nimport {TableState} from '@react-stately/table';\nimport {useFocusable} from '@react-aria/focus';\nimport {useGridCell} from '@react-aria/grid';\nimport {usePress} from '@react-aria/interactions';\n\n\ninterface ColumnHeaderProps {\n /** An object representing the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). Contains all the relevant information that makes up the column header. */\n node: Node<unknown>,\n /** The ref attached to the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader). */\n ref: RefObject<HTMLElement>,\n /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** The number of columns the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) should span. */\n colspan?: number,\n /** Whether the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) is disabled. */\n isDisabled?: boolean\n}\n\ninterface ColumnHeaderAria {\n /** Props for the [column header](https://www.w3.org/TR/wai-aria-1.1/#columnheader) element. */\n columnHeaderProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a column header in a table.\n * @param props - Props for the column header.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableColumnHeader<T>(props: ColumnHeaderProps, state: TableState<T>): ColumnHeaderAria {\n let {node, colspan, ref, isDisabled} = props;\n let {gridCellProps} = useGridCell(props, state);\n\n let {pressProps} = usePress({\n isDisabled: !node.props.allowsSorting || isDisabled,\n onPress() {\n state.sort(node.key);\n }\n });\n\n // Needed to pick up the focusable context, enabling things like Tooltips for example\n let {focusableProps} = useFocusable({}, ref);\n let ariaSort: HTMLAttributes<HTMLElement>['aria-sort'] = null;\n if (node.props.allowsSorting) {\n ariaSort = state.sortDescriptor?.column === node.key ? state.sortDescriptor.direction : 'none';\n }\n\n return {\n columnHeaderProps: {\n ...mergeProps(gridCellProps, pressProps, focusableProps),\n role: 'columnheader',\n id: getColumnHeaderId(state, node.key),\n 'aria-colspan': colspan && colspan > 1 ? colspan : null,\n 'aria-sort': ariaSort\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getRowLabelledBy} from './utils';\nimport {GridRowAria, GridRowProps, useGridRow} from '@react-aria/grid';\nimport {TableCollection} from '@react-types/table';\nimport {TableState} from '@react-stately/table';\n\n/**\n * Provides the behavior and accessibility implementation for a row in a table.\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRow<T>(props: GridRowProps<T>, state: TableState<T>): GridRowAria {\n let {node} = props;\n let {rowProps} = useGridRow<T, TableCollection<T>, TableState<T>>(props, state);\n return {\n rowProps: {\n ...rowProps,\n 'aria-labelledby': getRowLabelledBy(state, node.key)\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getCellId} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {HTMLAttributes, RefObject} from 'react';\nimport {TableState} from '@react-stately/table';\nimport {useGridCell} from '@react-aria/grid';\n\ninterface RowHeaderProps {\n /** An object representing the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader). Contains all the relevant information that makes up the row header. */\n node: GridNode<unknown>,\n /** The ref attached to the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader). */\n ref: RefObject<HTMLElement>,\n /** Whether the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) is disabled. */\n isDisabled?: boolean\n}\n\ninterface RowHeaderAria {\n /** Props for the [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) element. */\n rowHeaderProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a row header in a table.\n * @param props - Props for the row header.\n * @param state - State of the table, as returned by `useTableState`.\n */\nexport function useTableRowHeader<T>(props: RowHeaderProps, state: TableState<T>): RowHeaderAria {\n let {gridCellProps} = useGridCell(props, state);\n\n let columnKey = props.node.column.key;\n return {\n rowHeaderProps: {\n ...gridCellProps,\n role: 'rowheader',\n id: getCellId(state, props.node.parentKey, columnKey)\n }\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCheckboxProps} from '@react-types/checkbox';\nimport {getRowLabelledBy} from './utils';\nimport {Key} from 'react';\nimport {TableState} from '@react-stately/table';\nimport {useId} from '@react-aria/utils';\n\ninterface SelectionCheckboxProps {\n /** A unique key for the checkbox. */\n key: Key,\n /** Whether the checkbox is disabled. */\n isDisabled?: boolean\n}\n\ninterface SelectionCheckboxAria {\n /** Props for the row selection checkbox element. */\n checkboxProps: AriaCheckboxProps\n}\n\ninterface SelectAllCheckboxAria {\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: SelectionCheckboxProps, state: TableState<T>): SelectionCheckboxAria {\n let {\n key,\n isDisabled\n } = props;\n\n let manager = state.selectionManager;\n let checkboxId = useId();\n let isSelected = state.selectionManager.isSelected(key) && !isDisabled;\n\n let onChange = () => manager.select(key);\n\n return {\n checkboxProps: {\n id: checkboxId,\n 'aria-label': 'Select',\n 'aria-labelledby': `${checkboxId} ${getRowLabelledBy(state, key)}`,\n isSelected,\n onChange\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>): SelectAllCheckboxAria {\n let {isEmpty, isSelectAll} = state.selectionManager;\n return {\n checkboxProps: {\n 'aria-label': 'Select All',\n isSelected: isSelectAll,\n isIndeterminate: !isEmpty && !isSelectAll,\n onChange: () => state.selectionManager.toggleSelectAll()\n }\n };\n}\n"],"names":["gridIds","WeakMap","normalizeKey","key","replace","getColumnHeaderId","state","columnKey","gridId","get","Error","getCellId","rowKey","getRowLabelledBy","collection","rowHeaderColumnKeys","map","join","TableKeyboardDelegate","GridKeyboardDelegate","isCell","node","type","getKeyBelow","startItem","getItem","child","childNodes","firstItem","getFirstKey","index","getKeyAbove","parent","parentKey","superKey","columns","findNextColumnKey","column","findNextKey","item","row","headerRows","level","findPreviousColumnKey","findPreviousKey","i","length","getKeyRightOf","direction","getKeyLeftOf","getKeyForSearch","search","fromKey","collator","hasWrapped","cell","has","textValue","substring","slice","compare","fromItem","useTable","props","ref","keyboardDelegate","isVirtualized","layout","useCollator","usage","sensitivity","useLocale","delegate","useMemo","disabledKeys","id","useId","set","gridProps","useGrid","getRowText","added","text","push","size","useTableColumnHeader","colspan","isDisabled","gridCellProps","useGridCell","pressProps","usePress","allowsSorting","onPress","sort","focusableProps","useFocusable","ariaSort","sortDescriptor","columnHeaderProps","mergeProps","role","useTableRow","rowProps","useGridRow","useTableRowHeader","rowHeaderProps","useTableSelectionCheckbox","manager","selectionManager","checkboxId","isSelected","onChange","select","checkboxProps","useTableSelectAllCheckbox","isEmpty","isSelectAll","isIndeterminate","toggleSelectAll"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaM,SAAS;IACd,OAAO,CAAA,GAAA,sBAAc;AACvB","sources":["packages/@react-aria/table/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTable} from './useTable';\nexport {useTableColumnHeader} from './useTableColumnHeader';\nexport {useTableRow} from './useTableRow';\nexport {useTableHeaderRow} from './useTableHeaderRow';\nexport {useTableCell} from './useTableCell';\nexport {useTableSelectionCheckbox, useTableSelectAllCheckbox} from './useTableSelectionCheckbox';\nexport {useTableColumnResize} from './useTableColumnResize';\n\n// Workaround for a Parcel bug where re-exports don't work in the CommonJS output format...\n// export {useGridRowGroup as useTableRowGroup} from '@react-aria/grid';\nimport {GridRowGroupAria, useGridRowGroup} from '@react-aria/grid';\nexport function useTableRowGroup(): GridRowGroupAria {\n return useGridRowGroup();\n}\n\nexport type {AriaTableProps} from './useTable';\nexport type {GridAria, GridRowAria, GridRowProps} from '@react-aria/grid';\nexport type {AriaTableColumnHeaderProps, TableColumnHeaderAria} from './useTableColumnHeader';\nexport type {AriaTableCellProps, TableCellAria} from './useTableCell';\nexport type {TableHeaderRowAria} from './useTableHeaderRow';\nexport type {AriaTableSelectionCheckboxProps, TableSelectionCheckboxAria, TableSelectAllCheckboxAria} from './useTableSelectionCheckbox';\nexport type {AriaTableColumnResizeProps, TableColumnResizeAria} from './useTableColumnResize';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ "ascending": `stigende`,
3
+ "ascendingSort": (args)=>`sortert etter kolonne ${args.columnName} i stigende rekkef\xf8lge`,
4
+ "columnSize": (args)=>`${args.value} piksler`,
5
+ "descending": `synkende`,
6
+ "descendingSort": (args)=>`sortert etter kolonne ${args.columnName} i synkende rekkef\xf8lge`,
7
+ "resizerDescription": `Trykk p\xe5 Enter for \xe5 starte st\xf8rrelsesendring`,
8
+ "select": `Velg`,
9
+ "selectAll": `Velg alle`,
10
+ "sortable": `kolonne som kan sorteres`
11
+ };
12
+
13
+
14
+ //# sourceMappingURL=nb-NO.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,QAAQ,CAAC;IACzC,iBAAiB,CAAC,OAAS,CAAC,sBAAsB,EAAE,KAAK,UAAU,CAAC,yBAAsB,CAAC;IAC3F,cAAc,CAAC,OAAS,CAAC,EAAE,KAAK,KAAK,CAAC,QAAQ,CAAC;IAC/C,cAAc,CAAC,QAAQ,CAAC;IACxB,kBAAkB,CAAC,OAAS,CAAC,sBAAsB,EAAE,KAAK,UAAU,CAAC,yBAAsB,CAAC;IAC5F,sBAAsB,CAAC,sDAA6C,CAAC;IACrE,UAAU,CAAC,IAAI,CAAC;IAChB,aAAa,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,wBAAwB,CAAC;AACxC","sources":["packages/@react-aria/table/intl/nb-NO.json"],"sourcesContent":["{\n \"ascending\": \"stigende\",\n \"ascendingSort\": \"sortert etter kolonne {columnName} i stigende rekkefølge\",\n \"columnSize\": \"{value} piksler\",\n \"descending\": \"synkende\",\n \"descendingSort\": \"sortert etter kolonne {columnName} i synkende rekkefølge\",\n \"resizerDescription\": \"Trykk på Enter for å starte størrelsesendring\",\n \"select\": \"Velg\",\n \"selectAll\": \"Velg alle\",\n \"sortable\": \"kolonne som kan sorteres\"\n}\n"],"names":[],"version":3,"file":"nb-NO.main.js.map"}