groundfloor-react-ui 1.2.71 → 1.2.72
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/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1532,7 +1532,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
|
|
|
1532
1532
|
align-items: center;
|
|
1533
1533
|
margin: 20px 0px;
|
|
1534
1534
|
font-size: 14px;
|
|
1535
|
-
`;const tl=({label:e,labelStyle:l,labelInline:o,required:i,message:n,fileArr:c,setFileArr:s,deleteFile:d,customDropzoneStyles:p,customFileStyles:m,customTextStyles:b,customFileNameStyles:g,backgroundColor:f,singleFile:h,messageSize:y,showSupportedFormats:x,file_extensions:v,maxFilesAmount:C,minFilesAmount:A,fileSizeLimit:w,fileSizeNamingConvention:S,errorMessages:k,suggesionMessage:E,MessagelabelStyle:V,dropValid:z,setDropValid:B,dropzoneContent:I,dropIcon:L,iconColor:W,id:R,customTooltipContentStyle:P,customStylesTPArightBefore:j,customStylesTPArightAfter:F,...q})=>{const Z=u()||H,[O,D]=r(!1),G=a(),[X,J]=r(z),[U,Y]=r("");let N;var Q=v;let K=Q.map((e=>e.toLowerCase()));K=[...new Set(K)];var _=!1,ee=x?"All file formats cannot be used with the files you provided.":"",te="";1==h&&(A=1,C=1);var le="Please upload (min."+A+" to max."+C+")files",oe=e=>{te="";let t=[];var l=0,o=c.length;if(o+e.length<A||o+e.length>C){var r=`Please upload (minimum ${A} to maximum ${C} files)`;te=k?.amount,te=void 0!==te?te:r}for(const e of c)e.size&&(l+=e.size);if(""==te)for(const[o,c]of Object.entries(e)){_=!0,c.name,l+=c.size;var i=c.name.split(".");i=i[i.length-1],_=Q.includes(i.toLowerCase());var a=1024;("MB"===S||"GB"===S||"TB"===S)&&(a*=1024);var n=Math.round(l/a);if(!1===_&&(te=k?.format,te=te||ee),n>w&&_){_=!1;r="The file(s) must be under "+w+" "+S;te=k?.size,te=void 0!==te?te:r}_&&(N=URL.createObjectURL(c),c.path=N,t.push(c))}return te.length>0?(B(!1),J(z),Y(te)):(B(!0),J(z),Y("")),t};function re(e){e.preventDefault(),e.stopPropagation()}function ie(e,t){let l=[...c,...e];return t||(l=l.filter(((e,t,l)=>t===l.findIndex((t=>t.place===e.place&&t.name===e.name))))),s(l),D(!1),l}function ae(e,t){if(e instanceof File){const t=c.findIndex((t=>t.name===e.name));let l=c[t].path;URL.revokeObjectURL(l);const o=c.filter((t=>t.name!==e.name));s(o)}else!function(e,t){const l=c.filter((t=>t.name!==e.name));s(l),d(e)}(e)}const ne=t.createElement("div",null,K.map(((e,l)=>t.createElement("span",null,e,l<K.length-1?",":""))));return t.createElement("div",null,t.createElement("div",{style:{display:"flex",width:"inherit"}},t.createElement(ct,M({customStyles:l,type:"label-text",labelInline:o,text:e,style:{display:"flex",marginBottom:`${o?0:"8px"}`,paddingBottom:"0px"}},q)),i&&t.createElement("div",{style:{marginLeft:"4px",color:`${Z.variant.error}`}},"*")),t.createElement(Yt,{theme:Z,inBuiltCss:T,defaultStyles:"dropzone-parent",backgroundColor:f,customDropzoneStyles:z?p:{},onDragLeave:function(e){re(e),D(!1)},onDragOver:function(e){re(e),D(!0)},onDrop:function(e){re(e);const{files:t}=e.dataTransfer;var l=oe(t);D(!0),q.onFilesAdded(ie(l,h))},onClick:function(){G.current.click()},hover:O,dropValid:z,fileArr:c},t.createElement(Qt,M({ref:G,valid:X,dropValid:z,type:"file",id:R,multiple:!h,onChange:function(e){let{files:t}=e.target;D(!1);var l=oe(t);l&&q.onFilesAdded(ie(l,h))},onClick:e=>e.target.value=null},q)),z?t.createElement(t.Fragment,null,L?t.createElement($,{icon:L,color:O?Z.bgColor:W,size:24}):t.createElement($,{icon:"file-upload",color:O?Z.bgColor:Z.primary["primary-1"],size:24})):null,t.createElement(Kt,{dropValid:z,valid:X,hover:O,backgroundColor:f,customTextStyles:b,inBuiltCss:T,defaultStyles:"dropzone-text-div"},z?t.createElement(t.Fragment,null,I?t.createElement("div",{style:{color:O?Z.bgColor:null}},I):t.createElement("div",null,t.createElement("span",{style:{color:O?Z.bgColor:Z.primary["primary-1"]}},"Choose a file"," "),t.createElement("span",{style:{color:O?Z.bgColor:Z.neutral["neutral-2"]}},"or"," "),t.createElement("span",{style:{color:O?Z.bgColor:Z.textColor}},"drag ",h?"it":"them"," here"))):t.createElement("div",null,t.createElement("span",{style:{color:Z.variant.error}},"Try again!!"," "),t.createElement("span",{style:{color:Z.textColor}},U||n)))),U===ee||k.format?t.createElement("div",{style:{display:"flex"}},t.createElement(ct,M({themeColor:H,customStyles:V,type:"label-text",labelInline:o,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},q)),t.createElement(tt,{contentTrigger:t.createElement("span",{style:{cursor:"pointer"}},"Click here to view the supported file types"),headerTooltip:"",contentTooltip:ne,footerTooltip:"",popperOptionsP:{placement:"right"},settings:{closeOnOutsideClick:!0,trigger:"click"},customTriggerStyle:{marginTop:"8px",marginLeft:"4px",textDecoration:"underline",color:Z.variant["primary-1"]},customBodyStyle:{wordWrap:"break-word"},customContentStyle:P,customStylesTPArightBefore:j,customStylesTPArightAfter:F})):"The file size is not uploaded"===U?t.createElement(ct,M({themeColor:H,customStyles:V,type:"label-text",labelInline:o,text:le,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},q)):"",c?.map(((e,l)=>t.createElement(Nt,{inBuiltCss:T,defaultStyles:"dropzone-file-div",key:`${e}-${l}`,customFileStyles:m},t.createElement(_t,null,t.createElement($,{icon:"file-icon",color:Z.primary["primary-1"]})),(File,t.createElement("a",{style:{color:Z.variant["primary-1"],marginLeft:"5px"},href:e?.path,target:"_blank",rel:"noreferrer",download:e.name}," ",e.name)),t.createElement(el,null,e?.otherInfo),t.createElement($t,{key:101*Math.random()|0,onClick:()=>ae(e)},t.createElement("div",{style:{marginRight:"7px"}},t.createElement($,{icon:`${!(e instanceof File)&&"cloud-icon"}`,color:Z.primary["primary-1"]})),t.createElement($,{icon:"cross-icon",color:Z.neutral["neutral-2"],size:13}))))))};tl.propTypes={onFilesAdded:e.func,dropValid:e.bool,setDropValid:e.func,message:e.string,fileArr:e.array,setFileArr:e.func,customDropzoneStyles:e.object,customFileStyles:e.object,customTextStyles:e.object,customFileNameStyles:e.object,backgroundColor:e.string,messageSize:e.number,maxFilesAmount:e.number,minFilesAmount:e.number,fileSizeLimit:e.number,fileSizeNamingConvention:e.string,showSupportedFormats:e.bool,file_extensions:e.array,errorMessages:e.object,suggesionMessage:e.any,MessagelabelStyle:e.object,id:e.string,dropzoneContent:e.any,dropIcon:e.string,iconColor:e.string,singleFile:e.bool,customTooltipContentStyle:e.object,customStylesTPArightBefore:e.object,customStylesTPArightAfter:e.object},tl.defaultProps={onFilesAdded:()=>null,dropValid:!0,message:"",fileArr:[],setFileArr:()=>{},customDropzoneStyles:{},customFileStyles:{},customTextStyles:{},customFileNameStyles:{},messageSize:100,additionalText:"",maxFilesAmount:5,minFilesAmount:1,fileSizeLimit:10,fileSizeNamingConvention:"MB",showSupportedFormats:!0,file_extensions:["doc","docx","jpg","JPG","pdf","png","xlsx","xlsr","xls"],errorMessages:{},MessagelabelStyle:{},suggesionMessage:"doc, docx, jpg, pdf, png, xlsx, xlsr, xls (Max 10MB)",id:"",iconColor:"black"};const ll=b`
|
|
1535
|
+
`;const tl=({label:e,labelStyle:l,labelInline:o,required:i,message:n,fileArr:c,setFileArr:s,deleteFile:d,customDropzoneStyles:p,customFileStyles:m,customTextStyles:b,customFileNameStyles:g,backgroundColor:f,singleFile:h,messageSize:y,showSupportedFormats:x,file_extensions:v,maxFilesAmount:C,minFilesAmount:A,fileSizeLimit:w,fileSizeNamingConvention:S,errorMessages:k,suggesionMessage:E,MessagelabelStyle:V,dropValid:z,setDropValid:B,dropzoneContent:I,dropIcon:L,iconColor:W,id:R,customTooltipContentStyle:P,customStylesTPArightBefore:j,customStylesTPArightAfter:F,...q})=>{const Z=u()||H,[O,D]=r(!1),G=a(),[X,J]=r(z),[U,Y]=r("");let N;var Q=v;let K=Q.map((e=>e.toLowerCase()));K=[...new Set(K)];var _=!1,ee=x?"All file formats cannot be used with the files you provided.":"",te="";1==h&&(A=1,C=1);var le="Please upload (min."+A+" to max."+C+")files",oe=e=>{te="";let t=[];var l=0,o=c.length;if(o+e.length<A||o+e.length>C){var r=`Please upload (minimum ${A} to maximum ${C} files)`;te=k?.amount,te=void 0!==te?te:r}for(const e of c)e.size&&(l+=e.size);if(""==te)for(const[o,c]of Object.entries(e)){_=!0,c.name,l+=c.size;var i=c.name.split(".");i=i[i.length-1],_=Q.includes(i.toLowerCase());var a=1024;("MB"===S||"GB"===S||"TB"===S)&&(a*=1024);var n=Math.round(l/a);if(!1===_&&(te=k?.format,te=te||ee),n>w&&_){_=!1;r="The file(s) must be under "+w+" "+S;te=k?.size,te=void 0!==te?te:r}_&&(N=URL.createObjectURL(c),c.path=N,t.push(c))}return te.length>0?(B(!1),J(z),Y(te)):(B(!0),J(z),Y("")),t};function re(e){e.preventDefault(),e.stopPropagation()}function ie(e,t){let l=[...c,...e];return t||(l=l.filter(((e,t,l)=>t===l.findIndex((t=>t.place===e.place&&t.name===e.name))))),s(l),D(!1),l}function ae(e,t){if(e instanceof File){const t=c.findIndex((t=>t.name===e.name));let l=c[t].path;URL.revokeObjectURL(l);const o=c.filter((t=>t.name!==e.name));s(o)}else!function(e,t){const l=c.filter((t=>t.name!==e.name));s(l),d(e)}(e)}const ne=t.createElement("div",null,K.map(((e,l)=>t.createElement("span",null,e,l<K.length-1?", ":""))));return t.createElement("div",null,t.createElement("div",{style:{display:"flex",width:"inherit"}},t.createElement(ct,M({customStyles:l,type:"label-text",labelInline:o,text:e,style:{display:"flex",marginBottom:`${o?0:"8px"}`,paddingBottom:"0px"}},q)),i&&t.createElement("div",{style:{marginLeft:"4px",color:`${Z.variant.error}`}},"*")),t.createElement(Yt,{theme:Z,inBuiltCss:T,defaultStyles:"dropzone-parent",backgroundColor:f,customDropzoneStyles:z?p:{},onDragLeave:function(e){re(e),D(!1)},onDragOver:function(e){re(e),D(!0)},onDrop:function(e){re(e);const{files:t}=e.dataTransfer;var l=oe(t);D(!0),q.onFilesAdded(ie(l,h))},onClick:function(){G.current.click()},hover:O,dropValid:z,fileArr:c},t.createElement(Qt,M({ref:G,valid:X,dropValid:z,type:"file",id:R,multiple:!h,onChange:function(e){let{files:t}=e.target;D(!1);var l=oe(t);l&&q.onFilesAdded(ie(l,h))},onClick:e=>e.target.value=null},q)),z?t.createElement(t.Fragment,null,L?t.createElement($,{icon:L,color:O?Z.bgColor:W,size:24}):t.createElement($,{icon:"file-upload",color:O?Z.bgColor:Z.primary["primary-1"],size:24})):null,t.createElement(Kt,{dropValid:z,valid:X,hover:O,backgroundColor:f,customTextStyles:b,inBuiltCss:T,defaultStyles:"dropzone-text-div"},z?t.createElement(t.Fragment,null,I?t.createElement("div",{style:{color:O?Z.bgColor:null}},I):t.createElement("div",null,t.createElement("span",{style:{color:O?Z.bgColor:Z.primary["primary-1"]}},"Choose a file"," "),t.createElement("span",{style:{color:O?Z.bgColor:Z.neutral["neutral-2"]}},"or"," "),t.createElement("span",{style:{color:O?Z.bgColor:Z.textColor}},"drag ",h?"it":"them"," here"))):t.createElement("div",null,t.createElement("span",{style:{color:Z.variant.error}},"Try again!!"," "),t.createElement("span",{style:{color:Z.textColor}},U||n)))),U===ee||k.format?t.createElement("div",{style:{display:"flex"}},t.createElement(ct,M({themeColor:H,customStyles:V,type:"label-text",labelInline:o,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},q)),t.createElement(tt,{contentTrigger:t.createElement("span",{style:{cursor:"pointer"}},"Click here to view the supported file types"),headerTooltip:"",contentTooltip:ne,footerTooltip:"",popperOptionsP:{placement:"right"},settings:{closeOnOutsideClick:!0,trigger:"click"},customTriggerStyle:{marginTop:"8px",marginLeft:"4px",textDecoration:"underline",color:Z.variant["primary-1"]},customBodyStyle:{wordWrap:"break-word"},customContentStyle:P,customStylesTPArightBefore:j,customStylesTPArightAfter:F})):"The file size is not uploaded"===U?t.createElement(ct,M({themeColor:H,customStyles:V,type:"label-text",labelInline:o,text:le,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},q)):"",c?.map(((e,l)=>t.createElement(Nt,{inBuiltCss:T,defaultStyles:"dropzone-file-div",key:`${e}-${l}`,customFileStyles:m},t.createElement(_t,null,t.createElement($,{icon:"file-icon",color:Z.primary["primary-1"]})),(File,t.createElement("a",{style:{color:Z.variant["primary-1"],marginLeft:"5px"},href:e?.path,target:"_blank",rel:"noreferrer",download:e.name}," ",e.name)),t.createElement(el,null,e?.otherInfo),t.createElement($t,{key:101*Math.random()|0,onClick:()=>ae(e)},t.createElement("div",{style:{marginRight:"7px"}},t.createElement($,{icon:`${!(e instanceof File)&&"cloud-icon"}`,color:Z.primary["primary-1"]})),t.createElement($,{icon:"cross-icon",color:Z.neutral["neutral-2"],size:13}))))))};tl.propTypes={onFilesAdded:e.func,dropValid:e.bool,setDropValid:e.func,message:e.string,fileArr:e.array,setFileArr:e.func,customDropzoneStyles:e.object,customFileStyles:e.object,customTextStyles:e.object,customFileNameStyles:e.object,backgroundColor:e.string,messageSize:e.number,maxFilesAmount:e.number,minFilesAmount:e.number,fileSizeLimit:e.number,fileSizeNamingConvention:e.string,showSupportedFormats:e.bool,file_extensions:e.array,errorMessages:e.object,suggesionMessage:e.any,MessagelabelStyle:e.object,id:e.string,dropzoneContent:e.any,dropIcon:e.string,iconColor:e.string,singleFile:e.bool,customTooltipContentStyle:e.object,customStylesTPArightBefore:e.object,customStylesTPArightAfter:e.object},tl.defaultProps={onFilesAdded:()=>null,dropValid:!0,message:"",fileArr:[],setFileArr:()=>{},customDropzoneStyles:{},customFileStyles:{},customTextStyles:{},customFileNameStyles:{},messageSize:100,additionalText:"",maxFilesAmount:5,minFilesAmount:1,fileSizeLimit:10,fileSizeNamingConvention:"MB",showSupportedFormats:!0,file_extensions:["doc","docx","jpg","JPG","pdf","png","xlsx","xlsr","xls"],errorMessages:{},MessagelabelStyle:{},suggesionMessage:"doc, docx, jpg, pdf, png, xlsx, xlsr, xls (Max 10MB)",id:"",iconColor:"black"};const ll=b`
|
|
1536
1536
|
pointer-events: none;
|
|
1537
1537
|
`,ol=m.input`
|
|
1538
1538
|
background-color: transparent;
|
package/dist/index.js
CHANGED
|
@@ -1532,7 +1532,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
|
|
|
1532
1532
|
align-items: center;
|
|
1533
1533
|
margin: 20px 0px;
|
|
1534
1534
|
font-size: 14px;
|
|
1535
|
-
`;const Kt=({label:e,labelStyle:a,labelInline:o,required:r,message:i,fileArr:n,setFileArr:c,deleteFile:s,customDropzoneStyles:d,customFileStyles:u,customTextStyles:p,customFileNameStyles:f,backgroundColor:m,singleFile:b,messageSize:h,showSupportedFormats:y,file_extensions:x,maxFilesAmount:v,minFilesAmount:C,fileSizeLimit:A,fileSizeNamingConvention:w,errorMessages:S,suggesionMessage:E,MessagelabelStyle:V,dropValid:z,setDropValid:M,dropzoneContent:B,dropIcon:I,iconColor:L,id:T,customTooltipContentStyle:P,customStylesTPArightBefore:H,customStylesTPArightAfter:j,...F})=>{const q=l.useTheme()||R,[Z,O]=t.useState(!1),D=t.createRef(),[G,X]=t.useState(z),[J,U]=t.useState("");let Y;var Q=x;let K=Q.map((e=>e.toLowerCase()));K=[...new Set(K)];var $=!1,_=y?"All file formats cannot be used with the files you provided.":"",ee="";1==b&&(C=1,v=1);var te="Please upload (min."+C+" to max."+v+")files",le=e=>{ee="";let t=[];var l=0,a=n.length;if(a+e.length<C||a+e.length>v){var o=`Please upload (minimum ${C} to maximum ${v} files)`;ee=S?.amount,ee=void 0!==ee?ee:o}for(const e of n)e.size&&(l+=e.size);if(""==ee)for(const[a,n]of Object.entries(e)){$=!0,n.name,l+=n.size;var r=n.name.split(".");r=r[r.length-1],$=Q.includes(r.toLowerCase());var i=1024;("MB"===w||"GB"===w||"TB"===w)&&(i*=1024);var c=Math.round(l/i);if(!1===$&&(ee=S?.format,ee=ee||_),c>A&&$){$=!1;o="The file(s) must be under "+A+" "+w;ee=S?.size,ee=void 0!==ee?ee:o}$&&(Y=URL.createObjectURL(n),n.path=Y,t.push(n))}return ee.length>0?(M(!1),X(z),U(ee)):(M(!0),X(z),U("")),t};function ae(e){e.preventDefault(),e.stopPropagation()}function oe(e,t){let l=[...n,...e];return t||(l=l.filter(((e,t,l)=>t===l.findIndex((t=>t.place===e.place&&t.name===e.name))))),c(l),O(!1),l}function re(e,t){if(e instanceof File){const t=n.findIndex((t=>t.name===e.name));let l=n[t].path;URL.revokeObjectURL(l);const a=n.filter((t=>t.name!==e.name));c(a)}else!function(e,t){const l=n.filter((t=>t.name!==e.name));c(l),s(e)}(e)}const ie=g.default.createElement("div",null,K.map(((e,t)=>g.default.createElement("span",null,e,t<K.length-1?",":""))));return g.default.createElement("div",null,g.default.createElement("div",{style:{display:"flex",width:"inherit"}},g.default.createElement(ot,k({customStyles:a,type:"label-text",labelInline:o,text:e,style:{display:"flex",marginBottom:`${o?0:"8px"}`,paddingBottom:"0px"}},F)),r&&g.default.createElement("div",{style:{marginLeft:"4px",color:`${q.variant.error}`}},"*")),g.default.createElement(Gt,{theme:q,inBuiltCss:W,defaultStyles:"dropzone-parent",backgroundColor:m,customDropzoneStyles:z?d:{},onDragLeave:function(e){ae(e),O(!1)},onDragOver:function(e){ae(e),O(!0)},onDrop:function(e){ae(e);const{files:t}=e.dataTransfer;var l=le(t);O(!0),F.onFilesAdded(oe(l,b))},onClick:function(){D.current.click()},hover:Z,dropValid:z,fileArr:n},g.default.createElement(Jt,k({ref:D,valid:G,dropValid:z,type:"file",id:T,multiple:!b,onChange:function(e){let{files:t}=e.target;O(!1);var l=le(t);l&&F.onFilesAdded(oe(l,b))},onClick:e=>e.target.value=null},F)),z?g.default.createElement(g.default.Fragment,null,I?g.default.createElement(N,{icon:I,color:Z?q.bgColor:L,size:24}):g.default.createElement(N,{icon:"file-upload",color:Z?q.bgColor:q.primary["primary-1"],size:24})):null,g.default.createElement(Ut,{dropValid:z,valid:G,hover:Z,backgroundColor:m,customTextStyles:p,inBuiltCss:W,defaultStyles:"dropzone-text-div"},z?g.default.createElement(g.default.Fragment,null,B?g.default.createElement("div",{style:{color:Z?q.bgColor:null}},B):g.default.createElement("div",null,g.default.createElement("span",{style:{color:Z?q.bgColor:q.primary["primary-1"]}},"Choose a file"," "),g.default.createElement("span",{style:{color:Z?q.bgColor:q.neutral["neutral-2"]}},"or"," "),g.default.createElement("span",{style:{color:Z?q.bgColor:q.textColor}},"drag ",b?"it":"them"," here"))):g.default.createElement("div",null,g.default.createElement("span",{style:{color:q.variant.error}},"Try again!!"," "),g.default.createElement("span",{style:{color:q.textColor}},J||i)))),J===_||S.format?g.default.createElement("div",{style:{display:"flex"}},g.default.createElement(ot,k({themeColor:R,customStyles:V,type:"label-text",labelInline:o,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},F)),g.default.createElement(Ke,{contentTrigger:g.default.createElement("span",{style:{cursor:"pointer"}},"Click here to view the supported file types"),headerTooltip:"",contentTooltip:ie,footerTooltip:"",popperOptionsP:{placement:"right"},settings:{closeOnOutsideClick:!0,trigger:"click"},customTriggerStyle:{marginTop:"8px",marginLeft:"4px",textDecoration:"underline",color:q.variant["primary-1"]},customBodyStyle:{wordWrap:"break-word"},customContentStyle:P,customStylesTPArightBefore:H,customStylesTPArightAfter:j})):"The file size is not uploaded"===J?g.default.createElement(ot,k({themeColor:R,customStyles:V,type:"label-text",labelInline:o,text:te,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},F)):"",n?.map(((e,t)=>g.default.createElement(Xt,{inBuiltCss:W,defaultStyles:"dropzone-file-div",key:`${e}-${t}`,customFileStyles:u},g.default.createElement(Nt,null,g.default.createElement(N,{icon:"file-icon",color:q.primary["primary-1"]})),(File,g.default.createElement("a",{style:{color:q.variant["primary-1"],marginLeft:"5px"},href:e?.path,target:"_blank",rel:"noreferrer",download:e.name}," ",e.name)),g.default.createElement(Qt,null,e?.otherInfo),g.default.createElement(Yt,{key:101*Math.random()|0,onClick:()=>re(e)},g.default.createElement("div",{style:{marginRight:"7px"}},g.default.createElement(N,{icon:`${!(e instanceof File)&&"cloud-icon"}`,color:q.primary["primary-1"]})),g.default.createElement(N,{icon:"cross-icon",color:q.neutral["neutral-2"],size:13}))))))};Kt.propTypes={onFilesAdded:b.default.func,dropValid:b.default.bool,setDropValid:b.default.func,message:b.default.string,fileArr:b.default.array,setFileArr:b.default.func,customDropzoneStyles:b.default.object,customFileStyles:b.default.object,customTextStyles:b.default.object,customFileNameStyles:b.default.object,backgroundColor:b.default.string,messageSize:b.default.number,maxFilesAmount:b.default.number,minFilesAmount:b.default.number,fileSizeLimit:b.default.number,fileSizeNamingConvention:b.default.string,showSupportedFormats:b.default.bool,file_extensions:b.default.array,errorMessages:b.default.object,suggesionMessage:b.default.any,MessagelabelStyle:b.default.object,id:b.default.string,dropzoneContent:b.default.any,dropIcon:b.default.string,iconColor:b.default.string,singleFile:b.default.bool,customTooltipContentStyle:b.default.object,customStylesTPArightBefore:b.default.object,customStylesTPArightAfter:b.default.object},Kt.defaultProps={onFilesAdded:()=>null,dropValid:!0,message:"",fileArr:[],setFileArr:()=>{},customDropzoneStyles:{},customFileStyles:{},customTextStyles:{},customFileNameStyles:{},messageSize:100,additionalText:"",maxFilesAmount:5,minFilesAmount:1,fileSizeLimit:10,fileSizeNamingConvention:"MB",showSupportedFormats:!0,file_extensions:["doc","docx","jpg","JPG","pdf","png","xlsx","xlsr","xls"],errorMessages:{},MessagelabelStyle:{},suggesionMessage:"doc, docx, jpg, pdf, png, xlsx, xlsr, xls (Max 10MB)",id:"",iconColor:"black"};const $t=l.css`
|
|
1535
|
+
`;const Kt=({label:e,labelStyle:a,labelInline:o,required:r,message:i,fileArr:n,setFileArr:c,deleteFile:s,customDropzoneStyles:d,customFileStyles:u,customTextStyles:p,customFileNameStyles:f,backgroundColor:m,singleFile:b,messageSize:h,showSupportedFormats:y,file_extensions:x,maxFilesAmount:v,minFilesAmount:C,fileSizeLimit:A,fileSizeNamingConvention:w,errorMessages:S,suggesionMessage:E,MessagelabelStyle:V,dropValid:z,setDropValid:M,dropzoneContent:B,dropIcon:I,iconColor:L,id:T,customTooltipContentStyle:P,customStylesTPArightBefore:H,customStylesTPArightAfter:j,...F})=>{const q=l.useTheme()||R,[Z,O]=t.useState(!1),D=t.createRef(),[G,X]=t.useState(z),[J,U]=t.useState("");let Y;var Q=x;let K=Q.map((e=>e.toLowerCase()));K=[...new Set(K)];var $=!1,_=y?"All file formats cannot be used with the files you provided.":"",ee="";1==b&&(C=1,v=1);var te="Please upload (min."+C+" to max."+v+")files",le=e=>{ee="";let t=[];var l=0,a=n.length;if(a+e.length<C||a+e.length>v){var o=`Please upload (minimum ${C} to maximum ${v} files)`;ee=S?.amount,ee=void 0!==ee?ee:o}for(const e of n)e.size&&(l+=e.size);if(""==ee)for(const[a,n]of Object.entries(e)){$=!0,n.name,l+=n.size;var r=n.name.split(".");r=r[r.length-1],$=Q.includes(r.toLowerCase());var i=1024;("MB"===w||"GB"===w||"TB"===w)&&(i*=1024);var c=Math.round(l/i);if(!1===$&&(ee=S?.format,ee=ee||_),c>A&&$){$=!1;o="The file(s) must be under "+A+" "+w;ee=S?.size,ee=void 0!==ee?ee:o}$&&(Y=URL.createObjectURL(n),n.path=Y,t.push(n))}return ee.length>0?(M(!1),X(z),U(ee)):(M(!0),X(z),U("")),t};function ae(e){e.preventDefault(),e.stopPropagation()}function oe(e,t){let l=[...n,...e];return t||(l=l.filter(((e,t,l)=>t===l.findIndex((t=>t.place===e.place&&t.name===e.name))))),c(l),O(!1),l}function re(e,t){if(e instanceof File){const t=n.findIndex((t=>t.name===e.name));let l=n[t].path;URL.revokeObjectURL(l);const a=n.filter((t=>t.name!==e.name));c(a)}else!function(e,t){const l=n.filter((t=>t.name!==e.name));c(l),s(e)}(e)}const ie=g.default.createElement("div",null,K.map(((e,t)=>g.default.createElement("span",null,e,t<K.length-1?", ":""))));return g.default.createElement("div",null,g.default.createElement("div",{style:{display:"flex",width:"inherit"}},g.default.createElement(ot,k({customStyles:a,type:"label-text",labelInline:o,text:e,style:{display:"flex",marginBottom:`${o?0:"8px"}`,paddingBottom:"0px"}},F)),r&&g.default.createElement("div",{style:{marginLeft:"4px",color:`${q.variant.error}`}},"*")),g.default.createElement(Gt,{theme:q,inBuiltCss:W,defaultStyles:"dropzone-parent",backgroundColor:m,customDropzoneStyles:z?d:{},onDragLeave:function(e){ae(e),O(!1)},onDragOver:function(e){ae(e),O(!0)},onDrop:function(e){ae(e);const{files:t}=e.dataTransfer;var l=le(t);O(!0),F.onFilesAdded(oe(l,b))},onClick:function(){D.current.click()},hover:Z,dropValid:z,fileArr:n},g.default.createElement(Jt,k({ref:D,valid:G,dropValid:z,type:"file",id:T,multiple:!b,onChange:function(e){let{files:t}=e.target;O(!1);var l=le(t);l&&F.onFilesAdded(oe(l,b))},onClick:e=>e.target.value=null},F)),z?g.default.createElement(g.default.Fragment,null,I?g.default.createElement(N,{icon:I,color:Z?q.bgColor:L,size:24}):g.default.createElement(N,{icon:"file-upload",color:Z?q.bgColor:q.primary["primary-1"],size:24})):null,g.default.createElement(Ut,{dropValid:z,valid:G,hover:Z,backgroundColor:m,customTextStyles:p,inBuiltCss:W,defaultStyles:"dropzone-text-div"},z?g.default.createElement(g.default.Fragment,null,B?g.default.createElement("div",{style:{color:Z?q.bgColor:null}},B):g.default.createElement("div",null,g.default.createElement("span",{style:{color:Z?q.bgColor:q.primary["primary-1"]}},"Choose a file"," "),g.default.createElement("span",{style:{color:Z?q.bgColor:q.neutral["neutral-2"]}},"or"," "),g.default.createElement("span",{style:{color:Z?q.bgColor:q.textColor}},"drag ",b?"it":"them"," here"))):g.default.createElement("div",null,g.default.createElement("span",{style:{color:q.variant.error}},"Try again!!"," "),g.default.createElement("span",{style:{color:q.textColor}},J||i)))),J===_||S.format?g.default.createElement("div",{style:{display:"flex"}},g.default.createElement(ot,k({themeColor:R,customStyles:V,type:"label-text",labelInline:o,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},F)),g.default.createElement(Ke,{contentTrigger:g.default.createElement("span",{style:{cursor:"pointer"}},"Click here to view the supported file types"),headerTooltip:"",contentTooltip:ie,footerTooltip:"",popperOptionsP:{placement:"right"},settings:{closeOnOutsideClick:!0,trigger:"click"},customTriggerStyle:{marginTop:"8px",marginLeft:"4px",textDecoration:"underline",color:q.variant["primary-1"]},customBodyStyle:{wordWrap:"break-word"},customContentStyle:P,customStylesTPArightBefore:H,customStylesTPArightAfter:j})):"The file size is not uploaded"===J?g.default.createElement(ot,k({themeColor:R,customStyles:V,type:"label-text",labelInline:o,text:te,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},F)):"",n?.map(((e,t)=>g.default.createElement(Xt,{inBuiltCss:W,defaultStyles:"dropzone-file-div",key:`${e}-${t}`,customFileStyles:u},g.default.createElement(Nt,null,g.default.createElement(N,{icon:"file-icon",color:q.primary["primary-1"]})),(File,g.default.createElement("a",{style:{color:q.variant["primary-1"],marginLeft:"5px"},href:e?.path,target:"_blank",rel:"noreferrer",download:e.name}," ",e.name)),g.default.createElement(Qt,null,e?.otherInfo),g.default.createElement(Yt,{key:101*Math.random()|0,onClick:()=>re(e)},g.default.createElement("div",{style:{marginRight:"7px"}},g.default.createElement(N,{icon:`${!(e instanceof File)&&"cloud-icon"}`,color:q.primary["primary-1"]})),g.default.createElement(N,{icon:"cross-icon",color:q.neutral["neutral-2"],size:13}))))))};Kt.propTypes={onFilesAdded:b.default.func,dropValid:b.default.bool,setDropValid:b.default.func,message:b.default.string,fileArr:b.default.array,setFileArr:b.default.func,customDropzoneStyles:b.default.object,customFileStyles:b.default.object,customTextStyles:b.default.object,customFileNameStyles:b.default.object,backgroundColor:b.default.string,messageSize:b.default.number,maxFilesAmount:b.default.number,minFilesAmount:b.default.number,fileSizeLimit:b.default.number,fileSizeNamingConvention:b.default.string,showSupportedFormats:b.default.bool,file_extensions:b.default.array,errorMessages:b.default.object,suggesionMessage:b.default.any,MessagelabelStyle:b.default.object,id:b.default.string,dropzoneContent:b.default.any,dropIcon:b.default.string,iconColor:b.default.string,singleFile:b.default.bool,customTooltipContentStyle:b.default.object,customStylesTPArightBefore:b.default.object,customStylesTPArightAfter:b.default.object},Kt.defaultProps={onFilesAdded:()=>null,dropValid:!0,message:"",fileArr:[],setFileArr:()=>{},customDropzoneStyles:{},customFileStyles:{},customTextStyles:{},customFileNameStyles:{},messageSize:100,additionalText:"",maxFilesAmount:5,minFilesAmount:1,fileSizeLimit:10,fileSizeNamingConvention:"MB",showSupportedFormats:!0,file_extensions:["doc","docx","jpg","JPG","pdf","png","xlsx","xlsr","xls"],errorMessages:{},MessagelabelStyle:{},suggesionMessage:"doc, docx, jpg, pdf, png, xlsx, xlsr, xls (Max 10MB)",id:"",iconColor:"black"};const $t=l.css`
|
|
1536
1536
|
pointer-events: none;
|
|
1537
1537
|
`,_t=h.default.input`
|
|
1538
1538
|
background-color: transparent;
|