@flipdish/ui-library 0.69.0 → 0.71.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 (415) hide show
  1. package/README.md +3 -3
  2. package/dist/components/__internal__/controlFill/controlFill.context.cjs +13 -0
  3. package/dist/components/__internal__/controlFill/controlFill.context.cjs.map +1 -0
  4. package/dist/components/__internal__/controlFill/controlFill.context.d.ts +7 -0
  5. package/dist/components/__internal__/controlFill/controlFill.context.d.ts.map +1 -0
  6. package/dist/components/__internal__/controlFill/controlFill.context.js +11 -0
  7. package/dist/components/__internal__/controlFill/controlFill.context.js.map +1 -0
  8. package/dist/components/__internal__/focusHandOff/focusHandOff.context.cjs +13 -0
  9. package/dist/components/__internal__/focusHandOff/focusHandOff.context.cjs.map +1 -0
  10. package/dist/components/__internal__/focusHandOff/focusHandOff.context.d.ts +8 -0
  11. package/dist/components/__internal__/focusHandOff/focusHandOff.context.d.ts.map +1 -0
  12. package/dist/components/__internal__/focusHandOff/focusHandOff.context.js +11 -0
  13. package/dist/components/__internal__/focusHandOff/focusHandOff.context.js.map +1 -0
  14. package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.d.ts +1 -1
  15. package/dist/components/atoms/Buttons/IconButton/IconButton.cjs +1 -1
  16. package/dist/components/atoms/Buttons/IconButton/IconButton.cjs.map +1 -1
  17. package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts.map +1 -1
  18. package/dist/components/atoms/Buttons/IconButton/IconButton.js +1 -1
  19. package/dist/components/atoms/Buttons/IconButton/IconButton.js.map +1 -1
  20. package/dist/components/atoms/LiveStatus/index.cjs +18 -0
  21. package/dist/components/atoms/LiveStatus/index.cjs.map +1 -0
  22. package/dist/components/atoms/LiveStatus/index.d.ts +17 -0
  23. package/dist/components/atoms/LiveStatus/index.d.ts.map +1 -0
  24. package/dist/components/atoms/LiveStatus/index.js +16 -0
  25. package/dist/components/atoms/LiveStatus/index.js.map +1 -0
  26. package/dist/components/forms/Form/index.cjs +1 -1
  27. package/dist/components/forms/Form/index.js +1 -1
  28. package/dist/components/molecules/Dropdown/index.d.ts +2 -2
  29. package/dist/components/molecules/EmptyState/index.cjs +9 -1
  30. package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
  31. package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
  32. package/dist/components/molecules/EmptyState/index.js +11 -3
  33. package/dist/components/molecules/EmptyState/index.js.map +1 -1
  34. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.cjs +13 -0
  35. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.cjs.map +1 -1
  36. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.d.ts +8 -0
  37. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.d.ts.map +1 -1
  38. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.js +13 -1
  39. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.js.map +1 -1
  40. package/dist/components/molecules/Modals/Modal/Modal.cjs +6 -5
  41. package/dist/components/molecules/Modals/Modal/Modal.cjs.map +1 -1
  42. package/dist/components/molecules/Modals/Modal/Modal.d.ts.map +1 -1
  43. package/dist/components/molecules/Modals/Modal/Modal.js +6 -5
  44. package/dist/components/molecules/Modals/Modal/Modal.js.map +1 -1
  45. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.cjs +1 -1
  46. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts +1 -1
  47. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts.map +1 -1
  48. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.js +1 -1
  49. package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts +1 -1
  50. package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -1
  51. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs +4 -1
  52. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs.map +1 -1
  53. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  54. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js +5 -2
  55. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js.map +1 -1
  56. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs +11 -6
  57. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs.map +1 -1
  58. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts +4 -2
  59. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts.map +1 -1
  60. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js +12 -7
  61. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js.map +1 -1
  62. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.cjs +53 -0
  63. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.cjs.map +1 -0
  64. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.d.ts +41 -0
  65. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.d.ts.map +1 -0
  66. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.js +51 -0
  67. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.js.map +1 -0
  68. package/dist/components/organisms/FilterBar/index.cjs +19 -7
  69. package/dist/components/organisms/FilterBar/index.cjs.map +1 -1
  70. package/dist/components/organisms/FilterBar/index.d.ts +1 -0
  71. package/dist/components/organisms/FilterBar/index.d.ts.map +1 -1
  72. package/dist/components/organisms/FilterBar/index.js +18 -7
  73. package/dist/components/organisms/FilterBar/index.js.map +1 -1
  74. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs +2 -0
  75. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs.map +1 -1
  76. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts +10 -0
  77. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts.map +1 -1
  78. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js +2 -0
  79. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js.map +1 -1
  80. package/dist/components/organisms/SlideoutMenu/index.cjs +3 -1
  81. package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
  82. package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
  83. package/dist/components/organisms/SlideoutMenu/index.js +3 -1
  84. package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
  85. package/dist/components/organisms/Table/index.cjs +14 -244
  86. package/dist/components/organisms/Table/index.cjs.map +1 -1
  87. package/dist/components/organisms/Table/index.d.ts +29 -124
  88. package/dist/components/organisms/Table/index.d.ts.map +1 -1
  89. package/dist/components/organisms/Table/index.js +13 -243
  90. package/dist/components/organisms/Table/index.js.map +1 -1
  91. package/dist/components/organisms/Tables/Table/Table.cjs +305 -0
  92. package/dist/components/organisms/Tables/Table/Table.cjs.map +1 -0
  93. package/dist/components/organisms/Tables/Table/Table.d.ts +146 -0
  94. package/dist/components/organisms/Tables/Table/Table.d.ts.map +1 -0
  95. package/dist/components/organisms/Tables/Table/Table.js +301 -0
  96. package/dist/components/organisms/Tables/Table/Table.js.map +1 -0
  97. package/dist/components/organisms/Tables/Table/Table.styles.cjs +29 -0
  98. package/dist/components/organisms/Tables/Table/Table.styles.cjs.map +1 -0
  99. package/dist/components/organisms/Tables/Table/Table.styles.d.ts +16 -0
  100. package/dist/components/organisms/Tables/Table/Table.styles.d.ts.map +1 -0
  101. package/dist/components/organisms/Tables/Table/Table.styles.js +27 -0
  102. package/dist/components/organisms/Tables/Table/Table.styles.js.map +1 -0
  103. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.cjs +2 -2
  104. package/dist/components/organisms/Tables/Table/components/TableCardList.cjs.map +1 -0
  105. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.d.ts +1 -1
  106. package/dist/components/organisms/Tables/Table/components/TableCardList.d.ts.map +1 -0
  107. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.js +2 -2
  108. package/dist/components/organisms/Tables/Table/components/TableCardList.js.map +1 -0
  109. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.cjs +10 -5
  110. package/dist/components/organisms/Tables/Table/components/TableCardRow.cjs.map +1 -0
  111. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.d.ts +1 -1
  112. package/dist/components/organisms/Tables/Table/components/TableCardRow.d.ts.map +1 -0
  113. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.js +11 -6
  114. package/dist/components/organisms/Tables/Table/components/TableCardRow.js.map +1 -0
  115. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.cjs +2 -2
  116. package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.cjs.map +1 -0
  117. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.d.ts +3 -1
  118. package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.d.ts.map +1 -0
  119. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.js +2 -2
  120. package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.js.map +1 -0
  121. package/dist/components/organisms/Tables/Table/components/TableEmptyState.cjs +17 -0
  122. package/dist/components/organisms/Tables/Table/components/TableEmptyState.cjs.map +1 -0
  123. package/dist/components/organisms/Tables/Table/components/TableEmptyState.d.ts +5 -0
  124. package/dist/components/organisms/Tables/Table/components/TableEmptyState.d.ts.map +1 -0
  125. package/dist/components/organisms/Tables/Table/components/TableEmptyState.js +15 -0
  126. package/dist/components/organisms/Tables/Table/components/TableEmptyState.js.map +1 -0
  127. package/dist/components/organisms/Tables/Table/components/TableFallbackCard.cjs.map +1 -0
  128. package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.d.ts +1 -1
  129. package/dist/components/organisms/Tables/Table/components/TableFallbackCard.d.ts.map +1 -0
  130. package/dist/components/organisms/Tables/Table/components/TableFallbackCard.js.map +1 -0
  131. package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.cjs +6 -5
  132. package/dist/components/organisms/Tables/Table/components/TableRowCard.cjs.map +1 -0
  133. package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.d.ts +1 -1
  134. package/dist/components/organisms/Tables/Table/components/TableRowCard.d.ts.map +1 -0
  135. package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.js +6 -5
  136. package/dist/components/organisms/Tables/Table/components/TableRowCard.js.map +1 -0
  137. package/dist/components/organisms/Tables/Table/components/TableSortIcon.cjs.map +1 -0
  138. package/dist/components/organisms/Tables/Table/components/TableSortIcon.d.ts.map +1 -0
  139. package/dist/components/organisms/Tables/Table/components/TableSortIcon.js.map +1 -0
  140. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.cjs +22 -0
  141. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.cjs.map +1 -0
  142. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts +12 -0
  143. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts.map +1 -0
  144. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.js +20 -0
  145. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.js.map +1 -0
  146. package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.cjs +1 -1
  147. package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.cjs.map +1 -0
  148. package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.d.ts.map +1 -0
  149. package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.js +1 -1
  150. package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.js.map +1 -0
  151. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs +42 -0
  152. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs.map +1 -0
  153. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts +14 -0
  154. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts.map +1 -0
  155. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js +40 -0
  156. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js.map +1 -0
  157. package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.cjs +8 -11
  158. package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.cjs.map +1 -0
  159. package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.d.ts +10 -3
  160. package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.d.ts.map +1 -0
  161. package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.js +9 -12
  162. package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.js.map +1 -0
  163. package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.cjs.map +1 -0
  164. package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.d.ts +1 -1
  165. package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.d.ts.map +1 -0
  166. package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.js.map +1 -0
  167. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.cjs +83 -0
  168. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.cjs.map +1 -0
  169. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.d.ts +23 -0
  170. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.d.ts.map +1 -0
  171. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.js +81 -0
  172. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.js.map +1 -0
  173. package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.cjs +12 -4
  174. package/dist/components/organisms/Tables/Table/hooks/useTableSelection.cjs.map +1 -0
  175. package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.d.ts +5 -3
  176. package/dist/components/organisms/Tables/Table/hooks/useTableSelection.d.ts.map +1 -0
  177. package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.js +12 -4
  178. package/dist/components/organisms/Tables/Table/hooks/useTableSelection.js.map +1 -0
  179. package/dist/components/organisms/Tables/Table/providers/Table.context.cjs.map +1 -0
  180. package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.d.ts +14 -2
  181. package/dist/components/organisms/Tables/Table/providers/Table.context.d.ts.map +1 -0
  182. package/dist/components/organisms/Tables/Table/providers/Table.context.js.map +1 -0
  183. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.cjs +55 -0
  184. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.cjs.map +1 -0
  185. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.d.ts +25 -0
  186. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.d.ts.map +1 -0
  187. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.js +51 -0
  188. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.js.map +1 -0
  189. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs +57 -0
  190. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs.map +1 -0
  191. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts +66 -0
  192. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts.map +1 -0
  193. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js +52 -0
  194. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js.map +1 -0
  195. package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.cjs +21 -21
  196. package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.cjs.map +1 -0
  197. package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.d.ts +29 -19
  198. package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.d.ts.map +1 -0
  199. package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.js +20 -21
  200. package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.js.map +1 -0
  201. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.cjs +34 -0
  202. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.cjs.map +1 -0
  203. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.d.ts +37 -0
  204. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.d.ts.map +1 -0
  205. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.js +32 -0
  206. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.js.map +1 -0
  207. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.cjs +32 -0
  208. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.cjs.map +1 -0
  209. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.d.ts +21 -0
  210. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.d.ts.map +1 -0
  211. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.js +30 -0
  212. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.js.map +1 -0
  213. package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.cjs +12 -5
  214. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.cjs.map +1 -0
  215. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts +47 -0
  216. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts.map +1 -0
  217. package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.js +12 -5
  218. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.js.map +1 -0
  219. package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.cjs.map +1 -0
  220. package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.d.ts.map +1 -0
  221. package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.js.map +1 -0
  222. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.cjs +84 -0
  223. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.cjs.map +1 -0
  224. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.d.ts +20 -0
  225. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.d.ts.map +1 -0
  226. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.js +81 -0
  227. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.js.map +1 -0
  228. package/dist/components/organisms/Tables/index.cjs +14 -0
  229. package/dist/components/organisms/Tables/index.cjs.map +1 -0
  230. package/dist/components/organisms/Tables/index.d.ts +19 -0
  231. package/dist/components/organisms/Tables/index.d.ts.map +1 -0
  232. package/dist/components/organisms/Tables/index.js +4 -0
  233. package/dist/components/organisms/Tables/index.js.map +1 -0
  234. package/dist/components/organisms/{Table/table.types.d.ts → Tables/tables.types.d.ts} +12 -2
  235. package/dist/components/organisms/Tables/tables.types.d.ts.map +1 -0
  236. package/dist/components/organisms/Tables/utilities/tableCard.utils.cjs.map +1 -0
  237. package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.d.ts +2 -2
  238. package/dist/components/organisms/Tables/utilities/tableCard.utils.d.ts.map +1 -0
  239. package/dist/components/organisms/Tables/utilities/tableCard.utils.js.map +1 -0
  240. package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.cjs +7 -4
  241. package/dist/components/organisms/Tables/utilities/tableChildren.utils.cjs.map +1 -0
  242. package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.d.ts +5 -3
  243. package/dist/components/organisms/Tables/utilities/tableChildren.utils.d.ts.map +1 -0
  244. package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.js +7 -4
  245. package/dist/components/organisms/Tables/utilities/tableChildren.utils.js.map +1 -0
  246. package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs +23 -0
  247. package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs.map +1 -0
  248. package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts +8 -0
  249. package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts.map +1 -0
  250. package/dist/components/organisms/Tables/utilities/tableIterable.utils.js +21 -0
  251. package/dist/components/organisms/Tables/utilities/tableIterable.utils.js.map +1 -0
  252. package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.cjs +1 -1
  253. package/dist/components/organisms/Tables/utilities/tableSort.utils.cjs.map +1 -0
  254. package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.d.ts +1 -1
  255. package/dist/components/organisms/Tables/utilities/tableSort.utils.d.ts.map +1 -0
  256. package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.js +1 -1
  257. package/dist/components/organisms/Tables/utilities/tableSort.utils.js.map +1 -0
  258. package/dist/hooks/useFocusAfterRetry/index.cjs +21 -19
  259. package/dist/hooks/useFocusAfterRetry/index.cjs.map +1 -1
  260. package/dist/hooks/useFocusAfterRetry/index.d.ts +15 -5
  261. package/dist/hooks/useFocusAfterRetry/index.d.ts.map +1 -1
  262. package/dist/hooks/useFocusAfterRetry/index.js +21 -19
  263. package/dist/hooks/useFocusAfterRetry/index.js.map +1 -1
  264. package/dist/hooks/useFocusHandOff/index.cjs +67 -0
  265. package/dist/hooks/useFocusHandOff/index.cjs.map +1 -0
  266. package/dist/hooks/useFocusHandOff/index.d.ts +17 -0
  267. package/dist/hooks/useFocusHandOff/index.d.ts.map +1 -0
  268. package/dist/hooks/useFocusHandOff/index.js +65 -0
  269. package/dist/hooks/useFocusHandOff/index.js.map +1 -0
  270. package/dist/hooks/useListQueryParams/index.cjs +238 -0
  271. package/dist/hooks/useListQueryParams/index.cjs.map +1 -0
  272. package/dist/hooks/useListQueryParams/index.d.ts +77 -0
  273. package/dist/hooks/useListQueryParams/index.d.ts.map +1 -0
  274. package/dist/hooks/useListQueryParams/index.js +236 -0
  275. package/dist/hooks/useListQueryParams/index.js.map +1 -0
  276. package/dist/hooks/useLoadState/index.cjs +69 -0
  277. package/dist/hooks/useLoadState/index.cjs.map +1 -0
  278. package/dist/hooks/useLoadState/index.d.ts +44 -0
  279. package/dist/hooks/useLoadState/index.d.ts.map +1 -0
  280. package/dist/hooks/useLoadState/index.js +67 -0
  281. package/dist/hooks/useLoadState/index.js.map +1 -0
  282. package/dist/hooks/usePagedList/index.cjs +61 -0
  283. package/dist/hooks/usePagedList/index.cjs.map +1 -0
  284. package/dist/hooks/usePagedList/index.d.ts +56 -0
  285. package/dist/hooks/usePagedList/index.d.ts.map +1 -0
  286. package/dist/hooks/usePagedList/index.js +59 -0
  287. package/dist/hooks/usePagedList/index.js.map +1 -0
  288. package/dist/native/components/atoms/LiveStatus/index.d.ts +12 -0
  289. package/dist/native/components/organisms/Tables/index.d.ts +12 -0
  290. package/dist/native/hooks/useFocusHandOff/index.d.ts +12 -0
  291. package/dist/native/hooks/useListQueryParams/index.d.ts +12 -0
  292. package/dist/native/hooks/useLoadState/index.d.ts +12 -0
  293. package/dist/native/hooks/usePagedList/index.d.ts +12 -0
  294. package/dist/native/utilities/listQueryUtils/index.d.ts +12 -0
  295. package/dist/styles.css +12 -0
  296. package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.cjs +9 -0
  297. package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.cjs.map +1 -0
  298. package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.d.ts +8 -0
  299. package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.d.ts.map +1 -0
  300. package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.js +9 -1
  301. package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.js.map +1 -0
  302. package/dist/utilities/__internal__/listStateUtils/listState.utils.cjs +47 -0
  303. package/dist/utilities/__internal__/listStateUtils/listState.utils.cjs.map +1 -0
  304. package/dist/utilities/__internal__/listStateUtils/listState.utils.d.ts +51 -0
  305. package/dist/utilities/__internal__/listStateUtils/listState.utils.d.ts.map +1 -0
  306. package/dist/utilities/__internal__/listStateUtils/listState.utils.js +43 -0
  307. package/dist/utilities/__internal__/listStateUtils/listState.utils.js.map +1 -0
  308. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.cjs +67 -0
  309. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.cjs.map +1 -0
  310. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.d.ts +27 -0
  311. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.d.ts.map +1 -0
  312. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.js +64 -0
  313. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.js.map +1 -0
  314. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs +28 -0
  315. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs.map +1 -1
  316. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts +10 -0
  317. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts.map +1 -1
  318. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js +28 -1
  319. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js.map +1 -1
  320. package/dist/utilities/listQueryUtils/index.cjs +59 -0
  321. package/dist/utilities/listQueryUtils/index.cjs.map +1 -0
  322. package/dist/utilities/listQueryUtils/index.d.ts +46 -0
  323. package/dist/utilities/listQueryUtils/index.d.ts.map +1 -0
  324. package/dist/utilities/listQueryUtils/index.js +55 -0
  325. package/dist/utilities/listQueryUtils/index.js.map +1 -0
  326. package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs +2 -0
  327. package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs.map +1 -1
  328. package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts +2 -0
  329. package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts.map +1 -1
  330. package/dist/utilities/localStorageUtils/localStorageUtils.constants.js +2 -0
  331. package/dist/utilities/localStorageUtils/localStorageUtils.constants.js.map +1 -1
  332. package/package.json +9 -9
  333. package/dist/components/forms/Form/utilities/focusFromCode.utils.cjs.map +0 -1
  334. package/dist/components/forms/Form/utilities/focusFromCode.utils.d.ts.map +0 -1
  335. package/dist/components/forms/Form/utilities/focusFromCode.utils.js.map +0 -1
  336. package/dist/components/organisms/Table/components/TableCardList.cjs.map +0 -1
  337. package/dist/components/organisms/Table/components/TableCardList.d.ts.map +0 -1
  338. package/dist/components/organisms/Table/components/TableCardList.js.map +0 -1
  339. package/dist/components/organisms/Table/components/TableCardRow.cjs.map +0 -1
  340. package/dist/components/organisms/Table/components/TableCardRow.d.ts.map +0 -1
  341. package/dist/components/organisms/Table/components/TableCardRow.js.map +0 -1
  342. package/dist/components/organisms/Table/components/TableCardsSelectAll.cjs.map +0 -1
  343. package/dist/components/organisms/Table/components/TableCardsSelectAll.d.ts.map +0 -1
  344. package/dist/components/organisms/Table/components/TableCardsSelectAll.js.map +0 -1
  345. package/dist/components/organisms/Table/components/TableFallbackCard.cjs.map +0 -1
  346. package/dist/components/organisms/Table/components/TableFallbackCard.d.ts.map +0 -1
  347. package/dist/components/organisms/Table/components/TableFallbackCard.js.map +0 -1
  348. package/dist/components/organisms/Table/components/TableFocusGuard.cjs +0 -23
  349. package/dist/components/organisms/Table/components/TableFocusGuard.cjs.map +0 -1
  350. package/dist/components/organisms/Table/components/TableFocusGuard.d.ts +0 -2
  351. package/dist/components/organisms/Table/components/TableFocusGuard.d.ts.map +0 -1
  352. package/dist/components/organisms/Table/components/TableFocusGuard.js +0 -21
  353. package/dist/components/organisms/Table/components/TableFocusGuard.js.map +0 -1
  354. package/dist/components/organisms/Table/components/TableLayoutToggle.cjs +0 -27
  355. package/dist/components/organisms/Table/components/TableLayoutToggle.cjs.map +0 -1
  356. package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts +0 -17
  357. package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts.map +0 -1
  358. package/dist/components/organisms/Table/components/TableLayoutToggle.js +0 -25
  359. package/dist/components/organisms/Table/components/TableLayoutToggle.js.map +0 -1
  360. package/dist/components/organisms/Table/components/TableRowCard.cjs.map +0 -1
  361. package/dist/components/organisms/Table/components/TableRowCard.d.ts.map +0 -1
  362. package/dist/components/organisms/Table/components/TableRowCard.js.map +0 -1
  363. package/dist/components/organisms/Table/components/TableSortIcon.cjs.map +0 -1
  364. package/dist/components/organisms/Table/components/TableSortIcon.d.ts.map +0 -1
  365. package/dist/components/organisms/Table/components/TableSortIcon.js.map +0 -1
  366. package/dist/components/organisms/Table/components/TableSortMenu.cjs.map +0 -1
  367. package/dist/components/organisms/Table/components/TableSortMenu.d.ts +0 -35
  368. package/dist/components/organisms/Table/components/TableSortMenu.d.ts.map +0 -1
  369. package/dist/components/organisms/Table/components/TableSortMenu.js.map +0 -1
  370. package/dist/components/organisms/Table/hooks/useFirstSortDirection.cjs.map +0 -1
  371. package/dist/components/organisms/Table/hooks/useFirstSortDirection.d.ts.map +0 -1
  372. package/dist/components/organisms/Table/hooks/useFirstSortDirection.js.map +0 -1
  373. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.cjs.map +0 -1
  374. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.d.ts.map +0 -1
  375. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.js.map +0 -1
  376. package/dist/components/organisms/Table/hooks/usePlaceholderRows.cjs.map +0 -1
  377. package/dist/components/organisms/Table/hooks/usePlaceholderRows.d.ts.map +0 -1
  378. package/dist/components/organisms/Table/hooks/usePlaceholderRows.js.map +0 -1
  379. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.cjs.map +0 -1
  380. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.d.ts.map +0 -1
  381. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.js.map +0 -1
  382. package/dist/components/organisms/Table/hooks/useTableSelection.cjs.map +0 -1
  383. package/dist/components/organisms/Table/hooks/useTableSelection.d.ts.map +0 -1
  384. package/dist/components/organisms/Table/hooks/useTableSelection.js.map +0 -1
  385. package/dist/components/organisms/Table/providers/Table.context.cjs.map +0 -1
  386. package/dist/components/organisms/Table/providers/Table.context.d.ts.map +0 -1
  387. package/dist/components/organisms/Table/providers/Table.context.js.map +0 -1
  388. package/dist/components/organisms/Table/table.types.d.ts.map +0 -1
  389. package/dist/components/organisms/Table/utilities/tableCard.utils.cjs.map +0 -1
  390. package/dist/components/organisms/Table/utilities/tableCard.utils.d.ts.map +0 -1
  391. package/dist/components/organisms/Table/utilities/tableCard.utils.js.map +0 -1
  392. package/dist/components/organisms/Table/utilities/tableChildren.utils.cjs.map +0 -1
  393. package/dist/components/organisms/Table/utilities/tableChildren.utils.d.ts.map +0 -1
  394. package/dist/components/organisms/Table/utilities/tableChildren.utils.js.map +0 -1
  395. package/dist/components/organisms/Table/utilities/tableSelection.utils.cjs.map +0 -1
  396. package/dist/components/organisms/Table/utilities/tableSelection.utils.d.ts.map +0 -1
  397. package/dist/components/organisms/Table/utilities/tableSelection.utils.js.map +0 -1
  398. package/dist/components/organisms/Table/utilities/tableSort.utils.cjs.map +0 -1
  399. package/dist/components/organisms/Table/utilities/tableSort.utils.d.ts.map +0 -1
  400. package/dist/components/organisms/Table/utilities/tableSort.utils.js.map +0 -1
  401. /package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.cjs +0 -0
  402. /package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.js +0 -0
  403. /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.cjs +0 -0
  404. /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.d.ts +0 -0
  405. /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.js +0 -0
  406. /package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.d.ts +0 -0
  407. /package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.cjs +0 -0
  408. /package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.js +0 -0
  409. /package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.cjs +0 -0
  410. /package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.js +0 -0
  411. /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.cjs +0 -0
  412. /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.d.ts +0 -0
  413. /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.js +0 -0
  414. /package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.cjs +0 -0
  415. /package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.js +0 -0
