@react-aria/grid 3.14.8 → 3.15.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 +9 -9
  2. package/dist/main.js +16 -16
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +9 -9
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +16 -0
  7. package/package.json +15 -23
  8. package/src/index.ts +16 -16
  9. package/dist/GridKeyboardDelegate.main.js +0 -318
  10. package/dist/GridKeyboardDelegate.main.js.map +0 -1
  11. package/dist/GridKeyboardDelegate.mjs +0 -313
  12. package/dist/GridKeyboardDelegate.module.js +0 -313
  13. package/dist/GridKeyboardDelegate.module.js.map +0 -1
  14. package/dist/ar-AE.main.js +0 -15
  15. package/dist/ar-AE.main.js.map +0 -1
  16. package/dist/ar-AE.mjs +0 -17
  17. package/dist/ar-AE.module.js +0 -17
  18. package/dist/ar-AE.module.js.map +0 -1
  19. package/dist/bg-BG.main.js +0 -15
  20. package/dist/bg-BG.main.js.map +0 -1
  21. package/dist/bg-BG.mjs +0 -17
  22. package/dist/bg-BG.module.js +0 -17
  23. package/dist/bg-BG.module.js.map +0 -1
  24. package/dist/cs-CZ.main.js +0 -15
  25. package/dist/cs-CZ.main.js.map +0 -1
  26. package/dist/cs-CZ.mjs +0 -17
  27. package/dist/cs-CZ.module.js +0 -17
  28. package/dist/cs-CZ.module.js.map +0 -1
  29. package/dist/da-DK.main.js +0 -15
  30. package/dist/da-DK.main.js.map +0 -1
  31. package/dist/da-DK.mjs +0 -17
  32. package/dist/da-DK.module.js +0 -17
  33. package/dist/da-DK.module.js.map +0 -1
  34. package/dist/de-DE.main.js +0 -15
  35. package/dist/de-DE.main.js.map +0 -1
  36. package/dist/de-DE.mjs +0 -17
  37. package/dist/de-DE.module.js +0 -17
  38. package/dist/de-DE.module.js.map +0 -1
  39. package/dist/el-GR.main.js +0 -15
  40. package/dist/el-GR.main.js.map +0 -1
  41. package/dist/el-GR.mjs +0 -17
  42. package/dist/el-GR.module.js +0 -17
  43. package/dist/el-GR.module.js.map +0 -1
  44. package/dist/en-US.main.js +0 -15
  45. package/dist/en-US.main.js.map +0 -1
  46. package/dist/en-US.mjs +0 -17
  47. package/dist/en-US.module.js +0 -17
  48. package/dist/en-US.module.js.map +0 -1
  49. package/dist/es-ES.main.js +0 -15
  50. package/dist/es-ES.main.js.map +0 -1
  51. package/dist/es-ES.mjs +0 -17
  52. package/dist/es-ES.module.js +0 -17
  53. package/dist/es-ES.module.js.map +0 -1
  54. package/dist/et-EE.main.js +0 -15
  55. package/dist/et-EE.main.js.map +0 -1
  56. package/dist/et-EE.mjs +0 -17
  57. package/dist/et-EE.module.js +0 -17
  58. package/dist/et-EE.module.js.map +0 -1
  59. package/dist/fi-FI.main.js +0 -15
  60. package/dist/fi-FI.main.js.map +0 -1
  61. package/dist/fi-FI.mjs +0 -17
  62. package/dist/fi-FI.module.js +0 -17
  63. package/dist/fi-FI.module.js.map +0 -1
  64. package/dist/fr-FR.main.js +0 -15
  65. package/dist/fr-FR.main.js.map +0 -1
  66. package/dist/fr-FR.mjs +0 -17
  67. package/dist/fr-FR.module.js +0 -17
  68. package/dist/fr-FR.module.js.map +0 -1
  69. package/dist/he-IL.main.js +0 -15
  70. package/dist/he-IL.main.js.map +0 -1
  71. package/dist/he-IL.mjs +0 -17
  72. package/dist/he-IL.module.js +0 -17
  73. package/dist/he-IL.module.js.map +0 -1
  74. package/dist/hr-HR.main.js +0 -15
  75. package/dist/hr-HR.main.js.map +0 -1
  76. package/dist/hr-HR.mjs +0 -17
  77. package/dist/hr-HR.module.js +0 -17
  78. package/dist/hr-HR.module.js.map +0 -1
  79. package/dist/hu-HU.main.js +0 -15
  80. package/dist/hu-HU.main.js.map +0 -1
  81. package/dist/hu-HU.mjs +0 -17
  82. package/dist/hu-HU.module.js +0 -17
  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 -15
  90. package/dist/it-IT.main.js.map +0 -1
  91. package/dist/it-IT.mjs +0 -17
  92. package/dist/it-IT.module.js +0 -17
  93. package/dist/it-IT.module.js.map +0 -1
  94. package/dist/ja-JP.main.js +0 -15
  95. package/dist/ja-JP.main.js.map +0 -1
  96. package/dist/ja-JP.mjs +0 -17
  97. package/dist/ja-JP.module.js +0 -17
  98. package/dist/ja-JP.module.js.map +0 -1
  99. package/dist/ko-KR.main.js +0 -15
  100. package/dist/ko-KR.main.js.map +0 -1
  101. package/dist/ko-KR.mjs +0 -17
  102. package/dist/ko-KR.module.js +0 -17
  103. package/dist/ko-KR.module.js.map +0 -1
  104. package/dist/lt-LT.main.js +0 -15
  105. package/dist/lt-LT.main.js.map +0 -1
  106. package/dist/lt-LT.mjs +0 -17
  107. package/dist/lt-LT.module.js +0 -17
  108. package/dist/lt-LT.module.js.map +0 -1
  109. package/dist/lv-LV.main.js +0 -15
  110. package/dist/lv-LV.main.js.map +0 -1
  111. package/dist/lv-LV.mjs +0 -17
  112. package/dist/lv-LV.module.js +0 -17
  113. package/dist/lv-LV.module.js.map +0 -1
  114. package/dist/nb-NO.main.js +0 -15
  115. package/dist/nb-NO.main.js.map +0 -1
  116. package/dist/nb-NO.mjs +0 -17
  117. package/dist/nb-NO.module.js +0 -17
  118. package/dist/nb-NO.module.js.map +0 -1
  119. package/dist/nl-NL.main.js +0 -15
  120. package/dist/nl-NL.main.js.map +0 -1
  121. package/dist/nl-NL.mjs +0 -17
  122. package/dist/nl-NL.module.js +0 -17
  123. package/dist/nl-NL.module.js.map +0 -1
  124. package/dist/pl-PL.main.js +0 -15
  125. package/dist/pl-PL.main.js.map +0 -1
  126. package/dist/pl-PL.mjs +0 -17
  127. package/dist/pl-PL.module.js +0 -17
  128. package/dist/pl-PL.module.js.map +0 -1
  129. package/dist/pt-BR.main.js +0 -15
  130. package/dist/pt-BR.main.js.map +0 -1
  131. package/dist/pt-BR.mjs +0 -17
  132. package/dist/pt-BR.module.js +0 -17
  133. package/dist/pt-BR.module.js.map +0 -1
  134. package/dist/pt-PT.main.js +0 -15
  135. package/dist/pt-PT.main.js.map +0 -1
  136. package/dist/pt-PT.mjs +0 -17
  137. package/dist/pt-PT.module.js +0 -17
  138. package/dist/pt-PT.module.js.map +0 -1
  139. package/dist/ro-RO.main.js +0 -15
  140. package/dist/ro-RO.main.js.map +0 -1
  141. package/dist/ro-RO.mjs +0 -17
  142. package/dist/ro-RO.module.js +0 -17
  143. package/dist/ro-RO.module.js.map +0 -1
  144. package/dist/ru-RU.main.js +0 -15
  145. package/dist/ru-RU.main.js.map +0 -1
  146. package/dist/ru-RU.mjs +0 -17
  147. package/dist/ru-RU.module.js +0 -17
  148. package/dist/ru-RU.module.js.map +0 -1
  149. package/dist/sk-SK.main.js +0 -15
  150. package/dist/sk-SK.main.js.map +0 -1
  151. package/dist/sk-SK.mjs +0 -17
  152. package/dist/sk-SK.module.js +0 -17
  153. package/dist/sk-SK.module.js.map +0 -1
  154. package/dist/sl-SI.main.js +0 -15
  155. package/dist/sl-SI.main.js.map +0 -1
  156. package/dist/sl-SI.mjs +0 -17
  157. package/dist/sl-SI.module.js +0 -17
  158. package/dist/sl-SI.module.js.map +0 -1
  159. package/dist/sr-SP.main.js +0 -15
  160. package/dist/sr-SP.main.js.map +0 -1
  161. package/dist/sr-SP.mjs +0 -17
  162. package/dist/sr-SP.module.js +0 -17
  163. package/dist/sr-SP.module.js.map +0 -1
  164. package/dist/sv-SE.main.js +0 -15
  165. package/dist/sv-SE.main.js.map +0 -1
  166. package/dist/sv-SE.mjs +0 -17
  167. package/dist/sv-SE.module.js +0 -17
  168. package/dist/sv-SE.module.js.map +0 -1
  169. package/dist/tr-TR.main.js +0 -15
  170. package/dist/tr-TR.main.js.map +0 -1
  171. package/dist/tr-TR.mjs +0 -17
  172. package/dist/tr-TR.module.js +0 -17
  173. package/dist/tr-TR.module.js.map +0 -1
  174. package/dist/types.d.ts +0 -213
  175. package/dist/types.d.ts.map +0 -1
  176. package/dist/uk-UA.main.js +0 -15
  177. package/dist/uk-UA.main.js.map +0 -1
  178. package/dist/uk-UA.mjs +0 -17
  179. package/dist/uk-UA.module.js +0 -17
  180. package/dist/uk-UA.module.js.map +0 -1
  181. package/dist/useGrid.main.js +0 -135
  182. package/dist/useGrid.main.js.map +0 -1
  183. package/dist/useGrid.mjs +0 -130
  184. package/dist/useGrid.module.js +0 -130
  185. package/dist/useGrid.module.js.map +0 -1
  186. package/dist/useGridCell.main.js +0 -231
  187. package/dist/useGridCell.main.js.map +0 -1
  188. package/dist/useGridCell.mjs +0 -226
  189. package/dist/useGridCell.module.js +0 -226
  190. package/dist/useGridCell.module.js.map +0 -1
  191. package/dist/useGridRow.main.js +0 -56
  192. package/dist/useGridRow.main.js.map +0 -1
  193. package/dist/useGridRow.mjs +0 -51
  194. package/dist/useGridRow.module.js +0 -51
  195. package/dist/useGridRow.module.js.map +0 -1
  196. package/dist/useGridRowGroup.main.js +0 -26
  197. package/dist/useGridRowGroup.main.js.map +0 -1
  198. package/dist/useGridRowGroup.mjs +0 -21
  199. package/dist/useGridRowGroup.module.js +0 -21
  200. package/dist/useGridRowGroup.module.js.map +0 -1
  201. package/dist/useGridSelectionAnnouncement.main.js +0 -118
  202. package/dist/useGridSelectionAnnouncement.main.js.map +0 -1
  203. package/dist/useGridSelectionAnnouncement.mjs +0 -113
  204. package/dist/useGridSelectionAnnouncement.module.js +0 -113
  205. package/dist/useGridSelectionAnnouncement.module.js.map +0 -1
  206. package/dist/useGridSelectionCheckbox.main.js +0 -39
  207. package/dist/useGridSelectionCheckbox.main.js.map +0 -1
  208. package/dist/useGridSelectionCheckbox.mjs +0 -34
  209. package/dist/useGridSelectionCheckbox.module.js +0 -34
  210. package/dist/useGridSelectionCheckbox.module.js.map +0 -1
  211. package/dist/useHighlightSelectionDescription.main.js +0 -55
  212. package/dist/useHighlightSelectionDescription.main.js.map +0 -1
  213. package/dist/useHighlightSelectionDescription.mjs +0 -50
  214. package/dist/useHighlightSelectionDescription.module.js +0 -50
  215. package/dist/useHighlightSelectionDescription.module.js.map +0 -1
  216. package/dist/utils.main.js +0 -20
  217. package/dist/utils.main.js.map +0 -1
  218. package/dist/utils.mjs +0 -15
  219. package/dist/utils.module.js +0 -15
  220. package/dist/utils.module.js.map +0 -1
  221. package/dist/zh-CN.main.js +0 -15
  222. package/dist/zh-CN.main.js.map +0 -1
  223. package/dist/zh-CN.mjs +0 -17
  224. package/dist/zh-CN.module.js +0 -17
  225. package/dist/zh-CN.module.js.map +0 -1
  226. package/dist/zh-TW.main.js +0 -15
  227. package/dist/zh-TW.main.js.map +0 -1
  228. package/dist/zh-TW.mjs +0 -17
  229. package/dist/zh-TW.module.js +0 -17
  230. package/dist/zh-TW.module.js.map +0 -1
  231. package/src/GridKeyboardDelegate.ts +0 -484
  232. package/src/useGrid.ts +0 -186
  233. package/src/useGridCell.ts +0 -300
  234. package/src/useGridRow.ts +0 -84
  235. package/src/useGridRowGroup.ts +0 -29
  236. package/src/useGridSelectionAnnouncement.ts +0 -140
  237. package/src/useGridSelectionCheckbox.ts +0 -48
  238. package/src/useHighlightSelectionDescription.ts +0 -52
  239. package/src/utils.ts +0 -29
