@geotab/zenith 3.16.0 → 3.17.0-beta.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 (282) hide show
  1. package/README.md +67 -1
  2. package/README.md.baseline +1 -0
  3. package/dist/absolute/absolute.js +5 -1
  4. package/dist/button/button.d.ts +2 -1
  5. package/dist/button/button.js +22 -5
  6. package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +2 -0
  7. package/dist/checkboxListWithAction/checkboxListWithAction.js +1 -1
  8. package/dist/commonHelpers/ShowMoreCell.d.ts +5 -0
  9. package/dist/commonHelpers/ShowMoreCell.js +66 -0
  10. package/dist/commonHelpers/getAriaAttributes.js +6 -9
  11. package/dist/commonHelpers/getNonAriaProps.d.ts +11 -0
  12. package/dist/commonHelpers/getNonAriaProps.js +19 -0
  13. package/dist/commonHelpers/hooks/useScroll.d.ts +1 -1
  14. package/dist/commonHelpers/hooks/useScroll.js +6 -6
  15. package/dist/commonHelpers/isAriaProp.d.ts +9 -0
  16. package/dist/commonHelpers/isAriaProp.js +13 -0
  17. package/dist/commonHelpers/showMoreRow.d.ts +28 -0
  18. package/dist/commonHelpers/showMoreRow.js +29 -0
  19. package/dist/commonHelpers/tabsKeyboard.d.ts +1 -1
  20. package/dist/commonHelpers/tabsKeyboard.js +15 -1
  21. package/dist/commonStyles/colors/colors.less +18 -0
  22. package/dist/dataFeed/dataFeedColumnsItems.js +3 -1
  23. package/dist/dataGrid/columns/checkboxColumn/checkboxCell.d.ts +2 -1
  24. package/dist/dataGrid/columns/checkboxColumn/checkboxCell.js +1 -1
  25. package/dist/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.d.ts +4 -2
  26. package/dist/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.js +10 -1
  27. package/dist/dataGrid/dataGrid.d.ts +5 -1
  28. package/dist/dataGrid/dataGrid.js +39 -2
  29. package/dist/dataGrid/lazyLoadingEnd/lazyLoadingEnd.d.ts +3 -0
  30. package/dist/dataGrid/lazyLoadingEnd/lazyLoadingEnd.js +54 -0
  31. package/dist/dataGrid/row/row.js +20 -2
  32. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -1
  33. package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +39 -4
  34. package/dist/dataGrid/withSelectableRows/withSelectableRows.js +73 -12
  35. package/dist/dropdown/dropdownTrigger.d.ts +1 -1
  36. package/dist/dropdownRaw/dropdownHelper.d.ts +12 -0
  37. package/dist/dropdownRaw/dropdownHelper.js +32 -11
  38. package/dist/dropdownRaw/dropdownRaw.js +36 -8
  39. package/dist/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
  40. package/dist/dropdownRaw/dropdownSearchableTrigger.js +13 -6
  41. package/dist/dropdownRaw/dropdownTrigger.d.ts +2 -1
  42. package/dist/dropdownRaw/dropdownTrigger.js +2 -2
  43. package/dist/dropdownRaw/stateReducer/stateReducer.d.ts +8 -0
  44. package/dist/dropdownRaw/stateReducer/stateReducer.js +5 -2
  45. package/dist/dropdownRaw/types.d.ts +36 -0
  46. package/dist/filterButton/filterButton.d.ts +1 -1
  47. package/dist/formGroup/hooks/rowHooks/useLabelClasses.js +8 -2
  48. package/dist/formLayout/utils/applyLayoutPosition/applyLayoutPosition.d.ts +2 -1
  49. package/dist/formLayout/utils/applyLayoutPosition/applyLayoutPosition.js +37 -90
  50. package/dist/header/components/collapsedItemsControl/collapsedItemsControl.d.ts +1 -1
  51. package/dist/header/components/collapsedItemsControl/collapsedItemsControl.js +6 -2
  52. package/dist/header/headerButton.d.ts +3 -1
  53. package/dist/header/headerButton.js +4 -2
  54. package/dist/header/headerMenu.d.ts +2 -0
  55. package/dist/header/headerMenu.js +1 -1
  56. package/dist/index.css +319 -68
  57. package/dist/index.d.ts +3 -1
  58. package/dist/index.js +9 -3
  59. package/dist/menu/components/menuButton.d.ts +3 -1
  60. package/dist/menu/components/menuButton.js +66 -47
  61. package/dist/menu/components/menuItem.js +4 -4
  62. package/dist/miniTabs/miniTabs.js +4 -2
  63. package/dist/pageHeader/pageHeaderButton.d.ts +1 -1
  64. package/dist/pageHeader/pageHeaderButton.js +4 -2
  65. package/dist/pagination/pagination.d.ts +19 -4
  66. package/dist/pagination/pagination.js +21 -1
  67. package/dist/pagination/paginationText/paginationText.d.ts +7 -1
  68. package/dist/pagination/paginationText/paginationText.js +6 -3
  69. package/dist/pillExpandable/pillContent.d.ts +3 -2
  70. package/dist/pillExpandable/pillContent.js +2 -2
  71. package/dist/pillExpandable/pillExpandable.js +20 -5
  72. package/dist/pillExpandable/pillExpandablePopoverContent.d.ts +3 -2
  73. package/dist/pillExpandable/pillExpandablePopoverContent.js +1 -1
  74. package/dist/pillExpandable/pillExpandableSimple.d.ts +3 -1
  75. package/dist/pillExpandable/pillExpandableSimple.js +19 -9
  76. package/dist/selectList/selectList.js +1 -0
  77. package/dist/selectList/selectListItem.d.ts +10 -1
  78. package/dist/selectList/selectListItem.js +12 -9
  79. package/dist/table/children/tablePagination.d.ts +1 -1
  80. package/dist/table/children/useTableChildren.d.ts +4 -2
  81. package/dist/table/children/useTableChildren.js +64 -16
  82. package/dist/table/nested/nestedData.d.ts +29 -1
  83. package/dist/table/nested/nestedData.js +45 -4
  84. package/dist/table/nested/useNestedRows.js +18 -22
  85. package/dist/table/nested/useShowMore.d.ts +41 -0
  86. package/dist/table/nested/useShowMore.js +56 -0
  87. package/dist/table/selectable/interfaces.d.ts +17 -0
  88. package/dist/table/selectable/useDragSelection.d.ts +10 -0
  89. package/dist/table/selectable/useDragSelection.js +145 -0
  90. package/dist/table/selectable/useSelectableRows.d.ts +5 -2
  91. package/dist/table/selectable/useSelectableRows.js +131 -36
  92. package/dist/table/selectable/utils/calculateSelectionState.d.ts +1 -1
  93. package/dist/table/selectable/utils/calculateSelectionState.js +43 -7
  94. package/dist/table/selectable/utils/checkRow.js +4 -2
  95. package/dist/table/selectable/utils/getCurrentPageSelection.js +9 -5
  96. package/dist/table/selectable/utils/getDragSelectionRows.d.ts +15 -0
  97. package/dist/table/selectable/utils/getDragSelectionRows.js +28 -0
  98. package/dist/table/selectable/utils/getRangeIds.d.ts +2 -0
  99. package/dist/table/selectable/utils/getRangeIds.js +21 -0
  100. package/dist/table/selectable/utils/isRowChecked.d.ts +1 -1
  101. package/dist/table/selectable/utils/isRowChecked.js +40 -7
  102. package/dist/table/table.d.ts +1 -2
  103. package/dist/table/table.js +58 -31
  104. package/dist/tabs/tabs.d.ts +1 -0
  105. package/dist/tabs/tabs.js +50 -17
  106. package/dist/textInputRaw/textInputRaw.js +3 -2
  107. package/dist/tooltip/tooltip.d.ts +2 -0
  108. package/dist/tooltip/tooltip.js +19 -7
  109. package/dist/utils/localization/translations/ar-001.json +1 -0
  110. package/dist/utils/localization/translations/bg-BG.json +1 -0
  111. package/dist/utils/localization/translations/cs.json +1 -0
  112. package/dist/utils/localization/translations/da-DK.json +1 -0
  113. package/dist/utils/localization/translations/de.json +1 -0
  114. package/dist/utils/localization/translations/el-GR.json +1 -0
  115. package/dist/utils/localization/translations/en.json +4 -0
  116. package/dist/utils/localization/translations/es.json +1 -0
  117. package/dist/utils/localization/translations/et-EE.json +1 -0
  118. package/dist/utils/localization/translations/fi-FI.json +1 -0
  119. package/dist/utils/localization/translations/fr-FR.json +1 -0
  120. package/dist/utils/localization/translations/fr.json +1 -0
  121. package/dist/utils/localization/translations/hu-HU.json +1 -0
  122. package/dist/utils/localization/translations/id.json +1 -0
  123. package/dist/utils/localization/translations/it.json +1 -0
  124. package/dist/utils/localization/translations/ja.json +1 -0
  125. package/dist/utils/localization/translations/ka-GE.json +1 -0
  126. package/dist/utils/localization/translations/ko-KR.json +1 -0
  127. package/dist/utils/localization/translations/lt-LT.json +1 -0
  128. package/dist/utils/localization/translations/lv-LV.json +1 -0
  129. package/dist/utils/localization/translations/ms.json +1 -0
  130. package/dist/utils/localization/translations/nb-NO.json +1 -0
  131. package/dist/utils/localization/translations/nl.json +1 -0
  132. package/dist/utils/localization/translations/pl.json +1 -0
  133. package/dist/utils/localization/translations/pt-BR.json +1 -0
  134. package/dist/utils/localization/translations/pt-PT.json +1 -0
  135. package/dist/utils/localization/translations/ro-RO.json +1 -0
  136. package/dist/utils/localization/translations/sk-SK.json +1 -0
  137. package/dist/utils/localization/translations/sv.json +1 -0
  138. package/dist/utils/localization/translations/th.json +1 -0
  139. package/dist/utils/localization/translations/tr.json +1 -0
  140. package/dist/utils/localization/translations/zh-Hans.json +1 -0
  141. package/dist/utils/localization/translations/zh-TW.json +1 -0
  142. package/dist/waiting/waiting.js +95 -1
  143. package/esm/absolute/absolute.js +5 -1
  144. package/esm/button/button.d.ts +2 -1
  145. package/esm/button/button.js +22 -5
  146. package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +2 -0
  147. package/esm/checkboxListWithAction/checkboxListWithAction.js +1 -1
  148. package/esm/commonHelpers/ShowMoreCell.d.ts +5 -0
  149. package/esm/commonHelpers/ShowMoreCell.js +57 -0
  150. package/esm/commonHelpers/getAriaAttributes.js +6 -9
  151. package/esm/commonHelpers/getNonAriaProps.d.ts +11 -0
  152. package/esm/commonHelpers/getNonAriaProps.js +15 -0
  153. package/esm/commonHelpers/hooks/useScroll.d.ts +1 -1
  154. package/esm/commonHelpers/hooks/useScroll.js +6 -6
  155. package/esm/commonHelpers/isAriaProp.d.ts +9 -0
  156. package/esm/commonHelpers/isAriaProp.js +9 -0
  157. package/esm/commonHelpers/showMoreRow.d.ts +28 -0
  158. package/esm/commonHelpers/showMoreRow.js +22 -0
  159. package/esm/commonHelpers/tabsKeyboard.d.ts +1 -1
  160. package/esm/commonHelpers/tabsKeyboard.js +15 -1
  161. package/esm/commonStyles/colors/colorsConstant.js +11 -11
  162. package/esm/dataFeed/dataFeedColumnsItems.js +3 -1
  163. package/esm/dataGrid/columns/checkboxColumn/checkboxCell.d.ts +2 -1
  164. package/esm/dataGrid/columns/checkboxColumn/checkboxCell.js +1 -1
  165. package/esm/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.d.ts +4 -2
  166. package/esm/dataGrid/columns/checkboxColumn/checkboxColumnWrapper.js +10 -1
  167. package/esm/dataGrid/dataGrid.d.ts +5 -1
  168. package/esm/dataGrid/dataGrid.js +38 -2
  169. package/esm/dataGrid/lazyLoadingEnd/lazyLoadingEnd.d.ts +3 -0
  170. package/esm/dataGrid/lazyLoadingEnd/lazyLoadingEnd.js +45 -0
  171. package/esm/dataGrid/row/row.js +20 -2
  172. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -1
  173. package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +39 -4
  174. package/esm/dataGrid/withSelectableRows/withSelectableRows.js +73 -12
  175. package/esm/dropdown/dropdownTrigger.d.ts +1 -1
  176. package/esm/dropdownRaw/dropdownHelper.d.ts +12 -0
  177. package/esm/dropdownRaw/dropdownHelper.js +30 -10
  178. package/esm/dropdownRaw/dropdownRaw.js +37 -9
  179. package/esm/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
  180. package/esm/dropdownRaw/dropdownSearchableTrigger.js +13 -6
  181. package/esm/dropdownRaw/dropdownTrigger.d.ts +2 -1
  182. package/esm/dropdownRaw/dropdownTrigger.js +2 -2
  183. package/esm/dropdownRaw/stateReducer/stateReducer.d.ts +8 -0
  184. package/esm/dropdownRaw/stateReducer/stateReducer.js +5 -2
  185. package/esm/dropdownRaw/types.d.ts +36 -0
  186. package/esm/filterButton/filterButton.d.ts +1 -1
  187. package/esm/formGroup/hooks/rowHooks/useLabelClasses.js +8 -2
  188. package/esm/formLayout/utils/applyLayoutPosition/applyLayoutPosition.d.ts +2 -1
  189. package/esm/formLayout/utils/applyLayoutPosition/applyLayoutPosition.js +37 -90
  190. package/esm/header/components/collapsedItemsControl/collapsedItemsControl.d.ts +1 -1
  191. package/esm/header/components/collapsedItemsControl/collapsedItemsControl.js +6 -2
  192. package/esm/header/headerButton.d.ts +3 -1
  193. package/esm/header/headerButton.js +4 -2
  194. package/esm/header/headerMenu.d.ts +2 -0
  195. package/esm/header/headerMenu.js +1 -1
  196. package/esm/index.d.ts +3 -1
  197. package/esm/index.js +3 -1
  198. package/esm/menu/components/menuButton.d.ts +3 -1
  199. package/esm/menu/components/menuButton.js +66 -47
  200. package/esm/menu/components/menuItem.js +4 -4
  201. package/esm/miniTabs/miniTabs.js +4 -2
  202. package/esm/pageHeader/pageHeaderButton.d.ts +1 -1
  203. package/esm/pageHeader/pageHeaderButton.js +4 -2
  204. package/esm/pagination/pagination.d.ts +19 -4
  205. package/esm/pagination/pagination.js +21 -1
  206. package/esm/pagination/paginationText/paginationText.d.ts +7 -1
  207. package/esm/pagination/paginationText/paginationText.js +6 -3
  208. package/esm/pillExpandable/pillContent.d.ts +3 -2
  209. package/esm/pillExpandable/pillContent.js +2 -2
  210. package/esm/pillExpandable/pillExpandable.js +20 -5
  211. package/esm/pillExpandable/pillExpandablePopoverContent.d.ts +3 -2
  212. package/esm/pillExpandable/pillExpandablePopoverContent.js +1 -1
  213. package/esm/pillExpandable/pillExpandableSimple.d.ts +3 -1
  214. package/esm/pillExpandable/pillExpandableSimple.js +20 -10
  215. package/esm/selectList/selectList.js +1 -0
  216. package/esm/selectList/selectListItem.d.ts +10 -1
  217. package/esm/selectList/selectListItem.js +12 -9
  218. package/esm/table/children/tablePagination.d.ts +1 -1
  219. package/esm/table/children/useTableChildren.d.ts +4 -2
  220. package/esm/table/children/useTableChildren.js +64 -16
  221. package/esm/table/nested/nestedData.d.ts +29 -1
  222. package/esm/table/nested/nestedData.js +44 -3
  223. package/esm/table/nested/useNestedRows.js +18 -22
  224. package/esm/table/nested/useShowMore.d.ts +41 -0
  225. package/esm/table/nested/useShowMore.js +52 -0
  226. package/esm/table/selectable/interfaces.d.ts +17 -0
  227. package/esm/table/selectable/useDragSelection.d.ts +10 -0
  228. package/esm/table/selectable/useDragSelection.js +141 -0
  229. package/esm/table/selectable/useSelectableRows.d.ts +5 -2
  230. package/esm/table/selectable/useSelectableRows.js +129 -35
  231. package/esm/table/selectable/utils/calculateSelectionState.d.ts +1 -1
  232. package/esm/table/selectable/utils/calculateSelectionState.js +43 -7
  233. package/esm/table/selectable/utils/checkRow.js +4 -2
  234. package/esm/table/selectable/utils/getCurrentPageSelection.js +9 -5
  235. package/esm/table/selectable/utils/getDragSelectionRows.d.ts +15 -0
  236. package/esm/table/selectable/utils/getDragSelectionRows.js +24 -0
  237. package/esm/table/selectable/utils/getRangeIds.d.ts +2 -0
  238. package/esm/table/selectable/utils/getRangeIds.js +17 -0
  239. package/esm/table/selectable/utils/isRowChecked.d.ts +1 -1
  240. package/esm/table/selectable/utils/isRowChecked.js +40 -7
  241. package/esm/table/table.d.ts +1 -2
  242. package/esm/table/table.js +43 -16
  243. package/esm/tabs/tabs.d.ts +1 -0
  244. package/esm/tabs/tabs.js +50 -17
  245. package/esm/textInputRaw/textInputRaw.js +3 -2
  246. package/esm/tooltip/tooltip.d.ts +2 -0
  247. package/esm/tooltip/tooltip.js +19 -7
  248. package/esm/utils/localization/translations/ar-001.json +1 -0
  249. package/esm/utils/localization/translations/bg-BG.json +1 -0
  250. package/esm/utils/localization/translations/cs.json +1 -0
  251. package/esm/utils/localization/translations/da-DK.json +1 -0
  252. package/esm/utils/localization/translations/de.json +1 -0
  253. package/esm/utils/localization/translations/el-GR.json +1 -0
  254. package/esm/utils/localization/translations/en.json +4 -0
  255. package/esm/utils/localization/translations/es.json +1 -0
  256. package/esm/utils/localization/translations/et-EE.json +1 -0
  257. package/esm/utils/localization/translations/fi-FI.json +1 -0
  258. package/esm/utils/localization/translations/fr-FR.json +1 -0
  259. package/esm/utils/localization/translations/fr.json +1 -0
  260. package/esm/utils/localization/translations/hu-HU.json +1 -0
  261. package/esm/utils/localization/translations/id.json +1 -0
  262. package/esm/utils/localization/translations/it.json +1 -0
  263. package/esm/utils/localization/translations/ja.json +1 -0
  264. package/esm/utils/localization/translations/ka-GE.json +1 -0
  265. package/esm/utils/localization/translations/ko-KR.json +1 -0
  266. package/esm/utils/localization/translations/lt-LT.json +1 -0
  267. package/esm/utils/localization/translations/lv-LV.json +1 -0
  268. package/esm/utils/localization/translations/ms.json +1 -0
  269. package/esm/utils/localization/translations/nb-NO.json +1 -0
  270. package/esm/utils/localization/translations/nl.json +1 -0
  271. package/esm/utils/localization/translations/pl.json +1 -0
  272. package/esm/utils/localization/translations/pt-BR.json +1 -0
  273. package/esm/utils/localization/translations/pt-PT.json +1 -0
  274. package/esm/utils/localization/translations/ro-RO.json +1 -0
  275. package/esm/utils/localization/translations/sk-SK.json +1 -0
  276. package/esm/utils/localization/translations/sv.json +1 -0
  277. package/esm/utils/localization/translations/th.json +1 -0
  278. package/esm/utils/localization/translations/tr.json +1 -0
  279. package/esm/utils/localization/translations/zh-Hans.json +1 -0
  280. package/esm/utils/localization/translations/zh-TW.json +1 -0
  281. package/esm/waiting/waiting.js +96 -2
  282. package/package.json +18 -6
