@databiosphere/findable-ui 5.0.0 → 6.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 (183) hide show
  1. package/README.md +5 -1
  2. package/lib/components/ComponentCreator/ComponentCreator.d.ts +4 -2
  3. package/lib/components/ComponentCreator/ComponentCreator.js +6 -8
  4. package/lib/components/Detail/components/DetailViewTable/detailViewTable.d.ts +3 -3
  5. package/lib/components/Detail/components/DetailViewTable/detailViewTable.js +1 -1
  6. package/lib/components/Detail/components/Table/common/utils.d.ts +2 -2
  7. package/lib/components/Detail/components/Table/components/TableBody/tableBody.d.ts +3 -3
  8. package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.d.ts +3 -3
  9. package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +2 -4
  10. package/lib/components/Detail/components/Table/components/TableRows/tableRows.d.ts +2 -2
  11. package/lib/components/Detail/components/Table/components/TableRows/tableRows.js +2 -1
  12. package/lib/components/Detail/components/Table/table.d.ts +3 -4
  13. package/lib/components/Detail/components/Table/table.js +2 -1
  14. package/lib/components/Filter/components/Filters/filters.d.ts +1 -1
  15. package/lib/components/Index/components/Cell/cell.d.ts +3 -0
  16. package/lib/components/Index/components/Cell/cell.js +3 -0
  17. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +3 -0
  18. package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +3 -0
  19. package/lib/components/Index/components/NTag/nTag.d.ts +3 -0
  20. package/lib/components/Index/components/NTag/nTag.js +3 -0
  21. package/lib/components/Index/components/NTagCell/nTagCell.d.ts +6 -1
  22. package/lib/components/Index/components/NTagCell/nTagCell.js +6 -2
  23. package/lib/components/Layout/components/Outline/common/constants.d.ts +1 -1
  24. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.d.ts +1 -1
  25. package/lib/components/Links/components/Link/link.d.ts +3 -1
  26. package/lib/components/Links/components/Link/link.js +4 -4
  27. package/lib/components/Table/common/gridTable.styles.js +8 -2
  28. package/lib/components/Table/common/utils.d.ts +19 -14
  29. package/lib/components/Table/common/utils.js +26 -11
  30. package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.d.ts +3 -3
  31. package/lib/components/Table/components/PaginationSummary/paginationSummary.js +9 -8
  32. package/lib/components/Table/components/TableBody/tableBody.d.ts +3 -3
  33. package/lib/components/Table/components/TableCell/common/utils.d.ts +3 -3
  34. package/lib/components/Table/components/TableCell/components/BasicCell/basicCell.d.ts +7 -0
  35. package/lib/components/Table/components/TableCell/components/BasicCell/basicCell.js +55 -0
  36. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.d.ts +6 -0
  37. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.js +93 -0
  38. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.styles.d.ts +5 -0
  39. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.styles.js +16 -0
  40. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag.d.ts +7 -0
  41. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag.js +24 -0
  42. package/lib/components/Table/components/TableCell/components/NTagCell/nTagCell.d.ts +9 -0
  43. package/lib/components/Table/components/TableCell/components/NTagCell/nTagCell.js +53 -0
  44. package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.d.ts +2 -2
  45. package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.d.ts +2 -2
  46. package/lib/components/Table/components/TableHead/tableHead.d.ts +3 -3
  47. package/lib/components/Table/components/TableRow/tableRow.styles.d.ts +16 -0
  48. package/lib/components/Table/components/TableRow/tableRow.styles.js +22 -0
  49. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.d.ts +3 -3
  50. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +3 -2
  51. package/lib/components/Table/components/TableRows/tableRows.d.ts +3 -3
  52. package/lib/components/Table/components/TableRows/tableRows.js +3 -1
  53. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/common/constants.d.ts +2 -0
  54. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/common/constants.js +12 -0
  55. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.d.ts +9 -0
  56. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.js +32 -0
  57. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.styles.d.ts +6 -0
  58. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.styles.js +35 -0
  59. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.d.ts +12 -0
  60. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.js +32 -0
  61. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.styles.d.ts +5 -0
  62. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.styles.js +50 -0
  63. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.d.ts +7 -0
  64. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.js +16 -0
  65. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.styles.d.ts +5 -0
  66. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.styles.js +17 -0
  67. package/lib/components/Table/components/TableToolbar/components/RowPreview/rowPreview.d.ts +8 -0
  68. package/lib/components/Table/components/TableToolbar/components/RowPreview/rowPreview.js +14 -0
  69. package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.d.ts +3 -3
  70. package/lib/components/Table/components/TableToolbar/tableToolbar.d.ts +3 -3
  71. package/lib/components/Table/components/TableToolbar/tableToolbar.js +9 -6
  72. package/lib/components/Table/features/RowPreview/constants.d.ts +2 -0
  73. package/lib/components/Table/features/RowPreview/constants.js +45 -0
  74. package/lib/components/Table/features/RowPreview/entities.d.ts +22 -0
  75. package/lib/components/Table/features/RowPreview/entities.js +2 -0
  76. package/lib/components/Table/features/RowPreview/utils.d.ts +33 -0
  77. package/lib/components/Table/features/RowPreview/utils.js +89 -0
  78. package/lib/components/Table/features/entities.d.ts +7 -0
  79. package/lib/components/Table/features/entities.js +2 -0
  80. package/lib/components/Table/table.d.ts +4 -12
  81. package/lib/components/Table/table.js +26 -38
  82. package/lib/components/TableCreator/common/entities.d.ts +1 -1
  83. package/lib/components/TableCreator/tableCreator.d.ts +2 -9
  84. package/lib/components/TableCreator/tableCreator.js +4 -4
  85. package/lib/components/common/Button/button.d.ts +1 -1
  86. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.d.ts +7 -0
  87. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.js +17 -0
  88. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.styles.d.ts +5 -0
  89. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.styles.js +17 -0
  90. package/lib/components/common/Drawer/components/drawer.styles.d.ts +5 -0
  91. package/lib/components/common/Drawer/components/drawer.styles.js +11 -0
  92. package/lib/components/common/Drawer/drawer.d.ts +7 -0
  93. package/lib/components/common/Drawer/drawer.js +24 -0
  94. package/lib/components/common/Grid/grid.d.ts +1 -1
  95. package/lib/components/common/Typography/common/entities.d.ts +2 -0
  96. package/lib/components/common/Typography/common/entities.js +2 -0
  97. package/lib/config/entities.d.ts +7 -25
  98. package/lib/providers/exploreState/entities.d.ts +3 -2
  99. package/lib/providers/exploreState/initializer/constants.js +1 -3
  100. package/lib/providers/exploreState/initializer/utils.js +1 -0
  101. package/lib/providers/exploreState/payloads/entities.d.ts +6 -11
  102. package/lib/providers/exploreState/utils.d.ts +12 -10
  103. package/lib/providers/exploreState/utils.js +20 -24
  104. package/lib/providers/exploreState.d.ts +12 -32
  105. package/lib/providers/exploreState.js +47 -36
  106. package/lib/styles/common/mixins/colors.d.ts +2 -1
  107. package/lib/styles/common/mixins/colors.js +3 -1
  108. package/lib/theme/common/components.js +11 -2
  109. package/lib/theme/common/palette.d.ts +3 -1
  110. package/lib/theme/common/palette.js +4 -1
  111. package/lib/views/ExploreView/exploreView.js +4 -6
  112. package/package.json +2 -2
  113. package/src/components/ComponentCreator/ComponentCreator.tsx +6 -1
  114. package/src/components/Detail/components/DetailViewTable/detailViewTable.tsx +4 -4
  115. package/src/components/Detail/components/Table/common/utils.ts +2 -2
  116. package/src/components/Detail/components/Table/components/TableBody/tableBody.tsx +3 -3
  117. package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +5 -7
  118. package/src/components/Detail/components/Table/components/TableRows/tableRows.tsx +10 -6
  119. package/src/components/Detail/components/Table/table.tsx +6 -3
  120. package/src/components/Filter/components/Filters/filters.tsx +1 -1
  121. package/src/components/Index/components/Cell/cell.tsx +4 -0
  122. package/src/components/Index/components/NTag/components/Tooltip/tooltip.tsx +4 -0
  123. package/src/components/Index/components/NTag/nTag.tsx +4 -0
  124. package/src/components/Index/components/NTagCell/nTagCell.tsx +22 -3
  125. package/src/components/Layout/components/Outline/common/constants.ts +1 -1
  126. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +1 -1
  127. package/src/components/Links/components/Link/link.tsx +15 -2
  128. package/src/components/Table/common/gridTable.styles.ts +8 -2
  129. package/src/components/Table/common/utils.ts +55 -24
  130. package/src/components/Table/components/DownloadEntityResults/downloadEntityResults.tsx +3 -3
  131. package/src/components/Table/components/PaginationSummary/paginationSummary.tsx +11 -9
  132. package/src/components/Table/components/TableBody/tableBody.tsx +3 -3
  133. package/src/components/Table/components/TableCell/common/utils.ts +3 -3
  134. package/src/components/Table/components/TableCell/components/BasicCell/basicCell.tsx +52 -0
  135. package/src/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.styles.ts +11 -0
  136. package/src/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.tsx +86 -0
  137. package/src/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag.tsx +21 -0
  138. package/src/components/Table/components/TableCell/components/NTagCell/nTagCell.tsx +70 -0
  139. package/src/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.tsx +2 -3
  140. package/src/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.tsx +2 -3
  141. package/src/components/Table/components/TableHead/tableHead.tsx +3 -3
  142. package/src/components/Table/components/TableRow/tableRow.styles.ts +22 -0
  143. package/src/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +8 -6
  144. package/src/components/Table/components/TableRows/tableRows.tsx +9 -6
  145. package/src/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/common/constants.ts +11 -0
  146. package/src/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.styles.ts +31 -0
  147. package/src/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.tsx +52 -0
  148. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.styles.ts +48 -0
  149. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.tsx +53 -0
  150. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.styles.ts +12 -0
  151. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.tsx +25 -0
  152. package/src/components/Table/components/TableToolbar/components/RowPreview/rowPreview.tsx +19 -0
  153. package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.tsx +3 -3
  154. package/src/components/Table/components/TableToolbar/tableToolbar.tsx +9 -4
  155. package/src/components/Table/features/RowPreview/constants.ts +65 -0
  156. package/src/components/Table/features/RowPreview/entities.ts +25 -0
  157. package/src/components/Table/features/RowPreview/utils.ts +93 -0
  158. package/src/components/Table/features/entities.ts +13 -0
  159. package/src/components/Table/table.tsx +40 -50
  160. package/src/components/TableCreator/common/entities.ts +1 -1
  161. package/src/components/TableCreator/tableCreator.tsx +15 -22
  162. package/src/components/common/Button/button.tsx +1 -2
  163. package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.styles.ts +12 -0
  164. package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.tsx +27 -0
  165. package/src/components/common/Drawer/components/drawer.styles.ts +6 -0
  166. package/src/components/common/Drawer/drawer.tsx +21 -0
  167. package/src/components/common/Grid/grid.tsx +1 -3
  168. package/src/components/common/Section/components/CollapsableSection/collapsableSection.tsx +1 -2
  169. package/src/components/common/Typography/common/entities.ts +5 -0
  170. package/src/config/entities.ts +7 -37
  171. package/src/providers/exploreState/entities.ts +7 -2
  172. package/src/providers/exploreState/initializer/constants.ts +1 -3
  173. package/src/providers/exploreState/initializer/utils.ts +2 -1
  174. package/src/providers/exploreState/payloads/entities.ts +7 -18
  175. package/src/providers/exploreState/utils.ts +25 -36
  176. package/src/providers/exploreState.tsx +93 -73
  177. package/src/styles/common/mixins/colors.ts +4 -1
  178. package/src/theme/common/components.ts +12 -0
  179. package/src/theme/common/palette.ts +4 -5
  180. package/src/theme/theme.ts +1 -2
  181. package/src/views/ExploreView/exploreView.tsx +3 -25
  182. package/types/data-explorer-ui.d.ts +21 -2
  183. package/src/hooks/useEntityListRelatedView.ts +0 -78
