@databiosphere/findable-ui 4.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 (184) 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/components/ExploreViewLink/exploreViewLink.js +13 -1
  26. package/lib/components/Links/components/Link/link.d.ts +3 -1
  27. package/lib/components/Links/components/Link/link.js +4 -4
  28. package/lib/components/Table/common/gridTable.styles.js +8 -2
  29. package/lib/components/Table/common/utils.d.ts +19 -14
  30. package/lib/components/Table/common/utils.js +26 -11
  31. package/lib/components/Table/components/DownloadEntityResults/downloadEntityResults.d.ts +3 -3
  32. package/lib/components/Table/components/PaginationSummary/paginationSummary.js +9 -8
  33. package/lib/components/Table/components/TableBody/tableBody.d.ts +3 -3
  34. package/lib/components/Table/components/TableCell/common/utils.d.ts +3 -3
  35. package/lib/components/Table/components/TableCell/components/BasicCell/basicCell.d.ts +7 -0
  36. package/lib/components/Table/components/TableCell/components/BasicCell/basicCell.js +55 -0
  37. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.d.ts +6 -0
  38. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.js +93 -0
  39. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.styles.d.ts +5 -0
  40. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.styles.js +16 -0
  41. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag.d.ts +7 -0
  42. package/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag.js +24 -0
  43. package/lib/components/Table/components/TableCell/components/NTagCell/nTagCell.d.ts +9 -0
  44. package/lib/components/Table/components/TableCell/components/NTagCell/nTagCell.js +53 -0
  45. package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.d.ts +2 -2
  46. package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.d.ts +2 -2
  47. package/lib/components/Table/components/TableHead/tableHead.d.ts +3 -3
  48. package/lib/components/Table/components/TableRow/tableRow.styles.d.ts +16 -0
  49. package/lib/components/Table/components/TableRow/tableRow.styles.js +22 -0
  50. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.d.ts +3 -3
  51. package/lib/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +3 -2
  52. package/lib/components/Table/components/TableRows/tableRows.d.ts +3 -3
  53. package/lib/components/Table/components/TableRows/tableRows.js +3 -1
  54. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/common/constants.d.ts +2 -0
  55. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/common/constants.js +12 -0
  56. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.d.ts +9 -0
  57. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.js +32 -0
  58. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.styles.d.ts +6 -0
  59. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.styles.js +35 -0
  60. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.d.ts +12 -0
  61. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.js +32 -0
  62. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.styles.d.ts +5 -0
  63. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.styles.js +50 -0
  64. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.d.ts +7 -0
  65. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.js +16 -0
  66. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.styles.d.ts +5 -0
  67. package/lib/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.styles.js +17 -0
  68. package/lib/components/Table/components/TableToolbar/components/RowPreview/rowPreview.d.ts +8 -0
  69. package/lib/components/Table/components/TableToolbar/components/RowPreview/rowPreview.js +14 -0
  70. package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.d.ts +3 -3
  71. package/lib/components/Table/components/TableToolbar/tableToolbar.d.ts +3 -3
  72. package/lib/components/Table/components/TableToolbar/tableToolbar.js +9 -6
  73. package/lib/components/Table/features/RowPreview/constants.d.ts +2 -0
  74. package/lib/components/Table/features/RowPreview/constants.js +45 -0
  75. package/lib/components/Table/features/RowPreview/entities.d.ts +22 -0
  76. package/lib/components/Table/features/RowPreview/entities.js +2 -0
  77. package/lib/components/Table/features/RowPreview/utils.d.ts +33 -0
  78. package/lib/components/Table/features/RowPreview/utils.js +89 -0
  79. package/lib/components/Table/features/entities.d.ts +7 -0
  80. package/lib/components/Table/features/entities.js +2 -0
  81. package/lib/components/Table/table.d.ts +4 -12
  82. package/lib/components/Table/table.js +27 -39
  83. package/lib/components/TableCreator/common/entities.d.ts +1 -1
  84. package/lib/components/TableCreator/tableCreator.d.ts +2 -9
  85. package/lib/components/TableCreator/tableCreator.js +4 -4
  86. package/lib/components/common/Button/button.d.ts +1 -1
  87. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.d.ts +7 -0
  88. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.js +17 -0
  89. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.styles.d.ts +5 -0
  90. package/lib/components/common/Drawer/components/DrawerTitle/drawerTitle.styles.js +17 -0
  91. package/lib/components/common/Drawer/components/drawer.styles.d.ts +5 -0
  92. package/lib/components/common/Drawer/components/drawer.styles.js +11 -0
  93. package/lib/components/common/Drawer/drawer.d.ts +7 -0
  94. package/lib/components/common/Drawer/drawer.js +24 -0
  95. package/lib/components/common/Grid/grid.d.ts +1 -1
  96. package/lib/components/common/Typography/common/entities.d.ts +2 -0
  97. package/lib/components/common/Typography/common/entities.js +2 -0
  98. package/lib/config/entities.d.ts +8 -26
  99. package/lib/providers/exploreState/entities.d.ts +3 -2
  100. package/lib/providers/exploreState/initializer/constants.js +1 -3
  101. package/lib/providers/exploreState/initializer/utils.js +2 -2
  102. package/lib/providers/exploreState/payloads/entities.d.ts +7 -11
  103. package/lib/providers/exploreState/utils.d.ts +12 -10
  104. package/lib/providers/exploreState/utils.js +20 -24
  105. package/lib/providers/exploreState.d.ts +12 -32
  106. package/lib/providers/exploreState.js +48 -36
  107. package/lib/styles/common/mixins/colors.d.ts +2 -1
  108. package/lib/styles/common/mixins/colors.js +3 -1
  109. package/lib/theme/common/components.js +11 -2
  110. package/lib/theme/common/palette.d.ts +3 -1
  111. package/lib/theme/common/palette.js +4 -1
  112. package/lib/views/ExploreView/exploreView.js +4 -6
  113. package/package.json +2 -2
  114. package/src/components/ComponentCreator/ComponentCreator.tsx +6 -1
  115. package/src/components/Detail/components/DetailViewTable/detailViewTable.tsx +4 -4
  116. package/src/components/Detail/components/Table/common/utils.ts +2 -2
  117. package/src/components/Detail/components/Table/components/TableBody/tableBody.tsx +3 -3
  118. package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +5 -7
  119. package/src/components/Detail/components/Table/components/TableRows/tableRows.tsx +10 -6
  120. package/src/components/Detail/components/Table/table.tsx +6 -3
  121. package/src/components/Filter/components/Filters/filters.tsx +1 -1
  122. package/src/components/Index/components/Cell/cell.tsx +4 -0
  123. package/src/components/Index/components/NTag/components/Tooltip/tooltip.tsx +4 -0
  124. package/src/components/Index/components/NTag/nTag.tsx +4 -0
  125. package/src/components/Index/components/NTagCell/nTagCell.tsx +22 -3
  126. package/src/components/Layout/components/Outline/common/constants.ts +1 -1
  127. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +18 -2
  128. package/src/components/Links/components/Link/link.tsx +15 -2
  129. package/src/components/Table/common/gridTable.styles.ts +8 -2
  130. package/src/components/Table/common/utils.ts +55 -24
  131. package/src/components/Table/components/DownloadEntityResults/downloadEntityResults.tsx +3 -3
  132. package/src/components/Table/components/PaginationSummary/paginationSummary.tsx +11 -9
  133. package/src/components/Table/components/TableBody/tableBody.tsx +3 -3
  134. package/src/components/Table/components/TableCell/common/utils.ts +3 -3
  135. package/src/components/Table/components/TableCell/components/BasicCell/basicCell.tsx +52 -0
  136. package/src/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.styles.ts +11 -0
  137. package/src/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip.tsx +86 -0
  138. package/src/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag.tsx +21 -0
  139. package/src/components/Table/components/TableCell/components/NTagCell/nTagCell.tsx +70 -0
  140. package/src/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.tsx +2 -3
  141. package/src/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.tsx +2 -3
  142. package/src/components/Table/components/TableHead/tableHead.tsx +3 -3
  143. package/src/components/Table/components/TableRow/tableRow.styles.ts +22 -0
  144. package/src/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +8 -6
  145. package/src/components/Table/components/TableRows/tableRows.tsx +9 -6
  146. package/src/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/common/constants.ts +11 -0
  147. package/src/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.styles.ts +31 -0
  148. package/src/components/Table/components/TableToolbar/components/RowPreview/components/RowDrawer/rowDrawer.tsx +52 -0
  149. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.styles.ts +48 -0
  150. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/components/RowDetail/rowDetail.tsx +53 -0
  151. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.styles.ts +12 -0
  152. package/src/components/Table/components/TableToolbar/components/RowPreview/components/Section/section.tsx +25 -0
  153. package/src/components/Table/components/TableToolbar/components/RowPreview/rowPreview.tsx +19 -0
  154. package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.tsx +3 -3
  155. package/src/components/Table/components/TableToolbar/tableToolbar.tsx +9 -4
  156. package/src/components/Table/features/RowPreview/constants.ts +65 -0
  157. package/src/components/Table/features/RowPreview/entities.ts +25 -0
  158. package/src/components/Table/features/RowPreview/utils.ts +93 -0
  159. package/src/components/Table/features/entities.ts +13 -0
  160. package/src/components/Table/table.tsx +41 -51
  161. package/src/components/TableCreator/common/entities.ts +1 -1
  162. package/src/components/TableCreator/tableCreator.tsx +15 -22
  163. package/src/components/common/Button/button.tsx +1 -2
  164. package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.styles.ts +12 -0
  165. package/src/components/common/Drawer/components/DrawerTitle/drawerTitle.tsx +27 -0
  166. package/src/components/common/Drawer/components/drawer.styles.ts +6 -0
  167. package/src/components/common/Drawer/drawer.tsx +21 -0
  168. package/src/components/common/Grid/grid.tsx +1 -3
  169. package/src/components/common/Section/components/CollapsableSection/collapsableSection.tsx +1 -2
  170. package/src/components/common/Typography/common/entities.ts +5 -0
  171. package/src/config/entities.ts +8 -38
  172. package/src/providers/exploreState/entities.ts +7 -2
  173. package/src/providers/exploreState/initializer/constants.ts +1 -3
  174. package/src/providers/exploreState/initializer/utils.ts +3 -3
  175. package/src/providers/exploreState/payloads/entities.ts +8 -18
  176. package/src/providers/exploreState/utils.ts +25 -36
  177. package/src/providers/exploreState.tsx +95 -69
  178. package/src/styles/common/mixins/colors.ts +4 -1
  179. package/src/theme/common/components.ts +12 -0
  180. package/src/theme/common/palette.ts +4 -5
  181. package/src/theme/theme.ts +1 -2
  182. package/src/views/ExploreView/exploreView.tsx +3 -25
  183. package/types/data-explorer-ui.d.ts +21 -2
  184. package/src/hooks/useEntityListRelatedView.ts +0 -78
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateSelectColumnVisibility = exports.updateEntityStateByCategoryGroupConfigKey = exports.updateEntityPageStateSorting = exports.updateEntityPageState = exports.resetRowSelection = exports.resetPage = exports.patchEntityListItems = exports.getFilterCount = exports.getEntityStateSavedSorting = exports.getEntityStateSavedFilter = exports.getEntityState = exports.getEntityCategoryGroupConfigKey = exports.buildNextSavedFilterState = exports.buildEntityStateSavedFilterState = void 0;
3
+ exports.updateSelectColumnVisibility = exports.updateEntityStateByCategoryGroupConfigKey = exports.updateEntityPageStateWithCommonCategoryGroupConfigKey = exports.updateEntityPageState = exports.resetPage = exports.patchEntityListItems = exports.getFilterCount = exports.getEntityStateSavedSorting = exports.getEntityStateSavedFilter = exports.getEntityState = exports.getEntityCategoryGroupConfigKey = exports.closeRowPreview = exports.buildNextSavedFilterState = exports.buildEntityStateSavedFilterState = void 0;
4
4
  const constants_1 = require("../../components/TableCreator/common/constants");
