@flipdish/ui-library 0.67.1 → 0.69.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 (195) hide show
  1. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.cjs +10 -4
  2. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.cjs.map +1 -1
  3. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.d.ts +3 -3
  4. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.d.ts.map +1 -1
  5. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.js +11 -5
  6. package/dist/components/atoms/PhoneInput/hooks/usePhoneEntry.js.map +1 -1
  7. package/dist/components/atoms/PhoneInput/utilities/phoneEntry.utils.cjs +13 -0
  8. package/dist/components/atoms/PhoneInput/utilities/phoneEntry.utils.cjs.map +1 -1
  9. package/dist/components/atoms/PhoneInput/utilities/phoneEntry.utils.d.ts +9 -0
  10. package/dist/components/atoms/PhoneInput/utilities/phoneEntry.utils.d.ts.map +1 -1
  11. package/dist/components/atoms/PhoneInput/utilities/phoneEntry.utils.js +14 -2
  12. package/dist/components/atoms/PhoneInput/utilities/phoneEntry.utils.js.map +1 -1
  13. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.cjs +51 -16
  14. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.cjs.map +1 -1
  15. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.d.ts +19 -6
  16. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.d.ts.map +1 -1
  17. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.js +51 -17
  18. package/dist/components/atoms/PhoneInput/utilities/phoneInput.utils.js.map +1 -1
  19. package/dist/components/forms/Form/index.cjs +5 -3
  20. package/dist/components/forms/Form/index.cjs.map +1 -1
  21. package/dist/components/forms/Form/index.d.ts +8 -2
  22. package/dist/components/forms/Form/index.d.ts.map +1 -1
  23. package/dist/components/forms/Form/index.js +5 -3
  24. package/dist/components/forms/Form/index.js.map +1 -1
  25. package/dist/components/forms/Form/utilities/focusFromCode.utils.cjs +47 -0
  26. package/dist/components/forms/Form/utilities/focusFromCode.utils.cjs.map +1 -0
  27. package/dist/components/forms/Form/utilities/focusFromCode.utils.d.ts +12 -0
  28. package/dist/components/forms/Form/utilities/focusFromCode.utils.d.ts.map +1 -0
  29. package/dist/components/forms/Form/utilities/focusFromCode.utils.js +45 -0
  30. package/dist/components/forms/Form/utilities/focusFromCode.utils.js.map +1 -0
  31. package/dist/components/molecules/EmptyState/index.cjs +4 -2
  32. package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
  33. package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
  34. package/dist/components/molecules/EmptyState/index.js +4 -2
  35. package/dist/components/molecules/EmptyState/index.js.map +1 -1
  36. package/dist/components/molecules/Pagination/index.d.ts +1 -1
  37. package/dist/components/molecules/Pagination/index.d.ts.map +1 -1
  38. package/dist/components/molecules/Paginations/Pagination/Pagination.cjs +21 -5
  39. package/dist/components/molecules/Paginations/Pagination/Pagination.cjs.map +1 -1
  40. package/dist/components/molecules/Paginations/Pagination/Pagination.d.ts +7 -1
  41. package/dist/components/molecules/Paginations/Pagination/Pagination.d.ts.map +1 -1
  42. package/dist/components/molecules/Paginations/Pagination/Pagination.js +22 -6
  43. package/dist/components/molecules/Paginations/Pagination/Pagination.js.map +1 -1
  44. package/dist/components/molecules/Paginations/components/PaginationBase.cjs +2 -2
  45. package/dist/components/molecules/Paginations/components/PaginationBase.cjs.map +1 -1
  46. package/dist/components/molecules/Paginations/components/PaginationBase.d.ts +4 -2
  47. package/dist/components/molecules/Paginations/components/PaginationBase.d.ts.map +1 -1
  48. package/dist/components/molecules/Paginations/components/PaginationBase.js +2 -2
  49. package/dist/components/molecules/Paginations/components/PaginationBase.js.map +1 -1
  50. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.cjs +125 -0
  51. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.cjs.map +1 -0
  52. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts +42 -0
  53. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts.map +1 -0
  54. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.js +118 -0
  55. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.js.map +1 -0
  56. package/dist/components/organisms/FilterBar/index.cjs +3 -1
  57. package/dist/components/organisms/FilterBar/index.cjs.map +1 -1
  58. package/dist/components/organisms/FilterBar/index.d.ts.map +1 -1
  59. package/dist/components/organisms/FilterBar/index.js +3 -1
  60. package/dist/components/organisms/FilterBar/index.js.map +1 -1
  61. package/dist/components/organisms/Table/components/TableCardList.cjs +27 -0
  62. package/dist/components/organisms/Table/components/TableCardList.cjs.map +1 -0
  63. package/dist/components/organisms/Table/components/TableCardList.d.ts +4 -0
  64. package/dist/components/organisms/Table/components/TableCardList.d.ts.map +1 -0
  65. package/dist/components/organisms/Table/components/TableCardList.js +25 -0
  66. package/dist/components/organisms/Table/components/TableCardList.js.map +1 -0
  67. package/dist/components/organisms/Table/components/TableCardRow.cjs +80 -0
  68. package/dist/components/organisms/Table/components/TableCardRow.cjs.map +1 -0
  69. package/dist/components/organisms/Table/components/TableCardRow.d.ts +4 -0
  70. package/dist/components/organisms/Table/components/TableCardRow.d.ts.map +1 -0
  71. package/dist/components/organisms/Table/components/TableCardRow.js +78 -0
  72. package/dist/components/organisms/Table/components/TableCardRow.js.map +1 -0
  73. package/dist/components/organisms/Table/components/TableCardsSelectAll.cjs +24 -0
  74. package/dist/components/organisms/Table/components/TableCardsSelectAll.cjs.map +1 -0
  75. package/dist/components/organisms/Table/components/TableCardsSelectAll.d.ts +13 -0
  76. package/dist/components/organisms/Table/components/TableCardsSelectAll.d.ts.map +1 -0
  77. package/dist/components/organisms/Table/components/TableCardsSelectAll.js +22 -0
  78. package/dist/components/organisms/Table/components/TableCardsSelectAll.js.map +1 -0
  79. package/dist/components/organisms/Table/components/TableFallbackCard.cjs +12 -0
  80. package/dist/components/organisms/Table/components/TableFallbackCard.cjs.map +1 -0
  81. package/dist/components/organisms/Table/components/TableFallbackCard.d.ts +6 -0
  82. package/dist/components/organisms/Table/components/TableFallbackCard.d.ts.map +1 -0
  83. package/dist/components/organisms/Table/components/TableFallbackCard.js +10 -0
  84. package/dist/components/organisms/Table/components/TableFallbackCard.js.map +1 -0
  85. package/dist/components/organisms/Table/components/TableFocusGuard.cjs +23 -0
  86. package/dist/components/organisms/Table/components/TableFocusGuard.cjs.map +1 -0
  87. package/dist/components/organisms/Table/components/TableFocusGuard.d.ts +2 -0
  88. package/dist/components/organisms/Table/components/TableFocusGuard.d.ts.map +1 -0
  89. package/dist/components/organisms/Table/components/TableFocusGuard.js +21 -0
  90. package/dist/components/organisms/Table/components/TableFocusGuard.js.map +1 -0
  91. package/dist/components/organisms/Table/components/TableLayoutToggle.cjs +27 -0
  92. package/dist/components/organisms/Table/components/TableLayoutToggle.cjs.map +1 -0
  93. package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts +17 -0
  94. package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts.map +1 -0
  95. package/dist/components/organisms/Table/components/TableLayoutToggle.js +25 -0
  96. package/dist/components/organisms/Table/components/TableLayoutToggle.js.map +1 -0
  97. package/dist/components/organisms/Table/components/TableRowCard.cjs +79 -0
  98. package/dist/components/organisms/Table/components/TableRowCard.cjs.map +1 -0
  99. package/dist/components/organisms/Table/components/TableRowCard.d.ts +71 -0
  100. package/dist/components/organisms/Table/components/TableRowCard.d.ts.map +1 -0
  101. package/dist/components/organisms/Table/components/TableRowCard.js +72 -0
  102. package/dist/components/organisms/Table/components/TableRowCard.js.map +1 -0
  103. package/dist/components/organisms/Table/components/TableSortMenu.cjs +48 -0
  104. package/dist/components/organisms/Table/components/TableSortMenu.cjs.map +1 -0
  105. package/dist/components/organisms/Table/components/TableSortMenu.d.ts +35 -0
  106. package/dist/components/organisms/Table/components/TableSortMenu.d.ts.map +1 -0
  107. package/dist/components/organisms/Table/components/TableSortMenu.js +46 -0
  108. package/dist/components/organisms/Table/components/TableSortMenu.js.map +1 -0
  109. package/dist/components/organisms/Table/hooks/useFirstSortDirection.cjs +25 -0
  110. package/dist/components/organisms/Table/hooks/useFirstSortDirection.cjs.map +1 -0
  111. package/dist/components/organisms/Table/hooks/useFirstSortDirection.d.ts +12 -0
  112. package/dist/components/organisms/Table/hooks/useFirstSortDirection.d.ts.map +1 -0
  113. package/dist/components/organisms/Table/hooks/useFirstSortDirection.js +23 -0
  114. package/dist/components/organisms/Table/hooks/useFirstSortDirection.js.map +1 -0
  115. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.cjs +21 -0
  116. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.cjs.map +1 -0
  117. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.d.ts +9 -0
  118. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.d.ts.map +1 -0
  119. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.js +19 -0
  120. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.js.map +1 -0
  121. package/dist/components/organisms/Table/hooks/usePlaceholderRows.cjs +43 -0
  122. package/dist/components/organisms/Table/hooks/usePlaceholderRows.cjs.map +1 -0
  123. package/dist/components/organisms/Table/hooks/usePlaceholderRows.d.ts +23 -0
  124. package/dist/components/organisms/Table/hooks/usePlaceholderRows.d.ts.map +1 -0
  125. package/dist/components/organisms/Table/hooks/usePlaceholderRows.js +40 -0
  126. package/dist/components/organisms/Table/hooks/usePlaceholderRows.js.map +1 -0
  127. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.cjs +20 -2
  128. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.cjs.map +1 -1
  129. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.d.ts +8 -4
  130. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.d.ts.map +1 -1
  131. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.js +21 -3
  132. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.js.map +1 -1
  133. package/dist/components/organisms/Table/hooks/useTableSelection.cjs +47 -0
  134. package/dist/components/organisms/Table/hooks/useTableSelection.cjs.map +1 -0
  135. package/dist/components/organisms/Table/hooks/useTableSelection.d.ts +31 -0
  136. package/dist/components/organisms/Table/hooks/useTableSelection.d.ts.map +1 -0
  137. package/dist/components/organisms/Table/hooks/useTableSelection.js +45 -0
  138. package/dist/components/organisms/Table/hooks/useTableSelection.js.map +1 -0
  139. package/dist/components/organisms/Table/index.cjs +169 -38
  140. package/dist/components/organisms/Table/index.cjs.map +1 -1
  141. package/dist/components/organisms/Table/index.d.ts +57 -20
  142. package/dist/components/organisms/Table/index.d.ts.map +1 -1
  143. package/dist/components/organisms/Table/index.js +162 -33
  144. package/dist/components/organisms/Table/index.js.map +1 -1
  145. package/dist/components/organisms/Table/providers/Table.context.cjs +19 -0
  146. package/dist/components/organisms/Table/providers/Table.context.cjs.map +1 -0
  147. package/dist/components/organisms/Table/providers/Table.context.d.ts +44 -0
  148. package/dist/components/organisms/Table/providers/Table.context.d.ts.map +1 -0
  149. package/dist/components/organisms/Table/providers/Table.context.js +13 -0
  150. package/dist/components/organisms/Table/providers/Table.context.js.map +1 -0
  151. package/dist/components/organisms/Table/table.types.d.ts +35 -0
  152. package/dist/components/organisms/Table/table.types.d.ts.map +1 -0
  153. package/dist/components/organisms/Table/utilities/tableCard.utils.cjs +197 -0
  154. package/dist/components/organisms/Table/utilities/tableCard.utils.cjs.map +1 -0
  155. package/dist/components/organisms/Table/utilities/tableCard.utils.d.ts +161 -0
  156. package/dist/components/organisms/Table/utilities/tableCard.utils.d.ts.map +1 -0
  157. package/dist/components/organisms/Table/utilities/tableCard.utils.js +180 -0
  158. package/dist/components/organisms/Table/utilities/tableCard.utils.js.map +1 -0
  159. package/dist/components/organisms/Table/utilities/tableChildren.utils.cjs +47 -0
  160. package/dist/components/organisms/Table/utilities/tableChildren.utils.cjs.map +1 -0
  161. package/dist/components/organisms/Table/utilities/tableChildren.utils.d.ts +39 -0
  162. package/dist/components/organisms/Table/utilities/tableChildren.utils.d.ts.map +1 -0
  163. package/dist/components/organisms/Table/utilities/tableChildren.utils.js +43 -0
  164. package/dist/components/organisms/Table/utilities/tableChildren.utils.js.map +1 -0
  165. package/dist/components/organisms/Table/utilities/tableSelection.utils.cjs +106 -0
  166. package/dist/components/organisms/Table/utilities/tableSelection.utils.cjs.map +1 -0
  167. package/dist/components/organisms/Table/utilities/tableSelection.utils.d.ts +82 -0
  168. package/dist/components/organisms/Table/utilities/tableSelection.utils.d.ts.map +1 -0
  169. package/dist/components/organisms/Table/utilities/tableSelection.utils.js +98 -0
  170. package/dist/components/organisms/Table/utilities/tableSelection.utils.js.map +1 -0
  171. package/dist/components/organisms/Table/utilities/tableSort.utils.cjs +87 -0
  172. package/dist/components/organisms/Table/utilities/tableSort.utils.cjs.map +1 -0
  173. package/dist/components/organisms/Table/utilities/tableSort.utils.d.ts +67 -0
  174. package/dist/components/organisms/Table/utilities/tableSort.utils.d.ts.map +1 -0
  175. package/dist/components/organisms/Table/utilities/tableSort.utils.js +79 -0
  176. package/dist/components/organisms/Table/utilities/tableSort.utils.js.map +1 -0
  177. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.cjs +2 -2
  178. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.d.ts +2 -2
  179. package/dist/hooks/__internal__/useReturnFocus/useReturnFocus.js +2 -2
  180. package/dist/hooks/useFocusAfterRetry/index.cjs +1 -1
  181. package/dist/hooks/useFocusAfterRetry/index.d.ts +1 -1
  182. package/dist/hooks/useFocusAfterRetry/index.js +1 -1
  183. package/dist/utilities/searchParamsUtils/index.cjs +2 -9
  184. package/dist/utilities/searchParamsUtils/index.cjs.map +1 -1
  185. package/dist/utilities/searchParamsUtils/index.d.ts +5 -3
  186. package/dist/utilities/searchParamsUtils/index.d.ts.map +1 -1
  187. package/dist/utilities/searchParamsUtils/index.js +2 -9
  188. package/dist/utilities/searchParamsUtils/index.js.map +1 -1
  189. package/package.json +2 -2
  190. package/dist/components/organisms/Table/table.utils.cjs +0 -61
  191. package/dist/components/organisms/Table/table.utils.cjs.map +0 -1
  192. package/dist/components/organisms/Table/table.utils.d.ts +0 -48
  193. package/dist/components/organisms/Table/table.utils.d.ts.map +0 -1
  194. package/dist/components/organisms/Table/table.utils.js +0 -55
  195. package/dist/components/organisms/Table/table.utils.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import type { TableCardColumn } from '../table.types';