package/README.md CHANGED
@@ -28,4 +28,8 @@
28
28
  - Run `npm link ../../findable-ui`, which will create a symlink in node_modules pointing
29
29
  to findable-ui.
30
30
  - If any packages are later installed or uninstalled, the symlink will need to be created again, which can be done
31
- with the same command or by running `npm link @databiosphere/findable-ui`.
31
+ with the same command or by running `npm link @databiosphere/findable-ui`.
32
+ - To successfully link to findable-ui, you may need to comment out the following packages from the `next.config.mjs` webpack configuration:
33
+ - `@tanstack/react-table`
34
+ - `axios`
35
+
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { ComponentsConfig } from "../../config/entities";
2
+ import { ComponentsConfig, ViewContext } from "../../config/entities";
3
3
  export interface ComponentCreatorProps<T> {
4
4
  components: ComponentsConfig;
5
5
  response: T;
6
+ viewContext?: Partial<ViewContext<T>>;
6
7
  }
7
8
  /**
8
9
  * ComponentCreator uses React API to create components based on the component configs, instead of using JSX.
@@ -11,6 +12,7 @@ export interface ComponentCreatorProps<T> {
11
12
  * @param componentCreatorProps - Custom props required for creating component.
12
13
  * @param componentCreatorProps.components - Component config to render as React elements.
13
14
  * @param componentCreatorProps.response - Response returned from API endpoint, used to populate component props.
15
+ * @param componentCreatorProps.viewContext - Additional context to pass to the component.
14
16
  * @returns A set of React components.
15
17
  */
