master-components-react 4.2.13 → 4.2.14
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.
|
@@ -328,7 +328,7 @@ Valid keys: `+JSON.stringify(Object.keys(Q),null," "));var ce=ve(V,le,A,O,P+"."
|
|
|
328
328
|
${["delete"].includes(v.type)?Xa.staticColor:""}
|
|
329
329
|
${Xa.actionIcon}
|
|
330
330
|
${f(v)&&f(v)!=="no_icon"?Xa.defaultIcons:""}
|
|
331
|
-
`,style:{opacity:r[v.disableKey]?.5:1},children:f(v)&&f(v)!=="no_icon"?f(v):v==null?void 0:v.icon()}),I.jsx("div",{className:Xa.actionLabel,children:I.jsxs("p",{style:{...v==null?void 0:v.style},children:[I.jsx("p",{style:{opacity:r[v.disableKey]?.5:1},children:v==null?void 0:v.label})," ",p(v)]})})]},g))})]})},Qle="DeleteAll-module__deleteAllWrapper",eue="DeleteAll-module__iconContainer",tue="DeleteAll-module__deleteItemsCountLabel",iue="DeleteAll-module__dark",nue="DeleteAll-module__datagridDeleteAllAction",Ml={deleteAllWrapper:Qle,iconContainer:eue,deleteItemsCountLabel:tue,dark:iue,datagridDeleteAllAction:nue},rue=ue.forwardRef((e,t)=>{const[i,n]=ue.useState(0),r=o=>{n(o)};ue.useImperativeHandle(t,()=>({setValue:r}));const a=()=>{e.onDeleteAll&&typeof e.onDeleteAll=="function"&&e.onDeleteAll()};return I.jsxs("div",{ref:t,className:`${(e==null?void 0:e.theme)==="dark"?Ml.dark:""} ${Ml.datagridDeleteAllAction} ${Ml.deleteAllWrapper}`,children:[I.jsx("div",{className:Ml.iconContainer,onClick:a,children:I.jsx(eB,{})}),I.jsx("div",{className:Ml.deleteItemsCountLabel,children:I.jsxs("span",{children:["Delete ",i," Checked Item"]})})]})}),aue=({data:e,customColumns:t,summary:i,keyExpr:n,theme:r,height:a,focusedRowEnabled:o=!0,rowAlternationEnabled:s,columnAutoWidth:l=!0,withCustomStore:u,withGrouping:d,groupDefaultCollapsed:c,storeKey:h,loadFunction:f,updateFunction:p,insertFunction:v,removeFunction:g,withColumnConfigure:C,withDeleteAll:x,withMasterDetail:w,detailTemplate:L,editingOptions:D,scrollMode:G,pagerOptions:H,selection:z,filterOptions:j,defaultPageIndex:Z,searchPanel:ee,onEvent:W,onPageChange:Y,selectionChanged:E,focusedRowChanging:R,focusedRowChanged:q,onRowClick:te,onWheelClick:he,showPagination:de=!0,refresh:Q,diselectAll:K,customActions:y,onColumnConfigure:T,onDeleteAll:A,onDelete:O,onEdit:P,withCustomActions:V,multiExpand:N,onFilterValueChange:X,onRowExpand:le,onRowCollaps:ve,onOptionChanged:ce,onRowPrepared:Te,onFocusedCellChanged:b,ShowLoader:re=!0,noDataText:ne,onLoading:M,hideActions:F,allowColumnResizing:J=!0,disableOverflow:ae,onActionExpand:me})=>{const[ie,be]=ue.useState(!1),De=ue.useRef(t),Ae=ue.useRef(null),[We,ot]=ue.useState(""),Qe=ue.useRef({Refresh:()=>Ae.current.instance.getDataSource().reload(),SelectedRowKeys:()=>Ae.current.instance.getSelectedRowKeys(),DeselectAll:()=>{var Ce;return(Ce=Ae.current)==null?void 0:Ce.instance.deselectAll()}}),[Et,pt]=ue.useState([{label:"Edit",type:"edit",event:(Ce,fe)=>Ma(Ce,fe)},{label:"Delete",type:"delete",event:(Ce,fe)=>Fa(Ce,fe)}]),zt=ue.useRef(null),vi=Ce=>{Et&&Et.length&&di()},ut=()=>{Et&&Et.length&&di()},di=()=>{document.querySelectorAll(".datagrid_action_data_controller > ul").forEach(fe=>{fe.style.display="none",fe.style.pointerEvents="none"})},Li=new Ws({key:h??"id",load:f,update:p,insert:v,remove:g,onLoading:M}),bt=(Ce,fe)=>{if(W&&typeof W=="function"&&W(fe,Ce),fe==="onContentReady"){const U=document.querySelector(".dx-pager"),Ee=document.querySelector("#pagination-container");let Re=!1;U?Re=!U.classList.contains("dx-hidden"):Re=!1,Ee.style.display=Re?"block":"none"}},sn=Ce=>{o&&(z==null?void 0:z.mode)==="multiple"&&x&&zt.current.setValue(Ce.selectedRowKeys.length),E&&typeof E=="function"&&E(Ce)},$i=Ce=>{R&&typeof R=="function"&&R(Ce)},ze=Ce=>{q&&typeof q=="function"&&q(Ce)},Le=Ce=>{b&&typeof b=="function"&&b(Ce)},tt=Ce=>{te&&typeof te=="function"&&te(Ce.data)},Xe=(Ce,fe)=>{Ce.button===1&&(he&&typeof he=="function"&&he(fe.data),Ce.preventDefault())},It=Ce=>{Ce.rowElement&&Ce.data&&Ce.rowElement.addEventListener("mousedown",fe=>Xe(fe,Ce)),Te&&typeof Te=="function"&&Te(Ce)},ln=()=>{A&&typeof A=="function"&&A(Qe.current.SelectedRowKeys())},Go=Ce=>{ce&&typeof ce=="function"&&ce(Ce),Ce.fullName==="paging.pageIndex"&&Y&&typeof Y=="function"&&Y(Ce.value+1)},Uo=Ce=>{let U=document.querySelector(`#datagrid_action_data_id_${Ce[n]}`),Ee=document.querySelectorAll(".datagrid_action_data_controller > ul"),Re=U.querySelector("ul");const qe=document.querySelectorAll(".dx-datagrid-rowsview .dx-row > td");qe&&qe.forEach(dt=>{dt.querySelector("ul")?dt.style.overflow="unset":dt.style.overflow="hidden"});const Tt=U.getBoundingClientRect(),Mt=document.querySelector(".gridWrapper").getBoundingClientRect();let vt={display:"block",position:"absolute",pointerEvents:"all",top:"20px",left:"-70px"};Tt.bottom>Mt.bottom-150&&(vt.top="unset",vt.bottom="100%",vt.left="-100px"),Ee.forEach(dt=>{dt.style.display="none",dt.style.pointerEvents="none"}),Object.assign(Re.style,vt)},Ko=Ce=>{De.current=Ce,be(fe=>!fe),T&&typeof T=="function"&&T(De.current)},br=Ce=>{N||Ce.component.collapseAll(-1),le&&typeof le=="function"&&le(Ce)},il=Ce=>{ve&&typeof ve=="function"&&ve(Ce)},jo=Ce=>{Ce.parentType==="filterRow"&&(Ce.editorElement.onchange=fe=>{const U={columnKey:Ce.dataField,columnName:Ce.caption,filterValue:fe.target.value};X&&typeof X=="function"&&X(U)})},Fa=(Ce,fe)=>{O&&typeof O=="function"&&O(fe)},Ma=(Ce,fe)=>{P&&typeof P=="function"&&P(fe)};ue.useEffect(()=>{y&&y.length&&pt(Ce=>{const fe=Ce;return y.forEach(U=>{fe.some(Ee=>Ee.type===U.type)||fe.push(U)}),fe})},[y]),ue.useEffect(()=>{Q&&(Qe.current.Refresh(),console.info("DataSource Refresh....."))},[Q]),ue.useEffect(()=>{K&&Qe.current.DeselectAll()},[K]),ue.useEffect(()=>{if(Array.isArray(ae)&&ae.length>0){const Ce=()=>{ae.forEach(Ee=>{document.querySelectorAll(`.dx-datagrid-rowsview .dx-row td:nth-child(${Ee})`).forEach(qe=>{qe.style.overflow="unset"})})};Ce();const fe=new MutationObserver(()=>{Ce()}),U=document.querySelector(".dx-datagrid-rowsview");return U&&fe.observe(U,{childList:!0,subtree:!0}),()=>fe.disconnect()}},[ae]);const nl=()=>{const Ce=Ae.current.instance,fe=Ce.pageIndex();fe>0&&Ce.pageIndex(fe-1)},rl=()=>{const Ce=Ae.current.instance,fe=Ce.pageIndex(),U=Ce.pageCount();fe<U-1&&Ce.pageIndex(fe+1)};return ue.useEffect(()=>{De.current=t,be(Ce=>!Ce)},[t]),ue.useEffect(()=>(document.addEventListener("click",vi),document.addEventListener("wheel",ut),()=>{document.removeEventListener("click",vi),document.removeEventListener("wheel",ut)}),[]),ue.useEffect(()=>{const Ce=document.querySelector(".dx-pager"),fe=document.querySelector("#pagination-container");let U=!1;Ce?U=!Ce.classList.contains("dx-hidden"):U=!1,fe.style.display=U?"block":"none"},[e,Li,Q]),I.jsxs(I.Fragment,{children:[I.jsx("div",{className:r==="dark"?"dark":"","data-grid-confirm-delete":!0,style:{display:"none"}}),I.jsxs("div",{style:{height:"100%",position:"relative"},className:`gridWrapper __dx_DataGrid_Component__ light ${r&&!["dark","light"].includes(r)?"light":r}`,children:[(C||x&&(z==null?void 0:z.mode)==="multiple")&&I.jsxs("div",{className:"__dx_DataGrid_Toolbar",children:[I.jsx("div",{className:"__dx_DataGrid_Toolbar_Leftside",children:x&&(z==null?void 0:z.mode)==="multiple"&&I.jsx(rue,{theme:r,ref:zt,onDeleteAll:ln})}),I.jsx("div",{className:"__dx_DataGrid_Toolbar_Righttside",children:C&&I.jsx("div",{className:"column_configure_wrapper",children:I.jsx(Gle,{theme:r,items:De.current.sort((Ce,fe)=>Ce.orderIndex-fe.orderIndex),change:Ce=>Ko(Ce)})})})]}),I.jsxs("div",{id:"pagination-container",children:[I.jsx("div",{className:"custom-pagination-controls",style:{position:"absolute",bottom:"18px",right:"24px",zIndex:"100"},children:I.jsxs("button",{className:"custom-pagination-button",onClick:rl,size:"sm",style:{backgroundColor:"transparent",border:"1px solid #D5D7DA",borderRadius:"8px",height:"32px",padding:"16px 12px",color:"#414651",fontFamily:"Inter-SemiBold",fontSize:"14px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:["Next"," ",I.jsx("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I.jsx("path",{d:"M4.1665 10.5001H15.8332M15.8332 10.5001L9.99984 4.66675M15.8332 10.5001L9.99984 16.3334",stroke:"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),I.jsx("div",{className:"custom-pagination-controls",style:{position:"absolute",bottom:"18px",left:"24px",zIndex:"100"},children:I.jsxs("button",{className:"custom-pagination-button",onClick:nl,size:"sm",style:{backgroundColor:"transparent",border:"1px solid #D5D7DA",borderRadius:"8px",height:"32px",padding:"16px 12px",color:"#414651",fontSize:"14px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",fontFamily:"Inter-SemiBold"},children:[I.jsx("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I.jsx("path",{d:"M15.8334 10.5001H4.16675M4.16675 10.5001L10.0001 16.3334M4.16675 10.5001L10.0001 4.66675",stroke:"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})," ","Previous"]})})]}),I.jsxs(Wk,{height:a||"100%",ref:Ae,onRowPrepared:It,onFocusedCellChanged:Le,dataSource:u?Li:e,remoteOperations:!0,keyExpr:n??"id",allowColumnReordering:!1,allowColumnResizing:J,columnAutoWidth:l,noDataText:ne??"No Data",showColumnLines:!1,showRowLines:!0,rowAlternationEnabled:s,showBorders:!1,hoverStateEnabled:!0,onEditorPreparing:jo,onEditingStart:Ce=>bt(Ce,"onEditingStart"),onInitNewRow:Ce=>bt(Ce,"onInitNewRow"),onRowInserting:Ce=>bt(Ce,"onRowInserting"),onRowInserted:Ce=>bt(Ce,"onRowInserted"),onRowUpdating:Ce=>bt(Ce,"onRowUpdating"),onRowUpdated:Ce=>bt(Ce,"onRowUpdated"),onRowRemoving:Ce=>bt(Ce,"onRowRemoving"),onRowRemoved:Ce=>bt(Ce,"onRowRemoved"),onSaving:Ce=>bt(Ce,"onSaving"),onSaved:Ce=>bt(Ce,"onSaved"),onEditCanceling:Ce=>bt(Ce,"onEditCanceling"),onEditCanceled:Ce=>bt(Ce,"onEditCanceled"),onContentReady:Ce=>bt(Ce,"onContentReady"),onOptionChanged:Ce=>Go(Ce),focusedRowEnabled:o,autoNavigateToFocusedRow:!1,onFocusedRowChanging:$i,onFocusedRowChanged:ze,onRowClick:tt,onRowExpanding:br,onRowCollapsed:il,onSelectionChanged:sn,children:[d&&I.jsx(Uk,{autoExpandAll:c}),I.jsx(Qk,{mode:(z==null?void 0:z.mode)??"single",selectAllMode:(z==null?void 0:z.selectAllMode)??["allPages","page"][0],showCheckBoxesMode:"always"}),D&&I.jsx(zk,{mode:(D==null?void 0:D.mode)??"row",allowUpdating:(D==null?void 0:D.allowUpdating)??!1,allowDeleting:(D==null?void 0:D.allowDeleting)??!1,allowAdding:!1}),I.jsx(Gk,{visible:(j==null?void 0:j.filterRow)??!1,applyFilter:"auto"}),I.jsx(Jk,{visible:(ee==null?void 0:ee.visible)??!1,width:(ee==null?void 0:ee.width)??256,placeholder:(ee==null?void 0:ee.placeholder)??"Search..."}),I.jsx(Kk,{allowSearch:!0,visible:(j==null?void 0:j.headerFilter)??!1}),De&&De.current.map((Ce,fe)=>Ce.group?I.jsx(jc,{groupIndex:0,dataField:Ce.columnKey},fe):I.jsx(jc,{dataField:Ce.columnKey,caption:Ce.columnName,alignment:Ce.alignment?Ce.alignment:Ce.dataType==="number"?"right":"left",width:Ce.width,visible:Ce.visible,dataType:Ce.dataType,format:Ce.format==="date"?"M/d/yyyy, HH:mm":Ce.dataType==="number"&&Ce.fixedNumber?{type:"fixedPoint",precision:2}:Ce.format,fixed:Ce.fixed,cellRender:Ce.template,selectedFilterOperation:Ce.defaultFilterOperation,allowFiltering:Ce.allowFiltering,allowHeaderFiltering:Ce.allowHeaderFiltering,allowSorting:Ce.allowSorting,allowEditing:Ce.allowEditing,visibleIndex:Ce.orderIndex,defaultSortOrder:Ce.sortOrderType},fe)),i&&i.length&&!u&&I.jsx(Nm,{children:i&&i.map((Ce,fe)=>I.jsx($m,{column:Ce.column,summaryType:"custom",customizeText:Ce.total},fe))}),i&&i.length&&u&&I.jsx(Nm,{children:i.map((Ce,fe)=>I.jsx($m,{column:Ce.column,summaryType:Ce.summaryType,displayFormat:Ce.displayFormat}))}),!!V&&Et&&Et.length&&I.jsx(jc,{dataField:null,caption:"Actions",alignment:"left",width:100,fixed:!1,fixedPosition:"right",allowFiltering:!1,allowSorting:!1,cellRender:Ce=>{if(!F||F.length===0||F&&F.length>0&&!F.includes(Ce.data[n]))return I.jsx(Jle,{theme:r,rowData:Ce.data,rowID:Ce.data[n],actions:Et.filter(fe=>fe.disabledForKeys&&fe.disabledForKeys.length?!fe.disabledForKeys.includes(Ce.data[n]):fe),hiddenActionTypes:[O?"":"delete",P?"":"edit"],onExpand:fe=>{Uo(Ce.data),me&&typeof me=="function"&&me(Ce.data)}})}}),w&&I.jsx(qk,{enabled:!0,component:L}),I.jsx(jk,{enabled:re}),I.jsx(Zk,{useNative:!0,mode:G??"none"}),I.jsx(Xk,{defaultPageIndex:Z?Z-1:null,defaultPageSize:H==null?void 0:H.defaultPageSize}),I.jsx(Yk,{visible:H==null?void 0:H.visible,allowedPageSizes:H==null?void 0:H.allowedPageSizes,showPageSizeSelector:H==null?void 0:H.showPageSizeSelector,showInfo:H==null?void 0:H.showInfo,showNavigationButtons:H==null?void 0:H.showNavigationButtons})]})]})]})},oue="Tabs-module__tabContainer",sue="Tabs-module__vertical",lue="Tabs-module__underline",uue="Tabs-module__singleTab",due="Tabs-module__active",cue="Tabs-module__button",hue="Tabs-module__buttonBorder",fue="Tabs-module__buttonMinimal",pue="Tabs-module__dark",vue="Tabs-module__underLine",Za={tabContainer:oue,vertical:sue,underline:lue,singleTab:uue,active:due,button:cue,buttonBorder:hue,buttonMinimal:fue,dark:pue,underLine:vue},_ue=({tabsData:e,type:t="underline",vertical:i=!1,onItemClick:n,tabContainerStyle:r,singleTabStyle:a,theme:o})=>{const[s,l]=ue.useState(!1),u=d=>{d.active=!0,e.forEach(c=>{c.id===d.id?c.active=!0:c.active=!1}),n&&typeof n=="function"&&n(d),l(c=>!c)};return I.jsx("div",{style:r??{},className:`${o==="dark"?Za.dark:""} ${Za.tabContainer} ${Za[t]} ${i?Za.vertical:""}`,children:e.map(d=>I.jsx("div",{style:a??{},className:`${Za.singleTab} ${d.active?Za.active:""}`,onClick:()=>u(d),children:typeof d.label=="function"?I.jsx("span",{className:Za.labelWrapper,children:d.label()}):d.label},d.id))})},mue="FileBlock-module__fileBlockWrapper",gue="FileBlock-module__fileName",Cue="FileBlock-module__texts",yue="FileBlock-module__deleteFile",xue="FileBlock-module__dark",Cs={fileBlockWrapper:mue,fileName:gue,texts:Cue,deleteFile:yue,dark:xue},bue=()=>I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 0 16 20",fill:"none",children:I.jsx("path",{d:"M9.66665 1.89118V5.33329C9.66665 5.8 9.66665 6.03336 9.75747 6.21162C9.83737 6.36842 9.96485 6.4959 10.1217 6.5758C10.2999 6.66663 10.5333 6.66663 11 6.66663H14.4421M14.6666 8.32348V14.3333C14.6666 15.7334 14.6666 16.4335 14.3942 16.9683C14.1545 17.4387 13.772 17.8211 13.3016 18.0608C12.7668 18.3333 12.0668 18.3333 10.6666 18.3333H5.33331C3.93318 18.3333 3.23312 18.3333 2.69834 18.0608C2.22793 17.8211 1.84548 17.4387 1.6058 16.9683C1.33331 16.4335 1.33331 15.7334 1.33331 14.3333V5.66663C1.33331 4.26649 1.33331 3.56643 1.6058 3.03165C1.84548 2.56124 2.22793 2.17879 2.69834 1.93911C3.23312 1.66663 3.93318 1.66663 5.33331 1.66663H8.00979C8.62127 1.66663 8.92701 1.66663 9.21473 1.7357C9.46982 1.79694 9.71368 1.89795 9.93736 2.03503C10.1897 2.18963 10.4058 2.40582 10.8382 2.8382L13.4951 5.49505C13.9275 5.92743 14.1436 6.14362 14.2982 6.39591C14.4353 6.61959 14.5363 6.86346 14.5976 7.11855C14.6666 7.40627 14.6666 7.712 14.6666 8.32348Z",stroke:"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),Sue=({theme:e,file:t,onDelete:i,fileBlockWrapperStyle:n,fileNameStyle:r,textsStyle:a,nameStyle:o,sizeStyle:s,clearIcon:l,fileIcon:u})=>{const d=()=>{i&&typeof i=="function"&&i(t)};return I.jsx("div",{className:`${e==="dark"?Cs.dark:""} ${Cs.fileBlockWrapper}`,style:n??{},children:I.jsxs("div",{className:Cs.fileName,style:r??{},children:[I.jsx("div",{style:{display:"flex",alignItems:"center"},children:u??I.jsx(bue,{})}),I.jsxs("div",{className:Cs.texts,style:a??{},children:[I.jsx("span",{title:t&&(t!=null&&t.fileName)?t.fileName:"-",style:o??{},children:t&&(t!=null&&t.fileName)?t.fileName:"-"}),I.jsx("span",{style:s??{},className:Cs.size,children:t&&(t!=null&&t.unitSize)?t==null?void 0:t.unitSize:""})]}),I.jsx("div",{className:Cs.deleteFile,onClick:d,children:l??I.jsx(zm,{width:16,color:"#A4A7AE"})})]})})},wue="FileUploader-module__fileUploaderWrapper",Eue="FileUploader-module__rowStyle",Iue="FileUploader-module__fileUploaderContent",Tue="FileUploader-module__labels",Aue="FileUploader-module__draganddrop",Due="FileUploader-module__uploadSvg",Oue="FileUploader-module__title",Rue="FileUploader-module__brandColor",kue="FileUploader-module__subTitle",Bue="FileUploader-module__uploadAction",Lue="FileUploader-module__dark",en={fileUploaderWrapper:wue,rowStyle:Eue,fileUploaderContent:Iue,labels:Tue,draganddrop:Aue,uploadSvg:Due,title:Oue,brandColor:Rue,subTitle:kue,uploadAction:Bue,dark:Lue},CI=e=>I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",children:I.jsx("path",{d:"M7.16675 13.3333L10.5001 10M10.5001 10L13.8334 13.3333M10.5001 10V17.5M17.1667 13.9524C18.1847 13.1117 18.8334 11.8399 18.8334 10.4167C18.8334 7.88536 16.7814 5.83333 14.2501 5.83333C14.068 5.83333 13.8976 5.73833 13.8052 5.58145C12.7185 3.73736 10.7121 2.5 8.41675 2.5C4.96497 2.5 2.16675 5.29822 2.16675 8.75C2.16675 10.4718 2.86295 12.0309 3.98921 13.1613",stroke:"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),Pue=({multiple:e=!0,onChange:t,maxSize:i,withFileValidation:n,acceptedFileFormats:r,title:a,subTitle:o,withResults:s=!0,onFormatError:l,onMaxSizeError:u,type:d="default",withIcon:c=!0,uploadIcon:h,fileUploaderWrapperStyle:f,fileUploaderContentStyle:p,draganddropStyle:v,labelsStyle:g,titleStyle:C,clickToUploadStyle:x,subTitleStyle:w,fileBlockWrapperStyle:L,fileNameStyle:D,textsStyle:G,nameStyle:H,sizeStyle:z,clearIcon:j,theme:Z})=>{const ee=ue.useRef(crypto.randomUUID()),[W,Y]=ue.useState(!1),[E,R]=ue.useState(!1),q=ue.useRef([]),te=P=>{R(P)},he=P=>{P.preventDefault(),te(!0)},de=P=>{P.preventDefault(),te(!1)},Q=P=>{P.preventDefault(),te(!0)},K=P=>{P.preventDefault(),O(P.dataTransfer.files),te(!1)},y=P=>{q.current=q.current.filter((V,N)=>V.fileID!==P.fileID),Y(V=>!V),A()},T=P=>{O(P.target.files)},A=()=>{t&&typeof t=="function"&&t(q.current)},O=async P=>{let V=P,N=[];for(let X=0;X<V.length;X++){let le={fileName:V[X].name,size:V[X].size,unitSize:$P(V[X].size),type:V[X].type,format:HP(V[X].name),base64:await WP(V[X]),fileID:crypto.randomUUID()};if(n&&r&&!r.includes(le.format.toLowerCase())){l&&typeof l=="function"&&l(le.format.toLowerCase());return}i&&V[X].size>i?u&&typeof u=="function"&&u({Error:"Max_Size_Error",MaxSize:i}):N.push(le)}e?q.current=[...q.current,...N]:(N=N.slice(-1),q.current=N),Y(X=>!X),A()};return I.jsxs("div",{className:`${Z==="dark"?en.dark:""} ${en.fileUploaderWrapper} ${d==="row"?en.rowStyle:""}`,style:f??{},children:[I.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center"},children:[I.jsxs("div",{style:p??{},className:`${en.fileUploaderContent} `,onDragEnter:he,onDragLeave:de,onDragOver:Q,onDrop:K,children:[I.jsxs("div",{className:en.draganddrop,style:v??{},children:[d!=="row"&&c&&I.jsx("div",{className:en.uploadSvg,children:h||I.jsx(CI,{})}),I.jsxs("div",{className:`${en.labels} `,style:g??{},htmlFor:ee.current,children:[a&&typeof a=="function"?a():I.jsx("div",{style:C??{},className:en.title,children:a||I.jsx("div",{children:I.jsxs(I.Fragment,{children:[I.jsx("span",{style:x??{},className:d!=="row"?en.brandColor:"",children:d!=="row"?"Click to upload":"Click to "}),I.jsxs("span",{className:d==="row"?en.brandColor:"",children:[" ",d!=="row"?"or drag and drop":"upload"]})]})})}),o&&typeof o=="function"?o():I.jsx("p",{style:w??{},className:en.subTitle,children:o??""})]})]}),I.jsx("div",{className:en.uploadAction,children:I.jsx("input",{type:"file",name:"",id:ee.current,multiple:!!e,onChange:T,accept:""})})]}),d==="row"&&c&&I.jsx("div",{className:en.uploadSvg,children:h||I.jsxs("div",{children:[I.jsx(CI,{}),I.jsx("div",{className:en.uploadAction,children:I.jsx("input",{type:"file",name:"",id:ee.current,multiple:!!e,onChange:T,accept:""})})]})})]}),q&&q.current&&q.current.length&&s?q.current.map((P,V)=>I.jsx(Sue,{theme:Z,fileBlockWrapperStyle:L,fileNameStyle:D,textsStyle:G,nameStyle:H,sizeStyle:z,clearIcon:j,file:P,onDelete:y},V)):""]})},Fue=()=>{const e=document.createElement("style");e.setAttribute("id","toast_notification_style_key"),e.innerHTML=`
|
|
331
|
+
`,style:{opacity:r[v.disableKey]?.5:1},children:f(v)&&f(v)!=="no_icon"?f(v):v==null?void 0:v.icon()}),I.jsxs("div",{className:Xa.actionLabel,children:[I.jsx("p",{style:{...v==null?void 0:v.style,opacity:r[v.disableKey]?.5:1},children:v==null?void 0:v.label})," ",p(v)]})]},g))})]})},Qle="DeleteAll-module__deleteAllWrapper",eue="DeleteAll-module__iconContainer",tue="DeleteAll-module__deleteItemsCountLabel",iue="DeleteAll-module__dark",nue="DeleteAll-module__datagridDeleteAllAction",Ml={deleteAllWrapper:Qle,iconContainer:eue,deleteItemsCountLabel:tue,dark:iue,datagridDeleteAllAction:nue},rue=ue.forwardRef((e,t)=>{const[i,n]=ue.useState(0),r=o=>{n(o)};ue.useImperativeHandle(t,()=>({setValue:r}));const a=()=>{e.onDeleteAll&&typeof e.onDeleteAll=="function"&&e.onDeleteAll()};return I.jsxs("div",{ref:t,className:`${(e==null?void 0:e.theme)==="dark"?Ml.dark:""} ${Ml.datagridDeleteAllAction} ${Ml.deleteAllWrapper}`,children:[I.jsx("div",{className:Ml.iconContainer,onClick:a,children:I.jsx(eB,{})}),I.jsx("div",{className:Ml.deleteItemsCountLabel,children:I.jsxs("span",{children:["Delete ",i," Checked Item"]})})]})}),aue=({data:e,customColumns:t,summary:i,keyExpr:n,theme:r,height:a,focusedRowEnabled:o=!0,rowAlternationEnabled:s,columnAutoWidth:l=!0,withCustomStore:u,withGrouping:d,groupDefaultCollapsed:c,storeKey:h,loadFunction:f,updateFunction:p,insertFunction:v,removeFunction:g,withColumnConfigure:C,withDeleteAll:x,withMasterDetail:w,detailTemplate:L,editingOptions:D,scrollMode:G,pagerOptions:H,selection:z,filterOptions:j,defaultPageIndex:Z,searchPanel:ee,onEvent:W,onPageChange:Y,selectionChanged:E,focusedRowChanging:R,focusedRowChanged:q,onRowClick:te,onWheelClick:he,showPagination:de=!0,refresh:Q,diselectAll:K,customActions:y,onColumnConfigure:T,onDeleteAll:A,onDelete:O,onEdit:P,withCustomActions:V,multiExpand:N,onFilterValueChange:X,onRowExpand:le,onRowCollaps:ve,onOptionChanged:ce,onRowPrepared:Te,onFocusedCellChanged:b,ShowLoader:re=!0,noDataText:ne,onLoading:M,hideActions:F,allowColumnResizing:J=!0,disableOverflow:ae,onActionExpand:me})=>{const[ie,be]=ue.useState(!1),De=ue.useRef(t),Ae=ue.useRef(null),[We,ot]=ue.useState(""),Qe=ue.useRef({Refresh:()=>Ae.current.instance.getDataSource().reload(),SelectedRowKeys:()=>Ae.current.instance.getSelectedRowKeys(),DeselectAll:()=>{var Ce;return(Ce=Ae.current)==null?void 0:Ce.instance.deselectAll()}}),[Et,pt]=ue.useState([{label:"Edit",type:"edit",event:(Ce,fe)=>Ma(Ce,fe)},{label:"Delete",type:"delete",event:(Ce,fe)=>Fa(Ce,fe)}]),zt=ue.useRef(null),vi=Ce=>{Et&&Et.length&&di()},ut=()=>{Et&&Et.length&&di()},di=()=>{document.querySelectorAll(".datagrid_action_data_controller > ul").forEach(fe=>{fe.style.display="none",fe.style.pointerEvents="none"})},Li=new Ws({key:h??"id",load:f,update:p,insert:v,remove:g,onLoading:M}),bt=(Ce,fe)=>{if(W&&typeof W=="function"&&W(fe,Ce),fe==="onContentReady"){const U=document.querySelector(".dx-pager"),Ee=document.querySelector("#pagination-container");let Re=!1;U?Re=!U.classList.contains("dx-hidden"):Re=!1,Ee.style.display=Re?"block":"none"}},sn=Ce=>{o&&(z==null?void 0:z.mode)==="multiple"&&x&&zt.current.setValue(Ce.selectedRowKeys.length),E&&typeof E=="function"&&E(Ce)},$i=Ce=>{R&&typeof R=="function"&&R(Ce)},ze=Ce=>{q&&typeof q=="function"&&q(Ce)},Le=Ce=>{b&&typeof b=="function"&&b(Ce)},tt=Ce=>{te&&typeof te=="function"&&te(Ce.data)},Xe=(Ce,fe)=>{Ce.button===1&&(he&&typeof he=="function"&&he(fe.data),Ce.preventDefault())},It=Ce=>{Ce.rowElement&&Ce.data&&Ce.rowElement.addEventListener("mousedown",fe=>Xe(fe,Ce)),Te&&typeof Te=="function"&&Te(Ce)},ln=()=>{A&&typeof A=="function"&&A(Qe.current.SelectedRowKeys())},Go=Ce=>{ce&&typeof ce=="function"&&ce(Ce),Ce.fullName==="paging.pageIndex"&&Y&&typeof Y=="function"&&Y(Ce.value+1)},Uo=Ce=>{let U=document.querySelector(`#datagrid_action_data_id_${Ce[n]}`),Ee=document.querySelectorAll(".datagrid_action_data_controller > ul"),Re=U.querySelector("ul");const qe=document.querySelectorAll(".dx-datagrid-rowsview .dx-row > td");qe&&qe.forEach(dt=>{dt.querySelector("ul")?dt.style.overflow="unset":dt.style.overflow="hidden"});const Tt=U.getBoundingClientRect(),Mt=document.querySelector(".gridWrapper").getBoundingClientRect();let vt={display:"block",position:"absolute",pointerEvents:"all",top:"20px",left:"-70px"};Tt.bottom>Mt.bottom-150&&(vt.top="unset",vt.bottom="100%",vt.left="-100px"),Ee.forEach(dt=>{dt.style.display="none",dt.style.pointerEvents="none"}),Object.assign(Re.style,vt)},Ko=Ce=>{De.current=Ce,be(fe=>!fe),T&&typeof T=="function"&&T(De.current)},br=Ce=>{N||Ce.component.collapseAll(-1),le&&typeof le=="function"&&le(Ce)},il=Ce=>{ve&&typeof ve=="function"&&ve(Ce)},jo=Ce=>{Ce.parentType==="filterRow"&&(Ce.editorElement.onchange=fe=>{const U={columnKey:Ce.dataField,columnName:Ce.caption,filterValue:fe.target.value};X&&typeof X=="function"&&X(U)})},Fa=(Ce,fe)=>{O&&typeof O=="function"&&O(fe)},Ma=(Ce,fe)=>{P&&typeof P=="function"&&P(fe)};ue.useEffect(()=>{y&&y.length&&pt(Ce=>{const fe=Ce;return y.forEach(U=>{fe.some(Ee=>Ee.type===U.type)||fe.push(U)}),fe})},[y]),ue.useEffect(()=>{Q&&(Qe.current.Refresh(),console.info("DataSource Refresh....."))},[Q]),ue.useEffect(()=>{K&&Qe.current.DeselectAll()},[K]),ue.useEffect(()=>{if(Array.isArray(ae)&&ae.length>0){const Ce=()=>{ae.forEach(Ee=>{document.querySelectorAll(`.dx-datagrid-rowsview .dx-row td:nth-child(${Ee})`).forEach(qe=>{qe.style.overflow="unset"})})};Ce();const fe=new MutationObserver(()=>{Ce()}),U=document.querySelector(".dx-datagrid-rowsview");return U&&fe.observe(U,{childList:!0,subtree:!0}),()=>fe.disconnect()}},[ae]);const nl=()=>{const Ce=Ae.current.instance,fe=Ce.pageIndex();fe>0&&Ce.pageIndex(fe-1)},rl=()=>{const Ce=Ae.current.instance,fe=Ce.pageIndex(),U=Ce.pageCount();fe<U-1&&Ce.pageIndex(fe+1)};return ue.useEffect(()=>{De.current=t,be(Ce=>!Ce)},[t]),ue.useEffect(()=>(document.addEventListener("click",vi),document.addEventListener("wheel",ut),()=>{document.removeEventListener("click",vi),document.removeEventListener("wheel",ut)}),[]),ue.useEffect(()=>{const Ce=document.querySelector(".dx-pager"),fe=document.querySelector("#pagination-container");let U=!1;Ce?U=!Ce.classList.contains("dx-hidden"):U=!1,fe.style.display=U?"block":"none"},[e,Li,Q]),I.jsxs(I.Fragment,{children:[I.jsx("div",{className:r==="dark"?"dark":"","data-grid-confirm-delete":!0,style:{display:"none"}}),I.jsxs("div",{style:{height:"100%",position:"relative"},className:`gridWrapper __dx_DataGrid_Component__ light ${r&&!["dark","light"].includes(r)?"light":r}`,children:[(C||x&&(z==null?void 0:z.mode)==="multiple")&&I.jsxs("div",{className:"__dx_DataGrid_Toolbar",children:[I.jsx("div",{className:"__dx_DataGrid_Toolbar_Leftside",children:x&&(z==null?void 0:z.mode)==="multiple"&&I.jsx(rue,{theme:r,ref:zt,onDeleteAll:ln})}),I.jsx("div",{className:"__dx_DataGrid_Toolbar_Righttside",children:C&&I.jsx("div",{className:"column_configure_wrapper",children:I.jsx(Gle,{theme:r,items:De.current.sort((Ce,fe)=>Ce.orderIndex-fe.orderIndex),change:Ce=>Ko(Ce)})})})]}),I.jsxs("div",{id:"pagination-container",children:[I.jsx("div",{className:"custom-pagination-controls",style:{position:"absolute",bottom:"18px",right:"24px",zIndex:"100"},children:I.jsxs("button",{className:"custom-pagination-button",onClick:rl,size:"sm",style:{backgroundColor:"transparent",border:"1px solid #D5D7DA",borderRadius:"8px",height:"32px",padding:"16px 12px",color:"#414651",fontFamily:"Inter-SemiBold",fontSize:"14px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:["Next"," ",I.jsx("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I.jsx("path",{d:"M4.1665 10.5001H15.8332M15.8332 10.5001L9.99984 4.66675M15.8332 10.5001L9.99984 16.3334",stroke:"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),I.jsx("div",{className:"custom-pagination-controls",style:{position:"absolute",bottom:"18px",left:"24px",zIndex:"100"},children:I.jsxs("button",{className:"custom-pagination-button",onClick:nl,size:"sm",style:{backgroundColor:"transparent",border:"1px solid #D5D7DA",borderRadius:"8px",height:"32px",padding:"16px 12px",color:"#414651",fontSize:"14px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",fontFamily:"Inter-SemiBold"},children:[I.jsx("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:I.jsx("path",{d:"M15.8334 10.5001H4.16675M4.16675 10.5001L10.0001 16.3334M4.16675 10.5001L10.0001 4.66675",stroke:"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})," ","Previous"]})})]}),I.jsxs(Wk,{height:a||"100%",ref:Ae,onRowPrepared:It,onFocusedCellChanged:Le,dataSource:u?Li:e,remoteOperations:!0,keyExpr:n??"id",allowColumnReordering:!1,allowColumnResizing:J,columnAutoWidth:l,noDataText:ne??"No Data",showColumnLines:!1,showRowLines:!0,rowAlternationEnabled:s,showBorders:!1,hoverStateEnabled:!0,onEditorPreparing:jo,onEditingStart:Ce=>bt(Ce,"onEditingStart"),onInitNewRow:Ce=>bt(Ce,"onInitNewRow"),onRowInserting:Ce=>bt(Ce,"onRowInserting"),onRowInserted:Ce=>bt(Ce,"onRowInserted"),onRowUpdating:Ce=>bt(Ce,"onRowUpdating"),onRowUpdated:Ce=>bt(Ce,"onRowUpdated"),onRowRemoving:Ce=>bt(Ce,"onRowRemoving"),onRowRemoved:Ce=>bt(Ce,"onRowRemoved"),onSaving:Ce=>bt(Ce,"onSaving"),onSaved:Ce=>bt(Ce,"onSaved"),onEditCanceling:Ce=>bt(Ce,"onEditCanceling"),onEditCanceled:Ce=>bt(Ce,"onEditCanceled"),onContentReady:Ce=>bt(Ce,"onContentReady"),onOptionChanged:Ce=>Go(Ce),focusedRowEnabled:o,autoNavigateToFocusedRow:!1,onFocusedRowChanging:$i,onFocusedRowChanged:ze,onRowClick:tt,onRowExpanding:br,onRowCollapsed:il,onSelectionChanged:sn,children:[d&&I.jsx(Uk,{autoExpandAll:c}),I.jsx(Qk,{mode:(z==null?void 0:z.mode)??"single",selectAllMode:(z==null?void 0:z.selectAllMode)??["allPages","page"][0],showCheckBoxesMode:"always"}),D&&I.jsx(zk,{mode:(D==null?void 0:D.mode)??"row",allowUpdating:(D==null?void 0:D.allowUpdating)??!1,allowDeleting:(D==null?void 0:D.allowDeleting)??!1,allowAdding:!1}),I.jsx(Gk,{visible:(j==null?void 0:j.filterRow)??!1,applyFilter:"auto"}),I.jsx(Jk,{visible:(ee==null?void 0:ee.visible)??!1,width:(ee==null?void 0:ee.width)??256,placeholder:(ee==null?void 0:ee.placeholder)??"Search..."}),I.jsx(Kk,{allowSearch:!0,visible:(j==null?void 0:j.headerFilter)??!1}),De&&De.current.map((Ce,fe)=>Ce.group?I.jsx(jc,{groupIndex:0,dataField:Ce.columnKey},fe):I.jsx(jc,{dataField:Ce.columnKey,caption:Ce.columnName,alignment:Ce.alignment?Ce.alignment:Ce.dataType==="number"?"right":"left",width:Ce.width,visible:Ce.visible,dataType:Ce.dataType,format:Ce.format==="date"?"M/d/yyyy, HH:mm":Ce.dataType==="number"&&Ce.fixedNumber?{type:"fixedPoint",precision:2}:Ce.format,fixed:Ce.fixed,cellRender:Ce.template,selectedFilterOperation:Ce.defaultFilterOperation,allowFiltering:Ce.allowFiltering,allowHeaderFiltering:Ce.allowHeaderFiltering,allowSorting:Ce.allowSorting,allowEditing:Ce.allowEditing,visibleIndex:Ce.orderIndex,defaultSortOrder:Ce.sortOrderType},fe)),i&&i.length&&!u&&I.jsx(Nm,{children:i&&i.map((Ce,fe)=>I.jsx($m,{column:Ce.column,summaryType:"custom",customizeText:Ce.total},fe))}),i&&i.length&&u&&I.jsx(Nm,{children:i.map((Ce,fe)=>I.jsx($m,{column:Ce.column,summaryType:Ce.summaryType,displayFormat:Ce.displayFormat}))}),!!V&&Et&&Et.length&&I.jsx(jc,{dataField:null,caption:"Actions",alignment:"left",width:100,fixed:!1,fixedPosition:"right",allowFiltering:!1,allowSorting:!1,cellRender:Ce=>{if(!F||F.length===0||F&&F.length>0&&!F.includes(Ce.data[n]))return I.jsx(Jle,{theme:r,rowData:Ce.data,rowID:Ce.data[n],actions:Et.filter(fe=>fe.disabledForKeys&&fe.disabledForKeys.length?!fe.disabledForKeys.includes(Ce.data[n]):fe),hiddenActionTypes:[O?"":"delete",P?"":"edit"],onExpand:fe=>{Uo(Ce.data),me&&typeof me=="function"&&me(Ce.data)}})}}),w&&I.jsx(qk,{enabled:!0,component:L}),I.jsx(jk,{enabled:re}),I.jsx(Zk,{useNative:!0,mode:G??"none"}),I.jsx(Xk,{defaultPageIndex:Z?Z-1:null,defaultPageSize:H==null?void 0:H.defaultPageSize}),I.jsx(Yk,{visible:H==null?void 0:H.visible,allowedPageSizes:H==null?void 0:H.allowedPageSizes,showPageSizeSelector:H==null?void 0:H.showPageSizeSelector,showInfo:H==null?void 0:H.showInfo,showNavigationButtons:H==null?void 0:H.showNavigationButtons})]})]})]})},oue="Tabs-module__tabContainer",sue="Tabs-module__vertical",lue="Tabs-module__underline",uue="Tabs-module__singleTab",due="Tabs-module__active",cue="Tabs-module__button",hue="Tabs-module__buttonBorder",fue="Tabs-module__buttonMinimal",pue="Tabs-module__dark",vue="Tabs-module__underLine",Za={tabContainer:oue,vertical:sue,underline:lue,singleTab:uue,active:due,button:cue,buttonBorder:hue,buttonMinimal:fue,dark:pue,underLine:vue},_ue=({tabsData:e,type:t="underline",vertical:i=!1,onItemClick:n,tabContainerStyle:r,singleTabStyle:a,theme:o})=>{const[s,l]=ue.useState(!1),u=d=>{d.active=!0,e.forEach(c=>{c.id===d.id?c.active=!0:c.active=!1}),n&&typeof n=="function"&&n(d),l(c=>!c)};return I.jsx("div",{style:r??{},className:`${o==="dark"?Za.dark:""} ${Za.tabContainer} ${Za[t]} ${i?Za.vertical:""}`,children:e.map(d=>I.jsx("div",{style:a??{},className:`${Za.singleTab} ${d.active?Za.active:""}`,onClick:()=>u(d),children:typeof d.label=="function"?I.jsx("span",{className:Za.labelWrapper,children:d.label()}):d.label},d.id))})},mue="FileBlock-module__fileBlockWrapper",gue="FileBlock-module__fileName",Cue="FileBlock-module__texts",yue="FileBlock-module__deleteFile",xue="FileBlock-module__dark",Cs={fileBlockWrapper:mue,fileName:gue,texts:Cue,deleteFile:yue,dark:xue},bue=()=>I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 0 16 20",fill:"none",children:I.jsx("path",{d:"M9.66665 1.89118V5.33329C9.66665 5.8 9.66665 6.03336 9.75747 6.21162C9.83737 6.36842 9.96485 6.4959 10.1217 6.5758C10.2999 6.66663 10.5333 6.66663 11 6.66663H14.4421M14.6666 8.32348V14.3333C14.6666 15.7334 14.6666 16.4335 14.3942 16.9683C14.1545 17.4387 13.772 17.8211 13.3016 18.0608C12.7668 18.3333 12.0668 18.3333 10.6666 18.3333H5.33331C3.93318 18.3333 3.23312 18.3333 2.69834 18.0608C2.22793 17.8211 1.84548 17.4387 1.6058 16.9683C1.33331 16.4335 1.33331 15.7334 1.33331 14.3333V5.66663C1.33331 4.26649 1.33331 3.56643 1.6058 3.03165C1.84548 2.56124 2.22793 2.17879 2.69834 1.93911C3.23312 1.66663 3.93318 1.66663 5.33331 1.66663H8.00979C8.62127 1.66663 8.92701 1.66663 9.21473 1.7357C9.46982 1.79694 9.71368 1.89795 9.93736 2.03503C10.1897 2.18963 10.4058 2.40582 10.8382 2.8382L13.4951 5.49505C13.9275 5.92743 14.1436 6.14362 14.2982 6.39591C14.4353 6.61959 14.5363 6.86346 14.5976 7.11855C14.6666 7.40627 14.6666 7.712 14.6666 8.32348Z",stroke:"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),Sue=({theme:e,file:t,onDelete:i,fileBlockWrapperStyle:n,fileNameStyle:r,textsStyle:a,nameStyle:o,sizeStyle:s,clearIcon:l,fileIcon:u})=>{const d=()=>{i&&typeof i=="function"&&i(t)};return I.jsx("div",{className:`${e==="dark"?Cs.dark:""} ${Cs.fileBlockWrapper}`,style:n??{},children:I.jsxs("div",{className:Cs.fileName,style:r??{},children:[I.jsx("div",{style:{display:"flex",alignItems:"center"},children:u??I.jsx(bue,{})}),I.jsxs("div",{className:Cs.texts,style:a??{},children:[I.jsx("span",{title:t&&(t!=null&&t.fileName)?t.fileName:"-",style:o??{},children:t&&(t!=null&&t.fileName)?t.fileName:"-"}),I.jsx("span",{style:s??{},className:Cs.size,children:t&&(t!=null&&t.unitSize)?t==null?void 0:t.unitSize:""})]}),I.jsx("div",{className:Cs.deleteFile,onClick:d,children:l??I.jsx(zm,{width:16,color:"#A4A7AE"})})]})})},wue="FileUploader-module__fileUploaderWrapper",Eue="FileUploader-module__rowStyle",Iue="FileUploader-module__fileUploaderContent",Tue="FileUploader-module__labels",Aue="FileUploader-module__draganddrop",Due="FileUploader-module__uploadSvg",Oue="FileUploader-module__title",Rue="FileUploader-module__brandColor",kue="FileUploader-module__subTitle",Bue="FileUploader-module__uploadAction",Lue="FileUploader-module__dark",en={fileUploaderWrapper:wue,rowStyle:Eue,fileUploaderContent:Iue,labels:Tue,draganddrop:Aue,uploadSvg:Due,title:Oue,brandColor:Rue,subTitle:kue,uploadAction:Bue,dark:Lue},CI=e=>I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",children:I.jsx("path",{d:"M7.16675 13.3333L10.5001 10M10.5001 10L13.8334 13.3333M10.5001 10V17.5M17.1667 13.9524C18.1847 13.1117 18.8334 11.8399 18.8334 10.4167C18.8334 7.88536 16.7814 5.83333 14.2501 5.83333C14.068 5.83333 13.8976 5.73833 13.8052 5.58145C12.7185 3.73736 10.7121 2.5 8.41675 2.5C4.96497 2.5 2.16675 5.29822 2.16675 8.75C2.16675 10.4718 2.86295 12.0309 3.98921 13.1613",stroke:"#414651",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),Pue=({multiple:e=!0,onChange:t,maxSize:i,withFileValidation:n,acceptedFileFormats:r,title:a,subTitle:o,withResults:s=!0,onFormatError:l,onMaxSizeError:u,type:d="default",withIcon:c=!0,uploadIcon:h,fileUploaderWrapperStyle:f,fileUploaderContentStyle:p,draganddropStyle:v,labelsStyle:g,titleStyle:C,clickToUploadStyle:x,subTitleStyle:w,fileBlockWrapperStyle:L,fileNameStyle:D,textsStyle:G,nameStyle:H,sizeStyle:z,clearIcon:j,theme:Z})=>{const ee=ue.useRef(crypto.randomUUID()),[W,Y]=ue.useState(!1),[E,R]=ue.useState(!1),q=ue.useRef([]),te=P=>{R(P)},he=P=>{P.preventDefault(),te(!0)},de=P=>{P.preventDefault(),te(!1)},Q=P=>{P.preventDefault(),te(!0)},K=P=>{P.preventDefault(),O(P.dataTransfer.files),te(!1)},y=P=>{q.current=q.current.filter((V,N)=>V.fileID!==P.fileID),Y(V=>!V),A()},T=P=>{O(P.target.files)},A=()=>{t&&typeof t=="function"&&t(q.current)},O=async P=>{let V=P,N=[];for(let X=0;X<V.length;X++){let le={fileName:V[X].name,size:V[X].size,unitSize:$P(V[X].size),type:V[X].type,format:HP(V[X].name),base64:await WP(V[X]),fileID:crypto.randomUUID()};if(n&&r&&!r.includes(le.format.toLowerCase())){l&&typeof l=="function"&&l(le.format.toLowerCase());return}i&&V[X].size>i?u&&typeof u=="function"&&u({Error:"Max_Size_Error",MaxSize:i}):N.push(le)}e?q.current=[...q.current,...N]:(N=N.slice(-1),q.current=N),Y(X=>!X),A()};return I.jsxs("div",{className:`${Z==="dark"?en.dark:""} ${en.fileUploaderWrapper} ${d==="row"?en.rowStyle:""}`,style:f??{},children:[I.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center"},children:[I.jsxs("div",{style:p??{},className:`${en.fileUploaderContent} `,onDragEnter:he,onDragLeave:de,onDragOver:Q,onDrop:K,children:[I.jsxs("div",{className:en.draganddrop,style:v??{},children:[d!=="row"&&c&&I.jsx("div",{className:en.uploadSvg,children:h||I.jsx(CI,{})}),I.jsxs("div",{className:`${en.labels} `,style:g??{},htmlFor:ee.current,children:[a&&typeof a=="function"?a():I.jsx("div",{style:C??{},className:en.title,children:a||I.jsx("div",{children:I.jsxs(I.Fragment,{children:[I.jsx("span",{style:x??{},className:d!=="row"?en.brandColor:"",children:d!=="row"?"Click to upload":"Click to "}),I.jsxs("span",{className:d==="row"?en.brandColor:"",children:[" ",d!=="row"?"or drag and drop":"upload"]})]})})}),o&&typeof o=="function"?o():I.jsx("p",{style:w??{},className:en.subTitle,children:o??""})]})]}),I.jsx("div",{className:en.uploadAction,children:I.jsx("input",{type:"file",name:"",id:ee.current,multiple:!!e,onChange:T,accept:""})})]}),d==="row"&&c&&I.jsx("div",{className:en.uploadSvg,children:h||I.jsxs("div",{children:[I.jsx(CI,{}),I.jsx("div",{className:en.uploadAction,children:I.jsx("input",{type:"file",name:"",id:ee.current,multiple:!!e,onChange:T,accept:""})})]})})]}),q&&q.current&&q.current.length&&s?q.current.map((P,V)=>I.jsx(Sue,{theme:Z,fileBlockWrapperStyle:L,fileNameStyle:D,textsStyle:G,nameStyle:H,sizeStyle:z,clearIcon:j,file:P,onDelete:y},V)):""]})},Fue=()=>{const e=document.createElement("style");e.setAttribute("id","toast_notification_style_key"),e.innerHTML=`
|
|
332
332
|
.notifications_wrapper{
|
|
333
333
|
position: fixed;
|
|
334
334
|
z-index: 9999999;
|
|
@@ -72382,11 +72382,11 @@ const Wle = "ColumnConfigure-module__configureWrapper", zle = "ColumnConfigure-m
|
|
|
72382
72382
|
children: f(v) && f(v) !== "no_icon" ? f(v) : v == null ? void 0 : v.icon()
|
|
72383
72383
|
}
|
|
72384
72384
|
),
|
|
72385
|
-
/* @__PURE__ */ I.
|
|
72386
|
-
/* @__PURE__ */ I.jsx("p", { style: { opacity: r[v.disableKey] ? 0.5 : 1 }, children: v == null ? void 0 : v.label }),
|
|
72385
|
+
/* @__PURE__ */ I.jsxs("div", { className: Qa.actionLabel, children: [
|
|
72386
|
+
/* @__PURE__ */ I.jsx("p", { style: { ...v == null ? void 0 : v.style, opacity: r[v.disableKey] ? 0.5 : 1 }, children: v == null ? void 0 : v.label }),
|
|
72387
72387
|
" ",
|
|
72388
72388
|
p(v)
|
|
72389
|
-
] })
|
|
72389
|
+
] })
|
|
72390
72390
|
]
|
|
72391
72391
|
},
|
|
72392
72392
|
g
|