5
5
  const constants_2 = require("./initializer/constants");
6
6
  /**
@@ -30,6 +30,19 @@ function buildNextSavedFilterState(state, selectedValue, selected) {
30
30
  return (savedFilter === null || savedFilter === void 0 ? void 0 : savedFilter.filters) || [];
31
31
  }
32
32
  exports.buildNextSavedFilterState = buildNextSavedFilterState;
33
+ /**
34
+ * Closes row preview, if row preview is enabled.
35
+ * If row preview is enabled, the row preview state value is set to false.
36
+ * @param rowPreview - Row preview state.
37
+ * @returns row preview state with row preview value set to false.
38
+ */
39
+ function closeRowPreview(rowPreview) {
40
+ if (!rowPreview)
41
+ return rowPreview;
42
+ const [[key]] = Object.entries(rowPreview);
43
+ return { [key]: false };
44
+ }
45
+ exports.closeRowPreview = closeRowPreview;
33
46
  /**
34
47
  * Returns the category group config key for the current entity.
35
48
  * @param entityPath - Entity path.
@@ -115,21 +128,6 @@ function resetPage(paginationState) {
115
128
  return nextPaginationState;
116
129
  }
117
130
  exports.resetPage = resetPage;
118
- /**
119
- * Resets row selection for the current entity and entities that share the same category group config key.
120
- * @param state - Explore state.
121
- * @param categoryGroupConfigKey - Category group config key.
122
- * @returns entity page state mapper with row selection reset.
123
- */
124
- function resetRowSelection(state, categoryGroupConfigKey = getEntityCategoryGroupConfigKey(state.tabValue, state.entityPageState)) {
125
- return Object.entries(state.entityPageState).reduce((acc, [entityPath, entityPageState]) => {
126
- if (entityPageState.categoryGroupConfigKey === categoryGroupConfigKey) {
127
- return Object.assign(Object.assign({}, acc), { [entityPath]: Object.assign(Object.assign({}, entityPageState), { rowSelection: {} }) });
128
- }
129
- return Object.assign(Object.assign({}, acc), { [entityPath]: entityPageState });
130
- }, {});
131
- }
132
- exports.resetRowSelection = resetRowSelection;
133
131
  /**
134
132
  * Sets entity state for the given category group config key.
135
133
  * @param categoryGroupConfigKey - Category group config key.
@@ -152,23 +150,21 @@ entityPageState, nextEntityPageState) {
152
150
  }
153
151
  exports.updateEntityPageState = updateEntityPageState;
154
152
  /**
155
- * Updates entity page state sorting for all entities with the same category group config key.
153
+ * Updates entity page state for the current entity and entities that share the same category group config key.
156
154
  * @param state - Explore state.
157
- * @param sorting - Sorting.
155
+ * @param nextEntityPageState - Partial next entity page state.
156
+ * @param categoryGroupConfigKey - Category group config key.
158
157
  * @returns entity page state.
159
158
  */
