@databiosphere/findable-ui 35.1.0 → 36.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/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.js +21 -29
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestSpreadsheet/fileManifestSpreadsheet.js +21 -36
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/constants.d.ts +2 -0
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/constants.js +22 -0
- 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 +3 -0
- package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.js +9 -0
- package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.styles.d.ts +5 -0
- package/lib/components/Table/components/TableCell/components/CodeCell/codeCell.styles.js +15 -0
- 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/useFileManifestDownload.d.ts +2 -2
- package/lib/hooks/useFileManifest/useFileManifestDownload.js +3 -10
- package/lib/hooks/useFileManifest/useFileManifestSpreadsheet.d.ts +5 -4
- package/lib/hooks/useFileManifest/useFileManifestSpreadsheet.js +24 -20
- 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/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/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload.tsx +43 -71
- package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestSpreadsheet/fileManifestSpreadsheet.tsx +52 -74
- package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/constants.ts +24 -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.styles.ts +16 -0
- package/src/components/Table/components/TableCell/components/CodeCell/codeCell.tsx +21 -0
- 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/useFileManifestDownload.ts +9 -16
- package/src/hooks/useFileManifest/useFileManifestSpreadsheet.ts +41 -26
- 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/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/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,85 @@
|
|
|
1
|
+
import { Row, RowData, Table } from "@tanstack/react-table";
|
|
2
|
+
import { escapeRegExp } from "../../../../../../common/utils";
|
|
3
|
+
import { ColumnFilterMeta } from "../../../../columnDef/globalFilter/types";
|
|
4
|
+
import { parseSearchTerms } from "../../../../columnDef/globalFilter/utils";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Renders a cell value with highlighting if it matches item rank filter criteria.
|
|
8
|
+
* @param table - Table.
|
|
9
|
+
* @param row - Row.
|
|
10
|
+
* @param columnId - Column identifier.
|
|
11
|
+
* @param value - Cell value.
|
|
12
|
+
* @returns Rendered cell value with highlighting.
|
|
13
|
+
*/
|
|
14
|
+
export function renderRankedCell<T extends RowData>(
|
|
15
|
+
table: Table<T>,
|
|
16
|
+
row: Row<T>,
|
|
17
|
+
columnId: string,
|
|
18
|
+
value: string | undefined | null
|
|
19
|
+
): string {
|
|
20
|
+
// If the cell value is undefined or null, return an empty string.
|
|
21
|
+
if (value === undefined || value === null) return "";
|
|
22
|
+
|
|
23
|
+
const stringValue = String(value);
|
|
24
|
+
|
|
25
|
+
// Check if the cell is ranked.
|
|
26
|
+
const isRanked = isRankedCell(table, row, columnId);
|
|
27
|
+
|
|
28
|
+
// Return the unranked cell, as-is, in string form.
|
|
29
|
+
if (!isRanked) return stringValue;
|
|
30
|
+
|
|
31
|
+
// Tokenise the current global filter.
|
|
32
|
+
const tokens = getTokens(table);
|
|
33
|
+
|
|
34
|
+
// If there are no tokens, return the value as-is, in string form.
|
|
35
|
+
if (tokens.length === 0) return stringValue;
|
|
36
|
+
|
|
37
|
+
// Create regex pattern.
|
|
38
|
+
const regex = getTokensRegex(tokens);
|
|
39
|
+
|
|
40
|
+
return stringValue.replace(regex, "<mark>$1</mark>");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the current global filter tokens from the table.
|
|
45
|
+
* @param table - Table.
|
|
46
|
+
* @returns An array of search tokens.
|
|
47
|
+
*/
|
|
48
|
+
export function getTokens<T extends RowData>(table: Table<T>): string[] {
|
|
49
|
+
const { getState } = table;
|
|
50
|
+
const { globalFilter } = getState();
|
|
51
|
+
return parseSearchTerms(globalFilter);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Returns a RegExp pattern for matching search tokens.
|
|
56
|
+
* @param tokens - Search tokens.
|
|
57
|
+
* @returns A RegExp pattern that matches any of the tokens.
|
|
58
|
+
*/
|
|
59
|
+
export function getTokensRegex(tokens: string[]): RegExp {
|
|
60
|
+
return new RegExp(`(${tokens.map(escapeRegExp).join("|")})`, "gi");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Checks if a cell is ranked based on the global filter.
|
|
65
|
+
* @param table - Table.
|
|
66
|
+
* @param row - Row.
|
|
67
|
+
* @param columnId - Column identifier.
|
|
68
|
+
* @returns Whether the cell is ranked.
|
|
69
|
+
*/
|
|
70
|
+
export function isRankedCell<T extends RowData>(
|
|
71
|
+
table: Table<T>,
|
|
72
|
+
row: Row<T>,
|
|
73
|
+
columnId: string
|
|
74
|
+
): boolean {
|
|
75
|
+
const { getState } = table;
|
|
76
|
+
const { globalFilter } = getState();
|
|
77
|
+
|
|
78
|
+
// If there is no global filter, return the value as-is.
|
|
79
|
+
if (!globalFilter) return false;
|
|
80
|
+
|
|
81
|
+
// Check if the column has filter metadata with itemRank.passed
|
|
82
|
+
const columnFilterMeta = row.columnFiltersMeta[columnId] as ColumnFilterMeta;
|
|
83
|
+
|
|
84
|
+
return columnFilterMeta?.passed ?? false;
|
|
85
|
+
}
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
1
2
|
import styled from "@emotion/styled";
|
|
2
|
-
import { Menu, menuClasses, paperClasses } from "@mui/material";
|
|
3
|
+
import { Button, Menu, menuClasses, paperClasses } from "@mui/material";
|
|
4
|
+
import { PALETTE } from "../../../../../styles/common/constants/palette";
|
|
3
5
|
import { MAX_LIST_HEIGHT_PX } from "../../../../Filter/common/constants";
|
|
4
6
|
import {
|
|
5
7
|
MuiListItemButtonRoot,
|
|
6
8
|
MuiListItemTextRoot,
|
|
7
9
|
} from "../../../../Filter/components/FilterList/filterList.styles";
|
|
8
10
|
|
|
11
|
+
interface Props {
|
|
12
|
+
open: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const StyledButton = styled(Button, {
|
|
16
|
+
shouldForwardProp: (prop) => prop !== "open",
|
|
17
|
+
})<Props>`
|
|
18
|
+
&.MuiButtonGroup-grouped {
|
|
19
|
+
gap: 0;
|
|
20
|
+
|
|
21
|
+
.MuiButton-endIcon {
|
|
22
|
+
margin-left: 0;
|
|
23
|
+
margin-right: -8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${({ open }) =>
|
|
27
|
+
open &&
|
|
28
|
+
css`
|
|
29
|
+
background-color: ${PALETTE.SMOKE_LIGHT};
|
|
30
|
+
`}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
9
34
|
export const StyledMenu = styled(Menu)`
|
|
10
35
|
.${paperClasses.root} {
|
|
11
36
|
margin: 4px 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkbox,
|
|
3
|
+
Grid,
|
|
3
4
|
ListItemButton,
|
|
4
5
|
ListItemText,
|
|
5
|
-
Button as MButton,
|
|
6
6
|
Typography,
|
|
7
7
|
} from "@mui/material";
|
|
8
8
|
import { RowData } from "@tanstack/react-table";
|
|
@@ -13,10 +13,11 @@ import { CheckedIcon } from "../../../../common/CustomIcon/components/CheckedIco
|
|
|
13
13
|
import { UncheckedIcon } from "../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
|
|
14
14
|
import { DropDownIcon } from "../../../../common/Form/components/Select/components/DropDownIcon/dropDownIcon";
|
|
15
15
|
import { useMenu } from "../../../../common/Menu/hooks/useMenu";
|
|
16
|
+
import { FilterCountChip } from "../../../../Filter/components/FilterCountChip/filterCountChip";
|
|
16
17
|
import { getColumnHeader } from "../../../common/utils";
|
|
17
18
|
import { getSortedFacetedValues } from "../../../featureOptions/facetedColumn/utils";
|
|
18
|
-
import { StyledMenu } from "./columnFilter.styles";
|
|
19
|
-
import { MENU_PROPS } from "./constants";
|
|
19
|
+
import { StyledButton, StyledMenu } from "./columnFilter.styles";
|
|
20
|
+
import { GRID_PROPS, MENU_PROPS } from "./constants";
|
|
20
21
|
import { ColumnFilterProps } from "./types";
|
|
21
22
|
import { updater } from "./utils";
|
|
22
23
|
|
|
@@ -26,7 +27,7 @@ import { updater } from "./utils";
|
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
export const ColumnFilter = <T extends RowData>({
|
|
29
|
-
Button =
|
|
30
|
+
Button = StyledButton,
|
|
30
31
|
className,
|
|
31
32
|
column,
|
|
32
33
|
...props /* MuiMenuProps */
|
|
@@ -39,10 +40,15 @@ export const ColumnFilter = <T extends RowData>({
|
|
|
39
40
|
<Fragment>
|
|
40
41
|
<Button
|
|
41
42
|
key={column.id}
|
|
43
|
+
disabled={sortedValues.length === 0}
|
|
42
44
|
endIcon={<DropDownIcon color={SVG_ICON_PROPS.COLOR.INK_LIGHT} />}
|
|
43
45
|
onClick={onOpen}
|
|
46
|
+
open={open}
|
|
44
47
|
>
|
|
45
|
-
{
|
|
48
|
+
<Grid {...GRID_PROPS}>
|
|
49
|
+
{getColumnHeader(column)}
|
|
50
|
+
<FilterCountChip count={filterValue.length} />
|
|
51
|
+
</Grid>
|
|
46
52
|
</Button>
|
|
47
53
|
<StyledMenu
|
|
48
54
|
{...MENU_PROPS}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { Chip } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../../../styles/common/constants/palette";
|
|
4
|
+
|
|
5
|
+
export const StyledChip = styled(Chip)`
|
|
6
|
+
border-radius: 4px;
|
|
7
|
+
box-shadow: 0 0 0 2px ${PALETTE.COMMON_WHITE};
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
justify-self: flex-start;
|
|
11
|
+
padding: 0 8px;
|
|
12
|
+
|
|
13
|
+
.MuiChip-label {
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.MuiChip-deleteIcon {
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
margin: 0 -4px 0 0;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
color: inherit;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CloseRounded } from "@mui/icons-material";
|
|
2
|
+
import { RowData } from "@tanstack/react-table";
|
|
3
|
+
import React, { Fragment } from "react";
|
|
4
|
+
import { updater } from "../../../../../components/TableFeatures/ColumnFilter/utils";
|
|
5
|
+
import { StyledChip } from "./columnFilterTag.styles";
|
|
6
|
+
import { CHIP_PROPS, SVG_ICON_PROPS } from "./constants";
|
|
7
|
+
import { ColumnFilterTagProps } from "./types";
|
|
8
|
+
|
|
9
|
+
export const ColumnFilterTag = <T extends RowData>({
|
|
10
|
+
className,
|
|
11
|
+
column,
|
|
12
|
+
...props /* MuiChipProps */
|
|
13
|
+
}: ColumnFilterTagProps<T>): JSX.Element => {
|
|
14
|
+
const filterValue = column.getFilterValue() as unknown[];
|
|
15
|
+
return (
|
|
16
|
+
<Fragment>
|
|
17
|
+
{filterValue.map((value) => (
|
|
18
|
+
<StyledChip
|
|
19
|
+
{...CHIP_PROPS}
|
|
20
|
+
key={String(value)}
|
|
21
|
+
className={className}
|
|
22
|
+
deleteIcon={<CloseRounded {...SVG_ICON_PROPS} />}
|
|
23
|
+
label={String(value)}
|
|
24
|
+
onClick={() => column.setFilterValue(updater(value))}
|
|
25
|
+
onDelete={() => column.setFilterValue(updater(value))}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
))}
|
|
29
|
+
</Fragment>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChipProps, SvgIconProps } from "@mui/material";
|
|
2
|
+
import { CHIP_PROPS as MUI_CHIP_PROPS } from "../../../../../../../styles/common/mui/chip";
|
|
3
|
+
import { SVG_ICON_PROPS as MUI_SVG_ICON_PROPS } from "../../../../../../../styles/common/mui/svgIcon";
|
|
4
|
+
|
|
5
|
+
export const CHIP_PROPS: ChipProps = {
|
|
6
|
+
clickable: false,
|
|
7
|
+
color: MUI_CHIP_PROPS.COLOR.DEFAULT,
|
|
8
|
+
size: MUI_CHIP_PROPS.SIZE.MEDIUM,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SVG_ICON_PROPS: SvgIconProps = {
|
|
12
|
+
color: MUI_SVG_ICON_PROPS.COLOR.INHERIT,
|
|
13
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Box } from "@mui/material";
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { BIONETWORK } from "../../../../../../../DataDictionary/components/Filters/stories/constants";
|
|
5
|
+
import { ColumnFilterTag } from "../columnFilterTag";
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof ColumnFilterTag> = {
|
|
8
|
+
component: ColumnFilterTag,
|
|
9
|
+
decorators: [
|
|
10
|
+
(Story): JSX.Element => (
|
|
11
|
+
<Box sx={{ display: "grid", gap: 2, gridAutoFlow: "column" }}>
|
|
12
|
+
<Story />
|
|
13
|
+
</Box>
|
|
14
|
+
),
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
column: BIONETWORK,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChipProps } from "@mui/material";
|
|
2
|
+
import { Column, RowData } from "@tanstack/react-table";
|
|
3
|
+
import { BaseComponentProps } from "../../../../../../types";
|
|
4
|
+
|
|
5
|
+
export interface ColumnFilterTagProps<T extends RowData>
|
|
6
|
+
extends BaseComponentProps,
|
|
7
|
+
ChipProps {
|
|
8
|
+
column: Column<T>;
|
|
9
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { MenuProps } from "@mui/material";
|
|
1
|
+
import { GridProps, MenuProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const GRID_PROPS: GridProps = {
|
|
4
|
+
alignItems: "center",
|
|
5
|
+
container: true,
|
|
6
|
+
direction: "row",
|
|
7
|
+
gap: 1,
|
|
8
|
+
};
|
|
2
9
|
|
|
3
10
|
export const MENU_PROPS: Omit<MenuProps, "anchorEl" | "onClose" | "open"> = {
|
|
4
11
|
anchorOrigin: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MenuProps } from "@mui/material";
|
|
2
2
|
import { Column, RowData } from "@tanstack/react-table";
|
|
3
3
|
import { BaseComponentProps } from "../../../../types";
|
|
4
|
+
import { StyledButton } from "./columnFilter.styles";
|
|
4
5
|
|
|
5
6
|
export interface ColumnFilterProps<T extends RowData>
|
|
6
7
|
extends BaseComponentProps,
|
|
7
8
|
Omit<MenuProps, "anchorEl" | "onClose" | "open"> {
|
|
8
|
-
Button?: typeof
|
|
9
|
+
Button?: typeof StyledButton;
|
|
9
10
|
column: Column<T>;
|
|
10
11
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OutlinedInputProps } from "@mui/material";
|
|
2
|
+
import { OUTLINED_INPUT_PROPS as MUI_OUTLINED_INPUT_PROPS } from "../../../../../styles/common/mui/outlinedInput";
|
|
3
|
+
|
|
4
|
+
export const OUTLINED_INPUT_PROPS: OutlinedInputProps = {
|
|
5
|
+
color: MUI_OUTLINED_INPUT_PROPS.COLOR.SECONDARY,
|
|
6
|
+
fullWidth: true,
|
|
7
|
+
id: "global-filter",
|
|
8
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RowData } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ClearInputAdornment } from "../../../../common/OutlinedInput/components/InputAdornment/components/ClearInputAdornment/clearInputAdornment";
|
|
4
|
+
import { SearchInputAdornment } from "../../../../common/OutlinedInput/components/InputAdornment/components/SearchInputAdornment/searchInputAdornment";
|
|
5
|
+
import { StyledOutlinedInput } from "../../../../common/OutlinedInput/outlinedInput.styles";
|
|
6
|
+
import { OUTLINED_INPUT_PROPS } from "./constants";
|
|
7
|
+
import { GlobalFilterProps } from "./types";
|
|
8
|
+
|
|
9
|
+
export const GlobalFilter = <T extends RowData>({
|
|
10
|
+
className,
|
|
11
|
+
table,
|
|
12
|
+
...props /* MuiOutlinedInputProps */
|
|
13
|
+
}: GlobalFilterProps<T>): JSX.Element => {
|
|
14
|
+
const { getState, setGlobalFilter } = table;
|
|
15
|
+
const { globalFilter } = getState();
|
|
16
|
+
return (
|
|
17
|
+
<StyledOutlinedInput
|
|
18
|
+
{...OUTLINED_INPUT_PROPS}
|
|
19
|
+
className={className}
|
|
20
|
+
endAdornment={
|
|
21
|
+
<ClearInputAdornment
|
|
22
|
+
in={!!globalFilter}
|
|
23
|
+
onClick={() => setGlobalFilter(undefined)}
|
|
24
|
+
/>
|
|
25
|
+
}
|
|
26
|
+
hasValue={!!globalFilter}
|
|
27
|
+
onChange={(e) => setGlobalFilter(e.target.value)}
|
|
28
|
+
startAdornment={<SearchInputAdornment />}
|
|
29
|
+
value={globalFilter ?? ""}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OutlinedInputProps } from "@mui/material";
|
|
2
|
+
import { RowData, Table } from "@tanstack/react-table";
|
|
3
|
+
import { BaseComponentProps } from "components/types";
|
|
4
|
+
|
|
5
|
+
export interface GlobalFilterProps<T extends RowData>
|
|
6
|
+
extends BaseComponentProps,
|
|
7
|
+
OutlinedInputProps {
|
|
8
|
+
table: Table<T>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InitialTableState, PaginationTableState } from "@tanstack/react-table";
|
|
2
|
+
import { PAGINATION_TABLE_STATE } from "./constants";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initializes pagination state by merging default values with initial state.
|
|
6
|
+
* TanStack Table always applies a default pagination of `{ pageIndex: 0, pageSize: 10 }`,
|
|
7
|
+
* so this function ensures custom pagination state is properly initialized from the initial state.
|
|
8
|
+
* @param initialState - The initial state.
|
|
9
|
+
* @returns The initialized pagination state.
|
|
10
|
+
*/
|
|
11
|
+
export function initPaginationState(
|
|
12
|
+
initialState?: InitialTableState
|
|
13
|
+
): PaginationTableState {
|
|
14
|
+
if (!initialState?.pagination) return PAGINATION_TABLE_STATE;
|
|
15
|
+
return {
|
|
16
|
+
pagination: {
|
|
17
|
+
...PAGINATION_TABLE_STATE.pagination,
|
|
18
|
+
...initialState.pagination,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -2,7 +2,7 @@ import styled from "@emotion/styled";
|
|
|
2
2
|
import Link from "next/link";
|
|
3
3
|
import { inkLight } from "../../../styles/common/mixins/colors";
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const StyledNextLink = styled(Link)`
|
|
6
6
|
color: ${inkLight};
|
|
7
7
|
margin-left: 4px;
|
|
8
8
|
opacity: 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LinkRounded } from "@mui/icons-material";
|
|
2
|
+
import { useRouter } from "next/router";
|
|
2
3
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
+
import { StyledNextLink } from "./anchorLink.styles";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* An anchor link component that provides deep linking functionality.
|
|
@@ -18,9 +19,14 @@ export const AnchorLink = ({
|
|
|
18
19
|
anchorLink,
|
|
19
20
|
className,
|
|
20
21
|
}: AnchorLinkProps): JSX.Element => {
|
|
22
|
+
const { query } = useRouter();
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
24
|
+
<StyledNextLink
|
|
25
|
+
aria-label={anchorLink}
|
|
26
|
+
className={className}
|
|
27
|
+
href={{ hash: anchorLink, query }}
|
|
28
|
+
>
|
|
23
29
|
<LinkRounded fontSize="xsmall" />
|
|
24
|
-
</
|
|
30
|
+
</StyledNextLink>
|
|
25
31
|
);
|
|
26
32
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { SvgIcon } from "@mui/material";
|
|
1
|
+
import { SvgIcon, SvgIconProps } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { CustomSVGIconProps } from "../../common/entities";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Custom search icon.
|
|
@@ -10,7 +9,7 @@ export const SearchIcon = ({
|
|
|
10
9
|
fontSize = "xsmall",
|
|
11
10
|
viewBox = "0 0 20 20",
|
|
12
11
|
...props /* Spread props to allow for Mui SvgIconProps specific prop overrides e.g. "htmlColor". */
|
|
13
|
-
}:
|
|
12
|
+
}: SvgIconProps): JSX.Element => {
|
|
14
13
|
return (
|
|
15
14
|
<SvgIcon fontSize={fontSize} viewBox={viewBox} {...props}>
|
|
16
15
|
<path
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { InputAdornment } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../../../styles/common/constants/palette";
|
|
4
|
+
|
|
5
|
+
export const StyledInputAdornment = styled(InputAdornment)`
|
|
6
|
+
color: ${PALETTE.INK_LIGHT};
|
|
7
|
+
margin: 0;
|
|
8
|
+
|
|
9
|
+
.MuiIconButton-root {
|
|
10
|
+
margin-right: -10px;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CloseRounded } from "@mui/icons-material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SVG_ICON_PROPS } from "../constants";
|
|
5
|
+
import { StyledInputAdornment } from "./clearInputAdornment.styles";
|
|
6
|
+
import { ICON_BUTTON_PROPS, INPUT_ADORNMENT_PROPS } from "./constants";
|
|
7
|
+
import { ClearInputAdornmentProps } from "./types";
|
|
8
|
+
|
|
9
|
+
export const ClearInputAdornment = ({
|
|
10
|
+
in: isIn,
|
|
11
|
+
onClick,
|
|
12
|
+
}: ClearInputAdornmentProps): JSX.Element | null => {
|
|
13
|
+
if (!isIn) return null;
|
|
14
|
+
return (
|
|
15
|
+
<StyledInputAdornment {...INPUT_ADORNMENT_PROPS}>
|
|
16
|
+
<IconButton {...ICON_BUTTON_PROPS} onClick={onClick}>
|
|
17
|
+
<CloseRounded {...SVG_ICON_PROPS} />
|
|
18
|
+
</IconButton>
|
|
19
|
+
</StyledInputAdornment>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconButtonProps, InputAdornmentProps } from "@mui/material";
|
|
2
|
+
import { ICON_BUTTON_PROPS as MUI_ICON_BUTTON_PROPS } from "../../../../../../../styles/common/mui/iconButton";
|
|
3
|
+
import { INPUT_ADORNMENT_PROPS as MUI_INPUT_ADORNMENT_PROPS } from "../../../../../../../styles/common/mui/inputAdornment";
|
|
4
|
+
|
|
5
|
+
export const ICON_BUTTON_PROPS: IconButtonProps = {
|
|
6
|
+
color: MUI_ICON_BUTTON_PROPS.COLOR.INHERIT,
|
|
7
|
+
edge: MUI_ICON_BUTTON_PROPS.EDGE.END,
|
|
8
|
+
size: MUI_ICON_BUTTON_PROPS.SIZE.MEDIUM,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const INPUT_ADORNMENT_PROPS: InputAdornmentProps = {
|
|
12
|
+
position: MUI_INPUT_ADORNMENT_PROPS.POSITION.END,
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputAdornmentProps } from "@mui/material";
|
|
2
|
+
import { INPUT_ADORNMENT_PROPS as MUI_INPUT_ADORNMENT_PROPS } from "../../../../../../../styles/common/mui/inputAdornment";
|
|
3
|
+
|
|
4
|
+
export const INPUT_ADORNMENT_PROPS: InputAdornmentProps = {
|
|
5
|
+
disablePointerEvents: true,
|
|
6
|
+
position: MUI_INPUT_ADORNMENT_PROPS.POSITION.START,
|
|
7
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SearchIcon } from "../../../../../CustomIcon/components/SearchIcon/searchIcon";
|
|
3
|
+
import { StyledInputAdornment } from "../../inputAdornment.styles";
|
|
4
|
+
import { SVG_ICON_PROPS } from "../constants";
|
|
5
|
+
import { INPUT_ADORNMENT_PROPS } from "./constants";
|
|
6
|
+
|
|
7
|
+
export const SearchInputAdornment = (): JSX.Element => {
|
|
8
|
+
return (
|
|
9
|
+
<StyledInputAdornment {...INPUT_ADORNMENT_PROPS}>
|
|
10
|
+
<SearchIcon {...SVG_ICON_PROPS} />
|
|
11
|
+
</StyledInputAdornment>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SvgIconProps } from "@mui/material";
|
|
2
|
+
import { SVG_ICON_PROPS as MUI_SVG_ICON_PROPS } from "../../../../../../styles/common/mui/svgIcon";
|
|
3
|
+
|
|
4
|
+
export const SVG_ICON_PROPS: SvgIconProps = {
|
|
5
|
+
color: MUI_SVG_ICON_PROPS.COLOR.INHERIT,
|
|
6
|
+
fontSize: MUI_SVG_ICON_PROPS.FONT_SIZE.SMALL,
|
|
7
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { OutlinedInput } from "@mui/material";
|
|
4
|
+
import { PALETTE } from "../../../styles/common/constants/palette";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
hasValue: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const StyledOutlinedInput = styled(OutlinedInput, {
|
|
11
|
+
shouldForwardProp: (prop) => prop !== "hasValue",
|
|
12
|
+
})<Props>`
|
|
13
|
+
${({ hasValue }) =>
|
|
14
|
+
hasValue &&
|
|
15
|
+
css`
|
|
16
|
+
& {
|
|
17
|
+
color: ${PALETTE.INK_MAIN};
|
|
18
|
+
|
|
19
|
+
.MuiOutlinedInput-input {
|
|
20
|
+
color: inherit;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`};
|
|
24
|
+
`;
|
|
@@ -17,11 +17,11 @@ export const useMetaCommands = <Action>({
|
|
|
17
17
|
switch (command) {
|
|
18
18
|
case META_COMMAND.STATE_TO_URL_PUSH:
|
|
19
19
|
Router.push({ query }, undefined, { shallow: true });
|
|
20
|
-
dispatch(actions.clearMeta());
|
|
20
|
+
dispatch?.(actions.clearMeta());
|
|
21
21
|
break;
|
|
22
22
|
case META_COMMAND.STATE_TO_URL_REPLACE:
|
|
23
23
|
Router.replace({ query }, undefined, { shallow: true });
|
|
24
|
-
dispatch(actions.clearMeta());
|
|
24
|
+
dispatch?.(actions.clearMeta());
|
|
25
25
|
break;
|
|
26
26
|
default:
|
|
27
27
|
break;
|
|
@@ -33,7 +33,7 @@ export const useStateSync = <Action>({
|
|
|
33
33
|
// Dispatch action sync URL >> state.
|
|
34
34
|
if (wasPop(basePath, pathname, popRef.current)) {
|
|
35
35
|
// When the user navigates with the back/forward buttons.
|
|
36
|
-
dispatch(actions.urlToState({ query }));
|
|
36
|
+
dispatch?.(actions.urlToState({ query }));
|
|
37
37
|
onClearPopRef();
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -41,12 +41,12 @@ export const useStateSync = <Action>({
|
|
|
41
41
|
// Dispatch action sync URL >> state.
|
|
42
42
|
if (hasParams(query, paramKeys)) {
|
|
43
43
|
// When the URL has parameters.
|
|
44
|
-
dispatch(actions.urlToState({ query }));
|
|
44
|
+
dispatch?.(actions.urlToState({ query }));
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// Otherwise, dispatch action sync URL << state.
|
|
49
|
-
dispatch(actions.stateToUrl({ method: ROUTER_METHOD.REPLACE }));
|
|
49
|
+
dispatch?.(actions.stateToUrl({ method: ROUTER_METHOD.REPLACE }));
|
|
50
50
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- deliberate omission of `state.query`, `state.paramKeys`, `actions` and `dispatch` from dependencies, hook is only expected to run when the Next.js router changes.
|
|
51
51
|
}, [basePath, isReady, pathname, query]);
|
|
52
52
|
};
|