3
+ /** Children as a row or header may take them: nodes, or a function called once per column. */
4
+ type CollectionChildren<T> = ReactNode | ((column: T) => ReactElement);
5
+ /**
6
+ * Finds the first element of a type among children, looking through fragments.
7
+ * @param children - What a component received as `children`.
8
+ * @param type - The component to look for.
9
+ * @returns That element, or `undefined` when no child renders it directly.
10
+ */
11
+ export declare const findElement: <P>(children: ReactNode, type: unknown) => ReactElement<P> | undefined;
12
+ /** A row's children split into the card it declares and the cells the table renders. */
13
+ export interface RowChildren {
14
+ /** The first card that is a direct child of the row. */
15
+ card?: ReactElement;
16
+ /** How many cards are direct children of the row; only the first renders. */
17
+ cardCount: number;
18
+ /** Everything else, in order, one entry per column. */
19
+ cells: ReactNode[];
20
+ }
21
+ /**
22
+ * Splits a `Table.Row`'s children into its card and its cells. Only a direct child counts as the card: one nested inside
23
+ * another element stays among the cells, so the row gets the fallback card, and the nested card renders nothing in either
24
+ * layout (`Table.RowCard` checks where it sits). A row whose cells come from a column function has no card.
25
+ * @param children - The row's children, as nodes or as a function of each column.
26
+ * @param columns - The row's `columns`, which a function of each column is called with.
27
+ * @param isCard - Tells a card element apart from a cell.
28
+ * @returns The card, when the row declares one, and the cells.
29
+ */
30
+ export declare const splitRowChildren: <T>(children: CollectionChildren<T>, columns: Iterable<T> | undefined, isCard: (element: ReactElement) => boolean) => RowChildren;
31
+ /**
32
+ * Reads each column a `Table.Header` declares, for a card, which has no header of its own to read them from.
33
+ * @param children - The header's children: `Table.Head` elements, conditionals among them, or a function of each column.
34
+ * @param columns - The header's `columns`, which a function of each column is called with.
35
+ * @returns One entry per rendered column, in order; a string child stands in for a missing `label`.
36
+ */
37
+ export declare const columnsOfHeader: <T>(children: CollectionChildren<T>, columns?: Iterable<T>) => TableCardColumn[];
38
+ export {};
39
+ //# sourceMappingURL=tableChildren.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableChildren.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Table/utilities/tableChildren.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,8FAA8F;AAC9F,KAAK,kBAAkB,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,YAAY,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,UAAU,SAAS,EAAE,MAAM,OAAO,KAAG,YAAY,CAAC,CAAC,CAAC,GAAG,SAC6B,CAAC;AAEpH,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAChC,UAAU,kBAAkB,CAAC,CAAC,CAAC,EAC/B,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,EAChC,QAAQ,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,KACzC,WAMF,CAAC;AAQF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,UAAU,kBAAkB,CAAC,CAAC,CAAC,EAAE,UAAU,QAAQ,CAAC,CAAC,CAAC,KAAG,eAAe,EAM1G,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Children, isValidElement } from 'react';
2
+ import { flattenChildren } from '../../../../utilities/__internal__/childrenUtils/children.utils.js';
3
+
4
+ /**
5
+ * Finds the first element of a type among children, looking through fragments.
6
+ * @param children - What a component received as `children`.
7
+ * @param type - The component to look for.
8
+ * @returns That element, or `undefined` when no child renders it directly.
9
+ */
10
+ const findElement = (children, type) => flattenChildren(children).find((child) => isValidElement(child) && child.type === type);
11
+ /**
12
+ * Splits a `Table.Row`'s children into its card and its cells. Only a direct child counts as the card: one nested inside
13
+ * another element stays among the cells, so the row gets the fallback card, and the nested card renders nothing in either
14
+ * layout (`Table.RowCard` checks where it sits). A row whose cells come from a column function has no card.
15
+ * @param children - The row's children, as nodes or as a function of each column.
16
+ * @param columns - The row's `columns`, which a function of each column is called with.
17
+ * @param isCard - Tells a card element apart from a cell.
18
+ * @returns The card, when the row declares one, and the cells.
19
+ */
20
+ const splitRowChildren = (children, columns, isCard) => {
21
+ if (typeof children === 'function')
22
+ return { cardCount: 0, cells: Children.toArray(Array.from(columns ?? [], children)) };
23
+ const flat = flattenChildren(children);
24
+ const isCardChild = (child) => isValidElement(child) && isCard(child);
25
+ const cards = flat.filter(isCardChild);
26
+ return { card: cards[0], cardCount: cards.length, cells: flat.filter((child) => !isCardChild(child)) };
27
+ };
28
+ /**
29
+ * Reads each column a `Table.Header` declares, for a card, which has no header of its own to read them from.
30
+ * @param children - The header's children: `Table.Head` elements, conditionals among them, or a function of each column.
31
+ * @param columns - The header's `columns`, which a function of each column is called with.
32
+ * @returns One entry per rendered column, in order; a string child stands in for a missing `label`.
33
+ */
34
+ const columnsOfHeader = (children, columns) => {
35
+ const heads = typeof children === 'function' ? Array.from(columns ?? [], children) : flattenChildren(children);
36
+ return heads.filter((isValidElement)).map(({ props }) => ({
37
+ label: props.label ?? (typeof props.children === 'string' ? props.children : undefined),
38
+ isRowHeader: props.isRowHeader === true,
39
+ }));
40
+ };
41
+
42
+ export { columnsOfHeader, findElement, splitRowChildren };
43
+ //# sourceMappingURL=tableChildren.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableChildren.utils.js","sources":["../../../../../src/components/organisms/Table/utilities/tableChildren.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAOA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAI,QAAmB,EAAE,IAAa,KAC/D,eAAe,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAA+B,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;AAYlH;;;;;;;;AAQG;AACI,MAAM,gBAAgB,GAAG,CAC9B,QAA+B,EAC/B,OAAgC,EAChC,MAA0C,KAC3B;IACf,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,EAAE;AACzH,IAAA,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC;AACtC,IAAA,MAAM,WAAW,GAAG,CAAC,KAAgB,KAA4B,cAAc,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;IACvG,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;AACtC,IAAA,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE;AACxG;AAQA;;;;;AAKG;MACU,eAAe,GAAG,CAAI,QAA+B,EAAE,OAAqB,KAAuB;IAC9G,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC;AAC9G,IAAA,OAAO,KAAK,CAAC,MAAM,EAAC,cAAyB,EAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;QACjE,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,GAAG,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;AACvF,QAAA,WAAW,EAAE,KAAK,CAAC,WAAW,KAAK,IAAI;AACxC,KAAA,CAAC,CAAC;AACL;;"}
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Turns a single selected key into the selection react-aria expects.
5
+ * @param key - The selected row's id, or `null` for none.
6
+ * @returns A selection holding that one key, or an empty one.
7
+ */
8
+ const selectionOfKey = (key) => new Set(key === null ? [] : [key]);
9
+ /**
10
+ * Reads the one selected key out of a selection, for a single-select table.
11
+ * @param selection - What react-aria reports; a single-select table never reports `'all'`.
12
+ * @returns The selected row's id, or `null` when nothing is selected, as after a second click on the selected row.
13
+ */
14
+ const keyOfSelection = (selection) => {
15
+ if (selection === 'all')
16
+ return null;
17
+ const [first] = selection;
18
+ return first ?? null;
19
+ };
20
+ /**
21
+ * Lists the selected keys of a multiple-select table, resolving "select all" into the rows it covers.
22
+ * @param selection - What react-aria reports, `'all'` after the header checkbox.
23
+ * @param rowKeys - Every rendered row's id, in the order the rows mounted, which is the display order until rows are reordered in place.
24
+ * @param disabledKeys - Rows that cannot be selected, which "select all" leaves out.
25
+ * @returns The selected rows' ids.
26
+ */
27
+ const keysOfSelection = (selection, rowKeys, disabledKeys = []) => {
28
+ if (selection !== 'all')
29
+ return [...selection];
30
+ const disabled = new Set(disabledKeys);
31
+ return [...rowKeys].filter((key) => !disabled.has(key));
32
+ };
33
+ /**
34
+ * Forwards one selection change to every listener the consumer passed, in that order.
35
+ *
36
+ * @param selection What react-aria reports, including `'all'` after the header checkbox.
37
+ * @param rowKeys Mounted selectable row ids, in mount order, used to expand `'all'`.
38
+ * @param disabledKeys Rows "select all" leaves out. Omitted when the table disables none.
39
+ * @param listeners The callbacks to notify. Each runs only when the consumer passed it.
40
+ * @returns Nothing. Each provided listener is called.
41
+ */
42
+ const reportSelectionChange = (selection, rowKeys, disabledKeys, listeners) => {
43
+ listeners.onSelectionChange?.(selection);
44
+ listeners.onSelectedKeyChange?.(keyOfSelection(selection));
45
+ listeners.onSelectedKeysChange?.(keysOfSelection(selection, rowKeys, disabledKeys));
46
+ };
47
+ /**
48
+ * Works out the select-all checkbox from the selection and the rows on screen, as the table's header checkbox does.
49
+ * @param selection - The current selection; `'all'` after select all.
50
+ * @param rowKeys - Every mounted selectable row's id.
51
+ * @param disabledKeys - Rows the table disables, which select all leaves out.
52
+ * @returns Whether the checkbox is checked, indeterminate or disabled.
53
+ */
54
+ const selectAllStateOf = (selection, rowKeys, disabledKeys) => {
55
+ const selectable = keysOfSelection('all', rowKeys, disabledKeys);
56
+ if (selectable.length === 0)
57
+ return { isSelected: false, isIndeterminate: false, isDisabled: true };
58
+ if (selection === 'all')
59
+ return { isSelected: true, isIndeterminate: false, isDisabled: false };
60
+ const selected = new Set(selection);
61
+ const selectedCount = selectable.filter((key) => selected.has(key)).length;
62
+ return {
63
+ isSelected: selectedCount === selectable.length,
64
+ // As react-aria's header checkbox: anything selected, even a row not on screen, and not every row on screen.
65
+ isIndeterminate: selected.size > 0 && selectedCount < selectable.length,
66
+ isDisabled: false,
67
+ };
68
+ };
69
+ /**
70
+ * Picks the selection a press on the select-all checkbox reports, the values react-aria's header checkbox reports.
71
+ * @param isSelected - Whether every selectable row is selected now.
72
+ * @param disallowEmptySelection - Whether the table keeps at least one row selected.
73
+ * @returns `'all'`, an empty selection, or `undefined` when clearing is not allowed.
74
+ */
75
+ const selectAllToggleOf = (isSelected, disallowEmptySelection = false) => {
76
+ if (!isSelected)
77
+ return 'all';
78
+ return disallowEmptySelection ? undefined : new Set();
79
+ };
80
+ /**
81
+ * Says whether a table must drop its focused key before react-stately looks for a row to move focus to. That search can
82
+ * loop for ever only when it meets disabled rows, or finds no body row at all, so the key goes in either case. The cost:
83
+ * in a table with a disabled row, such as a placeholder, removing the focused row drops focus instead of moving it to a
84
+ * neighbour.
85
+ * @param focusedKey - The key the table's selection state holds as focused; `null` when nothing is.
86
+ * @param hasKey - Whether the table's new collection still holds a key.
87
+ * @param rows - The new collection's rows; only its body rows count.
88
+ * @param isDisabled - Whether the table's selection manager counts a row as disabled, as placeholder rows are.
89
+ * @returns `true` when the focused key is gone and a body row left is disabled, or none is left; `false` otherwise, so
90
+ * react-aria still moves focus to a neighbouring row in a table with no disabled row.
91
+ */
92
+ const isFocusRecoveryAtRisk = (focusedKey, hasKey, rows, isDisabled) => {
93
+ if (focusedKey == null || hasKey(focusedKey))
94
+ return false;
95
+ const bodyRows = rows.filter((row) => row.type === 'item');
96
+ return bodyRows.length === 0 || bodyRows.some((row) => isDisabled(row.key));
97
+ };
98
+
99
+ exports.isFocusRecoveryAtRisk = isFocusRecoveryAtRisk;
100
+ exports.keyOfSelection = keyOfSelection;
101
+ exports.keysOfSelection = keysOfSelection;
102
+ exports.reportSelectionChange = reportSelectionChange;
103
+ exports.selectAllStateOf = selectAllStateOf;
104
+ exports.selectAllToggleOf = selectAllToggleOf;
105
+ exports.selectionOfKey = selectionOfKey;
106
+ //# sourceMappingURL=tableSelection.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSelection.utils.cjs","sources":["../../../../../src/components/organisms/Table/utilities/tableSelection.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"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"}
@@ -0,0 +1,82 @@
1
+ import type { Key, Selection } from 'react-aria-components';
2
+ /**
3
+ * Turns a single selected key into the selection react-aria expects.
4
+ * @param key - The selected row's id, or `null` for none.
5
+ * @returns A selection holding that one key, or an empty one.
6
+ */
7
+ export declare const selectionOfKey: (key: Key | null) => Selection;
8
+ /**
9
+ * Reads the one selected key out of a selection, for a single-select table.
10
+ * @param selection - What react-aria reports; a single-select table never reports `'all'`.
11
+ * @returns The selected row's id, or `null` when nothing is selected, as after a second click on the selected row.
12
+ */
13
+ export declare const keyOfSelection: (selection: Selection) => Key | null;
14
+ /**
15
+ * Lists the selected keys of a multiple-select table, resolving "select all" into the rows it covers.
16
+ * @param selection - What react-aria reports, `'all'` after the header checkbox.
17
+ * @param rowKeys - Every rendered row's id, in the order the rows mounted, which is the display order until rows are reordered in place.
18
+ * @param disabledKeys - Rows that cannot be selected, which "select all" leaves out.
19
+ * @returns The selected rows' ids.
20
+ */
21
+ export declare const keysOfSelection: (selection: Selection, rowKeys: Iterable<Key>, disabledKeys?: Iterable<Key>) => Key[];
22
+ export interface SelectionChangeListeners {
23
+ /** React Aria's own selection callback, forwarded unchanged. */
24
+ onSelectionChange?: (selection: Selection) => void;
25
+ /** Single-select callback. Receives the one key, or `null` when the selection is empty or `'all'`. */
26
+ onSelectedKeyChange?: (key: Key | null) => void;
27
+ /** Multi-select callback. Receives row ids, with `'all'` expanded to the mounted selectable rows. */
28
+ onSelectedKeysChange?: (keys: Key[]) => void;
29
+ }
30
+ /**
31
+ * Forwards one selection change to every listener the consumer passed, in that order.
32
+ *
33
+ * @param selection What react-aria reports, including `'all'` after the header checkbox.
34
+ * @param rowKeys Mounted selectable row ids, in mount order, used to expand `'all'`.
35
+ * @param disabledKeys Rows "select all" leaves out. Omitted when the table disables none.
36
+ * @param listeners The callbacks to notify. Each runs only when the consumer passed it.
37
+ * @returns Nothing. Each provided listener is called.
38
+ */
39
+ export declare const reportSelectionChange: (selection: Selection, rowKeys: Iterable<Key>, disabledKeys: Iterable<Key> | undefined, listeners: SelectionChangeListeners) => void;
40
+ /** What the card list's select-all checkbox shows. */
41
+ export interface SelectAllState {
42
+ /** Every selectable row is selected. */
43
+ isSelected: boolean;
44
+ /** Something is selected, a row off screen included, but not every selectable row on screen. */
45
+ isIndeterminate: boolean;
46
+ /** No row can be selected, as while loading or with no rows. */
47
+ isDisabled: boolean;
48
+ }
49
+ /**
50
+ * Works out the select-all checkbox from the selection and the rows on screen, as the table's header checkbox does.
51
+ * @param selection - The current selection; `'all'` after select all.
52
+ * @param rowKeys - Every mounted selectable row's id.
53
+ * @param disabledKeys - Rows the table disables, which select all leaves out.
54
+ * @returns Whether the checkbox is checked, indeterminate or disabled.
55
+ */
56
+ export declare const selectAllStateOf: (selection: "all" | Iterable<Key>, rowKeys: Iterable<Key>, disabledKeys?: Iterable<Key>) => SelectAllState;
57
+ /**
58
+ * Picks the selection a press on the select-all checkbox reports, the values react-aria's header checkbox reports.
59
+ * @param isSelected - Whether every selectable row is selected now.
60
+ * @param disallowEmptySelection - Whether the table keeps at least one row selected.
61
+ * @returns `'all'`, an empty selection, or `undefined` when clearing is not allowed.
62
+ */
63
+ export declare const selectAllToggleOf: (isSelected: boolean, disallowEmptySelection?: boolean) => Selection | undefined;
64
+ /** One of a table's rows as react-stately's focus recovery walks them: a body row, a header row or a loader. */
65
+ export interface FocusRecoveryRow {
66
+ key: Key;
67
+ type: string;
68
+ }
69
+ /**
70
+ * Says whether a table must drop its focused key before react-stately looks for a row to move focus to. That search can
71
+ * loop for ever only when it meets disabled rows, or finds no body row at all, so the key goes in either case. The cost:
72
+ * in a table with a disabled row, such as a placeholder, removing the focused row drops focus instead of moving it to a
73
+ * neighbour.
74
+ * @param focusedKey - The key the table's selection state holds as focused; `null` when nothing is.
75
+ * @param hasKey - Whether the table's new collection still holds a key.
76
+ * @param rows - The new collection's rows; only its body rows count.
77
+ * @param isDisabled - Whether the table's selection manager counts a row as disabled, as placeholder rows are.
78
+ * @returns `true` when the focused key is gone and a body row left is disabled, or none is left; `false` otherwise, so
79
+ * react-aria still moves focus to a neighbouring row in a table with no disabled row.
80
+ */
81
+ export declare const isFocusRecoveryAtRisk: (focusedKey: Key | null, hasKey: (key: Key) => boolean, rows: readonly FocusRecoveryRow[], isDisabled: (key: Key) => boolean) => boolean;
82
+ //# sourceMappingURL=tableSelection.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSelection.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Table/utilities/tableSelection.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,GAAG,GAAG,IAAI,KAAG,SAA+C,CAAC;AAEjG;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,SAAS,KAAG,GAAG,GAAG,IAI3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,SAAS,EAAE,SAAS,QAAQ,CAAC,GAAG,CAAC,EAAE,eAAc,QAAQ,CAAC,GAAG,CAAM,KAAG,GAAG,EAInH,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACnD,sGAAsG;IACtG,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,qGAAqG;IACrG,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,WAAW,SAAS,EACpB,SAAS,QAAQ,CAAC,GAAG,CAAC,EACtB,cAAc,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,EACvC,WAAW,wBAAwB,KAClC,IAIF,CAAC;AAEF,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,gGAAgG;IAChG,eAAe,EAAE,OAAO,CAAC;IACzB,gEAAgE;IAChE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,QAAQ,CAAC,GAAG,CAAC,EAAE,eAAe,QAAQ,CAAC,GAAG,CAAC,KAAG,cAazH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,OAAO,EAAE,gCAA8B,KAAG,SAAS,GAAG,SAGnG,CAAC;AAEF,gHAAgH;AAChH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAChC,YAAY,GAAG,GAAG,IAAI,EACtB,QAAQ,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,EAC7B,MAAM,SAAS,gBAAgB,EAAE,EACjC,YAAY,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,KAChC,OAIF,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Turns a single selected key into the selection react-aria expects.
3
+ * @param key - The selected row's id, or `null` for none.
4
+ * @returns A selection holding that one key, or an empty one.
5
+ */
6
+ const selectionOfKey = (key) => new Set(key === null ? [] : [key]);
7
+ /**
8
+ * Reads the one selected key out of a selection, for a single-select table.
9
+ * @param selection - What react-aria reports; a single-select table never reports `'all'`.
10
+ * @returns The selected row's id, or `null` when nothing is selected, as after a second click on the selected row.
11
+ */
12
+ const keyOfSelection = (selection) => {
13
+ if (selection === 'all')
14
+ return null;
15
+ const [first] = selection;
16
+ return first ?? null;
17
+ };
18
+ /**
19
+ * Lists the selected keys of a multiple-select table, resolving "select all" into the rows it covers.
20
+ * @param selection - What react-aria reports, `'all'` after the header checkbox.
21
+ * @param rowKeys - Every rendered row's id, in the order the rows mounted, which is the display order until rows are reordered in place.
22
+ * @param disabledKeys - Rows that cannot be selected, which "select all" leaves out.
23
+ * @returns The selected rows' ids.
24
+ */
25
+ const keysOfSelection = (selection, rowKeys, disabledKeys = []) => {
26
+ if (selection !== 'all')
27
+ return [...selection];
28
+ const disabled = new Set(disabledKeys);
29
+ return [...rowKeys].filter((key) => !disabled.has(key));
30
+ };
31
+ /**
32
+ * Forwards one selection change to every listener the consumer passed, in that order.
33
+ *
34
+ * @param selection What react-aria reports, including `'all'` after the header checkbox.
35
+ * @param rowKeys Mounted selectable row ids, in mount order, used to expand `'all'`.
36
+ * @param disabledKeys Rows "select all" leaves out. Omitted when the table disables none.
37
+ * @param listeners The callbacks to notify. Each runs only when the consumer passed it.
38
+ * @returns Nothing. Each provided listener is called.
39
+ */
40
+ const reportSelectionChange = (selection, rowKeys, disabledKeys, listeners) => {
41
+ listeners.onSelectionChange?.(selection);
42
+ listeners.onSelectedKeyChange?.(keyOfSelection(selection));
43
+ listeners.onSelectedKeysChange?.(keysOfSelection(selection, rowKeys, disabledKeys));
44
+ };
45
+ /**
46
+ * Works out the select-all checkbox from the selection and the rows on screen, as the table's header checkbox does.
47
+ * @param selection - The current selection; `'all'` after select all.
48
+ * @param rowKeys - Every mounted selectable row's id.
49
+ * @param disabledKeys - Rows the table disables, which select all leaves out.
50
+ * @returns Whether the checkbox is checked, indeterminate or disabled.
51
+ */
52
+ const selectAllStateOf = (selection, rowKeys, disabledKeys) => {
53
+ const selectable = keysOfSelection('all', rowKeys, disabledKeys);
54
+ if (selectable.length === 0)
55
+ return { isSelected: false, isIndeterminate: false, isDisabled: true };
56
+ if (selection === 'all')
57
+ return { isSelected: true, isIndeterminate: false, isDisabled: false };
58
+ const selected = new Set(selection);
59
+ const selectedCount = selectable.filter((key) => selected.has(key)).length;
60
+ return {
61
+ isSelected: selectedCount === selectable.length,
62
+ // As react-aria's header checkbox: anything selected, even a row not on screen, and not every row on screen.
63
+ isIndeterminate: selected.size > 0 && selectedCount < selectable.length,
64
+ isDisabled: false,
65
+ };
66
+ };
67
+ /**
68
+ * Picks the selection a press on the select-all checkbox reports, the values react-aria's header checkbox reports.
69
+ * @param isSelected - Whether every selectable row is selected now.
70
+ * @param disallowEmptySelection - Whether the table keeps at least one row selected.
71
+ * @returns `'all'`, an empty selection, or `undefined` when clearing is not allowed.
72
+ */
73
+ const selectAllToggleOf = (isSelected, disallowEmptySelection = false) => {
74
+ if (!isSelected)
75
+ return 'all';
76
+ return disallowEmptySelection ? undefined : new Set();
77
+ };
78
+ /**
79
+ * Says whether a table must drop its focused key before react-stately looks for a row to move focus to. That search can
80
+ * loop for ever only when it meets disabled rows, or finds no body row at all, so the key goes in either case. The cost:
81
+ * in a table with a disabled row, such as a placeholder, removing the focused row drops focus instead of moving it to a
82
+ * neighbour.
83
+ * @param focusedKey - The key the table's selection state holds as focused; `null` when nothing is.
84
+ * @param hasKey - Whether the table's new collection still holds a key.
85
+ * @param rows - The new collection's rows; only its body rows count.
86
+ * @param isDisabled - Whether the table's selection manager counts a row as disabled, as placeholder rows are.
87
+ * @returns `true` when the focused key is gone and a body row left is disabled, or none is left; `false` otherwise, so
88
+ * react-aria still moves focus to a neighbouring row in a table with no disabled row.
89
+ */
90
+ const isFocusRecoveryAtRisk = (focusedKey, hasKey, rows, isDisabled) => {
91
+ if (focusedKey == null || hasKey(focusedKey))
92
+ return false;
93
+ const bodyRows = rows.filter((row) => row.type === 'item');
94
+ return bodyRows.length === 0 || bodyRows.some((row) => isDisabled(row.key));
95
+ };
96
+
97
+ export { isFocusRecoveryAtRisk, keyOfSelection, keysOfSelection, reportSelectionChange, selectAllStateOf, selectAllToggleOf, selectionOfKey };
98
+ //# sourceMappingURL=tableSelection.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSelection.utils.js","sources":["../../../../../src/components/organisms/Table/utilities/tableSelection.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"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"}
@@ -0,0 +1,87 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Tells whether two sorts order a list the same way, for showing that a table is not at its resting order.
5
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
6
+ * @param other - The sort to compare it with, such as the page's resting sort; `undefined` for no sort.
7
+ * @returns `true` when both sort the same column in the same direction, or neither sorts anything.
8
+ */
9
+ const isSameSort = (current, other) => current?.column === other?.column && current?.direction === other?.direction;
10
+ /**
11
+ * Keeps track of the direction the sorted column first landed on, as the table's sort changes. A sort at the resting sort is
12
+ * always the start of its column's cycle, so a column opened elsewhere, as from a link, comes back round once a clear lands it there.
13
+ * @param previous - What was tracked before; `undefined` while nothing was sorted.
14
+ * @param sortDescriptor - The table's sort now; `undefined` when nothing is sorted.
15
+ * @param resting - The page's resting sort; `undefined` when the list rests unsorted.
16
+ * @returns The column and its direction when another column becomes sorted, as on mount, or when the sort is the resting one;
17
+ * `previous` while the same column stays sorted elsewhere, whatever its direction now; `undefined` when nothing is sorted.
18
+ */
19
+ const firstSortOf = (previous, sortDescriptor, resting) => {
20
+ if (!sortDescriptor)
21
+ return undefined;
22
+ const isSameColumn = previous?.column === sortDescriptor.column;
23
+ if (isSameColumn && !isSameSort(sortDescriptor, resting))
24
+ return previous;
25
+ // The same object while nothing changed, so the hook holding it settles instead of storing a copy on every render.
26
+ if (isSameColumn && previous?.direction === sortDescriptor.direction)
27
+ return previous;
28
+ return { column: sortDescriptor.column, direction: sortDescriptor.direction };
29
+ };
30
+ /**
31
+ * Decides what a press on a sortable column header does. A column's cycle is its first direction, the other direction, then
32
+ * cleared: react-aria only toggles the sorted column, so the press that would toggle it back to its first direction clears it
33
+ * instead. An explicit `sort(direction)` on the sorted column asking for the other direction reaches the table as a press
34
+ * does, so on its second direction it clears too; one asking for the direction already shown is a change.
35
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
36
+ * @param next - What react-aria asks for: ascending for a column that is not sorted, the other direction for the one that is.
37
+ * @param firstDirection - The direction the sorted column first landed on; `current`'s own direction when unknown.
38
+ * @returns `'clear'` for a press on the sorted column once it is on its second direction; `'change'` otherwise.
39
+ */
40
+ const sortStepOf = (current, next, firstDirection) => {
41
+ if (!current || current.column !== next.column)
42
+ return 'change';
43
+ // A press always asks for the other direction, so this is an explicit request for the one shown, which keeps it.
44
+ if (next.direction === current.direction)
45
+ return 'change';
46
+ return current.direction === (firstDirection ?? current.direction) ? 'change' : 'clear';
47
+ };
48
+ /**
49
+ * Picks the sort a column chosen in the sort menu applies.
50
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
51
+ * @param column - The chosen column's id.
52
+ * @returns That column in the current direction, or ascending when nothing is sorted.
53
+ */
54
+ const sortOfColumnChoice = (current, column) => ({
55
+ column,
56
+ direction: current?.direction ?? 'ascending',
57
+ });
58
+ /**
59
+ * Picks the sort a direction chosen in the sort menu applies.
60
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
61
+ * @param direction - The chosen direction.
62
+ * @returns The current column in that direction, or `undefined` when nothing is sorted, as there is no column to apply it to.
63
+ */
64
+ const sortOfDirectionChoice = (current, direction) => current && { column: current.column, direction };
65
+ /**
66
+ * Keys a column's item in the sort menu, apart from the direction and "Clear sort" items and from every other column's.
67
+ * @param id - The column's id, as its `Table.Head` has it.
68
+ * @returns `col-<id>` for a string id and `colnum-<id>` for a number, so `'1'` and `1` stay apart; the item's test id
69
+ * derives from it too.
70
+ */
71
+ const sortMenuColumnKeyOf = (id) => (typeof id === 'number' ? `colnum-${id}` : `col-${id}`);
72
+ /**
73
+ * Finds the column a sort-menu item stands for.
74
+ * @param columns - The menu's columns.
75
+ * @param key - The chosen item's key; `undefined` when nothing is chosen.
76
+ * @returns The column whose item that is, or `undefined` for any other key.
77
+ */
78
+ const columnOfSortMenuKey = (columns, key) => key === undefined ? undefined : columns.find((column) => sortMenuColumnKeyOf(column.id) === key);
79
+
80
+ exports.columnOfSortMenuKey = columnOfSortMenuKey;
81
+ exports.firstSortOf = firstSortOf;
82
+ exports.isSameSort = isSameSort;
83
+ exports.sortMenuColumnKeyOf = sortMenuColumnKeyOf;
84
+ exports.sortOfColumnChoice = sortOfColumnChoice;
85
+ exports.sortOfDirectionChoice = sortOfDirectionChoice;
86
+ exports.sortStepOf = sortStepOf;
87
+ //# sourceMappingURL=tableSort.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSort.utils.cjs","sources":["../../../../../src/components/organisms/Table/utilities/tableSort.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAAC,OAAmC,EAAE,KAAiC,KAC/F,OAAO,EAAE,MAAM,KAAK,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE,SAAS,KAAK,KAAK,EAAE;AAUrE;;;;;;;;AAQG;AACI,MAAM,WAAW,GAAG,CACzB,QAA+B,EAC/B,cAA0C,EAC1C,OAAwB,KACC;AACzB,IAAA,IAAI,CAAC,cAAc;AAAE,QAAA,OAAO,SAAS;IACrC,MAAM,YAAY,GAAG,QAAQ,EAAE,MAAM,KAAK,cAAc,CAAC,MAAM;IAC/D,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC;AAAE,QAAA,OAAO,QAAQ;;IAEzE,IAAI,YAAY,IAAI,QAAQ,EAAE,SAAS,KAAK,cAAc,CAAC,SAAS;AAAE,QAAA,OAAO,QAAQ;AACrF,IAAA,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE;AAC/E;AAEA;;;;;;;;;AASG;AACI,MAAM,UAAU,GAAG,CAAC,OAAmC,EAAE,IAAoB,EAAE,cAA8B,KAAwB;IAC1I,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,QAAQ;;AAE/D,IAAA,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,SAAS;AAAE,QAAA,OAAO,QAAQ;AACzD,IAAA,OAAO,OAAO,CAAC,SAAS,MAAM,cAAc,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,QAAQ,GAAG,OAAO;AACzF;AAEA;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAmC,EAAE,MAAW,MAAsB;IACvG,MAAM;AACN,IAAA,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW;AAC7C,CAAA;AAED;;;;;AAKG;MACU,qBAAqB,GAAG,CAAC,OAAmC,EAAE,SAAwB,KACjG,OAAO,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS;AAEhD;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,EAAO,MAAc,OAAO,EAAE,KAAK,QAAQ,GAAG,CAAA,OAAA,EAAU,EAAE,CAAA,CAAE,GAAG,CAAA,IAAA,EAAO,EAAE,CAAA,CAAE;AAE9G;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAwB,OAAqB,EAAE,GAAoB,KACpG,GAAG,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,GAAG;;;;;;;;"}
@@ -0,0 +1,67 @@
1
+ import type { Key, SortDescriptor, SortDirection } from 'react-aria-components';
2
+ /**
3
+ * Tells whether two sorts order a list the same way, for showing that a table is not at its resting order.
4
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
5
+ * @param other - The sort to compare it with, such as the page's resting sort; `undefined` for no sort.
6
+ * @returns `true` when both sort the same column in the same direction, or neither sorts anything.
7
+ */
8
+ export declare const isSameSort: (current: SortDescriptor | undefined, other: SortDescriptor | undefined) => boolean;
9
+ /** The sorted column, and the direction it first landed on when it became the sorted column. */
10
+ export interface FirstSort {
11
+ /** The sorted column's id. */
12
+ column: Key;
13
+ /** The direction the column was first sorted in: its cycle is this, the other direction, then cleared. */
14
+ direction: SortDirection;
15
+ }
16
+ /**
17
+ * Keeps track of the direction the sorted column first landed on, as the table's sort changes. A sort at the resting sort is
18
+ * always the start of its column's cycle, so a column opened elsewhere, as from a link, comes back round once a clear lands it there.
19
+ * @param previous - What was tracked before; `undefined` while nothing was sorted.
20
+ * @param sortDescriptor - The table's sort now; `undefined` when nothing is sorted.
21
+ * @param resting - The page's resting sort; `undefined` when the list rests unsorted.
22
+ * @returns The column and its direction when another column becomes sorted, as on mount, or when the sort is the resting one;
23
+ * `previous` while the same column stays sorted elsewhere, whatever its direction now; `undefined` when nothing is sorted.
24
+ */
25
+ export declare const firstSortOf: (previous: FirstSort | undefined, sortDescriptor: SortDescriptor | undefined, resting?: SortDescriptor) => FirstSort | undefined;
26
+ /**
27
+ * Decides what a press on a sortable column header does. A column's cycle is its first direction, the other direction, then
28
+ * cleared: react-aria only toggles the sorted column, so the press that would toggle it back to its first direction clears it
29
+ * instead. An explicit `sort(direction)` on the sorted column asking for the other direction reaches the table as a press
30
+ * does, so on its second direction it clears too; one asking for the direction already shown is a change.
31
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
32
+ * @param next - What react-aria asks for: ascending for a column that is not sorted, the other direction for the one that is.
33
+ * @param firstDirection - The direction the sorted column first landed on; `current`'s own direction when unknown.
34
+ * @returns `'clear'` for a press on the sorted column once it is on its second direction; `'change'` otherwise.
35
+ */
36
+ export declare const sortStepOf: (current: SortDescriptor | undefined, next: SortDescriptor, firstDirection?: SortDirection) => "change" | "clear";
37
+ /**
38
+ * Picks the sort a column chosen in the sort menu applies.
39
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
40
+ * @param column - The chosen column's id.
41
+ * @returns That column in the current direction, or ascending when nothing is sorted.
42
+ */
43
+ export declare const sortOfColumnChoice: (current: SortDescriptor | undefined, column: Key) => SortDescriptor;
44
+ /**
45
+ * Picks the sort a direction chosen in the sort menu applies.
46
+ * @param current - The table's `sortDescriptor`; `undefined` when nothing is sorted.
47
+ * @param direction - The chosen direction.
48
+ * @returns The current column in that direction, or `undefined` when nothing is sorted, as there is no column to apply it to.
49
+ */
50
+ export declare const sortOfDirectionChoice: (current: SortDescriptor | undefined, direction: SortDirection) => SortDescriptor | undefined;
51
+ /**
52
+ * Keys a column's item in the sort menu, apart from the direction and "Clear sort" items and from every other column's.
53
+ * @param id - The column's id, as its `Table.Head` has it.
54
+ * @returns `col-<id>` for a string id and `colnum-<id>` for a number, so `'1'` and `1` stay apart; the item's test id
55
+ * derives from it too.
56
+ */
57
+ export declare const sortMenuColumnKeyOf: (id: Key) => string;
58
+ /**
59
+ * Finds the column a sort-menu item stands for.
60
+ * @param columns - The menu's columns.
61
+ * @param key - The chosen item's key; `undefined` when nothing is chosen.
62
+ * @returns The column whose item that is, or `undefined` for any other key.
63
+ */
64
+ export declare const columnOfSortMenuKey: <C extends {
65
+ id: Key;
66
+ }>(columns: readonly C[], key: Key | undefined) => C | undefined;
67
+ //# sourceMappingURL=tableSort.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSort.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Table/utilities/tableSort.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,OAAO,cAAc,GAAG,SAAS,KAAG,OACtB,CAAC;AAE/E,gGAAgG;AAChG,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,MAAM,EAAE,GAAG,CAAC;IACZ,0GAA0G;IAC1G,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,SAAS,GAAG,SAAS,EAC/B,gBAAgB,cAAc,GAAG,SAAS,EAC1C,UAAU,cAAc,KACvB,SAAS,GAAG,SAOd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,MAAM,cAAc,EAAE,iBAAiB,aAAa,KAAG,QAAQ,GAAG,OAKjI,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,QAAQ,GAAG,KAAG,cAGpF,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,WAAW,aAAa,KAAG,cAAc,GAAG,SACrE,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,GAAG,KAAG,MAAiE,CAAC;AAEhH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,EAAE,SAAS,SAAS,CAAC,EAAE,EAAE,KAAK,GAAG,GAAG,SAAS,KAAG,CAAC,GAAG,SACX,CAAC"}