160
- function updateEntityPageStateSorting(state, sorting) {
161
- if (!sorting)
162
- return state.entityPageState;
163
- const categoryGroupConfigKey = getEntityCategoryGroupConfigKey(state.tabValue, state.entityPageState);
159
+ function updateEntityPageStateWithCommonCategoryGroupConfigKey(state, nextEntityPageState, categoryGroupConfigKey = getEntityCategoryGroupConfigKey(state.tabValue, state.entityPageState)) {
164
160
  return Object.entries(state.entityPageState).reduce((acc, [entityPath, entityPageState]) => {
165
161
  if (entityPageState.categoryGroupConfigKey === categoryGroupConfigKey) {
166
- return Object.assign(Object.assign({}, acc), { [entityPath]: Object.assign(Object.assign({}, entityPageState), { sorting }) });
162
+ return Object.assign(Object.assign({}, acc), { [entityPath]: Object.assign(Object.assign({}, entityPageState), nextEntityPageState) });
167
163
  }
168
164
  return Object.assign(Object.assign({}, acc), { [entityPath]: entityPageState });
169
165
  }, {});
170
166
  }
171
- exports.updateEntityPageStateSorting = updateEntityPageStateSorting;
167
+ exports.updateEntityPageStateWithCommonCategoryGroupConfigKey = updateEntityPageStateWithCommonCategoryGroupConfigKey;
172
168
  /**
173
169
  * Updates entity state by category group config key.
174
170
  * @param state - Explore state.
@@ -1,17 +1,11 @@
1
1
  import React, { Dispatch, ReactNode } from "react";
2
2
  import { AzulSearchIndex } from "../apis/azul/common/entities";
3
3
  import { SelectCategoryView, SelectedFilter } from "../common/entities";
4
+ import { RowPreviewState } from "../components/Table/features/RowPreview/entities";
4
5
  import { CategoryGroup, SiteConfig } from "../config/entities";
5
6
  import { EntityPageStateMapper, EntityStateByCategoryGroupConfigKey, ListItem } from "./exploreState/entities";
6
- import { ApplySavedFilterPayload, PaginateTablePayload, PatchExploreResponsePayload, ProcessExploreResponsePayload, ProcessRelatedResponsePayload, ResetExploreResponsePayload, ToggleEntityViewPayload, UpdateColumnVisibilityPayload, UpdateEntityFiltersPayload, UpdateEntityViewAccessPayload, UpdateFilterPayload, UpdateRowSelectionPayload, UpdateSortingPayload } from "./exploreState/payloads/entities";
7
+ import { ApplySavedFilterPayload, PaginateTablePayload, PatchExploreResponsePayload, ProcessExploreResponsePayload, ResetExploreResponsePayload, UpdateColumnVisibilityPayload, UpdateEntityFiltersPayload, UpdateEntityViewAccessPayload, UpdateFilterPayload, UpdateRowPreviewPayload, UpdateRowSelectionPayload, UpdateSortingPayload } from "./exploreState/payloads/entities";
7
8
  export declare type CatalogState = string | undefined;
8
- /**
9
- * Entity view.
10
- */
11
- export declare enum ENTITY_VIEW {
12
- EXACT = "EXACT",
13
- RELATED = "RELATED"
14
- }
15
9
  /**
16
10
  * Explore context.
17
11
  */
@@ -31,12 +25,10 @@ export declare type ExploreState = {
31
25
  featureFlagState: FeatureFlagState;
32
26
  filterCount: number;
33
27
  filterState: SelectedFilter[];
34
- isRelatedView: boolean;
35
28
  listItems: ListItems;
36
- listView: ENTITY_VIEW | undefined;
37
29
  loading: boolean;
38
30
  paginationState: PaginationState;
39
- relatedListItems: RelatedListItems;
31
+ rowPreview: RowPreviewState;
40
32
  tabValue: string;
41
33
  };
42
34
  /**
@@ -80,10 +72,6 @@ export interface PaginationState {
80
72
  previousIndex: PaginationIndex | null;
81
73
  rows: number;
82
74
  }
83
- /**
84
- * Related list items.
85
- */
86
- export declare type RelatedListItems = any[] | undefined;
87
75
  /**
88
76
  * Explore state context for storing and using filter-related and explore state.
89
77
  */
@@ -108,22 +96,21 @@ export declare enum ExploreActionKind {
108
96
  PaginateTable = "PAGINATE_TABLE",
109
97
  PatchExploreResponse = "PATCH_EXPLORE_RESPONSE",
110
98
  ProcessExploreResponse = "PROCESS_EXPLORE_RESPONSE",
111
- ProcessRelatedResponse = "PROCESS_RELATED_RESPONSE",
112
99
  ResetExploreResponse = "RESET_EXPLORE_RESPONSE",
113
100
  ResetState = "RESET_STATE",
114
101
  SelectEntityType = "SELECT_ENTITY_TYPE",
115
- ToggleEntityView = "TOGGLE_ENTITY_VIEW",
116
102
  UpdateColumnVisibility = "UPDATE_COLUMN_VISIBILITY",
117
103
  UpdateEntityFilters = "UPDATE_ENTITY_FILTERS",
118
104
  UpdateEntityViewAccess = "UPDATE_ENTITY_VIEW_ACCESS",
119
105
  UpdateFilter = "UPDATE_FILTER",
106
+ UpdateRowPreview = "UPDATE_ROW_PREVIEW",
120
107
  UpdateRowSelection = "UPDATE_ROW_SELECTION",
121
108
  UpdateSorting = "UPDATE_SORTING"
122
109
  }
123
110
  /**
124
111
  * Explore action.
125
112
  */
126
- export declare type ExploreAction = ApplySavedFilterAction | ClearFiltersAction | PaginateTableAction | PatchExploreResponseAction | ProcessExploreResponseAction | ProcessRelatedResponseAction | ResetExploreResponseAction | ResetStateAction | SelectEntityTypeAction | ToggleEntityViewAction | UpdateColumnVisibilityAction | UpdateEntityFiltersAction | UpdateEntityViewAccessAction | UpdateFilterAction | UpdateRowSelectionAction | UpdateSortingAction;
113
+ export declare type ExploreAction = ApplySavedFilterAction | ClearFiltersAction | PaginateTableAction | PatchExploreResponseAction | ProcessExploreResponseAction | ResetExploreResponseAction | ResetStateAction | SelectEntityTypeAction | UpdateColumnVisibilityAction | UpdateEntityFiltersAction | UpdateEntityViewAccessAction | UpdateFilterAction | UpdateRowPreviewAction | UpdateRowSelectionAction | UpdateSortingAction;
127
114
  /**
128
115
  * Apply saved filter action.
129
116
  */
@@ -159,13 +146,6 @@ declare type ProcessExploreResponseAction = {
159
146
  payload: ProcessExploreResponsePayload;
160
147
  type: ExploreActionKind.ProcessExploreResponse;
161
148
  };
162
- /**
163
- * Process related response action.
164
- */
165
- declare type ProcessRelatedResponseAction = {
166
- payload: ProcessRelatedResponsePayload;
167
- type: ExploreActionKind.ProcessRelatedResponse;
168
- };
169
149
  /**
170
150
  * Reset explore response action.
171
151
  */
@@ -187,13 +167,6 @@ declare type SelectEntityTypeAction = {
187
167
  payload: string;
188
168
  type: ExploreActionKind.SelectEntityType;
189
169
  };
190
- /**
191
- * Toggle entity view action.
192
- */
193
- declare type ToggleEntityViewAction = {
194
- payload: ToggleEntityViewPayload;
195
- type: ExploreActionKind.ToggleEntityView;
196
- };
197
170
  /**
198
171
  * Update column visibility action.
199
172
  */
@@ -222,6 +195,13 @@ declare type UpdateFilterAction = {
222
195
  payload: UpdateFilterPayload;
223
196
  type: ExploreActionKind.UpdateFilter;
224
197
  };
198
+ /**
199
+ * Update row preview action.
200
+ */
201
+ export declare type UpdateRowPreviewAction = {
202
+ payload: UpdateRowPreviewPayload;
203
+ type: ExploreActionKind.UpdateRowPreview;
204
+ };
225
205
  /**
226
206
  * Update row selection action.
227
207
  */
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ExploreActionKind = exports.ExploreStateProvider = exports.ExploreStateContext = exports.ENTITY_VIEW = void 0;
26
+ exports.ExploreActionKind = exports.ExploreStateProvider = exports.ExploreStateContext = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
28
  const useAuthentication_1 = require("../hooks/useAuthentication/useAuthentication");
29
29
  const useCategoryFilter_1 = require("../hooks/useCategoryFilter");
@@ -32,14 +32,6 @@ const useURLFilterParams_1 = require("../hooks/useURLFilterParams");
32
32
  const constants_1 = require("./exploreState/initializer/constants");
33
33
  const utils_1 = require("./exploreState/initializer/utils");
34
34
  const utils_2 = require("./exploreState/utils");
35
- /**
36
- * Entity view.
37
- */
38
- var ENTITY_VIEW;
39
- (function (ENTITY_VIEW) {
40
- ENTITY_VIEW["EXACT"] = "EXACT";
41
- ENTITY_VIEW["RELATED"] = "RELATED";
42
- })(ENTITY_VIEW = exports.ENTITY_VIEW || (exports.ENTITY_VIEW = {}));
43
35
  /**
44
36
  * Explore state context for storing and using filter-related and explore state.
45
37
  */
@@ -98,15 +90,14 @@ var ExploreActionKind;
98
90
  ExploreActionKind["PaginateTable"] = "PAGINATE_TABLE";
99
91
  ExploreActionKind["PatchExploreResponse"] = "PATCH_EXPLORE_RESPONSE";
100
92
  ExploreActionKind["ProcessExploreResponse"] = "PROCESS_EXPLORE_RESPONSE";
101
- ExploreActionKind["ProcessRelatedResponse"] = "PROCESS_RELATED_RESPONSE";
102
93
  ExploreActionKind["ResetExploreResponse"] = "RESET_EXPLORE_RESPONSE";
103
94
  ExploreActionKind["ResetState"] = "RESET_STATE";
104
95
  ExploreActionKind["SelectEntityType"] = "SELECT_ENTITY_TYPE";
105
- ExploreActionKind["ToggleEntityView"] = "TOGGLE_ENTITY_VIEW";
106
96
  ExploreActionKind["UpdateColumnVisibility"] = "UPDATE_COLUMN_VISIBILITY";
107
97
  ExploreActionKind["UpdateEntityFilters"] = "UPDATE_ENTITY_FILTERS";
108
98
  ExploreActionKind["UpdateEntityViewAccess"] = "UPDATE_ENTITY_VIEW_ACCESS";
109
99
  ExploreActionKind["UpdateFilter"] = "UPDATE_FILTER";
100
+ ExploreActionKind["UpdateRowPreview"] = "UPDATE_ROW_PREVIEW";
110
101
  ExploreActionKind["UpdateRowSelection"] = "UPDATE_ROW_SELECTION";
111
102
  ExploreActionKind["UpdateSorting"] = "UPDATE_SORTING";
112
103
  })(ExploreActionKind = exports.ExploreActionKind || (exports.ExploreActionKind = {}));