@@ -1,6 +1,7 @@
1
1
  import { injectString } from "../../utils/localization/translationsDictionary";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useLanguage } from "../../utils/localization/useLanguage";
4
+ injectString("en", "{from}-{to} of {total}", "{from}-{to} of {total}");
4
5
  injectString("cs", "Showing {from} - {to} of {total}", "Zobrazuji {from}\u2013{to} z\xA0{total}");
5
6
  injectString("da-DK", "Showing {from} - {to} of {total}", "Viser {fra} - {til} af {total}");
6
7
  injectString("de", "Showing {from} - {to} of {total}", "{from} - {to} von {total} werden angezeigt");
@@ -37,12 +38,14 @@ injectString("bg-BG", "Showing {from} - {to} of {total}", "\u041F\u043E\u043A\u0
37
38
  export const PaginationText = ({
38
39
  amount,
39
40
  from,
40
- to
41
+ to,
42
+ variant = "showing"
41
43
  }) => {
42
44
  const {
43
45
  translate
44
46
  } = useLanguage();
45
- const children = translate("Showing {from} - {to} of {total}").replace("{from}", from.toString()).replace("{to}", to.toString()).replace("{total}", amount.toString());
47
+ const template = variant === "loaded" ? translate("{from}-{to} of {total}") : translate("Showing {from} - {to} of {total}");
48
+ const children = template.replace("{from}", from.toString()).replace("{to}", to.toString()).replace("{total}", amount.toString());
46
49
  return _jsx("span", {
47
50
  "aria-live": "polite",
48
51
  "aria-atomic": "true",
@@ -50,4 +53,4 @@ export const PaginationText = ({
50
53
  children: children
51
54
  });
52
55
  };
53
- export const TRANSLATIONS = ["Showing {from} - {to} of {total}"];
56
+ export const TRANSLATIONS = ["Showing {from} - {to} of {total}", "{from}-{to} of {total}"];
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode, Ref } from "react";
2
2
  import { IPillExpandableAction } from "./pillExpandable";
3
3
  import { TLazyContent } from "../skeleton/lazyContent";
4
4
  interface IPillContent {
@@ -12,6 +12,7 @@ interface IPillContent {
12
12
  isVisible?: boolean;
13
13
  errorHandler: (err: any) => ReactNode | undefined;
14
14
  descriptionId?: string;
15
+ descriptionRef?: Ref<HTMLDivElement>;
15
16
  }
16
- export declare const PillContent: ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible, errorHandler, descriptionId }: IPillContent) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const PillContent: ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible, errorHandler, descriptionId, descriptionRef }: IPillContent) => import("react/jsx-runtime").JSX.Element;
17
18
  export {};