package/dist/import.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import {GridKeyboardDelegate as $d1c300d9c497e402$export$de9feff04fda126e} from "./GridKeyboardDelegate.mjs";
2
- import {useGrid as $83c6e2eafa584c67$export$f6b86a04e5d66d90} from "./useGrid.mjs";
3
- import {useGridRowGroup as $e45487f8ba1cbdbf$export$d3037f5d3f3e51bf} from "./useGridRowGroup.mjs";
4
- import {useGridRow as $4159a7a9cbb0cc18$export$96357d5a73f686fa} from "./useGridRow.mjs";
5
- import {useGridCell as $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c} from "./useGridCell.mjs";
6
- import {useGridSelectionCheckbox as $7cb39d07f245a780$export$70e2eed1a92976ad} from "./useGridSelectionCheckbox.mjs";
7
- import {useHighlightSelectionDescription as $5b9b5b5723db6ae1$export$be42ebdab07ae4c2} from "./useHighlightSelectionDescription.mjs";
8
- import {useGridSelectionAnnouncement as $92599c3fd427b763$export$137e594ef3218a10} from "./useGridSelectionAnnouncement.mjs";
1
+ import {GridKeyboardDelegate as $737e6046a902a4a4$re_export$GridKeyboardDelegate} from "react-aria/private/grid/GridKeyboardDelegate";
2
+ import {useGrid as $737e6046a902a4a4$re_export$useGrid} from "react-aria/private/grid/useGrid";
3
+ import {useGridRowGroup as $737e6046a902a4a4$re_export$useGridRowGroup} from "react-aria/private/grid/useGridRowGroup";
4
+ import {useGridRow as $737e6046a902a4a4$re_export$useGridRow} from "react-aria/private/grid/useGridRow";
5
+ import {useGridCell as $737e6046a902a4a4$re_export$useGridCell} from "react-aria/private/grid/useGridCell";
6
+ import {useGridSelectionCheckbox as $737e6046a902a4a4$re_export$useGridSelectionCheckbox} from "react-aria/private/grid/useGridSelectionCheckbox";
7
+ import {useHighlightSelectionDescription as $737e6046a902a4a4$re_export$useHighlightSelectionDescription} from "react-aria/private/grid/useHighlightSelectionDescription";
8
+ import {useGridSelectionAnnouncement as $737e6046a902a4a4$re_export$useGridSelectionAnnouncement} from "react-aria/private/grid/useGridSelectionAnnouncement";
9
9
 