@@ -126,13 +117,16 @@ function exploreReducer(state, action, exploreContext) {
126
117
  **/
127
118
  case ExploreActionKind.ApplySavedFilter: {
128
119
  const filterState = (0, utils_2.buildNextSavedFilterState)(state, payload.selectedValue, payload.selected);
120
+ const rowPreview = (0, utils_2.closeRowPreview)(state.rowPreview);
121
+ const rowSelection = {};
129
122
  const savedFilterState = (0, utils_2.buildEntityStateSavedFilterState)(payload.categoryKey, payload.selectedValue, payload.selected);
130
123
  const savedSorting = (0, utils_2.getEntityStateSavedSorting)(state, payload.selectedValue, payload.selected);
124
+ const sorting = savedSorting || []; // Reset sorting to default if saved sorting is not available.
131
125
  (0, utils_2.updateEntityStateByCategoryGroupConfigKey)(state, {
132
126
  filterState,
133
127
  savedFilterState,
134
128
  });
135
- return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageStateSorting)(state, savedSorting), filterCount: (0, utils_2.getFilterCount)(filterState), filterState, paginationState: (0, utils_2.resetPage)(state.paginationState) });
129
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageStateWithCommonCategoryGroupConfigKey)(state, { rowPreview, rowSelection, sorting }), filterCount: (0, utils_2.getFilterCount)(filterState), filterState, paginationState: (0, utils_2.resetPage)(state.paginationState), rowPreview });
136
130
  }
