@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,41 @@
|
|
|
1
|
+
import { ColumnFiltersState, functionalUpdate } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryState } from "../../types";
|
|
3
|
+
import { UpdateColumnFiltersPayload } from "./types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Builds the next column filters state for the current dictionary.
|
|
7
|
+
* Uses TanStack updater to update the column filters state.
|
|
8
|
+
* @param state - State.
|
|
9
|
+
* @param payload - Payload.
|
|
10
|
+
* @returns column filters state.
|
|
11
|
+
*/
|
|
12
|
+
export function buildNextColumnFilters(
|
|
13
|
+
state: DataDictionaryState,
|
|
14
|
+
payload: UpdateColumnFiltersPayload
|
|
15
|
+
): ColumnFiltersState {
|
|
16
|
+
return functionalUpdate(
|
|
17
|
+
payload.updaterOrValue,
|
|
18
|
+
getOldColumnFilters(state, payload)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the current "old" column filters state.
|
|
24
|
+
* @param state - State.
|
|
25
|
+
* @param payload - Payload.
|
|
26
|
+
* @returns old column filters state.
|
|
27
|
+
*/
|
|
28
|
+
function getOldColumnFilters(
|
|
29
|
+
state: DataDictionaryState,
|
|
30
|
+
payload: UpdateColumnFiltersPayload
|
|
31
|
+
): ColumnFiltersState {
|
|
32
|
+
// Grab the dictionary.
|
|
33
|
+
const dictionary = state.dictionaries[payload.dictionary];
|
|
34
|
+
|
|
35
|
+
// If the dictionary is not found, return an empty array.
|
|
36
|
+
if (!dictionary) return [];
|
|
37
|
+
|
|
38
|
+
// Grab column filters from dictionary state.
|
|
39
|
+
const { columnFilters = [] } = dictionary.state;
|
|
40
|
+
return columnFilters;
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { buildNextDictionaries } from "../../dictionaries/state";
|
|
2
|
+
import { DataDictionaryState } from "../../types";
|
|
3
|
+
import { UpdateGlobalFilterPayload } from "./types";
|
|
4
|
+
import { buildNextGlobalFilter, buildNextMeta } from "./utils";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reducer function to handle the "update global filter" action.
|
|
8
|
+
* @param state - State.
|
|
9
|
+
* @param payload - Payload.
|
|
10
|
+
* @returns state.
|
|
11
|
+
*/
|
|
12
|
+
export function updateGlobalFilterAction(
|
|
13
|
+
state: DataDictionaryState,
|
|
14
|
+
payload: UpdateGlobalFilterPayload
|
|
15
|
+
): DataDictionaryState {
|
|
16
|
+
const globalFilter = buildNextGlobalFilter(payload);
|
|
17
|
+
const meta = buildNextMeta(state, payload, globalFilter);
|
|
18
|
+
return {
|
|
19
|
+
...state,
|
|
20
|
+
dictionaries: buildNextDictionaries(state, payload.dictionary, {
|
|
21
|
+
globalFilter,
|
|
22
|
+
}),
|
|
23
|
+
meta,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
import { UpdateGlobalFilterAction, UpdateGlobalFilterPayload } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Action creator for updating global filter in the state.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns Action with payload and action type.
|
|
8
|
+
*/
|
|
9
|
+
export function updateGlobalFilter(
|
|
10
|
+
payload: UpdateGlobalFilterPayload
|
|
11
|
+
): UpdateGlobalFilterAction {
|
|
12
|
+
return {
|
|
13
|
+
payload,
|
|
14
|
+
type: DataDictionaryActionKind.UpdateGlobalFilter,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Updater } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryActionKind } from "../types";
|
|
3
|
+
|
|
4
|
+
export type UpdateGlobalFilterAction = {
|
|
5
|
+
payload: UpdateGlobalFilterPayload;
|
|
6
|
+
type: DataDictionaryActionKind.UpdateGlobalFilter;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface UpdateGlobalFilterPayload {
|
|
10
|
+
dictionary: string;
|
|
11
|
+
updaterOrValue: Updater<string | undefined>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { functionalUpdate } from "@tanstack/react-table";
|
|
2
|
+
import { META_COMMAND } from "../../../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
3
|
+
import { DataDictionaryState } from "../../types";
|
|
4
|
+
import { UpdateGlobalFilterPayload } from "./types";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Builds the next global filter state for the current dictionary.
|
|
8
|
+
* Uses TanStack updater to update the global filter state.
|
|
9
|
+
* @param payload - Payload.
|
|
10
|
+
* @returns global filter state.
|
|
11
|
+
*/
|
|
12
|
+
export function buildNextGlobalFilter(
|
|
13
|
+
payload: UpdateGlobalFilterPayload
|
|
14
|
+
): string | undefined {
|
|
15
|
+
return functionalUpdate(payload.updaterOrValue, undefined) || undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Builds the next meta state for the current dictionary.
|
|
20
|
+
* @param state - State.
|
|
21
|
+
* @param payload - Payload.
|
|
22
|
+
* @param nextGlobalFilter - Next global filter.
|
|
23
|
+
* @returns meta state.
|
|
24
|
+
*/
|
|
25
|
+
export function buildNextMeta(
|
|
26
|
+
state: DataDictionaryState,
|
|
27
|
+
payload: UpdateGlobalFilterPayload,
|
|
28
|
+
nextGlobalFilter: string | undefined
|
|
29
|
+
): DataDictionaryState["meta"] {
|
|
30
|
+
const currentGlobalFilter = getCurrentGlobalFilter(state, payload);
|
|
31
|
+
// Use PUSH method with adding or removing the global filter.
|
|
32
|
+
if (currentGlobalFilter === undefined || nextGlobalFilter === undefined) {
|
|
33
|
+
return { command: META_COMMAND.STATE_TO_URL_PUSH };
|
|
34
|
+
}
|
|
35
|
+
// Use REPLACE method with edits to the global filter.
|
|
36
|
+
return { command: META_COMMAND.STATE_TO_URL_REPLACE };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns the current global filter for the current dictionary.
|
|
41
|
+
* @param state - State.
|
|
42
|
+
* @param payload - Payload.
|
|
43
|
+
* @returns global filter.
|
|
44
|
+
*/
|
|
45
|
+
function getCurrentGlobalFilter(
|
|
46
|
+
state: DataDictionaryState,
|
|
47
|
+
payload: UpdateGlobalFilterPayload
|
|
48
|
+
): string | undefined {
|
|
49
|
+
return state.dictionaries[payload.dictionary].state.globalFilter;
|
|
50
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { parseJsonQueryParam } from "../../../../utils/parseJsonQueryParam";
|
|
2
|
+
import { DATA_DICTIONARY_URL_PARAMS } from "../../dictionaries/constants";
|
|
3
|
+
import { buildNextDictionaries } from "../../dictionaries/state";
|
|
4
|
+
import { DataDictionaryState } from "../../types";
|
|
5
|
+
import { UrlToStatePayload } from "./types";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Reducer function to handle the "URL >> state sync" action.
|
|
9
|
+
* @param state - State.
|
|
10
|
+
* @param payload - Payload.
|
|
11
|
+
* @returns state.
|
|
12
|
+
*/
|
|
13
|
+
export function urlToStateAction(
|
|
14
|
+
state: DataDictionaryState,
|
|
15
|
+
payload: UrlToStatePayload
|
|
16
|
+
): DataDictionaryState {
|
|
17
|
+
if (typeof payload.query.dictionary !== "string") return state;
|
|
18
|
+
return {
|
|
19
|
+
...state,
|
|
20
|
+
dictionaries: buildNextDictionaries(state, payload.query.dictionary, {
|
|
21
|
+
columnFilters: parseJsonQueryParam(
|
|
22
|
+
payload.query[DATA_DICTIONARY_URL_PARAMS.COLUMN_FILTERS],
|
|
23
|
+
[]
|
|
24
|
+
),
|
|
25
|
+
globalFilter: payload.query[DATA_DICTIONARY_URL_PARAMS.GLOBAL_FILTER],
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataDictionaryActionKind } from "../types";
|
|
2
|
+
import { UrlToStateAction, UrlToStatePayload } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Action creator for URL >> state sync.
|
|
6
|
+
* @param payload - Payload.
|
|
7
|
+
* @returns Action with payload and action type.
|
|
8
|
+
*/
|
|
9
|
+
export function urlToState(payload: UrlToStatePayload): UrlToStateAction {
|
|
10
|
+
return {
|
|
11
|
+
payload,
|
|
12
|
+
type: DataDictionaryActionKind.UrlToState,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NextRouter } from "next/router";
|
|
2
|
+
import { DataDictionaryActionKind } from "../types";
|
|
3
|
+
|
|
4
|
+
export type UrlToStateAction = {
|
|
5
|
+
payload: UrlToStatePayload;
|
|
6
|
+
type: DataDictionaryActionKind.UrlToState;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type UrlToStatePayload = {
|
|
10
|
+
query: NextRouter["query"];
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import { INITIAL_DATA_DICTIONARY_STATE } from "./initializer/constants";
|
|
3
|
+
import { DataDictionaryStateContextProps } from "./types";
|
|
4
|
+
|
|
5
|
+
export const DataDictionaryStateContext =
|
|
6
|
+
createContext<DataDictionaryStateContextProps>({
|
|
7
|
+
dataDictionaryDispatch: null,
|
|
8
|
+
dataDictionaryState: INITIAL_DATA_DICTIONARY_STATE,
|
|
9
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TableState } from "@tanstack/react-table";
|
|
2
|
+
import { stateToUrlQuery } from "../../../utils/stateToUrlQuery";
|
|
3
|
+
import { DataDictionaryState } from "../types";
|
|
4
|
+
import { DictionariesContext } from "./types";
|
|
5
|
+
import { extractDictionaryUrlState as extractUrlState } from "./utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Builds the next dictionaries context.
|
|
9
|
+
* @param state - State.
|
|
10
|
+
* @param dictionaryKey - Dictionary key.
|
|
11
|
+
* @param nextDictionaryState - Next dictionary state.
|
|
12
|
+
* @returns Next dictionaries context.
|
|
13
|
+
*/
|
|
14
|
+
export function buildNextDictionaries(
|
|
15
|
+
state: DataDictionaryState,
|
|
16
|
+
dictionaryKey: string,
|
|
17
|
+
nextDictionaryState: Partial<TableState>
|
|
18
|
+
): DictionariesContext {
|
|
19
|
+
// Clone the dictionaries.
|
|
20
|
+
const dictionaries: DictionariesContext = { ...state.dictionaries };
|
|
21
|
+
|
|
22
|
+
for (const [key, dictionary] of Object.entries(dictionaries)) {
|
|
23
|
+
// Clone the dictionary context.
|
|
24
|
+
const dictionaryContext = { ...dictionary };
|
|
25
|
+
|
|
26
|
+
// If the dictionary key is a match, update the dictionary context.
|
|
27
|
+
if (key === dictionaryKey) {
|
|
28
|
+
// Update the dictionary state.
|
|
29
|
+
dictionaryContext.state = { ...dictionary.state, ...nextDictionaryState };
|
|
30
|
+
|
|
31
|
+
// Grab param values from the updated dictionary state.
|
|
32
|
+
const { columnFilters, globalFilter } = dictionaryContext.state;
|
|
33
|
+
|
|
34
|
+
// Update the dictionary query.
|
|
35
|
+
dictionaryContext.query = stateToUrlQuery(
|
|
36
|
+
extractUrlState(key, { columnFilters, globalFilter })
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Update the dictionary context.
|
|
41
|
+
dictionaries[key] = dictionaryContext;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return dictionaries;
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TableState } from "@tanstack/react-table";
|
|
2
|
+
import { NextRouter } from "next/router";
|
|
3
|
+
|
|
4
|
+
export interface DictionariesContext {
|
|
5
|
+
[key: string]: DictionaryContext;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface DictionaryContext {
|
|
9
|
+
query: NextRouter["query"];
|
|
10
|
+
state: Partial<TableState>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ColumnFiltersState, TableState } from "@tanstack/react-table";
|
|
2
|
+
import { DATA_DICTIONARY_URL_PARAMS } from "./constants";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Extracts dictionary state properties that should be synchronized with URL parameters.
|
|
6
|
+
* This function maps specific properties from the dictionary state to a format
|
|
7
|
+
* that can be used to generate URL query parameters.
|
|
8
|
+
* The extracted properties are:
|
|
9
|
+
* - dictionary: Dictionary key (string).
|
|
10
|
+
* - filter: Applied column filters (ColumnFiltersState).
|
|
11
|
+
* - search: Applied global filter (GlobalFilterTableState) - typed as string or undefined.
|
|
12
|
+
* @param dictionary - Dictionary key.
|
|
13
|
+
* @param state - Dictionary table state.
|
|
14
|
+
* @returns Object with properties ready for URL query serialization.
|
|
15
|
+
*/
|
|
16
|
+
export function extractDictionaryUrlState(
|
|
17
|
+
dictionary: string,
|
|
18
|
+
state: Partial<TableState>
|
|
19
|
+
): Record<string, string | ColumnFiltersState | undefined> {
|
|
20
|
+
return {
|
|
21
|
+
dictionary,
|
|
22
|
+
[DATA_DICTIONARY_URL_PARAMS.COLUMN_FILTERS]: state.columnFilters || [],
|
|
23
|
+
[DATA_DICTIONARY_URL_PARAMS.GLOBAL_FILTER]: state.globalFilter,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DataDictionaryConfig } from "../../../../common/entities";
|
|
2
|
+
import { useConfig } from "../../../../hooks/useConfig";
|
|
3
|
+
import { UseDataDictionaryInitialArgs } from "./types";
|
|
4
|
+
|
|
5
|
+
export const useDataDictionaryInitialArgs =
|
|
6
|
+
(): UseDataDictionaryInitialArgs => {
|
|
7
|
+
const { config } = useConfig();
|
|
8
|
+
|
|
9
|
+
const dataDictionaries = config.dataDictionaries as
|
|
10
|
+
| DataDictionaryConfig[]
|
|
11
|
+
| undefined;
|
|
12
|
+
|
|
13
|
+
return { dataDictionaries };
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useReducer } from "react";
|
|
2
|
+
import { initializer } from "../../initializer/initializer";
|
|
3
|
+
import { dataDictionaryReducer } from "../../reducer";
|
|
4
|
+
import { DataDictionaryStateContextProps } from "../../types";
|
|
5
|
+
import { useDataDictionaryInitialArgs } from "../UseDataDictionaryInitialArgs/hook";
|
|
6
|
+
|
|
7
|
+
export const useDataDictionaryReducer = (): DataDictionaryStateContextProps => {
|
|
8
|
+
const initialArgs = useDataDictionaryInitialArgs();
|
|
9
|
+
|
|
10
|
+
const [dataDictionaryState, dataDictionaryDispatch] = useReducer(
|
|
11
|
+
dataDictionaryReducer,
|
|
12
|
+
initialArgs,
|
|
13
|
+
initializer
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
return { dataDictionaryDispatch, dataDictionaryState };
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { DataDictionaryStateContext } from "../../context";
|
|
3
|
+
import { DataDictionaryStateContextProps } from "../../types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns data dictionary state context.
|
|
7
|
+
* @returns data dictionary state context.
|
|
8
|
+
*/
|
|
9
|
+
export const useDataDictionaryState = (): DataDictionaryStateContextProps => {
|
|
10
|
+
return useContext(DataDictionaryStateContext);
|
|
11
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UseDataDictionaryInitialArgs } from "../hooks/UseDataDictionaryInitialArgs/types";
|
|
2
|
+
import { DataDictionaryState } from "../types";
|
|
3
|
+
import { INITIAL_DATA_DICTIONARY_STATE } from "./constants";
|
|
4
|
+
import { initDictionaries } from "./utils";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Initializer function for the data dictionary reducer, returning initial state.
|
|
8
|
+
* @param initialArgs - Initial arguments.
|
|
9
|
+
* @param initialArgs.dataDictionaries - Data dictionary configs.
|
|
10
|
+
* @returns The initialized data dictionary state.
|
|
11
|
+
*/
|
|
12
|
+
export function initializer({
|
|
13
|
+
dataDictionaries,
|
|
14
|
+
}: UseDataDictionaryInitialArgs): DataDictionaryState {
|
|
15
|
+
// If no data dictionary configs are provided, return default initial state.
|
|
16
|
+
if (!dataDictionaries) return INITIAL_DATA_DICTIONARY_STATE;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
dictionaries: initDictionaries(dataDictionaries),
|
|
20
|
+
meta: null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TableState } from "@tanstack/react-table";
|
|
2
|
+
import { DataDictionaryConfig } from "../../../common/entities";
|
|
3
|
+
import { initPaginationState } from "../../../components/Table/coreOptions/state/pagination/utils";
|
|
4
|
+
import { DictionariesContext } from "../dictionaries/types";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the dictionaries context.
|
|
8
|
+
* @param dataDictionaries - The data dictionary configs.
|
|
9
|
+
* @returns The initialized dictionaries context.
|
|
10
|
+
*/
|
|
11
|
+
export function initDictionaries(
|
|
12
|
+
dataDictionaries: DataDictionaryConfig[]
|
|
13
|
+
): DictionariesContext {
|
|
14
|
+
return dataDictionaries.reduce((acc, { path, tableOptions }) => {
|
|
15
|
+
acc[path] = {
|
|
16
|
+
query: { dictionary: path },
|
|
17
|
+
state: initState(tableOptions),
|
|
18
|
+
};
|
|
19
|
+
return acc;
|
|
20
|
+
}, {} as DictionariesContext);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Initializes the dictionary state (TanStack Table state).
|
|
25
|
+
* @param tableOptions - The table options.
|
|
26
|
+
* @returns The initialized dictionary state.
|
|
27
|
+
*/
|
|
28
|
+
function initState(
|
|
29
|
+
tableOptions: DataDictionaryConfig["tableOptions"]
|
|
30
|
+
): Partial<TableState> {
|
|
31
|
+
const { initialState } = tableOptions;
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
columnFilters: [],
|
|
35
|
+
globalFilter: undefined,
|
|
36
|
+
...initialState,
|
|
37
|
+
...initPaginationState(initialState),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { DataDictionaryStateContext } from "./context";
|
|
3
|
+
import { useDataDictionaryReducer } from "./hooks/UseDataDictionaryReducer/hook";
|
|
4
|
+
|
|
5
|
+
export function DataDictionaryStateProvider({
|
|
6
|
+
children,
|
|
7
|
+
}: {
|
|
8
|
+
children: ReactNode | ReactNode[];
|
|
9
|
+
}): JSX.Element {
|
|
10
|
+
const reducer = useDataDictionaryReducer();
|
|
11
|
+
return (
|
|
12
|
+
<DataDictionaryStateContext.Provider value={reducer}>
|
|
13
|
+
{children}
|
|
14
|
+
</DataDictionaryStateContext.Provider>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { clearMetaAction } from "./actions/clearMeta/action";
|
|
2
|
+
import { stateToUrlAction } from "./actions/stateToUrl/action";
|
|
3
|
+
import {
|
|
4
|
+
DataDictionaryAction,
|
|
5
|
+
DataDictionaryActionKind,
|
|
6
|
+
} from "./actions/types";
|
|
7
|
+
import { updateColumnFiltersAction } from "./actions/updateColumnFilters/action";
|
|
8
|
+
import { updateGlobalFilterAction } from "./actions/updateGlobalFilter/action";
|
|
9
|
+
import { urlToStateAction } from "./actions/urlToState/action";
|
|
10
|
+
import { DataDictionaryState } from "./types";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Reducer for data dictionary.
|
|
14
|
+
* @param state - State.
|
|
15
|
+
* @param action - Action.
|
|
16
|
+
* @returns state.
|
|
17
|
+
*/
|
|
18
|
+
export function dataDictionaryReducer(
|
|
19
|
+
state: DataDictionaryState,
|
|
20
|
+
action: DataDictionaryAction
|
|
21
|
+
): DataDictionaryState {
|
|
22
|
+
const { payload, type } = action;
|
|
23
|
+
switch (type) {
|
|
24
|
+
case DataDictionaryActionKind.ClearMeta: {
|
|
25
|
+
return clearMetaAction(state, payload);
|
|
26
|
+
}
|
|
27
|
+
case DataDictionaryActionKind.StateToUrl: {
|
|
28
|
+
return stateToUrlAction(state, payload);
|
|
29
|
+
}
|
|
30
|
+
case DataDictionaryActionKind.UpdateColumnFilters: {
|
|
31
|
+
return updateColumnFiltersAction(state, payload);
|
|
32
|
+
}
|
|
33
|
+
case DataDictionaryActionKind.UpdateGlobalFilter: {
|
|
34
|
+
return updateGlobalFilterAction(state, payload);
|
|
35
|
+
}
|
|
36
|
+
case DataDictionaryActionKind.UrlToState: {
|
|
37
|
+
return urlToStateAction(state, payload);
|
|
38
|
+
}
|
|
39
|
+
default:
|
|
40
|
+
return state;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { META_COMMAND } from "../../hooks/stateSyncManager/hooks/UseMetaCommands/types";
|
|
3
|
+
import { DataDictionaryAction } from "./actions/types";
|
|
4
|
+
import { DictionariesContext } from "./dictionaries/types";
|
|
5
|
+
|
|
6
|
+
export interface DataDictionaryState {
|
|
7
|
+
dictionaries: DictionariesContext;
|
|
8
|
+
meta: Meta | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DataDictionaryStateContextProps {
|
|
12
|
+
dataDictionaryDispatch: Dispatch<DataDictionaryAction> | null;
|
|
13
|
+
dataDictionaryState: DataDictionaryState;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Meta {
|
|
17
|
+
command: META_COMMAND;
|
|
18
|
+
}
|
|
@@ -24,6 +24,7 @@ import { FILE_MANIFEST_STATE } from "./fileManifestState/constants";
|
|
|
24
24
|
* File manifest state.
|
|
25
25
|
*/
|
|
26
26
|
export type FileManifestState = {
|
|
27
|
+
fileCount: number | undefined;
|
|
27
28
|
filesFacets: FileFacet[];
|
|
28
29
|
fileSummary?: AzulSummaryResponse;
|
|
29
30
|
fileSummaryFacetName?: string;
|
|
@@ -133,6 +134,7 @@ export function FileManifestStateProvider({
|
|
|
133
134
|
export enum FileManifestActionKind {
|
|
134
135
|
ClearFileManifest = "CLEAR_FILE_MANIFEST",
|
|
135
136
|
FetchFileManifest = "FETCH_FILE_MANIFEST",
|
|
137
|
+
UpdateFileCount = "UPDATE_FILE_COUNT",
|
|
136
138
|
UpdateFileManifest = "UPDATE_FILE_MANIFEST",
|
|
137
139
|
UpdateFilter = "UPDATE_FILTER",
|
|
138
140
|
UpdateFiltersCategory = "UPDATE_FILTERS_CATEGORY",
|
|
@@ -144,6 +146,7 @@ export enum FileManifestActionKind {
|
|
|
144
146
|
export type FileManifestAction =
|
|
145
147
|
| ClearFileManifestAction
|
|
146
148
|
| FetchFileManifestAction
|
|
149
|
+
| UpdateFileCountAction
|
|
147
150
|
| UpdateFileManifestAction
|
|
148
151
|
| UpdateFilterAction
|
|
149
152
|
| UpdateFiltersCategoryAction;
|
|
@@ -172,6 +175,14 @@ type UpdateFileManifestAction = {
|
|
|
172
175
|
type: FileManifestActionKind.UpdateFileManifest;
|
|
173
176
|
};
|
|
174
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Update file count action.
|
|
180
|
+
*/
|
|
181
|
+
type UpdateFileCountAction = {
|
|
182
|
+
payload: UpdateFileCountPayload;
|
|
183
|
+
type: FileManifestActionKind.UpdateFileCount;
|
|
184
|
+
};
|
|
185
|
+
|
|
175
186
|
/**
|
|
176
187
|
* Update filter action.
|
|
177
188
|
*/
|
|
@@ -196,6 +207,13 @@ type FetchFileManifestPayload = {
|
|
|
196
207
|
filters: Filters;
|
|
197
208
|
};
|
|
198
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Update file count payload.
|
|
212
|
+
*/
|
|
213
|
+
export type UpdateFileCountPayload = {
|
|
214
|
+
fileCount: number | undefined;
|
|
215
|
+
};
|
|
216
|
+
|
|
199
217
|
/**
|
|
200
218
|
* Update file manifest payload.
|
|
201
219
|
*/
|
|
@@ -235,6 +253,7 @@ function fileManifestReducer(
|
|
|
235
253
|
case FileManifestActionKind.ClearFileManifest: {
|
|
236
254
|
return {
|
|
237
255
|
...state,
|
|
256
|
+
fileCount: undefined,
|
|
238
257
|
isEnabled: false,
|
|
239
258
|
};
|
|
240
259
|
}
|
|
@@ -252,6 +271,10 @@ function fileManifestReducer(
|
|
|
252
271
|
isEnabled: true,
|
|
253
272
|
};
|
|
254
273
|
}
|
|
274
|
+
// Updates file count.
|
|
275
|
+
case FileManifestActionKind.UpdateFileCount: {
|
|
276
|
+
return { ...state, ...payload };
|
|
277
|
+
}
|
|
255
278
|
// Updates file manifest.
|
|
256
279
|
case FileManifestActionKind.UpdateFileManifest: {
|
|
257
280
|
return { ...state, ...payload };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IconButtonProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
type IconButtonPropsOptions = {
|
|
4
|
+
COLOR: typeof COLOR;
|
|
5
|
+
EDGE: typeof EDGE;
|
|
6
|
+
SIZE: typeof SIZE;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const COLOR: Record<string, IconButtonProps["color"]> = {
|
|
10
|
+
DEFAULT: "default",
|
|
11
|
+
ERROR: "error",
|
|
12
|
+
INFO: "info",
|
|
13
|
+
INHERIT: "inherit",
|
|
14
|
+
INK: "ink",
|
|
15
|
+
INK_LIGHT: "inkLight",
|
|
16
|
+
PRIMARY: "primary",
|
|
17
|
+
SECONDARY: "secondary",
|
|
18
|
+
SUCCESS: "success",
|
|
19
|
+
WARNING: "warning",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const EDGE: Record<string, IconButtonProps["edge"]> = {
|
|
23
|
+
END: "end",
|
|
24
|
+
START: "start",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const SIZE: Record<string, IconButtonProps["size"]> = {
|
|
28
|
+
LARGE: "large",
|
|
29
|
+
MEDIUM: "medium",
|
|
30
|
+
SMALL: "small",
|
|
31
|
+
XLARGE: "xlarge",
|
|
32
|
+
XSMALL: "xsmall",
|
|
33
|
+
XXSMALL: "xxsmall",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const ICON_BUTTON_PROPS: IconButtonPropsOptions = {
|
|
37
|
+
COLOR,
|
|
38
|
+
EDGE,
|
|
39
|
+
SIZE,
|
|
40
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InputAdornmentProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
type InputAdornmentPropsOptions = {
|
|
4
|
+
POSITION: typeof POSITION;
|
|
5
|
+
VARIANT: typeof VARIANT;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const POSITION: Record<string, InputAdornmentProps["position"]> = {
|
|
9
|
+
END: "end",
|
|
10
|
+
START: "start",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const VARIANT: Record<string, InputAdornmentProps["variant"]> = {
|
|
14
|
+
FILLED: "filled",
|
|
15
|
+
OUTLINED: "outlined",
|
|
16
|
+
STANDARD: "standard",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const INPUT_ADORNMENT_PROPS: InputAdornmentPropsOptions = {
|
|
20
|
+
POSITION,
|
|
21
|
+
VARIANT,
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OutlinedInputProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
type OutlinedInputPropsOptions = {
|
|
4
|
+
COLOR: typeof COLOR;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const COLOR: Record<string, OutlinedInputProps["color"]> = {
|
|
8
|
+
PRIMARY: "primary",
|
|
9
|
+
SECONDARY: "secondary",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const OUTLINED_INPUT_PROPS: OutlinedInputPropsOptions = {
|
|
13
|
+
COLOR,
|
|
14
|
+
};
|