@zydon/common 2.3.75 → 2.3.76
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-373LAZQA.js +19 -0
- package/dist/components/form/UploadAvatarWithCrop/index.js +1 -1
- package/dist/components/upload/index.d.ts +1 -1
- package/dist/components/upload/index.js +1 -1
- package/dist/theme/styles/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-WWK537HP.js +0 -18
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { p, f } from './chunk-4VAXJ4XM.js';
|
|
2
|
+
import { a as a$3 } from './chunk-WB44OSQ3.js';
|
|
3
|
+
import { e } from './chunk-ANAHA3L6.js';
|
|
4
|
+
import { i } from './chunk-D27ND54J.js';
|
|
5
|
+
import { a } from './chunk-JAXAPLBP.js';
|
|
6
|
+
import { a as a$2 } from './chunk-KFZEM7KS.js';
|
|
7
|
+
import { a as a$1 } from './chunk-X24QANPC.js';
|
|
8
|
+
import { useState, useEffect } from 'react';
|
|
9
|
+
import { useDropzone } from 'react-dropzone';
|
|
10
|
+
import U from '@mui/material/Box';
|
|
11
|
+
import _ from '@mui/material/CircularProgress';
|
|
12
|
+
import H from '@mui/material/Typography';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
|
+
import J from '@mui/material/Dialog';
|
|
15
|
+
import K from '@mui/material/Stack';
|
|
16
|
+
|
|
17
|
+
function F({sx:n,error:s,file:r,disabled:m,uploading:u,helperText:p$1,...y}){let{getRootProps:C,getInputProps:b,isDragActive:f,isDragReject:g,fileRejections:w}=useDropzone({multiple:!1,disabled:m,accept:{"image/*":[]},...y}),e=!!r,l=g||!!s,[R,h]=useState();useEffect(()=>{typeof r=="string"?h(r):r instanceof File&&h(URL.createObjectURL(r));},[r]);let P=e&&jsx("img",{alt:"avatar",src:R,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),x=jsx(U,{className:"upload-placeholder",sx:{top:0,gap:1,left:0,width:1,height:1,zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:"text.disabled",flexDirection:"column",justifyContent:"center",bgcolor:o=>i(o.vars.palette.grey["500Channel"],.08),transition:o=>o.transitions.create(["opacity"],{duration:o.transitions.duration.shorter}),"&:hover":{opacity:.72},...l&&{color:"error.main",bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},...e&&{zIndex:9,opacity:0,color:"common.white",bgcolor:o=>i(o.vars.palette.grey["900Channel"],.64)}},children:u?jsx(_,{size:30,color:"primary"}):jsxs(Fragment,{children:[jsx(a,{icon:"ADD_IMAGE",width:32}),jsx(H,{variant:"caption",children:e?"Atualizar foto":"Enviar foto"})]})}),I=jsxs(U,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[P,x]});return jsxs(Fragment,{children:[jsxs(U,{...C(),sx:{p:1,m:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:o=>`1px dashed ${i(o.vars.palette.grey["500Channel"],.2)}`,...f&&{opacity:.72},...m&&{opacity:.48,pointerEvents:"none"},...l&&{borderColor:"error.main"},...e&&{...l&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...n},children:[jsx("input",{...b()}),I]}),p$1&&p$1,jsx(p,{files:w})]})}var Q=({onFileCropped:n,onImageUploaded:s,onCancel:r,aspect:m,label:u,image:p="",uploading:y,file:C,tabIndex:b,maxSize:f$1,onDropRejected:g,...w})=>{let{id:e$1,setCropModalOpen:l,handleRemove:R,cropModalOpen:h,cancelChanges:P,saveChanges:x,previewImage:I,setCropper:o,preview:D,closePreviewImage:W,saving:$}=a$1({onFileCropped:n,onImageUploaded:s,onCancel:r}),{error:q}=a$2();return jsxs(Fragment,{children:[jsxs(K,{position:"relative",alignItems:"center",justifyContent:"center",children:[y&&jsx(f,{}),jsx(F,{...w,maxSize:f$1,id:e$1,file:C,onDrop:i=>{if(i.length>0){l(!0);let c=new FileReader;c.addEventListener("load",()=>{let A=c.result?.toString()||"";s(A),n(i[0]);}),c.readAsDataURL(i[0]);}},image:p,tabIndex:b,onDropRejected:(i,c)=>{let A=i[0]?.errors[0]?.code;s(void 0),n(void 0),q(A==="file-too-large"?`Imagem n\xE3o pode ser maior que ${e(f$1)}`:"Erro ao enviar imagem"),g&&g(i,c);}})]}),jsx(a$3,{id:e$1,open:h,onClose:P,label:u,aspectRatio:m,imageSrc:p,onRemove:R,onSave:x,onPreview:I,onInitialized:o,loading:$}),jsx(J,{open:!!D,onClose:W,scroll:"body",PaperProps:{sx:{p:2}},children:D&&jsx("img",{src:D,alt:"Preview"})})]})},uo=Q;
|
|
18
|
+
|
|
19
|
+
export { F as a, uo as b };
|
|
@@ -59,7 +59,7 @@ declare function RejectionFiles({ files }: Props): react_jsx_runtime.JSX.Element
|
|
|
59
59
|
|
|
60
60
|
declare const Upload: ({ id, disabled, multiple, error, helperText, file, onDelete, files, thumbnail, onRemove, onHandleMainImage, mainUrl, sx, dropZoneProps, placeholderProps, placeholderAlt, uploading, image, tabIndex, preview, onRemoveAll, onUpload, onReorder, ...other }: UploadProps) => react_jsx_runtime.JSX.Element;
|
|
61
61
|
|
|
62
|
-
declare function UploadAvatar({ sx, error, file: value, disabled, helperText, ...other }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
declare function UploadAvatar({ sx, error, file: value, disabled, uploading, helperText, ...other }: UploadProps): react_jsx_runtime.JSX.Element;
|
|
63
63
|
|
|
64
64
|
declare const UploadAvatarWithCrop: ({ onFileCropped, onImageUploaded, onCancel, aspect, label, image, uploading, file, tabIndex, maxSize, onDropRejected, ...other }: UploadWithCropProps) => react_jsx_runtime.JSX.Element;
|
|
65
65
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-
|
|
1
|
+
export { a as UploadAvatar, b as UploadAvatarWithCrop } from '../../chunk-373LAZQA.js';
|
|
2
2
|
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload, e as UploadWithCrop } from '../../chunk-MMTDVFNL.js';
|
|
3
3
|
import { o } from '../../chunk-4VAXJ4XM.js';
|
|
4
4
|
export { p as RejectionFiles } from '../../chunk-4VAXJ4XM.js';
|
|
@@ -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 (
|
|
446
|
+
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | 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" | "reverse" | "linear" | "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;
|
package/package.json
CHANGED
package/dist/chunk-WWK537HP.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { p, f } from './chunk-4VAXJ4XM.js';
|
|
2
|
-
import { a as a$3 } from './chunk-WB44OSQ3.js';
|
|
3
|
-
import { e } from './chunk-ANAHA3L6.js';
|
|
4
|
-
import { i } from './chunk-D27ND54J.js';
|
|
5
|
-
import { a } from './chunk-JAXAPLBP.js';
|
|
6
|
-
import { a as a$2 } from './chunk-KFZEM7KS.js';
|
|
7
|
-
import { a as a$1 } from './chunk-X24QANPC.js';
|
|
8
|
-
import { useState, useEffect } from 'react';
|
|
9
|
-
import { useDropzone } from 'react-dropzone';
|
|
10
|
-
import A from '@mui/material/Box';
|
|
11
|
-
import T from '@mui/material/Typography';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import H from '@mui/material/Dialog';
|
|
14
|
-
import J from '@mui/material/Stack';
|
|
15
|
-
|
|
16
|
-
function M({sx:n,error:s,file:e,disabled:d,helperText:m,...f}){let{getRootProps:y,getInputProps:C,isDragActive:b,isDragReject:g,fileRejections:h}=useDropzone({multiple:!1,disabled:d,accept:{"image/*":[]},...f}),r=!!e,t=g||!!s,[w,v]=useState();useEffect(()=>{typeof e=="string"?v(e):e instanceof File&&v(URL.createObjectURL(e));},[e]);let R=r&&jsx("img",{alt:"avatar",src:w,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),x=jsxs(A,{className:"upload-placeholder",sx:{top:0,gap:1,left:0,width:1,height:1,zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:"text.disabled",flexDirection:"column",justifyContent:"center",bgcolor:o=>i(o.vars.palette.grey["500Channel"],.08),transition:o=>o.transitions.create(["opacity"],{duration:o.transitions.duration.shorter}),"&:hover":{opacity:.72},...t&&{color:"error.main",bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},...r&&{zIndex:9,opacity:0,color:"common.white",bgcolor:o=>i(o.vars.palette.grey["900Channel"],.64)}},children:[jsx(a,{icon:"ADD_IMAGE",width:32}),jsx(T,{variant:"caption",children:r?"Atualizar foto":"Enviar foto"})]}),P=jsxs(A,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[R,x]});return jsxs(Fragment,{children:[jsxs(A,{...y(),sx:{p:1,m:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:o=>`1px dashed ${i(o.vars.palette.grey["500Channel"],.2)}`,...b&&{opacity:.72},...d&&{opacity:.48,pointerEvents:"none"},...t&&{borderColor:"error.main"},...r&&{...t&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...n},children:[jsx("input",{...C()}),P]}),m&&m,jsx(p,{files:h})]})}var K=({onFileCropped:n,onImageUploaded:s,onCancel:e$1,aspect:d,label:m,image:f$1="",uploading:y,file:C,tabIndex:b,maxSize:g,onDropRejected:h,...r})=>{let{id:t,setCropModalOpen:w,handleRemove:v,cropModalOpen:R,cancelChanges:x,saveChanges:P,previewImage:o,setCropper:F,preview:I,closePreviewImage:O,saving:W}=a$1({onFileCropped:n,onImageUploaded:s,onCancel:e$1}),{error:$}=a$2();return jsxs(Fragment,{children:[jsxs(J,{position:"relative",alignItems:"center",justifyContent:"center",children:[y&&jsx(f,{}),jsx(M,{...r,maxSize:g,id:t,file:C,onDrop:i=>{if(i.length>0){w(!0);let p=new FileReader;p.addEventListener("load",()=>{let D=p.result?.toString()||"";s(D),n(i[0]);}),p.readAsDataURL(i[0]);}},image:f$1,tabIndex:b,onDropRejected:(i,p)=>{let D=i[0]?.errors[0]?.code;s(void 0),n(void 0),$(D==="file-too-large"?`Imagem n\xE3o pode ser maior que ${e(g)}`:"Erro ao enviar imagem"),h&&h(i,p);}})]}),jsx(a$3,{id:t,open:R,onClose:x,label:m,aspectRatio:d,imageSrc:f$1,onRemove:v,onSave:P,onPreview:o,onInitialized:F,loading:W}),jsx(H,{open:!!I,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:I&&jsx("img",{src:I,alt:"Preview"})})]})},ho=K;
|
|
17
|
-
|
|
18
|
-
export { M as a, ho as b };
|