@zydon/common 2.5.52 → 2.5.53
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.
|
@@ -58,6 +58,6 @@ declare const DesktopPaginationContainer: _emotion_styled.StyledComponent<_mui_m
|
|
|
58
58
|
|
|
59
59
|
declare const Toolbar: () => react_jsx_runtime.JSX.Element;
|
|
60
60
|
|
|
61
|
-
declare const DataView: ({ title, breakpoint, columns, rows, mobileRender, rowCount, paginationModel, onPaginationChange, actions, moreActions, onAdd, onSearch, searchValue, onSearchChange, slots, slotProps, loading, fetching, containerProps, ...others }: DataViewProps) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare const DataView: ({ title, breakpoint, columns, rows, mobileRender, rowCount, paginationModel, onPaginationChange, actions, moreActions, onAdd, onSearch, searchValue, onSearchChange, slots, slotProps, loading, fetching, containerProps, hideFooter, ...others }: DataViewProps) => react_jsx_runtime.JSX.Element;
|
|
62
62
|
|
|
63
63
|
export { ActionsContainer, ActionsDivider, Container, DesktopPaginationContainer, Header, MobilePaginationContainer, SearchContainer, Toolbar, ToolbarActionsDivider, Topbar, DataView as default };
|
|
@@ -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
|
|
18
|
-
import
|
|
19
|
-
import
|
|
17
|
+
import eo from '@mui/material/Button';
|
|
18
|
+
import vo from '@mui/material/CircularProgress';
|
|
19
|
+
import V from '@mui/material/Divider';
|
|
20
20
|
import p from '@mui/material/Stack';
|
|
21
21
|
import x from '@mui/material/Typography';
|
|
22
|
-
import
|
|
22
|
+
import uo 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
|
|
27
|
+
var P="datagrid-actions";var $=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)}})),U=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"}})),Q=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(V)({borderStyle:"dashed",height:16,margin:"auto"}),J=styled(V)({borderStyle:"dashed",height:12,marginTop:"auto",marginBottom:"auto"}),K=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}}}}})),X=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}}})),Y=styled(p)(({theme:o})=>({"& .MuiToolbar-root":{height:24,minHeight:24,overflow:"hidden",[o.breakpoints.down("sm")]:{height:"auto",flexWrap:"wrap",justifyContent:"center"}}})),Z=styled(p)(({theme:o})=>({minHeight:60,alignItems:"flex-end",justifyContent:"center",borderTop:`1px solid ${o.palette.divider}`,[o.breakpoints.down("sm")]:{minHeight:"auto"}})),oo=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:e,rowsPerPage:m,onPageChange:s,onRowsPerPageChange:b})=>jsx(Y,{children:jsx(uo,{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=fo;var bo=forwardRef(({children:o,...e},m)=>jsx(eo,{...e,ref:m,color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:o??"Colunas"}));bo.displayName="ColumnsButton";var wo=()=>jsx(a$2,{container:P,children:jsx(GridToolbarColumnsButton,{slotProps:{button:{color:"inherit",startIcon:jsx(a$1,{icon:"COLUMNS"}),children:"Colunas"}}})}),Co=wo;var So=({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:no,onSearchChange:io,slots:w,slotProps:ao,loading:c,fetching:T,containerProps:po={height:562,maxHeight:562},hideFooter:B,...so})=>{let f=a$3(),h=b("down",e),[lo,mo]=useState(null),A=!!k,C=!!I,R=!!D,co=R||C,H=!!S,M=H||A||!h;return jsxs($,{breakpoint:e,...po,flex:c?1:void 0,minHeight:!c&&s.length===0?562:void 0,children:[jsxs(U,{breakpoint:e,children:[jsx(x,{variant:"overline",color:"text.secondary",noWrap:!0,children:o}),co&&jsxs(Q,{breakpoint:e,children:[R&&jsxs(Fragment,{children:[D,C&&jsx(q,{orientation:"vertical",flexItem:!0})]}),C&&jsx(eo,{startIcon:jsx(a$1,{icon:"SIMPLE_ADD"}),variant:"contained",onClick:I,children:"Adicionar"})]})]}),M&&jsxs(K,{breakpoint:e,children:[jsx(p,{flex:1,direction:"row",alignItems:"center",id:P,gap:.5,children:H&&jsxs(Fragment,{children:[jsx(eo,{color:"inherit",startIcon:jsx(a$1,{icon:"MORE_BOLD"}),size:"small",onClick:f.onOpen,children:"Mais"}),!h&&jsx(J,{orientation:"vertical",flexItem:!0}),jsx(a$4,{open:f.open,anchorEl:f.open,onClose:f.onClose,sx:{minWidth:160},disabledArrow:h,children:S})]})}),A&&jsx(X,{breakpoint:e,children:jsx(a$5,{value:no,placeholder:"Buscar",onSearch:k,onChange:r=>io?.(r.target.value),size:"small",fullWidth:!0,iconPosition:"start"})})]}),!M&&jsx(V,{sx:{mt:2}}),h?jsxs(a$6,{isFetching:T,fetching:jsx(a$7,{}),isLoading:c,loading:jsx(vo,{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))}),!B&&jsx(Z,{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(oo,{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:lo},toolbar:{setFilterButtonEl:mo,showQuickFilter:!0},...ao},columnHeaderHeight:48,getRowHeight:()=>68,loading:c,fetching:T,hideFooter:B,...so})]},c?"loading":"data")},dt=So;
|
|
28
28
|
|
|
29
|
-
export {
|
|
29
|
+
export { Q as ActionsContainer, q as ActionsDivider, $ as Container, oo as DesktopPaginationContainer, U as Header, Z as MobilePaginationContainer, X as SearchContainer, Co as Toolbar, J as ToolbarActionsDivider, K as Topbar, dt as default };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
import { Breakpoint } from '@mui/material/styles';
|
|
3
4
|
|
|
4
5
|
interface DisplayModeProps {
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
desktop?: boolean;
|
|
7
8
|
mobile?: boolean;
|
|
9
|
+
breakpoint?: Breakpoint;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
declare const DisplayMode: ({ children, desktop, mobile, ...props }: DisplayModeProps & BoxProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare const DisplayMode: ({ children, desktop, mobile, breakpoint, ...props }: DisplayModeProps & BoxProps) => react_jsx_runtime.JSX.Element;
|
|
11
13
|
|
|
12
14
|
export { DisplayMode as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from '@mui/material/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var r=styled(t,{shouldForwardProp:o=>o!=="breakpoint"})(({theme:o,breakpoint:p})=>({[o.breakpoints.up(p)]:{"&.mobile":{display:"none"}},[o.breakpoints.down(p)]:{"&.desktop":{display:"none"}}}));var n=({children:o,desktop:p,mobile:s,breakpoint:i="md",...a})=>{let e=[p&&"desktop",s&&"mobile"].filter(Boolean).join(" ");return jsx(r,{breakpoint:i,className:e,...a,children:o})},B=n;
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { B as default };
|