@zydon/common 2.5.19 → 2.5.21
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.
|
@@ -24,6 +24,6 @@ import { styled, alpha } from '@mui/material/styles';
|
|
|
24
24
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
25
25
|
import { GridToolbarFilterButton, GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
|
|
26
26
|
|
|
27
|
-
var P="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)}})),U=styled(d,{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"}})),Q=styled(d,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({flexDirection:"row",alignItems:"center",gap:12,color:o.palette.text.secondary,[o.breakpoints.down(r)]:{"& button, & a":{textIndent:"-9999em",fontSize:0,minWidth:36,maxWidth:36,height:36,width:36,overflow:"hidden","& .MuiButton-icon":{margin:0}}}})),q=styled(j)({borderStyle:"dashed",height:16,margin:"auto"}),b=styled(j)({borderStyle:"dashed",height:12,marginTop:"auto",marginBottom:"auto"}),J=styled(d,{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:"-9999em",fontSize:0,minWidth:36,maxWidth:36,height:36,width:36,overflow:"hidden","& .MuiButton-icon":{margin:0}}}}})),K=styled(d,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({width:320,alignItems:"center",justifyContent:"center",[o.breakpoints.down(r)]:{position:"absolute",left:0,width:"100%",padding:"0 12px",zIndex:1,"& fieldset, & input":{display:"flex"},"& .MuiInputAdornment-root":{marginLeft:0}}})),X=styled(d)(({theme:o})=>({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden",[o.breakpoints.down("sm")]:{height:"auto",flexWrap:"wrap",justifyContent:"center"}}})),Y=styled(d)(({theme:o})=>({minHeight:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}
|
|
27
|
+
var P="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)}})),U=styled(d,{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"}})),Q=styled(d,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({flexDirection:"row",alignItems:"center",gap:12,color:o.palette.text.secondary,[o.breakpoints.down(r)]:{"& button, & a":{textIndent:"-9999em",fontSize:0,minWidth:36,maxWidth:36,height:36,width:36,overflow:"hidden","& .MuiButton-icon":{margin:0}}}})),q=styled(j)({borderStyle:"dashed",height:16,margin:"auto"}),b=styled(j)({borderStyle:"dashed",height:12,marginTop:"auto",marginBottom:"auto"}),J=styled(d,{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:"-9999em",fontSize:0,minWidth:36,maxWidth:36,height:36,width:36,overflow:"hidden","& .MuiButton-icon":{margin:0}}}}})),K=styled(d,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:r})=>({width:320,alignItems:"center",justifyContent:"center",[o.breakpoints.down(r)]:{position:"absolute",left:0,width:"100%",padding:"0 12px",zIndex:1,"& fieldset, & input":{display:"flex"},"& .MuiInputAdornment-root":{marginLeft:0}}})),X=styled(d)(({theme:o})=>({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden",[o.breakpoints.down("sm")]:{height:"auto",flexWrap:"wrap",justifyContent:"center"}}})),Y=styled(d)(({theme:o})=>({minHeight:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}`,[o.breakpoints.down("sm")]:{minHeight:"auto"}})),Z=styled(d)(({theme:o})=>({flexDirection:"row",height:60,alignItems:"center",justifyContent:"space-between",borderTop:`1px solid ${o.palette.divider}`,gap:16,padding:16}));var Po=({count:o,page:r,rowsPerPage:l,onPageChange:m,onRowsPerPageChange:w})=>jsx(X,{children:jsx(ho,{color:"primary",component:"div",size:"small",count:o,page:r,rowsPerPage:l,onPageChange:(c,n)=>m(n),onRowsPerPageChange:c=>w(Number(c.target.value))})}),y=Po;var wo=forwardRef(({children:o,...r},l)=>jsx(ro,{...r,ref:l,color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:o??"Colunas"}));wo.displayName="ColumnsButton";var Co=forwardRef(({children:o,...r},l)=>jsx(ro,{...r,ref:l,color:"inherit",startIcon:jsx(a$1,{icon:"FILTER_VERTICAL"}),children:o??"Filtros"}));Co.displayName="FilterButton";var vo=({setFilterButtonEl:o})=>jsxs(a$2,{container:P,children:[jsx(GridToolbarFilterButton,{ref:o,slotProps:{button:{color:"inherit",startIcon:jsx(a$1,{icon:"FILTER_VERTICAL"}),children:"Filtros"}}}),jsx(b,{orientation:"vertical",flexItem:!0}),jsx(GridToolbarColumnsButton,{slotProps:{button:{color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:"Colunas"}}})]}),eo=vo;var So=({title:o,breakpoint:r="md",columns:l,rows:m=[],mobileRender:w,rowCount:c=0,paginationModel:n={page:0,pageSize:25},onPaginationChange:g,actions:T,moreActions:D,onAdd:S,onSearch:B,searchValue:ao,onSearchChange:po,slots:C,slotProps:so,loading:u,fetching:k,containerProps:lo={height:562,maxHeight:562},...mo})=>{let f=a$3(),h=b$1("down",r),[co,uo]=useState(null),A=!!B,v=!!S,R=!!T,go=R||v,F=!!D,H=F||A||!h;return jsxs($,{breakpoint:r,...lo,flex:u?1:void 0,minHeight:!u&&m.length===0?562:void 0,children:[jsxs(U,{breakpoint:r,children:[jsx(x,{variant:"overline",color:"text.secondary",noWrap:!0,children:o}),go&&jsxs(Q,{breakpoint:r,children:[R&&jsxs(Fragment,{children:[T,v&&jsx(q,{orientation:"vertical",flexItem:!0})]}),v&&jsx(ro,{startIcon:jsx(a$1,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:S,children:"Adicionar"})]})]}),H&&jsxs(J,{breakpoint:r,children:[jsx(d,{flex:1,direction:"row",alignItems:"center",id:P,gap:.5,children:F&&jsxs(Fragment,{children:[jsx(ro,{color:"inherit",startIcon:jsx(a$1,{icon:"MORE_BOLD"}),size:"small",onClick:f.onOpen,children:"Mais"}),!h&&jsx(b,{orientation:"vertical",flexItem:!0}),jsx(a$4,{open:f.open,anchorEl:f.open,onClose:f.onClose,sx:{minWidth:160},disabledArrow:h,children:D})]})}),A&&jsx(K,{breakpoint:r,children:jsx(a$5,{value:ao,placeholder:"Buscar",onSearch:B,onChange:e=>po?.(e.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]}),!H&&jsx(j,{sx:{mt:2}}),h?jsxs(a$6,{isFetching:k,fetching:jsx(a$7,{}),isLoading:u,loading:jsx(To,{sx:{m:"160px auto"}}),isEmpty:m.length===0,empty:jsx(d,{flex:1,alignItems:"center",justifyContent:"center",children:C?.noRowsOverlay?jsx(C.noRowsOverlay,{}):jsx(x,{variant:"body2",color:"text.secondary",children:"Nenhum registro encontrado"})}),children:[jsx(a$8,{fillContent:!0,children:m.map(e=>w(e))}),jsx(Y,{children:jsx(y,{count:c,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>g(e,n.pageSize),onRowsPerPageChange:e=>g(n.page,e)})})]}):jsx(a$9,{columns:l,rows:m,slots:{toolbar:eo,footer:()=>jsxs(Z,{children:[jsxs(d,{direction:"row",alignItems:"center",gap:.5,children:[jsx(x,{variant:"body2",color:"text.disabled",children:"Total de itens:"}),jsx(x,{variant:"body2",children:c})]}),jsx(y,{count:c,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>g(e,n.pageSize),onRowsPerPageChange:e=>g(n.page,e)})]}),...C},slotProps:{panel:{anchorEl:co},toolbar:{setFilterButtonEl:uo,showQuickFilter:!0},...so},columnHeaderHeight:48,getRowHeight:()=>68,loading:u,fetching:k,...mo})]},u?"loading":"data")},ut=So;
|
|
28
28
|
|
|
29
29
|
export { Q as ActionsContainer, q as ActionsDivider, $ as Container, Z as DesktopPaginationContainer, U as Header, Y as MobilePaginationContainer, K as SearchContainer, eo as Toolbar, b as ToolbarActionsDivider, J as Topbar, ut as default };
|