@zydon/common 2.4.62 → 2.4.64

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,10 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
+ import { StackProps } from '@mui/material/Stack';
3
4
  import { Breakpoint } from '@mui/material/styles';
4
5
  import { DataGridProps } from '../../types/dataGridProps.js';
5
6
  import '@mui/x-data-grid-premium';
6
7
 
7
8
  interface DataViewProps extends DataGridProps {
9
+ containerProps?: StackProps;
8
10
  title: string;
9
11
  breakpoint?: Breakpoint | number;
10
12
  onPaginationChange: (page: number, rowsPerPage: number) => void;
@@ -17,6 +19,6 @@ interface DataViewProps extends DataGridProps {
17
19
  onSearchChange?: (value: string) => void;
18
20
  }
19
21
 
20
- declare const DataView: ({ title, breakpoint, columns, rows, mobileRender, rowCount, paginationModel, onPaginationChange, actions, moreActions, onAdd, onSearch, searchValue, onSearchChange, slots, slotProps, loading, fetching, ...others }: DataViewProps) => react_jsx_runtime.JSX.Element;
22
+ declare const DataView: ({ title, breakpoint, columns, rows, mobileRender, rowCount, paginationModel, onPaginationChange, actions, moreActions, onAdd, onSearch, searchValue, onSearchChange, slots, slotProps, loading, fetching, containerProps, ...others }: DataViewProps) => react_jsx_runtime.JSX.Element;
21
23
 
22
24
  export { DataView as default };
@@ -1,26 +1,29 @@
1
1
  import { a as a$4 } from '../../chunk-MPKHVDQH.js';
2
+ import { a as a$5 } from '../../chunk-TWGGHTU5.js';
2
3
  import { a as a$3 } from '../../chunk-HOMGLSVS.js';
3
- import { a as a$6 } from '../../chunk-5YJTSVA2.js';
4
+ import { a as a$9 } from '../../chunk-5YJTSVA2.js';
4
5
  import { a } from '../../chunk-CFD2VTQ3.js';
5
- import { a as a$5 } from '../../chunk-JTD47UZZ.js';
6
- import '../../chunk-FK7DDO5L.js';
6
+ import { a as a$8 } from '../../chunk-JTD47UZZ.js';
7
+ import { a as a$6 } from '../../chunk-FK7DDO5L.js';
7
8
  import '../../chunk-PUR4ARBY.js';
8
9
  import '../../chunk-U26IUEAG.js';
9
10
  import '../../chunk-D27ND54J.js';
11
+ import { a as a$7 } from '../../chunk-E5MGOPPQ.js';
10
12
  import { a as a$1 } from '../../chunk-YQ6K2DEP.js';
11
13
  import '../../chunk-CHLVIVDD.js';
12
14
  import { a as a$2 } from '../../chunk-ORYAES3Q.js';
13
- import { b } from '../../chunk-ILHUUK4X.js';
15
+ import { b as b$1 } from '../../chunk-ILHUUK4X.js';
14
16
  import { forwardRef, useState } from 'react';
15
- import X from '@mui/material/Button';
16
- import W from '@mui/material/Divider';
17
+ import ro from '@mui/material/Button';
18
+ import Do from '@mui/material/CircularProgress';
19
+ import V from '@mui/material/Divider';
17
20
  import p from '@mui/material/Stack';
18
- import x from '@mui/material/Typography';
19
- import go from '@mui/material/TablePagination';
21
+ import P from '@mui/material/Typography';
22
+ import Po from '@mui/material/TablePagination';
20
23
  import { styled, alpha } from '@mui/material/styles';
21
24
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
22
25
  import { GridToolbarFilterButton, GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
23
26
 
24
- var f="datagrid-actions";var N=styled(a,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:t})=>({position:"relative",borderRadius:12,padding:0,gap:0,overflow:"hidden",[o.breakpoints.down(t)]:{borderColor:alpha(o.palette.grey[500],.2)}})),O=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:t})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"24px 24px 0",gap:24,[o.breakpoints.down(t)]:{padding:"16px 16px 0"}})),_=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:t})=>({flexDirection:"row",alignItems:"center",gap:12,color:o.palette.text.secondary,[o.breakpoints.down(t)]:{"& button":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:0}}}})),V=styled(W)({borderStyle:"dashed",height:16,margin:"auto"}),h=styled(W)({borderStyle:"dashed",height:12,marginTop:"auto",marginBottom:"auto"}),j=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:t})=>({position:"relative",padding:16,flexDirection:"row",alignItems:"center",color:o.palette.text.secondary,[o.breakpoints.down(t)]:{padding:"12px 16px",borderBottom:`1px solid ${o.palette.divider}`,height:60,[o.breakpoints.down(t)]:{"& button":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:0}}}}})),$=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:t})=>({width:320,alignItems:"center",justifyContent:"center",[o.breakpoints.down(t)]:{width:36,height:36,"& fieldset, & input":{display:"none"},"& .MuiInputAdornment-root":{marginLeft:-14},"&:hover":{position:"absolute",left:0,width:"100%",padding:"0 12px","& fieldset, & input":{display:"flex"},"& .MuiInputAdornment-root":{marginLeft:0}}}})),Q=styled(p)({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden"}}),U=styled(p)(({theme:o})=>({height:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}`})),q=styled(p)(({theme:o})=>({flexDirection:"row",height:60,alignItems:"center",justifyContent:"space-between",borderTop:`1px solid ${o.palette.divider}`,gap:16,padding:16}));var fo=({count:o,page:t,rowsPerPage:b,onPageChange:c,onRowsPerPageChange:P})=>jsx(Q,{children:jsx(go,{color:"primary",component:"div",size:"small",count:o,page:t,rowsPerPage:b,onPageChange:(l,n)=>c(n),onRowsPerPageChange:l=>P(Number(l.target.value))})}),w=fo;var Y=forwardRef((o,t)=>jsx(X,{...o,ref:t,color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:"Colunas"}));Y.displayName="ColumnsButton";var Z=forwardRef((o,t)=>jsx(X,{...o,ref:t,color:"inherit",startIcon:jsx(a$1,{icon:"FILTER_VERTICAL"}),children:"Filtros"}));Z.displayName="FilterButton";var Po=({setFilterButtonEl:o})=>jsxs(a$6,{container:f,children:[jsx(GridToolbarFilterButton,{ref:o,slotProps:{button:{component:Z,color:"inherit"}}}),jsx(h,{orientation:"vertical",flexItem:!0}),jsx(GridToolbarColumnsButton,{slotProps:{button:{component:Y,color:"inherit"}}})]}),oo=Po;var Do=({title:o,breakpoint:t="md",columns:b$1,rows:c=[],mobileRender:P,rowCount:l=0,paginationModel:n={page:0,pageSize:25},onPaginationChange:m,actions:D,moreActions:T,onAdd:v,onSearch:I,searchValue:eo,onSearchChange:no,slots:io,slotProps:ao,loading:y,fetching:po,...so})=>{let u=a$2(),g=b("down",t),[lo,co]=useState(null),B=!!I,S=!!v,k=!!D,mo=k||S,A=!!T,M=A||B||!g;return jsxs(N,{breakpoint:t,flex:y?1:void 0,children:[jsxs(O,{breakpoint:t,children:[jsx(x,{variant:"overline",color:"text.secondary",noWrap:!0,children:o}),mo&&jsxs(_,{breakpoint:t,children:[k&&jsxs(Fragment,{children:[D,jsx(V,{orientation:"vertical",flexItem:!0})]}),S&&jsx(X,{startIcon:jsx(a$1,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:v,children:"Adicionar"})]})]}),M&&jsxs(j,{breakpoint:t,children:[jsx(p,{flex:1,direction:"row",alignItems:"center",id:f,gap:.5,children:A&&jsxs(Fragment,{children:[jsx(X,{color:"inherit",startIcon:jsx(a$1,{icon:"MORE_BOLD"}),size:"small",onClick:u.onOpen,children:"Mais"}),!g&&jsx(h,{orientation:"vertical",flexItem:!0}),jsx(a$3,{open:u.open,anchorEl:u.open,onClose:u.onClose,sx:{minWidth:160},disabledArrow:g,children:T})]})}),B&&jsx($,{breakpoint:t,children:jsx(a$4,{value:eo,placeholder:"Buscar",onSearch:I,onChange:e=>no?.(e.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]}),!M&&jsx(W,{sx:{mt:2}}),g?jsxs(Fragment,{children:[c.map(e=>P(e)),jsx(U,{children:jsx(w,{count:l,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>m(e,n.pageSize),onRowsPerPageChange:e=>m(n.page,e)})})]}):jsx(a$5,{columns:b$1,rows:c,slots:{toolbar:oo,footer:()=>jsxs(q,{children:[jsxs(p,{direction:"row",alignItems:"center",gap:.5,children:[jsx(x,{variant:"body2",color:"text.disabled",children:"Total de itens:"}),jsx(x,{variant:"body2",children:l})]}),jsx(w,{count:l,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>m(e,n.pageSize),onRowsPerPageChange:e=>m(n.page,e)})]}),...io},slotProps:{panel:{anchorEl:lo},toolbar:{setFilterButtonEl:co,showQuickFilter:!0},...ao},columnHeaderHeight:48,getRowHeight:()=>68,loading:y,fetching:po,...so})]})},et=Do;
27
+ var h="datagrid-actions";var $=styled(a,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({position:"relative",borderRadius:12,padding:0,gap:0,overflow:"hidden",[o.breakpoints.down(r)]:{borderColor:alpha(o.palette.grey[500],.2)}})),Q=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"24px 24px 0",gap:24,[o.breakpoints.down(r)]:{padding:"16px 16px 0"}})),U=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({flexDirection:"row",alignItems:"center",gap:12,color:o.palette.text.secondary,[o.breakpoints.down(r)]:{"& button":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:0}}}})),q=styled(V)({borderStyle:"dashed",height:16,margin:"auto"}),b=styled(V)({borderStyle:"dashed",height:12,marginTop:"auto",marginBottom:"auto"}),J=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({position:"relative",padding:16,flexDirection:"row",alignItems:"center",color:o.palette.text.secondary,[o.breakpoints.down(r)]:{padding:"12px 16px",borderBottom:`1px solid ${o.palette.divider}`,minHeight:60,[o.breakpoints.down(r)]:{"& button":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:0}}}}})),K=styled(p,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({width:320,alignItems:"center",justifyContent:"center",[o.breakpoints.down(r)]:{width:36,height:36,"& fieldset, & input":{display:"none"},"& .MuiInputAdornment-root":{marginLeft:-14},"&:hover":{position:"absolute",left:0,width:"100%",padding:"0 12px","& fieldset, & input":{display:"flex"},"& .MuiInputAdornment-root":{marginLeft:0}}}})),X=styled(p)({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden"}}),Y=styled(p)(({theme:o})=>({minHeight:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}`})),Z=styled(p)(({theme:o})=>({flexDirection:"row",height:60,alignItems:"center",justifyContent:"space-between",borderTop:`1px solid ${o.palette.divider}`,gap:16,padding:16}));var xo=({count:o,page:r,rowsPerPage:x,onPageChange:l,onRowsPerPageChange:w})=>jsx(X,{children:jsx(Po,{color:"primary",component:"div",size:"small",count:o,page:r,rowsPerPage:x,onPageChange:(m,n)=>l(n),onRowsPerPageChange:m=>w(Number(m.target.value))})}),y=xo;var eo=forwardRef((o,r)=>jsx(ro,{...o,ref:r,color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:"Colunas"}));eo.displayName="ColumnsButton";var no=forwardRef((o,r)=>jsx(ro,{...o,ref:r,color:"inherit",startIcon:jsx(a$1,{icon:"FILTER_VERTICAL"}),children:"Filtros"}));no.displayName="FilterButton";var yo=({setFilterButtonEl:o})=>jsxs(a$9,{container:h,children:[jsx(GridToolbarFilterButton,{ref:o,slotProps:{button:{component:no,color:"inherit"}}}),jsx(b,{orientation:"vertical",flexItem:!0}),jsx(GridToolbarColumnsButton,{slotProps:{button:{component:eo,color:"inherit"}}})]}),io=yo;var So=({title:o,breakpoint:r="md",columns:x,rows:l=[],mobileRender:w,rowCount:m=0,paginationModel:n={page:0,pageSize:25},onPaginationChange:g,actions:T,moreActions:D,onAdd:I,onSearch:S,searchValue:so,onSearchChange:lo,slots:C,slotProps:mo,loading:c,fetching:k,containerProps:co={height:562,maxHeight:562},...go})=>{let u=a$2(),f=b$1("down",r),[uo,fo]=useState(null),B=!!S,A=!!I,R=!!T,ho=R||A,F=!!D,H=F||B||!f;return jsxs($,{breakpoint:r,...co,flex:c?1:void 0,minHeight:!c&&l.length===0?562:void 0,children:[jsxs(Q,{breakpoint:r,children:[jsx(P,{variant:"overline",color:"text.secondary",noWrap:!0,children:o}),ho&&jsxs(U,{breakpoint:r,children:[R&&jsxs(Fragment,{children:[T,jsx(q,{orientation:"vertical",flexItem:!0})]}),A&&jsx(ro,{startIcon:jsx(a$1,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:I,children:"Adicionar"})]})]}),H&&jsxs(J,{breakpoint:r,children:[jsx(p,{flex:1,direction:"row",alignItems:"center",id:h,gap:.5,children:F&&jsxs(Fragment,{children:[jsx(ro,{color:"inherit",startIcon:jsx(a$1,{icon:"MORE_BOLD"}),size:"small",onClick:u.onOpen,children:"Mais"}),!f&&jsx(b,{orientation:"vertical",flexItem:!0}),jsx(a$3,{open:u.open,anchorEl:u.open,onClose:u.onClose,sx:{minWidth:160},disabledArrow:f,children:D})]})}),B&&jsx(K,{breakpoint:r,children:jsx(a$4,{value:so,placeholder:"Buscar",onSearch:S,onChange:e=>lo?.(e.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]}),!H&&jsx(V,{sx:{mt:2}}),f?jsxs(a$5,{isFetching:k,fetching:jsx(a$6,{}),isLoading:c,loading:jsx(Do,{sx:{m:"160px auto"}}),isEmpty:l.length===0,empty:jsx(p,{flex:1,alignItems:"center",justifyContent:"center",children:C?.noRowsOverlay?jsx(C.noRowsOverlay,{}):jsx(P,{variant:"body2",color:"text.secondary",children:"Nenhum registro encontrado"})}),children:[jsx(a$7,{fillContent:!0,children:l.map(e=>w(e))}),jsx(Y,{children:jsx(y,{count:m,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>g(e,n.pageSize),onRowsPerPageChange:e=>g(n.page,e)})})]}):jsx(a$8,{columns:x,rows:l,slots:{toolbar:io,footer:()=>jsxs(Z,{children:[jsxs(p,{direction:"row",alignItems:"center",gap:.5,children:[jsx(P,{variant:"body2",color:"text.disabled",children:"Total de itens:"}),jsx(P,{variant:"body2",children:m})]}),jsx(y,{count:m,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>g(e,n.pageSize),onRowsPerPageChange:e=>g(n.page,e)})]}),...C},slotProps:{panel:{anchorEl:uo},toolbar:{setFilterButtonEl:fo,showQuickFilter:!0},...mo},columnHeaderHeight:48,getRowHeight:()=>68,loading:c,fetching:k,...go})]},c?"loading":"data")},ct=So;
25
28
 
26
- export { et as default };
29
+ export { ct as default };
@@ -1,7 +1,7 @@
1
- export { a as default } from '../../chunk-FM5E5MVW.js';
2
- import '../../chunk-TWGGHTU5.js';
1
+ export { a as default } from '../../chunk-3IGXAQXD.js';
3
2
  import '../../chunk-4ZBE3RNR.js';
4
3
  import '../../chunk-MPKHVDQH.js';
4
+ import '../../chunk-TWGGHTU5.js';
5
5
  import '../../chunk-U26IUEAG.js';
6
6
  import '../../chunk-E5MGOPPQ.js';
7
7
  import '../../chunk-YQ6K2DEP.js';
@@ -1,6 +1,6 @@
1
- import { a as a$1 } from '../../chunk-TWGGHTU5.js';
2
1
  import { a as a$2 } from '../../chunk-4ZBE3RNR.js';
3
2
  import { a } from '../../chunk-MPKHVDQH.js';
3
+ import { a as a$1 } from '../../chunk-TWGGHTU5.js';
4
4
  import '../../chunk-U26IUEAG.js';
5
5
  import { a as a$3 } from '../../chunk-E5MGOPPQ.js';
6
6
  import { a as a$4 } from '../../chunk-YQ6K2DEP.js';
@@ -1,7 +1,7 @@
1
- import { a } from '../../../chunk-FM5E5MVW.js';
2
- import '../../../chunk-TWGGHTU5.js';
1
+ import { a } from '../../../chunk-3IGXAQXD.js';
3
2
  import '../../../chunk-4ZBE3RNR.js';
4
3
  import '../../../chunk-MPKHVDQH.js';
4
+ import '../../../chunk-TWGGHTU5.js';
5
5
  import '../../../chunk-U26IUEAG.js';
6
6
  import '../../../chunk-E5MGOPPQ.js';
7
7
  import '../../../chunk-YQ6K2DEP.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.4.62",
3
+ "version": "2.4.64",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,6 +1,6 @@
1
- import { a as a$3 } from './chunk-TWGGHTU5.js';
2
1
  import { a as a$4 } from './chunk-4ZBE3RNR.js';
3
2
  import { a as a$1 } from './chunk-MPKHVDQH.js';
3
+ import { a as a$3 } from './chunk-TWGGHTU5.js';
4
4
  import { a as a$2 } from './chunk-E5MGOPPQ.js';
5
5
  import { a as a$5 } from './chunk-YQ6K2DEP.js';
6
6
  import { useState } from 'react';