marketplacepos 5.48.2 → 5.48.4
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/Marketplace/{chunk-B6F5PDL5.js → chunk-222XXOAY.js} +1 -1
- package/Marketplace/{chunk-H7GV5SNI.js → chunk-27DJ3M5I.js} +1 -1
- package/Marketplace/{chunk-IDH7MCR3.js → chunk-2C2HFRNV.js} +1 -1
- package/Marketplace/{chunk-7DT7FQ2T.js → chunk-2NVWRVFF.js} +1 -1
- package/Marketplace/{chunk-J6BQDYXO.js → chunk-2VA22SO6.js} +1 -1
- package/Marketplace/{chunk-PLLHTY6O.js → chunk-4M33AWDZ.js} +1 -1
- package/Marketplace/{chunk-LABF6W37.js → chunk-4ZJFRWQN.js} +1 -1
- package/Marketplace/{chunk-DH5CXAEM.js → chunk-5AODAALH.js} +1 -1
- package/Marketplace/{chunk-2IASUYTM.js → chunk-6QQYEBL5.js} +1 -1
- package/Marketplace/{chunk-Y77WYZ6Y.js → chunk-7SLU6C27.js} +1 -1
- package/Marketplace/{chunk-7SB4C4PT.js → chunk-B2AJZWCR.js} +1 -1
- package/Marketplace/chunk-B3OCJYGA.js +1 -0
- package/Marketplace/chunk-C3PHFX5T.js +1 -0
- package/Marketplace/{chunk-CAZ7U2IL.js → chunk-CBG4WEYF.js} +1 -1
- package/Marketplace/{chunk-ALPG22RQ.js → chunk-CPZLAKWT.js} +1 -1
- package/Marketplace/{chunk-I723PUUO.js → chunk-CS6LKY4V.js} +1 -1
- package/Marketplace/{chunk-SZVL42NR.js → chunk-CY6E3XTP.js} +1 -1
- package/Marketplace/{chunk-UCEZJNIL.js → chunk-DZPJWQHG.js} +1 -1
- package/Marketplace/{chunk-AEVLZ7NS.js → chunk-FH4WODGS.js} +1 -1
- package/Marketplace/{chunk-CBU473N2.js → chunk-G2BBO6GM.js} +1 -1
- package/Marketplace/{chunk-TIIGDXIJ.js → chunk-GRC7HDKP.js} +2 -2
- package/Marketplace/{chunk-ZUL6ZHSW.js → chunk-GUL2XBWQ.js} +1 -1
- package/Marketplace/chunk-HK4GOJ73.js +1 -0
- package/Marketplace/{chunk-M65Z55OS.js → chunk-HSA2EDQG.js} +1 -1
- package/Marketplace/chunk-IDBG7TAK.js +1 -0
- package/Marketplace/{chunk-RCBY7EIY.js → chunk-IWHLLPRU.js} +1 -1
- package/Marketplace/{chunk-5CHTDUME.js → chunk-JPSDIHQS.js} +1 -1
- package/Marketplace/{chunk-5KYN6Y7M.js → chunk-K7L2HJWH.js} +1 -1
- package/Marketplace/{chunk-3JYZF65T.js → chunk-LKOXNIF6.js} +1 -1
- package/Marketplace/{chunk-GVI6GJHY.js → chunk-LO7NU25H.js} +1 -1
- package/Marketplace/{chunk-ADKAX3OO.js → chunk-M5M7T3E4.js} +1 -1
- package/Marketplace/{chunk-UBTALPOC.js → chunk-NMN7TOB5.js} +1 -1
- package/Marketplace/{chunk-CLQGGKN6.js → chunk-NRMQVYZ5.js} +1 -1
- package/Marketplace/{chunk-KZSTYKIP.js → chunk-NVVJMZYV.js} +1 -1
- package/Marketplace/{chunk-QCV5XC3U.js → chunk-OMYXR4JG.js} +2 -2
- package/Marketplace/{chunk-PZKN5FIT.js → chunk-PCKX55VF.js} +1 -1
- package/Marketplace/{chunk-HKHNRMPT.js → chunk-PMJQCWXG.js} +1 -1
- package/Marketplace/{chunk-KSVJCX2D.js → chunk-QHN4ATYC.js} +1 -1
- package/Marketplace/{chunk-FCFCTT5A.js → chunk-QHWVLA6O.js} +1 -1
- package/Marketplace/{chunk-FRZCC6KZ.js → chunk-QINDZ3K2.js} +1 -1
- package/Marketplace/chunk-QJU4F5AN.js +1 -0
- package/Marketplace/{chunk-3K2EKA5O.js → chunk-RLSTZSKZ.js} +1 -1
- package/Marketplace/{chunk-XK4RP5MQ.js → chunk-RPI2RGAE.js} +1 -1
- package/Marketplace/{chunk-6OIMOM7S.js → chunk-UDM6UTHY.js} +1 -1
- package/Marketplace/{chunk-MKADKY44.js → chunk-UXCV6LVT.js} +1 -1
- package/Marketplace/{chunk-C6JHPCLF.js → chunk-VEX4VY2R.js} +1 -1
- package/Marketplace/{chunk-T7HRAMHR.js → chunk-VX75I7HA.js} +1 -1
- package/Marketplace/{chunk-GX6JPDQ5.js → chunk-X3VCSYP4.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-YJKBQ3LW.js → main-FO3SINLF.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-5X2L45XK.js +0 -1
- package/Marketplace/chunk-VYQD3A3M.js +0 -1
- package/Marketplace/chunk-WRK3ZHRX.js +0 -1
- package/Marketplace/chunk-X6COQADC.js +0 -1
- package/Marketplace/chunk-XDBH7EGC.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-5X2E3W32.js";import{a as x}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-5X2E3W32.js";import{a as x}from"./chunk-6QQYEBL5.js";import{i as E}from"./chunk-CS6LKY4V.js";import{a as T}from"./chunk-AGBJEXIM.js";import{b as w,e as d}from"./chunk-OXWPYJNB.js";import{b as i,c as g}from"./chunk-JBEKD57G.js";import{F as D}from"./chunk-LNJUGHOX.js";import{B as U,G as C,Ha as j,J as l,g as A,ma as s,q as u,ra as p,v as I}from"./chunk-ZYJ6LAJ3.js";var H=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var R=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var V=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var z=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var y=class{};var v=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var N=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var O=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post(T.UploadPlugoProduct,t).pipe(l(e=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(E),this.productService=p(x),this.shoppeUploadService=p(H),this.tiktokUploadService=p(R),this.lazadaUploadService=p(V),this.tokopediaUploadService=p(G),this.wooUploadService=p(z),this.shopifyUploadService=p(N),this.plugoUploadService=p(O),this.toastrHandlingService=p(F),this.toastr=p(w),this.router=p(D),this.httpService=p(d),this._selectedProduct=new A(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return j(t.map(r=>{let c=new y;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==i.Shopify||r.type==i.ShopifyV2||r.type==i.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(I(r=>{let c=[];return r.filter(f=>g.IsNotEmpty(f)).forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],f=[],S=[],k=[],P=[],b=[];t.forEach(n=>{switch(n.ChannelType){case i.Shopee:r.push(n);break;case i.Tiktok:e.push(n);break;case i.Lazada:c.push(n);break;case i.Tokopedia:f.push(n);break;case i.WooCommerce:S.push(n);break;case i.Shopify:k.push(n);break;case i.ShopifyV2:P.push(n);break;case i.Plugo:b.push(n);break}});let h=[];return[{type:i.Shopee,data:r},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:k},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:b}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case i.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case i.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:h.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:h.push(this.shopifyUploadService.uploadProduct(k));break;case i.ShopifyV2:h.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:h.push(this.plugoUploadService.uploadProduct(b));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new v;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==i.Shopify||r.type==i.ShopifyV2?delete c.CategoryID:c.CategoryID=r.categoryId,c=this.generateAttributeHttpRequest(r,c),e.push(c)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let r;switch(t){case i.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:r=e;break;case i.Shopify:r=e;break;case i.ShopifyV2:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();export{H as a,R as b,V as c,z as d,Bt as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as me,b as de,c as se}from"./chunk-ILW6ZFFV.js";import{a as ue}from"./chunk-NVVJMZYV.js";import{a as P}from"./chunk-LO7NU25H.js";import{a as ce}from"./chunk-S7CKRTJV.js";import{a as le}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as pe}from"./chunk-K7L2HJWH.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as oe}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-CS6LKY4V.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as re,n as ae}from"./chunk-EDEZ3JLR.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as ie,w as ne}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as J,j as K,l as Q,m as X}from"./chunk-LNJUGHOX.js";import{$b as b,$c as q,Gb as D,Ha as F,Lc as z,Mc as l,Nc as w,Oc as x,Qc as h,Rc as S,Sc as C,Tc as A,Uc as R,Vc as H,Zc as j,_c as U,bc as V,cc as I,ec as B,fc as k,gc as f,hc as t,hd as y,ic as i,id as E,jc as _,jd as G,lb as W,nb as r,qc as M,ra as O,vc as T,xa as s,xc as g,ya as c}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as L,b as N}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=a=>({"td-cell-hover":a});function ge(a,p){if(a&1&&_(0,"variants-dropdown",31),a&2){let e=g().$implicit;f("variants",e==null?null:e.Variants)}}function he(a,p){if(a&1&&_(0,"variant-with-image",32),a&2){let e=g().$implicit;f("variant",e==null?null:e.Variants[0])}}function Se(a,p){if(a&1&&(t(0,"span"),l(1),i()),a&2){let e=g().$implicit;r(),x("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Ce(a,p){if(a&1&&(t(0,"tr")(1,"td")(2,"div",24),_(3,"img",25),y(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),_(14,"order-link",29),i(),t(15,"small"),l(16),y(17,"date"),i(),_(18,"br"),t(19,"small"),_(20,"i",30),l(21),i()()(),t(22,"td"),b(23,ge,1,1,"variants-dropdown",31)(24,he,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),y(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),b(33,Se,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),a&2){let e=p.$implicit;r(3),f("src",E(4,14,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(4),w(e.Outlet),r(3),w(e.ChannelName),r(4),f("order",e),r(2),x(" ",G(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),x(" ",e.Customer," "),r(),z(q(21,fe,(e.Variants==null?null:e.Variants.length)>1)),r(),V((e.Variants==null?null:e.Variants.length)>1?23:24),r(3),w(E(27,19,e.Amount)),r(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),V(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),r(2),x(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ve(a,p){if(a&1){let e=M();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th"),l(9,"Items"),i(),t(10,"th",21),l(11,"Amount"),i(),t(12,"th",22),l(13,"Shipping"),i()()(),t(14,"tbody"),B(15,Ce,36,23,"tr",null,I),i()(),t(17,"app-custom-paginator",23),T("next",function(){s(e);let d=g();return c(d.initShippedOrders())})("previous",function(){s(e);let d=g();return c(d.initShippedOrders())}),i()()}if(a&2){let e=g(),m=H(0);r(15),k(m),r(2),f("filter",e.filter())("totaldata",m==null?null:m.length)}}function we(a,p){a&1&&(t(0,"div",16),_(1,"app-empty-state"),i())}var je=(()=>{let p=class p{constructor(){this.orderService=O(P),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:m=>{this.initFromDate(m)},error:m=>{console.error("Error fetching default date:",m),this.initFromDate(null)}})}initFromDate(m){this.filter.update(d=>N(L({},d),{From:m})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}};p.\u0275fac=function(d){return new(d||p)},p.\u0275cmp=D({type:p,selectors:[["app-shipped"]],features:[j([P])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(d,o){if(d&1){let u=M();A(0),y(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return s(u),c(o.initShippedOrders())}),C("textChange",function(n){return s(u),S(o.filter().Number,n)||(o.filter().Number=n),c(n)}),t(3,"actions")(4,"a",1),_(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),C("ngModelChange",function(n){return s(u),S(o.filter().ListChannelID,n)||(o.filter().ListChannelID=n),c(n)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return s(u),S(o.filter().From,n)||(o.filter().From=n),c(n)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(n){return s(u),S(o.filter().To,n)||(o.filter().To=n),c(n)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(n){return s(u),S(o.filter().PageNumber,n)||(o.filter().PageNumber=n),c(n)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(n){return s(u),S(o.filter().PageSize,n)||(o.filter().PageSize=n),c(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),b(32,ve,18,2,"div",15)(33,we,2,0,"div",16),i()()()()()}if(d&2){let u=R(E(1,8,o.shippedOrders$)||U(11,_e));r(2),h("text",o.filter().Number),r(10),f("multiple",!0),h("ngModel",o.filter().ListChannelID),r(5),h("date",o.filter().From),r(2),h("date",o.filter().To),r(4),h("ngModel",o.filter().PageNumber),r(4),h("ngModel",o.filter().PageSize),r(5),V(u.length>0?32:33)}},dependencies:[X,ae,re,le,oe,te,Y,ee,Z,$,de,se,ce,ne,ie,ue,pe,J,Q,K,me],encapsulation:2});let a=p;return a})();export{je as ShippedComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _e}from"./chunk-TYQY4WPY.js";import"./chunk-IM5M2CAI.js";import{a as fe}from"./chunk-XK4RP5MQ.js";import{a as ge}from"./chunk-GG3MDS4C.js";import{a as V}from"./chunk-ISMIPSYN.js";import{c as Se,d as O,e as R}from"./chunk-S5R6MCNP.js";import{c as ue,d as Ce}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import"./chunk-DXYMG6QK.js";import"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import"./chunk-O2YF5VGD.js";import"./chunk-63I3I3MX.js";import{a as me}from"./chunk-2IASUYTM.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-6OIMOM7S.js";import{e as se}from"./chunk-6KWG6O5L.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as N}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as E}from"./chunk-AGBJEXIM.js";import{b as oe,e as re}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as _}from"./chunk-JBEKD57G.js";import{d as ce,l as pe,m as he,n as de}from"./chunk-EDEZ3JLR.js";import{A as ne,c as Z,h as $,m as ee,o as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as ae,c as le}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as X,m as Y}from"./chunk-LNJUGHOX.js";import{$b as F,$c as J,G as k,Gb as A,Ha as y,Mb as G,Mc as v,Qc as b,Rc as I,Sc as T,Tc as K,Zc as Q,bc as M,ea as H,gc as f,hc as s,hd as P,ic as d,id as w,jc as j,ma as W,nb as C,nc as z,oc as q,qc as D,ra as c,vc as S,xa as p,xc as g,ya as h}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as B,b as U}from"./chunk-66YHNWRR.js";var x=(()=>{let l=class l{constructor(){this.authService=c(N),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(n,r){let e=Object.assign([],this.channelOptions),i=[],o;return n.forEach(t=>{o=e.find(u=>u.ID==t?.parent?.id),o&&(o=U(B({},o),{Name:`${t?.parent?.label} - ${t?.label}`,LocationID:t?.id}),i.push(o))}),r.forEach(t=>{o=e.find(u=>u.ID==t.id),o&&i.push(o)}),i}generateFilterLocation(n,r){let e=[],i=[],o=[];return n.length>0?(e=n.map(t=>t.id),i=n.filter(t=>_.IsNotEmpty(t?.parent?.id)).map(t=>t?.parent?.id).filter((t,u,L)=>L.indexOf(t)===u)):(e=[],i=[]),o=r.map(t=>t.id),o=o.concat(i).filter((t,u,L)=>L.indexOf(t)===u),{locationIds:e,channelIds:o}}};l.\u0275fac=function(r){return new(r||l)},l.\u0275prov=W({token:l,factory:l.\u0275fac});let a=l;return a})();var ve=a=>[a];function be(a,l){if(a&1){let m=D();s(0,"button",17),S("click",function(){p(m);let r=g(2),e=g();return h(e.onUpdateItems(r))}),j(1,"i",18),v(2," Update "),d()}}function Ie(a,l){if(a&1&&(z(0),F(1,be,3,0,"button",16),q()),a&2){let m=g(),n=g();C(),M(n.productService.hasSelectionVariant(m)?1:-1)}}function Pe(a,l){if(a&1&&(s(0,"actions")(1,"div",14),G(2,Ie,2,1,"ng-container",15),d()()),a&2){let m=g();C(2),f("ngxPermissionsOnly",J(1,ve,m.inventoryUpdateRole))}}function we(a,l){if(a&1){let m=D();s(0,"app-table",19),S("onToggle",function(r){p(m);let e=g();return h(e.onShowDifferenceStock(r))})("onSubmit",function(r){p(m);let e=g();return h(e.updateStockByVariant(r))}),d()}if(a&2){let m=g();f("data",l)("channel",m.channels())("showProductToggle",!0)("hiddenIPOSInventory",m.searchFilter.HiddenIPOSInventory)}}var pt=(()=>{let l=class l{constructor(){this.http=c(re),this.toastr=c(oe),this.dialog=c(ce),this.productService=c(me),this.authService=c(N),this.mainPanelService=c(pe),this.placeholderService=c(ue),this.paginationService=c(O),this.multiChannelService=c(x),this.updateResHandling=c(R),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=y([]),this.selectedChannels=y([]),this.channels=y([]),this.inventoryUpdateRole=ie.InventoryUpdate,this.searchPlaceholder=y("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(H(n=>{n.Filter={PageNumber:n.Filter.PageNumber,filterModel:V.ALL,RowCount:n.Filter.PageSize,HiddenIPOSInventory:n.Filter.HiddenIPOSInventory,SearchType:n.Filter.SearchType,NumberFilterComparator:n.Filter.NumberFilterComparator},this.searchFilter=n.Filter,this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onChannelChange(n=[]){let r=n.filter(i=>_.isValidGUID(i.id)==!1),e=n.filter(i=>_.isValidGUID(i.id));this.selectedLocations.set(r),this.selectedChannels.set(e)}onSearch(n){let r=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(r);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=n,this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter)}updateStock(n,r){if(n.length>0){let e=[];n.forEach(t=>{t.Channel?.forEach(u=>{e.push({ChannelItemID:u?.ChannelItemID,ChannelVariationID:u?.ChannelVariationID,Inventory:t.Inventory,LocationID:u?.LocationID})})});let o={ListChannelID:r.filter(t=>t.selected).map(t=>t.ID),List:e};this.http.post(E.UpdateInventoryChannel,o).subscribe(t=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(n){let r=n.InventoryMultiwarehouse[0]?.LocationID,e={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:r};this.http.post(E.UpdateUpdateQuantityByItem,e).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(i)})}handlingUpdateStock(n){if(n){let r=n?.Response?.Fail_list,e=n?.Response?.Success_list;this.updateResHandling.responseHandling(e,r,"Stock")}else this.toastr.error(n?.Exception,"Error")}onShowDifferenceStock(n){n?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(n){let r=this.productService.selectedVariantProduct(n),e=this.channelOptions.filter(i=>this.channels()?.find(o=>o.ID===i.ID));this.dialog.open(ge,{data:{selectedItems:r,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(k(i=>_.IsNotEmpty(i))).subscribe(i=>{this.updateStock(r,i)})}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-multi-channel-comparison"]],features:[Q([O,x,R])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(r,e){if(r&1){let i=D();s(0,"mainpanel",0),S("onSubmit",function(t){return p(i),h(e.onSearch(t))}),F(1,Pe,3,3,"actions"),P(2,"async"),s(3,"filters"),K(4),P(5,"async"),s(6,"div",1)(7,"label",2),v(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),S("onChannelChange",function(t){return p(i),h(e.onChannelChange(t))}),d()(),s(10,"div",1)(11,"filter-query-type",4),T("numberFilterComparatorChange",function(t){return p(i),I(e.searchFilter.NumberFilterComparator,t)||(e.searchFilter.NumberFilterComparator=t),h(t)})("searchTypeChange",function(t){return p(i),I(e.searchFilter.SearchType,t)||(e.searchFilter.SearchType=t),h(t)}),d()(),s(12,"div",1)(13,"label",5),v(14,"PageNumber"),d(),s(15,"input",6),T("ngModelChange",function(t){return p(i),I(e.searchFilter.PageNumber,t)||(e.searchFilter.PageNumber=t),h(t)}),d()(),s(16,"div")(17,"label",7),v(18,"Page Size"),d(),s(19,"input",8),T("ngModelChange",function(t){return p(i),I(e.searchFilter.RowCount,t)||(e.searchFilter.RowCount=t),h(t)}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),F(24,we,1,4,"app-table",12),P(25,"async"),s(26,"infinite-paginator",13),P(27,"async"),S("onNextPage",function(){return p(i),h(e.paginationService.onNextPage(e.searchFilter))})("onLastPage",function(){return p(i),h(e.paginationService.onLastPage(e.searchFilter))})("onGetRowCount",function(){return p(i),h(e.paginationService.getRowCount(e.searchFilter))}),d()()()()()()}if(r&2){let i,o;f("hideSearchBox",!1)("searchBoxPlaceHolder",e.searchPlaceholder()),C(),M((i=w(2,17,e.paginationService.data$))?1:-1,i);let t=w(5,19,e.loader$);C(8),f("multiple",!0),C(2),f("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),b("numberFilterComparator",e.searchFilter.NumberFilterComparator),f("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),b("searchType",e.searchFilter.SearchType),C(4),b("ngModel",e.searchFilter.PageNumber),C(4),b("ngModel",e.searchFilter.RowCount),C(5),M((o=w(25,21,e.paginationService.data$))?24:-1,o),C(2),f("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",w(27,23,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage())}},dependencies:[Y,de,he,fe,ne,Z,te,$,ee,Se,_e,le,ae,se,Ce,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=l;return a})();export{pt as MultiChannelComparison};
|
|
1
|
+
import{a as _e}from"./chunk-TYQY4WPY.js";import"./chunk-IM5M2CAI.js";import{a as fe}from"./chunk-RPI2RGAE.js";import{a as ge}from"./chunk-GG3MDS4C.js";import{a as V}from"./chunk-ISMIPSYN.js";import{c as Se,d as O,e as R}from"./chunk-S5R6MCNP.js";import{c as ue,d as Ce}from"./chunk-VX75I7HA.js";import"./chunk-DAUML5UD.js";import"./chunk-DXYMG6QK.js";import"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import"./chunk-O2YF5VGD.js";import"./chunk-63I3I3MX.js";import{a as me}from"./chunk-6QQYEBL5.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-UDM6UTHY.js";import{e as se}from"./chunk-6KWG6O5L.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as N}from"./chunk-CS6LKY4V.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as E}from"./chunk-AGBJEXIM.js";import{b as oe,e as re}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as _}from"./chunk-JBEKD57G.js";import{d as ce,l as pe,m as he,n as de}from"./chunk-EDEZ3JLR.js";import{A as ne,c as Z,h as $,m as ee,o as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as ae,c as le}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as X,m as Y}from"./chunk-LNJUGHOX.js";import{$b as F,$c as J,G as k,Gb as A,Ha as y,Mb as G,Mc as v,Qc as b,Rc as I,Sc as T,Tc as K,Zc as Q,bc as M,ea as H,gc as f,hc as s,hd as P,ic as d,id as w,jc as j,ma as W,nb as C,nc as z,oc as q,qc as D,ra as c,vc as S,xa as p,xc as g,ya as h}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as B,b as U}from"./chunk-66YHNWRR.js";var x=(()=>{let l=class l{constructor(){this.authService=c(N),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(n,r){let e=Object.assign([],this.channelOptions),i=[],o;return n.forEach(t=>{o=e.find(u=>u.ID==t?.parent?.id),o&&(o=U(B({},o),{Name:`${t?.parent?.label} - ${t?.label}`,LocationID:t?.id}),i.push(o))}),r.forEach(t=>{o=e.find(u=>u.ID==t.id),o&&i.push(o)}),i}generateFilterLocation(n,r){let e=[],i=[],o=[];return n.length>0?(e=n.map(t=>t.id),i=n.filter(t=>_.IsNotEmpty(t?.parent?.id)).map(t=>t?.parent?.id).filter((t,u,L)=>L.indexOf(t)===u)):(e=[],i=[]),o=r.map(t=>t.id),o=o.concat(i).filter((t,u,L)=>L.indexOf(t)===u),{locationIds:e,channelIds:o}}};l.\u0275fac=function(r){return new(r||l)},l.\u0275prov=W({token:l,factory:l.\u0275fac});let a=l;return a})();var ve=a=>[a];function be(a,l){if(a&1){let m=D();s(0,"button",17),S("click",function(){p(m);let r=g(2),e=g();return h(e.onUpdateItems(r))}),j(1,"i",18),v(2," Update "),d()}}function Ie(a,l){if(a&1&&(z(0),F(1,be,3,0,"button",16),q()),a&2){let m=g(),n=g();C(),M(n.productService.hasSelectionVariant(m)?1:-1)}}function Pe(a,l){if(a&1&&(s(0,"actions")(1,"div",14),G(2,Ie,2,1,"ng-container",15),d()()),a&2){let m=g();C(2),f("ngxPermissionsOnly",J(1,ve,m.inventoryUpdateRole))}}function we(a,l){if(a&1){let m=D();s(0,"app-table",19),S("onToggle",function(r){p(m);let e=g();return h(e.onShowDifferenceStock(r))})("onSubmit",function(r){p(m);let e=g();return h(e.updateStockByVariant(r))}),d()}if(a&2){let m=g();f("data",l)("channel",m.channels())("showProductToggle",!0)("hiddenIPOSInventory",m.searchFilter.HiddenIPOSInventory)}}var pt=(()=>{let l=class l{constructor(){this.http=c(re),this.toastr=c(oe),this.dialog=c(ce),this.productService=c(me),this.authService=c(N),this.mainPanelService=c(pe),this.placeholderService=c(ue),this.paginationService=c(O),this.multiChannelService=c(x),this.updateResHandling=c(R),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=y([]),this.selectedChannels=y([]),this.channels=y([]),this.inventoryUpdateRole=ie.InventoryUpdate,this.searchPlaceholder=y("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(H(n=>{n.Filter={PageNumber:n.Filter.PageNumber,filterModel:V.ALL,RowCount:n.Filter.PageSize,HiddenIPOSInventory:n.Filter.HiddenIPOSInventory,SearchType:n.Filter.SearchType,NumberFilterComparator:n.Filter.NumberFilterComparator},this.searchFilter=n.Filter,this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onChannelChange(n=[]){let r=n.filter(i=>_.isValidGUID(i.id)==!1),e=n.filter(i=>_.isValidGUID(i.id));this.selectedLocations.set(r),this.selectedChannels.set(e)}onSearch(n){let r=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(r);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=n,this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter)}updateStock(n,r){if(n.length>0){let e=[];n.forEach(t=>{t.Channel?.forEach(u=>{e.push({ChannelItemID:u?.ChannelItemID,ChannelVariationID:u?.ChannelVariationID,Inventory:t.Inventory,LocationID:u?.LocationID})})});let o={ListChannelID:r.filter(t=>t.selected).map(t=>t.ID),List:e};this.http.post(E.UpdateInventoryChannel,o).subscribe(t=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(n){let r=n.InventoryMultiwarehouse[0]?.LocationID,e={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:r};this.http.post(E.UpdateUpdateQuantityByItem,e).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(i)})}handlingUpdateStock(n){if(n){let r=n?.Response?.Fail_list,e=n?.Response?.Success_list;this.updateResHandling.responseHandling(e,r,"Stock")}else this.toastr.error(n?.Exception,"Error")}onShowDifferenceStock(n){n?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(n){let r=this.productService.selectedVariantProduct(n),e=this.channelOptions.filter(i=>this.channels()?.find(o=>o.ID===i.ID));this.dialog.open(ge,{data:{selectedItems:r,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(k(i=>_.IsNotEmpty(i))).subscribe(i=>{this.updateStock(r,i)})}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-multi-channel-comparison"]],features:[Q([O,x,R])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(r,e){if(r&1){let i=D();s(0,"mainpanel",0),S("onSubmit",function(t){return p(i),h(e.onSearch(t))}),F(1,Pe,3,3,"actions"),P(2,"async"),s(3,"filters"),K(4),P(5,"async"),s(6,"div",1)(7,"label",2),v(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),S("onChannelChange",function(t){return p(i),h(e.onChannelChange(t))}),d()(),s(10,"div",1)(11,"filter-query-type",4),T("numberFilterComparatorChange",function(t){return p(i),I(e.searchFilter.NumberFilterComparator,t)||(e.searchFilter.NumberFilterComparator=t),h(t)})("searchTypeChange",function(t){return p(i),I(e.searchFilter.SearchType,t)||(e.searchFilter.SearchType=t),h(t)}),d()(),s(12,"div",1)(13,"label",5),v(14,"PageNumber"),d(),s(15,"input",6),T("ngModelChange",function(t){return p(i),I(e.searchFilter.PageNumber,t)||(e.searchFilter.PageNumber=t),h(t)}),d()(),s(16,"div")(17,"label",7),v(18,"Page Size"),d(),s(19,"input",8),T("ngModelChange",function(t){return p(i),I(e.searchFilter.RowCount,t)||(e.searchFilter.RowCount=t),h(t)}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),F(24,we,1,4,"app-table",12),P(25,"async"),s(26,"infinite-paginator",13),P(27,"async"),S("onNextPage",function(){return p(i),h(e.paginationService.onNextPage(e.searchFilter))})("onLastPage",function(){return p(i),h(e.paginationService.onLastPage(e.searchFilter))})("onGetRowCount",function(){return p(i),h(e.paginationService.getRowCount(e.searchFilter))}),d()()()()()()}if(r&2){let i,o;f("hideSearchBox",!1)("searchBoxPlaceHolder",e.searchPlaceholder()),C(),M((i=w(2,17,e.paginationService.data$))?1:-1,i);let t=w(5,19,e.loader$);C(8),f("multiple",!0),C(2),f("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),b("numberFilterComparator",e.searchFilter.NumberFilterComparator),f("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),b("searchType",e.searchFilter.SearchType),C(4),b("ngModel",e.searchFilter.PageNumber),C(4),b("ngModel",e.searchFilter.RowCount),C(5),M((o=w(25,21,e.paginationService.data$))?24:-1,o),C(2),f("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",w(27,23,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage())}},dependencies:[Y,de,he,fe,ne,Z,te,$,ee,Se,_e,le,ae,se,Ce,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=l;return a})();export{pt as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-DHPNXR6E.js";import{a as Fe}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as N}from"./chunk-ISMIPSYN.js";import{a as ve,b as be,c as Te,d as L,e as W}from"./chunk-S5R6MCNP.js";import{c as fe,d as Pe}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import{a as ye,b as we}from"./chunk-DXYMG6QK.js";import"./chunk-63I3I3MX.js";import{a as ue}from"./chunk-2IASUYTM.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{a as xe}from"./chunk-6OJQRHIZ.js";import"./chunk-6OIMOM7S.js";import{e as pe}from"./chunk-6KWG6O5L.js";import{a as Se}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as de}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as le,e as ce}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as re}from"./chunk-JBEKD57G.js";import{d as me,l as Ce,m as he,n as ge}from"./chunk-EDEZ3JLR.js";import{A as oe,b as Y,c as ee,h as te,m as ne,o as ie}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as se,c as _e}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{c as J,i as Z,l as E,m as Q,p as X}from"./chunk-LNJUGHOX.js";import{$b as h,$c as V,G as A,Gb as q,Ha as H,Mb as M,Mc as p,Nc as B,Oc as T,Qc as P,Rc as y,Sc as w,Wc as G,Z as $,Zc as K,bc as g,cc as k,ea as z,ec as O,fc as R,gc as C,hc as a,hd as v,ic as l,id as b,jc as F,jd as j,lb as D,nb as c,qc as S,ra as u,vc as x,xa as _,xc as r,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var U=o=>[o],Ie=o=>({"text-decoration-line-through":o}),De=o=>({"bg-gradient-warning":o});function Ee(o,s){if(o&1){let e=S();a(0,"button",13),x("click",function(){_(e);let t=r(),i=r(2);return d(i.updateStock(t))}),F(1,"i",14),p(2," Update "),l()}}function Me(o,s){if(o&1){let e=S();a(0,"div",8),h(1,Ee,3,0,"button",10),a(2,"button",11),x("click",function(){_(e);let t=r(2);return d(t.openExportDialog())}),F(3,"i",12),a(4,"span"),p(5,"Export"),l()()()}if(o&2){let e=r(2);c(),g(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=S();a(0,"th")(1,"input",28),x("change",function(t){_(e);let i=r(),m=r(2);return d(m.onSelectAllSKU(t.target.checked,i))}),l()()}}function ke(o,s){if(o&1){let e=S();a(0,"input",46),w("ngModelChange",function(t){_(e);let i=r(4).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),x("ngModelChange",function(){_(e);let t=r(4).$implicit,i=r(3);return d(i.onCheckboxStateProduct(t))}),l()}if(o&2){let e=r(4).$implicit;P("ngModel",e.selected)}}function Oe(o,s){if(o&1&&M(0,ke,1,1,"ng-template",22),o&2){let e=r(6);C("ngxPermissionsOnly",V(1,U,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=S();a(0,"img",47),x("click",function(t){_(e);let i=r(3).$implicit,m=r(3);return d(m.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(o&2){let e=r(3).$implicit;C("src",G(e.ThumbnailUrl),D)}}function Be(o,s){o&1&&F(0,"img",42)}function Le(o,s){if(o&1&&(a(0,"small",45),p(1),l()),o&2){let e=r(3).$implicit;c(),T("(",e.Category,")")}}function We(o,s){if(o&1&&(a(0,"td",40)(1,"div",31),h(2,Oe,1,3,null,22),a(3,"div"),h(4,Re,1,2,"img",41)(5,Be,1,0,"img",42),l()()(),a(6,"td",43)(7,"span",44),p(8),l(),h(9,Le,2,1,"small",45),l()),o&2){let e=r(2).$implicit;C("rowSpan",e.Variants.length),c(2),g((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),g(e.ThumbnailUrl?4:5),c(2),C("rowSpan",e.Variants.length),c(2),B(e.Name),c(),g(e.Category?9:-1)}}function Ue(o,s){if(o&1){let e=S();a(0,"input",50),w("ngModelChange",function(t){_(e);let i=r(2).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),l()}if(o&2){let e=r(2).$implicit;P("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(a(0,"td",48),h(1,Ue,1,1,"input",49),l()),o&2){let e=r().$implicit;c(),g(e.UnitPrice>=0?1:-1)}}function $e(o,s){o&1&&(a(0,"div",32),p(1," Not Found "),l())}function ze(o,s){if(o&1&&(a(0,"div"),p(1),v(2,"number"),l()),o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.UnitPrice)," ")}}function He(o,s){if(o&1&&(a(0,"div",33)(1,"a",36),F(2,"i",51),l()()),o&2){let e=r().$implicit,n=r(4);c(),C("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),D)}}function qe(o,s){if(o&1){let e=S();a(0,"div",52),x("click",function(){_(e);let t=r().$implicit,i=r().$implicit,m=r(2),f=r();return d(f.openTableDialog(t,i,m))}),p(1),v(2,"number"),l()}if(o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ge(o,s){if(o&1){let e=S();a(0,"tr",29),h(1,We,10,6),a(2,"td",20),p(3),l(),a(4,"td",23)(5,"span",30),p(6),l()(),M(7,Ae,2,1,"ng-template",22),a(8,"td",23)(9,"div",31),h(10,$e,2,0,"div",32),h(11,ze,3,3,"div"),h(12,He,3,1,"div",33),l()(),a(13,"td",34)(14,"div",31),h(15,qe,3,3,"div",35),a(16,"div",33)(17,"a",36),F(18,"i",37),l()(),a(19,"div",33)(20,"div",38),x("click",function(){let t=_(e).$implicit,i=r(4);return d(i.refreshPrice(t))}),F(21,"i",39),l()()()()()}if(o&2){let e=s.$implicit,n=s.$index,t=r(4);c(),g(n==0?1:-1),c(2),B(e.Model),c(2),C("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",V(12,Ie,e.Discontinued)),c(),T(" ",e.Code," "),c(),C("ngxPermissionsOnly",V(14,U,t.rolePriceEdit)),c(3),g((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),C("ngClass",V(16,De,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),c(2),g(e.Channel.length>0?15:-1),c(2),C("href",e.Channel[0]==null?null:e.Channel[0].Url,D)}}function Ke(o,s){if(o&1&&O(0,Ge,22,18,"tr",29,k),o&2){let e=s.$implicit;R(e.Variants)}}function je(o,s){if(o&1){let e=S();a(0,"div",9)(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),p(6," Product "),a(7,"div")(8,"mat-slide-toggle",19),w("ngModelChange",function(t){_(e);let i=r(2);return y(i.toggleDifferentInventory,t)||(i.toggleDifferentInventory=t),d(t)}),x("toggleChange",function(){_(e);let t=r(2);return d(t.onToggleDifferentInventory())}),a(9,"small",6),p(10,"FILTER DIFFERENT PRICE"),l()()()(),a(11,"th",20),p(12,"Variant"),l(),a(13,"th",21),p(14,"SKU"),l(),M(15,Ne,2,0,"ng-template",22),a(16,"th",23),p(17,"POS"),l(),a(18,"th",23)(19,"div",24),x("click",function(){_(e);let t=r(2);return d(t.openModalFilter())}),F(20,"img",25),a(21,"span",26),p(22),v(23,"stringLimit"),l()()()()(),a(24,"tbody"),O(25,Ke,2,0,null,null,k),l()(),a(27,"infinite-paginator",27),v(28,"async"),x("onNextPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()}if(o&2){let e=r(2);c(8),P("ngModel",e.toggleDifferentInventory),c(7),C("ngxPermissionsOnly",V(16,U,e.rolePriceEdit)),c(4),C("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),c(),C("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),c(2),T(" ",j(23,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),c(3),R(s),c(2),C("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",b(28,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=S();a(0,"mainpanel",1),w("textChange",function(t){_(e);let i=r();return y(i.searchFilter.text,t)||(i.searchFilter.text=t),d(t)}),x("onSubmit",function(){_(e);let t=r();return d(t.onSearch())}),a(1,"filters")(2,"div",2)(3,"label",3),p(4,"Channel"),l(),a(5,"app-channel-options-v2",4),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.ChannelID,t)||(i.searchFilter.ChannelID=t),d(t)}),l()(),a(6,"div",2)(7,"filter-query-type",5),w("numberFilterComparatorChange",function(t){_(e);let i=r();return y(i.searchFilter.NumberFilterComparator,t)||(i.searchFilter.NumberFilterComparator=t),d(t)})("searchTypeChange",function(t){_(e);let i=r();return y(i.searchFilter.SearchType,t)||(i.searchFilter.SearchType=t),d(t)}),l()(),a(8,"div",2)(9,"label",6),p(10,"Page Number"),l(),a(11,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),l()(),a(12,"div")(13,"label",6),p(14,"Page Size"),l(),a(15,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),l()()(),a(16,"actions"),h(17,Me,6,1,"div",8),v(18,"async"),l(),a(19,"content"),h(20,je,29,18,"div",9),v(21,"async"),l()()}if(o&2){let e,n,t=s,i=r();C("headerTitle",i.pageTitle),P("text",i.searchFilter.text),C("searchBoxPlaceHolder",i.searchPlaceholder()),c(5),P("ngModel",i.searchFilter.ChannelID),c(2),C("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),P("numberFilterComparator",i.searchFilter.NumberFilterComparator),C("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),P("searchType",i.searchFilter.SearchType),c(4),P("ngModel",i.searchFilter.PageNumber),c(4),P("ngModel",i.searchFilter.RowCount),c(2),g((e=b(18,12,i.data$))?17:-1,e),c(3),g((n=b(21,14,i.data$))?20:-1,n)}}var Nt=(()=>{let s=class s{constructor(){this.http=u(ce),this.toastr=u(le),this.dialog=u(me),this.productService=u(ue),this.biggerPictureService=u(xe),this.authService=u(de),this.mainPanelService=u(Ce),this.decimalPipe=u(E),this.placeholderService=u(fe),this.infinitePagination=u(L),this.updateResHandling=u(W),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ae.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.searchPlaceholder=H("Search ...");let n=this.authService;this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=n.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(z(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=N.ALL,this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let i=this.productService.selectedVariantProduct(n).map(f=>({ID:f.ID,ChannelID:f.Channel[0].ChannelID,Code:f.Code,Price:f.UnitPrice})),m={ListChannelID:[this.searchFilter.ChannelID],ListPrice:i};this.http.post("/api/Price/UpdateChannel",m).subscribe(f=>{this.onSearch(),this.handlingUpdateStock(f.Response)})}handlingUpdateStock(n){if(n.success_list?.length>0||n.failure_list?.length>0){let t=n.failure_list,i=n.success_list;this.updateResHandling.responseHandling(i,t,"Price")}else this.toastr.error(n[0]?.Exception,"Error")}refreshPrice(n){let t={ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(i=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(n,t,i){let m=JSON.parse(JSON.stringify(n));this.dialog.open(ve,{data:{Name:t.Name,Variant:m,ChannelID:m?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:m?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(I=>re.IsNotEmpty(I))).subscribe(I=>{this.updateItemAfterDialog(I,n)})}updateItemAfterDialog(n,t){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(m=>{let f=this.productService.findChannelById(i.ID,this.channelOptions),I=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) price in ${f.Name} to ${I}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=i.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(n=>n.ID==this.searchFilter.ChannelID)}onSelectAllSKU(n,t){t=t.map(i=>(i.Variants=i.Variants.map(m=>(m.selected=n,m)),i))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}openExportDialog(){this.dialog.open(Fe,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=q({type:s,selectors:[["app-price-single-channel"]],features:[K([L,Ve,X("https://resc.cloudinary.com/"),E,W])],decls:2,vars:3,consts:[[1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(t,i){if(t&1&&(h(0,Je,22,16,"mainpanel",0),v(1,"async")),t&2){let m;g((m=b(1,1,i.loader$))?0:-1,m)}},dependencies:[Q,J,ge,he,oe,ee,ie,Y,te,ne,Te,_e,se,we,ye,Se,pe,Pe,Z,E,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let o=s;return o})();export{Nt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as Ve}from"./chunk-DHPNXR6E.js";import{a as Fe}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as N}from"./chunk-ISMIPSYN.js";import{a as ve,b as be,c as Te,d as L,e as W}from"./chunk-S5R6MCNP.js";import{c as fe,d as Pe}from"./chunk-VX75I7HA.js";import"./chunk-DAUML5UD.js";import{a as ye,b as we}from"./chunk-DXYMG6QK.js";import"./chunk-63I3I3MX.js";import{a as ue}from"./chunk-6QQYEBL5.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{a as xe}from"./chunk-6OJQRHIZ.js";import"./chunk-UDM6UTHY.js";import{e as pe}from"./chunk-6KWG6O5L.js";import{a as Se}from"./chunk-K7L2HJWH.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as de}from"./chunk-CS6LKY4V.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as le,e as ce}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as re}from"./chunk-JBEKD57G.js";import{d as me,l as Ce,m as he,n as ge}from"./chunk-EDEZ3JLR.js";import{A as oe,b as Y,c as ee,h as te,m as ne,o as ie}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as se,c as _e}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{c as J,i as Z,l as E,m as Q,p as X}from"./chunk-LNJUGHOX.js";import{$b as h,$c as V,G as A,Gb as q,Ha as H,Mb as M,Mc as p,Nc as B,Oc as T,Qc as P,Rc as y,Sc as w,Wc as G,Z as $,Zc as K,bc as g,cc as k,ea as z,ec as O,fc as R,gc as C,hc as a,hd as v,ic as l,id as b,jc as F,jd as j,lb as D,nb as c,qc as S,ra as u,vc as x,xa as _,xc as r,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var U=o=>[o],Ie=o=>({"text-decoration-line-through":o}),De=o=>({"bg-gradient-warning":o});function Ee(o,s){if(o&1){let e=S();a(0,"button",13),x("click",function(){_(e);let t=r(),i=r(2);return d(i.updateStock(t))}),F(1,"i",14),p(2," Update "),l()}}function Me(o,s){if(o&1){let e=S();a(0,"div",8),h(1,Ee,3,0,"button",10),a(2,"button",11),x("click",function(){_(e);let t=r(2);return d(t.openExportDialog())}),F(3,"i",12),a(4,"span"),p(5,"Export"),l()()()}if(o&2){let e=r(2);c(),g(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=S();a(0,"th")(1,"input",28),x("change",function(t){_(e);let i=r(),m=r(2);return d(m.onSelectAllSKU(t.target.checked,i))}),l()()}}function ke(o,s){if(o&1){let e=S();a(0,"input",46),w("ngModelChange",function(t){_(e);let i=r(4).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),x("ngModelChange",function(){_(e);let t=r(4).$implicit,i=r(3);return d(i.onCheckboxStateProduct(t))}),l()}if(o&2){let e=r(4).$implicit;P("ngModel",e.selected)}}function Oe(o,s){if(o&1&&M(0,ke,1,1,"ng-template",22),o&2){let e=r(6);C("ngxPermissionsOnly",V(1,U,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=S();a(0,"img",47),x("click",function(t){_(e);let i=r(3).$implicit,m=r(3);return d(m.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(o&2){let e=r(3).$implicit;C("src",G(e.ThumbnailUrl),D)}}function Be(o,s){o&1&&F(0,"img",42)}function Le(o,s){if(o&1&&(a(0,"small",45),p(1),l()),o&2){let e=r(3).$implicit;c(),T("(",e.Category,")")}}function We(o,s){if(o&1&&(a(0,"td",40)(1,"div",31),h(2,Oe,1,3,null,22),a(3,"div"),h(4,Re,1,2,"img",41)(5,Be,1,0,"img",42),l()()(),a(6,"td",43)(7,"span",44),p(8),l(),h(9,Le,2,1,"small",45),l()),o&2){let e=r(2).$implicit;C("rowSpan",e.Variants.length),c(2),g((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),g(e.ThumbnailUrl?4:5),c(2),C("rowSpan",e.Variants.length),c(2),B(e.Name),c(),g(e.Category?9:-1)}}function Ue(o,s){if(o&1){let e=S();a(0,"input",50),w("ngModelChange",function(t){_(e);let i=r(2).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),l()}if(o&2){let e=r(2).$implicit;P("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(a(0,"td",48),h(1,Ue,1,1,"input",49),l()),o&2){let e=r().$implicit;c(),g(e.UnitPrice>=0?1:-1)}}function $e(o,s){o&1&&(a(0,"div",32),p(1," Not Found "),l())}function ze(o,s){if(o&1&&(a(0,"div"),p(1),v(2,"number"),l()),o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.UnitPrice)," ")}}function He(o,s){if(o&1&&(a(0,"div",33)(1,"a",36),F(2,"i",51),l()()),o&2){let e=r().$implicit,n=r(4);c(),C("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),D)}}function qe(o,s){if(o&1){let e=S();a(0,"div",52),x("click",function(){_(e);let t=r().$implicit,i=r().$implicit,m=r(2),f=r();return d(f.openTableDialog(t,i,m))}),p(1),v(2,"number"),l()}if(o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ge(o,s){if(o&1){let e=S();a(0,"tr",29),h(1,We,10,6),a(2,"td",20),p(3),l(),a(4,"td",23)(5,"span",30),p(6),l()(),M(7,Ae,2,1,"ng-template",22),a(8,"td",23)(9,"div",31),h(10,$e,2,0,"div",32),h(11,ze,3,3,"div"),h(12,He,3,1,"div",33),l()(),a(13,"td",34)(14,"div",31),h(15,qe,3,3,"div",35),a(16,"div",33)(17,"a",36),F(18,"i",37),l()(),a(19,"div",33)(20,"div",38),x("click",function(){let t=_(e).$implicit,i=r(4);return d(i.refreshPrice(t))}),F(21,"i",39),l()()()()()}if(o&2){let e=s.$implicit,n=s.$index,t=r(4);c(),g(n==0?1:-1),c(2),B(e.Model),c(2),C("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",V(12,Ie,e.Discontinued)),c(),T(" ",e.Code," "),c(),C("ngxPermissionsOnly",V(14,U,t.rolePriceEdit)),c(3),g((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),C("ngClass",V(16,De,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),c(2),g(e.Channel.length>0?15:-1),c(2),C("href",e.Channel[0]==null?null:e.Channel[0].Url,D)}}function Ke(o,s){if(o&1&&O(0,Ge,22,18,"tr",29,k),o&2){let e=s.$implicit;R(e.Variants)}}function je(o,s){if(o&1){let e=S();a(0,"div",9)(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),p(6," Product "),a(7,"div")(8,"mat-slide-toggle",19),w("ngModelChange",function(t){_(e);let i=r(2);return y(i.toggleDifferentInventory,t)||(i.toggleDifferentInventory=t),d(t)}),x("toggleChange",function(){_(e);let t=r(2);return d(t.onToggleDifferentInventory())}),a(9,"small",6),p(10,"FILTER DIFFERENT PRICE"),l()()()(),a(11,"th",20),p(12,"Variant"),l(),a(13,"th",21),p(14,"SKU"),l(),M(15,Ne,2,0,"ng-template",22),a(16,"th",23),p(17,"POS"),l(),a(18,"th",23)(19,"div",24),x("click",function(){_(e);let t=r(2);return d(t.openModalFilter())}),F(20,"img",25),a(21,"span",26),p(22),v(23,"stringLimit"),l()()()()(),a(24,"tbody"),O(25,Ke,2,0,null,null,k),l()(),a(27,"infinite-paginator",27),v(28,"async"),x("onNextPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()}if(o&2){let e=r(2);c(8),P("ngModel",e.toggleDifferentInventory),c(7),C("ngxPermissionsOnly",V(16,U,e.rolePriceEdit)),c(4),C("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),c(),C("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),c(2),T(" ",j(23,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),c(3),R(s),c(2),C("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",b(28,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=S();a(0,"mainpanel",1),w("textChange",function(t){_(e);let i=r();return y(i.searchFilter.text,t)||(i.searchFilter.text=t),d(t)}),x("onSubmit",function(){_(e);let t=r();return d(t.onSearch())}),a(1,"filters")(2,"div",2)(3,"label",3),p(4,"Channel"),l(),a(5,"app-channel-options-v2",4),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.ChannelID,t)||(i.searchFilter.ChannelID=t),d(t)}),l()(),a(6,"div",2)(7,"filter-query-type",5),w("numberFilterComparatorChange",function(t){_(e);let i=r();return y(i.searchFilter.NumberFilterComparator,t)||(i.searchFilter.NumberFilterComparator=t),d(t)})("searchTypeChange",function(t){_(e);let i=r();return y(i.searchFilter.SearchType,t)||(i.searchFilter.SearchType=t),d(t)}),l()(),a(8,"div",2)(9,"label",6),p(10,"Page Number"),l(),a(11,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),l()(),a(12,"div")(13,"label",6),p(14,"Page Size"),l(),a(15,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),l()()(),a(16,"actions"),h(17,Me,6,1,"div",8),v(18,"async"),l(),a(19,"content"),h(20,je,29,18,"div",9),v(21,"async"),l()()}if(o&2){let e,n,t=s,i=r();C("headerTitle",i.pageTitle),P("text",i.searchFilter.text),C("searchBoxPlaceHolder",i.searchPlaceholder()),c(5),P("ngModel",i.searchFilter.ChannelID),c(2),C("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),P("numberFilterComparator",i.searchFilter.NumberFilterComparator),C("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),P("searchType",i.searchFilter.SearchType),c(4),P("ngModel",i.searchFilter.PageNumber),c(4),P("ngModel",i.searchFilter.RowCount),c(2),g((e=b(18,12,i.data$))?17:-1,e),c(3),g((n=b(21,14,i.data$))?20:-1,n)}}var Nt=(()=>{let s=class s{constructor(){this.http=u(ce),this.toastr=u(le),this.dialog=u(me),this.productService=u(ue),this.biggerPictureService=u(xe),this.authService=u(de),this.mainPanelService=u(Ce),this.decimalPipe=u(E),this.placeholderService=u(fe),this.infinitePagination=u(L),this.updateResHandling=u(W),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ae.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.searchPlaceholder=H("Search ...");let n=this.authService;this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=n.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(z(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=N.ALL,this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let i=this.productService.selectedVariantProduct(n).map(f=>({ID:f.ID,ChannelID:f.Channel[0].ChannelID,Code:f.Code,Price:f.UnitPrice})),m={ListChannelID:[this.searchFilter.ChannelID],ListPrice:i};this.http.post("/api/Price/UpdateChannel",m).subscribe(f=>{this.onSearch(),this.handlingUpdateStock(f.Response)})}handlingUpdateStock(n){if(n.success_list?.length>0||n.failure_list?.length>0){let t=n.failure_list,i=n.success_list;this.updateResHandling.responseHandling(i,t,"Price")}else this.toastr.error(n[0]?.Exception,"Error")}refreshPrice(n){let t={ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(i=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(n,t,i){let m=JSON.parse(JSON.stringify(n));this.dialog.open(ve,{data:{Name:t.Name,Variant:m,ChannelID:m?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:m?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(I=>re.IsNotEmpty(I))).subscribe(I=>{this.updateItemAfterDialog(I,n)})}updateItemAfterDialog(n,t){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(m=>{let f=this.productService.findChannelById(i.ID,this.channelOptions),I=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) price in ${f.Name} to ${I}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=i.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(n=>n.ID==this.searchFilter.ChannelID)}onSelectAllSKU(n,t){t=t.map(i=>(i.Variants=i.Variants.map(m=>(m.selected=n,m)),i))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}openExportDialog(){this.dialog.open(Fe,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=q({type:s,selectors:[["app-price-single-channel"]],features:[K([L,Ve,X("https://resc.cloudinary.com/"),E,W])],decls:2,vars:3,consts:[[1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(t,i){if(t&1&&(h(0,Je,22,16,"mainpanel",0),v(1,"async")),t&2){let m;g((m=b(1,1,i.loader$))?0:-1,m)}},dependencies:[Q,J,ge,he,oe,ee,ie,Y,te,ne,Te,_e,se,we,ye,Se,pe,Pe,Z,E,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let o=s;return o})();export{Nt as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as W,b as A,c as U}from"./chunk-3JRUKSV3.js";import{a as z,b as B}from"./chunk-SJ5MC42H.js";import{b as j}from"./chunk-NWB7EVME.js";import{a as I}from"./chunk-A6QXXKPR.js";import{i as E}from"./chunk-
|
|
1
|
+
import{a as W,b as A,c as U}from"./chunk-3JRUKSV3.js";import{a as z,b as B}from"./chunk-SJ5MC42H.js";import{b as j}from"./chunk-NWB7EVME.js";import{a as I}from"./chunk-A6QXXKPR.js";import{i as E}from"./chunk-CS6LKY4V.js";import{ra as P}from"./chunk-5PMKN6PM.js";import{A as k,a as D,h as N,m as F}from"./chunk-L3W6SG2T.js";import{$b as T,Gb as V,Kb as v,Mb as _,Mc as x,Nc as S,Qc as w,Rc as b,Sc as y,Zc as O,bc as L,gc as p,hc as c,ic as u,jc as g,lb as h,nb as m,qc as f,ra as M,td as d,vc as C,xa as r,xc as a,ya as s}from"./chunk-ZYJ6LAJ3.js";function G(n,o){if(n&1&&(c(0,"div",6),g(1,"img",7),c(2,"div"),x(3),u()()),n&2){let e=o.$implicit;m(),p("src",e.logo,h),m(2),S(e.Name)}}function R(n,o){if(n&1){let e=f();c(0,"p-multiselect",4,0),C("click",function(){r(e);let i=a();return s(i.onClickSelect())}),y("ngModelChange",function(i){r(e);let l=a();return b(l.selectedChannels,i)||(l.selectedChannels=i),s(i)}),C("ngModelChange",function(i){r(e);let l=a();return s(l.onChannelChange(i))}),_(2,G,4,2,"ng-template",5),u()}if(n&2){let e=a();p("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),p("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function q(n,o){if(n&1&&(c(0,"div",6),g(1,"img",7),c(2,"div"),x(3),u()()),n&2){let e=o.$implicit;m(),p("src",e.logo,h),m(2),S(e.Name)}}function H(n,o){if(n&1){let e=f();c(0,"p-select",8,1),C("click",function(){r(e);let i=a();return s(i.onClickSelect())}),y("ngModelChange",function(i){r(e);let l=a();return b(l.selectedChannels,i)||(l.selectedChannels=i),s(i)}),C("ngModelChange",function(i){r(e);let l=a();return s(l.onChannelChange(i))}),_(2,q,4,2,"ng-template",5),u()}if(n&2){let e=a();p("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),p("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var re=(()=>{let o=class o extends U{constructor(){super(),this.authService=M(E),this.multiple=d(!1),this.clearable=d(!0),this.placeholder=d("Select Channels"),this.options=d(this.authService.getChannels()),this.maxSelectedLabels=d(6),this.onChange=t=>{}}onChannelChange(t){this.multiple()?t=t||[]:t=t||I.GuidEmpty,this.onChange(t)}onClickSelect(){this.initTopPosition(),setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(t){this.selectedChannels=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){}setDisabledState(t){}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=V({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],options:[1,"options"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[O([{provide:D,multi:!0,useExisting:o}]),v],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,l){i&1&&T(0,R,3,6,"p-multiselect",2)(1,H,3,6,"p-select",3),i&2&&L(l.multiple()?0:1)},dependencies:[B,z,P,j,k,N,F,A,W],encapsulation:2});let n=o;return n})();export{re as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as m}from"./chunk-
|
|
1
|
+
import{h as m}from"./chunk-CS6LKY4V.js";import{a as r}from"./chunk-AGBJEXIM.js";import{b as S,e as C}from"./chunk-OXWPYJNB.js";import{b as i,c as l}from"./chunk-JBEKD57G.js";import{aa as u,ea as h,ma as c,ra as s,v as p}from"./chunk-ZYJ6LAJ3.js";var b=(()=>{let n=class n{constructor(){this.httpService=s(C),this.toastr=s(S),this.tokenService=s(m)}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(u(t=>this.tokenService.refreshToken().pipe(p(o=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelType(e){let t={ChannelID:e.ID,TypeID:i.ShopifyV2};return this.httpService.post(r.UpdateChannelType,t).pipe(h(o=>{this.showTostrSuccessTestShopID(o)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=l.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var o in e)t+=o+" : "+e[o]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(p(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(o=>{window.open(o.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case i.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case i.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case i.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"});let a=n;return a})();export{b as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as f}from"./chunk-
|
|
1
|
+
import{h as f}from"./chunk-CS6LKY4V.js";import{a as n}from"./chunk-AGBJEXIM.js";import{e as m}from"./chunk-OXWPYJNB.js";import{ea as u,ma as c,ra as l,v as a}from"./chunk-ZYJ6LAJ3.js";var S=(()=>{let r=class r{constructor(){}convertToCSV(t,e){let i;if(typeof t=="string")i=t;else{var o=typeof t=="object"?t:JSON.parse(t);i=this.transformToCSVStringFormat(o)}this.downloadCSV(i,e)}transformToCSVStringFormat(t){if(!t||!t.length)return;let e=",",i=Object.keys(t[0]);return t.map(h=>i.map(d=>{let p=h[d]===null||h[d]===void 0?"":h[d];return p=p instanceof Date?p.toLocaleString():p.toString().replace(/"/g,'""'),p.search(/("|,|\n)/g)>=0&&(p=`"${p}"`),p}).join(e)).join(`
|
|
2
2
|
`)}downloadCSV(t,e){var i=new Blob([t],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(i)),o.setAttribute("download",e),document.body.appendChild(o),o.click(),document.body.removeChild(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"});let s=r;return s})();var T=(()=>{let r=class r{constructor(){this.httpService=l(m),this.tokenService=l(f),this.exportService=l(S)}getShippedOrders(t){return this.httpService.post(n.GetShipped,t).pipe(a(e=>e.Data||[]))}getReadyToShipOrders(t){return this.httpService.post(n.GetToShip,t).pipe(a(e=>e?.Data))}getCompletedOrders(t){return this.httpService.post(n.GetCompleted,t).pipe(a(e=>e?.Data||[]))}getCancelledOrders(t){return this.httpService.post(n.GetCancelled,t).pipe(a(e=>e.Data))}getAwaitingCollectionOrders(t){return this.httpService.post(n.GetAwaitingCollection,t).pipe(a(e=>e?.Data))}getOrderDefaultValue(){return this.httpService.get(n.getOrderDaysFrom).pipe(a(t=>{let e=Number(t.Days??0),i=new Date;return e===0?null:new Date(i.setDate(i.getDate()-e))}))}getAllOrders(t){return this.httpService.post(n.GetAll,t).pipe(a(e=>e.Data))}exportOrders(t,e){return this.httpService.post("api/Orders/ExportOrder",t).pipe(u(i=>{this.exportService.convertToCSV(i,e)}))}refreshShippingCourier(t,e){let i={ShopID:t,OrderNumber:e};return this.httpService.post(n.RefreshShippingCourierAndRefNumber,i)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=c({token:r,factory:r.\u0275fac});let s=r;return s})();export{T as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-4VNQYYVV.js";import{h as u}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-4VNQYYVV.js";import{h as u}from"./chunk-CS6LKY4V.js";import{b as h,d as C,i as M,j as v,k as x}from"./chunk-EDEZ3JLR.js";import{F as g}from"./chunk-LNJUGHOX.js";import{Gb as d,Mc as t,gc as f,hc as n,ic as r,jc as c,ma as m,ra as o,vc as p}from"./chunk-ZYJ6LAJ3.js";var y=(()=>{let e=class e{constructor(){this.dialogRef=o(h),this.route=o(g),this.modalConfig=new v,this.modalConfig.title="Switch to modern authorization",this.modalConfig.customWidth="450px",this.modalConfig.hideCancel=!0,this.modalConfig.headerType=M.Warning,this.modalConfig.okText="Setup"}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(),this.route.navigate(["/menu/users"])}};e.\u0275fac=function(a){return new(a||e)},e.\u0275cmp=d({type:e,selectors:[["app-modal-user-migration-confirmation"]],decls:19,vars:1,consts:[[3,"onOk","onCancel","config"],["content",""],[1,"d-flex","align-items-center","justify-content-between","gap-6"],[1,"text-center",2,"width","300px"],[1,"fa-solid","fa-users-gear","fa-6x"],[1,"lh-base"],["href","https://support.dealpos.com/en/articles/12636364-how-to-migrate-user-in-dealpos-omnichannel","target","_blank"]],template:function(a,s){a&1&&(n(0,"modal-material",0),p("onOk",function(){return s.onOk()})("onCancel",function(){return s.onClose()}),n(1,"div",1)(2,"div",2)(3,"div",3),c(4,"i",4),r(),n(5,"div",5)(6,"p"),t(7," We have introduced a new Modern Authorization, Please switch from "),n(8,"b"),t(9,"legacy"),r(),t(10," to "),n(11,"b"),t(12,"modern"),r(),t(13," authorization by inviting your users. "),r(),n(14,"div"),t(15," Please refer to this "),n(16,"a",6),t(17,"article"),r(),t(18," for more information "),r()()()()()),a&2&&f("config",s.modalConfig)},dependencies:[x],encapsulation:2});let i=e;return i})();var R=(()=>{let e=class e{constructor(){this.dialog=o(C),this.tokenService=o(u),this.dialogRef=null}openDialogMigrationConfirmation(){this.tokenService.getUser()?.AuthorizationMode===S.Legacy&&!this.dialogRef&&(this.dialogRef=this.dialog.open(y),this.dialogRef.afterClosed().subscribe(()=>{this.dialogRef=null}))}resetDialogState(){this.dialogRef&&(this.dialogRef.close(),this.dialogRef=null)}};e.\u0275fac=function(a){return new(a||e)},e.\u0275prov=m({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var q=(i,e)=>(o(R).openDialogMigrationConfirmation(),!0);export{q as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as Ft}from"./chunk-E3EBAWLJ.js";import{a as It}from"./chunk-AFIF6VRM.js";import{a as be,b as pt,c as ut,d as ye,e as ve}from"./chunk-M65Z55OS.js";import"./chunk-5X2E3W32.js";import{a as st,b as Ce,c as mt,d as ge,f as Ct,g as gt,h as Se,i as bt,o as oe}from"./chunk-ZW2TMVZP.js";import{b as vt}from"./chunk-2F4DTZCZ.js";import{a as _t}from"./chunk-36U7D4LI.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import{b as ht,d as Te}from"./chunk-FCEXPGTK.js";import{b as xt}from"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import{a as Tt,b as St}from"./chunk-O2YF5VGD.js";import{a as yt}from"./chunk-63I3I3MX.js";import"./chunk-2IASUYTM.js";import{a as ft,b as xe}from"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import{a as he}from"./chunk-4YCSITNV.js";import{a as lt,b as dt,f as ct}from"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as at}from"./chunk-FHER4TFY.js";import"./chunk-6OIMOM7S.js";import{d as G,e as Y}from"./chunk-6KWG6O5L.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as tt,e as ie}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as Ee,c as b}from"./chunk-JBEKD57G.js";import{m as nt,n as rt}from"./chunk-EDEZ3JLR.js";import{A as te,B as $,a as Je,c as ee,e as de,h as R,i as H,l as _e,m as qe,n as j,q as W,r as ze,s as X,t as Qe,u as Ze,v as et,z as K}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as it,w as ot}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as P,m as I}from"./chunk-LNJUGHOX.js";import{$ as Ge,$b as _,Ad as Ke,Gb as S,Hb as me,Hc as pe,Ic as Me,K as Re,M as $e,Mc as C,Na as N,Nc as Z,Oc as q,Qc as He,Rc as je,Sc as We,Wc as Xe,Z as Q,Zb as Ye,Zc as k,_c as ue,bc as h,ca as le,cc as U,ea as w,ec as L,f as ce,fc as B,g as Be,gc as p,hc as c,hd as F,ic as l,id as A,jc as f,ma as D,na as se,nb as s,qc as M,ra as u,sb as V,sd as fe,td as g,v as O,vc as T,xa as v,xc as d,ya as x}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e})(J||{});var ne=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(ne||{});var re=(function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e})(re||{});var De=class extends _e{setValue(o,n){if(o instanceof Date){let i=Math.floor(o.getTime()/1e3);super.setValue(i,n)}else super.setValue(o,n)}},Ne=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(K)}getAttributes(i){return this.shopeeUploadService.getAttributes(i.channelId,i.categoryId).pipe(O(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(i=[]){let t,a;return i=i.map(r=>(t=r?.multi_lang?.find(m=>m.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),r.name=t?.value?t?.value:r.name,r)),i}createFormGroup(i){let t=this.formBuilder.group({}),a=[];return i.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new _e(null),value:new _e(null,a)});t.addControl(JSON.stringify(r.attribute_id),m)}else r?.attribute_info?.input_type==J.FREE_TEXT_FILED&&r?.attribute_info?.input_validation_type==re.VALIDATOR_DATE_TYPE?t.addControl(JSON.stringify(r.attribute_id),new De(null,a)):t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(i,t){let a=JSON.parse(JSON.stringify(i)),r=Object.keys(t),m=a.filter(y=>r.findIndex(Pe=>parseInt(Pe)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,t),m}filterSelectedAttributes(i,t){return i.map(r=>{switch(r.attribute_info.input_type){case J.MULTI_COMBO_BOX:b.IsNotEmpty(t[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(m=>t[r.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):r.attribute_value_list=[];break;case J.FREE_TEXT_FILED:r.attribute_info.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):r.attribute_info.input_validation_type==re.VALIDATOR_DATE_TYPE?r.attribute_value_list=this.setSelectedDateAttr(t[r.attribute_id]):r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]);break;default:r.attribute_value_list=r.attribute_value_list.filter(m=>m.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(i,t){let a=[];if(b.IsNotEmpty(i)){let r={value_id:0,original_value_name:JSON.stringify(i)};b.IsNotEmpty(t)&&(r.value_unit=t),a=[r]}return a}setSelectedDateAttr(i){let t=[];return b.IsNotEmpty(i)&&(t=[{value_id:0,original_value_name:JSON.stringify(i)}]),t}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();var Ie=(()=>{let o=class o{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(i){this._calendarHeaderConfig.next(i)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac,providedIn:"root"});let e=o;return e})();var Ut=["class","component ts"];function Lt(e,o){if(e&1){let n=M();c(0,"button",2),T("click",function(){v(n);let t=d(2);return x(t.todayClicked())}),f(1,"i",3),l()}}function Bt(e,o){if(e&1){let n=M();c(0,"button",4),T("click",function(){v(n);let t=d(2);return x(t.clearClicked())}),f(1,"i",5),l()}}function Rt(e,o){if(e&1&&(_(0,Lt,2,0,"button",0),_(1,Bt,2,0,"button",1)),e&2){let n=o;h(n.hideBtnToday?-1:0),s(),h(n.hideBtnClear?-1:1)}}var At=(()=>{let o=class o{constructor(){this._datePicker=u(Se),this._calendar=u(gt),this._dateAdapter=u(Ce),this.calendarService=u(Ie),this._destroyed=new ce;let i=this._calendar,t=u(Ke);i.stateChanges.pipe(le(this._destroyed)).subscribe(a=>t.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(i){this._calendar.ngOnChanges(i)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Ut,decls:3,vars:3,consts:[["mat-icon-button","","title","Today"],["mat-icon-button","","title","Clear"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){if(t&1&&(c(0,"mat-calendar-header"),_(1,Rt,2,2),F(2,"async"),l()),t&2){let r;s(),h((r=A(2,1,a.calendarConfig$))?1:-1,r)}},dependencies:[ht,Ct,P],encapsulation:2});let e=o;return e})(),kt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=me({type:o}),o.\u0275inj=se({providers:[oe],imports:[I,Te,ge,oe,he,xe]});let e=o;return e})();function $t(e,o){if(e&1&&(c(0,"mat-label",2)(1,"span"),C(2),l()()),e&2){let n=d();p("show",n.placeholder),s(2),Z(n.placeholder)}}var Gt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let o=class o{set hidelClearBtn(i){this.calendarService.setHeaderConfig({hideBtnClear:i,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(i){let t=null;i&&(t=i.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(){this.calendarService=u(Ie),this.headerComponent=At,this.data_cy=g(void 0),this.appearance=g("outline"),this.width=g(void 0),this.isFloatingLabel=g(!0),this.disabled=!1,this.readOnly=g(!1),this.minDateValidation=g(void 0),this.maxDateValidation=g(void 0),this.dateChange=fe(),this.minDate=b.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(i){this.date=i}registerOnChange(i){this.onChange=i}registerOnTouched(i){}setDisabledState(i){this.disabled=i}onOpenDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["datepicker"]],inputs:{data_cy:[1,"data_cy"],placeholder:"placeholder",displayToggle:"displayToggle",appearance:[1,"appearance"],width:[1,"width"],isFloatingLabel:[1,"isFloatingLabel"],date:"date",disabled:"disabled",readOnly:[1,"readOnly"],minDateValidation:[1,"minDateValidation"],maxDateValidation:[1,"maxDateValidation"],hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[k([{provide:Ce,useClass:It,deps:[st]},{provide:mt,useValue:Gt},{provide:Je,multi:!0,useExisting:o}])],decls:7,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"]],template:function(t,a){if(t&1){let r=M();c(0,"mat-form-field",1),_(1,$t,3,2,"mat-label",2),c(2,"input",3),T("dateChange",function(y){return v(r),x(a.change(y.value))})("click",function(){v(r);let y=pe(6);return x(y.open())}),l(),c(3,"span",4),T("click",function(){v(r);let y=pe(6);return x(y.open())}),f(4,"i",5),l(),c(5,"mat-datepicker",6,0),T("opened",function(){return v(r),x(a.onOpenDatepicker())})("closed",function(){return v(r),x(a.onCloseDatepicker())}),l()()}if(t&2){let r=pe(6);Me("width",a.width()||100,"%"),p("disabled",a.disabled)("appearance",a.appearance()),s(),h(a.isFloatingLabel()&&a.placeholder?1:-1),s(),p("placeholder",Xe(a.placeholder||""))("matDatepicker",r)("min",a.minDateValidation())("max",a.maxDateValidation())("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly()),Ye("data-cy",a.data_cy()),s(),Me("display",a.displayToggle?"unset":"none"),s(2),p("calendarHeaderComponent",a.headerComponent)}},dependencies:[Se,bt,ct,lt,dt,ft],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
|
|
1
|
+
import{b as Ft}from"./chunk-E3EBAWLJ.js";import{a as It}from"./chunk-AFIF6VRM.js";import{a as be,b as pt,c as ut,d as ye,e as ve}from"./chunk-HSA2EDQG.js";import"./chunk-5X2E3W32.js";import{a as st,b as Ce,c as mt,d as ge,f as Ct,g as gt,h as Se,i as bt,o as oe}from"./chunk-ZW2TMVZP.js";import{b as vt}from"./chunk-2F4DTZCZ.js";import{a as _t}from"./chunk-36U7D4LI.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import{b as ht,d as Te}from"./chunk-FCEXPGTK.js";import{b as xt}from"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import{a as Tt,b as St}from"./chunk-O2YF5VGD.js";import{a as yt}from"./chunk-63I3I3MX.js";import"./chunk-6QQYEBL5.js";import{a as ft,b as xe}from"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import{a as he}from"./chunk-4YCSITNV.js";import{a as lt,b as dt,f as ct}from"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as at}from"./chunk-FHER4TFY.js";import"./chunk-UDM6UTHY.js";import{d as G,e as Y}from"./chunk-6KWG6O5L.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-CS6LKY4V.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as tt,e as ie}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as Ee,c as b}from"./chunk-JBEKD57G.js";import{m as nt,n as rt}from"./chunk-EDEZ3JLR.js";import{A as te,B as $,a as Je,c as ee,e as de,h as R,i as H,l as _e,m as qe,n as j,q as W,r as ze,s as X,t as Qe,u as Ze,v as et,z as K}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as it,w as ot}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as P,m as I}from"./chunk-LNJUGHOX.js";import{$ as Ge,$b as _,Ad as Ke,Gb as S,Hb as me,Hc as pe,Ic as Me,K as Re,M as $e,Mc as C,Na as N,Nc as Z,Oc as q,Qc as He,Rc as je,Sc as We,Wc as Xe,Z as Q,Zb as Ye,Zc as k,_c as ue,bc as h,ca as le,cc as U,ea as w,ec as L,f as ce,fc as B,g as Be,gc as p,hc as c,hd as F,ic as l,id as A,jc as f,ma as D,na as se,nb as s,qc as M,ra as u,sb as V,sd as fe,td as g,v as O,vc as T,xa as v,xc as d,ya as x}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e})(J||{});var ne=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(ne||{});var re=(function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e})(re||{});var De=class extends _e{setValue(o,n){if(o instanceof Date){let i=Math.floor(o.getTime()/1e3);super.setValue(i,n)}else super.setValue(o,n)}},Ne=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(K)}getAttributes(i){return this.shopeeUploadService.getAttributes(i.channelId,i.categoryId).pipe(O(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(i=[]){let t,a;return i=i.map(r=>(t=r?.multi_lang?.find(m=>m.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),r.name=t?.value?t?.value:r.name,r)),i}createFormGroup(i){let t=this.formBuilder.group({}),a=[];return i.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new _e(null),value:new _e(null,a)});t.addControl(JSON.stringify(r.attribute_id),m)}else r?.attribute_info?.input_type==J.FREE_TEXT_FILED&&r?.attribute_info?.input_validation_type==re.VALIDATOR_DATE_TYPE?t.addControl(JSON.stringify(r.attribute_id),new De(null,a)):t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(i,t){let a=JSON.parse(JSON.stringify(i)),r=Object.keys(t),m=a.filter(y=>r.findIndex(Pe=>parseInt(Pe)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,t),m}filterSelectedAttributes(i,t){return i.map(r=>{switch(r.attribute_info.input_type){case J.MULTI_COMBO_BOX:b.IsNotEmpty(t[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(m=>t[r.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):r.attribute_value_list=[];break;case J.FREE_TEXT_FILED:r.attribute_info.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):r.attribute_info.input_validation_type==re.VALIDATOR_DATE_TYPE?r.attribute_value_list=this.setSelectedDateAttr(t[r.attribute_id]):r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]);break;default:r.attribute_value_list=r.attribute_value_list.filter(m=>m.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(i,t){let a=[];if(b.IsNotEmpty(i)){let r={value_id:0,original_value_name:JSON.stringify(i)};b.IsNotEmpty(t)&&(r.value_unit=t),a=[r]}return a}setSelectedDateAttr(i){let t=[];return b.IsNotEmpty(i)&&(t=[{value_id:0,original_value_name:JSON.stringify(i)}]),t}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();var Ie=(()=>{let o=class o{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(i){this._calendarHeaderConfig.next(i)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac,providedIn:"root"});let e=o;return e})();var Ut=["class","component ts"];function Lt(e,o){if(e&1){let n=M();c(0,"button",2),T("click",function(){v(n);let t=d(2);return x(t.todayClicked())}),f(1,"i",3),l()}}function Bt(e,o){if(e&1){let n=M();c(0,"button",4),T("click",function(){v(n);let t=d(2);return x(t.clearClicked())}),f(1,"i",5),l()}}function Rt(e,o){if(e&1&&(_(0,Lt,2,0,"button",0),_(1,Bt,2,0,"button",1)),e&2){let n=o;h(n.hideBtnToday?-1:0),s(),h(n.hideBtnClear?-1:1)}}var At=(()=>{let o=class o{constructor(){this._datePicker=u(Se),this._calendar=u(gt),this._dateAdapter=u(Ce),this.calendarService=u(Ie),this._destroyed=new ce;let i=this._calendar,t=u(Ke);i.stateChanges.pipe(le(this._destroyed)).subscribe(a=>t.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(i){this._calendar.ngOnChanges(i)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Ut,decls:3,vars:3,consts:[["mat-icon-button","","title","Today"],["mat-icon-button","","title","Clear"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){if(t&1&&(c(0,"mat-calendar-header"),_(1,Rt,2,2),F(2,"async"),l()),t&2){let r;s(),h((r=A(2,1,a.calendarConfig$))?1:-1,r)}},dependencies:[ht,Ct,P],encapsulation:2});let e=o;return e})(),kt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=me({type:o}),o.\u0275inj=se({providers:[oe],imports:[I,Te,ge,oe,he,xe]});let e=o;return e})();function $t(e,o){if(e&1&&(c(0,"mat-label",2)(1,"span"),C(2),l()()),e&2){let n=d();p("show",n.placeholder),s(2),Z(n.placeholder)}}var Gt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let o=class o{set hidelClearBtn(i){this.calendarService.setHeaderConfig({hideBtnClear:i,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(i){let t=null;i&&(t=i.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(){this.calendarService=u(Ie),this.headerComponent=At,this.data_cy=g(void 0),this.appearance=g("outline"),this.width=g(void 0),this.isFloatingLabel=g(!0),this.disabled=!1,this.readOnly=g(!1),this.minDateValidation=g(void 0),this.maxDateValidation=g(void 0),this.dateChange=fe(),this.minDate=b.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(i){this.date=i}registerOnChange(i){this.onChange=i}registerOnTouched(i){}setDisabledState(i){this.disabled=i}onOpenDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["datepicker"]],inputs:{data_cy:[1,"data_cy"],placeholder:"placeholder",displayToggle:"displayToggle",appearance:[1,"appearance"],width:[1,"width"],isFloatingLabel:[1,"isFloatingLabel"],date:"date",disabled:"disabled",readOnly:[1,"readOnly"],minDateValidation:[1,"minDateValidation"],maxDateValidation:[1,"maxDateValidation"],hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[k([{provide:Ce,useClass:It,deps:[st]},{provide:mt,useValue:Gt},{provide:Je,multi:!0,useExisting:o}])],decls:7,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"]],template:function(t,a){if(t&1){let r=M();c(0,"mat-form-field",1),_(1,$t,3,2,"mat-label",2),c(2,"input",3),T("dateChange",function(y){return v(r),x(a.change(y.value))})("click",function(){v(r);let y=pe(6);return x(y.open())}),l(),c(3,"span",4),T("click",function(){v(r);let y=pe(6);return x(y.open())}),f(4,"i",5),l(),c(5,"mat-datepicker",6,0),T("opened",function(){return v(r),x(a.onOpenDatepicker())})("closed",function(){return v(r),x(a.onCloseDatepicker())}),l()()}if(t&2){let r=pe(6);Me("width",a.width()||100,"%"),p("disabled",a.disabled)("appearance",a.appearance()),s(),h(a.isFloatingLabel()&&a.placeholder?1:-1),s(),p("placeholder",Xe(a.placeholder||""))("matDatepicker",r)("min",a.minDateValidation())("max",a.maxDateValidation())("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly()),Ye("data-cy",a.data_cy()),s(),Me("display",a.displayToggle?"unset":"none"),s(2),p("calendarHeaderComponent",a.headerComponent)}},dependencies:[Se,bt,ct,lt,dt,ft],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
|
|
2
2
|
`],encapsulation:2});let e=o;return e})(),Mt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=me({type:o}),o.\u0275inj=se({providers:[oe],imports:[I,Te,ge,oe,he,xe,kt,vt]});let e=o;return e})();var Oe=()=>[];function Ht(e,o){e&1&&(c(0,"span",4),C(1,"*"),l())}function jt(e,o){if(e&1&&f(0,"ng-select",5),e&2){let n=d().$implicit;p("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:ue(4,Oe))("placeholder","Pilih "+(n==null?null:n.name))}}function Wt(e,o){if(e&1&&f(0,"input",7),e&2){let n=d(2).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function Xt(e,o){if(e&1&&(c(0,"option",14),C(1),l()),e&2){let n=o.$implicit;p("value",n),s(),Z(n)}}function Kt(e,o){if(e&1&&(c(0,"div",9),f(1,"input",11),c(2,"select",12)(3,"option",13),C(4,"Unit"),l(),L(5,Xt,2,2,"option",14,U),l()()),e&2){let n=d(3).$implicit;p("formGroupName",n.attribute_id),s(),p("placeholder","Isi "+(n==null?null:n.name)),s(2),p("value",null),s(2),B(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function Jt(e,o){if(e&1&&f(0,"input",10),e&2){let n=d(3).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function qt(e,o){if(e&1&&_(0,Kt,7,3,"div",9)(1,Jt,1,2,"input",10),e&2){let n=d(2).$implicit,i=d(2);h((n==null||n.attribute_info==null?null:n.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function zt(e,o){if(e&1&&f(0,"datepicker",8),e&2){let n=d(2).$implicit;p("formControlName",n.attribute_id)}}function Qt(e,o){if(e&1&&_(0,Wt,1,2,"input",7)(1,qt,2,1)(2,zt,1,1,"datepicker",8),e&2){let n,i=d().$implicit,t=d(2);h((n=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===t.validationType.VALIDATOR_STRING_TYPE?0:n===t.validationType.VALIDATOR_FLOAT_TYPE?1:n===t.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function Zt(e,o){if(e&1&&f(0,"ng-select",6),e&2){let n=d().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:ue(3,Oe))("placeholder","Pilih "+(n==null?null:n.name))}}function ei(e,o){if(e&1&&f(0,"ng-select",6),e&2){let n=d().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:ue(3,Oe))("placeholder","Pilih "+(n==null?null:n.name))}}function ti(e,o){if(e&1&&(c(0,"div",2)(1,"div",3),_(2,Ht,2,0,"span",4),c(3,"span"),C(4),l()(),_(5,jt,1,5,"ng-select",5)(6,Qt,3,1)(7,Zt,1,4,"ng-select",6)(8,ei,1,4,"ng-select",6),l()),e&2){let n,i=o.$implicit,t=d(2);s(2),h(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),h((n=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===t.inputType.MULTI_COMBO_BOX?5:n===t.inputType.FREE_TEXT_FILED?6:n===t.inputType.SINGLE_COMBO_BOX?7:8)}}function ii(e,o){if(e&1&&(c(0,"form",0)(1,"div",1),L(2,ti,9,3,"div",2,U),l()()),e&2){let n=d();p("formGroup",n.form),s(2),B(o)}}var Et=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ne),this.channelType=g(void 0),this.categoryId=g(void 0),this.channelId=g(void 0),this.channelProductUpload=g(void 0),this.attributesChanges=new V,this.inputType=J,this.formatType=ne,this.validationType=re}ngOnChanges(){let i=this.categoryId(),t=this.channelId();b.IsNotEmpty(i)&&b.IsNotEmpty(t)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:i,channelId:t,channelType:this.channelType()}).pipe(w(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),Q(1)))}listenToFormChange(i){let t=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{t=this.formCategoryService.getFilteredAttributes(i,a),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Ne]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(t,a){if(t&1&&(_(0,ii,4,1,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,Y,G,$,j,Ze,et,ee,Qe,R,H,W,X,ze,yt,Mt,Pt,P],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mat-icon-button-state-layer-size: 36px}"]});let e=o;return e})();var z=(function(e){return e.TIKTOK_SHOP="TIKTOK_SHOP",e.TOKOPEDIA="TOKOPEDIA",e})(z||{});var we=(()=>{let o=class o{constructor(){this.httpService=u(ie),this.formBuilder=u(K),this.uploadProductService=u(ve)}getAttributes(i,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:i},{key:"CategoryID",value:t}]).pipe(Re(r=>this.uploadProductService.selectedProduct$.pipe(O(m=>(r=this.mappingAttributeSalesProperty(r,m),r)))))}mappingAttributeSalesProperty(i,t){let a=0;return i.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(t),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(i){let t=!1,a=[];return i.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),t=a.some(r=>r>1),t}createFormGroup(i){let t=this.formBuilder.group({}),a=[];return i.forEach(r=>{a=[],r.is_required&&a.push(de.required),t.addControl(r.id,this.formBuilder.control(null,a))}),t.addControl("listingPlatform",this.formBuilder.control([z.TIKTOK_SHOP,z.TOKOPEDIA],[de.required])),t}getFilteredAttributes(i,t){let a=JSON.parse(JSON.stringify(i)),r=Object.keys(t),m=a.filter(y=>r.findIndex(Pe=>parseInt(Pe)==y.id)!=-1);return m=this.filterSelectedAttributes(m,t),m}filterSelectedAttributes(i,t){return i.map(r=>(b.IsNotEmpty(r.values)?r.is_multiple_selection?r.values=r.values.filter(m=>t[r.id]?.includes(m.id)):r.values=r.values.filter(m=>m.id==t[r.id]):t[r.id]&&(r.values=[{id:null,name:t[r.id]}]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();function oi(e,o){e&1&&(c(0,"small",5),C(1," Platform is required "),l())}function ni(e,o){e&1&&(c(0,"span",5),C(1,"*"),l())}function ri(e,o){if(e&1&&f(0,"ng-select",6),e&2){let n=d().$implicit;p("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ai(e,o){if(e&1&&f(0,"ng-select",7),e&2){let n=d().$implicit;p("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,o){if(e&1&&f(0,"input",8),e&2){let n=d().$implicit;p("formControlName",n.id)("placeholder",n==null?null:n.name)}}function di(e,o){if(e&1&&(c(0,"small",5),C(1),l()),e&2){let n=d().$implicit;s(),q(" ",n==null?null:n.name," is mandatory ")}}function ci(e,o){if(e&1&&(c(0,"div",2)(1,"div",3),_(2,ni,2,0,"span",5),c(3,"span"),C(4),l()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,1,2,"input",8),_(8,di,2,1,"small",5),l()),e&2){let n=o.$implicit;s(2),h(n.is_required?2:-1),s(2),q(" ",n==null?null:n.name," "),s(),h(n.is_multiple_selection?5:n.values!==null&&n.values.length>0?6:7),s(3),h(n.is_required?8:-1)}}function si(e,o){if(e&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),C(5," Platform Options"),l()(),f(6,"ng-select",4),_(7,oi,2,0,"small",5),l(),L(8,ci,9,4,"div",2,U),l()()),e&2){let n,i=d();p("formGroup",i.form),s(6),p("multiple",!0)("items",i.platformOptions)("clearable",!1),s(),h(!(i.form==null||(n=i.form.get("listingPlatform").errors)==null)&&n.required?7:-1),s(),B(o)}}var Dt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(we),this.channelId=g(void 0),this.categoryId=g(void 0),this.platformChange=fe({alias:"onPlatformChanges"}),this.formSubscription=new ce,this.attributesChanges=new V,this.platformOptions=[{label:"TikTok Shop",value:z.TIKTOK_SHOP},{label:"Tokopedia",value:z.TOKOPEDIA}]}ngOnChanges(){let i=this.categoryId(),t=this.channelId();b.IsNotEmpty(i)&&b.IsNotEmpty(t)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(t,i).pipe(O(a=>a.filter(r=>!(r.type=="PRODUCT_PROPERTY"&&(b.IsEmpty(r.values)||r.values?.length==0)&&r.is_customizable==!1))),w(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),Q(1)))}listenToFormChange(i){let t=[];this.form.valueChanges.pipe(le(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,t=this.tiktokAttributeFormService.getFilteredAttributes(i,a),this.attributesChanges.emit(t)}),this.form.get("listingPlatform").valueChanges.pipe(Ge(this.form.get("listingPlatform").value),le(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[k([we]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(t,a){if(t&1&&(_(0,si,10,5,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,Y,G,$,j,ee,R,H,W,X,te,P],encapsulation:2});let e=o;return e})();var Ve=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(ye)}getAttributes(i,t){return this.woocommerceUploadService.getAttributes(i,t).pipe(O(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();var Nt=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(Ve),this.channelId=g(),this.categoryId=g(),this.attributesChanges=new V}ngOnChanges(){b.IsNotEmpty(this.categoryId())&&b.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(i){this.attributesChanges.emit([i.key])}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Ve]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(t,a){t&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),C(3,"Atribut"),l(),c(4,"ng-select",3),F(5,"async"),T("change",function(m){return a.onSelectAttribute(m)}),l()()()),t&2&&(s(4),p("items",A(5,1,a.attributes$)))},dependencies:[I,te,Y,G,$,P],encapsulation:2});let e=o;return e})();var Ue=(()=>{let o=class o{constructor(){this.httpService=u(ie),this.formBuilder=u(K)}getAttributes(i,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:i},{key:"CategoryID",value:t}]).pipe(O(r=>r))}createFormGroup(i){let t=this.formBuilder.group({});return i.forEach(a=>{t.addControl(a.variant,this.formBuilder.control(null))}),t}convertAttributes(i={}){return Object.values(i).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();function mi(e,o){if(e&1&&(c(0,"div",2)(1,"div",3),C(2),l(),f(3,"ng-select",4),l()),e&2){let n=o.$implicit;s(2),q(" ",n==null?null:n.variant," "),s(),p("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function pi(e,o){if(e&1&&(c(0,"form",0)(1,"div",1),L(2,mi,4,4,"div",2,U),l()()),e&2){let n=d();p("formGroup",n.form),s(2),B(o)}}var Ot=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(Ue),this.channelId=g(void 0),this.categoryId=g(void 0),this.attributesChanges=new V}ngOnInit(){}ngOnChanges(i){let t=this.categoryId(),a=this.channelId();b.IsNotEmpty(t)&&b.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,t).pipe(w(r=>{this.form=this.tokpedAttrFormService.createFormGroup(r),this.listenToFormChange()})))}listenToFormChange(){let i=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{i=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Ue]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,a){if(t&1&&(_(0,pi,4,1,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,Y,G,$,j,R,H,W,X,P],encapsulation:2});let e=o;return e})();var Le=(()=>{let o=class o{constructor(){this.httpService=u(ie),this.formBuilder=u(K)}getAttributes(i){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:i}]).pipe(w(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(i){let t=this.formBuilder.group({});return Object.keys(i.Attribute).forEach(r=>{t.addControl(r,this.formBuilder.control(null))}),t}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();function ui(e,o){if(e&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),C(4," Brand "),l(),f(5,"input",4),l(),c(6,"div",5)(7,"div",3),C(8," Product Type "),l(),f(9,"input",6),l(),c(10,"div",5)(11,"div",3),C(12," Status "),l(),f(13,"ng-select",7),l()()()),e&2){let n=d();p("formGroup",n.form),s(13),p("items",o.Options.StatusOptions)}}var wt=(()=>{let o=class o{constructor(){this.channelId=g(void 0),this.attributesChanges=new V,this.shopifyFormService=u(Le)}ngOnChanges(i){i.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(w(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe($e(500)).subscribe(i=>{this.attributesChanges.emit([i])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Le]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,a){if(t&1&&(_(0,ui,14,2,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,$,j,ee,R,H,W,X,Y,G,P],encapsulation:2});let e=o;return e})();function fi(e,o){if(e&1&&(c(0,"div",6),f(1,"app-product-card",9),l()),e&2){let n=o.$implicit;s(),p("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("imageForZoom",n==null?null:n.ImageUrl)("code",n==null||n.Variants[0]==null?null:n.Variants[0].Code)("showFooter",!1)}}function _i(e,o){if(e&1){let n=M();c(0,"mat-checkbox",21),We("ngModelChange",function(t){v(n);let a=d().$implicit;return je(a.selected,t)||(a.selected=t),x(t)}),T("ngModelChange",function(){let t=v(n),a=d(),r=a.$implicit,m=a.$index,y=d();return x(y.onSelectChannel(r,m,t))}),l()}if(e&2){let n=d().$implicit;He("ngModel",n.selected)}}function hi(e,o){if(e&1&&(c(0,"div",18),f(1,"input",22),l()),e&2){let n=d().$implicit,i=d();p("matTooltip",n.type==i.channelType.Shopify||n.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":n.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ci(e,o){if(e&1){let n=M();c(0,"app-channel-category-select",23),T("selectedCategory",function(t){v(n);let a=d().$index,r=d();return x(r.onCategoryChange(a,t))}),l()}if(e&2){let n=d().$implicit,i=d();p("disabled",!n.selected||n.selected&&n.type==i.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function gi(e,o){if(e&1){let n=M();c(0,"shopee-attribute-form",27),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function bi(e,o){if(e&1){let n=M();c(0,"tiktok-attribute-form",28),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))})("onPlatformChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onPlatformChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,o){if(e&1){let n=M();c(0,"wooocommerce-attribute-form",29),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,o){if(e&1){let n=M();c(0,"tokopedia-attribute-form",29),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function xi(e,o){if(e&1&&(c(0,"div",20)(1,"div",24),_(2,gi,1,3,"shopee-attribute-form",25)(3,bi,1,2,"tiktok-attribute-form",26)(4,yi,1,2,"wooocommerce-attribute-form",26)(5,vi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,i=d().$implicit,t=d();s(2),h((n=i.type)===t.channelType.Shopee?2:n===t.channelType.Tiktok?3:n===t.channelType.WooCommerce?4:n===t.channelType.Tokopedia?5:-1)}}function Ti(e,o){if(e&1){let n=M();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),T("attributesChanges",function(t){v(n);let a=d().$index,r=d();return x(r.onAttributesChange(a,t))}),l()()()}if(e&2){let n=d().$implicit;s(2),p("channelId",n.id)}}function Si(e,o){if(e&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,_i,1,1,"mat-checkbox",14),F(7,"async"),l(),c(8,"div"),f(9,"app-channel-logo",15),l(),c(10,"div",16)(11,"span"),C(12),l()()()(),c(13,"div",12)(14,"div",17),_(15,hi,2,1,"div",18)(16,Ci,1,4,"app-channel-category-select",19),l()()(),_(17,xi,6,1,"div",20)(18,Ti,3,1,"div",20),l()()),e&2){let n,i=o.$implicit,t=d();s(6),h((n=A(7,8,t.defaultCategories$))?6:-1,n),s(3),p("typeId",i.type)("showChannelName",!1),s(),p("matTooltip",i.name)("matTooltipShowDelay",2500),s(2),Z(i.name),s(3),h(i.type==t.channelType.Shopify||i.type==t.channelType.Plugo||i.type==t.channelType.ShopifyV2?15:16),s(2),h(i.categoryId&&t.channelType.Lazada!=i.type&&i.selected?17:(t.channelType.Shopify==i.type||i.type==t.channelType.ShopifyV2)&&i.selected?18:-1)}}var Sr=(()=>{let o=class o{constructor(){this.toastr=u(tt),this.uploadProductService=u(ve),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ee,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Q(1))}onCategoryChange(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.categoryId=t,r.attributes=[]),r)))}onPlatformChange(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.listing_platforms=t),r)))}onAttributesChange(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.attributes=t),r)))}tiktokPlatformChanges(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.listing_platforms=t),r)))}onSelectChannel(i,t,a){this.channelProductUploads.update(r=>r.map((m,y)=>{if(y==t&&i.selected){let ke=this.findCategoryByChannelId(i.id,a);m.categoryId=ke?.DefaultCategoryID}return y==t&&!i.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(i,t){return t.find(a=>a.ID===i)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(t=>t.type==Ee.Tiktok&&b.IsNotEmpty(t?.categoryId)?t.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["app-product-upload"]],features:[k([be,pt,ut,ye])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,a){if(t&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),T("click",function(){return a.onUploadProduct()}),f(3,"i",2),C(4," Upload "),l()(),c(5,"content")(6,"div",3)(7,"h3",4),C(8,"Product To Upload"),l(),c(9,"div",5),L(10,fi,2,7,"div",6,U),F(12,"async"),l(),c(13,"h3",7),C(14,"Channel To Upload"),l(),L(15,Si,19,10,"div",8,U),l()()()),t&2){let r;p("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),p("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),s(8),B(A(12,3,a.selectedProducts$)),s(5),B(a.channelProductUploads())}},dependencies:[I,xt,rt,nt,St,Tt,at,te,R,qe,ot,it,Dt,Nt,Ot,wt,_t,Ft,Et,P],encapsulation:2});let e=o;return e})();export{Sr as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-DZPJWQHG.js";import{a as l,b as u}from"./chunk-A7PUMY67.js";import"./chunk-CS6LKY4V.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{E as m,I as s}from"./chunk-LNJUGHOX.js";import{Gb as i,gc as p,hc as c,ic as d,jc as n,nb as a}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var h=(()=>{let e=class e{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=i({type:e,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(o,f){o&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),d()()(),n(4,"router-outlet")),o&2&&(a(3),p("Tabs",f.tabs))},dependencies:[u,l,s,m],encapsulation:2});let t=e;return t})(),O=[{path:"",component:h,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-VEX4VY2R.js").then(t=>t.OrderApiComponent)},canActivate:[r],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-QINDZ3K2.js").then(t=>t.ProductApiComponent)},canActivate:[r],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-CY6E3XTP.js").then(t=>t.EscrowApiComponent)},canActivate:[r],data:{title:"Escrow API"}}]}];export{h as JsonApiComponent,O as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as _}from"./chunk-
|
|
1
|
+
import{f as _}from"./chunk-CS6LKY4V.js";import{c as a}from"./chunk-JBEKD57G.js";import{G as k,I as C}from"./chunk-LNJUGHOX.js";import{$b as I,Gb as v,Mc as u,Oc as p,ad as D,bc as g,gc as s,hc as c,ic as m,lb as b,ma as h,nb as l,od as f,ra as o,td as x,xc as d}from"./chunk-ZYJ6LAJ3.js";var y=(()=>{let e=class e{constructor(){this.localDataService=o(_),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(n){let r="";return a.IsNotEmpty(n.ID)?r=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${n.ID}`:r="/menu/Order/detail",r}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var U=(t,e)=>({Number:t,Outlet:e});function L(t,e){if(t&1&&(c(0,"a",0),u(1),m()),t&2){let i,n=d();s("href",n.baseUrl(),b),l(),p(" ",(i=n.order())==null?null:i.Number," ")}}function S(t,e){if(t&1&&(c(0,"a",1),u(1),m()),t&2){let i,n,r=d();s("routerLink",r.baseUrl())("queryParams",D(3,U,(i=r.order())==null?null:i.Number,(i=r.order())==null?null:i.Outlet)),l(),p(" ",(n=r.order())==null?null:n.Number," ")}}var z=(()=>{let e=class e{constructor(){this.order=x(),this.generateLinkService=o(y),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>a.IsNotEmpty(this.order()?.ID))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(r,N){r&1&&I(0,L,2,2,"a",0)(1,S,2,6,"a",1),r&2&&g(N.hasOrderID()?0:1)},dependencies:[C,k],encapsulation:2});let t=e;return t})();export{z as a};
|