groundfloor-react-ui 1.2.69 → 1.2.71

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 CHANGED
@@ -287,13 +287,13 @@ ${({inBuiltCss:e,type:t,size:l,customStyles:o})=>{if(e){let r={};if(e[t]){for(co
287
287
  `,xe=m.span`
288
288
  background-color: red;
289
289
  color: white;
290
- height: 13px;
291
- width: 13px;
290
+ height: 19px;
291
+ width: 19px;
292
292
  border-radius: 50%;
293
- font-size: 6px;
293
+ font-size: 12px;
294
294
  position: absolute;
295
- top: 2px;
296
- left: 24px;
295
+ top: -8px;
296
+ left: 18px;
297
297
  display: flex;
298
298
  justify-content: center;
299
299
  align-items: center;
@@ -1208,6 +1208,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
1208
1208
  display: flex;
1209
1209
  }
1210
1210
  .react-datepicker {
1211
+ display: flex;
1211
1212
  .react-datepicker__triangle {
1212
1213
  visibility: hidden;
1213
1214
  }
@@ -1531,7 +1532,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
1531
1532
  align-items: center;
1532
1533
  margin: 20px 0px;
1533
1534
  font-size: 14px;
1534
- `;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,K=!1,_=x?"All file formats cannot be used with the files you provided.":"",ee=(E=x?"The Supported format's are: ":"","");1==h&&(A=1,C=1);var te="Please upload (min."+A+" to max."+C+")files",le=e=>{ee="";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)`;ee=k?.amount,ee=void 0!==ee?ee:r}for(const e of c)e.size&&(l+=e.size);if(""==ee)for(const[o,c]of Object.entries(e)){K=!0,c.name,l+=c.size;var i=c.name.split(".");i=i[i.length-1],K=Q.includes(i.toLowerCase());var a=1024;("MB"===S||"GB"===S||"TB"===S)&&(a*=1024);var n=Math.round(l/a);if(!1===K&&(ee=k?.format,ee=ee||_),n>w&&K){K=!1;r="The file(s) must be under "+w+" "+S;ee=k?.size,ee=void 0!==ee?ee:r}K&&(N=URL.createObjectURL(c),c.path=N,t.push(c))}return ee.length>0?(B(!1),J(z),Y(ee)):(B(!0),J(z),Y("")),t};function oe(e){e.preventDefault(),e.stopPropagation()}function re(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 ie(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)}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){oe(e),D(!1)},onDragOver:function(e){oe(e),D(!0)},onDrop:function(e){oe(e);const{files:t}=e.dataTransfer;var l=le(t);D(!0),q.onFilesAdded(re(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=le(t);l&&q.onFilesAdded(re(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===_||k.format?t.createElement("div",{style:{display:"flex"}},t.createElement(ct,M({themeColor:H,customStyles:V,type:"label-text",labelInline:o,text:E,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},q)),t.createElement(tt,{contentTrigger:t.createElement("span",null,"read more"),headerTooltip:"",contentTooltip:JSON.stringify(Q),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:te,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:()=>ie(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","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`
1535
1536
  pointer-events: none;
1536
1537
  `,ol=m.input`
1537
1538
  background-color: transparent;
@@ -2558,7 +2559,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
2558
2559
  display: flex;
2559
2560
  justify-content: center;
2560
2561
  align-items: center;
2561
- `,rr=(e,t,l=1)=>{let o=e;const r=[];for(;o<=t;)r.push(o),o+=l;return r},ir=({totalRecords:e,pageNeighbours:l,onPageChanged:o,currentPageNumber:a,propsDropdownSelect:n,showRowsPerPage:c})=>{let s=n?.selectedValue?.value||10;0==s?s=1:s>e&&(s=e);const[d,p]=r(1),[m,b]=r(Math.ceil(e/s)),[g,f]=r({from:1+(d-1)*s,to:d*s>e?e:d*s}),h=u()||H,{width:y}=ze();l=y<512?0:y<768?1:l,i((()=>{b(Math.ceil(e/s)),x(a)}),[]),i((()=>{b(Math.ceil(e/s)),x(1)}),[s]),i((()=>{f({from:1+(d-1)*s,to:d*s>e?e:d*s})}),[d]);const x=t=>{const l=Math.max(0,Math.min(t,m));p(l);o({currentPage:l,totalPages:m,totalRecords:e})},v=e=>t=>{t.preventDefault(),x(e)},C=e=>{e.preventDefault(),x(d-2*(l||1)-1)},A=e=>{e.preventDefault(),x(d+2*(l||1)+1)};if(!e||1===m||0===s)return null;const w=(()=>{const e=2*l+3;if(m>e+3){const t=Math.max(2,d-l),o=Math.min(m-1,d+l);let r=rr(t,o);const i=t>2,a=m-o>1,n=e-(r.length+1);switch(!0){case i&&!a:r=["LEFT",...rr(t-n,t-1),...r];break;case!i&&a:{const e=rr(o+1,o+n);r=[...r,...e,"RIGHT"];break}default:r=["LEFT",...r,"RIGHT"]}return[1,...r,m]}return rr(1,m)})();return t.createElement(er,{theme:h,showRowsPerPage:c},t.createElement(lr,{theme:h},t.createElement(tr,{onClick:1!==d?v(d-1):null,disabled:1===d,theme:h},t.createElement($,{icon:"triangle-down",transform:"rotate(90deg)",color:"#BBC4CF"}),t.createElement("span",{className:"prev-text"}," PREVIOUS")),w.map(((e,l)=>"LEFT"===e?t.createElement("li",{key:l,className:"page-item"},t.createElement("div",{className:"page-link",onClick:C},t.createElement("span",{className:"text"},t.createElement($,{icon:"load-more",color:"#081348",transform:"rotate(90deg)"})),t.createElement("span",{className:"icon"},t.createElement($,{icon:"ellipses-horizontal",color:"#081348"}))," ")):"RIGHT"===e?t.createElement("li",{key:l,className:"page-item"},t.createElement("div",{className:"page-link",onClick:A},t.createElement("span",{className:"text"},t.createElement($,{icon:"load-more",color:h.primary["primary-2"],transform:"rotate(-90deg)"})),t.createElement("span",{className:"icon"},t.createElement($,{icon:"ellipses-horizontal",color:h.primary["primary-2"]})))):t.createElement("li",{key:l,className:"page-item"+(d===e?" active":"")},t.createElement("div",{className:"page-link",onClick:v(e)},e)))),t.createElement(tr,{onClick:d!==m?v(d+1):null,disabled:d===m,theme:h},t.createElement("span",{className:"next-text"}," NEXT"),t.createElement($,{icon:"triangle-down",transform:"rotate(-90deg)",color:"#BBC4CF"}))),c&&t.createElement(or,null,t.createElement("span",{style:{margin:"0 16px",color:h.variant["neutral-3"],fontSize:"12px"}},"Rows Per Page"),t.createElement(Xt,M({customSelectStyles:{menu:e=>({...e,border:"none",marginTop:"1px",borderTopRightRadius:"0px",borderTopLeftRadius:"0px",outline:"none",boxShadow:"0px 6px 20px rgba(56, 66, 100, 0.15)",borderRadius:"4.32px",fontSize:"14px",width:"100%",maxWidth:"100px"}),control:(e,t)=>({...e,border:"1px solid transparent",borderRadius:"6.25391px",height:"31px",minHeight:"31px",boxShadow:(t.isSelected||t.isFocused)&&"none",backgroundColor:"#F2F4FE",maxWidth:"100px",minWidth:"50px"}),singleValue:e=>({...e,fontSize:"12px",marginLeft:"0px",width:"100",marginRight:0})},customWrapperStyles:{marginRight:"16px"},isSearchable:!1,optionArr:[{value:10,label:10},{value:20,label:20},{value:30,label:30}]},n)),t.createElement("span",{style:{color:h.variant["neutral-3"],fontSize:"12px"}},g?.from,"-",g?.to," of"," ",t.createElement("span",{style:{color:h.variant["neutral-1"]}},e)," ","Results")))};ir.propTypes={totalRecords:e.number.isRequired,pageNeighbours:e.number,onPageChanged:e.func,showRowsPerPage:e.bool,currentPageNumber:e.number},ir.defaultProps={totalRecords:0,pageNeighbours:1,onPageChanged:()=>null,showRowsPerPage:!1,currentPageNumber:1};const ar=m.div`
2562
+ `,rr=(e,t,l=1)=>{let o=e;const r=[];for(;o<=t;)r.push(o),o+=l;return r},ir=({totalRecords:e,pageNeighbours:l,onPageChanged:o,currentPageNumber:a,propsDropdownSelect:n,showRowsPerPage:c})=>{let s=n?.selectedValue?.value||10;0==s?s=1:s>e&&(s=e);const[d,p]=r(a),[m,b]=r(Math.ceil(e/s)),[g,f]=r({from:1+(d-1)*s,to:d*s>e?e:d*s}),h=u()||H,{width:y}=ze();l=y<512?0:y<768?1:l,i((()=>{b(Math.ceil(e/s)),x(1)}),[s]),i((()=>{f({from:1+(d-1)*s,to:d*s>e?e:d*s})}),[d]);const x=t=>{const l=Math.max(0,Math.min(t,m));p(l);o({currentPage:l,totalPages:m,totalRecords:e})},v=e=>t=>{t.preventDefault(),x(e)},C=e=>{e.preventDefault(),x(d-2*(l||1)-1)},A=e=>{e.preventDefault(),x(d+2*(l||1)+1)};if(!e||1===m||0===s)return null;const w=(()=>{const e=2*l+3;if(m>e+3){const t=Math.max(2,d-l),o=Math.min(m-1,d+l);let r=rr(t,o);const i=t>2,a=m-o>1,n=e-(r.length+1);switch(!0){case i&&!a:r=["LEFT",...rr(t-n,t-1),...r];break;case!i&&a:{const e=rr(o+1,o+n);r=[...r,...e,"RIGHT"];break}default:r=["LEFT",...r,"RIGHT"]}return[1,...r,m]}return rr(1,m)})();return t.createElement(er,{theme:h,showRowsPerPage:c},t.createElement(lr,{theme:h},t.createElement(tr,{onClick:1!==d?v(d-1):null,disabled:1===d,theme:h},t.createElement($,{icon:"triangle-down",transform:"rotate(90deg)",color:"#BBC4CF"}),t.createElement("span",{className:"prev-text"}," PREVIOUS")),w.map(((e,l)=>"LEFT"===e?t.createElement("li",{key:l,className:"page-item"},t.createElement("div",{className:"page-link",onClick:C},t.createElement("span",{className:"text"},t.createElement($,{icon:"load-more",color:"#081348",transform:"rotate(90deg)"})),t.createElement("span",{className:"icon"},t.createElement($,{icon:"ellipses-horizontal",color:"#081348"}))," ")):"RIGHT"===e?t.createElement("li",{key:l,className:"page-item"},t.createElement("div",{className:"page-link",onClick:A},t.createElement("span",{className:"text"},t.createElement($,{icon:"load-more",color:h.primary["primary-2"],transform:"rotate(-90deg)"})),t.createElement("span",{className:"icon"},t.createElement($,{icon:"ellipses-horizontal",color:h.primary["primary-2"]})))):t.createElement("li",{key:l,className:"page-item"+(d===e?" active":"")},t.createElement("div",{className:"page-link",onClick:v(e)},e)))),t.createElement(tr,{onClick:d!==m?v(d+1):null,disabled:d===m,theme:h},t.createElement("span",{className:"next-text"}," NEXT"),t.createElement($,{icon:"triangle-down",transform:"rotate(-90deg)",color:"#BBC4CF"}))),c&&t.createElement(or,null,t.createElement("span",{style:{margin:"0 16px",color:h.variant["neutral-3"],fontSize:"12px"}},"Rows Per Page"),t.createElement(Xt,M({customSelectStyles:{menu:e=>({...e,border:"none",marginTop:"1px",borderTopRightRadius:"0px",borderTopLeftRadius:"0px",outline:"none",boxShadow:"0px 6px 20px rgba(56, 66, 100, 0.15)",borderRadius:"4.32px",fontSize:"14px",width:"100%",maxWidth:"100px"}),control:(e,t)=>({...e,border:"1px solid transparent",borderRadius:"6.25391px",height:"31px",minHeight:"31px",boxShadow:(t.isSelected||t.isFocused)&&"none",backgroundColor:"#F2F4FE",maxWidth:"100px",minWidth:"50px"}),singleValue:e=>({...e,fontSize:"12px",marginLeft:"0px",width:"100",marginRight:0})},customWrapperStyles:{marginRight:"16px"},isSearchable:!1,optionArr:[{value:10,label:10},{value:20,label:20},{value:30,label:30}]},n)),t.createElement("span",{style:{color:h.variant["neutral-3"],fontSize:"12px"}},g?.from,"-",g?.to," of"," ",t.createElement("span",{style:{color:h.variant["neutral-1"]}},e)," ","Results")))};ir.propTypes={totalRecords:e.number.isRequired,pageNeighbours:e.number,onPageChanged:e.func,showRowsPerPage:e.bool,currentPageNumber:e.number},ir.defaultProps={totalRecords:0,pageNeighbours:1,onPageChanged:()=>null,showRowsPerPage:!1,currentPageNumber:1};const ar=m.div`
2562
2563
  display: flex;
2563
2564
  align-items: center;
2564
2565
  color: ${({theme:e})=>e.variant["neutral-2"]};
package/dist/index.js CHANGED
@@ -287,13 +287,13 @@ ${({inBuiltCss:e,type:t,size:l,customStyles:a})=>{if(e){let o={};if(e[t]){for(co
287
287
  `,ge=h.default.span`
288
288
  background-color: red;
289
289
  color: white;
290
- height: 13px;
291
- width: 13px;
290
+ height: 19px;
291
+ width: 19px;
292
292
  border-radius: 50%;
293
- font-size: 6px;
293
+ font-size: 12px;
294
294
  position: absolute;
295
- top: 2px;
296
- left: 24px;
295
+ top: -8px;
296
+ left: 18px;
297
297
  display: flex;
298
298
  justify-content: center;
299
299
  align-items: center;
@@ -1208,6 +1208,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
1208
1208
  display: flex;
1209
1209
  }
1210
1210
  .react-datepicker {
1211
+ display: flex;
1211
1212
  .react-datepicker__triangle {
1212
1213
  visibility: hidden;
1213
1214
  }
@@ -1531,7 +1532,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
1531
1532
  align-items: center;
1532
1533
  margin: 20px 0px;
1533
1534
  font-size: 14px;
1534
- `;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,K=!1,$=y?"All file formats cannot be used with the files you provided.":"",_=(E=y?"The Supported format's are: ":"","");1==b&&(C=1,v=1);var ee="Please upload (min."+C+" to max."+v+")files",te=e=>{_="";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)`;_=S?.amount,_=void 0!==_?_:o}for(const e of n)e.size&&(l+=e.size);if(""==_)for(const[a,n]of Object.entries(e)){K=!0,n.name,l+=n.size;var r=n.name.split(".");r=r[r.length-1],K=Q.includes(r.toLowerCase());var i=1024;("MB"===w||"GB"===w||"TB"===w)&&(i*=1024);var c=Math.round(l/i);if(!1===K&&(_=S?.format,_=_||$),c>A&&K){K=!1;o="The file(s) must be under "+A+" "+w;_=S?.size,_=void 0!==_?_:o}K&&(Y=URL.createObjectURL(n),n.path=Y,t.push(n))}return _.length>0?(M(!1),X(z),U(_)):(M(!0),X(z),U("")),t};function le(e){e.preventDefault(),e.stopPropagation()}function ae(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 oe(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)}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){le(e),O(!1)},onDragOver:function(e){le(e),O(!0)},onDrop:function(e){le(e);const{files:t}=e.dataTransfer;var l=te(t);O(!0),F.onFilesAdded(ae(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=te(t);l&&F.onFilesAdded(ae(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,text:E,style:{display:"flex",paddingTop:"10px",paddingBottom:`${o?0:"16.64px"}`}},F)),g.default.createElement(Ke,{contentTrigger:g.default.createElement("span",null,"read more"),headerTooltip:"",contentTooltip:JSON.stringify(Q),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:ee,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:()=>oe(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","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`
1535
1536
  pointer-events: none;
1536
1537
  `,_t=h.default.input`
1537
1538
  background-color: transparent;
@@ -2558,7 +2559,7 @@ cursor: ${({disabled:e})=>e?"not-allowed":"text"};
2558
2559
  display: flex;
2559
2560
  justify-content: center;
2560
2561
  align-items: center;
2561
- `,$a=(e,t,l=1)=>{let a=e;const o=[];for(;a<=t;)o.push(a),a+=l;return o},_a=({totalRecords:e,pageNeighbours:a,onPageChanged:o,currentPageNumber:r,propsDropdownSelect:i,showRowsPerPage:n})=>{let c=i?.selectedValue?.value||10;0==c?c=1:c>e&&(c=e);const[s,d]=t.useState(1),[u,p]=t.useState(Math.ceil(e/c)),[f,m]=t.useState({from:1+(s-1)*c,to:s*c>e?e:s*c}),b=l.useTheme()||R,{width:h}=Ee();a=h<512?0:h<768?1:a,t.useEffect((()=>{p(Math.ceil(e/c)),y(r)}),[]),t.useEffect((()=>{p(Math.ceil(e/c)),y(1)}),[c]),t.useEffect((()=>{m({from:1+(s-1)*c,to:s*c>e?e:s*c})}),[s]);const y=t=>{const l=Math.max(0,Math.min(t,u));d(l);o({currentPage:l,totalPages:u,totalRecords:e})},x=e=>t=>{t.preventDefault(),y(e)},v=e=>{e.preventDefault(),y(s-2*(a||1)-1)},C=e=>{e.preventDefault(),y(s+2*(a||1)+1)};if(!e||1===u||0===c)return null;const A=(()=>{const e=2*a+3;if(u>e+3){const t=Math.max(2,s-a),l=Math.min(u-1,s+a);let o=$a(t,l);const r=t>2,i=u-l>1,n=e-(o.length+1);switch(!0){case r&&!i:o=["LEFT",...$a(t-n,t-1),...o];break;case!r&&i:{const e=$a(l+1,l+n);o=[...o,...e,"RIGHT"];break}default:o=["LEFT",...o,"RIGHT"]}return[1,...o,u]}return $a(1,u)})();return g.default.createElement(Ya,{theme:b,showRowsPerPage:n},g.default.createElement(Qa,{theme:b},g.default.createElement(Na,{onClick:1!==s?x(s-1):null,disabled:1===s,theme:b},g.default.createElement(N,{icon:"triangle-down",transform:"rotate(90deg)",color:"#BBC4CF"}),g.default.createElement("span",{className:"prev-text"}," PREVIOUS")),A.map(((e,t)=>"LEFT"===e?g.default.createElement("li",{key:t,className:"page-item"},g.default.createElement("div",{className:"page-link",onClick:v},g.default.createElement("span",{className:"text"},g.default.createElement(N,{icon:"load-more",color:"#081348",transform:"rotate(90deg)"})),g.default.createElement("span",{className:"icon"},g.default.createElement(N,{icon:"ellipses-horizontal",color:"#081348"}))," ")):"RIGHT"===e?g.default.createElement("li",{key:t,className:"page-item"},g.default.createElement("div",{className:"page-link",onClick:C},g.default.createElement("span",{className:"text"},g.default.createElement(N,{icon:"load-more",color:b.primary["primary-2"],transform:"rotate(-90deg)"})),g.default.createElement("span",{className:"icon"},g.default.createElement(N,{icon:"ellipses-horizontal",color:b.primary["primary-2"]})))):g.default.createElement("li",{key:t,className:"page-item"+(s===e?" active":"")},g.default.createElement("div",{className:"page-link",onClick:x(e)},e)))),g.default.createElement(Na,{onClick:s!==u?x(s+1):null,disabled:s===u,theme:b},g.default.createElement("span",{className:"next-text"}," NEXT"),g.default.createElement(N,{icon:"triangle-down",transform:"rotate(-90deg)",color:"#BBC4CF"}))),n&&g.default.createElement(Ka,null,g.default.createElement("span",{style:{margin:"0 16px",color:b.variant["neutral-3"],fontSize:"12px"}},"Rows Per Page"),g.default.createElement(Zt,k({customSelectStyles:{menu:e=>({...e,border:"none",marginTop:"1px",borderTopRightRadius:"0px",borderTopLeftRadius:"0px",outline:"none",boxShadow:"0px 6px 20px rgba(56, 66, 100, 0.15)",borderRadius:"4.32px",fontSize:"14px",width:"100%",maxWidth:"100px"}),control:(e,t)=>({...e,border:"1px solid transparent",borderRadius:"6.25391px",height:"31px",minHeight:"31px",boxShadow:(t.isSelected||t.isFocused)&&"none",backgroundColor:"#F2F4FE",maxWidth:"100px",minWidth:"50px"}),singleValue:e=>({...e,fontSize:"12px",marginLeft:"0px",width:"100",marginRight:0})},customWrapperStyles:{marginRight:"16px"},isSearchable:!1,optionArr:[{value:10,label:10},{value:20,label:20},{value:30,label:30}]},i)),g.default.createElement("span",{style:{color:b.variant["neutral-3"],fontSize:"12px"}},f?.from,"-",f?.to," of"," ",g.default.createElement("span",{style:{color:b.variant["neutral-1"]}},e)," ","Results")))};_a.propTypes={totalRecords:b.default.number.isRequired,pageNeighbours:b.default.number,onPageChanged:b.default.func,showRowsPerPage:b.default.bool,currentPageNumber:b.default.number},_a.defaultProps={totalRecords:0,pageNeighbours:1,onPageChanged:()=>null,showRowsPerPage:!1,currentPageNumber:1};const eo=h.default.div`
2562
+ `,$a=(e,t,l=1)=>{let a=e;const o=[];for(;a<=t;)o.push(a),a+=l;return o},_a=({totalRecords:e,pageNeighbours:a,onPageChanged:o,currentPageNumber:r,propsDropdownSelect:i,showRowsPerPage:n})=>{let c=i?.selectedValue?.value||10;0==c?c=1:c>e&&(c=e);const[s,d]=t.useState(r),[u,p]=t.useState(Math.ceil(e/c)),[f,m]=t.useState({from:1+(s-1)*c,to:s*c>e?e:s*c}),b=l.useTheme()||R,{width:h}=Ee();a=h<512?0:h<768?1:a,t.useEffect((()=>{p(Math.ceil(e/c)),y(1)}),[c]),t.useEffect((()=>{m({from:1+(s-1)*c,to:s*c>e?e:s*c})}),[s]);const y=t=>{const l=Math.max(0,Math.min(t,u));d(l);o({currentPage:l,totalPages:u,totalRecords:e})},x=e=>t=>{t.preventDefault(),y(e)},v=e=>{e.preventDefault(),y(s-2*(a||1)-1)},C=e=>{e.preventDefault(),y(s+2*(a||1)+1)};if(!e||1===u||0===c)return null;const A=(()=>{const e=2*a+3;if(u>e+3){const t=Math.max(2,s-a),l=Math.min(u-1,s+a);let o=$a(t,l);const r=t>2,i=u-l>1,n=e-(o.length+1);switch(!0){case r&&!i:o=["LEFT",...$a(t-n,t-1),...o];break;case!r&&i:{const e=$a(l+1,l+n);o=[...o,...e,"RIGHT"];break}default:o=["LEFT",...o,"RIGHT"]}return[1,...o,u]}return $a(1,u)})();return g.default.createElement(Ya,{theme:b,showRowsPerPage:n},g.default.createElement(Qa,{theme:b},g.default.createElement(Na,{onClick:1!==s?x(s-1):null,disabled:1===s,theme:b},g.default.createElement(N,{icon:"triangle-down",transform:"rotate(90deg)",color:"#BBC4CF"}),g.default.createElement("span",{className:"prev-text"}," PREVIOUS")),A.map(((e,t)=>"LEFT"===e?g.default.createElement("li",{key:t,className:"page-item"},g.default.createElement("div",{className:"page-link",onClick:v},g.default.createElement("span",{className:"text"},g.default.createElement(N,{icon:"load-more",color:"#081348",transform:"rotate(90deg)"})),g.default.createElement("span",{className:"icon"},g.default.createElement(N,{icon:"ellipses-horizontal",color:"#081348"}))," ")):"RIGHT"===e?g.default.createElement("li",{key:t,className:"page-item"},g.default.createElement("div",{className:"page-link",onClick:C},g.default.createElement("span",{className:"text"},g.default.createElement(N,{icon:"load-more",color:b.primary["primary-2"],transform:"rotate(-90deg)"})),g.default.createElement("span",{className:"icon"},g.default.createElement(N,{icon:"ellipses-horizontal",color:b.primary["primary-2"]})))):g.default.createElement("li",{key:t,className:"page-item"+(s===e?" active":"")},g.default.createElement("div",{className:"page-link",onClick:x(e)},e)))),g.default.createElement(Na,{onClick:s!==u?x(s+1):null,disabled:s===u,theme:b},g.default.createElement("span",{className:"next-text"}," NEXT"),g.default.createElement(N,{icon:"triangle-down",transform:"rotate(-90deg)",color:"#BBC4CF"}))),n&&g.default.createElement(Ka,null,g.default.createElement("span",{style:{margin:"0 16px",color:b.variant["neutral-3"],fontSize:"12px"}},"Rows Per Page"),g.default.createElement(Zt,k({customSelectStyles:{menu:e=>({...e,border:"none",marginTop:"1px",borderTopRightRadius:"0px",borderTopLeftRadius:"0px",outline:"none",boxShadow:"0px 6px 20px rgba(56, 66, 100, 0.15)",borderRadius:"4.32px",fontSize:"14px",width:"100%",maxWidth:"100px"}),control:(e,t)=>({...e,border:"1px solid transparent",borderRadius:"6.25391px",height:"31px",minHeight:"31px",boxShadow:(t.isSelected||t.isFocused)&&"none",backgroundColor:"#F2F4FE",maxWidth:"100px",minWidth:"50px"}),singleValue:e=>({...e,fontSize:"12px",marginLeft:"0px",width:"100",marginRight:0})},customWrapperStyles:{marginRight:"16px"},isSearchable:!1,optionArr:[{value:10,label:10},{value:20,label:20},{value:30,label:30}]},i)),g.default.createElement("span",{style:{color:b.variant["neutral-3"],fontSize:"12px"}},f?.from,"-",f?.to," of"," ",g.default.createElement("span",{style:{color:b.variant["neutral-1"]}},e)," ","Results")))};_a.propTypes={totalRecords:b.default.number.isRequired,pageNeighbours:b.default.number,onPageChanged:b.default.func,showRowsPerPage:b.default.bool,currentPageNumber:b.default.number},_a.defaultProps={totalRecords:0,pageNeighbours:1,onPageChanged:()=>null,showRowsPerPage:!1,currentPageNumber:1};const eo=h.default.div`
2562
2563
  display: flex;
2563
2564
  align-items: center;
2564
2565
  color: ${({theme:e})=>e.variant["neutral-2"]};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "groundfloor-react-ui",
3
3
  "description": "Official component library for Ground Floor",
4
- "version": "1.2.69",
4
+ "version": "1.2.71",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
7
7
  "private": false,