16
- export declare const ComponentCreator: <T>({ components, response, }: ComponentCreatorProps<T>) => JSX.Element;
18
+ export declare const ComponentCreator: <T>({ components, response, viewContext, }: ComponentCreatorProps<T>) => JSX.Element;
@@ -17,9 +17,10 @@ const useSystemStatus_1 = require("../../hooks/useSystemStatus");
17
17
  * @param componentCreatorProps - Custom props required for creating component.
18
18
  * @param componentCreatorProps.components - Component config to render as React elements.
19
19
  * @param componentCreatorProps.response - Response returned from API endpoint, used to populate component props.
20
+ * @param componentCreatorProps.viewContext - Additional context to pass to the component.
20
21
  * @returns A set of React components.
21
22
  */
22
- const ComponentCreator = ({ components, response, }) => {
23
+ const ComponentCreator = ({ components, response, viewContext, }) => {
23
24
  const { authenticationStatus, isAuthenticated } = (0, useAuthentication_1.useAuthentication)();
24
25
  const { config, entityConfig } = (0, useConfig_1.useConfig)();
25
26
  const { exploreState } = (0, useExploreState_1.useExploreState)();
@@ -30,18 +31,15 @@ const ComponentCreator = ({ components, response, }) => {
30
31
  // Using uuid as the component's key causes the component to re-mount on re-render.
31
32
  // An interim solution is to use the array item's index as its key; however, this may lead to subtle bugs.
32
33
  // See issue https://github.com/clevercanary/data-explorer/issues/363.
33
- const children = c.children ? (react_1.default.createElement(exports.ComponentCreator, { key: k, components: c.children, response: response })) : null;
34
+ const children = c.children ? (react_1.default.createElement(exports.ComponentCreator, { key: k, components: c.children, response: response, viewContext: viewContext })) : null;
34
35
  const props = c.viewBuilder
35
- ? c.viewBuilder(response, {
36
- authState: {
36
+ ? c.viewBuilder(response, Object.assign(Object.assign({}, viewContext), { authState: {
37
37
  authenticationStatus,
38
38
  isAuthenticated,
39
- },
40
- entityConfig,
39
+ }, entityConfig,
41
40
  exploreState,
42
41
  fileManifestState,
43
- systemStatus,
44
- })
42
+ systemStatus }))
45
43
  : {};
46
44
  return react_1.default.createElement(c.component, Object.assign(Object.assign(Object.assign({}, c.props), props), { key: k }), [children !== null && children !== void 0 ? children : props.children]);
47
45
  })));
@@ -1,8 +1,8 @@
1
- import { ColumnDef } from "@tanstack/react-table";
1
+ import { ColumnDef, RowData } from "@tanstack/react-table";
2
2
  import { ReactNode } from "react";
3
3
  import { FlatPaper, FluidPaper, RoundedPaper } from "../../../common/Paper/paper.styles";
4
4
  import { TableProps } from "../Table/table";
