@databiosphere/findable-ui 2.1.0 → 3.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/lib/components/Detail/components/DetailViewTable/detailViewTable.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Filter/components/Filters/filters.d.ts +1 -1
- package/lib/components/Filter/components/Filters/filters.styles.js +1 -1
- package/lib/components/Filter/components/VariableSizeListItem/variableSizeListItem.js +2 -1
- package/lib/components/Index/index.d.ts +2 -1
- package/lib/components/Index/index.js +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/AuthenticationMenu/authenticationMenu.styles.d.ts +3 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Table/common/utils.d.ts +6 -0
- package/lib/components/Table/common/utils.js +12 -1
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.js +2 -2
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.d.ts +1 -1
- package/lib/components/Table/components/CheckboxMenu/checkboxMenu.styles.js +3 -3
- package/lib/components/Table/components/TableCell/common/utils.d.ts +8 -0
- package/lib/components/Table/components/TableCell/common/utils.js +15 -0
- package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.d.ts +6 -0
- package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.js +15 -0
- package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.d.ts +6 -0
- package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.js +16 -0
- package/lib/components/Table/components/TableHead/tableHead.js +2 -2
- package/lib/components/Table/components/TableRows/tableRows.js +2 -3
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.d.ts +10 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.js +37 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.d.ts +3 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.js +13 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.d.ts +9 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.js +19 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.d.ts +5 -0
- package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.js +13 -0
- package/lib/components/Table/components/TableToolbar/tableToolbar.js +5 -5
- package/lib/components/Table/components/TableToolbar/tableToolbar.styles.d.ts +1 -5
- package/lib/components/Table/components/TableToolbar/tableToolbar.styles.js +10 -7
- package/lib/components/Table/table.d.ts +5 -2
- package/lib/components/Table/table.js +13 -2
- package/lib/components/TableCreator/common/constants.d.ts +6 -0
- package/lib/components/TableCreator/common/constants.js +22 -0
- package/lib/components/TableCreator/common/entities.d.ts +5 -0
- package/lib/components/TableCreator/common/entities.js +2 -0
- package/lib/components/TableCreator/common/utils.d.ts +8 -0
- package/lib/components/TableCreator/common/utils.js +24 -0
- package/lib/components/TableCreator/tableCreator.d.ts +3 -1
- package/lib/components/TableCreator/tableCreator.js +19 -34
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +5 -0
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +25 -0
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.d.ts +4 -2
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.js +2 -2
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.styles.d.ts +5 -1
- package/lib/components/common/Button/components/DropdownButton/dropdownButton.styles.js +24 -1
- package/lib/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.d.ts +6 -0
- package/lib/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.js +29 -0
- package/lib/components/common/Dialog/dialog.d.ts +7 -0
- package/lib/components/common/Dialog/dialog.js +24 -0
- package/lib/components/common/DropdownMenu/common/constants.d.ts +2 -0
- package/lib/components/common/DropdownMenu/common/constants.js +8 -0
- package/lib/components/common/DropdownMenu/common/entities.d.ts +10 -0
- package/lib/components/common/DropdownMenu/common/entities.js +2 -0
- package/lib/components/common/DropdownMenu/components/MenuItem/menuItem.d.ts +7 -0
- package/lib/components/common/DropdownMenu/components/MenuItem/menuItem.js +25 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.d.ts +9 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.js +49 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.d.ts +3 -0
- package/lib/components/common/DropdownMenu/dropdownMenu.styles.js +13 -0
- package/lib/components/common/IconButton/iconButton.d.ts +4 -3
- package/lib/components/common/IconButton/iconButton.js +4 -4
- package/lib/components/common/IconButton/iconButton.styles.d.ts +34 -0
- package/lib/components/common/IconButton/iconButton.styles.js +27 -1
- package/lib/components/common/Tabs/tabs.styles.d.ts +1 -1
- package/lib/config/entities.d.ts +9 -1
- package/lib/providers/exploreState/constants.d.ts +3 -3
- package/lib/providers/exploreState/constants.js +3 -26
- package/lib/providers/exploreState/entities.d.ts +16 -5
- package/lib/providers/exploreState/initializer/constants.js +2 -0
- package/lib/providers/exploreState/initializer/utils.js +77 -5
- package/lib/providers/exploreState/payloads/entities.d.ts +32 -6
- package/lib/providers/exploreState/utils.d.ts +65 -11
- package/lib/providers/exploreState/utils.js +126 -15
- package/lib/providers/exploreState.d.ts +39 -7
- package/lib/providers/exploreState.js +58 -11
- package/lib/theme/common/components.js +4 -0
- package/lib/views/ExploreView/exploreView.d.ts +3 -1
- package/lib/views/ExploreView/exploreView.js +17 -11
- package/package.json +1 -1
- package/src/components/Detail/components/DetailViewTable/detailViewTable.tsx +2 -2
- package/src/components/Filter/components/Filters/filters.styles.ts +1 -1
- package/src/components/Filter/components/Filters/filters.tsx +1 -1
- package/src/components/Filter/components/VariableSizeListItem/variableSizeListItem.tsx +6 -3
- package/src/components/Index/index.tsx +3 -1
- package/src/components/Table/common/utils.ts +17 -0
- package/src/components/Table/components/CheckboxMenu/checkboxMenu.styles.ts +3 -3
- package/src/components/Table/components/CheckboxMenu/checkboxMenu.tsx +4 -2
- package/src/components/Table/components/TableCell/common/utils.ts +16 -0
- package/src/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.tsx +24 -0
- package/src/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.tsx +31 -0
- package/src/components/Table/components/TableHead/tableHead.tsx +18 -7
- package/src/components/Table/components/TableRows/tableRows.tsx +10 -8
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.styles.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/components/DropdownMenu/dropdownMenu.tsx +50 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.ts +8 -0
- package/src/components/Table/components/TableToolbar/components/RowSelection/rowSelection.tsx +30 -0
- package/src/components/Table/components/TableToolbar/tableToolbar.styles.ts +10 -7
- package/src/components/Table/components/TableToolbar/tableToolbar.tsx +11 -8
- package/src/components/Table/table.tsx +18 -1
- package/src/components/TableCreator/common/constants.ts +26 -0
- package/src/components/TableCreator/common/entities.ts +6 -0
- package/src/components/TableCreator/common/utils.ts +33 -0
- package/src/components/TableCreator/tableCreator.tsx +38 -17
- package/src/components/common/Alert/components/AlertText/alertText.styles.ts +20 -0
- package/src/components/common/Button/components/DropdownButton/dropdownButton.styles.ts +15 -1
- package/src/components/common/Button/components/DropdownButton/dropdownButton.tsx +10 -2
- package/src/components/common/CustomIcon/components/IndeterminateIcon/indeterminateIcon.tsx +23 -0
- package/src/components/common/Dialog/dialog.tsx +21 -0
- package/src/components/common/DropdownMenu/common/constants.ts +7 -0
- package/src/components/common/DropdownMenu/common/entities.ts +11 -0
- package/src/components/common/DropdownMenu/components/MenuItem/menuItem.tsx +24 -0
- package/src/components/common/DropdownMenu/dropdownMenu.styles.ts +8 -0
- package/src/components/common/DropdownMenu/dropdownMenu.tsx +48 -0
- package/src/components/common/IconButton/iconButton.styles.ts +18 -0
- package/src/components/common/IconButton/iconButton.tsx +10 -11
- package/src/config/entities.ts +13 -1
- package/src/providers/exploreState/constants.ts +3 -0
- package/src/providers/exploreState/entities.ts +28 -4
- package/src/providers/exploreState/initializer/constants.ts +2 -0
- package/src/providers/exploreState/initializer/utils.ts +94 -3
- package/src/providers/exploreState/payloads/entities.ts +41 -7
- package/src/providers/exploreState/utils.ts +185 -21
- package/src/providers/exploreState.tsx +155 -21
- package/src/theme/common/components.ts +4 -0
- package/src/views/ExploreView/exploreView.tsx +22 -10
- package/types/data-explorer-ui.d.ts +10 -0
- package/src/components/Table/components/EntityViewToggle/entityViewToggle.tsx +0 -36
|
@@ -12,7 +12,7 @@ const table_1 = require("../Table/table");
|
|
|
12
12
|
const DetailViewTable = ({ className, columns, gridTemplateColumns, items, noResultsTitle, Paper = paper_styles_1.RoundedPaper, tools, }) => {
|
|
13
13
|
return items.length > 0 ? (react_1.default.createElement(Paper, { className: className },
|
|
14
14
|
react_1.default.createElement(paper_styles_1.GridPaper, null,
|
|
15
|
-
tools && react_1.default.createElement(tableToolbar_styles_1.
|
|
15
|
+
tools && react_1.default.createElement(tableToolbar_styles_1.Toolbar, { variant: "table" }, tools),
|
|
16
16
|
react_1.default.createElement(table_1.Table, { columns: columns, gridTemplateColumns: gridTemplateColumns, items: items })))) : (react_1.default.createElement(noResults_1.NoResults, { Paper: Paper, title: noResultsTitle }));
|
|
17
17
|
};
|
|
18
18
|
exports.DetailViewTable = DetailViewTable;
|
|
@@ -31,6 +31,6 @@ export declare const FilterLabel: import("@emotion/styled").StyledComponent<{
|
|
|
31
31
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
32
32
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
33
33
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
34
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "variant" | "href" | "disabled" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "
|
|
34
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "variant" | "href" | "disabled" | "action" | "size" | "fullWidth" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & {
|
|
35
35
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
36
|
}, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TrackFilterOpenedFunction } from "config/entities";
|
|
3
2
|
import { SelectCategoryView } from "../../../../common/entities";
|
|
3
|
+
import { TrackFilterOpenedFunction } from "../../../../config/entities";
|
|
4
4
|
import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
|
|
5
5
|
export interface CategoryFilter {
|
|
6
6
|
categoryViews: SelectCategoryView[];
|
|
@@ -10,7 +10,7 @@ const breakpoints_1 = require("../../../../styles/common/mixins/breakpoints");
|
|
|
10
10
|
const colors_1 = require("../../../../styles/common/mixins/colors");
|
|
11
11
|
const fonts_1 = require("../../../../styles/common/mixins/fonts");
|
|
12
12
|
exports.Filters = (0, styled_1.default)("div", {
|
|
13
|
-
shouldForwardProp: (prop) => prop !== "height",
|
|
13
|
+
shouldForwardProp: (prop) => prop !== "height" && prop !== "isBaseStyle",
|
|
14
14
|
}) `
|
|
15
15
|
${(props) => (props.isBaseStyle ? (0, fonts_1.textBody500)(props) : (0, fonts_1.textBody400)(props))};
|
|
16
16
|
color: ${(props) => (props.isBaseStyle ? (0, colors_1.inkMain)(props) : (0, colors_1.inkLight)(props))};
|
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const material_1 = require("@mui/material");
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
+
const constants_1 = require("../../../../providers/exploreState/constants");
|
|
28
29
|
const typography_1 = require("../../../../theme/common/typography");
|
|
29
30
|
const checkedIcon_1 = require("../../../common/CustomIcon/components/CheckedIcon/checkedIcon");
|
|
30
31
|
const uncheckedIcon_1 = require("../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon");
|
|
@@ -43,6 +44,6 @@ function VariableSizeListItem({ categoryKey, categorySection, matchedItem, onFil
|
|
|
43
44
|
};
|
|
44
45
|
return (react_1.default.createElement(material_1.ListItemButton, { ref: listItemRef, onClick: handleItemClicked, selected: selected, style: style },
|
|
45
46
|
react_1.default.createElement(material_1.Checkbox, { checked: selected, checkedIcon: react_1.default.createElement(checkedIcon_1.CheckedIcon, null), icon: react_1.default.createElement(uncheckedIcon_1.UncheckedIcon, null) }),
|
|
46
|
-
react_1.default.createElement(material_1.ListItemText, { disableTypography: true, primary: react_1.default.createElement(highlightedLabel_1.HighlightedLabel, { label: label, ranges: labelRanges }), secondary: react_1.default.createElement(material_1.Typography, { color: "ink.light", variant: typography_1.TEXT_BODY_SMALL_400 }, count) })));
|
|
47
|
+
react_1.default.createElement(material_1.ListItemText, { disableTypography: true, primary: react_1.default.createElement(highlightedLabel_1.HighlightedLabel, { label: label, ranges: labelRanges }), secondary: categoryKey !== constants_1.SELECT_CATEGORY_KEY.SAVED_FILTERS && (react_1.default.createElement(material_1.Typography, { color: "ink.light", variant: typography_1.TEXT_BODY_SMALL_400 }, count)) })));
|
|
47
48
|
}
|
|
48
49
|
exports.default = VariableSizeListItem;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { HeroTitle } from "../common/Title/title";
|
|
3
3
|
export interface IndexProps {
|
|
4
|
+
className?: string;
|
|
4
5
|
List?: ReactNode;
|
|
5
6
|
ListHero?: ReactNode | ReactNode[];
|
|
6
7
|
SideBarButton?: ReactNode;
|
|
@@ -9,4 +10,4 @@ export interface IndexProps {
|
|
|
9
10
|
Tabs?: ReactNode;
|
|
10
11
|
title: HeroTitle;
|
|
11
12
|
}
|
|
12
|
-
export declare const Index: ({ List, ListHero, SideBarButton, SubTitleHero, Summaries, Tabs, title, }: IndexProps) => JSX.Element;
|
|
13
|
+
export declare const Index: ({ className, List, ListHero, SideBarButton, SubTitleHero, Summaries, Tabs, title, }: IndexProps) => JSX.Element;
|
|
@@ -8,10 +8,10 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const useLayoutState_1 = require("../../hooks/useLayoutState");
|
|
9
9
|
const hero_1 = require("./components/Hero/hero");
|
|
10
10
|
const index_styles_1 = require("./index.styles");
|
|
11
|
-
const Index = ({ List, ListHero, SideBarButton, SubTitleHero, Summaries, Tabs, title, }) => {
|
|
11
|
+
const Index = ({ className, List, ListHero, SideBarButton, SubTitleHero, Summaries, Tabs, title, }) => {
|
|
12
12
|
const { layoutState } = (0, useLayoutState_1.useLayoutState)();
|
|
13
13
|
const { headerHeight } = layoutState;
|
|
14
|
-
return (react_1.default.createElement(index_styles_1.Index, { marginTop: headerHeight },
|
|
14
|
+
return (react_1.default.createElement(index_styles_1.Index, { className: className, marginTop: headerHeight },
|
|
15
15
|
react_1.default.createElement(hero_1.Hero, { SideBarButton: SideBarButton, Summaries: Summaries, title: title }),
|
|
16
16
|
SubTitleHero,
|
|
17
17
|
Tabs,
|
|
@@ -5,11 +5,11 @@ export declare const AuthenticationMenu: import("@emotion/styled").StyledCompone
|
|
|
5
5
|
export declare const UserIcon: import("@emotion/styled").StyledComponent<{
|
|
6
6
|
children?: import("react").ReactNode;
|
|
7
7
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
8
|
-
color?: "inherit" | "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | "
|
|
8
|
+
color?: "inherit" | "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | "inkLight" | "ink" | undefined;
|
|
9
9
|
disabled?: boolean | undefined;
|
|
10
10
|
disableFocusRipple?: boolean | undefined;
|
|
11
11
|
edge?: false | "end" | "start" | undefined;
|
|
12
|
-
size?: "large" | "medium" | "small" | "
|
|
12
|
+
size?: "large" | "medium" | "small" | "xsmall" | "xxsmall" | "xlarge" | undefined;
|
|
13
13
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
14
14
|
} & Omit<{
|
|
15
15
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
@@ -59,7 +59,7 @@ export declare const UserSummary: import("@emotion/styled").StyledComponent<{
|
|
|
59
59
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
60
60
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
61
61
|
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
62
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "autoFocus" | "tabIndex" | "children" | "sx" | "disabled" | "action" | "selected" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "
|
|
62
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "autoFocus" | "tabIndex" | "children" | "sx" | "disabled" | "action" | "selected" | "dense" | "disableGutters" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "divider"> & {
|
|
63
63
|
theme?: import("@emotion/react").Theme | undefined;
|
|
64
64
|
}, {}, {}>;
|
|
65
65
|
export declare const UserNames: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
@@ -31,6 +31,6 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
|
|
|
31
31
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
32
32
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
33
33
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
34
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "variant" | "href" | "disabled" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "
|
|
34
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "variant" | "href" | "disabled" | "action" | "size" | "fullWidth" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & {
|
|
35
35
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
36
|
}, {}, {}>;
|
|
@@ -9,4 +9,4 @@ export declare const SearchForm: import("@emotion/styled").StyledComponent<{
|
|
|
9
9
|
export declare const SearchInput: import("@emotion/styled").StyledComponent<import("@mui/material").InputProps & {
|
|
10
10
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
|
-
export declare const ClearButton: ({ className,
|
|
12
|
+
export declare const ClearButton: ({ className, Icon, iconProps, open, size, ...props }: import("../../../../../../../../../../../common/IconButton/iconButton").IconButtonProps) => JSX.Element;
|
|
@@ -31,6 +31,6 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
|
|
|
31
31
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
32
32
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
33
33
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
34
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "variant" | "href" | "disabled" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "
|
|
34
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "variant" | "href" | "disabled" | "action" | "size" | "fullWidth" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & {
|
|
35
35
|
theme?: import("@emotion/react").Theme | undefined;
|
|
36
36
|
}, {}, {}>;
|
package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ export declare const Tab: import("@emotion/styled").StyledComponent<{
|
|
|
28
28
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
29
29
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
30
30
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
31
|
-
}, "label" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "children" | "sx" | "disabled" | "value" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "
|
|
31
|
+
}, "label" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "children" | "sx" | "disabled" | "value" | "action" | "icon" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "wrapped" | "iconPosition"> & {
|
|
32
32
|
theme?: import("@emotion/react").Theme | undefined;
|
|
33
33
|
}, {}, {}>;
|
|
@@ -105,7 +105,7 @@ export declare const Tab: import("@emotion/styled").StyledComponent<{
|
|
|
105
105
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
106
106
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
107
107
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
108
|
-
}, "label" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "children" | "sx" | "disabled" | "value" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "
|
|
108
|
+
}, "label" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "children" | "sx" | "disabled" | "value" | "action" | "icon" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "wrapped" | "iconPosition"> & {
|
|
109
109
|
theme?: import("@emotion/react").Theme | undefined;
|
|
110
110
|
} & Props, {}, {}>;
|
|
111
111
|
export {};
|
|
@@ -91,6 +91,12 @@ export declare function getPinnedCellIndex<T>(row: Row<T>): PinnedCell<T>;
|
|
|
91
91
|
* @returns table sort label props.
|
|
92
92
|
*/
|
|
93
93
|
export declare function getTableSortLabelProps<T>(column: Column<T>): TableSortLabelProps;
|
|
94
|
+
/**
|
|
95
|
+
* Returns true if any or all table rows are selected.
|
|
96
|
+
* @param table - Table.
|
|
97
|
+
* @returns true if a row is selected.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isAnyRowSelected<T>(table: Table<T>): boolean;
|
|
94
100
|
/**
|
|
95
101
|
* Returns true if client-side filtering is enabled.
|
|
96
102
|
* @param exploreMode - Explore mode.
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getInitialTableColumnVisibility = exports.sortingFn = exports.isColumnSortActive = exports.isClientFilteringEnabled = exports.getTableSortLabelProps = exports.getPinnedCellIndex = exports.getInitialTableStateSorting = exports.getInitialState = exports.getGridTemplateColumns = exports.getFacetedUniqueValuesWithArrayValues = exports.getEditColumnOptions = exports.generateDownloadBlob = exports.getColumnSortDirection = exports.buildCategoryViews = exports.arrIncludesSome = void 0;
|
|
6
|
+
exports.getInitialTableColumnVisibility = exports.sortingFn = exports.isColumnSortActive = exports.isClientFilteringEnabled = exports.isAnyRowSelected = exports.getTableSortLabelProps = exports.getPinnedCellIndex = exports.getInitialTableStateSorting = exports.getInitialState = exports.getGridTemplateColumns = exports.getFacetedUniqueValuesWithArrayValues = exports.getEditColumnOptions = exports.generateDownloadBlob = exports.getColumnSortDirection = exports.buildCategoryViews = exports.arrIncludesSome = void 0;
|
|
7
7
|
const SouthRounded_1 = __importDefault(require("@mui/icons-material/SouthRounded"));
|
|
8
8
|
const react_table_1 = require("@tanstack/react-table");
|
|
9
9
|
const useExploreMode_1 = require("../../../hooks/useExploreMode");
|
|
@@ -262,6 +262,17 @@ function getVisibleHeadersTableData(rows) {
|
|
|
262
262
|
function getVisibleRowsTableData(rows) {
|
|
263
263
|
return rows.map((row) => row.getVisibleCells().map((cell) => cell.getValue()));
|
|
264
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Returns true if any or all table rows are selected.
|
|
267
|
+
* @param table - Table.
|
|
268
|
+
* @returns true if a row is selected.
|
|
269
|
+
*/
|
|
270
|
+
function isAnyRowSelected(table) {
|
|
271
|
+
const { getIsAllPageRowsSelected, getIsSomePageRowsSelected, options: { enableRowSelection }, } = table;
|
|
272
|
+
return Boolean(enableRowSelection &&
|
|
273
|
+
(getIsSomePageRowsSelected() || getIsAllPageRowsSelected()));
|
|
274
|
+
}
|
|
275
|
+
exports.isAnyRowSelected = isAnyRowSelected;
|
|
265
276
|
/**
|
|
266
277
|
* Returns true if client-side filtering is enabled.
|
|
267
278
|
* @param exploreMode - Explore mode.
|
|
@@ -41,8 +41,8 @@ const CheckboxMenu = ({ label: buttonLabel, onReset, options, }) => {
|
|
|
41
41
|
setAnchorEl(null);
|
|
42
42
|
};
|
|
43
43
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
44
|
-
react_1.default.createElement(dropdownButton_1.DropdownButton, { onClick: onOpenMenu }, buttonLabel),
|
|
45
|
-
react_1.default.createElement(checkboxMenu_styles_1.
|
|
44
|
+
react_1.default.createElement(dropdownButton_1.DropdownButton, { onClick: onOpenMenu, open: open }, buttonLabel),
|
|
45
|
+
react_1.default.createElement(checkboxMenu_styles_1.Menu, { anchorEl: anchorEl, anchorOrigin: { horizontal: "right", vertical: "bottom" }, onClose: onCloseMenu, open: open, slotProps: { paper: { variant: "menu" } }, transformOrigin: {
|
|
46
46
|
horizontal: "right",
|
|
47
47
|
vertical: "top",
|
|
48
48
|
} },
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const Menu: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & {
|
|
2
2
|
theme?: import("@emotion/react").Theme | undefined;
|
|
3
3
|
}, {}, {}>;
|
|
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.Menu = void 0;
|
|
7
7
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
|
-
exports.
|
|
9
|
+
exports.Menu = (0, styled_1.default)(material_1.Menu) `
|
|
10
10
|
.MuiPaper-menu {
|
|
11
|
-
margin:
|
|
11
|
+
margin: 4px 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// List item button
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableCellProps as MTableCellProps } from "@mui/material/TableCell/TableCell";
|
|
2
|
+
import { CoreCell, CoreHeader } from "@tanstack/table-core";
|
|
3
|
+
/**
|
|
4
|
+
* Returns table cell padding based on the cell ID.
|
|
5
|
+
* @param id - Cell ID.
|
|
6
|
+
* @returns table cell padding.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getTableCellPadding<T extends object, TValue>(id: CoreHeader<T, TValue>["id"] | CoreCell<T, TValue>["id"]): MTableCellProps["padding"];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTableCellPadding = void 0;
|
|
4
|
+
const constants_1 = require("../../../../TableCreator/common/constants");
|
|
5
|
+
/**
|
|
6
|
+
* Returns table cell padding based on the cell ID.
|
|
7
|
+
* @param id - Cell ID.
|
|
8
|
+
* @returns table cell padding.
|
|
9
|
+
*/
|
|
10
|
+
function getTableCellPadding(id) {
|
|
11
|
+
if (id === constants_1.ACCESSOR_KEYS.SELECT) {
|
|
12
|
+
return "checkbox";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.getTableCellPadding = getTableCellPadding;
|
package/lib/components/Table/components/TableCell/components/RowSelectionCell/rowSelectionCell.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RowSelectionCell = void 0;
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const checkedIcon_1 = require("../../../../../common/CustomIcon/components/CheckedIcon/checkedIcon");
|
|
10
|
+
const uncheckedIcon_1 = require("../../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon");
|
|
11
|
+
const RowSelectionCell = ({ row, }) => {
|
|
12
|
+
const { getIsSelected, getToggleSelectedHandler } = row;
|
|
13
|
+
return (react_1.default.createElement(material_1.Checkbox, { checked: getIsSelected(), checkedIcon: react_1.default.createElement(checkedIcon_1.CheckedIcon, null), icon: react_1.default.createElement(uncheckedIcon_1.UncheckedIcon, null), onChange: getToggleSelectedHandler() }));
|
|
14
|
+
};
|
|
15
|
+
exports.RowSelectionCell = RowSelectionCell;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Table } from "@tanstack/react-table";
|
|
3
|
+
export interface HeadSelectionCellProps<T> {
|
|
4
|
+
tableInstance: Table<T>;
|
|
5
|
+
}
|
|
6
|
+
export declare const HeadSelectionCell: <T extends unknown>({ tableInstance, }: HeadSelectionCellProps<T>) => JSX.Element;
|
package/lib/components/Table/components/TableHead/components/HeadSelectionCell/headSelectionCell.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HeadSelectionCell = void 0;
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const checkedIcon_1 = require("../../../../../common/CustomIcon/components/CheckedIcon/checkedIcon");
|
|
10
|
+
const indeterminateIcon_1 = require("../../../../../common/CustomIcon/components/IndeterminateIcon/indeterminateIcon");
|
|
11
|
+
const uncheckedIcon_1 = require("../../../../../common/CustomIcon/components/UncheckedIcon/uncheckedIcon");
|
|
12
|
+
const HeadSelectionCell = ({ tableInstance, }) => {
|
|
13
|
+
const { getIsAllPageRowsSelected, getIsSomePageRowsSelected, getToggleAllRowsSelectedHandler, } = tableInstance;
|
|
14
|
+
return (react_1.default.createElement(material_1.Checkbox, { checked: getIsAllPageRowsSelected(), checkedIcon: react_1.default.createElement(checkedIcon_1.CheckedIcon, null), icon: react_1.default.createElement(uncheckedIcon_1.UncheckedIcon, null), indeterminate: getIsSomePageRowsSelected(), indeterminateIcon: react_1.default.createElement(indeterminateIcon_1.IndeterminateIcon, null), onChange: getToggleAllRowsSelectedHandler() }));
|
|
15
|
+
};
|
|
16
|
+
exports.HeadSelectionCell = HeadSelectionCell;
|
|
@@ -29,10 +29,10 @@ const react_table_1 = require("@tanstack/react-table");
|
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
const entities_1 = require("../../common/entities");
|
|
31
31
|
const utils_1 = require("../../common/utils");
|
|
32
|
+
const utils_2 = require("../TableCell/common/utils");
|
|
32
33
|
const TableHead = ({ rowDirection, tableInstance, }) => {
|
|
33
34
|
return (react_1.default.createElement(react_1.Fragment, null, rowDirection === entities_1.ROW_DIRECTION.DEFAULT &&
|
|
34
35
|
tableInstance.getHeaderGroups().map((headerGroup) => (react_1.default.createElement(material_1.TableHead, { key: headerGroup.id },
|
|
35
|
-
react_1.default.createElement(material_1.TableRow, null, headerGroup.headers.map((header) => (react_1.default.createElement(material_1.TableCell, { key: header.id },
|
|
36
|
-
react_1.default.createElement(material_1.TableSortLabel, Object.assign({}, (0, utils_1.getTableSortLabelProps)(header.column)), (0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext())))))))))));
|
|
36
|
+
react_1.default.createElement(material_1.TableRow, null, headerGroup.headers.map((header) => (react_1.default.createElement(material_1.TableCell, { key: header.id, padding: (0, utils_2.getTableCellPadding)(header.id) }, header.column.getCanSort() ? (react_1.default.createElement(material_1.TableSortLabel, Object.assign({}, (0, utils_1.getTableSortLabelProps)(header.column)), (0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext()))) : ((0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext())))))))))));
|
|
37
37
|
};
|
|
38
38
|
exports.TableHead = TableHead;
|
|
@@ -27,15 +27,14 @@ exports.TableRows = void 0;
|
|
|
27
27
|
const material_1 = require("@mui/material");
|
|
28
28
|
const react_table_1 = require("@tanstack/react-table");
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
+
const utils_1 = require("../TableCell/common/utils");
|
|
30
31
|
const TableRows = ({ tableInstance, virtualizer, }) => {
|
|
31
32
|
const { getRowModel } = tableInstance;
|
|
32
33
|
const { rows } = getRowModel();
|
|
33
34
|
const virtualItems = virtualizer.getVirtualItems();
|
|
34
35
|
return (react_1.default.createElement(react_1.Fragment, null, virtualItems.map((virtualRow) => {
|
|
35
36
|
const row = rows[virtualRow.index];
|
|
36
|
-
return (react_1.default.createElement(material_1.TableRow, { key: row.id, "data-index": virtualRow.index, ref: virtualizer.measureElement }, row.getVisibleCells().map((cell) => {
|
|
37
|
-
return (react_1.default.createElement(material_1.TableCell, { key: cell.id }, (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext())));
|
|
38
|
-
})));
|
|
37
|
+
return (react_1.default.createElement(material_1.TableRow, { key: row.id, "data-index": virtualRow.index, ref: virtualizer.measureElement }, row.getVisibleCells().map((cell) => (react_1.default.createElement(material_1.TableCell, { key: cell.id, padding: (0, utils_1.getTableCellPadding)(cell.column.id) }, (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext()))))));
|
|
39
38
|
})));
|
|
40
39
|
};
|
|
41
40
|
exports.TableRows = TableRows;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DropdownMenuItemProps } from "../../../../../../../common/DropdownMenu/common/entities";
|
|
3
|
+
import { DropdownMenuProps as DXDropdownMenuProps } from "../../../../../../../common/DropdownMenu/dropdownMenu";
|
|
4
|
+
export interface DropdownMenuProps {
|
|
5
|
+
Button?: DXDropdownMenuProps["Button"];
|
|
6
|
+
buttonLabel?: string;
|
|
7
|
+
children: ({ closeMenu }: DropdownMenuItemProps) => JSX.Element[];
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const DropdownMenu: ({ Button, buttonLabel, children, className, ...props }: DropdownMenuProps) => JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DropdownMenu = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const dropdownButton_1 = require("../../../../../../../common/Button/components/DropdownButton/dropdownButton");
|
|
20
|
+
const dropdownMenu_styles_1 = require("./dropdownMenu.styles");
|
|
21
|
+
const DEFAULT_MENU_PROPS = {
|
|
22
|
+
anchorOrigin: { horizontal: "left", vertical: "bottom" },
|
|
23
|
+
transformOrigin: { horizontal: "left", vertical: "top" },
|
|
24
|
+
};
|
|
25
|
+
const DropdownMenu = (_a) => {
|
|
26
|
+
var { Button = (props) => renderButton(Object.assign({ children: buttonLabel }, props)), buttonLabel = "Edit", children, className } = _a, props = __rest(_a, ["Button", "buttonLabel", "children", "className"]) /* Spread props to allow for Mui Menu specific prop overrides e.g. "anchorOrigin". */;
|
|
27
|
+
return (react_1.default.createElement(dropdownMenu_styles_1.DropdownMenu, Object.assign({}, DEFAULT_MENU_PROPS, { className: className, Button: Button }, props), ({ closeMenu }) => children({ closeMenu })));
|
|
28
|
+
};
|
|
29
|
+
exports.DropdownMenu = DropdownMenu;
|
|
30
|
+
/**
|
|
31
|
+
* Return the dropdown button.
|
|
32
|
+
* @param props - Button props e.g. "onClick".
|
|
33
|
+
* @returns button element.
|
|
34
|
+
*/
|
|
35
|
+
function renderButton(props) {
|
|
36
|
+
return react_1.default.createElement(dropdownButton_1.DropdownButton, Object.assign({}, props));
|
|
37
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DropdownMenu = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const dropdownMenu_1 = require("../../../../../../../common/DropdownMenu/dropdownMenu");
|
|
9
|
+
exports.DropdownMenu = (0, styled_1.default)(dropdownMenu_1.DropdownMenu) `
|
|
10
|
+
.MuiPaper-menu {
|
|
11
|
+
min-width: 288px;
|
|
12
|
+
}
|
|
13
|
+
`;
|
package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from "@tanstack/react-table";
|
|
3
|
+
import { ComponentsConfig } from "../../../../../../config/entities";
|
|
4
|
+
export interface RowSelectionProps<T> {
|
|
5
|
+
className?: string;
|
|
6
|
+
rows: Row<T>[];
|
|
7
|
+
rowSelectionView?: ComponentsConfig;
|
|
8
|
+
}
|
|
9
|
+
export declare const RowSelection: <T extends object>({ className, rows, rowSelectionView, }: RowSelectionProps<T>) => JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RowSelection = void 0;
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const typography_1 = require("../../../../../../theme/common/typography");
|
|
10
|
+
const ComponentCreator_1 = require("../../../../../ComponentCreator/ComponentCreator");
|
|
11
|
+
const rowSelection_styles_1 = require("./rowSelection.styles");
|
|
12
|
+
const RowSelection = ({ className, rows, rowSelectionView, }) => {
|
|
13
|
+
return (react_1.default.createElement(rowSelection_styles_1.RowSelection, { className: className },
|
|
14
|
+
react_1.default.createElement(material_1.Typography, { variant: typography_1.TEXT_BODY_400 },
|
|
15
|
+
rows.length,
|
|
16
|
+
" items selected:"),
|
|
17
|
+
rowSelectionView ? (react_1.default.createElement(ComponentCreator_1.ComponentCreator, { components: rowSelectionView, response: rows })) : null));
|
|
18
|
+
};
|
|
19
|
+
exports.RowSelection = RowSelection;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const RowSelection: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
package/lib/components/Table/components/TableToolbar/components/RowSelection/rowSelection.styles.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RowSelection = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
exports.RowSelection = styled_1.default.div `
|
|
9
|
+
align-items: center;
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 16px;
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
`;
|
|
@@ -30,14 +30,14 @@ const entities_1 = require("../../common/entities");
|
|
|
30
30
|
const utils_1 = require("../../common/utils");
|
|
31
31
|
const checkboxMenu_1 = require("../CheckboxMenu/checkboxMenu");
|
|
32
32
|
const downloadEntityResults_1 = require("../DownloadEntityResults/downloadEntityResults");
|
|
33
|
-
const entityViewToggle_1 = require("../EntityViewToggle/entityViewToggle");
|
|
34
33
|
const paginationSummary_1 = require("../PaginationSummary/paginationSummary");
|
|
34
|
+
const rowSelection_1 = require("./components/RowSelection/rowSelection");
|
|
35
35
|
const tableToolbar_styles_1 = require("./tableToolbar.styles");
|
|
36
36
|
const TableToolbar = ({ listView, rowDirection, tableInstance, }) => {
|
|
37
37
|
const { exploreState } = (0, useExploreState_1.useExploreState)();
|
|
38
|
-
const { paginationState
|
|
38
|
+
const { paginationState } = exploreState;
|
|
39
39
|
const { currentPage, pages, pageSize, rows } = paginationState;
|
|
40
|
-
const { resetColumnVisibility } = tableInstance;
|
|
40
|
+
const { getSelectedRowModel, resetColumnVisibility } = tableInstance;
|
|
41
41
|
const { enableDownload } = listView || {};
|
|
42
42
|
const isLastPage = currentPage === pages;
|
|
43
43
|
const editColumnOptions = (0, utils_1.getEditColumnOptions)(tableInstance);
|
|
@@ -49,8 +49,8 @@ const TableToolbar = ({ listView, rowDirection, tableInstance, }) => {
|
|
|
49
49
|
const onResetColumnVisibility = () => {
|
|
50
50
|
resetColumnVisibility(false);
|
|
51
51
|
};
|
|
52
|
-
return (react_1.default.createElement(react_1.Fragment, null, showToolbar && (react_1.default.createElement(tableToolbar_styles_1.
|
|
53
|
-
|
|
52
|
+
return (react_1.default.createElement(react_1.Fragment, null, showToolbar && (react_1.default.createElement(tableToolbar_styles_1.Toolbar, { variant: "table" },
|
|
53
|
+
(0, utils_1.isAnyRowSelected)(tableInstance) ? (react_1.default.createElement(rowSelection_1.RowSelection, { rows: getSelectedRowModel().rows, rowSelectionView: listView === null || listView === void 0 ? void 0 : listView.rowSelectionView })) : (react_1.default.createElement(paginationSummary_1.PaginationSummary, { firstResult: (currentPage - 1) * pageSize + 1, lastResult: isLastPage ? rows : pageSize * currentPage, totalResult: rows })),
|
|
54
54
|
react_1.default.createElement(tableToolbar_styles_1.ToolbarActions, null,
|
|
55
55
|
enableDownload && (react_1.default.createElement(downloadEntityResults_1.DownloadEntityResults, { entityName: exploreState.tabValue, rows: tableInstance.getFilteredRowModel().rows })),
|
|
56
56
|
react_1.default.createElement(checkboxMenu_1.CheckboxMenu, { label: "Edit Columns", onReset: onResetColumnVisibility, options: editColumnOptions }))))));
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const TableToolbar: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
1
|
+
export declare const Toolbar: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").ToolbarTypeMap<{}, "div">>;
|
|
6
2
|
export declare const ToolbarActions: import("@emotion/styled").StyledComponent<import("../../../common/Grid/grid").GridProps & {
|
|
7
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
4
|
}, {}, {}>;
|
|
@@ -3,16 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ToolbarActions = exports.
|
|
6
|
+
exports.ToolbarActions = exports.Toolbar = void 0;
|
|
7
7
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
8
9
|
const colors_1 = require("../../../../styles/common/mixins/colors");
|
|
9
10
|
const grid_1 = require("../../../common/Grid/grid");
|
|
10
|
-
exports.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
exports.Toolbar = (0, styled_1.default)(material_1.Toolbar) `
|
|
12
|
+
&.MuiToolbar-table {
|
|
13
|
+
align-items: center;
|
|
14
|
+
background-color: ${colors_1.white};
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
}
|
|
16
19
|
`;
|
|
17
20
|
exports.ToolbarActions = (0, styled_1.default)(grid_1.Grid) `
|
|
18
21
|
gap: 8px;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnDef, InitialTableState } from "@tanstack/react-table";
|
|
3
|
+
import { CoreOptions } from "@tanstack/table-core";
|
|
3
4
|
import { Pagination } from "../../common/entities";
|
|
4
5
|
import { ListViewConfig } from "../../config/entities";
|
|
5
6
|
export interface TableProps<T extends object> {
|
|
6
7
|
columns: ColumnDef<T>[];
|
|
7
8
|
count?: number;
|
|
9
|
+
getRowId?: CoreOptions<T>["getRowId"];
|
|
8
10
|
initialState: InitialTableState;
|
|
9
11
|
items: T[];
|
|
10
12
|
listView?: ListViewConfig;
|
|
@@ -20,11 +22,12 @@ export interface TableProps<T extends object> {
|
|
|
20
22
|
* Uncontrolled table will take advantage of React Table's state and will be used for static loads.
|
|
21
23
|
* @param tableProps - Set of props required for displaying the table.
|
|
22
24
|
* @param tableProps.columns - Set of columns to display.
|
|
25
|
+
* @param tableProps.getRowId - Function to customize the row ID.
|
|
23
26
|
* @param tableProps.initialState - Initial table state.
|
|
24
27
|
* @param tableProps.items - Row data to display.
|
|
25
28
|
* @param tableProps.listView - List view configuration.
|
|
26
29
|
* @param tableProps.total - Total number of rows in the result set.
|
|
27
30
|
* @returns Configured table element for display.
|
|
28
31
|
*/
|
|
29
|
-
export declare const TableComponent: <T extends object>({ columns, initialState, items, listView, total, }: TableProps<T>) => JSX.Element;
|
|
30
|
-
export declare const Table: <T extends object>({ columns, initialState, items, listView, total, }: TableProps<T>) => JSX.Element;
|
|
32
|
+
export declare const TableComponent: <T extends object>({ columns, getRowId, initialState, items, listView, total, }: TableProps<T>) => JSX.Element;
|
|
33
|
+
export declare const Table: <T extends object>({ columns, getRowId, initialState, items, listView, total, }: TableProps<T>) => JSX.Element;
|