@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/lib/components/Filter/components/views/select/components/ListItemText/listItemText.styles.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { ListItemText } from "@mui/material";
|
|
3
|
+
export const StyledListItemText = styled(ListItemText) `
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: grid;
|
|
6
|
+
gap: 8px;
|
|
7
|
+
grid-template-columns: 1fr auto;
|
|
8
|
+
|
|
9
|
+
> span {
|
|
10
|
+
min-width: 0; /* required; flexbox child min-width property is "auto" by default making overflow-wrap ineffectual */
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { Fragment } from "react";
|
|
1
|
+
import { Grid, Typography } from "@mui/material";
|
|
2
|
+
import React, { Fragment, useCallback } from "react";
|
|
3
3
|
import { SVG_ICON_PROPS } from "../../../../../styles/common/mui/svgIcon";
|
|
4
4
|
import { TYPOGRAPHY_PROPS } from "../../../../../styles/common/mui/typography";
|
|
5
|
-
import { CheckedIcon } from "../../../../common/CustomIcon/components/CheckedIcon/checkedIcon";
|
|
6
|
-
import { UncheckedIcon } from "../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon";
|
|
7
5
|
import { DropDownIcon } from "../../../../common/Form/components/Select/components/DropDownIcon/dropDownIcon";
|
|
8
6
|
import { useMenu } from "../../../../common/Menu/hooks/useMenu";
|
|
9
7
|
import { FilterCountChip } from "../../../../Filter/components/FilterCountChip/filterCountChip";
|
|
8
|
+
import { ListItemButton } from "../../../../Filter/components/views/select/components/ListItemButton/listItemButton";
|
|
9
|
+
import { SelectListItem } from "../../../../Filter/components/views/select/SelectListItem/selectListItem";
|
|
10
10
|
import { getColumnHeader } from "../../../common/utils";
|
|
11
11
|
import { getSortedFacetedValues } from "../../../featureOptions/facetedColumn/utils";
|
|
12
12
|
import { StyledButton, StyledMenu } from "./columnFilter.styles";
|
|
@@ -18,18 +18,33 @@ import { updater } from "./utils";
|
|
|
18
18
|
*/
|
|
19
19
|
export const ColumnFilter = ({ Button = StyledButton, className, column, ...props /* MuiMenuProps */ }) => {
|
|
20
20
|
const { anchorEl, onClose, onOpen, open } = useMenu();
|
|
21
|
+
// Grab the unique values for the column.
|
|
21
22
|
const facetedUniqueValues = column.getFacetedUniqueValues();
|
|
23
|
+
// Sort the values.
|
|
22
24
|
const sortedValues = getSortedFacetedValues(facetedUniqueValues);
|
|
25
|
+
// Get the filter values.
|
|
23
26
|
const filterValue = (column.getFilterValue() || []);
|
|
27
|
+
const onFilter = useCallback((value) => {
|
|
28
|
+
column.setFilterValue(updater(value));
|
|
29
|
+
}, [column]);
|
|
24
30
|
return (React.createElement(Fragment, null,
|
|
25
|
-
React.createElement(Button, {
|
|
31
|
+
React.createElement(Button, { disabled: sortedValues.length === 0, endIcon: React.createElement(DropDownIcon, { color: SVG_ICON_PROPS.COLOR.INK_LIGHT }), onClick: onOpen, open: open },
|
|
26
32
|
React.createElement(Grid, { ...GRID_PROPS },
|
|
27
33
|
getColumnHeader(column),
|
|
28
34
|
React.createElement(FilterCountChip, { count: filterValue.length }))),
|
|
29
35
|
React.createElement(StyledMenu, { ...MENU_PROPS, ...props, className: className, anchorEl: anchorEl, onClose: onClose, open: open },
|
|
30
|
-
sortedValues.map(([value, occurrence]) =>
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
sortedValues.map(([value, occurrence]) => {
|
|
37
|
+
const checked = filterValue.includes(value);
|
|
38
|
+
const onClick = () => onFilter(value);
|
|
39
|
+
const primary = String(value);
|
|
40
|
+
const secondary = String(occurrence);
|
|
41
|
+
const selected = checked;
|
|
42
|
+
return (React.createElement(SelectListItem, { key: primary, slotProps: {
|
|
43
|
+
checkbox: { checked },
|
|
44
|
+
listItemButton: { onClick, selected },
|
|
45
|
+
listItemText: { primary, secondary },
|
|
46
|
+
} }));
|
|
47
|
+
}),
|
|
33
48
|
React.createElement(ListItemButton, { disabled: !column.getIsFiltered(), onClick: () => column.setFilterValue(undefined) },
|
|
34
49
|
React.createElement(Typography, { color: column.getIsFiltered()
|
|
35
50
|
? TYPOGRAPHY_PROPS.COLOR.PRIMARY
|
|
@@ -9,8 +9,13 @@ export const MENU_PROPS = {
|
|
|
9
9
|
horizontal: "right",
|
|
10
10
|
vertical: "bottom",
|
|
11
11
|
},
|
|
12
|
+
/* Prevents the browser from auto‑focusing the menu on open, which can trigger a scrollIntoView jump when the viewport has `scroll-padding-top` (e.g., on <html>). */
|
|
13
|
+
disableAutoFocus: true,
|
|
14
|
+
/* Skips restoring focus to the trigger on close to avoid a similar scroll adjustment with `scroll-padding-top`. */
|
|
15
|
+
disableRestoreFocus: true,
|
|
12
16
|
marginThreshold: 8,
|
|
13
17
|
slotProps: {
|
|
18
|
+
list: { component: "div" },
|
|
14
19
|
paper: { variant: "menu" },
|
|
15
20
|
},
|
|
16
21
|
transformOrigin: {
|
|
@@ -14,6 +14,10 @@ export const BUTTON_PROPS = {
|
|
|
14
14
|
size: MUI_BUTTON_PROPS.SIZE.MEDIUM,
|
|
15
15
|
variant: MUI_BUTTON_PROPS.VARIANT.CONTAINED,
|
|
16
16
|
},
|
|
17
|
+
PRIMARY_TEXT: {
|
|
18
|
+
color: MUI_BUTTON_PROPS.COLOR.PRIMARY,
|
|
19
|
+
variant: MUI_BUTTON_PROPS.VARIANT.TEXT,
|
|
20
|
+
},
|
|
17
21
|
SECONDARY_CONTAINED: {
|
|
18
22
|
color: MUI_BUTTON_PROPS.COLOR.SECONDARY,
|
|
19
23
|
variant: MUI_BUTTON_PROPS.VARIANT.CONTAINED,
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function DrawerProvider({ children
|
|
3
|
-
children: ReactNode | ReactNode[];
|
|
4
|
-
}): JSX.Element;
|
|
1
|
+
import { DrawerProviderProps } from "./types";
|
|
2
|
+
export declare function DrawerProvider({ children }: DrawerProviderProps): JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useState } from "react";
|
|
2
2
|
import { DrawerContext } from "./context";
|
|
3
|
-
export function DrawerProvider({ children
|
|
3
|
+
export function DrawerProvider({ children }) {
|
|
4
4
|
const [open, setOpen] = useState(false);
|
|
5
5
|
const onClose = useCallback(() => setOpen(false), []);
|
|
6
6
|
const onOpen = useCallback(() => setOpen(true), []);
|
|
7
|
-
return (React.createElement(DrawerContext.Provider, { value: { onClose, onOpen, open } }, children
|
|
7
|
+
return (React.createElement(DrawerContext.Provider, { value: { onClose, onOpen, open } }, typeof children === "function"
|
|
8
|
+
? children({ onClose, onOpen, open })
|
|
9
|
+
: children));
|
|
8
10
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DrawerProps } from "@mui/material";
|
|
2
|
-
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export type DrawerContextProps = Omit<DrawerProps, "onClose"> & {
|
|
3
4
|
onClose: () => void;
|
|
4
5
|
onOpen: () => void;
|
|
5
6
|
open: boolean;
|
|
6
7
|
};
|
|
8
|
+
export type DrawerProviderProps = {
|
|
9
|
+
children: ReactNode | ((props: DrawerContextProps) => ReactNode);
|
|
10
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CategoryConfig } from "../common/categories/config/types";
|
|
2
2
|
import { Category } from "../common/categories/models/types";
|
|
3
3
|
import { CategoryView, VIEW_KIND } from "../common/categories/views/types";
|
|
4
|
-
import { CategoryKey, CategoryValueKey, Filters, SelectCategoryValue } from "../common/entities";
|
|
4
|
+
import { CategoryKey, CategoryValueKey, ClearAll, Filters, SelectCategoryValue } from "../common/entities";
|
|
5
5
|
/**
|
|
6
6
|
* State backing filter functionality and calculations. Converted to view model for display.
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export type FilterState = Filters;
|
|
|
9
9
|
/**
|
|
10
10
|
* Function invoked when selected state of a category value is toggled or range is selected.
|
|
11
11
|
*/
|
|
12
|
-
export type OnFilterFn = (categoryKey: CategoryKey, selectedCategoryValue: CategoryValueKey, selected: boolean, categorySection?: string, viewKind?: VIEW_KIND, searchTerm?: string) => void;
|
|
12
|
+
export type OnFilterFn = (categoryKey: CategoryKey | ClearAll, selectedCategoryValue: CategoryValueKey, selected: boolean, categorySection?: string, viewKind?: VIEW_KIND, searchTerm?: string) => void;
|
|
13
13
|
/**
|
|
14
14
|
* Build view-specific models from filter state, to facilitate easy rendering.
|
|
15
15
|
* @param categories - Categories, category value and their counts with the current filter applied.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ThemeProps } from "../../../theme/theme";
|
|
2
|
+
export declare const bpDown820: ({ theme }: ThemeProps) => string;
|
|
3
|
+
export declare const bpDown1024: ({ theme }: ThemeProps) => string;
|
|
2
4
|
export declare const mediaDesktopSmallDown: ({ theme }: ThemeProps) => string;
|
|
3
5
|
export declare const mediaDesktopSmallUp: ({ theme }: ThemeProps) => string;
|
|
4
6
|
export declare const mediaDesktopUp: ({ theme }: ThemeProps) => string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DESKTOP, DESKTOP_SM, TABLET } from "../../../theme/common/breakpoints";
|
|
2
|
+
export const bpDown820 = ({ theme }) => theme.breakpoints.down(820);
|
|
3
|
+
export const bpDown1024 = ({ theme }) => theme.breakpoints.down(1024);
|
|
2
4
|
export const mediaDesktopSmallDown = ({ theme }) => theme.breakpoints.down(DESKTOP_SM);
|
|
3
5
|
export const mediaDesktopSmallUp = ({ theme }) => theme.breakpoints.up(DESKTOP_SM);
|
|
4
6
|
export const mediaDesktopUp = ({ theme }) => theme.breakpoints.up(DESKTOP);
|
|
@@ -10,11 +10,13 @@ const VARIANT = {
|
|
|
10
10
|
TEXT_BODY_400: "text-body-400",
|
|
11
11
|
TEXT_BODY_400_2_LINES: "text-body-400-2lines",
|
|
12
12
|
TEXT_BODY_500: "text-body-500",
|
|
13
|
+
TEXT_BODY_LARGE_500: "text-body-large-500",
|
|
13
14
|
TEXT_BODY_SMALL_400: "text-body-small-400",
|
|
14
15
|
TEXT_BODY_SMALL_500: "text-body-small-500",
|
|
15
16
|
TEXT_HEADING_LARGE: "text-heading-large",
|
|
16
17
|
TEXT_HEADING_SMALL: "text-heading-small",
|
|
17
18
|
TEXT_HEADING_XSMALL: "text-heading-xsmall",
|
|
19
|
+
TEXT_UPPERCASE_500: "text-uppercase-500",
|
|
18
20
|
};
|
|
19
21
|
export const TYPOGRAPHY_PROPS = {
|
|
20
22
|
COLOR,
|
|
@@ -5,11 +5,13 @@ import { DrawerProvider } from "../../components/common/Drawer/provider/provider
|
|
|
5
5
|
import { ClearAllFilters } from "../../components/Filter/components/ClearAllFilters/clearAllFilters";
|
|
6
6
|
import { Filters, } from "../../components/Filter/components/Filters/filters";
|
|
7
7
|
import { SearchAllFilters } from "../../components/Filter/components/SearchAllFilters/searchAllFilters";
|
|
8
|
+
import { SURFACE_TYPE } from "../../components/Filter/components/surfaces/types";
|
|
8
9
|
import { Index as IndexView } from "../../components/Index/index";
|
|
9
10
|
import { SidebarLabel } from "../../components/Layout/components/Sidebar/components/SidebarLabel/sidebarLabel";
|
|
10
11
|
import { SidebarTools } from "../../components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles";
|
|
11
12
|
import { Sidebar } from "../../components/Layout/components/Sidebar/sidebar";
|
|
12
13
|
import { useStateSyncManager } from "../../hooks/stateSyncManager/hook";
|
|
14
|
+
import { useBreakpoint } from "../../hooks/useBreakpoint";
|
|
13
15
|
import { useConfig } from "../../hooks/useConfig";
|
|
14
16
|
import { useEntityList } from "../../hooks/useEntityList";
|
|
15
17
|
import { useExploreState } from "../../hooks/useExploreState";
|
|
@@ -21,6 +23,7 @@ import { SELECT_CATEGORY_KEY } from "../../providers/exploreState/constants";
|
|
|
21
23
|
import { TEST_IDS } from "../../tests/testIds";
|
|
22
24
|
import { buildStateSyncManagerContext } from "./utils";
|
|
23
25
|
export const ExploreView = (props) => {
|
|
26
|
+
const { mdDown } = useBreakpoint();
|
|
24
27
|
const { config, entityConfig } = useConfig(); // Get app level config.
|
|
25
28
|
const { exploreDispatch, exploreState } = useExploreState(); // Get the useReducer state and dispatch for "Explore".
|
|
26
29
|
const { trackingConfig } = config;
|
|
@@ -97,7 +100,7 @@ export const ExploreView = (props) => {
|
|
|
97
100
|
React.createElement(SidebarLabel, { label: "Filters" }),
|
|
98
101
|
React.createElement(ClearAllFilters, null),
|
|
99
102
|
React.createElement(SearchAllFilters, { categoryViews: categoryViews, onFilter: onFilterChange.bind(null, true) })),
|
|
100
|
-
React.createElement(Filters, { categoryFilters: categoryFilters, onFilter: onFilterChange.bind(null, false), trackFilterOpened: trackingConfig?.trackFilterOpened }))),
|
|
103
|
+
React.createElement(Filters, { categoryFilters: categoryFilters, onFilter: onFilterChange.bind(null, false), surfaceType: mdDown ? SURFACE_TYPE.DRAWER : SURFACE_TYPE.MENU, trackFilterOpened: trackingConfig?.trackFilterOpened }))),
|
|
101
104
|
React.createElement(IndexView, { className: props.className, categoryFilters: categoryFilters, entityListType: entityListType, entityName: label, loading: loading })));
|
|
102
105
|
};
|
|
103
106
|
/**
|
package/package.json
CHANGED
package/src/common/entities.ts
CHANGED
|
@@ -23,6 +23,16 @@ export interface Attribute {
|
|
|
23
23
|
*/
|
|
24
24
|
export type CategoryKey = string;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Clear all filters key.
|
|
28
|
+
*/
|
|
29
|
+
export const CLEAR_ALL = "CLEAR_ALL" as const;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Clear all filters type.
|
|
33
|
+
*/
|
|
34
|
+
export type ClearAll = typeof CLEAR_ALL;
|
|
35
|
+
|
|
26
36
|
/**
|
|
27
37
|
* View model of category tag.
|
|
28
38
|
*/
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
mediaTabletUp,
|
|
6
6
|
} from "../../../../styles/common/mixins/breakpoints";
|
|
7
7
|
import { textHeadingSmall } from "../../../../styles/common/mixins/fonts";
|
|
8
|
-
import {
|
|
8
|
+
import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
|
|
9
9
|
import { MarkdownRenderer } from "../../../MarkdownRenderer/markdownRenderer";
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const StyledFluidPaper = styled(FluidPaper)`
|
|
12
12
|
padding: 20px;
|
|
13
13
|
|
|
14
14
|
${mediaTabletDown} {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
StyledMarkdownRenderer,
|
|
4
|
-
StyledRoundedPaper,
|
|
5
|
-
} from "./description.styles";
|
|
2
|
+
import { StyledFluidPaper, StyledMarkdownRenderer } from "./description.styles";
|
|
6
3
|
import { DescriptionProps } from "./types";
|
|
7
4
|
|
|
8
5
|
export const Description = ({
|
|
@@ -10,8 +7,8 @@ export const Description = ({
|
|
|
10
7
|
}: DescriptionProps): JSX.Element | null => {
|
|
11
8
|
if (!description) return null;
|
|
12
9
|
return (
|
|
13
|
-
<
|
|
10
|
+
<StyledFluidPaper elevation={0}>
|
|
14
11
|
<StyledMarkdownRenderer value={description} />
|
|
15
|
-
</
|
|
12
|
+
</StyledFluidPaper>
|
|
16
13
|
);
|
|
17
14
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Typography } from "@mui/material";
|
|
3
|
+
import { mediaTabletDown } from "../../../../styles/common/mixins/breakpoints";
|
|
3
4
|
|
|
4
5
|
export const StyledTypography = styled(Typography)`
|
|
5
6
|
&:hover a {
|
|
6
7
|
opacity: 1;
|
|
7
8
|
}
|
|
9
|
+
|
|
10
|
+
${mediaTabletDown} {
|
|
11
|
+
margin: 0 16px;
|
|
12
|
+
}
|
|
8
13
|
` as typeof Typography;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from "@mui/material";
|
|
1
|
+
import { Button, Theme, useMediaQuery } from "@mui/material";
|
|
2
2
|
import { RowData } from "@tanstack/react-table";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Attribute } from "../../../../../../common/entities";
|
|
@@ -14,9 +14,12 @@ export const ColumnFilterTags = <T extends RowData = Attribute>({
|
|
|
14
14
|
}: ColumnFilterTagsProps<T>): JSX.Element | null => {
|
|
15
15
|
const { getAllColumns, resetColumnFilters } = table;
|
|
16
16
|
const columns = getAllColumns().filter((column) => column.getIsFiltered());
|
|
17
|
+
const isDrawer = useMediaQuery((theme: Theme) => theme.breakpoints.down(820));
|
|
17
18
|
|
|
18
19
|
if (columns.length === 0) return null;
|
|
19
20
|
|
|
21
|
+
if (isDrawer) return null;
|
|
22
|
+
|
|
20
23
|
return (
|
|
21
24
|
<StyledGrid className={className} {...GRID_PROPS}>
|
|
22
25
|
{columns.map((column) => (
|
package/src/components/DataDictionary/components/Filters/components/ColumnFilters/columnFilters.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ButtonGroup } from "@mui/material";
|
|
1
|
+
import { ButtonGroup, Theme, useMediaQuery } from "@mui/material";
|
|
2
2
|
import { RowData } from "@tanstack/react-table";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Attribute } from "../../../../../../common/entities";
|
|
5
5
|
import { BUTTON_GROUP_PROPS } from "../../../../../common/ButtonGroup/constants";
|
|
6
|
+
import { ColumnFiltersAdapter } from "../../../../../Filter/components/adapters/tanstack/ColumnFiltersAdapter/columnFiltersAdapter";
|
|
7
|
+
import { Drawer } from "../../../../../Filter/components/surfaces/drawer/Drawer/drawer";
|
|
6
8
|
import { ColumnFilter } from "../../../../../Table/components/TableFeatures/ColumnFilter/columnFilter";
|
|
7
9
|
import { ColumnFiltersProps } from "./types";
|
|
8
10
|
|
|
@@ -12,9 +14,18 @@ export const ColumnFilters = <T extends RowData = Attribute>({
|
|
|
12
14
|
const columns = table.getAllColumns();
|
|
13
15
|
const columnFilters = columns.filter((column) => column.getCanFilter());
|
|
14
16
|
const enableColumnFilters = table.options.enableColumnFilters;
|
|
17
|
+
const isDrawer = useMediaQuery((theme: Theme) => theme.breakpoints.down(820));
|
|
15
18
|
|
|
16
19
|
if (!enableColumnFilters) return null;
|
|
17
20
|
|
|
21
|
+
if (isDrawer)
|
|
22
|
+
return (
|
|
23
|
+
<ColumnFiltersAdapter
|
|
24
|
+
table={table}
|
|
25
|
+
renderSurface={(props) => <Drawer {...props} />}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
|
|
18
29
|
return (
|
|
19
30
|
<ButtonGroup {...BUTTON_GROUP_PROPS.SECONDARY_OUTLINED}>
|
|
20
31
|
{columnFilters.map((column) => (
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Grid } from "@mui/material";
|
|
3
|
-
import { mediaTabletDown } from "../../../../styles/common/mixins/breakpoints";
|
|
4
3
|
|
|
5
4
|
export const StyledGrid = styled(Grid)`
|
|
6
5
|
align-items: center;
|
|
7
6
|
display: grid;
|
|
8
7
|
gap: 16px;
|
|
9
8
|
grid-template-columns: 1fr auto;
|
|
10
|
-
|
|
11
|
-
${mediaTabletDown} {
|
|
12
|
-
grid-template-columns: 1fr;
|
|
13
|
-
}
|
|
14
9
|
`;
|
|
@@ -4,9 +4,10 @@ import { Meta, StoryObj } from "@storybook/react";
|
|
|
4
4
|
import { functionalUpdate, Table } from "@tanstack/react-table";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { Filters } from "../filters";
|
|
7
|
-
import {
|
|
7
|
+
import { COLUMNS } from "./constants";
|
|
8
8
|
import { useFilterStore, useGlobalFilterStore } from "./hook";
|
|
9
9
|
import { PartialColumn } from "./types";
|
|
10
|
+
import { buildColumnFilters } from "./utils";
|
|
10
11
|
|
|
11
12
|
const meta: Meta<typeof Filters> = {
|
|
12
13
|
component: Filters,
|
|
@@ -27,6 +28,9 @@ const DefaultStory = (): JSX.Element => {
|
|
|
27
28
|
const { filterStore, setFilterStore } = useFilterStore();
|
|
28
29
|
const { globalFilter, setGlobalFilter } = useGlobalFilterStore();
|
|
29
30
|
|
|
31
|
+
// Builds column filters from filter store.
|
|
32
|
+
const columnFilters = buildColumnFilters(filterStore);
|
|
33
|
+
|
|
30
34
|
const makeColumn = (column: PartialColumn): PartialColumn => ({
|
|
31
35
|
...column,
|
|
32
36
|
getFilterValue: () => filterStore[column.id],
|
|
@@ -39,10 +43,13 @@ const DefaultStory = (): JSX.Element => {
|
|
|
39
43
|
},
|
|
40
44
|
});
|
|
41
45
|
|
|
46
|
+
// Make the columns.
|
|
47
|
+
const columns = COLUMNS.map(makeColumn);
|
|
48
|
+
|
|
42
49
|
const table = {
|
|
43
|
-
getAllColumns: () =>
|
|
44
|
-
|
|
45
|
-
getState: () => ({ globalFilter }),
|
|
50
|
+
getAllColumns: () => columns,
|
|
51
|
+
getColumn: (columnId: string) => columns.find(({ id }) => id === columnId)!,
|
|
52
|
+
getState: () => ({ columnFilters, globalFilter }),
|
|
46
53
|
options: { enableColumnFilters: true, enableGlobalFilter: true },
|
|
47
54
|
setGlobalFilter,
|
|
48
55
|
} as Table<unknown>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ColumnFiltersState } from "@tanstack/react-table";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Builds column filters from filter store.
|
|
5
|
+
* @param filterStore - The filter store.
|
|
6
|
+
* @returns The column filters.
|
|
7
|
+
*/
|
|
8
|
+
export function buildColumnFilters(
|
|
9
|
+
filterStore: Record<string, unknown>
|
|
10
|
+
): ColumnFiltersState {
|
|
11
|
+
return Object.entries(filterStore).reduce((acc, [id, value]) => {
|
|
12
|
+
if (!value) return acc;
|
|
13
|
+
return [...acc, { id, value }];
|
|
14
|
+
}, [] as ColumnFiltersState);
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { LayoutSpacing } from "../../../../../../hooks/UseLayoutSpacing/types";
|
|
3
|
-
import {
|
|
3
|
+
import { bpDown1024 } from "../../../../../../styles/common/mixins/breakpoints";
|
|
4
4
|
import { LAYOUT_SPACING } from "../../constants";
|
|
5
5
|
|
|
6
6
|
const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
@@ -15,7 +15,7 @@ export const Layout = styled("div")<LayoutSpacing>`
|
|
|
15
15
|
padding-top: ${({ top }) => top}px;
|
|
16
16
|
z-index: 1; /* not required, but helpful in that the entities are always on top */
|
|
17
17
|
|
|
18
|
-
${
|
|
18
|
+
${bpDown1024} {
|
|
19
19
|
grid-column: 1;
|
|
20
20
|
grid-row: auto;
|
|
21
21
|
padding-top: ${PT}px;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { LayoutSpacing } from "../../../../../../hooks/UseLayoutSpacing/types";
|
|
3
3
|
import { PALETTE } from "../../../../../../styles/common/constants/palette";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
bpDown1024,
|
|
6
|
+
mediaTabletDown,
|
|
7
|
+
} from "../../../../../../styles/common/mixins/breakpoints";
|
|
5
8
|
import { LAYOUT_SPACING } from "../../constants";
|
|
6
9
|
|
|
7
10
|
const PB = LAYOUT_SPACING.FILTERS_PADDING_BOTTOM; /* bottom padding */
|
|
@@ -21,10 +24,14 @@ export const Layout = styled("div")<LayoutSpacing>`
|
|
|
21
24
|
top: 0;
|
|
22
25
|
z-index: 2; /* required, filters should be on top of entities */
|
|
23
26
|
|
|
24
|
-
${
|
|
27
|
+
${bpDown1024} {
|
|
25
28
|
grid-column: 1;
|
|
26
29
|
grid-row: auto;
|
|
27
30
|
padding-top: ${PT}px;
|
|
28
31
|
position: relative;
|
|
29
32
|
}
|
|
33
|
+
|
|
34
|
+
${mediaTabletDown} {
|
|
35
|
+
margin: 0 16px;
|
|
36
|
+
}
|
|
30
37
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { LayoutSpacing } from "../../../../../../hooks/UseLayoutSpacing/types";
|
|
3
|
-
import {
|
|
3
|
+
import { bpDown1024 } from "../../../../../../styles/common/mixins/breakpoints";
|
|
4
4
|
import { LAYOUT_SPACING } from "../../constants";
|
|
5
5
|
|
|
6
6
|
const PB = LAYOUT_SPACING.CONTENT_PADDING_BOTTOM; /* bottom padding */
|
|
@@ -19,7 +19,7 @@ export const Layout = styled("div")<LayoutSpacing>`
|
|
|
19
19
|
position: sticky;
|
|
20
20
|
top: 0;
|
|
21
21
|
|
|
22
|
-
${
|
|
22
|
+
${bpDown1024} {
|
|
23
23
|
display: none;
|
|
24
24
|
}
|
|
25
25
|
`;
|
package/src/components/DataDictionary/components/Layout/components/TitleLayout/titleLayout.styles.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { LayoutSpacing } from "../../../../../../hooks/UseLayoutSpacing/types";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
bpDown1024,
|
|
5
|
+
mediaTabletDown,
|
|
6
|
+
} from "../../../../../../styles/common/mixins/breakpoints";
|
|
4
7
|
|
|
5
8
|
export const Layout = styled("div")<LayoutSpacing>`
|
|
6
9
|
grid-column: 1 / -1;
|
|
@@ -11,9 +14,13 @@ export const Layout = styled("div")<LayoutSpacing>`
|
|
|
11
14
|
top: 0;
|
|
12
15
|
z-index: 4;
|
|
13
16
|
|
|
14
|
-
${
|
|
17
|
+
${bpDown1024} {
|
|
15
18
|
grid-column: 1;
|
|
16
19
|
grid-row: auto;
|
|
17
20
|
position: relative;
|
|
18
21
|
}
|
|
22
|
+
|
|
23
|
+
${mediaTabletDown} {
|
|
24
|
+
margin: 0 16px;
|
|
25
|
+
}
|
|
19
26
|
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { PALETTE } from "../../../../styles/common/constants/palette";
|
|
3
|
-
import {
|
|
3
|
+
import { FluidPaper } from "../../../common/Paper/components/FluidPaper/fluidPaper";
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const StyledFluidPaper = styled(FluidPaper)`
|
|
6
6
|
background-color: ${PALETTE.SMOKE_MAIN};
|
|
7
7
|
display: grid;
|
|
8
8
|
gap: 1px;
|
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
import { TableContainer } from "@mui/material";
|
|
2
2
|
import { RowData } from "@tanstack/react-table";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { useBreakpoint } from "../../../../hooks/useBreakpoint";
|
|
4
5
|
import { TableBody } from "../../../Detail/components/Table/components/TableBody/tableBody";
|
|
5
6
|
import { ROW_DIRECTION } from "../../../Table/common/entities";
|
|
6
7
|
import { TableHead } from "../../../Table/components/TableHead/tableHead";
|
|
7
8
|
import { GridTable } from "../../../Table/table.styles";
|
|
8
9
|
import { getColumnTrackSizing } from "../../../TableCreator/options/columnTrackSizing/utils";
|
|
9
|
-
import {
|
|
10
|
+
import { StyledFluidPaper } from "./table.styles";
|
|
10
11
|
import { TableProps } from "./types";
|
|
11
12
|
|
|
12
13
|
export const Table = <T extends RowData>({
|
|
13
14
|
row,
|
|
14
15
|
table,
|
|
15
16
|
}: TableProps<T>): JSX.Element => {
|
|
17
|
+
const { smDown } = useBreakpoint();
|
|
18
|
+
const rowDirection = smDown ? ROW_DIRECTION.VERTICAL : ROW_DIRECTION.DEFAULT;
|
|
16
19
|
return (
|
|
17
|
-
<
|
|
20
|
+
<StyledFluidPaper elevation={0}>
|
|
18
21
|
<TableContainer>
|
|
19
22
|
<GridTable
|
|
23
|
+
collapsable
|
|
20
24
|
gridTemplateColumns={getColumnTrackSizing(
|
|
21
25
|
table.getVisibleFlatColumns()
|
|
22
26
|
)}
|
|
23
27
|
>
|
|
24
28
|
<TableHead tableInstance={table} />
|
|
25
29
|
<TableBody
|
|
26
|
-
rowDirection={
|
|
30
|
+
rowDirection={rowDirection}
|
|
27
31
|
rows={row.getLeafRows()}
|
|
28
32
|
tableInstance={table}
|
|
29
33
|
/>
|
|
30
34
|
</GridTable>
|
|
31
35
|
</TableContainer>
|
|
32
|
-
</
|
|
36
|
+
</StyledFluidPaper>
|
|
33
37
|
);
|
|
34
38
|
};
|
|
@@ -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
|
|
|
5
5
|
export const StyledTitle = styled(Title)`
|
|
@@ -10,7 +10,7 @@ export const StyledTitle = styled(Title)`
|
|
|
10
10
|
line-height: 42px;
|
|
11
11
|
margin: 24px 0 8px;
|
|
12
12
|
|
|
13
|
-
${
|
|
13
|
+
${bpDown820} {
|
|
14
14
|
font-size: 26px;
|
|
15
15
|
line-height: 34px;
|
|
16
16
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { css } from "@emotion/react";
|
|
2
1
|
import styled from "@emotion/styled";
|
|
3
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
bpDown1024,
|
|
4
|
+
mediaTabletDown,
|
|
5
|
+
} from "../../styles/common/mixins/breakpoints";
|
|
4
6
|
|
|
5
|
-
export const
|
|
7
|
+
export const View = styled("div")`
|
|
6
8
|
column-gap: 24px;
|
|
7
9
|
display: grid;
|
|
8
|
-
grid-template-columns: 242px 1fr;
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export const View = styled("div")`
|
|
12
|
-
${grid};
|
|
13
10
|
flex: 1;
|
|
11
|
+
grid-template-columns: 242px 1fr;
|
|
14
12
|
margin: 0 24px;
|
|
15
13
|
position: relative;
|
|
16
14
|
|
|
17
|
-
${
|
|
15
|
+
${bpDown1024} {
|
|
18
16
|
grid-template-columns: 1fr;
|
|
19
17
|
margin: 0 16px;
|
|
20
18
|
}
|
|
19
|
+
|
|
20
|
+
${mediaTabletDown} {
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
21
23
|
`;
|