@evoke-platform/ui-components 1.0.0-dev.215 → 1.0.0-dev.216
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/dist/published/components/custom/BuilderGrid/BuilderGrid.d.ts +1 -0
- package/dist/published/components/custom/BuilderGrid/BuilderGrid.js +2 -2
- package/dist/published/components/custom/BuilderGrid/BuilderGridToolbar.d.ts +1 -0
- package/dist/published/components/custom/BuilderGrid/BuilderGridToolbar.js +17 -16
- package/dist/published/components/custom/BuilderGrid/ToolbarActions.js +2 -2
- package/package.json +1 -1
@@ -18,6 +18,7 @@ export declare type BuilderGridProps<T extends GridValidRowModel> = MuiDataGridP
|
|
18
18
|
disablePagination?: boolean;
|
19
19
|
hideEmptyContent?: boolean;
|
20
20
|
hideToolbar?: boolean;
|
21
|
+
hideSearchbar?: boolean;
|
21
22
|
noRowsOverlay?: React.ReactElement;
|
22
23
|
filterComponent?: React.ReactElement;
|
23
24
|
error?: number;
|
@@ -18,9 +18,9 @@ import { EmptyContent } from './EmptyContent';
|
|
18
18
|
import ErrorComponent from '../ErrorComponent';
|
19
19
|
const BuilderGrid = (props) => {
|
20
20
|
var _a, _b, _c, _d, _e;
|
21
|
-
const { loading, actions, item, rows, initialSort, emptyContentSelectOptions, emptyContentActionIndex, title, subtitle, disablePagination, hideEmptyContent, hideToolbar, noRowsOverlay, filterComponent, error } = props, rest = __rest(props, ["loading", "actions", "item", "rows", "initialSort", "emptyContentSelectOptions", "emptyContentActionIndex", "title", "subtitle", "disablePagination", "hideEmptyContent", "hideToolbar", "noRowsOverlay", "filterComponent", "error"]);
|
21
|
+
const { loading, actions, item, rows, initialSort, emptyContentSelectOptions, emptyContentActionIndex, title, subtitle, disablePagination, hideEmptyContent, hideToolbar, hideSearchbar, noRowsOverlay, filterComponent, error } = props, rest = __rest(props, ["loading", "actions", "item", "rows", "initialSort", "emptyContentSelectOptions", "emptyContentActionIndex", "title", "subtitle", "disablePagination", "hideEmptyContent", "hideToolbar", "hideSearchbar", "noRowsOverlay", "filterComponent", "error"]);
|
22
22
|
const [anchorEl, setAnchorEl] = useState();
|
23
|
-
const toolbar = useMemo(() => () => (React.createElement(BuilderGridToolbar, { loading: loading, actions: actions, title: title, subtitle: subtitle, filter: filterComponent })), [loading, actions]);
|
23
|
+
const toolbar = useMemo(() => () => (React.createElement(BuilderGridToolbar, { loading: loading, actions: actions, title: title, subtitle: subtitle, hideSearchbar: hideSearchbar, filter: filterComponent })), [loading, actions]);
|
24
24
|
return (React.createElement(UIThemeProvider, null, loading || rows.length || hideEmptyContent ? (React.createElement(Box, { sx: {
|
25
25
|
backgroundColor: '#fff',
|
26
26
|
borderRadius: '6px',
|
@@ -6,6 +6,7 @@ export declare type BuilderGridToolbar = MuiGridToolbarProps & {
|
|
6
6
|
title?: string;
|
7
7
|
subtitle?: string;
|
8
8
|
filter?: React.ReactElement;
|
9
|
+
hideSearchbar?: boolean;
|
9
10
|
};
|
10
11
|
declare function BuilderGridToolbar(props: BuilderGridToolbar): JSX.Element;
|
11
12
|
export default BuilderGridToolbar;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { Typography } from '@mui/material';
|
2
2
|
import { GridToolbarContainer, GridToolbarQuickFilter, } from '@mui/x-data-grid';
|
3
3
|
import React from 'react';
|
4
4
|
import UIThemeProvider from '../../../theme';
|
@@ -6,11 +6,13 @@ import { Grid } from '../../layout';
|
|
6
6
|
import { ToolbarActions } from './ToolbarActions';
|
7
7
|
function BuilderGridToolbar(props) {
|
8
8
|
var _a, _b, _c;
|
9
|
-
const { theme, actions, title, subtitle, filter } = props;
|
9
|
+
const { theme, actions, title, subtitle, filter, hideSearchbar } = props;
|
10
10
|
const styles = {
|
11
11
|
container: {
|
12
12
|
display: 'flex',
|
13
13
|
margin: '0 0 15px 0',
|
14
|
+
justifyContent: 'space-between',
|
15
|
+
width: '100%',
|
14
16
|
},
|
15
17
|
iconButton: {
|
16
18
|
minWidth: '36px',
|
@@ -42,19 +44,18 @@ function BuilderGridToolbar(props) {
|
|
42
44
|
};
|
43
45
|
return (React.createElement(UIThemeProvider, { args: { theme: theme } },
|
44
46
|
React.createElement(GridToolbarContainer, { sx: { padding: '0' } },
|
45
|
-
|
46
|
-
React.createElement(
|
47
|
-
React.createElement(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
} },
|
56
|
-
|
57
|
-
|
58
|
-
!title && React.createElement(ToolbarActions, { actions: actions })))));
|
47
|
+
React.createElement(Grid, { xs: 12, sx: styles.container },
|
48
|
+
React.createElement(Grid, { display: 'block' },
|
49
|
+
title && (React.createElement(Typography, { sx: {
|
50
|
+
fontSize: '18px',
|
51
|
+
fontWeight: 700,
|
52
|
+
marginBottom: '6px',
|
53
|
+
} }, title)),
|
54
|
+
React.createElement(Grid, { sx: { display: 'flex' } },
|
55
|
+
!hideSearchbar && (React.createElement(GridToolbarQuickFilter, { variant: "outlined", size: "small", sx: styles.quickFilter })),
|
56
|
+
filter && (React.createElement(Grid, { item: true, sx: { display: 'flex', marginLeft: '16px' } }, filter))),
|
57
|
+
subtitle && (React.createElement(Typography, { sx: { fontSize: '14px', marginTop: !hideSearchbar ? '8px' : '0px' } }, subtitle))),
|
58
|
+
React.createElement(Grid, null,
|
59
|
+
React.createElement(ToolbarActions, { actions: actions }))))));
|
59
60
|
}
|
60
61
|
export default BuilderGridToolbar;
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
2
2
|
import { Button } from '../../core';
|
3
3
|
import { Grid } from '../../layout';
|
4
4
|
export const ToolbarActions = (props) => {
|
5
|
-
const {
|
6
|
-
return (React.createElement(Grid, { item: true, container: true,
|
5
|
+
const { actions } = props;
|
6
|
+
return (React.createElement(Grid, { item: true, container: true, display: 'flex', alignItems: 'center', justifyContent: 'flex-end' }, actions === null || actions === void 0 ? void 0 : actions.filter((a) => !a.isHidden).map((action, index) => (React.createElement(Grid, { item: true, display: 'flex', alignItems: 'center', justifyContent: 'flex-end' },
|
7
7
|
React.createElement(Button, { sx: {
|
8
8
|
fontWeight: 700,
|
9
9
|
height: '36px',
|