@@ -1,15 +1,22 @@
1
- import type { RowId } from '../table.types';
1
+ import type { RowId } from '../../tables.types';
2
2
  /**
3
3
  * Keeps the table's row action off placeholder rows. A placeholder row is disabled, but `disabledBehavior="selection"`
4
4
  * leaves a disabled row's action on, so the card list's `onAction` checks this set as well.
5
5
  *
6
6
  * @param onRowAction The table's `onRowAction`, or `undefined` when it has none.
7
- * @returns `register`, which a placeholder row calls with its id and whose cleanup drops it, and `onAction`, the row
8
- * action to give the card list: it skips a registered placeholder, and is `undefined` when the table has no row action.
7
+ * @returns `register`, which a placeholder row calls with its id and whose cleanup drops it; `onAction`, the row action to
8
+ * give the card list, which skips a registered placeholder and is `undefined` when the table has no row action; and
9
+ * `registry`, the placeholders' ids with a subscription, for a part that must follow them as they join or leave.
9
10
  */
10
11
  export declare const usePlaceholderRows: (onRowAction: ((key: RowId) => void) | undefined) => {
11
12
  register: (id: RowId) => () => void;
12
13
  onAction: ((key: RowId) => void) | undefined;
14
+ registry: {
15
+ register: (id: RowId) => () => void;
16
+ rowIds: import("react").RefObject<Set<RowId>>;
17
+ subscribe: (listener: () => void) => () => void;
18
+ getVersion: () => number;
19
+ };
13
20
  };