@@ -4,7 +4,7 @@ import { Button } from "../button/button";
4
4
  import { classNames } from "../commonHelpers/classNames/classNames";
5
5
  import { useDriveClassName } from "../utils/theme/useDriveClassName";
6
6
  import { LazyContent } from "../skeleton/lazyContent";
7
- export const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible = true, errorHandler, descriptionId }) => {
7
+ export const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, tertiaryAction, onActionClick, isVisible = true, errorHandler, descriptionId, descriptionRef }) => {
8
8
  const headerDriveClassName = useDriveClassName("zen-status-pill-popup__header-text");
9
9
  const descriptionDriveClassName = useDriveClassName("zen-status-pill-popup__description");
10
10
  const mainActionClick = useCallback((onClick) => () => {
@@ -31,7 +31,7 @@ export const PillContent = ({ date, count, descriptionText, mainAction, secondar
31
31
  var _a, _b;
32
32
  return (_jsx(Button, Object.assign({ link: data.link }, data.linkOptions, { onClick: tertiaryActionClick(data.onClick), type: "tertiary", dataAnalyticsId: (_a = data.dataAnalyticsId) !== null && _a !== void 0 ? _a : (_b = data.linkOptions) === null || _b === void 0 ? void 0 : _b.dataAnalyticsId, children: data.text })));
33
33
  }, [tertiaryActionClick]);
34
- const renderDescription = useCallback(data => (_jsx("div", { id: descriptionId, className: classNames(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data })), [descriptionDriveClassName, descriptionId]);
34
+ const renderDescription = useCallback(data => (_jsx("div", { id: descriptionId, ref: descriptionRef, className: classNames(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data })), [descriptionDriveClassName, descriptionId, descriptionRef]);
35
35
  const renderCount = useCallback(data => data ? (_jsx("div", { className: classNames([
36
36
  "zen-status-pill-popup__header-text zen-status-pill-popup__header-text--left",
37
37
  headerDriveClassName || ""
@@ -87,6 +87,12 @@ const PillExpandablePopover = ({
87
87
  popoverRef.current = node;
88
88
  setContainerNode(node);
89
89
  }, [setContainerNode]);
90
+ const handleMobileReadyForFocus = useCallback(currentIsOpen => {
91
+ var _a;
92
+ if (!currentIsOpen) {
93
+ (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
94
+ }
95
+ }, [triggerRef]);
90
96
  // Focus first focusable element in desktop popover when content is ready.
91
97
  // Mobile MobileSheet handles its own first-focus (close button).
92
98
  useEffect(() => {
@@ -125,6 +131,7 @@ const PillExpandablePopover = ({
125
131
  isOpen: isOpen,
126
132
  onHidePanel: onClose,
127
133
  onCloseClick: onClose,
134
+ onReadyForFocus: handleMobileReadyForFocus,
128
135
  id: popupId,
129
136
  children: [_jsx(MobileSheet.Title, {
130
137
  className: "zen-status-pill-popup__mobile-title",
@@ -141,13 +148,15 @@ const PillExpandablePopover = ({
141
148
  }
142
149
  return _jsx(Absolute, {
143
150
  recalculateTrigger: isPopupContentReady,
144
- recalculateOnScroll: true,
151
+ closeOnScroll: true,
145
152
  useTrapFocusWithTrigger: "on",
146
153
  className: popupClassName,
147
154
  id: popupId,
148
155
  onOpenChange: onChange,
149
156
  isOpen: isOpen,
150
157
  triggerRef: triggerRef,
158
+ role: "dialog",
159
+ ariaLabel: title || text,
151
160
  alignmentsFn: alignments,
152
161
  children: _jsxs("div", {
153
162
  ref: handlePopoverRef,
@@ -173,6 +182,7 @@ const PillExpandableChild = ({
173
182
  }) => {
174
183
  const pillId = useId();
175
184
  const descriptionId = useId();
185
+ const [descriptionElement, setDescriptionElement] = useState(null);
176
186
  const {
177
187
  level,
178
188
  expandedChildPillIds,
@@ -227,7 +237,7 @@ const PillExpandableChild = ({
227
237
  onExpand: handleChildToggle,
228
238
  type: type,
229
239
  errorHandler: errorHandler,
230
- descriptionId: descriptionId,
240
+ descriptionId: isExpanded && descriptionElement ? descriptionId : undefined,
231
241
  dataAnalyticsId: dataAnalyticsId
232
242
  }), _jsx(PillContent, {
233
243
  onActionClick: handleChildToggle,
@@ -239,7 +249,8 @@ const PillExpandableChild = ({
239
249
  tertiaryAction: content.tertiaryAction,
240
250
  isVisible: isExpanded,
241
251
  errorHandler: errorHandler,
242
- descriptionId: descriptionId
252
+ descriptionId: descriptionId,
253
+ descriptionRef: setDescriptionElement
243
254
  })]
244
255
  });
245
256
  };
@@ -409,6 +420,7 @@ const PillExpandableBase = ({
409
420
  }) => {
410
421
  const popupId = useId();
411
422
  const descriptionId = useId();
423
+ const [descriptionElement, setDescriptionElement] = useState(null);
412
424
  const isDrive = useDrive();
413
425
  const [isMobile, setIsMobile] = useState(false);
414
426
  const handleDeviceTypeChange = useCallback(deviceType => {
@@ -533,6 +545,7 @@ const PillExpandableBase = ({
533
545
  tertiaryAction: content.tertiaryAction,
534
546
  errorHandler: errorHandler,
535
547
  descriptionId,
548
+ descriptionRef: setDescriptionElement,
536
549
  childToDisplay
537
550
  }), [effectiveVariant, childrenAnalysis, content, errorHandler, descriptionId, childToDisplay]);
538
551
  const showFooter = Boolean(moreCounter && viewMoreAction && childCount > MAX_PILLS_TO_DISPLAY_IN_POPUP);
@@ -563,7 +576,6 @@ const PillExpandableBase = ({
563
576
  },
564
577
  children: _jsxs("div", {
565
578
  className: classNames(["zen-status-pill", className || ""]),
566
- "aria-haspopup": "true",
567
579
  children: [_jsxs("div", {
568
580
  className: "zen-status-pill__pill-container",
569
581
  onClick: handlePopupToggle,
@@ -576,6 +588,8 @@ const PillExpandableBase = ({
576
588
  errorHandler: errorHandler,
577
589
  isBeta: isBeta,
578
590
  isMobile: isMobile,
591
+ descriptionId: isPopupOpen && descriptionElement ? descriptionId : undefined,
592
+ ariaHasPopup: "dialog",
579
593
  dataAnalyticsId: dataAnalyticsId
580
594
  }), uniqueChildren && _jsx(PillExpandableSimple, {
581
595
  icon: secondaryIcon || effectiveIcon,
@@ -584,7 +598,8 @@ const PillExpandableBase = ({
584
598
  type: type,
585
599
  errorHandler: errorHandler,
586
600
  className: "zen-status-pill__counter",
587
- isMobile: isMobile
601
+ isMobile: isMobile,
602
+ isDecorative: true
588
603
  })]
589
604
  }), _jsx(PillExpandablePopover, {
590
605
  useMobileSheet: useMobileSheet,
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode, Ref } from "react";
2
2
  import { TLazyContent } from "../skeleton/lazyContent";
3
3
  import { IPillExpandableAction, TPopoverVariant } from "./pillExpandable";
4
4
  interface IPillExpandablePopoverContent {
@@ -13,7 +13,8 @@ interface IPillExpandablePopoverContent {
13
13
  tertiaryAction?: TLazyContent<IPillExpandableAction>;
14
14
  errorHandler: (e: unknown) => ReactNode | undefined;
15
15
  descriptionId?: string;
16
+ descriptionRef?: Ref<HTMLDivElement>;
16
17
  childToDisplay: ReactNode[];
17
18
  }
18
- export declare const PillExpandablePopoverContent: ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, childToDisplay }: IPillExpandablePopoverContent) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const PillExpandablePopoverContent: ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, descriptionRef, childToDisplay }: IPillExpandablePopoverContent) => import("react/jsx-runtime").JSX.Element;
19
20
  export {};
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { PillContent } from "./pillContent";
3
- export const PillExpandablePopoverContent = ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, childToDisplay }) => (_jsxs(_Fragment, { children: [variant === "placeholder" && customContent, variant === "default" && (_jsx(PillContent, { onActionClick: onActionClick, descriptionText: descriptionText, date: date, count: count, mainAction: mainAction, secondaryAction: secondaryAction, tertiaryAction: tertiaryAction, errorHandler: errorHandler, descriptionId: descriptionId })), childToDisplay.length > 0 && _jsx("div", { className: "zen-status-pill-popup__children", children: childToDisplay })] }));
3
+ export const PillExpandablePopoverContent = ({ variant, customContent, onActionClick, descriptionText, date, count, mainAction, secondaryAction, tertiaryAction, errorHandler, descriptionId, descriptionRef, childToDisplay }) => (_jsxs(_Fragment, { children: [variant === "placeholder" && customContent, variant === "default" && (_jsx(PillContent, { onActionClick: onActionClick, descriptionText: descriptionText, date: date, count: count, mainAction: mainAction, secondaryAction: secondaryAction, tertiaryAction: tertiaryAction, errorHandler: errorHandler, descriptionId: descriptionId, descriptionRef: descriptionRef })), childToDisplay.length > 0 && _jsx("div", { className: "zen-status-pill-popup__children", children: childToDisplay })] }));
@@ -10,10 +10,12 @@ interface IPillExpandableSimple extends IPillExpandableBase {
10
10
  isMobile?: boolean;
11
11
  ref?: RefObject<HTMLButtonElement | null>;
12
12
  descriptionId?: string;
13
+ ariaHasPopup?: "dialog";
14
+ isDecorative?: boolean;
13
15
  type?: TPillType;
14
16
  }
15
17
  export declare const PillExpandableSimple: {
16
- ({ onExpand, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId, dataAnalyticsId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
18
+ ({ onExpand, text, expanded, includeExpandIcon, type, icon, isBeta, isMobile, ref, className, descriptionId, ariaHasPopup, isDecorative, dataAnalyticsId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
17
19
  displayName: string;
18
20
  };
19
21
  export {};
@@ -1,11 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { createElement, useCallback } from "react";
3
3
  import { useDriveClassName } from "../utils/theme/useDriveClassName";
4
4
  import { IconChevronTop } from "../icons/iconChevronTop";
5
5
  import { IconChevronBottom } from "../icons/iconChevronBottom";
6
6
  import { IconException } from "../icons/iconException";
7
7
  import { classNames } from "../commonHelpers/classNames/classNames";
8
- export const PillExpandableSimple = ({ onExpand, text, expanded, includeExpandIcon = true, type = "warning", icon = IconException, isBeta, isMobile, ref, className, descriptionId, dataAnalyticsId
8
+ export const PillExpandableSimple = ({ onExpand, text, expanded, includeExpandIcon = true, type = "warning", icon = IconException, isBeta, isMobile, ref, className, descriptionId, ariaHasPopup, isDecorative, dataAnalyticsId
9
9
  // eslint-disable-next-line complexity
10
10
  }) => {
11
11
  const iconDriveClassName = useDriveClassName("icon");
@@ -18,13 +18,7 @@ export const PillExpandableSimple = ({ onExpand, text, expanded, includeExpandIc
18
18
  const iconSize = isBeta ? "big" : isLargeIcon ? "large" : "big";
19
19
  const hasText = (text || "").trim().length > 0;
20
20
  const isTextCentered = icon === false && !includeExpandIcon;
21
- return (_jsxs("button", Object.assign({ type: "button", className: classNames([
22
- "zen-status-pill__container",
23
- `zen-status-pill__container--${type}`,
24
- containerDriveClassName || "",
25
- className || "",
26
- "zen-ellipsis"
27
- ]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-expanded": includeExpandIcon ? (expanded !== null && expanded !== void 0 ? expanded : false) : undefined, "aria-describedby": descriptionId }, (dataAnalyticsId ? { "data-analytics-id": dataAnalyticsId } : {}), { children: [icon !== false && (_jsx("div", { className: classNames([
21
+ const content = (_jsxs(_Fragment, { children: [icon !== false && (_jsx("div", { className: classNames([
28
22
  "zen-status-pill__icon",
29
23
  `zen-status-pill__icon--${type}`,
30
24
  isLargeIcon ? "zen-status-pill__icon--large" : "",
@@ -38,6 +32,22 @@ export const PillExpandableSimple = ({ onExpand, text, expanded, includeExpandIc
38
32
  isTextCentered ? "zen-status-pill__text--centered" : ""
39
33
  ]), children: text })), includeExpandIcon && (_jsx("div", { className: `zen-status-pill__expand-button zen-status-pill__expand-button--${type}`, children: _jsx("div", { className: "zen-status-pill__icon", children: createElement(ChevronIcon, {
40
34
  size: iconSize
41
- }) }) }))] })));
35
+ }) }) }))] }));
36
+ if (isDecorative) {
37
+ return (_jsx("span", { className: classNames([
38
+ "zen-status-pill__container",
39
+ `zen-status-pill__container--${type}`,
40
+ containerDriveClassName || "",
41
+ className || "",
42
+ "zen-ellipsis"
43
+ ]), "aria-hidden": "true", children: content }));
44
+ }
45
+ return (_jsx("button", Object.assign({ type: "button", className: classNames([
46
+ "zen-status-pill__container",
47
+ `zen-status-pill__container--${type}`,
48
+ containerDriveClassName || "",
49
+ className || "",
50
+ "zen-ellipsis"
51
+ ]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-expanded": includeExpandIcon ? (expanded !== null && expanded !== void 0 ? expanded : false) : undefined, "aria-describedby": descriptionId, "aria-haspopup": ariaHasPopup, "data-role": ariaHasPopup }, (dataAnalyticsId ? { "data-analytics-id": dataAnalyticsId } : {}), { children: content })));
42
52
  };
43
53
  PillExpandableSimple.displayName = "PillExpandableSimple";
@@ -139,6 +139,7 @@ const SelectListInnerComp = ({
139
139
  showCheckbox: showCheckbox,
140
140
  state: state.itemsState.get(item.id),
141
141
  focused: state.activeIndex === index,
142
+ divider: index < items.length - 1 ? item.divider : undefined,
142
143
  onChange: onChangeItem,
143
144
  onClick: onClickItem,
144
145
  onFocusItem: onFocusItem
@@ -10,5 +10,14 @@ export interface ISelectListItem extends IZenIdComponentProps {
10
10
  onClick?: (id: string) => void;
11
11
  onFocusItem?: (id: string) => void;
12
12
  multiLevel?: boolean;
13
+ /** When true, renders a 1px separator line below this item. */
14
+ divider?: boolean;
15
+ title?: string;
16
+ /**
17
+ * When true, renders the item label in `--text-error-message` red. Visual signal only — does not prevent selection.
18
+ * Only applies in single-select (SelectList) mode; ignored in multiselect (CheckboxListWithAction).
19
+ * Disabled+destructive renders with `--accents-error--main` (#ffeceb) on a transparent background, no hover feedback.
20
+ */
21
+ destructive?: boolean;
13
22
  }
14
- export declare const SelectListItem: ({ id, disabled, state, showCheckbox, focused, onChange, onClick, onFocusItem, multiLevel, className, children }: ISelectListItem) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const SelectListItem: ({ id, disabled, state, showCheckbox, focused, onChange, onClick, onFocusItem, multiLevel, divider, title, destructive, className, children }: ISelectListItem) => import("react/jsx-runtime").JSX.Element;
@@ -23,7 +23,16 @@ const getTabIndex = (showCheckbox, focused, disabled) => {
23
23
  return -1;
24
24
  return focused ? 0 : -1;
25
25
  };
26
- export const SelectListItem = ({ id, disabled = false, state = CheckboxState.Off, showCheckbox = false, focused = false, onChange, onClick, onFocusItem, multiLevel, className = "", children }) => {
26
+ const getItemClassName = (showCheckbox, focused, destructive, driveClassName, className, divider) => classNames([
27
+ "zen-select-item",
28
+ showCheckbox ? "zen-select-item--with-checkbox" : "",
29
+ focused ? "zen-select-item--focused" : "",
30
+ destructive ? "zen-select-item--destructive" : "",
31
+ driveClassName || "",
32
+ className,
33
+ divider ? "zen-select-item--divider" : ""
34
+ ]);
35
+ export const SelectListItem = ({ id, disabled = false, state = CheckboxState.Off, showCheckbox = false, focused = false, onChange, onClick, onFocusItem, multiLevel, divider, title, destructive, className = "", children }) => {
27
36
  const driveClassName = useDriveClassName("zen-select-item");
28
37
  const ChevronIcon = useDirectionalIcon(IconChevronRight, IconChevronLeft);
29
38
  const onClickFunc = () => {
@@ -36,16 +45,10 @@ export const SelectListItem = ({ id, disabled = false, state = CheckboxState.Off
36
45
  }
37
46
  onChange && onChange(id, newState);
38
47
  };
39
- return (_jsx("li", { "data-id": id, className: classNames([
40
- "zen-select-item",
41
- showCheckbox ? "zen-select-item--with-checkbox" : "",
42
- focused ? "zen-select-item--focused" : "",
43
- driveClassName || "",
44
- className
45
- ]), role: showCheckbox ? "menuitemcheckbox" : "option", "aria-selected": showCheckbox ? undefined : state === CheckboxState.On, "aria-checked": getAriaChecked(showCheckbox, state), "aria-disabled": disabled, tabIndex: getTabIndex(showCheckbox, focused, disabled), onFocus: !showCheckbox && !disabled && onFocusItem ? () => onFocusItem(id) : undefined, onClick: onClickFunc, id: id, children: _jsxs("div", { className: classNames([
48
+ return (_jsx("li", { "data-id": id, className: getItemClassName(showCheckbox, focused, destructive, driveClassName, className, divider), role: showCheckbox ? "menuitemcheckbox" : "option", "aria-selected": showCheckbox ? undefined : state === CheckboxState.On, "aria-checked": getAriaChecked(showCheckbox, state), "aria-disabled": disabled, tabIndex: getTabIndex(showCheckbox, focused, disabled), onFocus: !showCheckbox && !disabled && onFocusItem ? () => onFocusItem(id) : undefined, onClick: onClickFunc, id: id, children: _jsxs("div", { className: classNames([
46
49
  "zen-select-list__item-content",
47
50
  "zen-select-item__wrapper",
48
51
  "zen-ellipsis",
49
52
  multiLevel ? "zen-select-item__wrapper--with-arrow" : ""
50
- ]), children: [showCheckbox ? (_jsx(CheckboxNonInteractive, { className: "zen-select-item__control-view", checked: state === CheckboxState.On, indeterminate: state === CheckboxState.Indeterminate, disabled: disabled, children: children })) : (children), multiLevel && !showCheckbox ? _jsx(ChevronIcon, { size: "large" }) : null] }) }));
53
+ ]), title: title || undefined, children: [showCheckbox ? (_jsx(CheckboxNonInteractive, { className: "zen-select-item__control-view", checked: state === CheckboxState.On, indeterminate: state === CheckboxState.Indeterminate, disabled: disabled, children: children })) : (children), multiLevel && !showCheckbox ? _jsx(ChevronIcon, { size: "large" }) : null] }) }));
51
54
  };
@@ -1,5 +1,5 @@
1
1
  import { IPagination } from "../../pagination/pagination";
2
- export interface ITablePagination extends Pick<IPagination, "activePage" | "total" | "perPage" | "onChange" | "disabled"> {
2
+ export interface ITablePagination extends Pick<IPagination, "total">, Partial<Pick<IPagination, "activePage" | "perPage" | "onChange" | "disabled">> {
3
3
  }
4
4
  export declare const TablePagination: {
5
5
  (_: ITablePagination): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
1
1
  import { ReactElement, ReactNode, RefObject } from "react";
2
- export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
3
- bulkActions: ReactElement | undefined;
2
+ export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void, isInfinite?: boolean, loadedCount?: number, excludedCount?: number, canUsePaginationTotal?: boolean, hasMoreRows?: boolean) => {
3
+ bulkActions: import("react/jsx-runtime").JSX.Element | undefined;
4
+ hasSelection: boolean;
4
5
  pagination: ReactElement | undefined;
6
+ paginationTotal: number | undefined;
5
7
  activePage: undefined;
6
8
  fullscreenButton: ReactElement | undefined;
7
9
  emptyList: ReactElement | undefined;
@@ -24,35 +24,58 @@ const isChildElement = function (child, expectedType) {
24
24
  }
25
25
  return false;
26
26
  };
27
- export const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel) => useMemo(() => {
28
- let bulkActions = undefined;
27
+ export const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel,
28
+ // Desktop infinite scroll (Table's `onScrollEnd`): when true, a `Table.Pagination` child is
29
+ // rendered as the chevron-less "loaded" variant (see `pagination.tsx`) instead of the normal
30
+ // paged controls, driven by `loadedCount` (the number of rows currently rendered).
31
+ isInfinite = false, loadedCount = 0, excludedCount = 0, canUsePaginationTotal = true, hasMoreRows = false) => useMemo(() => {
32
+ let bulkActionButtons;
29
33
  let tablePagination = undefined;
30
34
  let activePage = undefined;
35
+ // A plain `let` reassigned only inside the `Children.forEach` callback below would be seen
36
+ // by TS as always `undefined` at the return statement (its pre-callback narrowed type) —
37
+ // see the `as ReactElement | undefined` casts used for the other fields above/below for the
38
+ // same reason. A property on a mutable object sidesteps that: property reads aren't narrowed
39
+ // the same way, so `paginationMeta.total` correctly types as `number | undefined` below.
40
+ const paginationMeta = {};
31
41
  let tableFullscreen = undefined;
32
42
  let emptyList = undefined;
33
43
  let footer = undefined;
34
44
  let detailPanel = undefined;
35
45
  const other = [];
36
46
  Children.forEach(children, child => {
47
+ var _a, _b;
37
48
  if (!child) {
38
49
  return;
39
50
  }
40
51
  if (isChildElement(child, TableBulkActions.displayName)) {
41
- const bulkActionButtons = child.props.children || [];
42
- bulkActions = (_jsx(BulkActions, { gridType: isMobile ? DeviceType.Mobile : DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, children: bulkActionButtons }));
52
+ bulkActionButtons = child.props.children || [];
43
53
  return;
44
54
  }
45
55
  if (isChildElement(child, TablePagination.displayName)) {
46
- tablePagination = createElement(Pagination, {
47
- activePage: child.props.activePage,
48
- total: child.props.total || 0,
49
- perPage: child.props.perPage || 10,
50
- onChange: child.props.onChange,
51
- type: PaginationType.Compact,
52
- includeText: true,
53
- gridRef: gridRef,
54
- disabled: child.props.disabled
55
- });
56
+ paginationMeta.present = true;
57
+ const total = child.props.total || 0;
58
+ tablePagination = isInfinite
59
+ ? createElement(Pagination, {
60
+ // activePage/perPage/onChange/gridRef/disabled are all paged-only (see
61
+ // Pagination's `variant` dispatch) and optional on IPagination for exactly
62
+ // this reason — intentionally omitted here rather than passed for no effect.
63
+ total,
64
+ variant: "loaded",
65
+ loadedCount,
66
+ includeText: true
67
+ })
68
+ : createElement(Pagination, {
69
+ activePage: (_a = child.props.activePage) !== null && _a !== void 0 ? _a : 0,
70
+ total,
71
+ perPage: child.props.perPage || 10,
72
+ onChange: (_b = child.props.onChange) !== null && _b !== void 0 ? _b : (() => undefined),
73
+ type: PaginationType.Compact,
74
+ includeText: true,
75
+ gridRef: gridRef,
76
+ disabled: child.props.disabled
77
+ });
78
+ paginationMeta.total = child.props.total;
56
79
  activePage = child.props.activePage;
57
80
  return;
58
81
  }
@@ -90,9 +113,20 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
90
113
  }
91
114
  other.push(child);
92
115
  });
116
+ const allRowsLoaded = (!paginationMeta.present && !hasMoreRows) || (paginationMeta.total !== undefined && loadedCount >= paginationMeta.total);
117
+ const hasExclusions = allSelected && excludedCount > 0;
118
+ const selectedCount = allSelected && !allRowsLoaded
119
+ ? canUsePaginationTotal && paginationMeta.total !== undefined
120
+ ? Math.max(0, paginationMeta.total - excludedCount)
121
+ : undefined
122
+ : selected;
123
+ const hasSelection = selectedCount === undefined || selectedCount > 0;
124
+ const bulkActions = bulkActionButtons !== undefined ? (_jsx(BulkActions, { gridType: isMobile ? DeviceType.Mobile : DeviceType.Desktop, selected: selectedCount !== null && selectedCount !== void 0 ? selectedCount : selected, allSelected: allSelected && !hasExclusions && hasSelection, selectionCountUnknown: hasExclusions && selectedCount === undefined, onClearSelection: clearSelection, children: bulkActionButtons })) : undefined;
93
125
  return {
94
- bulkActions: bulkActions,
126
+ bulkActions,
127
+ hasSelection,
95
128
  pagination: tablePagination,
129
+ paginationTotal: paginationMeta.total,
96
130
  activePage: activePage,
97
131
  fullscreenButton: tableFullscreen,
98
132
  emptyList: emptyList,
@@ -100,4 +134,18 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
100
134
  detailPanel: detailPanel,
101
135
  other: other
102
136
  };
103
- }, [children, clearSelection, isMobile, selected, gridRef, allSelected, activeId, onCloseDetailPanel]);
137
+ }, [
138
+ children,
139
+ clearSelection,
140
+ isMobile,
141
+ selected,
142
+ gridRef,
143
+ allSelected,
144
+ activeId,
145
+ onCloseDetailPanel,
146
+ isInfinite,
147
+ loadedCount,
148
+ excludedCount,
149
+ canUsePaginationTotal,
150
+ hasMoreRows
151
+ ]);
@@ -1,5 +1,26 @@
1
+ import { ReactNode } from "react";
1
2
  import { IEntityWithId } from "../../commonHelpers/entity";
2
- declare const NestedDataInt: <TParent extends IEntityWithId, TChild extends IEntityWithId>({ entities, children, expandedRows, useChildrenDataHook, maxHooks }: {
3
+ export declare const DEFAULT_SHOW_MORE_CAP = 10;
4
+ /**
5
+ * Caps how many child rows render per parent, appending a "+N more" affordance.
6
+ * Desktop only: on mobile an expanded parent always renders its full child list, uncapped and
7
+ * with no "+N more" row, because the feed has no comparable density constraint.
8
+ * Memoize the object you pass — a new reference each render re-derives the entity tree.
9
+ */
10
+ export type IShowMoreOptions<TParent> = {
11
+ /** Defaults to 10. */
12
+ cap?: number;
13
+ label?: (remaining: number) => ReactNode;
14
+ /** When true for a parent, all its children render with no cap and no "+N more" row. */
15
+ isUncapped?: (parent: TParent) => boolean;
16
+ } & ({
17
+ onClick: (parent: TParent) => void;
18
+ href?: never;
19
+ } | {
20
+ href: (parent: TParent) => string;
21
+ onClick?: never;
22
+ });
23
+ declare const NestedDataInt: <TParent extends IEntityWithId, TChild extends IEntityWithId>({ entities, children, expandedRows, useChildrenDataHook, maxHooks, showMore, hideChildrenOnMobile }: {
3
24
  entities: TParent[];
4
25
  expandedRows: string[];
5
26
  useChildrenDataHook: (parentId: string, enabled: boolean) => {
@@ -10,6 +31,13 @@ declare const NestedDataInt: <TParent extends IEntityWithId, TChild extends IEnt
10
31
  };
11
32
  children: React.ReactNode;
12
33
  maxHooks?: number;
34
+ showMore?: IShowMoreOptions<TParent>;
35
+ /**
36
+ * Mobile only. When true, parents render as plain rows on the feed: no children and no
37
+ * expand control. Pair it with a column renderer (e.g. `MainColumn`'s `mainText.createLink`)
38
+ * to send the user to a view that owns the full child list. Desktop is unaffected.
39
+ */
40
+ hideChildrenOnMobile?: boolean;
13
41
  }) => import("react/jsx-runtime").JSX.Element;
14
42
  export declare const NestedData: typeof NestedDataInt;
15
43
  export {};
@@ -1,6 +1,21 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
13
  import { cloneElement, memo, useMemo } from "react";
3
- const NestedDataInt = ({ entities, children, expandedRows, useChildrenDataHook, maxHooks = 100 }) => {
14
+ import { createShowMoreRow, withFullChildren } from "../../commonHelpers/showMoreRow";
15
+ import { useMobile } from "../../commonHelpers/hooks/useMobile";
16
+ export const DEFAULT_SHOW_MORE_CAP = 10;
17
+ const NestedDataInt = ({ entities, children, expandedRows, useChildrenDataHook, maxHooks = 100, showMore, hideChildrenOnMobile }) => {
18
+ const isMobile = useMobile();
4
19
  // Call hooks in a consistent order - this MUST be at the top level and cannot be wrapped in useEffect
5
20
  // eslint-disable-next-line react-hooks/exhaustive-deps
6
21
  const hookResults = [];
@@ -15,23 +30,49 @@ const NestedDataInt = ({ entities, children, expandedRows, useChildrenDataHook,
15
30
  }
16
31
  // Memoize the entities with children calculation to avoid unnecessary re-renders
17
32
  const entitiesWithChildren = useMemo(() => entities.map((entity, index) => {
33
+ var _a, _b;
18
34
  const isExpanded = expandedRows.includes(entity.id);
19
35
  if (index < maxHooks) {
20
36
  const { data: childrenData, isLoading, error, isError } = hookResults[index];
37
+ // Must come before the skeleton branch below: that one attaches placeholder
38
+ // children to every collapsed parent, which is what makes the feed render an
39
+ // expand control. Dropping `children` entirely is what removes it.
40
+ if (isMobile && hideChildrenOnMobile) {
41
+ // `children` is destructured off rather than spread over, so a
42
+ // consumer-supplied array cannot survive and re-add the control.
43
+ const _c = entity, { children: _hidden } = _c, rest = __rest(_c, ["children"]);
44
+ const withoutChildren = rest;
45
+ // Selection still covers every real child (ticket decision #4) even though
46
+ // none of them render.
47
+ return childrenData ? withFullChildren(withoutChildren, childrenData) : withoutChildren;
48
+ }
21
49
  if (isLoading || !isExpanded) {
22
- return Object.assign(Object.assign({}, entity), { children: new Array(3)
50
+ const placeholderEntity = Object.assign(Object.assign({}, entity), { children: new Array(3)
23
51
  .fill("")
24
52
  .map((_1, j) => ({ id: `loading-${entity.id}-${j}`, isLoading: true })) });
53
+ // Skeletons render, but already-fetched children stay available so selecting
54
+ // the parent covers every child rather than the placeholders.
55
+ return childrenData ? withFullChildren(placeholderEntity, childrenData) : placeholderEntity;
25
56
  }
26
57
  if (isError && error) {
27
58
  return Object.assign(Object.assign({}, entity), { children: [] });
28
59
  }
29
60
  if (childrenData) {
61
+ const cap = (_a = showMore === null || showMore === void 0 ? void 0 : showMore.cap) !== null && _a !== void 0 ? _a : DEFAULT_SHOW_MORE_CAP;
62
+ // The cap is a desktop density affordance; the mobile feed renders every child.
63
+ if (showMore && !isMobile && childrenData.length > cap && !((_b = showMore.isUncapped) === null || _b === void 0 ? void 0 : _b.call(showMore, entity))) {
64
+ const remaining = childrenData.length - cap;
65
+ const showMoreActivation = "href" in showMore && showMore.href
66
+ ? { href: showMore.href(entity) }
67
+ : { onActivate: () => showMore.onClick(entity) };
68
+ const showMoreRow = createShowMoreRow(Object.assign({ parentId: entity.id, remaining, label: showMore.label }, showMoreActivation));
69
+ return withFullChildren(Object.assign(Object.assign({}, entity), { children: [...childrenData.slice(0, cap), showMoreRow] }), childrenData);
70
+ }
30
71
  return Object.assign(Object.assign({}, entity), { children: childrenData });
31
72
  }
32
73
  }
33
74
  return entity;
34
- }), [entities, expandedRows, maxHooks, hookResults]);
75
+ }), [entities, expandedRows, maxHooks, hookResults, showMore, isMobile, hideChildrenOnMobile]);
35
76
  /* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any */
36
77
  const table = useMemo(() => cloneElement(children, {
37
78
  entities: entitiesWithChildren