5
- interface DetailViewTableProps<T extends object> extends TableProps<T> {
5
+ interface DetailViewTableProps<T extends RowData> extends TableProps<T> {
6
6
  className?: string;
7
7
  columns: ColumnDef<T>[];
8
8
  gridTemplateColumns: string;
@@ -11,5 +11,5 @@ interface DetailViewTableProps<T extends object> extends TableProps<T> {
11
11
  Paper?: typeof FlatPaper | typeof FluidPaper | typeof RoundedPaper;
12
12
  tools?: ReactNode;
13
13
  }
14
- export declare const DetailViewTable: <T extends object>({ className, columns, gridTemplateColumns, items, noResultsTitle, Paper, tools, ...tableProps }: DetailViewTableProps<T>) => JSX.Element;
14
+ export declare const DetailViewTable: <T extends unknown>({ className, columns, gridTemplateColumns, items, noResultsTitle, Paper, tools, ...tableProps }: DetailViewTableProps<T>) => JSX.Element;
15
15
  export {};
@@ -22,7 +22,7 @@ const tableToolbar_styles_1 = require("../../../Table/components/TableToolbar/ta
22
22
  const table_1 = require("../Table/table");
23
23
  const DetailViewTable = (_a) => {
24
24
  var { className, columns, gridTemplateColumns, items, noResultsTitle, Paper = paper_styles_1.RoundedPaper, tools } = _a, tableProps = __rest(_a, ["className", "columns", "gridTemplateColumns", "items", "noResultsTitle", "Paper", "tools"]);
25
- return items.length > 0 ? (react_1.default.createElement(Paper, { className: className },
25
+ return items.length > 0 ? (react_1.default.createElement(Paper, { className: className, variant: "table" },
26
26
  react_1.default.createElement(paper_styles_1.GridPaper, null,
27
27
  tools && react_1.default.createElement(tableToolbar_styles_1.Toolbar, { variant: "table" }, tools),
28
28
  react_1.default.createElement(table_1.Table, Object.assign({ columns: columns, gridTemplateColumns: gridTemplateColumns, items: items }, tableProps))))) : (react_1.default.createElement(noResults_1.NoResults, { Paper: Paper, title: noResultsTitle }));
@@ -1,7 +1,7 @@
1
- import { ColumnDef } from "@tanstack/react-table";
1
+ import { ColumnDef, RowData } from "@tanstack/react-table";
2
2
  /**
3
3
  * Generates columns from column definitions with meta associated with the column.
4
4
  * @param columns - Column configuration.
5
5
  * @returns generated column definitions.
6
6
  */
7
- export declare function generateColumnDefinitions<T>(columns: ColumnDef<T>[]): ColumnDef<T>[];
7
+ export declare function generateColumnDefinitions<T extends RowData>(columns: ColumnDef<T>[]): ColumnDef<T>[];
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { Table } from "@tanstack/react-table";
2
+ import { RowData, Table } from "@tanstack/react-table";
3
3
  import { ROW_DIRECTION } from "../../../../../Table/common/entities";
4
4
  import { TableView } from "../../table";
5
- export interface TableBodyProps<T> {
5
+ export interface TableBodyProps<T extends RowData> {
6
6
  rowDirection: ROW_DIRECTION;
7
7
  tableInstance: Table<T>;
8
8
  tableView?: TableView;
9
9
  }
10
- export declare const TableBody: <T extends object>({ rowDirection, tableInstance, tableView, }: TableBodyProps<T>) => JSX.Element;
10
+ export declare const TableBody: <T extends unknown>({ rowDirection, tableInstance, tableView, }: TableBodyProps<T>) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { Table } from "@tanstack/react-table";
3
- export interface CollapsableRowsProps<T> {
2
+ import { RowData, Table } from "@tanstack/react-table";
3
+ export interface CollapsableRowsProps<T extends RowData> {
4
4
  tableInstance: Table<T>;
5
5
  }
6
- export declare const CollapsableRows: <T extends object>({ tableInstance, }: CollapsableRowsProps<T>) => JSX.Element;
6
+ export declare const CollapsableRows: <T extends unknown>({ tableInstance, }: CollapsableRowsProps<T>) => JSX.Element;
@@ -24,19 +24,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.CollapsableRows = void 0;
27
- const material_1 = require("@mui/material");
28
27
  const react_1 = __importStar(require("react"));
29
- const uuid_1 = require("uuid");
30
28
  const utils_1 = require("../../../../../../../Table/common/utils");
31
29
  const collapsableCell_1 = require("../../../../../../../Table/components/TableCell/components/CollapsableCell/collapsableCell");
30
+ const tableRow_styles_1 = require("../../../../../../../Table/components/TableRow/tableRow.styles");
32
31
  const CollapsableRows = ({ tableInstance, }) => {
33
32
  const { getRowModel } = tableInstance;
34
33
  const { rows } = getRowModel();
35
- const uuid = (0, uuid_1.v4)(); // Generate a unique ID for the collapsable rows.
36
34
  return (react_1.default.createElement(react_1.Fragment, null, rows.map((row) => {
37
35
  if (row.depth > 0)
38
36
  return null; // Hide sub rows.
39
- return (react_1.default.createElement(material_1.TableRow, { key: `${uuid}${row.id}` },
37
+ return (react_1.default.createElement(tableRow_styles_1.TableRow, { key: row.id, isPreview: row.getIsPreview() },
40
38
  react_1.default.createElement(collapsableCell_1.CollapsableCell, { isDisabled: (0, utils_1.isCollapsableRowDisabled)(tableInstance), row: row })));
41
39
  })));
42
40
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { Table } from "@tanstack/react-table";
2
+ import { RowData, Table } from "@tanstack/react-table";
3
3
  import { TableView } from "../../table";
4
- export interface TableRowsProps<T> {
4
+ export interface TableRowsProps<T extends RowData> {
5
5
  tableInstance: Table<T>;
6
6
  tableView?: TableView;
7
7
  }
@@ -28,13 +28,14 @@ const material_1 = require("@mui/material");
28
28
  const react_table_1 = require("@tanstack/react-table");
29
29
  const react_1 = __importStar(require("react"));
30
30
  const utils_1 = require("../../../../../Table/components/TableCell/common/utils");
31
+ const tableRow_styles_1 = require("../../../../../Table/components/TableRow/tableRow.styles");
31
32
  const TableRows = ({ tableInstance, tableView, }) => {
32
33
  const { getRowModel } = tableInstance;
33
34
  const { rows } = getRowModel();
34
35
  const { tableCell } = tableView || {};
35
36
  const { size: tableCellSize = "medium" } = tableCell || {};
36
37
  return (react_1.default.createElement(react_1.Fragment, null, rows.map((row) => {
37
- return (react_1.default.createElement(material_1.TableRow, { id: getRowId(row), key: row.id }, row.getVisibleCells().map((cell) => {
38
+ return (react_1.default.createElement(tableRow_styles_1.TableRow, { id: getRowId(row), isPreview: row.getIsPreview(), key: row.id }, row.getVisibleCells().map((cell) => {
38
39
  if (cell.getIsAggregated())
39
40
  return null; // Display of aggregated cells is currently not supported.
40
41
  if (cell.getIsPlaceholder())
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { TableCellProps as MTableCellProps, TableContainerProps as MTableContainerProps, TableProps as MTableProps } from "@mui/material";
3
- import { ColumnDef } from "@tanstack/react-table";
4
- import { TableOptions } from "@tanstack/table-core";
3
+ import { ColumnDef, RowData, TableOptions } from "@tanstack/react-table";
5
4
  export interface TableView {
6
5
  table?: Partial<MTableProps>;
7
6
  tableCell?: Partial<MTableCellProps>;
8
7
  tableContainer?: Partial<MTableContainerProps>;
9
8
  }
10
- export interface TableProps<T extends object> {
9
+ export interface TableProps<T extends RowData> {
11
10
  className?: string;
12
11
  collapsable?: boolean;
13
12
  columns: ColumnDef<T>[];
@@ -16,4 +15,4 @@ export interface TableProps<T extends object> {
16
15
  tableOptions?: Partial<TableOptions<T>>;
17
16
  tableView?: TableView;
18
17
  }
19
- export declare const Table: <T extends object>({ className, collapsable, columns, gridTemplateColumns, items, tableOptions, tableView, }: TableProps<T>) => JSX.Element;
18
+ export declare const Table: <T extends unknown>({ className, collapsable, columns, gridTemplateColumns, items, tableOptions, tableView, }: TableProps<T>) => JSX.Element;
@@ -11,6 +11,7 @@ const useBreakpointHelper_1 = require("../../../../hooks/useBreakpointHelper");
11
11
  const breakpoints_1 = require("../../../../theme/common/breakpoints");
12
12
  const entities_1 = require("../../../Table/common/entities");
13
13
  const tableHead_1 = require("../../../Table/components/TableHead/tableHead");
14
+ const constants_1 = require("../../../Table/features/RowPreview/constants");
14
15
  const table_styles_1 = require("../../../Table/table.styles");
15
16
  const utils_1 = require("./common/utils");
16
17
  const tableBody_1 = require("./components/TableBody/tableBody");
@@ -20,7 +21,7 @@ const Table = ({ className, collapsable = true, columns, gridTemplateColumns, it
20
21
  const { table, tableContainer } = tableView || {};
21
22
  const { stickyHeader = false } = table || {};
22
23
  const { sx: tableContainerSx } = tableContainer || {};
23
- const tableInstance = (0, react_table_1.useReactTable)(Object.assign({ columns: (0, utils_1.generateColumnDefinitions)(columns), data: items, enableSorting: false, getCoreRowModel: (0, react_table_1.getCoreRowModel)() }, tableOptions));
24
+ const tableInstance = (0, react_table_1.useReactTable)(Object.assign({ _features: [constants_1.ROW_PREVIEW], columns: (0, utils_1.generateColumnDefinitions)(columns), data: items, enableSorting: false, getCoreRowModel: (0, react_table_1.getCoreRowModel)() }, tableOptions));
24
25
  return (react_1.default.createElement(material_1.TableContainer, { className: className, sx: tableContainerSx },
25
26
  react_1.default.createElement(table_styles_1.GridTable, { collapsable: collapsable, gridTemplateColumns: gridTemplateColumns, stickyHeader: rowDirection === entities_1.ROW_DIRECTION.DEFAULT && stickyHeader },
26
27
  react_1.default.createElement(tableHead_1.TableHead, { rowDirection: rowDirection, tableInstance: tableInstance }),
@@ -9,7 +9,7 @@ export interface CategoryFilter {
9
9
  export interface FiltersProps {
10
10
  categoryFilters: CategoryFilter[];
11
11
  closeAncestor?: () => void;
12
- disabled: boolean;
12
+ disabled?: boolean;
13
13
  onFilter: OnFilterFn;
14
14
  trackFilterOpened?: TrackFilterOpenedFunction;
15
15
  }
@@ -2,4 +2,7 @@
2
2
  export interface CellProps {
3
3
  value?: number | string | string[];
4
4
  }
5
+ /**
6
+ * @deprecated - use BasicCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"
7
+ */
5
8
  export declare const Cell: ({ value }: CellProps) => JSX.Element;
@@ -5,6 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Cell = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
+ /**
9
+ * @deprecated - use BasicCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"
10
+ */
8
11
  const Cell = ({ value = "Unspecified" }) => {
9
12
  if (typeof value === "string" || typeof value === "number") {
10
13
  return react_1.default.createElement("div", null, value);
@@ -3,4 +3,7 @@ import { TooltipProps as MTooltipProps } from "@mui/material";
3
3
  export interface TooltipProps extends MTooltipProps {
4
4
  className?: string;
5
5
  }
6
+ /**
7
+ * @deprecated - use Tooltip from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip"
8
+ */
6
9
  export declare const Tooltip: ({ children, className, title, ...props }: TooltipProps) => JSX.Element;
@@ -53,6 +53,9 @@ const DEFAULT_PREVENT_OVERFLOW_MODIFIER = {
53
53
  padding: 16,
54
54
  },
55
55
  };
56
+ /**
57
+ * @deprecated - use Tooltip from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip"
58
+ */
56
59
  const Tooltip = (_a) => {
57
60
  var { children, className, title } = _a, props = __rest(_a, ["children", "className", "title"]) /* Spread props to allow for Mui Tooltip specific prop overrides. */;
58
61
  const [maxHeight, setMaxHeight] = (0, react_1.useState)();
@@ -4,4 +4,7 @@ export interface NTagProps {
4
4
  Tag: ReactElement;
5
5
  TooltipTitle: ReactElement;
6
6
  }
7
+ /**
8
+ * @deprecated - use NTag from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag"
9
+ */
7
10
  export declare const NTag: ({ className, Tag, TooltipTitle, ...props }: NTagProps) => JSX.Element;
@@ -17,6 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.NTag = void 0;
18
18
  const react_1 = __importDefault(require("react"));
19
19
  const tooltip_1 = require("./components/Tooltip/tooltip");
20
+ /**
21
+ * @deprecated - use NTag from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag"
22
+ */
20
23
  const NTag = (_a) => {
21
24
  var { className, Tag, TooltipTitle } = _a, props = __rest(_a, ["className", "Tag", "TooltipTitle"]) /* Spread props to allow for Mui Tooltip specific prop overrides. */;
22
25
  return (react_1.default.createElement(tooltip_1.Tooltip, Object.assign({ className: className, title: TooltipTitle }, props), Tag));
@@ -1,7 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import { TypographyProps } from "../../../common/Typography/common/entities";
2
3
  export declare type MetadataValue = string;
3
4
  export interface NTagCellProps {
4
5
  label: string;
6
+ TypographyProps?: TypographyProps;
5
7
  values: MetadataValue[];
6
8
  }
7
- export declare const NTagCell: ({ label, values }: NTagCellProps) => JSX.Element;
9
+ /**
10
+ * @deprecated - use NTagCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/nTagCell"
11
+ */
12
+ export declare const NTagCell: ({ label, TypographyProps, values, }: NTagCellProps) => JSX.Element;
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.NTagCell = void 0;
27
27
  const material_1 = require("@mui/material");
28
28
  const react_1 = __importStar(require("react"));
29
+ const typography_1 = require("../../../../theme/common/typography");
29
30
  const nTag_1 = require("../NTag/nTag");
30
31
  // Template constants
31
32
  const MAX_DISPLAYABLE_VALUES = 1;
@@ -44,9 +45,12 @@ function stringifyMetadataValues(metadataValues) {
44
45
  const Tag = (0, react_1.forwardRef)(function Tag(props, ref) {
45
46
  return react_1.default.createElement(material_1.Chip, Object.assign({ ref: ref }, props));
46
47
  });
47
- const NTagCell = ({ label, values }) => {
48
+ /**
49
+ * @deprecated - use NTagCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/nTagCell"
50
+ */
51
+ const NTagCell = ({ label, TypographyProps, values, }) => {
48
52
  const metadataCount = values.length;
49
53
  const showNTag = metadataCount > MAX_DISPLAYABLE_VALUES;
50
- return (react_1.default.createElement(react_1.default.Fragment, null, showNTag ? (react_1.default.createElement(nTag_1.NTag, { Tag: react_1.default.createElement(Tag, { label: `${metadataCount} ${label}`, variant: "ntag" }), TooltipTitle: react_1.default.createElement(material_1.Typography, { display: "block", variant: "text-body-small-400" }, stringifyMetadataValues(values)) })) : (values.map((value, v) => react_1.default.createElement("div", { key: `${value}${v}` }, value)))));
54
+ return (react_1.default.createElement(react_1.default.Fragment, null, showNTag ? (react_1.default.createElement(nTag_1.NTag, { Tag: react_1.default.createElement(Tag, { label: `${metadataCount} ${label}`, variant: "ntag" }), TooltipTitle: react_1.default.createElement(material_1.Typography, { display: "block", variant: typography_1.TEXT_BODY_SMALL_400 }, stringifyMetadataValues(values)) })) : (values.map((value, v) => (react_1.default.createElement(material_1.Typography, Object.assign({ key: `${value}${v}`, variant: "inherit" }, TypographyProps), value))))));
51
55
  };
52
56
  exports.NTagCell = NTagCell;
@@ -1,2 +1,2 @@
1
- import { TabProps as MTabProps } from "@mui/material/Tab/Tab";
1
+ import { TabProps as MTabProps } from "@mui/material";
2
2
  export declare const DEFAULT_TAB_VALUE: MTabProps["value"];
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { UrlObjectWithHrefAndQuery } from "../../../../common/entities";
3
3
  import { LinkProps } from "../../link";
4
- export interface ExploreViewLinkProps extends Omit<LinkProps, "copyable" | "noWrap" | "url"> {
4
+ export interface ExploreViewLinkProps extends Omit<LinkProps, "copyable" | "noWrap" | "TypographyProps" | "url"> {
5
5
  url: UrlObjectWithHrefAndQuery;
6
6
  }
7
7
  export declare const ExploreViewLink: ({ className, label, onClick, target, url, }: ExploreViewLinkProps) => JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { LinkProps as MLinkProps } from "@mui/material";
2
2
  import { ReactNode } from "react";
3
+ import { TypographyProps } from "../../../common/Typography/common/entities";
3
4
  import { ANCHOR_TARGET, Url } from "../../common/entities";
4
5
  export interface LinkProps {
5
6
  className?: string;
@@ -8,6 +9,7 @@ export interface LinkProps {
8
9
  noWrap?: MLinkProps["noWrap"];
9
10
  onClick?: () => void;
10
11
  target?: ANCHOR_TARGET;
12
+ TypographyProps?: TypographyProps;
11
13
  url: Url;
12
14
  }
13
- export declare const Link: ({ className, copyable, label, noWrap, onClick, target, url, }: LinkProps) => JSX.Element;
15
+ export declare const Link: ({ className, copyable, label, noWrap, onClick, target, TypographyProps, url, }: LinkProps) => JSX.Element;
@@ -12,7 +12,7 @@ const copyToClipboard_1 = require("../../../common/CopyToClipboard/copyToClipboa
12
12
  const entities_1 = require("../../common/entities");
13
13
  const utils_2 = require("../../common/utils");
14
14
  const exploreViewLink_1 = require("./components/ExploreViewLink/exploreViewLink");
15
- const Link = ({ className, copyable = false, label, noWrap = false, onClick, target, url, }) => {
15
+ const Link = ({ className, copyable = false, label, noWrap = false, onClick, target, TypographyProps, url, }) => {
16
16
  if ((0, utils_2.isURLObjectWithHrefAndQuery)(url)) {
17
17
  /* Internal navigation - explore link */
18
18
  return (react_1.default.createElement(exploreViewLink_1.ExploreViewLink, { className: className, label: label, onClick: onClick, target: target, url: url }));
@@ -22,17 +22,17 @@ const Link = ({ className, copyable = false, label, noWrap = false, onClick, tar
22
22
  /* Client-side navigation */
23
23
  return (react_1.default.createElement(react_1.default.Fragment, null,
24
24
  react_1.default.createElement(link_1.default, { href: url, legacyBehavior: true, passHref: true },
25
- react_1.default.createElement(material_1.Link, { className: className, rel: "noopener", noWrap: noWrap, target: target || entities_1.ANCHOR_TARGET.SELF, onClick: onClick }, label)),
25
+ react_1.default.createElement(material_1.Link, Object.assign({ className: className, rel: "noopener", noWrap: noWrap, target: target || entities_1.ANCHOR_TARGET.SELF, onClick: onClick }, TypographyProps), label)),
26
26
  copyable && react_1.default.createElement(copyToClipboard_1.CopyToClipboard, { copyStr: url })));
27
27
  }
28
28
  if ((0, utils_1.isValidUrl)(url)) {
29
29
  /* External navigation */
30
30
  return (react_1.default.createElement(react_1.default.Fragment, null,
31
- react_1.default.createElement(material_1.Link, { className: className, href: url, noWrap: noWrap, onClick: onClick, rel: "noopener noreferrer", target: target || entities_1.ANCHOR_TARGET.BLANK }, label),
31
+ react_1.default.createElement(material_1.Link, Object.assign({ className: className, href: url, noWrap: noWrap, onClick: onClick, rel: "noopener noreferrer", target: target || entities_1.ANCHOR_TARGET.BLANK }, TypographyProps), label),
32
32
  copyable && react_1.default.createElement(copyToClipboard_1.CopyToClipboard, { copyStr: url })));
33
33
  }
34
34
  }
35
35
  /* Invalid URL */
36
- return react_1.default.createElement(react_1.default.Fragment, null, label);
36
+ return (react_1.default.createElement(material_1.Typography, Object.assign({ component: "span", variant: "inherit" }, TypographyProps), label));
37
37
  };
38
38
  exports.Link = Link;
@@ -21,9 +21,13 @@ exports.GridTable = (0, styled_1.default)(material_1.Table, {
21
21
  display: contents; /* required; allows grandchildren of grid template to appear as though direct child */
22
22
  }
23
23
 
24
+ tr {
25
+ background-color: ${colors_1.white};
26
+ }
27
+
24
28
  td,
25
29
  th {
26
- background-color: ${colors_1.white};
30
+ background-color: inherit;
27
31
  }
28
32
 
29
33
  td,
@@ -39,8 +43,10 @@ exports.GridTable = (0, styled_1.default)(material_1.Table, {
39
43
  }
40
44
 
41
45
  [id^="grouped-row"] {
46
+ background-color: ${colors_1.smokeLightest};
47
+
42
48
  td {
43
- background-color: ${colors_1.smokeLightest};
49
+ background-color: inherit;
44
50
  grid-column: 1 / -1;
45
51
  }
46
52
  }
@@ -1,7 +1,5 @@
1
- import { TableSortLabelProps } from "@mui/material/TableSortLabel/TableSortLabel";
2
- import { Cell, ColumnFiltersState, ColumnSort, InitialTableState, Row, RowData, SortDirection, Table } from "@tanstack/react-table";
3
- import { Column } from "@tanstack/table-core";
4
- import { VisibilityState } from "@tanstack/table-core/src/features/Visibility";
1
+ import { TableSortLabelProps } from "@mui/material";
2
+ import { Cell, Column, ColumnFiltersState, ColumnSort, InitialTableState, PaginationState, Row, RowData, SortDirection, Table, VisibilityState } from "@tanstack/react-table";
5
3
  import { SelectCategory } from "../../../common/entities";
6
4
  import { ColumnConfig } from "../../../config/entities";
7
5
  import { ExploreMode } from "../../../hooks/useExploreMode";
@@ -13,7 +11,7 @@ declare type CountByTerms = Map<any, number>;
13
11
  /**
14
12
  * Pinned cell and pinned cell index tuple.
15
13
  */
16
- declare type PinnedCell<T> = [Cell<T, unknown>, number];
14
+ declare type PinnedCell<T extends RowData> = [Cell<T, unknown>, number];
17
15
  /**
18
16
  * Returns true if the row should be included in the filtered rows.
19
17
  * The row will be included if:
@@ -25,14 +23,14 @@ declare type PinnedCell<T> = [Cell<T, unknown>, number];
25
23
  * @param filterValue - Filter value or values.
26
24
  * @returns True if the row should be included in the filtered rows.
27
25
  */
28
- export declare function arrIncludesSome<T>(row: Row<T>, columnId: string, filterValue: unknown[]): boolean;
26
+ export declare function arrIncludesSome<T extends RowData>(row: Row<T>, columnId: string, filterValue: unknown[]): boolean;
29
27
  /**
30
28
  * Build view-specific models from react table faceted values function.
31
29
  * @param columns - Table columns.
32
30
  * @param columnFilters - Column filters state.
33
31
  * @returns Array of category views objects.
34
32
  */
35
- export declare function buildCategoryViews<T>(columns: Column<T>[], columnFilters: ColumnFiltersState): SelectCategory[];
33
+ export declare function buildCategoryViews<T extends RowData>(columns: Column<T>[], columnFilters: ColumnFiltersState): SelectCategory[];
36
34
  /**
37
35
  * Returns the column sort direction.
38
36
  * @param sortDirection - Column sort direction.
@@ -44,13 +42,13 @@ export declare function getColumnSortDirection(sortDirection: false | SortDirect
44
42
  * @param rows - Table rows.
45
43
  * @returns filtered entity results as a blob.
46
44
  */
47
- export declare function generateDownloadBlob<T>(rows: Row<T>[]): Blob | undefined;
45
+ export declare function generateDownloadBlob<T extends RowData>(rows: Row<T>[]): Blob | undefined;
48
46
  /**
49
47
  * Returns edit column checkbox menu options.
50
48
  * @param table - Table.
51
49
  * @returns a list of edit column options.
52
50
  */
53
- export declare function getEditColumnOptions<T>(table: Table<T>): CheckboxMenuListItem[];
51
+ export declare function getEditColumnOptions<T extends RowData>(table: Table<T>): CheckboxMenuListItem[];
54
52
  /**
55
53
  * Returns unique category term counts keyed by category terms.
56
54
  * Custom function based off react table function getFacetedUniqueValues, see
@@ -65,7 +63,7 @@ export declare function getFacetedUniqueValuesWithArrayValues<T extends RowData>
65
63
  * @param columns - Table columns.
66
64
  * @returns string value for the css property grid-template-columns.
67
65
  */
68
- export declare function getGridTemplateColumns<T>(columns: Column<T>[]): string;
66
+ export declare function getGridTemplateColumns<T extends RowData>(columns: Column<T>[]): string;
69
67
  /**
70
68
  * Returns initial table state.
71
69
  * @param columns - Column configuration.
@@ -84,19 +82,26 @@ export declare function getInitialTableStateSorting(defaultSort: ColumnSort | un
84
82
  * @param row - Row.
85
83
  * @returns pinned cell and index tuple.
86
84
  */
87
- export declare function getPinnedCellIndex<T>(row: Row<T>): PinnedCell<T>;
85
+ export declare function getPinnedCellIndex<T extends RowData>(row: Row<T>): PinnedCell<T>;
88
86
  /**
89
87
  * Returns table sort label props.
90
88
  * @param column - Table column.
91
89
  * @returns table sort label props.
92
90
  */
93
- export declare function getTableSortLabelProps<T>(column: Column<T>): TableSortLabelProps;
91
+ export declare function getTableSortLabelProps<T extends RowData>(column: Column<T>): TableSortLabelProps;
92
+ /**
93
+ * Returns table state pagination.
94
+ * @param pageIndex - Explore state page index.
95
+ * @param pageSize - Explore state page size.
96
+ * @returns table state pagination.
97
+ */
98
+ export declare function getTableStatePagination(pageIndex: number | undefined, pageSize: number): PaginationState;
94
99
  /**
95
100
  * Returns true if any or all table rows are selected.
96
101
  * @param table - Table.
97
102
  * @returns true if a row is selected.
98
103
  */
99
- export declare function isAnyRowSelected<T>(table: Table<T>): boolean;
104
+ export declare function isAnyRowSelected<T extends RowData>(table: Table<T>): boolean;
100
105
  /**
101
106
  * Returns true if client-side filtering is enabled.
102
107
  * @param exploreMode - Explore mode.
@@ -108,7 +113,7 @@ export declare function isClientFilteringEnabled(exploreMode: ExploreMode): bool
108
113
  * @param tableInstance - Table instance.
109
114
  * @returns true if the collapsable row is disabled.
110
115
  */
111
- export declare function isCollapsableRowDisabled<T>(tableInstance: Table<T>): boolean;
116
+ export declare function isCollapsableRowDisabled<T extends RowData>(tableInstance: Table<T>): boolean;
112
117
  /**
113
118
  * Returns true if column has a sort direction.
114
119
  * @param sortDirection - Column sort direction.
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getInitialTableColumnVisibility = exports.sortingFn = exports.isColumnSortActive = exports.isCollapsableRowDisabled = exports.isClientFilteringEnabled = exports.isAnyRowSelected = exports.getTableSortLabelProps = exports.getPinnedCellIndex = exports.getInitialTableStateSorting = exports.getInitialState = exports.getGridTemplateColumns = exports.getFacetedUniqueValuesWithArrayValues = exports.getEditColumnOptions = exports.generateDownloadBlob = exports.getColumnSortDirection = exports.buildCategoryViews = exports.arrIncludesSome = void 0;
6
+ exports.getInitialTableColumnVisibility = exports.sortingFn = exports.isColumnSortActive = exports.isCollapsableRowDisabled = exports.isClientFilteringEnabled = exports.isAnyRowSelected = exports.getTableStatePagination = exports.getTableSortLabelProps = exports.getPinnedCellIndex = exports.getInitialTableStateSorting = exports.getInitialState = exports.getGridTemplateColumns = exports.getFacetedUniqueValuesWithArrayValues = exports.getEditColumnOptions = exports.generateDownloadBlob = exports.getColumnSortDirection = exports.buildCategoryViews = exports.arrIncludesSome = void 0;
7
7
  const SouthRounded_1 = __importDefault(require("@mui/icons-material/SouthRounded"));
8
8
  const react_table_1 = require("@tanstack/react-table");
9
9
  const useExploreMode_1 = require("../../../hooks/useExploreMode");
@@ -140,19 +140,21 @@ exports.getEditColumnOptions = getEditColumnOptions;
140
140
  * @returns Unique category term counts keyed by category terms.
141
141
  */
142
142
  function getFacetedUniqueValuesWithArrayValues() {
143
- return (table, columnId) => (0, react_table_1.memo)(() => [table.getColumn(columnId).getFacetedRowModel()], (facetedRowModel) => {
143
+ return (table, columnId) => (0, react_table_1.memo)(() => { var _a; return [(_a = table.getColumn(columnId)) === null || _a === void 0 ? void 0 : _a.getFacetedRowModel()]; }, (facetedRowModel) => {
144
144
  var _a;
145
145
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This type matches react table getFacetedUniqueValues return type.
146
146
  const facetedUniqueValues = new Map();
147
- for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
148
- const value = (_a = facetedRowModel.flatRows[i]) === null || _a === void 0 ? void 0 : _a.getValue(columnId);
149
- if (Array.isArray(value)) {
150
- value.map((val) => {
151
- updateCountByTerms(facetedUniqueValues, val);
152
- });
153
- }
154
- else {
155
- updateCountByTerms(facetedUniqueValues, value);
147
+ if (facetedRowModel) {
148
+ for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
149
+ const value = (_a = facetedRowModel === null || facetedRowModel === void 0 ? void 0 : facetedRowModel.flatRows[i]) === null || _a === void 0 ? void 0 : _a.getValue(columnId);
150
+ if (Array.isArray(value)) {
151
+ value.map((val) => {
152
+ updateCountByTerms(facetedUniqueValues, val);
153
+ });
154
+ }
155
+ else {
156
+ updateCountByTerms(facetedUniqueValues, value);
157
+ }
156
158
  }
157
159
  }
158
160
  return facetedUniqueValues;
@@ -244,6 +246,19 @@ function getTableSortLabelProps(column) {
244
246
  };
245
247
  }
246
248
  exports.getTableSortLabelProps = getTableSortLabelProps;
249
+ /**
250
+ * Returns table state pagination.
251
+ * @param pageIndex - Explore state page index.
252
+ * @param pageSize - Explore state page size.
253
+ * @returns table state pagination.
254
+ */
255
+ function getTableStatePagination(pageIndex = 0, pageSize) {
256
+ return {
257
+ pageIndex,
258
+ pageSize,
259
+ };
260
+ }
261
+ exports.getTableStatePagination = getTableStatePagination;
247
262
  /**
248
263
  * Returns the list of visible table headers.
249
264
  * @param rows - Table rows.
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { Row } from "@tanstack/react-table";
3
- export interface DownloadEntityResultsProps<T> {
2
+ import { Row, RowData } from "@tanstack/react-table";
3
+ export interface DownloadEntityResultsProps<T extends RowData> {
4
4
  entityName: string;
5
5
  rows: Row<T>[];
6
6
  }
7
- export declare const DownloadEntityResults: <T extends object>({ entityName, rows, }: DownloadEntityResultsProps<T>) => JSX.Element;
7
+ export declare const DownloadEntityResults: <T extends unknown>({ entityName, rows, }: DownloadEntityResultsProps<T>) => JSX.Element;