14
21
  /**
15
22
  * Joins one placeholder row to the table's placeholder set while it carries `Table.RowCard.Skeleton`, in either layout.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePlaceholderRows.d.ts","sourceRoot":"","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/usePlaceholderRows.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,aAAa,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS;;qBAKtE,KAAK;;;;;;;CAMhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAU,CAAC,CAAC,EAAE,EAAE,KAAK,KAAK,MAAM,IAAI,CAAC,GAAG,SAAS,EAAE,IAAI,KAAK,GAAG,SAAS,EAAE,eAAe,OAAO,SAEzI,CAAC"}
@@ -1,28 +1,25 @@
1
- import { useEffect, useRef, useCallback } from 'react';
1
+ import { useEffect } from 'react';
2
+ import { useSelectableRowRegistry } from './useSelectableRowRegistry.js';
2
3
 
3
4
  /**
4
5
  * Keeps the table's row action off placeholder rows. A placeholder row is disabled, but `disabledBehavior="selection"`
5
6
  * leaves a disabled row's action on, so the card list's `onAction` checks this set as well.
6
7
  *
7
8
  * @param onRowAction The table's `onRowAction`, or `undefined` when it has none.
8
- * @returns `register`, which a placeholder row calls with its id and whose cleanup drops it, and `onAction`, the row
9
- * action to give the card list: it skips a registered placeholder, and is `undefined` when the table has no row action.
9
+ * @returns `register`, which a placeholder row calls with its id and whose cleanup drops it; `onAction`, the row action to
10
+ * give the card list, which skips a registered placeholder and is `undefined` when the table has no row action; and
11
+ * `registry`, the placeholders' ids with a subscription, for a part that must follow them as they join or leave.
10
12
  */
