@cyber-harbour/ui 2.2.18 → 2.2.20

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.
@@ -762,7 +762,7 @@ import U4,{createContext,forwardRef,useState,useCallback,useRef,useMemo,useEffec
762
762
  background: ${o.input[C].disabled.background};
763
763
  cursor: not-allowed;
764
764
  `}
765
- `);var J1=r(o=>{useEffect(()=>{if(!o||typeof window>"u")return;let e=document.body,t=document.documentElement,a=window.getComputedStyle(e),i=window.innerWidth-t.clientWidth,C=a.paddingRight,s=e.style.overflow,l=t.style.overflow;return e.style.overflow="hidden",t.style.overflow="hidden",e.style.paddingRight=`${parseInt(C)+i}px`,()=>{e.style.overflow=s,t.style.overflow=l,e.style.paddingRight=C;}},[o]);},"useBodyScrollLock"),b4=r(async o=>{let e=[],t=r(async i=>{if(i.isFile){let C=await new Promise((s,l)=>{i.file(s,l);});C.folder_path=i.fullPath.split("/").slice(0,-1).join("/"),e.push(C);}else if(i.isDirectory){let C=i.createReader(),s=r(async()=>{let l=await new Promise((p,c)=>{C.readEntries(p,c);});l.length!==0&&(await Promise.all(l.map(p=>t(p))),await s());},"readEntries");await s();}},"readEntry"),a=Array.from(o);return await Promise.all(a.map(async i=>{let C=i.webkitGetAsEntry();C&&await t(C);})),e},"getFilesFromDataTransfer");var rl=forwardRef(r(function({error:e,variant:t="outlined",multiple:a=false,accept:i,uploadButtonText:C="Files",uploadFolderButtonText:s="Folder",dragDropPlaceholder:l="Drag and drop files here",infoPlaceholder:p,dragDropText:c="Drop to upload",enableFilePreview:b=true,value:u=[],onChange:f,onError:S,disabled:g,className:v,dragDropClassName:F,hasIcon:M=true,hasButton:A=true,onClick:G,...P},K){let[L,E]=useState(false),[I,M1]=useState(false),i1=useRef(null),C1=useRef(null),q=r(x=>{if(a){let y=[...u,...x];f?.(y);}else f?.(x.length>0?[x[0]]:[]);},"handleFiles"),C2=r(x=>{x.preventDefault(),g||E(true);},"handleDragOver"),s2=r(x=>{x.preventDefault(),E(false);},"handleDragLeave"),l2=r(async x=>{if(x.preventDefault(),E(false),!(g||I))try{M1(!0);let y=await b4(x.dataTransfer.items);q(y);}catch(y){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",y);}finally{M1(false);}},"handleDrop"),d2=r(x=>{if(!x.target.files)return;let y=Array.from(x.target.files);q(y);},"handleInputChange"),s1=r(()=>{!g&&i1.current&&i1.current.click();},"handleUploadClick"),H=r(()=>{!g&&C1.current&&C1.current.click();},"handleFolderUploadClick"),k=r(x=>{if(!x.target.files)return;let y=Array.from(x.target.files).map(l1=>{let _=l1,n5=l1.webkitRelativePath??"";return _.folder_path=n5?"/"+n5.split("/").slice(0,-1).join("/"):"",_});q(y);},"handleFolderInputChange"),D=r(x=>{if(g)return;let y=u.filter((l1,_)=>_!==x);f?.(y);},"removeFile"),p2=r(x=>{if(x===0)return "0 Bytes";let y=1024,l1=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(x)/Math.log(y));return parseFloat((x/Math.pow(y,_)).toFixed(2))+" "+l1[_]},"formatFileSize");return jsxs(B7,{className:v,children:[jsxs(T7,{$error:!!e,$variant:t,$disabled:!!g,$isDragOver:L,onDragOver:C2,onDragLeave:s2,onDrop:l2,className:F,onClick:G||s1,children:[jsx(f4,{ref:i1,type:"file",multiple:a,accept:i,onChange:d2,disabled:g||I,onClick:x=>x.stopPropagation(),...P}),jsx(f4,{ref:C1,type:"file",webkitdirectory:"",accept:i,onChange:k,disabled:g||I,onClick:x=>x.stopPropagation()}),jsxs(G7,{children:[M&&(L?jsx("div",{className:"mb-3 flex items-center justify-center w-[50px] h-[50px] border border-gray-200 dark:border-neutral-700 rounded-md",children:jsx(f2,{width:20,className:"-rotate-90"})}):jsx(W,{size:"small",variant:"empty",color:"primary",type:"button",onClick:x=>{x.stopPropagation(),s1();},disabled:g||I,icon:jsx(R2,{color:"currentColor",width:64,className:"shrink-0 w-[64px]! h-[47px]!"}),className:"mb-3"})),jsx("div",{className:"flex flex-wrap items-center justify-center gap-1.25",children:L?jsx(x4,{children:c}):jsxs(Fragment,{children:[jsx(x4,{children:l}),I&&jsx("div",{className:"h-4.5 w-4.5 shrink-0 animate-spin rounded-full border-2 border-blue-500 border-s-transparent"})]})}),!!p&&jsx(z7,{$variant:t,children:p}),A&&!I&&jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center justify-center gap-2 mt-1",children:[jsx(W,{size:"small",variant:"outlined",color:"default",type:"button",icon:jsx(B2,{}),onClick:x=>{x.stopPropagation(),s1();},disabled:g,className:"text-[14px]! py-1.5!",children:C}),jsx(W,{size:"small",variant:"outlined",color:"default",type:"button",icon:jsx(M2,{}),onClick:x=>{x.stopPropagation(),H();},disabled:g,className:"text-[14px]! py-1.5!",children:s})]}),!!e&&jsxs(R7,{$variant:t,children:[jsx(f1,{}),jsx(Q5,{ml:5,color:"error",variant:"body",children:e})]})]})]}),b&&u.length>0&&jsx(A7,{children:u.map((x,y)=>jsxs(D7,{children:[jsxs(N7,{children:[jsx(W7,{children:x.name}),jsx(O7,{children:p2(x.size)})]}),!g&&jsx(_7,{type:"button",onClick:()=>D(y),children:"\xD7"})]},`${x.name}-${y}`))})]})},"FileField")),B7=styled.div`
765
+ `);var J1=r(o=>{useEffect(()=>{if(!o||typeof window>"u")return;let e=document.body,t=document.documentElement,a=window.getComputedStyle(e),i=window.innerWidth-t.clientWidth,C=a.paddingRight,s=e.style.overflow,l=t.style.overflow;return e.style.overflow="hidden",t.style.overflow="hidden",e.style.paddingRight=`${parseInt(C)+i}px`,()=>{e.style.overflow=s,t.style.overflow=l,e.style.paddingRight=C;}},[o]);},"useBodyScrollLock"),b4=r(async o=>{let e=[],t=r(async i=>{if(i.isFile){let C=await new Promise((s,l)=>{i.file(s,l);});C.folder_path=i.fullPath.split("/").slice(0,-1).join("/"),e.push(C);}else if(i.isDirectory){let C=i.createReader(),s=r(async()=>{let l=await new Promise((p,c)=>{C.readEntries(p,c);});l.length!==0&&(await Promise.all(l.map(p=>t(p))),await s());},"readEntries");await s();}},"readEntry"),a=Array.from(o);return await Promise.all(a.map(async i=>{let C=i.webkitGetAsEntry();C&&await t(C);})),e},"getFilesFromDataTransfer");var rl=forwardRef(r(function({error:e,variant:t="outlined",multiple:a=false,accept:i,uploadButtonText:C="Files",uploadFolderButtonText:s="Folder",dragDropPlaceholder:l="Drag and drop files here",infoPlaceholder:p,dragDropText:c="Drop to upload",enableFilePreview:b=true,value:u=[],onChange:f,onError:S,disabled:g,className:v,dragDropClassName:F,hasIcon:M=true,hasButton:A=true,onClick:G,...P},K){let[L,E]=useState(false),[I,M1]=useState(false),i1=useRef(null),C1=useRef(null),q=r(x=>{if(a){let y=[...u,...x];f?.(y);}else f?.(x.length>0?[x[0]]:[]);},"handleFiles"),C2=r(x=>{x.preventDefault(),g||E(true);},"handleDragOver"),s2=r(x=>{x.preventDefault(),E(false);},"handleDragLeave"),l2=r(async x=>{if(x.preventDefault(),E(false),!(g||I))try{M1(!0);let y=await b4(x.dataTransfer.items);q(y);}catch(y){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",y);}finally{M1(false);}},"handleDrop"),d2=r(x=>{if(!x.target.files)return;let y=Array.from(x.target.files);x.target.value="",q(y);},"handleInputChange"),s1=r(()=>{!g&&i1.current&&i1.current.click();},"handleUploadClick"),H=r(()=>{!g&&C1.current&&C1.current.click();},"handleFolderUploadClick"),k=r(x=>{if(!x.target.files)return;let y=Array.from(x.target.files).map(l1=>{let _=l1,n5=l1.webkitRelativePath??"";return _.folder_path=n5?"/"+n5.split("/").slice(0,-1).join("/"):"",_});x.target.value="",q(y);},"handleFolderInputChange"),D=r(x=>{if(g)return;let y=u.filter((l1,_)=>_!==x);f?.(y);},"removeFile"),p2=r(x=>{if(x===0)return "0 Bytes";let y=1024,l1=["Bytes","KB","MB","GB"],_=Math.floor(Math.log(x)/Math.log(y));return parseFloat((x/Math.pow(y,_)).toFixed(2))+" "+l1[_]},"formatFileSize");return jsxs(B7,{className:v,children:[jsxs(T7,{$error:!!e,$variant:t,$disabled:!!g,$isDragOver:L,onDragOver:C2,onDragLeave:s2,onDrop:l2,className:F,onClick:G||s1,children:[jsx(f4,{ref:i1,type:"file",multiple:a,accept:i,onChange:d2,disabled:g||I,onClick:x=>x.stopPropagation(),...P}),jsx(f4,{ref:C1,type:"file",webkitdirectory:"",accept:i,onChange:k,disabled:g||I,onClick:x=>x.stopPropagation()}),jsxs(G7,{children:[M&&(L?jsx("div",{className:"mb-3 flex items-center justify-center w-[50px] h-[50px] border border-gray-200 dark:border-neutral-700 rounded-md",children:jsx(f2,{width:20,className:"-rotate-90"})}):jsx(W,{size:"small",variant:"empty",color:"primary",type:"button",onClick:x=>{x.stopPropagation(),s1();},disabled:g||I,icon:jsx(R2,{color:"currentColor",width:64,className:"shrink-0 w-[64px]! h-[47px]!"}),className:"mb-3"})),jsx("div",{className:"flex flex-wrap items-center justify-center gap-1.25",children:L?jsx(x4,{children:c}):jsxs(Fragment,{children:[jsx(x4,{children:l}),I&&jsx("div",{className:"h-4.5 w-4.5 shrink-0 animate-spin rounded-full border-2 border-blue-500 border-s-transparent"})]})}),!!p&&jsx(z7,{$variant:t,children:p}),A&&!I&&jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center justify-center gap-2 mt-1",children:[jsx(W,{size:"small",variant:"outlined",color:"default",type:"button",icon:jsx(B2,{}),onClick:x=>{x.stopPropagation(),s1();},disabled:g,className:"text-[14px]! py-1.5!",children:C}),jsx(W,{size:"small",variant:"outlined",color:"default",type:"button",icon:jsx(M2,{}),onClick:x=>{x.stopPropagation(),H();},disabled:g,className:"text-[14px]! py-1.5!",children:s})]}),!!e&&jsxs(R7,{$variant:t,children:[jsx(f1,{}),jsx(Q5,{ml:5,color:"error",variant:"body",children:e})]})]})]}),b&&u.length>0&&jsx(A7,{children:u.map((x,y)=>jsxs(D7,{children:[jsxs(N7,{children:[jsx(W7,{children:x.name}),jsx(O7,{children:p2(x.size)})]}),!g&&jsx(_7,{type:"button",onClick:()=>D(y),children:"\xD7"})]},`${x.name}-${y}`))})]})},"FileField")),B7=styled.div`
766
766
  width: 100%;
767
767
  `,f4=styled.input`
768
768
  display: none;
@@ -1381,5 +1381,5 @@ import U4,{createContext,forwardRef,useState,useCallback,useRef,useMemo,useEffec
1381
1381
  }
1382
1382
  }
1383
1383
  animation: move 1.5s linear infinite;
1384
- `;export{W6 as $,zi as $a,h2 as A,y3 as Aa,Rd as Ab,t6 as B,P3 as Ba,Ad as Bb,n6 as C,Z3 as Ca,Dd as Cb,f2 as D,E3 as Da,F4 as Db,i6 as E,B3 as Ea,N8 as Eb,C6 as F,G3 as Fa,rp as Fb,x2 as G,R3 as Ga,P4 as Gb,m2 as H,D3 as Ha,Mp as Hb,p6 as I,N3 as Ia,Vp as Ib,g6 as J,W3 as Ja,Lp as Jb,u6 as K,_3 as Ka,Hp as Kb,f6 as L,U3 as La,r9 as Lb,x6 as M,X3 as Ma,Kp as Mb,w6 as N,q3 as Na,oc as Nb,v6 as O,Q3 as Oa,V6 as P,j3 as Pa,H6 as Q,o0 as Qa,F6 as R,t0 as Ra,P6 as S,R2 as Sa,M2 as T,A2 as Ta,Z6 as U,n0 as Ua,$6 as V,e1 as Va,I6 as W,ni as Wa,T6 as X,pi as Xa,G6 as Y,xi as Ya,R6 as Z,Vi as Za,D6 as _,Q5 as _a,r as a,_6 as aa,Wi as ab,V1 as b,U6 as ba,Xi as bb,d as c,X6 as ca,oC as cb,a5 as d,q6 as da,nC as db,B as e,J6 as ea,lC as eb,d1 as f,j6 as fa,VC as fb,z as g,e3 as ga,$C as gb,N as h,r3 as ha,i4 as hb,d9 as i,a3 as ia,XC as ib,p9 as j,k2 as ja,C4 as jb,c9 as k,C3 as ka,ss as kb,L1 as l,Z2 as la,Ls as lb,i5 as m,$2 as ma,p4 as mb,C5 as n,s3 as na,b4 as nb,s5 as o,d3 as oa,rl as ob,l5 as p,f1 as pa,K7 as pb,c5 as q,c3 as qa,j7 as qb,g5 as r,x1 as ra,yl as rb,R9 as s,b3 as sa,Il as sb,F1 as t,h3 as ta,zl as tb,h as u,x3 as ua,Xl as ub,q4 as v,m3 as va,td as vb,m as w,S3 as wa,ld as wb,w as x,M3 as xa,bd as xb,Q9 as y,L3 as ya,wd as yb,W as z,B2 as za,Fd as zb};//# sourceMappingURL=chunk-4AIWL7CV.mjs.map
1385
- //# sourceMappingURL=chunk-4AIWL7CV.mjs.map
1384
+ `;export{W6 as $,zi as $a,h2 as A,y3 as Aa,Rd as Ab,t6 as B,P3 as Ba,Ad as Bb,n6 as C,Z3 as Ca,Dd as Cb,f2 as D,E3 as Da,F4 as Db,i6 as E,B3 as Ea,N8 as Eb,C6 as F,G3 as Fa,rp as Fb,x2 as G,R3 as Ga,P4 as Gb,m2 as H,D3 as Ha,Mp as Hb,p6 as I,N3 as Ia,Vp as Ib,g6 as J,W3 as Ja,Lp as Jb,u6 as K,_3 as Ka,Hp as Kb,f6 as L,U3 as La,r9 as Lb,x6 as M,X3 as Ma,Kp as Mb,w6 as N,q3 as Na,oc as Nb,v6 as O,Q3 as Oa,V6 as P,j3 as Pa,H6 as Q,o0 as Qa,F6 as R,t0 as Ra,P6 as S,R2 as Sa,M2 as T,A2 as Ta,Z6 as U,n0 as Ua,$6 as V,e1 as Va,I6 as W,ni as Wa,T6 as X,pi as Xa,G6 as Y,xi as Ya,R6 as Z,Vi as Za,D6 as _,Q5 as _a,r as a,_6 as aa,Wi as ab,V1 as b,U6 as ba,Xi as bb,d as c,X6 as ca,oC as cb,a5 as d,q6 as da,nC as db,B as e,J6 as ea,lC as eb,d1 as f,j6 as fa,VC as fb,z as g,e3 as ga,$C as gb,N as h,r3 as ha,i4 as hb,d9 as i,a3 as ia,XC as ib,p9 as j,k2 as ja,C4 as jb,c9 as k,C3 as ka,ss as kb,L1 as l,Z2 as la,Ls as lb,i5 as m,$2 as ma,p4 as mb,C5 as n,s3 as na,b4 as nb,s5 as o,d3 as oa,rl as ob,l5 as p,f1 as pa,K7 as pb,c5 as q,c3 as qa,j7 as qb,g5 as r,x1 as ra,yl as rb,R9 as s,b3 as sa,Il as sb,F1 as t,h3 as ta,zl as tb,h as u,x3 as ua,Xl as ub,q4 as v,m3 as va,td as vb,m as w,S3 as wa,ld as wb,w as x,M3 as xa,bd as xb,Q9 as y,L3 as ya,wd as yb,W as z,B2 as za,Fd as zb};//# sourceMappingURL=chunk-DTPQDD44.mjs.map
1385
+ //# sourceMappingURL=chunk-DTPQDD44.mjs.map