@zydon/common 2.0.53 → 2.0.54

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,6 @@ import F from '@mui/material/Skeleton';
10
10
  import L from '@mui/material/Stack';
11
11
  import { styled } from '@mui/material/styles';
12
12
 
13
- var D=({showToolbar:t,disableExport:r,setFilterButtonEl:i,toolbarContent:l})=>{if(t)return jsxs(GridToolbarContainer,{children:[jsx(GridToolbarColumnsButton,{slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarFilterButton,{ref:i,slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarDensitySelector,{slotProps:{button:{color:"inherit"}}}),!r&&jsx(GridToolbarExport,{slotProps:{button:{color:"inherit"}}}),jsx(R,{sx:{flexGrow:1}}),l]})},S=D;var y=styled(R)({display:"flex",flexDirection:"row",alignItems:"center",padding:"0 16px"}),A=()=>{let t=useGridApiContext(),{rowHeight:r,paginationModel:i,initialState:l}=useGridRootProps(),s=i?.pageSize||l?.pagination?.paginationModel?.pageSize||10,d=gridColumnsTotalWidthSelector(t),m=gridColumnPositionsSelector(t),h=x.useMemo(()=>m.filter(o=>o<=d).length,[d,m]),p=t.current.getVisibleColumns().slice(0,h),n=p.length>0?p:[{field:"fake01",headerName:"",computedWidth:100},{field:"fake02",headerName:"",computedWidth:100},{field:"fake03",headerName:"",computedWidth:100},{field:"fake04",headerName:"",computedWidth:100},{field:"fake05",headerName:"",computedWidth:100}],g=x.useMemo(()=>{let o=[];for(let e=0;e<s;e+=1){for(let u of n)o.push(jsx(y,{sx:{justifyContent:u.align},children:jsx(F,{width:"100%"})},`column-${e}-${u.field}`));o.push(jsx(y,{},`fill-${e}`));}return o},[s,n]);return jsx(L,{display:"grid",sx:{display:"grid",gridTemplateColumns:`${n.map(({computedWidth:o})=>`${o}px`).join(" ")} 1fr`,gridAutoRows:r,backgroundColor:"#fff",overflow:"hidden",maxHeight:"100%"},children:g})},G=A;var U=({columns:t,rows:r=[],loading:i,fetching:l,hideFooter:s,sx:d,showToolbar:m,disableExport:h,columnHeaderHeight:p=56,rowHeight:n=76,rowSpacingType:g="margin",getRowSpacing:o=()=>({top:0,bottom:0}),autoHeight:e=!1,toolbarContent:u,...k})=>{let[P,T]=useState(null),w=[{...GRID_CHECKBOX_SELECTION_COL_DEF,width:71},...t];return jsxs(Fragment,{children:[l&&jsx(a,{sx:{zIndex:1}}),jsx(DataGridPremium,{columns:w,rows:r,loading:i,autoHeight:e,hideFooter:r.length===0?!0:s,rowHeight:n,columnHeaderHeight:p,getRowSpacing:o,rowSpacingType:g,slots:{toolbar:S,noRowsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),noResultsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),loadingOverlay:G},slotProps:{panel:{anchorEl:P},toolbar:{setFilterButtonEl:T,showQuickFilter:!0,disableExport:h,showToolbar:m,toolbarContent:u}},sx:d,...k})]})},go=U;
13
+ var H=({showToolbar:t,disableExport:r,setFilterButtonEl:i,toolbarContent:l})=>{if(t)return jsxs(GridToolbarContainer,{children:[jsx(GridToolbarColumnsButton,{slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarFilterButton,{ref:i,slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarDensitySelector,{slotProps:{button:{color:"inherit"}}}),!r&&jsx(GridToolbarExport,{slotProps:{button:{color:"inherit"}}}),jsx(R,{sx:{flexGrow:1}}),l]})},S=H;var y=styled(R)({display:"flex",flexDirection:"row",alignItems:"center",padding:"0 16px"}),A=()=>{let t=useGridApiContext(),{rowHeight:r,paginationModel:i,initialState:l}=useGridRootProps(),d=i?.pageSize||l?.pagination?.paginationModel?.pageSize||10,m=gridColumnsTotalWidthSelector(t),p=gridColumnPositionsSelector(t),h=x.useMemo(()=>p.filter(o=>o<=m).length,[m,p]),n=t.current.getVisibleColumns().slice(0,h),a=n.length>1?n:[...n,{field:"fake01",headerName:"",computedWidth:100},{field:"fake02",headerName:"",computedWidth:100},{field:"fake03",headerName:"",computedWidth:100},{field:"fake04",headerName:"",computedWidth:100}],g=x.useMemo(()=>{let o=[];for(let e=0;e<d;e+=1){for(let u of a)o.push(jsx(y,{sx:{justifyContent:u.align},children:jsx(F,{width:"100%"})},`column-${e}-${u.field}`));o.push(jsx(y,{},`fill-${e}`));}return o},[d,a]);return jsx(L,{display:"grid",sx:{display:"grid",gridTemplateColumns:`${a.map(({computedWidth:o})=>`${o}px`).join(" ")} 1fr`,gridAutoRows:r,backgroundColor:"#fff",overflow:"hidden",maxHeight:"100%"},children:g})},G=A;var U=({columns:t,rows:r=[],loading:i,fetching:l,hideFooter:d,sx:m,showToolbar:p,disableExport:h,columnHeaderHeight:n=56,rowHeight:a$2=76,rowSpacingType:g="margin",getRowSpacing:o=()=>({top:0,bottom:0}),autoHeight:e=!1,toolbarContent:u,...P})=>{let[T,k]=useState(null),w=[{...GRID_CHECKBOX_SELECTION_COL_DEF,width:71},...t];return jsxs(Fragment,{children:[l&&jsx(a,{sx:{zIndex:1}}),jsx(DataGridPremium,{columns:w,rows:r,loading:i,autoHeight:e,hideFooter:r.length===0?!0:d,rowHeight:a$2,columnHeaderHeight:n,getRowSpacing:o,rowSpacingType:g,slots:{toolbar:S,noRowsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),noResultsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),loadingOverlay:G},slotProps:{panel:{anchorEl:T},toolbar:{setFilterButtonEl:k,showQuickFilter:!0,disableExport:h,showToolbar:p,toolbarContent:u}},sx:m,...P})]})},go=U;
14
14
 
15
15
  export { go as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.0.53",
3
+ "version": "2.0.54",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",