137
131
  /**
138
132
  * Clear all filters
@@ -140,13 +134,15 @@ function exploreReducer(state, action, exploreContext) {
140
134
  case ExploreActionKind.ClearFilters: {
141
135
  const filterCount = 0;
142
136
  const filterState = [];
137
+ const rowPreview = (0, utils_2.closeRowPreview)(state.rowPreview);
138
+ const rowSelection = {};
143
139
  const savedFilterState = [];
144
140
  (0, utils_2.updateEntityStateByCategoryGroupConfigKey)(state, {
145
141
  filterState,
146
142
  savedFilterState,
147
143
  });
148
- return Object.assign(Object.assign({}, state), { filterCount,
149
- filterState, paginationState: (0, utils_2.resetPage)(state.paginationState) });
144
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageStateWithCommonCategoryGroupConfigKey)(state, { rowPreview, rowSelection }), filterCount,
145
+ filterState, paginationState: (0, utils_2.resetPage)(state.paginationState), rowPreview });
150
146
  }
151
147
  /**
152
148
  * Paginate table
@@ -161,7 +157,8 @@ function exploreReducer(state, action, exploreContext) {
161
157
  nextPaginationState.currentPage--;
162
158
  nextPaginationState.index = nextPaginationState.previousIndex;
163
159
  }
164
- return Object.assign(Object.assign({}, state), { paginationState: nextPaginationState });
160
+ const rowPreview = (0, utils_2.closeRowPreview)(state.rowPreview);
161
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { rowPreview }), paginationState: nextPaginationState, rowPreview });
165
162
  }
166
163
  /**
167
164
  * Patch explore response
@@ -173,6 +170,7 @@ function exploreReducer(state, action, exploreContext) {
173
170
  * Process explore response
174
171
  **/
175
172
  case ExploreActionKind.ProcessExploreResponse: {
173
+ const entityPageState = state.entityPageState[state.tabValue];
176
174
  const entityState = (0, utils_2.getEntityState)(state);
177
175
  const nextCategoryViews = payload.selectCategories
178
176
  ? (0, useCategoryFilter_1.buildCategoryViews)([
@@ -180,16 +178,11 @@ function exploreReducer(state, action, exploreContext) {
180
178
  ...entityState.savedSelectCategories, // "savedFilter" select categories are built from config at reducer initialization.
181
179
  ], entityState.categoryConfigs, [...state.filterState, ...entityState.savedFilterState])
182
180
  : state.categoryViews;
181
+ const rowPreview = entityPageState.rowPreview;
183
182
  (0, utils_2.updateEntityStateByCategoryGroupConfigKey)(state, {
184
183
  categoryViews: nextCategoryViews,
185
184
  });
186
- return Object.assign(Object.assign({}, state), { categoryViews: nextCategoryViews, listItems: payload.loading ? [] : payload.listItems, loading: payload.loading, paginationState: Object.assign(Object.assign({}, state.paginationState), payload.paginationResponse) });
187
- }
188
- /**
189
- * Process related response
190
- */
191
- case ExploreActionKind.ProcessRelatedResponse: {
192
- return Object.assign(Object.assign({}, state), { relatedListItems: payload.relatedListItems });
185
+ return Object.assign(Object.assign({}, state), { categoryViews: nextCategoryViews, listItems: payload.loading ? [] : payload.listItems, loading: payload.loading, paginationState: Object.assign(Object.assign({}, state.paginationState), payload.paginationResponse), rowPreview });
193
186
  }
194
187
  /**
195
188
  * Reset explore response.
@@ -211,31 +204,38 @@ function exploreReducer(state, action, exploreContext) {
211
204
  return state;
212
205
  }
213
206
  const entityState = (0, utils_2.getEntityState)(state, (0, utils_2.getEntityCategoryGroupConfigKey)(payload, state.entityPageState));
214
- return Object.assign(Object.assign({}, state), { categoryGroups: entityState.categoryGroups, categoryViews: entityState.categoryViews, filterCount: (0, utils_2.getFilterCount)(entityState.filterState), filterState: entityState.filterState, listItems: [], loading: true, paginationState: (0, utils_2.resetPage)(state.paginationState), tabValue: payload });
215
- }
216
- /**
217
- * Toggle entity view
218
- */
219
- case ExploreActionKind.ToggleEntityView: {
220
- return Object.assign(Object.assign({}, state), { isRelatedView: payload === ENTITY_VIEW.RELATED, listView: payload });
207
+ const rowPreview = (0, utils_2.closeRowPreview)(state.rowPreview); // Close row preview, without updating the entity page state row preview.
208
+ return Object.assign(Object.assign({}, state), { categoryGroups: entityState.categoryGroups, categoryViews: entityState.categoryViews, filterCount: (0, utils_2.getFilterCount)(entityState.filterState), filterState: entityState.filterState, listItems: [], loading: true, paginationState: Object.assign(Object.assign({}, (0, utils_2.resetPage)(state.paginationState)), { rows: 0 }), rowPreview, tabValue: payload });
221
209
  }
222
210
  /**
223
211
  * Update column visibility
224
212
  **/
225
213
  case ExploreActionKind.UpdateColumnVisibility: {
226
- return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { columnsVisibility: payload }) });
214
+ const columnsVisibility = payload;
215
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { columnsVisibility }) });
227
216
  }
228
217
  /**
229
218
  * Update entity filters.
219
+ * Updates state for the given entity and entities with the same category group config key, prior to navigation to the entity.
220
+ * Actions for the given entity and entities with the same category group config key:
221
+ * - updates filter state,
222
+ * - clears saved filter state,
223
+ * - resets row selection, and
224
+ * - closes row preview.
225
+ * Actions for the current entity:
226
+ * - closes row preview, without updating the entity page state row preview.
230
227
  */
