dealpos 26.3.0 → 26.3.1
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/browser/{chunk-FGYPWSQ2.js → chunk-277ZY5JU.js} +1 -1
- package/browser/{chunk-NRUDPIZI.js → chunk-2C6RJFLN.js} +1 -1
- package/browser/{chunk-KQNPNW3B.js → chunk-2CMBJ46N.js} +1 -1
- package/browser/{chunk-N7K5AJYD.js → chunk-2H4WR2C5.js} +1 -1
- package/browser/{chunk-PFMQNXYT.js → chunk-2YJ3FSVA.js} +1 -1
- package/browser/chunk-37DSL7KN.js +1 -0
- package/browser/{chunk-E7D5TSNJ.js → chunk-3OBHKW7Q.js} +1 -1
- package/browser/{chunk-HJ4CDLEG.js → chunk-3RQ77JSC.js} +1 -1
- package/browser/{chunk-E3MKTVII.js → chunk-4F6RTUSH.js} +1 -1
- package/browser/{chunk-TUKEI7DS.js → chunk-4HUVH3ZF.js} +1 -1
- package/browser/{chunk-XDWCNV5C.js → chunk-54FBO45S.js} +1 -1
- package/browser/{chunk-PJFPFSNF.js → chunk-5B63GABL.js} +1 -1
- package/browser/{chunk-MXNGUK75.js → chunk-5SNIH54I.js} +1 -1
- package/browser/{chunk-CE4KGU3Q.js → chunk-5UR27LMQ.js} +1 -1
- package/browser/{chunk-Q53POYNS.js → chunk-72GKRVS4.js} +1 -1
- package/browser/{chunk-KL3UWCEB.js → chunk-7NJMT7EF.js} +1 -1
- package/browser/{chunk-WUQQX2YV.js → chunk-7S6TR3MY.js} +2 -2
- package/browser/{chunk-YKEBXLYR.js → chunk-7TVUZFMF.js} +1 -1
- package/browser/chunk-AY4LDKH2.js +1 -0
- package/browser/{chunk-UGVRH42W.js → chunk-BAMUOEAU.js} +1 -1
- package/browser/chunk-BAYMY7BU.js +1 -0
- package/browser/{chunk-UH7M2CQE.js → chunk-BGNCAYFP.js} +1 -1
- package/browser/{chunk-C343HRJ2.js → chunk-BKM4FOGU.js} +1 -1
- package/browser/{chunk-H2IEQ3XF.js → chunk-BPOGZHZF.js} +1 -1
- package/browser/{chunk-OSKY7SAF.js → chunk-EHKOWHBW.js} +1 -1
- package/browser/{chunk-BFLO3AEK.js → chunk-EOGGED7K.js} +1 -1
- package/browser/{chunk-K4VHIUMQ.js → chunk-ES7Z7DIE.js} +4 -4
- package/browser/{chunk-C34MJXEK.js → chunk-FSEZW3O6.js} +1 -1
- package/browser/{chunk-3ZH4ZECI.js → chunk-FUU6W3LO.js} +2 -2
- package/browser/{chunk-JRBEN4BO.js → chunk-G34ACAAC.js} +1 -1
- package/browser/{chunk-4R7UO7M4.js → chunk-G6GLATNX.js} +1 -1
- package/browser/{chunk-6ZSBGBMA.js → chunk-HCB5OU7M.js} +1 -1
- package/browser/{chunk-FCIFXEE4.js → chunk-HGP7GMIY.js} +1 -1
- package/browser/{chunk-C56YECB6.js → chunk-IKDP2AM3.js} +1 -1
- package/browser/{chunk-YYIAAIGU.js → chunk-J2OO7EBA.js} +1 -1
- package/browser/{chunk-S2I2Z7SQ.js → chunk-J7IUXILJ.js} +1 -1
- package/browser/{chunk-QGCJJC6L.js → chunk-JYCIVJEI.js} +1 -1
- package/browser/{chunk-NNJWCS2H.js → chunk-K72NYE7D.js} +1 -1
- package/browser/{chunk-GFEHC7RF.js → chunk-KCRIB6HN.js} +1 -1
- package/browser/{chunk-HZCHB6NB.js → chunk-KDX52VOS.js} +1 -1
- package/browser/{chunk-5GSBFAC4.js → chunk-KKM54C4C.js} +1 -1
- package/browser/{chunk-THQY3KLU.js → chunk-KMQDB53H.js} +1 -1
- package/browser/{chunk-ELQX4GP7.js → chunk-L5LG5LVB.js} +2 -2
- package/browser/{chunk-ISYOPBYU.js → chunk-LDIB5UPT.js} +1 -1
- package/browser/{chunk-VNM3YXS7.js → chunk-LDQOLISH.js} +1 -1
- package/browser/{chunk-HYDDEXNT.js → chunk-LLDUJXHV.js} +1 -1
- package/browser/{chunk-R37YPPCZ.js → chunk-LS3AUDEG.js} +1 -1
- package/browser/{chunk-RVVCXDO7.js → chunk-LU76OFKL.js} +1 -1
- package/browser/{chunk-MWLRG2GS.js → chunk-LVBB4G6X.js} +1 -1
- package/browser/{chunk-MJ3QICSV.js → chunk-M3GZFJXL.js} +1 -1
- package/browser/{chunk-IMJXVR45.js → chunk-M3Q3N23Q.js} +1 -1
- package/browser/{chunk-X3GZQ7KY.js → chunk-MAUAXALW.js} +1 -1
- package/browser/{chunk-TJVLQJCS.js → chunk-MMV5O4DK.js} +7 -7
- package/browser/{chunk-7MQ6SB2U.js → chunk-MOHC3M32.js} +1 -1
- package/browser/{chunk-TDL6QWGT.js → chunk-MTOD5ZFV.js} +1 -1
- package/browser/{chunk-XEJ53LUN.js → chunk-NUEZUH4T.js} +1 -1
- package/browser/{chunk-GJD7VFLG.js → chunk-OFIRJDRI.js} +13 -13
- package/browser/{chunk-RL7CLWIJ.js → chunk-OKYFRQUV.js} +1 -1
- package/browser/{chunk-BZ63KJIS.js → chunk-ON5MMASO.js} +2 -2
- package/browser/{chunk-K4BKO4XY.js → chunk-OO7FD7CT.js} +1 -1
- package/browser/{chunk-N4CXPRQ4.js → chunk-P6A4YFJE.js} +1 -1
- package/browser/{chunk-SCARDHDE.js → chunk-PIEJRXN3.js} +1 -1
- package/browser/{chunk-NQN6I4U3.js → chunk-POCHDKBB.js} +5 -5
- package/browser/{chunk-PHGKBUNZ.js → chunk-PPJZ22NZ.js} +1 -1
- package/browser/chunk-PVC4XWNU.js +1 -0
- package/browser/{chunk-47SOGPQC.js → chunk-Q2ODC2U6.js} +1 -1
- package/browser/{chunk-3A6QSR2D.js → chunk-Q62UUP53.js} +1 -1
- package/browser/{chunk-OA2FDRUY.js → chunk-QKSTKNMN.js} +1 -1
- package/browser/{chunk-ITTL3GLA.js → chunk-RC6L3XCA.js} +8 -8
- package/browser/{chunk-JQWOKUYI.js → chunk-RNH7GXAZ.js} +1 -1
- package/browser/{chunk-F3E2YFTK.js → chunk-S2ZHYKZZ.js} +1 -1
- package/browser/{chunk-E72FLFBR.js → chunk-SCSSMVAN.js} +1 -1
- package/browser/{chunk-ERXSIXPI.js → chunk-SH54PSGA.js} +1 -1
- package/browser/{chunk-MT5CI6GU.js → chunk-SHDBZ7HT.js} +1 -1
- package/browser/{chunk-SIOWYL3F.js → chunk-SQDWKNWI.js} +1 -1
- package/browser/{chunk-TMFUDALL.js → chunk-T6Z46Z66.js} +1 -1
- package/browser/{chunk-ZNEUOFFD.js → chunk-TBG3PLYB.js} +1 -1
- package/browser/chunk-TCIATEOL.js +11 -0
- package/browser/{chunk-TNWQ4VSE.js → chunk-TJQ3K5PA.js} +1 -1
- package/browser/{chunk-ECIN7MIX.js → chunk-UHXSK5U3.js} +1 -1
- package/browser/{chunk-PGUPSFF5.js → chunk-UPSV6UVM.js} +1 -1
- package/browser/{chunk-TTNBDMHS.js → chunk-VB4IUA5F.js} +1 -1
- package/browser/{chunk-IPBG7MP2.js → chunk-VBBYERXJ.js} +1 -1
- package/browser/{chunk-BP3PQGQ2.js → chunk-VHEJIH5T.js} +1 -1
- package/browser/{chunk-SYIABNMZ.js → chunk-VQXU6HL6.js} +1 -1
- package/browser/{chunk-LZ6KVEQ7.js → chunk-W5Q3QIWC.js} +1 -1
- package/browser/{chunk-RDR2LUVI.js → chunk-W7LWZNUZ.js} +1 -1
- package/browser/{chunk-RKTSFA5X.js → chunk-WAEN5I4X.js} +1 -1
- package/browser/{chunk-72LS4HTY.js → chunk-WDIAPNCE.js} +1 -1
- package/browser/{chunk-RCCPTKFN.js → chunk-WYTKTF6R.js} +1 -1
- package/browser/{chunk-UJXJ33VQ.js → chunk-XOTYHCDB.js} +1 -1
- package/browser/{chunk-OL6MRTON.js → chunk-XPXIGCCS.js} +1 -1
- package/browser/{chunk-XULXSWH2.js → chunk-XS2ZR7PN.js} +1 -1
- package/browser/{chunk-56CBUXG7.js → chunk-YF2XX4YL.js} +2 -2
- package/browser/{chunk-RKAUK5J7.js → chunk-ZK7T2XC5.js} +1 -1
- package/browser/{chunk-5QY3OIRZ.js → chunk-ZZEX6XS3.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-BVYHWEW5.js → main-CBCRPZRT.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-H4YMWFPD.js +0 -1
- package/browser/chunk-JPYLJIEO.js +0 -1
- package/browser/chunk-OVIFE5Q6.js +0 -11
- package/browser/chunk-TSVBIRRG.js +0 -1
- package/browser/chunk-YXCPHYC5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-UHXSK5U3.js";import{a as x}from"./chunk-J7IUXILJ.js";import{a as w}from"./chunk-GMJBQR3Q.js";import{a as A}from"./chunk-ZK7T2XC5.js";import{a as I}from"./chunk-XYUERTH2.js";import{a as c}from"./chunk-2FWFPV5I.js";import{a as l}from"./chunk-WUV22SZ4.js";import{Da as P,fa as y,qa as f,t as L,z as S}from"./chunk-Y2L5QWEJ.js";import{a as F}from"./chunk-SNAKHGZS.js";var h=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){w(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var u=class{constructor(o){this.httpService=o}exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return l.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let b=parseInt(n.getAttribute("colspan"));for(let g=1;g<b;g++)a["column"+s]="",s++;let m=n.innerText,v=m.toString().split("");if(o&&v[0]==="0"&&v.length>1){let g="'"+m.trim();a["column"+s]=g}else a["column"+s]=m.trim()}),e.push(a)}),e}};var d=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var M=class extends A{constructor(t,e,i,r,a,s,p){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=p;this.exportHandler=new u(e),r?(s&&(this.loaderPayload=F({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload)]).pipe(L(([n,b])=>b)).pipe(I()).subscribe(n=>{this.pageData=n,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),p?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}openDialogFilter=f(x);reportFilterService=f(C);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new d;dragDrop=new h;exportHandler;comparation=0;loaderPayload={};reloadRowCount=P(!1);preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).subscribe(e=>{this.data=e,this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).pipe(y(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=l.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=l.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,c.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let p=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,p.length>0){let n=p[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{M as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ge}from"./chunk-YSSTG3C7.js";import{a as Ne,f as Ae}from"./chunk-TNWQ4VSE.js";import{b as Le,c as Re,d as Be,e as We,f as je,g as ze}from"./chunk-5EJZ4SLS.js";import"./chunk-QV7JAXIQ.js";import{b as $e}from"./chunk-ZHFXBX4S.js";import"./chunk-I2VRQAVX.js";import"./chunk-WZ4H2QCH.js";import"./chunk-MAZTVHVF.js";import{d as Fe}from"./chunk-JNIORAXC.js";import"./chunk-FYL3GGVQ.js";import{b as ve}from"./chunk-LENDLHAV.js";import{a as Se}from"./chunk-P2Z4YGQM.js";import"./chunk-VL2K4VS6.js";import{c as xe}from"./chunk-NXZ3FBIN.js";import"./chunk-VUTMWXCW.js";import"./chunk-RXYWOHIG.js";import"./chunk-WD2MPWG4.js";import"./chunk-5GSBFAC4.js";import"./chunk-WJQ2ONA3.js";import"./chunk-Y2SIZH42.js";import"./chunk-5JBGYOM3.js";import"./chunk-2RXQF7XL.js";import"./chunk-TTIBJA6T.js";import{b as De,c as ke,f as Ue,g as Ve}from"./chunk-S2I2Z7SQ.js";import"./chunk-3A6QSR2D.js";import"./chunk-EI6LHFOD.js";import"./chunk-HKRRRS5Z.js";import"./chunk-VUQURUMC.js";import"./chunk-PSWOJ5IT.js";import"./chunk-KUQLG62N.js";import"./chunk-UKR6WSMU.js";import"./chunk-EXDHBZKS.js";import"./chunk-7JQAOKYW.js";import{e as Pe,f as Oe}from"./chunk-7MQ6SB2U.js";import{a as be,b as Ee}from"./chunk-RKAUK5J7.js";import"./chunk-D7IVR7NS.js";import"./chunk-TTUOKG4X.js";import"./chunk-F3X26H2E.js";import{a as Te,b as Me}from"./chunk-ET5PLR24.js";import"./chunk-73QKSUFY.js";import"./chunk-65TS2FI5.js";import"./chunk-BQATLA3U.js";import"./chunk-YMCW77AL.js";import"./chunk-YNQPX5G6.js";import{O as q}from"./chunk-YIUT3U63.js";import"./chunk-KBGHJVCP.js";import{a as we,b as Ie,c as ye}from"./chunk-MI6NPOA7.js";import"./chunk-XYUERTH2.js";import"./chunk-PXAONONR.js";import"./chunk-WCNEGT6N.js";import"./chunk-433OILLE.js";import"./chunk-K3VG42QW.js";import"./chunk-62FLHAOF.js";import"./chunk-UPFQNTMD.js";import"./chunk-YOLOS4V7.js";import"./chunk-2FWFPV5I.js";import{pa as he}from"./chunk-JYQVZO6Y.js";import{F as W,G as ge,h as _e,o as fe}from"./chunk-GI3LYHJ6.js";import"./chunk-72LS4HTY.js";import"./chunk-XDWCNV5C.js";import"./chunk-DQLTY6WY.js";import"./chunk-JPYLJIEO.js";import"./chunk-WUV22SZ4.js";import{a as ue}from"./chunk-BFLO3AEK.js";import{s as Ce}from"./chunk-ELAN2H2C.js";import{$b as F,Ac as le,Bb as v,Bc as ae,Da as V,Db as b,Dc as pe,E as Y,Eb as te,Gb as ie,Hb as ne,I as J,Ib as c,Ic as g,Jb as n,Jc as C,Kb as o,Kc as me,Lb as w,Pb as E,Qb as P,Sb as x,Ta as Z,Vb as f,Wc as H,Xb as s,Xc as R,Y as z,Ya as p,Yb as oe,Zb as Q,aa as X,ac as N,bc as A,fa as $,fb as G,fc as L,hc as re,jb as y,k as K,kc as l,kd as se,lc as d,mc as I,nb as ee,pb as T,pc as O,qa as M,qc as D,rc as k,sd as de,ua as u,va as _,wd as ce,zd as B}from"./chunk-Y2L5QWEJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var Ye=["stepperRef"],Je=[[["preview"]],[["complete"]]],Xe=["preview","complete"];function Ze(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function et(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function tt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function it(t,r){t&1&&(w(0,"i",8),n(1,"span"),l(2,"Upload"),o())}function nt(t,r){if(t&1){let e=x();n(0,"div",9)(1,"div",10)(2,"POS-uppy",11),f("fileUploaded",function(i){u(e);let m=s(2);return _(m.onDropFile(i))}),o()(),n(3,"div",12)(4,"p",13),l(5," Please refer this "),n(6,"a",14),l(7,"article"),o(),l(8," for more information "),o()()()}if(t&2){let e=s(2);p(2),c("sampleUrl",e.sampleUrl())("subtitle","Accepted file formats: .csv & max file size: 1 MB"),p(4),c("href",e.articleLink(),Z)}}function ot(t,r){if(t&1&&v(0,nt,9,3,"div",9),t&2){s();let e=L(1);b(e.selectedIndex===0?0:-1)}}function rt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function lt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function at(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function pt(t,r){t&1&&(w(0,"i",15),n(1,"span"),l(2,"Preview"),o())}function mt(t,r){t&1&&Q(0)}function st(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function dt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function ct(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function ut(t,r){t&1&&(w(0,"i",16),n(1,"span"),l(2,"Finish"),o())}function _t(t,r){t&1&&Q(0,1)}var S=(function(t){return t[t.UPLOAD=0]="UPLOAD",t[t.PREVIEW=1]="PREVIEW",t[t.COMPLETE=2]="COMPLETE",t})(S||{}),He=(()=>{let r=class r{constructor(){this.sampleUrl=R(""),this.articleLink=R(),this._onDropFile=H({alias:"onDropFile"}),this.disabledEdit=R(!1),this._onStateChange=H({alias:"onStateChange"}),console.log("Import Stepper Component Initialized")}get stepper(){return this._stepper}nextStep(){this._stepper&&(this.stepper.selected&&(this.stepper.selected.completed=!0),this._stepper.next())}previousStep(){this._stepper&&this._stepper.previous()}resetStep(){this._stepper&&this._stepper.reset()}onStepChange(a){a.selectedIndex===1?this._onStateChange.emit(S.PREVIEW):a.selectedIndex===2?this._onStateChange.emit(S.COMPLETE):this._onStateChange.emit(S.UPLOAD)}onDropFile(a){this._onDropFile.emit(a)}onRemoveFile(){}stateUpload(){}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=y({type:r,selectors:[["pos-import-stepper"]],viewQuery:function(i,m){if(i&1&&F(Ye,5),i&2){let h;N(h=A())&&(m._stepper=h.first)}},inputs:{sampleUrl:[1,"sampleUrl"],articleLink:[1,"articleLink"],disabledEdit:[1,"disabledEdit"]},outputs:{_onDropFile:"onDropFile",_onStateChange:"onStateChange"},ngContentSelectors:Xe,decls:20,vars:7,consts:[["stepperRef",""],[3,"selectionChange","linear"],[3,"completed","editable"],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepLabel",""],["matStepContent",""],[1,"fa-solid","fa-upload","me-3"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-2"],[2,"max-width","580px"],["file","",3,"fileUploaded","sampleUrl","subtitle"],[1,"d-flex","w-100",2,"max-width","580px"],[1,"fst-italic"],["target","_blank",3,"href"],[1,"fa-regular","fa-file","me-3"],[1,"fa-solid","fa-check","me-3"]],template:function(i,m){if(i&1){let h=x();oe(Je),n(0,"mat-stepper",1,0),f("selectionChange",function(Ke){return u(h),_(m.onStepChange(Ke))}),n(2,"mat-step",2),T(3,Ze,1,1,"ng-template",3)(4,et,1,1,"ng-template",4)(5,tt,1,1,"ng-template",5)(6,it,3,0,"ng-template",6)(7,ot,1,1,"ng-template",7),o(),n(8,"mat-step",2),T(9,rt,1,1,"ng-template",3)(10,lt,1,1,"ng-template",4)(11,at,1,1,"ng-template",5)(12,pt,3,0,"ng-template",6)(13,mt,1,0,"ng-template",7),o(),n(14,"mat-step",2),T(15,st,1,1,"ng-template",3)(16,dt,1,1,"ng-template",4)(17,ct,1,1,"ng-template",5)(18,ut,3,0,"ng-template",6)(19,_t,1,0,"ng-template",7),o()()}i&2&&(c("linear",!0),p(2),c("completed",!1)("editable",!m.disabledEdit()),p(6),c("completed",!1)("editable",!m.disabledEdit()),p(6),c("completed",!1)("editable",!1))},dependencies:[xe,W,ge,Se,ve,$e,Fe,ze,We,Le,je,Re,Be],styles:[".mat-horizontal-stepper-header-container{width:50%!important;margin:0 auto} .mat-horizontal-stepper-wrapper{gap:1rem} .mat-horizontal-stepper-content{display:flex;justify-content:center} p-table .p-datatable-tbody>tr{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-thead>tr>th{font-family:Roboto,Courier,monospace;font-weight:700;font-style:normal;color:#333} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-tbody>tr>td{font-family:Roboto,Courier,monospace;font-weight:400;font-style:normal;color:#333}"]});let t=r;return t})();var j=class t{configModal=new Te;dialogRef=M(we);data=M(Ie);constructor(){this.initDialogConfig()}initDialogConfig(){this.configModal.title="Preview Summary",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.customWidth="500px"}onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["app-dialog-import-preview"]],decls:30,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"row"],[1,"col"],[1,"d-flex","flex-column","gap-2"],[2,"font-size","1.9rem"],[2,"font-size","1rem"]],template:function(e,a){e&1&&(n(0,"modal-material",0),f("onOk",function(){return a.onOk()})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),w(1,"header"),n(2,"content")(3,"div",1)(4,"div",2)(5,"h3"),l(6,"Import Summary"),o()(),n(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"span",7),l(12),g(13,"number"),o(),n(14,"span",8),l(15,"New Outlet"),o()()(),n(16,"div",5)(17,"div",6)(18,"span",7),l(19),g(20,"number"),o(),n(21,"span",8),l(22,"Update Outlet"),o()()(),n(23,"div",5)(24,"div",6)(25,"span",7),l(26),g(27,"number"),o(),n(28,"span",8),l(29,"New Outlet Group"),o()()()()()()()()),e&2&&(c("config",a.configModal),p(12),d(C(13,4,a.data==null?null:a.data.new)),p(7),d(C(20,6,a.data==null?null:a.data.update)),p(7),d(C(27,8,a.data==null?null:a.data.newOutletGroup)))},dependencies:[B,Me,ce],encapsulation:2})};var Ct=["importStepper"],ht=()=>({"min-width":"50rem"}),xt=(t,r,e)=>({"btn-success":t,"btn-outline-secondary":r,"not-allowed":e}),St=t=>({"mb-1":t});function vt(t,r){if(t&1){let e=x();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onPreviousStep())}),l(1," Back "),o()}}function bt(t,r){if(t&1){let e=x();n(0,"button",15),g(1,"async"),g(2,"async"),f("click",function(){u(e);let i=s();return _(i.onNextStep())}),l(3," Next "),o()}if(t&2){let e,a,i=s();c("ngClass",pe(6,xt,i.currentState()===1,i.currentState()!==1,!((e=C(1,2,i.importPreview$))!=null&&e.CanProceed)))("disabled",!((a=C(2,4,i.importPreview$))!=null&&a.CanProceed)&&i.currentState()===1)}}function wt(t,r){if(t&1){let e=x();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onReset())}),l(1," New "),o()}}function It(t,r){if(t&1){let e=x();n(0,"tr")(1,"th",16),l(2,"Name"),o(),n(3,"th",17),l(4,"Code"),o(),n(5,"th",18),l(6," Status "),n(7,"i",19),f("click",function(i){u(e);let m=L(9);return _(m.toggle(i))}),o(),n(8,"p-popover",null,1)(10,"div",20)(11,"div",21)(12,"p-checkbox",22),f("ngModelChange",function(i){u(e);let m=s();return _(m.selectAll(i))}),o(),n(13,"label",23),l(14,"All"),o()(),n(15,"div",24)(16,"p-checkbox",25),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(17,"label",26),l(18,"Unchanged"),o()(),n(19,"div",24)(20,"p-checkbox",27),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(21,"label",28),l(22,"New"),o()(),n(23,"div",24)(24,"p-checkbox",29),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(25,"label",30),l(26,"Error"),o()(),n(27,"div",24)(28,"p-checkbox",31),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(29,"label",32),l(30,"Update"),o()()()()(),n(31,"th"),l(32,"Message"),o()()}if(t&2){let e=s();p(12),c("ngModel",e.pickAll),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition)}}function yt(t,r){if(t&1&&(n(0,"div",33)(1,"span",34),l(2),o(),n(3,"span"),l(4),o()()),t&2){let e=r.$implicit,a=r.$index,i=s().$implicit;c("ngClass",ae(3,St,a<i.Issues.length-1)),p(2),I(" ",e.Issue,". "),p(2),I("",e.Solution," ")}}function Tt(t,r){if(t&1&&(n(0,"tr")(1,"td"),l(2),o(),n(3,"td"),l(4),o(),n(5,"td"),l(6),o(),n(7,"td"),ie(8,yt,5,5,"div",33,te),o()()),t&2){let e=r.$implicit;p(2),d(e.Name),p(2),d(e.Code),p(),re("bg-gradient-success",e.Action=="New")("bg-gradient-warning",e.Action=="Update")("bg-gradient-danger",e.Action=="Error"),p(),I(" ",e.Action," "),p(2),ne(e.Issues)}}function Mt(t,r){if(t&1&&(n(0,"div",37)(1,"span"),l(2),o(),l(3,", "),n(4,"span"),l(5),o(),n(6,"span"),l(7),o(),n(8,"span"),l(9,"succesfully imported"),o()()),t&2){let e=r;p(2),I("",e==null?null:e.Summary.NewOutlet," New Outlets"),p(3),I("",e==null?null:e.Summary.UpdateOutlet," Updated Outlets"),p(2),I("and ",e==null?null:e.Summary.NewOutletGroup," New Outlet Group")}}function Et(t,r){if(t&1&&(n(0,"div",13),w(1,"i",35),n(2,"h1",36),l(3,"Upload Complete!"),o(),v(4,Mt,10,3,"div",37),g(5,"async"),o()),t&2){let e,a=s();p(4),b((e=C(5,1,a.importPreview$))?4:-1,e)}}var qe=class t extends be{constructor(e,a){super(e);this.httpService=a;this.menuData$.subscribe()}pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];importStepper;fileToImport=V(null);importPreview$;sampleImportFileUrl=ue.files.csv.outlet_import;articleLink="https://support.dealpos.com/en/articles/11069092-import-new-outlet";currentState=V(S.UPLOAD);confirmImport$;importPreview=V(null);dialog=M(ye);onDropFile(e){this.fileToImport.set(e)}onNextStep(){switch(this.currentState()){case S.UPLOAD:this.onPreviewImport();break;case S.PREVIEW:this.onImport();break;default:break}}onPreviousStep(){this.importStepper.previousStep()}onReset(){this.importPreview.set(null),this.importPreview$=null,this.confirmImport$=null,this.fileToImport.set(null),this.currentState.update(()=>S.UPLOAD),this.importStepper.resetStep()}onStateChange(e){this.currentState.update(()=>e)}onPreviewImport(){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let e=new FormData;e.append("file",this.fileToImport()),this.importPreview$=this.httpService.postFormData(q.previewImportOutlet,e).pipe($(a=>{this.importPreview.set(a),this.importStepper.nextStep()}),z(1))}onImport(){this.confirmImport$=this.dialog.open(j,{data:{new:this.importPreview()?.Summary?.NewOutlet,update:this.importPreview()?.Summary?.UpdateOutlet,newOutletGroup:this.importPreview()?.Summary?.NewOutletGroup}}).afterClosed().pipe(Y(e=>e==!0),X(()=>this.httpService.post(q.importOutlet,{CacheKey:this.importPreview()?.CacheKey})),$(e=>{this.importStepper.nextStep()}),J(e=>(this.pickAll=[],this.filterTreeCondition=["Error"],K)),z(1))}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(a){return new(a||t)(G(Ee),G(Ce))};static \u0275cmp=y({type:t,selectors:[["app-outlet-import"]],viewQuery:function(a,i){if(a&1&&F(Ct,5),a&2){let m;N(m=A())&&(i.importStepper=m.first)}},features:[ee],decls:17,vars:21,consts:[["importStepper",""],["op",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["type","button",1,"btn","btn-outline-secondary"],[1,"btn",3,"ngClass","disabled"],["ngProjectAs","content",5,["content"]],[3,"onDropFile","onStateChange","sampleUrl","disabledEdit","articleLink"],["ngProjectAs","preview",5,["preview"]],[1,"w-100",3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["ngProjectAs","complete",5,["complete"]],[1,"d-flex","flex-column","align-items-center"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"btn",3,"click","ngClass","disabled"],[2,"width","300px"],[2,"width","200px"],[2,"width","100px"],[1,"fa","fa-filter","pointer",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","name","filterTreeCondition","value","All","inputId","all",3,"ngModelChange","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Unchanged","name","filterTreeCondition","value","Unchanged","inputId","unchanged",3,"ngModelChange","ngModel"],["for","unchanged",1,"ms-2"],["label","New","name","filterTreeCondition","value","New","inputId","new",3,"ngModelChange","ngModel"],["for","new",1,"ms-2"],["label","Error","name","filterTreeCondition","value","Error","inputId","error",3,"ngModelChange","ngModel"],["for","error",1,"ms-2"],["label","Updated","name","filterTreeCondition","value","Update","inputId","update",3,"ngModelChange","ngModel"],["for","update",1,"ms-2"],[3,"ngClass"],[1,"me-1"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"d-flex","gap-2","fw-normal","fs-4","mt-2"]],template:function(a,i){if(a&1){let m=x();n(0,"mainpanel-cmp",2),E(1,3),v(2,vt,2,0,"button",4),v(3,bt,4,10,"button",5),v(4,wt,2,0,"button",4),P(),E(5,6),n(6,"pos-import-stepper",7,0),f("onDropFile",function(U){return u(m),_(i.onDropFile(U))})("onStateChange",function(U){return u(m),_(i.onStateChange(U))}),E(8,8),n(9,"p-table",9),g(10,"async"),g(11,"filterTree"),T(12,It,33,5,"ng-template",10)(13,Tt,10,9,"ng-template",11),o(),P(),E(14,12),v(15,Et,6,3,"div",13),g(16,"async"),P(),o(),P(),o()}if(a&2){let m,h;c("pageData",i.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),b(i.currentState()==1?2:-1),p(),b(i.fileToImport()&&((m=i.fileToImport())==null?null:m.size)>0&&i.currentState()<2?3:-1),p(),b(i.currentState()===2?4:-1),p(2),c("sampleUrl",i.sampleImportFileUrl)("disabledEdit",i.currentState()===2)("articleLink",i.articleLink),p(3),c("value",me(11,15,(h=C(10,13,i.importPreview$))==null?null:h.DataRow,i.filterTreeCondition))("scrollable",!0)("tableStyle",le(20,ht)),p(6),b(C(16,18,i.confirmImport$)?15:-1)}},dependencies:[B,se,He,Ve,Ue,Ae,Ne,he,Oe,Pe,W,_e,fe,ke,De,de,Ge],encapsulation:2})};export{qe as OutletImportComponent};
|
|
1
|
+
import{a as Ge}from"./chunk-YSSTG3C7.js";import{a as Ne,f as Ae}from"./chunk-TJQ3K5PA.js";import{b as Le,c as Re,d as Be,e as We,f as je,g as ze}from"./chunk-5EJZ4SLS.js";import"./chunk-QV7JAXIQ.js";import{b as $e}from"./chunk-ZHFXBX4S.js";import"./chunk-I2VRQAVX.js";import"./chunk-WZ4H2QCH.js";import"./chunk-MAZTVHVF.js";import{d as Fe}from"./chunk-JNIORAXC.js";import"./chunk-FYL3GGVQ.js";import{b as ve}from"./chunk-LENDLHAV.js";import{a as Se}from"./chunk-P2Z4YGQM.js";import"./chunk-VL2K4VS6.js";import{c as xe}from"./chunk-NXZ3FBIN.js";import"./chunk-VUTMWXCW.js";import"./chunk-RXYWOHIG.js";import"./chunk-WD2MPWG4.js";import"./chunk-KKM54C4C.js";import"./chunk-WJQ2ONA3.js";import"./chunk-Y2SIZH42.js";import"./chunk-5JBGYOM3.js";import"./chunk-2RXQF7XL.js";import"./chunk-TTIBJA6T.js";import{b as De,c as ke,f as Ue,g as Ve}from"./chunk-J7IUXILJ.js";import"./chunk-Q62UUP53.js";import"./chunk-EI6LHFOD.js";import"./chunk-HKRRRS5Z.js";import"./chunk-VUQURUMC.js";import"./chunk-PSWOJ5IT.js";import"./chunk-KUQLG62N.js";import"./chunk-UKR6WSMU.js";import"./chunk-EXDHBZKS.js";import"./chunk-7JQAOKYW.js";import{e as Pe,f as Oe}from"./chunk-MOHC3M32.js";import{a as be,b as Ee}from"./chunk-ZK7T2XC5.js";import"./chunk-D7IVR7NS.js";import"./chunk-TTUOKG4X.js";import"./chunk-F3X26H2E.js";import{a as Te,b as Me}from"./chunk-ET5PLR24.js";import"./chunk-73QKSUFY.js";import"./chunk-65TS2FI5.js";import"./chunk-BQATLA3U.js";import"./chunk-YMCW77AL.js";import"./chunk-YNQPX5G6.js";import{O as q}from"./chunk-YIUT3U63.js";import"./chunk-KBGHJVCP.js";import{a as we,b as Ie,c as ye}from"./chunk-MI6NPOA7.js";import"./chunk-XYUERTH2.js";import"./chunk-PXAONONR.js";import"./chunk-WCNEGT6N.js";import"./chunk-433OILLE.js";import"./chunk-K3VG42QW.js";import"./chunk-62FLHAOF.js";import"./chunk-UPFQNTMD.js";import"./chunk-YOLOS4V7.js";import"./chunk-2FWFPV5I.js";import{pa as he}from"./chunk-JYQVZO6Y.js";import{F as W,G as ge,h as _e,o as fe}from"./chunk-GI3LYHJ6.js";import"./chunk-WDIAPNCE.js";import"./chunk-54FBO45S.js";import"./chunk-DQLTY6WY.js";import"./chunk-BAYMY7BU.js";import"./chunk-WUV22SZ4.js";import{a as ue}from"./chunk-EOGGED7K.js";import{s as Ce}from"./chunk-ELAN2H2C.js";import{$b as F,Ac as le,Bb as v,Bc as ae,Da as V,Db as b,Dc as pe,E as Y,Eb as te,Gb as ie,Hb as ne,I as J,Ib as c,Ic as g,Jb as n,Jc as C,Kb as o,Kc as me,Lb as w,Pb as E,Qb as P,Sb as x,Ta as Z,Vb as f,Wc as H,Xb as s,Xc as R,Y as z,Ya as p,Yb as oe,Zb as Q,aa as X,ac as N,bc as A,fa as $,fb as G,fc as L,hc as re,jb as y,k as K,kc as l,kd as se,lc as d,mc as I,nb as ee,pb as T,pc as O,qa as M,qc as D,rc as k,sd as de,ua as u,va as _,wd as ce,zd as B}from"./chunk-Y2L5QWEJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var Ye=["stepperRef"],Je=[[["preview"]],[["complete"]]],Xe=["preview","complete"];function Ze(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function et(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function tt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function it(t,r){t&1&&(w(0,"i",8),n(1,"span"),l(2,"Upload"),o())}function nt(t,r){if(t&1){let e=x();n(0,"div",9)(1,"div",10)(2,"POS-uppy",11),f("fileUploaded",function(i){u(e);let m=s(2);return _(m.onDropFile(i))}),o()(),n(3,"div",12)(4,"p",13),l(5," Please refer this "),n(6,"a",14),l(7,"article"),o(),l(8," for more information "),o()()()}if(t&2){let e=s(2);p(2),c("sampleUrl",e.sampleUrl())("subtitle","Accepted file formats: .csv & max file size: 1 MB"),p(4),c("href",e.articleLink(),Z)}}function ot(t,r){if(t&1&&v(0,nt,9,3,"div",9),t&2){s();let e=L(1);b(e.selectedIndex===0?0:-1)}}function rt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function lt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function at(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function pt(t,r){t&1&&(w(0,"i",15),n(1,"span"),l(2,"Preview"),o())}function mt(t,r){t&1&&Q(0)}function st(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function dt(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function ct(t,r){if(t&1&&l(0),t&2){let e=r.index;d(e+1)}}function ut(t,r){t&1&&(w(0,"i",16),n(1,"span"),l(2,"Finish"),o())}function _t(t,r){t&1&&Q(0,1)}var S=(function(t){return t[t.UPLOAD=0]="UPLOAD",t[t.PREVIEW=1]="PREVIEW",t[t.COMPLETE=2]="COMPLETE",t})(S||{}),He=(()=>{let r=class r{constructor(){this.sampleUrl=R(""),this.articleLink=R(),this._onDropFile=H({alias:"onDropFile"}),this.disabledEdit=R(!1),this._onStateChange=H({alias:"onStateChange"}),console.log("Import Stepper Component Initialized")}get stepper(){return this._stepper}nextStep(){this._stepper&&(this.stepper.selected&&(this.stepper.selected.completed=!0),this._stepper.next())}previousStep(){this._stepper&&this._stepper.previous()}resetStep(){this._stepper&&this._stepper.reset()}onStepChange(a){a.selectedIndex===1?this._onStateChange.emit(S.PREVIEW):a.selectedIndex===2?this._onStateChange.emit(S.COMPLETE):this._onStateChange.emit(S.UPLOAD)}onDropFile(a){this._onDropFile.emit(a)}onRemoveFile(){}stateUpload(){}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=y({type:r,selectors:[["pos-import-stepper"]],viewQuery:function(i,m){if(i&1&&F(Ye,5),i&2){let h;N(h=A())&&(m._stepper=h.first)}},inputs:{sampleUrl:[1,"sampleUrl"],articleLink:[1,"articleLink"],disabledEdit:[1,"disabledEdit"]},outputs:{_onDropFile:"onDropFile",_onStateChange:"onStateChange"},ngContentSelectors:Xe,decls:20,vars:7,consts:[["stepperRef",""],[3,"selectionChange","linear"],[3,"completed","editable"],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepLabel",""],["matStepContent",""],[1,"fa-solid","fa-upload","me-3"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-2"],[2,"max-width","580px"],["file","",3,"fileUploaded","sampleUrl","subtitle"],[1,"d-flex","w-100",2,"max-width","580px"],[1,"fst-italic"],["target","_blank",3,"href"],[1,"fa-regular","fa-file","me-3"],[1,"fa-solid","fa-check","me-3"]],template:function(i,m){if(i&1){let h=x();oe(Je),n(0,"mat-stepper",1,0),f("selectionChange",function(Ke){return u(h),_(m.onStepChange(Ke))}),n(2,"mat-step",2),T(3,Ze,1,1,"ng-template",3)(4,et,1,1,"ng-template",4)(5,tt,1,1,"ng-template",5)(6,it,3,0,"ng-template",6)(7,ot,1,1,"ng-template",7),o(),n(8,"mat-step",2),T(9,rt,1,1,"ng-template",3)(10,lt,1,1,"ng-template",4)(11,at,1,1,"ng-template",5)(12,pt,3,0,"ng-template",6)(13,mt,1,0,"ng-template",7),o(),n(14,"mat-step",2),T(15,st,1,1,"ng-template",3)(16,dt,1,1,"ng-template",4)(17,ct,1,1,"ng-template",5)(18,ut,3,0,"ng-template",6)(19,_t,1,0,"ng-template",7),o()()}i&2&&(c("linear",!0),p(2),c("completed",!1)("editable",!m.disabledEdit()),p(6),c("completed",!1)("editable",!m.disabledEdit()),p(6),c("completed",!1)("editable",!1))},dependencies:[xe,W,ge,Se,ve,$e,Fe,ze,We,Le,je,Re,Be],styles:[".mat-horizontal-stepper-header-container{width:50%!important;margin:0 auto} .mat-horizontal-stepper-wrapper{gap:1rem} .mat-horizontal-stepper-content{display:flex;justify-content:center} p-table .p-datatable-tbody>tr{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-thead>tr>th{font-family:Roboto,Courier,monospace;font-weight:700;font-style:normal;color:#333} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-tbody>tr>td{font-family:Roboto,Courier,monospace;font-weight:400;font-style:normal;color:#333}"]});let t=r;return t})();var j=class t{configModal=new Te;dialogRef=M(we);data=M(Ie);constructor(){this.initDialogConfig()}initDialogConfig(){this.configModal.title="Preview Summary",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.customWidth="500px"}onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["app-dialog-import-preview"]],decls:30,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"row"],[1,"col"],[1,"d-flex","flex-column","gap-2"],[2,"font-size","1.9rem"],[2,"font-size","1rem"]],template:function(e,a){e&1&&(n(0,"modal-material",0),f("onOk",function(){return a.onOk()})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),w(1,"header"),n(2,"content")(3,"div",1)(4,"div",2)(5,"h3"),l(6,"Import Summary"),o()(),n(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"span",7),l(12),g(13,"number"),o(),n(14,"span",8),l(15,"New Outlet"),o()()(),n(16,"div",5)(17,"div",6)(18,"span",7),l(19),g(20,"number"),o(),n(21,"span",8),l(22,"Update Outlet"),o()()(),n(23,"div",5)(24,"div",6)(25,"span",7),l(26),g(27,"number"),o(),n(28,"span",8),l(29,"New Outlet Group"),o()()()()()()()()),e&2&&(c("config",a.configModal),p(12),d(C(13,4,a.data==null?null:a.data.new)),p(7),d(C(20,6,a.data==null?null:a.data.update)),p(7),d(C(27,8,a.data==null?null:a.data.newOutletGroup)))},dependencies:[B,Me,ce],encapsulation:2})};var Ct=["importStepper"],ht=()=>({"min-width":"50rem"}),xt=(t,r,e)=>({"btn-success":t,"btn-outline-secondary":r,"not-allowed":e}),St=t=>({"mb-1":t});function vt(t,r){if(t&1){let e=x();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onPreviousStep())}),l(1," Back "),o()}}function bt(t,r){if(t&1){let e=x();n(0,"button",15),g(1,"async"),g(2,"async"),f("click",function(){u(e);let i=s();return _(i.onNextStep())}),l(3," Next "),o()}if(t&2){let e,a,i=s();c("ngClass",pe(6,xt,i.currentState()===1,i.currentState()!==1,!((e=C(1,2,i.importPreview$))!=null&&e.CanProceed)))("disabled",!((a=C(2,4,i.importPreview$))!=null&&a.CanProceed)&&i.currentState()===1)}}function wt(t,r){if(t&1){let e=x();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onReset())}),l(1," New "),o()}}function It(t,r){if(t&1){let e=x();n(0,"tr")(1,"th",16),l(2,"Name"),o(),n(3,"th",17),l(4,"Code"),o(),n(5,"th",18),l(6," Status "),n(7,"i",19),f("click",function(i){u(e);let m=L(9);return _(m.toggle(i))}),o(),n(8,"p-popover",null,1)(10,"div",20)(11,"div",21)(12,"p-checkbox",22),f("ngModelChange",function(i){u(e);let m=s();return _(m.selectAll(i))}),o(),n(13,"label",23),l(14,"All"),o()(),n(15,"div",24)(16,"p-checkbox",25),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(17,"label",26),l(18,"Unchanged"),o()(),n(19,"div",24)(20,"p-checkbox",27),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(21,"label",28),l(22,"New"),o()(),n(23,"div",24)(24,"p-checkbox",29),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(25,"label",30),l(26,"Error"),o()(),n(27,"div",24)(28,"p-checkbox",31),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(29,"label",32),l(30,"Update"),o()()()()(),n(31,"th"),l(32,"Message"),o()()}if(t&2){let e=s();p(12),c("ngModel",e.pickAll),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition)}}function yt(t,r){if(t&1&&(n(0,"div",33)(1,"span",34),l(2),o(),n(3,"span"),l(4),o()()),t&2){let e=r.$implicit,a=r.$index,i=s().$implicit;c("ngClass",ae(3,St,a<i.Issues.length-1)),p(2),I(" ",e.Issue,". "),p(2),I("",e.Solution," ")}}function Tt(t,r){if(t&1&&(n(0,"tr")(1,"td"),l(2),o(),n(3,"td"),l(4),o(),n(5,"td"),l(6),o(),n(7,"td"),ie(8,yt,5,5,"div",33,te),o()()),t&2){let e=r.$implicit;p(2),d(e.Name),p(2),d(e.Code),p(),re("bg-gradient-success",e.Action=="New")("bg-gradient-warning",e.Action=="Update")("bg-gradient-danger",e.Action=="Error"),p(),I(" ",e.Action," "),p(2),ne(e.Issues)}}function Mt(t,r){if(t&1&&(n(0,"div",37)(1,"span"),l(2),o(),l(3,", "),n(4,"span"),l(5),o(),n(6,"span"),l(7),o(),n(8,"span"),l(9,"succesfully imported"),o()()),t&2){let e=r;p(2),I("",e==null?null:e.Summary.NewOutlet," New Outlets"),p(3),I("",e==null?null:e.Summary.UpdateOutlet," Updated Outlets"),p(2),I("and ",e==null?null:e.Summary.NewOutletGroup," New Outlet Group")}}function Et(t,r){if(t&1&&(n(0,"div",13),w(1,"i",35),n(2,"h1",36),l(3,"Upload Complete!"),o(),v(4,Mt,10,3,"div",37),g(5,"async"),o()),t&2){let e,a=s();p(4),b((e=C(5,1,a.importPreview$))?4:-1,e)}}var qe=class t extends be{constructor(e,a){super(e);this.httpService=a;this.menuData$.subscribe()}pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];importStepper;fileToImport=V(null);importPreview$;sampleImportFileUrl=ue.files.csv.outlet_import;articleLink="https://support.dealpos.com/en/articles/11069092-import-new-outlet";currentState=V(S.UPLOAD);confirmImport$;importPreview=V(null);dialog=M(ye);onDropFile(e){this.fileToImport.set(e)}onNextStep(){switch(this.currentState()){case S.UPLOAD:this.onPreviewImport();break;case S.PREVIEW:this.onImport();break;default:break}}onPreviousStep(){this.importStepper.previousStep()}onReset(){this.importPreview.set(null),this.importPreview$=null,this.confirmImport$=null,this.fileToImport.set(null),this.currentState.update(()=>S.UPLOAD),this.importStepper.resetStep()}onStateChange(e){this.currentState.update(()=>e)}onPreviewImport(){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let e=new FormData;e.append("file",this.fileToImport()),this.importPreview$=this.httpService.postFormData(q.previewImportOutlet,e).pipe($(a=>{this.importPreview.set(a),this.importStepper.nextStep()}),z(1))}onImport(){this.confirmImport$=this.dialog.open(j,{data:{new:this.importPreview()?.Summary?.NewOutlet,update:this.importPreview()?.Summary?.UpdateOutlet,newOutletGroup:this.importPreview()?.Summary?.NewOutletGroup}}).afterClosed().pipe(Y(e=>e==!0),X(()=>this.httpService.post(q.importOutlet,{CacheKey:this.importPreview()?.CacheKey})),$(e=>{this.importStepper.nextStep()}),J(e=>(this.pickAll=[],this.filterTreeCondition=["Error"],K)),z(1))}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(a){return new(a||t)(G(Ee),G(Ce))};static \u0275cmp=y({type:t,selectors:[["app-outlet-import"]],viewQuery:function(a,i){if(a&1&&F(Ct,5),a&2){let m;N(m=A())&&(i.importStepper=m.first)}},features:[ee],decls:17,vars:21,consts:[["importStepper",""],["op",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["type","button",1,"btn","btn-outline-secondary"],[1,"btn",3,"ngClass","disabled"],["ngProjectAs","content",5,["content"]],[3,"onDropFile","onStateChange","sampleUrl","disabledEdit","articleLink"],["ngProjectAs","preview",5,["preview"]],[1,"w-100",3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["ngProjectAs","complete",5,["complete"]],[1,"d-flex","flex-column","align-items-center"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"btn",3,"click","ngClass","disabled"],[2,"width","300px"],[2,"width","200px"],[2,"width","100px"],[1,"fa","fa-filter","pointer",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","name","filterTreeCondition","value","All","inputId","all",3,"ngModelChange","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Unchanged","name","filterTreeCondition","value","Unchanged","inputId","unchanged",3,"ngModelChange","ngModel"],["for","unchanged",1,"ms-2"],["label","New","name","filterTreeCondition","value","New","inputId","new",3,"ngModelChange","ngModel"],["for","new",1,"ms-2"],["label","Error","name","filterTreeCondition","value","Error","inputId","error",3,"ngModelChange","ngModel"],["for","error",1,"ms-2"],["label","Updated","name","filterTreeCondition","value","Update","inputId","update",3,"ngModelChange","ngModel"],["for","update",1,"ms-2"],[3,"ngClass"],[1,"me-1"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"d-flex","gap-2","fw-normal","fs-4","mt-2"]],template:function(a,i){if(a&1){let m=x();n(0,"mainpanel-cmp",2),E(1,3),v(2,vt,2,0,"button",4),v(3,bt,4,10,"button",5),v(4,wt,2,0,"button",4),P(),E(5,6),n(6,"pos-import-stepper",7,0),f("onDropFile",function(U){return u(m),_(i.onDropFile(U))})("onStateChange",function(U){return u(m),_(i.onStateChange(U))}),E(8,8),n(9,"p-table",9),g(10,"async"),g(11,"filterTree"),T(12,It,33,5,"ng-template",10)(13,Tt,10,9,"ng-template",11),o(),P(),E(14,12),v(15,Et,6,3,"div",13),g(16,"async"),P(),o(),P(),o()}if(a&2){let m,h;c("pageData",i.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),b(i.currentState()==1?2:-1),p(),b(i.fileToImport()&&((m=i.fileToImport())==null?null:m.size)>0&&i.currentState()<2?3:-1),p(),b(i.currentState()===2?4:-1),p(2),c("sampleUrl",i.sampleImportFileUrl)("disabledEdit",i.currentState()===2)("articleLink",i.articleLink),p(3),c("value",me(11,15,(h=C(10,13,i.importPreview$))==null?null:h.DataRow,i.filterTreeCondition))("scrollable",!0)("tableStyle",le(20,ht)),p(6),b(C(16,18,i.confirmImport$)?15:-1)}},dependencies:[B,se,He,Ve,Ue,Ae,Ne,he,Oe,Pe,W,_e,fe,ke,De,de,Ge],encapsulation:2})};export{qe as OutletImportComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N,b as Y}from"./chunk-Y44BPSJ2.js";import"./chunk-ZQGG2REW.js";import{N as j}from"./chunk-YIUT3U63.js";import{b as V}from"./chunk-
|
|
1
|
+
import{a as N,b as Y}from"./chunk-Y44BPSJ2.js";import"./chunk-ZQGG2REW.js";import{N as j}from"./chunk-YIUT3U63.js";import{b as V}from"./chunk-BAYMY7BU.js";import"./chunk-WUV22SZ4.js";import{Bb as P,Bc as k,Db as D,Eb as w,Gb as x,Hb as b,Ia as u,Ib as y,Ic as E,Jb as o,Kb as r,Kc as M,Lb as _,Sb as F,Ud as L,Vb as S,Wd as R,Xb as m,Ya as n,Za as C,fb as h,jb as v,kc as d,kd as O,lc as T,mc as s,ua as g,va as f,wd as W,zd as I}from"./chunk-Y2L5QWEJ.js";import"./chunk-WFMAM73Y.js";import{a as c,b as p}from"./chunk-SNAKHGZS.js";var A=a=>({today:a});function B(a,e){if(a&1){let t=F();o(0,"div",6)(1,"a",11),d(2),r(),o(3,"ul",12)(4,"li")(5,"a",13),S("click",function(){g(t);let l=m();return l.isTodayFilter=!l.isTodayFilter,f(l.onChangeFilterPeriod())}),d(6),r()()()()}if(a&2){let t=m();n(2),s(" ",t.isTodayFilter?"Today":"Last 7 Days"," "),n(),y("ngClass",k(3,A,!t.isTodayFilter)),n(3),s(" ",t.isTodayFilter?"Last 7 Days":"Today"," ")}}function K(a,e){a&1&&(o(0,"span",7),d(1,"Today"),r())}function $(a,e){if(a&1&&(o(0,"div",8)(1,"div")(2,"div",14),d(3),r(),o(4,"div",15)(5,"small",16),d(6),r(),o(7,"h2",17),d(8),E(9,"number"),r()()()()),a&2){let t=e.$implicit,i=m();n(3),T(t.name),n(3),s(" ",i.dashboardConfig==null?null:i.dashboardConfig.CurrencySymbol," "),n(2),s(" ",M(9,3,t==null?null:t.value,"1.0-0")," ")}}var H=class a{constructor(e,t){this.dashboardService=e;this.role=t;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;dashboardConfig;filterPaymentWidget=new C;chartConfig;paymentData;todayPaymentData;weeklyPaymentData;isTodayFilter=!0;showPeriodFilter;ngOnChanges(e){if(e.chartData&&e.chartData.currentValue){let t=e?.chartData?.currentValue?.Series;this.initPeriodWidget(t),this.chartConfig=p(c({},this.chartConfig),{series:t,chart:p(c({},this.chartConfig.chart),{type:"spline"})}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig)}}initPeriodWidget(e){this.initWeeklyPaymentData(e),this.initDailyPaymentData(e),this.todayPaymentData.length===0?(this.isTodayFilter=!1,this.paymentData=this.weeklyPaymentData):(this.isTodayFilter=!0,this.paymentData=this.todayPaymentData),this.onChangeFilterPeriod(),this.initPeriodFilter(e)}initPeriodFilter(e){this.showPeriodFilter=e[0]?.data?.length>=7}onChangeFilterPeriod(){this.isTodayFilter?this.paymentData=this.todayPaymentData:this.paymentData=this.weeklyPaymentData,this.filterPaymentWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}initWeeklyPaymentData(e){this.weeklyPaymentData=e.map(t=>({name:t.name,value:t.data.reduce((i,l)=>i+l,0)})).sort((t,i)=>i.value-t.value).slice(0,3)}initDailyPaymentData(e){this.todayPaymentData=e.map(t=>({name:t.name,value:t?.data[t?.data?.length-1]})).sort((t,i)=>i.value-t.value).slice(0,3).filter(t=>t?.value>0)}static \u0275fac=function(t){return new(t||a)(h(N),h(V))};static \u0275cmp=v({type:a,selectors:[["app-payment-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig"},outputs:{filterPaymentWidget:"onFilter"},features:[u],decls:13,vars:2,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","PaymentChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end"],[1,"text-end","fs-5","mt-5"],["routerLink","/menu/Payment/Default/Received"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"fs-5"],[1,"d-flex","align-items-center"],[1,"me-2"],[1,"fw-normal"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"div",1),_(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),P(6,B,7,5,"div",6)(7,K,2,0,"span",7),r(),x(8,$,10,6,"div",8,w),o(10,"div",9)(11,"a",10),d(12," More "),r()()()()()),t&2&&(n(2),y("config",i.chartConfig),n(4),D(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),n(2),b(i.paymentData))},dependencies:[I,O,Y,R,L,j,W],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width: 767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width: 768px) and (max-width: 991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};export{H as PaymentWidgetComponent};
|