@mercurjs/admin 2.2.0-canary.2 → 2.2.0-canary.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-OLNTDP26.js → add-campaign-promotions-BNLH6QN5.js} +4 -4
- package/dist/{adjust-inventory-CVWSBMHU.js → adjust-inventory-2LHBQAWK.js} +20 -21
- package/dist/{api-key-management-create-7RWOCVAO.js → api-key-management-create-7SIKAXEH.js} +4 -4
- package/dist/{api-key-management-detail-ZIIDMHFI.js → api-key-management-detail-R5QQPNOD.js} +23 -23
- package/dist/{api-key-management-edit-ACH6TJAX.js → api-key-management-edit-C4FYJZGH.js} +4 -4
- package/dist/{api-key-management-list-JHBBXGHH.js → api-key-management-list-FVOOICQR.js} +4 -4
- package/dist/{api-key-management-sales-channels-XEBTUB5V.js → api-key-management-sales-channels-JLSDZRG6.js} +8 -7
- package/dist/{attribute-create-2PNEX4PM.js → attribute-create-JW7OXOK2.js} +65 -44
- package/dist/{attribute-detail-3QBRIF6Q.js → attribute-detail-3Z6MTMJT.js} +25 -23
- package/dist/{attribute-edit-5G7P3LP2.js → attribute-edit-4YPWXZRX.js} +3 -3
- package/dist/{attribute-edit-possible-value-VQ7MEFZA.js → attribute-edit-possible-value-YHEWXK6L.js} +3 -3
- package/dist/{attribute-list-OHU2QMUG.js → attribute-list-WRTXTFED.js} +19 -20
- package/dist/breadcrumb-CO5DVI72.js +26 -0
- package/dist/breadcrumb-RYIHOYZE.js +27 -0
- package/dist/{campaign-budget-edit-WKSYXTBX.js → campaign-budget-edit-N2WWGO2G.js} +1 -1
- package/dist/{campaign-configuration-ZTK46EB5.js → campaign-configuration-MFFZXUEN.js} +1 -1
- package/dist/{campaign-create-VFFIIRE4.js → campaign-create-NMIOUGXQ.js} +3 -3
- package/dist/{campaign-detail-AZKBPDLC.js → campaign-detail-ROTJ4SWD.js} +22 -23
- package/dist/{campaign-edit-ZGLDY4X4.js → campaign-edit-PA7FGIY3.js} +1 -1
- package/dist/{categories-metadata-YZUP43OH.js → categories-metadata-EPKUI3R4.js} +20 -21
- package/dist/{category-create-2MRYTSYM.js → category-create-AR33DJYX.js} +8 -5
- package/dist/{category-detail-PBGZSZRK.js → category-detail-ICACLNJ3.js} +28 -27
- package/dist/{category-edit-QLOS2LBA.js → category-edit-XKANIIH5.js} +3 -3
- package/dist/category-icon-edit-4GXAK4JZ.js +117 -0
- package/dist/{category-list-U7ZQBSZN.js → category-list-PFOINLTU.js} +7 -4
- package/dist/category-media-7SLAXXXM.js +654 -0
- package/dist/{category-organize-TIKTYJFZ.js → category-organize-U6UO35Y3.js} +2 -2
- package/dist/{category-products-4V2CKLVW.js → category-products-V4H3B6ML.js} +25 -26
- package/dist/{chunk-3JSAS7QP.js → chunk-22EOFXNK.js} +16 -0
- package/dist/{chunk-GJ6WPZQG.js → chunk-2HMWS5UW.js} +4 -4
- package/dist/{chunk-BVZAGCTV.js → chunk-2L4W75VS.js} +3 -3
- package/dist/{chunk-DKMBAZ5P.js → chunk-2MYHGOPY.js} +7 -7
- package/dist/{chunk-637OFDFC.js → chunk-2NA54XKC.js} +186 -78
- package/dist/{chunk-26UTIAAZ.js → chunk-32URSQ4F.js} +1 -1
- package/dist/{chunk-CKACZXMP.js → chunk-3FN3YH2F.js} +4 -4
- package/dist/{chunk-5POK3PM3.js → chunk-3JN4WUVU.js} +4 -8
- package/dist/{chunk-XODRTI2W.js → chunk-47TXYMFT.js} +1 -1
- package/dist/chunk-4FHHNYIV.js +280 -0
- package/dist/{chunk-ZHOI4QMK.js → chunk-4OEYCLBE.js} +1 -1
- package/dist/{chunk-2LQ5SCPB.js → chunk-4Q5JHL4V.js} +18 -6
- package/dist/{chunk-HDRFPI6V.js → chunk-4UWPTSZK.js} +346 -424
- package/dist/{chunk-NXLOYMWF.js → chunk-4VXYPZMT.js} +7 -7
- package/dist/{chunk-IRTI3AS3.js → chunk-5T45PYWI.js} +4 -4
- package/dist/{chunk-DZIXC7OE.js → chunk-6FLSBL4Q.js} +30 -85
- package/dist/{chunk-3EDQIZV6.js → chunk-6LG3VL3Q.js} +2 -2
- package/dist/{chunk-2S6VXFBZ.js → chunk-6PTZK4CH.js} +4 -4
- package/dist/{chunk-6LZAVEHW.js → chunk-7JZVZ5EX.js} +2 -2
- package/dist/{chunk-P25PIADJ.js → chunk-7VPJ4C6F.js} +1 -1
- package/dist/{chunk-HRGC5JHU.js → chunk-7XBB24GO.js} +107 -411
- package/dist/{chunk-G4PROEJI.js → chunk-7ZL46D3W.js} +4 -4
- package/dist/{chunk-EJTB2SLE.js → chunk-A7RM5JXC.js} +1 -1
- package/dist/{chunk-EREXPX6I.js → chunk-AGXO2H4E.js} +23 -37
- package/dist/{chunk-UXD3VNBO.js → chunk-AJLGY3LQ.js} +1 -2
- package/dist/{chunk-WYA62MUL.js → chunk-AROCMF45.js} +1 -1
- package/dist/chunk-AWLDIHXR.js +204 -0
- package/dist/{chunk-BHOZKBYY.js → chunk-B5OMHYJ5.js} +6 -4
- package/dist/{chunk-LYZT5REU.js → chunk-C4XKPQ6T.js} +14 -1
- package/dist/{chunk-NQBSSM5V.js → chunk-CKQPO2SN.js} +2 -2
- package/dist/{chunk-54RTJBYO.js → chunk-DGCPYCHU.js} +8 -63
- package/dist/{chunk-HLPCO2OQ.js → chunk-EAC3J2Z4.js} +5 -5
- package/dist/chunk-EG45GIE3.js +368 -0
- package/dist/{chunk-TP7L6M7V.js → chunk-FBD7WJPO.js} +1 -1
- package/dist/{chunk-K4TGNN4P.js → chunk-FCLS6CKW.js} +2 -2
- package/dist/{chunk-FTAR3BDS.js → chunk-FJHAAROU.js} +1 -1
- package/dist/chunk-FNGPOGDR.js +213 -0
- package/dist/{chunk-4LXBQTFN.js → chunk-FREUYHMS.js} +1 -1
- package/dist/{chunk-Q2QFNTNX.js → chunk-FWWPSH6V.js} +1 -1
- package/dist/{chunk-PXTJJQKJ.js → chunk-FYKG35MR.js} +1 -1
- package/dist/{chunk-BAYORQYD.js → chunk-FZHLRCBV.js} +4 -4
- package/dist/{chunk-GNLPUGYK.js → chunk-GHGOOZEL.js} +2 -2
- package/dist/{chunk-ZSFJVRRS.js → chunk-GQUGCSJV.js} +2 -2
- package/dist/chunk-GVEF6UDT.js +8 -0
- package/dist/{chunk-V6OGMYAI.js → chunk-HHW4PPNH.js} +159 -169
- package/dist/{chunk-AB2LHP3M.js → chunk-HI6L7DXI.js} +1 -1
- package/dist/{chunk-TITPJHIL.js → chunk-IER5BQNC.js} +1 -1
- package/dist/{chunk-GKW445WA.js → chunk-IHTQOPB6.js} +13 -187
- package/dist/{chunk-DRJAKRTI.js → chunk-ISS4LS3E.js} +1 -1
- package/dist/{chunk-JQBSPUH2.js → chunk-J3AMUGGZ.js} +14 -1
- package/dist/chunk-JEJQKTZO.js +191 -0
- package/dist/{chunk-Y2M536WR.js → chunk-JHBNG7OD.js} +17 -0
- package/dist/{chunk-N2LH7A4X.js → chunk-JR4T4OQU.js} +10 -10
- package/dist/{chunk-WKCYMDTV.js → chunk-JRLDKKCM.js} +3 -3
- package/dist/{chunk-XFQH5HPP.js → chunk-JZBVDH6A.js} +3 -3
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-SRDK3XX7.js → chunk-KNB55WE4.js} +2 -2
- package/dist/{chunk-QABGBGAE.js → chunk-KNZ6ICKB.js} +6 -6
- package/dist/{chunk-H5PYBIOZ.js → chunk-KYFWVLWO.js} +1 -1
- package/dist/chunk-KZB7LCF2.js +82 -0
- package/dist/{chunk-BE6JLTMI.js → chunk-L5Z4JGRD.js} +1 -1
- package/dist/{chunk-CKNQJPAG.js → chunk-LEHS6RED.js} +4 -2
- package/dist/{chunk-FB7DDNCA.js → chunk-LHVXXHPO.js} +1 -1
- package/dist/{chunk-UPNMDPFX.js → chunk-LLHYICP5.js} +18 -6
- package/dist/{chunk-YGAX72XV.js → chunk-LO2ZWQGL.js} +0 -2
- package/dist/{chunk-3P4VTL4S.js → chunk-LTAQZW2L.js} +6 -6
- package/dist/{chunk-S72BD7TM.js → chunk-LYCKVPWQ.js} +12 -4
- package/dist/{chunk-2YYXP6XI.js → chunk-M2E3PKA4.js} +196 -212
- package/dist/{chunk-YLKG7W4P.js → chunk-M3YII6OB.js} +73 -20
- package/dist/{chunk-PQI4UJ6F.js → chunk-MASXQMJY.js} +3 -3
- package/dist/{chunk-6FIU2V6Y.js → chunk-MHVZVF6O.js} +1 -1
- package/dist/{chunk-H5EOOXPA.js → chunk-N6R2WOJ7.js} +1 -2
- package/dist/{chunk-ZF3WBVOB.js → chunk-NEZ35LWM.js} +3 -3
- package/dist/{chunk-QIU6DJY6.js → chunk-NZOB3LPA.js} +1 -1
- package/dist/{chunk-S5BJ5CMF.js → chunk-OKWGPKVK.js} +1 -1
- package/dist/{chunk-6GWCDARX.js → chunk-ORENI3LP.js} +3 -3
- package/dist/{chunk-AXTQMIIK.js → chunk-PJR6W35H.js} +8 -27
- package/dist/chunk-PN5C4AND.js +115 -0
- package/dist/{chunk-UXQAHUGZ.js → chunk-POSHDM4L.js} +1 -1
- package/dist/{chunk-3IVTUFBM.js → chunk-PWFZCT6H.js} +1 -1
- package/dist/chunk-PZ27H46M.js +358 -0
- package/dist/{chunk-XZZTC7E5.js → chunk-QKJGSZI2.js} +1 -1
- package/dist/{chunk-N7KTSXS5.js → chunk-QPLEFEOZ.js} +1 -1
- package/dist/chunk-QR3GYYX6.js +0 -0
- package/dist/{chunk-3B6MTW5G.js → chunk-QUHSHIAC.js} +3 -0
- package/dist/{chunk-B3EEDC47.js → chunk-RMAQKNBA.js} +10 -94
- package/dist/{chunk-ED7XNGZD.js → chunk-RWW3TAJQ.js} +4 -4
- package/dist/chunk-RXRDZ47F.js +103 -0
- package/dist/chunk-S6A4FVM2.js +170 -0
- package/dist/{chunk-XQBPW3A4.js → chunk-S6E7XAWX.js} +2 -2
- package/dist/{chunk-CBGXKU7Z.js → chunk-SEY52XON.js} +4 -4
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/{chunk-6MJ6ZSJF.js → chunk-SJKLYS3R.js} +5 -5
- package/dist/{chunk-RQPDD3RI.js → chunk-SKKF3CU6.js} +1 -1
- package/dist/{chunk-Q6I2IKJB.js → chunk-SNCZQATG.js} +2 -2
- package/dist/{chunk-BLYJZMNE.js → chunk-TLOJG7LK.js} +2 -2
- package/dist/chunk-UIVWOKWT.js +63 -0
- package/dist/chunk-UKLRBS4W.js +61 -0
- package/dist/{chunk-WS63IRBI.js → chunk-UUTACMA5.js} +6 -6
- package/dist/{chunk-BECQJZQ4.js → chunk-V3ATA433.js} +17 -8
- package/dist/{chunk-4KX6CBJ4.js → chunk-VSLHL2AZ.js} +2 -0
- package/dist/{chunk-BGGUVHDG.js → chunk-WETV577Q.js} +604 -744
- package/dist/{chunk-WDH5C2NS.js → chunk-WJGABDWC.js} +1 -1
- package/dist/{chunk-YZW5JD5A.js → chunk-WTPWO7KS.js} +116 -181
- package/dist/{chunk-A772RAKB.js → chunk-XGUUM3S6.js} +1 -1
- package/dist/chunk-XVSJKCCQ.js +142 -0
- package/dist/chunk-Y3RABQC4.js +33 -0
- package/dist/{chunk-S4SVK5DE.js → chunk-YVLANFBK.js} +29 -1
- package/dist/{chunk-OSEIN4Y2.js → chunk-Z2UBJXTU.js} +1 -1
- package/dist/{chunk-BCVUMATY.js → chunk-Z3SUMFDT.js} +7 -7
- package/dist/{chunk-OHOWEMHO.js → chunk-ZIFHQXP3.js} +31 -25
- package/dist/{chunk-U7AZOXPV.js → chunk-ZLETFDWJ.js} +205 -110
- package/dist/{collection-add-products-33MYCTBF.js → collection-add-products-PBCIG33C.js} +24 -25
- package/dist/{collection-create-HUNYHKUJ.js → collection-create-7G3MHBVQ.js} +3 -3
- package/dist/{collection-detail-ACN5GFHC.js → collection-detail-3OLBOV24.js} +24 -25
- package/dist/{collection-edit-OQGYTQDO.js → collection-edit-LQEQ6YGD.js} +3 -3
- package/dist/{collection-list-M4MFNMXL.js → collection-list-S4ICG5T6.js} +24 -25
- package/dist/{collection-metadata-47N7TUOH.js → collection-metadata-VUOECEP4.js} +20 -21
- package/dist/commission-rule-commission-edit-TA3H3EEN.js +196 -0
- package/dist/commission-rule-create-O7Z25SC7.js +412 -0
- package/dist/commission-rule-detail-I7LVSNAM.js +45 -0
- package/dist/commission-rule-edit-YSHDTYZY.js +342 -0
- package/dist/{product-brand-list-ZBPBSRQN.js → commissions-list-OUGVPED6.js} +12 -7
- package/dist/{constants-26tEckuq.d.ts → constants-Bahlh59D.d.ts} +8 -4
- package/dist/{customer-create-QHA4KM6N.js → customer-create-RW63XPQ6.js} +1 -1
- package/dist/{customer-create-address-TYWVWNUE.js → customer-create-address-SZCOIGDP.js} +1 -1
- package/dist/{customer-detail-D5SSLNFT.js → customer-detail-MT2R7DFI.js} +24 -25
- package/dist/{customer-edit-JZ4PQTIN.js → customer-edit-ZBIZ4FKT.js} +1 -1
- package/dist/{customer-group-add-customers-VJUBEN7M.js → customer-group-add-customers-SG7EU4D7.js} +1 -1
- package/dist/{customer-group-create-NA2UKCF6.js → customer-group-create-LFGY5HR6.js} +1 -1
- package/dist/{customer-group-detail-KRT7E2JA.js → customer-group-detail-MCAEXZYM.js} +18 -19
- package/dist/{customer-group-edit-3O6HAYYN.js → customer-group-edit-CXWQSMDZ.js} +1 -1
- package/dist/{customer-group-list-KKDIESQ6.js → customer-group-list-V4PW33M5.js} +18 -19
- package/dist/{customer-group-metadata-J6JY7DZ3.js → customer-group-metadata-J622TR4I.js} +20 -21
- package/dist/{customer-metadata-AH2LBK4T.js → customer-metadata-SFS5VRK5.js} +20 -21
- package/dist/{customers-add-customer-group-AHGAPEIS.js → customers-add-customer-group-G6FIKKUP.js} +19 -20
- package/dist/{edit-inventory-item-ADNLKLCN.js → edit-inventory-item-OFPVTJ4I.js} +19 -20
- package/dist/{edit-inventory-item-attributes-XVR2WLDU.js → edit-inventory-item-attributes-Z37AFIYM.js} +19 -20
- package/dist/{edit-reservation-HQQL42QX.js → edit-reservation-TBZL2REV.js} +3 -3
- package/dist/{edit-rules-YMKM5JPI.js → edit-rules-JG62MLUS.js} +20 -21
- package/dist/global-commission-edit-LCD6JJUX.js +194 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +613 -631
- package/dist/{inventory-create-IVESXFSV.js → inventory-create-3IM54ZO3.js} +23 -24
- package/dist/{inventory-detail-TINIAFVB.js → inventory-detail-POKYZVLA.js} +19 -20
- package/dist/{inventory-list-YLIAKQXI.js → inventory-list-SCRYOBZV.js} +2 -2
- package/dist/{inventory-metadata-6INRH2JC.js → inventory-metadata-XXYKRUNP.js} +20 -21
- package/dist/{inventory-stock-6YGTATID.js → inventory-stock-CXPPGARO.js} +204 -43
- package/dist/loader-S77URTQS.js +32 -0
- package/dist/loader-XPJWDZU3.js +32 -0
- package/dist/{location-create-ZMNB7YKR.js → location-create-SO2CURZL.js} +1 -1
- package/dist/{location-detail-EK2S7WOK.js → location-detail-PHT367V5.js} +21 -22
- package/dist/{location-edit-DMBF3CYZ.js → location-edit-XA53657R.js} +1 -1
- package/dist/{location-fulfillment-providers-V26OWDAI.js → location-fulfillment-providers-EZOVLJWL.js} +23 -24
- package/dist/{location-list-IV323QW2.js → location-list-HVSRDHOW.js} +20 -21
- package/dist/{location-sales-channels-EYUXMTW7.js → location-sales-channels-46SPET7R.js} +7 -6
- package/dist/{location-service-zone-create-ZS3UWJAA.js → location-service-zone-create-IOB7DWBR.js} +1 -1
- package/dist/{location-service-zone-edit-MTGU2O4C.js → location-service-zone-edit-X37BNDRP.js} +1 -1
- package/dist/{location-service-zone-manage-areas-S7QZTIFT.js → location-service-zone-manage-areas-CWWABV5M.js} +1 -1
- package/dist/{location-service-zone-shipping-option-create-36JZFRGY.js → location-service-zone-shipping-option-create-VZBL7MK6.js} +23 -24
- package/dist/{location-service-zone-shipping-option-edit-3PGSNKYT.js → location-service-zone-shipping-option-edit-WRSLBO23.js} +4 -4
- package/dist/{location-service-zone-shipping-option-pricing-JLGCOZGS.js → location-service-zone-shipping-option-pricing-FZNCTVT6.js} +8 -8
- package/dist/{login-6L3RMREO.js → login-LJMTSRAG.js} +18 -19
- package/dist/{manage-locations-CFTM6DNH.js → manage-locations-WW35SVOX.js} +1 -1
- package/dist/{marketplace-add-currencies-6ANNBGZM.js → marketplace-add-currencies-YVJA6G6V.js} +1 -1
- package/dist/{marketplace-detail-BAU2MEJT.js → marketplace-detail-WINAJJDB.js} +21 -22
- package/dist/{marketplace-edit-6Q3G2OY5.js → marketplace-edit-QNFCTDUC.js} +1 -1
- package/dist/{marketplace-metadata-KRCGKOCA.js → marketplace-metadata-CCUK2B4Q.js} +22 -23
- package/dist/offer-detail-page-2DG3W7VG.js +572 -0
- package/dist/offer-variant-detail-page-U4LDYFE3.js +143 -0
- package/dist/{offers-J2SFSNF3.js → offers-5LSNWJ6B.js} +287 -124
- package/dist/{order-create-claim-RMDDCUZ6.js → order-create-claim-2MO3LM6J.js} +271 -246
- package/dist/{order-create-edit-PQ54JFZZ.js → order-create-edit-UFD26FE2.js} +206 -111
- package/dist/{order-create-exchange-T6DBVS75.js → order-create-exchange-6IQJFYUK.js} +279 -252
- package/dist/{order-create-refund-OW3MIXBY.js → order-create-refund-DUVGD54U.js} +24 -25
- package/dist/{order-create-return-YCX6C3VP.js → order-create-return-Y7QS52UL.js} +46 -19
- package/dist/{order-detail-2OAEGBQG.js → order-detail-Y6SFV44C.js} +30 -32
- package/dist/{order-edit-billing-address-VGZBQHF5.js → order-edit-billing-address-IW6UIARN.js} +22 -23
- package/dist/{order-edit-email-OOCXVRET.js → order-edit-email-D5XIYASI.js} +21 -22
- package/dist/{order-edit-shipping-address-B4F3E5RE.js → order-edit-shipping-address-4VJDVGKJ.js} +21 -22
- package/dist/{order-list-ERQWQ6UI.js → order-list-KWHMMX2M.js} +7 -7
- package/dist/{order-metadata-AN6MPHHT.js → order-metadata-QSTGFW66.js} +21 -22
- package/dist/{order-request-transfer-A2NJSQ4H.js → order-request-transfer-GYBTSHU4.js} +21 -22
- package/dist/pages/index.d.ts +134 -339
- package/dist/pages/index.js +172 -176
- package/dist/{price-list-configuration-XAHXLCXR.js → price-list-configuration-SNL2LNV2.js} +3 -3
- package/dist/{price-list-create-XCP32SJZ.js → price-list-create-LPJWSOBP.js} +29 -30
- package/dist/{price-list-detail-26RLU4G3.js → price-list-detail-7AUDNRSM.js} +25 -26
- package/dist/{price-list-edit-ZVLD4M5T.js → price-list-edit-BOEBNVGM.js} +3 -3
- package/dist/{price-list-list-ER4TOZTY.js → price-list-list-AX7ZW6LL.js} +4 -4
- package/dist/{price-list-prices-add-H4E2IVBC.js → price-list-prices-add-5IOYBCXV.js} +28 -29
- package/dist/{price-list-prices-edit-WHCIGSB2.js → price-list-prices-edit-DT2DLFTO.js} +21 -22
- package/dist/{product-add-existing-attributes-MSJD3GOP.js → product-add-existing-attributes-LNZK2LHX.js} +65 -29
- package/dist/{product-attributes-MHRXZK5S.js → product-attributes-2LAKXXX6.js} +3 -3
- package/dist/{product-bulk-edit-J6ZP7GGM.js → product-bulk-edit-G7QTYQHG.js} +6 -8
- package/dist/{product-create-WOCQFTMZ.js → product-create-QYEZHBTC.js} +31 -32
- package/dist/{product-create-attribute-ZT3VZDNZ.js → product-create-attribute-ELMLVRUB.js} +75 -47
- package/dist/product-create-variant-FQSREC66.js +20 -0
- package/dist/{product-detail-AOMYROBE.js → product-detail-Q6YF7IYX.js} +25 -25
- package/dist/{product-edit-EKAZRIJ6.js → product-edit-3Q5E5E5L.js} +3 -5
- package/dist/product-edit-attribute-WW4LCYD7.js +175 -0
- package/dist/{product-list-J7RDCTOW.js → product-list-IDRT4WUK.js} +25 -26
- package/dist/{product-media-KREKRDOC.js → product-media-6H34CVXJ.js} +9 -8
- package/dist/{product-metadata-O3BAEUYB.js → product-metadata-VJMZL753.js} +21 -22
- package/dist/{product-organization-SBQY44IF.js → product-organization-ILQCXL7B.js} +5 -48
- package/dist/{product-sales-channels-TFOGXCMI.js → product-sales-channels-7QCAABL4.js} +7 -6
- package/dist/{product-shipping-profile-E4HJ4EYW.js → product-shipping-profile-4K7LTJ5K.js} +3 -3
- package/dist/{product-tag-create-7JBM6I3V.js → product-tag-create-4FYE46PE.js} +19 -20
- package/dist/{product-tag-detail-FCVZLJ7N.js → product-tag-detail-WF34TUQR.js} +35 -36
- package/dist/{product-tag-edit-O2ADFDD6.js → product-tag-edit-HRWMMCUC.js} +19 -20
- package/dist/{product-tag-list-N44OW4BR.js → product-tag-list-PK43EMMH.js} +35 -36
- package/dist/{product-tag-metadata-SBOUTUXY.js → product-tag-metadata-ONSEQTEW.js} +20 -21
- package/dist/{product-type-create-RHG4KEAV.js → product-type-create-A7SUR2OX.js} +1 -1
- package/dist/{product-type-detail-II4RYMUP.js → product-type-detail-J466AJUQ.js} +25 -26
- package/dist/{product-type-edit-CABB7R7Y.js → product-type-edit-DM4U2VB4.js} +1 -1
- package/dist/{product-type-metadata-KN5OXR6J.js → product-type-metadata-CXYKP2OF.js} +21 -22
- package/dist/{product-variant-detail-H2YRFDAU.js → product-variant-detail-FXQZLB7Q.js} +23 -33
- package/dist/{product-variant-edit-3HKWOCHQ.js → product-variant-edit-CYEISGII.js} +170 -261
- package/dist/{product-variant-metadata-QESZ7VS2.js → product-variant-metadata-YQ2GKWW7.js} +20 -21
- package/dist/{profile-edit-HQTWYWZ7.js → profile-edit-H5QZ66PF.js} +1 -1
- package/dist/{promotion-add-campaign-O3RTMS3W.js → promotion-add-campaign-V3RJ634F.js} +4 -4
- package/dist/{promotion-create-TGC6BVWF.js → promotion-create-KNK57JWD.js} +24 -25
- package/dist/{promotion-detail-VYIXZMMD.js → promotion-detail-EUQ5LK2V.js} +21 -22
- package/dist/{promotion-edit-details-TKRC5HES.js → promotion-edit-details-NWOBD3YD.js} +1 -1
- package/dist/{promotion-list-C3SKV5BJ.js → promotion-list-M5SAE7A3.js} +4 -4
- package/dist/{refund-reason-create-2KEQFOID.js → refund-reason-create-ANAVZO2N.js} +19 -20
- package/dist/{refund-reason-edit-E7CB7SM3.js → refund-reason-edit-HKEVJ6A5.js} +19 -20
- package/dist/{refund-reason-list-CB2FZPDK.js → refund-reason-list-FBH43XVP.js} +32 -33
- package/dist/{region-add-countries-COXN4LP3.js → region-add-countries-5I2UDAJU.js} +1 -1
- package/dist/{region-create-P66Q65XY.js → region-create-SIB6WZPV.js} +1 -1
- package/dist/{region-edit-XFE54SAO.js → region-edit-YQZCZIX3.js} +1 -1
- package/dist/region-list-2XXKCDDX.js +1 -1
- package/dist/{region-metadata-723RQGHS.js → region-metadata-XHT3A6D7.js} +23 -24
- package/dist/{reservation-create-Y3HG4AZA.js → reservation-create-F6YDCLCG.js} +3 -3
- package/dist/{reservation-detail-HQMADZ56.js → reservation-detail-T3VHDWP6.js} +20 -21
- package/dist/{reservation-list-YKC3JJ6K.js → reservation-list-RGD6O4RY.js} +3 -3
- package/dist/{reservation-metadata-UG4YTEMY.js → reservation-metadata-4LVLM4UW.js} +21 -22
- package/dist/{reset-password-2VNU52CE.js → reset-password-RF5J4RIU.js} +1 -1
- package/dist/{return-reason-create-KED7446I.js → return-reason-create-G7ON7U3A.js} +1 -1
- package/dist/{return-reason-edit-57EU3XSE.js → return-reason-edit-77RVRFF6.js} +1 -1
- package/dist/{return-reason-list-47DFQ3NX.js → return-reason-list-4JWWSFOS.js} +16 -16
- package/dist/{sales-channel-add-products-KKU2AR5R.js → sales-channel-add-products-FNJQKCQQ.js} +24 -25
- package/dist/{sales-channel-create-BSNCLZWR.js → sales-channel-create-TAKKGGK3.js} +3 -3
- package/dist/{sales-channel-detail-5WPD5VKT.js → sales-channel-detail-HXJAR6M4.js} +24 -25
- package/dist/{sales-channel-edit-FUDXMZYV.js → sales-channel-edit-HEESIKZH.js} +3 -3
- package/dist/{sales-channel-list-GYLGH4U7.js → sales-channel-list-YYIH254X.js} +23 -23
- package/dist/{sales-channel-metadata-H6RSHKVP.js → sales-channel-metadata-YF5AV2XX.js} +20 -21
- package/dist/{shipping-option-type-create-QAOW7753.js → shipping-option-type-create-TOONS7EC.js} +19 -20
- package/dist/{shipping-option-type-detail-QGWVDTDU.js → shipping-option-type-detail-VXZ4UQQI.js} +20 -21
- package/dist/{shipping-option-type-edit-WXYBDRNY.js → shipping-option-type-edit-6WO2XRLE.js} +19 -20
- package/dist/{shipping-option-type-list-YSWP6DSC.js → shipping-option-type-list-S7TW7Q3R.js} +20 -21
- package/dist/{shipping-profile-create-UJNCCKKK.js → shipping-profile-create-JYRXTOBF.js} +1 -1
- package/dist/{shipping-profile-metadata-UE53IA3J.js → shipping-profile-metadata-SVD3WK7H.js} +21 -22
- package/dist/{store-address-edit-PKIBRFH4.js → store-address-edit-SWLACMPC.js} +1 -1
- package/dist/{store-bulk-edit-6SQX7OV2.js → store-bulk-edit-JAOT5GY2.js} +3 -3
- package/dist/{store-closure-edit-OK7MTUHY.js → store-closure-edit-Y3FOCDRX.js} +1 -1
- package/dist/{store-create-WNFRHXWR.js → store-create-7A5OSRIV.js} +23 -24
- package/dist/{store-details-RS3SPTXC.js → store-details-LSGSI4QU.js} +30 -45
- package/dist/{store-edit-34CPYPM3.js → store-edit-TP5CQHV7.js} +8 -8
- package/dist/{store-list-Q5X3JB3R.js → store-list-KQGPNQQ4.js} +24 -25
- package/dist/{store-member-invite-7PAPHDOK.js → store-member-invite-MNRTPHUB.js} +2 -2
- package/dist/{store-payment-details-edit-HOGHZMZC.js → store-payment-details-edit-DF2WURRI.js} +1 -1
- package/dist/{store-professional-details-edit-DPJ4ZFDR.js → store-professional-details-edit-FPOLORSE.js} +1 -1
- package/dist/{tax-region-create-3KVECMFN.js → tax-region-create-JR7OHOJ5.js} +20 -21
- package/dist/{tax-region-detail-AOT4X4DZ.js → tax-region-detail-2E56T5C2.js} +23 -24
- package/dist/{tax-region-edit-5T7VHKIA.js → tax-region-edit-7SBQFGPY.js} +19 -20
- package/dist/{tax-region-metadata-RSZCJGJT.js → tax-region-metadata-4NUEQV3N.js} +20 -21
- package/dist/{tax-region-province-create-OVLIZPNP.js → tax-region-province-create-SEPY4OAZ.js} +1 -1
- package/dist/{tax-region-province-detail-XEMIX5SQ.js → tax-region-province-detail-5Q5E5OP7.js} +22 -23
- package/dist/{tax-region-tax-override-create-KPFXMSPH.js → tax-region-tax-override-create-S5S5JZEJ.js} +38 -41
- package/dist/{tax-region-tax-override-edit-RMMHCFXN.js → tax-region-tax-override-edit-JBG3MRNC.js} +40 -43
- package/dist/{tax-region-tax-rate-create-KDN6G52Y.js → tax-region-tax-rate-create-ZITIAU3K.js} +1 -1
- package/dist/{tax-region-tax-rate-edit-D4BFDDJ7.js → tax-region-tax-rate-edit-RQLUPHD4.js} +1 -1
- package/dist/{user-detail-W7DGVXDZ.js → user-detail-6CCQQPFR.js} +1 -1
- package/dist/{user-edit-MXS2DV37.js → user-edit-DVIMNODF.js} +1 -1
- package/dist/{user-invite-HLZJ7FST.js → user-invite-NJZWT4M5.js} +1 -1
- package/dist/{user-metadata-3AFZX3DM.js → user-metadata-2D552EAR.js} +20 -21
- package/package.json +2 -2
- package/dist/[id]-YI7UXOO2.js +0 -499
- package/dist/chunk-AKTAFKIU.js +0 -228
- package/dist/chunk-ALATTLBM.js +0 -390
- package/dist/chunk-IEPNHH7Z.js +0 -170
- package/dist/chunk-J65IXAGI.js +0 -292
- package/dist/chunk-QSGR43JM.js +0 -30
- package/dist/chunk-RQ4NMLSS.js +0 -8
- package/dist/chunk-RXM4B6HR.js +0 -8
- package/dist/chunk-SWL7ZCP3.js +0 -11
- package/dist/chunk-TIMU6K63.js +0 -207
- package/dist/chunk-TTERSO37.js +0 -652
- package/dist/chunk-U7XILJH6.js +0 -423
- package/dist/chunk-UM7ZR3VU.js +0 -14
- package/dist/chunk-V5XHY5LP.js +0 -39
- package/dist/chunk-WV4SQ57G.js +0 -141
- package/dist/chunk-ZZ3XFIEM.js +0 -84
- package/dist/commission-rate-create-DCMGZS3D.js +0 -783
- package/dist/commission-rate-detail-LAZZLZVX.js +0 -86
- package/dist/commission-rate-edit-VL4TUE3M.js +0 -768
- package/dist/commission-rate-list-Y5XLEO67.js +0 -26
- package/dist/loader-6KDBTRVR.js +0 -26
- package/dist/order-allocate-items-DJ2V4B7A.js +0 -563
- package/dist/order-create-fulfillment-SMSUJSBN.js +0 -644
- package/dist/order-create-shipment-5ZAWH5CZ.js +0 -215
- package/dist/order-receive-return-DZ4IUOHY.js +0 -563
- package/dist/product-brand-create-B3ZJGHUQ.js +0 -171
- package/dist/product-brand-detail-QBWHNBYM.js +0 -100
- package/dist/product-brand-edit-3TQDHZNN.js +0 -179
- package/dist/product-brand-metadata-EAMW6PQJ.js +0 -87
- package/dist/product-create-option-NIAP75EE.js +0 -130
- package/dist/product-create-variant-QODC7MZ7.js +0 -60
- package/dist/product-edit-option-OZUZGMIM.js +0 -166
- package/dist/product-prices-R5JOHVGS.js +0 -267
- package/dist/product-stock-EIP2XJUR.js +0 -545
- package/dist/product-variant-manage-inventory-items-Q5MJG3EJ.js +0 -337
- package/dist/{chunk-WVKVPGJW.js → chunk-FNKBJCNF.js} +3 -3
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-U2L77ZDR.js";
|
|
4
4
|
import {
|
|
5
5
|
OutboundShippingPlaceholder,
|
|
6
|
-
ReturnShippingPlaceholder
|
|
7
|
-
|
|
6
|
+
ReturnShippingPlaceholder,
|
|
7
|
+
getOfferRestockPreview
|
|
8
|
+
} from "./chunk-YVLANFBK.js";
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
useOffers
|
|
11
|
+
} from "./chunk-UIVWOKWT.js";
|
|
11
12
|
import {
|
|
12
13
|
useAddExchangeInboundItems,
|
|
13
14
|
useAddExchangeInboundShipping,
|
|
@@ -25,23 +26,24 @@ import {
|
|
|
25
26
|
useUpdateExchangeInboundShipping,
|
|
26
27
|
useUpdateExchangeOutboundItems,
|
|
27
28
|
useUpdateExchangeOutboundShipping
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-GHGOOZEL.js";
|
|
30
|
+
import {
|
|
31
|
+
getFormattedShippingOptionLocationName
|
|
32
|
+
} from "./chunk-HC25LNX7.js";
|
|
29
33
|
import {
|
|
30
34
|
useReturnReasons
|
|
31
35
|
} from "./chunk-2FGRDEAD.js";
|
|
32
36
|
import {
|
|
33
|
-
getReturnableQuantity
|
|
34
|
-
|
|
37
|
+
getReturnableQuantity,
|
|
38
|
+
useReturn,
|
|
39
|
+
useUpdateReturn
|
|
40
|
+
} from "./chunk-IHTQOPB6.js";
|
|
35
41
|
import {
|
|
36
42
|
MoneyAmountCell
|
|
37
43
|
} from "./chunk-2Y3WMGN6.js";
|
|
38
44
|
import {
|
|
39
45
|
DEFAULT_FIELDS
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import {
|
|
42
|
-
useReturn,
|
|
43
|
-
useUpdateReturn
|
|
44
|
-
} from "./chunk-GKW445WA.js";
|
|
46
|
+
} from "./chunk-JHBNG7OD.js";
|
|
45
47
|
import {
|
|
46
48
|
getStylizedAmount
|
|
47
49
|
} from "./chunk-PXYDR7WQ.js";
|
|
@@ -49,7 +51,9 @@ import {
|
|
|
49
51
|
ProductCell,
|
|
50
52
|
ProductHeader
|
|
51
53
|
} from "./chunk-FWPGOIFA.js";
|
|
52
|
-
import
|
|
54
|
+
import {
|
|
55
|
+
PlaceholderCell
|
|
56
|
+
} from "./chunk-PHOCVOZ5.js";
|
|
53
57
|
import "./chunk-FQERBIVS.js";
|
|
54
58
|
import {
|
|
55
59
|
_DataTable,
|
|
@@ -66,7 +70,7 @@ import {
|
|
|
66
70
|
} from "./chunk-IQPN4PZJ.js";
|
|
67
71
|
import {
|
|
68
72
|
KeyboundForm
|
|
69
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-SITRHMZZ.js";
|
|
70
74
|
import {
|
|
71
75
|
RouteFocusModal,
|
|
72
76
|
StackedFocusModal,
|
|
@@ -84,62 +88,59 @@ import "./chunk-XQNVC4Q7.js";
|
|
|
84
88
|
import {
|
|
85
89
|
useQueryParams
|
|
86
90
|
} from "./chunk-THHRRYRS.js";
|
|
87
|
-
import "./chunk-
|
|
91
|
+
import "./chunk-PJR6W35H.js";
|
|
88
92
|
import "./chunk-OH4AABUT.js";
|
|
89
93
|
import "./chunk-AEMDNTW5.js";
|
|
90
94
|
import "./chunk-LYD3C73Z.js";
|
|
91
|
-
import "./chunk-
|
|
92
|
-
import "./chunk-46M463BR.js";
|
|
93
|
-
import "./chunk-ZZ3XFIEM.js";
|
|
95
|
+
import "./chunk-FJHAAROU.js";
|
|
94
96
|
import "./chunk-533GMKEG.js";
|
|
95
97
|
import "./chunk-YFRC6GEN.js";
|
|
96
|
-
import "./chunk-
|
|
97
|
-
import "./chunk-
|
|
98
|
+
import "./chunk-N6SI4IIT.js";
|
|
99
|
+
import "./chunk-46M463BR.js";
|
|
100
|
+
import "./chunk-ZIFHQXP3.js";
|
|
98
101
|
import "./chunk-JPNPTILP.js";
|
|
102
|
+
import "./chunk-DAXXLQKB.js";
|
|
99
103
|
import "./chunk-GKGLVDDV.js";
|
|
100
|
-
import "./chunk-
|
|
104
|
+
import "./chunk-ESPLVOFC.js";
|
|
101
105
|
import "./chunk-WJJXUXSO.js";
|
|
102
106
|
import "./chunk-LAPEZATU.js";
|
|
103
|
-
import "./chunk-
|
|
104
|
-
import "./chunk-
|
|
107
|
+
import "./chunk-QKJGSZI2.js";
|
|
108
|
+
import "./chunk-Z2UBJXTU.js";
|
|
109
|
+
import "./chunk-FXWKGNRV.js";
|
|
110
|
+
import "./chunk-VDKOJ5WD.js";
|
|
105
111
|
import "./chunk-ZN7LWXVC.js";
|
|
106
|
-
import "./chunk-VYMODH6P.js";
|
|
107
|
-
import "./chunk-LEG67A2R.js";
|
|
108
|
-
import "./chunk-PRBE5CM3.js";
|
|
109
112
|
import {
|
|
110
113
|
useShippingOptions
|
|
111
114
|
} from "./chunk-5TRY5IMZ.js";
|
|
112
115
|
import {
|
|
113
116
|
useStockLocations
|
|
114
117
|
} from "./chunk-EPHVGD5Z.js";
|
|
118
|
+
import "./chunk-XGUUM3S6.js";
|
|
115
119
|
import {
|
|
116
120
|
useOrder,
|
|
117
121
|
useOrderPreview,
|
|
118
122
|
useOrderShippingOptions
|
|
119
|
-
} from "./chunk-
|
|
120
|
-
import "./chunk-
|
|
121
|
-
import "./chunk-
|
|
122
|
-
import "./chunk-
|
|
123
|
-
import "./chunk-VDKOJ5WD.js";
|
|
123
|
+
} from "./chunk-RMAQKNBA.js";
|
|
124
|
+
import "./chunk-VYMODH6P.js";
|
|
125
|
+
import "./chunk-LEG67A2R.js";
|
|
126
|
+
import "./chunk-PRBE5CM3.js";
|
|
124
127
|
import {
|
|
125
128
|
ActionMenu
|
|
126
129
|
} from "./chunk-BDGZ4EQO.js";
|
|
127
|
-
import "./chunk-
|
|
128
|
-
import "./chunk-
|
|
130
|
+
import "./chunk-OKWGPKVK.js";
|
|
131
|
+
import "./chunk-KYFWVLWO.js";
|
|
129
132
|
import "./chunk-LAVHRER2.js";
|
|
130
133
|
import "./chunk-Y7QKP6QU.js";
|
|
131
134
|
import "./chunk-INNFZYX2.js";
|
|
132
|
-
import "./chunk-
|
|
135
|
+
import "./chunk-M2E3PKA4.js";
|
|
133
136
|
import "./chunk-RHKRREUU.js";
|
|
134
137
|
import "./chunk-ZA2KFUFR.js";
|
|
135
|
-
import
|
|
136
|
-
sdk
|
|
137
|
-
} from "./chunk-ZBWL72TB.js";
|
|
138
|
+
import "./chunk-ZBWL72TB.js";
|
|
138
139
|
import "./chunk-NBMM2TZK.js";
|
|
139
140
|
|
|
140
141
|
// src/pages/orders/order-create-exchange/exchange-create.tsx
|
|
141
142
|
import { toast as toast4 } from "@medusajs/ui";
|
|
142
|
-
import { useEffect as useEffect4, useState as
|
|
143
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
143
144
|
import { useTranslation as useTranslation12 } from "react-i18next";
|
|
144
145
|
import { useNavigate, useParams } from "react-router-dom";
|
|
145
146
|
|
|
@@ -155,7 +156,7 @@ import {
|
|
|
155
156
|
toast as toast3,
|
|
156
157
|
usePrompt
|
|
157
158
|
} from "@medusajs/ui";
|
|
158
|
-
import { useEffect as useEffect3, useMemo as
|
|
159
|
+
import { useEffect as useEffect3, useMemo as useMemo7, useState as useState3 } from "react";
|
|
159
160
|
import { useForm } from "react-hook-form";
|
|
160
161
|
import { useTranslation as useTranslation11 } from "react-i18next";
|
|
161
162
|
|
|
@@ -183,8 +184,8 @@ var ExchangeCreateSchema = z.object({
|
|
|
183
184
|
});
|
|
184
185
|
|
|
185
186
|
// src/pages/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-section.tsx
|
|
186
|
-
import {
|
|
187
|
-
import { useEffect, useMemo as useMemo3
|
|
187
|
+
import { Button, Heading, Text as Text2, toast } from "@medusajs/ui";
|
|
188
|
+
import { useEffect, useMemo as useMemo3 } from "react";
|
|
188
189
|
import { useFieldArray } from "react-hook-form";
|
|
189
190
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
190
191
|
|
|
@@ -450,13 +451,20 @@ function ExchangeInboundItem({
|
|
|
450
451
|
form,
|
|
451
452
|
onRemove,
|
|
452
453
|
onUpdate,
|
|
453
|
-
index
|
|
454
|
+
index,
|
|
455
|
+
locationId,
|
|
456
|
+
locationName
|
|
454
457
|
}) {
|
|
455
458
|
const { t } = useTranslation4();
|
|
456
459
|
const { return_reasons = [] } = useReturnReasons({ fields: "+label" });
|
|
457
460
|
const formItem = form.watch(`inbound_items.${index}`);
|
|
458
461
|
const showReturnReason = typeof formItem.reason_id === "string";
|
|
459
462
|
const showNote = typeof formItem.note === "string";
|
|
463
|
+
const restockRows = locationId ? getOfferRestockPreview(
|
|
464
|
+
item,
|
|
465
|
+
formItem?.quantity ?? 0
|
|
466
|
+
) : [];
|
|
467
|
+
const offerSku = item.offer?.sku ?? item.variant_sku ?? null;
|
|
460
468
|
return /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest my-2 rounded-xl ", children: [
|
|
461
469
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-x-2 gap-y-2 p-3 text-sm md:flex-row", children: [
|
|
462
470
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-x-3", children: [
|
|
@@ -545,6 +553,22 @@ function ExchangeInboundItem({
|
|
|
545
553
|
)
|
|
546
554
|
] })
|
|
547
555
|
] }),
|
|
556
|
+
restockRows.length > 0 && /* @__PURE__ */ jsx3("div", { className: "bg-ui-bg-subtle flex flex-col gap-y-1 rounded-md px-3 py-2", children: restockRows.map((row) => /* @__PURE__ */ jsx3(
|
|
557
|
+
Text,
|
|
558
|
+
{
|
|
559
|
+
size: "xsmall",
|
|
560
|
+
className: "text-ui-fg-subtle",
|
|
561
|
+
"data-testid": `exchange-inbound-item-${item.id}-restock-${row.inventoryItemId}`,
|
|
562
|
+
children: t("orders.returns.restockPreview", {
|
|
563
|
+
quantity: formItem?.quantity ?? 0,
|
|
564
|
+
offerSku: offerSku ?? "\u2014",
|
|
565
|
+
delta: row.delta,
|
|
566
|
+
inventoryItem: row.inventoryItemLabel,
|
|
567
|
+
location: locationName ?? "\u2014"
|
|
568
|
+
})
|
|
569
|
+
},
|
|
570
|
+
row.inventoryItemId
|
|
571
|
+
)) }),
|
|
548
572
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
549
573
|
showReturnReason && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-2 p-3 md:grid-cols-2", children: [
|
|
550
574
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -656,7 +680,6 @@ var ExchangeInboundSection = ({
|
|
|
656
680
|
}) => {
|
|
657
681
|
const { t } = useTranslation5();
|
|
658
682
|
const { setIsOpen } = useStackedModal();
|
|
659
|
-
const [inventoryMap, setInventoryMap] = useState2({});
|
|
660
683
|
const { mutateAsync: updateReturn } = useUpdateReturn(
|
|
661
684
|
preview?.order_change?.return_id,
|
|
662
685
|
order.id
|
|
@@ -692,12 +715,17 @@ var ExchangeInboundSection = ({
|
|
|
692
715
|
[order.items]
|
|
693
716
|
);
|
|
694
717
|
const locationId = form.watch("location_id");
|
|
695
|
-
const
|
|
718
|
+
const sellerId = order.seller?.id;
|
|
719
|
+
const { stock_locations = [] } = useStockLocations({
|
|
720
|
+
limit: 999,
|
|
721
|
+
...sellerId ? { seller_id: sellerId } : {}
|
|
722
|
+
});
|
|
696
723
|
const { shipping_options = [] } = useShippingOptions(
|
|
697
724
|
{
|
|
698
725
|
limit: 999,
|
|
699
726
|
fields: "*prices,+service_zone.fulfillment_set.location.id",
|
|
700
|
-
stock_location_id: locationId
|
|
727
|
+
stock_location_id: locationId,
|
|
728
|
+
...sellerId ? { seller_id: sellerId } : {}
|
|
701
729
|
},
|
|
702
730
|
{
|
|
703
731
|
enabled: !!locationId
|
|
@@ -830,49 +858,6 @@ var ExchangeInboundSection = ({
|
|
|
830
858
|
);
|
|
831
859
|
}
|
|
832
860
|
};
|
|
833
|
-
const showLevelsWarning = useMemo3(() => {
|
|
834
|
-
if (!locationId) {
|
|
835
|
-
return false;
|
|
836
|
-
}
|
|
837
|
-
const allItemsHaveLocation = inboundItems.map((_i) => {
|
|
838
|
-
const item = itemsMap.get(_i.item_id);
|
|
839
|
-
if (!item?.variant_id || !item?.variant) {
|
|
840
|
-
return true;
|
|
841
|
-
}
|
|
842
|
-
if (!item.variant?.manage_inventory) {
|
|
843
|
-
return true;
|
|
844
|
-
}
|
|
845
|
-
return inventoryMap[item.variant_id]?.find(
|
|
846
|
-
(l) => l.location_id === locationId
|
|
847
|
-
);
|
|
848
|
-
}).every(Boolean);
|
|
849
|
-
return !allItemsHaveLocation;
|
|
850
|
-
}, [
|
|
851
|
-
inboundItems,
|
|
852
|
-
inventoryMap,
|
|
853
|
-
locationId,
|
|
854
|
-
itemsMap
|
|
855
|
-
]);
|
|
856
|
-
useEffect(() => {
|
|
857
|
-
const getInventoryMap = async () => {
|
|
858
|
-
const ret = {};
|
|
859
|
-
if (!inboundItems.length) {
|
|
860
|
-
return ret;
|
|
861
|
-
}
|
|
862
|
-
const variantIds = inboundItems.map((item) => item?.variant_id).filter(Boolean);
|
|
863
|
-
const variants = (await sdk.admin.productVariants.query({
|
|
864
|
-
id: variantIds,
|
|
865
|
-
fields: "*inventory.location_levels"
|
|
866
|
-
})).variants;
|
|
867
|
-
variants.forEach((variant) => {
|
|
868
|
-
ret[variant.id] = variant.inventory?.[0]?.location_levels || [];
|
|
869
|
-
});
|
|
870
|
-
return ret;
|
|
871
|
-
};
|
|
872
|
-
getInventoryMap().then((map) => {
|
|
873
|
-
setInventoryMap(map);
|
|
874
|
-
});
|
|
875
|
-
}, [inboundItems]);
|
|
876
861
|
return /* @__PURE__ */ jsxs2("div", { children: [
|
|
877
862
|
/* @__PURE__ */ jsxs2("div", { className: "mt-8 flex items-center justify-between", children: [
|
|
878
863
|
/* @__PURE__ */ jsx4(Heading, { level: "h2", children: t("orders.returns.inbound") }),
|
|
@@ -925,6 +910,8 @@ var ExchangeInboundSection = ({
|
|
|
925
910
|
previewItem: inboundItemsMap.get(item.item_id),
|
|
926
911
|
currencyCode: order.currency_code,
|
|
927
912
|
form,
|
|
913
|
+
locationId,
|
|
914
|
+
locationName: stock_locations.find((l) => l.id === locationId)?.name,
|
|
928
915
|
onRemove: () => {
|
|
929
916
|
const actionId = previewInboundItems.find((i) => i.id === item.item_id)?.actions?.find((a) => a.action === "RETURN_ITEM")?.id;
|
|
930
917
|
if (actionId) {
|
|
@@ -1040,46 +1027,40 @@ var ExchangeInboundSection = ({
|
|
|
1040
1027
|
}
|
|
1041
1028
|
)
|
|
1042
1029
|
] })
|
|
1043
|
-
] }),
|
|
1044
|
-
showLevelsWarning && /* @__PURE__ */ jsxs2(Alert, { variant: "warning", dismissible: true, className: "mt-4 p-5", children: [
|
|
1045
|
-
/* @__PURE__ */ jsx4("div", { className: "text-ui-fg-subtle txt-small pb-2 font-medium leading-[20px]", children: t("orders.returns.noInventoryLevel") }),
|
|
1046
|
-
/* @__PURE__ */ jsx4(Text2, { className: "text-ui-fg-subtle txt-small leading-normal", children: t("orders.returns.noInventoryLevelDesc") })
|
|
1047
1030
|
] })
|
|
1048
1031
|
] });
|
|
1049
1032
|
};
|
|
1050
1033
|
|
|
1051
1034
|
// src/pages/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-section.tsx
|
|
1052
|
-
import {
|
|
1053
|
-
import { useEffect as useEffect2, useMemo as
|
|
1035
|
+
import { Button as Button2, Heading as Heading2, toast as toast2 } from "@medusajs/ui";
|
|
1036
|
+
import { useEffect as useEffect2, useMemo as useMemo6 } from "react";
|
|
1054
1037
|
import { useFieldArray as useFieldArray2 } from "react-hook-form";
|
|
1055
1038
|
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
1056
1039
|
|
|
1057
1040
|
// src/pages/orders/order-create-exchange/components/add-exchange-outbound-items-table/add-exchange-outbound-items-table.tsx
|
|
1058
|
-
import { useState as
|
|
1041
|
+
import { useMemo as useMemo5, useState as useState2 } from "react";
|
|
1059
1042
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
1060
1043
|
|
|
1061
1044
|
// src/pages/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-columns.tsx
|
|
1062
|
-
import { Checkbox as Checkbox2 } from "@medusajs/ui";
|
|
1045
|
+
import { Checkbox as Checkbox2, Text as Text3 } from "@medusajs/ui";
|
|
1063
1046
|
import { createColumnHelper as createColumnHelper2 } from "@tanstack/react-table";
|
|
1064
1047
|
import { useMemo as useMemo4 } from "react";
|
|
1065
1048
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
1066
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1049
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1067
1050
|
var columnHelper2 = createColumnHelper2();
|
|
1068
|
-
var useExchangeOutboundItemTableColumns = (
|
|
1051
|
+
var useExchangeOutboundItemTableColumns = () => {
|
|
1069
1052
|
const { t } = useTranslation6();
|
|
1070
1053
|
return useMemo4(
|
|
1071
1054
|
() => [
|
|
1072
1055
|
columnHelper2.display({
|
|
1073
1056
|
id: "select",
|
|
1074
|
-
header: ({ table }) =>
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
);
|
|
1082
|
-
},
|
|
1057
|
+
header: ({ table }) => /* @__PURE__ */ jsx5(
|
|
1058
|
+
Checkbox2,
|
|
1059
|
+
{
|
|
1060
|
+
checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
|
|
1061
|
+
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value)
|
|
1062
|
+
}
|
|
1063
|
+
),
|
|
1083
1064
|
cell: ({ row }) => {
|
|
1084
1065
|
const isSelectable = row.getCanSelect();
|
|
1085
1066
|
return /* @__PURE__ */ jsx5(
|
|
@@ -1097,19 +1078,44 @@ var useExchangeOutboundItemTableColumns = (_currencyCode) => {
|
|
|
1097
1078
|
}),
|
|
1098
1079
|
columnHelper2.display({
|
|
1099
1080
|
id: "product",
|
|
1100
|
-
header: ()
|
|
1081
|
+
header: t("fields.product"),
|
|
1101
1082
|
cell: ({ row }) => {
|
|
1102
|
-
|
|
1083
|
+
const variant = row.original.product_variant;
|
|
1084
|
+
const productTitle = variant?.product?.title;
|
|
1085
|
+
if (!productTitle) {
|
|
1086
|
+
return /* @__PURE__ */ jsx5(PlaceholderCell, {});
|
|
1087
|
+
}
|
|
1088
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex h-full w-full max-w-[300px] items-center gap-x-3 overflow-hidden", children: [
|
|
1089
|
+
/* @__PURE__ */ jsx5(Thumbnail, { src: variant?.product?.thumbnail }),
|
|
1090
|
+
/* @__PURE__ */ jsx5(
|
|
1091
|
+
Text3,
|
|
1092
|
+
{
|
|
1093
|
+
size: "small",
|
|
1094
|
+
leading: "compact",
|
|
1095
|
+
className: "truncate",
|
|
1096
|
+
title: productTitle,
|
|
1097
|
+
children: productTitle
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
] });
|
|
1103
1101
|
}
|
|
1104
1102
|
}),
|
|
1105
1103
|
columnHelper2.accessor("sku", {
|
|
1106
1104
|
header: t("fields.sku"),
|
|
1107
1105
|
cell: ({ getValue }) => {
|
|
1108
|
-
|
|
1106
|
+
const sku = getValue();
|
|
1107
|
+
if (!sku) return /* @__PURE__ */ jsx5(PlaceholderCell, {});
|
|
1108
|
+
return /* @__PURE__ */ jsx5(Text3, { size: "small", leading: "compact", className: "truncate", children: sku });
|
|
1109
1109
|
}
|
|
1110
1110
|
}),
|
|
1111
|
-
columnHelper2.
|
|
1112
|
-
|
|
1111
|
+
columnHelper2.display({
|
|
1112
|
+
id: "variant_title",
|
|
1113
|
+
header: t("fields.title"),
|
|
1114
|
+
cell: ({ row }) => {
|
|
1115
|
+
const title = row.original.product_variant?.title;
|
|
1116
|
+
if (!title) return /* @__PURE__ */ jsx5(PlaceholderCell, {});
|
|
1117
|
+
return /* @__PURE__ */ jsx5(Text3, { size: "small", leading: "compact", className: "truncate", children: title });
|
|
1118
|
+
}
|
|
1113
1119
|
})
|
|
1114
1120
|
],
|
|
1115
1121
|
[t]
|
|
@@ -1159,71 +1165,141 @@ var useExchangeOutboundItemTableQuery = ({
|
|
|
1159
1165
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1160
1166
|
var PAGE_SIZE2 = 50;
|
|
1161
1167
|
var PREFIX2 = "rit";
|
|
1168
|
+
var OFFER_PICKER_FIELDS = [
|
|
1169
|
+
"id",
|
|
1170
|
+
"sku",
|
|
1171
|
+
"variant_id",
|
|
1172
|
+
"seller_id",
|
|
1173
|
+
"prices.amount",
|
|
1174
|
+
"prices.currency_code",
|
|
1175
|
+
"product_variant.id",
|
|
1176
|
+
"product_variant.title",
|
|
1177
|
+
"product_variant.product.id",
|
|
1178
|
+
"product_variant.product.title",
|
|
1179
|
+
"product_variant.product.thumbnail",
|
|
1180
|
+
"product_variant.manage_inventory",
|
|
1181
|
+
"product_variant.inventory_quantity",
|
|
1182
|
+
"product_variant.inventory_items.required_quantity",
|
|
1183
|
+
"product_variant.inventory_items.inventory.location_levels.available_quantity"
|
|
1184
|
+
].join(",");
|
|
1185
|
+
var offerHasInventory = (offer) => {
|
|
1186
|
+
const variant = offer.product_variant;
|
|
1187
|
+
if (!variant) return false;
|
|
1188
|
+
if (variant.manage_inventory === false) return true;
|
|
1189
|
+
const links = variant.inventory_items ?? [];
|
|
1190
|
+
if (!links.length) {
|
|
1191
|
+
return (variant.inventory_quantity ?? 0) > 0;
|
|
1192
|
+
}
|
|
1193
|
+
return links.every((link) => {
|
|
1194
|
+
const available = (link.inventory?.location_levels ?? []).reduce(
|
|
1195
|
+
(acc, lvl) => acc + (lvl.available_quantity ?? 0),
|
|
1196
|
+
0
|
|
1197
|
+
);
|
|
1198
|
+
const required = link.required_quantity ?? 1;
|
|
1199
|
+
return required > 0 && available >= required;
|
|
1200
|
+
});
|
|
1201
|
+
};
|
|
1162
1202
|
var AddExchangeOutboundItemsTable = ({
|
|
1203
|
+
currencyCode,
|
|
1163
1204
|
onSelectionChange,
|
|
1164
|
-
selectedItems
|
|
1165
|
-
currencyCode
|
|
1205
|
+
selectedItems = []
|
|
1166
1206
|
}) => {
|
|
1167
1207
|
const { t } = useTranslation8();
|
|
1168
|
-
const [rowSelection, setRowSelection] =
|
|
1208
|
+
const [rowSelection, setRowSelection] = useState2(
|
|
1169
1209
|
selectedItems.reduce((acc, id) => {
|
|
1170
1210
|
acc[id] = true;
|
|
1171
1211
|
return acc;
|
|
1172
1212
|
}, {})
|
|
1173
1213
|
);
|
|
1174
|
-
const updater = (fn) => {
|
|
1175
|
-
const newState = typeof fn === "function" ? fn(rowSelection) : fn;
|
|
1176
|
-
setRowSelection(newState);
|
|
1177
|
-
onSelectionChange(Object.keys(newState));
|
|
1178
|
-
};
|
|
1179
1214
|
const { searchParams, raw } = useExchangeOutboundItemTableQuery({
|
|
1180
1215
|
pageSize: PAGE_SIZE2,
|
|
1181
1216
|
prefix: PREFIX2
|
|
1182
1217
|
});
|
|
1183
|
-
const
|
|
1218
|
+
const offersResponse = useOffers({
|
|
1219
|
+
...searchParams,
|
|
1220
|
+
fields: OFFER_PICKER_FIELDS
|
|
1221
|
+
});
|
|
1222
|
+
const rawCount = offersResponse.count ?? 0;
|
|
1223
|
+
const offers = useMemo5(() => {
|
|
1224
|
+
const rawOffers = offersResponse.offers ?? [];
|
|
1225
|
+
return rawOffers.filter((offer) => {
|
|
1226
|
+
if (currencyCode) {
|
|
1227
|
+
const hasPrice = (offer.prices ?? []).some(
|
|
1228
|
+
(p) => p.currency_code === currencyCode
|
|
1229
|
+
);
|
|
1230
|
+
if (!hasPrice) return false;
|
|
1231
|
+
}
|
|
1232
|
+
return offerHasInventory(offer);
|
|
1233
|
+
});
|
|
1234
|
+
}, [offersResponse.offers, currencyCode]);
|
|
1235
|
+
const count = offers.length;
|
|
1236
|
+
void rawCount;
|
|
1237
|
+
const columns = useExchangeOutboundItemTableColumns();
|
|
1184
1238
|
const filters = useExchangeOutboundItemTableFilters();
|
|
1239
|
+
const selectionByOfferId = useMemo5(() => {
|
|
1240
|
+
const map = /* @__PURE__ */ new Map();
|
|
1241
|
+
for (const offer of offers) {
|
|
1242
|
+
if (offer.id && offer.variant_id) {
|
|
1243
|
+
map.set(offer.id, { variantId: offer.variant_id, offerId: offer.id });
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
return map;
|
|
1247
|
+
}, [offers]);
|
|
1248
|
+
const updater = (fn) => {
|
|
1249
|
+
const newState = typeof fn === "function" ? fn(rowSelection) : fn;
|
|
1250
|
+
setRowSelection(newState);
|
|
1251
|
+
const pairs = Object.keys(newState).map((offerId) => selectionByOfferId.get(offerId)).filter((p) => !!p);
|
|
1252
|
+
onSelectionChange(pairs);
|
|
1253
|
+
};
|
|
1185
1254
|
const { table } = useDataTable({
|
|
1186
|
-
data:
|
|
1255
|
+
data: offers,
|
|
1187
1256
|
columns,
|
|
1188
|
-
count
|
|
1257
|
+
count,
|
|
1189
1258
|
enablePagination: true,
|
|
1190
|
-
|
|
1259
|
+
// Row id is the offer id so each offer surfaces as a distinct row and the
|
|
1260
|
+
// selection can be turned back into `{ variantId, offerId }` pairs.
|
|
1261
|
+
getRowId: (row) => row.id ?? row.variant_id,
|
|
1191
1262
|
pageSize: PAGE_SIZE2,
|
|
1192
|
-
enableRowSelection: (
|
|
1193
|
-
return true;
|
|
1194
|
-
},
|
|
1263
|
+
enableRowSelection: () => true,
|
|
1195
1264
|
rowSelection: {
|
|
1196
1265
|
state: rowSelection,
|
|
1197
1266
|
updater
|
|
1198
1267
|
}
|
|
1199
1268
|
});
|
|
1200
|
-
return /* @__PURE__ */ jsx6(
|
|
1201
|
-
|
|
1269
|
+
return /* @__PURE__ */ jsx6(
|
|
1270
|
+
"div",
|
|
1202
1271
|
{
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1272
|
+
className: "flex size-full flex-col overflow-hidden",
|
|
1273
|
+
"data-testid": "add-offers-picker",
|
|
1274
|
+
children: /* @__PURE__ */ jsx6(
|
|
1275
|
+
_DataTable,
|
|
1276
|
+
{
|
|
1277
|
+
table,
|
|
1278
|
+
columns,
|
|
1279
|
+
pageSize: PAGE_SIZE2,
|
|
1280
|
+
count,
|
|
1281
|
+
filters,
|
|
1282
|
+
pagination: true,
|
|
1283
|
+
layout: "fill",
|
|
1284
|
+
search: true,
|
|
1285
|
+
orderBy: [
|
|
1286
|
+
{ key: "sku", label: t("fields.sku") },
|
|
1287
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
1288
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
1289
|
+
],
|
|
1290
|
+
prefix: PREFIX2,
|
|
1291
|
+
queryObject: raw
|
|
1292
|
+
}
|
|
1293
|
+
)
|
|
1218
1294
|
}
|
|
1219
|
-
)
|
|
1295
|
+
);
|
|
1220
1296
|
};
|
|
1221
1297
|
|
|
1222
1298
|
// src/pages/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-item.tsx
|
|
1223
1299
|
import { XCircle as XCircle2 } from "@medusajs/icons";
|
|
1224
|
-
import { Input as Input2, Text as
|
|
1300
|
+
import { Input as Input2, Text as Text4 } from "@medusajs/ui";
|
|
1225
1301
|
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
1226
|
-
import { jsx as jsx7, jsxs as
|
|
1302
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1227
1303
|
function ExchangeOutboundItem({
|
|
1228
1304
|
previewItem,
|
|
1229
1305
|
currencyCode,
|
|
@@ -1233,33 +1309,33 @@ function ExchangeOutboundItem({
|
|
|
1233
1309
|
index
|
|
1234
1310
|
}) {
|
|
1235
1311
|
const { t } = useTranslation9();
|
|
1236
|
-
return /* @__PURE__ */ jsx7("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest my-2 rounded-xl ", children: /* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ jsx7("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest my-2 rounded-xl ", children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center gap-x-2 gap-y-2 p-3 text-sm md:flex-row", children: [
|
|
1313
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-1 items-center gap-x-3", children: [
|
|
1238
1314
|
/* @__PURE__ */ jsx7(Thumbnail, { src: previewItem.thumbnail }),
|
|
1239
|
-
/* @__PURE__ */
|
|
1240
|
-
/* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1315
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
|
|
1316
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
1317
|
+
/* @__PURE__ */ jsxs4(Text4, { className: "txt-small", as: "span", weight: "plus", children: [
|
|
1242
1318
|
previewItem.title,
|
|
1243
1319
|
" "
|
|
1244
1320
|
] }),
|
|
1245
|
-
previewItem.variant_sku && /* @__PURE__ */
|
|
1321
|
+
previewItem.variant_sku && /* @__PURE__ */ jsxs4("span", { children: [
|
|
1246
1322
|
"(",
|
|
1247
1323
|
previewItem.variant_sku,
|
|
1248
1324
|
")"
|
|
1249
1325
|
] })
|
|
1250
1326
|
] }),
|
|
1251
|
-
/* @__PURE__ */ jsx7(
|
|
1327
|
+
/* @__PURE__ */ jsx7(Text4, { as: "div", className: "text-ui-fg-subtle txt-small", children: previewItem.subtitle })
|
|
1252
1328
|
] })
|
|
1253
1329
|
] }),
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-1 justify-between", children: [
|
|
1331
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-grow items-center gap-2", children: [
|
|
1256
1332
|
/* @__PURE__ */ jsx7(
|
|
1257
1333
|
Form.Field,
|
|
1258
1334
|
{
|
|
1259
1335
|
control: form.control,
|
|
1260
1336
|
name: `outbound_items.${index}.quantity`,
|
|
1261
1337
|
render: ({ field }) => {
|
|
1262
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ jsxs4(Form.Item, { children: [
|
|
1263
1339
|
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1264
1340
|
Input2,
|
|
1265
1341
|
{
|
|
@@ -1282,7 +1358,7 @@ function ExchangeOutboundItem({
|
|
|
1282
1358
|
}
|
|
1283
1359
|
}
|
|
1284
1360
|
),
|
|
1285
|
-
/* @__PURE__ */ jsx7(
|
|
1361
|
+
/* @__PURE__ */ jsx7(Text4, { className: "txt-small text-ui-fg-subtle", children: t("fields.qty") })
|
|
1286
1362
|
] }),
|
|
1287
1363
|
/* @__PURE__ */ jsx7("div", { className: "text-ui-fg-subtle txt-small mr-2 flex flex-shrink-0", children: /* @__PURE__ */ jsx7(
|
|
1288
1364
|
MoneyAmountCell,
|
|
@@ -1312,7 +1388,7 @@ function ExchangeOutboundItem({
|
|
|
1312
1388
|
}
|
|
1313
1389
|
|
|
1314
1390
|
// src/pages/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-section.tsx
|
|
1315
|
-
import { jsx as jsx8, jsxs as
|
|
1391
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1316
1392
|
var itemsToAdd2 = [];
|
|
1317
1393
|
var itemsToRemove2 = [];
|
|
1318
1394
|
var ExchangeOutboundSection = ({
|
|
@@ -1323,7 +1399,6 @@ var ExchangeOutboundSection = ({
|
|
|
1323
1399
|
}) => {
|
|
1324
1400
|
const { t } = useTranslation10();
|
|
1325
1401
|
const { setIsOpen } = useStackedModal();
|
|
1326
|
-
const [inventoryMap, setInventoryMap] = useState4({});
|
|
1327
1402
|
const { shipping_options = [] } = useOrderShippingOptions(order.id);
|
|
1328
1403
|
const outboundShippingOptions = shipping_options.filter(
|
|
1329
1404
|
(so) => !so.rules?.find((r) => r.attribute === "is_return" && r.value === "true")
|
|
@@ -1345,7 +1420,7 @@ var ExchangeOutboundSection = ({
|
|
|
1345
1420
|
exchange.id,
|
|
1346
1421
|
order.id
|
|
1347
1422
|
);
|
|
1348
|
-
const previewOutboundItems =
|
|
1423
|
+
const previewOutboundItems = useMemo6(
|
|
1349
1424
|
() => preview?.items?.filter(
|
|
1350
1425
|
(i) => !!i.actions?.find(
|
|
1351
1426
|
(a) => a.exchange_id === exchange.id && a.action === "ITEM_ADD"
|
|
@@ -1353,10 +1428,6 @@ var ExchangeOutboundSection = ({
|
|
|
1353
1428
|
),
|
|
1354
1429
|
[preview.items, exchange.id]
|
|
1355
1430
|
);
|
|
1356
|
-
const variantItemMap = useMemo5(
|
|
1357
|
-
() => new Map(order?.items?.map((i) => [i.variant_id, i])),
|
|
1358
|
-
[order.items]
|
|
1359
|
-
);
|
|
1360
1431
|
const {
|
|
1361
1432
|
fields: outboundItems,
|
|
1362
1433
|
append,
|
|
@@ -1366,7 +1437,7 @@ var ExchangeOutboundSection = ({
|
|
|
1366
1437
|
name: "outbound_items",
|
|
1367
1438
|
control: form.control
|
|
1368
1439
|
});
|
|
1369
|
-
const variantOutboundMap =
|
|
1440
|
+
const variantOutboundMap = useMemo6(
|
|
1370
1441
|
() => new Map(previewOutboundItems.map((i) => [i.variant_id, i])),
|
|
1371
1442
|
[previewOutboundItems]
|
|
1372
1443
|
);
|
|
@@ -1405,15 +1476,15 @@ var ExchangeOutboundSection = ({
|
|
|
1405
1476
|
update,
|
|
1406
1477
|
append
|
|
1407
1478
|
]);
|
|
1408
|
-
const locationId = form.watch("location_id");
|
|
1409
1479
|
const showOutboundItemsPlaceholder = !outboundItems.length;
|
|
1410
1480
|
const onItemsSelected = async () => {
|
|
1411
1481
|
if (itemsToAdd2.length) {
|
|
1412
1482
|
await addOutboundItem(
|
|
1413
1483
|
{
|
|
1414
|
-
items: itemsToAdd2.map((variantId) => ({
|
|
1484
|
+
items: itemsToAdd2.map(({ variantId, offerId }) => ({
|
|
1415
1485
|
variant_id: variantId,
|
|
1416
|
-
quantity: 1
|
|
1486
|
+
quantity: 1,
|
|
1487
|
+
metadata: { offer_id: offerId }
|
|
1417
1488
|
}))
|
|
1418
1489
|
},
|
|
1419
1490
|
{
|
|
@@ -1469,73 +1540,33 @@ var ExchangeOutboundSection = ({
|
|
|
1469
1540
|
);
|
|
1470
1541
|
}
|
|
1471
1542
|
};
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
return false;
|
|
1475
|
-
}
|
|
1476
|
-
const allItemsHaveLocation = outboundItems.map((i) => {
|
|
1477
|
-
const item = variantItemMap.get(i.variant_id);
|
|
1478
|
-
if (!item?.variant_id || !item?.variant) {
|
|
1479
|
-
return true;
|
|
1480
|
-
}
|
|
1481
|
-
if (!item.variant?.manage_inventory) {
|
|
1482
|
-
return true;
|
|
1483
|
-
}
|
|
1484
|
-
return inventoryMap[item.variant_id]?.find(
|
|
1485
|
-
(l) => l.location_id === locationId
|
|
1486
|
-
);
|
|
1487
|
-
}).every(Boolean);
|
|
1488
|
-
return !allItemsHaveLocation;
|
|
1489
|
-
}, [
|
|
1490
|
-
outboundItems,
|
|
1491
|
-
inventoryMap,
|
|
1492
|
-
locationId,
|
|
1493
|
-
variantItemMap
|
|
1494
|
-
]);
|
|
1495
|
-
useEffect2(() => {
|
|
1496
|
-
const getInventoryMap = async () => {
|
|
1497
|
-
const ret = {};
|
|
1498
|
-
if (!outboundItems.length) {
|
|
1499
|
-
return ret;
|
|
1500
|
-
}
|
|
1501
|
-
const variantIds = outboundItems.map((item) => item?.variant_id).filter(Boolean);
|
|
1502
|
-
const variants = (await sdk.admin.productVariants.query({
|
|
1503
|
-
id: variantIds,
|
|
1504
|
-
fields: "*inventory.location_levels"
|
|
1505
|
-
})).variants;
|
|
1506
|
-
variants.forEach((variant) => {
|
|
1507
|
-
ret[variant.id] = variant.inventory?.[0]?.location_levels || [];
|
|
1508
|
-
});
|
|
1509
|
-
return ret;
|
|
1510
|
-
};
|
|
1511
|
-
getInventoryMap().then((map) => {
|
|
1512
|
-
setInventoryMap(map);
|
|
1513
|
-
});
|
|
1514
|
-
}, [outboundItems]);
|
|
1515
|
-
return /* @__PURE__ */ jsxs4("div", { children: [
|
|
1516
|
-
/* @__PURE__ */ jsxs4("div", { className: "mt-8 flex items-center justify-between", children: [
|
|
1543
|
+
return /* @__PURE__ */ jsxs5("div", { children: [
|
|
1544
|
+
/* @__PURE__ */ jsxs5("div", { className: "mt-8 flex items-center justify-between", children: [
|
|
1517
1545
|
/* @__PURE__ */ jsx8(Heading2, { level: "h2", children: t("orders.returns.outbound") }),
|
|
1518
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ jsxs5(StackedFocusModal, { id: "outbound-items", children: [
|
|
1519
1547
|
/* @__PURE__ */ jsx8(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx8("button", { type: "button", className: "focus-visible:shadow-borders-focus transition-fg txt-compact-small-plus cursor-pointer text-blue-500 outline-none hover:text-blue-400", children: t("actions.addItems") }) }),
|
|
1520
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsxs5(StackedFocusModal.Content, { children: [
|
|
1521
1549
|
/* @__PURE__ */ jsx8(StackedFocusModal.Header, {}),
|
|
1522
1550
|
/* @__PURE__ */ jsx8(
|
|
1523
1551
|
AddExchangeOutboundItemsTable,
|
|
1524
1552
|
{
|
|
1525
|
-
selectedItems: outboundItems.map(
|
|
1553
|
+
selectedItems: outboundItems.map(
|
|
1554
|
+
(i) => (typeof i.metadata?.offer_id === "string" ? i.metadata.offer_id : null) ?? i.variant_id
|
|
1555
|
+
).filter((v) => !!v),
|
|
1526
1556
|
currencyCode: order.currency_code,
|
|
1527
1557
|
onSelectionChange: (finalSelection) => {
|
|
1528
|
-
const
|
|
1558
|
+
const alreadyVariantIds = outboundItems.map((i) => i.variant_id).filter((v) => !!v);
|
|
1529
1559
|
itemsToAdd2 = finalSelection.filter(
|
|
1530
|
-
(
|
|
1560
|
+
({ variantId }) => !alreadyVariantIds.includes(variantId)
|
|
1531
1561
|
);
|
|
1532
|
-
|
|
1533
|
-
|
|
1562
|
+
const finalVariantIds = finalSelection.map((s) => s.variantId);
|
|
1563
|
+
itemsToRemove2 = alreadyVariantIds.filter(
|
|
1564
|
+
(variantId) => !finalVariantIds.includes(variantId)
|
|
1534
1565
|
);
|
|
1535
1566
|
}
|
|
1536
1567
|
}
|
|
1537
1568
|
),
|
|
1538
|
-
/* @__PURE__ */ jsx8(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsx8("div", { className: "flex w-full items-center justify-end gap-x-4", children: /* @__PURE__ */
|
|
1569
|
+
/* @__PURE__ */ jsx8(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsx8("div", { className: "flex w-full items-center justify-end gap-x-4", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
1539
1570
|
/* @__PURE__ */ jsx8(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "secondary", size: "small", children: t("actions.cancel") }) }),
|
|
1540
1571
|
/* @__PURE__ */ jsx8(
|
|
1541
1572
|
Button2,
|
|
@@ -1590,8 +1621,8 @@ var ExchangeOutboundSection = ({
|
|
|
1590
1621
|
item.id
|
|
1591
1622
|
)
|
|
1592
1623
|
),
|
|
1593
|
-
!showOutboundItemsPlaceholder && /* @__PURE__ */ jsx8("div", { className: "mt-8 flex flex-col gap-y-4", children: /* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1624
|
+
!showOutboundItemsPlaceholder && /* @__PURE__ */ jsx8("div", { className: "mt-8 flex flex-col gap-y-4", children: /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 gap-2 md:grid-cols-2", children: [
|
|
1625
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1595
1626
|
/* @__PURE__ */ jsx8(Form.Label, { children: t("orders.exchanges.outboundShipping") }),
|
|
1596
1627
|
/* @__PURE__ */ jsx8(Form.Hint, { className: "!mt-1", children: t("orders.exchanges.outboundShippingHint") })
|
|
1597
1628
|
] }),
|
|
@@ -1622,16 +1653,12 @@ var ExchangeOutboundSection = ({
|
|
|
1622
1653
|
}
|
|
1623
1654
|
}
|
|
1624
1655
|
)
|
|
1625
|
-
] }) })
|
|
1626
|
-
showLevelsWarning && /* @__PURE__ */ jsxs4(Alert2, { variant: "warning", dismissible: true, className: "mt-4 p-5", children: [
|
|
1627
|
-
/* @__PURE__ */ jsx8("div", { className: "text-ui-fg-subtle txt-small pb-2 font-medium leading-[20px]", children: t("orders.returns.noInventoryLevel") }),
|
|
1628
|
-
/* @__PURE__ */ jsx8(Text4, { className: "text-ui-fg-subtle txt-small leading-normal", children: t("orders.returns.noInventoryLevelDesc") })
|
|
1629
|
-
] })
|
|
1656
|
+
] }) })
|
|
1630
1657
|
] });
|
|
1631
1658
|
};
|
|
1632
1659
|
|
|
1633
1660
|
// src/pages/orders/order-create-exchange/components/exchange-create-form/exchange-create-form.tsx
|
|
1634
|
-
import { jsx as jsx9, jsxs as
|
|
1661
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1635
1662
|
var IS_CANCELING = false;
|
|
1636
1663
|
var ExchangeCreateForm = ({
|
|
1637
1664
|
order,
|
|
@@ -1641,13 +1668,13 @@ var ExchangeCreateForm = ({
|
|
|
1641
1668
|
}) => {
|
|
1642
1669
|
const { t } = useTranslation11();
|
|
1643
1670
|
const { handleSuccess } = useRouteModal();
|
|
1644
|
-
const [isInboundShippingPriceEdit, setIsInboundShippingPriceEdit] =
|
|
1645
|
-
const [isOutboundShippingPriceEdit, setIsOutboundShippingPriceEdit] =
|
|
1646
|
-
const [customInboundShippingAmount, setCustomInboundShippingAmount] =
|
|
1671
|
+
const [isInboundShippingPriceEdit, setIsInboundShippingPriceEdit] = useState3(false);
|
|
1672
|
+
const [isOutboundShippingPriceEdit, setIsOutboundShippingPriceEdit] = useState3(false);
|
|
1673
|
+
const [customInboundShippingAmount, setCustomInboundShippingAmount] = useState3({
|
|
1647
1674
|
value: "0",
|
|
1648
1675
|
float: 0
|
|
1649
1676
|
});
|
|
1650
|
-
const [customOutboundShippingAmount, setCustomOutboundShippingAmount] =
|
|
1677
|
+
const [customOutboundShippingAmount, setCustomOutboundShippingAmount] = useState3({
|
|
1651
1678
|
value: "0",
|
|
1652
1679
|
float: 0
|
|
1653
1680
|
});
|
|
@@ -1662,7 +1689,7 @@ var ExchangeCreateForm = ({
|
|
|
1662
1689
|
isPending: isUpdatingInboundShipping
|
|
1663
1690
|
} = useUpdateExchangeOutboundShipping(exchange.id, order.id);
|
|
1664
1691
|
const isRequestLoading = isConfirming || isCanceling || isUpdatingInboundShipping || isUpdatingOutboundShipping;
|
|
1665
|
-
const previewItems =
|
|
1692
|
+
const previewItems = useMemo7(
|
|
1666
1693
|
() => preview?.items?.filter(
|
|
1667
1694
|
(i) => !!i.actions?.find((a) => a.exchange_id === exchange.id)
|
|
1668
1695
|
),
|
|
@@ -1784,19 +1811,19 @@ var ExchangeCreateForm = ({
|
|
|
1784
1811
|
}
|
|
1785
1812
|
};
|
|
1786
1813
|
}, [t, cancelExchangeRequest]);
|
|
1787
|
-
const inboundShippingTotal =
|
|
1814
|
+
const inboundShippingTotal = useMemo7(() => {
|
|
1788
1815
|
const method = preview.shipping_methods.find(
|
|
1789
1816
|
(sm) => !!sm.actions?.find((a) => a.action === "SHIPPING_ADD" && !!a.return_id)
|
|
1790
1817
|
);
|
|
1791
1818
|
return method?.total || 0;
|
|
1792
1819
|
}, [preview.shipping_methods]);
|
|
1793
|
-
const outboundShippingTotal =
|
|
1820
|
+
const outboundShippingTotal = useMemo7(() => {
|
|
1794
1821
|
const method = preview.shipping_methods.find(
|
|
1795
1822
|
(sm) => !!sm.actions?.find((a) => a.action === "SHIPPING_ADD" && !a.return_id)
|
|
1796
1823
|
);
|
|
1797
1824
|
return method?.total || 0;
|
|
1798
1825
|
}, [preview.shipping_methods]);
|
|
1799
|
-
return /* @__PURE__ */ jsx9(RouteFocusModal.Form, { form, "data-testid": "order-create-exchange-form", children: /* @__PURE__ */
|
|
1826
|
+
return /* @__PURE__ */ jsx9(RouteFocusModal.Form, { form, "data-testid": "order-create-exchange-form", children: /* @__PURE__ */ jsxs6(
|
|
1800
1827
|
KeyboundForm,
|
|
1801
1828
|
{
|
|
1802
1829
|
onSubmit: handleSubmit,
|
|
@@ -1809,7 +1836,7 @@ var ExchangeCreateForm = ({
|
|
|
1809
1836
|
{
|
|
1810
1837
|
className: "flex size-full justify-center overflow-y-auto",
|
|
1811
1838
|
"data-testid": "order-create-exchange-body",
|
|
1812
|
-
children: /* @__PURE__ */
|
|
1839
|
+
children: /* @__PURE__ */ jsxs6(
|
|
1813
1840
|
"div",
|
|
1814
1841
|
{
|
|
1815
1842
|
className: "mt-16 w-[720px] max-w-[100%] px-4 md:p-0",
|
|
@@ -1835,13 +1862,13 @@ var ExchangeCreateForm = ({
|
|
|
1835
1862
|
exchange
|
|
1836
1863
|
}
|
|
1837
1864
|
),
|
|
1838
|
-
/* @__PURE__ */
|
|
1865
|
+
/* @__PURE__ */ jsxs6(
|
|
1839
1866
|
"div",
|
|
1840
1867
|
{
|
|
1841
1868
|
className: "mt-8 border-y border-dotted py-4",
|
|
1842
1869
|
"data-testid": "order-create-exchange-totals",
|
|
1843
1870
|
children: [
|
|
1844
|
-
/* @__PURE__ */
|
|
1871
|
+
/* @__PURE__ */ jsxs6(
|
|
1845
1872
|
"div",
|
|
1846
1873
|
{
|
|
1847
1874
|
className: "mb-2 flex items-center justify-between",
|
|
@@ -1875,7 +1902,7 @@ var ExchangeCreateForm = ({
|
|
|
1875
1902
|
]
|
|
1876
1903
|
}
|
|
1877
1904
|
),
|
|
1878
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsxs6(
|
|
1879
1906
|
"div",
|
|
1880
1907
|
{
|
|
1881
1908
|
className: "mb-2 flex items-center justify-between",
|
|
@@ -1909,9 +1936,9 @@ var ExchangeCreateForm = ({
|
|
|
1909
1936
|
]
|
|
1910
1937
|
}
|
|
1911
1938
|
),
|
|
1912
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ jsxs6("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1913
1940
|
/* @__PURE__ */ jsx9("span", { className: "txt-small text-ui-fg-subtle", children: t("orders.returns.inboundShipping") }),
|
|
1914
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ jsxs6("span", { className: "txt-small text-ui-fg-subtle flex items-center", children: [
|
|
1915
1942
|
!isInboundShippingPriceEdit && /* @__PURE__ */ jsx9(
|
|
1916
1943
|
IconButton2,
|
|
1917
1944
|
{
|
|
@@ -1965,9 +1992,9 @@ var ExchangeCreateForm = ({
|
|
|
1965
1992
|
) : getStylizedAmount(inboundShippingTotal, order.currency_code)
|
|
1966
1993
|
] })
|
|
1967
1994
|
] }),
|
|
1968
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
|
|
1969
1996
|
/* @__PURE__ */ jsx9("span", { className: "txt-small text-ui-fg-subtle", children: t("orders.exchanges.outboundShipping") }),
|
|
1970
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ jsxs6("span", { className: "txt-small text-ui-fg-subtle flex items-center", children: [
|
|
1971
1998
|
!isOutboundShippingPriceEdit && /* @__PURE__ */ jsx9(
|
|
1972
1999
|
IconButton2,
|
|
1973
2000
|
{
|
|
@@ -2024,7 +2051,7 @@ var ExchangeCreateForm = ({
|
|
|
2024
2051
|
)
|
|
2025
2052
|
] })
|
|
2026
2053
|
] }),
|
|
2027
|
-
/* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ jsxs6(
|
|
2028
2055
|
"div",
|
|
2029
2056
|
{
|
|
2030
2057
|
className: "mt-4 flex items-center justify-between border-t border-dotted pt-4",
|
|
@@ -2066,8 +2093,8 @@ var ExchangeCreateForm = ({
|
|
|
2066
2093
|
control: form.control,
|
|
2067
2094
|
name: "send_notification",
|
|
2068
2095
|
render: ({ field: { onChange, value, ...field } }) => {
|
|
2069
|
-
return /* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2096
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { "data-testid": "order-create-exchange-notification-item", children: [
|
|
2097
|
+
/* @__PURE__ */ jsxs6(
|
|
2071
2098
|
"div",
|
|
2072
2099
|
{
|
|
2073
2100
|
className: "flex items-center",
|
|
@@ -2091,7 +2118,7 @@ var ExchangeCreateForm = ({
|
|
|
2091
2118
|
)
|
|
2092
2119
|
}
|
|
2093
2120
|
),
|
|
2094
|
-
/* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ jsxs6("div", { className: "block", children: [
|
|
2095
2122
|
/* @__PURE__ */ jsx9(Form.Label, { "data-testid": "order-create-exchange-notification-label", children: t("orders.returns.sendNotification") }),
|
|
2096
2123
|
/* @__PURE__ */ jsx9(
|
|
2097
2124
|
Form.Hint,
|
|
@@ -2123,7 +2150,7 @@ var ExchangeCreateForm = ({
|
|
|
2123
2150
|
{
|
|
2124
2151
|
className: "flex w-full items-center justify-end gap-x-4",
|
|
2125
2152
|
"data-testid": "order-create-exchange-form-footer-actions",
|
|
2126
|
-
children: /* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
2127
2154
|
/* @__PURE__ */ jsx9(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx9(
|
|
2128
2155
|
Button3,
|
|
2129
2156
|
{
|
|
@@ -2166,7 +2193,7 @@ var ExchangeCreate = () => {
|
|
|
2166
2193
|
fields: DEFAULT_FIELDS
|
|
2167
2194
|
});
|
|
2168
2195
|
const { order: preview } = useOrderPreview(id);
|
|
2169
|
-
const [activeExchangeId, setActiveExchangeId] =
|
|
2196
|
+
const [activeExchangeId, setActiveExchangeId] = useState4();
|
|
2170
2197
|
const { mutateAsync: createExchange } = useCreateExchange(order.id);
|
|
2171
2198
|
const { exchange } = useExchange(activeExchangeId, void 0, {
|
|
2172
2199
|
enabled: !!activeExchangeId
|