231
228
  case ExploreActionKind.UpdateEntityFilters: {
232
- const { entityListType, filters: filterState } = payload;
229
+ const { entityListType, filters: filterState, sorting } = payload;
233
230
  const categoryGroupConfigKey = (0, utils_2.getEntityCategoryGroupConfigKey)(entityListType, state.entityPageState);
231
+ const rowPreview = (0, utils_2.closeRowPreview)(state.entityPageState[entityListType].rowPreview);
232
+ const rowSelection = {};
233
+ const savedFilterState = [];
234
234
  (0, utils_2.updateEntityStateByCategoryGroupConfigKey)(state, {
235
235
  filterState,
236
- savedFilterState: [], // Clear saved filter state.
236
+ savedFilterState,
237
237
  }, categoryGroupConfigKey);
238
- return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.resetRowSelection)(state, categoryGroupConfigKey) });
238
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageStateWithCommonCategoryGroupConfigKey)(state, { rowPreview, rowSelection, sorting }, categoryGroupConfigKey), rowPreview: (0, utils_2.closeRowPreview)(state.rowPreview) });
239
239
  }
240
240
  /**
241
241
  * Update entity view access
@@ -248,24 +248,36 @@ function exploreReducer(state, action, exploreContext) {
248
248
  **/
249
249
  case ExploreActionKind.UpdateFilter: {
250
250
  const filterState = (0, useCategoryFilter_1.buildNextFilterState)(state.filterState, payload.categoryKey, payload.selectedValue, payload.selected);
251
+ const rowPreview = (0, utils_2.closeRowPreview)(state.rowPreview);
252
+ const rowSelection = {};
251
253
  const savedFilterState = []; // Clear saved filter state.
252
254
  (0, utils_2.updateEntityStateByCategoryGroupConfigKey)(state, {
253
255
  filterState,
254
256
  savedFilterState,
255
257
  });
256
- return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.resetRowSelection)(state), filterCount: (0, utils_2.getFilterCount)(filterState), filterState, paginationState: (0, utils_2.resetPage)(state.paginationState) });
258
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageStateWithCommonCategoryGroupConfigKey)(state, { rowPreview, rowSelection }), filterCount: (0, utils_2.getFilterCount)(filterState), filterState, paginationState: (0, utils_2.resetPage)(state.paginationState), rowPreview });
259
+ }
260
+ /**
261
+ * Update row preview
262
+ */
263
+ case ExploreActionKind.UpdateRowPreview: {
264
+ const rowPreview = payload;
265
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { rowPreview }), rowPreview });
257
266
  }
258
267
  /**
259
268
  * Update row selection
260
269
  */
261
270
  case ExploreActionKind.UpdateRowSelection: {
262
- return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { rowSelection: payload }) });
271
+ const rowSelection = payload;
272
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { rowSelection }) });
263
273
  }
264
274
  /**
265
275
  * Update sorting
266
276
  **/
267
277
  case ExploreActionKind.UpdateSorting: {
268
- return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { sorting: payload }), paginationState: (0, utils_2.resetPage)(state.paginationState) });
278
+ const rowPreview = (0, utils_2.closeRowPreview)(state.rowPreview);
279
+ const sorting = payload;
280
+ return Object.assign(Object.assign({}, state), { entityPageState: (0, utils_2.updateEntityPageState)(state.tabValue, state.entityPageState, { rowPreview, sorting }), paginationState: (0, utils_2.resetPage)(state.paginationState), rowPreview });
269
281
  }
270
282
  default:
271
283
  return state;
@@ -1,4 +1,4 @@
1
- import { CommonColors, PaletteColor } from "@mui/material/styles/createPalette";
1
+ import { CommonColors, PaletteColor } from "@mui/material/styles";
2
2
  import { ThemeProps } from "../../../theme/theme";
3
3
  export declare const alertLight: ({ theme }: ThemeProps) => PaletteColor["light"];
4
4
  export declare const alertLightest: ({ theme, }: ThemeProps) => PaletteColor["lightest"];
@@ -10,6 +10,7 @@ export declare const infoMain: ({ theme }: ThemeProps) => PaletteColor["main"];
10
10
  export declare const inkLight: ({ theme }: ThemeProps) => PaletteColor["light"];
11
11
  export declare const inkMain: ({ theme }: ThemeProps) => PaletteColor["main"];
12
12
  export declare const primaryDark: ({ theme }: ThemeProps) => PaletteColor["dark"];
13
+ export declare const primaryLightest: ({ theme, }: ThemeProps) => PaletteColor["lightest"];
13
14
  export declare const primaryMain: ({ theme }: ThemeProps) => PaletteColor["main"];
14
15
  export declare const smokeDark: ({ theme }: ThemeProps) => PaletteColor["dark"];
15
16
  export declare const smokeLight: ({ theme }: ThemeProps) => PaletteColor["light"];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.white = exports.warningMain = exports.warningLightest = exports.warningLight = exports.successMain = exports.successLightest = exports.successLight = exports.smokeMain = exports.smokeLightest = exports.smokeLight = exports.smokeDark = exports.primaryMain = exports.primaryDark = exports.inkMain = exports.inkLight = exports.infoMain = exports.infoLightest = exports.infoLight = exports.errorMain = exports.alertMain = exports.alertLightest = exports.alertLight = void 0;
3
+ exports.white = exports.warningMain = exports.warningLightest = exports.warningLight = exports.successMain = exports.successLightest = exports.successLight = exports.smokeMain = exports.smokeLightest = exports.smokeLight = exports.smokeDark = exports.primaryMain = exports.primaryLightest = exports.primaryDark = exports.inkMain = exports.inkLight = exports.infoMain = exports.infoLightest = exports.infoLight = exports.errorMain = exports.alertMain = exports.alertLightest = exports.alertLight = void 0;
4
4
  // Alert
5
5
  const alertLight = ({ theme }) => theme.palette.alert.light;
6
6
  exports.alertLight = alertLight;
@@ -26,6 +26,8 @@ exports.inkMain = inkMain;
26
26
  // Primary
27
27
  const primaryDark = ({ theme }) => theme.palette.primary.dark;
28
28
  exports.primaryDark = primaryDark;
29
+ const primaryLightest = ({ theme, }) => theme.palette.primary.lightest;
30
+ exports.primaryLightest = primaryLightest;
29
31
  const primaryMain = ({ theme }) => theme.palette.primary.main;
30
32
  exports.primaryMain = primaryMain;
31
33
  // Smoke
@@ -542,11 +542,11 @@ const MuiChip = (theme) => {
542
542
  },
