@databiosphere/findable-ui 35.2.0 → 37.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +27 -0
- package/lib/common/entities.d.ts +2 -3
- package/lib/components/DataDictionary/components/Entities/constants.d.ts +3 -1
- package/lib/components/DataDictionary/components/Entities/constants.js +6 -2
- package/lib/components/DataDictionary/components/Entities/entities.js +6 -2
- package/lib/components/DataDictionary/components/Entities/entities.styles.d.ts +3 -0
- package/lib/components/DataDictionary/components/Entities/entities.styles.js +5 -0
- package/lib/components/DataDictionary/components/Entity/entity.styles.js +1 -8
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.d.ts +4 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.js +15 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.d.ts +7 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.js +7 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.js +6 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.d.ts +6 -0
- package/lib/components/DataDictionary/components/Filters/filters.js +2 -0
- package/lib/components/DataDictionary/components/Filters/filters.styles.js +3 -3
- package/lib/components/DataDictionary/components/Filters/stories/constants.d.ts +1 -0
- package/lib/components/DataDictionary/components/Filters/stories/constants.js +16 -0
- package/lib/components/DataDictionary/components/Filters/stories/filters.stories.js +11 -3
- package/lib/components/DataDictionary/components/Filters/stories/hook.d.ts +4 -0
- package/lib/components/DataDictionary/components/Filters/stories/hook.js +4 -0
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.d.ts +2 -1
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.js +4 -4
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +1 -4
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/types.d.ts +4 -2
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.d.ts +2 -1
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.js +4 -4
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.js +4 -1
- package/lib/components/DataDictionary/components/Table/hook.d.ts +2 -2
- package/lib/components/DataDictionary/components/Table/hook.js +8 -4
- package/lib/components/DataDictionary/components/Table/options/columnFilters/constants.js +2 -1
- package/lib/components/DataDictionary/components/Table/options/columnFilters/hook.d.ts +2 -5
- package/lib/components/DataDictionary/components/Table/options/columnFilters/hook.js +8 -6
- package/lib/components/DataDictionary/components/Table/options/globalFilter/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/options/globalFilter/constants.js +5 -0
- package/lib/components/DataDictionary/components/Table/options/globalFilter/hook.d.ts +3 -0
- package/lib/components/DataDictionary/components/Table/options/globalFilter/hook.js +16 -0
- package/lib/components/DataDictionary/components/Table/options/hook.js +7 -5
- package/lib/components/DataDictionary/components/Table/options/pagination/constants.d.ts +2 -0
- package/lib/components/DataDictionary/components/Table/options/pagination/constants.js +3 -0
- package/lib/components/DataDictionary/dataDictionary.d.ts +1 -1
- package/lib/components/DataDictionary/dataDictionary.js +31 -12
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.d.ts +4 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.js +27 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.d.ts +7 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/types.js +1 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.d.ts +6 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.js +8 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/hook.d.ts +2 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/hook.js +17 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/types.d.ts +7 -0
- package/lib/components/DataDictionary/hooks/UseMeasureFilters/types.js +1 -0
- package/lib/components/DataDictionary/types.d.ts +1 -0
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +2 -1
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +3 -1
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +2 -1
- package/lib/components/Export/components/ExportToTerra/exportToTerra.js +3 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +2 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.js +3 -1
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.d.ts +2 -0
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.js +8 -0
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.d.ts +3 -0
- package/lib/components/Filter/components/FilterCountChip/filterCountChip.styles.js +18 -0
- package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.d.ts +6 -0
- package/lib/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.js +6 -0
- package/lib/components/Filter/components/FilterCountChip/types.d.ts +5 -0
- package/lib/components/Filter/components/FilterCountChip/types.js +1 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Table/columnDef/globalFilter/constants.d.ts +2 -0
- package/lib/components/Table/columnDef/globalFilter/constants.js +4 -0
- package/lib/components/Table/columnDef/globalFilter/filterFn.d.ts +13 -0
- package/lib/components/Table/columnDef/globalFilter/filterFn.js +24 -0
- package/lib/components/Table/columnDef/globalFilter/types.d.ts +4 -0
- package/lib/components/Table/columnDef/globalFilter/types.js +1 -0
- package/lib/components/Table/columnDef/globalFilter/utils.d.ts +23 -0
- package/lib/components/Table/columnDef/globalFilter/utils.js +57 -0
- package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.d.ts +2 -1
- package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.d.ts +3 -0
- package/lib/components/Table/components/TableCell/components/RankedCell/rankedCell.js +25 -0
- package/lib/components/Table/components/TableCell/components/RankedCell/utils.d.ts +30 -0
- package/lib/components/Table/components/TableCell/components/RankedCell/utils.js +64 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.js +9 -5
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.d.ts +9 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.js +20 -1
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.d.ts +3 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.js +9 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.d.ts +5 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.js +24 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.d.ts +3 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.js +10 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.d.ts +6 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.js +17 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.d.ts +6 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.js +1 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.d.ts +2 -1
- package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.js +6 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/types.d.ts +3 -2
- package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.d.ts +2 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/constants.js +6 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.d.ts +3 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/globalFilter.js +10 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/types.d.ts +6 -0
- package/lib/components/Table/components/TableFeatures/GlobalFilter/types.js +1 -0
- package/lib/components/Table/coreOptions/state/pagination/constants.d.ts +2 -0
- package/lib/components/Table/coreOptions/state/pagination/constants.js +6 -0
- package/lib/components/Table/coreOptions/state/pagination/utils.d.ts +9 -0
- package/lib/components/Table/coreOptions/state/pagination/utils.js +18 -0
- package/lib/components/common/AnchorLink/anchorLink.js +4 -2
- package/lib/components/common/AnchorLink/anchorLink.styles.d.ts +1 -1
- package/lib/components/common/AnchorLink/anchorLink.styles.js +1 -1
- package/lib/components/common/CustomIcon/components/SearchIcon/searchIcon.d.ts +2 -2
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.d.ts +2 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.js +13 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.d.ts +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.js +11 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.d.ts +3 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.js +10 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.d.ts +4 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.js +1 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.d.ts +2 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.js +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.d.ts +1 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.js +9 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.d.ts +2 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/components/constants.js +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.d.ts +5 -0
- package/lib/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.js +5 -0
- package/lib/components/common/OutlinedInput/outlinedInput.styles.d.ts +7 -0
- package/lib/components/common/OutlinedInput/outlinedInput.styles.js +18 -0
- package/lib/hooks/stateSyncManager/hooks/UseMetaCommands/hook.js +2 -2
- package/lib/hooks/stateSyncManager/hooks/UseStateSync/hook.js +3 -3
- package/lib/hooks/stateSyncManager/types.d.ts +1 -1
- package/lib/hooks/useFileManifest/useFileManifestFileCount.d.ts +10 -0
- package/lib/hooks/useFileManifest/useFileManifestFileCount.js +44 -0
- package/lib/hooks/useRequestManifest/utils.d.ts +21 -14
- package/lib/hooks/useRequestManifest/utils.js +33 -21
- package/lib/mocks/useRequestFileManifest.mocks.js +2 -0
- package/lib/providers/dataDictionary/context.d.ts +2 -0
- package/lib/providers/dataDictionary/context.js +4 -0
- package/lib/providers/dataDictionary/hook.d.ts +6 -0
- package/lib/providers/dataDictionary/hook.js +9 -0
- package/lib/providers/dataDictionary/types.d.ts +3 -0
- package/lib/providers/dataDictionary/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/action.js +12 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/dispatch.d.ts +6 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/dispatch.js +11 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/types.d.ts +6 -0
- package/lib/providers/dataDictionaryState/actions/clearMeta/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/action.js +14 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/types.d.ts +12 -0
- package/lib/providers/dataDictionaryState/actions/stateToUrl/types.js +5 -0
- package/lib/providers/dataDictionaryState/actions/types.d.ts +13 -0
- package/lib/providers/dataDictionaryState/actions/types.js +8 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/action.js +18 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/types.d.ts +10 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/utils.d.ts +11 -0
- package/lib/providers/dataDictionaryState/actions/updateColumnFilters/utils.js +27 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/action.js +19 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/types.d.ts +10 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/types.js +1 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/utils.d.ts +17 -0
- package/lib/providers/dataDictionaryState/actions/updateGlobalFilter/utils.js +36 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/action.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/action.js +20 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/dispatch.d.ts +7 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/dispatch.js +12 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/types.d.ts +9 -0
- package/lib/providers/dataDictionaryState/actions/urlToState/types.js +1 -0
- package/lib/providers/dataDictionaryState/context.d.ts +2 -0
- package/lib/providers/dataDictionaryState/context.js +6 -0
- package/lib/providers/dataDictionaryState/dictionaries/constants.d.ts +4 -0
- package/lib/providers/dataDictionaryState/dictionaries/constants.js +4 -0
- package/lib/providers/dataDictionaryState/dictionaries/state.d.ts +11 -0
- package/lib/providers/dataDictionaryState/dictionaries/state.js +29 -0
- package/lib/providers/dataDictionaryState/dictionaries/types.d.ts +9 -0
- package/lib/providers/dataDictionaryState/dictionaries/types.js +1 -0
- package/lib/providers/dataDictionaryState/dictionaries/utils.d.ts +14 -0
- package/lib/providers/dataDictionaryState/dictionaries/utils.js +20 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.d.ts +2 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.js +6 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.d.ts +4 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.js +1 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.d.ts +2 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.js +9 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.d.ts +6 -0
- package/lib/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.js +9 -0
- package/lib/providers/dataDictionaryState/initializer/constants.d.ts +2 -0
- package/lib/providers/dataDictionaryState/initializer/constants.js +4 -0
- package/lib/providers/dataDictionaryState/initializer/initializer.d.ts +9 -0
- package/lib/providers/dataDictionaryState/initializer/initializer.js +17 -0
- package/lib/providers/dataDictionaryState/initializer/utils.d.ts +8 -0
- package/lib/providers/dataDictionaryState/initializer/utils.js +29 -0
- package/lib/providers/dataDictionaryState/provider.d.ts +4 -0
- package/lib/providers/dataDictionaryState/provider.js +7 -0
- package/lib/providers/dataDictionaryState/reducer.d.ts +9 -0
- package/lib/providers/dataDictionaryState/reducer.js +34 -0
- package/lib/providers/dataDictionaryState/types.d.ts +15 -0
- package/lib/providers/dataDictionaryState/types.js +1 -0
- package/lib/providers/fileManifestState/constants.js +1 -0
- package/lib/providers/fileManifestState.d.ts +16 -1
- package/lib/providers/fileManifestState.js +6 -0
- package/lib/styles/common/mui/iconButton.d.ts +11 -0
- package/lib/styles/common/mui/iconButton.js +29 -0
- package/lib/styles/common/mui/inputAdornment.d.ts +9 -0
- package/lib/styles/common/mui/inputAdornment.js +13 -0
- package/lib/styles/common/mui/outlinedInput.d.ts +7 -0
- package/lib/styles/common/mui/outlinedInput.js +7 -0
- package/lib/theme/common/components.js +122 -16
- package/lib/theme/components/muiButtonGroup.js +4 -0
- package/lib/theme/components/muiTableCell.js +6 -0
- package/lib/utils/parseJsonQueryParam.d.ts +14 -0
- package/lib/utils/parseJsonQueryParam.js +25 -0
- package/lib/utils/stateToUrlQuery.d.ts +15 -0
- package/lib/utils/stateToUrlQuery.js +35 -0
- package/lib/views/DataDictionaryView/dataDictionaryView.d.ts +2 -2
- package/lib/views/DataDictionaryView/dataDictionaryView.js +16 -2
- package/lib/views/DataDictionaryView/types.d.ts +4 -0
- package/lib/views/DataDictionaryView/types.js +1 -0
- package/lib/views/DataDictionaryView/utils.d.ts +12 -0
- package/lib/views/DataDictionaryView/utils.js +17 -0
- package/lib/views/ExploreView/utils.d.ts +1 -1
- package/lib/views/ExploreView/utils.js +1 -1
- package/package.json +2 -1
- package/src/common/entities.ts +2 -3
- package/src/components/DataDictionary/components/Entities/constants.ts +9 -3
- package/src/components/DataDictionary/components/Entities/entities.styles.ts +6 -0
- package/src/components/DataDictionary/components/Entities/entities.tsx +7 -2
- package/src/components/DataDictionary/components/Entity/entity.styles.ts +1 -10
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.styles.ts +8 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx +33 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/constants.ts +8 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/types.ts +8 -0
- package/src/components/DataDictionary/components/Filters/filters.styles.ts +3 -3
- package/src/components/DataDictionary/components/Filters/filters.tsx +2 -0
- package/src/components/DataDictionary/components/Filters/stories/constants.ts +18 -0
- package/src/components/DataDictionary/components/Filters/stories/filters.stories.tsx +15 -3
- package/src/components/DataDictionary/components/Filters/stories/hook.ts +8 -0
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +1 -5
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx +13 -7
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/types.ts +4 -2
- package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts +4 -1
- package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsx +13 -7
- package/src/components/DataDictionary/components/Table/hook.ts +10 -6
- package/src/components/DataDictionary/components/Table/options/columnFilters/constants.ts +2 -1
- package/src/components/DataDictionary/components/Table/options/columnFilters/hook.ts +13 -12
- package/src/components/DataDictionary/components/Table/options/globalFilter/constants.ts +14 -0
- package/src/components/DataDictionary/components/Table/options/globalFilter/hook.ts +28 -0
- package/src/components/DataDictionary/components/Table/options/hook.ts +9 -11
- package/src/components/DataDictionary/components/Table/options/pagination/constants.ts +6 -0
- package/src/components/DataDictionary/dataDictionary.tsx +45 -16
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/hook.ts +38 -0
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/types.ts +8 -0
- package/src/components/DataDictionary/hooks/UseDataDictionaryConfig/utils.ts +8 -0
- package/src/components/DataDictionary/hooks/UseMeasureFilters/hook.ts +27 -0
- package/src/components/DataDictionary/hooks/UseMeasureFilters/types.ts +6 -0
- package/src/components/DataDictionary/types.ts +1 -0
- package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +4 -0
- package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +4 -0
- package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +4 -0
- package/src/components/Filter/components/FilterCountChip/filterCountChip.styles.ts +19 -0
- package/src/components/Filter/components/FilterCountChip/filterCountChip.tsx +21 -0
- package/src/components/Filter/components/FilterCountChip/stories/filterCountChip.stories.tsx +12 -0
- package/src/components/Filter/components/FilterCountChip/types.ts +6 -0
- package/src/components/Table/columnDef/globalFilter/constants.ts +5 -0
- package/src/components/Table/columnDef/globalFilter/filterFn.ts +34 -0
- package/src/components/Table/columnDef/globalFilter/types.ts +5 -0
- package/src/components/Table/columnDef/globalFilter/utils.ts +74 -0
- package/src/components/Table/components/TableCell/components/CodeCell/codeCell.tsx +5 -2
- package/src/components/Table/components/TableCell/components/RankedCell/rankedCell.tsx +50 -0
- package/src/components/Table/components/TableCell/components/RankedCell/utils.ts +85 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.styles.ts +26 -1
- package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.tsx +11 -5
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.styles.ts +25 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag.tsx +31 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/constants.ts +13 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/stories/columFilterTag.stories.tsx +26 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/types.ts +9 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/constants.ts +8 -1
- package/src/components/Table/components/TableFeatures/ColumnFilter/types.ts +3 -2
- package/src/components/Table/components/TableFeatures/GlobalFilter/constants.ts +8 -0
- package/src/components/Table/components/TableFeatures/GlobalFilter/globalFilter.tsx +33 -0
- package/src/components/Table/components/TableFeatures/GlobalFilter/types.ts +9 -0
- package/src/components/Table/coreOptions/state/pagination/constants.ts +8 -0
- package/src/components/Table/coreOptions/state/pagination/utils.ts +21 -0
- package/src/components/common/AnchorLink/anchorLink.styles.ts +1 -1
- package/src/components/common/AnchorLink/anchorLink.tsx +9 -3
- package/src/components/common/CustomIcon/components/SearchIcon/searchIcon.tsx +2 -3
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.styles.ts +12 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment.tsx +21 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/constants.ts +13 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/types.ts +4 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/constants.ts +7 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment.tsx +13 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/components/constants.ts +7 -0
- package/src/components/common/OutlinedInput/components/InputAdornment/inputAdornment.styles.ts +6 -0
- package/src/components/common/OutlinedInput/outlinedInput.styles.ts +24 -0
- package/src/hooks/stateSyncManager/hooks/UseMetaCommands/hook.ts +2 -2
- package/src/hooks/stateSyncManager/hooks/UseStateSync/hook.ts +3 -3
- package/src/hooks/stateSyncManager/types.ts +1 -1
- package/src/hooks/useFileManifest/useFileManifestFileCount.ts +65 -0
- package/src/hooks/useRequestManifest/utils.ts +37 -24
- package/src/mocks/useRequestFileManifest.mocks.ts +2 -0
- package/src/providers/dataDictionary/context.ts +6 -0
- package/src/providers/dataDictionary/hook.ts +11 -0
- package/src/providers/dataDictionary/types.ts +6 -0
- package/src/providers/dataDictionaryState/actions/clearMeta/action.ts +18 -0
- package/src/providers/dataDictionaryState/actions/clearMeta/dispatch.ts +13 -0
- package/src/providers/dataDictionaryState/actions/clearMeta/types.ts +8 -0
- package/src/providers/dataDictionaryState/actions/stateToUrl/action.ts +20 -0
- package/src/providers/dataDictionaryState/actions/stateToUrl/dispatch.ts +14 -0
- package/src/providers/dataDictionaryState/actions/stateToUrl/types.ts +15 -0
- package/src/providers/dataDictionaryState/actions/types.ts +20 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/action.ts +24 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/dispatch.ts +16 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/types.ts +12 -0
- package/src/providers/dataDictionaryState/actions/updateColumnFilters/utils.ts +41 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/action.ts +25 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/dispatch.ts +16 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/types.ts +12 -0
- package/src/providers/dataDictionaryState/actions/updateGlobalFilter/utils.ts +50 -0
- package/src/providers/dataDictionaryState/actions/urlToState/action.ts +28 -0
- package/src/providers/dataDictionaryState/actions/urlToState/dispatch.ts +14 -0
- package/src/providers/dataDictionaryState/actions/urlToState/types.ts +11 -0
- package/src/providers/dataDictionaryState/context.ts +9 -0
- package/src/providers/dataDictionaryState/dictionaries/constants.ts +4 -0
- package/src/providers/dataDictionaryState/dictionaries/state.ts +45 -0
- package/src/providers/dataDictionaryState/dictionaries/types.ts +11 -0
- package/src/providers/dataDictionaryState/dictionaries/utils.ts +25 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/hook.ts +14 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryInitialArgs/types.ts +5 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryReducer/hook.ts +17 -0
- package/src/providers/dataDictionaryState/hooks/UseDataDictionaryState/hook.ts +11 -0
- package/src/providers/dataDictionaryState/initializer/constants.ts +6 -0
- package/src/providers/dataDictionaryState/initializer/initializer.ts +22 -0
- package/src/providers/dataDictionaryState/initializer/utils.ts +39 -0
- package/src/providers/dataDictionaryState/provider.tsx +16 -0
- package/src/providers/dataDictionaryState/reducer.ts +42 -0
- package/src/providers/dataDictionaryState/types.ts +18 -0
- package/src/providers/fileManifestState/constants.ts +1 -0
- package/src/providers/fileManifestState.tsx +23 -0
- package/src/styles/common/mui/iconButton.ts +40 -0
- package/src/styles/common/mui/inputAdornment.ts +22 -0
- package/src/styles/common/mui/outlinedInput.ts +14 -0
- package/src/theme/common/components.ts +122 -16
- package/src/theme/components/muiButtonGroup.ts +4 -0
- package/src/theme/components/muiTableCell.ts +6 -0
- package/src/utils/parseJsonQueryParam.ts +27 -0
- package/src/utils/stateToUrlQuery.ts +40 -0
- package/src/views/DataDictionaryView/dataDictionaryView.tsx +29 -3
- package/src/views/DataDictionaryView/types.ts +5 -0
- package/src/views/DataDictionaryView/utils.ts +23 -0
- package/src/views/ExploreView/utils.ts +1 -1
- package/tests/buildRequestFilters.test.ts +5 -13
- package/tests/useRequestManifest.test.ts +10 -0
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.d.ts +0 -4
- package/lib/components/DataDictionary/hooks/UseDataDictionary/hook.js +0 -36
- package/lib/components/DataDictionary/hooks/UseDataDictionary/types.d.ts +0 -8
- package/src/components/DataDictionary/hooks/UseDataDictionary/hook.ts +0 -51
- package/src/components/DataDictionary/hooks/UseDataDictionary/types.ts +0 -9
- /package/lib/components/DataDictionary/{hooks/UseDataDictionary → components/Filters/components/ColumnFilterTags}/types.js +0 -0
|
@@ -1,20 +1,37 @@
|
|
|
1
|
+
import { fn } from "@storybook/test";
|
|
1
2
|
import { PartialColumn } from "./types";
|
|
2
3
|
|
|
3
4
|
export const BIONETWORK: PartialColumn = {
|
|
4
5
|
columnDef: { header: "BioNetwork" },
|
|
5
6
|
getCanFilter: () => true,
|
|
7
|
+
getCanGlobalFilter: () => false,
|
|
6
8
|
getFacetedUniqueValues: () =>
|
|
7
9
|
new Map([
|
|
8
10
|
["Nervous System", 3],
|
|
9
11
|
["Brain", 2],
|
|
10
12
|
["Lung", 1],
|
|
11
13
|
]),
|
|
14
|
+
getFilterValue: () => ["Nervous System", "Brain"],
|
|
12
15
|
id: "bioNetwork",
|
|
16
|
+
setFilterValue: fn(),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const DESCRIPTION: PartialColumn = {
|
|
20
|
+
columnDef: { header: "Description" },
|
|
21
|
+
getCanFilter: () => false,
|
|
22
|
+
getCanGlobalFilter: () => true,
|
|
23
|
+
getFacetedUniqueValues: () =>
|
|
24
|
+
new Map([
|
|
25
|
+
["Platform used for single cell library construction.", 1],
|
|
26
|
+
["Platform used for sequencing.", 1],
|
|
27
|
+
]),
|
|
28
|
+
id: "description",
|
|
13
29
|
};
|
|
14
30
|
|
|
15
31
|
export const EXAMPLE: PartialColumn = {
|
|
16
32
|
columnDef: { header: "Example" },
|
|
17
33
|
getCanFilter: () => false,
|
|
34
|
+
getCanGlobalFilter: () => false,
|
|
18
35
|
getFacetedUniqueValues: () => new Map([["EFO:0008563", 1]]),
|
|
19
36
|
id: "example",
|
|
20
37
|
};
|
|
@@ -22,6 +39,7 @@ export const EXAMPLE: PartialColumn = {
|
|
|
22
39
|
export const REQUIRED: PartialColumn = {
|
|
23
40
|
columnDef: { header: "Required" },
|
|
24
41
|
getCanFilter: () => true,
|
|
42
|
+
getCanGlobalFilter: () => false,
|
|
25
43
|
getFacetedUniqueValues: () =>
|
|
26
44
|
new Map([
|
|
27
45
|
["Required", 16],
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
import { Box } from "@mui/material";
|
|
1
2
|
import { action } from "@storybook/addon-actions";
|
|
2
3
|
import { Meta, StoryObj } from "@storybook/react";
|
|
3
4
|
import { functionalUpdate, Table } from "@tanstack/react-table";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import { Filters } from "../filters";
|
|
6
|
-
import { BIONETWORK, EXAMPLE, REQUIRED } from "./constants";
|
|
7
|
-
import { useFilterStore } from "./hook";
|
|
7
|
+
import { BIONETWORK, DESCRIPTION, EXAMPLE, REQUIRED } from "./constants";
|
|
8
|
+
import { useFilterStore, useGlobalFilterStore } from "./hook";
|
|
8
9
|
import { PartialColumn } from "./types";
|
|
9
10
|
|
|
10
11
|
const meta: Meta<typeof Filters> = {
|
|
11
12
|
component: Filters,
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story): JSX.Element => (
|
|
15
|
+
<Box sx={{ width: 600 }}>
|
|
16
|
+
<Story />
|
|
17
|
+
</Box>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
export default meta;
|
|
@@ -17,6 +25,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
17
25
|
|
|
18
26
|
const DefaultStory = (): JSX.Element => {
|
|
19
27
|
const { filterStore, setFilterStore } = useFilterStore();
|
|
28
|
+
const { globalFilter, setGlobalFilter } = useGlobalFilterStore();
|
|
20
29
|
|
|
21
30
|
const makeColumn = (column: PartialColumn): PartialColumn => ({
|
|
22
31
|
...column,
|
|
@@ -31,7 +40,10 @@ const DefaultStory = (): JSX.Element => {
|
|
|
31
40
|
});
|
|
32
41
|
|
|
33
42
|
const table = {
|
|
34
|
-
getAllColumns: () =>
|
|
43
|
+
getAllColumns: () =>
|
|
44
|
+
[DESCRIPTION, REQUIRED, BIONETWORK, EXAMPLE].map(makeColumn),
|
|
45
|
+
getState: () => ({ globalFilter }),
|
|
46
|
+
setGlobalFilter,
|
|
35
47
|
} as Table<unknown>;
|
|
36
48
|
|
|
37
49
|
return <Filters table={table} />;
|
|
@@ -7,3 +7,11 @@ export function useFilterStore(): {
|
|
|
7
7
|
const [filterStore, setFilterStore] = useState<Record<string, unknown>>({});
|
|
8
8
|
return { filterStore, setFilterStore };
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export function useGlobalFilterStore(): {
|
|
12
|
+
globalFilter: string | undefined;
|
|
13
|
+
setGlobalFilter: Dispatch<SetStateAction<string | undefined>>;
|
|
14
|
+
} {
|
|
15
|
+
const [globalFilter, setGlobalFilter] = useState<string | undefined>();
|
|
16
|
+
return { globalFilter, setGlobalFilter };
|
|
17
|
+
}
|
|
@@ -5,16 +5,12 @@ import { LAYOUT_SPACING } from "../../constants";
|
|
|
5
5
|
|
|
6
6
|
const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
7
7
|
const PT = LAYOUT_SPACING.CONTENT_PADDING_TOP; /* top padding */
|
|
8
|
-
const FILTERS_HEIGHT =
|
|
9
|
-
LAYOUT_SPACING.FILTERS_HEIGHT +
|
|
10
|
-
LAYOUT_SPACING.FILTERS_PADDING_TOP; /* filters height */
|
|
11
|
-
const TITLE_HEIGHT = LAYOUT_SPACING.TITLE_HEIGHT; /* title height */
|
|
12
8
|
|
|
13
9
|
export const Layout = styled("div")<LayoutSpacing>`
|
|
14
10
|
grid-column: 2;
|
|
15
11
|
grid-row: 1;
|
|
16
12
|
padding-bottom: ${PB}px;
|
|
17
|
-
padding-top: ${({ top }) => top
|
|
13
|
+
padding-top: ${({ top }) => top}px;
|
|
18
14
|
z-index: 1; /* not required, but helpful in that the entities are always on top */
|
|
19
15
|
|
|
20
16
|
${mediaTabletDown} {
|
package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.tsx
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { Layout } from "./entitiesLayout.styles";
|
|
3
3
|
import { EntitiesLayoutProps } from "./types";
|
|
4
4
|
|
|
5
|
-
export const EntitiesLayout = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const EntitiesLayout = forwardRef<HTMLDivElement, EntitiesLayoutProps>(
|
|
6
|
+
function EntitiesLayout(
|
|
7
|
+
{ children, spacing, ...props }: EntitiesLayoutProps,
|
|
8
|
+
ref
|
|
9
|
+
): JSX.Element {
|
|
10
|
+
return (
|
|
11
|
+
<Layout ref={ref} {...spacing} {...props}>
|
|
12
|
+
{children}
|
|
13
|
+
</Layout>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { LayoutSpacing } from "../../../../hooks/UseLayoutSpacing/types";
|
|
3
3
|
|
|
4
|
-
export interface EntitiesLayoutProps
|
|
4
|
+
export interface EntitiesLayoutProps {
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
spacing: LayoutSpacing;
|
|
7
|
+
style?: CSSProperties; // Required for Fade component. See https://mui.com/material-ui/transitions/#child-requirement.
|
|
6
8
|
}
|
|
@@ -11,9 +11,11 @@ const TITLE_HEIGHT = LAYOUT_SPACING.TITLE_HEIGHT; /* title height */
|
|
|
11
11
|
export const Layout = styled("div")<LayoutSpacing>`
|
|
12
12
|
align-self: flex-start;
|
|
13
13
|
background-color: ${PALETTE.BACKGROUND_DEFAULT};
|
|
14
|
+
display: grid;
|
|
15
|
+
gap: 12px;
|
|
14
16
|
grid-column: 2;
|
|
15
17
|
grid-row: 1;
|
|
16
|
-
|
|
18
|
+
padding-bottom: ${PB}px;
|
|
17
19
|
padding-top: ${({ top }) => top + TITLE_HEIGHT + PT}px;
|
|
18
20
|
position: sticky;
|
|
19
21
|
top: 0;
|
|
@@ -23,5 +25,6 @@ export const Layout = styled("div")<LayoutSpacing>`
|
|
|
23
25
|
grid-column: 1;
|
|
24
26
|
grid-row: auto;
|
|
25
27
|
padding-top: ${PT}px;
|
|
28
|
+
position: relative;
|
|
26
29
|
}
|
|
27
30
|
`;
|
package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.tsx
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
2
|
import { Layout } from "./filtersLayout.styles";
|
|
3
3
|
import { FiltersLayoutProps } from "./types";
|
|
4
4
|
|
|
5
|
-
export const FiltersLayout = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const FiltersLayout = forwardRef<HTMLDivElement, FiltersLayoutProps>(
|
|
6
|
+
function FiltersLayout(
|
|
7
|
+
{ children, ...props }: FiltersLayoutProps,
|
|
8
|
+
ref
|
|
9
|
+
): JSX.Element {
|
|
10
|
+
return (
|
|
11
|
+
<Layout ref={ref} {...props}>
|
|
12
|
+
{children}
|
|
13
|
+
</Layout>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ColumnDef,
|
|
3
2
|
RowData,
|
|
4
3
|
Table,
|
|
5
4
|
TableOptions,
|
|
@@ -7,15 +6,16 @@ import {
|
|
|
7
6
|
} from "@tanstack/react-table";
|
|
8
7
|
import { useMemo } from "react";
|
|
9
8
|
import { Attribute, Class } from "../../../../common/entities";
|
|
9
|
+
import { useDataDictionaryState } from "../../../../providers/dataDictionaryState/hooks/UseDataDictionaryState/hook";
|
|
10
10
|
import { useTableOptions } from "./options/hook";
|
|
11
11
|
import { buildClassMeta, buildTableData } from "./utils";
|
|
12
12
|
|
|
13
13
|
export const useTable = <T extends RowData = Attribute>(
|
|
14
|
+
dictionary: string,
|
|
14
15
|
classes: Class<T>[],
|
|
15
|
-
|
|
16
|
-
tableOptions?: Omit<TableOptions<T>, "columns" | "data" | "getCoreRowModel">
|
|
16
|
+
tableOptions: Omit<TableOptions<T>, "data" | "getCoreRowModel">
|
|
17
17
|
): Table<T> => {
|
|
18
|
-
//
|
|
18
|
+
// Table data.
|
|
19
19
|
const data = useMemo(() => buildTableData(classes), [classes]);
|
|
20
20
|
|
|
21
21
|
// Default table options.
|
|
@@ -24,13 +24,17 @@ export const useTable = <T extends RowData = Attribute>(
|
|
|
24
24
|
// Build class meta.
|
|
25
25
|
const classMeta = useMemo(() => buildClassMeta(classes), [classes]);
|
|
26
26
|
|
|
27
|
+
// Table state.
|
|
28
|
+
const { dataDictionaryState } = useDataDictionaryState();
|
|
29
|
+
const { dictionaries } = dataDictionaryState;
|
|
30
|
+
const { state = {} } = dictionaries?.[dictionary] || {};
|
|
31
|
+
|
|
27
32
|
// Table instance.
|
|
28
33
|
return useReactTable<T>({
|
|
29
34
|
...defaultTableOptions,
|
|
30
35
|
...tableOptions,
|
|
31
|
-
columns: columnDefs,
|
|
32
36
|
data,
|
|
33
|
-
manualPagination: true,
|
|
34
37
|
meta: { classMeta },
|
|
38
|
+
state,
|
|
35
39
|
});
|
|
36
40
|
};
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
getFilteredRowModel,
|
|
5
5
|
} from "@tanstack/react-table";
|
|
6
6
|
import { arrIncludesSome } from "../../../../../Table/columnDef/columnFilters/filterFn";
|
|
7
|
+
import { fuzzy } from "../../../../../Table/columnDef/globalFilter/filterFn";
|
|
7
8
|
|
|
8
9
|
export const COLUMN_FILTERS_OPTIONS: Pick<
|
|
9
10
|
ColumnFiltersOptions<RowData>,
|
|
@@ -11,6 +12,6 @@ export const COLUMN_FILTERS_OPTIONS: Pick<
|
|
|
11
12
|
> = {
|
|
12
13
|
enableColumnFilters: true,
|
|
13
14
|
enableFilters: true,
|
|
14
|
-
filterFns: { arrIncludesSome },
|
|
15
|
+
filterFns: { arrIncludesSome, fuzzy },
|
|
15
16
|
getFilteredRowModel: getFilteredRowModel(),
|
|
16
17
|
};
|
|
@@ -4,25 +4,26 @@ import {
|
|
|
4
4
|
RowData,
|
|
5
5
|
Updater,
|
|
6
6
|
} from "@tanstack/react-table";
|
|
7
|
-
import {
|
|
7
|
+
import { useCallback } from "react";
|
|
8
8
|
import { Attribute } from "../../../../../../common/entities";
|
|
9
|
-
import {
|
|
9
|
+
import { useDataDictionary } from "../../../../../../providers/dataDictionary/hook";
|
|
10
|
+
import { updateColumnFilters } from "../../../../../../providers/dataDictionaryState/actions/updateColumnFilters/dispatch";
|
|
11
|
+
import { useDataDictionaryState } from "../../../../../../providers/dataDictionaryState/hooks/UseDataDictionaryState/hook";
|
|
10
12
|
import { COLUMN_FILTERS_OPTIONS } from "./constants";
|
|
11
13
|
|
|
12
|
-
export const useColumnFiltersOptions = <
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// TODO dispatch to provider with reducer.
|
|
14
|
+
export const useColumnFiltersOptions = <
|
|
15
|
+
T extends RowData = Attribute
|
|
16
|
+
>(): ColumnFiltersOptions<T> => {
|
|
17
|
+
const { dictionary } = useDataDictionary();
|
|
18
|
+
const { dataDictionaryDispatch } = useDataDictionaryState();
|
|
19
|
+
|
|
19
20
|
const onColumnFiltersChange = useCallback(
|
|
20
21
|
(updaterOrValue: Updater<ColumnFiltersState>): void => {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
dataDictionaryDispatch?.(
|
|
23
|
+
updateColumnFilters({ dictionary, updaterOrValue })
|
|
23
24
|
);
|
|
24
25
|
},
|
|
25
|
-
[
|
|
26
|
+
[dataDictionaryDispatch, dictionary]
|
|
26
27
|
);
|
|
27
28
|
|
|
28
29
|
return {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FilterFnOption,
|
|
3
|
+
GlobalFilterOptions,
|
|
4
|
+
RowData,
|
|
5
|
+
} from "@tanstack/react-table";
|
|
6
|
+
|
|
7
|
+
export const GLOBAL_FILTER_OPTIONS: Pick<
|
|
8
|
+
GlobalFilterOptions<RowData>,
|
|
9
|
+
"enableGlobalFilter" | "getColumnCanGlobalFilter" | "globalFilterFn"
|
|
10
|
+
> = {
|
|
11
|
+
enableGlobalFilter: true,
|
|
12
|
+
getColumnCanGlobalFilter: () => true,
|
|
13
|
+
globalFilterFn: "fuzzy" as FilterFnOption<RowData>,
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { GlobalFilterOptions, RowData, Updater } from "@tanstack/react-table";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { Attribute } from "../../../../../../common/entities";
|
|
4
|
+
import { useDataDictionary } from "../../../../../../providers/dataDictionary/hook";
|
|
5
|
+
import { updateGlobalFilter } from "../../../../../../providers/dataDictionaryState/actions/updateGlobalFilter/dispatch";
|
|
6
|
+
import { useDataDictionaryState } from "../../../../../../providers/dataDictionaryState/hooks/UseDataDictionaryState/hook";
|
|
7
|
+
import { GLOBAL_FILTER_OPTIONS } from "./constants";
|
|
8
|
+
|
|
9
|
+
export const useGlobalFilterOptions = <
|
|
10
|
+
T extends RowData = Attribute
|
|
11
|
+
>(): GlobalFilterOptions<T> => {
|
|
12
|
+
const { dictionary } = useDataDictionary();
|
|
13
|
+
const { dataDictionaryDispatch } = useDataDictionaryState();
|
|
14
|
+
|
|
15
|
+
const onGlobalFilterChange = useCallback(
|
|
16
|
+
(updaterOrValue: Updater<string | undefined>): void => {
|
|
17
|
+
dataDictionaryDispatch?.(
|
|
18
|
+
updateGlobalFilter({ dictionary, updaterOrValue })
|
|
19
|
+
);
|
|
20
|
+
},
|
|
21
|
+
[dataDictionaryDispatch, dictionary]
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
...GLOBAL_FILTER_OPTIONS,
|
|
26
|
+
onGlobalFilterChange,
|
|
27
|
+
} as GlobalFilterOptions<T>;
|
|
28
|
+
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ColumnFiltersState,
|
|
3
|
-
RowData,
|
|
4
|
-
TableOptions,
|
|
5
|
-
} from "@tanstack/react-table";
|
|
6
|
-
import { useState } from "react";
|
|
1
|
+
import { RowData, TableOptions } from "@tanstack/react-table";
|
|
7
2
|
import { Attribute } from "../../../../../common/entities";
|
|
8
3
|
import { useColumnFiltersOptions } from "./columnFilters/hook";
|
|
9
4
|
import { CORE_OPTIONS } from "./core/constants";
|
|
10
5
|
import { EXPANDED_OPTIONS } from "./expanded/constants";
|
|
11
6
|
import { FACETED_OPTIONS } from "./faceted/constants";
|
|
7
|
+
import { useGlobalFilterOptions } from "./globalFilter/hook";
|
|
12
8
|
import { GROUPING_OPTIONS } from "./grouping/constants";
|
|
9
|
+
import { PAGINATION_OPTIONS } from "./pagination/constants";
|
|
13
10
|
import { SORTING_OPTIONS } from "./sorting/constants";
|
|
14
11
|
import { VISIBILITY_OPTIONS } from "./visibility/constants";
|
|
15
12
|
|
|
@@ -17,11 +14,11 @@ export const useTableOptions = <T extends RowData = Attribute>(): Omit<
|
|
|
17
14
|
TableOptions<T>,
|
|
18
15
|
"columns" | "data" | "initialState"
|
|
19
16
|
> => {
|
|
20
|
-
// Column filters state - to be moved to a provider with a reducer.
|
|
21
|
-
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
|
|
22
|
-
|
|
23
17
|
// Column filters options.
|
|
24
|
-
const columnFiltersOptions = useColumnFiltersOptions<T>(
|
|
18
|
+
const columnFiltersOptions = useColumnFiltersOptions<T>();
|
|
19
|
+
|
|
20
|
+
// Global filter options.
|
|
21
|
+
const globalFilterOptions = useGlobalFilterOptions<T>();
|
|
25
22
|
|
|
26
23
|
// Table options.
|
|
27
24
|
return {
|
|
@@ -29,9 +26,10 @@ export const useTableOptions = <T extends RowData = Attribute>(): Omit<
|
|
|
29
26
|
...CORE_OPTIONS,
|
|
30
27
|
...EXPANDED_OPTIONS,
|
|
31
28
|
...FACETED_OPTIONS,
|
|
29
|
+
...globalFilterOptions,
|
|
32
30
|
...GROUPING_OPTIONS,
|
|
31
|
+
...PAGINATION_OPTIONS,
|
|
33
32
|
...SORTING_OPTIONS,
|
|
34
33
|
...VISIBILITY_OPTIONS,
|
|
35
|
-
state: { columnFilters },
|
|
36
34
|
} as TableOptions<T>;
|
|
37
35
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PaginationOptions } from "@tanstack/react-table";
|
|
2
|
+
|
|
3
|
+
export const PAGINATION_OPTIONS: Pick<PaginationOptions, "autoResetPageIndex"> =
|
|
4
|
+
{
|
|
5
|
+
autoResetPageIndex: false, // Temporary fix for hydration issue, see https://github.com/TanStack/table/issues/5026.
|
|
6
|
+
};
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
import { Fade } from "@mui/material";
|
|
1
2
|
import { RowData } from "@tanstack/react-table";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { Attribute } from "../../common/entities";
|
|
4
5
|
import { Entities } from "./components/Entities/entities";
|
|
6
|
+
import { ColumnFilterTags } from "./components/Filters/components/ColumnFilterTags/columnFilterTags";
|
|
5
7
|
import { Filters } from "./components/Filters/filters";
|
|
6
8
|
import { EntitiesLayout as DefaultEntitiesLayout } from "./components/Layout/components/EntitiesLayout/entitiesLayout";
|
|
7
9
|
import { FiltersLayout as DefaultFiltersLayout } from "./components/Layout/components/FiltersLayout/filtersLayout";
|
|
8
10
|
import { OutlineLayout as DefaultOutlineLayout } from "./components/Layout/components/OutlineLayout/outlineLayout";
|
|
9
11
|
import { TitleLayout as DefaultTitleLayout } from "./components/Layout/components/TitleLayout/titleLayout";
|
|
10
12
|
import { Outline as DefaultOutline } from "./components/Outline/outline";
|
|
13
|
+
import { buildClassesOutline } from "./components/Outline/utils";
|
|
14
|
+
import { useTable } from "./components/Table/hook";
|
|
11
15
|
import { Title as DefaultTitle } from "./components/Title/title";
|
|
12
16
|
import { View } from "./dataDictionary.styles";
|
|
13
|
-
import {
|
|
17
|
+
import { useDataDictionaryConfig } from "./hooks/UseDataDictionaryConfig/hook";
|
|
14
18
|
import { useLayoutSpacing } from "./hooks/UseLayoutSpacing/hook";
|
|
19
|
+
import { useMeasureFilters } from "./hooks/UseMeasureFilters/hook";
|
|
15
20
|
import { DataDictionaryProps } from "./types";
|
|
16
21
|
|
|
17
22
|
export const DataDictionary = <T extends RowData = Attribute>({
|
|
18
23
|
className,
|
|
24
|
+
dictionary,
|
|
19
25
|
EntitiesLayout = DefaultEntitiesLayout,
|
|
20
26
|
FiltersLayout = DefaultFiltersLayout,
|
|
21
27
|
Outline = DefaultOutline,
|
|
@@ -23,22 +29,45 @@ export const DataDictionary = <T extends RowData = Attribute>({
|
|
|
23
29
|
Title = DefaultTitle,
|
|
24
30
|
TitleLayout = DefaultTitleLayout,
|
|
25
31
|
}: DataDictionaryProps): JSX.Element => {
|
|
26
|
-
|
|
32
|
+
// Get dictionary configuration.
|
|
33
|
+
const { classes, tableOptions, title } =
|
|
34
|
+
useDataDictionaryConfig<T>(dictionary);
|
|
35
|
+
|
|
36
|
+
// Layout measurements.
|
|
37
|
+
// Get header and footer dimensions.
|
|
27
38
|
const { spacing } = useLayoutSpacing();
|
|
39
|
+
// Measure filters dimensions.
|
|
40
|
+
const { dimensions, filtersRef } = useMeasureFilters();
|
|
41
|
+
// Update entities' spacing with filters dimensions.
|
|
42
|
+
const entitiesSpacing = { ...spacing, top: dimensions.height };
|
|
43
|
+
|
|
44
|
+
// Table instance.
|
|
45
|
+
const table = useTable<T>(dictionary, classes, tableOptions);
|
|
46
|
+
|
|
47
|
+
// Dictionary outline.
|
|
48
|
+
const outline = buildClassesOutline<T>(table);
|
|
49
|
+
|
|
28
50
|
return (
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
<Fade in={spacing.top > 0}>
|
|
52
|
+
{/* Fade in when header is measured. */}
|
|
53
|
+
<View className={className}>
|
|
54
|
+
<TitleLayout {...spacing}>
|
|
55
|
+
<Title title={title} />
|
|
56
|
+
</TitleLayout>
|
|
57
|
+
<OutlineLayout {...spacing}>
|
|
58
|
+
<Outline outline={outline} />
|
|
59
|
+
</OutlineLayout>
|
|
60
|
+
<FiltersLayout ref={filtersRef} {...spacing}>
|
|
61
|
+
<Filters table={table} />
|
|
62
|
+
<ColumnFilterTags table={table} />
|
|
63
|
+
</FiltersLayout>
|
|
64
|
+
<Fade in={dimensions.height > 0}>
|
|
65
|
+
{/* Fade in entities when filters are measured. */}
|
|
66
|
+
<EntitiesLayout spacing={entitiesSpacing}>
|
|
67
|
+
<Entities spacing={entitiesSpacing} table={table} />
|
|
68
|
+
</EntitiesLayout>
|
|
69
|
+
</Fade>
|
|
70
|
+
</View>
|
|
71
|
+
</Fade>
|
|
43
72
|
);
|
|
44
73
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RowData } from "@tanstack/react-table";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Attribute, DataDictionaryConfig } from "../../../../common/entities";
|
|
4
|
+
import { useConfig } from "../../../../hooks/useConfig";
|
|
5
|
+
import { UseDataDictionaryConfig } from "./types";
|
|
6
|
+
import { throwDictionaryConfigNotFoundError } from "./utils";
|
|
7
|
+
|
|
8
|
+
export const useDataDictionaryConfig = <T extends RowData = Attribute>(
|
|
9
|
+
dictionary: string
|
|
10
|
+
): UseDataDictionaryConfig<T> => {
|
|
11
|
+
const {
|
|
12
|
+
config: { dataDictionaries: dataDictionaryConfigs },
|
|
13
|
+
} = useConfig();
|
|
14
|
+
// Get dictionary config by matching the current path with the data dictionary path
|
|
15
|
+
const dataDictionaryConfig = useMemo(() => {
|
|
16
|
+
if (!dataDictionaryConfigs?.length) return undefined;
|
|
17
|
+
|
|
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(
|
|
21
|
+
(config) => config.path === dictionary
|
|
22
|
+
) as DataDictionaryConfig<T> | undefined;
|
|
23
|
+
}, [dataDictionaryConfigs, dictionary]);
|
|
24
|
+
|
|
25
|
+
// Throw error if the dictionary config is not found.
|
|
26
|
+
if (!dataDictionaryConfig) throwDictionaryConfigNotFoundError(dictionary);
|
|
27
|
+
|
|
28
|
+
// Get configured dictionary classes, column definitions and table options.
|
|
29
|
+
return useMemo(() => {
|
|
30
|
+
// Using non-null assertion (!) because we've already checked dataDictionaryConfig
|
|
31
|
+
// exists above and would have thrown an error if undefined.
|
|
32
|
+
return {
|
|
33
|
+
classes: dataDictionaryConfig!.dataDictionary.classes,
|
|
34
|
+
tableOptions: dataDictionaryConfig!.tableOptions,
|
|
35
|
+
title: dataDictionaryConfig!.dataDictionary.title,
|
|
36
|
+
};
|
|
37
|
+
}, [dataDictionaryConfig]);
|
|
38
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RowData, TableOptions } from "@tanstack/react-table";
|
|
2
|
+
import { Attribute, Class } from "../../../../common/entities";
|
|
3
|
+
|
|
4
|
+
export interface UseDataDictionaryConfig<T extends RowData = Attribute> {
|
|
5
|
+
classes: Class<T>[];
|
|
6
|
+
tableOptions: Omit<TableOptions<T>, "data" | "getCoreRowModel">;
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when a dictionary config is not found.
|
|
3
|
+
* @param dictionary - Dictionary ID.
|
|
4
|
+
* @throws Error - Dictionary config not found.
|
|
5
|
+
*/
|
|
6
|
+
export function throwDictionaryConfigNotFoundError(dictionary: string): void {
|
|
7
|
+
throw new Error(`Dictionary config not found for dictionary: ${dictionary}`);
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
getBorderBoxSizeHeight,
|
|
4
|
+
useResizeObserver,
|
|
5
|
+
} from "../../../../hooks/useResizeObserver";
|
|
6
|
+
import { useLayoutDimensions } from "../../../../providers/layoutDimensions/hook";
|
|
7
|
+
import { UseMeasureFilters } from "./types";
|
|
8
|
+
|
|
9
|
+
export const useMeasureFilters = (): UseMeasureFilters => {
|
|
10
|
+
// Get header dimensions.
|
|
11
|
+
const { dimensions } = useLayoutDimensions();
|
|
12
|
+
const { header } = dimensions;
|
|
13
|
+
|
|
14
|
+
// Measure filters dimensions.
|
|
15
|
+
const filtersRef = useRef<HTMLElement>(null);
|
|
16
|
+
const filtersRect = useResizeObserver(
|
|
17
|
+
filtersRef,
|
|
18
|
+
getBorderBoxSizeHeight,
|
|
19
|
+
header.height > 0 // Only measure filters height, when header measurement is available.
|
|
20
|
+
);
|
|
21
|
+
const { height = 0 } = filtersRect || {};
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
dimensions: { height },
|
|
25
|
+
filtersRef,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -4,6 +4,7 @@ import { Filters } from "../../../../common/entities";
|
|
|
4
4
|
import { useExploreState } from "../../../../hooks/useExploreState";
|
|
5
5
|
import { FileManifestType } from "../../../../hooks/useFileManifest/common/entities";
|
|
6
6
|
import { useFileManifest } from "../../../../hooks/useFileManifest/useFileManifest";
|
|
7
|
+
import { useFileManifestFileCount } from "../../../../hooks/useFileManifest/useFileManifestFileCount";
|
|
7
8
|
import {
|
|
8
9
|
FileLocation,
|
|
9
10
|
useRequestFileLocation,
|
|
@@ -30,6 +31,7 @@ interface DownloadCurlCommandProps {
|
|
|
30
31
|
filters: Filters; // Initializes bulk download filters.
|
|
31
32
|
formFacet: FormFacet;
|
|
32
33
|
manifestDownloadFormat?: ManifestDownloadFormat;
|
|
34
|
+
speciesFacetName: string;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export const DownloadCurlCommand = ({
|
|
@@ -41,8 +43,10 @@ export const DownloadCurlCommand = ({
|
|
|
41
43
|
filters,
|
|
42
44
|
formFacet,
|
|
43
45
|
manifestDownloadFormat = MANIFEST_DOWNLOAD_FORMAT.CURL,
|
|
46
|
+
speciesFacetName,
|
|
44
47
|
}: DownloadCurlCommandProps): JSX.Element => {
|
|
45
48
|
useFileManifest(filters, fileSummaryFacetName);
|
|
49
|
+
useFileManifestFileCount(filters, speciesFacetName, fileSummaryFacetName);
|
|
46
50
|
const [executionEnvironment, setExecutionEnvironment] =
|
|
47
51
|
useState<ExecutionEnvironment>(BULK_DOWNLOAD_EXECUTION_ENVIRONMENT.BASH);
|
|
48
52
|
const {
|