@databiosphere/findable-ui 17.0.0 → 19.0.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 (201) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +22 -0
  3. package/lib/apis/azul/common/filterTransformer.js +1 -1
  4. package/lib/apis/azul/common/utils.d.ts +1 -1
  5. package/lib/apis/azul/common/utils.js +5 -1
  6. package/lib/common/entities.d.ts +3 -3
  7. package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +2 -0
  8. package/lib/components/Detail/components/Table/components/TableRows/tableRows.js +1 -15
  9. package/lib/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.js +9 -10
  10. package/lib/components/Filter/common/utils.js +1 -1
  11. package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +1 -1
  12. package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.d.ts +1 -1
  13. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +23 -12
  14. package/lib/components/Table/common/columnDef.js +1 -0
  15. package/lib/components/Table/common/gridTable.styles.js +5 -11
  16. package/lib/components/Table/common/utils.d.ts +3 -29
  17. package/lib/components/Table/common/utils.js +26 -61
  18. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.d.ts +3 -0
  19. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.js +3 -0
  20. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.d.ts +8 -0
  21. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.js +18 -0
  22. package/lib/components/Table/components/TableBody/hooks/virtualizer/types.d.ts +4 -0
  23. package/lib/components/Table/components/TableBody/tableBody.d.ts +3 -2
  24. package/lib/components/Table/components/TableBody/tableBody.js +7 -28
  25. package/lib/components/Table/components/TableBody/utils.d.ts +12 -0
  26. package/lib/components/Table/components/TableBody/utils.js +17 -0
  27. package/lib/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.d.ts +3 -1
  28. package/lib/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.js +6 -14
  29. package/lib/components/Table/components/TableFeatures/ColumnGrouping/utils.d.ts +28 -0
  30. package/lib/components/Table/components/TableFeatures/ColumnGrouping/utils.js +52 -0
  31. package/lib/components/Table/components/TableFeatures/ColumnVisibility/utils.d.ts +21 -0
  32. package/lib/components/Table/components/TableFeatures/ColumnVisibility/utils.js +37 -0
  33. package/lib/components/Table/components/TableFeatures/RowSorting/utils.d.ts +29 -0
  34. package/lib/components/Table/components/TableFeatures/RowSorting/utils.js +68 -0
  35. package/lib/components/Table/components/TableHead/tableHead.d.ts +2 -6
  36. package/lib/components/Table/components/TableHead/tableHead.js +6 -4
  37. package/lib/components/Table/components/TableHead/types.d.ts +6 -0
  38. package/lib/components/Table/components/TableHead/types.js +1 -0
  39. package/lib/components/Table/components/TableHead/utils.d.ts +19 -0
  40. package/lib/components/Table/components/TableHead/utils.js +34 -0
  41. package/lib/components/Table/components/TableRow/tableRow.styles.d.ts +1 -0
  42. package/lib/components/Table/components/TableRow/tableRow.styles.js +14 -2
  43. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.d.ts +3 -2
  44. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +8 -4
  45. package/lib/components/Table/components/TableRows/components/CollapsableRows/hook.d.ts +9 -0
  46. package/lib/components/Table/components/TableRows/components/CollapsableRows/hook.js +17 -0
  47. package/lib/components/Table/components/TableRows/tableRows.d.ts +3 -3
  48. package/lib/components/Table/components/TableRows/tableRows.js +9 -5
  49. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.d.ts +3 -0
  50. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.js +26 -0
  51. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.d.ts +2 -0
  52. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.js +16 -0
  53. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.d.ts +3 -0
  54. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.js +12 -0
  55. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.d.ts +7 -0
  56. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.js +1 -0
  57. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/constants.d.ts +4 -0
  58. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/constants.js +13 -0
  59. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/types.d.ts +4 -0
  60. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/types.js +1 -0
  61. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/utils.d.ts +17 -0
  62. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/utils.js +36 -0
  63. package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.d.ts +2 -3
  64. package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.js +3 -11
  65. package/lib/components/Table/components/TableToolbar/tableToolbar.js +4 -2
  66. package/lib/components/Table/features/RowPosition/constants.js +2 -2
  67. package/lib/components/Table/features/RowPosition/utils.d.ts +2 -2
  68. package/lib/components/Table/features/RowPosition/utils.js +12 -5
  69. package/lib/components/Table/options/updater.d.ts +10 -0
  70. package/lib/components/Table/options/updater.js +24 -0
  71. package/lib/components/Table/table.js +22 -17
  72. package/lib/components/TableCreator/common/constants.d.ts +2 -2
  73. package/lib/components/TableCreator/common/constants.js +2 -1
  74. package/lib/components/TableCreator/common/utils.d.ts +5 -2
  75. package/lib/components/TableCreator/common/utils.js +11 -4
  76. package/lib/components/TableCreator/options/expanded/constants.d.ts +2 -0
  77. package/lib/components/TableCreator/options/expanded/constants.js +6 -0
  78. package/lib/components/TableCreator/options/expanded/hook.d.ts +2 -0
  79. package/lib/components/TableCreator/options/expanded/hook.js +4 -0
  80. package/lib/components/TableCreator/options/grouping/constants.d.ts +2 -0
  81. package/lib/components/TableCreator/options/grouping/constants.js +5 -0
  82. package/lib/components/TableCreator/options/grouping/hook.d.ts +2 -0
  83. package/lib/components/TableCreator/options/grouping/hook.js +9 -0
  84. package/lib/components/TableCreator/options/hook.d.ts +2 -0
  85. package/lib/components/TableCreator/options/hook.js +25 -0
  86. package/lib/components/TableCreator/options/rowSelection/constants.d.ts +2 -0
  87. package/lib/components/TableCreator/options/rowSelection/constants.js +5 -0
  88. package/lib/components/TableCreator/options/rowSelection/hook.d.ts +2 -0
  89. package/lib/components/TableCreator/options/rowSelection/hook.js +4 -0
  90. package/lib/components/TableCreator/options/sorting/constants.d.ts +2 -0
  91. package/lib/components/TableCreator/options/sorting/constants.js +5 -0
  92. package/lib/components/TableCreator/options/sorting/hook.d.ts +2 -0
  93. package/lib/components/TableCreator/options/sorting/hook.js +4 -0
  94. package/lib/components/TableCreator/tableCreator.d.ts +3 -5
  95. package/lib/components/TableCreator/tableCreator.js +4 -2
  96. package/lib/components/common/DropdownMenu/dropdownMenu.d.ts +2 -3
  97. package/lib/components/common/DropdownMenu/dropdownMenu.js +7 -7
  98. package/lib/components/common/DropdownMenu/dropdownMenu.styles.d.ts +1 -1
  99. package/lib/components/common/DropdownMenu/dropdownMenu.styles.js +1 -1
  100. package/lib/components/common/Menu/hooks/useMenu.d.ts +5 -6
  101. package/lib/config/entities.d.ts +7 -7
  102. package/lib/config/utils.d.ts +0 -7
  103. package/lib/config/utils.js +0 -12
  104. package/lib/hooks/useCategoryFilter.js +5 -1
  105. package/lib/providers/exploreState/actions/updateGrouping/action.d.ts +10 -0
  106. package/lib/providers/exploreState/actions/updateGrouping/action.js +16 -0
  107. package/lib/providers/exploreState/actions/updateGrouping/dispatch.d.ts +7 -0
  108. package/lib/providers/exploreState/actions/updateGrouping/dispatch.js +12 -0
  109. package/lib/providers/exploreState/actions/updateGrouping/types.d.ts +9 -0
  110. package/lib/providers/exploreState/actions/updateGrouping/types.js +1 -0
  111. package/lib/providers/exploreState/actions/updateGrouping/utils.d.ts +10 -0
  112. package/lib/providers/exploreState/actions/updateGrouping/utils.js +26 -0
  113. package/lib/providers/exploreState/entities.d.ts +3 -4
  114. package/lib/providers/exploreState/initializer/utils.js +41 -8
  115. package/lib/providers/exploreState/payloads/entities.d.ts +2 -1
  116. package/lib/providers/exploreState/utils.d.ts +6 -4
  117. package/lib/providers/exploreState/utils.js +7 -4
  118. package/lib/providers/exploreState.d.ts +3 -1
  119. package/lib/providers/exploreState.js +15 -5
  120. package/lib/providers/fileManifestState.js +2 -4
  121. package/lib/viewModelBuilders/common/utils.d.ts +6 -6
  122. package/lib/viewModelBuilders/common/utils.js +10 -10
  123. package/lib/views/ExploreView/exploreView.js +3 -3
  124. package/package.json +1 -1
  125. package/src/apis/azul/common/filterTransformer.ts +1 -1
  126. package/src/apis/azul/common/utils.ts +4 -2
  127. package/src/common/entities.ts +3 -3
  128. package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +2 -0
  129. package/src/components/Detail/components/Table/components/TableRows/tableRows.tsx +3 -18
  130. package/src/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.tsx +28 -32
  131. package/src/components/Filter/common/utils.ts +1 -1
  132. package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +1 -1
  133. package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +1 -1
  134. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +27 -13
  135. package/src/components/Table/common/columnDef.ts +1 -0
  136. package/src/components/Table/common/gridTable.styles.ts +5 -11
  137. package/src/components/Table/common/utils.ts +45 -108
  138. package/src/components/Table/components/TableBody/hooks/virtualizer/constants.ts +3 -0
  139. package/src/components/Table/components/TableBody/hooks/virtualizer/hook.ts +23 -0
  140. package/src/components/Table/components/TableBody/hooks/virtualizer/types.ts +5 -0
  141. package/src/components/Table/components/TableBody/tableBody.tsx +14 -30
  142. package/src/components/Table/components/TableBody/utils.ts +21 -0
  143. package/src/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.tsx +14 -15
  144. package/src/components/Table/components/TableFeatures/ColumnGrouping/utils.ts +70 -0
  145. package/src/components/Table/components/TableFeatures/ColumnVisibility/utils.ts +52 -0
  146. package/src/components/Table/components/TableFeatures/RowSorting/utils.ts +87 -0
  147. package/src/components/Table/components/TableHead/tableHead.tsx +21 -29
  148. package/src/components/Table/components/TableHead/types.ts +7 -0
  149. package/src/components/Table/components/TableHead/utils.ts +42 -0
  150. package/src/components/Table/components/TableRow/tableRow.styles.ts +19 -2
  151. package/src/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +8 -2
  152. package/src/components/Table/components/TableRows/components/CollapsableRows/hook.ts +20 -0
  153. package/src/components/Table/components/TableRows/tableRows.tsx +18 -15
  154. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.ts +17 -0
  155. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.tsx +54 -0
  156. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.tsx +28 -0
  157. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.ts +8 -0
  158. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/constants.ts +17 -0
  159. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/types.ts +5 -0
  160. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/utils.ts +45 -0
  161. package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.tsx +7 -20
  162. package/src/components/Table/components/TableToolbar/tableToolbar.tsx +8 -2
  163. package/src/components/Table/features/RowPosition/constants.ts +2 -2
  164. package/src/components/Table/features/RowPosition/utils.ts +10 -5
  165. package/src/components/Table/options/updater.ts +29 -0
  166. package/src/components/Table/table.tsx +43 -25
  167. package/src/components/TableCreator/common/constants.ts +4 -6
  168. package/src/components/TableCreator/common/utils.ts +14 -7
  169. package/src/components/TableCreator/options/expanded/constants.ts +14 -0
  170. package/src/components/TableCreator/options/expanded/hook.ts +6 -0
  171. package/src/components/TableCreator/options/grouping/constants.ts +6 -0
  172. package/src/components/TableCreator/options/grouping/hook.ts +17 -0
  173. package/src/components/TableCreator/options/hook.ts +31 -0
  174. package/src/components/TableCreator/options/rowSelection/constants.ts +10 -0
  175. package/src/components/TableCreator/options/rowSelection/hook.ts +8 -0
  176. package/src/components/TableCreator/options/sorting/constants.ts +10 -0
  177. package/src/components/TableCreator/options/sorting/hook.ts +6 -0
  178. package/src/components/TableCreator/tableCreator.tsx +4 -11
  179. package/src/components/common/DropdownMenu/dropdownMenu.styles.ts +1 -1
  180. package/src/components/common/DropdownMenu/dropdownMenu.tsx +19 -17
  181. package/src/components/common/Menu/hooks/useMenu.ts +8 -9
  182. package/src/config/entities.ts +11 -10
  183. package/src/config/utils.ts +0 -14
  184. package/src/hooks/useCategoryFilter.ts +5 -1
  185. package/src/hooks/useFileManifest/common/utils.ts +2 -2
  186. package/src/providers/exploreState/actions/updateGrouping/action.ts +26 -0
  187. package/src/providers/exploreState/actions/updateGrouping/dispatch.ts +16 -0
  188. package/src/providers/exploreState/actions/updateGrouping/types.ts +11 -0
  189. package/src/providers/exploreState/actions/updateGrouping/utils.ts +33 -0
  190. package/src/providers/exploreState/entities.ts +3 -3
  191. package/src/providers/exploreState/initializer/utils.ts +58 -10
  192. package/src/providers/exploreState/payloads/entities.ts +2 -0
  193. package/src/providers/exploreState/utils.ts +10 -7
  194. package/src/providers/exploreState.tsx +29 -6
  195. package/src/providers/fileManifestState.tsx +2 -4
  196. package/src/viewModelBuilders/common/utils.ts +10 -10
  197. package/src/views/ExploreView/exploreView.tsx +2 -4
  198. package/types/data-explorer-ui.d.ts +8 -1
  199. package/lib/components/TableCreator/common/entities.d.ts +0 -5
  200. package/src/components/TableCreator/common/entities.ts +0 -6
  201. /package/lib/components/{TableCreator/common/entities.js → Table/components/TableBody/hooks/virtualizer/types.js} +0 -0
