@databiosphere/findable-ui 18.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 (180) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +11 -0
  3. package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +2 -0
  4. package/lib/components/Detail/components/Table/components/TableRows/tableRows.js +1 -15
  5. package/lib/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.js +9 -10
  6. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +23 -12
  7. package/lib/components/Table/common/columnDef.js +1 -0
  8. package/lib/components/Table/common/gridTable.styles.js +5 -11
  9. package/lib/components/Table/common/utils.d.ts +3 -29
  10. package/lib/components/Table/common/utils.js +25 -60
  11. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.d.ts +3 -0
  12. package/lib/components/Table/components/TableBody/hooks/virtualizer/constants.js +3 -0
  13. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.d.ts +8 -0
  14. package/lib/components/Table/components/TableBody/hooks/virtualizer/hook.js +18 -0
  15. package/lib/components/Table/components/TableBody/hooks/virtualizer/types.d.ts +4 -0
  16. package/lib/components/Table/components/TableBody/tableBody.d.ts +3 -2
  17. package/lib/components/Table/components/TableBody/tableBody.js +7 -28
  18. package/lib/components/Table/components/TableBody/utils.d.ts +12 -0
  19. package/lib/components/Table/components/TableBody/utils.js +17 -0
  20. package/lib/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.d.ts +3 -1
  21. package/lib/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.js +6 -14
  22. package/lib/components/Table/components/TableFeatures/ColumnGrouping/utils.d.ts +28 -0
  23. package/lib/components/Table/components/TableFeatures/ColumnGrouping/utils.js +52 -0
  24. package/lib/components/Table/components/TableFeatures/ColumnVisibility/utils.d.ts +21 -0
  25. package/lib/components/Table/components/TableFeatures/ColumnVisibility/utils.js +37 -0
  26. package/lib/components/Table/components/TableFeatures/RowSorting/utils.d.ts +29 -0
  27. package/lib/components/Table/components/TableFeatures/RowSorting/utils.js +68 -0
  28. package/lib/components/Table/components/TableHead/tableHead.d.ts +2 -6
  29. package/lib/components/Table/components/TableHead/tableHead.js +6 -4
  30. package/lib/components/Table/components/TableHead/types.d.ts +6 -0
  31. package/lib/components/Table/components/TableHead/types.js +1 -0
  32. package/lib/components/Table/components/TableHead/utils.d.ts +19 -0
  33. package/lib/components/Table/components/TableHead/utils.js +34 -0
  34. package/lib/components/Table/components/TableRow/tableRow.styles.d.ts +1 -0
  35. package/lib/components/Table/components/TableRow/tableRow.styles.js +14 -2
  36. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.d.ts +3 -2
  37. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +8 -4
  38. package/lib/components/Table/components/TableRows/components/CollapsableRows/hook.d.ts +9 -0
  39. package/lib/components/Table/components/TableRows/components/CollapsableRows/hook.js +17 -0
  40. package/lib/components/Table/components/TableRows/tableRows.d.ts +3 -3
  41. package/lib/components/Table/components/TableRows/tableRows.js +9 -5
  42. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.d.ts +3 -0
  43. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.js +26 -0
  44. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.d.ts +2 -0
  45. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.js +16 -0
  46. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.d.ts +3 -0
  47. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.js +12 -0
  48. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.d.ts +7 -0
  49. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.js +1 -0
  50. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/constants.d.ts +4 -0
  51. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/constants.js +13 -0
  52. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/types.d.ts +4 -0
  53. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/types.js +1 -0
  54. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/utils.d.ts +17 -0
  55. package/lib/components/Table/components/TableToolbar/components/ColumnGrouping/utils.js +36 -0
  56. package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.d.ts +2 -3
  57. package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.js +3 -11
  58. package/lib/components/Table/components/TableToolbar/tableToolbar.js +4 -2
  59. package/lib/components/Table/features/RowPosition/constants.js +2 -2
  60. package/lib/components/Table/features/RowPosition/utils.d.ts +2 -2
  61. package/lib/components/Table/features/RowPosition/utils.js +12 -5
  62. package/lib/components/Table/options/updater.d.ts +10 -0
  63. package/lib/components/Table/options/updater.js +24 -0
  64. package/lib/components/Table/table.js +22 -17
  65. package/lib/components/TableCreator/common/constants.d.ts +2 -2
  66. package/lib/components/TableCreator/common/constants.js +2 -1
  67. package/lib/components/TableCreator/common/utils.d.ts +5 -2
  68. package/lib/components/TableCreator/common/utils.js +11 -4
  69. package/lib/components/TableCreator/options/expanded/constants.d.ts +2 -0
  70. package/lib/components/TableCreator/options/expanded/constants.js +6 -0
  71. package/lib/components/TableCreator/options/expanded/hook.d.ts +2 -0
  72. package/lib/components/TableCreator/options/expanded/hook.js +4 -0
  73. package/lib/components/TableCreator/options/grouping/constants.d.ts +2 -0
  74. package/lib/components/TableCreator/options/grouping/constants.js +5 -0
  75. package/lib/components/TableCreator/options/grouping/hook.d.ts +2 -0
  76. package/lib/components/TableCreator/options/grouping/hook.js +9 -0
  77. package/lib/components/TableCreator/options/hook.d.ts +2 -0
  78. package/lib/components/TableCreator/options/hook.js +25 -0
  79. package/lib/components/TableCreator/options/rowSelection/constants.d.ts +2 -0
  80. package/lib/components/TableCreator/options/rowSelection/constants.js +5 -0
  81. package/lib/components/TableCreator/options/rowSelection/hook.d.ts +2 -0
  82. package/lib/components/TableCreator/options/rowSelection/hook.js +4 -0
  83. package/lib/components/TableCreator/options/sorting/constants.d.ts +2 -0
  84. package/lib/components/TableCreator/options/sorting/constants.js +5 -0
  85. package/lib/components/TableCreator/options/sorting/hook.d.ts +2 -0
  86. package/lib/components/TableCreator/options/sorting/hook.js +4 -0
  87. package/lib/components/TableCreator/tableCreator.d.ts +3 -5
  88. package/lib/components/TableCreator/tableCreator.js +4 -2
  89. package/lib/components/common/DropdownMenu/dropdownMenu.d.ts +2 -3
  90. package/lib/components/common/DropdownMenu/dropdownMenu.js +7 -7
  91. package/lib/components/common/DropdownMenu/dropdownMenu.styles.d.ts +1 -1
  92. package/lib/components/common/DropdownMenu/dropdownMenu.styles.js +1 -1
  93. package/lib/components/common/Menu/hooks/useMenu.d.ts +5 -6
  94. package/lib/config/entities.d.ts +6 -6
  95. package/lib/config/utils.d.ts +0 -7
  96. package/lib/config/utils.js +0 -12
  97. package/lib/providers/exploreState/actions/updateGrouping/action.d.ts +10 -0
  98. package/lib/providers/exploreState/actions/updateGrouping/action.js +16 -0
  99. package/lib/providers/exploreState/actions/updateGrouping/dispatch.d.ts +7 -0
  100. package/lib/providers/exploreState/actions/updateGrouping/dispatch.js +12 -0
  101. package/lib/providers/exploreState/actions/updateGrouping/types.d.ts +9 -0
  102. package/lib/providers/exploreState/actions/updateGrouping/types.js +1 -0
  103. package/lib/providers/exploreState/actions/updateGrouping/utils.d.ts +10 -0
  104. package/lib/providers/exploreState/actions/updateGrouping/utils.js +26 -0
  105. package/lib/providers/exploreState/entities.d.ts +3 -4
  106. package/lib/providers/exploreState/initializer/utils.js +41 -8
  107. package/lib/providers/exploreState/payloads/entities.d.ts +2 -1
  108. package/lib/providers/exploreState/utils.d.ts +6 -4
  109. package/lib/providers/exploreState/utils.js +7 -4
  110. package/lib/providers/exploreState.d.ts +3 -1
  111. package/lib/providers/exploreState.js +15 -5
  112. package/lib/views/ExploreView/exploreView.js +2 -2
  113. package/package.json +1 -1
  114. package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +2 -0
  115. package/src/components/Detail/components/Table/components/TableRows/tableRows.tsx +3 -18
  116. package/src/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.tsx +28 -32
  117. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +27 -13
  118. package/src/components/Table/common/columnDef.ts +1 -0
  119. package/src/components/Table/common/gridTable.styles.ts +5 -11
  120. package/src/components/Table/common/utils.ts +44 -107
  121. package/src/components/Table/components/TableBody/hooks/virtualizer/constants.ts +3 -0
  122. package/src/components/Table/components/TableBody/hooks/virtualizer/hook.ts +23 -0
  123. package/src/components/Table/components/TableBody/hooks/virtualizer/types.ts +5 -0
  124. package/src/components/Table/components/TableBody/tableBody.tsx +14 -30
  125. package/src/components/Table/components/TableBody/utils.ts +21 -0
  126. package/src/components/Table/components/TableCell/components/CollapsableCell/collapsableCell.tsx +14 -15
  127. package/src/components/Table/components/TableFeatures/ColumnGrouping/utils.ts +70 -0
  128. package/src/components/Table/components/TableFeatures/ColumnVisibility/utils.ts +52 -0
  129. package/src/components/Table/components/TableFeatures/RowSorting/utils.ts +87 -0
  130. package/src/components/Table/components/TableHead/tableHead.tsx +21 -29
  131. package/src/components/Table/components/TableHead/types.ts +7 -0
  132. package/src/components/Table/components/TableHead/utils.ts +42 -0
  133. package/src/components/Table/components/TableRow/tableRow.styles.ts +19 -2
  134. package/src/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +8 -2
  135. package/src/components/Table/components/TableRows/components/CollapsableRows/hook.ts +20 -0
  136. package/src/components/Table/components/TableRows/tableRows.tsx +18 -15
  137. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.styles.ts +17 -0
  138. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/columnGrouping.tsx +54 -0
  139. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/menuItems.tsx +28 -0
  140. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/components/MenuItems/types.ts +8 -0
  141. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/constants.ts +17 -0
  142. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/types.ts +5 -0
  143. package/src/components/Table/components/TableToolbar/components/ColumnGrouping/utils.ts +45 -0
  144. package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.tsx +7 -20
  145. package/src/components/Table/components/TableToolbar/tableToolbar.tsx +8 -2
  146. package/src/components/Table/features/RowPosition/constants.ts +2 -2
  147. package/src/components/Table/features/RowPosition/utils.ts +10 -5
  148. package/src/components/Table/options/updater.ts +29 -0
  149. package/src/components/Table/table.tsx +43 -25
  150. package/src/components/TableCreator/common/constants.ts +4 -6
  151. package/src/components/TableCreator/common/utils.ts +14 -7
  152. package/src/components/TableCreator/options/expanded/constants.ts +14 -0
  153. package/src/components/TableCreator/options/expanded/hook.ts +6 -0
  154. package/src/components/TableCreator/options/grouping/constants.ts +6 -0
  155. package/src/components/TableCreator/options/grouping/hook.ts +17 -0
  156. package/src/components/TableCreator/options/hook.ts +31 -0
  157. package/src/components/TableCreator/options/rowSelection/constants.ts +10 -0
  158. package/src/components/TableCreator/options/rowSelection/hook.ts +8 -0
  159. package/src/components/TableCreator/options/sorting/constants.ts +10 -0
  160. package/src/components/TableCreator/options/sorting/hook.ts +6 -0
  161. package/src/components/TableCreator/tableCreator.tsx +4 -11
  162. package/src/components/common/DropdownMenu/dropdownMenu.styles.ts +1 -1
  163. package/src/components/common/DropdownMenu/dropdownMenu.tsx +19 -17
  164. package/src/components/common/Menu/hooks/useMenu.ts +8 -9
  165. package/src/config/entities.ts +10 -9
  166. package/src/config/utils.ts +0 -14
  167. package/src/providers/exploreState/actions/updateGrouping/action.ts +26 -0
  168. package/src/providers/exploreState/actions/updateGrouping/dispatch.ts +16 -0
  169. package/src/providers/exploreState/actions/updateGrouping/types.ts +11 -0
  170. package/src/providers/exploreState/actions/updateGrouping/utils.ts +33 -0
  171. package/src/providers/exploreState/entities.ts +3 -3
  172. package/src/providers/exploreState/initializer/utils.ts +58 -10
  173. package/src/providers/exploreState/payloads/entities.ts +2 -0
  174. package/src/providers/exploreState/utils.ts +10 -7
  175. package/src/providers/exploreState.tsx +29 -6
  176. package/src/views/ExploreView/exploreView.tsx +1 -3
  177. package/types/data-explorer-ui.d.ts +8 -1
  178. package/lib/components/TableCreator/common/entities.d.ts +0 -5
  179. package/src/components/TableCreator/common/entities.ts +0 -6
  180. /package/lib/components/{TableCreator/common/entities.js → Table/components/TableBody/hooks/virtualizer/types.js} +0 -0
