@databiosphere/findable-ui 2.1.0 → 3.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.
- package/lib/components/Detail/components/DetailViewTable/detailViewTable.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Filter/components/Filters/filters.d.ts +1 -1
- package/lib/components/Filter/components/Filters/filters.styles.js +1 -1
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +2 -1
- package/lib/components/Index/index.d.ts +2 -1
- package/lib/components/Index/index.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +3 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Table/common/utils.d.ts +6 -0
- package/lib/components/Table/common/utils.js +12 -1
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +2 -2
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +1 -1
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +3 -3
- package/lib/components/Table/components/TableCell/common/utils.d.ts +8 -0
- package/lib/components/Table/components/TableCell/common/utils.js +15 -0
- package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.d.ts +6 -0
- package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.js +15 -0
- package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.d.ts +6 -0
- package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.js +16 -0
- package/lib/components/Table/components/TableHead/tableHead.js +2 -2
- package/lib/components/Table/components/TableRows/tableRows.js +2 -3
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.d.ts +10 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.js +37 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.d.ts +3 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.js +13 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.d.ts +9 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.js +19 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.d.ts +5 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.js +13 -0
- package/lib/components/Table/components/TableToolbar/tableToolbar.js +5 -5
- package/lib/components/Table/components/TableToolbar/tableToolbar.styles.d.ts +1 -5
- package/lib/components/Table/components/TableToolbar/tableToolbar.styles.js +10 -7
- package/lib/components/Table/table.d.ts +5 -2
- package/lib/components/Table/table.js +13 -2
- package/lib/components/TableCreator/common/constants.d.ts +6 -0
- package/lib/components/TableCreator/common/constants.js +22 -0
- package/lib/components/TableCreator/common/entities.d.ts +5 -0
- package/lib/components/TableCreator/common/entities.js +2 -0
- package/lib/components/TableCreator/common/utils.d.ts +8 -0
- package/lib/components/TableCreator/common/utils.js +24 -0
- package/lib/components/TableCreator/tableCreator.d.ts +3 -1
- package/lib/components/TableCreator/tableCreator.js +19 -34
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +5 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +25 -0
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.d.ts +4 -2
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.js +2 -2
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.styles.d.ts +5 -1
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.styles.js +24 -1
- package/lib/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.d.ts +6 -0
- package/lib/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.js +29 -0
- package/lib/components/common/Dialog/dialog.d.ts +7 -0
- package/lib/components/common/Dialog/dialog.js +24 -0
- package/lib/components/common/DropdownMenu/common/constants.d.ts +2 -0
- package/lib/components/common/DropdownMenu/common/constants.js +8 -0
- package/lib/components/common/DropdownMenu/common/entities.d.ts +10 -0
- package/lib/components/common/DropdownMenu/common/entities.js +2 -0
- package/lib/components/common/DropdownMenu/components/MenuItem/menuItem.d.ts +7 -0
- package/lib/components/common/DropdownMenu/components/MenuItem/menuItem.js +25 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.d.ts +9 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.js +49 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.d.ts +3 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.js +13 -0
- package/lib/components/common/IconButton/iconButton.d.ts +4 -3
- package/lib/components/common/IconButton/iconButton.js +4 -4
- package/lib/components/common/IconButton/iconButton.styles.d.ts +34 -0
- package/lib/components/common/IconButton/iconButton.styles.js +27 -1
- package/lib/components/common/Tabs/tabs.styles.d.ts +1 -1
- package/lib/config/entities.d.ts +9 -1
- package/lib/providers/exploreState/constants.d.ts +3 -3
- package/lib/providers/exploreState/constants.js +3 -26
- package/lib/providers/exploreState/entities.d.ts +16 -5
- package/lib/providers/exploreState/initializer/constants.js +2 -0
- package/lib/providers/exploreState/initializer/utils.js +77 -5
- package/lib/providers/exploreState/payloads/entities.d.ts +32 -6
- package/lib/providers/exploreState/utils.d.ts +65 -11
- package/lib/providers/exploreState/utils.js +126 -15
- package/lib/providers/exploreState.d.ts +39 -7
- package/lib/providers/exploreState.js +58 -11
- package/lib/theme/common/components.js +4 -0
- package/lib/views/ExploreView/exploreView.d.ts +3 -1
- package/lib/views/ExploreView/exploreView.js +17 -11
- package/package.json +1 -1
- package/src/components/Detail/components/DetailViewTable/detailViewTable.tsx +2 -2
- package/src/components/Filter/components/Filters/filters.styles.ts +1 -1
- package/src/components/Filter/components/Filters/filters.tsx +1 -1
- package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +6 -3
- package/src/components/Index/index.tsx +3 -1
- package/src/components/Table/common/utils.ts +17 -0
- package/src/components/Table/components/CheckboxMenu/checkboxMenu.styles.ts +3 -3
- package/src/components/Table/components/CheckboxMenu/checkboxMenu.tsx +4 -2
- package/src/components/Table/components/TableCell/common/utils.ts +16 -0
- package/src/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.tsx +24 -0
- package/src/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.tsx +31 -0
- package/src/components/Table/components/TableHead/tableHead.tsx +18 -7
- package/src/components/Table/components/TableRows/tableRows.tsx +10 -8
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.tsx +50 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.tsx +30 -0
- package/src/components/Table/components/TableToolbar/tableToolbar.styles.ts +10 -7
- package/src/components/Table/components/TableToolbar/tableToolbar.tsx +11 -8
- package/src/components/Table/table.tsx +18 -1
- package/src/components/TableCreator/common/constants.ts +26 -0
- package/src/components/TableCreator/common/entities.ts +6 -0
- package/src/components/TableCreator/common/utils.ts +33 -0
- package/src/components/TableCreator/tableCreator.tsx +38 -17
- package/src/components/common/Alert/components/AlertText/alertText.styles.ts +20 -0
- package/src/components/common/Button/components/DropdownButton/dropdownButton.styles.ts +15 -1
- package/src/components/common/Button/components/DropdownButton/dropdownButton.tsx +10 -2
- package/src/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.tsx +23 -0
- package/src/components/common/Dialog/dialog.tsx +21 -0
- package/src/components/common/DropdownMenu/common/constants.ts +7 -0
- package/src/components/common/DropdownMenu/common/entities.ts +11 -0
- package/src/components/common/DropdownMenu/components/MenuItem/menuItem.tsx +24 -0
- package/src/components/common/DropdownMenu/dropdownMenu.styles.ts +8 -0
- package/src/components/common/DropdownMenu/dropdownMenu.tsx +48 -0
- package/src/components/common/IconButton/iconButton.styles.ts +18 -0
- package/src/components/common/IconButton/iconButton.tsx +10 -11
- package/src/config/entities.ts +13 -1
- package/src/providers/exploreState/constants.ts +3 -0
- package/src/providers/exploreState/entities.ts +28 -4
- package/src/providers/exploreState/initializer/constants.ts +2 -0
- package/src/providers/exploreState/initializer/utils.ts +94 -3
- package/src/providers/exploreState/payloads/entities.ts +41 -7
- package/src/providers/exploreState/utils.ts +185 -21
- package/src/providers/exploreState.tsx +155 -21
- package/src/theme/common/components.ts +4 -0
- package/src/views/ExploreView/exploreView.tsx +22 -10
- package/types/data-explorer-ui.d.ts +10 -0
- package/src/components/Table/components/EntityViewToggle/entityViewToggle.tsx +0 -36
|
@@ -41,9 +41,12 @@ import { useEntityListRelatedView } from "../../hooks/useEntityListRelatedView";
|
|
|
41
41
|
import { useExploreState } from "../../hooks/useExploreState";
|
|
42
42
|
import { useSummary } from "../../hooks/useSummary";
|
|
43
43
|
import { ExploreActionKind, ExploreState } from "../../providers/exploreState";
|
|
44
|
+
import { SELECT_CATEGORY_KEY } from "../../providers/exploreState/constants";
|
|
44
45
|
import { DESKTOP_SM } from "../../theme/common/breakpoints";
|
|
45
46
|
|
|
46
|
-
export
|
|
47
|
+
export interface ExploreViewProps extends AzulEntitiesStaticResponse {
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
47
50
|
|
|
48
51
|
/**
|
|
49
52
|
* Returns tabs to be used as a prop for the Tabs component.
|
|
@@ -111,13 +114,18 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
111
114
|
categorySection?: string,
|
|
112
115
|
searchTerm?: string
|
|
113
116
|
): void => {
|
|
117
|
+
const dispatchType =
|
|
118
|
+
categoryKey === SELECT_CATEGORY_KEY.SAVED_FILTERS
|
|
119
|
+
? ExploreActionKind.ApplySavedFilter
|
|
120
|
+
: ExploreActionKind.UpdateFilter;
|
|
121
|
+
|
|
114
122
|
exploreDispatch({
|
|
115
123
|
payload: {
|
|
116
124
|
categoryKey,
|
|
117
125
|
selected,
|
|
118
126
|
selectedValue: selectedCategoryValue,
|
|
119
127
|
},
|
|
120
|
-
type:
|
|
128
|
+
type: dispatchType,
|
|
121
129
|
});
|
|
122
130
|
|
|
123
131
|
trackingConfig?.trackFilterApplied?.({
|
|
@@ -193,6 +201,7 @@ export const ExploreView = (props: ExploreViewProps): JSX.Element => {
|
|
|
193
201
|
</Sidebar>
|
|
194
202
|
)}
|
|
195
203
|
<IndexView
|
|
204
|
+
className={props.className}
|
|
196
205
|
List={renderList(exploreState, entityConfig, entityListType)}
|
|
197
206
|
ListHero={renderComponent(listHero)}
|
|
198
207
|
SideBarButton={
|
|
@@ -226,23 +235,25 @@ function buildCategoryFilters(
|
|
|
226
235
|
if (!categoryGroups) {
|
|
227
236
|
return [{ categoryViews: selectCategoryViews }];
|
|
228
237
|
}
|
|
229
|
-
return categoryGroups.
|
|
238
|
+
return categoryGroups.reduce((accGroups, { categoryConfigs, label }) => {
|
|
230
239
|
// Grab the category views for the configured grouped categories.
|
|
231
240
|
const categoryViews = categoryConfigs.reduce(
|
|
232
|
-
(
|
|
241
|
+
(accViews, { key: categoryKey }) => {
|
|
233
242
|
const categoryView = selectCategoryViews.find(
|
|
234
243
|
({ key }) => key === categoryKey
|
|
235
244
|
);
|
|
236
245
|
if (categoryView) {
|
|
237
|
-
|
|
246
|
+
accViews.push(categoryView);
|
|
238
247
|
}
|
|
239
|
-
return
|
|
248
|
+
return accViews;
|
|
240
249
|
},
|
|
241
250
|
[] as SelectCategoryView[]
|
|
242
251
|
);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
252
|
+
if (categoryViews.length > 0) {
|
|
253
|
+
accGroups.push({ categoryViews, label });
|
|
254
|
+
}
|
|
255
|
+
return accGroups;
|
|
256
|
+
}, [] as CategoryFilter[]);
|
|
246
257
|
}
|
|
247
258
|
|
|
248
259
|
/**
|
|
@@ -281,7 +292,7 @@ function renderList(
|
|
|
281
292
|
relatedListItems,
|
|
282
293
|
tabValue,
|
|
283
294
|
} = exploreState;
|
|
284
|
-
const { list, listView } = entityConfig;
|
|
295
|
+
const { getId: getRowId, list, listView } = entityConfig;
|
|
285
296
|
const { columns: columnsConfig, defaultSort } = list;
|
|
286
297
|
|
|
287
298
|
if (!exploreState || !tabValue) {
|
|
@@ -298,6 +309,7 @@ function renderList(
|
|
|
298
309
|
<TableCreator
|
|
299
310
|
columns={columnsConfig}
|
|
300
311
|
defaultSort={defaultSort}
|
|
312
|
+
getRowId={getRowId}
|
|
301
313
|
items={
|
|
302
314
|
isRelatedView && relatedListItems ? relatedListItems : listItems ?? []
|
|
303
315
|
}
|
|
@@ -11,6 +11,7 @@ import { PaletteColorOptions } from "@mui/material/styles/createPalette";
|
|
|
11
11
|
import { TypographyStyleOptions } from "@mui/material/styles/createTypography";
|
|
12
12
|
import type {} from "@mui/material/SvgIcon";
|
|
13
13
|
import type {} from "@mui/material/Tabs";
|
|
14
|
+
import type {} from "@mui/material/Toolbar";
|
|
14
15
|
import type {} from "@mui/material/Typography";
|
|
15
16
|
import { RowData } from "@tanstack/react-table";
|
|
16
17
|
import { DataLayer } from "../src/common/analytics/entities";
|
|
@@ -200,6 +201,15 @@ declare module "@mui/material/styles" {
|
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Toolbar prop options.
|
|
206
|
+
*/
|
|
207
|
+
declare module "@mui/material/Toolbar" {
|
|
208
|
+
interface ToolbarPropsVariantOverrides {
|
|
209
|
+
table: true;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
203
213
|
/**
|
|
204
214
|
* Typography variant overrides.
|
|
205
215
|
*/
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
3
|
-
import {
|
|
4
|
-
ENTITY_VIEW,
|
|
5
|
-
ExploreActionKind,
|
|
6
|
-
} from "../../../../providers/exploreState";
|
|
7
|
-
import { ToggleButtonGroup } from "../../../common/ToggleButtonGroup/toggleButtonGroup";
|
|
8
|
-
|
|
9
|
-
export const EntityViewToggle = (): JSX.Element => {
|
|
10
|
-
const { exploreDispatch } = useExploreState();
|
|
11
|
-
const toggleButtons = [
|
|
12
|
-
{
|
|
13
|
-
label: "Exact Match",
|
|
14
|
-
onToggle: () => onChange(ENTITY_VIEW.EXACT),
|
|
15
|
-
value: ENTITY_VIEW.EXACT,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
label: "Related Match",
|
|
19
|
-
onToggle: () => onChange(ENTITY_VIEW.RELATED),
|
|
20
|
-
value: ENTITY_VIEW.RELATED,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Callback fired when toggle button value changes.
|
|
26
|
-
* @param entityView - Entity list view.
|
|
27
|
-
*/
|
|
28
|
-
const onChange = (entityView: ENTITY_VIEW): void => {
|
|
29
|
-
exploreDispatch({
|
|
30
|
-
payload: entityView,
|
|
31
|
-
type: ExploreActionKind.ToggleEntityView,
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return <ToggleButtonGroup toggleButtons={toggleButtons} />;
|
|
36
|
-
};
|