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