@databiosphere/findable-ui 35.0.3 → 35.1.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/lib/common/entities.d.ts +1 -0
- package/lib/components/DataDictionary/components/Table/hook.js +1 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +15 -2
- package/package.json +1 -1
- package/src/common/entities.ts +1 -0
- package/src/components/DataDictionary/components/Table/hook.ts +1 -0
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +17 -4
- package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +0 -6
- package/lib/components/DataDictionary/components/Table/columns/columnDef.js +0 -33
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +0 -5
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +0 -5
- package/lib/components/DataDictionary/components/Table/columns/types.d.ts +0 -2
- package/lib/components/DataDictionary/components/Table/columns/types.js +0 -1
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +0 -4
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +0 -1
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +0 -8
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +0 -36
- package/lib/components/Filter/components/Filter/filter.stories.d.ts +0 -25
- package/lib/components/Filter/components/Filter/filter.stories.js +0 -42
- package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +0 -16
- package/lib/components/Filter/components/FilterTag/filterTag.stories.js +0 -17
- package/lib/components/Filter/components/Filters/filters.stories.d.ts +0 -6
- package/lib/components/Filter/components/Filters/filters.stories.js +0 -91
- package/lib/components/Index/components/Cell/cell.d.ts +0 -7
- package/lib/components/Index/components/Cell/cell.js +0 -10
- package/lib/components/Index/components/EntitiesView/constants.d.ts +0 -1
- package/lib/components/Index/components/EntitiesView/constants.js +0 -1
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +0 -13
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +0 -18
- package/lib/components/Index/components/Hero/hero.stories.d.ts +0 -23
- package/lib/components/Index/components/Hero/hero.stories.js +0 -22
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +0 -8
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +0 -57
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +0 -4
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +0 -10
- package/lib/components/Index/components/NTag/nTag.d.ts +0 -10
- package/lib/components/Index/components/NTag/nTag.js +0 -8
- package/lib/components/Index/components/NTagCell/nTagCell.d.ts +0 -11
- package/lib/components/Index/components/NTagCell/nTagCell.js +0 -29
- package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +0 -5
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +0 -16
- package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
- package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
- package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
- package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
- package/lib/components/Index/index.stories.d.ts +0 -6
- package/lib/components/Index/index.stories.js +0 -26
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +0 -6
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +0 -10
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +0 -5
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +0 -29
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +0 -6
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +0 -13
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +0 -36
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +0 -9
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +0 -5
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +0 -10
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +0 -36
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +0 -9
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +0 -5
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +0 -19
- package/lib/components/Layout/components/Outline/common/constants.d.ts +0 -2
- package/lib/components/Layout/components/Outline/common/constants.js +0 -1
- package/lib/components/Login/login.stories.d.ts +0 -6
- package/lib/components/Login/login.stories.js +0 -31
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +0 -16
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +0 -28
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +0 -5
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +0 -46
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +0 -3
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +0 -21
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +0 -2
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +0 -37
- package/lib/components/TableCreator/common/constants.d.ts +0 -6
- package/lib/components/TableCreator/common/constants.js +0 -19
- package/lib/components/TableCreator/common/entities.d.ts +0 -5
- package/lib/components/TableCreator/common/entities.js +0 -1
- package/lib/components/TableCreator/tableCreator.styles.d.ts +0 -4
- package/lib/components/TableCreator/tableCreator.styles.js +0 -4
- package/lib/components/common/Alert/alert.stories.d.ts +0 -6
- package/lib/components/common/Alert/alert.stories.js +0 -36
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
- package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +0 -3
- package/lib/components/common/Button/components/LoginButton/loginButton.js +0 -6
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +0 -7
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +0 -11
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +0 -5
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +0 -10
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +0 -3
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +0 -9
- package/lib/hooks/useAuthentication/common/constants.d.ts +0 -4
- package/lib/hooks/useAuthentication/common/constants.js +0 -19
- package/lib/hooks/useAuthentication/common/entities.d.ts +0 -25
- package/lib/hooks/useAuthentication/common/entities.js +0 -11
- package/lib/hooks/useAuthentication/common/utils.d.ts +0 -15
- package/lib/hooks/useAuthentication/common/utils.js +0 -25
- package/lib/hooks/useAuthentication/useAuthentication.d.ts +0 -6
- package/lib/hooks/useAuthentication/useAuthentication.js +0 -9
- package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +0 -6
- package/lib/hooks/useAuthentication/useAuthenticationComplete.js +0 -55
- package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +0 -20
- package/lib/hooks/useAuthentication/useAuthenticationForm.js +0 -88
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +0 -18
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +0 -50
- package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +0 -20
- package/lib/hooks/useAuthentication/useAuthenticationStatus.js +0 -32
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +0 -21
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +0 -41
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +0 -18
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +0 -62
- package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +0 -24
- package/lib/hooks/useAuthentication/useFetchTerraProfile.js +0 -62
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +0 -15
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +0 -62
- package/lib/hooks/useAuthentication/useTokenClient.d.ts +0 -11
- package/lib/hooks/useAuthentication/useTokenClient.js +0 -29
- package/lib/hooks/useAuthenticationConfig.d.ts +0 -6
- package/lib/hooks/useAuthenticationConfig.js +0 -14
- package/lib/hooks/useCategoryConfigs.d.ts +0 -6
- package/lib/hooks/useCategoryConfigs.js +0 -17
- package/lib/hooks/useEntityListRelatedView.d.ts +0 -15
- package/lib/hooks/useEntityListRelatedView.js +0 -62
- package/lib/hooks/useExploreMode.d.ts +0 -14
- package/lib/hooks/useExploreMode.js +0 -20
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +0 -15
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +0 -27
- package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +0 -5
- package/lib/hooks/useFileManifest/useFileManifestURL.js +0 -11
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +0 -9
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +0 -37
- package/lib/hooks/useLayoutState.d.ts +0 -6
- package/lib/hooks/useLayoutState.js +0 -9
- package/lib/hooks/useMenu.d.ts +0 -10
- package/lib/hooks/useMenu.js +0 -17
- package/lib/hooks/useMenuWithPosition.d.ts +0 -14
- package/lib/hooks/useMenuWithPosition.js +0 -33
- package/lib/hooks/useSessionTimeout.d.ts +0 -11
- package/lib/hooks/useSessionTimeout.js +0 -28
- package/lib/providers/authentication.d.ts +0 -51
- package/lib/providers/authentication.js +0 -110
- package/lib/providers/layoutState.d.ts +0 -40
- package/lib/providers/layoutState.js +0 -47
- package/lib/styles/common/mixins/shadows.d.ts +0 -3
- package/lib/styles/common/mixins/shadows.js +0 -4
- package/lib/styles/common/mui/palette.d.ts +0 -47
- package/lib/styles/common/mui/palette.js +0 -47
- package/lib/theme/common/entities.d.ts +0 -6
- package/lib/theme/common/entities.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [35.1.0](https://github.com/DataBiosphere/findable-ui/compare/v35.0.3...v35.1.0) (2025-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* added handling of multiple dictionaries [#423](https://github.com/DataBiosphere/findable-ui/issues/423) ([#523](https://github.com/DataBiosphere/findable-ui/issues/523)) ([212d09a](https://github.com/DataBiosphere/findable-ui/commit/212d09a55f0699a19f5a9dd9c5f917bd46de7a14))
|
|
9
|
+
|
|
3
10
|
## [35.0.3](https://github.com/DataBiosphere/findable-ui/compare/v35.0.2...v35.0.3) (2025-06-04)
|
|
4
11
|
|
|
5
12
|
|
package/lib/common/entities.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export interface DataDictionary<T extends RowData = Attribute> {
|
|
|
65
65
|
export interface DataDictionaryConfig<T extends RowData = Attribute> {
|
|
66
66
|
columnDefs: ColumnDef<T, T[keyof T]>[];
|
|
67
67
|
dataDictionary: DataDictionary<T>;
|
|
68
|
+
path: string;
|
|
68
69
|
tableOptions?: Omit<TableOptions<T>, "columns" | "data" | "getCoreRowModel">;
|
|
69
70
|
}
|
|
70
71
|
/**
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
import { useRouter } from "next/router";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
import { useConfig } from "../../../../hooks/useConfig";
|
|
3
4
|
import { buildClassesOutline } from "../../components/Outline/utils";
|
|
4
5
|
import { useTable } from "../../components/Table/hook";
|
|
5
6
|
export const useDataDictionary = () => {
|
|
6
7
|
const { config: { dataDictionaries: dataDictionaryConfigs }, } = useConfig();
|
|
7
|
-
//
|
|
8
|
-
|
|
8
|
+
// Dynamic paths must be resolved at this point otherwise the initial settings
|
|
9
|
+
// passed to useTable on subsequent renders will be ignored (as the table will have
|
|
10
|
+
// already been initialized).
|
|
11
|
+
const router = useRouter();
|
|
12
|
+
const query = router.query;
|
|
13
|
+
const { dictionary } = query;
|
|
14
|
+
// Get dictionary config by matching the current path with the data dictionary path
|
|
15
|
+
const dataDictionaryConfig = useMemo(() => {
|
|
16
|
+
if (!dataDictionaryConfigs?.length)
|
|
17
|
+
return undefined;
|
|
18
|
+
// Find the data dictionary with a path that matches the current route
|
|
19
|
+
// We check if the current path starts with the dictionary path to handle nested routes
|
|
20
|
+
return dataDictionaryConfigs.find((config) => config.path === dictionary);
|
|
21
|
+
}, [dataDictionaryConfigs, dictionary]);
|
|
9
22
|
// Get configured dictionary classes, column definitions and table options.
|
|
10
23
|
const { classes, columnDefs, tableOptions, title } = useMemo(() => {
|
|
11
24
|
return {
|
package/package.json
CHANGED
package/src/common/entities.ts
CHANGED
|
@@ -74,6 +74,7 @@ export interface DataDictionary<T extends RowData = Attribute> {
|
|
|
74
74
|
export interface DataDictionaryConfig<T extends RowData = Attribute> {
|
|
75
75
|
columnDefs: ColumnDef<T, T[keyof T]>[];
|
|
76
76
|
dataDictionary: DataDictionary<T>;
|
|
77
|
+
path: string; // Used as a key to find the dictionary to display
|
|
77
78
|
tableOptions?: Omit<TableOptions<T>, "columns" | "data" | "getCoreRowModel">;
|
|
78
79
|
}
|
|
79
80
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RowData } from "@tanstack/react-table";
|
|
2
|
+
import { useRouter } from "next/router";
|
|
2
3
|
import { useMemo } from "react";
|
|
3
4
|
import { Attribute, DataDictionaryConfig } from "../../../../common/entities";
|
|
4
5
|
import { useConfig } from "../../../../hooks/useConfig";
|
|
@@ -12,11 +13,23 @@ export const useDataDictionary = <
|
|
|
12
13
|
const {
|
|
13
14
|
config: { dataDictionaries: dataDictionaryConfigs },
|
|
14
15
|
} = useConfig();
|
|
16
|
+
// Dynamic paths must be resolved at this point otherwise the initial settings
|
|
17
|
+
// passed to useTable on subsequent renders will be ignored (as the table will have
|
|
18
|
+
// already been initialized).
|
|
19
|
+
const router = useRouter();
|
|
20
|
+
const query = router.query;
|
|
21
|
+
const { dictionary } = query;
|
|
15
22
|
|
|
16
|
-
// Get dictionary config
|
|
17
|
-
const dataDictionaryConfig =
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
// Get dictionary config by matching the current path with the data dictionary path
|
|
24
|
+
const dataDictionaryConfig = useMemo(() => {
|
|
25
|
+
if (!dataDictionaryConfigs?.length) return undefined;
|
|
26
|
+
|
|
27
|
+
// Find the data dictionary with a path that matches the current route
|
|
28
|
+
// We check if the current path starts with the dictionary path to handle nested routes
|
|
29
|
+
return dataDictionaryConfigs.find(
|
|
30
|
+
(config) => config.path === dictionary
|
|
31
|
+
) as DataDictionaryConfig<T> | undefined;
|
|
32
|
+
}, [dataDictionaryConfigs, dictionary]);
|
|
20
33
|
|
|
21
34
|
// Get configured dictionary classes, column definitions and table options.
|
|
22
35
|
const { classes, columnDefs, tableOptions, title } = useMemo(() => {
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ColumnDef } from "@tanstack/react-table";
|
|
2
|
-
import { Attribute } from "../../../../../common/entities";
|
|
3
|
-
import { COLUMN_IDENTIFIER } from "./columnIdentifier";
|
|
4
|
-
import { AttributeValue } from "./types";
|
|
5
|
-
export declare const COLUMN_DEF: Record<keyof typeof COLUMN_IDENTIFIER, ColumnDef<Attribute, AttributeValue>>;
|
|
6
|
-
export declare const COLUMN_DEFS: ColumnDef<Attribute, AttributeValue>[];
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BasicCell } from "../components/BasicCell/basicCell";
|
|
2
|
-
import { COLUMN_IDENTIFIER } from "./columnIdentifier";
|
|
3
|
-
const COLUMN_DEF_DESCRIPTION = {
|
|
4
|
-
accessorFn: (row) => row.description,
|
|
5
|
-
cell: (props) => BasicCell({ ...props }),
|
|
6
|
-
header: "Description",
|
|
7
|
-
id: COLUMN_IDENTIFIER.DESCRIPTION,
|
|
8
|
-
meta: { width: { max: "2fr", min: "480px" } },
|
|
9
|
-
};
|
|
10
|
-
const COLUMN_DEF_KEY = {
|
|
11
|
-
accessorFn: (row) => row.key,
|
|
12
|
-
cell: (props) => BasicCell({ ...props }),
|
|
13
|
-
header: "Key",
|
|
14
|
-
id: COLUMN_IDENTIFIER.KEY,
|
|
15
|
-
meta: { width: { max: "1fr", min: "180px" } },
|
|
16
|
-
};
|
|
17
|
-
const COLUMN_DEF_LABEL = {
|
|
18
|
-
accessorFn: (row) => row.label,
|
|
19
|
-
cell: (props) => BasicCell({ ...props }),
|
|
20
|
-
header: "Label",
|
|
21
|
-
id: COLUMN_IDENTIFIER.LABEL,
|
|
22
|
-
meta: { width: { max: "1fr", min: "200px" } },
|
|
23
|
-
};
|
|
24
|
-
export const COLUMN_DEF = {
|
|
25
|
-
DESCRIPTION: COLUMN_DEF_DESCRIPTION,
|
|
26
|
-
KEY: COLUMN_DEF_KEY,
|
|
27
|
-
LABEL: COLUMN_DEF_LABEL,
|
|
28
|
-
};
|
|
29
|
-
export const COLUMN_DEFS = [
|
|
30
|
-
COLUMN_DEF.LABEL,
|
|
31
|
-
COLUMN_DEF.KEY,
|
|
32
|
-
COLUMN_DEF.DESCRIPTION,
|
|
33
|
-
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Table } from "@tanstack/react-table";
|
|
3
|
-
import { ROW_DIRECTION } from "../../../../../Table/common/entities";
|
|
4
|
-
export interface TableBodyProps<T> {
|
|
5
|
-
rowDirection: ROW_DIRECTION;
|
|
6
|
-
tableInstance: Table<T>;
|
|
7
|
-
}
|
|
8
|
-
export declare const TableHead: <T extends object>({ rowDirection, tableInstance, }: TableBodyProps<T>) => JSX.Element;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.TableHead = void 0;
|
|
27
|
-
const material_1 = require("@mui/material");
|
|
28
|
-
const react_table_1 = require("@tanstack/react-table");
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const entities_1 = require("../../../../../Table/common/entities");
|
|
31
|
-
const TableHead = ({ rowDirection, tableInstance, }) => {
|
|
32
|
-
return (react_1.default.createElement(react_1.Fragment, null, rowDirection === entities_1.ROW_DIRECTION.DEFAULT &&
|
|
33
|
-
tableInstance.getHeaderGroups().map((headerGroup) => (react_1.default.createElement(material_1.TableHead, { key: headerGroup.id },
|
|
34
|
-
react_1.default.createElement(material_1.TableRow, null, headerGroup.headers.map((header) => (react_1.default.createElement(material_1.TableCell, { key: header.id }, (0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext()))))))))));
|
|
35
|
-
};
|
|
36
|
-
exports.TableHead = TableHead;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
declare const meta: {
|
|
4
|
-
argTypes: {
|
|
5
|
-
tags: {
|
|
6
|
-
control: {
|
|
7
|
-
disable: true;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
component: ({ categorySection, categoryView, closeAncestor, isFilterDrawer, onFilter, tags, trackFilterOpened, }: import("./filter").FilterProps) => JSX.Element;
|
|
12
|
-
decorators: ((Story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
13
|
-
categorySection?: string | undefined;
|
|
14
|
-
categoryView: import("../../../../common/entities").SelectCategoryView;
|
|
15
|
-
closeAncestor?: (() => void) | undefined;
|
|
16
|
-
isFilterDrawer: boolean;
|
|
17
|
-
onFilter: import("../../../../hooks/useCategoryFilter").OnFilterFn;
|
|
18
|
-
tags?: React.ReactNode;
|
|
19
|
-
trackFilterOpened?: import("../../../../config/entities").TrackFilterOpenedFunction | undefined;
|
|
20
|
-
}>) => JSX.Element)[];
|
|
21
|
-
title: string;
|
|
22
|
-
};
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
export declare const FilterStory: Story;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Filter } from "./filter";
|
|
3
|
-
const meta = {
|
|
4
|
-
argTypes: {
|
|
5
|
-
tags: { control: { disable: true } },
|
|
6
|
-
},
|
|
7
|
-
component: Filter,
|
|
8
|
-
decorators: [
|
|
9
|
-
(Story) => (React.createElement("div", { style: { padding: "8px 12px 8px 16px", width: 264 } },
|
|
10
|
-
React.createElement(Story, null))),
|
|
11
|
-
],
|
|
12
|
-
title: "Components/Filter/Filter",
|
|
13
|
-
};
|
|
14
|
-
export default meta;
|
|
15
|
-
const onFilter = () => {
|
|
16
|
-
// onFilter function
|
|
17
|
-
};
|
|
18
|
-
export const FilterStory = {
|
|
19
|
-
args: {
|
|
20
|
-
categoryView: {
|
|
21
|
-
isDisabled: false,
|
|
22
|
-
key: "genusSpecies",
|
|
23
|
-
label: "Genus Species",
|
|
24
|
-
values: [
|
|
25
|
-
{
|
|
26
|
-
count: 12,
|
|
27
|
-
key: "homoSapiens",
|
|
28
|
-
label: "Homo sapiens",
|
|
29
|
-
selected: false,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
count: 6,
|
|
33
|
-
key: "musMusculus",
|
|
34
|
-
label: "Mus musculus",
|
|
35
|
-
selected: false,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
isFilterDrawer: false,
|
|
40
|
-
onFilter,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react";
|
|
2
|
-
declare const meta: {
|
|
3
|
-
argTypes: {
|
|
4
|
-
label: {
|
|
5
|
-
control: "text";
|
|
6
|
-
};
|
|
7
|
-
superseded: {
|
|
8
|
-
control: "boolean";
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
component: ({ label, onRemove, superseded, }: import("./filterTag").FilterTagProps) => JSX.Element;
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
export default meta;
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
export declare const FilterTagStory: Story;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FilterTag } from "./filterTag";
|
|
2
|
-
const meta = {
|
|
3
|
-
argTypes: {
|
|
4
|
-
label: { control: "text" },
|
|
5
|
-
superseded: { control: "boolean" },
|
|
6
|
-
},
|
|
7
|
-
component: FilterTag,
|
|
8
|
-
title: "Components/Filter/FilterTag",
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const FilterTagStory = {
|
|
12
|
-
args: {
|
|
13
|
-
label: "Male",
|
|
14
|
-
onRemove: () => { },
|
|
15
|
-
superseded: false,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FilterMenuStory } from "../FilterMenu/filterMenu.stories";
|
|
3
|
-
import { Filters } from "./filters";
|
|
4
|
-
export default {
|
|
5
|
-
argTypes: {
|
|
6
|
-
categories: { control: { disable: true } },
|
|
7
|
-
onFilter: { control: { disable: true } },
|
|
8
|
-
},
|
|
9
|
-
component: Filters,
|
|
10
|
-
decorators: [
|
|
11
|
-
(Story) => (React.createElement("div", { style: { width: 264 } },
|
|
12
|
-
React.createElement(Story, null))),
|
|
13
|
-
],
|
|
14
|
-
title: "Components/Filter/Filters",
|
|
15
|
-
};
|
|
16
|
-
const onFilter = () => {
|
|
17
|
-
// onFilter function
|
|
18
|
-
};
|
|
19
|
-
const defaultValues = [
|
|
20
|
-
{
|
|
21
|
-
count: 1,
|
|
22
|
-
key: "item1",
|
|
23
|
-
label: "Item 1",
|
|
24
|
-
selected: false,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
count: 10,
|
|
28
|
-
key: "item2",
|
|
29
|
-
label: "Item 2",
|
|
30
|
-
selected: false,
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
export const FiltersStory = {
|
|
34
|
-
args: {
|
|
35
|
-
categoryFilters: [
|
|
36
|
-
{
|
|
37
|
-
categoryViews: [
|
|
38
|
-
{
|
|
39
|
-
isDisabled: false,
|
|
40
|
-
key: "genusSpecies",
|
|
41
|
-
label: "Genus Species",
|
|
42
|
-
values: [
|
|
43
|
-
{
|
|
44
|
-
count: 12,
|
|
45
|
-
key: "homoSapiens",
|
|
46
|
-
label: "Homo sapiens",
|
|
47
|
-
selected: false,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
count: 6,
|
|
51
|
-
key: "musMusculus",
|
|
52
|
-
label: "Mus musculus",
|
|
53
|
-
selected: false,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
categoryViews: [
|
|
61
|
-
{
|
|
62
|
-
isDisabled: false,
|
|
63
|
-
key: "donorDisease",
|
|
64
|
-
label: "Donor Disease",
|
|
65
|
-
values: FilterMenuStory.args?.values || defaultValues,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
isDisabled: true,
|
|
69
|
-
key: "anatomicalEntity",
|
|
70
|
-
label: "Anatomical Entity",
|
|
71
|
-
values: [
|
|
72
|
-
{
|
|
73
|
-
count: 12,
|
|
74
|
-
key: "oralCavity",
|
|
75
|
-
label: "oral cavity",
|
|
76
|
-
selected: true,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
count: 6,
|
|
80
|
-
key: "pancreas",
|
|
81
|
-
label: "pancreas",
|
|
82
|
-
selected: false,
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
onFilter: onFilter,
|
|
90
|
-
},
|
|
91
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface CellProps {
|
|
2
|
-
value?: number | string | string[];
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated - use BasicCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"
|
|
6
|
-
*/
|
|
7
|
-
export declare const Cell: ({ value }: CellProps) => JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated - use BasicCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"
|
|
4
|
-
*/
|
|
5
|
-
export const Cell = ({ value = "Unspecified" }) => {
|
|
6
|
-
if (typeof value === "string" || typeof value === "number") {
|
|
7
|
-
return React.createElement("div", null, value);
|
|
8
|
-
}
|
|
9
|
-
return (React.createElement(React.Fragment, null, value.map((v) => (React.createElement("div", { key: v }, v)))));
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ENTITIES_VIEW_TEST_ID = "entities-view";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const ENTITIES_VIEW_TEST_ID = "entities-view";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react";
|
|
2
|
-
declare const meta: {
|
|
3
|
-
argTypes: {
|
|
4
|
-
summaries: {
|
|
5
|
-
control: "object";
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
component: ({ summaries }: import("./summaries").SummariesProps) => JSX.Element;
|
|
9
|
-
title: string;
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const SummariesStory: Story;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Summaries } from "./summaries";
|
|
2
|
-
const meta = {
|
|
3
|
-
argTypes: {
|
|
4
|
-
summaries: { control: "object" },
|
|
5
|
-
},
|
|
6
|
-
component: Summaries,
|
|
7
|
-
title: "Components/Summary",
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
export const SummariesStory = {
|
|
11
|
-
args: {
|
|
12
|
-
summaries: [
|
|
13
|
-
{ count: "1", label: "Species" },
|
|
14
|
-
{ count: "1.1k", label: "Donors" },
|
|
15
|
-
{ count: "508.5k", label: "Files" },
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react";
|
|
2
|
-
declare const meta: {
|
|
3
|
-
argTypes: {
|
|
4
|
-
Summaries: {
|
|
5
|
-
table: {
|
|
6
|
-
disable: true;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
title: {
|
|
10
|
-
table: {
|
|
11
|
-
disable: true;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
component: ({ SideBarButton, Summaries, title, }: import("./hero").HeroProps) => JSX.Element;
|
|
16
|
-
parameters: {
|
|
17
|
-
layout: string;
|
|
18
|
-
};
|
|
19
|
-
title: string;
|
|
20
|
-
};
|
|
21
|
-
export default meta;
|
|
22
|
-
type Story = StoryObj<typeof meta>;
|
|
23
|
-
export declare const HeroStory: Story;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Summaries } from "./components/Summaries/summaries";
|
|
3
|
-
import { SummariesStory } from "./components/Summaries/summaries.stories";
|
|
4
|
-
import { Hero } from "./hero";
|
|
5
|
-
const meta = {
|
|
6
|
-
argTypes: {
|
|
7
|
-
Summaries: { table: { disable: true } },
|
|
8
|
-
title: { table: { disable: true } },
|
|
9
|
-
},
|
|
10
|
-
component: Hero,
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: "fullscreen",
|
|
13
|
-
},
|
|
14
|
-
title: "Components/Hero/ExploreView",
|
|
15
|
-
};
|
|
16
|
-
export default meta;
|
|
17
|
-
export const HeroStory = {
|
|
18
|
-
args: {
|
|
19
|
-
Summaries: React.createElement(Summaries, { ...SummariesStory.args }),
|
|
20
|
-
title: "Data Explorer",
|
|
21
|
-
},
|
|
22
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TooltipProps as MTooltipProps } from "@mui/material";
|
|
2
|
-
export interface TooltipProps extends MTooltipProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated - use Tooltip from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip"
|
|
7
|
-
*/
|
|
8
|
-
export declare const Tooltip: ({ children, className, title, ...props }: TooltipProps) => JSX.Element;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Tooltip as MTooltip, } from "@mui/material";
|
|
2
|
-
import { detectOverflow } from "@popperjs/core";
|
|
3
|
-
import React, { useMemo, useState } from "react";
|
|
4
|
-
import { TooltipContent } from "./tooltip.styles";
|
|
5
|
-
const DEFAULT_FLIP_MODIFIER = {
|
|
6
|
-
enabled: true,
|
|
7
|
-
name: "flip",
|
|
8
|
-
options: {
|
|
9
|
-
fallbackPlacements: ["bottom", "right", "left"],
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
const DEFAULT_PREVENT_OVERFLOW_MODIFIER = {
|
|
13
|
-
enabled: true,
|
|
14
|
-
name: "preventOverflow",
|
|
15
|
-
options: {
|
|
16
|
-
padding: 16,
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated - use Tooltip from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/components/Tooltip/tooltip"
|
|
21
|
-
*/
|
|
22
|
-
export const Tooltip = ({ children, className, title, ...props /* Spread props to allow for Mui Tooltip specific prop overrides. */ }) => {
|
|
23
|
-
const [maxHeight, setMaxHeight] = useState();
|
|
24
|
-
const modifiers = useMemo(() => [
|
|
25
|
-
{
|
|
26
|
-
enabled: true,
|
|
27
|
-
fn: ({ state }) => setMaxHeight(calculateMaxHeight(state)),
|
|
28
|
-
name: "maxHeight",
|
|
29
|
-
phase: "main",
|
|
30
|
-
requiresIfExists: ["offset"],
|
|
31
|
-
},
|
|
32
|
-
DEFAULT_FLIP_MODIFIER,
|
|
33
|
-
DEFAULT_PREVENT_OVERFLOW_MODIFIER,
|
|
34
|
-
], []);
|
|
35
|
-
return (React.createElement(MTooltip, { arrow: true, className: className, onClose: () => setMaxHeight(undefined), slotProps: {
|
|
36
|
-
popper: { modifiers },
|
|
37
|
-
tooltip: { style: { display: "flex", maxHeight, padding: 0 } },
|
|
38
|
-
}, title: React.createElement(TooltipContent, null, title), ...props }, children));
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Calculate the max height of the tooltip based on the current popper modifier state.
|
|
42
|
-
* @param state - Popper modifier state.
|
|
43
|
-
* @returns tooltip maximum height.
|
|
44
|
-
*/
|
|
45
|
-
function calculateMaxHeight(state) {
|
|
46
|
-
const overflow = detectOverflow(state);
|
|
47
|
-
const { placement } = state;
|
|
48
|
-
if (placement === "left" || placement === "right") {
|
|
49
|
-
return window.innerHeight - 32;
|
|
50
|
-
}
|
|
51
|
-
if (placement === "top") {
|
|
52
|
-
return state.rects.popper.height - overflow.top - 24;
|
|
53
|
-
}
|
|
54
|
-
if (placement === "bottom") {
|
|
55
|
-
return state.rects.popper.height - overflow.bottom - 24;
|
|
56
|
-
}
|
|
57
|
-
}
|