11
13
  const usePlaceholderRows = (onRowAction) => {
12
- const placeholderIds = useRef(new Set());
13
- const register = useCallback((id) => {
14
- placeholderIds.current.add(id);
15
- return () => {
16
- placeholderIds.current.delete(id);
17
- };
18
- }, []);
14
+ // The same id registry selectable rows use, so select all can subscribe to placeholders too.
15
+ const registry = useSelectableRowRegistry();
19
16
  const onAction = onRowAction
20
17
  ? (key) => {
21
- if (!placeholderIds.current.has(key))
18
+ if (!registry.rowIds.current.has(key))
22
19
  onRowAction(key);
23
20
  }
24
21
  : undefined;
25
- return { register, onAction };
22
+ return { register: registry.register, onAction, registry };
26
23
  };
27
24
  /**
28
25
  * Joins one placeholder row to the table's placeholder set while it carries `Table.RowCard.Skeleton`, in either layout.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePlaceholderRows.js","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/usePlaceholderRows.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAMA;;;;;;;;AAQG;AACI,MAAM,kBAAkB,GAAG,CAAC,WAA+C,KAAI;;AAEpF,IAAA,MAAM,QAAQ,GAAG,wBAAwB,EAAE;IAE3C,MAAM,QAAQ,GAAG;AACf,UAAE,CAAC,GAAU,KAAI;YACb,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,WAAW,CAAC,GAAG,CAAC;QACzD;UACA,SAAS;IAEb,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE;AAC5D;AAEA;;;;;;;AAOG;AACI,MAAM,yBAAyB,GAAG,CAAC,QAAiD,EAAE,EAAqB,EAAE,aAAsB,KAAI;AAC5I,IAAA,SAAS,CAAC,OAAO,aAAa,IAAI,EAAE,KAAK,SAAS,GAAG,QAAQ,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,aAAa,CAAC,CAAC;AAClH;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectableRowRegistry.cjs","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.ts"],"sourcesContent":[null],"names":["useRef","useCallback","useEffect"],"mappings":";;;;AAKA;;;;;;AAMG;AACI,MA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K,SAAS,IAAI,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;AAC5G;;;"}
@@ -1,4 +1,4 @@
1
- import type { RowId } from '../table.types';
1
+ import type { RowId } from '../../tables.types';
2
2
  /**
3
3
  * Remembers which selectable rows are mounted so "select all" can name them instead of react-aria's `'all'`.
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectableRowRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;mBAMD,KAAK;;0BAaE,MAAM,IAAI;;CAUpD,CAAC;AAEF,qGAAqG;AACrG,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,CAAC,CAAC,EAAE,EAAE,KAAK,KAAK,MAAM,IAAI,CAAC,GAAG,SAAS,EACjD,IAAI,KAAK,GAAG,SAAS,EACrB,YAAY,OAAO,GAAG,SAAS,SAGhC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelectableRowRegistry.js","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;;AAMG;AACI,MAAM,wBAAwB,GAAG,MAAK;;IAE3C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,GAAG,EAAS,CAAC;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,EAAc,CAAC;AAC/C,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AAEzB,IAAA,MAAM,QAAQ,GAAG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ableFocusHandOff_utils = require('../utilities/tableFocusHandOff.utils.cjs');
6
+
7
+ /**
8
+ * One table's focus hand-off: a press on a button or link in its empty state that removes it hands keyboard focus to what
9
+ * replaces it, the first row or card to mount or the next empty state's title, so the page wires no refs of its own.
10
+ *
11
+ * @returns The refs for the rows and the titles and the props for the empty state's wrapper, the same objects on every
12
+ * render, so a row or title already on screen never spends a hand-off. A hand-off waits while the pressed control is still
13
+ * on the page, and ends once focus moves on: to a target, or anywhere the user presses or focuses outside the control.
14
+ */
15
+ const useTableFocusHandOff = () => {
16
+ const { handOff, targetRef } = useFocusHandOff.useFocusHandOff();
17
+ const pressed = React.useRef(null);
18
+ const scope = React.useRef(null);
19
+ // A table that unmounts mid hand-off, as a link in its empty state navigates away, leaves no listener behind.
20
+ React.useEffect(() => () => pressed.current?.stopWatching(), []);
21
+ return React.useMemo(() => {
22
+ const markPending = handOff(() => undefined);
23
+ const end = () => {
24
+ pressed.current?.stopWatching();
25
+ pressed.current = null;
26
+ };
27
+ const start = (control) => {
28
+ if (!control || pressed.current?.control === control)
29
+ return;
30
+ end();
31
+ // A modal the control opens, or a click on blank space, means the user moved on, though the control stays.
32
+ const stopWatching = tableFocusHandOff_utils.watchForLeaving(control, () => {
33
+ if (pressed.current?.control === control)
34
+ end();
35
+ });
36
+ pressed.current = { control, stopWatching };
37
+ };
38
+ const handOffTo = (target) => {
39
+ const control = pressed.current?.control;
40
+ // Still on the page, the control was not what this target replaced, as "Try again" stays while a retry runs.
41
+ if (!control || control.isConnected)
42
+ return;
43
+ const { ownerDocument } = target;
44
+ if (ownerDocument.activeElement === ownerDocument.body) {
45
+ markPending();
46
+ targetRef(target);
47
+ }
48
+ // Held, or put elsewhere by the user: either way it is over; a target that could not hold it leaves it for the next.
49
+ if (ownerDocument.activeElement !== ownerDocument.body)
50
+ end();
51
+ };
52
+ return {
53
+ // React-aria gives a row it can focus a `tabindex` and a disabled one none, which the hand-off would make focusable.
54
+ rowRef: (row) => {
55
+ if (row?.hasAttribute('tabindex'))
56
+ handOffTo(row);
57
+ },
58
+ // After the commit, past the empty state the card list redraws once before its cards, and never through a portal.
59
+ titleRef: (title) => {
60
+ if (!title)
61
+ return;
62
+ queueMicrotask(() => {
63
+ if (title.isConnected && scope.current?.contains(title))
64
+ handOffTo(title);
65
+ });
66
+ },
67
+ scopeProps: {
68
+ ref: scope,
69
+ // In capture, as react-aria stops a press's keydown from propagating; it presses on a later event.
70
+ onKeyDownCapture: (event) => {
71
+ const control = tableFocusHandOff_utils.pressedControlOf(event.target, event.currentTarget);
72
+ if (control && tableFocusHandOff_utils.isPressKey(control, event.key))
73
+ start(control);
74
+ },
75
+ // React-aria presses on the click, which reaches the control before its action can remove it; a press dragged off lands its click elsewhere.
76
+ onClickCapture: (event) => start(tableFocusHandOff_utils.pressedControlOf(event.target, event.currentTarget)),
77
+ },
78
+ };
79
+ }, [handOff, targetRef]);
80
+ };
81
+
82
+ exports.useTableFocusHandOff = useTableFocusHandOff;
83
+ //# sourceMappingURL=useTableFocusHandOff.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableFocusHandOff.cjs","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useTableFocusHandOff.ts"],"sourcesContent":[null],"names":["useFocusHandOff","useRef","useEffect","useMemo","watchForLeaving","pressedControlOf","isPressKey"],"mappings":";;;;;;AAwBA;;;;;;;AAOG;AACI,MAAM,oBAAoB,GAAG,MAAwB;IAC1D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAGA,+BAAe,EAAE;AAChD,IAAA,MAAM,OAAO,GAAGC,YAAM,CAAwB,IAAI,CAAC;AACnD,IAAA,MAAM,KAAK,GAAGA,YAAM,CAAiB,IAAI,CAAC;;AAG1C,IAAAC,eAAS,CAAC,MAAM,MAAM,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAE1D,OAAOC,aAAO,CAAC,MAAK;QAClB,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,SAA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gBACZ,cAAc,CAAC,MAAK;oBAClB,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC;wBAAE,SAAS,CAAC,KAAK,CAAC;AAC3E,gBAAA,CAAC,CAAC;YACJ,CAAC;AACD,YAAA,UAAU,EAAE;AACV,gBAAA,GAAG,EAAE,KAAK;;AAEV,gBAAA,gBAAgB,EAAE,CAAC,KAAK,KAAI;AAC1B,oBAAA,MAAM,OAAO,GAAGC,wCAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;oBACnE,IAAI,OAAO,IAAIC,kCAAU,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC;wBAAE,KAAK,CAAC,OAAO,CAAC;gBAC/D,CAAC;;AAED,gBAAA,cAAc,EAAE,CAAC,KAAK,KAAK,KAAK,CAACD,wCAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;AACtF,aAAA;SACF;AACH,IAAA,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAC1B;;"}
@@ -0,0 +1,23 @@
1
+ import { type KeyboardEvent, type Ref, type RefCallback, type SyntheticEvent } from 'react';
2
+ export interface TableFocusHandOff {
3
+ /** For each real row and card: the first to mount once the pressed control has gone takes focus, if focus fell to the page. */
4
+ rowRef: RefCallback<HTMLElement>;
5
+ /** For a title in the empty state: the same, once its commit ends, and only for one inside the empty state's own element. */
6
+ titleRef: RefCallback<HTMLElement>;
7
+ /** For the element around the empty state: a press on a button or link inside it starts a hand-off. */
8
+ scopeProps: {
9
+ ref: Ref<HTMLDivElement>;
10
+ onKeyDownCapture: (event: KeyboardEvent<HTMLElement>) => void;
11
+ onClickCapture: (event: SyntheticEvent<HTMLElement>) => void;
12
+ };
13
+ }
14
+ /**
15
+ * One table's focus hand-off: a press on a button or link in its empty state that removes it hands keyboard focus to what
16
+ * replaces it, the first row or card to mount or the next empty state's title, so the page wires no refs of its own.
17
+ *
18
+ * @returns The refs for the rows and the titles and the props for the empty state's wrapper, the same objects on every
19
+ * render, so a row or title already on screen never spends a hand-off. A hand-off waits while the pressed control is still
20
+ * on the page, and ends once focus moves on: to a target, or anywhere the user presses or focuses outside the control.
21
+ */
22
+ export declare const useTableFocusHandOff: () => TableFocusHandOff;
23
+ //# sourceMappingURL=useTableFocusHandOff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableFocusHandOff.d.ts","sourceRoot":"","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useTableFocusHandOff.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,GAAG,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAA8B,MAAM,OAAO,CAAC;AAGxH,MAAM,WAAW,iBAAiB;IAChC,+HAA+H;IAC/H,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACjC,6HAA6H;IAC7H,QAAQ,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACnC,uGAAuG;IACvG,UAAU,EAAE;QACV,GAAG,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;QACzB,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,cAAc,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;KAC9D,CAAC;CACH;AAOD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,QAAO,iBA+DvC,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { useFocusHandOff } from '@flipdish/ui-library/hooks/useFocusHandOff';
2
+ import { useRef, useEffect, useMemo } from 'react';
3
+ import { pressedControlOf, isPressKey, watchForLeaving } from '../utilities/tableFocusHandOff.utils.js';
4
+
5
+ /**
6
+ * One table's focus hand-off: a press on a button or link in its empty state that removes it hands keyboard focus to what
7
+ * replaces it, the first row or card to mount or the next empty state's title, so the page wires no refs of its own.
8
+ *
9
+ * @returns The refs for the rows and the titles and the props for the empty state's wrapper, the same objects on every
10
+ * render, so a row or title already on screen never spends a hand-off. A hand-off waits while the pressed control is still
11
+ * on the page, and ends once focus moves on: to a target, or anywhere the user presses or focuses outside the control.
12
+ */
13
+ const useTableFocusHandOff = () => {
14
+ const { handOff, targetRef } = useFocusHandOff();
15
+ const pressed = useRef(null);
16
+ const scope = useRef(null);
17
+ // A table that unmounts mid hand-off, as a link in its empty state navigates away, leaves no listener behind.
18
+ useEffect(() => () => pressed.current?.stopWatching(), []);
19
+ return useMemo(() => {
20
+ const markPending = handOff(() => undefined);
21
+ const end = () => {
22
+ pressed.current?.stopWatching();
23
+ pressed.current = null;
24
+ };
25
+ const start = (control) => {
26
+ if (!control || pressed.current?.control === control)
27
+ return;
28
+ end();
29
+ // A modal the control opens, or a click on blank space, means the user moved on, though the control stays.
30
+ const stopWatching = watchForLeaving(control, () => {
31
+ if (pressed.current?.control === control)
32
+ end();
33
+ });
34
+ pressed.current = { control, stopWatching };
35
+ };
36
+ const handOffTo = (target) => {
37
+ const control = pressed.current?.control;
38
+ // Still on the page, the control was not what this target replaced, as "Try again" stays while a retry runs.
39
+ if (!control || control.isConnected)
40
+ return;
41
+ const { ownerDocument } = target;
42
+ if (ownerDocument.activeElement === ownerDocument.body) {
43
+ markPending();
44
+ targetRef(target);
45
+ }
46
+ // Held, or put elsewhere by the user: either way it is over; a target that could not hold it leaves it for the next.
47
+ if (ownerDocument.activeElement !== ownerDocument.body)
48
+ end();
49
+ };
50
+ return {
51
+ // React-aria gives a row it can focus a `tabindex` and a disabled one none, which the hand-off would make focusable.
52
+ rowRef: (row) => {
53
+ if (row?.hasAttribute('tabindex'))
54
+ handOffTo(row);
55
+ },
56
+ // After the commit, past the empty state the card list redraws once before its cards, and never through a portal.
57
+ titleRef: (title) => {
58
+ if (!title)
59
+ return;
60
+ queueMicrotask(() => {
61
+ if (title.isConnected && scope.current?.contains(title))
62
+ handOffTo(title);
63
+ });
64
+ },
65
+ scopeProps: {
66
+ ref: scope,
67
+ // In capture, as react-aria stops a press's keydown from propagating; it presses on a later event.
68
+ onKeyDownCapture: (event) => {
69
+ const control = pressedControlOf(event.target, event.currentTarget);
70
+ if (control && isPressKey(control, event.key))
71
+ start(control);
72
+ },
73
+ // React-aria presses on the click, which reaches the control before its action can remove it; a press dragged off lands its click elsewhere.
74
+ onClickCapture: (event) => start(pressedControlOf(event.target, event.currentTarget)),
75
+ },
76
+ };
77
+ }, [handOff, targetRef]);
78
+ };
79
+
80
+ export { useTableFocusHandOff };
81
+ //# sourceMappingURL=useTableFocusHandOff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableFocusHandOff.js","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useTableFocusHandOff.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAwBA;;;;;;;AAOG;AACI,MAAM,oBAAoB,GAAG,MAAwB;IAC1D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE;AAChD,IAAA,MAAM,OAAO,GAAG,MAAM,CAAwB,IAAI,CAAC;AACnD,IAAA,MAAM,KAAK,GAAG,MAAM,CAAiB,IAAI,CAAC;;AAG1C,IAAA,SAAS,CAAC,MAAM,MAAM,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAE1D,OAAO,OAAO,CAAC,MAAK;QAClB,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,SAAS,CAAC;QAE5C,MAAM,GAAG,GAAG,MAAK;AACf,YAAA,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE;AAC/B,YAAA,OAAO,CAAC,OAAO,GAAG,IAAI;AACxB,QAAA,CAAC;AAED,QAAA,MAAM,KAAK,GAAG,CAAC,OAAuB,KAAI;YACxC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO;gBAAE;AACtD,YAAA,GAAG,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MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;oBACnE,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC;wBAAE,KAAK,CAAC,OAAO,CAAC;gBAC/D,CAAC;;AAED,gBAAA,cAAc,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;AACtF,aAAA;SACF;AACH,IAAA,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAC1B;;"}
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var tableIterable_utils = require('../../utilities/tableIterable.utils.cjs');
4
5
  var tableSelection_utils = require('../utilities/tableSelection.utils.cjs');
