@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
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ButtonBase,
|
|
3
|
-
TableBody,
|
|
4
|
-
TableCell,
|
|
5
|
-
TableRow,
|
|
6
|
-
Tooltip,
|
|
7
|
-
} from "@mui/material";
|
|
1
|
+
import { Button, TableBody, TableCell, TableRow, Tooltip } from "@mui/material";
|
|
8
2
|
import copy from "copy-to-clipboard";
|
|
9
|
-
import React
|
|
3
|
+
import React from "react";
|
|
10
4
|
import { Filters } from "../../../../../../../../common/entities";
|
|
11
5
|
import { useDownloadStatus } from "../../../../../../../../hooks/useDownloadStatus";
|
|
12
6
|
import { useFileManifestDownload } from "../../../../../../../../hooks/useFileManifest/useFileManifestDownload";
|
|
13
7
|
import { useLoginGuard } from "../../../../../../../../providers/loginGuard/hook";
|
|
8
|
+
import { BUTTON_PROPS } from "../../../../../../../common/Button/constants";
|
|
14
9
|
import { ButtonGroup } from "../../../../../../../common/ButtonGroup/buttonGroup";
|
|
15
|
-
import { ButtonGroupButton } from "../../../../../../../common/ButtonGroup/components/ButtonGroupButton/buttonGroupButton";
|
|
16
10
|
import {
|
|
17
11
|
ContentCopyIconSmall,
|
|
18
12
|
DownloadIconSmall,
|
|
@@ -26,6 +20,7 @@ import {
|
|
|
26
20
|
LOADING_PANEL_STYLE,
|
|
27
21
|
} from "../../../../../../../Loading/loading";
|
|
28
22
|
import { GridTable } from "../../../../../../../Table/common/gridTable.styles";
|
|
23
|
+
import { TOOLTIP_PROPS } from "../../constants";
|
|
29
24
|
import {
|
|
30
25
|
SectionTitle,
|
|
31
26
|
TableContainer,
|
|
@@ -38,87 +33,64 @@ export interface FileManifestDownloadProps {
|
|
|
38
33
|
export const FileManifestDownload = ({
|
|
39
34
|
filters,
|
|
40
35
|
}: FileManifestDownloadProps): JSX.Element => {
|
|
41
|
-
const downloadRef = useRef<HTMLAnchorElement>(null);
|
|
42
36
|
const { disabled, message } = useDownloadStatus();
|
|
43
|
-
const { fileName, isIdle, isLoading, manifestURL } =
|
|
44
|
-
filters
|
|
45
|
-
disabled
|
|
46
|
-
);
|
|
47
|
-
const isInProgress = (isIdle || isLoading) && !disabled;
|
|
48
|
-
const isReady = Boolean(manifestURL) || disabled;
|
|
37
|
+
const { fileName, isIdle, isLoading, manifestURL, requestManifest } =
|
|
38
|
+
useFileManifestDownload(filters);
|
|
49
39
|
|
|
50
40
|
// Prompt user for login before download and copy, if required.
|
|
51
41
|
const { requireLogin } = useLoginGuard();
|
|
52
42
|
|
|
53
|
-
// Copies file manifest.
|
|
54
|
-
const copyManifestURL = (url?: string): void => {
|
|
55
|
-
if (!url) return;
|
|
56
|
-
copy(url);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Downloads file manifest.
|
|
60
|
-
const downloadManifestURL = (): void => {
|
|
61
|
-
downloadRef.current?.click();
|
|
62
|
-
};
|
|
63
|
-
|
|
64
43
|
return (
|
|
65
44
|
<FluidPaper>
|
|
66
45
|
<GridPaper>
|
|
67
46
|
<SectionTitle>File Manifest</SectionTitle>
|
|
68
47
|
<TableContainer>
|
|
69
48
|
<Loading
|
|
70
|
-
loading={
|
|
49
|
+
loading={isLoading}
|
|
71
50
|
panelStyle={LOADING_PANEL_STYLE.INHERIT}
|
|
72
51
|
/>
|
|
73
|
-
<GridTable gridTemplateColumns=
|
|
52
|
+
<GridTable gridTemplateColumns="auto 1fr">
|
|
74
53
|
<TableBody>
|
|
75
54
|
<TableRow>
|
|
76
|
-
{
|
|
77
|
-
<TableCell
|
|
78
|
-
|
|
55
|
+
{isIdle || isLoading ? (
|
|
56
|
+
<TableCell>
|
|
57
|
+
<Tooltip {...TOOLTIP_PROPS} title={message}>
|
|
58
|
+
<span>
|
|
59
|
+
<Button
|
|
60
|
+
{...BUTTON_PROPS.PRIMARY_CONTAINED}
|
|
61
|
+
disabled={disabled || isLoading}
|
|
62
|
+
onClick={() => requireLogin(requestManifest)}
|
|
63
|
+
>
|
|
64
|
+
Request link
|
|
65
|
+
</Button>
|
|
66
|
+
</span>
|
|
67
|
+
</Tooltip>
|
|
68
|
+
</TableCell>
|
|
69
|
+
) : (
|
|
79
70
|
<>
|
|
71
|
+
{manifestURL && (
|
|
72
|
+
<TableCell>
|
|
73
|
+
<ButtonGroup
|
|
74
|
+
Buttons={[
|
|
75
|
+
<Button key="download" download href={manifestURL}>
|
|
76
|
+
<DownloadIconSmall />
|
|
77
|
+
</Button>,
|
|
78
|
+
<Button
|
|
79
|
+
key="copy"
|
|
80
|
+
onClick={() => copy(manifestURL)}
|
|
81
|
+
>
|
|
82
|
+
<ContentCopyIconSmall />
|
|
83
|
+
</Button>,
|
|
84
|
+
]}
|
|
85
|
+
/>
|
|
86
|
+
</TableCell>
|
|
87
|
+
)}
|
|
80
88
|
<TableCell>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ref={downloadRef}
|
|
85
|
-
sx={{ display: "none" }}
|
|
86
|
-
/>
|
|
87
|
-
<Tooltip arrow title={message}>
|
|
88
|
-
<span>
|
|
89
|
-
<ButtonGroup
|
|
90
|
-
Buttons={[
|
|
91
|
-
<ButtonGroupButton
|
|
92
|
-
key="download"
|
|
93
|
-
action="Download file manifest"
|
|
94
|
-
disabled={disabled}
|
|
95
|
-
label={<DownloadIconSmall />}
|
|
96
|
-
onClick={() =>
|
|
97
|
-
requireLogin(downloadManifestURL)
|
|
98
|
-
}
|
|
99
|
-
/>,
|
|
100
|
-
<ButtonGroupButton
|
|
101
|
-
key="copy"
|
|
102
|
-
action="Copy file manifest"
|
|
103
|
-
disabled={disabled}
|
|
104
|
-
label={<ContentCopyIconSmall />}
|
|
105
|
-
onClick={() =>
|
|
106
|
-
requireLogin((): void =>
|
|
107
|
-
copyManifestURL(manifestURL)
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
/>,
|
|
111
|
-
]}
|
|
112
|
-
/>
|
|
113
|
-
</span>
|
|
114
|
-
</Tooltip>
|
|
89
|
+
{manifestURL
|
|
90
|
+
? fileName
|
|
91
|
+
: "The manifest is not available for this project."}
|
|
115
92
|
</TableCell>
|
|
116
|
-
<TableCell>{fileName}</TableCell>
|
|
117
93
|
</>
|
|
118
|
-
) : (
|
|
119
|
-
<TableCell>
|
|
120
|
-
The manifest is not available for this project.
|
|
121
|
-
</TableCell>
|
|
122
94
|
)}
|
|
123
95
|
</TableRow>
|
|
124
96
|
</TableBody>
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ButtonBase,
|
|
3
|
-
TableBody,
|
|
4
|
-
TableCell,
|
|
5
|
-
TableRow,
|
|
6
|
-
Tooltip,
|
|
7
|
-
} from "@mui/material";
|
|
1
|
+
import { Button, TableBody, TableCell, TableRow, Tooltip } from "@mui/material";
|
|
8
2
|
import copy from "copy-to-clipboard";
|
|
9
|
-
import React
|
|
3
|
+
import React from "react";
|
|
10
4
|
import { Filters } from "../../../../../../../../common/entities";
|
|
11
5
|
import { useDownloadStatus } from "../../../../../../../../hooks/useDownloadStatus";
|
|
12
6
|
import { useFileManifestSpreadsheet } from "../../../../../../../../hooks/useFileManifest/useFileManifestSpreadsheet";
|
|
13
|
-
import {
|
|
7
|
+
import { BUTTON_PROPS } from "../../../../../../../common/Button/constants";
|
|
14
8
|
import { ButtonGroup } from "../../../../../../../common/ButtonGroup/buttonGroup";
|
|
15
|
-
import { ButtonGroupButton } from "../../../../../../../common/ButtonGroup/components/ButtonGroupButton/buttonGroupButton";
|
|
16
9
|
import {
|
|
17
10
|
ContentCopyIconSmall,
|
|
18
11
|
DownloadIconSmall,
|
|
@@ -26,6 +19,7 @@ import {
|
|
|
26
19
|
LOADING_PANEL_STYLE,
|
|
27
20
|
} from "../../../../../../../Loading/loading";
|
|
28
21
|
import { GridTable } from "../../../../../../../Table/common/gridTable.styles";
|
|
22
|
+
import { TOOLTIP_PROPS } from "../../constants";
|
|
29
23
|
import {
|
|
30
24
|
SectionTitle,
|
|
31
25
|
TableContainer,
|
|
@@ -38,30 +32,14 @@ export interface FileManifestSpreadsheetProps {
|
|
|
38
32
|
export const FileManifestSpreadsheet = ({
|
|
39
33
|
filters,
|
|
40
34
|
}: FileManifestSpreadsheetProps): JSX.Element => {
|
|
41
|
-
const downloadRef = useRef<HTMLAnchorElement>(null);
|
|
42
35
|
const { disabled, message } = useDownloadStatus();
|
|
43
|
-
const {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// Copies metadata spreadsheet.
|
|
51
|
-
const copyMetadataURL = (url?: string): void => {
|
|
52
|
-
if (!url) return;
|
|
53
|
-
copy(url);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// Downloads metadata spreadsheet.
|
|
57
|
-
const downloadMetadataURL = (): void => {
|
|
58
|
-
downloadRef.current?.click();
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Requests metadata spreadsheet.
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
run();
|
|
64
|
-
}, [fileUrl, run]);
|
|
36
|
+
const {
|
|
37
|
+
fileName,
|
|
38
|
+
isIdle = false,
|
|
39
|
+
isLoading = false,
|
|
40
|
+
requestManifest,
|
|
41
|
+
spreadsheetUrl,
|
|
42
|
+
} = useFileManifestSpreadsheet(filters) || {};
|
|
65
43
|
|
|
66
44
|
return (
|
|
67
45
|
<FluidPaper>
|
|
@@ -69,55 +47,55 @@ export const FileManifestSpreadsheet = ({
|
|
|
69
47
|
<SectionTitle>Metadata</SectionTitle>
|
|
70
48
|
<TableContainer>
|
|
71
49
|
<Loading
|
|
72
|
-
loading={
|
|
50
|
+
loading={isLoading}
|
|
73
51
|
panelStyle={LOADING_PANEL_STYLE.INHERIT}
|
|
74
52
|
/>
|
|
75
|
-
<GridTable gridTemplateColumns=
|
|
53
|
+
<GridTable gridTemplateColumns="auto 1fr">
|
|
76
54
|
<TableBody>
|
|
77
55
|
<TableRow>
|
|
78
|
-
{
|
|
79
|
-
<TableCell
|
|
80
|
-
|
|
56
|
+
{isIdle || isLoading ? (
|
|
57
|
+
<TableCell>
|
|
58
|
+
<Tooltip {...TOOLTIP_PROPS} title={message}>
|
|
59
|
+
<span>
|
|
60
|
+
<Button
|
|
61
|
+
{...BUTTON_PROPS.PRIMARY_CONTAINED}
|
|
62
|
+
disabled={disabled || isLoading}
|
|
63
|
+
onClick={() => requestManifest?.()}
|
|
64
|
+
>
|
|
65
|
+
Request link
|
|
66
|
+
</Button>
|
|
67
|
+
</span>
|
|
68
|
+
</Tooltip>
|
|
69
|
+
</TableCell>
|
|
70
|
+
) : (
|
|
81
71
|
<>
|
|
72
|
+
{spreadsheetUrl && (
|
|
73
|
+
<TableCell>
|
|
74
|
+
<ButtonGroup
|
|
75
|
+
Buttons={[
|
|
76
|
+
<Button
|
|
77
|
+
key="download"
|
|
78
|
+
download
|
|
79
|
+
href={spreadsheetUrl}
|
|
80
|
+
>
|
|
81
|
+
<DownloadIconSmall />
|
|
82
|
+
</Button>,
|
|
83
|
+
<Button
|
|
84
|
+
key="copy"
|
|
85
|
+
onClick={() => copy(spreadsheetUrl)}
|
|
86
|
+
>
|
|
87
|
+
<ContentCopyIconSmall />
|
|
88
|
+
</Button>,
|
|
89
|
+
]}
|
|
90
|
+
/>
|
|
91
|
+
</TableCell>
|
|
92
|
+
)}
|
|
82
93
|
<TableCell>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
href={spreadsheetURL ?? ""}
|
|
87
|
-
ref={downloadRef}
|
|
88
|
-
sx={{ display: "none" }}
|
|
89
|
-
/>
|
|
90
|
-
<Tooltip arrow title={message}>
|
|
91
|
-
<span>
|
|
92
|
-
<ButtonGroup
|
|
93
|
-
Buttons={[
|
|
94
|
-
<ButtonGroupButton
|
|
95
|
-
key="download"
|
|
96
|
-
action="Download metadata spreadsheet"
|
|
97
|
-
disabled={disabled}
|
|
98
|
-
label={<DownloadIconSmall />}
|
|
99
|
-
onClick={downloadMetadataURL}
|
|
100
|
-
/>,
|
|
101
|
-
<ButtonGroupButton
|
|
102
|
-
key="copy"
|
|
103
|
-
action="Copy metadata spreadsheet"
|
|
104
|
-
disabled={disabled}
|
|
105
|
-
label={<ContentCopyIconSmall />}
|
|
106
|
-
onClick={(): void =>
|
|
107
|
-
copyMetadataURL(spreadsheetURL)
|
|
108
|
-
}
|
|
109
|
-
/>,
|
|
110
|
-
]}
|
|
111
|
-
/>
|
|
112
|
-
</span>
|
|
113
|
-
</Tooltip>
|
|
94
|
+
{spreadsheetUrl
|
|
95
|
+
? fileName
|
|
96
|
+
: "The metadata is not available for this project."}
|
|
114
97
|
</TableCell>
|
|
115
|
-
<TableCell>{fileName}</TableCell>
|
|
116
98
|
</>
|
|
117
|
-
) : (
|
|
118
|
-
<TableCell>
|
|
119
|
-
The metadata is not available for this project.
|
|
120
|
-
</TableCell>
|
|
121
99
|
)}
|
|
122
100
|
</TableRow>
|
|
123
101
|
</TableBody>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TooltipProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const TOOLTIP_PROPS: Partial<TooltipProps> = {
|
|
4
|
+
arrow: true,
|
|
5
|
+
slotProps: {
|
|
6
|
+
popper: {
|
|
7
|
+
modifiers: [
|
|
8
|
+
{
|
|
9
|
+
name: "offset",
|
|
10
|
+
options: {
|
|
11
|
+
offset: [0, -4],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "preventOverflow",
|
|
16
|
+
options: { padding: 8 },
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
tooltip: {
|
|
21
|
+
sx: { maxWidth: "none" },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Chip, styled } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const StyledChip = styled(Chip)`
|
|
4
|
+
align-items: center;
|
|
5
|
+
border-radius: 10px;
|
|
6
|
+
flex: none;
|
|
7
|
+
gap: 0;
|
|
8
|
+
height: 16px;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
min-width: 16px;
|
|
11
|
+
padding: 0 4px;
|
|
12
|
+
|
|
13
|
+
.MuiChip-label {
|
|
14
|
+
font-size: 9px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
line-height: 16px;
|
|
17
|
+
padding: 0;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CHIP_PROPS } from "../../../../styles/common/mui/chip";
|
|
3
|
+
import { StyledChip } from "./filterCountChip.styles";
|
|
4
|
+
import { FilterCountChipProps } from "./types";
|
|
5
|
+
|
|
6
|
+
export const FilterCountChip = ({
|
|
7
|
+
className,
|
|
8
|
+
count,
|
|
9
|
+
...props /* MuiChipProps */
|
|
10
|
+
}: FilterCountChipProps): JSX.Element | null => {
|
|
11
|
+
if (!count) return null;
|
|
12
|
+
return (
|
|
13
|
+
<StyledChip
|
|
14
|
+
className={className}
|
|
15
|
+
color={CHIP_PROPS.COLOR.PRIMARY}
|
|
16
|
+
label={String(count)}
|
|
17
|
+
variant={CHIP_PROPS.VARIANT.FILLED}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { FilterCountChip } from "../filterCountChip";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof FilterCountChip> = {
|
|
5
|
+
component: FilterCountChip,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
|
|
12
|
+
export const DEFAULT: Story = { args: { count: 1, onDelete: undefined } };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FilterMeta, Row, RowData } from "@tanstack/react-table";
|
|
2
|
+
import { parseSearchTerms, rankColumnValue, rankRowColumns } from "./utils";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fuzzy matches a column against search terms.
|
|
6
|
+
* A true value is returned if the column's value passes the ranking threshold.
|
|
7
|
+
* Normally, TanStack global filtering will not process remaining row columns if a match is found.
|
|
8
|
+
* This function ranks other row columns for highlighting purposes.
|
|
9
|
+
* @param row - Row.
|
|
10
|
+
* @param columnId - Column identifier.
|
|
11
|
+
* @param value - Search term.
|
|
12
|
+
* @param addMeta - Function to add filter metadata.
|
|
13
|
+
* @returns Whether the row passed the filter.
|
|
14
|
+
*/
|
|
15
|
+
export function fuzzy<T extends RowData>(
|
|
16
|
+
row: Row<T>,
|
|
17
|
+
columnId: string,
|
|
18
|
+
value: unknown,
|
|
19
|
+
addMeta: (meta: FilterMeta) => void
|
|
20
|
+
): boolean {
|
|
21
|
+
// Split the search term into terms.
|
|
22
|
+
const terms = parseSearchTerms(value);
|
|
23
|
+
|
|
24
|
+
// Rank the column value.
|
|
25
|
+
const passed = rankColumnValue(row, columnId, terms);
|
|
26
|
+
|
|
27
|
+
// Add the filter metadata.
|
|
28
|
+
addMeta({ passed });
|
|
29
|
+
|
|
30
|
+
// Rank other columns for highlighting purposes (TanStack global filtering will not process remaining columns if a match is found).
|
|
31
|
+
if (passed) rankRowColumns(row, columnId, terms);
|
|
32
|
+
|
|
33
|
+
return passed;
|
|
34
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { rankItem } from "@tanstack/match-sorter-utils";
|
|
2
|
+
import { Row, RowData } from "@tanstack/react-table";
|
|
3
|
+
import { RANK_ITEM_OPTIONS } from "./constants";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Parses a search term into an array of terms.
|
|
7
|
+
* @param value - Search term.
|
|
8
|
+
* @returns Array of terms.
|
|
9
|
+
*/
|
|
10
|
+
export function parseSearchTerms(value: unknown): string[] {
|
|
11
|
+
return String(value ?? "")
|
|
12
|
+
.toLowerCase()
|
|
13
|
+
.trim()
|
|
14
|
+
.split(/\s+/)
|
|
15
|
+
.filter(Boolean);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Ranks a column's value against search terms.
|
|
20
|
+
* @param row - Row to rank.
|
|
21
|
+
* @param columnId - Column identifier.
|
|
22
|
+
* @param terms - Search terms to match against.
|
|
23
|
+
* @returns Whether the value passed.
|
|
24
|
+
*/
|
|
25
|
+
export function rankColumnValue<T extends RowData>(
|
|
26
|
+
row: Row<T>,
|
|
27
|
+
columnId: string,
|
|
28
|
+
terms: string[]
|
|
29
|
+
): boolean {
|
|
30
|
+
// Get the column value.
|
|
31
|
+
const columnValue = row.getValue(columnId);
|
|
32
|
+
|
|
33
|
+
// Return false if the column value is undefined or null.
|
|
34
|
+
if (columnValue === undefined || columnValue === null) return false;
|
|
35
|
+
|
|
36
|
+
// Check if each term matches the column value.
|
|
37
|
+
// Ranking from CASE_SENSITIVE_EQUAL to CONTAINS (excludes `ACRONYM`, `MATCHES` threshold).
|
|
38
|
+
const rankings = terms.map((term) =>
|
|
39
|
+
rankItem(String(columnValue), term, RANK_ITEM_OPTIONS)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return rankings.every(({ passed }) => passed);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Ranks a row's columns against search terms.
|
|
47
|
+
* Processes columns that are searchable and have not already been processed.
|
|
48
|
+
* @param row - Row to rank.
|
|
49
|
+
* @param columnId - Column identifier.
|
|
50
|
+
* @param terms - Search terms to match against.
|
|
51
|
+
*/
|
|
52
|
+
export function rankRowColumns<T extends RowData>(
|
|
53
|
+
row: Row<T>,
|
|
54
|
+
columnId: string,
|
|
55
|
+
terms: string[]
|
|
56
|
+
): void {
|
|
57
|
+
const columnFiltersMeta = row.columnFiltersMeta;
|
|
58
|
+
|
|
59
|
+
// Process other columns.
|
|
60
|
+
for (const { column } of row.getAllCells()) {
|
|
61
|
+
// Column is not searchable.
|
|
62
|
+
if (!column.getCanGlobalFilter()) continue;
|
|
63
|
+
|
|
64
|
+
// Column has already been processed.
|
|
65
|
+
if (column.id === columnId) continue;
|
|
66
|
+
if (column.id in columnFiltersMeta) continue;
|
|
67
|
+
|
|
68
|
+
// Rank the column value.
|
|
69
|
+
const passed = rankColumnValue(row, column.id, terms);
|
|
70
|
+
|
|
71
|
+
// Add the filter metadata.
|
|
72
|
+
row.columnFiltersMeta[column.id] = { passed };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
height: auto;
|
|
9
|
+
justify-self: flex-start;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
|
|
12
|
+
.MuiChip-label {
|
|
13
|
+
padding: 2px 8px;
|
|
14
|
+
white-space: normal;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CellContext, RowData } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CHIP_PROPS } from "../../../../../../styles/common/mui/chip";
|
|
4
|
+
import { BaseComponentProps } from "../../../../../types";
|
|
5
|
+
import { StyledChip } from "./codeCell.styles";
|
|
6
|
+
|
|
7
|
+
export const CodeCell = <T extends RowData, TValue extends string = string>({
|
|
8
|
+
className,
|
|
9
|
+
getValue,
|
|
10
|
+
}: BaseComponentProps & CellContext<T, TValue>): JSX.Element | null => {
|
|
11
|
+
const value = getValue();
|
|
12
|
+
if (!value) return null;
|
|
13
|
+
return (
|
|
14
|
+
<StyledChip
|
|
15
|
+
className={className}
|
|
16
|
+
color={CHIP_PROPS.COLOR.DEFAULT}
|
|
17
|
+
label={value}
|
|
18
|
+
size={CHIP_PROPS.SIZE.SMALL}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CellContext, RowData } from "@tanstack/react-table";
|
|
2
|
+
import React, { Fragment } from "react";
|
|
3
|
+
import { BaseComponentProps } from "../../../../../types";
|
|
4
|
+
import { getTokens, getTokensRegex, isRankedCell } from "./utils";
|
|
5
|
+
|
|
6
|
+
export const RankedCell = <
|
|
7
|
+
T extends RowData,
|
|
8
|
+
TValue = string | undefined | null
|
|
9
|
+
>({
|
|
10
|
+
className,
|
|
11
|
+
column,
|
|
12
|
+
getValue,
|
|
13
|
+
row,
|
|
14
|
+
table,
|
|
15
|
+
}: BaseComponentProps & CellContext<T, TValue>): JSX.Element | null => {
|
|
16
|
+
// Get the cell value.
|
|
17
|
+
const value = getValue();
|
|
18
|
+
|
|
19
|
+
// If the cell value is undefined or null, return null.
|
|
20
|
+
if (value === undefined || value === null) return null;
|
|
21
|
+
|
|
22
|
+
// Convert the cell value to a string.
|
|
23
|
+
const stringValue = String(value);
|
|
24
|
+
|
|
25
|
+
// Check if the cell is ranked.
|
|
26
|
+
const isRanked = isRankedCell(table, row, column.id);
|
|
27
|
+
|
|
28
|
+
// Return the unranked cell, as-is.
|
|
29
|
+
if (!isRanked) return <Fragment>{stringValue}</Fragment>;
|
|
30
|
+
|
|
31
|
+
// Tokenise the current global filter.
|
|
32
|
+
const tokens = getTokens(table);
|
|
33
|
+
|
|
34
|
+
// If there are no tokens, return the value as-is.
|
|
35
|
+
if (tokens.length === 0) return <Fragment>{stringValue}</Fragment>;
|
|
36
|
+
|
|
37
|
+
// Create regex pattern.
|
|
38
|
+
const regex = getTokensRegex(tokens);
|
|
39
|
+
|
|
40
|
+
// Return the ranked cell, with highlighting.
|
|
41
|
+
return (
|
|
42
|
+
<span className={className}>
|
|
43
|
+
{stringValue.split(regex).map((part, i) => (
|
|
44
|
+
<Fragment key={i}>
|
|
45
|
+
{part.match(regex) ? <mark>{part}</mark> : part}
|
|
46
|
+
</Fragment>
|
|
47
|
+
))}
|
|
48
|
+
</span>
|
|
49
|
+
);
|
|
50
|
+
};
|