@zydon/common 2.2.36 → 2.2.37
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.
- package/dist/chunk-3SFA4YEZ.js +7 -0
- package/dist/chunk-QQB3DGHT.js +3 -0
- package/dist/components/DashedDivider/index.d.ts +5 -0
- package/dist/components/DashedDivider/index.js +1 -0
- package/dist/components/DataCards/index.d.ts +23 -0
- package/dist/components/DataCards/index.js +20 -0
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/FrameSkeleton/index.js +1 -1
- package/dist/components/SelectableCards/index.js +2 -2
- package/dist/components/SwapList/index.js +1 -1
- package/dist/components/form/SelectableCards/index.js +2 -2
- package/dist/components/upload/index.js +1 -1
- package/dist/types/datagrid.d.ts +6 -1
- package/dist/utils/number.d.ts +2 -1
- package/dist/utils/number.js +1 -3
- package/package.json +1 -1
- package/dist/{chunk-FNBYAASY.js → chunk-J76XIRCA.js} +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import d from '@mui/material/Divider';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var r=styled(d)(({theme:e})=>({height:1,backgroundImage:`linear-gradient(90deg, ${e.palette.grey[300]}, ${e.palette.grey[300]} 50%, transparent 50%, transparent 50%)`,backgroundSize:"8px 1px",border:"none"}));var a=()=>jsx(r,{className:"dashed-divider"}),g=a;
|
|
6
|
+
|
|
7
|
+
export { g as a };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { a as default } from '../../chunk-3SFA4YEZ.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { GridRowParams, MuiEvent } from '@mui/x-data-grid-premium';
|
|
3
|
+
import { DatagridRow, Columns } from '../../types/datagrid.js';
|
|
4
|
+
|
|
5
|
+
interface DataCardsProps {
|
|
6
|
+
title: string;
|
|
7
|
+
rows: DatagridRow[];
|
|
8
|
+
columns: Columns;
|
|
9
|
+
pagination?: {
|
|
10
|
+
total: number;
|
|
11
|
+
page: number;
|
|
12
|
+
perPage: number;
|
|
13
|
+
onPageChange(page: number): void;
|
|
14
|
+
};
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
fetching?: boolean;
|
|
17
|
+
getRowId: (row: DatagridRow) => string;
|
|
18
|
+
onClick?: (params: GridRowParams<object>, event: MuiEvent<React.MouseEvent<HTMLElement, MouseEvent>>, details: unknown) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare const DataCards: ({ title, rows, columns, getRowId, onClick, loading, fetching, pagination, }: DataCardsProps) => react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { DataCards };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { c } from '../../chunk-QQB3DGHT.js';
|
|
2
|
+
import { a as a$2 } from '../../chunk-3SFA4YEZ.js';
|
|
3
|
+
import { a } from '../../chunk-YWEB6IAI.js';
|
|
4
|
+
import { a as a$1 } from '../../chunk-ZODC2MGF.js';
|
|
5
|
+
import '../../chunk-ZDHXW74M.js';
|
|
6
|
+
import '../../chunk-D27ND54J.js';
|
|
7
|
+
import H from '@mui/material/Pagination';
|
|
8
|
+
import d from '@mui/material/Stack';
|
|
9
|
+
import { useMemo } from 'react';
|
|
10
|
+
import P from '@mui/material/Card';
|
|
11
|
+
import N from '@mui/material/CardContent';
|
|
12
|
+
import h from '@mui/material/Typography';
|
|
13
|
+
import G from '@mui/material/CardActionArea';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
16
|
+
import l from '@mui/material/Skeleton';
|
|
17
|
+
|
|
18
|
+
var M=styled(G)(({disableRipple:r})=>({".MuiCardActionArea-focusHighlight":{background:"transparent"},...r&&{"&:hover":{cursor:"default"}}}));var T=r=>{r.stopPropagation();},j=({fields:r,id:o,title:s,onClick:n})=>{let e=r.find(t=>t.label.toLowerCase()==="status"||t.type==="status"||t.field==="status"),v=useMemo(()=>e?.renderCell?.({value:e.value,field:o,row:{[o]:e.value}})||e?.value,[e,o]),g=r.find(t=>t.type==="actions"||t.id==="actions"),p=useMemo(()=>g?.getActions({id:o})||null,[g,o]),y=useMemo(()=>r.filter(t=>t.label.toLowerCase()!=="status"&&t.value?.toString()!==o&&t.type!=="actions"),[r,o]),c$1=t=>{n?.({id:o},t,r);},C=jsxs(N,{sx:{padding:"0!important"},children:[jsxs(d,{flexDirection:"row",justifyContent:"space-between",p:2,children:[jsxs(d,{flexDirection:"row",alignItems:"center",gap:1,children:[jsx(h,{variant:"body1",fontWeight:600,color:"text.secondary",children:s}),jsxs(h,{variant:"body1",fontWeight:600,children:[c(o)?"#":"",o]})]}),jsxs(d,{className:"actions",flexDirection:"row",alignItems:"center",gap:1,children:[jsx(h,{variant:"body2",color:"text.secondary",textTransform:"uppercase",fontSize:14,fontWeight:600,children:v}),jsx(d,{onClick:T,onMouseDown:T,children:p})]})]}),jsx(a$2,{}),jsx(d,{flexWrap:"wrap",direction:"row",justifyContent:"space-between",p:2,pb:0,children:y.map(t=>t.value!=o&&jsxs(d,{flexBasis:"50%",pb:2,order:t.order,children:[jsx(h,{variant:"body2",color:"text.secondary",children:t.label}),jsx(h,{variant:"body1",children:t.valueGetter?t.valueFormatter(t.valueGetter(t.value)):t.value})]},`data-card-field-${o}-${t.label}`))})]});return n?jsx(P,{onClick:c$1,children:jsx(M,{component:"div",children:C})}):jsx(P,{children:C})},E=j;var w=()=>jsxs(P,{children:[jsxs(d,{justifyContent:"space-between",direction:"row",spacing:2,p:2,children:[jsx(l,{height:24,width:200}),jsx(l,{height:24,width:100})]}),jsxs(d,{justifyContent:"space-between",flexWrap:"wrap",direction:"row",p:2,children:[jsxs(d,{width:"50%",spacing:1,children:[jsx(l,{height:24,width:100}),jsx(l,{sx:{maxWidth:"95%"},height:24,width:230})]}),jsxs(d,{width:"50%",spacing:1,children:[jsx(l,{height:24,width:80}),jsx(l,{sx:{maxWidth:"100%"},height:27,width:250})]})]})]});var R=(r,o)=>{let s=[];r.forEach(e=>{e.field&&e.field!=="actions"&&s.push({...e,label:e.headerName||e.field,value:o[e.field],type:e.type,order:e?.order||0,id:e.field});});let n=r.find(e=>e.field==="actions");return n&&s.push({...n,label:"Actions",value:null,order:0,type:"actions",id:"actions"}),s};var ft=({title:r,rows:o,columns:s,getRowId:n,onClick:e,loading:v,fetching:g,pagination:p})=>{let y=g&&jsx(a,{sx:{zIndex:1}});return v?jsxs(Fragment,{children:[y,jsx(w,{}),jsx(w,{}),jsx(w,{})]}):jsxs(d,{spacing:2,children:[y,o.length===0&&jsx(a$1,{sx:{mb:3},title:"Nenhum registro encontrado"}),o.map(c=>jsx(E,{title:r,id:n(c),fields:R(s,c),onClick:e},`data-card-${n(c)}`)),p&&o.length>0&&jsx(d,{direction:"row",justifyContent:"center",children:jsx(H,{page:p?.page,onChange:(c,C)=>{p?.onPageChange(C);},count:p?.total})})]})};
|
|
19
|
+
|
|
20
|
+
export { ft as DataCards };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { a } from '../../chunk-YWEB6IAI.js';
|
|
1
2
|
import { a as a$1 } from '../../chunk-ZODC2MGF.js';
|
|
2
3
|
import '../../chunk-ZDHXW74M.js';
|
|
3
|
-
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';
|
|
@@ -11,6 +11,6 @@ import C from '@mui/material/Button';
|
|
|
11
11
|
import { styled } from '@mui/material/styles';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
|
-
var S=styled(n)(({theme:o})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${o.palette.grey[300]}`})),h=styled(n)(({theme:o})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${o.palette.grey[300]}`})),s=styled(n)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),x=styled(n)(({theme:o})=>({height:"100%",width:"50%",flex:1,[o.breakpoints.down(1680)]:{width:"70%"}})),b=styled(g)(({theme:o})=>({color:o.palette.grey[800],fontSize:18,fontWeight:700})),
|
|
14
|
+
var S=styled(n)(({theme:o})=>({backgroundColor:"#fff",minWidth:"250px",padding:24,minHeight:"100vh",borderRight:`1px solid ${o.palette.grey[300]}`})),h=styled(n)(({theme:o})=>({backgroundColor:"#fff",position:"sticky",top:0,zIndex:999,width:"100%",padding:24,gap:24,borderBottom:`1px solid ${o.palette.grey[300]}`})),s=styled(n)({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:24}),x=styled(n)(({theme:o})=>({height:"100%",width:"50%",flex:1,[o.breakpoints.down(1680)]:{width:"70%"}})),b=styled(g)(({theme:o})=>({color:o.palette.grey[800],fontSize:18,fontWeight:700})),k=styled(g)(({theme:o})=>({color:o.palette.grey[500],fontSize:14,fontWeight:400,paddingBottom:24})),y=styled(C)(({theme:o})=>({paddingTop:6,paddingBottom:6,paddingLeft:0,margin:0,marginBottom:4,marginTop:4,width:"100%",display:"block",cursor:"pointer",color:o.palette.grey[600],textAlign:"left",fontWeight:400,fontSize:14,"> span":{color:o.palette.error.main}})),B=styled(a)(()=>({height:1,"& .simplebar-content":{height:1}})),T=styled(n)(()=>({position:"fixed",width:"202px"}));var H=({title:o,sections:l,headerLeftContent:w,headerRightContent:I,onClickBack:W})=>jsx(n,{children:jsxs(n,{direction:"row",children:[jsx(S,{id:"frame-skeleton-left-box",children:jsx(B,{children:jsxs(T,{children:[jsx(g,{variant:"overline",color:"text.disabled",fontWeight:700,children:"ACESSO R\xC1PIDO"}),l.map((e,p)=>jsxs(n,{children:[jsxs(y,{onClick:()=>{e.ref.current&&e.ref.current.scrollIntoView({block:"start",behavior:"smooth"});},children:[e.title,e.isRequired&&jsx("span",{children:"*"})]}),p<l.length-1&&jsx(v,{})]},p))]})})}),jsxs(n,{width:"100%",alignItems:"center",mb:8,children:[jsx(h,{children:jsxs(s,{children:[jsxs(n,{flexDirection:"row",gap:2,alignItems:"center",children:[jsx(F,{color:"primary",onClick:()=>W(),children:jsx(a$1,{icon:"CHEVRON_LEFT"})}),jsx(g,{variant:"h4",children:o}),w]}),jsxs(n,{direction:"row",gap:2,alignItems:"center",minWidth:"max-content",children:[jsx(a$2,{disabled:!0}),I]})]})}),jsx(x,{children:l.map((e,p)=>jsxs(n,{paddingTop:3,paddingBottom:2,alignItems:"start",width:"100%",id:`section-${p}`,children:[jsx(b,{ref:e.ref,children:e.title}),jsx(k,{children:e.subTitle}),jsx(a$3,{width:"100%",borderRadius:1,gap:1.5,padding:3,children:e.child})]},e.title))})]})]})}),_=H;
|
|
15
15
|
|
|
16
16
|
export { _ as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { a as default } from '../../chunk-
|
|
2
|
-
import '../../chunk-TWGGHTU5.js';
|
|
1
|
+
export { a as default } from '../../chunk-J76XIRCA.js';
|
|
3
2
|
import '../../chunk-2Z4AFXGP.js';
|
|
3
|
+
import '../../chunk-TWGGHTU5.js';
|
|
4
4
|
import '../../chunk-E5MGOPPQ.js';
|
|
5
5
|
import '../../chunk-2MVQI7NJ.js';
|
|
6
6
|
import '../../chunk-ZDHXW74M.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as a$1 } from '../../chunk-TWGGHTU5.js';
|
|
2
1
|
import { a } from '../../chunk-2Z4AFXGP.js';
|
|
2
|
+
import { a as a$1 } from '../../chunk-TWGGHTU5.js';
|
|
3
3
|
import { a as a$3 } from '../../chunk-E5MGOPPQ.js';
|
|
4
4
|
import { a as a$2 } from '../../chunk-2MVQI7NJ.js';
|
|
5
5
|
import '../../chunk-ZDHXW74M.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-TWGGHTU5.js';
|
|
1
|
+
import { a } from '../../../chunk-J76XIRCA.js';
|
|
3
2
|
import '../../../chunk-2Z4AFXGP.js';
|
|
3
|
+
import '../../../chunk-TWGGHTU5.js';
|
|
4
4
|
import '../../../chunk-E5MGOPPQ.js';
|
|
5
5
|
import '../../../chunk-2MVQI7NJ.js';
|
|
6
6
|
import '../../../chunk-ZDHXW74M.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-QCWALW56.js';
|
|
2
1
|
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-REM462FC.js';
|
|
2
|
+
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-QCWALW56.js';
|
|
3
3
|
export { c as RejectionFiles } from '../../chunk-2MW433JI.js';
|
|
4
4
|
import '../../chunk-P4HPVV7B.js';
|
|
5
5
|
import '../../chunk-WAAV5ZRR.js';
|
package/dist/types/datagrid.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { DataGridPremiumProps } from '@mui/x-data-grid-premium';
|
|
2
2
|
|
|
3
3
|
type Columns = DataGridPremiumProps['columns'];
|
|
4
|
+
interface DatagridRow {
|
|
5
|
+
'@indexes': string[];
|
|
6
|
+
'@id': string;
|
|
7
|
+
[key: string]: string | number | boolean | (string | number)[] | null;
|
|
8
|
+
}
|
|
4
9
|
|
|
5
|
-
export { Columns };
|
|
10
|
+
export { Columns, DatagridRow };
|
package/dist/utils/number.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare function isMultiple(possibleMultiple: number, reference: number, exponent?: number): boolean;
|
|
2
2
|
declare function roundIfNecessary(value?: number): number;
|
|
3
|
+
declare const isNumeric: (string: string) => boolean;
|
|
3
4
|
|
|
4
|
-
export { isMultiple, roundIfNecessary };
|
|
5
|
+
export { isMultiple, isNumeric, roundIfNecessary };
|
package/dist/utils/number.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { t as isMultiple, e as roundIfNecessary };
|
|
1
|
+
export { a as isMultiple, c as isNumeric, b as roundIfNecessary } from '../chunk-QQB3DGHT.js';
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as a$3 } from './chunk-TWGGHTU5.js';
|
|
2
1
|
import { a as a$1 } from './chunk-2Z4AFXGP.js';
|
|
2
|
+
import { a as a$3 } from './chunk-TWGGHTU5.js';
|
|
3
3
|
import { a as a$2 } from './chunk-E5MGOPPQ.js';
|
|
4
4
|
import { a as a$4 } from './chunk-2MVQI7NJ.js';
|
|
5
5
|
import { a as a$5 } from './chunk-PPUFQMAW.js';
|