5
6
 
6
7
  // React 18's StrictMode runs a state initialiser twice and keeps the second run, so a one-shot iterator is read once per identity.
@@ -20,9 +21,9 @@ const defaultSelectionOf = (keys) => {
20
21
  *
21
22
  * @param options The controlled values, the default, the listeners and the row registry; see `UseTableSelectionOptions`.
22
23
  * @returns `selectedKeys`, to pass to whichever layout renders, and `onSelectionChange`, which keeps an uncontrolled
23
- * change and reports it.
24
+ * change and reports it, and ignores a select all while the page is placeholders, as while the table loads.
24
25
  */
25
- const useTableSelection = ({ selectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, rowIds, ...listeners }) => {
26
+ const useTableSelection = ({ selectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, rowIds, isPlaceholderPage = false, ...listeners }) => {
26
27
  // Copied once, so a one-shot iterable still holds its rows for the next render and for the other layout.
27
28
  const [ownSelection, setOwnSelection] = React.useState(() => {
28
29
  if (defaultSelectedKeys === undefined)
@@ -30,15 +31,22 @@ const useTableSelection = ({ selectedKey, selectedKeys, defaultSelectedKeys, dis
30
31
  return defaultSelectedKeys === 'all' ? 'all' : defaultSelectionOf(defaultSelectedKeys);
31
32
  });
32
33
  const isControlled = selectedKey !== undefined || selectedKeys !== undefined;
34
+ // Read on every change, and by react-aria too, so a one-shot iterator is read once.
35
+ const reusableDisabledKeys = tableIterable_utils.reusableIterableOf(disabledKeys);
33
36
  const currentSelection = () => {
34
37
  if (selectedKey !== undefined)
35
38
  return tableSelection_utils.selectionOfKey(selectedKey);
36
- return selectedKeys ?? ownSelection;
39
+ if (selectedKeys === 'all')
40
+ return 'all';
41
+ // React-aria reads it, and so does the cards' select all, so a one-shot iterator is read once.
42
+ return tableIterable_utils.reusableIterableOf(selectedKeys) ?? ownSelection;
37
43
  };
38
44
  const onSelectionChange = (selection) => {
45
+ if (selection === 'all' && isPlaceholderPage)
46
+ return;
39
47
  if (!isControlled)
40
48
  setOwnSelection(selection);
41
- tableSelection_utils.reportSelectionChange(selection, rowIds.current ?? [], disabledKeys, listeners);
49
+ tableSelection_utils.reportSelectionChange(selection, rowIds.current ?? [], reusableDisabledKeys, listeners);
42
50
  };
43
51
  return { selectedKeys: currentSelection(), onSelectionChange };
44
52
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableSelection.cjs","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useTableSelection.ts"],"sourcesContent":[null],"names":["useState","reusableIterableOf","selectionOfKey","reportSelectionChange"],"mappings":";;;;;;AAUA;AACA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAsB;AAEzD,MAAM,kBAAkB,GAAG,CAAC,IAAqB,KAAgB;;IAE/D,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;AACtF,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC;AACpC,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,C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BAAiB,EAAE;AAChE;;"}
@@ -1,5 +1,5 @@
1
1
  import { type RefObject } from 'react';
2
- import type { RowId } from '../table.types';
2
+ import type { RowId } from '../../tables.types';
3
3
  import { type SelectionChangeListeners } from '../utilities/tableSelection.utils';
4
4
  /** The selection react-aria takes and reports. */
5
5
  type RowSelection = 'all' | Iterable<RowId>;
@@ -14,6 +14,8 @@ export interface UseTableSelectionOptions extends SelectionChangeListeners {
14
14
  disabledKeys?: Iterable<RowId>;
15
15
  /** The mounted selectable rows, which "select all" is reported as. */
16
16
  rowIds: RefObject<Set<RowId>>;
17
+ /** Whether the page is placeholders, from `useIsPlaceholderPage`: a select all then would store `'all'` for the rows that load next. */
18
+ isPlaceholderPage?: boolean;
17
19
  }
18
20
  /**
19
21
  * Holds a table's selection above its layout switch, so a selection the consumer does not control survives the table
@@ -21,9 +23,9 @@ export interface UseTableSelectionOptions extends SelectionChangeListeners {
21
23
  *
22
24
  * @param options The controlled values, the default, the listeners and the row registry; see `UseTableSelectionOptions`.
23
25
  * @returns `selectedKeys`, to pass to whichever layout renders, and `onSelectionChange`, which keeps an uncontrolled
24
- * change and reports it.
26
+ * change and reports it, and ignores a select all while the page is placeholders, as while the table loads.
25
27
  */
26
- export declare const useTableSelection: ({ selectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, rowIds, ...listeners }: UseTableSelectionOptions) => {
28
+ export declare const useTableSelection: ({ selectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, rowIds, isPlaceholderPage, ...listeners }: UseTableSelectionOptions) => {
27
29
  selectedKeys: RowSelection;
28
30
  onSelectionChange: (selection: "all" | Set<RowId>) => void;
29
31
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableSelection.d.ts","sourceRoot":"","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useTableSelection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAyB,KAAK,wBAAwB,EAAkB,MAAM,mCAAmC,CAAC;AAEzH,kDAAkD;AAClD,KAAK,YAAY,GAAG,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAc5C,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB;IACxE,0GAA0G;IAC1G,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC3B,yDAAyD;IACzD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,+DAA+D;IAC/D,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,sEAAsE;IACtE,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9B,wIAAwI;IACxI,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,2GAQ/B,wBAAwB;;mCAiBa,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;CAOzD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { useState } from 'react';
2
+ import { reusableIterableOf } from '../../utilities/tableIterable.utils.js';
2
3
  import { reportSelectionChange, selectionOfKey } from '../utilities/tableSelection.utils.js';
3
4
 
4
5
  // React 18's StrictMode runs a state initialiser twice and keeps the second run, so a one-shot iterator is read once per identity.
@@ -18,9 +19,9 @@ const defaultSelectionOf = (keys) => {
18
19
  *
19
20
  * @param options The controlled values, the default, the listeners and the row registry; see `UseTableSelectionOptions`.
20
21
  * @returns `selectedKeys`, to pass to whichever layout renders, and `onSelectionChange`, which keeps an uncontrolled
21
- * change and reports it.
22
+ * change and reports it, and ignores a select all while the page is placeholders, as while the table loads.
22
23
  */
23
- const useTableSelection = ({ selectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, rowIds, ...listeners }) => {
24
+ const useTableSelection = ({ selectedKey, selectedKeys, defaultSelectedKeys, disabledKeys, rowIds, isPlaceholderPage = false, ...listeners }) => {
24
25
  // Copied once, so a one-shot iterable still holds its rows for the next render and for the other layout.
25
26
  const [ownSelection, setOwnSelection] = useState(() => {
26
27
  if (defaultSelectedKeys === undefined)
@@ -28,15 +29,22 @@ const useTableSelection = ({ selectedKey, selectedKeys, defaultSelectedKeys, dis
28
29
  return defaultSelectedKeys === 'all' ? 'all' : defaultSelectionOf(defaultSelectedKeys);
29
30
  });
30
31
  const isControlled = selectedKey !== undefined || selectedKeys !== undefined;
32
+ // Read on every change, and by react-aria too, so a one-shot iterator is read once.
33
+ const reusableDisabledKeys = reusableIterableOf(disabledKeys);
31
34
  const currentSelection = () => {
32
35
  if (selectedKey !== undefined)
33
36
  return selectionOfKey(selectedKey);
34
- return selectedKeys ?? ownSelection;
37
+ if (selectedKeys === 'all')
38
+ return 'all';
39
+ // React-aria reads it, and so does the cards' select all, so a one-shot iterator is read once.
40
+ return reusableIterableOf(selectedKeys) ?? ownSelection;
35
41
  };
36
42
  const onSelectionChange = (selection) => {
43
+ if (selection === 'all' && isPlaceholderPage)
44
+ return;
37
45
  if (!isControlled)
38
46
  setOwnSelection(selection);
39
- reportSelectionChange(selection, rowIds.current ?? [], disabledKeys, listeners);
47
+ reportSelectionChange(selection, rowIds.current ?? [], reusableDisabledKeys, listeners);
40
48
  };
41
49
  return { selectedKeys: currentSelection(), onSelectionChange };
42
50
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableSelection.js","sources":["../../../../../../src/components/organisms/Tables/Table/hooks/useTableSelection.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAUA;AACA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAsB;AAEzD,MAAM,kBAAkB,GAAG,CAAC,IAAqB,KAAgB;;IAE/D,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAA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E,eAAe,CAAC,SAAS,CAAC;AAC7C,QAAA,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,oBAAoB,EAAE,SAAS,CAAC;AACzF,IAAA,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,iBAAiB,EAAE;AAChE;;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.context.cjs","sources":["../../../../../../src/components/organisms/Tables/Table/providers/Table.context.ts"],"sourcesContent":[null],"names":["createContext"],"mappings":";;;;AA6BO,MAAM,YAAY,GAAGA,mBAAa,CAAoB,EAAE,IAAI,EAAE,IAAI,EAAE;AAWpE,MAAM,sBAAsB,GAAGA,mBAAa,CAA8B,EAAE,MAAM,EAAE,OAAO,EAAE;AAoBpG;MACa,mBAAmB,GAAGA,mBAAa,CAAkC,IAAI;AAEtF;MACa,0BAA0B,GAAGA,mBAAa,CAAC,KAAK;AAE7D;MACa,iCAAiC,GAAGA,mBAAa,CAAC,KAAK;;;;;;"}
@@ -1,5 +1,7 @@
1
+ import { type ReactNode } from 'react';
1
2
  import type { Key } from 'react-aria-components';
2
- import type { TableCardColumn, TableCardListProps, TableLayout } from '../table.types';
3
+ import type { TableCardColumn, TableCardListProps, TableLayout, TableRowColor } from '../../tables.types';
4
+ import type { TableFocusHandOff } from '../hooks/useTableFocusHandOff';
3
5
  export interface TableContextValue {
4
6
  size: 'sm' | 'md';
5
7
  /** The layout the table renders; unset outside a `Table`, as inside `TableCard.Root` alone. */
@@ -8,12 +10,18 @@ export interface TableContextValue {
8
10
  hasRowAction?: boolean;
9
11
  /** Records a selectable row's id so "select all" can be reported as the rows it covers; returns the cleanup. */
10
12
  registerRow?: (id: Key) => () => void;
11
- /** Card layout only: records a placeholder row's id so the row action skips it; returns the cleanup. */
13
+ /** The page is placeholders, as while `isLoading`: the header's select all is off, as it would select only rows still to load. */
14
+ isPlaceholderPage?: boolean;
15
+ /** Records a placeholder row's id, in both layouts, so the row action skips it and select all knows a page of placeholders; returns the cleanup. */
12
16
  registerPlaceholder?: (id: Key) => () => void;
13
17
  /** Card layout only: every column as `Table.Header` declares it, which the fallback card labels its lines with. */
14
18
  columns?: TableCardColumn[];
15
19
  /** Card layout only: the table's props for the `GridList` that `Table.Body` renders. */
16
20
  listProps?: TableCardListProps;
21
+ /** While the table is `isLoading`: the rows `Table.Body` renders in place of its children. */
22
+ loadingRows?: ReactNode;
23
+ /** Hands focus from a pressed control in the empty state to what replaces it; unset outside a `Table`. */
24
+ focusHandOff?: TableFocusHandOff;
17
25
  }
18
26
  export declare const TableContext: import("react").Context<TableContextValue>;
19
27
  export interface TableCardLayoutContextValue {
@@ -21,6 +29,8 @@ export interface TableCardLayoutContextValue {
21
29
  layout: TableLayout;
22
30
  /** Lets that `Table` report its layout, so the card drops its surface while the table shows cards. */
23
31
  setLayout?: (layout: TableLayout) => void;
32
+ /** Lets a `Table` inside report that it is loading, so the card is `aria-busy` until each has let go; unset where no card listens. */
33
+ registerBusy?: () => () => void;
24
34
  }
25
35
  export declare const TableCardLayoutContext: import("react").Context<TableCardLayoutContextValue>;
26
36
  export interface TableRowCardContextValue {
@@ -35,6 +45,8 @@ export interface TableRowCardContextValue {
35
45
  showsSelection: boolean;
36
46
  /** The row carries `Table.RowCard.Skeleton`: nothing to press or select, and a skeleton in place of its checkbox. */
37
47
  isPlaceholder: boolean;
48
+ /** The row's status tint; unset for a placeholder, which ignores it. */
49
+ color?: TableRowColor;
38
50
  /** The row's resolved `data-testid`, which the card's derives from. */
39
51
  testId?: string;
40
52
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.context.d.ts","sourceRoot":"","sources":["../../../../../../src/components/organisms/Tables/Table/providers/Table.context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAA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AS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,+HAA+H;IAC/H,cAAc,EAAE,OAAO,CAAC;IACxB,qHAAqH;IACrH,aAAa,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,eAAO,MAAM,mBAAmB,0DAAuD,CAAC;AAGxF,eAAO,MAAM,0BAA0B,kCAAuB,CAAC;AAG/D,eAAO,MAAM,iCAAiC,kCAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.context.js","sources":["../../../../../../src/components/organisms/Tables/Table/providers/Table.context.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA6BO,MAAM,YAAY,GAAG,aAAa,CAAoB,EAAE,IAAI,EAAE,IAAI,EAAE;AAWpE,MAAM,sBAAsB,GAAG,aAAa,CAA8B,EAAE,MAAM,EAAE,OAAO,EAAE;AAoBpG;MACa,mBAAmB,GAAG,aAAa,CAAkC,IAAI;AAEtF;MACa,0BAA0B,GAAG,aAAa,CAAC,KAAK;AAE7D;MACa,iCAAiC,GAAG,aAAa,CAAC,KAAK;;"}
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ // What react-aria renders for something a press acts on: a button, a link, or a link with no `href` as `role="link"`; and a native input button.
4
+ const CONTROL_SELECTOR = 'button, a[href], [role="button"], [role="link"], input[type="submit"], input[type="button"], input[type="reset"], input[type="image"]';
5
+ /**
6
+ * Finds the control a press inside a table's empty state landed on, which a hand-off waits on to leave the page.
7
+ * @param target - The event's target. React passes on an event from a modal or popover the empty state opened, but its
8
+ * target sits in a portal, outside `scope`.
9
+ * @param scope - The element around the empty state.
10
+ * @returns The nearest enabled button or link around the target, when it sits inside `scope`; `null` for a press on text,
11
+ * on a disabled control, or outside `scope`.
12
+ */
13
+ const pressedControlOf = (target, scope) => {
14
+ if (!(target instanceof Element))
15
+ return null;
16
+ const control = target.closest(CONTROL_SELECTOR);
17
+ if (!control || !scope.contains(control) || control.matches(':disabled, [aria-disabled="true"]'))
18
+ return null;
19
+ return control;
20
+ };
21
+ // A link as react-aria reads one: `Space` scrolls past it, and only `Enter` presses it; `role="button"` on an anchor makes it a button.
22
+ const LINK_SELECTOR = '[role="link"], a[href]:not([role])';
23
+ /**
24
+ * Whether a key pressed on a control presses it, so a hand-off should wait on it.
25
+ * @param control - The control the key landed on, from `pressedControlOf`.
26
+ * @param key - The event's `key`.
27
+ * @returns `true` for `Enter` on any control and `Space` on any but a link; `false` for every other key.
28
+ */
29
+ const isPressKey = (control, key) => key === 'Enter' || (key === ' ' && !control.matches(LINK_SELECTOR));
30
+ /**
31
+ * Watches for the user moving on from a pressed control that is still on the page: a pointer press, or focus, anywhere
32
+ * outside it, such as a click on blank space or a modal the control opened taking focus.
33
+ * @param control - The pressed control; a press on it again, or focus returning to it, is not moving on.
34
+ * @param onLeave - Called on each such press or focus, until the watch stops.
35
+ * @returns Stops the watch.
36
+ */
37
+ const watchForLeaving = (control, onLeave) => {
38
+ const { ownerDocument } = control;
39
+ const leaveIfOutside = (event) => {
40
+ if (!(event.target instanceof Node) || !control.contains(event.target))
41
+ onLeave();
42
+ };
43
+ // In capture, so an element that stops a press or focus event from propagating still ends the watch.
44
+ ownerDocument.addEventListener('pointerdown', leaveIfOutside, true);
45
+ ownerDocument.addEventListener('focusin', leaveIfOutside, true);
46
+ return () => {
47
+ ownerDocument.removeEventListener('pointerdown', leaveIfOutside, true);
48
+ ownerDocument.removeEventListener('focusin', leaveIfOutside, true);
49
+ };
50
+ };
51
+
52
+ exports.isPressKey = isPressKey;
53
+ exports.pressedControlOf = pressedControlOf;
54
+ exports.watchForLeaving = watchForLeaving;
55
+ //# sourceMappingURL=tableFocusHandOff.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableFocusHandOff.utils.cjs","sources":["../../../../../../src/components/organisms/Tables/Table/utilities/tableFoc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tE,aAAa,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,EAAE,IAAI,CAAC;AACpE,IAAA,CAAC;AACH;;;;"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Finds the control a press inside a table's empty state landed on, which a hand-off waits on to leave the page.
3
+ * @param target - The event's target. React passes on an event from a modal or popover the empty state opened, but its
4
+ * target sits in a portal, outside `scope`.
5
+ * @param scope - The element around the empty state.
6
+ * @returns The nearest enabled button or link around the target, when it sits inside `scope`; `null` for a press on text,
7
+ * on a disabled control, or outside `scope`.
8
+ */
9
+ export declare const pressedControlOf: (target: EventTarget | null, scope: Element) => Element | null;
10
+ /**
11
+ * Whether a key pressed on a control presses it, so a hand-off should wait on it.
12
+ * @param control - The control the key landed on, from `pressedControlOf`.
13
+ * @param key - The event's `key`.
14
+ * @returns `true` for `Enter` on any control and `Space` on any but a link; `false` for every other key.
15
+ */
16
+ export declare const isPressKey: (control: Element, key: string) => boolean;
17
+ /**
18
+ * Watches for the user moving on from a pressed control that is still on the page: a pointer press, or focus, anywhere
19
+ * outside it, such as a click on blank space or a modal the control opened taking focus.
20
+ * @param control - The pressed control; a press on it again, or focus returning to it, is not moving on.
21
+ * @param onLeave - Called on each such press or focus, until the watch stops.
22
+ * @returns Stops the watch.
23
+ */
24
+ export declare const watchForLeaving: (control: Element, onLeave: () => void) => (() => void);
25
+ //# sourceMappingURL=tableFocusHandOff.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableFocusHandOff.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,WAAW,GAAG,IAAI,EAAE,OAAO,OAAO,KAAG,OAAO,GAAG,IAKvF,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,OAAO,EAAE,KAAK,MAAM,KAAG,OAA8E,CAAC;AAE1I;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,OAAO,EAAE,SAAS,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAYlF,CAAC"}