@zydon/common 2.1.41 → 2.1.43
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.
|
@@ -5,12 +5,12 @@ import { a } from './chunk-C7G4JHJP.js';
|
|
|
5
5
|
import { a as a$1 } from './chunk-M6QHAL4V.js';
|
|
6
6
|
import { useState, useEffect } from 'react';
|
|
7
7
|
import { useDropzone } from 'react-dropzone';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import I from '@mui/material/Box';
|
|
9
|
+
import F from '@mui/material/Typography';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import N from '@mui/material/Dialog';
|
|
12
12
|
import T from '@mui/material/Stack';
|
|
13
13
|
|
|
14
|
-
function j({sx:p,error:s,file:e,disabled:l,helperText:c$1,...d}){let{getRootProps:g,getInputProps:v,isDragActive:u,isDragReject:y,fileRejections:m}=useDropzone({multiple:!1,disabled:l,accept:{"image/*":[]},...d}),r=!!e,i$1=y||!!s,[C,f]=useState("");useEffect(()=>{typeof e=="string"?f(e):e instanceof File&&f(URL.createObjectURL(e));},[e]);let w=r&&jsx("img",{alt:"avatar",src:C,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),b=jsxs(
|
|
14
|
+
function j({sx:p,error:s,file:e,disabled:l,helperText:c$1,...d}){let{getRootProps:g,getInputProps:v,isDragActive:u,isDragReject:y,fileRejections:m}=useDropzone({multiple:!1,disabled:l,accept:{"image/*":[]},...d}),r=!!e,i$1=y||!!s,[C,f]=useState("");useEffect(()=>{typeof e=="string"?f(e):e instanceof File&&f(URL.createObjectURL(e));},[e]);let w=r&&jsx("img",{alt:"avatar",src:C,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),b=jsxs(I,{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},...i$1&&{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(F,{variant:"caption",children:r?"Atualizar foto":"Enviar foto"})]}),R=jsxs(I,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[w,b]});return jsxs(Fragment,{children:[jsxs(I,{...g(),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)}`,...u&&{opacity:.72},...l&&{opacity:.48,pointerEvents:"none"},...i$1&&{borderColor:"error.main"},...r&&{...i$1&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...p},children:[jsx("input",{...v()}),R]}),c$1&&c$1,jsx(c,{files:m})]})}var _=({onFileCropped:p,onImageUploaded:s,onCancel:e,aspect:l,label:c,image:d="",uploading:g,file:v,tabIndex:u,...y})=>{let{id:m,setCropModalOpen:r,handleRemove:i,cropModalOpen:C,cancelChanges:f$1,saveChanges:w,previewImage:b,setCropper:R,preview:o,closePreviewImage:L,saving:B}=a$1({onFileCropped:p,onImageUploaded:s,onCancel:e});return jsxs(Fragment,{children:[jsxs(T,{position:"relative",alignItems:"center",justifyContent:"center",children:[g&&jsx(f,{}),jsx(j,{...y,id:m,file:v,onDrop:x=>{if(x.length>0){r(!0);let P=new FileReader;P.addEventListener("load",()=>{let M=P.result?.toString()||"";s(M),p(x[0]);}),P.readAsDataURL(x[0]);}},image:d,tabIndex:u})]}),jsx(a$2,{id:m,open:C,onClose:f$1,label:c,aspectRatio:l,imageSrc:d,onRemove:i,onSave:w,onPreview:b,onInitialized:R,loading:B}),jsx(N,{open:!!o,onClose:L,scroll:"body",PaperProps:{sx:{p:2}},children:o&&jsx("img",{src:o,alt:"Preview"})})]})},no=_;
|
|
15
15
|
|
|
16
16
|
export { j as a, no as b };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import Captions from 'yet-another-react-lightbox/plugins/captions';
|
|
3
3
|
import { LightboxExternalProps, Slide } from 'yet-another-react-lightbox';
|
|
4
|
+
export { Slide } from 'yet-another-react-lightbox';
|
|
4
5
|
|
|
5
6
|
type LightBoxProps = LightboxExternalProps & {
|
|
6
7
|
disableZoom?: boolean;
|
|
@@ -11,6 +11,6 @@ import y from 'yet-another-react-lightbox/plugins/zoom';
|
|
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
import { useState, useCallback } from 'react';
|
|
13
13
|
|
|
14
|
-
var f={root:"mnl__lightbox__root"};function
|
|
14
|
+
var f={root:"mnl__lightbox__root"};function H({slides:i,disableZoom:l,disableVideo:n,disableTotal:p,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t,onGetCurrentIndex:a$1,render:I,...E}){let m=i?i.length:0;return jsx(C,{slides:i,animation:{swipe:240},carousel:{finite:m<5},controller:{closeOnBackdropClick:!0},plugins:L({disableZoom:l,disableVideo:n,disableCaptions:c,disableSlideshow:s,disableThumbnails:o,disableFullscreen:t}),on:{view:({index:_})=>{a$1&&a$1(_);}},toolbar:{buttons:[jsx(P,{totalItems:m,disableTotal:p},0),"close"]},render:{iconClose:()=>jsx(a,{width:24,icon:"CLOSE_MARK_BUTTON"}),iconZoomIn:()=>jsx(a,{width:24,icon:"ZOOM_IN"}),iconZoomOut:()=>jsx(a,{width:24,icon:"ZOOM_OUT"}),iconSlideshowPlay:()=>jsx(a,{width:24,icon:"PLAY_EXECUTE"}),iconSlideshowPause:()=>jsx(a,{width:24,icon:"PAUSE"}),iconPrev:()=>jsx(a,{width:32,icon:"CHEVRON_LEFT"}),iconNext:()=>jsx(a,{width:32,icon:"CHEVRON_RIGHT"}),iconExitFullscreen:()=>jsx(a,{width:24,icon:"MINIMIZE_SCREEN"}),iconEnterFullscreen:()=>jsx(a,{width:24,icon:"MAXIMIZE_SCREEN"}),...I},className:f.root,...E})}function L({disableZoom:i,disableVideo:l,disableCaptions:n,disableSlideshow:p,disableThumbnails:c,disableFullscreen:s}){let o=[d,h,u,x,g,y];return c&&(o=o.filter(t=>t!==x)),n&&(o=o.filter(t=>t!==d)),s&&(o=o.filter(t=>t!==h)),p&&(o=o.filter(t=>t!==u)),i&&(o=o.filter(t=>t!==y)),l&&(o=o.filter(t=>t!==g)),o}function P({totalItems:i,disableTotal:l}){let{currentIndex:n}=useLightboxState();return l?null:jsxs(w,{component:"span",className:"yarl__button",sx:{typography:"body2",alignItems:"center",display:"inline-flex",justifyContent:"center"},children:[jsxs("strong",{children:[" ",n+1," "]})," / ",i]})}function j(i){let[l,n]=useState(-1),p=useCallback(s=>{let o=i.findIndex(t=>t.type==="video"?t.poster===s:t.src===s);n(o);},[i]),c=useCallback(()=>{n(-1);},[]);return {selected:l,open:l>=0,onOpen:p,onClose:c,setSelected:n}}
|
|
15
15
|
|
|
16
|
-
export { P as DisplayTotal,
|
|
16
|
+
export { P as DisplayTotal, H as Lightbox, L as getPlugins, j as useLightBox };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as UploadAvatar, b as UploadAvatarWithCrop, b as UploadWithCrop } from '../../chunk-
|
|
1
|
+
export { a as UploadAvatar, b as UploadAvatarWithCrop, b as UploadWithCrop } from '../../chunk-L6JOQSV3.js';
|
|
2
2
|
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload } from '../../chunk-RWZXAZAO.js';
|
|
3
3
|
export { c as RejectionFiles } from '../../chunk-MJDNBI4A.js';
|
|
4
4
|
import '../../chunk-KBGIGYDP.js';
|