@zydon/common 2.4.60 → 2.4.62

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.
@@ -17,6 +17,6 @@ interface DataViewProps extends DataGridProps {
17
17
  onSearchChange?: (value: string) => void;
18
18
  }
19
19
 
20
- declare const DataView: ({ title, breakpoint, columns, rows, mobileRender, rowCount, paginationModel, onPaginationChange, actions, moreActions, onAdd, onSearch, searchValue, onSearchChange, slots, slotProps, ...others }: DataViewProps) => react_jsx_runtime.JSX.Element;
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;
21
21
 
22
22
  export { DataView as default };
@@ -12,15 +12,15 @@ import '../../chunk-CHLVIVDD.js';
12
12
  import { a as a$2 } from '../../chunk-ORYAES3Q.js';
13
13
  import { b } from '../../chunk-ILHUUK4X.js';
14
14
  import { forwardRef, useState } from 'react';
15
- import K from '@mui/material/Button';
16
- import z from '@mui/material/Divider';
15
+ import X from '@mui/material/Button';
16
+ import W from '@mui/material/Divider';
17
17
  import p from '@mui/material/Stack';
18
18
  import x from '@mui/material/Typography';
19
- import co from '@mui/material/TablePagination';
19
+ import go from '@mui/material/TablePagination';
20
20
  import { styled, alpha } from '@mui/material/styles';
21
21
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
22
22
  import { GridToolbarFilterButton, GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
23
23
 
24
- var f="datagrid-actions";var W=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)}})),N=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"}})),O=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}}}})),_=styled(z)({borderStyle:"dashed",height:16,margin:"auto"}),h=styled(z)({borderStyle:"dashed",height:12,marginTop:"auto",marginBottom:"auto"}),V=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}}}}})),j=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}}}})),$=styled(p)({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden"}}),Q=styled(p)(({theme:o})=>({height:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}`})),U=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:t,rowsPerPage:b,onPageChange:m,onRowsPerPageChange:P})=>jsx($,{children:jsx(co,{color:"primary",component:"div",size:"small",count:o,page:t,rowsPerPage:b,onPageChange:(l,n)=>m(n),onRowsPerPageChange:l=>P(Number(l.target.value))})}),w=uo;var X=forwardRef((o,t)=>jsx(K,{...o,ref:t,color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:"Colunas"}));X.displayName="ColumnsButton";var Y=forwardRef((o,t)=>jsx(K,{...o,ref:t,color:"inherit",startIcon:jsx(a$1,{icon:"FILTER_VERTICAL"}),children:"Filtros"}));Y.displayName="FilterButton";var ho=({setFilterButtonEl:o})=>jsxs(a$6,{container:f,children:[jsx(GridToolbarFilterButton,{ref:o,slotProps:{button:{component:Y,color:"inherit"}}}),jsx(h,{orientation:"vertical",flexItem:!0}),jsx(GridToolbarColumnsButton,{slotProps:{button:{component:X,color:"inherit"}}})]}),Z=ho;var xo=({title:o,breakpoint:t="md",columns:b$1,rows:m=[],mobileRender:P,rowCount:l=0,paginationModel:n={page:0,pageSize:25},onPaginationChange:c,actions:D,moreActions:T,onAdd:v,onSearch:I,searchValue:ro,onSearchChange:eo,slots:no,slotProps:io,...ao})=>{let u=a$2(),g=b("down",t),[po,so]=useState(null),y=!!I,B=!!v,S=!!D,lo=S||B,k=!!T,A=k||y||!g;return jsxs(W,{breakpoint:t,children:[jsxs(N,{breakpoint:t,children:[jsx(x,{variant:"overline",color:"text.secondary",noWrap:!0,children:o}),lo&&jsxs(O,{breakpoint:t,children:[S&&jsxs(Fragment,{children:[D,jsx(_,{orientation:"vertical",flexItem:!0})]}),B&&jsx(K,{startIcon:jsx(a$1,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:v,children:"Adicionar"})]})]}),A&&jsxs(V,{breakpoint:t,children:[jsx(p,{flex:1,direction:"row",alignItems:"center",id:f,gap:.5,children:k&&jsxs(Fragment,{children:[jsx(K,{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})]})}),y&&jsx(j,{breakpoint:t,children:jsx(a$4,{value:ro,placeholder:"Buscar",onSearch:I,onChange:e=>eo?.(e.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]}),!A&&jsx(z,{sx:{mt:2}}),g?jsxs(Fragment,{children:[m.map(e=>P(e)),jsx(Q,{children:jsx(w,{count:l,page:n.page,rowsPerPage:n.pageSize,onPageChange:e=>c(e,n.pageSize),onRowsPerPageChange:e=>c(n.page,e)})})]}):jsx(a$5,{columns:b$1,rows:m,slots:{toolbar:Z,footer:()=>jsxs(U,{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=>c(e,n.pageSize),onRowsPerPageChange:e=>c(n.page,e)})]}),...no},slotProps:{panel:{anchorEl:po},toolbar:{setFilterButtonEl:so,showQuickFilter:!0},...io},columnHeaderHeight:48,getRowHeight:()=>68,...ao})]})},tt=xo;
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;
25
25
 
26
- export { tt as default };
26
+ export { et as default };
@@ -443,7 +443,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
443
443
  wordWrap?: csstype.Property.WordWrap | readonly NonNullable<csstype.Property.WordWrap | undefined>[] | readonly csstype.Property.WordWrap[] | undefined;
444
444
  writingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
445
445
  zIndex?: csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto")[] | undefined;
446
- zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | undefined;
446
+ zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
447
447
  all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
448
448
  animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "auto" | "none" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
449
449
  animationRange?: csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.4.60",
3
+ "version": "2.4.62",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",