@react-aria/table 3.17.10 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/dist/import.mjs +2 -19
  2. package/dist/main.js +10 -27
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +2 -19
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +4 -0
  7. package/package.json +15 -25
  8. package/src/index.ts +4 -21
  9. package/dist/TableKeyboardDelegate.main.js +0 -142
  10. package/dist/TableKeyboardDelegate.main.js.map +0 -1
  11. package/dist/TableKeyboardDelegate.mjs +0 -137
  12. package/dist/TableKeyboardDelegate.module.js +0 -137
  13. package/dist/TableKeyboardDelegate.module.js.map +0 -1
  14. package/dist/ar-AE.main.js +0 -14
  15. package/dist/ar-AE.main.js.map +0 -1
  16. package/dist/ar-AE.mjs +0 -16
  17. package/dist/ar-AE.module.js +0 -16
  18. package/dist/ar-AE.module.js.map +0 -1
  19. package/dist/bg-BG.main.js +0 -14
  20. package/dist/bg-BG.main.js.map +0 -1
  21. package/dist/bg-BG.mjs +0 -16
  22. package/dist/bg-BG.module.js +0 -16
  23. package/dist/bg-BG.module.js.map +0 -1
  24. package/dist/cs-CZ.main.js +0 -14
  25. package/dist/cs-CZ.main.js.map +0 -1
  26. package/dist/cs-CZ.mjs +0 -16
  27. package/dist/cs-CZ.module.js +0 -16
  28. package/dist/cs-CZ.module.js.map +0 -1
  29. package/dist/da-DK.main.js +0 -14
  30. package/dist/da-DK.main.js.map +0 -1
  31. package/dist/da-DK.mjs +0 -16
  32. package/dist/da-DK.module.js +0 -16
  33. package/dist/da-DK.module.js.map +0 -1
  34. package/dist/de-DE.main.js +0 -14
  35. package/dist/de-DE.main.js.map +0 -1
  36. package/dist/de-DE.mjs +0 -16
  37. package/dist/de-DE.module.js +0 -16
  38. package/dist/de-DE.module.js.map +0 -1
  39. package/dist/el-GR.main.js +0 -14
  40. package/dist/el-GR.main.js.map +0 -1
  41. package/dist/el-GR.mjs +0 -16
  42. package/dist/el-GR.module.js +0 -16
  43. package/dist/el-GR.module.js.map +0 -1
  44. package/dist/en-US.main.js +0 -14
  45. package/dist/en-US.main.js.map +0 -1
  46. package/dist/en-US.mjs +0 -16
  47. package/dist/en-US.module.js +0 -16
  48. package/dist/en-US.module.js.map +0 -1
  49. package/dist/es-ES.main.js +0 -14
  50. package/dist/es-ES.main.js.map +0 -1
  51. package/dist/es-ES.mjs +0 -16
  52. package/dist/es-ES.module.js +0 -16
  53. package/dist/es-ES.module.js.map +0 -1
  54. package/dist/et-EE.main.js +0 -14
  55. package/dist/et-EE.main.js.map +0 -1
  56. package/dist/et-EE.mjs +0 -16
  57. package/dist/et-EE.module.js +0 -16
  58. package/dist/et-EE.module.js.map +0 -1
  59. package/dist/fi-FI.main.js +0 -14
  60. package/dist/fi-FI.main.js.map +0 -1
  61. package/dist/fi-FI.mjs +0 -16
  62. package/dist/fi-FI.module.js +0 -16
  63. package/dist/fi-FI.module.js.map +0 -1
  64. package/dist/fr-FR.main.js +0 -14
  65. package/dist/fr-FR.main.js.map +0 -1
  66. package/dist/fr-FR.mjs +0 -16
  67. package/dist/fr-FR.module.js +0 -16
  68. package/dist/fr-FR.module.js.map +0 -1
  69. package/dist/he-IL.main.js +0 -14
  70. package/dist/he-IL.main.js.map +0 -1
  71. package/dist/he-IL.mjs +0 -16
  72. package/dist/he-IL.module.js +0 -16
  73. package/dist/he-IL.module.js.map +0 -1
  74. package/dist/hr-HR.main.js +0 -14
  75. package/dist/hr-HR.main.js.map +0 -1
  76. package/dist/hr-HR.mjs +0 -16
  77. package/dist/hr-HR.module.js +0 -16
  78. package/dist/hr-HR.module.js.map +0 -1
  79. package/dist/hu-HU.main.js +0 -14
  80. package/dist/hu-HU.main.js.map +0 -1
  81. package/dist/hu-HU.mjs +0 -16
  82. package/dist/hu-HU.module.js +0 -16
  83. package/dist/hu-HU.module.js.map +0 -1
  84. package/dist/intlStrings.main.js +0 -108
  85. package/dist/intlStrings.main.js.map +0 -1
  86. package/dist/intlStrings.mjs +0 -110
  87. package/dist/intlStrings.module.js +0 -110
  88. package/dist/intlStrings.module.js.map +0 -1
  89. package/dist/it-IT.main.js +0 -14
  90. package/dist/it-IT.main.js.map +0 -1
  91. package/dist/it-IT.mjs +0 -16
  92. package/dist/it-IT.module.js +0 -16
  93. package/dist/it-IT.module.js.map +0 -1
  94. package/dist/ja-JP.main.js +0 -14
  95. package/dist/ja-JP.main.js.map +0 -1
  96. package/dist/ja-JP.mjs +0 -16
  97. package/dist/ja-JP.module.js +0 -16
  98. package/dist/ja-JP.module.js.map +0 -1
  99. package/dist/ko-KR.main.js +0 -14
  100. package/dist/ko-KR.main.js.map +0 -1
  101. package/dist/ko-KR.mjs +0 -16
  102. package/dist/ko-KR.module.js +0 -16
  103. package/dist/ko-KR.module.js.map +0 -1
  104. package/dist/lt-LT.main.js +0 -14
  105. package/dist/lt-LT.main.js.map +0 -1
  106. package/dist/lt-LT.mjs +0 -16
  107. package/dist/lt-LT.module.js +0 -16
  108. package/dist/lt-LT.module.js.map +0 -1
  109. package/dist/lv-LV.main.js +0 -14
  110. package/dist/lv-LV.main.js.map +0 -1
  111. package/dist/lv-LV.mjs +0 -16
  112. package/dist/lv-LV.module.js +0 -16
  113. package/dist/lv-LV.module.js.map +0 -1
  114. package/dist/nb-NO.main.js +0 -14
  115. package/dist/nb-NO.main.js.map +0 -1
  116. package/dist/nb-NO.mjs +0 -16
  117. package/dist/nb-NO.module.js +0 -16
  118. package/dist/nb-NO.module.js.map +0 -1
  119. package/dist/nl-NL.main.js +0 -14
  120. package/dist/nl-NL.main.js.map +0 -1
  121. package/dist/nl-NL.mjs +0 -16
  122. package/dist/nl-NL.module.js +0 -16
  123. package/dist/nl-NL.module.js.map +0 -1
  124. package/dist/pl-PL.main.js +0 -14
  125. package/dist/pl-PL.main.js.map +0 -1
  126. package/dist/pl-PL.mjs +0 -16
  127. package/dist/pl-PL.module.js +0 -16
  128. package/dist/pl-PL.module.js.map +0 -1
  129. package/dist/pt-BR.main.js +0 -14
  130. package/dist/pt-BR.main.js.map +0 -1
  131. package/dist/pt-BR.mjs +0 -16
  132. package/dist/pt-BR.module.js +0 -16
  133. package/dist/pt-BR.module.js.map +0 -1
  134. package/dist/pt-PT.main.js +0 -14
  135. package/dist/pt-PT.main.js.map +0 -1
  136. package/dist/pt-PT.mjs +0 -16
  137. package/dist/pt-PT.module.js +0 -16
  138. package/dist/pt-PT.module.js.map +0 -1
  139. package/dist/ro-RO.main.js +0 -14
  140. package/dist/ro-RO.main.js.map +0 -1
  141. package/dist/ro-RO.mjs +0 -16
  142. package/dist/ro-RO.module.js +0 -16
  143. package/dist/ro-RO.module.js.map +0 -1
  144. package/dist/ru-RU.main.js +0 -14
  145. package/dist/ru-RU.main.js.map +0 -1
  146. package/dist/ru-RU.mjs +0 -16
  147. package/dist/ru-RU.module.js +0 -16
  148. package/dist/ru-RU.module.js.map +0 -1
  149. package/dist/sk-SK.main.js +0 -14
  150. package/dist/sk-SK.main.js.map +0 -1
  151. package/dist/sk-SK.mjs +0 -16
  152. package/dist/sk-SK.module.js +0 -16
  153. package/dist/sk-SK.module.js.map +0 -1
  154. package/dist/sl-SI.main.js +0 -14
  155. package/dist/sl-SI.main.js.map +0 -1
  156. package/dist/sl-SI.mjs +0 -16
  157. package/dist/sl-SI.module.js +0 -16
  158. package/dist/sl-SI.module.js.map +0 -1
  159. package/dist/sr-SP.main.js +0 -14
  160. package/dist/sr-SP.main.js.map +0 -1
  161. package/dist/sr-SP.mjs +0 -16
  162. package/dist/sr-SP.module.js +0 -16
  163. package/dist/sr-SP.module.js.map +0 -1
  164. package/dist/sv-SE.main.js +0 -14
  165. package/dist/sv-SE.main.js.map +0 -1
  166. package/dist/sv-SE.mjs +0 -16
  167. package/dist/sv-SE.module.js +0 -16
  168. package/dist/sv-SE.module.js.map +0 -1
  169. package/dist/tr-TR.main.js +0 -14
  170. package/dist/tr-TR.main.js.map +0 -1
  171. package/dist/tr-TR.mjs +0 -16
  172. package/dist/tr-TR.module.js +0 -16
  173. package/dist/tr-TR.module.js.map +0 -1
  174. package/dist/types.d.ts +0 -157
  175. package/dist/types.d.ts.map +0 -1
  176. package/dist/uk-UA.main.js +0 -14
  177. package/dist/uk-UA.main.js.map +0 -1
  178. package/dist/uk-UA.mjs +0 -16
  179. package/dist/uk-UA.module.js +0 -16
  180. package/dist/uk-UA.module.js.map +0 -1
  181. package/dist/useTable.main.js +0 -114
  182. package/dist/useTable.main.js.map +0 -1
  183. package/dist/useTable.mjs +0 -109
  184. package/dist/useTable.module.js +0 -109
  185. package/dist/useTable.module.js.map +0 -1
  186. package/dist/useTableCell.main.js +0 -37
  187. package/dist/useTableCell.main.js.map +0 -1
  188. package/dist/useTableCell.mjs +0 -32
  189. package/dist/useTableCell.module.js +0 -32
  190. package/dist/useTableCell.module.js.map +0 -1
  191. package/dist/useTableColumnHeader.main.js +0 -92
  192. package/dist/useTableColumnHeader.main.js.map +0 -1
  193. package/dist/useTableColumnHeader.mjs +0 -87
  194. package/dist/useTableColumnHeader.module.js +0 -87
  195. package/dist/useTableColumnHeader.module.js.map +0 -1
  196. package/dist/useTableColumnResize.main.js +0 -226
  197. package/dist/useTableColumnResize.main.js.map +0 -1
  198. package/dist/useTableColumnResize.mjs +0 -221
  199. package/dist/useTableColumnResize.module.js +0 -221
  200. package/dist/useTableColumnResize.module.js.map +0 -1
  201. package/dist/useTableHeaderRow.main.js +0 -32
  202. package/dist/useTableHeaderRow.main.js.map +0 -1
  203. package/dist/useTableHeaderRow.mjs +0 -27
  204. package/dist/useTableHeaderRow.module.js +0 -27
  205. package/dist/useTableHeaderRow.module.js.map +0 -1
  206. package/dist/useTableRow.main.js +0 -82
  207. package/dist/useTableRow.main.js.map +0 -1
  208. package/dist/useTableRow.mjs +0 -77
  209. package/dist/useTableRow.module.js +0 -77
  210. package/dist/useTableRow.module.js.map +0 -1
  211. package/dist/useTableSelectionCheckbox.main.js +0 -56
  212. package/dist/useTableSelectionCheckbox.main.js.map +0 -1
  213. package/dist/useTableSelectionCheckbox.mjs +0 -50
  214. package/dist/useTableSelectionCheckbox.module.js +0 -50
  215. package/dist/useTableSelectionCheckbox.module.js.map +0 -1
  216. package/dist/utils.main.js +0 -43
  217. package/dist/utils.main.js.map +0 -1
  218. package/dist/utils.mjs +0 -35
  219. package/dist/utils.module.js +0 -35
  220. package/dist/utils.module.js.map +0 -1
  221. package/dist/zh-CN.main.js +0 -14
  222. package/dist/zh-CN.main.js.map +0 -1
  223. package/dist/zh-CN.mjs +0 -16
  224. package/dist/zh-CN.module.js +0 -16
  225. package/dist/zh-CN.module.js.map +0 -1
  226. package/dist/zh-TW.main.js +0 -14
  227. package/dist/zh-TW.main.js.map +0 -1
  228. package/dist/zh-TW.mjs +0 -16
  229. package/dist/zh-TW.module.js +0 -16
  230. package/dist/zh-TW.module.js.map +0 -1
  231. package/src/TableKeyboardDelegate.ts +0 -214
  232. package/src/useTable.ts +0 -123
  233. package/src/useTableCell.ts +0 -59
  234. package/src/useTableColumnHeader.ts +0 -108
  235. package/src/useTableColumnResize.ts +0 -277
  236. package/src/useTableHeaderRow.ts +0 -42
  237. package/src/useTableRow.ts +0 -86
  238. package/src/useTableSelectionCheckbox.ts +0 -72
  239. package/src/utils.ts +0 -49
