@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,44 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { FileManifestActionKind } from "../../providers/fileManifestState";
|
|
3
|
+
import { useCatalog } from "../useCatalog";
|
|
4
|
+
import { useFileManifestState } from "../useFileManifestState";
|
|
5
|
+
import { useFetchSummary } from "./useFetchSummary";
|
|
6
|
+
/**
|
|
7
|
+
* Fetches the latest file count from the summary endpoint, excluding filters
|
|
8
|
+
* that match the provided species and file facet names, and updates the file manifest state.
|
|
9
|
+
*
|
|
10
|
+
* @param initialFilters - The initial set of filters to apply.
|
|
11
|
+
* @param speciesFacetName - The facet name representing species to exclude from the summary request.
|
|
12
|
+
* @param fileFacetName - The facet name representing file type to exclude from the summary request.
|
|
13
|
+
*/
|
|
14
|
+
export const useFileManifestFileCount = (initialFilters, speciesFacetName, fileFacetName) => {
|
|
15
|
+
// Initial file manifest filter.
|
|
16
|
+
const [initFilters] = useState(() => initialFilters);
|
|
17
|
+
// File manifest dispatch.
|
|
18
|
+
const { fileManifestDispatch } = useFileManifestState();
|
|
19
|
+
// Determine catalog.
|
|
20
|
+
const catalog = useCatalog(); // catalog should be defined.
|
|
21
|
+
// Get filters required for fetching the summary.
|
|
22
|
+
const filters = excludeFacetsFromFilters(initFilters, [
|
|
23
|
+
speciesFacetName,
|
|
24
|
+
fileFacetName,
|
|
25
|
+
]);
|
|
26
|
+
// Fetch file count from summary.
|
|
27
|
+
const { summary: { fileCount } = {} } = useFetchSummary(filters, catalog, true);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
fileManifestDispatch({
|
|
30
|
+
payload: { fileCount },
|
|
31
|
+
type: FileManifestActionKind.UpdateFileCount,
|
|
32
|
+
});
|
|
33
|
+
}, [fileCount, fileManifestDispatch]);
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Returns a new filters array with the specified facet names excluded.
|
|
37
|
+
*
|
|
38
|
+
* @param filters - The list of filters to process.
|
|
39
|
+
* @param facetNames - The facet names to exclude from the filters.
|
|
40
|
+
* @returns The filters array excluding any filters matching the provided facet names.
|
|
41
|
+
*/
|
|
42
|
+
function excludeFacetsFromFilters(filters, facetNames) {
|
|
43
|
+
return (filters || []).filter(({ categoryKey }) => !facetNames.includes(categoryKey));
|
|
44
|
+
}
|
|
@@ -4,18 +4,21 @@ import { FormFacet } from "../../components/Export/common/entities";
|
|
|
4
4
|
import { FileManifestState } from "../../providers/fileManifestState";
|
|
5
5
|
import { UseRequestManifest } from "./types";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
7
|
+
* Determines whether all files are selected by comparing the file count to the summary file count.
|
|
8
|
+
*
|
|
9
|
+
* @param state - The file manifest state object.
|
|
10
|
+
* @returns True if all files are selected; otherwise, false.
|
|
10
11
|
*/
|
|
11
|
-
export declare function
|
|
12
|
+
export declare function areAllFilesSelected(state: FileManifestState): boolean;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
14
|
+
* Builds the filters object for a request URL based on the file manifest state and form facets.
|
|
15
|
+
*
|
|
16
|
+
* - If all files are selected, returns filters from state excluding fully selected form filters.
|
|
17
|
+
* - If only some files are selected, returns the current filters from state.
|
|
18
|
+
*
|
|
19
|
+
* @param state - The file manifest state object.
|
|
20
|
+
* @param formFacet - The form-related file facets.
|
|
21
|
+
* @returns The filters to use for the request URL.
|
|
19
22
|
*/
|
|
20
23
|
export declare function buildRequestFilters(state: FileManifestState, formFacet: FormFacet): Filters;
|
|
21
24
|
/**
|
|
@@ -42,11 +45,15 @@ export declare function excludeFullySelectedFormFilters(state: FileManifestState
|
|
|
42
45
|
*/
|
|
43
46
|
export declare function isCatalogReady(catalog: string | undefined): boolean;
|
|
44
47
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
+
* Determines if the file manifest state is ready to be used in a request.
|
|
49
|
+
*
|
|
50
|
+
* The state is considered ready when:
|
|
51
|
+
* - isEnabled is true
|
|
52
|
+
* - fileCount is defined
|
|
53
|
+
* - isLoading is false
|
|
54
|
+
*
|
|
48
55
|
* @param fileManifestState - File manifest state.
|
|
49
|
-
* @returns true if the file manifest state is ready
|
|
56
|
+
* @returns true if the file manifest state is ready.
|
|
50
57
|
*/
|
|
51
58
|
export declare function isFileManifestStateReady(fileManifestState: FileManifestState): boolean;
|
|
52
59
|
/**
|
|
@@ -2,29 +2,35 @@ import { AZUL_PARAM, MANIFEST_DOWNLOAD_FORMAT, } from "../../apis/azul/common/en
|
|
|
2
2
|
import { transformFilters } from "../../apis/azul/common/filterTransformer";
|
|
3
3
|
import { REQUEST_MANIFEST } from "./constants";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
5
|
+
* Determines whether all files are selected by comparing the file count to the summary file count.
|
|
6
|
+
*
|
|
7
|
+
* @param state - The file manifest state object.
|
|
8
|
+
* @returns True if all files are selected; otherwise, false.
|
|
8
9
|
*/
|
|
9
|
-
export function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export function areAllFilesSelected(state) {
|
|
11
|
+
const { fileCount, summary } = state;
|
|
12
|
+
// Return false if file count or summary file count is undefined.
|
|
13
|
+
if (fileCount === undefined || summary?.fileCount === undefined)
|
|
14
|
+
return false;
|
|
15
|
+
// Return true if file count equals summary file count.
|
|
16
|
+
return fileCount === summary.fileCount;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* -
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
19
|
+
* Builds the filters object for a request URL based on the file manifest state and form facets.
|
|
20
|
+
*
|
|
21
|
+
* - If all files are selected, returns filters from state excluding fully selected form filters.
|
|
22
|
+
* - If only some files are selected, returns the current filters from state.
|
|
23
|
+
*
|
|
24
|
+
* @param state - The file manifest state object.
|
|
25
|
+
* @param formFacet - The form-related file facets.
|
|
26
|
+
* @returns The filters to use for the request URL.
|
|
21
27
|
*/
|
|
22
28
|
export function buildRequestFilters(state, formFacet) {
|
|
23
|
-
//
|
|
24
|
-
if (
|
|
29
|
+
// Return filters from state excluding form filters if all files are selected.
|
|
30
|
+
if (areAllFilesSelected(state)) {
|
|
25
31
|
return excludeFullySelectedFormFilters(state, formFacet);
|
|
26
32
|
}
|
|
27
|
-
//
|
|
33
|
+
// Return current filters from state.
|
|
28
34
|
return state.filters;
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
@@ -84,14 +90,20 @@ export function isCatalogReady(catalog) {
|
|
|
84
90
|
return typeof catalog === "string";
|
|
85
91
|
}
|
|
86
92
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
93
|
+
* Determines if the file manifest state is ready to be used in a request.
|
|
94
|
+
*
|
|
95
|
+
* The state is considered ready when:
|
|
96
|
+
* - isEnabled is true
|
|
97
|
+
* - fileCount is defined
|
|
98
|
+
* - isLoading is false
|
|
99
|
+
*
|
|
90
100
|
* @param fileManifestState - File manifest state.
|
|
91
|
-
* @returns true if the file manifest state is ready
|
|
101
|
+
* @returns true if the file manifest state is ready.
|
|
92
102
|
*/
|
|
93
103
|
export function isFileManifestStateReady(fileManifestState) {
|
|
94
|
-
return fileManifestState.isEnabled &&
|
|
104
|
+
return (fileManifestState.isEnabled &&
|
|
105
|
+
fileManifestState.fileCount !== undefined &&
|
|
106
|
+
!fileManifestState.isLoading);
|
|
95
107
|
}
|
|
96
108
|
/**
|
|
97
109
|
* Checks if the file manifest format is ready for use.
|
|
@@ -59,9 +59,11 @@ export const FILTERS = {
|
|
|
59
59
|
FORM_SUBSET: [FILTER_FILES_SUBSET, FILTER_OTHER, FILTER_SPECIES],
|
|
60
60
|
};
|
|
61
61
|
export const FILE_MANIFEST_STATE = {
|
|
62
|
+
fileCount: 10,
|
|
62
63
|
filters: FILTERS.FORM_INITIAL_SET,
|
|
63
64
|
isEnabled: true,
|
|
64
65
|
isLoading: false,
|
|
66
|
+
summary: { fileCount: 10 },
|
|
65
67
|
};
|
|
66
68
|
export const FORM_FACET = {
|
|
67
69
|
COMPLETE_SET: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { DataDictionaryContext } from "./context";
|
|
3
|
+
/**
|
|
4
|
+
* Returns data dictionary context.
|
|
5
|
+
* @returns data dictionary context.
|
|
6
|
+
*/
|
|
7
|
+
export const useDataDictionary = () => {
|
|
8
|
+
return useContext(DataDictionaryContext);
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { ClearMetaPayload } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "clear meta" action.
|
|
5
|
+
* @param state - Data Dictionary State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns data dictionary state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function clearMetaAction(state: DataDictionaryState, payload: ClearMetaPayload): DataDictionaryState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reducer function to handle the "clear meta" action.
|
|
3
|
+
* @param state - Data Dictionary State.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns data dictionary state.
|
|
6
|
+
*/
|
|
7
|
+
export function clearMetaAction(state, payload) {
|
|
8
|
+
return {
|
|
9
|
+
...state,
|
|
10
|
+
meta: payload,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for clearing meta in the state.
|
|
4
|
+
* @returns Action with payload and action type.
|
|
5
|
+
*/
|
|
6
|
+
export function clearMeta() {
|
|
7
|
+
return {
|
|
8
|
+
payload: null,
|
|
9
|
+
type: DataDictionaryActionKind.ClearMeta,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { StateToUrlPayload } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "state >> URL sync" action.
|
|
5
|
+
* @param state - State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stateToUrlAction(state: DataDictionaryState, payload: StateToUrlPayload): DataDictionaryState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
2
|
+
import { ROUTER_METHOD } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "state >> URL sync" action.
|
|
5
|
+
* @param state - State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns state.
|
|
8
|
+
*/
|
|
9
|
+
export function stateToUrlAction(state, payload) {
|
|
10
|
+
const command = payload.method === ROUTER_METHOD.PUSH
|
|
11
|
+
? META_COMMAND.STATE_TO_URL_PUSH
|
|
12
|
+
: META_COMMAND.STATE_TO_URL_REPLACE;
|
|
13
|
+
return { ...state, meta: { command } };
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StateToUrlAction, StateToUrlPayload } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for state >> URL sync.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns Action with payload and action type.
|
|
6
|
+
*/
|
|
7
|
+
export declare function stateToUrl(payload: StateToUrlPayload): StateToUrlAction;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for state >> URL sync.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns Action with payload and action type.
|
|
6
|
+
*/
|
|
7
|
+
export function stateToUrl(payload) {
|
|
8
|
+
return {
|
|
9
|
+
payload,
|
|
10
|
+
type: DataDictionaryActionKind.StateToUrl,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
export declare enum ROUTER_METHOD {
|
|
3
|
+
PUSH = "push",
|
|
4
|
+
REPLACE = "replace"
|
|
5
|
+
}
|
|
6
|
+
export type StateToUrlAction = {
|
|
7
|
+
payload: StateToUrlPayload;
|
|
8
|
+
type: DataDictionaryActionKind.StateToUrl;
|
|
9
|
+
};
|
|
10
|
+
export type StateToUrlPayload = {
|
|
11
|
+
method: ROUTER_METHOD;
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export type DataDictionaryAction = ClearMetaAction | StateToUrlAction | UpdateColumnFiltersAction | UpdateGlobalFilterAction | UrlToStateAction;
|
|
7
|
+
export declare enum DataDictionaryActionKind {
|
|
8
|
+
ClearMeta = "CLEAR_META",
|
|
9
|
+
StateToUrl = "STATE_TO_URL",
|
|
10
|
+
UpdateColumnFilters = "UPDATE_COLUMN_FILTERS",
|
|
11
|
+
UpdateGlobalFilter = "UPDATE_GLOBAL_FILTER",
|
|
12
|
+
UrlToState = "URL_TO_STATE"
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var DataDictionaryActionKind;
|
|
2
|
+
(function (DataDictionaryActionKind) {
|
|
3
|
+
DataDictionaryActionKind["ClearMeta"] = "CLEAR_META";
|
|
4
|
+
DataDictionaryActionKind["StateToUrl"] = "STATE_TO_URL";
|
|
5
|
+
DataDictionaryActionKind["UpdateColumnFilters"] = "UPDATE_COLUMN_FILTERS";
|
|
6
|
+
DataDictionaryActionKind["UpdateGlobalFilter"] = "UPDATE_GLOBAL_FILTER";
|
|
7
|
+
DataDictionaryActionKind["UrlToState"] = "URL_TO_STATE";
|
|
8
|
+
})(DataDictionaryActionKind || (DataDictionaryActionKind = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { UpdateColumnFiltersPayload } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "update column filters" action.
|
|
5
|
+
* @param state - Data dictionary state.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns data dictionary state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function updateColumnFiltersAction(state: DataDictionaryState, payload: UpdateColumnFiltersPayload): DataDictionaryState;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
2
|
+
import { buildNextDictionaries } from "../../dictionaries/state";
|
|
3
|
+
import { buildNextColumnFilters } from "./utils";
|
|
4
|
+
/**
|
|
5
|
+
* Reducer function to handle the "update column filters" action.
|
|
6
|
+
* @param state - Data dictionary state.
|
|
7
|
+
* @param payload - Payload.
|
|
8
|
+
* @returns data dictionary state.
|
|
9
|
+
*/
|
|
10
|
+
export function updateColumnFiltersAction(state, payload) {
|
|
11
|
+
return {
|
|
12
|
+
...state,
|
|
13
|
+
dictionaries: buildNextDictionaries(state, payload.dictionary, {
|
|
14
|
+
columnFilters: buildNextColumnFilters(state, payload),
|
|
15
|
+
}),
|
|
16
|
+
meta: { command: META_COMMAND.STATE_TO_URL_PUSH },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UpdateColumnFiltersAction, UpdateColumnFiltersPayload } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for updating column filters in the state.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns Action with payload and action type.
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateColumnFilters(payload: UpdateColumnFiltersPayload): UpdateColumnFiltersAction;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for updating column filters in the state.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns Action with payload and action type.
|
|
6
|
+
*/
|
|
7
|
+
export function updateColumnFilters(payload) {
|
|
8
|
+
return {
|
|
9
|
+
payload,
|
|
10
|
+
type: DataDictionaryActionKind.UpdateColumnFilters,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnFiltersState, Updater } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryActionKind } from "../types";
|
|
3
|
+
export type UpdateColumnFiltersAction = {
|
|
4
|
+
payload: UpdateColumnFiltersPayload;
|
|
5
|
+
type: DataDictionaryActionKind.UpdateColumnFilters;
|
|
6
|
+
};
|
|
7
|
+
export interface UpdateColumnFiltersPayload {
|
|
8
|
+
dictionary: string;
|
|
9
|
+
updaterOrValue: Updater<ColumnFiltersState>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnFiltersState } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryState } from "../../types";
|
|
3
|
+
import { UpdateColumnFiltersPayload } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Builds the next column filters state for the current dictionary.
|
|
6
|
+
* Uses TanStack updater to update the column filters state.
|
|
7
|
+
* @param state - State.
|
|
8
|
+
* @param payload - Payload.
|
|
9
|
+
* @returns column filters state.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildNextColumnFilters(state: DataDictionaryState, payload: UpdateColumnFiltersPayload): ColumnFiltersState;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { functionalUpdate } from "@tanstack/react-table";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the next column filters state for the current dictionary.
|
|
4
|
+
* Uses TanStack updater to update the column filters state.
|
|
5
|
+
* @param state - State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns column filters state.
|
|
8
|
+
*/
|
|
9
|
+
export function buildNextColumnFilters(state, payload) {
|
|
10
|
+
return functionalUpdate(payload.updaterOrValue, getOldColumnFilters(state, payload));
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves the current "old" column filters state.
|
|
14
|
+
* @param state - State.
|
|
15
|
+
* @param payload - Payload.
|
|
16
|
+
* @returns old column filters state.
|
|
17
|
+
*/
|
|
18
|
+
function getOldColumnFilters(state, payload) {
|
|
19
|
+
// Grab the dictionary.
|
|
20
|
+
const dictionary = state.dictionaries[payload.dictionary];
|
|
21
|
+
// If the dictionary is not found, return an empty array.
|
|
22
|
+
if (!dictionary)
|
|
23
|
+
return [];
|
|
24
|
+
// Grab column filters from dictionary state.
|
|
25
|
+
const { columnFilters = [] } = dictionary.state;
|
|
26
|
+
return columnFilters;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { UpdateGlobalFilterPayload } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "update global filter" action.
|
|
5
|
+
* @param state - State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function updateGlobalFilterAction(state: DataDictionaryState, payload: UpdateGlobalFilterPayload): DataDictionaryState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { buildNextDictionaries } from "../../dictionaries/state";
|
|
2
|
+
import { buildNextGlobalFilter, buildNextMeta } from "./utils";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "update global filter" action.
|
|
5
|
+
* @param state - State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns state.
|
|
8
|
+
*/
|
|
9
|
+
export function updateGlobalFilterAction(state, payload) {
|
|
10
|
+
const globalFilter = buildNextGlobalFilter(payload);
|
|
11
|
+
const meta = buildNextMeta(state, payload, globalFilter);
|
|
12
|
+
return {
|
|
13
|
+
...state,
|
|
14
|
+
dictionaries: buildNextDictionaries(state, payload.dictionary, {
|
|
15
|
+
globalFilter,
|
|
16
|
+
}),
|
|
17
|
+
meta,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UpdateGlobalFilterAction, UpdateGlobalFilterPayload } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for updating global filter in the state.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns Action with payload and action type.
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateGlobalFilter(payload: UpdateGlobalFilterPayload): UpdateGlobalFilterAction;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Action creator for updating global filter in the state.
|
|
4
|
+
* @param payload - Payload.
|
|
5
|
+
* @returns Action with payload and action type.
|
|
6
|
+
*/
|
|
7
|
+
export function updateGlobalFilter(payload) {
|
|
8
|
+
return {
|
|
9
|
+
payload,
|
|
10
|
+
type: DataDictionaryActionKind.UpdateGlobalFilter,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Updater } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryActionKind } from "../types";
|
|
3
|
+
export type UpdateGlobalFilterAction = {
|
|
4
|
+
payload: UpdateGlobalFilterPayload;
|
|
5
|
+
type: DataDictionaryActionKind.UpdateGlobalFilter;
|
|
6
|
+
};
|
|
7
|
+
export interface UpdateGlobalFilterPayload {
|
|
8
|
+
dictionary: string;
|
|
9
|
+
updaterOrValue: Updater<string | undefined>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { UpdateGlobalFilterPayload } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the next global filter state for the current dictionary.
|
|
5
|
+
* Uses TanStack updater to update the global filter state.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns global filter state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildNextGlobalFilter(payload: UpdateGlobalFilterPayload): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Builds the next meta state for the current dictionary.
|
|
12
|
+
* @param state - State.
|
|
13
|
+
* @param payload - Payload.
|
|
14
|
+
* @param nextGlobalFilter - Next global filter.
|
|
15
|
+
* @returns meta state.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildNextMeta(state: DataDictionaryState, payload: UpdateGlobalFilterPayload, nextGlobalFilter: string | undefined): DataDictionaryState["meta"];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { functionalUpdate } from "@tanstack/react-table";
|
|
2
|
+
import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the next global filter state for the current dictionary.
|
|
5
|
+
* Uses TanStack updater to update the global filter state.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns global filter state.
|
|
8
|
+
*/
|
|
9
|
+
export function buildNextGlobalFilter(payload) {
|
|
10
|
+
return functionalUpdate(payload.updaterOrValue, undefined) || undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds the next meta state for the current dictionary.
|
|
14
|
+
* @param state - State.
|
|
15
|
+
* @param payload - Payload.
|
|
16
|
+
* @param nextGlobalFilter - Next global filter.
|
|
17
|
+
* @returns meta state.
|
|
18
|
+
*/
|
|
19
|
+
export function buildNextMeta(state, payload, nextGlobalFilter) {
|
|
20
|
+
const currentGlobalFilter = getCurrentGlobalFilter(state, payload);
|
|
21
|
+
// Use PUSH method with adding or removing the global filter.
|
|
22
|
+
if (currentGlobalFilter === undefined || nextGlobalFilter === undefined) {
|
|
23
|
+
return { command: META_COMMAND.STATE_TO_URL_PUSH };
|
|
24
|
+
}
|
|
25
|
+
// Use REPLACE method with edits to the global filter.
|
|
26
|
+
return { command: META_COMMAND.STATE_TO_URL_REPLACE };
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the current global filter for the current dictionary.
|
|
30
|
+
* @param state - State.
|
|
31
|
+
* @param payload - Payload.
|
|
32
|
+
* @returns global filter.
|
|
33
|
+
*/
|
|
34
|
+
function getCurrentGlobalFilter(state, payload) {
|
|
35
|
+
return state.dictionaries[payload.dictionary].state.globalFilter;
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataDictionaryState } from "../../types";
|
|
2
|
+
import { UrlToStatePayload } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer function to handle the "URL >> state sync" action.
|
|
5
|
+
* @param state - State.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function urlToStateAction(state: DataDictionaryState, payload: UrlToStatePayload): DataDictionaryState;
|