@evoke-platform/ui-components 1.0.0-dev.178 → 1.0.0-dev.179

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.
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { GridSortItem, GridValidRowModel, DataGridProps as MuiDataGridProps } from '@mui/x-data-grid';
2
+ import React from 'react';
3
3
  import { EmptyContentSelectOptions } from './EmptyContent';
4
4
  export declare type GridAction = {
5
5
  label: string;
@@ -12,6 +12,9 @@ export declare type BuilderGridProps<T extends GridValidRowModel> = MuiDataGridP
12
12
  emptyContentSelectOptions?: EmptyContentSelectOptions;
13
13
  title?: string;
14
14
  disablePagination?: boolean;
15
+ hideEmptyContent?: boolean;
16
+ hideToolbar?: boolean;
17
+ noRowsOverlay?: React.ReactElement;
15
18
  };
16
19
  declare const BuilderGrid: <T extends GridValidRowModel>(props: BuilderGridProps<T>) => JSX.Element;
17
20
  export default BuilderGrid;
@@ -17,10 +17,10 @@ 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, title, disablePagination } = props, rest = __rest(props, ["loading", "action", "item", "rows", "initialSort", "emptyContentSelectOptions", "title", "disablePagination"]);
20
+ const { loading, action, item, rows, initialSort, emptyContentSelectOptions, title, disablePagination, hideEmptyContent, hideToolbar, noRowsOverlay } = props, rest = __rest(props, ["loading", "action", "item", "rows", "initialSort", "emptyContentSelectOptions", "title", "disablePagination", "hideEmptyContent", "hideToolbar", "noRowsOverlay"]);
21
21
  const [anchorEl, setAnchorEl] = useState();
22
22
  const toolbar = useMemo(() => () => React.createElement(BuilderGridToolbar, { loading: loading, action: action, title: title }), [loading, action]);
23
- return (React.createElement(UIThemeProvider, null, loading || rows.length ? (React.createElement(Box, { sx: {
23
+ return (React.createElement(UIThemeProvider, null, loading || rows.length || hideEmptyContent ? (React.createElement(Box, { sx: {
24
24
  backgroundColor: '#fff',
25
25
  borderRadius: '6px',
26
26
  flexGrow: 1,
@@ -51,7 +51,7 @@ const BuilderGrid = (props) => {
51
51
  backgroundColor: '#F4F6F8',
52
52
  padding: '0 24px',
53
53
  }, '& .MuiDataGrid-columnHeaders': {
54
- borderTop: '1px solid #e2e2e3',
54
+ borderTop: hideToolbar ? 'none' : '1px solid #e2e2e3',
55
55
  borderRadius: 0,
56
56
  backgroundColor: '#f4f6f8',
57
57
  }, '& .MuiDataGrid-columnHeaderTitle': {
@@ -59,8 +59,6 @@ const BuilderGrid = (props) => {
59
59
  fontWeight: 700,
60
60
  }, '& .MuiDataGrid-iconButtonContainer': {
61
61
  marginLeft: '4px',
62
- }, '& .MuiDataGrid-overlayWrapper': {
63
- display: 'none',
64
62
  }, height: !disablePagination ? 'calc(100vh - 240px)' : 'auto' }, rest.sx), getRowId: (row) => row.id, disableColumnMenu: true, initialState: {
65
63
  sorting: {
66
64
  sortModel: initialSort ? [initialSort] : [],
@@ -78,9 +76,14 @@ const BuilderGrid = (props) => {
78
76
  },
79
77
  },
80
78
  },
81
- }, components: {
82
- Toolbar: toolbar,
83
- NoResultsOverlay: () => React.createElement(Box, null),
79
+ }, slots: {
80
+ toolbar: hideToolbar ? null : toolbar,
81
+ noResultsOverlay: () => {
82
+ return React.createElement(Box, null);
83
+ },
84
+ noRowsOverlay: () => {
85
+ return noRowsOverlay ? noRowsOverlay : null;
86
+ },
84
87
  }, rowHeight: 60, columnHeaderHeight: 62 })))) : (React.createElement(React.Fragment, null, rows && !rows.length && (React.createElement(Box, { sx: {
85
88
  backgroundColor: '#fff',
86
89
  borderRadius: '6px',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.178",
3
+ "version": "1.0.0-dev.179",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",