@@ -1,56 +0,0 @@
1
- var $6acf696f746f932c$exports = require("./utils.main.js");
2
- var $7ff3f66df3873a5e$exports = require("./intlStrings.main.js");
3
- var $jX14I$reactariagrid = require("@react-aria/grid");
4
- var $jX14I$reactariai18n = require("@react-aria/i18n");
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
-
11
- function $parcel$export(e, n, v, s) {
12
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
- }
14
-
15
- $parcel$export(module.exports, "useTableSelectionCheckbox", () => $0b394e4562ac57c9$export$16ea7f650bd7c1bb);
16
- $parcel$export(module.exports, "useTableSelectAllCheckbox", () => $0b394e4562ac57c9$export$1003db6a7e384b99);
17
- /*
18
- * Copyright 2020 Adobe. All rights reserved.
19
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
- * you may not use this file except in compliance with the License. You may obtain a copy
21
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software distributed under
24
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
- * OF ANY KIND, either express or implied. See the License for the specific language
26
- * governing permissions and limitations under the License.
27
- */
28
-
29
-
30
-
31
- function $0b394e4562ac57c9$export$16ea7f650bd7c1bb(props, state) {
32
- let { key: key } = props;
33
- const { checkboxProps: checkboxProps } = (0, $jX14I$reactariagrid.useGridSelectionCheckbox)(props, state);
34
- return {
35
- checkboxProps: {
36
- ...checkboxProps,
37
- 'aria-labelledby': `${checkboxProps.id} ${(0, $6acf696f746f932c$exports.getRowLabelledBy)(state, key)}`
38
- }
39
- };
40
- }
41
- function $0b394e4562ac57c9$export$1003db6a7e384b99(state) {
42
- let { isEmpty: isEmpty, isSelectAll: isSelectAll, selectionMode: selectionMode } = state.selectionManager;
43
- const stringFormatter = (0, $jX14I$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7ff3f66df3873a5e$exports))), '@react-aria/table');
44
- return {
45
- checkboxProps: {
46
- 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
47
- isSelected: isSelectAll,
48
- isDisabled: selectionMode !== 'multiple' || state.collection.size === 0 || state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader',
49
- isIndeterminate: !isEmpty && !isSelectAll,
50
- onChange: ()=>state.selectionManager.toggleSelectAll()
51
- }
52
- };
53
- }
54
-
55
-
56
- //# sourceMappingURL=useTableSelectionCheckbox.main.js.map
@@ -1 +0,0 @@
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"}
@@ -1,50 +0,0 @@
1
- import {getRowLabelledBy as $2140fb2337097f2d$export$85069b70317f543} from "./utils.mjs";
2
- import $iIuaM$intlStringsmodulejs from "./intlStrings.mjs";
3
- import {useGridSelectionCheckbox as $iIuaM$useGridSelectionCheckbox} from "@react-aria/grid";
4
- import {useLocalizedStringFormatter as $iIuaM$useLocalizedStringFormatter} from "@react-aria/i18n";
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
- function $2a795c53a101c542$export$16ea7f650bd7c1bb(props, state) {
25
- let { key: key } = props;
26
- const { checkboxProps: checkboxProps } = (0, $iIuaM$useGridSelectionCheckbox)(props, state);
27
- return {
28
- checkboxProps: {
29
- ...checkboxProps,
30
- 'aria-labelledby': `${checkboxProps.id} ${(0, $2140fb2337097f2d$export$85069b70317f543)(state, key)}`
31
- }
32
- };
33
- }
34
- function $2a795c53a101c542$export$1003db6a7e384b99(state) {
35
- let { isEmpty: isEmpty, isSelectAll: isSelectAll, selectionMode: selectionMode } = state.selectionManager;
36
- const stringFormatter = (0, $iIuaM$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iIuaM$intlStringsmodulejs))), '@react-aria/table');
37
- return {
38
- checkboxProps: {
39
- 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
40
- isSelected: isSelectAll,
41
- isDisabled: selectionMode !== 'multiple' || state.collection.size === 0 || state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader',
42
- isIndeterminate: !isEmpty && !isSelectAll,
43
- onChange: ()=>state.selectionManager.toggleSelectAll()
44
- }
45
- };
46
- }
47
-
48
-
49
- export {$2a795c53a101c542$export$16ea7f650bd7c1bb as useTableSelectionCheckbox, $2a795c53a101c542$export$1003db6a7e384b99 as useTableSelectAllCheckbox};
50
- //# sourceMappingURL=useTableSelectionCheckbox.module.js.map
@@ -1,50 +0,0 @@
1
- import {getRowLabelledBy as $2140fb2337097f2d$export$85069b70317f543} from "./utils.module.js";
2
- import $iIuaM$intlStringsmodulejs from "./intlStrings.module.js";
3
- import {useGridSelectionCheckbox as $iIuaM$useGridSelectionCheckbox} from "@react-aria/grid";
4
- import {useLocalizedStringFormatter as $iIuaM$useLocalizedStringFormatter} from "@react-aria/i18n";
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
- function $2a795c53a101c542$export$16ea7f650bd7c1bb(props, state) {
25
- let { key: key } = props;
26
- const { checkboxProps: checkboxProps } = (0, $iIuaM$useGridSelectionCheckbox)(props, state);
27
- return {
28
- checkboxProps: {
29
- ...checkboxProps,
30
- 'aria-labelledby': `${checkboxProps.id} ${(0, $2140fb2337097f2d$export$85069b70317f543)(state, key)}`
31
- }
32
- };
33
- }
34
- function $2a795c53a101c542$export$1003db6a7e384b99(state) {
35
- let { isEmpty: isEmpty, isSelectAll: isSelectAll, selectionMode: selectionMode } = state.selectionManager;
36
- const stringFormatter = (0, $iIuaM$useLocalizedStringFormatter)((0, ($parcel$interopDefault($iIuaM$intlStringsmodulejs))), '@react-aria/table');
37
- return {
38
- checkboxProps: {
39
- 'aria-label': stringFormatter.format(selectionMode === 'single' ? 'select' : 'selectAll'),
40
- isSelected: isSelectAll,
41
- isDisabled: selectionMode !== 'multiple' || state.collection.size === 0 || state.collection.rows.length === 1 && state.collection.rows[0].type === 'loader',
42
- isIndeterminate: !isEmpty && !isSelectAll,
43
- onChange: ()=>state.selectionManager.toggleSelectAll()
44
- }
45
- };
46
- }
47
-
48
-
49
- export {$2a795c53a101c542$export$16ea7f650bd7c1bb as useTableSelectionCheckbox, $2a795c53a101c542$export$1003db6a7e384b99 as useTableSelectAllCheckbox};
50
- //# sourceMappingURL=useTableSelectionCheckbox.module.js.map
@@ -1 +0,0 @@
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"}
@@ -1,43 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "gridIds", () => $6acf696f746f932c$export$552312adfd451dab);
7
- $parcel$export(module.exports, "getColumnHeaderId", () => $6acf696f746f932c$export$37cd4213f2ad742e);
8
- $parcel$export(module.exports, "getCellId", () => $6acf696f746f932c$export$19baff3266315d44);
9
- $parcel$export(module.exports, "getRowLabelledBy", () => $6acf696f746f932c$export$85069b70317f543);
10
- /*
11
- * Copyright 2020 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */ const $6acf696f746f932c$export$552312adfd451dab = new WeakMap();
21
- function $6acf696f746f932c$var$normalizeKey(key) {
22
- if (typeof key === 'string') return key.replace(/\s*/g, '');
23
- return '' + key;
24
- }
25
- function $6acf696f746f932c$export$37cd4213f2ad742e(state, columnKey) {
26
- let gridId = $6acf696f746f932c$export$552312adfd451dab.get(state);
27
- if (!gridId) throw new Error('Unknown grid');
28
- return `${gridId}-${$6acf696f746f932c$var$normalizeKey(columnKey)}`;
29
- }
30
- function $6acf696f746f932c$export$19baff3266315d44(state, rowKey, columnKey) {
31
- let gridId = $6acf696f746f932c$export$552312adfd451dab.get(state);
32
- if (!gridId) throw new Error('Unknown grid');
33
- return `${gridId}-${$6acf696f746f932c$var$normalizeKey(rowKey)}-${$6acf696f746f932c$var$normalizeKey(columnKey)}`;
34
- }
35
- function $6acf696f746f932c$export$85069b70317f543(state, rowKey) {
36
- // A row is labelled by it's row headers.
37
- return [
38
- ...state.collection.rowHeaderColumnKeys
39
- ].map((columnKey)=>$6acf696f746f932c$export$19baff3266315d44(state, rowKey, columnKey)).join(' ');
40
- }
41
-
42
-
43
- //# sourceMappingURL=utils.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAgD,IAAI;AAEjE,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: WeakMap<TableState<unknown>, string> = 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.mjs DELETED
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ const $2140fb2337097f2d$export$552312adfd451dab = new WeakMap();
12
- function $2140fb2337097f2d$var$normalizeKey(key) {
13
- if (typeof key === 'string') return key.replace(/\s*/g, '');
14
- return '' + key;
15
- }
16
- function $2140fb2337097f2d$export$37cd4213f2ad742e(state, columnKey) {
17
- let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
18
- if (!gridId) throw new Error('Unknown grid');
19
- return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
20
- }
21
- function $2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey) {
22
- let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
23
- if (!gridId) throw new Error('Unknown grid');
24
- return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(rowKey)}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
25
- }
26
- function $2140fb2337097f2d$export$85069b70317f543(state, rowKey) {
27
- // A row is labelled by it's row headers.
28
- return [
29
- ...state.collection.rowHeaderColumnKeys
30
- ].map((columnKey)=>$2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey)).join(' ');
31
- }
32
-
33
-
34
- export {$2140fb2337097f2d$export$552312adfd451dab as gridIds, $2140fb2337097f2d$export$37cd4213f2ad742e as getColumnHeaderId, $2140fb2337097f2d$export$19baff3266315d44 as getCellId, $2140fb2337097f2d$export$85069b70317f543 as getRowLabelledBy};
35
- //# sourceMappingURL=utils.module.js.map
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ const $2140fb2337097f2d$export$552312adfd451dab = new WeakMap();
12
- function $2140fb2337097f2d$var$normalizeKey(key) {
13
- if (typeof key === 'string') return key.replace(/\s*/g, '');
14
- return '' + key;
15
- }
16
- function $2140fb2337097f2d$export$37cd4213f2ad742e(state, columnKey) {
17
- let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
18
- if (!gridId) throw new Error('Unknown grid');
19
- return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
20
- }
21
- function $2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey) {
22
- let gridId = $2140fb2337097f2d$export$552312adfd451dab.get(state);
23
- if (!gridId) throw new Error('Unknown grid');
24
- return `${gridId}-${$2140fb2337097f2d$var$normalizeKey(rowKey)}-${$2140fb2337097f2d$var$normalizeKey(columnKey)}`;
25
- }
26
- function $2140fb2337097f2d$export$85069b70317f543(state, rowKey) {
27
- // A row is labelled by it's row headers.
28
- return [
29
- ...state.collection.rowHeaderColumnKeys
30
- ].map((columnKey)=>$2140fb2337097f2d$export$19baff3266315d44(state, rowKey, columnKey)).join(' ');
31
- }
32
-
33
-
34
- export {$2140fb2337097f2d$export$552312adfd451dab as gridIds, $2140fb2337097f2d$export$37cd4213f2ad742e as getColumnHeaderId, $2140fb2337097f2d$export$19baff3266315d44 as getCellId, $2140fb2337097f2d$export$85069b70317f543 as getRowLabelledBy};
35
- //# sourceMappingURL=utils.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAKM,MAAM,4CAAgD,IAAI;AAEjE,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: WeakMap<TableState<unknown>, string> = 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"}
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- "ascending": `\u{5347}\u{5E8F}`,
3
- "ascendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,
4
- "columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
5
- "descending": `\u{964D}\u{5E8F}`,
6
- "descendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,
7
- "resizerDescription": `\u{6309}\u{201C}\u{8F93}\u{5165}\u{201D}\u{952E}\u{5F00}\u{59CB}\u{8C03}\u{6574}\u{5927}\u{5C0F}\u{3002}`,
8
- "select": `\u{9009}\u{62E9}`,
9
- "selectAll": `\u{5168}\u{9009}`,
10
- "sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{5217}`
11
- };
12
-
13
-
14
- //# sourceMappingURL=zh-CN.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACvD,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACxD,sBAAsB,CAAC,wGAAa,CAAC;IACrC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-CN.json"],"sourcesContent":["{\n \"ascending\": \"升序\",\n \"ascendingSort\": \"按列 {columnName} 升序排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"降序\",\n \"descendingSort\": \"按列 {columnName} 降序排序\",\n \"resizerDescription\": \"按“输入”键开始调整大小。\",\n \"select\": \"选择\",\n \"selectAll\": \"全选\",\n \"sortable\": \"可排序的列\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
package/dist/zh-CN.mjs DELETED
@@ -1,16 +0,0 @@
1
- var $1648ec00941567f3$exports = {};
2
- $1648ec00941567f3$exports = {
3
- "ascending": `\u{5347}\u{5E8F}`,
4
- "ascendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,
5
- "columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
6
- "descending": `\u{964D}\u{5E8F}`,
7
- "descendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,
8
- "resizerDescription": `\u{6309}\u{201C}\u{8F93}\u{5165}\u{201D}\u{952E}\u{5F00}\u{59CB}\u{8C03}\u{6574}\u{5927}\u{5C0F}\u{3002}`,
9
- "select": `\u{9009}\u{62E9}`,
10
- "selectAll": `\u{5168}\u{9009}`,
11
- "sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{5217}`
12
- };
13
-
14
-
15
- export {$1648ec00941567f3$exports as default};
16
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1,16 +0,0 @@
1
- var $1648ec00941567f3$exports = {};
2
- $1648ec00941567f3$exports = {
3
- "ascending": `\u{5347}\u{5E8F}`,
4
- "ascendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,
5
- "columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
6
- "descending": `\u{964D}\u{5E8F}`,
7
- "descendingSort": (args)=>`\u{6309}\u{5217} ${args.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,
8
- "resizerDescription": `\u{6309}\u{201C}\u{8F93}\u{5165}\u{201D}\u{952E}\u{5F00}\u{59CB}\u{8C03}\u{6574}\u{5927}\u{5C0F}\u{3002}`,
9
- "select": `\u{9009}\u{62E9}`,
10
- "selectAll": `\u{5168}\u{9009}`,
11
- "sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{5217}`
12
- };
13
-
14
-
15
- export {$1648ec00941567f3$exports as default};
16
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACvD,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACxD,sBAAsB,CAAC,wGAAa,CAAC;IACrC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-CN.json"],"sourcesContent":["{\n \"ascending\": \"升序\",\n \"ascendingSort\": \"按列 {columnName} 升序排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"降序\",\n \"descendingSort\": \"按列 {columnName} 降序排序\",\n \"resizerDescription\": \"按“输入”键开始调整大小。\",\n \"select\": \"选择\",\n \"selectAll\": \"全选\",\n \"sortable\": \"可排序的列\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- "ascending": `\u{905E}\u{589E}`,
3
- "ascendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,
4
- "columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
5
- "descending": `\u{905E}\u{6E1B}`,
6
- "descendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,
7
- "resizerDescription": `\u{6309} Enter \u{9375}\u{4EE5}\u{958B}\u{59CB}\u{8ABF}\u{6574}\u{5927}\u{5C0F}`,
8
- "select": `\u{9078}\u{53D6}`,
9
- "selectAll": `\u{5168}\u{9078}`,
10
- "sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{6B04}`
11
- };
12
-
13
-
14
- //# sourceMappingURL=zh-TW.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IACzD,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IAC1D,sBAAsB,CAAC,+EAAgB,CAAC;IACxC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-TW.json"],"sourcesContent":["{\n \"ascending\": \"遞增\",\n \"ascendingSort\": \"已依據「{columnName}」欄遞增排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"遞減\",\n \"descendingSort\": \"已依據「{columnName}」欄遞減排序\",\n \"resizerDescription\": \"按 Enter 鍵以開始調整大小\",\n \"select\": \"選取\",\n \"selectAll\": \"全選\",\n \"sortable\": \"可排序的欄\"\n}\n"],"names":[],"version":3,"file":"zh-TW.main.js.map"}
package/dist/zh-TW.mjs DELETED
@@ -1,16 +0,0 @@
1
- var $b26f22384b3c1526$exports = {};
2
- $b26f22384b3c1526$exports = {
3
- "ascending": `\u{905E}\u{589E}`,
4
- "ascendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,
5
- "columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
6
- "descending": `\u{905E}\u{6E1B}`,
7
- "descendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,
8
- "resizerDescription": `\u{6309} Enter \u{9375}\u{4EE5}\u{958B}\u{59CB}\u{8ABF}\u{6574}\u{5927}\u{5C0F}`,
9
- "select": `\u{9078}\u{53D6}`,
10
- "selectAll": `\u{5168}\u{9078}`,
11
- "sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{6B04}`
12
- };
13
-
14
-
15
- export {$b26f22384b3c1526$exports as default};
16
- //# sourceMappingURL=zh-TW.module.js.map
@@ -1,16 +0,0 @@
1
- var $b26f22384b3c1526$exports = {};
2
- $b26f22384b3c1526$exports = {
3
- "ascending": `\u{905E}\u{589E}`,
4
- "ascendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,
5
- "columnSize": (args)=>`${args.value} \u{50CF}\u{7D20}`,
6
- "descending": `\u{905E}\u{6E1B}`,
7
- "descendingSort": (args)=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${args.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,
8
- "resizerDescription": `\u{6309} Enter \u{9375}\u{4EE5}\u{958B}\u{59CB}\u{8ABF}\u{6574}\u{5927}\u{5C0F}`,
9
- "select": `\u{9078}\u{53D6}`,
10
- "selectAll": `\u{5168}\u{9078}`,
11
- "sortable": `\u{53EF}\u{6392}\u{5E8F}\u{7684}\u{6B04}`
12
- };
13
-
14
-
15
- export {$b26f22384b3c1526$exports as default};
16
- //# sourceMappingURL=zh-TW.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IACzD,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IAC1D,sBAAsB,CAAC,+EAAgB,CAAC;IACxC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-TW.json"],"sourcesContent":["{\n \"ascending\": \"遞增\",\n \"ascendingSort\": \"已依據「{columnName}」欄遞增排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"遞減\",\n \"descendingSort\": \"已依據「{columnName}」欄遞減排序\",\n \"resizerDescription\": \"按 Enter 鍵以開始調整大小\",\n \"select\": \"選取\",\n \"selectAll\": \"全選\",\n \"sortable\": \"可排序的欄\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
@@ -1,214 +0,0 @@
1
- /*
2
- * Copyright 2022 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {getChildNodes, getFirstItem} from '@react-stately/collections';
14
- import {GridKeyboardDelegate} from '@react-aria/grid';
15
- import {Key, Node} from '@react-types/shared';
16
- import {TableCollection} from '@react-types/table';
17
-
18
- export class TableKeyboardDelegate<T> extends GridKeyboardDelegate<T, TableCollection<T>> {
19
-
20
- protected isCell(node: Node<T>): boolean {
21
- return node.type === 'cell' || node.type === 'rowheader' || node.type === 'column';
22
- }
23
-
24
- getKeyBelow(key: Key): Key | null {
25
- let startItem = this.collection.getItem(key);
26
- if (!startItem) {
27
- return null;
28
- }
29
-
30
- // If focus was on a column, then focus the first child column if any,
31
- // or find the corresponding cell in the first row.
32
- if (startItem.type === 'column') {
33
- let child = getFirstItem(getChildNodes(startItem, this.collection));
34
- if (child) {
35
- return child.key;
36
- }
37
-
38
- let firstKey = this.getFirstKey();
39
- if (firstKey == null) {
40
- return null;
41
- }
42
-
43
- let firstItem = this.collection.getItem(firstKey);
44
- if (!firstItem) {
45
- return null;
46
- }
47
-
48
- return super.getKeyForItemInRowByIndex(firstKey, startItem.index);
49
- }
50
-
51
- return super.getKeyBelow(key);
52
- }
53
-
54
- getKeyAbove(key: Key): Key | null {
55
- let startItem = this.collection.getItem(key);
56
- if (!startItem) {
57
- return null;
58
- }
59
-
60
- // If focus was on a column, focus the parent column if any
61
- if (startItem.type === 'column') {
62
- let parent = startItem.parentKey != null ? this.collection.getItem(startItem.parentKey) : null;
63
- if (parent && parent.type === 'column') {
64
- return parent.key;
65
- }
66
-
67
- return null;
68
- }
69
-
70
- // only return above row key if not header row
71
- let superKey = super.getKeyAbove(key);
72
- let superItem = superKey != null ? this.collection.getItem(superKey) : null;
73
- if (superItem && superItem.type !== 'headerrow') {
74
- return superKey;
75
- }
76
-
77
- // If no item was found, and focus was on a cell, then focus the
78
- // corresponding column header.
79
- if (this.isCell(startItem)) {
80
- return this.collection.columns[startItem.index].key;
81
- }
82
-
83
- // If focus was on a row, then focus the first column header.
84
- return this.collection.columns[0].key;
85
- }
86
-
87
- private findNextColumnKey(column: Node<T>): Key | null {
88
- // Search following columns
89
- let key = this.findNextKey(column.key, item => item.type === 'column');
90
- if (key != null) {
91
- return key;
92
- }
93
-
94
- // Wrap around to the first column
95
- let row = this.collection.headerRows[column.level];
96
- for (let item of getChildNodes(row, this.collection)) {
97
- if (item.type === 'column') {
98
- return item.key;
99
- }
100
- }
101
-
102
- return null;
103
- }
104
-
105
- private findPreviousColumnKey(column: Node<T>): Key | null {
106
- // Search previous columns
107
- let key = this.findPreviousKey(column.key, item => item.type === 'column');
108
- if (key != null) {
109
- return key;
110
- }
111
-
112
- // Wrap around to the last column
113
- let row = this.collection.headerRows[column.level];
114
- let childNodes = [...getChildNodes(row, this.collection)];
115
- for (let i = childNodes.length - 1; i >= 0; i--) {
116
- let item = childNodes[i];
117
- if (item.type === 'column') {
118
- return item.key;
119
- }
120
- }
121
-
122
- return null;
123
- }
124
-
125
- getKeyRightOf(key: Key): Key | null {
126
- let item = this.collection.getItem(key);
127
- if (!item) {
128
- return null;
129
- }
130
-
131
- // If focus was on a column, then focus the next column
132
- if (item.type === 'column') {
133
- return this.direction === 'rtl'
134
- ? this.findPreviousColumnKey(item)
135
- : this.findNextColumnKey(item);
136
- }
137
-
138
- return super.getKeyRightOf(key);
139
- }
140
-
141
- getKeyLeftOf(key: Key): Key | null {
142
- let item = this.collection.getItem(key);
143
- if (!item) {
144
- return null;
145
- }
146
-
147
- // If focus was on a column, then focus the previous column
148
- if (item.type === 'column') {
149
- return this.direction === 'rtl'
150
- ? this.findNextColumnKey(item)
151
- : this.findPreviousColumnKey(item);
152
- }
153
-
154
- return super.getKeyLeftOf(key);
155
- }
156
-
157
- getKeyForSearch(search: string, fromKey?: Key): Key | null {
158
- if (!this.collator) {
159
- return null;
160
- }
161
-
162
- let collection = this.collection;
163
- let key = fromKey ?? this.getFirstKey();
164
- if (key == null) {
165
- return null;
166
- }
167
-
168
- // If the starting key is a cell, search from its parent row.
169
- let startItem = collection.getItem(key);
170
- if (startItem?.type === 'cell') {
171
- key = startItem.parentKey ?? null;
172
- }
173
-
174
- let hasWrapped = false;
175
- while (key != null) {
176
- let item = collection.getItem(key);
177
- if (!item) {
178
- return null;
179
- }
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
-
188
- // Check each of the row header cells in this row for a match
189
- for (let cell of getChildNodes(item, this.collection)) {
190
- let column = collection.columns[cell.index];
191
- if (collection.rowHeaderColumnKeys.has(column.key) && cell.textValue) {
192
- let substring = cell.textValue.slice(0, search.length);
193
- if (this.collator.compare(substring, search) === 0) {
194
- // If we started on a cell, end on the matching cell. Otherwise, end on the row.
195
- let fromItem = fromKey != null ? collection.getItem(fromKey) : startItem;
196
- return fromItem?.type === 'cell'
197
- ? cell.key
198
- : item.key;
199
- }
200
- }
201
- }
202
-
203
- key = this.getKeyBelow(key);
204
-
205
- // Wrap around when reaching the end of the collection
206
- if (key == null && !hasWrapped) {
207
- key = this.getFirstKey();
208
- hasWrapped = true;
209
- }
210
- }
211
-
212
- return null;
213
- }
214
- }