@mercurjs/admin 2.2.1 → 2.3.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-44GUWMAP.js → add-campaign-promotions-S4HKMFU7.js} +34 -19
- package/dist/{adjust-inventory-4ZOZCMSO.js → adjust-inventory-CFQ6LD2U.js} +37 -37
- package/dist/{api-key-management-create-KJAP6KDX.js → api-key-management-create-TFG4TLGM.js} +4 -4
- package/dist/{api-key-management-detail-RV5Q45EV.js → api-key-management-detail-TTGN4LO7.js} +34 -34
- package/dist/{api-key-management-edit-N75HXUJF.js → api-key-management-edit-XUZJEML7.js} +4 -4
- package/dist/{api-key-management-list-A2FUOLVQ.js → api-key-management-list-AHXOCLBO.js} +7 -7
- package/dist/{api-key-management-sales-channels-A5F3D42D.js → api-key-management-sales-channels-FFY3HIOX.js} +4 -4
- package/dist/{attribute-create-WDI2GMPM.js → attribute-create-7WTQLEV6.js} +35 -35
- package/dist/{attribute-create-possible-value-3D5M2GYE.js → attribute-create-possible-value-OKGWRSNJ.js} +2 -2
- package/dist/{attribute-detail-TDXW4CBR.js → attribute-detail-QRYCIEUR.js} +35 -35
- package/dist/{attribute-edit-LBMZVL3O.js → attribute-edit-HS4PH6TS.js} +4 -4
- package/dist/{attribute-edit-possible-value-RWG3U7IG.js → attribute-edit-possible-value-LN5R6SZT.js} +4 -4
- package/dist/{attribute-edit-ranking-COH6THIE.js → attribute-edit-ranking-SF7XSICV.js} +2 -2
- package/dist/attribute-list-6ELFWDHO.js +61 -0
- package/dist/{breadcrumb-2NHCSFUI.js → breadcrumb-KOE4ZWGU.js} +2 -2
- package/dist/{breadcrumb-3YK35VAB.js → breadcrumb-TCQDZXGC.js} +2 -2
- package/dist/{campaign-budget-edit-7NXMWE2S.js → campaign-budget-edit-EBFDQ6OX.js} +5 -9
- package/dist/{campaign-configuration-67I6NQNR.js → campaign-configuration-H6SKZFDS.js} +6 -10
- package/dist/{campaign-create-NCJ4NA2B.js → campaign-create-FEEKJCUE.js} +7 -7
- package/dist/{campaign-detail-EIQKFRLT.js → campaign-detail-WPTZDDD5.js} +40 -40
- package/dist/{campaign-edit-Z6A5J2G4.js → campaign-edit-2WJ7V2EY.js} +13 -68
- package/dist/{campaign-list-IMD4DAVX.js → campaign-list-7L2DGBHW.js} +9 -7
- package/dist/{categories-metadata-UN7P2PDA.js → categories-metadata-MJAYSCTW.js} +32 -32
- package/dist/{category-create-3F6PHBRW.js → category-create-7RFRKVKF.js} +6 -6
- package/dist/{category-detail-O523XOJR.js → category-detail-ZYOHF3ME.js} +43 -43
- package/dist/{category-edit-YIGHQ442.js → category-edit-3KXRPXXJ.js} +3 -3
- package/dist/{category-icon-edit-6ZVXC4ID.js → category-icon-edit-KUCL7KEJ.js} +4 -4
- package/dist/{category-list-355HTVFG.js → category-list-3IL2MERS.js} +9 -9
- package/dist/{category-media-IEIIXESO.js → category-media-IOA2VNMI.js} +4 -4
- package/dist/{category-organize-7QJ4MAA4.js → category-organize-KQ7UWVAJ.js} +3 -3
- package/dist/{category-products-G3JDJ6RR.js → category-products-GHRZVC5W.js} +40 -40
- package/dist/{chunk-QZXA66HY.js → chunk-22ILFYVW.js} +13 -13
- package/dist/{chunk-ZLRTPJ7R.js → chunk-23KZGNNG.js} +78 -21
- package/dist/{chunk-5P2YBCU4.js → chunk-2H27V7B2.js} +1 -1
- package/dist/{chunk-BAODXM3R.js → chunk-2HTCCPOG.js} +1 -1
- package/dist/{chunk-RUHF6QPS.js → chunk-2HV33DOE.js} +1 -1
- package/dist/{chunk-D6RWXLO6.js → chunk-2NOIR4BR.js} +1 -1
- package/dist/{chunk-IXC4VZBU.js → chunk-2SCR7R3C.js} +2 -2
- package/dist/{chunk-GBSL5JTZ.js → chunk-2XPJEEGO.js} +2 -2
- package/dist/{chunk-VPAMPIAF.js → chunk-3DFVU5HR.js} +3 -3
- package/dist/{chunk-2Z4JZU5E.js → chunk-3JN6NCCN.js} +2 -2
- package/dist/{chunk-5346HYMP.js → chunk-3R7N3HV3.js} +1 -1
- package/dist/{chunk-HPH2J4MY.js → chunk-3ZPJTOHI.js} +4 -4
- package/dist/{chunk-2ST7PJ7M.js → chunk-4IWBVSJ2.js} +8 -8
- package/dist/{chunk-HGOS4TNK.js → chunk-4XBAEB4B.js} +102 -74
- package/dist/{chunk-NH62M7H7.js → chunk-54SYWPLY.js} +1 -1
- package/dist/{chunk-HRPM4HIB.js → chunk-56XMCNDS.js} +3 -3
- package/dist/{chunk-6DBDQBFX.js → chunk-5QAOYZPB.js} +8 -8
- package/dist/{chunk-RTPQHQEK.js → chunk-6ASLWQB3.js} +1 -1
- package/dist/{chunk-R5UX3EPB.js → chunk-6DQFH5DW.js} +15 -13
- package/dist/{chunk-TF643ZL6.js → chunk-6Q2JZ5YN.js} +24 -4
- package/dist/{chunk-WCDCL5X6.js → chunk-6QOXR3AN.js} +5 -5
- package/dist/{chunk-KV2LVBNH.js → chunk-6ZVRNI5K.js} +198 -208
- package/dist/{chunk-2ISHQHC2.js → chunk-73N66XQD.js} +3 -3
- package/dist/{chunk-GYMFTVB4.js → chunk-7QZFRDTU.js} +2 -2
- package/dist/{chunk-P6EWVML2.js → chunk-7ZQWFHMP.js} +11 -11
- package/dist/{chunk-LVPTTWYC.js → chunk-7ZY7R6PG.js} +18 -7
- package/dist/{chunk-K6FC5Y72.js → chunk-AEBQQ2EG.js} +1 -1
- package/dist/chunk-AK7NUCTI.js +859 -0
- package/dist/{chunk-7QDFT4JE.js → chunk-AL26XZGB.js} +6 -6
- package/dist/{chunk-FRUJ3RNF.js → chunk-ALJIXUKL.js} +2 -2
- package/dist/{chunk-HI2E3YTU.js → chunk-AQHEU7OA.js} +1 -1
- package/dist/{chunk-WX5UZZZD.js → chunk-ARD6JGZB.js} +3 -3
- package/dist/{chunk-Y2WR3O3B.js → chunk-ASFCRSBA.js} +2 -2
- package/dist/{chunk-YTQAKAXN.js → chunk-BA2XHM7M.js} +2 -2
- package/dist/{chunk-YTBPZ5MO.js → chunk-BGI4CCBX.js} +14 -9
- package/dist/{chunk-EMZXHZJQ.js → chunk-BOPIWKTU.js} +1 -1
- package/dist/{chunk-NEURB6JB.js → chunk-BSXBRI23.js} +8 -5
- package/dist/{chunk-VMF2HNXG.js → chunk-C3B45LUQ.js} +6 -6
- package/dist/{chunk-LFNC565R.js → chunk-CFQX7HAW.js} +1 -1
- package/dist/{chunk-6ZVLQ4IK.js → chunk-CKEJLFYJ.js} +5 -5
- package/dist/{chunk-I5LAGPN7.js → chunk-CMBHUF6P.js} +122 -59
- package/dist/{chunk-7RPRNVBS.js → chunk-CMKC2YBP.js} +1 -10
- package/dist/{chunk-D5FHUQQK.js → chunk-CMVQ5SAG.js} +1 -1
- package/dist/{chunk-3EPBOJTL.js → chunk-CR7TRBEB.js} +5 -5
- package/dist/{chunk-PVNB7ETQ.js → chunk-D3RDR3D3.js} +1 -1
- package/dist/{chunk-R55WKWFH.js → chunk-DBCNRZZE.js} +1 -1
- package/dist/{chunk-NBKPNE3I.js → chunk-DPGE6G2I.js} +4 -4
- package/dist/{chunk-J7YEXYZJ.js → chunk-DSQRFZCO.js} +1 -1
- package/dist/{chunk-JTAECZCT.js → chunk-DTGEFKK4.js} +1 -0
- package/dist/{chunk-Y4QL7QLU.js → chunk-DYCCRR7B.js} +1 -1
- package/dist/{chunk-RLOKMTTN.js → chunk-E5PC2WDZ.js} +1 -1
- package/dist/{chunk-UNNSF2VP.js → chunk-E75QIW4N.js} +3 -3
- package/dist/{chunk-KHTVPTS4.js → chunk-EAZ6YM6D.js} +2 -2
- package/dist/{chunk-YII7HVOM.js → chunk-EF23N7II.js} +3 -3
- package/dist/{chunk-YDDD3MK5.js → chunk-ELLSTZ5X.js} +59 -24
- package/dist/{chunk-ML74OTDD.js → chunk-EPUODBUW.js} +11 -66
- package/dist/{chunk-P7IMB5H5.js → chunk-ESNSDIEC.js} +1 -1
- package/dist/{chunk-J37PJ6OX.js → chunk-EVCAR6GP.js} +5 -5
- package/dist/{chunk-R45DOGQ6.js → chunk-EVNTT2M3.js} +1 -1
- package/dist/{chunk-JJKPETJT.js → chunk-FHZHKIWI.js} +1 -1
- package/dist/{chunk-GYM6QZY3.js → chunk-GGKH2FM5.js} +5 -5
- package/dist/{chunk-UBME2ENV.js → chunk-GNNOFJAK.js} +1 -1
- package/dist/{chunk-IF2MFOIQ.js → chunk-H5E3CGD7.js} +1 -1
- package/dist/{chunk-LI3XW6HB.js → chunk-H6OULVCZ.js} +8 -8
- package/dist/{chunk-PSOGTJID.js → chunk-H7HNJFQA.js} +79 -128
- package/dist/{chunk-KGZZFXXX.js → chunk-HBLA43D4.js} +314 -168
- package/dist/{chunk-OEOLRONP.js → chunk-HBNQ3R3P.js} +3 -3
- package/dist/{chunk-JZZLMXG4.js → chunk-HFCJJJKP.js} +4 -4
- package/dist/{chunk-IKKZCYFE.js → chunk-HFMAEJN2.js} +70 -19
- package/dist/chunk-HJACC6KV.js +212 -0
- package/dist/{chunk-6HHMZ2QV.js → chunk-HRMANL53.js} +1 -1
- package/dist/{chunk-RES4NBTO.js → chunk-HV32AEGS.js} +142 -168
- package/dist/chunk-HX7X3XN2.js +359 -0
- package/dist/{chunk-2W4YIJYV.js → chunk-I4WBDDWN.js} +2 -2
- package/dist/{chunk-MRM5VNUM.js → chunk-IEFMUOVU.js} +1 -1
- package/dist/{chunk-PEPANIBF.js → chunk-IZ77JV46.js} +1 -1
- package/dist/{chunk-JU5ALCEN.js → chunk-J4SYK3RT.js} +2 -2
- package/dist/{chunk-MXLSIF5V.js → chunk-JC2FFAMW.js} +2 -2
- package/dist/{chunk-R7Q23SWH.js → chunk-JCGEIG3Y.js} +4 -4
- package/dist/{chunk-34AHGPLC.js → chunk-JL3NKSLJ.js} +4 -4
- package/dist/{chunk-3PWLO7XZ.js → chunk-JQEAWWRP.js} +3 -3
- package/dist/{chunk-UGKLN2X6.js → chunk-JW4YZDH6.js} +2 -2
- package/dist/{chunk-J4MVHPVY.js → chunk-JW5SGRFC.js} +1 -1
- package/dist/{chunk-SWHRBO6C.js → chunk-KA2JYXWT.js} +2 -2
- package/dist/{chunk-PD34CJ6T.js → chunk-KG2PDEFS.js} +1 -1
- package/dist/chunk-KGUX2KUR.js +540 -0
- package/dist/{chunk-NVU672HY.js → chunk-KTE5QGW6.js} +3 -3
- package/dist/chunk-KVAD5JGS.js +11 -0
- package/dist/{chunk-JTP32GYS.js → chunk-LAIT7Y53.js} +2 -2
- package/dist/{chunk-BTK54ERQ.js → chunk-LBZLMHYB.js} +3 -3
- package/dist/{chunk-R7HPBN4C.js → chunk-LHE6LM6S.js} +2 -2
- package/dist/{chunk-5HMJDME5.js → chunk-LIMG2EY2.js} +3 -3
- package/dist/{chunk-DY3XQPHC.js → chunk-LISOKQBZ.js} +25 -3
- package/dist/{chunk-XJ67JBUL.js → chunk-LLLD7JUI.js} +7 -7
- package/dist/{chunk-F265A5GC.js → chunk-LXTXP7ZM.js} +2 -2
- package/dist/{chunk-R5O4QT2H.js → chunk-LXW3L56Z.js} +2 -2
- package/dist/{chunk-AYK22LJU.js → chunk-M3AHXNLZ.js} +3 -3
- package/dist/{chunk-45Z2P3GA.js → chunk-MAXC747X.js} +4 -4
- package/dist/{chunk-5INL7Z64.js → chunk-MEQLWAZC.js} +7 -2
- package/dist/{chunk-YNPIZEWG.js → chunk-MEQWNYCJ.js} +2 -2
- package/dist/{chunk-XQBF2FRT.js → chunk-MXM5ZD4Y.js} +2 -2
- package/dist/{chunk-J7AF7G7E.js → chunk-MY3WQXPS.js} +3 -3
- package/dist/{chunk-GINON6FD.js → chunk-N2YADNWS.js} +1 -1
- package/dist/{chunk-PJ3OSJVB.js → chunk-N3ZYLAGA.js} +2 -2
- package/dist/{chunk-XBHT34SZ.js → chunk-NGLBA5UK.js} +2 -2
- package/dist/{chunk-UILKCIRW.js → chunk-NKZLCOFU.js} +1 -1
- package/dist/chunk-NN2AWPC7.js +75 -0
- package/dist/{chunk-EJNYP4ZP.js → chunk-NN6PSWE4.js} +218 -42
- package/dist/{chunk-YAPKMKRA.js → chunk-NWLWKR4U.js} +4 -4
- package/dist/{chunk-PJG7Q5MF.js → chunk-ODBYHQML.js} +6 -6
- package/dist/{chunk-XPTKT2SY.js → chunk-OFW63WXL.js} +1 -1
- package/dist/{chunk-43C2OEFK.js → chunk-OQ2J45XW.js} +1 -1
- package/dist/chunk-OS6DZEKB.js +82 -0
- package/dist/{chunk-KXGFQRXK.js → chunk-P2BNZD5K.js} +7 -7
- package/dist/{chunk-YG65LX2W.js → chunk-PAYX77VD.js} +2 -2
- package/dist/{chunk-IC7CKUCI.js → chunk-PB24YMA4.js} +3 -3
- package/dist/{chunk-RUWKTYQN.js → chunk-PKPYTXFX.js} +6 -6
- package/dist/{chunk-EKLQ3PFC.js → chunk-PY4RE444.js} +1 -1
- package/dist/{chunk-TLV3AINO.js → chunk-Q732RWRD.js} +2 -2
- package/dist/chunk-QLOJNFUE.js +53 -0
- package/dist/{chunk-42VZYFJ5.js → chunk-QWT3GCLC.js} +3 -3
- package/dist/{chunk-ENWEPNEB.js → chunk-R22UAHRF.js} +1 -1
- package/dist/{chunk-HINXQTCW.js → chunk-RKFEXC2J.js} +37 -0
- package/dist/{chunk-PMBR7NK4.js → chunk-RSDTHO3I.js} +1 -1
- package/dist/{chunk-WJJBIAJI.js → chunk-S4WDCOQD.js} +101 -21
- package/dist/{chunk-U4BIWWRA.js → chunk-S7TEUVP7.js} +2 -2
- package/dist/{chunk-FWPGOIFA.js → chunk-SANVDYAL.js} +1 -1
- package/dist/{chunk-EAYVJOSP.js → chunk-SCLV2T6Z.js} +2 -2
- package/dist/{chunk-YT7ZBFWO.js → chunk-SM22ETAM.js} +5 -5
- package/dist/{chunk-C3SCJHQN.js → chunk-SQ7J4KTS.js} +2 -2
- package/dist/{chunk-AW77UWCZ.js → chunk-SR3DYN52.js} +4 -3
- package/dist/{chunk-ZIELZO2F.js → chunk-TW7BMUFE.js} +2 -2
- package/dist/{chunk-WIYFXWRI.js → chunk-U3I6S3RO.js} +1 -1
- package/dist/{chunk-55NZ2MMZ.js → chunk-UNS2F7DK.js} +1 -1
- package/dist/{chunk-VKHGNAFW.js → chunk-US3WGTFG.js} +2 -2
- package/dist/{chunk-4DHTLLPG.js → chunk-VACZ4ZLQ.js} +4 -4
- package/dist/{chunk-4UQMRTSC.js → chunk-VH3TGSWE.js} +46 -2
- package/dist/{chunk-L2FUUVMT.js → chunk-VKVK5D2F.js} +4 -4
- package/dist/{chunk-53KPM2IF.js → chunk-VOTOLN64.js} +1 -1
- package/dist/{chunk-GOIUTVZR.js → chunk-VTXMQTXK.js} +1 -1
- package/dist/{chunk-3BZMCD7I.js → chunk-VWPX7GLC.js} +1 -1
- package/dist/{chunk-RDDZLUKZ.js → chunk-VX37IW2B.js} +4 -4
- package/dist/{chunk-LL2UR6WT.js → chunk-WEIAADFK.js} +6 -6
- package/dist/chunk-WP3B4NEU.js +32 -0
- package/dist/{chunk-LHIWM2J5.js → chunk-WPX74IOA.js} +1 -1
- package/dist/{chunk-56LEZVAH.js → chunk-WW7ULZUY.js} +1 -1
- package/dist/{chunk-SUMFHYD5.js → chunk-WYRUCSGW.js} +2 -2
- package/dist/{chunk-ZZHAKDOJ.js → chunk-X2OJSE2R.js} +4 -4
- package/dist/{chunk-QMEFPNCA.js → chunk-XLD5JXJZ.js} +2 -2
- package/dist/{chunk-XYCUMBBJ.js → chunk-XS6QEL45.js} +2 -2
- package/dist/{chunk-HOOIU4KF.js → chunk-XWOFQSGH.js} +1 -1
- package/dist/{chunk-VYKDZ6J4.js → chunk-Y4CKZNKV.js} +11 -11
- package/dist/{chunk-YDX675U4.js → chunk-Y7PMRILC.js} +8 -8
- package/dist/{chunk-BOHYPLFV.js → chunk-YMMREB3P.js} +1 -1
- package/dist/{chunk-5A4JNOK3.js → chunk-YPHF4ZG6.js} +1 -1
- package/dist/{chunk-TSM7EZND.js → chunk-YWMY2I7B.js} +1 -1
- package/dist/{chunk-PAXNPCS2.js → chunk-YWZQKODL.js} +6 -6
- package/dist/{chunk-QE57IFSR.js → chunk-Z476HUMI.js} +1 -14
- package/dist/{chunk-6K3WDPGJ.js → chunk-ZBRRK3Y6.js} +3 -3
- package/dist/chunk-ZH6TIKKW.js +61 -0
- package/dist/{collection-add-products-PISO2X3T.js → collection-add-products-DDKLPJE6.js} +40 -40
- package/dist/{collection-create-3ZCR6VGP.js → collection-create-W75VOWNN.js} +4 -4
- package/dist/{collection-detail-FQYKALDQ.js → collection-detail-T5QEBZTV.js} +42 -42
- package/dist/{collection-edit-LIIDFJ6T.js → collection-edit-3ZZCDIUY.js} +3 -3
- package/dist/{collection-icon-edit-GMWBV5EA.js → collection-icon-edit-L6VSK4DB.js} +4 -4
- package/dist/collection-list-BTR6IBDZ.js +85 -0
- package/dist/{collection-media-FHD3IAES.js → collection-media-PKTR7VDY.js} +4 -4
- package/dist/{collection-metadata-PEBMVFM3.js → collection-metadata-XM2EBCWF.js} +32 -32
- package/dist/{commission-rule-commission-edit-VAHTLFOO.js → commission-rule-commission-edit-KLGYDUOC.js} +6 -6
- package/dist/{commission-rule-create-3BNKCPVT.js → commission-rule-create-CDLLQIY4.js} +6 -6
- package/dist/{commission-rule-detail-FSV6PA6Y.js → commission-rule-detail-LFEZ5U6V.js} +8 -8
- package/dist/{commission-rule-edit-PQFGFD7L.js → commission-rule-edit-5CFKPI7U.js} +3 -3
- package/dist/{commissions-list-6ZFSZENW.js → commissions-list-X54FEOEZ.js} +10 -10
- package/dist/{customer-create-LGJHCECL.js → customer-create-46H2N34Z.js} +2 -2
- package/dist/{customer-create-address-MUDSAQXG.js → customer-create-address-OGWYC7BZ.js} +2 -2
- package/dist/{customer-detail-O3QCTJQE.js → customer-detail-GWF2DLBE.js} +37 -37
- package/dist/{customer-edit-APMIOGMM.js → customer-edit-RBPGTG32.js} +2 -2
- package/dist/{customer-edit-address-C2XFCA7J.js → customer-edit-address-PGWY42QU.js} +2 -2
- package/dist/{customer-group-add-customers-PIJRCYE7.js → customer-group-add-customers-6HJMWGW2.js} +5 -5
- package/dist/{customer-group-create-GEIEIY7G.js → customer-group-create-WER6DODC.js} +2 -2
- package/dist/{customer-group-detail-VFE2OHMV.js → customer-group-detail-FX3PNES4.js} +36 -36
- package/dist/{customer-group-edit-WY4I5BJ2.js → customer-group-edit-A74OFHEH.js} +2 -2
- package/dist/customer-group-list-KBZBSGTQ.js +57 -0
- package/dist/{customer-group-metadata-2GHR645Q.js → customer-group-metadata-FUJFFWCO.js} +32 -32
- package/dist/{customer-list-RUUTCIBN.js → customer-list-IJJEZDOZ.js} +6 -6
- package/dist/{customer-metadata-H2BVMMPM.js → customer-metadata-GWZC456X.js} +32 -32
- package/dist/{customers-add-customer-group-B3HTSZTK.js → customers-add-customer-group-OQBT7CUI.js} +35 -35
- package/dist/{edit-inventory-item-DD5ZG32Y.js → edit-inventory-item-JLTBJEVA.js} +38 -38
- package/dist/{edit-inventory-item-attributes-VNLOF6NO.js → edit-inventory-item-attributes-BENAJP4P.js} +34 -33
- package/dist/{edit-reservation-CA6SMY3V.js → edit-reservation-FVJZ2NRW.js} +70 -22
- package/dist/{edit-rules-MQICWWOW.js → edit-rules-BVZS6GBQ.js} +35 -35
- package/dist/extension-targets.d.ts +6 -4
- package/dist/{global-commission-edit-FDRWR3GS.js → global-commission-edit-JEBLF6CT.js} +6 -6
- package/dist/index.css +49 -25
- package/dist/index.d.ts +13 -2
- package/dist/index.js +334 -285
- package/dist/{inventory-detail-MD6UAJ6S.js → inventory-detail-XVZC3EKF.js} +38 -37
- package/dist/{inventory-list-ZQ7T7UP5.js → inventory-list-47UGRRO4.js} +7 -6
- package/dist/{inventory-metadata-SVEEQKIY.js → inventory-metadata-FGHOW3YG.js} +32 -32
- package/dist/{inventory-stock-3WSWPSMT.js → inventory-stock-66AFFHZN.js} +51 -42
- package/dist/{invite-Z6ZEQ5ZV.js → invite-6WUERQLW.js} +3 -3
- package/dist/{loader-5VHWG2HX.js → loader-3VTBJUA2.js} +2 -2
- package/dist/{loader-XDYR2V3I.js → loader-G2ECT6LC.js} +2 -2
- package/dist/{location-create-UJM54XUE.js → location-create-XCEPUY44.js} +2 -2
- package/dist/{location-detail-B3HC5UUP.js → location-detail-TVHDXEV5.js} +35 -35
- package/dist/{location-edit-YT42REFT.js → location-edit-TQFZN2RW.js} +2 -2
- package/dist/{location-fulfillment-providers-GZN6ZGLA.js → location-fulfillment-providers-CE2VQZK5.js} +40 -40
- package/dist/location-list-VIAP63HV.js +55 -0
- package/dist/{location-sales-channels-MMRCF6QT.js → location-sales-channels-UCPVQLCE.js} +4 -4
- package/dist/{location-service-zone-create-CKCO743Z.js → location-service-zone-create-MAN7KD4N.js} +7 -7
- package/dist/{location-service-zone-edit-JI57PTL4.js → location-service-zone-edit-36TATZI4.js} +4 -4
- package/dist/{location-service-zone-manage-areas-JT4LBLZK.js → location-service-zone-manage-areas-EZS5PYJI.js} +7 -7
- package/dist/location-service-zone-shipping-option-create-CH5LD2QT.js +60 -0
- package/dist/{location-service-zone-shipping-option-edit-WPPGPHTR.js → location-service-zone-shipping-option-edit-HOEBC3D6.js} +4 -4
- package/dist/{location-service-zone-shipping-option-pricing-VNBDBAEC.js → location-service-zone-shipping-option-pricing-D5Q4FLAP.js} +6 -6
- package/dist/login-TZHRVYA5.js +249 -0
- package/dist/{manage-locations-E2ODEJC5.js → manage-locations-5CF36BYN.js} +21 -9
- package/dist/{marketplace-add-currencies-5B2XYBLM.js → marketplace-add-currencies-RWT3F2WT.js} +6 -6
- package/dist/{marketplace-detail-DFILEROF.js → marketplace-detail-D2R5PFX2.js} +35 -35
- package/dist/{marketplace-edit-LUBE4HXK.js → marketplace-edit-GWOPSYXL.js} +4 -4
- package/dist/{marketplace-metadata-75DPIUID.js → marketplace-metadata-EGDXYKCE.js} +32 -32
- package/dist/{offer-detail-page-C6FK5MCN.js → offer-detail-page-GLOI33TW.js} +9 -9
- package/dist/{offer-variant-detail-page-FMR3NOJV.js → offer-variant-detail-page-5PLRLGNQ.js} +5 -5
- package/dist/{offers-ZY2ZN2ZG.js → offers-76PAVEND.js} +43 -41
- package/dist/{order-create-claim-HTNJIIBZ.js → order-create-claim-SCUH6IYB.js} +13 -13
- package/dist/{order-create-edit-SC3SORRB.js → order-create-edit-52VT7JLO.js} +9 -9
- package/dist/{order-create-exchange-KB24UQUR.js → order-create-exchange-ONVRQAYR.js} +41 -41
- package/dist/{order-create-refund-FWRG3VIW.js → order-create-refund-4MKAZL7C.js} +32 -32
- package/dist/{order-create-return-3LXNXHV4.js → order-create-return-NW7E2KL3.js} +11 -11
- package/dist/{order-detail-B4OZSDPP.js → order-detail-QU4GQRJI.js} +41 -41
- package/dist/{order-edit-billing-address-UYZNY77G.js → order-edit-billing-address-5OYY6SEI.js} +36 -36
- package/dist/{order-edit-email-GVGQLXNK.js → order-edit-email-GM3HKYR6.js} +32 -32
- package/dist/{order-edit-shipping-address-RS3PRPVM.js → order-edit-shipping-address-ZWGROPKU.js} +35 -35
- package/dist/{order-list-3JO46M43.js → order-list-LEPNY6ZS.js} +14 -14
- package/dist/{order-metadata-2TOR4BJY.js → order-metadata-VIG5MGYV.js} +32 -32
- package/dist/{order-request-transfer-6JJ2FQPA.js → order-request-transfer-OTGRHY6N.js} +33 -33
- package/dist/pages/index.d.ts +274 -335
- package/dist/pages/index.js +199 -197
- package/dist/{payout-detail-E6CFHU6I.js → payout-detail-UTFO6U4H.js} +3 -3
- package/dist/{payout-list-FUKHV2JT.js → payout-list-HRVCGZJS.js} +5 -5
- package/dist/price-list-configuration-4OTKSK5N.js +150 -0
- package/dist/price-list-create-PPHOWAAS.js +74 -0
- package/dist/price-list-customer-availability-WU2OGO37.js +190 -0
- package/dist/{price-list-detail-CXV4KN2W.js → price-list-detail-ULHZGIJQ.js} +45 -48
- package/dist/{price-list-edit-FQVZW4FT.js → price-list-edit-ZZZDR62K.js} +61 -44
- package/dist/{price-list-list-WHHPZCDO.js → price-list-list-JC5EDBH6.js} +9 -11
- package/dist/price-list-prices-add-UDILFRKA.js +70 -0
- package/dist/{price-list-prices-edit-PZN63VWV.js → price-list-prices-edit-XRMJB47E.js} +168 -125
- package/dist/{product-add-existing-attributes-LQ3S5RBE.js → product-add-existing-attributes-OAPNHMJG.js} +35 -35
- package/dist/{product-attributes-JUEMRL5V.js → product-attributes-PCOM3JRX.js} +2 -2
- package/dist/{product-bulk-edit-7GWRXFUC.js → product-bulk-edit-GQHEFVOG.js} +2 -2
- package/dist/product-create-BPT4WAG2.js +77 -0
- package/dist/{product-create-attribute-7P4LZP5R.js → product-create-attribute-U3M5Y7RN.js} +3 -3
- package/dist/{product-create-variant-74KLCMEU.js → product-create-variant-GND5NOC3.js} +6 -6
- package/dist/{product-detail-JBKJRTGZ.js → product-detail-BMY3ZIZO.js} +38 -38
- package/dist/{product-edit-GAYL53YC.js → product-edit-2CMVTDWT.js} +3 -3
- package/dist/{product-edit-attribute-EBES4PJ3.js → product-edit-attribute-W3AS47FM.js} +3 -3
- package/dist/{product-list-NJUYBXMR.js → product-list-C4GEKJMG.js} +41 -41
- package/dist/{product-media-4LDPBVQ5.js → product-media-34LLNGQX.js} +5 -5
- package/dist/{product-metadata-YZKS2MQV.js → product-metadata-5CRGB7TR.js} +32 -32
- package/dist/{product-organization-6TQ4HKB2.js → product-organization-XS62HARL.js} +6 -6
- package/dist/{product-sales-channels-K7VOMWUP.js → product-sales-channels-OGWCSG2W.js} +3 -3
- package/dist/{product-shipping-profile-SYGR4IF7.js → product-shipping-profile-SWB5FK7S.js} +3 -3
- package/dist/{product-tag-create-J6SUTGLF.js → product-tag-create-QORH6X2D.js} +32 -32
- package/dist/{product-tag-detail-M4DBYZ7X.js → product-tag-detail-NVT66WIF.js} +57 -56
- package/dist/{product-tag-edit-XTCRJPYD.js → product-tag-edit-JWYVCPCC.js} +32 -32
- package/dist/{product-tag-list-ZXOAH2VF.js → product-tag-list-S4AN525N.js} +57 -56
- package/dist/{product-tag-metadata-UMQPCGKY.js → product-tag-metadata-BCUPIIJ5.js} +32 -32
- package/dist/{product-type-create-CWWJMDLN.js → product-type-create-BJMYBP2R.js} +2 -2
- package/dist/{product-type-detail-SKGWES74.js → product-type-detail-O2YKCRKH.js} +42 -42
- package/dist/{product-type-edit-ZADGA6PV.js → product-type-edit-IEMK45NK.js} +2 -2
- package/dist/{product-type-list-3OL5TJSS.js → product-type-list-NNNFCCWS.js} +6 -6
- package/dist/{product-type-metadata-RIRSRMDO.js → product-type-metadata-DKBBQB6R.js} +32 -32
- package/dist/{product-variant-detail-XWREJ4EK.js → product-variant-detail-XHMS2UT5.js} +33 -33
- package/dist/{product-variant-edit-PCD66JBM.js → product-variant-edit-BCO53OXI.js} +39 -39
- package/dist/{product-variant-metadata-UJOLOTCQ.js → product-variant-metadata-ETVJBXSW.js} +32 -32
- package/dist/{profile-detail-RLGHULMT.js → profile-detail-3T7XIJIX.js} +3 -3
- package/dist/{profile-edit-NWUQUWNW.js → profile-edit-34K6IDKU.js} +2 -2
- package/dist/{promotion-add-campaign-MAVIGZQ5.js → promotion-add-campaign-TVTKI5EP.js} +8 -8
- package/dist/promotion-create-7ZUJ4W2J.js +57 -0
- package/dist/{promotion-detail-VOFBW6ZF.js → promotion-detail-4WNHEOG4.js} +38 -37
- package/dist/{promotion-edit-details-WMH7KQFD.js → promotion-edit-details-FFTEJ2CV.js} +3 -3
- package/dist/{promotion-list-RI5VFG7C.js → promotion-list-AJ5NBDZ2.js} +10 -10
- package/dist/{refund-reason-create-XEBLTB3C.js → refund-reason-create-P5FUFEGK.js} +32 -32
- package/dist/{refund-reason-edit-J3KQ2FVF.js → refund-reason-edit-AKOTWXCE.js} +32 -32
- package/dist/{refund-reason-list-I2EACZ64.js → refund-reason-list-G3PXZY73.js} +49 -48
- package/dist/{region-add-countries-WZNV7T6R.js → region-add-countries-TUPPVB4U.js} +5 -5
- package/dist/{region-create-5IWBEU2F.js → region-create-UVMXMB2D.js} +7 -7
- package/dist/{region-detail-7EVI6XVZ.js → region-detail-7SHGTLWA.js} +7 -7
- package/dist/{region-edit-BXH6TBJG.js → region-edit-N6FXU7NY.js} +5 -5
- package/dist/{region-list-BP6QJVOI.js → region-list-XFQ3EQZ4.js} +6 -6
- package/dist/{region-metadata-GDKM4ND5.js → region-metadata-Q6HEMCHD.js} +32 -32
- package/dist/{reservation-create-77EYD2ZZ.js → reservation-create-H3T3AHTK.js} +47 -17
- package/dist/{reservation-detail-M7ZAEO3G.js → reservation-detail-5GYGVM3M.js} +33 -34
- package/dist/{reservation-list-5HETCOVJ.js → reservation-list-CRPRHIMT.js} +8 -7
- package/dist/{reservation-metadata-E6WP6SHE.js → reservation-metadata-P4G3JEDW.js} +32 -32
- package/dist/{reset-password-P45OKOT4.js → reset-password-7G75C4RO.js} +3 -3
- package/dist/{return-reason-create-K55MK47K.js → return-reason-create-GNUVNYS5.js} +2 -2
- package/dist/{return-reason-edit-3N5K4WLG.js → return-reason-edit-5ZICBOB3.js} +2 -2
- package/dist/{return-reason-list-OVHCCW37.js → return-reason-list-XDLTSIM7.js} +21 -20
- package/dist/review-detail-K555FECH.js +65 -0
- package/dist/review-edit-VD4JATST.js +203 -0
- package/dist/review-list-BTBPA2HV.js +31 -0
- package/dist/review-respond-N6JNU5HF.js +130 -0
- package/dist/{sales-channel-add-products-Z4LR5OXJ.js → sales-channel-add-products-WZ475HH6.js} +40 -40
- package/dist/{sales-channel-create-BYCHXO7N.js → sales-channel-create-WEF7QXKI.js} +3 -3
- package/dist/{sales-channel-detail-BTCUXNDG.js → sales-channel-detail-DTBXMMAX.js} +41 -41
- package/dist/{sales-channel-edit-KHHDBZQG.js → sales-channel-edit-2SCFS7SA.js} +3 -3
- package/dist/sales-channel-list-DUIEWTAO.js +52 -0
- package/dist/{sales-channel-metadata-QAXDOSPG.js → sales-channel-metadata-NBWFH4QX.js} +32 -32
- package/dist/{shipping-option-type-create-AULMQGRN.js → shipping-option-type-create-M23CI42D.js} +32 -32
- package/dist/{shipping-option-type-detail-EQDAW4GJ.js → shipping-option-type-detail-QIJZQ5WW.js} +34 -34
- package/dist/{shipping-option-type-edit-NVXGY32I.js → shipping-option-type-edit-6PWBHHFP.js} +32 -32
- package/dist/shipping-option-type-list-R4JPQOAA.js +60 -0
- package/dist/{shipping-profile-create-FKAYICYI.js → shipping-profile-create-FT6KK2H5.js} +2 -2
- package/dist/{shipping-profile-detail-2JSKRGVO.js → shipping-profile-detail-KPRFJE4V.js} +3 -3
- package/dist/{shipping-profile-metadata-OW5IGIW3.js → shipping-profile-metadata-S7Z3IC6I.js} +32 -32
- package/dist/{shipping-profiles-list-KKWDAWO4.js → shipping-profiles-list-UKD47NUF.js} +5 -5
- package/dist/{store-address-edit-OKIZHTIJ.js → store-address-edit-VLYDLTHQ.js} +2 -2
- package/dist/{store-bulk-edit-KOBCPVNM.js → store-bulk-edit-UMDP7YTD.js} +3 -3
- package/dist/{store-closure-edit-FXUECFDN.js → store-closure-edit-AT4DMZRF.js} +2 -2
- package/dist/{store-create-YPCF45XH.js → store-create-J4SL6SY3.js} +32 -32
- package/dist/{store-details-LDBTEJZG.js → store-details-G4DVQBKE.js} +46 -45
- package/dist/{store-edit-BGQJW7GH.js → store-edit-2MJMEZ3D.js} +5 -5
- package/dist/store-list-JVTZXRE4.js +82 -0
- package/dist/{store-member-invite-2WGAJVIX.js → store-member-invite-R3LYRUQX.js} +4 -4
- package/dist/{store-payment-details-edit-AQDLN7BO.js → store-payment-details-edit-VCCSUXIV.js} +2 -2
- package/dist/{store-professional-details-edit-CUHZ7JQM.js → store-professional-details-edit-MXW6WBQF.js} +2 -2
- package/dist/{tax-region-create-7UUVKDZM.js → tax-region-create-P4IKQNTU.js} +38 -38
- package/dist/tax-region-detail-NBRSCKTD.js +69 -0
- package/dist/{tax-region-edit-UQAMWLO5.js → tax-region-edit-I27QZZPB.js} +33 -33
- package/dist/{tax-region-list-MGSVCJVE.js → tax-region-list-JC4QYF5B.js} +7 -7
- package/dist/{tax-region-metadata-UONPCPC6.js → tax-region-metadata-6YIZSRLO.js} +32 -32
- package/dist/{tax-region-province-create-FNXJVUDS.js → tax-region-province-create-RYNRPGY5.js} +2 -2
- package/dist/{tax-region-province-detail-V7NV2G6T.js → tax-region-province-detail-WU5GD7VW.js} +37 -37
- package/dist/{tax-region-tax-override-create-E7VNVYIR.js → tax-region-tax-override-create-XR644KO4.js} +56 -55
- package/dist/{tax-region-tax-override-edit-4OT5ZOZD.js → tax-region-tax-override-edit-5GRR6SVC.js} +56 -55
- package/dist/{tax-region-tax-rate-create-N7E2HDJ7.js → tax-region-tax-rate-create-DLLXVZPG.js} +3 -3
- package/dist/{tax-region-tax-rate-edit-KLVNNKQJ.js → tax-region-tax-rate-edit-HN5VDJAZ.js} +3 -3
- package/dist/{user-detail-IYB2LYGS.js → user-detail-5LOE6QGK.js} +4 -4
- package/dist/{user-edit-NI6IKAX7.js → user-edit-Z3ODTSMN.js} +2 -2
- package/dist/{user-invite-AQMFF7YL.js → user-invite-WG57KWD3.js} +4 -4
- package/dist/{user-list-DE6EAICL.js → user-list-P7JCBIOR.js} +5 -5
- package/dist/{user-metadata-OXHKB6LT.js → user-metadata-2PEU2IJE.js} +32 -32
- package/package.json +6 -6
- package/dist/attribute-list-RKESEUDY.js +0 -61
- package/dist/chunk-4CRCM45N.js +0 -164
- package/dist/chunk-6IJMSVC6.js +0 -16
- package/dist/chunk-APAT344J.js +0 -144
- package/dist/chunk-BNOKKKUU.js +0 -88
- package/dist/chunk-DFYBHFBM.js +0 -499
- package/dist/chunk-NASNLJLQ.js +0 -744
- package/dist/chunk-U6EIJREE.js +0 -435
- package/dist/collection-list-GVZPRCOV.js +0 -85
- package/dist/customer-group-list-R3AR2DFN.js +0 -57
- package/dist/inventory-create-VDO4OWZJ.js +0 -58
- package/dist/location-list-4RNLWRLN.js +0 -55
- package/dist/location-service-zone-shipping-option-create-CJI2IDS2.js +0 -60
- package/dist/login-7R2QVOMB.js +0 -266
- package/dist/price-list-configuration-FWKEEKKA.js +0 -356
- package/dist/price-list-create-JSJQQBOM.js +0 -77
- package/dist/price-list-prices-add-JPNY5ITI.js +0 -72
- package/dist/product-create-SRVQFBEE.js +0 -77
- package/dist/promotion-create-42BECIQE.js +0 -57
- package/dist/sales-channel-list-J4624AXE.js +0 -52
- package/dist/shipping-option-type-list-5O4G6THO.js +0 -60
- package/dist/store-list-QGOGPQGQ.js +0 -82
- package/dist/tax-region-detail-CV3QWTNJ.js +0 -69
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PriceListCreateOffersSchema,
|
|
3
|
+
PriceListRulesSchema,
|
|
4
|
+
buildOfferGridData,
|
|
5
|
+
usePriceListCurrencyData,
|
|
6
|
+
usePriceListGridColumns
|
|
7
|
+
} from "./chunk-ELLSTZ5X.js";
|
|
8
|
+
import {
|
|
9
|
+
useCustomerGroupTableColumns
|
|
10
|
+
} from "./chunk-54EPH67T.js";
|
|
11
|
+
import {
|
|
12
|
+
useOfferTableColumns,
|
|
13
|
+
useOfferTableFilters,
|
|
14
|
+
useOfferTableQuery
|
|
15
|
+
} from "./chunk-EPUODBUW.js";
|
|
16
|
+
import {
|
|
17
|
+
extractPricesFromOffers
|
|
18
|
+
} from "./chunk-KVAD5JGS.js";
|
|
19
|
+
import {
|
|
20
|
+
useCustomerGroupTableFilters
|
|
21
|
+
} from "./chunk-CFQX7HAW.js";
|
|
22
|
+
import {
|
|
23
|
+
useOffers
|
|
24
|
+
} from "./chunk-GNNOFJAK.js";
|
|
25
|
+
import {
|
|
26
|
+
useCustomerGroupTableQuery
|
|
27
|
+
} from "./chunk-3XOE4NV5.js";
|
|
28
|
+
import {
|
|
29
|
+
TabbedForm,
|
|
30
|
+
defineTabMeta,
|
|
31
|
+
useTabbedForm
|
|
32
|
+
} from "./chunk-FREUYHMS.js";
|
|
33
|
+
import {
|
|
34
|
+
DataGrid
|
|
35
|
+
} from "./chunk-JXSXBSV6.js";
|
|
36
|
+
import {
|
|
37
|
+
RouteFocusModal,
|
|
38
|
+
StackedDrawer,
|
|
39
|
+
StackedFocusModal,
|
|
40
|
+
useRouteModal,
|
|
41
|
+
useStackedModal
|
|
42
|
+
} from "./chunk-FWJLS7XD.js";
|
|
43
|
+
import {
|
|
44
|
+
Form
|
|
45
|
+
} from "./chunk-3QSRE5LS.js";
|
|
46
|
+
import {
|
|
47
|
+
_DataTable,
|
|
48
|
+
useDataTable
|
|
49
|
+
} from "./chunk-BSXBRI23.js";
|
|
50
|
+
import {
|
|
51
|
+
useCreatePriceList
|
|
52
|
+
} from "./chunk-56XMCNDS.js";
|
|
53
|
+
import {
|
|
54
|
+
useCustomerGroups
|
|
55
|
+
} from "./chunk-XWOFQSGH.js";
|
|
56
|
+
import {
|
|
57
|
+
useDocumentDirection
|
|
58
|
+
} from "./chunk-Y7QKP6QU.js";
|
|
59
|
+
import {
|
|
60
|
+
useProducts
|
|
61
|
+
} from "./chunk-Z476HUMI.js";
|
|
62
|
+
|
|
63
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/schema.ts
|
|
64
|
+
import i18n from "i18next";
|
|
65
|
+
import { z } from "zod";
|
|
66
|
+
var PricingCustomerGroupsArray = z.array(
|
|
67
|
+
z.object({
|
|
68
|
+
id: z.string(),
|
|
69
|
+
name: z.string()
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
var PricingCreateSchema = z.object({
|
|
73
|
+
type: z.enum(["sale", "override"]),
|
|
74
|
+
status: z.enum(["draft", "active"]),
|
|
75
|
+
title: z.string().min(1, i18n.t("priceLists.create.validation.title")),
|
|
76
|
+
description: z.string().min(1, i18n.t("priceLists.create.validation.description")),
|
|
77
|
+
starts_at: z.date().nullish(),
|
|
78
|
+
ends_at: z.date().nullish(),
|
|
79
|
+
product_ids: z.array(z.object({ id: z.string() })).min(1),
|
|
80
|
+
// Offer ids selected in the picker (every variant of the chosen store+product
|
|
81
|
+
// groups). The Prices tab hydrates `offers` from these.
|
|
82
|
+
offer_ids: z.array(z.string()).default([]),
|
|
83
|
+
// Offer-keyed prices (offer_id -> { variant_id, prices }), so the same variant
|
|
84
|
+
// from two sellers stays separate.
|
|
85
|
+
offers: PriceListCreateOffersSchema.default({}),
|
|
86
|
+
rules: PriceListRulesSchema.nullish()
|
|
87
|
+
});
|
|
88
|
+
var PricingDetailsSchema = PricingCreateSchema.pick({
|
|
89
|
+
type: true,
|
|
90
|
+
title: true,
|
|
91
|
+
description: true,
|
|
92
|
+
starts_at: true,
|
|
93
|
+
ends_at: true
|
|
94
|
+
});
|
|
95
|
+
var PricingDetailsFields = Object.keys(
|
|
96
|
+
PricingDetailsSchema.shape
|
|
97
|
+
);
|
|
98
|
+
var PricingProductsSchema = PricingCreateSchema.pick({
|
|
99
|
+
product_ids: true
|
|
100
|
+
});
|
|
101
|
+
var PricingProductsFields = Object.keys(
|
|
102
|
+
PricingProductsSchema.shape
|
|
103
|
+
);
|
|
104
|
+
var PricingPricesSchema = PricingCreateSchema.pick({
|
|
105
|
+
offers: true
|
|
106
|
+
});
|
|
107
|
+
var PricingPricesFields = Object.keys(
|
|
108
|
+
PricingPricesSchema.shape
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// src/pages/price-lists/price-list-create/price-list-create.tsx
|
|
112
|
+
import { Children as Children2 } from "react";
|
|
113
|
+
|
|
114
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx
|
|
115
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
116
|
+
import { toast } from "@medusajs/ui";
|
|
117
|
+
import { Children, useMemo as useMemo4 } from "react";
|
|
118
|
+
import { useForm } from "react-hook-form";
|
|
119
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
120
|
+
|
|
121
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-details-form.tsx
|
|
122
|
+
import { MagnifyingGlass, XMarkMini } from "@medusajs/icons";
|
|
123
|
+
import {
|
|
124
|
+
Button as Button2,
|
|
125
|
+
DatePicker,
|
|
126
|
+
Divider,
|
|
127
|
+
Heading,
|
|
128
|
+
IconButton,
|
|
129
|
+
Input,
|
|
130
|
+
RadioGroup,
|
|
131
|
+
Text,
|
|
132
|
+
Textarea,
|
|
133
|
+
clx
|
|
134
|
+
} from "@medusajs/ui";
|
|
135
|
+
import { useFieldArray } from "react-hook-form";
|
|
136
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
137
|
+
|
|
138
|
+
// src/pages/price-lists/common/components/price-list-customer-group-rule-form/price-list-customer-group-rule-form.tsx
|
|
139
|
+
import { Button, Checkbox } from "@medusajs/ui";
|
|
140
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
141
|
+
import {
|
|
142
|
+
createColumnHelper
|
|
143
|
+
} from "@tanstack/react-table";
|
|
144
|
+
import { useEffect, useMemo, useState } from "react";
|
|
145
|
+
import { useTranslation } from "react-i18next";
|
|
146
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
147
|
+
var PAGE_SIZE = 50;
|
|
148
|
+
var PREFIX = "cg";
|
|
149
|
+
var initRowSelection = (state) => {
|
|
150
|
+
return state.reduce((acc, group) => {
|
|
151
|
+
acc[group.id] = true;
|
|
152
|
+
return acc;
|
|
153
|
+
}, {});
|
|
154
|
+
};
|
|
155
|
+
var PriceListCustomerGroupRuleForm = ({
|
|
156
|
+
state,
|
|
157
|
+
setState,
|
|
158
|
+
type
|
|
159
|
+
}) => {
|
|
160
|
+
const { t } = useTranslation();
|
|
161
|
+
const [rowSelection, setRowSelection] = useState(
|
|
162
|
+
initRowSelection(state)
|
|
163
|
+
);
|
|
164
|
+
const [intermediate, setIntermediate] = useState(state);
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
setRowSelection(initRowSelection(state));
|
|
167
|
+
setIntermediate(state);
|
|
168
|
+
}, [state]);
|
|
169
|
+
const { searchParams, raw } = useCustomerGroupTableQuery({
|
|
170
|
+
pageSize: PAGE_SIZE,
|
|
171
|
+
prefix: PREFIX
|
|
172
|
+
});
|
|
173
|
+
const { customer_groups, count, isLoading, isError, error } = useCustomerGroups(
|
|
174
|
+
{ ...searchParams, fields: "id,name,customers.id" },
|
|
175
|
+
{
|
|
176
|
+
placeholderData: keepPreviousData
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
const updater = (value) => {
|
|
180
|
+
const state2 = typeof value === "function" ? value(rowSelection) : value;
|
|
181
|
+
const currentIds = Object.keys(rowSelection);
|
|
182
|
+
const ids = Object.keys(state2);
|
|
183
|
+
const newIds = ids.filter((id) => !currentIds.includes(id));
|
|
184
|
+
const removedIds = currentIds.filter((id) => !ids.includes(id));
|
|
185
|
+
const newCustomerGroups = customer_groups?.filter((cg) => newIds.includes(cg.id)).map((cg) => ({ id: cg.id, name: cg.name })) || [];
|
|
186
|
+
const filteredIntermediate = intermediate.filter(
|
|
187
|
+
(cg) => !removedIds.includes(cg.id)
|
|
188
|
+
);
|
|
189
|
+
setIntermediate([...filteredIntermediate, ...newCustomerGroups]);
|
|
190
|
+
setRowSelection(state2);
|
|
191
|
+
};
|
|
192
|
+
const handleSave = () => {
|
|
193
|
+
setState(intermediate);
|
|
194
|
+
};
|
|
195
|
+
const filters = useCustomerGroupTableFilters();
|
|
196
|
+
const columns = useColumns();
|
|
197
|
+
const { table } = useDataTable({
|
|
198
|
+
data: customer_groups || [],
|
|
199
|
+
columns,
|
|
200
|
+
count,
|
|
201
|
+
enablePagination: true,
|
|
202
|
+
enableRowSelection: true,
|
|
203
|
+
getRowId: (row) => row.id,
|
|
204
|
+
rowSelection: {
|
|
205
|
+
state: rowSelection,
|
|
206
|
+
updater
|
|
207
|
+
},
|
|
208
|
+
pageSize: PAGE_SIZE,
|
|
209
|
+
prefix: PREFIX
|
|
210
|
+
});
|
|
211
|
+
const Component = type === "focus" ? StackedFocusModal : StackedDrawer;
|
|
212
|
+
if (isError) {
|
|
213
|
+
throw error;
|
|
214
|
+
}
|
|
215
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex size-full flex-col overflow-hidden", children: [
|
|
216
|
+
/* @__PURE__ */ jsx(Component.Body, { className: "min-h-0 p-0", children: /* @__PURE__ */ jsx(
|
|
217
|
+
_DataTable,
|
|
218
|
+
{
|
|
219
|
+
table,
|
|
220
|
+
columns,
|
|
221
|
+
pageSize: PAGE_SIZE,
|
|
222
|
+
count,
|
|
223
|
+
isLoading,
|
|
224
|
+
filters,
|
|
225
|
+
orderBy: [
|
|
226
|
+
{ key: "name", label: t("fields.name") },
|
|
227
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
228
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
229
|
+
],
|
|
230
|
+
layout: "fill",
|
|
231
|
+
pagination: true,
|
|
232
|
+
search: true,
|
|
233
|
+
prefix: PREFIX,
|
|
234
|
+
queryObject: raw
|
|
235
|
+
}
|
|
236
|
+
) }),
|
|
237
|
+
/* @__PURE__ */ jsxs(Component.Footer, { children: [
|
|
238
|
+
/* @__PURE__ */ jsx(Component.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", type: "button", children: t("actions.cancel") }) }),
|
|
239
|
+
/* @__PURE__ */ jsx(Button, { type: "button", size: "small", onClick: handleSave, children: t("actions.save") })
|
|
240
|
+
] })
|
|
241
|
+
] });
|
|
242
|
+
};
|
|
243
|
+
var columnHelper = createColumnHelper();
|
|
244
|
+
var useColumns = () => {
|
|
245
|
+
const base = useCustomerGroupTableColumns();
|
|
246
|
+
return useMemo(
|
|
247
|
+
() => [
|
|
248
|
+
columnHelper.display({
|
|
249
|
+
id: "select",
|
|
250
|
+
header: ({ table }) => {
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
Checkbox,
|
|
253
|
+
{
|
|
254
|
+
checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
|
|
255
|
+
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value)
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
},
|
|
259
|
+
cell: ({ row }) => {
|
|
260
|
+
return /* @__PURE__ */ jsx(
|
|
261
|
+
Checkbox,
|
|
262
|
+
{
|
|
263
|
+
checked: row.getIsSelected(),
|
|
264
|
+
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
265
|
+
onClick: (e) => {
|
|
266
|
+
e.stopPropagation();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
...base
|
|
273
|
+
],
|
|
274
|
+
[base]
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-details-form.tsx
|
|
279
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
280
|
+
var Root = () => {
|
|
281
|
+
const { t } = useTranslation2();
|
|
282
|
+
const form = useTabbedForm();
|
|
283
|
+
const direction = useDocumentDirection();
|
|
284
|
+
const { fields, remove, append } = useFieldArray({
|
|
285
|
+
control: form.control,
|
|
286
|
+
name: "rules.customer_group_id",
|
|
287
|
+
keyName: "cg_id"
|
|
288
|
+
});
|
|
289
|
+
const { setIsOpen } = useStackedModal();
|
|
290
|
+
const handleAddCustomerGroup = (groups) => {
|
|
291
|
+
const newIds = groups.map((group) => group.id);
|
|
292
|
+
const fieldsToAdd = groups.filter(
|
|
293
|
+
(group) => !fields.some((field) => field.id === group.id)
|
|
294
|
+
);
|
|
295
|
+
for (const field of fields) {
|
|
296
|
+
if (!newIds.includes(field.id)) {
|
|
297
|
+
remove(fields.indexOf(field));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
append(fieldsToAdd);
|
|
301
|
+
setIsOpen("cg", false);
|
|
302
|
+
};
|
|
303
|
+
return /* @__PURE__ */ jsx2("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", "data-testid": "price-list-details-form", children: /* @__PURE__ */ jsxs2("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8 px-8 py-16", children: [
|
|
304
|
+
/* @__PURE__ */ jsxs2("div", { "data-testid": "price-list-details-form-header", children: [
|
|
305
|
+
/* @__PURE__ */ jsx2(Heading, { "data-testid": "price-list-details-form-heading", children: t("priceLists.create.header") }),
|
|
306
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", className: "text-ui-fg-subtle", "data-testid": "price-list-details-form-subheader", children: t("priceLists.create.subheader") })
|
|
307
|
+
] }),
|
|
308
|
+
/* @__PURE__ */ jsx2(
|
|
309
|
+
Form.Field,
|
|
310
|
+
{
|
|
311
|
+
control: form.control,
|
|
312
|
+
name: "type",
|
|
313
|
+
render: ({ field: { onChange, ...rest } }) => {
|
|
314
|
+
return /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-type-item", children: [
|
|
315
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-y-4", children: [
|
|
316
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
317
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "price-list-details-form-type-label", children: t("priceLists.fields.type.label") }),
|
|
318
|
+
/* @__PURE__ */ jsx2(Form.Hint, { "data-testid": "price-list-details-form-type-hint", children: t("priceLists.fields.type.hint") })
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-type-control", children: /* @__PURE__ */ jsxs2(
|
|
321
|
+
RadioGroup,
|
|
322
|
+
{
|
|
323
|
+
dir: direction,
|
|
324
|
+
onValueChange: onChange,
|
|
325
|
+
...rest,
|
|
326
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
327
|
+
"data-testid": "price-list-details-form-type-radio-group",
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ jsx2(
|
|
330
|
+
RadioGroup.ChoiceBox,
|
|
331
|
+
{
|
|
332
|
+
value: "sale",
|
|
333
|
+
label: t("priceLists.fields.type.options.sale.label"),
|
|
334
|
+
description: t("priceLists.fields.type.options.sale.description"),
|
|
335
|
+
"data-testid": "price-list-details-form-type-option-sale"
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ jsx2(
|
|
339
|
+
RadioGroup.ChoiceBox,
|
|
340
|
+
{
|
|
341
|
+
value: "override",
|
|
342
|
+
label: t("priceLists.fields.type.options.override.label"),
|
|
343
|
+
description: t("priceLists.fields.type.options.override.description"),
|
|
344
|
+
"data-testid": "price-list-details-form-type-option-override"
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
) })
|
|
350
|
+
] }),
|
|
351
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-type-error" })
|
|
352
|
+
] });
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-y-4", children: [
|
|
357
|
+
/* @__PURE__ */ jsx2(
|
|
358
|
+
Form.Field,
|
|
359
|
+
{
|
|
360
|
+
control: form.control,
|
|
361
|
+
name: "status",
|
|
362
|
+
render: ({ field: { onChange, ...rest } }) => /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-status-item", children: [
|
|
363
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "price-list-details-form-status-label", children: t("priceLists.fields.status.label") }),
|
|
364
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-status-control", children: /* @__PURE__ */ jsxs2(
|
|
365
|
+
RadioGroup,
|
|
366
|
+
{
|
|
367
|
+
dir: direction,
|
|
368
|
+
onValueChange: onChange,
|
|
369
|
+
...rest,
|
|
370
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
371
|
+
"data-testid": "price-list-details-form-status-radio-group",
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ jsx2(
|
|
374
|
+
RadioGroup.ChoiceBox,
|
|
375
|
+
{
|
|
376
|
+
value: "draft",
|
|
377
|
+
label: t("priceLists.fields.status.options.draft"),
|
|
378
|
+
description: t("priceLists.fields.status.descriptions.draft"),
|
|
379
|
+
"data-testid": "price-list-details-form-status-option-draft"
|
|
380
|
+
}
|
|
381
|
+
),
|
|
382
|
+
/* @__PURE__ */ jsx2(
|
|
383
|
+
RadioGroup.ChoiceBox,
|
|
384
|
+
{
|
|
385
|
+
value: "active",
|
|
386
|
+
label: t("priceLists.fields.status.options.active"),
|
|
387
|
+
description: t("priceLists.fields.status.descriptions.active"),
|
|
388
|
+
"data-testid": "price-list-details-form-status-option-active"
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
) }),
|
|
394
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-status-error" })
|
|
395
|
+
] })
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ jsx2(
|
|
399
|
+
Form.Field,
|
|
400
|
+
{
|
|
401
|
+
control: form.control,
|
|
402
|
+
name: "title",
|
|
403
|
+
render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-title-item", children: [
|
|
404
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "price-list-details-form-title-label", children: t("fields.title") }),
|
|
405
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-title-control", children: /* @__PURE__ */ jsx2(Input, { ...field, "data-testid": "price-list-details-form-title-input" }) }),
|
|
406
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-title-error" })
|
|
407
|
+
] })
|
|
408
|
+
}
|
|
409
|
+
),
|
|
410
|
+
/* @__PURE__ */ jsx2(
|
|
411
|
+
Form.Field,
|
|
412
|
+
{
|
|
413
|
+
control: form.control,
|
|
414
|
+
name: "description",
|
|
415
|
+
render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-description-item", children: [
|
|
416
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "price-list-details-form-description-label", children: t("fields.description") }),
|
|
417
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-description-control", children: /* @__PURE__ */ jsx2(Textarea, { ...field, "data-testid": "price-list-details-form-description-input" }) }),
|
|
418
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-description-error" })
|
|
419
|
+
] })
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
] }),
|
|
423
|
+
/* @__PURE__ */ jsx2(Divider, {}),
|
|
424
|
+
/* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
425
|
+
/* @__PURE__ */ jsx2(
|
|
426
|
+
Form.Field,
|
|
427
|
+
{
|
|
428
|
+
control: form.control,
|
|
429
|
+
name: "starts_at",
|
|
430
|
+
render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-starts-at-item", children: [
|
|
431
|
+
/* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "price-list-details-form-starts-at-label", children: t("priceLists.fields.startsAt.label") }),
|
|
432
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-starts-at-control", children: /* @__PURE__ */ jsx2(
|
|
433
|
+
DatePicker,
|
|
434
|
+
{
|
|
435
|
+
granularity: "minute",
|
|
436
|
+
shouldCloseOnSelect: false,
|
|
437
|
+
...field,
|
|
438
|
+
"data-testid": "price-list-details-form-starts-at-input"
|
|
439
|
+
}
|
|
440
|
+
) }),
|
|
441
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-starts-at-error" })
|
|
442
|
+
] })
|
|
443
|
+
}
|
|
444
|
+
),
|
|
445
|
+
/* @__PURE__ */ jsx2(
|
|
446
|
+
Form.Field,
|
|
447
|
+
{
|
|
448
|
+
control: form.control,
|
|
449
|
+
name: "ends_at",
|
|
450
|
+
render: ({ field }) => /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-ends-at-item", children: [
|
|
451
|
+
/* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "price-list-details-form-ends-at-label", children: t("priceLists.fields.endsAt.label") }),
|
|
452
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-ends-at-control", children: /* @__PURE__ */ jsx2(
|
|
453
|
+
DatePicker,
|
|
454
|
+
{
|
|
455
|
+
granularity: "minute",
|
|
456
|
+
shouldCloseOnSelect: false,
|
|
457
|
+
...field,
|
|
458
|
+
"data-testid": "price-list-details-form-ends-at-input"
|
|
459
|
+
}
|
|
460
|
+
) }),
|
|
461
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-ends-at-error" })
|
|
462
|
+
] })
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
] }),
|
|
466
|
+
/* @__PURE__ */ jsx2(Divider, {}),
|
|
467
|
+
/* @__PURE__ */ jsx2(
|
|
468
|
+
Form.Field,
|
|
469
|
+
{
|
|
470
|
+
control: form.control,
|
|
471
|
+
name: "rules.customer_group_id",
|
|
472
|
+
render: ({ field }) => {
|
|
473
|
+
return /* @__PURE__ */ jsxs2(Form.Item, { "data-testid": "price-list-details-form-customer-group-item", children: [
|
|
474
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
475
|
+
/* @__PURE__ */ jsx2(Form.Label, { optional: true, "data-testid": "price-list-details-form-customer-group-label", children: t("priceLists.fields.customerAvailability.label") }),
|
|
476
|
+
/* @__PURE__ */ jsx2(Form.Hint, { "data-testid": "price-list-details-form-customer-group-hint", children: t("priceLists.fields.customerAvailability.hint") })
|
|
477
|
+
] }),
|
|
478
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "price-list-details-form-customer-group-control", children: /* @__PURE__ */ jsxs2(
|
|
479
|
+
"div",
|
|
480
|
+
{
|
|
481
|
+
className: clx(
|
|
482
|
+
"bg-ui-bg-component shadow-elevation-card-rest transition-fg grid gap-1.5 rounded-xl py-1.5",
|
|
483
|
+
"aria-[invalid='true']:shadow-borders-error"
|
|
484
|
+
),
|
|
485
|
+
role: "application",
|
|
486
|
+
ref: field.ref,
|
|
487
|
+
"data-testid": "price-list-details-form-customer-group-selector",
|
|
488
|
+
children: [
|
|
489
|
+
/* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid gap-1.5 px-1.5 md:grid-cols-2", children: [
|
|
490
|
+
/* @__PURE__ */ jsx2("div", { className: "bg-ui-bg-field shadow-borders-base txt-compact-small rounded-md px-2 py-1.5", children: t("priceLists.fields.customerAvailability.attribute") }),
|
|
491
|
+
/* @__PURE__ */ jsx2("div", { className: "bg-ui-bg-field shadow-borders-base txt-compact-small rounded-md px-2 py-1.5", children: t("operators.in") })
|
|
492
|
+
] }),
|
|
493
|
+
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-1.5 px-1.5", children: /* @__PURE__ */ jsxs2(StackedFocusModal, { id: "cg", children: [
|
|
494
|
+
/* @__PURE__ */ jsx2(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
|
|
495
|
+
"button",
|
|
496
|
+
{
|
|
497
|
+
type: "button",
|
|
498
|
+
className: "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover shadow-borders-base txt-compact-small text-ui-fg-muted transition-fg focus-visible:shadow-borders-interactive-with-active flex flex-1 items-center gap-x-2 rounded-md px-2 py-1.5 outline-none",
|
|
499
|
+
"data-testid": "price-list-details-form-customer-group-search-button",
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ jsx2(MagnifyingGlass, {}),
|
|
502
|
+
t("priceLists.fields.customerAvailability.placeholder")
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
) }),
|
|
506
|
+
/* @__PURE__ */ jsx2(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx2(Button2, { variant: "secondary", "data-testid": "price-list-details-form-customer-group-browse-button", children: t("actions.browse") }) }),
|
|
507
|
+
/* @__PURE__ */ jsxs2(StackedFocusModal.Content, { children: [
|
|
508
|
+
/* @__PURE__ */ jsx2(StackedFocusModal.Header, {}),
|
|
509
|
+
/* @__PURE__ */ jsx2(
|
|
510
|
+
PriceListCustomerGroupRuleForm,
|
|
511
|
+
{
|
|
512
|
+
state: fields,
|
|
513
|
+
setState: handleAddCustomerGroup,
|
|
514
|
+
type: "focus"
|
|
515
|
+
}
|
|
516
|
+
)
|
|
517
|
+
] })
|
|
518
|
+
] }) }),
|
|
519
|
+
fields.length > 0 ? /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-y-1.5", "data-testid": "price-list-details-form-customer-group-selected", children: [
|
|
520
|
+
/* @__PURE__ */ jsx2(Divider, { variant: "dashed" }),
|
|
521
|
+
/* @__PURE__ */ jsx2("div", { className: "flex flex-col gap-y-1.5 px-1.5", children: fields.map((field2, index) => {
|
|
522
|
+
return /* @__PURE__ */ jsxs2(
|
|
523
|
+
"div",
|
|
524
|
+
{
|
|
525
|
+
className: "bg-ui-bg-field-component shadow-borders-base flex items-center justify-between gap-2 rounded-md px-2 py-0.5",
|
|
526
|
+
"data-testid": `price-list-details-form-customer-group-selected-${field2.id}`,
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", "data-testid": `price-list-details-form-customer-group-selected-${field2.id}-name`, children: field2.name }),
|
|
529
|
+
/* @__PURE__ */ jsx2(
|
|
530
|
+
IconButton,
|
|
531
|
+
{
|
|
532
|
+
size: "small",
|
|
533
|
+
variant: "transparent",
|
|
534
|
+
type: "button",
|
|
535
|
+
onClick: () => remove(index),
|
|
536
|
+
"data-testid": `price-list-details-form-customer-group-selected-${field2.id}-remove-button`,
|
|
537
|
+
children: /* @__PURE__ */ jsx2(XMarkMini, {})
|
|
538
|
+
}
|
|
539
|
+
)
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
field2.cg_id
|
|
543
|
+
);
|
|
544
|
+
}) })
|
|
545
|
+
] }) : null
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
) }),
|
|
549
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "price-list-details-form-customer-group-error" })
|
|
550
|
+
] });
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
] }) });
|
|
555
|
+
};
|
|
556
|
+
Root._tabMeta = defineTabMeta({
|
|
557
|
+
id: "detail",
|
|
558
|
+
labelKey: "priceLists.create.tabs.details",
|
|
559
|
+
validationFields: ["type", "title", "description", "starts_at", "ends_at"]
|
|
560
|
+
});
|
|
561
|
+
var PriceListDetailsForm = Root;
|
|
562
|
+
|
|
563
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx
|
|
564
|
+
import { useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
565
|
+
import { useWatch } from "react-hook-form";
|
|
566
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
567
|
+
var Root2 = ({
|
|
568
|
+
currencies,
|
|
569
|
+
regions,
|
|
570
|
+
pricePreferences
|
|
571
|
+
}) => {
|
|
572
|
+
const form = useTabbedForm();
|
|
573
|
+
const { setValue } = form;
|
|
574
|
+
const { setCloseOnEscape } = useRouteModal();
|
|
575
|
+
const offerIds = useWatch({ control: form.control, name: "offer_ids" });
|
|
576
|
+
const existingOffers = useWatch({ control: form.control, name: "offers" });
|
|
577
|
+
const { offers: selectedOffers } = useOffers(
|
|
578
|
+
{
|
|
579
|
+
id: offerIds,
|
|
580
|
+
limit: offerIds?.length || 1,
|
|
581
|
+
fields: "id,variant_id,product_id,seller_id,sku,seller.name,product.title,product.thumbnail"
|
|
582
|
+
},
|
|
583
|
+
{ enabled: (offerIds?.length ?? 0) > 0 }
|
|
584
|
+
);
|
|
585
|
+
const productIds = useMemo2(
|
|
586
|
+
() => Array.from(
|
|
587
|
+
new Set((selectedOffers ?? []).map((o) => o.product_id))
|
|
588
|
+
),
|
|
589
|
+
[selectedOffers]
|
|
590
|
+
);
|
|
591
|
+
const { products, isLoading } = useProducts(
|
|
592
|
+
{ id: productIds, limit: productIds.length || 1, fields: "id,*variants" },
|
|
593
|
+
{ enabled: productIds.length > 0 }
|
|
594
|
+
);
|
|
595
|
+
const { gridData, variantIdByOffer } = useMemo2(
|
|
596
|
+
() => buildOfferGridData(
|
|
597
|
+
selectedOffers ?? [],
|
|
598
|
+
products ?? []
|
|
599
|
+
),
|
|
600
|
+
[selectedOffers, products]
|
|
601
|
+
);
|
|
602
|
+
useEffect2(() => {
|
|
603
|
+
for (const [offerId, variantId] of Object.entries(variantIdByOffer)) {
|
|
604
|
+
if (!existingOffers?.[offerId]) {
|
|
605
|
+
setValue(`offers.${offerId}`, {
|
|
606
|
+
variant_id: variantId,
|
|
607
|
+
currency_prices: {},
|
|
608
|
+
region_prices: {}
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}, [variantIdByOffer, existingOffers, setValue]);
|
|
613
|
+
const columns = usePriceListGridColumns({
|
|
614
|
+
currencies,
|
|
615
|
+
regions,
|
|
616
|
+
pricePreferences
|
|
617
|
+
});
|
|
618
|
+
return /* @__PURE__ */ jsx3("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx3(
|
|
619
|
+
DataGrid,
|
|
620
|
+
{
|
|
621
|
+
isLoading,
|
|
622
|
+
columns,
|
|
623
|
+
data: gridData,
|
|
624
|
+
state: form,
|
|
625
|
+
onEditingChange: (editing) => setCloseOnEscape(!editing)
|
|
626
|
+
}
|
|
627
|
+
) });
|
|
628
|
+
};
|
|
629
|
+
Root2._tabMeta = defineTabMeta({
|
|
630
|
+
id: "price",
|
|
631
|
+
labelKey: "priceLists.create.tabs.prices",
|
|
632
|
+
validationFields: ["offers"]
|
|
633
|
+
});
|
|
634
|
+
var PriceListPricesForm = Root2;
|
|
635
|
+
|
|
636
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-products-form.tsx
|
|
637
|
+
import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
|
|
638
|
+
import { useMemo as useMemo3, useRef, useState as useState2 } from "react";
|
|
639
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
640
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
641
|
+
var PAGE_SIZE2 = 50;
|
|
642
|
+
var PREFIX2 = "p";
|
|
643
|
+
var Root3 = () => {
|
|
644
|
+
const { t } = useTranslation3();
|
|
645
|
+
const form = useTabbedForm();
|
|
646
|
+
const { setValue } = form;
|
|
647
|
+
const [rowSelection, setRowSelection] = useState2({});
|
|
648
|
+
const { searchParams, raw } = useOfferTableQuery({
|
|
649
|
+
pageSize: PAGE_SIZE2,
|
|
650
|
+
prefix: PREFIX2
|
|
651
|
+
});
|
|
652
|
+
const { offers, count, isLoading, isError, error } = useOffers(searchParams, {
|
|
653
|
+
placeholderData: keepPreviousData2
|
|
654
|
+
});
|
|
655
|
+
const offerMeta = useRef({});
|
|
656
|
+
for (const offer of offers ?? []) {
|
|
657
|
+
offerMeta.current[offer.id] = {
|
|
658
|
+
product_id: offer.product_id,
|
|
659
|
+
offer_ids: offer.offer_ids ?? [offer.id]
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
const updater = (fn) => {
|
|
663
|
+
const state = typeof fn === "function" ? fn(rowSelection) : fn;
|
|
664
|
+
const selectedRowIds = Object.keys(state).filter(
|
|
665
|
+
(rowId) => offerMeta.current[rowId]
|
|
666
|
+
);
|
|
667
|
+
const productIds = Array.from(
|
|
668
|
+
new Set(selectedRowIds.map((id) => offerMeta.current[id].product_id))
|
|
669
|
+
);
|
|
670
|
+
const offerIds = Array.from(
|
|
671
|
+
new Set(selectedRowIds.flatMap((id) => offerMeta.current[id].offer_ids))
|
|
672
|
+
);
|
|
673
|
+
setValue(
|
|
674
|
+
"product_ids",
|
|
675
|
+
productIds.map((id) => ({ id })),
|
|
676
|
+
{ shouldDirty: true, shouldTouch: true }
|
|
677
|
+
);
|
|
678
|
+
setValue("offer_ids", offerIds, {
|
|
679
|
+
shouldDirty: true,
|
|
680
|
+
shouldTouch: true
|
|
681
|
+
});
|
|
682
|
+
setRowSelection(state);
|
|
683
|
+
};
|
|
684
|
+
const columns = useColumns2();
|
|
685
|
+
const filters = useOfferTableFilters();
|
|
686
|
+
const { table } = useDataTable({
|
|
687
|
+
data: offers ?? [],
|
|
688
|
+
columns,
|
|
689
|
+
count,
|
|
690
|
+
enablePagination: true,
|
|
691
|
+
enableRowSelection: true,
|
|
692
|
+
getRowId: (row) => row.id,
|
|
693
|
+
rowSelection: {
|
|
694
|
+
state: rowSelection,
|
|
695
|
+
updater
|
|
696
|
+
},
|
|
697
|
+
pageSize: PAGE_SIZE2,
|
|
698
|
+
prefix: PREFIX2
|
|
699
|
+
});
|
|
700
|
+
if (isError) {
|
|
701
|
+
throw error;
|
|
702
|
+
}
|
|
703
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex size-full flex-col", children: /* @__PURE__ */ jsx4(
|
|
704
|
+
_DataTable,
|
|
705
|
+
{
|
|
706
|
+
table,
|
|
707
|
+
columns,
|
|
708
|
+
filters,
|
|
709
|
+
pageSize: PAGE_SIZE2,
|
|
710
|
+
prefix: PREFIX2,
|
|
711
|
+
count,
|
|
712
|
+
isLoading,
|
|
713
|
+
layout: "fill",
|
|
714
|
+
orderBy: [
|
|
715
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
716
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
717
|
+
],
|
|
718
|
+
defaultOrder: "-created_at",
|
|
719
|
+
pagination: true,
|
|
720
|
+
search: true,
|
|
721
|
+
queryObject: raw,
|
|
722
|
+
noRecords: {
|
|
723
|
+
message: t("priceLists.create.products.list.noRecordsMessage")
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
) });
|
|
727
|
+
};
|
|
728
|
+
var useColumns2 = () => {
|
|
729
|
+
const base = useOfferTableColumns();
|
|
730
|
+
return useMemo3(
|
|
731
|
+
() => base.slice(0, -1),
|
|
732
|
+
[base]
|
|
733
|
+
);
|
|
734
|
+
};
|
|
735
|
+
Root3._tabMeta = defineTabMeta({
|
|
736
|
+
id: "product",
|
|
737
|
+
labelKey: "priceLists.create.tabs.products",
|
|
738
|
+
validationFields: ["product_ids"]
|
|
739
|
+
});
|
|
740
|
+
var PriceListProductsForm = Root3;
|
|
741
|
+
|
|
742
|
+
// src/pages/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx
|
|
743
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
744
|
+
var PriceListCreateForm = ({
|
|
745
|
+
regions,
|
|
746
|
+
currencies,
|
|
747
|
+
pricePreferences,
|
|
748
|
+
children,
|
|
749
|
+
schema,
|
|
750
|
+
defaultValues: extraDefaults
|
|
751
|
+
}) => {
|
|
752
|
+
const { t } = useTranslation4();
|
|
753
|
+
const { handleSuccess } = useRouteModal();
|
|
754
|
+
const form = useForm({
|
|
755
|
+
defaultValues: {
|
|
756
|
+
type: "sale",
|
|
757
|
+
status: "draft",
|
|
758
|
+
title: "",
|
|
759
|
+
description: "",
|
|
760
|
+
starts_at: null,
|
|
761
|
+
ends_at: null,
|
|
762
|
+
product_ids: [],
|
|
763
|
+
offer_ids: [],
|
|
764
|
+
offers: {},
|
|
765
|
+
rules: {
|
|
766
|
+
customer_group_id: []
|
|
767
|
+
},
|
|
768
|
+
...extraDefaults
|
|
769
|
+
},
|
|
770
|
+
resolver: zodResolver(schema ?? PricingCreateSchema)
|
|
771
|
+
});
|
|
772
|
+
const { mutateAsync, isPending } = useCreatePriceList();
|
|
773
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
774
|
+
const { rules, offers } = data;
|
|
775
|
+
const rulesPayload = rules?.customer_group_id?.length ? { "customer.groups.id": rules.customer_group_id.map((cg) => cg.id) } : void 0;
|
|
776
|
+
const prices = extractPricesFromOffers(offers, regions);
|
|
777
|
+
await mutateAsync(
|
|
778
|
+
{
|
|
779
|
+
title: data.title,
|
|
780
|
+
type: data.type,
|
|
781
|
+
status: data.status,
|
|
782
|
+
description: data.description,
|
|
783
|
+
starts_at: data.starts_at ? data.starts_at.toISOString() : null,
|
|
784
|
+
ends_at: data.ends_at ? data.ends_at.toISOString() : null,
|
|
785
|
+
rules: rulesPayload,
|
|
786
|
+
prices
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
onSuccess: ({ price_list }) => {
|
|
790
|
+
toast.success(
|
|
791
|
+
t("priceLists.create.successToast", {
|
|
792
|
+
title: price_list.title
|
|
793
|
+
})
|
|
794
|
+
);
|
|
795
|
+
handleSuccess(`../${price_list.id}`);
|
|
796
|
+
},
|
|
797
|
+
onError: (error) => {
|
|
798
|
+
toast.error(error.message);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
);
|
|
802
|
+
});
|
|
803
|
+
const defaultTabs = useMemo4(
|
|
804
|
+
() => [
|
|
805
|
+
/* @__PURE__ */ jsx5(PriceListDetailsForm, {}, "detail"),
|
|
806
|
+
/* @__PURE__ */ jsx5(PriceListProductsForm, {}, "product"),
|
|
807
|
+
/* @__PURE__ */ jsx5(
|
|
808
|
+
PriceListPricesForm,
|
|
809
|
+
{
|
|
810
|
+
currencies,
|
|
811
|
+
regions,
|
|
812
|
+
pricePreferences
|
|
813
|
+
},
|
|
814
|
+
"price"
|
|
815
|
+
)
|
|
816
|
+
],
|
|
817
|
+
[currencies, regions, pricePreferences]
|
|
818
|
+
);
|
|
819
|
+
const hasCustomChildren = Children.count(children) > 0;
|
|
820
|
+
return /* @__PURE__ */ jsx5(
|
|
821
|
+
TabbedForm,
|
|
822
|
+
{
|
|
823
|
+
model: "price_list",
|
|
824
|
+
zone: "create",
|
|
825
|
+
form,
|
|
826
|
+
onSubmit: handleSubmit,
|
|
827
|
+
isLoading: isPending,
|
|
828
|
+
children: hasCustomChildren ? children : defaultTabs
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
// src/pages/price-lists/price-list-create/price-list-create.tsx
|
|
834
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
835
|
+
var Root4 = ({ children }) => {
|
|
836
|
+
const { isReady, regions, currencies, pricePreferences } = usePriceListCurrencyData();
|
|
837
|
+
return /* @__PURE__ */ jsx6(RouteFocusModal, { children: isReady && (Children2.count(children) > 0 ? children : /* @__PURE__ */ jsx6(
|
|
838
|
+
PriceListCreateForm,
|
|
839
|
+
{
|
|
840
|
+
regions,
|
|
841
|
+
currencies,
|
|
842
|
+
pricePreferences
|
|
843
|
+
}
|
|
844
|
+
)) });
|
|
845
|
+
};
|
|
846
|
+
var PriceListCreatePage = Object.assign(Root4, {
|
|
847
|
+
Form: PriceListCreateForm,
|
|
848
|
+
DetailsTab: PriceListDetailsForm,
|
|
849
|
+
ProductsTab: PriceListProductsForm,
|
|
850
|
+
PricesTab: PriceListPricesForm,
|
|
851
|
+
Tab: TabbedForm.Tab
|
|
852
|
+
});
|
|
853
|
+
var PriceListCreate = Root4;
|
|
854
|
+
|
|
855
|
+
export {
|
|
856
|
+
PricingCreateSchema,
|
|
857
|
+
PriceListCreatePage,
|
|
858
|
+
PriceListCreate
|
|
859
|
+
};
|