@zydon/common 2.7.15 → 2.7.17
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-JALBND3K.js +34 -0
- package/dist/components/FileUpload/index.d.ts +10 -347
- package/dist/components/FileUpload/index.js +13 -34
- package/dist/components/form/FileUpload/index.d.ts +240 -0
- package/dist/components/form/FileUpload/index.js +25 -0
- package/dist/index.d.ts +2 -2
- package/dist/theme/core/index.d.ts +1 -1
- package/dist/theme/styles/index.d.ts +13 -13
- package/dist/types-90c7bcee.d.ts +352 -0
- package/package.json +1 -1
- package/dist/{index-3e407e51.d.ts → index-8a737d25.d.ts} +12 -12
|
@@ -1,39 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
export { p as ContentType, q as FileContentType, i as FileThumbnail, a as HelperText, b as MultiFilePreview, s as MultipleFileUpload, t as MultipleImageUpload, c as SingleFilePreview, u as SingleFileUpload, v as SingleImageUpload, w as UploadAvatar, x as UploadSimpleBox, l as compressImageWithoutCrop, k as convertToWebP, n as encodeFilenameForHeader, d as fileFormat, g as fileNameByUrl, e as fileThumb, h as fileThumbnailClasses, f as fileTypeByUrl, m as getFileNameFromContentDisposition, j as isImageFile, o as useDropzoneUploader, r as useFileUploadService } from '../../chunk-JALBND3K.js';
|
|
2
|
+
import '../../chunk-H5L4ARDB.js';
|
|
3
|
+
import '../../chunk-3X7KMUN3.js';
|
|
4
|
+
import '../../chunk-ANAHA3L6.js';
|
|
5
|
+
import '../../chunk-2FXBVVBD.js';
|
|
6
|
+
import '../../chunk-KA6PGKWV.js';
|
|
6
7
|
import '../../chunk-GZ4UBWZJ.js';
|
|
7
8
|
import '../../chunk-7AZX7L27.js';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import '../../chunk-DUFPX4QZ.js';
|
|
10
|
+
import '../../chunk-2P4CXK3O.js';
|
|
11
|
+
import '../../chunk-FK7DDO5L.js';
|
|
12
|
+
import '../../chunk-DMQW3LDF.js';
|
|
13
|
+
import '../../chunk-WIJV4EHZ.js';
|
|
13
14
|
import '../../chunk-FO7JCJ76.js';
|
|
14
15
|
import '../../chunk-C2JZG45F.js';
|
|
15
16
|
import '../../chunk-ILHUUK4X.js';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { memo, forwardRef, useMemo, useLayoutEffect, useCallback, useRef, useState, useEffect } from 'react';
|
|
19
|
-
import Ho from '@mui/material/FormHelperText';
|
|
20
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
21
|
-
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
22
|
-
import { restrictToHorizontalAxis, restrictToParentElement, restrictToWindowEdges } from '@dnd-kit/modifiers';
|
|
23
|
-
import { useSortable, sortableKeyboardCoordinates, SortableContext, horizontalListSortingStrategy } from '@dnd-kit/sortable';
|
|
24
|
-
import { m, AnimatePresence } from 'framer-motion';
|
|
25
|
-
import he from '@mui/material/Stack';
|
|
26
|
-
import Je from '@mui/material/Typography';
|
|
27
|
-
import De from '@mui/material/Box';
|
|
28
|
-
import qo from '@mui/material/IconButton';
|
|
29
|
-
import Vo from '@mui/material/Paper';
|
|
30
|
-
import { styled, alpha } from '@mui/material/styles';
|
|
31
|
-
import Qo from '@mui/material/Badge';
|
|
32
|
-
import Br from '@mui/material/ButtonBase';
|
|
33
|
-
import jr from '@mui/material/Tooltip';
|
|
34
|
-
import { useDropzone } from 'react-dropzone';
|
|
35
|
-
import Nt from '@mui/material/CircularProgress';
|
|
36
|
-
|
|
37
|
-
var $o=({helperText:e,disabled:o,isError:r})=>e?jsx(Ho,{error:r,sx:t=>({mx:"14px",color:o?t.palette.grey[500]:void 0}),children:e}):null,O=memo($o);var Me=styled(he)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),ke=styled(he)({position:"absolute",top:4,right:4,gap:.5,"& svg":{width:16,height:16}}),ao=styled(De,{shouldForwardProp:e=>!["isDragActive","isError","disabled"].includes(e)})(({theme:e,isDragActive:o,isError:r,disabled:t})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`dashed 1px ${e.palette.divider}`,...o&&{opacity:.72},...r&&{color:e.palette.error.main,backgroundColor:e.palette.error.lighter,borderColor:e.palette.error.light},...t&&{opacity:.48,pointerEvents:"none"},"&:hover":{opacity:.72}}));styled(he)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:e.palette.background.paper}}}));var no=styled(qo)(({theme:e})=>({position:"relative",zIndex:999,pointerEvents:"auto",color:e.palette.grey[700],backgroundColor:e.palette.grey[100],"&:hover":{color:e.palette.grey[900],backgroundColor:e.palette.grey[300]}})),He=styled("div")({position:"relative",zIndex:1,userSelect:"none","&:hover":{zIndex:2}}),so=styled(he,{shouldForwardProp:e=>!["isDragging"].includes(e)})(({theme:e,width:o,isDragging:r})=>({width:o,height:100,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2,1,2,1),gap:e.spacing(1),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),lo=styled(m.div)(({theme:e,width:o,isDragging:r})=>({width:o,height:60,alignItems:"center",display:"inline-flex",justifyContent:"center",margin:e.spacing(.5),padding:e.spacing(2),borderRadius:e.spacing(1.25),overflow:"hidden",position:"relative",border:`solid 1px ${e.palette.divider}`,backgroundColor:e.palette.common.white,zIndex:1,transition:"box-shadow 150ms ease-in-out",boxShadow:r?`0 0 0 2px ${e.palette.primary.main}, ${e.customShadows.z8}, inset 0 0 0 1000px ${alpha(e.palette.primary.main,.06)}`:"0px 0px 0px 0px rgba(0, 0, 0, 0)"})),po=styled(a)(({theme:e})=>({top:16,right:16,zIndex:9,position:"absolute",color:e.palette.common.white,backgroundColor:alpha(e.palette.grey[900],.72),"&:hover":{backgroundColor:alpha(e.palette.grey[900],.48)}})),mo=styled(De,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="disabled"&&e!=="hasError"})(({theme:e,isDragActive:o,disabled:r,hasError:t})=>({width:64,height:64,flexShrink:0,display:"flex",borderRadius:1,cursor:"pointer",alignItems:"center",color:e.palette.text.disabled,justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),border:`dashed 1px ${alpha(e.palette.grey[500],.16)}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...t&&{color:e.palette.error.main,borderColor:e.palette.error.main,backgroundColor:alpha(e.palette.error.main,.08)},"&:hover":{opacity:.72}})),co=styled(De)(({theme:e})=>({padding:e.spacing(1),top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out",filter:"blur(0)","&:hover":{filter:"blur(3px)"}})),go=styled("img",{shouldForwardProp:e=>e!=="aspectRatio"&&e!=="isLoading"&&e!=="isUploading"&&e!=="maxWidth"&&e!=="maxHeight"&&e!=="cropSize"})(({theme:e,aspectRatio:o,maxWidth:r,maxHeight:t,isLoading:n,isUploading:s})=>({borderRadius:e.shape.borderRadius,objectFit:"cover",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)",filter:"blur(0)",zIndex:1,maxWidth:r,maxHeight:t,backgroundColor:e.palette.background.paper,aspectRatio:Math.abs(o),...Math.abs(o)>1?{width:"calc(100% - 16px)",height:void 0}:{width:void 0,height:"calc(100% - 16px)"},transition:"all 0.5s ease-in-out",...n||s?{opacity:0,filter:"blur(1.5rem)",transform:"translate(-50%, -50%) scale(0.7)"}:{},"&:hover":{transition:"all 0.2s ease-in-out"}})),uo=styled("img",{shouldForwardProp:e=>e!=="isLoading"&&e!=="isUploading"})(({isLoading:e,isUploading:o})=>({width:"100%",height:"100%",objectFit:"cover",top:0,left:0,filter:"blur(1.5rem)",transform:"scale(1.1)",position:"absolute",zIndex:0,transition:"opacity 0.3s ease-in-out",...e&&{opacity:0},...o&&{opacity:.7,filter:"blur(2rem)"}})),fo=styled(he)({width:"100%",height:"100%",position:"relative",overflow:"hidden",borderRadius:"50%",justifyContent:"center",alignItems:"center"});styled(Vo)(({theme:e})=>({py:1,px:2,mt:3,textAlign:"left",borderStyle:"dashed",borderColor:"error.main",backgroundColor:alpha(e.palette.error.main,.08)}));var $e=styled(De,{shouldForwardProp:e=>e!=="isError"&&e!=="hasFile"})(({theme:e,isError:o,hasFile:r})=>({top:0,gap:e.spacing(1),left:0,width:"100%",height:"100%",zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:e.palette.text.disabled,flexDirection:"column",justifyContent:"center",backgroundColor:alpha(e.palette.grey[500],.08),transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter}),"&:hover":{opacity:.92},...o&&{color:e.palette.error.main},...r&&{zIndex:9,opacity:0,color:e.palette.common.white,backgroundColor:alpha(e.palette.common.black,.54)}})),xo=styled(he)({top:0,left:0,right:0,bottom:0,position:"absolute",zIndex:10,alignItems:"center",justifyContent:"center",opacity:.8});styled(he)(({theme:e})=>({padding:20,justifyContent:"center",alignItems:"center",gap:4,alignSelf:"stretch",borderRadius:12,background:e.palette.divider,color:e.palette.text.disabled,height:160}));var ho=styled(De,{shouldForwardProp:e=>e!=="isDragActive"&&e!=="isError"&&e!=="hasFile"})(({theme:e,isDragActive:o,disabled:r,isError:t,hasFile:n})=>({padding:e.spacing(1),margin:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:`1px dashed ${e.palette.divider}`,...o&&{opacity:.72},...r&&{opacity:.48,pointerEvents:"none"},...t&&{borderColor:"error.main"},...n&&{...t&&{bgcolor:alpha(e.palette.error.main,.08)},"&:hover .upload-placeholder":{opacity:1},"& img":{filter:"blur(0)"},"&:hover img":{filter:"blur(3px)"}}})),bo=styled("img")({width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover",transition:"all 0.3s ease-in-out"}),Io=styled(a)(({theme:e})=>({backgroundColor:alpha(e.palette.grey[900],.72),color:e.palette.common.white,"&:hover":{backgroundColor:alpha(e.palette.grey[600],.64),color:e.palette.common.white},"& svg":{width:14,height:14}}));var Yo=({onRemove:e,sx:o,file:r,disableDrag:t,attributes:n,listeners:s,innerWidth:i,isDragging:d})=>{let p=r?.id;return p?jsx(Qo,{anchorOrigin:{vertical:"top",horizontal:"left"},children:jsxs(lo,{width:i,isDragging:d,"data-testid":`preview-multi-img-${p}`,...j().inUp,sx:o,children:[jsx(a$2,{disableDrag:t,...n,...s}),jsx(Ee,{imageView:!0,file:r}),jsx(ke,{sx:{position:"absolute",right:3,top:3,zIndex:1},children:e&&jsx(Io,{size:"small",label:"Remover arquivo",onClick:()=>e(r),icon:"DELETE_MARK_BUTTON_02"})})]})},`badge-${p}`):null},Po=memo(Yo);var ir=({file:e$1,thumbnail:o,onRemove:r,sx:t,disableDrag:n=!1})=>{let s=e$1.size||0,i=e$1.name||e$1.id,d=e$1.id,p=typeof e$1=="string",m=n?70:80,{attributes:l,listeners:u,setNodeRef:b,transform:F,transition:R,isDragging:I}=useSortable({id:d,disabled:n}),C={transform:x.Transform.toString(F),transition:R,display:"inline-block",alignItems:"center",justifyContent:"center",width:`${m+8}px`,height:"68px"};return o&&e$1?jsx(He,{ref:b,style:C,children:jsx(Po,{innerWidth:m,isDragging:I,sx:t,file:e$1,disableDrag:n,attributes:l,listeners:u,onRemove:r})}):jsx(He,{ref:b,style:{...C,height:"80px",width:`${m+38}px`},children:jsxs(so,{width:m+30,isDragging:I,"data-testid":`preview-multi-img-${d}`,...j().inUp,sx:t,children:[jsx(a$2,{disableDrag:n,...l,...u}),e$1&&jsx(Ee,{file:e$1}),jsxs(he,{flexGrow:1,sx:{width:"100%"},children:[jsx(a$3,{title:i,children:jsx(Je,{variant:"subtitle2",noWrap:!0,children:i})}),jsx(Je,{variant:"caption",sx:{color:"text.secondary"},children:p?"":e(s)})]}),jsx(ke,{children:r&&jsx(a,{size:"small",label:"Remover arquivo",onClick:()=>r(e$1),icon:"DELETE_MARK_BUTTON_02"})})]})})},Fo=memo(ir);var Ir=({thumbnail:e,files:o,onRemove:r,onReorder:t,sx:n})=>{let s=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),i=useCallback(p=>{let{active:m,over:l}=p;if(!(!m||!l||m.id===l.id)&&t){let u=o.findIndex(({id:F})=>F===m.id),b=o.findIndex(({id:F})=>F===l.id);u!==-1&&b!==-1&&t(u,b,o);}},[o,t]),d=jsx(AnimatePresence,{initial:!1,children:o.map(p=>jsx(Fo,{sx:n,id:`preview-file-${p.id}`,file:p,onRemove:r,thumbnail:e,disableDrag:!t},`preview-file-${p.id}`))});return t?jsx(DndContext,{sensors:s,collisionDetection:closestCenter,onDragEnd:i,modifiers:[restrictToHorizontalAxis,restrictToParentElement,restrictToWindowEdges],children:jsx(SortableContext,{items:o.map(p=>p.id),strategy:horizontalListSortingStrategy,children:d})}):d},_e=memo(Ir);var Ao=forwardRef(({onLoading:e,aspectRatio:o,cropSize:r,...t},n)=>{let{maxWidth:s,maxHeight:i}=useMemo(()=>r&&typeof r=="object"?{maxWidth:r.width,maxHeight:r.height}:r&&typeof r=="number"?{maxWidth:r,maxHeight:r}:{maxWidth:"100%",maxHeight:"100%"},[r]);a$1(()=>{e?.(!0);}),useLayoutEffect(()=>{typeof n=="object"&&n?.current?e?.(!n.current.complete):e?.(!1);},[n,e]);function d(){e?.(!1);}return jsx(go,{...t,maxWidth:s,maxHeight:i,ref:n,aspectRatio:o,onLoad:d,onError:d})});Ao.displayName="LoadingPreviewImage";var Do=Ao;var Dr=({file:e,aspectRatio:o=1,isUploading:r,isLoading:t,onLoading:n,cropSize:s,maxWidth:i,maxHeight:d})=>{let p=useRef(null),m=e?.id||"",l=e?.name||"",u=URL.createObjectURL(e);return m?jsxs(co,{className:"single-file-preview-box",children:[jsx(Do,{className:"single-file-preview-img",aspectRatio:o,cropSize:s,isLoading:t,isUploading:r,alt:l,src:u,ref:p,loading:"lazy",onLoading:n,onLoad:()=>n?.(!1),onError:()=>n?.(!1),maxWidth:i,maxHeight:d},`image-preview-${m}`),jsx(uo,{className:"single-file-preview-bg",alt:l,src:u,isLoading:t,isUploading:r})]}):null},Xe=memo(Dr);var _r=["pdf"],Sr=["txt"],Tr=["psd"],Or=["doc","docx"],Ur=["xls","xlsx"],yr=["zip","rar","iso"],Cr=["ai","eps"],Lr=["ppt","pptx"],Mr=["wav","aif","mp3","aac"],kr=["jpg","jpeg","gif","bmp","png","svg","webp"],zr=["m4v","avi","mpg","mp4","webm"];function qe(e){let o,r=_o(e);return Sr.includes(r)?o="txt":yr.includes(r)?o="zip":Mr.includes(r)?o="audio":kr.includes(r)?o="image":zr.includes(r)?o="video":Or.includes(r)?o="word":Ur.includes(r)?o="excel":Lr.includes(r)?o="powerpoint":_r.includes(r)?o="pdf":Tr.includes(r)?o="photoshop":Cr.includes(r)?o="illustrator":e?.startsWith("http")?o="image":o=_o(e),o}function So(e){let o;switch(qe(e)){case"folder":o="IC_FOLDER";break;case"txt":o="IC_TXT";break;case"zip":o="IC_ZIP";break;case"audio":o="IC_AUDIO";break;case"video":o="IC_VIDEO";break;case"word":o="IC_WORD";break;case"excel":o="IC_EXCEL";break;case"powerpoint":o="IC_POWER_POINT";break;case"pdf":o="IC_PDF";break;case"photoshop":o="IC_PTS";break;case"illustrator":o="IC_AI";break;case"image":o="IC_IMG";break;default:o="IC_FILE";}return o}function _o(e){return e&&e.split(".").pop()||""}function ea(e){return e.split("/").pop()}var Ne={root:"mnl__file__thumbnail__root",img:"mnl__file__thumbnail__img",icon:"mnl__file__thumbnail__icon",removeBtn:"mnl__file__thumbnail__remove__button",downloadBtn:"mnl__file__thumbnail__download__button"},Ee=({sx:e,file:o,tooltip:r,onRemove:t,imageView:n,slotProps:s,onDownload:i,...d})=>{let p=URL.createObjectURL(o),m=o?.name||"",u=o.type.startsWith("image/")?"image":qe(p),b=jsx(De,{component:"img",src:p,className:Ne.img,sx:{width:1,height:1,objectFit:"cover",borderRadius:"inherit",...s?.img}}),F=jsx(a$4,{icon:So(u),sx:{width:32,height:32,flexShrink:0,...e}}),R=jsxs(he,{component:"span",className:Ne.root,sx:{width:36,height:36,flexShrink:0,borderRadius:1.25,alignItems:"center",position:"relative",display:"inline-flex",justifyContent:"center",...e},...d,children:[u==="image"&&n?b:F,t&&jsx(Br,{onClick:t,className:Ne.removeBtn,sx:s?.removeBtn,children:jsx(a$4,{icon:"CLOSE_MARK_BUTTON",width:24})}),i&&jsx(qo,{onClick:i,className:Ne.downloadBtn,sx:s?.downloadBtn,size:"small",children:jsx(a$4,{icon:"ARROW_DOWN_CICLE",width:12})})]});return r?jsx(jr,{arrow:!0,title:m,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,-12]}}]}},children:R}):R};var ma=e=>e.startsWith("image/"),To=(e,o=.8)=>new Promise((r,t)=>{let n=document.createElement("canvas"),s=n.getContext("2d"),i=new Image;i.onload=()=>{n.width=i.width,n.height=i.height,s?(s.drawImage(i,0,0),n.toBlob(d=>{if(d){let p=new File([d],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});r(p);}else t(new Error("Falha ao converter para WebP"));},"image/webp",o)):t(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},i.onerror=()=>t(new Error("Falha ao carregar imagem")),i.src=URL.createObjectURL(e);}),Oo=(e,o=.8,r,t)=>new Promise((n,s)=>{let i=document.createElement("canvas"),d=i.getContext("2d"),p=new Image;p.onload=()=>{let{width:m,height:l}=p;r&&m>r&&(l=l*r/m,m=r),t&&l>t&&(m=m*t/l,l=t),i.width=m,i.height=l,d?(d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(p,0,0,m,l),i.toBlob(u=>{if(u){let b=new File([u],e.name.replace(/\.[^/.]+$/,".webp"),{type:"image/webp",lastModified:Date.now()});n(b);}else s(new Error("Falha ao comprimir imagem"));},"image/webp",o)):s(new Error("N\xE3o foi poss\xEDvel obter contexto do canvas"));},p.onerror=()=>s(new Error("Falha ao carregar imagem")),p.src=URL.createObjectURL(e);}),Uo=e=>{let o=e.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i);return o?.[1]||o?.[2]||""},yo=e=>`UTF-8''${encodeURIComponent(e)}`;var Vr=({onFilesSelect:e$1,onFileSelect:o,onReorder:r,onRemove:t,uploadFiles:n,filesPreview:s,dropzoneOptions:i,enableCrop:d=!1,customAspectRatio:p,convertToWebp:m=!0,cropSize:l,maxFiles:u,compressionQuality:b=.8,maxCompressedWidth:F,maxCompressedHeight:R})=>{let{showErrorMessage:I}=a$8(),C=useMemo(()=>p||(l&&typeof l!="number"?l.width/l.height:1),[p,l]),[v,c]=useState([]),[E,w]=useState(!1),[_,L]=useState(null),[f,h]=useState(null),[g,A]=useState(""),[M,S]=useState(!1),[T,N]=useState([]),[V,G]=useState(0),[se,oe]=useState(0),re=x=>{if(x.length<1)return;let P=x[0];L(P),G(y=>y+1);let D=new FileReader;D.onload=()=>{A(D.result),w(!0);},D.readAsDataURL(P);},le=(x,P)=>{h(P);},ge=async x=>!_||!f?null:new Promise(P=>{let D=document.createElement("canvas"),y=D.getContext("2d"),k=new Image;k.onload=async()=>{let{width:B,height:pe,x:Se,y:Wo}=f,Go=Math.abs(C),Te=B,Oe=pe;l&&typeof l=="object"?(Te=l.width,Oe=l.height):l&&typeof l=="number"&&(Te=l,Oe=l/Go),D.width=Te,D.height=Oe,y?(y.drawImage(k,Se,Wo,B,pe,0,0,Te,Oe),D.toBlob(async eo=>{if(eo){let Ze=new File([eo],_.name,{type:_.type,lastModified:Date.now()});if(m)try{Ze=await To(Ze,b);}catch(jo){I(jo,"Erro ao converter para WebP");}let oo=Ze;oo.id=x,P(oo);}else P(null);},"image/png")):P(null);},k.src=g;}),ue=async()=>{if(!(!_||!f||T.length===0)){S(!0);try{let x=T[0],P=await ge(x.id);if(P){let y=await n([P]);y&&(!e$1&&!o&&c(k=>[...k,...y]),e$1?.([...s||[],...y]),o?.(P));}w(!1),S(!1),A(""),L(null);let D=T.slice(1);N(D),re(D);}catch(x){I(x,"Erro ao processar imagem"),S(!1);}}},j=()=>{w(!1),S(!1),A(""),L(null),N([]),G(0),oe(0);},K=async x=>{if(x.length===0)return;let P=Object.keys(i?.accept||{}).some(y=>y.includes("image/")),D=v.length+x.length;if(u&&D>u){I(new Error(`M\xE1ximo de ${u} arquivos`),"Erro ao fazer upload");return}try{if(P&&d){let k=x.filter(B=>B.type.startsWith("image/")).map((B,pe)=>{let Se=B;return Se.id=`temp-crop-${Date.now()}-${pe}`,Se});oe(k.length),G(0),N(k),re(k);}else {let y=[];for(let B of x)if(B.type.startsWith("image/")&&m)try{let pe=await Oo(B,b,F,R);y.push(pe);}catch(pe){I(pe,"Erro ao comprimir imagem"),y.push(B);}else y.push(B);let k=await n(y);k&&(!e$1&&!o&&c(B=>[...B,...k]),e$1?.([...s||[],...k]),o?.(k[0]));}}catch(y){I(y,"Erro ao processar arquivos");}},J=x=>{if(!x.length)return;let P=x[0]?.errors[0]?.code,D=i?.maxSize||3145728;I(P==="file-too-large"?new Error(`O arquivo excede o tamanho m\xE1ximo de ${e(D)}`):P==="file-invalid-type"?new Error("Formato de arquivo n\xE3o suportado"):x[0]?.errors[0]||new Error("Erro ao enviar arquivo"),"Erro ao fazer upload");},{getRootProps:te,getInputProps:Z,isDragActive:a,isDragReject:fe,fileRejections:ie}=useDropzone({onDrop:K,onDropRejected:J,...i}),we=x=>{if(!x){t||c([]),t?.(void 0);return}let P=v.filter(D=>D.id!==x.id);t||c(P),t?.(x);},H=(x,P,D)=>{r?.(x,P,D);},xe=useRef("");return useEffect(()=>{let x=s?.map(P=>P.id).join(",")||"";x!==xe.current&&(xe.current=x,c(s||[]));},[s]),{file:v?.[0],files:v,aspectRatio:C,dropzoneProps:{getRootProps:te,getInputProps:Z,isDragActive:a,isDragReject:fe,fileRejections:ie},cropState:{cropModalOpen:E,imagePreview:g,cropLoading:M,setCropModalOpen:w,onCropInitialized:le,handleCropSave:ue,handleCropCancel:j,currentImageIndex:V,totalPendingImages:se},setInitialFiles:c,handleRemove:we,handleReorder:H}},X=Vr;var Ve=(a=>(a.APPLICATION_OCTET_STREAM="application/octet-stream",a.IMAGE_JPEG="image/jpeg",a.IMAGE_JPG="image/jpg",a.IMAGE_PNG="image/png",a.IMAGE_GIF="image/gif",a.IMAGE_WEBP="image/webp",a.IMAGE_SVG="image/svg+xml",a.IMAGE_BMP="image/bmp",a.IMAGE_TIFF="image/tiff",a.IMAGE_ICO="image/x-icon",a.IMAGE_AVIF="image/avif",a.APPLICATION_PDF="application/pdf",a.TEXT_PLAIN="text/plain",a.TEXT_CSV="text/csv",a.APPLICATION_RTF="application/rtf",a.APPLICATION_MSWORD="application/msword",a.APPLICATION_DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",a.APPLICATION_MSEXCEL="application/vnd.ms-excel",a.APPLICATION_XLSX="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",a.APPLICATION_MSPOWERPOINT="application/vnd.ms-powerpoint",a.APPLICATION_PPTX="application/vnd.openxmlformats-officedocument.presentationml.presentation",a.APPLICATION_ODT="application/vnd.oasis.opendocument.text",a.APPLICATION_ODS="application/vnd.oasis.opendocument.spreadsheet",a.APPLICATION_ODP="application/vnd.oasis.opendocument.presentation",a.APPLICATION_XML="application/xml",a.TEXT_XML="text/xml",a.TEXT_HTML="text/html",a.TEXT_CSS="text/css",a.APPLICATION_JSON="application/json",a.TEXT_JAVASCRIPT="text/javascript",a.APPLICATION_ZIP="application/zip",a.APPLICATION_GZIP="application/gzip",a.APPLICATION_RAR="application/vnd.rar",a.APPLICATION_7Z="application/x-7z-compressed",a.AUDIO_MPEG="audio/mpeg",a.AUDIO_WAV="audio/wav",a.AUDIO_OGG="audio/ogg",a.AUDIO_WEBM="audio/webm",a.AUDIO_AAC="audio/aac",a.VIDEO_MP4="video/mp4",a.VIDEO_MPEG="video/mpeg",a.VIDEO_OGG="video/ogg",a.VIDEO_WEBM="video/webm",a.VIDEO_QUICKTIME="video/quicktime",a))(Ve||{}),Be=(e=>(e["application/octet-stream"]="APPLICATION_OCTET_STREAM",e["image/jpeg"]="IMAGE_JPEG",e["image/jpg"]="IMAGE_JPG",e["image/png"]="IMAGE_PNG",e["image/gif"]="IMAGE_GIF",e["image/webp"]="IMAGE_WEBP",e["image/svg+xml"]="IMAGE_SVG",e["image/bmp"]="IMAGE_BMP",e["image/tiff"]="IMAGE_TIFF",e["image/x-icon"]="IMAGE_ICO",e["image/avif"]="IMAGE_AVIF",e["application/pdf"]="APPLICATION_PDF",e["text/plain"]="TEXT_PLAIN",e["text/csv"]="TEXT_CSV",e["application/rtf"]="APPLICATION_RTF",e["application/msword"]="APPLICATION_MSWORD",e["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]="APPLICATION_DOCX",e["application/vnd.ms-excel"]="APPLICATION_MSEXCEL",e["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]="APPLICATION_XLSX",e["application/vnd.ms-powerpoint"]="APPLICATION_MSPOWERPOINT",e["application/vnd.openxmlformats-officedocument.presentationml.presentation"]="APPLICATION_PPTX",e["application/vnd.oasis.opendocument.text"]="APPLICATION_ODT",e["application/vnd.oasis.opendocument.spreadsheet"]="APPLICATION_ODS",e["application/vnd.oasis.opendocument.presentation"]="APPLICATION_ODP",e["application/xml"]="APPLICATION_XML",e["text/xml"]="TEXT_XML",e["text/html"]="TEXT_HTML",e["text/css"]="TEXT_CSS",e["application/json"]="APPLICATION_JSON",e["text/javascript"]="TEXT_JAVASCRIPT",e["application/zip"]="APPLICATION_ZIP",e["application/gzip"]="APPLICATION_GZIP",e["application/vnd.rar"]="APPLICATION_RAR",e["application/x-7z-compressed"]="APPLICATION_7Z",e["audio/mpeg"]="AUDIO_MPEG",e["audio/wav"]="AUDIO_WAV",e["audio/ogg"]="AUDIO_OGG",e["audio/webm"]="AUDIO_WEBM",e["audio/aac"]="AUDIO_AAC",e["video/mp4"]="VIDEO_MP4",e["video/mpeg"]="VIDEO_MPEG",e["video/ogg"]="VIDEO_OGG",e["video/webm"]="VIDEO_WEBM",e["video/quicktime"]="VIDEO_QUICKTIME",e))(Be||{});var Yr=({createFilesMutation:e,filesDetails:o})=>{let{showErrorMessage:r}=a$8(),[t,n]=useState(!1),[s,i]=useState(!1),[d,p]=useState(null),[m,l]=useState([]),u=useMemo(()=>m?.[0],[m]),b=s||t,F=useCallback(async v=>{if(!v.length){l([]),i(!1);return}i(!0);try{let E=(await Promise.all(v.map(async({url:w,id:_,name:L})=>{try{if(!w)return null;let f=await fetch(w);if(!f.ok)throw new Error(f.statusText);let h=await f.blob(),g=null;if(!L){let S=f.headers.get("content-disposition")||void 0;if(S){let T=Uo(S);if(T)try{g=decodeURIComponent(T);}catch{g=T;}}}let A=g||L||_,M=new File([h],A,{type:h.type});return M.id=_,M.url=w,M}catch{return null}}))).filter(Boolean);l(E),i(!1);}catch(c){r(c,"Erro ao carregar arquivos"),l([]),i(!1);}},[r]),R=useRef("");useEffect(()=>{let v=o?.map(({id:c})=>c).join(",")||"";v!==R.current&&(async()=>(R.current=v,await F(o)))();},[o,F]);let I=async v=>{if(!v||!Array.isArray(v))throw new Error("Arquivos inv\xE1lidos");let c=v.filter(E=>E instanceof File);if(c?.length){n(!0);try{let E=c.map(f=>{let h=f.type||"application/octet-stream",g=Be[h];if(!g)throw new Error(`Tipo de arquivo n\xE3o suportado: ${h}`);return {file:f,mimeType:h,contentTypeEnum:g}}),w=await e({files:E.map(({file:f,contentTypeEnum:h})=>({content_type:h,name:f.name}))}).unwrap(),_=w.files.map((f,h)=>{let g=E[h].file,A=g;return A.id=f.id,A.url=URL.createObjectURL(g),A});return await(await Promise.all(w.files.map((f,h)=>{let{mimeType:g}=E[h],A=_[h];return fetch(f.url,{method:"PUT",headers:{"Content-Type":g,"Content-Disposition":`inline; filename*=${yo(A.name)}`,"X-File-Id":f.id},body:A})}))).forEach(async f=>{if(!f.ok)throw new Error("Erro no upload do arquivo.")}),_}catch(E){throw p(E),r(E,"Erro no upload"),E}finally{n(!1);}}},C=useMemo(()=>d&&d instanceof Error?d.message:d,[d]);return {setFilesPreview:l,uploadFiles:I,filesPreview:m,filePreview:u,isLoadingPreview:s,isUploadingFiles:t,isUploadOrLoadingFiles:b,uploadErrorText:C}},q=Yr;var ot=({sx:e,id:o,name:r,tabIndex:t,uploading:n,getRootProps:s,getInputProps:i,isDragActive:d,isError:p,disabled:m,dropZoneSxProps:l,dropZoneContent:u,children:b,...F})=>jsxs(Me,{children:[n&&jsx(a$7,{"data-testid":"uploading-progress-bar",sx:{zIndex:1}}),jsxs(De,{sx:{width:1,position:"relative",...e},children:[jsxs(ao,{...s(),"data-testid":"drop-zone-styled-area",isError:p,isDragActive:d,disabled:!!m,sx:l,...F,children:[jsx("input",{...i(),id:o,tabIndex:t,name:r}),u]}),b]})]}),de=ot;var it=({header:e,description:o,sx:r,...t})=>jsxs(he,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...r},...t,children:[jsx(a$5,{sx:{width:220}}),jsxs("div",{children:[jsx(Je,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),jsx(Je,{variant:"body2",sx:{color:"text.secondary"},children:o||jsxs(Fragment,{children:["Solte os arquivos aqui ou clique",jsx(Je,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua m\xE1quina"]})})]})]}),me=memo(it);var pt=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:t,filesDetails:n=[],id:s,disabled:i,error:d,helperText:p,thumbnail:m,dropZoneSxProps:l,uploading:u,tabIndex:b,maxFiles:F,placeholderAlt:R,placeholderProps:I,...C})=>{let{filesPreview:v,isUploadOrLoadingFiles:c,uploadErrorText:E,uploadFiles:w}=q({createFilesMutation:t,filesDetails:n}),{files:_,dropzoneProps:L,handleRemove:f,handleReorder:h}=X({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:v,dropzoneOptions:{multiple:!0,disabled:i,...C},maxFiles:F,uploadFiles:w}),{getRootProps:g,getInputProps:A,isDragActive:M,isDragReject:S}=L,T=!!_?.filter(V=>!!V.id).length,N=S||!!d||!!E;return jsxs(de,{id:s,uploading:u||c,disabled:i,dropZoneSxProps:l,tabIndex:b,getRootProps:g,getInputProps:A,isDragActive:M,isError:N,dropZoneContent:jsx(Fragment,{children:R?jsx(he,{children:R}):jsx(me,{header:I?.header,description:I?.description})}),children:[jsx(O,{disabled:i,helperText:p,isError:N}),d?jsx(O,{helperText:d,isError:!0}):null,E?jsx(O,{helperText:E,isError:!0}):null,T&&jsx(De,{sx:{my:3},children:jsx(_e,{files:_,thumbnail:!!m,onRemove:e?f:void 0,onReorder:o?h:void 0})})]})},dt=memo(pt);var ht=({onRemove:e,onReorder:o,onFilesSelect:r,createFilesMutation:t,filesDetails:n=[],id:s,disabled:i,error:d,helperText:p,dropZoneSxProps:m,placeholderProps:l,placeholderAlt:u,uploading:b,tabIndex:F,maxFiles:R,aspectRatio:I,enableCrop:C=!0,convertToWebp:v=!0,cropSize:c,name:E,label:w,..._})=>{let{filesPreview:L,isUploadOrLoadingFiles:f,uploadErrorText:h,uploadFiles:g}=q({createFilesMutation:t,filesDetails:n}),A=b||f,{files:M,dropzoneProps:S,cropState:T,aspectRatio:N,handleRemove:V,handleReorder:G}=X({onFilesSelect:r,onReorder:o,onRemove:e,filesPreview:L,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!0,disabled:i,..._},enableCrop:C,customAspectRatio:I,convertToWebp:v,maxFiles:R,cropSize:c,uploadFiles:g}),{getRootProps:se,getInputProps:oe,isDragActive:re,isDragReject:le}=S,{cropModalOpen:ge,imagePreview:ue,cropLoading:j,onCropInitialized:K,handleCropSave:J,handleCropCancel:te,currentImageIndex:Z,totalPendingImages:a}=T,fe=!!M?.filter(H=>!!H.id).length,ie=le||!!d||!!h,we=useMemo(()=>{let H=w??"Ajustar Imagem",xe=a>1||Z>1?` (${Z} de ${a})`:"";return `${H}${xe}`},[w,a,Z]);return jsxs(de,{id:s,name:E,uploading:A,disabled:i,dropZoneSxProps:m,tabIndex:F,getRootProps:se,getInputProps:oe,isDragActive:re,isError:ie,dropZoneContent:jsx(Fragment,{children:u?jsx(he,{children:u}):jsx(me,{header:l?.header,description:l?.description})}),children:[jsx(O,{disabled:i,helperText:p,isError:ie}),d?jsx(O,{helperText:d,isError:!0}):null,h?jsx(O,{helperText:h,isError:!0}):null,fe&&jsx(De,{sx:{my:3,ml:.5},children:jsx(_e,{files:M,thumbnail:!0,onRemove:V,onReorder:o?G:void 0})}),jsx(a$6,{open:ge,onClose:te,label:we,imageSrc:ue,aspectRatio:N,onInitialized:K,onSave:J,loading:j,cropSize:c})]})},bt=memo(ht);var wt=({onFileSelect:e$1,onRemove:o,createFilesMutation:r,fileDetails:t,id:n,disabled:s,error:i,helperText:d,sx:p,dropZoneSxProps:m$1,uploading:l,tabIndex:u,...b})=>{let{filesPreview:F,isUploadOrLoadingFiles:R,uploadErrorText:I,uploadFiles:C}=q({createFilesMutation:r,filesDetails:t?[t]:[]}),v=R||l,{file:c,dropzoneProps:E,handleRemove:w}=X({uploadFiles:C,onFileSelect:e$1,onRemove:o,filesPreview:F,dropzoneOptions:{multiple:!1,disabled:s,...b}}),{getRootProps:_,getInputProps:L,isDragActive:f,isDragReject:h}=E,g=useCallback(T=>{T.stopPropagation(),w(c||void 0);},[c,w]),A=!!c,M=typeof c=="string",S=h||!!i||!!I;return jsxs(de,{id:n,uploading:v,disabled:s,dropZoneSxProps:m$1,tabIndex:u,getRootProps:_,getInputProps:L,isDragActive:f,isError:S,dropZoneContent:jsxs(Fragment,{children:[!A&&jsx(me,{}),A&&jsxs(he,{component:m.div,...j().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:T=>`solid 1px ${T.palette.divider}`,...p},children:[jsx(Ee,{file:c}),jsxs(he,{flexGrow:1,sx:{minWidth:0},children:[jsx(Je,{variant:"subtitle2",noWrap:!0,children:M?c:c.name}),jsx(Je,{variant:"caption",sx:{color:"text.secondary"},children:M?"":e(c.size)})]}),o&&jsx(a$3,{title:"Remover arquivo",children:jsx(no,{edge:"end",size:"small",disabled:s,"aria-label":"Remover arquivo",onClick:g,children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})})})]})]}),children:[jsx(O,{disabled:s,helperText:d,isError:S}),i?jsx(O,{helperText:i,isError:!0}):null,I?jsx(O,{helperText:I,isError:!0}):null]})},At=memo(wt);var Ut=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:t,id:n,disabled:s,error:i,helperText:d,dropZoneSxProps:p,placeholderProps:m,placeholderAlt:l,uploading:u,tabIndex:b,aspectRatio:F,enableCrop:R=!0,convertToWebp:I=!0,name:C,label:v,cropSize:c,sx:E,maxWidth:w,maxHeight:_,compressionQuality:L=.8,maxCompressedWidth:f,maxCompressedHeight:h,...g})=>{let{filesPreview:A,isUploadOrLoadingFiles:M,uploadErrorText:S,uploadFiles:T}=q({createFilesMutation:r,filesDetails:t?[t]:[]}),[N,V]=useState(!1),{file:G,dropzoneProps:se,cropState:oe,handleRemove:re,aspectRatio:le}=X({onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:s,...g},filesPreview:A,enableCrop:R,customAspectRatio:F,convertToWebp:I,cropSize:c,uploadFiles:T,compressionQuality:L,maxCompressedWidth:f,maxCompressedHeight:h}),{getRootProps:ge,getInputProps:ue,isDragActive:j,isDragReject:K}=se,{cropModalOpen:J,imagePreview:te,cropLoading:Z,onCropInitialized:a,handleCropSave:fe,handleCropCancel:ie}=oe,we=useCallback(()=>{re(G||void 0);},[G,re]),H=!!G,xe=K||!!i||!!S,x=u||M,P=H?{opacity:0}:{opacity:1},D=p?.width;return useEffect(()=>{H||V(!1);},[H]),jsxs(Me,{sx:{...E,...D&&{width:D}},children:[(x||N)&&jsx(a$7,{}),jsxs(de,{id:n,uploading:x,disabled:s,dropZoneSxProps:p,tabIndex:b,getRootProps:ge,getInputProps:ue,isDragActive:j,isError:xe,name:C,dropZoneContent:jsxs(Fragment,{children:[l?jsx(he,{sx:P,children:l}):jsx(me,{sx:P,header:m?.title,description:m?.description}),H&&jsx(Xe,{file:G,cropSize:c,isLoading:N,isUploading:x,onLoading:V,aspectRatio:le,maxWidth:w,maxHeight:_})]}),children:[jsx(O,{disabled:s,helperText:d,isError:xe}),i?jsx(O,{helperText:i,isError:!0}):null,S?jsx(O,{helperText:S,isError:!0}):null,H&&e&&jsx(po,{size:"small",onClick:we,disabled:s,label:"Remover arquivo",children:jsx(a$4,{icon:"DELETE_MARK_BUTTON_02",width:16})}),jsx(a$6,{open:J,onClose:ie,label:v??"Ajustar Imagem",imageSrc:te,aspectRatio:le,onInitialized:a,onSave:fe,loading:Z,cropSize:c})]})]})},yt=memo(Ut);var Bt=({onRemove:e,onFileSelect:o,createFilesMutation:r,fileDetails:t,disabled:n,label:s,id:i,tabIndex:d,error:p,helperText:m,sx:l,name:u,maxSize:b,uploading:F,aspectRatio:R=1,enableCrop:I=!0,convertToWebp:C=!0,cropSize:v,...c})=>{let[E,w]=useState(!1),{filesPreview:_,isUploadOrLoadingFiles:L,uploadErrorText:f,uploadFiles:h}=q({createFilesMutation:r,filesDetails:t?[t]:[]}),{file:g,dropzoneProps:A,cropState:M,handleRemove:S}=X({filesPreview:_,onFileSelect:o,onRemove:e,dropzoneOptions:{accept:{"image/*":[".jpeg",".jpg",".png",".gif",".webp"]},multiple:!1,disabled:n,maxSize:b,...c},enableCrop:I,customAspectRatio:R,convertToWebp:C,cropSize:v,uploadFiles:h}),{getRootProps:T,getInputProps:N,isDragActive:V,isDragReject:G}=A,{cropModalOpen:se,imagePreview:oe,cropLoading:re,onCropInitialized:le,handleCropSave:ge,handleCropCancel:ue}=M,j=G||!!p||!!f,K=E||L||F,J=!!e,te=useRef(t?.url||""),Z=useRef();useEffect(()=>{if(!g){te.current="",Z.current=void 0;return}if(Z.current===g.id)return;Z.current=g.id,w(!0);let ie=URL.createObjectURL(g);return te.current=ie,()=>{URL.revokeObjectURL(ie);}},[g]);let a=()=>{w(!1);},fe=useCallback(()=>J&&g?()=>S(g):T().onClick,[J,g,T,S]);return jsxs(Fragment,{children:[jsxs(he,{sx:{alignItems:"center"},children:[jsxs(ho,{sx:l,isError:j,isDragActive:V,hasFile:!!g,...T(),onClick:fe(),children:[jsxs(fo,{children:[K&&jsx(xo,{children:jsx(Nt,{size:135,thickness:2,color:"primary"})}),g&&jsx(bo,{alt:"Avatar Preview",src:te.current,onLoad:a,...K&&{sx:{filter:"blur(5px) !important",scale:1.2,opacity:.7}}}),!g&&!K&&jsxs($e,{isError:j,hasFile:!1,children:[jsx(a$4,{icon:"ADD_IMAGE",width:32}),jsx(Je,{variant:"caption",textAlign:"center",sx:{color:j?"error.main":"text.disabled"},children:"Adicionar foto"})]}),g&&!K&&jsxs($e,{isError:j,hasFile:!0,children:[jsx(a$4,{icon:J?"DELETE_MARK_BUTTON_02":"ADD_IMAGE",width:32}),jsx(Je,{variant:"caption",textAlign:"center",sx:{color:j?"error.main":"common.white"},children:J?"Remover foto":"Alterar foto"})]})]}),jsx("input",{name:u,id:i,tabIndex:d,...N()})]}),jsx(he,{sx:{alignItems:"center",mt:-.5},children:jsx(O,{helperText:m,disabled:n,isError:j})}),f?jsx(O,{helperText:f,isError:!0}):null,p?jsx(O,{helperText:p,isError:!0}):null]}),se&&oe&&jsx(a$6,{open:se,onClose:ue,label:s??"Ajustar Imagem",imageSrc:oe,aspectRatio:R,onInitialized:le,onSave:ge,loading:re,cropSize:v,cropShape:"round"})]})},Wt=memo(Bt);var Ht=({error:e,name:o,disabled:r,sx:t,...n})=>{let{getRootProps:s,getInputProps:i,isDragActive:d,isDragReject:p}=useDropzone({disabled:r,...n}),m=p||e;return jsxs(mo,{...s(),isDragActive:d,hasError:!!m,disabled:!!r,sx:t,"data-testid":"upload-box",children:[jsx("input",{name:o,...i()}),"Selecionar arquivo"]})},$t=memo(Ht);
|
|
38
|
-
|
|
39
|
-
export { Ve as ContentType, Be as FileContentType, Ee as FileThumbnail, O as HelperText, _e as MultiFilePreview, dt as MultipleFileUpload, bt as MultipleImageUpload, Xe as SingleFilePreview, At as SingleFileUpload, yt as SingleImageUpload, Wt as UploadAvatar, $t as UploadSimpleBox, Oo as compressImageWithoutCrop, To as convertToWebP, yo as encodeFilenameForHeader, qe as fileFormat, ea as fileNameByUrl, So as fileThumb, Ne as fileThumbnailClasses, _o as fileTypeByUrl, Uo as getFileNameFromContentDisposition, ma as isImageFile, X as useDropzoneUploader, q as useFileUploadService };
|
|
17
|
+
import '../../chunk-GFJT57TO.js';
|
|
18
|
+
import '../../chunk-S7QQBC4I.js';
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { F as FileGetResponse, S as SingleImageUploadProps, M as MultiImageUploadProps, a as SingleFileUploadProps, b as MultiFileUploadProps } from '../../../types-90c7bcee.js';
|
|
4
|
+
import '@mui/material/Stack';
|
|
5
|
+
import '@mui/material/styles';
|
|
6
|
+
import 'react-dropzone';
|
|
7
|
+
import 'react-easy-crop';
|
|
8
|
+
import '@dnd-kit/core';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Tipo para busca de arquivo individual
|
|
12
|
+
* Recebe um ID e retorna FileGetResponse
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const getFileQuery = async (id: string): Promise<FileGetResponse> => {
|
|
17
|
+
* const response = await api.get(`/files/${id}`);
|
|
18
|
+
* return response.data;
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
type GetFileQuery = (id: string) => Promise<FileGetResponse> | FileGetResponse;
|
|
23
|
+
/**
|
|
24
|
+
* Props base para componentes de upload integrados ao form
|
|
25
|
+
*/
|
|
26
|
+
interface BaseFormUploadProps {
|
|
27
|
+
name: string;
|
|
28
|
+
rules?: RegisterOptions;
|
|
29
|
+
getFileQuery: GetFileQuery;
|
|
30
|
+
disableRemove?: boolean;
|
|
31
|
+
disableReorder?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Props para SingleImageUpload integrado ao form
|
|
35
|
+
* Retorna apenas o resource_file_id no campo do formulário
|
|
36
|
+
*/
|
|
37
|
+
interface FormSingleImageUploadProps extends Omit<SingleImageUploadProps, 'fileDetails' | 'onFileSelect' | 'onRemove' | 'name'>, BaseFormUploadProps {
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props para MultiImageUpload integrado ao form
|
|
41
|
+
* Retorna array de resource_file_ids no campo do formulário
|
|
42
|
+
*/
|
|
43
|
+
interface FormMultiImageUploadProps extends Omit<MultiImageUploadProps, 'filesDetails' | 'onFilesSelect' | 'onRemove' | 'onRemoveAll' | 'name'>, BaseFormUploadProps {
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Props para SingleFileUpload integrado ao form
|
|
47
|
+
* Retorna apenas o resource_file_id no campo do formulário
|
|
48
|
+
*/
|
|
49
|
+
interface FormSingleFileUploadProps extends Omit<SingleFileUploadProps, 'fileDetails' | 'onFileSelect' | 'onRemove' | 'name'>, BaseFormUploadProps {
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Props para MultiFileUpload integrado ao form
|
|
53
|
+
* Retorna array de resource_file_ids no campo do formulário
|
|
54
|
+
*/
|
|
55
|
+
interface FormMultiFileUploadProps extends Omit<MultiFileUploadProps, 'filesDetails' | 'onFilesSelect' | 'onRemove' | 'onRemoveAll' | 'name'>, BaseFormUploadProps {
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* AvatarUpload integrado ao React Hook Form
|
|
60
|
+
* Componente especializado para upload de avatar (imagem circular de perfil)
|
|
61
|
+
* Gerencia automaticamente o estado do arquivo e retorna apenas o resource_file_id
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* import { Form } from 'components/form';
|
|
66
|
+
* import { AvatarUpload } from 'components/form/FileUpload';
|
|
67
|
+
* import { useCreateFilesMutation, useGetFileQuery } from 'services/filesApi';
|
|
68
|
+
*
|
|
69
|
+
* interface FormData {
|
|
70
|
+
* avatar_id: string | null;
|
|
71
|
+
* }
|
|
72
|
+
*
|
|
73
|
+
* const ProfileForm = () => {
|
|
74
|
+
* const createFilesMutation = useCreateFilesMutation();
|
|
75
|
+
* const getFileQuery = useGetFileQuery();
|
|
76
|
+
* const methods = useForm<FormData>();
|
|
77
|
+
*
|
|
78
|
+
* return (
|
|
79
|
+
* <Form methods={methods} onSubmit={handleSubmit}>
|
|
80
|
+
* <AvatarUpload
|
|
81
|
+
* name="avatar_id"
|
|
82
|
+
* createFilesMutation={createFilesMutation}
|
|
83
|
+
* getFileQuery={getFileQuery}
|
|
84
|
+
* />
|
|
85
|
+
* </Form>
|
|
86
|
+
* );
|
|
87
|
+
* };
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare const AvatarUpload: ({ name, rules, createFilesMutation, getFileQuery, disableRemove, aspectRatio, enableCrop, maxSize, ...other }: FormSingleImageUploadProps) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* MultiFileUpload integrado ao React Hook Form
|
|
94
|
+
* Gerencia automaticamente o estado dos arquivos e retorna array de resource_file_ids
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* import { Form } from 'components/form';
|
|
99
|
+
* import { MultiFileUpload } from 'components/form/FileUpload';
|
|
100
|
+
* import { useCreateFilesMutation } from 'services/filesApi';
|
|
101
|
+
*
|
|
102
|
+
* const FormExample = () => {
|
|
103
|
+
* const createFilesMutation = useCreateFilesMutation();
|
|
104
|
+
* const methods = useForm({
|
|
105
|
+
* defaultValues: {
|
|
106
|
+
* document_ids: [],
|
|
107
|
+
* },
|
|
108
|
+
* });
|
|
109
|
+
*
|
|
110
|
+
* const handleSubmit = (data: any) => {
|
|
111
|
+
* console.log(data.document_ids); // Array de IDs
|
|
112
|
+
* };
|
|
113
|
+
*
|
|
114
|
+
* return (
|
|
115
|
+
* <Form methods={methods} onSubmit={handleSubmit}>
|
|
116
|
+
* <MultiFileUpload
|
|
117
|
+
* name="document_ids"
|
|
118
|
+
* label="Documentos"
|
|
119
|
+
* createFilesMutation={createFilesMutation}
|
|
120
|
+
* maxFiles={5}
|
|
121
|
+
* />
|
|
122
|
+
* </Form>
|
|
123
|
+
* );
|
|
124
|
+
* };
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
declare const MultiFileUpload: ({ name, rules, createFilesMutation, getFileQuery, disableRemove, disableReorder, ...other }: FormMultiFileUploadProps) => react_jsx_runtime.JSX.Element;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* MultiImageUpload integrado ao React Hook Form
|
|
131
|
+
* Gerencia automaticamente o estado dos arquivos e retorna array de resource_file_ids
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* import { Form } from 'components/form';
|
|
136
|
+
* import { MultiImageUpload } from 'components/form/FileUpload';
|
|
137
|
+
* import { useCreateFilesMutation } from 'services/filesApi';
|
|
138
|
+
*
|
|
139
|
+
* const FormExample = () => {
|
|
140
|
+
* const createFilesMutation = useCreateFilesMutation();
|
|
141
|
+
* const methods = useForm({
|
|
142
|
+
* defaultValues: {
|
|
143
|
+
* image_ids: [],
|
|
144
|
+
* },
|
|
145
|
+
* });
|
|
146
|
+
*
|
|
147
|
+
* const handleSubmit = (data: any) => {
|
|
148
|
+
* console.log(data.image_ids); // Array de IDs
|
|
149
|
+
* };
|
|
150
|
+
*
|
|
151
|
+
* return (
|
|
152
|
+
* <Form methods={methods} onSubmit={handleSubmit}>
|
|
153
|
+
* <MultiImageUpload
|
|
154
|
+
* name="image_ids"
|
|
155
|
+
* label="Imagens"
|
|
156
|
+
* createFilesMutation={createFilesMutation}
|
|
157
|
+
* maxFiles={5}
|
|
158
|
+
* />
|
|
159
|
+
* </Form>
|
|
160
|
+
* );
|
|
161
|
+
* };
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
declare const MultiImageUpload: ({ name, rules, createFilesMutation, getFileQuery, disableRemove, disableReorder, ...other }: FormMultiImageUploadProps) => react_jsx_runtime.JSX.Element;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* SingleFileUpload integrado ao React Hook Form
|
|
168
|
+
* Gerencia automaticamente o estado do arquivo e retorna apenas o resource_file_id
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```tsx
|
|
172
|
+
* import { Form } from 'components/form';
|
|
173
|
+
* import { SingleFileUpload } from 'components/form/FileUpload';
|
|
174
|
+
* import { useCreateFilesMutation } from 'services/filesApi';
|
|
175
|
+
*
|
|
176
|
+
* const FormExample = () => {
|
|
177
|
+
* const createFilesMutation = useCreateFilesMutation();
|
|
178
|
+
* const methods = useForm({
|
|
179
|
+
* defaultValues: {
|
|
180
|
+
* document_id: null,
|
|
181
|
+
* },
|
|
182
|
+
* });
|
|
183
|
+
*
|
|
184
|
+
* const handleSubmit = (data: any) => {
|
|
185
|
+
* console.log(data.document_id); // ID do arquivo
|
|
186
|
+
* };
|
|
187
|
+
*
|
|
188
|
+
* return (
|
|
189
|
+
* <Form methods={methods} onSubmit={handleSubmit}>
|
|
190
|
+
* <SingleFileUpload
|
|
191
|
+
* name="document_id"
|
|
192
|
+
* label="Documento"
|
|
193
|
+
* createFilesMutation={createFilesMutation}
|
|
194
|
+
* maxSize={1024 * 1024 * 10}
|
|
195
|
+
* />
|
|
196
|
+
* </Form>
|
|
197
|
+
* );
|
|
198
|
+
* };
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare const SingleFileUpload: ({ name, rules, createFilesMutation, getFileQuery, disableRemove, ...other }: FormSingleFileUploadProps) => react_jsx_runtime.JSX.Element;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* SingleImageUpload integrado ao React Hook Form
|
|
205
|
+
* Gerencia automaticamente o estado do arquivo e retorna apenas o resource_file_id
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```tsx
|
|
209
|
+
* import { Form } from 'components/form';
|
|
210
|
+
* import { SingleImageUpload } from 'components/form/FileUpload';
|
|
211
|
+
* import { useCreateFilesMutation } from 'services/filesApi';
|
|
212
|
+
*
|
|
213
|
+
* const FormExample = () => {
|
|
214
|
+
* const createFilesMutation = useCreateFilesMutation();
|
|
215
|
+
* const methods = useForm({
|
|
216
|
+
* defaultValues: {
|
|
217
|
+
* resource_id: null,
|
|
218
|
+
* },
|
|
219
|
+
* });
|
|
220
|
+
*
|
|
221
|
+
* const handleSubmit = (data: any) => {
|
|
222
|
+
* console.log(data.resource_id); // ID do arquivo
|
|
223
|
+
* };
|
|
224
|
+
*
|
|
225
|
+
* return (
|
|
226
|
+
* <Form methods={methods} onSubmit={handleSubmit}>
|
|
227
|
+
* <SingleImageUpload
|
|
228
|
+
* name="resource_id"
|
|
229
|
+
* label="Imagem"
|
|
230
|
+
* createFilesMutation={createFilesMutation}
|
|
231
|
+
* maxSize={1024 * 1024 * 5}
|
|
232
|
+
* />
|
|
233
|
+
* </Form>
|
|
234
|
+
* );
|
|
235
|
+
* };
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
declare const SingleImageUpload: ({ name, rules, createFilesMutation, getFileQuery, disableRemove, ...other }: FormSingleImageUploadProps) => react_jsx_runtime.JSX.Element;
|
|
239
|
+
|
|
240
|
+
export { AvatarUpload, FileGetResponse, FormMultiFileUploadProps, FormMultiImageUploadProps, FormSingleFileUploadProps, FormSingleImageUploadProps, GetFileQuery, MultiFileUpload, MultiImageUpload, SingleFileUpload, SingleImageUpload };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { v, s, t, u } from '../../../chunk-JALBND3K.js';
|
|
2
|
+
import '../../../chunk-H5L4ARDB.js';
|
|
3
|
+
import '../../../chunk-3X7KMUN3.js';
|
|
4
|
+
import '../../../chunk-ANAHA3L6.js';
|
|
5
|
+
import '../../../chunk-2FXBVVBD.js';
|
|
6
|
+
import '../../../chunk-KA6PGKWV.js';
|
|
7
|
+
import '../../../chunk-GZ4UBWZJ.js';
|
|
8
|
+
import '../../../chunk-7AZX7L27.js';
|
|
9
|
+
import '../../../chunk-DUFPX4QZ.js';
|
|
10
|
+
import '../../../chunk-2P4CXK3O.js';
|
|
11
|
+
import '../../../chunk-FK7DDO5L.js';
|
|
12
|
+
import '../../../chunk-DMQW3LDF.js';
|
|
13
|
+
import '../../../chunk-WIJV4EHZ.js';
|
|
14
|
+
import '../../../chunk-FO7JCJ76.js';
|
|
15
|
+
import '../../../chunk-C2JZG45F.js';
|
|
16
|
+
import '../../../chunk-ILHUUK4X.js';
|
|
17
|
+
import '../../../chunk-GFJT57TO.js';
|
|
18
|
+
import '../../../chunk-S7QQBC4I.js';
|
|
19
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
20
|
+
import { useState, useEffect, useMemo, useRef } from 'react';
|
|
21
|
+
import { jsx } from 'react/jsx-runtime';
|
|
22
|
+
|
|
23
|
+
var h=(e,r)=>{let{setValue:l,watch:a}=useFormContext(),t=a(e),[o,i]=useState();return useEffect(()=>{if(!t){i(void 0);return}(async()=>{try{let s=await r(t);i({id:s.id,url:s.url,name:s.name});}catch{i({id:t,url:""});}})();},[t,r]),{fileDetails:o,handleFileSelect:d=>{l(e,d.id,{shouldValidate:!0,shouldDirty:!0});},handleRemove:()=>{l(e,null,{shouldValidate:!0,shouldDirty:!0});}}},R=(e,r)=>{let{setValue:l,watch:a}=useFormContext(),t=a(e),o=useMemo(()=>t||[],[t]),[i,n]=useState([]),u=useRef(new Map);return useEffect(()=>{if(!o||o.length===0){n([]);return}(async()=>{try{let p=[...new Set(o)],c=u.current,F=p.filter(S=>!c.has(S));if(F.length>0){let S=F.map(async U=>{try{let g=await r(U),M={id:g.id,url:g.url,name:g.name};return c.set(U,M),M}catch{let g={id:U,url:""};return c.set(U,g),g}});await Promise.all(S);}let Q=p.map(S=>c.get(S));n(Q);}catch{n(o.map(p=>({id:p,url:""})));}})();},[o,r]),{currentValue:o,filesDetails:i,handleFilesSelect:m=>{let p=m.map(F=>F.id),c=[...new Set([...o,...p])];l(e,c,{shouldValidate:!0,shouldDirty:!0});},handleRemove:m=>{if(!m)return;let p=o.filter(c=>c!==m.id);l(e,p,{shouldValidate:!0,shouldDirty:!0});},handleReorder:(m,p)=>{let c=[...o],[F]=c.splice(m,1);c.splice(p,0,F),l(e,c,{shouldValidate:!0,shouldDirty:!0});}}};var B=({name:e,rules:r,createFilesMutation:l,getFileQuery:a,disableRemove:t,aspectRatio:o=1,enableCrop:i=!0,maxSize:n=5242880,...u})=>{let{control:d}=useFormContext(),{fileDetails:s,handleFileSelect:f,handleRemove:m}=h(e,a);return jsx(Controller,{name:e,control:d,rules:r,render:({fieldState:{error:p}})=>jsx(v,{name:e,fileDetails:s,createFilesMutation:l,onFileSelect:f,onRemove:t?void 0:m,aspectRatio:o,enableCrop:i,maxSize:n,error:p?.message,...u})})},H=B;var L=({name:e,rules:r,createFilesMutation:l,getFileQuery:a,disableRemove:t,disableReorder:o,...i})=>{let{control:n}=useFormContext(),{filesDetails:u,handleFilesSelect:d,handleRemove:s$1,handleReorder:f}=R(e,a);return jsx(Controller,{name:e,control:n,rules:r,render:({fieldState:{error:m}})=>jsx(s,{name:e,filesDetails:u,createFilesMutation:l,onFilesSelect:d,onRemove:t?void 0:s$1,onReorder:o?void 0:f,error:m?.message,...i})})},N=L;var W=({name:e,rules:r,createFilesMutation:l,getFileQuery:a,disableRemove:t$1,disableReorder:o,...i})=>{let{control:n}=useFormContext(),{filesDetails:u,handleFilesSelect:d,handleRemove:s,handleReorder:f}=R(e,a);return jsx(Controller,{name:e,control:n,rules:r,render:({fieldState:{error:m}})=>jsx(t,{name:e,filesDetails:u,createFilesMutation:l,onFilesSelect:d,onRemove:t$1?void 0:s,onReorder:o?void 0:f,error:m?.message,...i})})},X=W;var _=({name:e,rules:r,createFilesMutation:l,getFileQuery:a,disableRemove:t,...o})=>{let{control:i}=useFormContext(),{fileDetails:n,handleFileSelect:u$1,handleRemove:d}=h(e,a);return jsx(Controller,{name:e,control:i,rules:r,render:({fieldState:{error:s}})=>jsx(u,{name:e,fileDetails:n,createFilesMutation:l,onFileSelect:u$1,onRemove:t?void 0:d,error:s?.message,...o})})},$=_;var oe=({name:e,rules:r,createFilesMutation:l,getFileQuery:a,disableRemove:t,...o})=>{let{control:i}=useFormContext(),{fileDetails:n,handleFileSelect:u,handleRemove:d}=h(e,a);return jsx(Controller,{name:e,control:i,rules:r,render:({fieldState:{error:s}})=>jsx(v,{name:e,fileDetails:n,createFilesMutation:l,onFileSelect:u,onRemove:t?void 0:d,error:s?.message,...o})})},te=oe;
|
|
24
|
+
|
|
25
|
+
export { H as AvatarUpload, N as MultiFileUpload, X as MultiImageUpload, $ as SingleFileUpload, te as SingleImageUpload };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomShadows } from './index-
|
|
2
|
-
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-
|
|
1
|
+
import { C as CustomShadows } from './index-8a737d25.js';
|
|
2
|
+
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-8a737d25.js';
|
|
3
3
|
export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-918b7981.js';
|
|
4
4
|
export { default as ThemeProvider } from './theme/theme-provider.js';
|
|
5
5
|
import { S as SettingsState } from './settings-d0cceb05.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-
|
|
1
|
+
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-8a737d25.js';
|
|
2
2
|
import '@mui/lab/TimelineConnector';
|
|
3
3
|
import '@mui/system';
|
|
4
4
|
import '@mui/lab/TimelineDot';
|
|
@@ -193,7 +193,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
193
193
|
flexShrink?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FlexShrink | readonly NonNullable<csstype.Property.FlexShrink | undefined>[] | undefined;
|
|
194
194
|
flexWrap?: csstype.Property.FlexWrap | readonly NonNullable<csstype.Property.FlexWrap | undefined>[] | readonly csstype.Property.FlexWrap[] | undefined;
|
|
195
195
|
float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
|
|
196
|
-
fontFamily?: csstype.Property.FontFamily | readonly
|
|
196
|
+
fontFamily?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
|
|
197
197
|
fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
|
|
198
198
|
fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
|
|
199
199
|
fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
|
|
@@ -218,7 +218,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
218
218
|
fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
|
|
219
219
|
fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
|
|
220
220
|
fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
|
|
221
|
-
fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
221
|
+
fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
|
|
222
222
|
forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
|
|
223
223
|
gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
|
|
224
224
|
gridAutoFlow?: readonly string[] | csstype.Property.GridAutoFlow | readonly csstype.Property.GridAutoFlow[] | undefined;
|
|
@@ -443,9 +443,9 @@ 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?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
|
|
446
|
-
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
446
|
+
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "reset" | "normal")[] | undefined;
|
|
447
447
|
all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
|
|
448
|
-
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
448
|
+
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto" | "none" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
449
449
|
animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
|
|
450
450
|
background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
|
|
451
451
|
border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
|
|
@@ -454,7 +454,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
454
454
|
borderBlockStart?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockStart<string | number> | readonly NonNullable<csstype.Property.BorderBlockStart<string | number> | undefined>[] | undefined;
|
|
455
455
|
borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
|
|
456
456
|
borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
|
|
457
|
-
borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
457
|
+
borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
458
458
|
borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
|
|
459
459
|
borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
|
|
460
460
|
borderInlineStart?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineStart<string | number> | readonly NonNullable<csstype.Property.BorderInlineStart<string | number> | undefined>[] | undefined;
|
|
@@ -486,7 +486,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
486
486
|
marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
|
|
487
487
|
marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
|
|
488
488
|
mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
|
|
489
|
-
maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
489
|
+
maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
|
|
490
490
|
motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
|
|
491
491
|
offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
|
|
492
492
|
outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
|
|
@@ -729,8 +729,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
729
729
|
WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
|
|
730
730
|
WebkitUserSelect?: csstype.Property.UserSelect | readonly NonNullable<csstype.Property.UserSelect | undefined>[] | readonly csstype.Property.UserSelect[] | undefined;
|
|
731
731
|
WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
|
|
732
|
-
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
733
|
-
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
732
|
+
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto" | "none" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
733
|
+
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
734
734
|
MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
|
|
735
735
|
MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
|
|
736
736
|
MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
|
|
@@ -741,16 +741,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
741
741
|
msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
|
|
742
742
|
msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
|
|
743
743
|
msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
744
|
-
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
744
|
+
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto" | "none" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
745
745
|
WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
|
|
746
|
-
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
746
|
+
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
747
747
|
WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
|
|
748
748
|
WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
|
|
749
749
|
WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
|
|
750
750
|
WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
|
|
751
751
|
WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
|
|
752
752
|
WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
|
|
753
|
-
WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
753
|
+
WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
|
|
754
754
|
WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
|
|
755
755
|
WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
|
|
756
756
|
WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
@@ -831,7 +831,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
831
831
|
MozTransitionTimingFunction?: readonly string[] | csstype.Property.TransitionTimingFunction | readonly csstype.Property.TransitionTimingFunction[] | undefined;
|
|
832
832
|
MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
|
|
833
833
|
msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
|
|
834
|
-
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
834
|
+
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto" | "none" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
835
835
|
OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
|
|
836
836
|
OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
|
|
837
837
|
OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
|
|
@@ -841,7 +841,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
841
841
|
OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
|
|
842
842
|
OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
|
|
843
843
|
OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
|
|
844
|
-
OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "
|
|
844
|
+
OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
845
845
|
OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
|
|
846
846
|
OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
|
|
847
847
|
OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
|