@zydon/common 2.0.60 → 2.0.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.
|
@@ -3,6 +3,6 @@ import { DataGridProps } from '../../types/dataGridProps.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@mui/x-data-grid-premium';
|
|
5
5
|
|
|
6
|
-
declare const DataGrid: ({ columns, rows, loading, fetching, hideFooter, sx, showToolbar, disableExport, columnHeaderHeight, rowHeight, rowSpacingType, getRowSpacing, autoHeight, toolbarContent, ...other }: DataGridProps) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const DataGrid: ({ columns, rows, loading, fetching, hideFooter, sx, showToolbar, disableExport, columnHeaderHeight, rowHeight, rowSpacingType, getRowSpacing, autoHeight, toolbarContent, slots, ...other }: DataGridProps) => react_jsx_runtime.JSX.Element;
|
|
7
7
|
|
|
8
8
|
export { DataGrid as default };
|
|
@@ -4,12 +4,12 @@ import { a } from '../../chunk-YWEB6IAI.js';
|
|
|
4
4
|
import '../../chunk-D27ND54J.js';
|
|
5
5
|
import x, { useState } from 'react';
|
|
6
6
|
import { GRID_CHECKBOX_SELECTION_COL_DEF, DataGridPremium, GridToolbarContainer, GridToolbarColumnsButton, GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExport, useGridApiContext, useGridRootProps, gridColumnsTotalWidthSelector, gridColumnPositionsSelector } from '@mui/x-data-grid-premium';
|
|
7
|
-
import
|
|
7
|
+
import E from '@mui/material/Box';
|
|
8
8
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import N from '@mui/material/Skeleton';
|
|
10
|
+
import $ from '@mui/material/Stack';
|
|
11
11
|
import { styled } from '@mui/material/styles';
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var F=({showToolbar:r,disableExport:e,setFilterButtonEl:i,toolbarContent:l})=>{if(r)return jsxs(GridToolbarContainer,{children:[jsx(GridToolbarColumnsButton,{slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarFilterButton,{ref:i,slotProps:{button:{color:"inherit"}}}),jsx(GridToolbarDensitySelector,{slotProps:{button:{color:"inherit"}}}),!e&&jsx(GridToolbarExport,{slotProps:{button:{color:"inherit"}}}),jsx(E,{sx:{flexGrow:1}}),l]})},S=F;var y=styled(E)({display:"flex",flexDirection:"row",alignItems:"center",padding:"0 16px"}),V=()=>{let r=useGridApiContext(),{rowHeight:e,paginationModel:i,initialState:l}=useGridRootProps(),m=i?.pageSize||l?.pagination?.paginationModel?.pageSize||10,p=gridColumnsTotalWidthSelector(r),d=gridColumnPositionsSelector(r),g=x.useMemo(()=>d.filter(o=>o<=p).length,[p,d]),n=r.current.getVisibleColumns().slice(0,g),s=n.length>1?n:[...n,...Array.from({length:8},(o,t)=>({field:`fake${String(t+1).padStart(2,"0")}`,headerName:"",computedWidth:200,align:"flex-start"}))],h=x.useMemo(()=>{let o=[];for(let t=0;t<m;t+=1){for(let u of s)o.push(jsx(y,{sx:{justifyContent:u.align},children:jsx(N,{width:"100%"})},`column-${t}-${u.field}`));o.push(jsx(y,{},`fill-${t}`));}return o},[m,s]);return jsx($,{display:"grid",sx:{display:"grid",gridTemplateColumns:`${s.map(({computedWidth:o})=>`${o}px`).join(" ")} 1fr`,gridAutoRows:e,backgroundColor:"#fff",overflow:"hidden",maxHeight:"100%"},children:h})},G=V;var X=({columns:r,rows:e=[],loading:i,fetching:l,hideFooter:m,sx:p,showToolbar:d,disableExport:g,columnHeaderHeight:n=56,rowHeight:s=76,rowSpacingType:h="margin",getRowSpacing:o=()=>({top:0,bottom:0}),autoHeight:t=!1,toolbarContent:u,slots:P,...T})=>{let[w,k]=useState(null),R=[{...GRID_CHECKBOX_SELECTION_COL_DEF,width:71},...r];return jsxs(Fragment,{children:[l&&jsx(a,{sx:{zIndex:1}}),jsx(DataGridPremium,{columns:R,rows:e,loading:i,autoHeight:t,hideFooter:e.length===0?!0:m,rowHeight:s,columnHeaderHeight:n,getRowSpacing:o,rowSpacingType:h,slots:{...P,toolbar:S,noRowsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),noResultsOverlay:()=>jsx(a$1,{title:"Nenhum registro encontrado"}),loadingOverlay:G},slotProps:{panel:{anchorEl:w},toolbar:{setFilterButtonEl:k,showQuickFilter:!0,disableExport:g,showToolbar:d,toolbarContent:u}},sx:p,...T})]})},Co=X;
|
|
14
14
|
|
|
15
|
-
export {
|
|
15
|
+
export { Co as default };
|
|
@@ -17,6 +17,6 @@ import X from '@mui/material/Button';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
19
19
|
|
|
20
|
-
var C=styled(X)(({theme:n})=>({borderColor:n.palette.grey[300]})),I=styled(U)(({theme:n})=>({display:"flex",border:`1.5px solid ${n.palette.grey[300]}`,height:450,borderRadius:8,flex:1,overflow:"hidden"}));var Z=({selectedItems:n,items:T,loading:L,searchText:g,onAdd:B,onRemove:D,search:P,itemsTitle:z,selectedItemsTitle:W,additionalContent:H,enableSearchInSelectedItems:k,selectedItemChild:K,onSearch:N})=>{let[$,_]=useState(""),M=debounce(N,400),
|
|
20
|
+
var C=styled(X)(({theme:n})=>({borderColor:n.palette.grey[300]})),I=styled(U)(({theme:n})=>({display:"flex",border:`1.5px solid ${n.palette.grey[300]}`,height:450,borderRadius:8,flex:1,overflow:"hidden"}));var Z=({selectedItems:n,items:T,loading:L,searchText:g,onAdd:B,onRemove:D,search:P,itemsTitle:z,selectedItemsTitle:W,additionalContent:H,enableSearchInSelectedItems:k,selectedItemChild:K,onSearch:N})=>{let[$,_]=useState(""),M=debounce(N,400),d=T.filter(e=>!n.some(a=>a.id===e.id)),O=n.filter(e=>e.name?.toLowerCase().includes($.toLowerCase())),s=k?O:n,[i,p]=useState([]),[l,m]=useState([]),j=()=>{B(i),p([]);},G=()=>{D(l),m([]);},V=e=>{m(e?s:[]);},q=e=>{p(e?d:[]);},J=(e,a)=>{m(a?c=>[...c,e]:c=>c.filter(u=>u.id!==e.id));},Q=(e,a)=>{p(a?c=>[...c,e]:c=>c.filter(u=>u.id!==e.id));},A=e=>{e.key==="Enter"&&e.preventDefault();};return jsx(o,{children:jsxs(o,{direction:"row",alignItems:"center",gap:3,children:[jsx(I,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:i.length>0&&i.length!==d.length,checked:i.length>0&&i.length===d.length,onChange:e=>q(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${z} cadastrados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${i.length}/${d.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,children:[jsx(a,{iconPosition:"start",placeholder:"Buscar",onKeyDown:A,size:"small",fullWidth:!0,trigger:"change",onSearch:e=>M(e)}),H]}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(F,{})}),isEmpty:d.length===0,empty:jsx(a$2,{text:P?`Nenhum ${g} encontrado`:`Nenhum ${g} dispon\xEDvel`,sx:{svg:{height:140}}}),children:jsx(a$3,{sx:{maxHeight:280},children:d.map(e=>jsxs(o,{gap:1,marginTop:"8px",children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:i.includes(e),onChange:a=>Q(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})}),jsxs(o,{gap:3,children:[jsx(C,{variant:"outlined",onClick:j,children:jsx(a$4,{icon:"ARROW_RIGHT_SIMPLE"})}),jsx(C,{variant:"outlined",onClick:G,children:jsx(a$4,{icon:"ARROW_LEFT_SIMPLE"})})]}),jsx(I,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:l.length>0&&l.length!==s.length,checked:l.length>0&&l.length===s.length,onChange:e=>V(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${W} selecionados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${l.length}/${s.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,gap:1,overflow:"hidden",children:[k&&jsx(a,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:e=>_(e??""),onKeyDown:A}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(F,{})}),isEmpty:s.length===0,empty:jsx(a$2,{text:$&&k?`Nenhum ${g} encontrado`:`Nenhum ${g} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:jsx(a$3,{sx:{maxHeight:280},children:s.map(e=>jsxs(o,{gap:1,children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsxs(o,{direction:"row",children:[K(e),jsx(h,{size:"small",checked:l.includes(e),onChange:a=>J(e,a.target.checked)})]}),e.label]}),jsx(f,{})]},e.id))})})]})]})})]})})},ue=Z;
|
|
21
21
|
|
|
22
22
|
export { ue 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 ((string & {}) | csstype.Globals | "normal"
|
|
446
|
+
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | 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" | "linear" | "reverse" | "none" | "auto" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start")[] | undefined;
|
|
449
449
|
animationRange?: csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|