@zydon/common 2.5.48 → 2.5.50
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-NRILCEDT.js +11 -0
- package/dist/components/FileUpload/index.js +2 -2
- package/dist/components/StateDisplay/index.d.ts +68 -0
- package/dist/components/StateDisplay/index.js +3 -0
- package/dist/components/form/UploadAvatarWithCrop/index.js +1 -1
- package/dist/components/form/UploadWithCrop/index.js +1 -1
- package/dist/components/table/index.js +18 -19
- package/dist/components/upload/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { a } from './chunk-24EPSBGG.js';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import d from '@mui/material/Button';
|
|
4
|
+
import o from '@mui/material/Stack';
|
|
5
|
+
import { useTheme } from '@mui/material/styles';
|
|
6
|
+
import u from '@mui/material/Typography';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var R=r=>{switch(r){case"success":return jsx(a,{"data-testid":"icon-SUCCESS",icon:"CHECK_CIRCLE",width:120,height:120});case"error":return jsx(a,{"data-testid":"icon-ERROR",icon:"CANCEL_CIRCLE",width:120,height:120});case"info":return jsx(a,{"data-testid":"icon-INFO",icon:"INFO_CIRCLE",width:120,height:120});case"empty":default:return jsx(a,{"data-testid":"icon-DEFAULT",icon:"PACKAGE",width:120,height:120})}},L=(r,e)=>{switch(r){case"success":return e.palette.success.main;case"error":return e.palette.error.main;case"info":return e.palette.primary.main;case"empty":default:return e.palette.text.disabled}},b=({icon:r,title:e,description:i,primaryAction:p,secondaryAction:l,primaryActionLabel:g,secondaryActionLabel:f,onPrimaryAction:n,onSecondaryAction:s,primaryActionProps:C,secondaryActionProps:y,variant:m="default",iconSize:h=120,maxWidth:x=768,sx:S,...w})=>{let E=useTheme(),T=typeof e=="string"?"h3":"div",v=typeof i=="string"?"p":"div",I=L(m,E);return jsxs(o,{alignItems:"center",justifyContent:"center",spacing:3,sx:{height:"100%",textAlign:"center",py:4,px:2,...S},...w,children:[jsx(o,{sx:{color:I,"& svg":{width:h,height:h}},children:r||R(m)}),jsxs(o,{spacing:1,sx:{maxWidth:x},children:[e&&jsx(u,{component:T,variant:"subtitle1",fontWeight:"600",color:"text.primary",sx:{mb:.5},children:e}),i&&jsx(u,{component:v,variant:"body1",color:"text.secondary",sx:{lineHeight:1.6},children:i})]}),(p||l||n||s)&&jsxs(o,{direction:"row",spacing:2,flexWrap:"wrap",justifyContent:"center",children:[l||s&&jsx(d,{variant:"outlined",color:"inherit",onClick:s,sx:{minWidth:120},...y,children:f||"Cancelar"}),p||n&&jsx(d,{variant:"contained",color:"primary",onClick:n,sx:{minWidth:120},...C,children:g||"Confirmar"})]})]})},_=memo(b);
|
|
10
|
+
|
|
11
|
+
export { _ as a };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as a$5 } from '../../chunk-H5L4ARDB.js';
|
|
2
|
-
import { a } from '../../chunk-XTIYH2YX.js';
|
|
3
|
-
import { e } from '../../chunk-ANAHA3L6.js';
|
|
4
2
|
import { a as a$3 } from '../../chunk-2FXBVVBD.js';
|
|
5
3
|
import { a as a$6 } from '../../chunk-G27HQGIC.js';
|
|
6
4
|
import '../../chunk-7AZX7L27.js';
|
|
5
|
+
import { a } from '../../chunk-XTIYH2YX.js';
|
|
7
6
|
import '../../chunk-QREMZNLF.js';
|
|
7
|
+
import { e } from '../../chunk-ANAHA3L6.js';
|
|
8
8
|
import { a as a$2 } from '../../chunk-SVWZMU2S.js';
|
|
9
9
|
import { x } from '../../chunk-2P4CXK3O.js';
|
|
10
10
|
import { a as a$7 } from '../../chunk-FK7DDO5L.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
5
|
+
import { StackProps } from '@mui/material/Stack';
|
|
6
|
+
|
|
7
|
+
interface StateDisplayProps extends Omit<StackProps, 'title'> {
|
|
8
|
+
/**
|
|
9
|
+
* Ícone ou asset customizado para exibir
|
|
10
|
+
*/
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Título principal do estado
|
|
14
|
+
*/
|
|
15
|
+
title?: string | ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Descrição ou texto secundário
|
|
18
|
+
*/
|
|
19
|
+
description?: string | ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Ação principal (botão customizado)
|
|
22
|
+
*/
|
|
23
|
+
primaryAction?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Ação secundária (botão customizado)
|
|
26
|
+
*/
|
|
27
|
+
secondaryAction?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Texto do botão primário (usado apenas se primaryAction não for fornecido)
|
|
30
|
+
*/
|
|
31
|
+
primaryActionLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Texto do botão secundário (usado apenas se secondaryAction não for fornecido)
|
|
34
|
+
*/
|
|
35
|
+
secondaryActionLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Callback para ação primária
|
|
38
|
+
*/
|
|
39
|
+
onPrimaryAction?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback para ação secundária
|
|
42
|
+
*/
|
|
43
|
+
onSecondaryAction?: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Props do botão primário
|
|
46
|
+
*/
|
|
47
|
+
primaryActionProps?: ButtonProps;
|
|
48
|
+
/**
|
|
49
|
+
* Props do botão secundário
|
|
50
|
+
*/
|
|
51
|
+
secondaryActionProps?: ButtonProps;
|
|
52
|
+
/**
|
|
53
|
+
* Variante do estado para aplicar estilos específicos
|
|
54
|
+
*/
|
|
55
|
+
variant?: 'empty' | 'success' | 'error' | 'info' | 'default';
|
|
56
|
+
/**
|
|
57
|
+
* Tamanho do ícone
|
|
58
|
+
*/
|
|
59
|
+
iconSize?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Largura máxima do conteúdo
|
|
62
|
+
*/
|
|
63
|
+
maxWidth?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare const _default: react.MemoExoticComponent<({ icon, title, description, primaryAction, secondaryAction, primaryActionLabel, secondaryActionLabel, onPrimaryAction, onSecondaryAction, primaryActionProps, secondaryActionProps, variant, iconSize, maxWidth, sx, ...stackProps }: StateDisplayProps) => react_jsx_runtime.JSX.Element>;
|
|
67
|
+
|
|
68
|
+
export { _default as default };
|
|
@@ -2,8 +2,8 @@ import { b } from '../../../chunk-SFCLGK5I.js';
|
|
|
2
2
|
import '../../../chunk-ISYQXE75.js';
|
|
3
3
|
import '../../../chunk-EVIELOMC.js';
|
|
4
4
|
import '../../../chunk-RQ5Q6X5Y.js';
|
|
5
|
-
import '../../../chunk-ANAHA3L6.js';
|
|
6
5
|
import '../../../chunk-QREMZNLF.js';
|
|
6
|
+
import '../../../chunk-ANAHA3L6.js';
|
|
7
7
|
import '../../../chunk-D27ND54J.js';
|
|
8
8
|
import '../../../chunk-X24QANPC.js';
|
|
9
9
|
import '../../../chunk-24EPSBGG.js';
|
|
@@ -3,8 +3,8 @@ import '../../../chunk-ISYQXE75.js';
|
|
|
3
3
|
import '../../../chunk-EVIELOMC.js';
|
|
4
4
|
import '../../../chunk-RQ5Q6X5Y.js';
|
|
5
5
|
import '../../../chunk-H5L4ARDB.js';
|
|
6
|
-
import '../../../chunk-ANAHA3L6.js';
|
|
7
6
|
import '../../../chunk-QREMZNLF.js';
|
|
7
|
+
import '../../../chunk-ANAHA3L6.js';
|
|
8
8
|
import '../../../chunk-SVWZMU2S.js';
|
|
9
9
|
import '../../../chunk-2P4CXK3O.js';
|
|
10
10
|
import '../../../chunk-FK7DDO5L.js';
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { a } from '../../chunk-
|
|
1
|
+
import { a } from '../../chunk-NRILCEDT.js';
|
|
2
|
+
import '../../chunk-24EPSBGG.js';
|
|
2
3
|
import '../../chunk-WRWKHENK.js';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import be from '@mui/material/TablePagination';
|
|
18
|
-
import h from '@mui/material/Skeleton';
|
|
4
|
+
import S from '@mui/material/TableCell';
|
|
5
|
+
import F from '@mui/material/TableRow';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
import q from '@mui/material/Box';
|
|
8
|
+
import J from '@mui/material/Checkbox';
|
|
9
|
+
import Q from '@mui/material/TableHead';
|
|
10
|
+
import Y from '@mui/material/TableSortLabel';
|
|
11
|
+
import oe from '@mui/material/FormControlLabel';
|
|
12
|
+
import re from '@mui/material/Switch';
|
|
13
|
+
import ae from '@mui/material/TablePagination';
|
|
14
|
+
import pe from '@mui/material/Stack';
|
|
15
|
+
import me from '@mui/material/Typography';
|
|
16
|
+
import g from '@mui/material/Skeleton';
|
|
17
|
+
import { useState, useCallback } from 'react';
|
|
19
18
|
|
|
20
|
-
var
|
|
19
|
+
var G=({emptyRows:t,height:o})=>t?jsx(F,{sx:{...o&&{height:o*t}},children:jsx(S,{colSpan:9})}):null,$=G;var Z={border:0,margin:-1,padding:0,width:"1px",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",clip:"rect(0 0 0 0)"},_=({sx:t,order:o,onSort:e,orderBy:r,headLabel:l,rowCount:s=0,numSelected:m=0,onSelectAllRows:c})=>jsx(Q,{sx:t,children:jsxs(F,{children:[c&&jsx(S,{padding:"checkbox",children:jsx(J,{indeterminate:!!m&&m<s,checked:!!s&&m===s,onChange:n=>c(n.target.checked),inputProps:{name:"select-all-rows","aria-label":"select all rows"}})}),l.map(n=>jsx(S,{align:n.align||"left",sortDirection:r===n.id?o:!1,sx:{width:n.width,minWidth:n.minWidth},children:e?jsxs(Y,{hideSortIcon:!0,active:r===n.id,direction:r===n.id?o:"asc",onClick:()=>e(n.id),children:[n.label,r===n.id?jsx(q,{sx:{...Z},children:o==="desc"?"sorted descending":"sorted ascending"}):null]}):n.label},n.id))]})}),B=_;var j=({notFound:t,sx:o})=>jsx(F,{children:t?jsx(S,{colSpan:12,children:jsx(a,{variant:"empty",title:"Nenhum dado encontrado",description:"N\xE3o h\xE1 registros para exibir",sx:{py:10,borderRadius:2,bgcolor:e=>e.palette.grey[50],border:e=>`dashed 1px ${e.palette.grey[300]}`,...o}})}):jsx(S,{colSpan:12,sx:{p:0}})}),ee=j;var ne=({sx:t,dense:o,onChangeDense:e,rowsPerPageOptions:r=[5,10,25],...l})=>jsxs(q,{sx:{position:"relative",...t},children:[jsx(ae,{rowsPerPageOptions:r,component:"div",...l,sx:{borderTopColor:"transparent"}}),e&&jsx(oe,{label:"Dense",control:jsx(re,{name:"dense",checked:o,onChange:e}),sx:{pl:2,py:1.5,top:0,position:{sm:"absolute"}}})]}),le=ne;var ce=({dense:t,action:o,rowCount:e,numSelected:r,onSelectAllRows:l,sx:s,...m})=>r?jsxs(pe,{direction:"row",alignItems:"center",sx:{pl:1,pr:2,top:0,left:0,width:1,zIndex:9,height:58,position:"absolute",bgcolor:"primary.lighter",...t&&{height:38},...s},...m,children:[jsx(J,{indeterminate:!!r&&r<e,checked:!!e&&r===e,onChange:c=>l(c.target.checked)}),jsxs(me,{variant:"subtitle2",sx:{ml:2,flexGrow:1,color:"primary.main",...t&&{ml:3}},children:[r," selected"]}),o&&o]}):null,de=ce;var Te=({...t})=>jsx(F,{...t,children:jsx(S,{colSpan:12,children:jsxs(pe,{spacing:3,direction:"row",alignItems:"center",children:[jsx(g,{sx:{borderRadius:1.5,width:48,height:48,flexShrink:0}}),jsx(g,{sx:{width:1,height:12}}),jsx(g,{sx:{width:180,height:12}}),jsx(g,{sx:{width:160,height:12}}),jsx(g,{sx:{width:140,height:12}}),jsx(g,{sx:{width:120,height:12}})]})})}),he=Te;var we=t=>{let[o,e]=useState(!!t?.defaultDense),[r,l]=useState(t?.defaultCurrentPage||0),[s,m]=useState(t?.defaultOrderBy||"name"),[c,n]=useState(t?.defaultRowsPerPage||5),[w,R]=useState(t?.defaultOrder||"asc"),[b,f]=useState(t?.defaultSelected||[]),H=useCallback(a=>{a!==""&&(R(s===a&&w==="asc"?"desc":"asc"),m(a));},[w,s]),I=useCallback(a=>{let i=b.includes(a)?b.filter(u=>u!==a):[...b,a];f(i);},[b]),L=useCallback(a=>{l(0),n(parseInt(a.target.value,10));},[]),O=useCallback(a=>{e(a.target.checked);},[]),A=useCallback((a,i)=>{if(a){f(i);return}f([]);},[]),M=useCallback((a,i)=>{l(i);},[]),N=useCallback(()=>{l(0);},[]),U=useCallback(a=>{f([]),r&&a<2&&l(r-1);},[r]),K=useCallback(({totalRowsInPage:a,totalRowsFiltered:i})=>{let u=b.length;if(f([]),r){if(u===a)l(r-1);else if(u===i)l(0);else if(u>a){let W=Math.ceil((i-u)/c)-1;l(W);}}},[r,c,b.length]);return {dense:o,order:w,page:r,orderBy:s,rowsPerPage:c,selected:b,onSelectRow:I,onSelectAllRows:A,onSort:H,onChangePage:M,onChangeDense:O,onResetPage:N,onChangeRowsPerPage:L,onUpdatePageDeleteRow:U,onUpdatePageDeleteRows:K,setPage:l,setDense:e,setOrder:R,setOrderBy:m,setSelected:f,setRowsPerPage:n}},Pe=we;function at(t,o,e){return t.slice(o*e,o*e+e)}function nt(t,o,e){return t?Math.max(0,(1+t)*o-e):0}function E(t,o,e){return t[e]?!o[e]||o[e]<t[e]?-1:o[e]>t[e]?1:0:1}function lt(t,o){return t==="desc"?(e,r)=>E(e,r,o):(e,r)=>-E(e,r,o)}
|
|
21
20
|
|
|
22
|
-
export {
|
|
21
|
+
export { $ as TableEmptyRows, B as TableHeadCustom, ee as TableNoData, le as TablePaginationCustom, de as TableSelectedAction, he as TableSkeleton, nt as emptyRows, lt as getComparator, at as rowInPage, Pe as useTable };
|
|
@@ -5,8 +5,8 @@ export { p as RejectionFiles } from '../../chunk-ISYQXE75.js';
|
|
|
5
5
|
import '../../chunk-EVIELOMC.js';
|
|
6
6
|
import '../../chunk-RQ5Q6X5Y.js';
|
|
7
7
|
import '../../chunk-H5L4ARDB.js';
|
|
8
|
-
import '../../chunk-ANAHA3L6.js';
|
|
9
8
|
import '../../chunk-QREMZNLF.js';
|
|
9
|
+
import '../../chunk-ANAHA3L6.js';
|
|
10
10
|
import '../../chunk-SVWZMU2S.js';
|
|
11
11
|
import '../../chunk-2P4CXK3O.js';
|
|
12
12
|
import '../../chunk-FK7DDO5L.js';
|