master-components-react 2.0.7 → 2.0.8

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.
@@ -318,7 +318,7 @@ Valid keys: `+JSON.stringify(Object.keys(Q),null," "));var oe=_e(U,ne,w,B,V+"."
318
318
  ${["delete"].includes(p.type)?Ga.staticColor:""}
319
319
  ${Ga.actionIcon}
320
320
  ${f(p)&&f(p)!=="no_icon"?Ga.defaultIcons:""}
321
- `,children:f(p)&&f(p)!=="no_icon"?f(p):p==null?void 0:p.icon()}),k.jsx("div",{className:Ga.actionLabel,children:k.jsx("span",{style:{...p==null?void 0:p.style},children:p==null?void 0:p.label})})]},g))})]})},gle="DeleteAll-module__deleteAllWrapper",mle="DeleteAll-module__iconContainer",Cle="DeleteAll-module__deleteItemsCountLabel",yle="DeleteAll-module__datagridDeleteAllAction",wl={deleteAllWrapper:gle,iconContainer:mle,deleteItemsCountLabel:Cle,datagridDeleteAllAction:yle},xle=ve.forwardRef((e,t)=>{const[i,n]=ve.useState(0),r=o=>{n(o)};ve.useImperativeHandle(t,()=>({setValue:r}));const a=()=>{e.onDeleteAll&&typeof e.onDeleteAll=="function"&&e.onDeleteAll()};return k.jsxs("div",{ref:t,className:`${theme==="dark"?wl.dark:""} ${wl.datagridDeleteAllAction} ${wl.deleteAllWrapper}`,children:[k.jsx("div",{className:wl.iconContainer,onClick:a,children:k.jsx(Rg,{})}),k.jsx("div",{className:wl.deleteItemsCountLabel,children:k.jsxs("span",{children:["Delete ",i," Checked Item"]})})]})}),ble=({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:g,removeFunction:m,withColumnConfigure:C,withDeleteAll:x,withMasterDetail:T,detailTemplate:R,editingOptions:A,scrollMode:z,pagerOptions:G,selection:N,filterOptions:K,searchPanel:q,onEvent:H,selectionChanged:F,focusedRowChanging:j,focusedRowChanged:I,onRowClick:Y,refresh:ue,customActions:J,onColumnConfigure:se,onDeleteAll:ae,onDelete:Q,onEdit:W,withCustomActions:y,multiExpand:E,onFilterValueChange:w,onRowExpand:B,onRowCollaps:V,onRowPrepared:U,onFocusedCellChanged:$,ShowLoader:ie=!0,noDataText:ne,onLoading:_e,hideActions:oe=[1],allowColumnResizing:Re=!0,onActionExpand:S})=>{const[fe,le]=ve.useState(!1),L=ve.useRef(t),P=ve.useRef(null);ve.useState("");const X=ve.useRef({Refresh:()=>P.current.instance.refresh(),SelectedRowKeys:()=>P.current.instance.getSelectedRowKeys()}),[ce,Ce]=ve.useState([{label:"Edit",type:"edit",event:(ye,Ve)=>Oi(ye,Ve)},{label:"Delete",type:"delete",event:(ye,Ve)=>ai(ye,Ve)}]),re=ve.useRef(null),Ee=ye=>{ce&&ce.length&&Ie()},Le=()=>{ce&&ce.length&&Ie()},Ie=()=>{document.querySelectorAll(".datagrid_action_data_controller > ul").forEach(Ve=>{Ve.style.display="none",Ve.style.pointerEvents="none"})},We=new Os({key:h??"id",load:f,update:p,insert:g,remove:m,onLoading:_e}),Qe=(ye,Ve)=>{H&&typeof H=="function"&&H(Ve,ye)},it=ye=>{o&&(N==null?void 0:N.mode)==="multiple"&&x&&re.current.setValue(ye.selectedRowKeys.length),F&&typeof F=="function"&&F(ye)},Kt=ye=>{j&&typeof j=="function"&&j(ye)},Ei=ye=>{I&&typeof I=="function"&&I(ye)},Ge=ye=>{$&&typeof $=="function"&&$(ye)},Et=ye=>{Y&&typeof Y=="function"&&Y(ye.data)},bt=ye=>{U&&typeof U=="function"&&U(ye)},Ki=()=>{ae&&typeof ae=="function"&&ae(X.current.SelectedRowKeys())},rn=ye=>{let St=document.querySelector(`#datagrid_action_data_id_${ye[n]}`),vr=document.querySelectorAll(".datagrid_action_data_controller > ul"),rd=St.querySelector("ul");const Gs=document.querySelectorAll(".dx-datagrid-rowsview .dx-row > td");Gs&&Gs.forEach(_r=>{_r.querySelector("ul")?_r.style.overflow="unset":_r.style.overflow="hidden"});const gf=St.getBoundingClientRect(),mf=document.querySelector(".gridWrapper").getBoundingClientRect();let Ra={display:"block",position:"absolute",pointerEvents:"all",top:"20px",left:"-70px"};gf.bottom>mf.bottom-150&&(Ra.top="unset",Ra.bottom="100%",Ra.left="-100px"),vr.forEach(_r=>{_r.style.display="none",_r.style.pointerEvents="none"}),Object.assign(rd.style,Ra)},ui=ye=>{L.current=ye,le(Ve=>!Ve),se&&typeof se=="function"&&se(L.current)},Se=ye=>{E||ye.component.collapseAll(-1),B&&typeof B=="function"&&B(ye)},Xe=ye=>{V&&typeof V=="function"&&V(ye)},Wt=ye=>{ye.parentType==="filterRow"&&(ye.editorElement.onchange=Ve=>{const St={columnKey:ye.dataField,columnName:ye.caption,filterValue:Ve.target.value};w&&typeof w=="function"&&w(St)})},ai=(ye,Ve)=>{const St=document.querySelector('div[data-grid-confirm-delete="true"]');St.style.display="grid",St.setAttribute("data-grid-confirm-row-data",JSON.stringify(Ve))},Oi=(ye,Ve)=>{W&&typeof W=="function"&&W(Ve)},ze=()=>{const ye=document.querySelector('div[data-grid-confirm-delete="true"]'),Ve=ye.getAttribute("data-grid-confirm-row-data");Q&&typeof Q=="function"&&Q(JSON.parse(Ve)),ye.style.display="none",ye.setAttribute("data-grid-confirm-row-data","")},ft=()=>{const ye=document.querySelector('div[data-grid-confirm-delete="true"]');ye.style.display="none",ye.setAttribute("data-grid-confirm-row-data","")};return ve.useEffect(()=>{J&&J.length&&Ce(ye=>{const Ve=ye;return J.forEach(St=>{Ve.some(vr=>vr.type===St.type)||Ve.push(St)}),Ve})},[J]),ve.useEffect(()=>{ue&&(X.current.Refresh(),console.info("DataSource Refresh....."))},[ue]),ve.useEffect(()=>{L.current=t,le(ye=>!ye)},[t]),ve.useEffect(()=>(document.addEventListener("click",Ee),document.addEventListener("wheel",Le),()=>{document.removeEventListener("click",Ee),document.removeEventListener("wheel",Le)}),[]),k.jsxs(k.Fragment,{children:[k.jsx("div",{className:r==="dark"?"dark":"","data-grid-confirm-delete":!0,style:{display:"none"},children:k.jsx(Lg,{visible:!0,options:{title:"Are You Sure You Want To Delete",type:"unsaved"},children:k.jsxs("div",{style:{marginTop:"2.25rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px"},children:[k.jsx(iu,{label:"Cancel",size:"small",buttonStyle:{border:"0.0625rem solid #EF4343",backgroundColor:"transparent"},labelStyle:{color:"red"},onClick:ft}),k.jsx(iu,{label:"Confirm",size:"small",onClick:ze})]})})}),k.jsxs("div",{style:{height:"100%"},className:`gridWrapper __dx_DataGrid_Component__ light ${r&&!["dark","light"].includes(r)?"light":r}`,children:[(C||x&&(N==null?void 0:N.mode)==="multiple")&&k.jsxs("div",{className:"__dx_DataGrid_Toolbar",children:[k.jsx("div",{className:"__dx_DataGrid_Toolbar_Leftside",children:x&&(N==null?void 0:N.mode)==="multiple"&&k.jsx(xle,{ref:re,onDeleteAll:Ki})}),k.jsx("div",{className:"__dx_DataGrid_Toolbar_Righttside",children:C&&k.jsx("div",{className:"column_configure_wrapper",children:k.jsx(lle,{theme:r,items:L.current.sort((ye,Ve)=>ye.orderIndex-Ve.orderIndex),change:ye=>ui(ye)})})})]}),k.jsxs(Lk,{height:a||"100%",ref:P,onRowPrepared:bt,onFocusedCellChanged:Ge,dataSource:u?We:e,remoteOperations:!0,keyExpr:n??"id",allowColumnReordering:!1,allowColumnResizing:Re,columnAutoWidth:l,noDataText:ne??"No Data",showColumnLines:!1,showRowLines:!0,rowAlternationEnabled:s,showBorders:!1,hoverStateEnabled:!0,onEditorPreparing:Wt,onEditingStart:ye=>Qe(ye,"onEditingStart"),onInitNewRow:ye=>Qe(ye,"onInitNewRow"),onRowInserting:ye=>Qe(ye,"onRowInserting"),onRowInserted:ye=>Qe(ye,"onRowInserted"),onRowUpdating:ye=>Qe(ye,"onRowUpdating"),onRowUpdated:ye=>Qe(ye,"onRowUpdated"),onRowRemoving:ye=>Qe(ye,"onRowRemoving"),onRowRemoved:ye=>Qe(ye,"onRowRemoved"),onSaving:ye=>Qe(ye,"onSaving"),onSaved:ye=>Qe(ye,"onSaved"),onEditCanceling:ye=>Qe(ye,"onEditCanceling"),onEditCanceled:ye=>Qe(ye,"onEditCanceled"),focusedRowEnabled:o,autoNavigateToFocusedRow:!1,onFocusedRowChanging:Kt,onFocusedRowChanged:Ei,onRowClick:Et,onRowExpanding:Se,onRowCollapsed:Xe,onSelectionChanged:it,children:[d&&k.jsx(Mk,{autoExpandAll:c}),k.jsx(Uk,{mode:(N==null?void 0:N.mode)??"single",selectAllMode:(N==null?void 0:N.selectAllMode)??["allPages","page"][0],showCheckBoxesMode:"always"}),A&&k.jsx(Pk,{mode:(A==null?void 0:A.mode)??"row",allowUpdating:(A==null?void 0:A.allowUpdating)??!1,allowDeleting:(A==null?void 0:A.allowDeleting)??!1,allowAdding:!1}),k.jsx(Fk,{visible:(K==null?void 0:K.filterRow)??!1,applyFilter:"auto"}),k.jsx(Gk,{visible:(q==null?void 0:q.visible)??!1,width:(q==null?void 0:q.width)??256,placeholder:(q==null?void 0:q.placeholder)??"Search..."}),k.jsx(Vk,{allowSearch:!0,visible:(K==null?void 0:K.headerFilter)??!1}),L&&L.current.map((ye,Ve)=>ye.group?k.jsx(Fc,{groupIndex:0,dataField:ye.columnKey},Ve):k.jsx(Fc,{dataField:ye.columnKey,caption:ye.columnName,alignment:ye.alignment?ye.alignment:ye.dataType==="number"?"right":"left",width:ye.width,visible:ye.visible,dataType:ye.dataType,format:ye.format==="date"?"M/d/yyyy, HH:mm":ye.dataType==="number"&&ye.fixedNumber?{type:"fixedPoint",precision:2}:ye.format,fixed:ye.fixed,cellRender:ye.template,selectedFilterOperation:ye.defaultFilterOperation,allowFiltering:ye.allowFiltering,allowHeaderFiltering:ye.allowHeaderFiltering,allowSorting:ye.allowSorting,allowEditing:ye.allowEditing,visibleIndex:ye.orderIndex,defaultSortOrder:ye.sortOrderType},Ve)),i&&i.length&&!u&&k.jsx(Dg,{children:i&&i.map((ye,Ve)=>k.jsx(Og,{column:ye.column,summaryType:"custom",customizeText:ye.total},Ve))}),i&&i.length&&u&&k.jsx(Dg,{children:i.map((ye,Ve)=>k.jsx(Og,{column:ye.column,summaryType:ye.summaryType,displayFormat:ye.displayFormat}))}),!!y&&ce&&ce.length&&k.jsx(Fc,{dataField:null,caption:"Actions",alignment:"left",width:100,fixed:!1,fixedPosition:"right",allowFiltering:!1,allowSorting:!1,cellRender:ye=>{if(oe&&oe.length>0&&!oe.includes(ye.data[n]))return k.jsx(_le,{theme:r,rowData:ye.data,rowID:ye.data[n],actions:ce.filter(Ve=>Ve.disabledForKeys&&Ve.disabledForKeys.length?!Ve.disabledForKeys.includes(ye.data[n]):Ve),hiddenActionTypes:[Q?"":"delete",W?"":"edit"],onExpand:Ve=>{rn(ye.data),S&&typeof S=="function"&&S(ye.data)}})}}),T&&k.jsx(Hk,{enabled:!0,component:R}),k.jsx(Nk,{enabled:ie}),k.jsx(zk,{mode:z??"none"}),k.jsx(Wk,{defaultPageSize:G==null?void 0:G.defaultPageSize}),k.jsx($k,{visible:G==null?void 0:G.visible,allowedPageSizes:G==null?void 0:G.allowedPageSizes,showPageSizeSelector:G==null?void 0:G.showPageSizeSelector,showInfo:G==null?void 0:G.showInfo,showNavigationButtons:G==null?void 0:G.showNavigationButtons})]})]})]})},Sle="Tabs-module__tabContainer",wle="Tabs-module__vertical",Ele="Tabs-module__underLine",Ile="Tabs-module__singleTab",Tle="Tabs-module__active",Ale="Tabs-module__button",Dle="Tabs-module__underline",Ole="Tabs-module__buttonBorder",Rle="Tabs-module__buttonMinimal",kle="Tabs-module__dark",ss={tabContainer:Sle,vertical:wle,underLine:Ele,singleTab:Ile,active:Tle,button:Ale,underline:Dle,buttonBorder:Ole,buttonMinimal:Rle,dark:kle},Ble=({tabsData:e,type:t="buttonMinimal",vertical:i=!1,onItemClick:n,tabContainerStyle:r,singleTabStyle:a,theme:o})=>{const[s,l]=ve.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 k.jsx("div",{style:r??{},className:`${o==="dark"?ss.dark:""} ${ss.tabContainer} ${ss[t]} ${i?ss.vertical:""}`,children:e.map(d=>k.jsx("p",{style:a??{},className:`${ss.singleTab} ${d.active?ss.active:""}`,onClick:()=>u(d),children:d.label?typeof d.label=="function"?d.label():d.label:""},d.id))})},Lle="FileBlock-module__fileBlockWrapper",Ple="FileBlock-module__fadeEnter",Fle="FileBlock-module__fileName",Mle="FileBlock-module__texts",Vle="FileBlock-module__deleteFile",El={fileBlockWrapper:Lle,fadeEnter:Ple,fileName:Fle,texts:Mle,deleteFile:Vle},Nle=()=>k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 0 16 20",fill:"none",children:k.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"})}),Hle=({file:e,onDelete:t,fileBlockWrapperStyle:i,fileNameStyle:n,textsStyle:r,nameStyle:a,sizeStyle:o,clearIcon:s})=>{const l=()=>{t&&typeof t=="function"&&t(e)};return k.jsxs("div",{className:El.fileBlockWrapper,style:i??{},children:[k.jsxs("div",{className:El.fileName,style:n??{},children:[k.jsx(Nle,{}),k.jsxs("div",{className:El.texts,style:r??{},children:[k.jsx("span",{style:a??{},children:e&&(e!=null&&e.fileName)?e.fileName:"-"}),k.jsx("span",{style:o??{},className:El.size,children:e&&(e!=null&&e.unitSize)?e==null?void 0:e.unitSize:""})]})]}),k.jsx("div",{className:El.deleteFile,onClick:l,children:s??k.jsx(xI,{width:16,color:"#A4A7AE"})})]})},$le="FileUploader-module__fileUploaderWrapper",Wle="FileUploader-module__fileUploaderContent",zle="FileUploader-module__draganddrop",Gle="FileUploader-module__uploadSvg",Ule="FileUploader-module__labels",Kle="FileUploader-module__title",jle="FileUploader-module__subTitle",qle="FileUploader-module__uploadAction",Yle="FileUploader-module__dark",Sr={fileUploaderWrapper:$le,fileUploaderContent:Wle,draganddrop:zle,uploadSvg:Gle,labels:Ule,title:Kle,subTitle:jle,uploadAction:qle,dark:Yle},Xle=e=>k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",children:k.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"})}),Zle=({multiple:e=!0,onChange:t,maxSize:i,withFileValidation:n,acceptedFileFormats:r,title:a,subTitle:o,withResults:s=!0,onFormatError:l,onMaxSizeError:u,fileUploaderWrapperStyle:d,fileUploaderContentStyle:c,draganddropStyle:h,labelsStyle:f,titleStyle:p,clickToUploadStyle:g,subTitleStyle:m,fileBlockWrapperStyle:C,fileNameStyle:x,textsStyle:T,nameStyle:R,sizeStyle:A,clearIcon:z,theme:G})=>{const N=ve.useRef(crypto.randomUUID()),[K,q]=ve.useState(!1),[H,F]=ve.useState(!1),j=ve.useRef([]),I=E=>{F(E)},Y=E=>{E.preventDefault(),I(!0)},ue=E=>{E.preventDefault(),I(!1)},J=E=>{E.preventDefault(),I(!0)},se=E=>{E.preventDefault(),y(E.dataTransfer.files),I(!1)},ae=E=>{j.current=j.current.filter((w,B)=>w.fileID!==E.fileID),q(w=>!w),W()},Q=E=>{y(E.target.files)},W=()=>{t&&typeof t=="function"&&t(j.current)},y=async E=>{let w=E,B=[];for(let V=0;V<w.length;V++){let U={fileName:w[V].name,size:w[V].size,unitSize:uP(w[V].size),type:w[V].type,format:dP(w[V].name),base64:await cP(w[V]),fileID:crypto.randomUUID()};if(n&&r&&!r.includes(U.format.toLowerCase())){l&&typeof l=="function"&&l(U.format.toLowerCase());return}i&&w[V].size>i?u&&typeof u=="function"&&u({Error:"Max_Size_Error",MaxSize:i}):B.push(U)}e?j.current=[...j.current,...B]:(B=B.slice(-1),j.current=B),q(V=>!V),W()};return k.jsxs("div",{className:`${G==="dark"?Sr.dark:""} ${Sr.fileUploaderWrapper}`,style:d??{},children:[k.jsxs("div",{style:c??{},className:`${Sr.fileUploaderContent} `,onDragEnter:Y,onDragLeave:ue,onDragOver:J,onDrop:se,children:[k.jsxs("div",{className:Sr.draganddrop,style:h??{},children:[k.jsx("div",{className:Sr.uploadSvg,children:k.jsx(Xle,{})}),k.jsxs("div",{className:`${Sr.labels} `,style:f??{},htmlFor:N.current,children:[a&&typeof a=="function"?a():k.jsxs("p",{style:p??{},className:Sr.title,children:[k.jsx("span",{style:g??{},children:"Click to upload"})," or drag and drop"]}),o&&typeof o=="function"?o():k.jsxs("p",{style:m??{},className:Sr.subTitle,children:[" ","SVG, PNG, JPG or GIF (max. 800x400px)"]})]})]}),k.jsx("div",{className:Sr.uploadAction,children:k.jsx("input",{type:"file",name:"",id:N.current,multiple:!!e,onChange:Q,accept:""})})]}),j&&j.current&&j.current.length&&s?j.current.map((E,w)=>k.jsx(Hle,{fileBlockWrapperStyle:C,fileNameStyle:x,textsStyle:T,nameStyle:R,sizeStyle:A,clearIcon:z,file:E,onDelete:ae},w)):""]})},Qle=()=>{const e=document.createElement("style");e.setAttribute("id","toast_notification_style_key"),e.innerHTML=`
321
+ `,children:f(p)&&f(p)!=="no_icon"?f(p):p==null?void 0:p.icon()}),k.jsx("div",{className:Ga.actionLabel,children:k.jsx("span",{style:{...p==null?void 0:p.style},children:p==null?void 0:p.label})})]},g))})]})},gle="DeleteAll-module__deleteAllWrapper",mle="DeleteAll-module__iconContainer",Cle="DeleteAll-module__deleteItemsCountLabel",yle="DeleteAll-module__datagridDeleteAllAction",wl={deleteAllWrapper:gle,iconContainer:mle,deleteItemsCountLabel:Cle,datagridDeleteAllAction:yle},xle=ve.forwardRef((e,t)=>{const[i,n]=ve.useState(0),r=o=>{n(o)};ve.useImperativeHandle(t,()=>({setValue:r}));const a=()=>{e.onDeleteAll&&typeof e.onDeleteAll=="function"&&e.onDeleteAll()};return k.jsxs("div",{ref:t,className:`${(e==null?void 0:e.theme)==="dark"?wl.dark:""} ${wl.datagridDeleteAllAction} ${wl.deleteAllWrapper}`,children:[k.jsx("div",{className:wl.iconContainer,onClick:a,children:k.jsx(Rg,{})}),k.jsx("div",{className:wl.deleteItemsCountLabel,children:k.jsxs("span",{children:["Delete ",i," Checked Item"]})})]})}),ble=({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:g,removeFunction:m,withColumnConfigure:C,withDeleteAll:x,withMasterDetail:T,detailTemplate:R,editingOptions:A,scrollMode:z,pagerOptions:G,selection:N,filterOptions:K,searchPanel:q,onEvent:H,selectionChanged:F,focusedRowChanging:j,focusedRowChanged:I,onRowClick:Y,refresh:ue,customActions:J,onColumnConfigure:se,onDeleteAll:ae,onDelete:Q,onEdit:W,withCustomActions:y,multiExpand:E,onFilterValueChange:w,onRowExpand:B,onRowCollaps:V,onRowPrepared:U,onFocusedCellChanged:$,ShowLoader:ie=!0,noDataText:ne,onLoading:_e,hideActions:oe=[1],allowColumnResizing:Re=!0,onActionExpand:S})=>{const[fe,le]=ve.useState(!1),L=ve.useRef(t),P=ve.useRef(null);ve.useState("");const X=ve.useRef({Refresh:()=>P.current.instance.refresh(),SelectedRowKeys:()=>P.current.instance.getSelectedRowKeys()}),[ce,Ce]=ve.useState([{label:"Edit",type:"edit",event:(ye,Ve)=>Oi(ye,Ve)},{label:"Delete",type:"delete",event:(ye,Ve)=>ai(ye,Ve)}]),re=ve.useRef(null),Ee=ye=>{ce&&ce.length&&Ie()},Le=()=>{ce&&ce.length&&Ie()},Ie=()=>{document.querySelectorAll(".datagrid_action_data_controller > ul").forEach(Ve=>{Ve.style.display="none",Ve.style.pointerEvents="none"})},We=new Os({key:h??"id",load:f,update:p,insert:g,remove:m,onLoading:_e}),Qe=(ye,Ve)=>{H&&typeof H=="function"&&H(Ve,ye)},it=ye=>{o&&(N==null?void 0:N.mode)==="multiple"&&x&&re.current.setValue(ye.selectedRowKeys.length),F&&typeof F=="function"&&F(ye)},Kt=ye=>{j&&typeof j=="function"&&j(ye)},Ei=ye=>{I&&typeof I=="function"&&I(ye)},Ge=ye=>{$&&typeof $=="function"&&$(ye)},Et=ye=>{Y&&typeof Y=="function"&&Y(ye.data)},bt=ye=>{U&&typeof U=="function"&&U(ye)},Ki=()=>{ae&&typeof ae=="function"&&ae(X.current.SelectedRowKeys())},rn=ye=>{let St=document.querySelector(`#datagrid_action_data_id_${ye[n]}`),vr=document.querySelectorAll(".datagrid_action_data_controller > ul"),rd=St.querySelector("ul");const Gs=document.querySelectorAll(".dx-datagrid-rowsview .dx-row > td");Gs&&Gs.forEach(_r=>{_r.querySelector("ul")?_r.style.overflow="unset":_r.style.overflow="hidden"});const gf=St.getBoundingClientRect(),mf=document.querySelector(".gridWrapper").getBoundingClientRect();let Ra={display:"block",position:"absolute",pointerEvents:"all",top:"20px",left:"-70px"};gf.bottom>mf.bottom-150&&(Ra.top="unset",Ra.bottom="100%",Ra.left="-100px"),vr.forEach(_r=>{_r.style.display="none",_r.style.pointerEvents="none"}),Object.assign(rd.style,Ra)},ui=ye=>{L.current=ye,le(Ve=>!Ve),se&&typeof se=="function"&&se(L.current)},Se=ye=>{E||ye.component.collapseAll(-1),B&&typeof B=="function"&&B(ye)},Xe=ye=>{V&&typeof V=="function"&&V(ye)},Wt=ye=>{ye.parentType==="filterRow"&&(ye.editorElement.onchange=Ve=>{const St={columnKey:ye.dataField,columnName:ye.caption,filterValue:Ve.target.value};w&&typeof w=="function"&&w(St)})},ai=(ye,Ve)=>{const St=document.querySelector('div[data-grid-confirm-delete="true"]');St.style.display="grid",St.setAttribute("data-grid-confirm-row-data",JSON.stringify(Ve))},Oi=(ye,Ve)=>{W&&typeof W=="function"&&W(Ve)},ze=()=>{const ye=document.querySelector('div[data-grid-confirm-delete="true"]'),Ve=ye.getAttribute("data-grid-confirm-row-data");Q&&typeof Q=="function"&&Q(JSON.parse(Ve)),ye.style.display="none",ye.setAttribute("data-grid-confirm-row-data","")},ft=()=>{const ye=document.querySelector('div[data-grid-confirm-delete="true"]');ye.style.display="none",ye.setAttribute("data-grid-confirm-row-data","")};return ve.useEffect(()=>{J&&J.length&&Ce(ye=>{const Ve=ye;return J.forEach(St=>{Ve.some(vr=>vr.type===St.type)||Ve.push(St)}),Ve})},[J]),ve.useEffect(()=>{ue&&(X.current.Refresh(),console.info("DataSource Refresh....."))},[ue]),ve.useEffect(()=>{L.current=t,le(ye=>!ye)},[t]),ve.useEffect(()=>(document.addEventListener("click",Ee),document.addEventListener("wheel",Le),()=>{document.removeEventListener("click",Ee),document.removeEventListener("wheel",Le)}),[]),k.jsxs(k.Fragment,{children:[k.jsx("div",{className:r==="dark"?"dark":"","data-grid-confirm-delete":!0,style:{display:"none"},children:k.jsx(Lg,{visible:!0,options:{title:"Are You Sure You Want To Delete",type:"unsaved"},children:k.jsxs("div",{style:{marginTop:"2.25rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px"},children:[k.jsx(iu,{label:"Cancel",size:"small",buttonStyle:{border:"0.0625rem solid #EF4343",backgroundColor:"transparent"},labelStyle:{color:"red"},onClick:ft}),k.jsx(iu,{label:"Confirm",size:"small",onClick:ze})]})})}),k.jsxs("div",{style:{height:"100%"},className:`gridWrapper __dx_DataGrid_Component__ light ${r&&!["dark","light"].includes(r)?"light":r}`,children:[(C||x&&(N==null?void 0:N.mode)==="multiple")&&k.jsxs("div",{className:"__dx_DataGrid_Toolbar",children:[k.jsx("div",{className:"__dx_DataGrid_Toolbar_Leftside",children:x&&(N==null?void 0:N.mode)==="multiple"&&k.jsx(xle,{ref:re,onDeleteAll:Ki})}),k.jsx("div",{className:"__dx_DataGrid_Toolbar_Righttside",children:C&&k.jsx("div",{className:"column_configure_wrapper",children:k.jsx(lle,{theme:r,items:L.current.sort((ye,Ve)=>ye.orderIndex-Ve.orderIndex),change:ye=>ui(ye)})})})]}),k.jsxs(Lk,{height:a||"100%",ref:P,onRowPrepared:bt,onFocusedCellChanged:Ge,dataSource:u?We:e,remoteOperations:!0,keyExpr:n??"id",allowColumnReordering:!1,allowColumnResizing:Re,columnAutoWidth:l,noDataText:ne??"No Data",showColumnLines:!1,showRowLines:!0,rowAlternationEnabled:s,showBorders:!1,hoverStateEnabled:!0,onEditorPreparing:Wt,onEditingStart:ye=>Qe(ye,"onEditingStart"),onInitNewRow:ye=>Qe(ye,"onInitNewRow"),onRowInserting:ye=>Qe(ye,"onRowInserting"),onRowInserted:ye=>Qe(ye,"onRowInserted"),onRowUpdating:ye=>Qe(ye,"onRowUpdating"),onRowUpdated:ye=>Qe(ye,"onRowUpdated"),onRowRemoving:ye=>Qe(ye,"onRowRemoving"),onRowRemoved:ye=>Qe(ye,"onRowRemoved"),onSaving:ye=>Qe(ye,"onSaving"),onSaved:ye=>Qe(ye,"onSaved"),onEditCanceling:ye=>Qe(ye,"onEditCanceling"),onEditCanceled:ye=>Qe(ye,"onEditCanceled"),focusedRowEnabled:o,autoNavigateToFocusedRow:!1,onFocusedRowChanging:Kt,onFocusedRowChanged:Ei,onRowClick:Et,onRowExpanding:Se,onRowCollapsed:Xe,onSelectionChanged:it,children:[d&&k.jsx(Mk,{autoExpandAll:c}),k.jsx(Uk,{mode:(N==null?void 0:N.mode)??"single",selectAllMode:(N==null?void 0:N.selectAllMode)??["allPages","page"][0],showCheckBoxesMode:"always"}),A&&k.jsx(Pk,{mode:(A==null?void 0:A.mode)??"row",allowUpdating:(A==null?void 0:A.allowUpdating)??!1,allowDeleting:(A==null?void 0:A.allowDeleting)??!1,allowAdding:!1}),k.jsx(Fk,{visible:(K==null?void 0:K.filterRow)??!1,applyFilter:"auto"}),k.jsx(Gk,{visible:(q==null?void 0:q.visible)??!1,width:(q==null?void 0:q.width)??256,placeholder:(q==null?void 0:q.placeholder)??"Search..."}),k.jsx(Vk,{allowSearch:!0,visible:(K==null?void 0:K.headerFilter)??!1}),L&&L.current.map((ye,Ve)=>ye.group?k.jsx(Fc,{groupIndex:0,dataField:ye.columnKey},Ve):k.jsx(Fc,{dataField:ye.columnKey,caption:ye.columnName,alignment:ye.alignment?ye.alignment:ye.dataType==="number"?"right":"left",width:ye.width,visible:ye.visible,dataType:ye.dataType,format:ye.format==="date"?"M/d/yyyy, HH:mm":ye.dataType==="number"&&ye.fixedNumber?{type:"fixedPoint",precision:2}:ye.format,fixed:ye.fixed,cellRender:ye.template,selectedFilterOperation:ye.defaultFilterOperation,allowFiltering:ye.allowFiltering,allowHeaderFiltering:ye.allowHeaderFiltering,allowSorting:ye.allowSorting,allowEditing:ye.allowEditing,visibleIndex:ye.orderIndex,defaultSortOrder:ye.sortOrderType},Ve)),i&&i.length&&!u&&k.jsx(Dg,{children:i&&i.map((ye,Ve)=>k.jsx(Og,{column:ye.column,summaryType:"custom",customizeText:ye.total},Ve))}),i&&i.length&&u&&k.jsx(Dg,{children:i.map((ye,Ve)=>k.jsx(Og,{column:ye.column,summaryType:ye.summaryType,displayFormat:ye.displayFormat}))}),!!y&&ce&&ce.length&&k.jsx(Fc,{dataField:null,caption:"Actions",alignment:"left",width:100,fixed:!1,fixedPosition:"right",allowFiltering:!1,allowSorting:!1,cellRender:ye=>{if(oe&&oe.length>0&&!oe.includes(ye.data[n]))return k.jsx(_le,{theme:r,rowData:ye.data,rowID:ye.data[n],actions:ce.filter(Ve=>Ve.disabledForKeys&&Ve.disabledForKeys.length?!Ve.disabledForKeys.includes(ye.data[n]):Ve),hiddenActionTypes:[Q?"":"delete",W?"":"edit"],onExpand:Ve=>{rn(ye.data),S&&typeof S=="function"&&S(ye.data)}})}}),T&&k.jsx(Hk,{enabled:!0,component:R}),k.jsx(Nk,{enabled:ie}),k.jsx(zk,{mode:z??"none"}),k.jsx(Wk,{defaultPageSize:G==null?void 0:G.defaultPageSize}),k.jsx($k,{visible:G==null?void 0:G.visible,allowedPageSizes:G==null?void 0:G.allowedPageSizes,showPageSizeSelector:G==null?void 0:G.showPageSizeSelector,showInfo:G==null?void 0:G.showInfo,showNavigationButtons:G==null?void 0:G.showNavigationButtons})]})]})]})},Sle="Tabs-module__tabContainer",wle="Tabs-module__vertical",Ele="Tabs-module__underLine",Ile="Tabs-module__singleTab",Tle="Tabs-module__active",Ale="Tabs-module__button",Dle="Tabs-module__underline",Ole="Tabs-module__buttonBorder",Rle="Tabs-module__buttonMinimal",kle="Tabs-module__dark",ss={tabContainer:Sle,vertical:wle,underLine:Ele,singleTab:Ile,active:Tle,button:Ale,underline:Dle,buttonBorder:Ole,buttonMinimal:Rle,dark:kle},Ble=({tabsData:e,type:t="buttonMinimal",vertical:i=!1,onItemClick:n,tabContainerStyle:r,singleTabStyle:a,theme:o})=>{const[s,l]=ve.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 k.jsx("div",{style:r??{},className:`${o==="dark"?ss.dark:""} ${ss.tabContainer} ${ss[t]} ${i?ss.vertical:""}`,children:e.map(d=>k.jsx("p",{style:a??{},className:`${ss.singleTab} ${d.active?ss.active:""}`,onClick:()=>u(d),children:d.label?typeof d.label=="function"?d.label():d.label:""},d.id))})},Lle="FileBlock-module__fileBlockWrapper",Ple="FileBlock-module__fadeEnter",Fle="FileBlock-module__fileName",Mle="FileBlock-module__texts",Vle="FileBlock-module__deleteFile",El={fileBlockWrapper:Lle,fadeEnter:Ple,fileName:Fle,texts:Mle,deleteFile:Vle},Nle=()=>k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"20",viewBox:"0 0 16 20",fill:"none",children:k.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"})}),Hle=({file:e,onDelete:t,fileBlockWrapperStyle:i,fileNameStyle:n,textsStyle:r,nameStyle:a,sizeStyle:o,clearIcon:s})=>{const l=()=>{t&&typeof t=="function"&&t(e)};return k.jsxs("div",{className:El.fileBlockWrapper,style:i??{},children:[k.jsxs("div",{className:El.fileName,style:n??{},children:[k.jsx(Nle,{}),k.jsxs("div",{className:El.texts,style:r??{},children:[k.jsx("span",{style:a??{},children:e&&(e!=null&&e.fileName)?e.fileName:"-"}),k.jsx("span",{style:o??{},className:El.size,children:e&&(e!=null&&e.unitSize)?e==null?void 0:e.unitSize:""})]})]}),k.jsx("div",{className:El.deleteFile,onClick:l,children:s??k.jsx(xI,{width:16,color:"#A4A7AE"})})]})},$le="FileUploader-module__fileUploaderWrapper",Wle="FileUploader-module__fileUploaderContent",zle="FileUploader-module__draganddrop",Gle="FileUploader-module__uploadSvg",Ule="FileUploader-module__labels",Kle="FileUploader-module__title",jle="FileUploader-module__subTitle",qle="FileUploader-module__uploadAction",Yle="FileUploader-module__dark",Sr={fileUploaderWrapper:$le,fileUploaderContent:Wle,draganddrop:zle,uploadSvg:Gle,labels:Ule,title:Kle,subTitle:jle,uploadAction:qle,dark:Yle},Xle=e=>k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",children:k.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"})}),Zle=({multiple:e=!0,onChange:t,maxSize:i,withFileValidation:n,acceptedFileFormats:r,title:a,subTitle:o,withResults:s=!0,onFormatError:l,onMaxSizeError:u,fileUploaderWrapperStyle:d,fileUploaderContentStyle:c,draganddropStyle:h,labelsStyle:f,titleStyle:p,clickToUploadStyle:g,subTitleStyle:m,fileBlockWrapperStyle:C,fileNameStyle:x,textsStyle:T,nameStyle:R,sizeStyle:A,clearIcon:z,theme:G})=>{const N=ve.useRef(crypto.randomUUID()),[K,q]=ve.useState(!1),[H,F]=ve.useState(!1),j=ve.useRef([]),I=E=>{F(E)},Y=E=>{E.preventDefault(),I(!0)},ue=E=>{E.preventDefault(),I(!1)},J=E=>{E.preventDefault(),I(!0)},se=E=>{E.preventDefault(),y(E.dataTransfer.files),I(!1)},ae=E=>{j.current=j.current.filter((w,B)=>w.fileID!==E.fileID),q(w=>!w),W()},Q=E=>{y(E.target.files)},W=()=>{t&&typeof t=="function"&&t(j.current)},y=async E=>{let w=E,B=[];for(let V=0;V<w.length;V++){let U={fileName:w[V].name,size:w[V].size,unitSize:uP(w[V].size),type:w[V].type,format:dP(w[V].name),base64:await cP(w[V]),fileID:crypto.randomUUID()};if(n&&r&&!r.includes(U.format.toLowerCase())){l&&typeof l=="function"&&l(U.format.toLowerCase());return}i&&w[V].size>i?u&&typeof u=="function"&&u({Error:"Max_Size_Error",MaxSize:i}):B.push(U)}e?j.current=[...j.current,...B]:(B=B.slice(-1),j.current=B),q(V=>!V),W()};return k.jsxs("div",{className:`${G==="dark"?Sr.dark:""} ${Sr.fileUploaderWrapper}`,style:d??{},children:[k.jsxs("div",{style:c??{},className:`${Sr.fileUploaderContent} `,onDragEnter:Y,onDragLeave:ue,onDragOver:J,onDrop:se,children:[k.jsxs("div",{className:Sr.draganddrop,style:h??{},children:[k.jsx("div",{className:Sr.uploadSvg,children:k.jsx(Xle,{})}),k.jsxs("div",{className:`${Sr.labels} `,style:f??{},htmlFor:N.current,children:[a&&typeof a=="function"?a():k.jsxs("p",{style:p??{},className:Sr.title,children:[k.jsx("span",{style:g??{},children:"Click to upload"})," or drag and drop"]}),o&&typeof o=="function"?o():k.jsxs("p",{style:m??{},className:Sr.subTitle,children:[" ","SVG, PNG, JPG or GIF (max. 800x400px)"]})]})]}),k.jsx("div",{className:Sr.uploadAction,children:k.jsx("input",{type:"file",name:"",id:N.current,multiple:!!e,onChange:Q,accept:""})})]}),j&&j.current&&j.current.length&&s?j.current.map((E,w)=>k.jsx(Hle,{fileBlockWrapperStyle:C,fileNameStyle:x,textsStyle:T,nameStyle:R,sizeStyle:A,clearIcon:z,file:E,onDelete:ae},w)):""]})},Qle=()=>{const e=document.createElement("style");e.setAttribute("id","toast_notification_style_key"),e.innerHTML=`
322
322
  .notifications_wrapper{
323
323
  position: fixed;
324
324
  z-index: 9999999;
@@ -71842,7 +71842,7 @@ const nle = "ColumnConfigure-module__configureWrapper", rle = "ColumnConfigure-m
71842
71842
  const a = () => {
71843
71843
  e.onDeleteAll && typeof e.onDeleteAll == "function" && e.onDeleteAll();
71844
71844
  };
71845
- return /* @__PURE__ */ k.jsxs("div", { ref: t, className: `${theme === "dark" ? Tl.dark : ""} ${Tl.datagridDeleteAllAction} ${Tl.deleteAllWrapper}`, children: [
71845
+ return /* @__PURE__ */ k.jsxs("div", { ref: t, className: `${(e == null ? void 0 : e.theme) === "dark" ? Tl.dark : ""} ${Tl.datagridDeleteAllAction} ${Tl.deleteAllWrapper}`, children: [
71846
71846
  /* @__PURE__ */ k.jsx("div", { className: Tl.iconContainer, onClick: a, children: /* @__PURE__ */ k.jsx(kg, {}) }),
71847
71847
  /* @__PURE__ */ k.jsx("div", { className: Tl.deleteItemsCountLabel, children: /* @__PURE__ */ k.jsxs("span", { children: [
71848
71848
  "Delete ",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "master-components-react",
3
3
  "private": false,
4
- "version": "2.0.7",
4
+ "version": "2.0.8",
5
5
  "type": "module",
6
6
  "main": "dist/master-components-react.cjs.js",
7
7
  "module": "dist/master-components-react.es.js",