@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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OutlinedInputProps } from "@mui/material";
|
|
2
|
+
import { RowData, Table } from "@tanstack/react-table";
|
|
3
|
+
import { BaseComponentProps } from "components/types";
|
|
4
|
+
|
|
5
|
+
export interface GlobalFilterProps<T extends RowData>
|
|
6
|
+
extends BaseComponentProps,
|
|
7
|
+
OutlinedInputProps {
|
|
8
|
+
table: Table<T>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InitialTableState, PaginationTableState } from "@tanstack/react-table";
|
|
2
|
+
import { PAGINATION_TABLE_STATE } from "./constants";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initializes pagination state by merging default values with initial state.
|
|
6
|
+
* TanStack Table always applies a default pagination of `{ pageIndex: 0, pageSize: 10 }`,
|
|
7
|
+
* so this function ensures custom pagination state is properly initialized from the initial state.
|
|
8
|
+
* @param initialState - The initial state.
|
|
9
|
+
* @returns The initialized pagination state.
|
|
10
|
+
*/
|
|
11
|
+
export function initPaginationState(
|
|
12
|
+
initialState?: InitialTableState
|
|
13
|
+
): PaginationTableState {
|
|
14
|
+
if (!initialState?.pagination) return PAGINATION_TABLE_STATE;
|
|
15
|
+
return {
|
|
16
|
+
pagination: {
|
|
17
|
+
...PAGINATION_TABLE_STATE.pagination,
|
|
18
|
+
...initialState.pagination,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -2,7 +2,7 @@ import styled from "@emotion/styled";
|
|
|
2
2
|
import Link from "next/link";
|
|
3
3
|
import { inkLight } from "../../../styles/common/mixins/colors";
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const StyledNextLink = styled(Link)`
|
|
6
6
|
color: ${inkLight};
|
|
7
7
|
margin-left: 4px;
|
|
8
8
|
opacity: 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LinkRounded } from "@mui/icons-material";
|
|
2
|
+
import { useRouter } from "next/router";
|
|
2
3
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
+
import { StyledNextLink } from "./anchorLink.styles";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* An anchor link component that provides deep linking functionality.
|
|
@@ -18,9 +19,14 @@ export const AnchorLink = ({
|
|
|
18
19
|
anchorLink,
|
|
19
20
|
className,
|
|
20
21
|
}: AnchorLinkProps): JSX.Element => {
|
|
22
|
+
const { query } = useRouter();
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
24
|
+
<StyledNextLink
|
|
25
|
+
aria-label={anchorLink}
|
|
26
|
+
className={className}
|
|
27
|
+
href={{ hash: anchorLink, query }}
|
|
28
|
+
>
|
|
23
29
|
<LinkRounded fontSize="xsmall" />
|
|
24
|
-
</
|
|
30
|
+
</StyledNextLink>
|
|
25
31
|
);
|
|
26
32
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { SvgIcon } from "@mui/material";
|
|
1
|
+
import { SvgIcon, SvgIconProps } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { CustomSVGIconProps } from "../../common/entities";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Custom search icon.
|
|
@@ -10,7 +9,7 @@ export const SearchIcon = ({
|
|
|
10
9
|
fontSize = "xsmall",
|
|
11
10
|
viewBox = "0 0 20 20",
|
|
12
11
|
...props /* Spread props to allow for Mui SvgIconProps specific prop overrides e.g. "htmlColor". */
|
|
13
|
-
}:
|
|
12
|
+
}: SvgIconProps): JSX.Element => {
|
|
14
13
|
return (
|
|
15
14
|
<SvgIcon fontSize={fontSize} viewBox={viewBox} {...props}>
|
|
16
15
|
<path
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { InputAdornment } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../../../styles/common/constants/palette";
|
|
4
|
+
|
|
5
|
+
export const StyledInputAdornment = styled(InputAdornment)`
|
|
6
|
+
color: ${PALETTE.INK_LIGHT};
|
|
7
|
+
margin: 0;
|
|
8
|
+
|
|
9
|
+
.MuiIconButton-root {
|
|
10
|
+
margin-right: -10px;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CloseRounded } from "@mui/icons-material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SVG_ICON_PROPS } from "../constants";
|
|
5
|
+
import { StyledInputAdornment } from "./clearInputAdornment.styles";
|
|
6
|
+
import { ICON_BUTTON_PROPS, INPUT_ADORNMENT_PROPS } from "./constants";
|
|
7
|
+
import { ClearInputAdornmentProps } from "./types";
|
|
8
|
+
|
|
9
|
+
export const ClearInputAdornment = ({
|
|
10
|
+
in: isIn,
|
|
11
|
+
onClick,
|
|
12
|
+
}: ClearInputAdornmentProps): JSX.Element | null => {
|
|
13
|
+
if (!isIn) return null;
|
|
14
|
+
return (
|
|
15
|
+
<StyledInputAdornment {...INPUT_ADORNMENT_PROPS}>
|
|
16
|
+
<IconButton {...ICON_BUTTON_PROPS} onClick={onClick}>
|
|
17
|
+
<CloseRounded {...SVG_ICON_PROPS} />
|
|
18
|
+
</IconButton>
|
|
19
|
+
</StyledInputAdornment>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconButtonProps, InputAdornmentProps } from "@mui/material";
|
|
2
|
+
import { ICON_BUTTON_PROPS as MUI_ICON_BUTTON_PROPS } from "../../../../../../../styles/common/mui/iconButton";
|
|
3
|
+
import { INPUT_ADORNMENT_PROPS as MUI_INPUT_ADORNMENT_PROPS } from "../../../../../../../styles/common/mui/inputAdornment";
|
|
4
|
+
|
|
5
|
+
export const ICON_BUTTON_PROPS: IconButtonProps = {
|
|
6
|
+
color: MUI_ICON_BUTTON_PROPS.COLOR.INHERIT,
|
|
7
|
+
edge: MUI_ICON_BUTTON_PROPS.EDGE.END,
|
|
8
|
+
size: MUI_ICON_BUTTON_PROPS.SIZE.MEDIUM,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const INPUT_ADORNMENT_PROPS: InputAdornmentProps = {
|
|
12
|
+
position: MUI_INPUT_ADORNMENT_PROPS.POSITION.END,
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputAdornmentProps } from "@mui/material";
|
|
2
|
+
import { INPUT_ADORNMENT_PROPS as MUI_INPUT_ADORNMENT_PROPS } from "../../../../../../../styles/common/mui/inputAdornment";
|
|
3
|
+
|
|
4
|
+
export const INPUT_ADORNMENT_PROPS: InputAdornmentProps = {
|
|
5
|
+
disablePointerEvents: true,
|
|
6
|
+
position: MUI_INPUT_ADORNMENT_PROPS.POSITION.START,
|
|
7
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SearchIcon } from "../../../../../CustomIcon/components/SearchIcon/searchIcon";
|
|
3
|
+
import { StyledInputAdornment } from "../../inputAdornment.styles";
|
|
4
|
+
import { SVG_ICON_PROPS } from "../constants";
|
|
5
|
+
import { INPUT_ADORNMENT_PROPS } from "./constants";
|
|
6
|
+
|
|
7
|
+
export const SearchInputAdornment = (): JSX.Element => {
|
|
8
|
+
return (
|
|
9
|
+
<StyledInputAdornment {...INPUT_ADORNMENT_PROPS}>
|
|
10
|
+
<SearchIcon {...SVG_ICON_PROPS} />
|
|
11
|
+
</StyledInputAdornment>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SvgIconProps } from "@mui/material";
|
|
2
|
+
import { SVG_ICON_PROPS as MUI_SVG_ICON_PROPS } from "../../../../../../styles/common/mui/svgIcon";
|
|
3
|
+
|
|
4
|
+
export const SVG_ICON_PROPS: SvgIconProps = {
|
|
5
|
+
color: MUI_SVG_ICON_PROPS.COLOR.INHERIT,
|
|
6
|
+
fontSize: MUI_SVG_ICON_PROPS.FONT_SIZE.SMALL,
|
|
7
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { OutlinedInput } from "@mui/material";
|
|
4
|
+
import { PALETTE } from "../../../styles/common/constants/palette";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
hasValue: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const StyledOutlinedInput = styled(OutlinedInput, {
|
|
11
|
+
shouldForwardProp: (prop) => prop !== "hasValue",
|
|
12
|
+
})<Props>`
|
|
13
|
+
${({ hasValue }) =>
|
|
14
|
+
hasValue &&
|
|
15
|
+
css`
|
|
16
|
+
& {
|
|
17
|
+
color: ${PALETTE.INK_MAIN};
|
|
18
|
+
|
|
19
|
+
.MuiOutlinedInput-input {
|
|
20
|
+
color: inherit;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`};
|
|
24
|
+
`;
|
|
@@ -17,11 +17,11 @@ export const useMetaCommands = <Action>({
|
|
|
17
17
|
switch (command) {
|
|
18
18
|
case META_COMMAND.STATE_TO_URL_PUSH:
|
|
19
19
|
Router.push({ query }, undefined, { shallow: true });
|
|
20
|
-
dispatch(actions.clearMeta());
|
|
20
|
+
dispatch?.(actions.clearMeta());
|
|
21
21
|
break;
|
|
22
22
|
case META_COMMAND.STATE_TO_URL_REPLACE:
|
|
23
23
|
Router.replace({ query }, undefined, { shallow: true });
|
|
24
|
-
dispatch(actions.clearMeta());
|
|
24
|
+
dispatch?.(actions.clearMeta());
|
|
25
25
|
break;
|
|
26
26
|
default:
|
|
27
27
|
break;
|
|
@@ -33,7 +33,7 @@ export const useStateSync = <Action>({
|
|
|
33
33
|
// Dispatch action sync URL >> state.
|
|
34
34
|
if (wasPop(basePath, pathname, popRef.current)) {
|
|
35
35
|
// When the user navigates with the back/forward buttons.
|
|
36
|
-
dispatch(actions.urlToState({ query }));
|
|
36
|
+
dispatch?.(actions.urlToState({ query }));
|
|
37
37
|
onClearPopRef();
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -41,12 +41,12 @@ export const useStateSync = <Action>({
|
|
|
41
41
|
// Dispatch action sync URL >> state.
|
|
42
42
|
if (hasParams(query, paramKeys)) {
|
|
43
43
|
// When the URL has parameters.
|
|
44
|
-
dispatch(actions.urlToState({ query }));
|
|
44
|
+
dispatch?.(actions.urlToState({ query }));
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// Otherwise, dispatch action sync URL << state.
|
|
49
|
-
dispatch(actions.stateToUrl({ method: ROUTER_METHOD.REPLACE }));
|
|
49
|
+
dispatch?.(actions.stateToUrl({ method: ROUTER_METHOD.REPLACE }));
|
|
50
50
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- deliberate omission of `state.query`, `state.paramKeys`, `actions` and `dispatch` from dependencies, hook is only expected to run when the Next.js router changes.
|
|
51
51
|
}, [basePath, isReady, pathname, query]);
|
|
52
52
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { Filters } from "../../common/entities";
|
|
3
|
+
import { FileManifestActionKind } from "../../providers/fileManifestState";
|
|
4
|
+
import { useCatalog } from "../useCatalog";
|
|
5
|
+
import { useFileManifestState } from "../useFileManifestState";
|
|
6
|
+
import { useFetchSummary } from "./useFetchSummary";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Fetches the latest file count from the summary endpoint, excluding filters
|
|
10
|
+
* that match the provided species and file facet names, and updates the file manifest state.
|
|
11
|
+
*
|
|
12
|
+
* @param initialFilters - The initial set of filters to apply.
|
|
13
|
+
* @param speciesFacetName - The facet name representing species to exclude from the summary request.
|
|
14
|
+
* @param fileFacetName - The facet name representing file type to exclude from the summary request.
|
|
15
|
+
*/
|
|
16
|
+
export const useFileManifestFileCount = (
|
|
17
|
+
initialFilters: Filters | undefined,
|
|
18
|
+
speciesFacetName: string,
|
|
19
|
+
fileFacetName: string
|
|
20
|
+
): void => {
|
|
21
|
+
// Initial file manifest filter.
|
|
22
|
+
const [initFilters] = useState(() => initialFilters);
|
|
23
|
+
|
|
24
|
+
// File manifest dispatch.
|
|
25
|
+
const { fileManifestDispatch } = useFileManifestState();
|
|
26
|
+
|
|
27
|
+
// Determine catalog.
|
|
28
|
+
const catalog = useCatalog() as string; // catalog should be defined.
|
|
29
|
+
|
|
30
|
+
// Get filters required for fetching the summary.
|
|
31
|
+
const filters = excludeFacetsFromFilters(initFilters, [
|
|
32
|
+
speciesFacetName,
|
|
33
|
+
fileFacetName,
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
// Fetch file count from summary.
|
|
37
|
+
const { summary: { fileCount } = {} } = useFetchSummary(
|
|
38
|
+
filters,
|
|
39
|
+
catalog,
|
|
40
|
+
true
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
fileManifestDispatch({
|
|
45
|
+
payload: { fileCount },
|
|
46
|
+
type: FileManifestActionKind.UpdateFileCount,
|
|
47
|
+
});
|
|
48
|
+
}, [fileCount, fileManifestDispatch]);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Returns a new filters array with the specified facet names excluded.
|
|
53
|
+
*
|
|
54
|
+
* @param filters - The list of filters to process.
|
|
55
|
+
* @param facetNames - The facet names to exclude from the filters.
|
|
56
|
+
* @returns The filters array excluding any filters matching the provided facet names.
|
|
57
|
+
*/
|
|
58
|
+
function excludeFacetsFromFilters(
|
|
59
|
+
filters: Filters | undefined,
|
|
60
|
+
facetNames: string[]
|
|
61
|
+
): Filters {
|
|
62
|
+
return (filters || []).filter(
|
|
63
|
+
({ categoryKey }) => !facetNames.includes(categoryKey)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -12,36 +12,41 @@ import { REQUEST_MANIFEST } from "./constants";
|
|
|
12
12
|
import { UseRequestManifest } from "./types";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
15
|
+
* Determines whether all files are selected by comparing the file count to the summary file count.
|
|
16
|
+
*
|
|
17
|
+
* @param state - The file manifest state object.
|
|
18
|
+
* @returns True if all files are selected; otherwise, false.
|
|
18
19
|
*/
|
|
19
|
-
export function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export function areAllFilesSelected(state: FileManifestState): boolean {
|
|
21
|
+
const { fileCount, summary } = state;
|
|
22
|
+
|
|
23
|
+
// Return false if file count or summary file count is undefined.
|
|
24
|
+
if (fileCount === undefined || summary?.fileCount === undefined) return false;
|
|
25
|
+
|
|
26
|
+
// Return true if file count equals summary file count.
|
|
27
|
+
return fileCount === summary.fileCount;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* -
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
31
|
+
* Builds the filters object for a request URL based on the file manifest state and form facets.
|
|
32
|
+
*
|
|
33
|
+
* - If all files are selected, returns filters from state excluding fully selected form filters.
|
|
34
|
+
* - If only some files are selected, returns the current filters from state.
|
|
35
|
+
*
|
|
36
|
+
* @param state - The file manifest state object.
|
|
37
|
+
* @param formFacet - The form-related file facets.
|
|
38
|
+
* @returns The filters to use for the request URL.
|
|
35
39
|
*/
|
|
36
40
|
export function buildRequestFilters(
|
|
37
41
|
state: FileManifestState,
|
|
38
42
|
formFacet: FormFacet
|
|
39
43
|
): Filters {
|
|
40
|
-
//
|
|
41
|
-
if (
|
|
44
|
+
// Return filters from state excluding form filters if all files are selected.
|
|
45
|
+
if (areAllFilesSelected(state)) {
|
|
42
46
|
return excludeFullySelectedFormFilters(state, formFacet);
|
|
43
47
|
}
|
|
44
|
-
|
|
48
|
+
|
|
49
|
+
// Return current filters from state.
|
|
45
50
|
return state.filters;
|
|
46
51
|
}
|
|
47
52
|
|
|
@@ -115,16 +120,24 @@ export function isCatalogReady(catalog: string | undefined): boolean {
|
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
123
|
+
* Determines if the file manifest state is ready to be used in a request.
|
|
124
|
+
*
|
|
125
|
+
* The state is considered ready when:
|
|
126
|
+
* - isEnabled is true
|
|
127
|
+
* - fileCount is defined
|
|
128
|
+
* - isLoading is false
|
|
129
|
+
*
|
|
121
130
|
* @param fileManifestState - File manifest state.
|
|
122
|
-
* @returns true if the file manifest state is ready
|
|
131
|
+
* @returns true if the file manifest state is ready.
|
|
123
132
|
*/
|
|
124
133
|
export function isFileManifestStateReady(
|
|
125
134
|
fileManifestState: FileManifestState
|
|
126
135
|
): boolean {
|
|
127
|
-
return
|
|
136
|
+
return (
|
|
137
|
+
fileManifestState.isEnabled &&
|
|
138
|
+
fileManifestState.fileCount !== undefined &&
|
|
139
|
+
!fileManifestState.isLoading
|
|
140
|
+
);
|
|
128
141
|
}
|
|
129
142
|
|
|
130
143
|
/**
|
|
@@ -79,9 +79,11 @@ export const FILTERS: Record<string, Filters> = {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
export const FILE_MANIFEST_STATE = {
|
|
82
|
+
fileCount: 10,
|
|
82
83
|
filters: FILTERS.FORM_INITIAL_SET,
|
|
83
84
|
isEnabled: true,
|
|
84
85
|
isLoading: false,
|
|
86
|
+
summary: { fileCount: 10 },
|
|
85
87
|
} as FileManifestState;
|
|
86
88
|
|
|
87
89
|
export const FORM_FACET: Record<string, FormFacet> = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { DataDictionaryContext } from "./context";
|
|
3
|
+
import { DataDictionaryContextProps } from "./types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns data dictionary context.
|
|
7
|
+
* @returns data dictionary context.
|
|
8
|
+
*/
|
|
9
|
+
export const useDataDictionary = (): DataDictionaryContextProps => {
|
|
10
|
+
return useContext(DataDictionaryContext);
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { ClearMetaPayload } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Reducer function to handle the "clear meta" action.
|
|
6
|
+
* @param state - Data Dictionary State.
|
|
7
|
+
* @param payload - Payload.
|
|
8
|
+
* @returns data dictionary state.
|
|
9
|
+
*/
|
|
10
|
+
export function clearMetaAction(
|
|
11
|
+
state: DataDictionaryState,
|
|
12
|
+
payload: ClearMetaPayload
|
|
13
|
+
): DataDictionaryState {
|
|
14
|
+
return {
|
|
15
|
+
...state,
|
|
16
|
+
meta: payload,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
import { ClearMetaAction } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Action creator for clearing meta in the state.
|
|
6
|
+
* @returns Action with payload and action type.
|
|
7
|
+
*/
|
|
8
|
+
export function clearMeta(): ClearMetaAction {
|
|
9
|
+
return {
|
|
10
|
+
payload: null,
|
|
11
|
+
type: DataDictionaryActionKind.ClearMeta,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
2
|
+
import { DataDictionaryState } from "../../types";
|
|
3
|
+
import { ROUTER_METHOD, StateToUrlPayload } from "./types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Reducer function to handle the "state >> URL sync" action.
|
|
7
|
+
* @param state - State.
|
|
8
|
+
* @param payload - Payload.
|
|
9
|
+
* @returns state.
|
|
10
|
+
*/
|
|
11
|
+
export function stateToUrlAction(
|
|
12
|
+
state: DataDictionaryState,
|
|
13
|
+
payload: StateToUrlPayload
|
|
14
|
+
): DataDictionaryState {
|
|
15
|
+
const command =
|
|
16
|
+
payload.method === ROUTER_METHOD.PUSH
|
|
17
|
+
? META_COMMAND.STATE_TO_URL_PUSH
|
|
18
|
+
: META_COMMAND.STATE_TO_URL_REPLACE;
|
|
19
|
+
return { ...state, meta: { command } };
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
import { StateToUrlAction, StateToUrlPayload } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Action creator for state >> URL sync.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns Action with payload and action type.
|
|
8
|
+
*/
|
|
9
|
+
export function stateToUrl(payload: StateToUrlPayload): StateToUrlAction {
|
|
10
|
+
return {
|
|
11
|
+
payload,
|
|
12
|
+
type: DataDictionaryActionKind.StateToUrl,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
|
|
3
|
+
export enum ROUTER_METHOD {
|
|
4
|
+
PUSH = "push",
|
|
5
|
+
REPLACE = "replace",
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type StateToUrlAction = {
|
|
9
|
+
payload: StateToUrlPayload;
|
|
10
|
+
type: DataDictionaryActionKind.StateToUrl;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type StateToUrlPayload = {
|
|
14
|
+
method: ROUTER_METHOD;
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClearMetaAction } from "./clearMeta/types";
|
|
2
|
+
import { StateToUrlAction } from "./stateToUrl/types";
|
|
3
|
+
import { UpdateColumnFiltersAction } from "./updateColumnFilters/types";
|
|
4
|
+
import { UpdateGlobalFilterAction } from "./updateGlobalFilter/types";
|
|
5
|
+
import { UrlToStateAction } from "./urlToState/types";
|
|
6
|
+
|
|
7
|
+
export type DataDictionaryAction =
|
|
8
|
+
| ClearMetaAction
|
|
9
|
+
| StateToUrlAction
|
|
10
|
+
| UpdateColumnFiltersAction
|
|
11
|
+
| UpdateGlobalFilterAction
|
|
12
|
+
| UrlToStateAction;
|
|
13
|
+
|
|
14
|
+
export enum DataDictionaryActionKind {
|
|
15
|
+
ClearMeta = "CLEAR_META",
|
|
16
|
+
StateToUrl = "STATE_TO_URL",
|
|
17
|
+
UpdateColumnFilters = "UPDATE_COLUMN_FILTERS",
|
|
18
|
+
UpdateGlobalFilter = "UPDATE_GLOBAL_FILTER",
|
|
19
|
+
UrlToState = "URL_TO_STATE",
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
2
|
+
import { buildNextDictionaries } from "../../dictionaries/state";
|
|
3
|
+
import { DataDictionaryState } from "../../types";
|
|
4
|
+
import { UpdateColumnFiltersPayload } from "./types";
|
|
5
|
+
import { buildNextColumnFilters } from "./utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Reducer function to handle the "update column filters" action.
|
|
9
|
+
* @param state - Data dictionary state.
|
|
10
|
+
* @param payload - Payload.
|
|
11
|
+
* @returns data dictionary state.
|
|
12
|
+
*/
|
|
13
|
+
export function updateColumnFiltersAction(
|
|
14
|
+
state: DataDictionaryState,
|
|
15
|
+
payload: UpdateColumnFiltersPayload
|
|
16
|
+
): DataDictionaryState {
|
|
17
|
+
return {
|
|
18
|
+
...state,
|
|
19
|
+
dictionaries: buildNextDictionaries(state, payload.dictionary, {
|
|
20
|
+
columnFilters: buildNextColumnFilters(state, payload),
|
|
21
|
+
}),
|
|
22
|
+
meta: { command: META_COMMAND.STATE_TO_URL_PUSH },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
import { UpdateColumnFiltersAction, UpdateColumnFiltersPayload } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Action creator for updating column filters in the state.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns Action with payload and action type.
|
|
8
|
+
*/
|
|
9
|
+
export function updateColumnFilters(
|
|
10
|
+
payload: UpdateColumnFiltersPayload
|
|
11
|
+
): UpdateColumnFiltersAction {
|
|
12
|
+
return {
|
|
13
|
+
payload,
|
|
14
|
+
type: DataDictionaryActionKind.UpdateColumnFilters,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ColumnFiltersState, Updater } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryActionKind } from "../types";
|
|
3
|
+
|
|
4
|
+
export type UpdateColumnFiltersAction = {
|
|
5
|
+
payload: UpdateColumnFiltersPayload;
|
|
6
|
+
type: DataDictionaryActionKind.UpdateColumnFilters;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface UpdateColumnFiltersPayload {
|
|
10
|
+
dictionary: string;
|
|
11
|
+
updaterOrValue: Updater<ColumnFiltersState>;
|
|
12
|
+
}
|