@databiosphere/findable-ui 34.1.0 → 35.0.1
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 +19 -0
- package/lib/components/DataDictionary/components/Table/columns/columnDef.d.ts +6 -0
- package/lib/components/DataDictionary/components/Table/columns/columnDef.js +33 -0
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.d.ts +5 -0
- package/lib/components/DataDictionary/components/Table/columns/columnIdentifier.js +5 -0
- package/lib/components/DataDictionary/components/Table/columns/types.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.d.ts +4 -0
- package/lib/components/DataDictionary/components/Table/components/BasicCell/types.js +1 -0
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.d.ts +8 -0
- package/lib/components/Detail/components/Table/components/TableHead/tableHead.js +36 -0
- package/lib/components/Filter/components/Filter/filter.stories.d.ts +25 -0
- package/lib/components/Filter/components/Filter/filter.stories.js +42 -0
- package/lib/components/Filter/components/FilterTag/filterTag.stories.d.ts +16 -0
- package/lib/components/Filter/components/FilterTag/filterTag.stories.js +17 -0
- package/lib/components/Filter/components/Filters/filters.stories.d.ts +6 -0
- package/lib/components/Filter/components/Filters/filters.stories.js +91 -0
- package/lib/components/Index/components/Cell/cell.d.ts +7 -0
- package/lib/components/Index/components/Cell/cell.js +10 -0
- package/lib/components/Index/components/EntitiesView/constants.d.ts +1 -0
- package/lib/components/Index/components/EntitiesView/constants.js +1 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.d.ts +13 -0
- package/lib/components/Index/components/Hero/components/Summaries/summaries.stories.js +18 -0
- package/lib/components/Index/components/Hero/hero.stories.d.ts +23 -0
- package/lib/components/Index/components/Hero/hero.stories.js +22 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.d.ts +8 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.js +57 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.d.ts +4 -0
- package/lib/components/Index/components/NTag/components/Tooltip/tooltip.styles.js +10 -0
- package/lib/components/Index/components/NTag/nTag.d.ts +10 -0
- package/lib/components/Index/components/NTag/nTag.js +8 -0
- package/lib/components/Index/components/NTagCell/nTagCell.d.ts +11 -0
- package/lib/components/Index/components/NTagCell/nTagCell.js +29 -0
- package/lib/components/Index/components/NTagCell/nTagCell.stories.d.ts +5 -0
- package/lib/components/Index/components/NTagCell/nTagCell.stories.js +16 -0
- package/lib/components/Index/components/TitleCell/titleCell.d.ts +6 -0
- package/lib/components/Index/components/TitleCell/titleCell.js +10 -0
- package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +3 -0
- package/lib/components/Index/components/TitleCell/titleCell.styles.js +6 -0
- package/lib/components/Index/index.stories.d.ts +6 -0
- package/lib/components/Index/index.stories.js +26 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.d.ts +6 -0
- package/lib/components/Layout/components/BackPage/components/BackPageHero/backPageHero.stories.js +10 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.stories.js +29 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.d.ts +6 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.js +13 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +36 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.js +9 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.js +10 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +36 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.js +9 -0
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.d.ts +5 -0
- package/lib/components/Layout/components/Header/hooks/useMeasureHeader.js +19 -0
- package/lib/components/Layout/components/Outline/common/constants.d.ts +2 -0
- package/lib/components/Layout/components/Outline/common/constants.js +1 -0
- package/lib/components/Login/login.stories.d.ts +6 -0
- package/lib/components/Login/login.stories.js +31 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.d.ts +16 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +28 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.d.ts +5 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.stories.js +46 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +3 -0
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +21 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.d.ts +2 -0
- package/lib/components/Table/components/EntityViewToggle/entityViewToggle.js +37 -0
- package/lib/components/TableCreator/common/constants.d.ts +6 -0
- package/lib/components/TableCreator/common/constants.js +19 -0
- package/lib/components/TableCreator/common/entities.d.ts +5 -0
- package/lib/components/TableCreator/common/entities.js +1 -0
- package/lib/components/TableCreator/tableCreator.styles.d.ts +4 -0
- package/lib/components/TableCreator/tableCreator.styles.js +4 -0
- package/lib/components/common/Alert/alert.stories.d.ts +6 -0
- package/lib/components/common/Alert/alert.stories.js +36 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +4 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +19 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +7 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +5 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +3 -0
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +19 -0
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +10 -0
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +16 -0
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +3 -0
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +21 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.d.ts +3 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.js +6 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.d.ts +7 -0
- package/lib/components/common/Button/components/LoginButton/loginButton.styles.js +11 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.d.ts +5 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.js +10 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.d.ts +3 -0
- package/lib/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.js +9 -0
- package/lib/hooks/stateSyncManager/hook.d.ts +19 -0
- package/lib/hooks/stateSyncManager/hook.js +35 -0
- package/lib/hooks/stateSyncManager/hooks/UseBeforePopState/hook.d.ts +1 -0
- package/lib/hooks/stateSyncManager/hooks/UseBeforePopState/hook.js +21 -0
- package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/hook.d.ts +2 -0
- package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/hook.js +23 -0
- package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/types.d.ts +4 -0
- package/lib/hooks/stateSyncManager/hooks/UseStateSync/hook.d.ts +2 -0
- package/lib/hooks/stateSyncManager/hooks/UseStateSync/hook.js +40 -0
- package/lib/hooks/stateSyncManager/hooks/UseStateSync/utils.d.ts +30 -0
- package/lib/hooks/stateSyncManager/hooks/UseStateSync/utils.js +41 -0
- package/lib/hooks/stateSyncManager/types.d.ts +26 -0
- package/lib/hooks/stateSyncManager/types.js +1 -0
- package/lib/hooks/useAuthentication/common/constants.d.ts +4 -0
- package/lib/hooks/useAuthentication/common/constants.js +19 -0
- package/lib/hooks/useAuthentication/common/entities.d.ts +25 -0
- package/lib/hooks/useAuthentication/common/entities.js +11 -0
- package/lib/hooks/useAuthentication/common/utils.d.ts +15 -0
- package/lib/hooks/useAuthentication/common/utils.js +25 -0
- package/lib/hooks/useAuthentication/useAuthentication.d.ts +6 -0
- package/lib/hooks/useAuthentication/useAuthentication.js +9 -0
- package/lib/hooks/useAuthentication/useAuthenticationComplete.d.ts +6 -0
- package/lib/hooks/useAuthentication/useAuthenticationComplete.js +55 -0
- package/lib/hooks/useAuthentication/useAuthenticationForm.d.ts +20 -0
- package/lib/hooks/useAuthentication/useAuthenticationForm.js +88 -0
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.d.ts +18 -0
- package/lib/hooks/useAuthentication/useAuthenticationNIHExpiry.js +50 -0
- package/lib/hooks/useAuthentication/useAuthenticationStatus.d.ts +20 -0
- package/lib/hooks/useAuthentication/useAuthenticationStatus.js +32 -0
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.d.ts +21 -0
- package/lib/hooks/useAuthentication/useFetchGoogleProfile.js +41 -0
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.d.ts +18 -0
- package/lib/hooks/useAuthentication/useFetchTerraNIHProfile.js +62 -0
- package/lib/hooks/useAuthentication/useFetchTerraProfile.d.ts +24 -0
- package/lib/hooks/useAuthentication/useFetchTerraProfile.js +62 -0
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.d.ts +15 -0
- package/lib/hooks/useAuthentication/useFetchTerraTermsOfService.js +62 -0
- package/lib/hooks/useAuthentication/useTokenClient.d.ts +11 -0
- package/lib/hooks/useAuthentication/useTokenClient.js +29 -0
- package/lib/hooks/useAuthenticationConfig.d.ts +6 -0
- package/lib/hooks/useAuthenticationConfig.js +14 -0
- package/lib/hooks/useCategoryConfigs.d.ts +6 -0
- package/lib/hooks/useCategoryConfigs.js +17 -0
- package/lib/hooks/useEntityListRelatedView.d.ts +15 -0
- package/lib/hooks/useEntityListRelatedView.js +62 -0
- package/lib/hooks/useExploreMode.d.ts +14 -0
- package/lib/hooks/useExploreMode.js +20 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +15 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +27 -0
- package/lib/hooks/useFileManifest/useFileManifestURL.d.ts +5 -0
- package/lib/hooks/useFileManifest/useFileManifestURL.js +11 -0
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +9 -0
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +37 -0
- package/lib/hooks/useLayoutState.d.ts +6 -0
- package/lib/hooks/useLayoutState.js +9 -0
- package/lib/hooks/useMenu.d.ts +10 -0
- package/lib/hooks/useMenu.js +17 -0
- package/lib/hooks/useMenuWithPosition.d.ts +14 -0
- package/lib/hooks/useMenuWithPosition.js +33 -0
- package/lib/hooks/useSessionTimeout.d.ts +11 -0
- package/lib/hooks/useSessionTimeout.js +28 -0
- package/lib/providers/authentication.d.ts +51 -0
- package/lib/providers/authentication.js +110 -0
- package/lib/providers/exploreState/actions/stateToUrl/action.d.ts +9 -0
- package/lib/providers/exploreState/actions/stateToUrl/action.js +14 -0
- package/lib/providers/exploreState/actions/stateToUrl/dispatch.d.ts +7 -0
- package/lib/providers/exploreState/actions/{syncStateFromUrl → stateToUrl}/dispatch.js +3 -3
- package/lib/providers/exploreState/actions/stateToUrl/types.d.ts +12 -0
- package/lib/providers/exploreState/actions/stateToUrl/types.js +5 -0
- package/lib/providers/exploreState/actions/urlToState/action.d.ts +9 -0
- package/lib/providers/exploreState/actions/urlToState/action.js +38 -0
- package/lib/providers/exploreState/actions/urlToState/dispatch.d.ts +7 -0
- package/lib/providers/exploreState/actions/urlToState/dispatch.js +12 -0
- package/lib/providers/exploreState/actions/urlToState/types.d.ts +9 -0
- package/lib/providers/exploreState/actions/urlToState/types.js +1 -0
- package/lib/providers/exploreState/actions/urlToState/utils.d.ts +7 -0
- package/lib/providers/exploreState/actions/urlToState/utils.js +13 -0
- package/lib/providers/{exploreStateSync/hooks/UseMetaCommands/utils.d.ts → exploreState/entities/query/buildQuery.d.ts} +10 -14
- package/lib/providers/{exploreStateSync/hooks/UseMetaCommands/utils.js → exploreState/entities/query/buildQuery.js} +13 -21
- package/lib/providers/exploreState/entities/state.d.ts +10 -0
- package/lib/providers/exploreState/entities/state.js +36 -0
- package/lib/providers/exploreState/entities/types.d.ts +16 -0
- package/lib/providers/exploreState/entities/types.js +1 -0
- package/lib/providers/exploreState/entities.d.ts +1 -1
- package/lib/providers/exploreState/initializer/constants.js +1 -0
- package/lib/providers/exploreState/initializer/utils.js +26 -1
- package/lib/providers/exploreState.d.ts +8 -4
- package/lib/providers/exploreState.js +20 -15
- package/lib/providers/layoutState.d.ts +40 -0
- package/lib/providers/layoutState.js +47 -0
- package/lib/providers/services/provider.d.ts +14 -0
- package/lib/providers/services/provider.js +18 -0
- package/lib/providers/services/wasPop/context.d.ts +2 -0
- package/lib/providers/services/wasPop/context.js +5 -0
- package/lib/providers/services/wasPop/hook.d.ts +2 -0
- package/lib/providers/services/wasPop/hook.js +5 -0
- package/lib/providers/services/wasPop/provider.d.ts +16 -0
- package/lib/providers/services/wasPop/provider.js +30 -0
- package/lib/providers/services/wasPop/types.d.ts +6 -0
- package/lib/providers/services/wasPop/types.js +1 -0
- package/lib/services/beforePopState/popStateBus.d.ts +20 -0
- package/lib/services/beforePopState/popStateBus.js +58 -0
- package/lib/services/beforePopState/types.d.ts +11 -0
- package/lib/services/beforePopState/types.js +1 -0
- package/lib/services/beforePopState/useOnPopState.d.ts +2 -0
- package/lib/services/beforePopState/useOnPopState.js +10 -0
- package/lib/services/beforePopState/usePopStateBus.d.ts +6 -0
- package/lib/services/beforePopState/usePopStateBus.js +12 -0
- package/lib/styles/common/mixins/shadows.d.ts +3 -0
- package/lib/styles/common/mixins/shadows.js +4 -0
- package/lib/styles/common/mui/palette.d.ts +47 -0
- package/lib/styles/common/mui/palette.js +47 -0
- package/lib/theme/common/entities.d.ts +6 -0
- package/lib/theme/common/entities.js +1 -0
- package/lib/views/ExploreView/exploreView.js +15 -2
- package/lib/views/ExploreView/utils.d.ts +14 -0
- package/lib/views/ExploreView/utils.js +17 -0
- package/package.json +1 -1
- package/src/hooks/stateSyncManager/hook.ts +47 -0
- package/src/hooks/stateSyncManager/hooks/UseBeforePopState/hook.ts +30 -0
- package/src/hooks/stateSyncManager/hooks/UseMetaCommands/hook.ts +30 -0
- package/src/hooks/stateSyncManager/hooks/UseMetaCommands/types.ts +4 -0
- package/src/hooks/stateSyncManager/hooks/UseStateSync/hook.ts +52 -0
- package/src/hooks/stateSyncManager/hooks/UseStateSync/utils.ts +58 -0
- package/src/hooks/stateSyncManager/types.ts +34 -0
- package/src/providers/exploreState/actions/stateToUrl/action.ts +20 -0
- package/src/providers/exploreState/actions/stateToUrl/dispatch.ts +14 -0
- package/src/providers/exploreState/actions/stateToUrl/types.ts +15 -0
- package/src/providers/exploreState/actions/urlToState/action.ts +74 -0
- package/src/providers/exploreState/actions/urlToState/dispatch.ts +14 -0
- package/src/providers/exploreState/actions/urlToState/types.ts +11 -0
- package/src/providers/exploreState/actions/urlToState/utils.ts +18 -0
- package/src/providers/{exploreStateSync/hooks/UseMetaCommands/utils.ts → exploreState/entities/query/buildQuery.ts} +23 -26
- package/src/providers/exploreState/entities/state.ts +50 -0
- package/src/providers/exploreState/entities/types.ts +19 -0
- package/src/providers/exploreState/entities.ts +1 -1
- package/src/providers/exploreState/initializer/constants.ts +1 -0
- package/src/providers/exploreState/initializer/utils.ts +30 -1
- package/src/providers/exploreState.tsx +27 -20
- package/src/providers/services/provider.tsx +25 -0
- package/src/providers/services/wasPop/context.ts +7 -0
- package/src/providers/services/wasPop/hook.ts +7 -0
- package/src/providers/services/wasPop/provider.tsx +45 -0
- package/src/providers/services/wasPop/types.ts +7 -0
- package/src/services/beforePopState/popStateBus.ts +64 -0
- package/src/services/beforePopState/types.ts +15 -0
- package/src/services/beforePopState/useOnPopState.ts +15 -0
- package/src/services/beforePopState/usePopStateBus.ts +14 -0
- package/src/views/ExploreView/exploreView.tsx +17 -3
- package/src/views/ExploreView/utils.ts +25 -0
- package/lib/providers/exploreState/actions/syncStateFromUrl/action.d.ts +0 -10
- package/lib/providers/exploreState/actions/syncStateFromUrl/action.js +0 -25
- package/lib/providers/exploreState/actions/syncStateFromUrl/dispatch.d.ts +0 -7
- package/lib/providers/exploreState/actions/syncStateFromUrl/types.d.ts +0 -8
- package/lib/providers/exploreState/actions/syncStateFromUrl/utils.d.ts +0 -9
- package/lib/providers/exploreState/actions/syncStateFromUrl/utils.js +0 -23
- package/lib/providers/exploreState/hooks/UseBeforePopState/useBeforePopState.d.ts +0 -18
- package/lib/providers/exploreState/hooks/UseBeforePopState/useBeforePopState.js +0 -41
- package/lib/providers/exploreState/hooks/UseBeforePopState/utils.d.ts +0 -23
- package/lib/providers/exploreState/hooks/UseBeforePopState/utils.js +0 -68
- package/lib/providers/exploreStateSync/hooks/UseMetaCommands/handlers.d.ts +0 -10
- package/lib/providers/exploreStateSync/hooks/UseMetaCommands/handlers.js +0 -18
- package/lib/providers/exploreStateSync/hooks/UseMetaCommands/hook.d.ts +0 -1
- package/lib/providers/exploreStateSync/hooks/UseMetaCommands/hook.js +0 -33
- package/lib/providers/exploreStateSync/hooks/UseMetaCommands/types.d.ts +0 -11
- package/lib/providers/exploreStateSync/provider.d.ts +0 -19
- package/lib/providers/exploreStateSync/provider.js +0 -22
- package/src/providers/exploreState/actions/syncStateFromUrl/action.ts +0 -44
- package/src/providers/exploreState/actions/syncStateFromUrl/dispatch.ts +0 -16
- package/src/providers/exploreState/actions/syncStateFromUrl/types.ts +0 -13
- package/src/providers/exploreState/actions/syncStateFromUrl/utils.ts +0 -31
- package/src/providers/exploreState/hooks/UseBeforePopState/useBeforePopState.ts +0 -46
- package/src/providers/exploreState/hooks/UseBeforePopState/utils.ts +0 -93
- package/src/providers/exploreStateSync/hooks/UseMetaCommands/handlers.ts +0 -25
- package/src/providers/exploreStateSync/hooks/UseMetaCommands/hook.ts +0 -38
- package/src/providers/exploreStateSync/hooks/UseMetaCommands/types.ts +0 -13
- package/src/providers/exploreStateSync/provider.tsx +0 -29
- /package/lib/{providers/exploreState/actions/syncStateFromUrl → components/DataDictionary/components/Table/columns}/types.js +0 -0
- /package/lib/{providers/exploreStateSync → hooks/stateSyncManager}/hooks/UseMetaCommands/types.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [35.0.1](https://github.com/DataBiosphere/findable-ui/compare/v35.0.0...v35.0.1) (2025-06-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Code Refactoring
|
|
7
|
+
|
|
8
|
+
* linting ([#510](https://github.com/DataBiosphere/findable-ui/issues/510)) ([#515](https://github.com/DataBiosphere/findable-ui/issues/515)) ([52d69d7](https://github.com/DataBiosphere/findable-ui/commit/52d69d791358e822e29268b6f0c31555fc296608))
|
|
9
|
+
|
|
10
|
+
## [35.0.0](https://github.com/DataBiosphere/findable-ui/compare/v34.1.0...v35.0.0) (2025-06-03)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ⚠ BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* integrate beforepopstatebus with generic state sync for url ↔ state e.g. explore ([#510](https://github.com/DataBiosphere/findable-ui/issues/510)) (#514)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add global 'beforepopstate' bus to intercept browser back/forward navigation ([#509](https://github.com/DataBiosphere/findable-ui/issues/509)) ([#511](https://github.com/DataBiosphere/findable-ui/issues/511)) ([0b851fd](https://github.com/DataBiosphere/findable-ui/commit/0b851fd55e29568bd498cdd3184107e4f0eea880))
|
|
20
|
+
* integrate beforepopstatebus with generic state sync for url ↔ state e.g. explore ([#510](https://github.com/DataBiosphere/findable-ui/issues/510)) ([#514](https://github.com/DataBiosphere/findable-ui/issues/514)) ([91f7731](https://github.com/DataBiosphere/findable-ui/commit/91f77318c5197ee43c9e690566a1032bb2301b18))
|
|
21
|
+
|
|
3
22
|
## [34.1.0](https://github.com/DataBiosphere/findable-ui/compare/v34.0.0...v34.1.0) (2025-05-29)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -0,0 +1,6 @@
|
|
|
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>[];
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
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;
|
|
@@ -0,0 +1,25 @@
|
|
|
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;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ENTITIES_VIEW_TEST_ID = "entities-view";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ENTITIES_VIEW_TEST_ID = "entities-view";
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export interface NTagProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
Tag: ReactElement;
|
|
5
|
+
TooltipTitle: ReactElement;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated - use NTag from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag"
|
|
9
|
+
*/
|
|
10
|
+
export declare const NTag: ({ className, Tag, TooltipTitle, ...props }: NTagProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Tooltip } from "./components/Tooltip/tooltip";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated - use NTag from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/components/NTag/nTag"
|
|
5
|
+
*/
|
|
6
|
+
export const NTag = ({ className, Tag, TooltipTitle, ...props /* Spread props to allow for Mui Tooltip specific prop overrides. */ }) => {
|
|
7
|
+
return (React.createElement(Tooltip, { className: className, title: TooltipTitle, ...props }, Tag));
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypographyProps } from "../../../common/Typography/common/entities";
|
|
2
|
+
export type MetadataValue = string;
|
|
3
|
+
export interface NTagCellProps {
|
|
4
|
+
label: string;
|
|
5
|
+
TypographyProps?: TypographyProps;
|
|
6
|
+
values: MetadataValue[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated - use NTagCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/nTagCell"
|
|
10
|
+
*/
|
|
11
|
+
export declare const NTagCell: ({ label, TypographyProps, values, }: NTagCellProps) => JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Chip as MChip, Typography, } from "@mui/material";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { TEXT_BODY_SMALL_400 } from "../../../../theme/common/typography";
|
|
4
|
+
import { NTag } from "../NTag/nTag";
|
|
5
|
+
// Template constants
|
|
6
|
+
const MAX_DISPLAYABLE_VALUES = 1;
|
|
7
|
+
/**
|
|
8
|
+
* String-concatenates the specified list of metadata values to a string value, joined by a comma ",".
|
|
9
|
+
* @param metadataValues - List of metadata values.
|
|
10
|
+
* @returns the metadata values in a string, each value joined by a comma.
|
|
11
|
+
*/
|
|
12
|
+
function stringifyMetadataValues(metadataValues) {
|
|
13
|
+
return metadataValues.join(", ");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders tag for NTag component.
|
|
17
|
+
* Tooltip children require forward ref.
|
|
18
|
+
*/
|
|
19
|
+
const Tag = forwardRef(function Tag(props, ref) {
|
|
20
|
+
return React.createElement(MChip, { ref: ref, ...props });
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated - use NTagCell from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/nTagCell"
|
|
24
|
+
*/
|
|
25
|
+
export const NTagCell = ({ label, TypographyProps, values, }) => {
|
|
26
|
+
const metadataCount = values.length;
|
|
27
|
+
const showNTag = metadataCount > MAX_DISPLAYABLE_VALUES;
|
|
28
|
+
return (React.createElement(React.Fragment, null, showNTag ? (React.createElement(NTag, { Tag: React.createElement(Tag, { label: `${metadataCount} ${label}`, variant: "ntag" }), TooltipTitle: React.createElement(Typography, { display: "block", variant: TEXT_BODY_SMALL_400 }, stringifyMetadataValues(values)) })) : (values.map((value, v) => (React.createElement(Typography, { key: `${value}${v}`, variant: "inherit", ...TypographyProps }, value))))));
|
|
29
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { NTagCell } from "./nTagCell";
|
|
3
|
+
declare const _default: ComponentMeta<typeof NTagCell>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const NTagCellStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./nTagCell").NTagCellProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NTagCell } from "./nTagCell";
|
|
3
|
+
export default {
|
|
4
|
+
argTypes: {
|
|
5
|
+
label: { control: "text" },
|
|
6
|
+
values: { control: "array" },
|
|
7
|
+
},
|
|
8
|
+
component: NTagCell,
|
|
9
|
+
title: "Components/Table/Cell/NTagCell",
|
|
10
|
+
};
|
|
11
|
+
const NTagCellTemplate = (args) => (React.createElement(NTagCell, { ...args }));
|
|
12
|
+
export const NTagCellStory = NTagCellTemplate.bind({});
|
|
13
|
+
NTagCellStory.args = {
|
|
14
|
+
label: "species",
|
|
15
|
+
values: ["Homo sapiens", "Mus musculus"],
|
|
16
|
+
};
|