543
543
  {
544
544
  props: { variant: "ntag" },
545
- style: Object.assign(Object.assign({}, theme.typography[typography_1.TEXT_BODY_SMALL_400]), { backgroundColor: theme.palette.smoke.main, boxShadow: `0 0 0 2px ${palette_1.white}`, height: 24 }),
545
+ style: Object.assign(Object.assign({}, theme.typography[typography_1.TEXT_BODY_SMALL_400]), { backgroundColor: theme.palette.smoke.main, boxShadow: `0 0 0 2px ${palette_1.white}`, height: 24, justifySelf: FLEX_START, minWidth: 0 }),
546
546
  },
547
547
  {
548
548
  props: { variant: "status" },
549
- style: Object.assign(Object.assign({}, theme.typography[typography_1.TEXT_BODY_SMALL_500]), { boxShadow: `0 0 0 2px ${palette_1.white}`, height: 20, maxWidth: "fit-content" }),
549
+ style: Object.assign(Object.assign({}, theme.typography[typography_1.TEXT_BODY_SMALL_500]), { boxShadow: `0 0 0 2px ${palette_1.white}`, height: 20, maxWidth: "fit-content", minWidth: 0 }),
550
550
  },
551
551
  ],
552
552
  };
@@ -1063,6 +1063,15 @@ const MuiPaper = (theme) => {
1063
1063
  },
1064
1064
  },
1065
1065
  },
1066
+ {
1067
+ props: { variant: "table" },
1068
+ style: {
1069
+ borderColor: theme.palette.smoke.main,
1070
+ borderStyle: "solid",
1071
+ borderWidth: 1,
1072
+ boxShadow: theme.shadows[1], // elevation01
1073
+ },
1074
+ },
1066
1075
  ],
1067
1076
  };
1068
1077
  };
@@ -1,5 +1,5 @@
1
1
  import { PaletteColorOptions } from "@mui/material";
2
- import { CommonColors, TypeBackground, TypeText } from "@mui/material/styles/createPalette";
2
+ import { CommonColors, TypeBackground, TypeText } from "@mui/material/styles";
3
3
  /**
4
4
  * Palette "Alert"
5
5
  */