@@ -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
  }
@@ -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.
@@ -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
  */
@@ -152,7 +152,7 @@ function renderComponent(componentsConfig, response) {
152
152
  function renderList(exploreState, entityConfig, entityListType) {
153
153
  const { listItems, loading, tabValue } = exploreState;
154
154
  const { getId: getRowId, list, listView } = entityConfig;
155
- const { columns: columnsConfig, defaultSort, tableOptions } = list;
155
+ const { columns: columnsConfig } = list;
156
156
  if (!exploreState || !tabValue) {
157
157
  return React.createElement(React.Fragment, null); //TODO: return the loading UI component
158
158
  }
@@ -161,7 +161,7 @@ function renderList(exploreState, entityConfig, entityListType) {
161
161
  // loads with the previous tabs data on the first render after switching tabs. (or similar)
162
162
  return React.createElement(React.Fragment, null);
163
163
  }
164
- return (React.createElement(TableCreator, { columns: columnsConfig, defaultSort: defaultSort, getRowId: getRowId, items: listItems ?? [], listView: listView, loading: loading, tableOptions: tableOptions }));
164
+ return (React.createElement(TableCreator, { columns: columnsConfig, getRowId: getRowId, items: listItems ?? [], listView: listView, loading: loading }));
165
165
  }
166
166
  /**
167
167
  * Renders Summaries component when all the following requirements are fulfilled:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "18.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
@@ -3,6 +3,7 @@ import React, { Fragment } from "react";
3
3
  import { isCollapsableRowDisabled } from "../../../../../../../Table/common/utils";
4
4
  import { CollapsableCell } from "../../../../../../../Table/components/TableCell/components/CollapsableCell/collapsableCell";
5
5
  import { TableRow } from "../../../../../../../Table/components/TableRow/tableRow.styles";
6
+ import { useCollapsableRows } from "../../../../../../../Table/components/TableRows/components/CollapsableRows/hook";
6
7
 
7
8
  export interface CollapsableRowsProps<T extends RowData> {
8
9
  tableInstance: Table<T>;
@@ -13,6 +14,7 @@ export const CollapsableRows = <T extends RowData>({
13
14
  }: CollapsableRowsProps<T>): JSX.Element => {
14
15
  const { getRowModel } = tableInstance;
15
16
  const { rows } = getRowModel();
17
+ useCollapsableRows(tableInstance);
16
18
  return (
17
19
  <Fragment>
18
20
  {rows.map((row) => {
@@ -1,5 +1,5 @@
1
1
  import { TableCell } from "@mui/material";
2
- import { flexRender, Row, RowData, Table } from "@tanstack/react-table";
2
+ import { flexRender, RowData, Table } from "@tanstack/react-table";
3
3
  import React, { Fragment } from "react";
4
4
  import {
5
5
  getTableCellAlign,
@@ -26,9 +26,9 @@ export const TableRows = <T extends RowData>({
26
26
  {rows.map((row) => {
27
27
  return (
28
28
  <TableRow
29
- id={getRowId(row)}
30
- isPreview={row.getIsPreview()}
31
29
  key={row.id}
30
+ isGrouped={row.getIsGrouped()}
31
+ isPreview={row.getIsPreview()}
32
32
  >
33
33
  {row.getVisibleCells().map((cell) => {
34
34
  if (cell.getIsAggregated()) return null; // Display of aggregated cells is currently not supported.
@@ -50,18 +50,3 @@ export const TableRows = <T extends RowData>({
50
50
  </Fragment>
51
51
  );
52
52
  };
53
-
54
- /**
55
- * Returns identifier for a row.
56
- * @param row - Row.
57
- * @returns row identifier.
58
- */
59
- function getRowId<T extends RowData>(row: Row<T>): string | undefined {
60
- const { depth, getIsGrouped, id } = row;
61
- if (getIsGrouped()) {
62
- return `grouped-row-${id}`;
63
- }
64
- if (depth > 0) {
65
- return `sub-row-${id}`;
66
- }
67
- }
@@ -8,7 +8,7 @@ import {
8
8
  TableHead,
9
9
  TableRow,
10
10
  } from "@mui/material";
11
- import React, { Fragment } from "react";
11
+ import React from "react";
12
12
  import { formatCountSize } from "../../../../../../utils/formatCountSize";
13
13
  import { formatFileSize } from "../../../../../../utils/formatFileSize";
14
14
  import { CheckedIcon } from "../../../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
@@ -81,37 +81,33 @@ export const ExportFileSummaryForm = ({
81
81
  </TableRow>
82
82
  </TableHead>
83
83
  <TableBody>
84
- <TableRow>
85
- {fileSummaryFacet.terms.map(
86
- ({ count, name, selected, size = 0 }) => (
87
- <Fragment key={name}>
88
- <TableCell>
89
- <FormControlLabel
90
- control={
91
- <Checkbox
92
- checked={selected}
93
- checkedIcon={<CheckedIcon />}
94
- icon={
95
- error ? <UncheckedErrorIcon /> : <UncheckedIcon />
96
- }
97
- onChange={(): void => {
98
- onClearError(error, ERROR.FILE_SUMMARY_ERROR);
99
- onFilter(fileSummaryFacet.name, name, selected);
100
- }}
101
- />
102
- }
103
- key={name}
104
- label={name}
105
- />
106
- </TableCell>
107
- <TableCell>{formatCountSize(count)}</TableCell>
108
- {hasFileSize && (
109
- <TableCell>{formatFileSize(size)}</TableCell>
110
- )}
111
- </Fragment>
112
- )
113
- )}
114
- </TableRow>
84
+ {fileSummaryFacet.terms.map(
85
+ ({ count, name, selected, size = 0 }) => (
86
+ <TableRow key={name}>
87
+ <TableCell>
88
+ <FormControlLabel
89
+ control={
90
+ <Checkbox
91
+ checked={selected}
92
+ checkedIcon={<CheckedIcon />}
93
+ icon={
94
+ error ? <UncheckedErrorIcon /> : <UncheckedIcon />
95
+ }
96
+ onChange={(): void => {
97
+ onClearError(error, ERROR.FILE_SUMMARY_ERROR);
98
+ onFilter(fileSummaryFacet.name, name, selected);
99
+ }}
100
+ />
101
+ }
102
+ key={name}
103
+ label={name}
104
+ />
105
+ </TableCell>
106
+ <TableCell>{formatCountSize(count)}</TableCell>
107
+ {hasFileSize && <TableCell>{formatFileSize(size)}</TableCell>}
108
+ </TableRow>
109
+ )
110
+ )}
115
111
  </TableBody>
116
112
  </GridTable>
117
113
  </GridPaper>