@databiosphere/findable-ui 40.0.0 → 41.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 +22 -0
- package/lib/common/entities.d.ts +8 -0
- package/lib/common/entities.js +4 -1
- package/lib/components/DataDictionary/components/Description/description.js +2 -2
- package/lib/components/DataDictionary/components/Description/description.styles.d.ts +1 -1
- package/lib/components/DataDictionary/components/Description/description.styles.js +2 -2
- package/lib/components/DataDictionary/components/Entity/entity.styles.js +5 -0
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.js +4 -1
- package/lib/components/DataDictionary/components/Filters/components/ColumnFilters/columnFilters.js +6 -1
- package/lib/components/DataDictionary/components/Filters/filters.styles.js +0 -5
- package/lib/components/DataDictionary/components/Filters/stories/constants.d.ts +1 -0
- package/lib/components/DataDictionary/components/Filters/stories/constants.js +1 -0
- package/lib/components/DataDictionary/components/Filters/stories/filters.stories.js +9 -3
- package/lib/components/DataDictionary/components/Filters/stories/utils.d.ts +7 -0
- package/lib/components/DataDictionary/components/Filters/stories/utils.js +12 -0
- package/lib/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.js +2 -2
- package/lib/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.js +6 -2
- package/lib/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.js +2 -2
- package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.js +6 -2
- package/lib/components/DataDictionary/components/Table/table.js +7 -4
- package/lib/components/DataDictionary/components/Table/table.styles.d.ts +1 -1
- package/lib/components/DataDictionary/components/Table/table.styles.js +2 -2
- package/lib/components/DataDictionary/components/Title/title.styles.js +2 -2
- package/lib/components/DataDictionary/dataDictionary.styles.d.ts +0 -1
- package/lib/components/DataDictionary/dataDictionary.styles.js +8 -8
- package/lib/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.js +2 -2
- package/lib/components/Filter/components/Filter/filter.d.ts +3 -2
- package/lib/components/Filter/components/Filter/filter.js +13 -11
- package/lib/components/Filter/components/Filter/filter.styles.d.ts +3 -5
- package/lib/components/Filter/components/Filter/filter.styles.js +16 -19
- package/lib/components/Filter/components/Filter/stories/args.js +3 -2
- package/lib/components/Filter/components/FilterLabel/filterLabel.d.ts +3 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.js +3 -3
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.d.ts +3 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.js +2 -0
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +3 -6
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.js +16 -13
- package/lib/components/Filter/components/FilterList/filterList.styles.d.ts +1 -1
- package/lib/components/Filter/components/FilterList/filterList.styles.js +1 -1
- package/lib/components/Filter/components/FilterMenu/filterMenu.d.ts +3 -2
- package/lib/components/Filter/components/FilterMenu/filterMenu.js +11 -11
- package/lib/components/Filter/components/FilterMenu/filterMenu.stories.d.ts +3 -2
- package/lib/components/Filter/components/FilterMenu/filterMenu.stories.js +2 -1
- package/lib/components/Filter/components/FilterMenu/filterMenu.styles.d.ts +2 -6
- package/lib/components/Filter/components/FilterMenu/filterMenu.styles.js +7 -17
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.d.ts +3 -1
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.js +3 -3
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.styles.d.ts +3 -2
- package/lib/components/Filter/components/FilterMenuSearch/filterMenuSearch.styles.js +9 -5
- package/lib/components/Filter/components/FilterRange/filterRange.d.ts +1 -1
- package/lib/components/Filter/components/FilterRange/filterRange.js +7 -8
- package/lib/components/Filter/components/FilterRange/filterRange.styles.d.ts +2 -1
- package/lib/components/Filter/components/FilterRange/filterRange.styles.js +20 -16
- package/lib/components/Filter/components/FilterRange/stories/args.js +2 -1
- package/lib/components/Filter/components/FilterRange/types.d.ts +2 -1
- package/lib/components/Filter/components/Filters/filters.d.ts +5 -2
- package/lib/components/Filter/components/Filters/filters.js +7 -8
- package/lib/components/Filter/components/Filters/filters.styles.d.ts +6 -5
- package/lib/components/Filter/components/Filters/filters.styles.js +11 -11
- package/lib/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.js +2 -2
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.d.ts +3 -2
- package/lib/components/Filter/components/VariableSizeList/VariableSizeList.js +9 -8
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.d.ts +3 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.js +24 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.d.ts +6 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.js +1 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.d.ts +14 -0
- package/lib/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.js +67 -0
- package/lib/components/Filter/components/controls/Controls/controls.d.ts +6 -0
- package/lib/components/Filter/components/controls/Controls/controls.js +14 -0
- package/lib/components/Filter/components/controls/Controls/controls.styles.d.ts +7 -0
- package/lib/components/Filter/components/controls/Controls/controls.styles.js +9 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/constants.d.ts +2 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/constants.js +5 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.d.ts +2 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.js +17 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.styles.d.ts +3 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/drawer.styles.js +19 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/types.d.ts +7 -0
- package/lib/components/Filter/components/surfaces/drawer/Drawer/types.js +1 -0
- package/lib/components/Filter/components/surfaces/drawer/components/Button/button.d.ts +7 -0
- package/lib/components/Filter/components/surfaces/drawer/components/Button/button.js +16 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.d.ts +6 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.js +14 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.styles.d.ts +5 -0
- package/lib/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.styles.js +12 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/constants.d.ts +3 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/constants.js +9 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.d.ts +6 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.js +13 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.styles.d.ts +5 -0
- package/lib/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.styles.js +9 -0
- package/lib/components/Filter/components/surfaces/types.d.ts +11 -0
- package/lib/components/Filter/components/surfaces/types.js +5 -0
- package/lib/components/Filter/components/views/select/SelectListItem/selectListItem.d.ts +3 -0
- package/lib/components/Filter/components/views/select/SelectListItem/selectListItem.js +9 -0
- package/lib/components/Filter/components/views/select/SelectListItem/types.d.ts +12 -0
- package/lib/components/Filter/components/views/select/SelectListItem/types.js +1 -0
- package/lib/components/Filter/components/views/select/components/Checkbox/checkbox.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/Checkbox/checkbox.js +7 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.d.ts +7 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.js +5 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.styles.d.ts +5 -0
- package/lib/components/Filter/components/views/select/components/ListItemButton/listItemButton.styles.js +11 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Count/count.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Count/count.js +6 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Term/term.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/components/Term/term.js +6 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.js +26 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.styles.d.ts +3 -0
- package/lib/components/Filter/components/views/select/components/ListItemText/listItemText.styles.js +12 -0
- package/lib/components/Table/components/TableFeatures/ColumnFilter/columnFilter.js +23 -8
- package/lib/components/Table/components/TableFeatures/ColumnFilter/constants.js +5 -0
- package/lib/components/common/Button/constants.js +4 -0
- package/lib/components/common/Drawer/provider/provider.d.ts +2 -4
- package/lib/components/common/Drawer/provider/provider.js +4 -2
- package/lib/components/common/Drawer/provider/types.d.ts +5 -1
- package/lib/hooks/useCategoryFilter.d.ts +2 -2
- package/lib/styles/common/mixins/breakpoints.d.ts +2 -0
- package/lib/styles/common/mixins/breakpoints.js +2 -0
- package/lib/styles/common/mui/typography.js +2 -0
- package/lib/utils/typeGuards.d.ts +6 -0
- package/lib/utils/typeGuards.js +8 -0
- package/lib/views/ExploreView/exploreView.js +4 -1
- package/package.json +1 -1
- package/src/common/entities.ts +10 -0
- package/src/components/DataDictionary/components/Description/description.styles.ts +2 -2
- package/src/components/DataDictionary/components/Description/description.tsx +3 -6
- package/src/components/DataDictionary/components/Entity/entity.styles.ts +5 -0
- package/src/components/DataDictionary/components/Filters/components/ColumnFilterTags/columnFilterTags.tsx +4 -1
- package/src/components/DataDictionary/components/Filters/components/ColumnFilters/columnFilters.tsx +12 -1
- package/src/components/DataDictionary/components/Filters/filters.styles.ts +0 -5
- package/src/components/DataDictionary/components/Filters/stories/constants.ts +2 -0
- package/src/components/DataDictionary/components/Filters/stories/filters.stories.tsx +11 -4
- package/src/components/DataDictionary/components/Filters/stories/utils.ts +15 -0
- package/src/components/DataDictionary/components/Layout/components/EntitiesLayout/entitiesLayout.styles.ts +2 -2
- package/src/components/DataDictionary/components/Layout/components/FiltersLayout/filtersLayout.styles.ts +9 -2
- package/src/components/DataDictionary/components/Layout/components/OutlineLayout/outlineLayout.styles.ts +2 -2
- package/src/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.ts +9 -2
- package/src/components/DataDictionary/components/Table/table.styles.ts +2 -2
- package/src/components/DataDictionary/components/Table/table.tsx +8 -4
- package/src/components/DataDictionary/components/Title/title.styles.ts +2 -2
- package/src/components/DataDictionary/dataDictionary.styles.ts +11 -9
- package/src/components/Detail/components/Table/components/TableRows/components/CollapsableRows/collapsableRows.tsx +1 -1
- package/src/components/Filter/components/Filter/filter.styles.ts +18 -20
- package/src/components/Filter/components/Filter/filter.tsx +17 -19
- package/src/components/Filter/components/Filter/stories/args.ts +3 -2
- package/src/components/Filter/components/FilterLabel/filterLabel.stories.tsx +2 -0
- package/src/components/Filter/components/FilterLabel/filterLabel.styles.ts +20 -19
- package/src/components/Filter/components/FilterLabel/filterLabel.tsx +7 -3
- package/src/components/Filter/components/FilterList/filterList.styles.ts +1 -1
- package/src/components/Filter/components/FilterMenu/filterMenu.stories.tsx +2 -1
- package/src/components/Filter/components/FilterMenu/filterMenu.styles.ts +9 -18
- package/src/components/Filter/components/FilterMenu/filterMenu.tsx +15 -19
- package/src/components/Filter/components/FilterMenuSearch/filterMenuSearch.styles.ts +11 -5
- package/src/components/Filter/components/FilterMenuSearch/filterMenuSearch.tsx +5 -1
- package/src/components/Filter/components/FilterRange/filterRange.styles.ts +25 -19
- package/src/components/Filter/components/FilterRange/filterRange.tsx +8 -12
- package/src/components/Filter/components/FilterRange/stories/args.ts +2 -1
- package/src/components/Filter/components/FilterRange/types.ts +2 -1
- package/src/components/Filter/components/Filters/filters.styles.ts +16 -16
- package/src/components/Filter/components/Filters/filters.tsx +19 -13
- package/src/components/Filter/components/SearchAllFilters/components/VariableSizeList/VariableSizeList.tsx +2 -2
- package/src/components/Filter/components/VariableSizeList/VariableSizeList.tsx +10 -9
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter.tsx +44 -0
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/types.ts +7 -0
- package/src/components/Filter/components/adapters/tanstack/ColumnFiltersAdapter/utils.ts +90 -0
- package/src/components/Filter/components/controls/Controls/controls.styles.ts +10 -0
- package/src/components/Filter/components/controls/Controls/controls.tsx +31 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/constants.ts +7 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/drawer.styles.ts +20 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/drawer.tsx +46 -0
- package/src/components/Filter/components/surfaces/drawer/Drawer/types.ts +11 -0
- package/src/components/Filter/components/surfaces/drawer/components/Button/button.tsx +40 -0
- package/src/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.styles.ts +13 -0
- package/src/components/Filter/components/surfaces/drawer/components/ButtonBase/buttonBase.tsx +25 -0
- package/src/components/Filter/components/surfaces/drawer/components/IconButton/constants.ts +12 -0
- package/src/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.styles.ts +10 -0
- package/src/components/Filter/components/surfaces/drawer/components/IconButton/iconButton.tsx +28 -0
- package/src/components/Filter/components/surfaces/types.ts +13 -0
- package/src/components/Filter/components/views/select/SelectListItem/selectListItem.tsx +19 -0
- package/src/components/Filter/components/views/select/SelectListItem/types.ts +14 -0
- package/src/components/Filter/components/views/select/components/Checkbox/checkbox.tsx +19 -0
- package/src/components/Filter/components/views/select/components/ListItemButton/listItemButton.styles.ts +12 -0
- package/src/components/Filter/components/views/select/components/ListItemButton/listItemButton.tsx +25 -0
- package/src/components/Filter/components/views/select/components/ListItemText/components/Count/count.tsx +20 -0
- package/src/components/Filter/components/views/select/components/ListItemText/components/Term/term.tsx +19 -0
- package/src/components/Filter/components/views/select/components/ListItemText/listItemText.styles.ts +13 -0
- package/src/components/Filter/components/views/select/components/ListItemText/listItemText.tsx +48 -0
- package/src/components/Table/components/TableFeatures/ColumnFilter/columnFilter.tsx +34 -35
- package/src/components/Table/components/TableFeatures/ColumnFilter/constants.ts +5 -0
- package/src/components/common/Button/constants.ts +4 -0
- package/src/components/common/Drawer/provider/provider.tsx +7 -8
- package/src/components/common/Drawer/provider/types.ts +6 -4
- package/src/hooks/useCategoryFilter.ts +2 -1
- package/src/styles/common/mixins/breakpoints.ts +6 -0
- package/src/styles/common/mui/typography.ts +2 -0
- package/src/utils/typeGuards.ts +8 -0
- package/src/views/ExploreView/exploreView.tsx +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [41.0.0](https://github.com/DataBiosphere/findable-ui/compare/v40.0.0...v41.0.0) (2025-07-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* create filter drawer component ([#597](https://github.com/DataBiosphere/findable-ui/issues/597)) (#598)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add primary text to button constants ([#588](https://github.com/DataBiosphere/findable-ui/issues/588)) ([#589](https://github.com/DataBiosphere/findable-ui/issues/589)) ([2d708cc](https://github.com/DataBiosphere/findable-ui/commit/2d708cc710159f5539330509b2e6beca10b2fa88))
|
|
13
|
+
* create filter button component ([#592](https://github.com/DataBiosphere/findable-ui/issues/592)) ([#594](https://github.com/DataBiosphere/findable-ui/issues/594)) ([b30098a](https://github.com/DataBiosphere/findable-ui/commit/b30098a4a5f12e9dd5c5aed8526ecb8077015ac2))
|
|
14
|
+
* create filter drawer component ([#597](https://github.com/DataBiosphere/findable-ui/issues/597)) ([#598](https://github.com/DataBiosphere/findable-ui/issues/598)) ([8352876](https://github.com/DataBiosphere/findable-ui/commit/8352876fd1934e9d0877ce4a97c01eaf8a60c295))
|
|
15
|
+
* create select filter item component ([#595](https://github.com/DataBiosphere/findable-ui/issues/595)) ([#596](https://github.com/DataBiosphere/findable-ui/issues/596)) ([b63e3bb](https://github.com/DataBiosphere/findable-ui/commit/b63e3bb793396e5ec220f2f9e85097a0fdeddd52))
|
|
16
|
+
* make data dictionary table row-collapse for smaller viewports ([#600](https://github.com/DataBiosphere/findable-ui/issues/600)) ([#601](https://github.com/DataBiosphere/findable-ui/issues/601)) ([88d0490](https://github.com/DataBiosphere/findable-ui/commit/88d0490bc8b659020f20abb5c1abd3136829d74b))
|
|
17
|
+
* update data dictionary smaller viewport navigation and search bar layouts ([#583](https://github.com/DataBiosphere/findable-ui/issues/583)) ([#584](https://github.com/DataBiosphere/findable-ui/issues/584)) ([20b9a53](https://github.com/DataBiosphere/findable-ui/commit/20b9a53cdc390fe85bfdf82845e7d6964f4d0cc3))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Code Refactoring
|
|
21
|
+
|
|
22
|
+
* columnfilter menu list prop component to be "div" rather than "ul" ([#590](https://github.com/DataBiosphere/findable-ui/issues/590)) ([#591](https://github.com/DataBiosphere/findable-ui/issues/591)) ([c504b99](https://github.com/DataBiosphere/findable-ui/commit/c504b99936b74b4f7e05b18ac69e2eef8336264d))
|
|
23
|
+
* drawerprovider to expose onClose via render prop ([#585](https://github.com/DataBiosphere/findable-ui/issues/585)) ([#587](https://github.com/DataBiosphere/findable-ui/issues/587)) ([2107c41](https://github.com/DataBiosphere/findable-ui/commit/2107c41545fbad344077f6c87bf1b27d2ac21a22))
|
|
24
|
+
|
|
3
25
|
## [40.0.0](https://github.com/DataBiosphere/findable-ui/compare/v39.1.0...v40.0.0) (2025-07-24)
|
|
4
26
|
|
|
5
27
|
|
package/lib/common/entities.d.ts
CHANGED
|
@@ -19,6 +19,14 @@ export interface Attribute {
|
|
|
19
19
|
* Filterable metadata keys.
|
|
20
20
|
*/
|
|
21
21
|
export type CategoryKey = string;
|
|
22
|
+
/**
|
|
23
|
+
* Clear all filters key.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CLEAR_ALL: "CLEAR_ALL";
|
|
26
|
+
/**
|
|
27
|
+
* Clear all filters type.
|
|
28
|
+
*/
|
|
29
|
+
export type ClearAll = typeof CLEAR_ALL;
|
|
22
30
|
/**
|
|
23
31
|
* View model of category tag.
|
|
24
32
|
*/
|
package/lib/common/entities.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StyledFluidPaper, StyledMarkdownRenderer } from "./description.styles";
|
|
3
3
|
export const Description = ({ description, }) => {
|
|
4
4
|
if (!description)
|
|
5
5
|
return null;
|
|
6
|
-
return (React.createElement(
|
|
6
|
+
return (React.createElement(StyledFluidPaper, { elevation: 0 },
|
|
7
7
|
React.createElement(StyledMarkdownRenderer, { value: description })));
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const StyledFluidPaper: import("@emotion/styled").StyledComponent<import("../../../types").BaseComponentProps & import("@mui/material").PaperOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
3
|
}, "style" | "className" | "classes" | "children" | "sx" | "elevation" | "square" | "variant"> & {
|
|
4
4
|
component?: React.ElementType;
|
|
@@ -2,9 +2,9 @@ import styled from "@emotion/styled";
|
|
|
2
2
|
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
3
3
|
import { mediaTabletDown, mediaTabletUp, } from "../../../../styles/common/mixins/breakpoints";
|
|
4
4
|
import { textHeadingSmall } from "../../../../styles/common/mixins/fonts";
|
|
5
|
-
import {
|
|
5
|
+
import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
|
|
6
6
|
import { MarkdownRenderer } from "../../../MarkdownRenderer/markdownRenderer";
|
|
7
|
-
export const
|
|
7
|
+
export const StyledFluidPaper = styled(FluidPaper) `
|
|
8
8
|
padding: 20px;
|
|
9
9
|
|
|
10
10
|
${mediaTabletDown} {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Typography } from "@mui/material";
|
|
3
|
+
import { mediaTabletDown } from "../../../../styles/common/mixins/breakpoints";
|
|
3
4
|
export const StyledTypography = styled(Typography) `
|
|
4
5
|
&:hover a {
|
|
5
6
|
opacity: 1;
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
${mediaTabletDown} {
|
|
10
|
+
margin: 0 16px;
|
|
11
|
+
}
|
|
7
12
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from "@mui/material";
|
|
1
|
+
import { Button, useMediaQuery } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { BUTTON_PROPS } from "../../../../../../styles/common/mui/button";
|
|
4
4
|
import { ColumnFilterTag } from "../../../../../Table/components/TableFeatures/ColumnFilter/components/ColumnFilterTag/columnFilterTag";
|
|
@@ -7,8 +7,11 @@ import { GRID_PROPS } from "./constants";
|
|
|
7
7
|
export const ColumnFilterTags = ({ className, table, }) => {
|
|
8
8
|
const { getAllColumns, resetColumnFilters } = table;
|
|
9
9
|
const columns = getAllColumns().filter((column) => column.getIsFiltered());
|
|
10
|
+
const isDrawer = useMediaQuery((theme) => theme.breakpoints.down(820));
|
|
10
11
|
if (columns.length === 0)
|
|
11
12
|
return null;
|
|
13
|
+
if (isDrawer)
|
|
14
|
+
return null;
|
|
12
15
|
return (React.createElement(StyledGrid, { className: className, ...GRID_PROPS },
|
|
13
16
|
columns.map((column) => (React.createElement(ColumnFilterTag, { key: column.id, column: column }))),
|
|
14
17
|
React.createElement(Button, { onClick: () => resetColumnFilters(true), variant: BUTTON_PROPS.VARIANT.TEXT }, "Clear all")));
|
package/lib/components/DataDictionary/components/Filters/components/ColumnFilters/columnFilters.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { ButtonGroup } from "@mui/material";
|
|
1
|
+
import { ButtonGroup, useMediaQuery } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { BUTTON_GROUP_PROPS } from "../../../../../common/ButtonGroup/constants";
|
|
4
|
+
import { ColumnFiltersAdapter } from "../../../../../Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter";
|
|
5
|
+
import { Drawer } from "../../../../../Filter/components/surfaces/drawer/Drawer/drawer";
|
|
4
6
|
import { ColumnFilter } from "../../../../../Table/components/TableFeatures/ColumnFilter/columnFilter";
|
|
5
7
|
export const ColumnFilters = ({ table, }) => {
|
|
6
8
|
const columns = table.getAllColumns();
|
|
7
9
|
const columnFilters = columns.filter((column) => column.getCanFilter());
|
|
8
10
|
const enableColumnFilters = table.options.enableColumnFilters;
|
|
11
|
+
const isDrawer = useMediaQuery((theme) => theme.breakpoints.down(820));
|
|
9
12
|
if (!enableColumnFilters)
|
|
10
13
|
return null;
|
|
14
|
+
if (isDrawer)
|
|
15
|
+
return (React.createElement(ColumnFiltersAdapter, { table: table, renderSurface: (props) => React.createElement(Drawer, { ...props }) }));
|
|
11
16
|
return (React.createElement(ButtonGroup, { ...BUTTON_GROUP_PROPS.SECONDARY_OUTLINED }, columnFilters.map((column) => (React.createElement(ColumnFilter, { key: column.id, column: column })))));
|
|
12
17
|
};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Grid } from "@mui/material";
|
|
3
|
-
import { mediaTabletDown } from "../../../../styles/common/mixins/breakpoints";
|
|
4
3
|
export const StyledGrid = styled(Grid) `
|
|
5
4
|
align-items: center;
|
|
6
5
|
display: grid;
|
|
7
6
|
gap: 16px;
|
|
8
7
|
grid-template-columns: 1fr auto;
|
|
9
|
-
|
|
10
|
-
${mediaTabletDown} {
|
|
11
|
-
grid-template-columns: 1fr;
|
|
12
|
-
}
|
|
13
8
|
`;
|
|
@@ -3,8 +3,9 @@ import { action } from "@storybook/addon-actions";
|
|
|
3
3
|
import { functionalUpdate } from "@tanstack/react-table";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Filters } from "../filters";
|
|
6
|
-
import {
|
|
6
|
+
import { COLUMNS } from "./constants";
|
|
7
7
|
import { useFilterStore, useGlobalFilterStore } from "./hook";
|
|
8
|
+
import { buildColumnFilters } from "./utils";
|
|
8
9
|
const meta = {
|
|
9
10
|
component: Filters,
|
|
10
11
|
decorators: [
|
|
@@ -16,6 +17,8 @@ export default meta;
|
|
|
16
17
|
const DefaultStory = () => {
|
|
17
18
|
const { filterStore, setFilterStore } = useFilterStore();
|
|
18
19
|
const { globalFilter, setGlobalFilter } = useGlobalFilterStore();
|
|
20
|
+
// Builds column filters from filter store.
|
|
21
|
+
const columnFilters = buildColumnFilters(filterStore);
|
|
19
22
|
const makeColumn = (column) => ({
|
|
20
23
|
...column,
|
|
21
24
|
getFilterValue: () => filterStore[column.id],
|
|
@@ -27,9 +30,12 @@ const DefaultStory = () => {
|
|
|
27
30
|
return next;
|
|
28
31
|
},
|
|
29
32
|
});
|
|
33
|
+
// Make the columns.
|
|
34
|
+
const columns = COLUMNS.map(makeColumn);
|
|
30
35
|
const table = {
|
|
31
|
-
getAllColumns: () =>
|
|
32
|
-
|
|
36
|
+
getAllColumns: () => columns,
|
|
37
|
+
getColumn: (columnId) => columns.find(({ id }) => id === columnId),
|
|
38
|
+
getState: () => ({ columnFilters, globalFilter }),
|
|
33
39
|
options: { enableColumnFilters: true, enableGlobalFilter: true },
|
|
34
40
|
setGlobalFilter,
|
|
35
41
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ColumnFiltersState } from "@tanstack/react-table";
|
|
2
|
+
/**
|
|
3
|
+
* Builds column filters from filter store.
|
|
4
|
+
* @param filterStore - The filter store.
|
|
5
|
+
* @returns The column filters.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildColumnFilters(filterStore: Record<string, unknown>): ColumnFiltersState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds column filters from filter store.
|
|
3
|
+
* @param filterStore - The filter store.
|
|
4
|
+
* @returns The column filters.
|
|
5
|
+
*/
|
|
6
|
+
export function buildColumnFilters(filterStore) {
|
|
7
|
+
return Object.entries(filterStore).reduce((acc, [id, value]) => {
|
|
8
|
+
if (!value)
|
|
9
|
+
return acc;
|
|
10
|
+
return [...acc, { id, value }];
|
|
11
|
+
}, []);
|
|
12
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
2
|
+
import { bpDown1024 } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
3
|
import { LAYOUT_SPACING } from "../../constants";
|
|
4
4
|
const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
5
5
|
const PT = LAYOUT_SPACING.CONTENT_PADDING_TOP; /* top padding */
|
|
@@ -12,7 +12,7 @@ export const Layout = styled("div") `
|
|
|
12
12
|
padding-top: ${({ top }) => top}px;
|
|
13
13
|
z-index: 1; /* not required, but helpful in that the entities are always on top */
|
|
14
14
|
|
|
15
|
-
${
|
|
15
|
+
${bpDown1024} {
|
|
16
16
|
grid-column: 1;
|
|
17
17
|
grid-row: auto;
|
|
18
18
|
padding-top: ${PT}px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { PALETTE } from "../../../../../../styles/common/constants/palette";
|
|
3
|
-
import { mediaTabletDown } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
|
+
import { bpDown1024, mediaTabletDown, } from "../../../../../../styles/common/mixins/breakpoints";
|
|
4
4
|
import { LAYOUT_SPACING } from "../../constants";
|
|
5
5
|
const PB = LAYOUT_SPACING.FILTERS_PADDING_BOTTOM; /* bottom padding */
|
|
6
6
|
const PT = LAYOUT_SPACING.FILTERS_PADDING_TOP; /* top padding */
|
|
@@ -18,10 +18,14 @@ export const Layout = styled("div") `
|
|
|
18
18
|
top: 0;
|
|
19
19
|
z-index: 2; /* required, filters should be on top of entities */
|
|
20
20
|
|
|
21
|
-
${
|
|
21
|
+
${bpDown1024} {
|
|
22
22
|
grid-column: 1;
|
|
23
23
|
grid-row: auto;
|
|
24
24
|
padding-top: ${PT}px;
|
|
25
25
|
position: relative;
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
${mediaTabletDown} {
|
|
29
|
+
margin: 0 16px;
|
|
30
|
+
}
|
|
27
31
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
2
|
+
import { bpDown1024 } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
3
|
import { LAYOUT_SPACING } from "../../constants";
|
|
4
4
|
const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
5
5
|
const PT = LAYOUT_SPACING.OUTLINE_PADDING_TOP; /* top padding */
|
|
@@ -15,7 +15,7 @@ export const Layout = styled("div") `
|
|
|
15
15
|
position: sticky;
|
|
16
16
|
top: 0;
|
|
17
17
|
|
|
18
|
-
${
|
|
18
|
+
${bpDown1024} {
|
|
19
19
|
display: none;
|
|
20
20
|
}
|
|
21
21
|
`;
|
package/lib/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import { mediaTabletDown } from "../../../../../../styles/common/mixins/breakpoints";
|
|
2
|
+
import { bpDown1024, mediaTabletDown, } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
3
|
export const Layout = styled("div") `
|
|
4
4
|
grid-column: 1 / -1;
|
|
5
5
|
grid-row: 1;
|
|
@@ -9,9 +9,13 @@ export const Layout = styled("div") `
|
|
|
9
9
|
top: 0;
|
|
10
10
|
z-index: 4;
|
|
11
11
|
|
|
12
|
-
${
|
|
12
|
+
${bpDown1024} {
|
|
13
13
|
grid-column: 1;
|
|
14
14
|
grid-row: auto;
|
|
15
15
|
position: relative;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
${mediaTabletDown} {
|
|
19
|
+
margin: 0 16px;
|
|
20
|
+
}
|
|
17
21
|
`;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { TableContainer } from "@mui/material";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { useBreakpoint } from "../../../../hooks/useBreakpoint";
|
|
3
4
|
import { TableBody } from "../../../Detail/components/Table/components/TableBody/tableBody";
|
|
4
5
|
import { ROW_DIRECTION } from "../../../Table/common/entities";
|
|
5
6
|
import { TableHead } from "../../../Table/components/TableHead/tableHead";
|
|
6
7
|
import { GridTable } from "../../../Table/table.styles";
|
|
7
8
|
import { getColumnTrackSizing } from "../../../TableCreator/options/columnTrackSizing/utils";
|
|
8
|
-
import {
|
|
9
|
+
import { StyledFluidPaper } from "./table.styles";
|
|
9
10
|
export const Table = ({ row, table, }) => {
|
|
10
|
-
|
|
11
|
+
const { smDown } = useBreakpoint();
|
|
12
|
+
const rowDirection = smDown ? ROW_DIRECTION.VERTICAL : ROW_DIRECTION.DEFAULT;
|
|
13
|
+
return (React.createElement(StyledFluidPaper, { elevation: 0 },
|
|
11
14
|
React.createElement(TableContainer, null,
|
|
12
|
-
React.createElement(GridTable, { gridTemplateColumns: getColumnTrackSizing(table.getVisibleFlatColumns()) },
|
|
15
|
+
React.createElement(GridTable, { collapsable: true, gridTemplateColumns: getColumnTrackSizing(table.getVisibleFlatColumns()) },
|
|
13
16
|
React.createElement(TableHead, { tableInstance: table }),
|
|
14
|
-
React.createElement(TableBody, { rowDirection:
|
|
17
|
+
React.createElement(TableBody, { rowDirection: rowDirection, rows: row.getLeafRows(), tableInstance: table })))));
|
|
15
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const StyledFluidPaper: import("@emotion/styled").StyledComponent<import("../../../types").BaseComponentProps & import("@mui/material").PaperOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
3
|
}, "style" | "className" | "classes" | "children" | "sx" | "elevation" | "square" | "variant"> & {
|
|
4
4
|
component?: React.ElementType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
3
|
-
import {
|
|
4
|
-
export const
|
|
3
|
+
import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
|
|
4
|
+
export const StyledFluidPaper = styled(FluidPaper) `
|
|
5
5
|
background-color: ${PALETTE.SMOKE_MAIN};
|
|
6
6
|
display: grid;
|
|
7
7
|
gap: 1px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
2
|
+
import { bpDown820 } from "../../../../styles/common/mixins/breakpoints";
|
|
3
3
|
import { Title } from "../../../common/Title/title";
|
|
4
4
|
export const StyledTitle = styled(Title) `
|
|
5
5
|
& {
|
|
@@ -9,7 +9,7 @@ export const StyledTitle = styled(Title) `
|
|
|
9
9
|
line-height: 42px;
|
|
10
10
|
margin: 24px 0 8px;
|
|
11
11
|
|
|
12
|
-
${
|
|
12
|
+
${bpDown820} {
|
|
13
13
|
font-size: 26px;
|
|
14
14
|
line-height: 34px;
|
|
15
15
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { css } from "@emotion/react";
|
|
2
1
|
import styled from "@emotion/styled";
|
|
3
|
-
import { mediaTabletDown } from "../../styles/common/mixins/breakpoints";
|
|
4
|
-
export const
|
|
2
|
+
import { bpDown1024, mediaTabletDown, } from "../../styles/common/mixins/breakpoints";
|
|
3
|
+
export const View = styled("div") `
|
|
5
4
|
column-gap: 24px;
|
|
6
5
|
display: grid;
|
|
7
|
-
grid-template-columns: 242px 1fr;
|
|
8
|
-
`;
|
|
9
|
-
export const View = styled("div") `
|
|
10
|
-
${grid};
|
|
11
6
|
flex: 1;
|
|
7
|
+
grid-template-columns: 242px 1fr;
|
|
12
8
|
margin: 0 24px;
|
|
13
9
|
position: relative;
|
|
14
10
|
|
|
15
|
-
${
|
|
11
|
+
${bpDown1024} {
|
|
16
12
|
grid-template-columns: 1fr;
|
|
17
13
|
margin: 0 16px;
|
|
18
14
|
}
|
|
15
|
+
|
|
16
|
+
${mediaTabletDown} {
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
19
|
`;
|
|
@@ -8,8 +8,8 @@ export const CollapsableRows = ({ rows: leafOrSubRows, tableInstance, }) => {
|
|
|
8
8
|
const { rows } = getRowModel();
|
|
9
9
|
useCollapsableRows(tableInstance);
|
|
10
10
|
return (React.createElement(Fragment, null, (leafOrSubRows || rows).map((row) => {
|
|
11
|
-
if (row.depth > 0)
|
|
12
|
-
return null; // Hide sub rows.
|
|
11
|
+
if (row.depth > 0 && !leafOrSubRows)
|
|
12
|
+
return null; // Hide sub rows that are not already leaf or sub rows.
|
|
13
13
|
return (React.createElement(StyledTableRow, { key: row.id, id: row.id, isPreview: row.getIsPreview() },
|
|
14
14
|
React.createElement(CollapsableCell, { isDisabled: isCollapsableRowDisabled(tableInstance), row: row })));
|
|
15
15
|
})));
|
|
@@ -2,13 +2,14 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import { CategoryView } from "../../../../common/categories/views/types";
|
|
3
3
|
import { TrackFilterOpenedFunction } from "../../../../config/entities";
|
|
4
4
|
import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
|
|
5
|
+
import { SURFACE_TYPE } from "../surfaces/types";
|
|
5
6
|
export interface FilterProps {
|
|
6
7
|
categorySection?: string;
|
|
7
8
|
categoryView: CategoryView;
|
|
8
9
|
closeAncestor?: () => void;
|
|
9
|
-
isFilterDrawer: boolean;
|
|
10
10
|
onFilter: OnFilterFn;
|
|
11
|
+
surfaceType: SURFACE_TYPE;
|
|
11
12
|
tags?: ReactNode;
|
|
12
13
|
trackFilterOpened?: TrackFilterOpenedFunction;
|
|
13
14
|
}
|
|
14
|
-
export declare const Filter: ({ categorySection, categoryView, closeAncestor,
|
|
15
|
+
export declare const Filter: ({ categorySection, categoryView, closeAncestor, onFilter, surfaceType, tags, trackFilterOpened, }: FilterProps) => JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CloseRounded } from "@mui/icons-material";
|
|
2
1
|
import { Grow } from "@mui/material";
|
|
3
2
|
import React, { useState } from "react";
|
|
4
3
|
import { isRangeCategoryView } from "../../../../common/categories/views/range/typeGuards";
|
|
@@ -6,8 +5,10 @@ import { TEST_IDS } from "../../../../tests/testIds";
|
|
|
6
5
|
import { FilterLabel } from "../FilterLabel/filterLabel";
|
|
7
6
|
import { FilterMenu } from "../FilterMenu/filterMenu";
|
|
8
7
|
import { FilterRange } from "../FilterRange/filterRange";
|
|
8
|
+
import { IconButton } from "../surfaces/drawer/components/IconButton/iconButton";
|
|
9
|
+
import { SURFACE_TYPE } from "../surfaces/types";
|
|
9
10
|
import { DrawerTransition } from "./components/DrawerTransition/drawerTransition";
|
|
10
|
-
import {
|
|
11
|
+
import { StyledPopover } from "./filter.styles";
|
|
11
12
|
/**
|
|
12
13
|
* Filter component.
|
|
13
14
|
* TODO(cc) refactor: build tags from categoryView for selected values.
|
|
@@ -20,14 +21,15 @@ const DEFAULT_SLOT_PROPS = {
|
|
|
20
21
|
const DRAWER_SLOT_PROPS = {
|
|
21
22
|
paper: { elevation: 0 },
|
|
22
23
|
};
|
|
23
|
-
export const Filter = ({ categorySection, categoryView, closeAncestor,
|
|
24
|
+
export const Filter = ({ categorySection, categoryView, closeAncestor, onFilter, surfaceType, tags, trackFilterOpened, }) => {
|
|
24
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
25
26
|
const [position, setPosition] = useState(DEFAULT_POSITION);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const isDrawer = surfaceType === SURFACE_TYPE.DRAWER;
|
|
28
|
+
const anchorPosition = isDrawer ? DEFAULT_POSITION : position;
|
|
29
|
+
const slotProps = isDrawer ? DRAWER_SLOT_PROPS : DEFAULT_SLOT_PROPS;
|
|
30
|
+
const TransitionComponent = isDrawer ? DrawerTransition : Grow;
|
|
29
31
|
const transitionDuration = isOpen ? 250 : 300;
|
|
30
|
-
const TransitionDuration =
|
|
32
|
+
const TransitionDuration = isDrawer ? transitionDuration : undefined;
|
|
31
33
|
const isRangeView = isRangeCategoryView(categoryView);
|
|
32
34
|
/**
|
|
33
35
|
* Closes filter popover.
|
|
@@ -57,9 +59,9 @@ export const Filter = ({ categorySection, categoryView, closeAncestor, isFilterD
|
|
|
57
59
|
trackFilterOpened?.({ category: categoryView.key });
|
|
58
60
|
};
|
|
59
61
|
return (React.createElement(React.Fragment, null,
|
|
60
|
-
React.createElement(FilterLabel, { annotation: categoryView.annotation, count: isRangeView ? undefined : categoryView.values.length, disabled: categoryView.isDisabled, isOpen: isOpen, label: categoryView.label, onClick: onOpenFilter }),
|
|
61
|
-
React.createElement(
|
|
62
|
-
|
|
63
|
-
isRangeView ? (React.createElement(FilterRange, { categoryKey: categoryView.key, categoryLabel: categoryView.label, categorySection: categorySection,
|
|
62
|
+
React.createElement(FilterLabel, { annotation: categoryView.annotation, count: isRangeView ? undefined : categoryView.values.length, disabled: categoryView.isDisabled, isOpen: isOpen, label: categoryView.label, onClick: onOpenFilter, surfaceType: surfaceType }),
|
|
63
|
+
React.createElement(StyledPopover, { anchorPosition: anchorPosition, anchorReference: "anchorPosition", "data-testid": TEST_IDS.FILTER_POPOVER, marginThreshold: 0, onClose: onCloseFilters, open: isOpen, slotProps: slotProps, slots: { transition: TransitionComponent }, surfaceType: surfaceType, transitionDuration: TransitionDuration },
|
|
64
|
+
isDrawer && React.createElement(IconButton, { onClick: onCloseFilters }),
|
|
65
|
+
isRangeView ? (React.createElement(FilterRange, { categoryKey: categoryView.key, categoryLabel: categoryView.label, categorySection: categorySection, max: categoryView.max, min: categoryView.min, selectedMax: categoryView.selectedMax, selectedMin: categoryView.selectedMin, onCloseFilter: onCloseFilter, onFilter: onFilter, surfaceType: surfaceType, unit: categoryView.unit })) : (React.createElement(FilterMenu, { categoryKey: categoryView.key, categoryLabel: categoryView.label, categorySection: categorySection, onCloseFilter: onCloseFilter, onFilter: onFilter, surfaceType: surfaceType, values: categoryView.values }))),
|
|
64
66
|
tags));
|
|
65
67
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { FilterProps } from "./filter";
|
|
2
|
+
export declare const StyledPopover: import("@emotion/styled").StyledComponent<import("@mui/material").PopoverProps & {
|
|
2
3
|
theme?: import("@emotion/react").Theme;
|
|
3
|
-
}, {}, {}>;
|
|
4
|
-
export declare const IconButton: import("@emotion/styled").StyledComponent<import("../../../common/IconButton/iconButton").IconButtonProps & {
|
|
5
|
-
theme?: import("@emotion/react").Theme;
|
|
6
|
-
}, {}, {}>;
|
|
4
|
+
} & Pick<FilterProps, "surfaceType">, {}, {}>;
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
1
2
|
import styled from "@emotion/styled";
|
|
2
3
|
import { Popover } from "@mui/material";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
5
|
+
import { SURFACE_TYPE } from "../surfaces/types";
|
|
6
|
+
export const StyledPopover = styled(Popover, {
|
|
7
|
+
shouldForwardProp: (prop) => prop !== "surfaceType",
|
|
8
|
+
}) `
|
|
7
9
|
.MuiPaper-menu {
|
|
8
10
|
margin: 4px 0;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
${
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const IconButton = styled(DXIconButton) `
|
|
22
|
-
color: ${white};
|
|
23
|
-
left: calc(100% + 4px);
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 4px;
|
|
13
|
+
${({ surfaceType }) => surfaceType === SURFACE_TYPE.DRAWER &&
|
|
14
|
+
css `
|
|
15
|
+
.MuiPaper-root {
|
|
16
|
+
background-color: ${PALETTE.SMOKE_LIGHT};
|
|
17
|
+
height: 100%;
|
|
18
|
+
margin: 0;
|
|
19
|
+
max-height: 100%;
|
|
20
|
+
overflow: visible; // required; allows backdrop button to render outside of drawer container.
|
|
21
|
+
}
|
|
22
|
+
`}
|
|
26
23
|
`;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { fn } from "@storybook/test";
|
|
2
2
|
import { DONOR_COUNT, GENUS_SPECIES } from "../../Filters/stories/constants";
|
|
3
|
+
import { SURFACE_TYPE } from "../../surfaces/types";
|
|
3
4
|
export const SELECT_ARGS = {
|
|
4
5
|
categoryView: GENUS_SPECIES,
|
|
5
|
-
isFilterDrawer: false,
|
|
6
6
|
onFilter: fn(),
|
|
7
|
+
surfaceType: SURFACE_TYPE.MENU,
|
|
7
8
|
};
|
|
8
9
|
export const DISABLED_SELECT_ARGS = {
|
|
9
10
|
...SELECT_ARGS,
|
|
@@ -14,6 +15,6 @@ export const DISABLED_SELECT_ARGS = {
|
|
|
14
15
|
};
|
|
15
16
|
export const RANGE_ARGS = {
|
|
16
17
|
categoryView: DONOR_COUNT,
|
|
17
|
-
isFilterDrawer: false,
|
|
18
18
|
onFilter: fn(),
|
|
19
|
+
surfaceType: SURFACE_TYPE.MENU,
|
|
19
20
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MouseEvent } from "react";
|
|
2
2
|
import { DataDictionaryAnnotation } from "../../../../common/entities";
|
|
3
|
+
import { SURFACE_TYPE } from "../surfaces/types";
|
|
3
4
|
export interface FilterLabelProps {
|
|
4
5
|
annotation?: DataDictionaryAnnotation;
|
|
5
6
|
count?: number;
|
|
@@ -7,5 +8,6 @@ export interface FilterLabelProps {
|
|
|
7
8
|
isOpen: boolean;
|
|
8
9
|
label: string;
|
|
9
10
|
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
surfaceType: SURFACE_TYPE;
|
|
10
12
|
}
|
|
11
|
-
export declare const FilterLabel: ({ annotation, count, disabled, isOpen, label, onClick, }: FilterLabelProps) => JSX.Element;
|
|
13
|
+
export declare const FilterLabel: ({ annotation, count, disabled, isOpen, label, onClick, surfaceType, }: FilterLabelProps) => JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ArrowDropDownRounded } from "@mui/icons-material";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Tooltip } from "../../../DataDictionary/components/Tooltip/tooltip";
|
|
4
|
-
import {
|
|
5
|
-
export const FilterLabel = ({ annotation, count, disabled = false, isOpen, label, onClick, }) => {
|
|
4
|
+
import { StyledButton } from "./filterLabel.styles";
|
|
5
|
+
export const FilterLabel = ({ annotation, count, disabled = false, isOpen, label, onClick, surfaceType, }) => {
|
|
6
6
|
const filterLabel = count ? `${label}\xa0(${count})` : label; // When the count is present, a non-breaking space is used to prevent it from being on its own line
|
|
7
7
|
return (React.createElement(Tooltip, { description: annotation?.description, title: annotation?.label },
|
|
8
|
-
React.createElement(
|
|
8
|
+
React.createElement(StyledButton, { color: "inherit", disabled: disabled, endIcon: React.createElement(ArrowDropDownRounded, { fontSize: "small" }), fullWidth: true, isOpen: isOpen, onClick: onClick, surfaceType: surfaceType }, filterLabel)));
|
|
9
9
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { SURFACE_TYPE } from "../surfaces/types";
|
|
3
4
|
declare const meta: {
|
|
4
5
|
argTypes: {
|
|
5
6
|
count: {
|
|
@@ -15,7 +16,7 @@ declare const meta: {
|
|
|
15
16
|
control: "text";
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
|
-
component: ({ annotation, count, disabled, isOpen, label, onClick, }: import("./filterLabel").FilterLabelProps) => JSX.Element;
|
|
19
|
+
component: ({ annotation, count, disabled, isOpen, label, onClick, surfaceType, }: import("./filterLabel").FilterLabelProps) => JSX.Element;
|
|
19
20
|
decorators: ((Story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
20
21
|
annotation?: import("../../../../common/entities").DataDictionaryAnnotation | undefined;
|
|
21
22
|
count?: number | undefined;
|
|
@@ -23,6 +24,7 @@ declare const meta: {
|
|
|
23
24
|
isOpen: boolean;
|
|
24
25
|
label: string;
|
|
25
26
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
27
|
+
surfaceType: SURFACE_TYPE;
|
|
26
28
|
}>) => JSX.Element)[];
|
|
27
29
|
title: string;
|
|
28
30
|
};
|