@zydon/common 2.4.64 → 2.4.66
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,8 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ElementType } from 'react';
|
|
2
3
|
import { LoadingButtonProps } from '@mui/lab/LoadingButton';
|
|
3
4
|
|
|
4
5
|
type ActionButtonProps = {
|
|
5
6
|
actionType: 'SAVE' | 'NEW' | 'CREATE' | 'SETTINGS' | 'EDIT' | 'DELETE' | 'VIEW' | 'CANCEL';
|
|
7
|
+
component?: ElementType;
|
|
8
|
+
to?: string;
|
|
6
9
|
} & LoadingButtonProps;
|
|
7
10
|
|
|
8
11
|
declare const ActionButton: ({ actionType, children, ...other }: ActionButtonProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -15,15 +15,15 @@ import { a as a$2 } from '../../chunk-ORYAES3Q.js';
|
|
|
15
15
|
import { b as b$1 } from '../../chunk-ILHUUK4X.js';
|
|
16
16
|
import { forwardRef, useState } from 'react';
|
|
17
17
|
import ro from '@mui/material/Button';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
18
|
+
import vo from '@mui/material/CircularProgress';
|
|
19
|
+
import $ from '@mui/material/Divider';
|
|
20
|
+
import d from '@mui/material/Stack';
|
|
21
|
+
import x from '@mui/material/Typography';
|
|
22
|
+
import ho 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 { GridToolbarFilterButton, GridToolbarColumnsButton } from '@mui/x-data-grid-premium';
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var P="datagrid-actions";var j=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":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:0}}}})),q=styled($)({borderStyle:"dashed",height:16,margin:"auto"}),b=styled($)({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:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .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)]:{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(d)({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden"}}),Y=styled(d)(({theme:o})=>({minHeight:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}`})),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:C})=>jsx(X,{children:jsx(ho,{color:"primary",component:"div",size:"small",count:o,page:r,rowsPerPage:l,onPageChange:(c,n)=>m(n),onRowsPerPageChange:c=>C(Number(c.target.value))})}),y=Po;var Co=forwardRef(({children:o,...r},l)=>jsx(ro,{...r,ref:l,color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:o??"Colunas"}));Co.displayName="ColumnsButton";var wo=forwardRef(({children:o,...r},l)=>jsx(ro,{...r,ref:l,color:"inherit",startIcon:jsx(a$1,{icon:"FILTER_VERTICAL"}),children:o??"Filtros"}));wo.displayName="FilterButton";var yo=({setFilterButtonEl:o})=>jsxs(a$9,{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=yo;var Bo=({title:o,breakpoint:r="md",columns:l,rows:m=[],mobileRender:C,rowCount:c=0,paginationModel:n={page:0,pageSize:25},onPaginationChange:g,actions:T,moreActions:v,onAdd:D,onSearch:B,searchValue:ao,onSearchChange:po,slots:w,slotProps:so,loading:u,fetching:S,containerProps:lo={height:562,maxHeight:562},...mo})=>{let f=a$2(),h=b$1("down",r),[co,uo]=useState(null),k=!!B,A=!!D,R=!!T,go=R||A,F=!!v,E=F||k||!h;return jsxs(j,{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,jsx(q,{orientation:"vertical",flexItem:!0})]}),A&&jsx(ro,{startIcon:jsx(a$1,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:D,children:"Adicionar"})]})]}),E&&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$3,{open:f.open,anchorEl:f.open,onClose:f.onClose,sx:{minWidth:160},disabledArrow:h,children:v})]})}),k&&jsx(K,{breakpoint:r,children:jsx(a$4,{value:ao,placeholder:"Buscar",onSearch:B,onChange:e=>po?.(e.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]}),!E&&jsx($,{sx:{mt:2}}),h?jsxs(a$5,{isFetching:S,fetching:jsx(a$6,{}),isLoading:u,loading:jsx(vo,{sx:{m:"160px auto"}}),isEmpty:m.length===0,empty:jsx(d,{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$7,{fillContent:!0,children:m.map(e=>C(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$8,{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)})]}),...w},slotProps:{panel:{anchorEl:co},toolbar:{setFilterButtonEl:uo,showQuickFilter:!0},...so},columnHeaderHeight:48,getRowHeight:()=>68,loading:u,fetching:S,...mo})]},u?"loading":"data")},ut=Bo;
|
|
28
28
|
|
|
29
|
-
export {
|
|
29
|
+
export { ut as default };
|
|
@@ -9,6 +9,6 @@ import R from '@mui/material/Button';
|
|
|
9
9
|
import { styled, alpha } from '@mui/material/styles';
|
|
10
10
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
|
-
var x=styled(i)(({theme:t})=>({backgroundColor:"#fff",minWidth:300,flex:1,borderRight:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{display:"none"}})),S=styled(i)({position:"sticky",top:"calc(var(--sticky-header-height, 64px))",height:"calc(100vh - var(--sticky-header-height, 64px))"}),b=styled(i)(({theme:t})=>({position:"sticky",top:"var(--sticky-header-height, 64px)",flexDirection:"row",alignItems:"center",backgroundColor:"#fff",zIndex:999,width:"100%",padding:"12px 24px",height:64,gap:12,borderBottom:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{padding:"14px 16px",gap:6}})),k=styled(R)(({theme:t})=>({height:50,background:"none",fontSize:13,fontWeight:400,justifyContent:"flex-start",padding:"12px 8px",color:t.palette.text.secondary,borderBottom:`1px dashed ${alpha(t.palette.grey[500],.2)}`,borderRadius:0,gap:4,"&:hover":{backgroundColor:"transparent"},"& .required":{color:t.palette.error.main}})),p=styled(i)(({theme:t})=>({flex:1,flexDirection:"row",alignItems:"center",gap:24,"&.header-left-content":{justifyContent:"flex-start",marginLeft:12},[t.breakpoints.down("md")]:{gap:8,flex:"initial","& button":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:"auto"}},"&.header-left-content":{justifyContent:"flex-end",marginLeft:"auto",marginRight:-6,"& label":{marginRight:0},"& .MuiTypography-root":{display:"none"}}}})),y=styled(i)(({theme:t})=>({flex:1,width:"100%",padding:24,gap:24,alignItems:"center",[t.breakpoints.down("md")]:{padding:"24px 16px"}})),u=styled(i)(({theme:t})=>({alignItems:"start",width:"100%",maxWidth:700,[t.breakpoints.down("md")]:{maxWidth:"100%"}})),C=styled(a)(({theme:t})=>({width:"100%",borderRadius:12,gap:12,[t.breakpoints.down("md")]:{padding:"24px 16px"}})),w=styled(d)(({theme:t})=>({color:t.palette.grey[800],fontSize:18,fontWeight:700})),T=styled(d)(({theme:t})=>({color:t.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24}));var H=({title:t,subtitle:l,sections:c,headerLeftContent:v,headerRightContent:I,onClickBack:W})=>jsxs(i,{direction:"row",flex:1,children:[jsx(x,{id:"frame-skeleton-left-box",children:jsx(S,{children:jsx(a$1,{fillContent:!0,sx:{p:3},children:jsxs(i,{gap:1.5,children:[jsx(d,{variant:"overline",color:"text.disabled",fontWeight:700,pl:1,children:"ACESSO R\xC1PIDO"}),jsx(i,{children:c.map(o=>jsxs(k,{onClick:()=>{o.ref.current&&o.ref.current.scrollIntoView({block:"center",behavior:"smooth"});},children:[o.title,o.isRequired&&jsx("span",{className:"required",children:"*"})]},o.title))})]})})})}),jsxs(i,{width:"100%",alignItems:"center",mb:8,children:[jsxs(b,{children:[jsx(a$2,{color:"inherit",onClick:()=>W(),label:"Voltar","data-testid":"backToPreviousPage",children:jsx(a$3,{icon:"CHEVRON_LEFT"})}),jsxs(i,{overflow:"hidden",children:[jsx(d,{variant:"subtitle1",noWrap:!0,children:t}),l&&jsx(d,{variant:"caption",color:"text.secondary",noWrap:!0,children:l})]}),jsx(p,{className:"header-left-content",children:v}),jsx(p,{justifyContent:"flex-end",color:"text.secondary",children:I})]}),jsx(y,{children:c.map((o,B)=>jsxs(u,{id:`section-${B}`,children:[jsx(w,{ref:o.ref,children:o.title}),jsx(T,{children:o.subTitle}),jsx(C,{children:o.child})]},o.title))})]})]}),A=H;
|
|
12
|
+
var x=styled(i)(({theme:t})=>({backgroundColor:"#fff",minWidth:300,flex:1,borderRight:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{display:"none"}})),S=styled(i)({position:"sticky",top:"calc(var(--sticky-header-height, 64px))",height:"calc(100vh - var(--sticky-header-height, 64px))"}),b=styled(i)(({theme:t})=>({position:"sticky",top:"var(--sticky-header-height, 64px)",flexDirection:"row",alignItems:"center",backgroundColor:"#fff",zIndex:999,width:"100%",padding:"12px 24px",height:64,gap:12,borderBottom:`1px solid ${t.palette.grey[200]}`,[t.breakpoints.down("md")]:{padding:"14px 16px",gap:6}})),k=styled(R)(({theme:t})=>({height:50,background:"none",fontSize:13,fontWeight:400,justifyContent:"flex-start",padding:"12px 8px",color:t.palette.text.secondary,borderBottom:`1px dashed ${alpha(t.palette.grey[500],.2)}`,borderRadius:0,gap:4,"&:hover":{backgroundColor:"transparent"},"& .required":{color:t.palette.error.main}})),p=styled(i)(({theme:t})=>({flex:1,flexDirection:"row",alignItems:"center",gap:24,"&.header-left-content":{justifyContent:"flex-start",marginLeft:12},[t.breakpoints.down("md")]:{gap:8,flex:"initial","& button, & a":{textIndent:"-9999px",minWidth:36,maxWidth:36,height:36,width:36,"& .MuiButton-icon":{margin:"auto"}},"&.header-left-content":{justifyContent:"flex-end",marginLeft:"auto",marginRight:-6,"& label":{marginRight:0},"& .MuiTypography-root":{display:"none"}}}})),y=styled(i)(({theme:t})=>({flex:1,width:"100%",padding:24,gap:24,alignItems:"center",[t.breakpoints.down("md")]:{padding:"24px 16px"}})),u=styled(i)(({theme:t})=>({alignItems:"start",width:"100%",maxWidth:700,[t.breakpoints.down("md")]:{maxWidth:"100%"}})),C=styled(a)(({theme:t})=>({width:"100%",borderRadius:12,gap:12,[t.breakpoints.down("md")]:{padding:"24px 16px"}})),w=styled(d)(({theme:t})=>({color:t.palette.grey[800],fontSize:18,fontWeight:700})),T=styled(d)(({theme:t})=>({color:t.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24}));var H=({title:t,subtitle:l,sections:c,headerLeftContent:v,headerRightContent:I,onClickBack:W})=>jsxs(i,{direction:"row",flex:1,children:[jsx(x,{id:"frame-skeleton-left-box",children:jsx(S,{children:jsx(a$1,{fillContent:!0,sx:{p:3},children:jsxs(i,{gap:1.5,children:[jsx(d,{variant:"overline",color:"text.disabled",fontWeight:700,pl:1,children:"ACESSO R\xC1PIDO"}),jsx(i,{children:c.map(o=>jsxs(k,{onClick:()=>{o.ref.current&&o.ref.current.scrollIntoView({block:"center",behavior:"smooth"});},children:[o.title,o.isRequired&&jsx("span",{className:"required",children:"*"})]},o.title))})]})})})}),jsxs(i,{width:"100%",alignItems:"center",mb:8,children:[jsxs(b,{children:[jsx(a$2,{color:"inherit",onClick:()=>W(),label:"Voltar","data-testid":"backToPreviousPage",children:jsx(a$3,{icon:"CHEVRON_LEFT"})}),jsxs(i,{overflow:"hidden",children:[jsx(d,{variant:"subtitle1",noWrap:!0,children:t}),l&&jsx(d,{variant:"caption",color:"text.secondary",noWrap:!0,children:l})]}),jsx(p,{className:"header-left-content",children:v}),jsx(p,{justifyContent:"flex-end",color:"text.secondary",children:I})]}),jsx(y,{children:c.map((o,B)=>jsxs(u,{id:`section-${B}`,children:[jsx(w,{ref:o.ref,children:o.title}),jsx(T,{children:o.subTitle}),jsx(C,{children:o.child})]},o.title))})]})]}),A=H;
|
|
13
13
|
|
|
14
14
|
export { A as default };
|