@evoke-platform/ui-components 1.0.0-dev.174 → 1.0.0-dev.175

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.
@@ -10,6 +10,8 @@ export declare type BuilderGridProps<T extends GridValidRowModel> = MuiDataGridP
10
10
  item?: string;
11
11
  initialSort?: GridSortItem;
12
12
  emptyContentSelectOptions?: EmptyContentSelectOptions;
13
+ title?: string;
14
+ disablePagination?: boolean;
13
15
  };
14
16
  declare const BuilderGrid: <T extends GridValidRowModel>(props: BuilderGridProps<T>) => JSX.Element;
15
17
  export default BuilderGrid;
@@ -17,9 +17,9 @@ import BuilderGridToolbar from './BuilderGridToolbar';
17
17
  import { EmptyContent } from './EmptyContent';
18
18
  const BuilderGrid = (props) => {
19
19
  var _a, _b;
20
- const { loading, action, item, rows, initialSort, emptyContentSelectOptions } = props, rest = __rest(props, ["loading", "action", "item", "rows", "initialSort", "emptyContentSelectOptions"]);
20
+ const { loading, action, item, rows, initialSort, emptyContentSelectOptions, title, disablePagination } = props, rest = __rest(props, ["loading", "action", "item", "rows", "initialSort", "emptyContentSelectOptions", "title", "disablePagination"]);
21
21
  const [anchorEl, setAnchorEl] = useState();
22
- const toolbar = useMemo(() => () => React.createElement(BuilderGridToolbar, { loading: loading, action: action }), [loading, action]);
22
+ const toolbar = useMemo(() => () => React.createElement(BuilderGridToolbar, { loading: loading, action: action, title: title }), [loading, action]);
23
23
  return (React.createElement(UIThemeProvider, null, loading || rows.length ? (React.createElement(Box, { sx: {
24
24
  backgroundColor: '#fff',
25
25
  borderRadius: '6px',
@@ -28,7 +28,7 @@ const BuilderGrid = (props) => {
28
28
  borderBottom: 'none',
29
29
  boxShadow: 'rgba(145, 158, 171, 0.2) 0px 8px 16px',
30
30
  } },
31
- React.createElement(MuiDataGrid, Object.assign({ autoPageSize: true, onMenuOpen: (env) => setAnchorEl(env.target), loading: loading, rows: rows }, rest, { sx: Object.assign({ border: 'none', '& .MuiDataGrid-toolbarContainer': {
31
+ React.createElement(MuiDataGrid, Object.assign({ autoPageSize: !disablePagination, hideFooterPagination: disablePagination, hideFooter: disablePagination, onMenuOpen: (env) => setAnchorEl(env.target), loading: loading, rows: rows }, rest, { sx: Object.assign({ border: 'none', '& .MuiDataGrid-toolbarContainer': {
32
32
  padding: '0',
33
33
  fontColor: '#212B36',
34
34
  margin: '16px 16px 0 16px',
@@ -53,12 +53,15 @@ const BuilderGrid = (props) => {
53
53
  }, '& .MuiDataGrid-columnHeaders': {
54
54
  borderTop: '1px solid #e2e2e3',
55
55
  borderRadius: 0,
56
+ backgroundColor: '#f4f6f8',
56
57
  }, '& .MuiDataGrid-columnHeaderTitle': {
57
58
  color: '#637381',
58
59
  fontWeight: 700,
59
60
  }, '& .MuiDataGrid-iconButtonContainer': {
60
61
  marginLeft: '4px',
61
- }, height: 'calc(100vh - 240px)' }, rest.sx), getRowId: (row) => row.id, disableColumnMenu: true, initialState: {
62
+ }, '& .MuiDataGrid-overlayWrapper': {
63
+ display: 'none',
64
+ }, height: !disablePagination ? 'calc(100vh - 240px)' : 'auto' }, rest.sx), getRowId: (row) => row.id, disableColumnMenu: true, initialState: {
62
65
  sorting: {
63
66
  sortModel: initialSort ? [initialSort] : [],
64
67
  },
@@ -77,12 +80,14 @@ const BuilderGrid = (props) => {
77
80
  },
78
81
  }, components: {
79
82
  Toolbar: toolbar,
83
+ NoResultsOverlay: () => React.createElement(Box, null),
80
84
  }, rowHeight: 60, columnHeaderHeight: 62 })))) : (React.createElement(React.Fragment, null, rows && !rows.length && (React.createElement(Box, { sx: {
81
85
  backgroundColor: '#fff',
82
86
  borderRadius: '6px',
83
87
  display: 'flex',
84
88
  alignItems: 'center',
85
89
  justifyContent: 'center',
90
+ boxShadow: '0px 24px 48px rgba(145, 158, 171, 0.4)',
86
91
  height: (_b = (_a = rest.sx) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 'calc(100vh - 240px)',
87
92
  } },
88
93
  React.createElement(EmptyContent, { item: item, onClick: action === null || action === void 0 ? void 0 : action.onClick, selectOptions: emptyContentSelectOptions })))))));
@@ -3,6 +3,7 @@ import { GridToolbarProps as MuiGridToolbarProps } from '@mui/x-data-grid';
3
3
  import { GridAction } from './BuilderGrid';
4
4
  export declare type BuilderGridToolbar = MuiGridToolbarProps & {
5
5
  action?: GridAction;
6
+ title?: string;
6
7
  };
7
8
  declare function BuilderGridToolbar(props: BuilderGridToolbar): JSX.Element;
8
9
  export default BuilderGridToolbar;
@@ -1,3 +1,4 @@
1
+ import { Typography } from '@mui/material';
1
2
  import { GridToolbarContainer, GridToolbarQuickFilter, } from '@mui/x-data-grid';
2
3
  import React from 'react';
3
4
  import UIThemeProvider from '../../../theme';
@@ -5,7 +6,7 @@ import { Button } from '../../core';
5
6
  import { Grid } from '../../layout';
6
7
  function BuilderGridToolbar(props) {
7
8
  var _a, _b, _c;
8
- const { theme, action } = props;
9
+ const { theme, action, title } = props;
9
10
  const styles = {
10
11
  container: { display: 'flex', justifyContent: 'space-between', margin: '0 0 15px 0' },
11
12
  iconButton: {
@@ -37,8 +38,9 @@ function BuilderGridToolbar(props) {
37
38
  };
38
39
  return (React.createElement(UIThemeProvider, { args: { theme: theme } },
39
40
  React.createElement(GridToolbarContainer, { sx: { padding: '0' } },
41
+ title && (React.createElement(Typography, { sx: { fontSize: '18px', fontWeight: 700, marginBottom: '6px', marginTop: '6px' } }, title)),
40
42
  React.createElement(Grid, { container: true, sx: styles.container },
41
- React.createElement(Grid, { item: true, xs: 6 },
43
+ React.createElement(Grid, { item: true, xs: 6, sx: { display: 'flex', alignItems: 'center' } },
42
44
  React.createElement(GridToolbarQuickFilter, { variant: "outlined", size: "small", sx: styles.quickFilter })),
43
45
  React.createElement(Grid, { item: true, xs: 6, display: 'flex', alignItems: 'center', justifyContent: 'flex-end' },
44
46
  React.createElement(Button, { sx: {
@@ -46,8 +48,8 @@ function BuilderGridToolbar(props) {
46
48
  height: '40px',
47
49
  padding: '0px 14px',
48
50
  '&:hover': {
49
- boxShadow: 'none'
50
- }
51
+ boxShadow: 'none',
52
+ },
51
53
  }, onClick: action === null || action === void 0 ? void 0 : action.onClick, variant: 'contained' }, action === null || action === void 0 ? void 0 : action.label))))));
52
54
  }
53
55
  export default BuilderGridToolbar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.174",
3
+ "version": "1.0.0-dev.175",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",