@@ -9,6 +9,7 @@ import { HeadSelectionCell } from "../Table/components/TableHead/components/Head
9
9
  import { Table } from "../Table/table";
10
10
  import { COLUMN_CONFIGS } from "./common/constants";
11
11
  import { buildBaseColumnDef } from "./common/utils";
12
+ import { useTableOptions } from "./options/hook";
12
13
  import { TableCreator as TableCreatorContainer } from "./tableCreator.styles";
13
14
  const createCell = (config) => function CellCreator(cellContext) {
14
15
  return (React.createElement(ComponentCreator, { components: [config.componentConfig], response: cellContext.row.original, viewContext: { cellContext } }));
@@ -19,7 +20,8 @@ const createHeaderSelectionCell = () => function CellCreator({ table }) {
19
20
  const createRowSelectionCell = () => function CellCreator({ row }) {
20
21
  return React.createElement(RowSelectionCell, { row: row });
21
22
  };
22
- export const TableCreator = ({ columns, defaultSort, getRowId, items, listView, loading, tableOptions, }) => {
23
+ export const TableCreator = ({ columns, getRowId, items, listView, loading, }) => {
24
+ const tableOptions = useTableOptions();
23
25
  const columnDefs = useMemo(() => columns.reduce((acc, columnConfig) => {
24
26
  acc.push({
25
27
  ...buildBaseColumnDef(columnConfig),
@@ -38,7 +40,7 @@ export const TableCreator = ({ columns, defaultSort, getRowId, items, listView,
38
40
  header: createHeaderSelectionCell(),
39
41
  },
40
42
  ]), [columns]);
41
- const initialState = getInitialState(columns, defaultSort);
43
+ const initialState = getInitialState(columns);
42
44
  return (React.createElement(TableCreatorContainer, null,
43
45
  React.createElement(Loading, { appear: false, loading: loading || false, panelStyle: PAPER_PANEL_STYLE.FLUID }),
44
46
  React.createElement(Table, { columns: columnDefs, getRowId: getRowId, initialState: initialState, items: items, listView: listView, loading: loading, tableOptions: tableOptions })));
@@ -1,9 +1,8 @@
1
1
  import { MenuProps as MMenuProps } from "@mui/material";
2
- import { ElementType } from "react";
3
2
  import { DropdownMenuButtonProps, DropdownMenuIconButtonProps, DropdownMenuItemProps } from "./common/entities";
4
3
  export interface DropdownMenuProps extends Omit<MMenuProps, "children" | "open"> {
5
- Button: ElementType<DropdownMenuButtonProps> | ElementType<DropdownMenuIconButtonProps>;
4
+ button: (props: Pick<DropdownMenuButtonProps, "onClick" | "open"> | Pick<DropdownMenuIconButtonProps, "onClick" | "open">) => JSX.Element;
6
5
  children?: ({ closeMenu }: DropdownMenuItemProps) => JSX.Element[];
7
6
  className?: string;
8
7
  }
9
- export declare const DropdownMenu: ({ Button, children, className, ...props }: DropdownMenuProps) => JSX.Element;
8
+ export declare const DropdownMenu: ({ button, children, className, ...props }: DropdownMenuProps) => JSX.Element;
@@ -1,10 +1,10 @@
1
- import React, { Fragment, useState } from "react";
1
+ import React, { Fragment } from "react";
2
+ import { useMenu } from "../Menu/hooks/useMenu";
2
3
  import { DEFAULT_DROPDOWN_MENU_PROPS } from "./common/constants";
3
- import { Menu } from "./dropdownMenu.styles";
4
- export const DropdownMenu = ({ Button, children, className, ...props /* Spread props to allow for Mui Menu specific prop overrides e.g. "anchorOrigin". */ }) => {
5
- const [anchorEl, setAnchorEl] = useState(null);
6
- const closeMenu = () => setAnchorEl(null);
4
+ import { StyledMenu } from "./dropdownMenu.styles";
5
+ export const DropdownMenu = ({ button, children, className, ...props /* Spread props to allow for Mui Menu specific prop overrides e.g. "anchorOrigin". */ }) => {
6
+ const { anchorEl, onClose: closeMenu, onOpen: openMenu, open, } = useMenu();
7
7
  return (React.createElement(Fragment, null,
8
- React.createElement(Button, { onClick: (event) => setAnchorEl(event.currentTarget), open: Boolean(anchorEl) }),
9
- React.createElement(Menu, { ...DEFAULT_DROPDOWN_MENU_PROPS, anchorEl: anchorEl, className: className, onClose: closeMenu, open: Boolean(anchorEl), ...props }, children ? children({ closeMenu }) : null)));
8
+ button({ onClick: openMenu, open }),
9
+ React.createElement(StyledMenu, { ...DEFAULT_DROPDOWN_MENU_PROPS, anchorEl: anchorEl, className: className, onClose: closeMenu, open: open, ...props }, children ? children({ closeMenu }) : null)));
10
10
  };
@@ -1,3 +1,3 @@
1
- export declare const Menu: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & {
1
+ export declare const StyledMenu: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & {
2
2
  theme?: import("@emotion/react").Theme;
3
3
  }, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  import styled from "@emotion/styled";
2
2
  import { Menu as MMenu } from "@mui/material";
3
- export const Menu = styled(MMenu) `
3
+ export const StyledMenu = styled(MMenu) `
4
4
  .MuiPaper-menu {
5
5
  margin: 4px 0;
6
6
  }
@@ -1,16 +1,15 @@
1
- import { PopperProps as MPopperProps } from "@mui/material";
2
1
  import { MouseEvent } from "react";
3
- export interface UseMenu {
4
- anchorEl: MPopperProps["anchorEl"];
2
+ export interface UseMenu<E extends HTMLElement> {
3
+ anchorEl: E | null;
5
4
  onClose: () => void;
6
5
  onDisableScrollLock: () => void;
7
6
  onEnableScrollLock: () => void;
8
- onOpen: (event: MouseEvent<HTMLElement>) => void;
9
- onToggleOpen: (event: MouseEvent<HTMLElement>) => void;
7
+ onOpen: (event: MouseEvent<E>) => void;
8
+ onToggleOpen: (event: MouseEvent<E>) => void;
10
9
  open: boolean;
11
10
  }
12
11
  /**
13
12
  * Menu functionality for menu dropdown, with menu position.
14
13
  * @returns menu functionality.
15
14
  */
16
- export declare const useMenu: () => UseMenu;
15
+ export declare const useMenu: <E extends HTMLElement>() => UseMenu<E>;
@@ -1,5 +1,5 @@
1
1
  import { TabProps as MTabProps, Theme, ThemeOptions } from "@mui/material";
2
- import { CellContext, ColumnMeta, ColumnSort, RowData, Table, TableOptions } from "@tanstack/react-table";
2
+ import { CellContext, ColumnDef, ColumnMeta, ColumnSort, GroupingState, RowData, Table, TableOptions } from "@tanstack/react-table";
3
3
  import { JSXElementConstructor, ReactNode } from "react";
4
4
  import { SelectCategoryValueView, SelectedFilter } from "../common/entities";
5
5
  import { HeroTitle } from "../components/common/Title/title";
@@ -70,19 +70,19 @@ export interface CategoryConfig {
70
70
  }
71
71
  /**
72
72
  * Column configuration.
73
+ * TanStack ColumnDef properties not currently supported include:
74
+ * - `enableMultiSort` - Note, table multi-sort is managed via table options.
73
75
  */
74
- export interface ColumnConfig<T = any, C extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = any> {
76
+ export type ColumnConfig<T extends RowData, TValue = unknown, C extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = any> = Omit<ColumnDef<T, TValue>, "enableMultiSort"> & {
75
77
  columnPinned?: boolean;
76
78
  columnVisible?: boolean;
77
79
  componentConfig: ComponentConfig<C, T>;
78
80
  disableHiding?: boolean;
79
- disableSorting?: boolean;
80
81
  header: string;
81
82
  id: string;
82
83
  meta?: ColumnMeta<T, unknown>;
83
- tooltip?: string;
84
84
  width: GridTrackSize;
85
- }
85
+ };
86
86
  /**
87
87
  * Interface used to define the configuration of a component.
88
88
  * This will be used by @see ComponentCreator to create a React component with the given props and
@@ -213,7 +213,6 @@ export interface ListViewConfig {
213
213
  disablePagination?: boolean;
214
214
  enableDownload?: boolean;
215
215
  enableRowPreview?: boolean;
216
- enableRowSelection?: boolean;
217
216
  enableTab?: boolean;
218
217
  listHero?: ComponentsConfig;
219
218
  rowPreviewView?: ComponentsConfig;
@@ -250,6 +249,7 @@ export interface Override {
250
249
  }
251
250
  export interface SavedFilter {
252
251
  filters: SelectedFilter[];
252
+ grouping?: GroupingState;
253
253
  sorting?: ColumnSort[];
254
254
  title: string;
255
255
  }
@@ -262,7 +262,7 @@ export interface TrackFilterAppliedPayload {
262
262
  searchTerm: string;
263
263
  section: string;
264
264
  selected: boolean;
265
- value: string;
265
+ value: unknown;
266
266
  }
267
267
  /**
268
268
  * Filter applied tracking function
@@ -1,4 +1,3 @@
1
- import { ColumnSort } from "@tanstack/react-table";
2
1
  import { EntityConfig, SiteConfig } from "./entities";
3
2
  /**
4
3
  * Returns context default config for config provider.
@@ -10,12 +9,6 @@ export declare function getDefaultConfig(): SiteConfig;
10
9
  * @returns context default entity config for config provider.
11
10
  */
12
11
  export declare function getDefaultEntityConfig(): EntityConfig;
13
- /**
14
- * Returns the initial table sorting state for the specified entity list configuration.
15
- * @param entityConfig - Entity configuration.
16
- * @returns initial sorting state.
17
- */
18
- export declare function getDefaultSorting(entityConfig: EntityConfig): ColumnSort[];
19
12
  /**
20
13
  * Returns the entity config for the given entity list type.
21
14
  * @param entities - Entities config.
@@ -46,18 +46,6 @@ export function getDefaultEntityConfig() {
46
46
  route: "",
47
47
  };
48
48
  }
49
- /**
50
- * Returns the initial table sorting state for the specified entity list configuration.
51
- * @param entityConfig - Entity configuration.
52
- * @returns initial sorting state.
53
- */
54
- export function getDefaultSorting(entityConfig) {
55
- const columnSort = entityConfig.list.defaultSort;
56
- if (!columnSort) {
57
- return [];
58
- }
59
- return [columnSort];
60
- }
61
49
  /**
62
50
  * Returns the entity config for the given entity list type.
63
51
  * @param entities - Entities config.
@@ -158,7 +158,11 @@ function isCategoryAcceptListed(category, categoryConfigs) {
158
158
  * @returns Number indicating sort precedence of cv0 vs cv1.
159
159
  */
160
160
  function sortCategoryValueViews(cvv0, cvv1) {
161
- return COLLATOR_CASE_INSENSITIVE.compare(cvv0.label, cvv1.label);
161
+ return !cvv0.label
162
+ ? 1
163
+ : !cvv1.label
164
+ ? -1
165
+ : COLLATOR_CASE_INSENSITIVE.compare(cvv0.label, cvv1.label);
162
166
  }
163
167
  /**
164
168
  * Sort category views by display label, ascending.
@@ -0,0 +1,10 @@
1
+ import { ExploreState } from "../../../exploreState";
2
+ import { UpdateGroupingPayload } from "./types";
3
+ /**
4
+ * Reducer function to handle the "update grouping" action.
5
+ * Updates the grouping in the state for the current entity.
6
+ * @param state - Explore State.
7
+ * @param payload - Payload.
8
+ * @returns explore state.
9
+ */
10
+ export declare function updateGroupingAction(state: ExploreState, payload: UpdateGroupingPayload): ExploreState;
@@ -0,0 +1,16 @@
1
+ import { updateEntityPageState } from "../../utils";
2
+ import { buildNextGrouping } from "./utils";
3
+ /**
4
+ * Reducer function to handle the "update grouping" action.
5
+ * Updates the grouping in the state for the current entity.
6
+ * @param state - Explore State.
7
+ * @param payload - Payload.
8
+ * @returns explore state.
9
+ */
10
+ export function updateGroupingAction(state, payload) {
11
+ const grouping = buildNextGrouping(state, payload.updaterOrValue);
12
+ return {
13
+ ...state,
14
+ entityPageState: updateEntityPageState(state.tabValue, state.entityPageState, { grouping }),
15
+ };
16
+ }
@@ -0,0 +1,7 @@
1
+ import { UpdateGroupingAction, UpdateGroupingPayload } from "./types";
2
+ /**
3
+ * Action creator for updating grouping in the state.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export declare function updateGrouping(payload: UpdateGroupingPayload): UpdateGroupingAction;
@@ -0,0 +1,12 @@
1
+ import { ExploreActionKind } from "../../../exploreState";
2
+ /**
3
+ * Action creator for updating grouping in the state.
4
+ * @param payload - Payload.
5
+ * @returns Action with payload and action type.
6
+ */
7
+ export function updateGrouping(payload) {
8
+ return {
9
+ payload,
10
+ type: ExploreActionKind.UpdateGrouping,
11
+ };
12
+ }
@@ -0,0 +1,9 @@
1
+ import { GroupingState, Updater } from "@tanstack/react-table";
2
+ import { ExploreActionKind } from "../../../exploreState";
3
+ export type UpdateGroupingAction = {
4
+ payload: UpdateGroupingPayload;
5
+ type: ExploreActionKind.UpdateGrouping;
6
+ };
7
+ export type UpdateGroupingPayload = {
8
+ updaterOrValue: Updater<GroupingState>;
9
+ };
@@ -0,0 +1,10 @@
1
+ import { GroupingState, Updater } from "@tanstack/react-table";
2
+ import { ExploreState } from "../../../exploreState";
3
+ /**
4
+ * Builds the next grouping state for the current entity type.
5
+ * Uses TanStack updater to update the grouping state.
6
+ * @param state - Explore state.
7
+ * @param updaterOrValue - Updater or value to update the grouping state.
8
+ * @returns grouping state.
9
+ */
10
+ export declare function buildNextGrouping(state: ExploreState, updaterOrValue: Updater<GroupingState>): GroupingState;
@@ -0,0 +1,26 @@
1
+ import { resolveUpdater } from "../../../../components/Table/options/updater";
2
+ /**
3
+ * Builds the next grouping state for the current entity type.
4
+ * Uses TanStack updater to update the grouping state.
5
+ * @param state - Explore state.
6
+ * @param updaterOrValue - Updater or value to update the grouping state.
7
+ * @returns grouping state.
8
+ */
9
+ export function buildNextGrouping(state, updaterOrValue) {
10
+ const grouping = resolveUpdater(updaterOrValue, getOldGrouping(state));
11
+ if (grouping.length > 1) {
12
+ // Explore state only supports single-column grouping.
13
+ return grouping.slice(-1);
14
+ }
15
+ return grouping;
16
+ }
17
+ /**
18
+ * Retrieves the current "old" grouping state from the explore state, for the current entity type.
19
+ * @param state - Explore state.
20
+ * @returns old grouping state.
21
+ */
22
+ function getOldGrouping(state) {
23
+ const { entityPageState, tabValue } = state;
24
+ const { grouping = [] } = entityPageState[tabValue];
25
+ return grouping;
26
+ }
@@ -1,4 +1,4 @@
1
- import { ColumnSort, RowSelectionState, VisibilityState } from "@tanstack/react-table";
1
+ import { ColumnSort, GroupingState, RowSelectionState, VisibilityState } from "@tanstack/react-table";
2
2
  import { CategoryValueKey, SelectCategory, SelectCategoryView, SelectedFilter } from "../../common/entities";
3
3
  import { RowPreviewState } from "../../components/Table/features/RowPreview/entities";
4
4
  import { CategoryConfig, CategoryGroup, CategoryGroupConfig, EntityPath, SavedFilter } from "../../config/entities";
@@ -6,6 +6,7 @@ export interface EntityPageState {
6
6
  categoryGroupConfigKey: CategoryGroupConfigKey;
7
7
  columnsVisibility: VisibilityState;
8
8
  enableRowSelection: boolean;
9
+ grouping: GroupingState;
9
10
  rowPreview: RowPreviewState;
10
11
  rowSelection: RowSelectionState;
11
12
  sorting: ColumnSort[];
@@ -24,8 +25,6 @@ export interface EntityState {
24
25
  }
25
26
  export type EntityStateByCategoryGroupConfigKey = Map<CategoryGroupConfigKey, EntityState>;
26
27
  export type CategoryGroupConfigKey = CategoryGroupConfig["key"];
27
- export interface EntityStateSavedFilter extends Omit<SavedFilter, "sort"> {
28
- sorting?: ColumnSort[];
29
- }
28
+ export type EntityStateSavedFilter = SavedFilter;
30
29
  export type ListItem = any;
31
30
  export type SavedFilterByCategoryValueKey = Map<CategoryValueKey, EntityStateSavedFilter>;
@@ -1,6 +1,5 @@
1
1
  import { getInitialTableColumnVisibility } from "../../../components/Table/common/utils";
2
2
  import { ACCESSOR_KEYS } from "../../../components/TableCreator/common/constants";
3
- import { getDefaultSorting } from "../../../config/utils";
4
3
  import { SELECT_CATEGORY_KEY } from "../constants";
5
4
  import { getEntityCategoryGroupConfigKey, getFilterCount } from "../utils";
6
5
  import { DEFAULT_CATEGORY_GROUP_SAVED_FILTERS, DEFAULT_ENTITY_STATE, INITIAL_STATE, } from "./constants";
@@ -45,8 +44,13 @@ function buildSavedFilterByCategoryValueKey(savedFilters) {
45
44
  if (!savedFilters)
46
45
  return;
47
46
  const savedFilterByCategoryValueKey = new Map();
48
- for (const { filters, sorting, title } of savedFilters) {
49
- savedFilterByCategoryValueKey.set(title, { filters, sorting, title });
47
+ for (const { filters, grouping, sorting, title } of savedFilters) {
48
+ savedFilterByCategoryValueKey.set(title, {
49
+ filters,
50
+ grouping,
51
+ sorting,
52
+ title,
53
+ });
50
54
  }
51
55
  return savedFilterByCategoryValueKey;
52
56
  }
@@ -95,14 +99,22 @@ function initCategoryGroups(entityStateByCategoryGroupConfigKey, categoryGroupCo
95
99
  * @returns column visibility.
96
100
  */
97
101
  function initColumnVisibility(entityConfig) {
98
- const { list: { columns, tableOptions: { initialState: { columnVisibility = {} } = {} } = {}, }, listView: { enableRowSelection = false } = {}, } = entityConfig;
102
+ const { list: { columns, tableOptions: { enableRowSelection, initialState: { columnVisibility = {} } = {}, } = {}, }, } = entityConfig;
99
103
  return {
100
- [ACCESSOR_KEYS.ROW_POSITION]: false, // Explicitly setting row position to false; required - currently `columnVisibilty` is initialized from columns configuration.
101
- [ACCESSOR_KEYS.SELECT]: enableRowSelection,
104
+ [ACCESSOR_KEYS.ROW_POSITION]: false, // Explicitly setting row position to false; required - currently `columnVisibility` is initialized from columns configuration.
105
+ [ACCESSOR_KEYS.SELECT]: Boolean(enableRowSelection),
102
106
  ...getInitialTableColumnVisibility(columns),
103
107
  ...columnVisibility, // `columnVisibility` is managed by ExploreState; use table options to override this setting.
104
108
  };
105
109
  }
110
+ /**
111
+ * Returns the initial `enableRowSelection` option for the specified entity list configuration.
112
+ * @param entityConfig - Entity configuration.
113
+ * @returns initial `enableRowSelection` option.
114
+ */
115
+ function initEnableRowSelection(entityConfig) {
116
+ return Boolean(entityConfig.list.tableOptions?.enableRowSelection);
117
+ }
106
118
  /**
107
119
  * Initializes entity page state.
108
120
  * @param config - Site config.
@@ -115,10 +127,11 @@ function initEntityPageState(config) {
115
127
  [entity.route]: {
116
128
  categoryGroupConfigKey: initCategoryGroupConfigKey(config, entity),
117
129
  columnsVisibility: initColumnVisibility(entity),
118
- enableRowSelection: Boolean(entity.listView?.enableRowSelection),
130
+ enableRowSelection: initEnableRowSelection(entity),
131
+ grouping: initGrouping(entity),
119
132
  rowPreview: undefined,
120
133
  rowSelection: {},
121
- sorting: getDefaultSorting(entity),
134
+ sorting: initSorting(entity),
122
135
  },
123
136
  };
124
137
  }, {});
@@ -169,6 +182,26 @@ function initFilterState(decodedFilterParam) {
169
182
  }
170
183
  return filterState;
171
184
  }
185
+ /**
186
+ * Returns the initial table grouping state for the specified entity list configuration.
187
+ * @param entityConfig - Entity configuration.
188
+ * @returns initial grouping state.
189
+ */
190
+ function initGrouping(entityConfig) {
191
+ const { list: { tableOptions: { initialState: { grouping = [] } = {} } = {} }, } = entityConfig;
192
+ return grouping;
193
+ }
194
+ /**
195
+ * Returns the initial table sorting state for the specified entity list configuration.
196
+ * @param entityConfig - Entity configuration.
197
+ * @returns initial sorting state.
198
+ */
199
+ function initSorting(entityConfig) {
200
+ const { list: { defaultSort, tableOptions: { initialState: { sorting = [] } = {} } = {}, }, } = entityConfig;
201
+ if (defaultSort)
202
+ return [defaultSort];
203
+ return sorting;
204
+ }
172
205
  /**
173
206
  * Returns the explore state reducer initial arguments.
174
207
  * @param config - Site config.
@@ -1,4 +1,4 @@
1
- import { ColumnSort, RowSelectionState, VisibilityState } from "@tanstack/react-table";
1
+ import { ColumnSort, GroupingState, RowSelectionState, VisibilityState } from "@tanstack/react-table";
2
2
  import { CategoryKey, CategoryValueKey, PaginationDirectionType, SelectCategory, SelectedFilter } from "../../../common/entities";
3
3
  import { RowPreviewState } from "../../../components/Table/features/RowPreview/entities";
4
4
  import { ListItems, PaginationResponse } from "../../exploreState";
@@ -45,6 +45,7 @@ export type UpdateColumnVisibilityPayload = VisibilityState;
45
45
  export interface UpdateEntityFiltersPayload {
46
46
  entityListType: string;
47
47
  filters: SelectedFilter[];
48
+ grouping?: GroupingState;
48
49
  sorting?: ColumnSort[];
49
50
  }
50
51
  /**
@@ -1,4 +1,3 @@
1
- import { ColumnSort } from "@tanstack/react-table";
2
1
  import { CategoryKey, CategoryValueKey, SelectedFilter } from "../../common/entities";
3
2
  import { RowPreviewState } from "../../components/Table/features/RowPreview/entities";
4
3
  import { ExploreState, ListItems, PaginationState } from "../exploreState";
@@ -48,13 +47,16 @@ export declare function getEntityState(state: ExploreState, categoryGroupConfigK
48
47
  */
49
48
  export declare function getEntityStateSavedFilter(state: ExploreState, categoryValueKey: CategoryValueKey): EntityStateSavedFilter | undefined;
50
49
  /**
51
- * Returns entity state "saved filter" sorting for the given category value key.
50
+ * Retrieves a specified property from the "saved filter" for the given category value key.
51
+ * This function fetches a property (e.g., "sorting" or "grouping") from the saved filter
52
+ * associated with a given `selectedValue`.
52
53
  * @param state - Explore state.
53
54
  * @param selectedValue - Key of category value that has been de/selected.
54
55
  * @param selected - True if value is selected, false if de-selected.
55
- * @returns sorting.
56
+ * @param propertyName - The name of the property to retrieve from the saved filter. Should be one of the predefined keys: "sorting" or "grouping".
57
+ * @returns value of the specified property from the saved filter, or undefined if `selected` is false.
56
58
  */
57
- export declare function getEntityStateSavedSorting(state: ExploreState, selectedValue: CategoryValueKey, selected: boolean): ColumnSort[] | undefined;
59
+ export declare function getEntityStateSavedProperty<K extends "sorting" | "grouping">(state: ExploreState, selectedValue: CategoryValueKey, selected: boolean, propertyName: K): EntityStateSavedFilter[K] | undefined;
58
60
  /**
59
61
  * Returns the filter count.
60
62
  * @param filterState - Filter state.
@@ -67,17 +67,20 @@ export function getEntityStateSavedFilter(state, categoryValueKey) {
67
67
  return entityState.savedFilterByCategoryValueKey?.get(categoryValueKey);
68
68
  }
69
69
  /**
70
- * Returns entity state "saved filter" sorting for the given category value key.
70
+ * Retrieves a specified property from the "saved filter" for the given category value key.
71
+ * This function fetches a property (e.g., "sorting" or "grouping") from the saved filter
72
+ * associated with a given `selectedValue`.
71
73
  * @param state - Explore state.
72
74
  * @param selectedValue - Key of category value that has been de/selected.
73
75
  * @param selected - True if value is selected, false if de-selected.
74
- * @returns sorting.
76
+ * @param propertyName - The name of the property to retrieve from the saved filter. Should be one of the predefined keys: "sorting" or "grouping".
77
+ * @returns value of the specified property from the saved filter, or undefined if `selected` is false.
75
78
  */
76
- export function getEntityStateSavedSorting(state, selectedValue, selected) {
79
+ export function getEntityStateSavedProperty(state, selectedValue, selected, propertyName) {
77
80
  if (!selected)
78
81
  return;
79
82
  const savedFilter = getEntityStateSavedFilter(state, selectedValue);
80
- return savedFilter?.sorting;
83
+ return savedFilter?.[propertyName];
81
84
  }
82
85
  /**
83
86
  * Returns the filter count.
@@ -3,6 +3,7 @@ import { AzulSearchIndex } from "../apis/azul/common/entities";
3
3
  import { SelectCategoryView, SelectedFilter } from "../common/entities";
4
4
  import { RowPreviewState } from "../components/Table/features/RowPreview/entities";
5
5
  import { CategoryGroup, SiteConfig } from "../config/entities";
6
+ import { UpdateGroupingAction } from "./exploreState/actions/updateGrouping/types";
6
7
  import { EntityPageStateMapper, EntityStateByCategoryGroupConfigKey, ListItem } from "./exploreState/entities";
7
8
  import { ApplySavedFilterPayload, PaginateTablePayload, PatchExploreResponsePayload, ProcessExploreResponsePayload, ResetExploreResponsePayload, UpdateColumnVisibilityPayload, UpdateEntityFiltersPayload, UpdateEntityViewAccessPayload, UpdateFilterPayload, UpdateRowPreviewPayload, UpdateRowSelectionPayload, UpdateSortingPayload } from "./exploreState/payloads/entities";
8
9
  export type CatalogState = string | undefined;
@@ -103,6 +104,7 @@ export declare enum ExploreActionKind {
103
104
  UpdateEntityFilters = "UPDATE_ENTITY_FILTERS",
104
105
  UpdateEntityViewAccess = "UPDATE_ENTITY_VIEW_ACCESS",
105
106
  UpdateFilter = "UPDATE_FILTER",
107
+ UpdateGrouping = "UPDATE_GROUPING",
106
108
  UpdateRowPreview = "UPDATE_ROW_PREVIEW",
107
109
  UpdateRowSelection = "UPDATE_ROW_SELECTION",
108
110
  UpdateSorting = "UPDATE_SORTING"
@@ -110,7 +112,7 @@ export declare enum ExploreActionKind {
110
112
  /**
111
113
  * Explore action.
112
114
  */
113
- export type ExploreAction = ApplySavedFilterAction | ClearFiltersAction | PaginateTableAction | PatchExploreResponseAction | ProcessExploreResponseAction | ResetExploreResponseAction | ResetStateAction | SelectEntityTypeAction | UpdateColumnVisibilityAction | UpdateEntityFiltersAction | UpdateEntityViewAccessAction | UpdateFilterAction | UpdateRowPreviewAction | UpdateRowSelectionAction | UpdateSortingAction;
115
+ export type ExploreAction = ApplySavedFilterAction | ClearFiltersAction | PaginateTableAction | PatchExploreResponseAction | ProcessExploreResponseAction | ResetExploreResponseAction | ResetStateAction | SelectEntityTypeAction | UpdateColumnVisibilityAction | UpdateEntityFiltersAction | UpdateEntityViewAccessAction | UpdateFilterAction | UpdateGroupingAction | UpdateRowPreviewAction | UpdateRowSelectionAction | UpdateSortingAction;
114
116
  /**
115
117
  * Apply saved filter action.
116
118
  */
@@ -3,9 +3,10 @@ import { useAuthentication } from "../hooks/useAuthentication/useAuthentication"
3
3
  import { buildCategoryViews, buildNextFilterState, } from "../hooks/useCategoryFilter";
4
4
  import { useConfig } from "../hooks/useConfig";
5
5
  import { useURLFilterParams } from "../hooks/useURLFilterParams";
6
+ import { updateGroupingAction } from "./exploreState/actions/updateGrouping/action";
6
7
  import { DEFAULT_PAGINATION_STATE, INITIAL_STATE, } from "./exploreState/initializer/constants";
7
8
  import { initReducerArguments } from "./exploreState/initializer/utils";
8
- import { buildEntityStateSavedFilterState, buildNextSavedFilterState, closeRowPreview, getEntityCategoryGroupConfigKey, getEntityState, getEntityStateSavedSorting, getFilterCount, patchEntityListItems, resetPage, updateEntityPageState, updateEntityPageStateWithCommonCategoryGroupConfigKey, updateEntityStateByCategoryGroupConfigKey, updateSelectColumnVisibility, } from "./exploreState/utils";
9
+ import { buildEntityStateSavedFilterState, buildNextSavedFilterState, closeRowPreview, getEntityCategoryGroupConfigKey, getEntityState, getEntityStateSavedProperty, getFilterCount, patchEntityListItems, resetPage, updateEntityPageState, updateEntityPageStateWithCommonCategoryGroupConfigKey, updateEntityStateByCategoryGroupConfigKey, updateSelectColumnVisibility, } from "./exploreState/utils";
9
10
  /**
10
11
  * Explore state context for storing and using filter-related and explore state.
11
12
  */
@@ -70,6 +71,7 @@ export var ExploreActionKind;
70
71
  ExploreActionKind["UpdateEntityFilters"] = "UPDATE_ENTITY_FILTERS";
71
72
  ExploreActionKind["UpdateEntityViewAccess"] = "UPDATE_ENTITY_VIEW_ACCESS";
72
73
  ExploreActionKind["UpdateFilter"] = "UPDATE_FILTER";
74
+ ExploreActionKind["UpdateGrouping"] = "UPDATE_GROUPING";
73
75
  ExploreActionKind["UpdateRowPreview"] = "UPDATE_ROW_PREVIEW";
74
76
  ExploreActionKind["UpdateRowSelection"] = "UPDATE_ROW_SELECTION";
75
77
  ExploreActionKind["UpdateSorting"] = "UPDATE_SORTING";
@@ -93,7 +95,9 @@ function exploreReducer(state, action, exploreContext) {
93
95
  const rowPreview = closeRowPreview(state.rowPreview);
94
96
  const rowSelection = {};
95
97
  const savedFilterState = buildEntityStateSavedFilterState(payload.categoryKey, payload.selectedValue, payload.selected);
96
- const savedSorting = getEntityStateSavedSorting(state, payload.selectedValue, payload.selected);
98
+ const savedGrouping = getEntityStateSavedProperty(state, payload.selectedValue, payload.selected, "grouping");
99
+ const savedSorting = getEntityStateSavedProperty(state, payload.selectedValue, payload.selected, "sorting");
100
+ const grouping = savedGrouping || []; // Reset grouping to default if saved grouping is not available.
97
101
  const sorting = savedSorting || []; // Reset sorting to default if saved sorting is not available.
98
102
  updateEntityStateByCategoryGroupConfigKey(state, {
99
103
  filterState,
@@ -101,7 +105,7 @@ function exploreReducer(state, action, exploreContext) {
101
105
  });
102
106
  return {
103
107
  ...state,
104
- entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(state, { rowPreview, rowSelection, sorting }),
108
+ entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(state, { grouping, rowPreview, rowSelection, sorting }),
105
109
  filterCount: getFilterCount(filterState),
106
110
  filterState,
107
111
  paginationState: resetPage(state.paginationState),
@@ -250,7 +254,7 @@ function exploreReducer(state, action, exploreContext) {
250
254
  * - closes row preview, without updating the entity page state row preview.
251
255
  */
252
256
  case ExploreActionKind.UpdateEntityFilters: {
253
- const { entityListType, filters: filterState, sorting } = payload;
257
+ const { entityListType, filters: filterState, grouping = [], sorting = [], } = payload;
254
258
  const categoryGroupConfigKey = getEntityCategoryGroupConfigKey(entityListType, state.entityPageState);
255
259
  const rowPreview = closeRowPreview(state.entityPageState[entityListType].rowPreview);
256
260
  const rowSelection = {};
@@ -261,7 +265,7 @@ function exploreReducer(state, action, exploreContext) {
261
265
  }, categoryGroupConfigKey);
262
266
  return {
263
267
  ...state,
264
- entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(state, { rowPreview, rowSelection, sorting }, categoryGroupConfigKey),
268
+ entityPageState: updateEntityPageStateWithCommonCategoryGroupConfigKey(state, { grouping, rowPreview, rowSelection, sorting }, categoryGroupConfigKey),
265
269
  rowPreview: closeRowPreview(state.rowPreview),
266
270
  };
267
271
  }
@@ -295,6 +299,12 @@ function exploreReducer(state, action, exploreContext) {
295
299
  rowPreview,
296
300
  };
297
301
  }
302
+ /**
303
+ * Update grouping
304
+ **/
305
+ case ExploreActionKind.UpdateGrouping: {
306
+ return updateGroupingAction(state, payload);
307
+ }
298
308
  /**
299
309
  * Update row preview
300
310
  */
@@ -96,8 +96,7 @@ function fileManifestReducer(state, action) {
96
96
  // Updates selected file manifest filters with given selected category value.
97
97
  case FileManifestActionKind.UpdateFilter: {
98
98
  // Build next filter state.
99
- const filters = buildNextFilterState(state.filters, payload.categoryKey, getFilterParameterValue(payload.selectedValue), // TODO CategoryValueKey may be boolean or null.
100
- payload.selected);
99
+ const filters = buildNextFilterState(state.filters, payload.categoryKey, getFilterParameterValue(payload.selectedValue), payload.selected);
101
100
  // Get file summary filters.
102
101
  const fileSummaryFilters = buildNextFileSummaryFilterState(filters, state.fileSummaryFacetName);
103
102
  return {
@@ -140,8 +139,7 @@ function buildNextFileSummaryFilterState(filters, facetName) {
140
139
  * @returns all terms for the given category.
141
140
  */
142
141
  function getFileFacetTerms(fileFacet) {
143
- return fileFacet.terms.map((term) => getFilterParameterValue(term.name) // TODO CategoryValueKey may be boolean or null.
144
- );
142
+ return fileFacet.terms.map((term) => getFilterParameterValue(term.name));
145
143
  }
146
144
  /**
147
145
  * Build new set of selected filters on de/select of filter category.
@@ -7,15 +7,15 @@ import { CategoryKeyLabel } from "./entities";
7
7
  */
8
8
  export declare function mapCategoryKeyLabel(CATEGORY_KEY: Record<string, string>, CATEGORY_LABEL: Record<string, string>): CategoryKeyLabel;
9
9
  /**
10
- * Sanitizes a string for display i.e. any empty, null or undefined value is sanitized to "Unspecified".
11
- * @param str - String to sanitize.
10
+ * Sanitizes a value to a string for display i.e. any empty, null or undefined value is sanitized to "Unspecified".
11
+ * @param value - Value to sanitize.
12
12
  * @returns the string or sanitized string value.
13
13
  */
14
- export declare function sanitizeString(str: string): string;
14
+ export declare function sanitizeString(value: unknown): string;
15
15
  /**
16
- * Sanitizes a string array for display i.e. any string element within the string array that is an empty, null or
16
+ * Sanitizes array elements to strings for display i.e. any element within the string array that is an empty, null or
17
17
  * undefined value is sanitized to "Unspecified".
18
- * @param strArray - String array to sanitize.
18
+ * @param array - Array to sanitize.
19
19
  * @returns the string array, sanitized.
20
20
  */
21
- export declare function sanitizeStringArray(strArray: string[]): string[];
21
+ export declare function sanitizeStringArray(array: unknown[]): string[];