@@ -35,6 +35,7 @@ declare enum INK {
35
35
  */
36
36
  declare enum PRIMARY {
37
37
  DARK = "#005EA9",
38
+ LIGHTEST = "#E6EFF6",
38
39
  MAIN = "#1C7CC7"
39
40
  }
40
41
  /**
@@ -106,6 +107,7 @@ export declare const infoMain = INFO.CONTRAST_TEXT;
106
107
  export declare const inkLight = INK.LIGHT;
107
108
  export declare const inkMain = INK.MAIN;
108
109
  export declare const primaryDark = PRIMARY.DARK;
110
+ export declare const primaryLightest = PRIMARY.LIGHTEST;
109
111
  export declare const primaryMain = PRIMARY.MAIN;
110
112
  export declare const smokeDark = SMOKE.DARK;
111
113
  export declare const smokeLight = SMOKE.LIGHT;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warning = exports.text = exports.success = exports.smoke = exports.primary = exports.ink = exports.info = exports.common = exports.background = exports.alert = exports.black08 = exports.black04 = exports.alpha80 = exports.alpha64 = exports.alpha60 = exports.alpha32 = exports.alpha08 = exports.alpha04 = exports.white = exports.black = exports.warningMain = exports.warningLightest = exports.warningLight = exports.warningContrastText = exports.textPrimary = exports.successMain = exports.successLightest = exports.successLight = exports.smokeMain = exports.smokeLightest = exports.smokeLight = exports.smokeDark = exports.primaryMain = exports.primaryDark = exports.inkMain = exports.inkLight = exports.infoMain = exports.infoLightest = exports.infoLight = exports.infoContrastText = exports.backgroundDefault = exports.alertMain = exports.alertLightest = exports.alertLight = void 0;
3
+ exports.warning = exports.text = exports.success = exports.smoke = exports.primary = exports.ink = exports.info = exports.common = exports.background = exports.alert = exports.black08 = exports.black04 = exports.alpha80 = exports.alpha64 = exports.alpha60 = exports.alpha32 = exports.alpha08 = exports.alpha04 = exports.white = exports.black = exports.warningMain = exports.warningLightest = exports.warningLight = exports.warningContrastText = exports.textPrimary = exports.successMain = exports.successLightest = exports.successLight = exports.smokeMain = exports.smokeLightest = exports.smokeLight = exports.smokeDark = exports.primaryMain = exports.primaryLightest = exports.primaryDark = exports.inkMain = exports.inkLight = exports.infoMain = exports.infoLightest = exports.infoLight = exports.infoContrastText = exports.backgroundDefault = exports.alertMain = exports.alertLightest = exports.alertLight = void 0;
4
4
  /**
5
5
  * Palette "Alert"
6
6
  */
@@ -41,6 +41,7 @@ var INK;
41
41
  var PRIMARY;
42
42
  (function (PRIMARY) {
43
43
  PRIMARY["DARK"] = "#005EA9";
44
+ PRIMARY["LIGHTEST"] = "#E6EFF6";
44
45
  PRIMARY["MAIN"] = "#1C7CC7";
45
46
  })(PRIMARY || (PRIMARY = {}));
46
47
  /**
@@ -119,6 +120,7 @@ exports.infoMain = INFO.MAIN;
119
120
  exports.inkLight = INK.LIGHT;
120
121
  exports.inkMain = INK.MAIN;
121
122
  exports.primaryDark = PRIMARY.DARK;
123
+ exports.primaryLightest = PRIMARY.LIGHTEST;
122
124
  exports.primaryMain = PRIMARY.MAIN;
123
125
  exports.smokeDark = SMOKE.DARK;
124
126
  exports.smokeLight = SMOKE.LIGHT;
@@ -190,6 +192,7 @@ exports.ink = {
190
192
  */
191
193
  exports.primary = {
192
194
  dark: exports.primaryDark,
195
+ lightest: exports.primaryLightest,
193
196
  main: exports.primaryMain,
194
197
  };
195
198
  /**
@@ -42,7 +42,6 @@ const tableCreator_1 = require("../../components/TableCreator/tableCreator");
42
42
  const useBreakpointHelper_1 = require("../../hooks/useBreakpointHelper");
43
43
  const useConfig_1 = require("../../hooks/useConfig");
44
44
  const useEntityList_1 = require("../../hooks/useEntityList");
45
- const useEntityListRelatedView_1 = require("../../hooks/useEntityListRelatedView");
46
45
  const useExploreState_1 = require("../../hooks/useExploreState");
47
46
  const useSummary_1 = require("../../hooks/useSummary");
48
47
  const exploreState_1 = require("../../providers/exploreState");
@@ -69,12 +68,11 @@ const ExploreView = (props) => {
69
68
  const { entities, explorerTitle, summaryConfig, trackingConfig } = config;
70
69
  const { listView } = entityConfig;
71
70
  const { listHero, subTitleHero } = listView || {};
72
- const { categoryGroups, categoryViews, filterCount, isRelatedView, tabValue, } = exploreState;
71
+ const { categoryGroups, categoryViews, filterCount, tabValue } = exploreState;
73
72
  const { push } = (0, router_1.useRouter)();
74
73
  const tabs = getTabs(entities);
75
74
  const { response: summaryResponse } = (0, useSummary_1.useSummary)(); // Fetch summary.
76
75
  (0, useEntityList_1.useEntityList)(props); // Fetch entities.
77
- (0, useEntityListRelatedView_1.useEntityListRelatedView)(); // Fetch related entities.
78
76
  const { entityListType } = props;
79
77
  const categoryFilters = (0, react_1.useMemo)(() => buildCategoryFilters(categoryViews, categoryGroups), [categoryGroups, categoryViews]);
80
78
  /**
@@ -156,7 +154,7 @@ const ExploreView = (props) => {
156
154
  react_1.default.createElement(sidebarLabel_1.SidebarLabel, { label: "Filters" }),
157
155
  react_1.default.createElement(clearAllFilters_1.ClearAllFilters, null),
158
156
  react_1.default.createElement(searchAllFilters_1.SearchAllFilters, { categoryViews: categoryViews, drawerOpen: isDrawerOpen, onFilter: onFilterChange.bind(null, true) })),
159
- react_1.default.createElement(filters_1.Filters, { categoryFilters: categoryFilters, closeAncestor: onCloseDrawer, disabled: isRelatedView, onFilter: onFilterChange.bind(null, false), trackFilterOpened: trackingConfig === null || trackingConfig === void 0 ? void 0 : trackingConfig.trackFilterOpened }))),
157
+ react_1.default.createElement(filters_1.Filters, { categoryFilters: categoryFilters, closeAncestor: onCloseDrawer, onFilter: onFilterChange.bind(null, false), trackFilterOpened: trackingConfig === null || trackingConfig === void 0 ? void 0 : trackingConfig.trackFilterOpened }))),
160
158
  react_1.default.createElement(index_1.Index, { className: props.className, List: renderList(exploreState, entityConfig, entityListType), ListHero: renderComponent(listHero), SideBarButton: tabletDown ? (react_1.default.createElement(sidebarButton_1.SidebarButton, { count: filterCount, label: "Filter", onClick: onOpenDrawer })) : undefined, SubTitleHero: renderComponent(subTitleHero), Summaries: renderSummary(summaryConfig, summaryResponse), Tabs: react_1.default.createElement(tabs_1.Tabs, { onTabChange: onTabChange, tabs: tabs, value: tabValue }), title: explorerTitle })));
161
159
  };
162
160
  exports.ExploreView = ExploreView;
@@ -205,7 +203,7 @@ function renderComponent(componentsConfig, response) {
205
203
  * @returns rendered Table component.
206
204
  */
207
205
  function renderList(exploreState, entityConfig, entityListType) {
208
- const { isRelatedView, listItems, loading, paginationState, relatedListItems, tabValue, } = exploreState;
206
+ const { listItems, loading, tabValue } = exploreState;
209
207
  const { getId: getRowId, list, listView } = entityConfig;
210
208
  const { columns: columnsConfig, defaultSort } = list;
211
209
  if (!exploreState || !tabValue) {
@@ -216,7 +214,7 @@ function renderList(exploreState, entityConfig, entityListType) {
216
214
  // loads with the previous tabs data on the first render after switching tabs. (or similar)
217
215
  return react_1.default.createElement(react_1.default.Fragment, null);
218
216
  }
219
- return (react_1.default.createElement(tableCreator_1.TableCreator, { columns: columnsConfig, defaultSort: defaultSort, getRowId: getRowId, items: isRelatedView && relatedListItems ? relatedListItems : listItems !== null && listItems !== void 0 ? listItems : [], listView: listView, loading: loading, pages: paginationState.pages, pageSize: paginationState.pageSize, pagination: undefined, total: paginationState.rows }));
217
+ return (react_1.default.createElement(tableCreator_1.TableCreator, { columns: columnsConfig, defaultSort: defaultSort, getRowId: getRowId, items: listItems !== null && listItems !== void 0 ? listItems : [], listView: listView, loading: loading }));
220
218
  }
221
219
  /**
222
220
  * 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": "4.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -66,7 +66,7 @@
66
66
  "@emotion/styled": "11.11.0",
67
67
  "@mui/icons-material": "5.14.1",
68
68
  "@mui/material": "5.14.1",
69
- "@tanstack/react-table": "8.5.11",
69
+ "@tanstack/react-table": "^8.17.3",
70
70
  "@tanstack/react-virtual": "^3.0.0-beta.59",
71
71
  "axios": "^1.6.7",
72
72
  "copy-to-clipboard": "3.3.1",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ComponentsConfig } from "../../config/entities";
2
+ import { ComponentsConfig, ViewContext } from "../../config/entities";
3
3
  import { useAuthentication } from "../../hooks/useAuthentication/useAuthentication";
4
4
  import { useConfig } from "../../hooks/useConfig";
5
5
  import { useExploreState } from "../../hooks/useExploreState";
@@ -9,6 +9,7 @@ import { useSystemStatus } from "../../hooks/useSystemStatus";
9
9
  export interface ComponentCreatorProps<T> {
10
10
  components: ComponentsConfig;
11
11
  response: T;
12
+ viewContext?: Partial<ViewContext<T>>;
12
13
  }
13
14
 
14
15
  /**
@@ -18,11 +19,13 @@ export interface ComponentCreatorProps<T> {
18
19
  * @param componentCreatorProps - Custom props required for creating component.
19
20
  * @param componentCreatorProps.components - Component config to render as React elements.
20
21
  * @param componentCreatorProps.response - Response returned from API endpoint, used to populate component props.
22
+ * @param componentCreatorProps.viewContext - Additional context to pass to the component.
21
23
  * @returns A set of React components.
22
24
  */
23
25
  export const ComponentCreator = <T,>({
24
26
  components,
25
27
  response,
28
+ viewContext,
26
29
  }: ComponentCreatorProps<T>): JSX.Element => {
27
30
  const { authenticationStatus, isAuthenticated } = useAuthentication();
28
31
  const { config, entityConfig } = useConfig();
@@ -43,10 +46,12 @@ export const ComponentCreator = <T,>({
43
46
  key={k}
44
47
  components={c.children}
45
48
  response={response}
49
+ viewContext={viewContext}
46
50
  />
47
51
  ) : null;
48
52
  const props = c.viewBuilder
49
53
  ? c.viewBuilder(response, {
54
+ ...viewContext,
50
55
  authState: {
51
56
  authenticationStatus,
52
57
  isAuthenticated,