10
10
  /*
11
11
  * Copyright 2020 Adobe. All rights reserved.
@@ -27,5 +27,5 @@ import {useGridSelectionAnnouncement as $92599c3fd427b763$export$137e594ef3218a1
27
27
 
28
28
 
29
29
 
30
- export {$d1c300d9c497e402$export$de9feff04fda126e as GridKeyboardDelegate, $83c6e2eafa584c67$export$f6b86a04e5d66d90 as useGrid, $e45487f8ba1cbdbf$export$d3037f5d3f3e51bf as useGridRowGroup, $4159a7a9cbb0cc18$export$96357d5a73f686fa as useGridRow, $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c as useGridCell, $7cb39d07f245a780$export$70e2eed1a92976ad as useGridSelectionCheckbox, $5b9b5b5723db6ae1$export$be42ebdab07ae4c2 as useHighlightSelectionDescription, $92599c3fd427b763$export$137e594ef3218a10 as useGridSelectionAnnouncement};
30
+ export {$737e6046a902a4a4$re_export$GridKeyboardDelegate as GridKeyboardDelegate, $737e6046a902a4a4$re_export$useGrid as useGrid, $737e6046a902a4a4$re_export$useGridRowGroup as useGridRowGroup, $737e6046a902a4a4$re_export$useGridRow as useGridRow, $737e6046a902a4a4$re_export$useGridCell as useGridCell, $737e6046a902a4a4$re_export$useGridSelectionCheckbox as useGridSelectionCheckbox, $737e6046a902a4a4$re_export$useHighlightSelectionDescription as useHighlightSelectionDescription, $737e6046a902a4a4$re_export$useGridSelectionAnnouncement as useGridSelectionAnnouncement};
31
31
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,25 +1,25 @@
1
- var $3187c0e19200cb16$exports = require("./GridKeyboardDelegate.main.js");
2
- var $11d770dfabe45077$exports = require("./useGrid.main.js");
3
- var $c7def85a57100898$exports = require("./useGridRowGroup.main.js");
4
- var $eed398987c639831$exports = require("./useGridRow.main.js");
5
- var $cf2021be63b01ef4$exports = require("./useGridCell.main.js");
6
- var $d8385f73d3701365$exports = require("./useGridSelectionCheckbox.main.js");
7
- var $340f2fcd0ef9ce8d$exports = require("./useHighlightSelectionDescription.main.js");
8
- var $1eb174acfe8a0f16$exports = require("./useGridSelectionAnnouncement.main.js");
1
+ var $5DPg5$reactariaprivategridGridKeyboardDelegate = require("react-aria/private/grid/GridKeyboardDelegate");
2
+ var $5DPg5$reactariaprivategriduseGrid = require("react-aria/private/grid/useGrid");
3
+ var $5DPg5$reactariaprivategriduseGridRowGroup = require("react-aria/private/grid/useGridRowGroup");
4
+ var $5DPg5$reactariaprivategriduseGridRow = require("react-aria/private/grid/useGridRow");
5
+ var $5DPg5$reactariaprivategriduseGridCell = require("react-aria/private/grid/useGridCell");
6
+ var $5DPg5$reactariaprivategriduseGridSelectionCheckbox = require("react-aria/private/grid/useGridSelectionCheckbox");
7
+ var $5DPg5$reactariaprivategriduseHighlightSelectionDescription = require("react-aria/private/grid/useHighlightSelectionDescription");
8
+ var $5DPg5$reactariaprivategriduseGridSelectionAnnouncement = require("react-aria/private/grid/useGridSelectionAnnouncement");
9
9
 
10
10
 
11
11
  function $parcel$export(e, n, v, s) {
12
12
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
13
  }
14
14
 
15
- $parcel$export(module.exports, "GridKeyboardDelegate", () => $3187c0e19200cb16$exports.GridKeyboardDelegate);
16
- $parcel$export(module.exports, "useGrid", () => $11d770dfabe45077$exports.useGrid);
17
- $parcel$export(module.exports, "useGridRowGroup", () => $c7def85a57100898$exports.useGridRowGroup);
18
- $parcel$export(module.exports, "useGridRow", () => $eed398987c639831$exports.useGridRow);
19
- $parcel$export(module.exports, "useGridCell", () => $cf2021be63b01ef4$exports.useGridCell);
20
- $parcel$export(module.exports, "useGridSelectionCheckbox", () => $d8385f73d3701365$exports.useGridSelectionCheckbox);
21
- $parcel$export(module.exports, "useHighlightSelectionDescription", () => $340f2fcd0ef9ce8d$exports.useHighlightSelectionDescription);
22
- $parcel$export(module.exports, "useGridSelectionAnnouncement", () => $1eb174acfe8a0f16$exports.useGridSelectionAnnouncement);
15
+ $parcel$export(module.exports, "GridKeyboardDelegate", function () { return $5DPg5$reactariaprivategridGridKeyboardDelegate.GridKeyboardDelegate; });
16
+ $parcel$export(module.exports, "useGrid", function () { return $5DPg5$reactariaprivategriduseGrid.useGrid; });
17
+ $parcel$export(module.exports, "useGridRowGroup", function () { return $5DPg5$reactariaprivategriduseGridRowGroup.useGridRowGroup; });
18
+ $parcel$export(module.exports, "useGridRow", function () { return $5DPg5$reactariaprivategriduseGridRow.useGridRow; });
19
+ $parcel$export(module.exports, "useGridCell", function () { return $5DPg5$reactariaprivategriduseGridCell.useGridCell; });
20
+ $parcel$export(module.exports, "useGridSelectionCheckbox", function () { return $5DPg5$reactariaprivategriduseGridSelectionCheckbox.useGridSelectionCheckbox; });
21
+ $parcel$export(module.exports, "useHighlightSelectionDescription", function () { return $5DPg5$reactariaprivategriduseHighlightSelectionDescription.useHighlightSelectionDescription; });
22
+ $parcel$export(module.exports, "useGridSelectionAnnouncement", function () { return $5DPg5$reactariaprivategriduseGridSelectionAnnouncement.useGridSelectionAnnouncement; });
23
23
  /*
24
24
  * Copyright 2020 Adobe. All rights reserved.
25
25
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/grid/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 {GridKeyboardDelegate} from './GridKeyboardDelegate';\nexport {useGrid} from './useGrid';\nexport {useGridRowGroup} from './useGridRowGroup';\nexport {useGridRow} from './useGridRow';\nexport {useGridCell} from './useGridCell';\nexport {useGridSelectionCheckbox} from './useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\n\nexport type {GridProps, GridAria} from './useGrid';\nexport type {GridCellAria, GridCellProps} from './useGridCell';\nexport type {GridRowGroupAria} from './useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from './useGridRow';\nexport type {GridKeyboardDelegateOptions} from './GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from './useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from './useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from './useGridSelectionAnnouncement';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/grid/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 {GridKeyboardDelegate} from 'react-aria/private/grid/GridKeyboardDelegate';\n\nexport {useGrid} from 'react-aria/private/grid/useGrid';\nexport {useGridRowGroup} from 'react-aria/private/grid/useGridRowGroup';\nexport {useGridRow} from 'react-aria/private/grid/useGridRow';\nexport {useGridCell} from 'react-aria/private/grid/useGridCell';\nexport {useGridSelectionCheckbox} from 'react-aria/private/grid/useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from 'react-aria/private/grid/useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from 'react-aria/private/grid/useGridSelectionAnnouncement';\nexport type {GridProps, GridAria} from 'react-aria/private/grid/useGrid';\nexport type {GridCellAria, GridCellProps} from 'react-aria/private/grid/useGridCell';\nexport type {GridRowGroupAria} from 'react-aria/private/grid/useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from 'react-aria/private/grid/useGridRow';\nexport type {GridKeyboardDelegateOptions} from 'react-aria/private/grid/GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from 'react-aria/private/grid/useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from 'react-aria/private/grid/useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from 'react-aria/private/grid/useGridSelectionAnnouncement';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,11 +1,11 @@
1
- import {GridKeyboardDelegate as $d1c300d9c497e402$export$de9feff04fda126e} from "./GridKeyboardDelegate.module.js";
2
- import {useGrid as $83c6e2eafa584c67$export$f6b86a04e5d66d90} from "./useGrid.module.js";
3
- import {useGridRowGroup as $e45487f8ba1cbdbf$export$d3037f5d3f3e51bf} from "./useGridRowGroup.module.js";
4
- import {useGridRow as $4159a7a9cbb0cc18$export$96357d5a73f686fa} from "./useGridRow.module.js";
5
- import {useGridCell as $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c} from "./useGridCell.module.js";
6
- import {useGridSelectionCheckbox as $7cb39d07f245a780$export$70e2eed1a92976ad} from "./useGridSelectionCheckbox.module.js";
7
- import {useHighlightSelectionDescription as $5b9b5b5723db6ae1$export$be42ebdab07ae4c2} from "./useHighlightSelectionDescription.module.js";
8
- import {useGridSelectionAnnouncement as $92599c3fd427b763$export$137e594ef3218a10} from "./useGridSelectionAnnouncement.module.js";
1
+ import {GridKeyboardDelegate as $737e6046a902a4a4$re_export$GridKeyboardDelegate} from "react-aria/private/grid/GridKeyboardDelegate";
2
+ import {useGrid as $737e6046a902a4a4$re_export$useGrid} from "react-aria/private/grid/useGrid";
3
+ import {useGridRowGroup as $737e6046a902a4a4$re_export$useGridRowGroup} from "react-aria/private/grid/useGridRowGroup";
4
+ import {useGridRow as $737e6046a902a4a4$re_export$useGridRow} from "react-aria/private/grid/useGridRow";
5
+ import {useGridCell as $737e6046a902a4a4$re_export$useGridCell} from "react-aria/private/grid/useGridCell";
6
+ import {useGridSelectionCheckbox as $737e6046a902a4a4$re_export$useGridSelectionCheckbox} from "react-aria/private/grid/useGridSelectionCheckbox";
7
+ import {useHighlightSelectionDescription as $737e6046a902a4a4$re_export$useHighlightSelectionDescription} from "react-aria/private/grid/useHighlightSelectionDescription";
8
+ import {useGridSelectionAnnouncement as $737e6046a902a4a4$re_export$useGridSelectionAnnouncement} from "react-aria/private/grid/useGridSelectionAnnouncement";
9
9
 
10
10
  /*
11
11
  * Copyright 2020 Adobe. All rights reserved.
@@ -27,5 +27,5 @@ import {useGridSelectionAnnouncement as $92599c3fd427b763$export$137e594ef3218a1
27
27
 
28
28
 
29
29
 
30
- export {$d1c300d9c497e402$export$de9feff04fda126e as GridKeyboardDelegate, $83c6e2eafa584c67$export$f6b86a04e5d66d90 as useGrid, $e45487f8ba1cbdbf$export$d3037f5d3f3e51bf as useGridRowGroup, $4159a7a9cbb0cc18$export$96357d5a73f686fa as useGridRow, $ab90dcbc1b5466d0$export$c7e10bfc0c59f67c as useGridCell, $7cb39d07f245a780$export$70e2eed1a92976ad as useGridSelectionCheckbox, $5b9b5b5723db6ae1$export$be42ebdab07ae4c2 as useHighlightSelectionDescription, $92599c3fd427b763$export$137e594ef3218a10 as useGridSelectionAnnouncement};
30
+ export {$737e6046a902a4a4$re_export$GridKeyboardDelegate as GridKeyboardDelegate, $737e6046a902a4a4$re_export$useGrid as useGrid, $737e6046a902a4a4$re_export$useGridRowGroup as useGridRowGroup, $737e6046a902a4a4$re_export$useGridRow as useGridRow, $737e6046a902a4a4$re_export$useGridCell as useGridCell, $737e6046a902a4a4$re_export$useGridSelectionCheckbox as useGridSelectionCheckbox, $737e6046a902a4a4$re_export$useHighlightSelectionDescription as useHighlightSelectionDescription, $737e6046a902a4a4$re_export$useGridSelectionAnnouncement as useGridSelectionAnnouncement};
31
31
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/grid/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 {GridKeyboardDelegate} from './GridKeyboardDelegate';\nexport {useGrid} from './useGrid';\nexport {useGridRowGroup} from './useGridRowGroup';\nexport {useGridRow} from './useGridRow';\nexport {useGridCell} from './useGridCell';\nexport {useGridSelectionCheckbox} from './useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\n\nexport type {GridProps, GridAria} from './useGrid';\nexport type {GridCellAria, GridCellProps} from './useGridCell';\nexport type {GridRowGroupAria} from './useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from './useGridRow';\nexport type {GridKeyboardDelegateOptions} from './GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from './useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from './useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from './useGridSelectionAnnouncement';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/grid/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 {GridKeyboardDelegate} from 'react-aria/private/grid/GridKeyboardDelegate';\n\nexport {useGrid} from 'react-aria/private/grid/useGrid';\nexport {useGridRowGroup} from 'react-aria/private/grid/useGridRowGroup';\nexport {useGridRow} from 'react-aria/private/grid/useGridRow';\nexport {useGridCell} from 'react-aria/private/grid/useGridCell';\nexport {useGridSelectionCheckbox} from 'react-aria/private/grid/useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from 'react-aria/private/grid/useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from 'react-aria/private/grid/useGridSelectionAnnouncement';\nexport type {GridProps, GridAria} from 'react-aria/private/grid/useGrid';\nexport type {GridCellAria, GridCellProps} from 'react-aria/private/grid/useGridCell';\nexport type {GridRowGroupAria} from 'react-aria/private/grid/useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from 'react-aria/private/grid/useGridRow';\nexport type {GridKeyboardDelegateOptions} from 'react-aria/private/grid/GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from 'react-aria/private/grid/useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from 'react-aria/private/grid/useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from 'react-aria/private/grid/useGridSelectionAnnouncement';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,16 @@
1
+ export { GridKeyboardDelegate } from 'react-aria/private/grid/GridKeyboardDelegate';
2
+ export { useGrid } from 'react-aria/private/grid/useGrid';
3
+ export { useGridRowGroup } from 'react-aria/private/grid/useGridRowGroup';
4
+ export { useGridRow } from 'react-aria/private/grid/useGridRow';
5
+ export { useGridCell } from 'react-aria/private/grid/useGridCell';
6
+ export { useGridSelectionCheckbox } from 'react-aria/private/grid/useGridSelectionCheckbox';
7
+ export { useHighlightSelectionDescription } from 'react-aria/private/grid/useHighlightSelectionDescription';
8
+ export { useGridSelectionAnnouncement } from 'react-aria/private/grid/useGridSelectionAnnouncement';
9
+ export type { GridProps, GridAria } from 'react-aria/private/grid/useGrid';
10
+ export type { GridCellAria, GridCellProps } from 'react-aria/private/grid/useGridCell';
11
+ export type { GridRowGroupAria } from 'react-aria/private/grid/useGridRowGroup';
12
+ export type { GridRowProps, GridRowAria } from 'react-aria/private/grid/useGridRow';
13
+ export type { GridKeyboardDelegateOptions } from 'react-aria/private/grid/GridKeyboardDelegate';
14
+ export type { AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria } from 'react-aria/private/grid/useGridSelectionCheckbox';
15
+ export type { HighlightSelectionDescriptionProps } from 'react-aria/private/grid/useHighlightSelectionDescription';
16
+ export type { GridSelectionAnnouncementProps } from 'react-aria/private/grid/useGridSelectionAnnouncement';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-aria/grid",
3
- "version": "3.14.8",
3
+ "version": "3.15.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -26,19 +26,8 @@
26
26
  "url": "https://github.com/adobe/react-spectrum"
27
27
  },
28
28
  "dependencies": {
29
- "@react-aria/focus": "^3.21.5",
30
- "@react-aria/i18n": "^3.12.16",
31
- "@react-aria/interactions": "^3.27.1",
32
- "@react-aria/live-announcer": "^3.4.4",
33
- "@react-aria/selection": "^3.27.2",
34
- "@react-aria/utils": "^3.33.1",
35
- "@react-stately/collections": "^3.12.10",
36
- "@react-stately/grid": "^3.11.9",
37
- "@react-stately/selection": "^3.20.9",
38
- "@react-types/checkbox": "^3.10.4",
39
- "@react-types/grid": "^3.3.8",
40
- "@react-types/shared": "^3.33.1",
41
- "@swc/helpers": "^0.5.0"
29
+ "@swc/helpers": "^0.5.0",
30
+ "react-aria": "3.48.0"
42
31
  },
43
32
  "peerDependencies": {
44
33
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
@@ -47,5 +36,8 @@
47
36
  "publishConfig": {
48
37
  "access": "public"
49
38
  },
50
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
39
+ "targets": {
40
+ "types": false
41
+ },
42
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
51
43
  }
package/src/index.ts CHANGED
@@ -10,20 +10,20 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export {GridKeyboardDelegate} from './GridKeyboardDelegate';
14
- export {useGrid} from './useGrid';
15
- export {useGridRowGroup} from './useGridRowGroup';
16
- export {useGridRow} from './useGridRow';
17
- export {useGridCell} from './useGridCell';
18
- export {useGridSelectionCheckbox} from './useGridSelectionCheckbox';
19
- export {useHighlightSelectionDescription} from './useHighlightSelectionDescription';
20
- export {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';
13
+ export {GridKeyboardDelegate} from 'react-aria/private/grid/GridKeyboardDelegate';
21
14
 
22
- export type {GridProps, GridAria} from './useGrid';
23
- export type {GridCellAria, GridCellProps} from './useGridCell';
24
- export type {GridRowGroupAria} from './useGridRowGroup';
25
- export type {GridRowProps, GridRowAria} from './useGridRow';
26
- export type {GridKeyboardDelegateOptions} from './GridKeyboardDelegate';
27
- export type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from './useGridSelectionCheckbox';
28
- export type {HighlightSelectionDescriptionProps} from './useHighlightSelectionDescription';
29
- export type {GridSelectionAnnouncementProps} from './useGridSelectionAnnouncement';
15
+ export {useGrid} from 'react-aria/private/grid/useGrid';
16
+ export {useGridRowGroup} from 'react-aria/private/grid/useGridRowGroup';
17
+ export {useGridRow} from 'react-aria/private/grid/useGridRow';
18
+ export {useGridCell} from 'react-aria/private/grid/useGridCell';
19
+ export {useGridSelectionCheckbox} from 'react-aria/private/grid/useGridSelectionCheckbox';
20
+ export {useHighlightSelectionDescription} from 'react-aria/private/grid/useHighlightSelectionDescription';
21
+ export {useGridSelectionAnnouncement} from 'react-aria/private/grid/useGridSelectionAnnouncement';
22
+ export type {GridProps, GridAria} from 'react-aria/private/grid/useGrid';
23
+ export type {GridCellAria, GridCellProps} from 'react-aria/private/grid/useGridCell';
24
+ export type {GridRowGroupAria} from 'react-aria/private/grid/useGridRowGroup';
25
+ export type {GridRowProps, GridRowAria} from 'react-aria/private/grid/useGridRow';
26
+ export type {GridKeyboardDelegateOptions} from 'react-aria/private/grid/GridKeyboardDelegate';
27
+ export type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from 'react-aria/private/grid/useGridSelectionCheckbox';
28
+ export type {HighlightSelectionDescriptionProps} from 'react-aria/private/grid/useHighlightSelectionDescription';
29
+ export type {GridSelectionAnnouncementProps} from 'react-aria/private/grid/useGridSelectionAnnouncement';
@@ -1,318 +0,0 @@
1
- var $iKGCm$reactariaselection = require("@react-aria/selection");
2
- var $iKGCm$reactstatelycollections = require("@react-stately/collections");
3
-
4
-
5
- function $parcel$export(e, n, v, s) {
6
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
- }
8
-
9
- $parcel$export(module.exports, "GridKeyboardDelegate", () => $3187c0e19200cb16$export$de9feff04fda126e);
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
- class $3187c0e19200cb16$export$de9feff04fda126e {
23
- isCell(node) {
24
- return node.type === 'cell';
25
- }
26
- isRow(node) {
27
- return node.type === 'row' || node.type === 'item';
28
- }
29
- isDisabled(item) {
30
- var _item_props;
31
- return this.disabledBehavior === 'all' && (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || this.disabledKeys.has(item.key));
32
- }
33
- findPreviousKey(fromKey, pred) {
34
- let key = fromKey != null ? this.collection.getKeyBefore(fromKey) : this.collection.getLastKey();
35
- while(key != null){
36
- let item = this.collection.getItem(key);
37
- if (!item) return null;
38
- if (!this.isDisabled(item) && (!pred || pred(item))) return key;
39
- key = this.collection.getKeyBefore(key);
40
- }
41
- return null;
42
- }
43
- findNextKey(fromKey, pred) {
44
- let key = fromKey != null ? this.collection.getKeyAfter(fromKey) : this.collection.getFirstKey();
45
- while(key != null){
46
- let item = this.collection.getItem(key);
47
- if (!item) return null;
48
- if (!this.isDisabled(item) && (!pred || pred(item))) return key;
49
- key = this.collection.getKeyAfter(key);
50
- if (key == null) return null;
51
- }
52
- return null;
53
- }
54
- getKeyForItemInRowByIndex(key, index = 0) {
55
- if (index < 0) return null;
56
- let item = this.collection.getItem(key);
57
- if (!item) return null;
58
- let i = 0;
59
- for (let child of (0, $iKGCm$reactstatelycollections.getChildNodes)(item, this.collection)){
60
- var _child_key;
61
- if (child.colSpan && child.colSpan + i > index) return (_child_key = child.key) !== null && _child_key !== void 0 ? _child_key : null;
62
- if (child.colSpan) i = i + child.colSpan - 1;
63
- var _child_key1;
64
- if (i === index) return (_child_key1 = child.key) !== null && _child_key1 !== void 0 ? _child_key1 : null;
65
- i++;
66
- }
67
- return null;
68
- }
69
- getKeyBelow(fromKey) {
70
- let key = fromKey;
71
- let startItem = this.collection.getItem(key);
72
- if (!startItem) return null;
73
- var _startItem_parentKey;
74
- // If focus was on a cell, start searching from the parent row
75
- if (this.isCell(startItem)) key = (_startItem_parentKey = startItem.parentKey) !== null && _startItem_parentKey !== void 0 ? _startItem_parentKey : null;
76
- if (key == null) return null;
77
- // Find the next item
78
- key = this.findNextKey(key, (item)=>item.type === 'item');
79
- if (key != null) {
80
- // If focus was on a cell, focus the cell with the same index in the next row.
81
- if (this.isCell(startItem)) {
82
- let startIndex = startItem.colIndex ? startItem.colIndex : startItem.index;
83
- return this.getKeyForItemInRowByIndex(key, startIndex);
84
- }
85
- // Otherwise, focus the next row
86
- if (this.focusMode === 'row') return key;
87
- }
88
- return null;
89
- }
90
- getKeyAbove(fromKey) {
91
- let key = fromKey;
92
- let startItem = this.collection.getItem(key);
93
- if (!startItem) return null;
94
- var _startItem_parentKey;
95
- // If focus is on a cell, start searching from the parent row
96
- if (this.isCell(startItem)) key = (_startItem_parentKey = startItem.parentKey) !== null && _startItem_parentKey !== void 0 ? _startItem_parentKey : null;
97
- if (key == null) return null;
98
- // Find the previous item
99
- key = this.findPreviousKey(key, (item)=>item.type === 'item');
100
- if (key != null) {
101
- // If focus was on a cell, focus the cell with the same index in the previous row.
102
- if (this.isCell(startItem)) {
103
- let startIndex = startItem.colIndex ? startItem.colIndex : startItem.index;
104
- return this.getKeyForItemInRowByIndex(key, startIndex);
105
- }
106
- // Otherwise, focus the previous row
107
- if (this.focusMode === 'row') return key;
108
- }
109
- return null;
110
- }
111
- getKeyRightOf(key) {
112
- let item = this.collection.getItem(key);
113
- if (!item) return null;
114
- // If focus is on a row, focus the first child cell.
115
- if (this.isRow(item)) {
116
- var _getLastItem, _getFirstItem;
117
- let children = (0, $iKGCm$reactstatelycollections.getChildNodes)(item, this.collection);
118
- var _ref;
119
- return (_ref = this.direction === 'rtl' ? (_getLastItem = (0, $iKGCm$reactstatelycollections.getLastItem)(children)) === null || _getLastItem === void 0 ? void 0 : _getLastItem.key : (_getFirstItem = (0, $iKGCm$reactstatelycollections.getFirstItem)(children)) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _ref !== void 0 ? _ref : null;
120
- }
121
- // If focus is on a cell, focus the next cell if any,
122
- // otherwise focus the parent row.
123
- if (this.isCell(item) && item.parentKey != null) {
124
- let parent = this.collection.getItem(item.parentKey);
125
- if (!parent) return null;
126
- let children = (0, $iKGCm$reactstatelycollections.getChildNodes)(parent, this.collection);
127
- var _ref1;
128
- let next = (_ref1 = this.direction === 'rtl' ? (0, $iKGCm$reactstatelycollections.getNthItem)(children, item.index - 1) : (0, $iKGCm$reactstatelycollections.getNthItem)(children, item.index + 1)) !== null && _ref1 !== void 0 ? _ref1 : null;
129
- var _next_key;
130
- if (next) return (_next_key = next.key) !== null && _next_key !== void 0 ? _next_key : null;
131
- var _item_parentKey;
132
- // focus row only if focusMode is set to row
133
- if (this.focusMode === 'row') return (_item_parentKey = item.parentKey) !== null && _item_parentKey !== void 0 ? _item_parentKey : null;
134
- var _ref2;
135
- return (_ref2 = this.direction === 'rtl' ? this.getFirstKey(key) : this.getLastKey(key)) !== null && _ref2 !== void 0 ? _ref2 : null;
136
- }
137
- return null;
138
- }
139
- getKeyLeftOf(key) {
140
- let item = this.collection.getItem(key);
141
- if (!item) return null;
142
- // If focus is on a row, focus the last child cell.
143
- if (this.isRow(item)) {
144
- var _getFirstItem, _getLastItem;
145
- let children = (0, $iKGCm$reactstatelycollections.getChildNodes)(item, this.collection);
146
- var _ref;
147
- return (_ref = this.direction === 'rtl' ? (_getFirstItem = (0, $iKGCm$reactstatelycollections.getFirstItem)(children)) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key : (_getLastItem = (0, $iKGCm$reactstatelycollections.getLastItem)(children)) === null || _getLastItem === void 0 ? void 0 : _getLastItem.key) !== null && _ref !== void 0 ? _ref : null;
148
- }
149
- // If focus is on a cell, focus the previous cell if any,
150
- // otherwise focus the parent row.
151
- if (this.isCell(item) && item.parentKey != null) {
152
- let parent = this.collection.getItem(item.parentKey);
153
- if (!parent) return null;
154
- let children = (0, $iKGCm$reactstatelycollections.getChildNodes)(parent, this.collection);
155
- var _ref1;
156
- let prev = (_ref1 = this.direction === 'rtl' ? (0, $iKGCm$reactstatelycollections.getNthItem)(children, item.index + 1) : (0, $iKGCm$reactstatelycollections.getNthItem)(children, item.index - 1)) !== null && _ref1 !== void 0 ? _ref1 : null;
157
- var _prev_key;
158
- if (prev) return (_prev_key = prev.key) !== null && _prev_key !== void 0 ? _prev_key : null;
159
- var _item_parentKey;
160
- // focus row only if focusMode is set to row
161
- if (this.focusMode === 'row') return (_item_parentKey = item.parentKey) !== null && _item_parentKey !== void 0 ? _item_parentKey : null;
162
- var _ref2;
163
- return (_ref2 = this.direction === 'rtl' ? this.getLastKey(key) : this.getFirstKey(key)) !== null && _ref2 !== void 0 ? _ref2 : null;
164
- }
165
- return null;
166
- }
167
- getFirstKey(fromKey, global) {
168
- let key = fromKey !== null && fromKey !== void 0 ? fromKey : null;
169
- let item;
170
- if (key != null) {
171
- item = this.collection.getItem(key);
172
- if (!item) return null;
173
- // If global flag is not set, and a cell is currently focused,
174
- // move focus to the first cell in the parent row.
175
- if (this.isCell(item) && !global && item.parentKey != null) {
176
- var _getFirstItem;
177
- let parent = this.collection.getItem(item.parentKey);
178
- if (!parent) return null;
179
- var _getFirstItem_key;
180
- return (_getFirstItem_key = (_getFirstItem = (0, $iKGCm$reactstatelycollections.getFirstItem)((0, $iKGCm$reactstatelycollections.getChildNodes)(parent, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null;
181
- }
182
- }
183
- // Find the first row
184
- key = this.findNextKey(undefined, (item)=>item.type === 'item');
185
- // If global flag is set (or if focus mode is cell), focus the first cell in the first row.
186
- if (key != null && (item && this.isCell(item) && global || this.focusMode === 'cell')) {
187
- var _getFirstItem1;
188
- let item = this.collection.getItem(key);
189
- if (!item) return null;
190
- var _getFirstItem_key1;
191
- key = (_getFirstItem_key1 = (_getFirstItem1 = (0, $iKGCm$reactstatelycollections.getFirstItem)((0, $iKGCm$reactstatelycollections.getChildNodes)(item, this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key) !== null && _getFirstItem_key1 !== void 0 ? _getFirstItem_key1 : null;
192
- }
193
- // Otherwise, focus the row itself.
194
- return key;
195
- }
196
- getLastKey(fromKey, global) {
197
- let key = fromKey !== null && fromKey !== void 0 ? fromKey : null;
198
- let item;
199
- if (key != null) {
200
- item = this.collection.getItem(key);
201
- if (!item) return null;
202
- // If global flag is not set, and a cell is currently focused,
203
- // move focus to the last cell in the parent row.
204
- if (this.isCell(item) && !global && item.parentKey != null) {
205
- var _getLastItem;
206
- let parent = this.collection.getItem(item.parentKey);
207
- if (!parent) return null;
208
- let children = (0, $iKGCm$reactstatelycollections.getChildNodes)(parent, this.collection);
209
- var _getLastItem_key;
210
- return (_getLastItem_key = (_getLastItem = (0, $iKGCm$reactstatelycollections.getLastItem)(children)) === null || _getLastItem === void 0 ? void 0 : _getLastItem.key) !== null && _getLastItem_key !== void 0 ? _getLastItem_key : null;
211
- }
212
- }
213
- // Find the last row
214
- key = this.findPreviousKey(undefined, (item)=>item.type === 'item');
215
- // If global flag is set (or if focus mode is cell), focus the last cell in the last row.
216
- if (key != null && (item && this.isCell(item) && global || this.focusMode === 'cell')) {
217
- var _getLastItem1;
218
- let item = this.collection.getItem(key);
219
- if (!item) return null;
220
- let children = (0, $iKGCm$reactstatelycollections.getChildNodes)(item, this.collection);
221
- var _getLastItem_key1;
222
- key = (_getLastItem_key1 = (_getLastItem1 = (0, $iKGCm$reactstatelycollections.getLastItem)(children)) === null || _getLastItem1 === void 0 ? void 0 : _getLastItem1.key) !== null && _getLastItem_key1 !== void 0 ? _getLastItem_key1 : null;
223
- }
224
- // Otherwise, focus the row itself.
225
- return key;
226
- }
227
- getKeyPageAbove(fromKey) {
228
- let key = fromKey;
229
- let itemRect = this.layoutDelegate.getItemRect(key);
230
- if (!itemRect) return null;
231
- let pageY = Math.max(0, itemRect.y + itemRect.height - this.layoutDelegate.getVisibleRect().height);
232
- while(itemRect && itemRect.y > pageY && key != null){
233
- var _this_getKeyAbove;
234
- key = (_this_getKeyAbove = this.getKeyAbove(key)) !== null && _this_getKeyAbove !== void 0 ? _this_getKeyAbove : null;
235
- if (key == null) break;
236
- itemRect = this.layoutDelegate.getItemRect(key);
237
- }
238
- return key;
239
- }
240
- getKeyPageBelow(fromKey) {
241
- let key = fromKey;
242
- let itemRect = this.layoutDelegate.getItemRect(key);
243
- if (!itemRect) return null;
244
- let pageHeight = this.layoutDelegate.getVisibleRect().height;
245
- let pageY = Math.min(this.layoutDelegate.getContentSize().height, itemRect.y + pageHeight);
246
- while(itemRect && itemRect.y + itemRect.height < pageY){
247
- let nextKey = this.getKeyBelow(key);
248
- // If nextKey is undefined, we've reached the last row already
249
- if (nextKey == null) break;
250
- itemRect = this.layoutDelegate.getItemRect(nextKey);
251
- key = nextKey;
252
- }
253
- return key;
254
- }
255
- getKeyForSearch(search, fromKey) {
256
- let key = fromKey !== null && fromKey !== void 0 ? fromKey : null;
257
- if (!this.collator) return null;
258
- let collection = this.collection;
259
- key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
260
- if (key == null) return null;
261
- // If the starting key is a cell, search from its parent row.
262
- let startItem = collection.getItem(key);
263
- if (!startItem) return null;
264
- var _startItem_parentKey;
265
- if (startItem.type === 'cell') key = (_startItem_parentKey = startItem.parentKey) !== null && _startItem_parentKey !== void 0 ? _startItem_parentKey : null;
266
- let hasWrapped = false;
267
- while(key != null){
268
- let item = collection.getItem(key);
269
- if (!item) return null;
270
- // check row text value for match
271
- if (item.textValue) {
272
- let substring = item.textValue.slice(0, search.length);
273
- if (this.collator.compare(substring, search) === 0) {
274
- var _getFirstItem;
275
- var _getFirstItem_key;
276
- if (this.isRow(item) && this.focusMode === 'cell') return (_getFirstItem_key = (_getFirstItem = (0, $iKGCm$reactstatelycollections.getFirstItem)((0, $iKGCm$reactstatelycollections.getChildNodes)(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null;
277
- return item.key;
278
- }
279
- }
280
- key = this.findNextKey(key, (item)=>item.type === 'item');
281
- // Wrap around when reaching the end of the collection
282
- if (key == null && !hasWrapped) {
283
- key = this.getFirstKey();
284
- hasWrapped = true;
285
- }
286
- }
287
- return null;
288
- }
289
- constructor(options){
290
- this.collection = options.collection;
291
- this.disabledKeys = options.disabledKeys;
292
- this.disabledBehavior = options.disabledBehavior || 'all';
293
- this.direction = options.direction;
294
- this.collator = options.collator;
295
- if (!options.layout && !options.ref) throw new Error('Either a layout or a ref must be specified.');
296
- this.layoutDelegate = options.layoutDelegate || (options.layout ? new $3187c0e19200cb16$var$DeprecatedLayoutDelegate(options.layout) : new (0, $iKGCm$reactariaselection.DOMLayoutDelegate)(options.ref));
297
- var _options_focusMode;
298
- this.focusMode = (_options_focusMode = options.focusMode) !== null && _options_focusMode !== void 0 ? _options_focusMode : 'row';
299
- }
300
- }
301
- class $3187c0e19200cb16$var$DeprecatedLayoutDelegate {
302
- getContentSize() {
303
- return this.layout.getContentSize();
304
- }
305
- getItemRect(key) {
306
- var _this_layout_getLayoutInfo;
307
- return ((_this_layout_getLayoutInfo = this.layout.getLayoutInfo(key)) === null || _this_layout_getLayoutInfo === void 0 ? void 0 : _this_layout_getLayoutInfo.rect) || null;
308
- }
309
- getVisibleRect() {
310
- return this.layout.virtualizer.visibleRect;
311
- }
312
- constructor(layout){
313
- this.layout = layout;
314
- }
315
- }
316
-
317
-
318
- //# sourceMappingURL=GridKeyboardDelegate.main.js.map