@mercurjs/vendor 2.2.0-canary.2 → 2.2.0-canary.21
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/{[id]-KRLGIVLR.js → [id]-3JICOSAI.js} +133 -41
- package/dist/[id]-CR76L5TG.js +3102 -0
- package/dist/{[id]-7BAKUHUO.js → [id]-DDGHFRSB.js} +5 -5
- package/dist/{[id]-KVWYLDN3.js → [id]-E7DYRMMO.js} +162 -71
- package/dist/{[id]-4OBGG7OH.js → [id]-FIP4UMQ4.js} +197 -105
- package/dist/{[id]-3EC6HYXL.js → [id]-FZRXOJWL.js} +22 -21
- package/dist/{[id]-ZWWMJAKI.js → [id]-PD3ISUL5.js} +7 -7
- package/dist/{[id]-UUUQK22M.js → [id]-Q5AXQ5XO.js} +460 -581
- package/dist/{[id]-KJIQTFGE.js → [id]-VSNA6SV5.js} +15 -15
- package/dist/{[id]-Y2ISCLUD.js → [id]-XUKQKCDN.js} +3 -3
- package/dist/{[id]-K2CT7BXQ.js → [id]-YPCO3DJV.js} +1 -1
- package/dist/{[id]-LUFRJLAU.js → [id]-ZEFQ7FQQ.js} +36 -33
- package/dist/{[id]-COLO4TQJ.js → [id]-ZW7TBWDU.js} +24 -23
- package/dist/{[province_id]-H2QAPKVH.js → [province_id]-CHOO7ERP.js} +14 -14
- package/dist/{add-FIWTANZX.js → add-GYXNRUAE.js} +40 -37
- package/dist/{add-PBZQCIZQ.js → add-IC5R27X3.js} +95 -32
- package/dist/{add-customer-groups-RAHCP67U.js → add-customer-groups-KIGBZT5G.js} +20 -23
- package/dist/{add-products-N3V2MVLD.js → add-products-ALJVIFXU.js} +23 -22
- package/dist/{add-promotions-CSCAJZHV.js → add-promotions-EQ5MMQKG.js} +8 -8
- package/dist/{add-to-campaign-DLP7PSQB.js → add-to-campaign-C6JDNB6F.js} +4 -4
- package/dist/{address-7F5SN7PV.js → address-UKLDTSTP.js} +13 -13
- package/dist/{adjust-inventory-SZF4W7LR.js → adjust-inventory-5XPGE44Y.js} +2 -2
- package/dist/allocate-items-URVRAFPS.js +685 -0
- package/dist/{areas-7Y6BVS5A.js → areas-64VXOFYS.js} +6 -6
- package/dist/{attributes-MBZ76HVZ.js → attributes-YQNW5JBY.js} +2 -2
- package/dist/{breadcrumb-HND5FFWC.js → breadcrumb-26G7BS3Q.js} +3 -3
- package/dist/{breadcrumb-7PURSRTT.js → breadcrumb-2AYN2SV7.js} +12 -12
- package/dist/{breadcrumb-ZCG2RHIU.js → breadcrumb-4KKLMVC3.js} +12 -12
- package/dist/{breadcrumb-WRG4SITG.js → breadcrumb-4XSHX5RV.js} +13 -13
- package/dist/{breadcrumb-QV2IAX7N.js → breadcrumb-E5OF4L2J.js} +2 -2
- package/dist/breadcrumb-JC5FUQYF.js +28 -0
- package/dist/{breadcrumb-YBBYFQYG.js → breadcrumb-LBO2I4OJ.js} +1 -1
- package/dist/breadcrumb-PIDJ23EZ.js +13 -0
- package/dist/{breadcrumb-65SAGUUL.js → breadcrumb-RWYEU5JK.js} +3 -3
- package/dist/{breadcrumb-VWELWDB2.js → breadcrumb-VXKAO6GP.js} +1 -1
- package/dist/{breadcrumb-FLDHJRVY.js → breadcrumb-WMNG4P6C.js} +9 -8
- package/dist/{breadcrumb-EDPMEN2P.js → breadcrumb-XPQETVMM.js} +2 -2
- package/dist/{campaigns-L6ULR6KR.js → campaigns-4I2T6EDZ.js} +5 -5
- package/dist/{categories-FUZQKBXV.js → categories-3P2DRH5V.js} +10 -8
- package/dist/{chunk-EZ3JOAUS.js → chunk-22CIYLKO.js} +1 -1
- package/dist/{chunk-RZLN2Q6G.js → chunk-247L47JD.js} +1 -1
- package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
- package/dist/{chunk-M7KSRYRI.js → chunk-2ECD67FO.js} +2 -2
- package/dist/{chunk-36L54SQQ.js → chunk-2H4FGZ4U.js} +1 -1
- package/dist/{chunk-X2FVFUET.js → chunk-2NUZTTBU.js} +27 -8
- package/dist/chunk-2OY4NW7L.js +185 -0
- package/dist/{chunk-K4X324QP.js → chunk-36WXPGD2.js} +6 -5
- package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
- package/dist/chunk-3EDZQSKG.js +33 -0
- package/dist/{chunk-2DXNJURE.js → chunk-3L2DVCOC.js} +1 -1
- package/dist/chunk-42R54Z2X.js +8 -0
- package/dist/{chunk-CNMY5HVP.js → chunk-4EQIJMQT.js} +3 -3
- package/dist/{chunk-UAF2S447.js → chunk-4OIOYUQE.js} +3 -3
- package/dist/{chunk-UORPTGV2.js → chunk-4R5GESED.js} +10 -14
- package/dist/{chunk-WUPJADSO.js → chunk-4RFPRO2W.js} +2 -2
- package/dist/chunk-4YWKKCTT.js +32 -0
- package/dist/{chunk-XFQJU6FA.js → chunk-5QG6P6EU.js} +1 -1
- package/dist/{chunk-N4MVIBFM.js → chunk-5Y6RDTW2.js} +3 -3
- package/dist/{chunk-DZIXC7OE.js → chunk-6FLSBL4Q.js} +30 -85
- package/dist/{chunk-DVEKYLPV.js → chunk-6QS6IZC6.js} +1 -1
- package/dist/chunk-6ZGQ3SOR.js +127 -0
- package/dist/{chunk-NXNJQZCP.js → chunk-7FIPNQM2.js} +1 -1
- package/dist/{chunk-NSZQERLE.js → chunk-7GGWRJJF.js} +2 -2
- package/dist/{chunk-QS6RWIBL.js → chunk-7RGUD6PI.js} +34 -20
- package/dist/{chunk-5L2DCA4W.js → chunk-7ZPJGL4C.js} +57 -6
- package/dist/{chunk-KD7RYE6R.js → chunk-AG6KIAUD.js} +2 -2
- package/dist/{chunk-UCQKXXLD.js → chunk-AKKIZD2P.js} +32 -34
- package/dist/chunk-CHBURL76.js +438 -0
- package/dist/{chunk-PBD36EZJ.js → chunk-CI4YXVQF.js} +2 -2
- package/dist/{chunk-7LBY5JLV.js → chunk-DAV7WS53.js} +1 -1
- package/dist/{chunk-6BS2AVGJ.js → chunk-DNXMONCL.js} +6 -6
- package/dist/{chunk-TNVYTMBL.js → chunk-E4O5PARZ.js} +4 -4
- package/dist/{chunk-L7QKFC5N.js → chunk-E6W57UP3.js} +32 -122
- package/dist/chunk-EEBJYXWA.js +15 -0
- package/dist/chunk-FP6U6BPH.js +61 -0
- package/dist/{chunk-SGR4DMCW.js → chunk-FRYZRBLA.js} +1 -1
- package/dist/chunk-FWPGOIFA.js +22 -0
- package/dist/chunk-GL7F6NDU.js +30 -0
- package/dist/chunk-H7BVANDX.js +407 -0
- package/dist/{chunk-FDR22JMM.js → chunk-HFRHHT36.js} +8 -63
- package/dist/{chunk-FJUUGFXL.js → chunk-HOUDNM5M.js} +1 -1
- package/dist/{chunk-6Y53VZ3C.js → chunk-HZCSJLGH.js} +11 -11
- package/dist/chunk-I75SROQZ.js +315 -0
- package/dist/{chunk-JQV7CXEC.js → chunk-II3ACSV2.js} +17 -2
- package/dist/{chunk-DARJTN4I.js → chunk-IMJ62GAP.js} +10 -5
- package/dist/{chunk-PPLC4IKI.js → chunk-IV57G2CB.js} +14 -1
- package/dist/{chunk-7SLWXX6L.js → chunk-J434WDD3.js} +5 -6
- package/dist/chunk-J6XCRFBW.js +30 -0
- package/dist/{chunk-KAZ5BYTQ.js → chunk-KCHYLLVG.js} +6 -4
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-GXIAIITP.js → chunk-KZYRC3WR.js} +36 -39
- package/dist/chunk-L57USMYC.js +39 -0
- package/dist/chunk-LFX6WU4A.js +36 -0
- package/dist/{chunk-EROX26D4.js → chunk-LRMWYKSF.js} +1 -1
- package/dist/{chunk-LWJF63JW.js → chunk-LTQQRVZG.js} +89 -14
- package/dist/chunk-LYYM7H7H.js +59 -0
- package/dist/{chunk-NHFEY3EI.js → chunk-M3YUT5AY.js} +2 -2
- package/dist/{chunk-H6LZ77GX.js → chunk-MJCL3WID.js} +1 -1
- package/dist/{chunk-X4INVIWL.js → chunk-MZRZVLWD.js} +3 -3
- package/dist/{chunk-DDH7ULIQ.js → chunk-N6MGVXXQ.js} +1 -1
- package/dist/{chunk-QXLRABYH.js → chunk-O7VOGTLX.js} +1 -1
- package/dist/{chunk-35G3SZRN.js → chunk-P3SOE76R.js} +1 -1
- package/dist/{chunk-PZ44R4AS.js → chunk-P7Q5ZSZD.js} +1 -1
- package/dist/{chunk-5ATEALH7.js → chunk-PFJFS3F4.js} +1 -5
- package/dist/chunk-POOTMH3K.js +62 -0
- package/dist/{chunk-GGWUWT55.js → chunk-QJI4OET7.js} +23 -36
- package/dist/{chunk-NJMNYS7G.js → chunk-QS35HWC5.js} +1 -1
- package/dist/{chunk-RTBNJQOV.js → chunk-R4JLYNUA.js} +419 -538
- package/dist/{chunk-DIW4GRTI.js → chunk-RT3G3GEK.js} +47 -31
- package/dist/{chunk-QT7YFHCA.js → chunk-S23FD6FA.js} +12 -0
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/chunk-SPFLYPY6.js +6 -0
- package/dist/{chunk-EIUYXS7E.js → chunk-SZBERGA4.js} +1 -1
- package/dist/chunk-T6DSYOY5.js +173 -0
- package/dist/{chunk-4LVP635F.js → chunk-TKSKCYM3.js} +128 -126
- package/dist/{chunk-QNNJN4H6.js → chunk-TSTUAL6N.js} +59 -0
- package/dist/{chunk-LNM2D2I4.js → chunk-TZMNEN7A.js} +7 -6
- package/dist/chunk-UM7ZR3VU.js +14 -0
- package/dist/{chunk-X22KTLZ7.js → chunk-UO6IX5Y7.js} +1 -1
- package/dist/chunk-VCUUITW6.js +35 -0
- package/dist/{chunk-LQD232FW.js → chunk-WJ5EU3KW.js} +1 -1
- package/dist/{chunk-AIF2KTEE.js → chunk-WKRW5OPL.js} +12 -2
- package/dist/{chunk-6YA3C4NB.js → chunk-XBKWFLJG.js} +4 -13
- package/dist/{chunk-WBHFU3MG.js → chunk-XJYQ4SW5.js} +2 -2
- package/dist/chunk-XQUF3WIS.js +159 -0
- package/dist/chunk-YBF45CX5.js +23 -0
- package/dist/{chunk-AVOIZO63.js → chunk-YQZBAP3S.js} +4 -2
- package/dist/chunk-ZHFFTT3I.js +17 -0
- package/dist/{chunk-TODJFRLH.js → chunk-ZHR77OQI.js} +2 -2
- package/dist/chunk-ZUHIKMQL.js +353 -0
- package/dist/{chunk-44RQ5PTN.js → chunk-ZZIJSTXN.js} +225 -90
- package/dist/{collections-YCAAFGSW.js → collections-7M7O23NO.js} +28 -26
- package/dist/{configuration-UOSNP45I.js → configuration-5IDQRYJQ.js} +4 -4
- package/dist/{configuration-C4IGBNXH.js → configuration-TXRAYMI4.js} +1 -1
- package/dist/{create-BJ4OO6LS.js → create-2N73Y6FO.js} +14 -14
- package/dist/{create-R7K3ECN6.js → create-3MUVY3UY.js} +1 -1
- package/dist/{create-SFU3W3ZH.js → create-6DRXGPYA.js} +1 -1
- package/dist/{create-XAD5NMSJ.js → create-6KM5AZCG.js} +20 -20
- package/dist/{create-YDDBH4VQ.js → create-A6CPQMMH.js} +27 -26
- package/dist/create-B4EWCX7X.js +1798 -0
- package/dist/{create-YBF4YGWG.js → create-BHSMHOFN.js} +1 -1
- package/dist/{create-XVHOCZHJ.js → create-BVUZWMET.js} +1 -1
- package/dist/create-CJEZCYN6.js +1179 -0
- package/dist/create-DAVMJNC2.js +1931 -0
- package/dist/{create-35MYQPVM.js → create-E4HTVPP7.js} +17 -17
- package/dist/{create-JDGM5KXE.js → create-G4TF2M7G.js} +88 -42
- package/dist/{create-UQNYMVBM.js → create-LOP7AF5N.js} +6 -6
- package/dist/{create-UPYB65PD.js → create-MKFDE32U.js} +1 -1
- package/dist/{create-B5ZXTK3K.js → create-NR7ULWQS.js} +37 -34
- package/dist/{create-HI5UI2EZ.js → create-SJSLOXOW.js} +31 -26
- package/dist/{create-GB3ZA4LH.js → create-SYI6DVKM.js} +4 -4
- package/dist/{create-ORXYT74H.js → create-ZAGMLDR4.js} +13 -13
- package/dist/create-ZP4LSJYQ.js +216 -0
- package/dist/customer-group-add-customers-GTM556QA.js +251 -0
- package/dist/customer-group-create-OYHAXX2T.js +140 -0
- package/dist/customer-group-detail-KW62TLWA.js +58 -0
- package/dist/customer-group-edit-WH7O4N4L.js +137 -0
- package/dist/customer-groups-UJFZBZ2B.js +276 -0
- package/dist/{customers-ETXVNM3G.js → customers-4WKIFPUU.js} +7 -7
- package/dist/{edit-UGEC27HP.js → edit-3EN2H52W.js} +39 -36
- package/dist/{edit-ZMERG3L7.js → edit-3VNT35DW.js} +1 -1
- package/dist/{edit-ORXS3A2Y.js → edit-6DUTTLEV.js} +1 -1
- package/dist/edit-6K3NSVI7.js +103 -0
- package/dist/{edit-REDDBLTA.js → edit-6Z6RIJRZ.js} +4 -4
- package/dist/{edit-2Q7TRUTL.js → edit-CVSO5CX7.js} +14 -14
- package/dist/{edit-ZAHCMF5U.js → edit-FQDSESVI.js} +1 -1
- package/dist/edit-GZXLWSTL.js +176 -0
- package/dist/edit-LLNKSZR4.js +871 -0
- package/dist/{edit-O4JLGKQR.js → edit-MKVDAUA5.js} +1 -1
- package/dist/{edit-ZCXUG42Q.js → edit-NDUSRTWY.js} +13 -13
- package/dist/{edit-522DG3BY.js → edit-RBREBAQQ.js} +1 -1
- package/dist/{edit-Q3UQIOLS.js → edit-RQHOHZR6.js} +1 -1
- package/dist/{edit-VKT62KHG.js → edit-SAB6F3ZG.js} +36 -15
- package/dist/{edit-C4OCKQVU.js → edit-SM2GHVKW.js} +1 -1
- package/dist/{edit-KAKVPHZZ.js → edit-UVY3TEHD.js} +1 -1
- package/dist/{edit-SGUY2CCK.js → edit-V7WLYLOQ.js} +16 -16
- package/dist/{edit-FKXIQ6ZI.js → edit-XMZSLH4O.js} +16 -16
- package/dist/{edit-L5ZZLMAY.js → edit-YTS77SJS.js} +43 -32
- package/dist/{edit-budget-L3CCEWNF.js → edit-budget-4JMGEPNF.js} +1 -1
- package/dist/{edit-inventory-item-6B7ITDGD.js → edit-inventory-item-G22KFCYY.js} +2 -2
- package/dist/{edit-inventory-item-attributes-Y7MQZLXI.js → edit-inventory-item-attributes-RJSM4MEI.js} +2 -2
- package/dist/edit-price-K6K2FTMF.js +196 -0
- package/dist/edit-stock-6TUSJD5R.js +229 -0
- package/dist/fulfillment-VEF6HG6D.js +641 -0
- package/dist/{fulfillment-providers-DQAU43JZ.js → fulfillment-providers-VKBWFH45.js} +24 -24
- package/dist/index.css +107 -10
- package/dist/index.js +302 -183
- package/dist/{inventory-KAUVPMPZ.js → inventory-OCIGVZ4V.js} +6 -6
- package/dist/{offer-inventory-batch-page-WKCWNDNK.js → inventory-T7BRSFKY.js} +16 -16
- package/dist/{invite-CI2P4GF6.js → invite-J6L3Q7MQ.js} +12 -12
- package/dist/{invite-Q6EYDZVQ.js → invite-VWNUFOFI.js} +21 -21
- package/dist/loader-2EQ4ROTD.js +34 -0
- package/dist/loader-HYUC2XZX.js +33 -0
- package/dist/{login-KY342RMK.js → login-WOZMCEFY.js} +12 -12
- package/dist/{manage-locations-WNHEBS3A.js → manage-locations-R3ASMF5B.js} +1 -1
- package/dist/{media-B6ME2WXY.js → media-KIIJ6WSZ.js} +18 -17
- package/dist/media-RJHUSBXL.js +315 -0
- package/dist/{metadata-WR4RFXO5.js → metadata-45S6CFKY.js} +14 -14
- package/dist/{metadata-2CMH4I6U.js → metadata-FCATUWIZ.js} +14 -14
- package/dist/{metadata-GWI6R4ES.js → metadata-L5GBBXC4.js} +14 -14
- package/dist/{metadata-TLDUF5KV.js → metadata-R4ZRMAO6.js} +14 -14
- package/dist/{metadata-NUXUC2JA.js → metadata-RM5VVAOS.js} +14 -14
- package/dist/{offer-create-page-4Z6L63BU.js → offer-create-page-DV4JCIL2.js} +190 -195
- package/dist/offer-detail-page-TIBYGQBS.js +590 -0
- package/dist/offer-variant-detail-page-ORH56HZI.js +421 -0
- package/dist/offers-VA63KV3C.js +54 -0
- package/dist/{onboarding-43LQQQGQ.js → onboarding-L5RRKT65.js} +12 -12
- package/dist/{orders-ZV4D6L2V.js → orders-KKJD6EWZ.js} +27 -27
- package/dist/{organization-ZTQGRJWS.js → organization-6YPU2RQP.js} +53 -89
- package/dist/{organize-K6QMAMEN.js → organize-LR7FWK2J.js} +3 -3
- package/dist/{organize-HNJUHEEG.js → organize-SUG4SGVR.js} +3 -3
- package/dist/pages/index.d.ts +40 -16
- package/dist/pages/index.js +73 -73
- package/dist/{payment-details-64US5XWD.js → payment-details-UVEIHQA5.js} +13 -13
- package/dist/{payouts-UXJDTXDL.js → payouts-D4A4CILI.js} +8 -8
- package/dist/{price-lists-KBPUVSZI.js → price-lists-WJFXFGEV.js} +10 -10
- package/dist/{pricing-DF6C5XK4.js → pricing-QEVR2Z4K.js} +19 -19
- package/dist/{offer-pricing-edit-page-4TYGGSOE.js → pricing-XJUUCYL5.js} +24 -18
- package/dist/{product-tags-6MZB4W5R.js → product-tags-MW2JMRFY.js} +36 -33
- package/dist/{product-types-UUHBV4IZ.js → product-types-XXU7X42K.js} +6 -6
- package/dist/product-variant-detail-XZWTSH3H.js +369 -0
- package/dist/{product-variant-edit-YYNPHE4L.js → product-variant-edit-A2KO3E7B.js} +41 -44
- package/dist/{products-MZBU5MEV.js → products-TZS2OPK3.js} +37 -37
- package/dist/{products-IWKTGZS6.js → products-XSXEUKIB.js} +23 -22
- package/dist/{professional-details-5T2VS6MM.js → professional-details-ELUEJPOH.js} +13 -13
- package/dist/{profile-6XGHAT7H.js → profile-EDVGIBW6.js} +16 -16
- package/dist/{promotions-O7U4BTK6.js → promotions-JYO23G6N.js} +8 -8
- package/dist/receive-47SMYKIJ.js +578 -0
- package/dist/refund-IU7B77FV.js +268 -0
- package/dist/{register-N6WOSMLA.js → register-SR2SYX4Q.js} +14 -14
- package/dist/{reset-password-EICPAY2N.js → reset-password-N22YRMR3.js} +1 -1
- package/dist/{return-reasons-IX3LIOCU.js → return-reasons-POR5YPTF.js} +18 -15
- package/dist/{sales-channels-JW3QUYR7.js → sales-channels-ETB6QRRY.js} +8 -8
- package/dist/{sales-channels-B6FULRWI.js → sales-channels-YXRRARDL.js} +7 -7
- package/dist/{settings-MV53ZZ53.js → settings-MHBYIZ2I.js} +38 -35
- package/dist/shipment-ZX6PQ32L.js +241 -0
- package/dist/shipping-W4SPR3JO.js +122 -0
- package/dist/{shipping-profile-Y4SNEPZX.js → shipping-profile-L5CFXVEE.js} +4 -8
- package/dist/{shipping-profiles-2NWKCEJK.js → shipping-profiles-QBJUWXVQ.js} +17 -17
- package/dist/{stock-7CSVEJJU.js → stock-FW4DOVFV.js} +14 -14
- package/dist/{store-X23G3JCJ.js → store-NWWBV2UO.js} +75 -144
- package/dist/{store-closure-P5PD2RSV.js → store-closure-O3CBSOJD.js} +19 -14
- package/dist/{store-select-TREPDS3G.js → store-select-C7GI5MKK.js} +13 -13
- package/dist/{tax-regions-YXZW7UVX.js → tax-regions-2JCIB4T7.js} +2 -2
- package/dist/{team-SPP5OY5W.js → team-MY24J5WO.js} +20 -20
- package/package.json +2 -2
- package/dist/[id]-LTNOHLGE.js +0 -1219
- package/dist/allocate-items-SDFS5GYN.js +0 -533
- package/dist/chunk-432S4FGR.js +0 -0
- package/dist/chunk-AIZM66CG.js +0 -66
- package/dist/chunk-BDZOSMAX.js +0 -23
- package/dist/chunk-CFRWIQIZ.js +0 -43
- package/dist/chunk-GKZHBXZK.js +0 -426
- package/dist/chunk-RXZFEFNV.js +0 -73
- package/dist/chunk-T6LHVNWO.js +0 -27
- package/dist/chunk-WLT7K7K7.js +0 -63
- package/dist/create-FCKGCZSM.js +0 -210
- package/dist/edit-GQNIINRR.js +0 -192
- package/dist/fulfillment-75Z4H23W.js +0 -559
- package/dist/loader-FBB5OQRT.js +0 -31
- package/dist/metadata-5BPOBBU2.js +0 -45
- package/dist/offer-detail-page-6MAHNNIO.js +0 -488
- package/dist/offer-edit-page-DYQFU6JU.js +0 -151
- package/dist/offers-ZG6OTDZ2.js +0 -32
- package/dist/product-variant-detail-RVWEYVPC.js +0 -220
- package/dist/shipment-Q33QBMXX.js +0 -176
|
@@ -3,69 +3,93 @@ import {
|
|
|
3
3
|
CategoryHeader,
|
|
4
4
|
ProductStatusCell,
|
|
5
5
|
ProductStatusHeader
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PFJFS3F4.js";
|
|
7
|
+
import {
|
|
8
|
+
useProductTableQuery
|
|
9
|
+
} from "./chunk-MJCL3WID.js";
|
|
10
|
+
import {
|
|
11
|
+
ProductCell,
|
|
12
|
+
ProductHeader
|
|
13
|
+
} from "./chunk-FWPGOIFA.js";
|
|
7
14
|
import "./chunk-FQERBIVS.js";
|
|
15
|
+
import {
|
|
16
|
+
useProductTableFilters
|
|
17
|
+
} from "./chunk-7ZPJGL4C.js";
|
|
8
18
|
import "./chunk-DB6ANJBO.js";
|
|
9
19
|
import {
|
|
10
20
|
PlaceholderCell
|
|
11
21
|
} from "./chunk-PHOCVOZ5.js";
|
|
12
22
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "./chunk-AIF2KTEE.js";
|
|
16
|
-
import "./chunk-YN3FGNJM.js";
|
|
17
|
-
import "./chunk-KAZ5BYTQ.js";
|
|
18
|
-
import "./chunk-3EF54XFY.js";
|
|
23
|
+
defineTabMeta
|
|
24
|
+
} from "./chunk-LEWA4BPH.js";
|
|
19
25
|
import {
|
|
20
26
|
DataGrid,
|
|
21
27
|
createDataGridHelper,
|
|
22
28
|
createDataGridLocationStockColumns,
|
|
23
29
|
createDataGridPriceColumns
|
|
24
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TKSKCYM3.js";
|
|
25
31
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
_DataTable,
|
|
33
|
+
useDataTable
|
|
34
|
+
} from "./chunk-WKRW5OPL.js";
|
|
35
|
+
import "./chunk-YN3FGNJM.js";
|
|
36
|
+
import "./chunk-KCHYLLVG.js";
|
|
37
|
+
import "./chunk-3EF54XFY.js";
|
|
28
38
|
import "./chunk-IQPN4PZJ.js";
|
|
29
39
|
import {
|
|
30
40
|
TabbedForm
|
|
31
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WJ5EU3KW.js";
|
|
32
42
|
import "./chunk-TKGWSUEI.js";
|
|
33
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-SITRHMZZ.js";
|
|
34
44
|
import {
|
|
35
45
|
RouteFocusModal,
|
|
36
46
|
useRouteModal
|
|
37
47
|
} from "./chunk-GDWBOQI5.js";
|
|
38
48
|
import "./chunk-3QSRE5LS.js";
|
|
49
|
+
import "./chunk-THHRRYRS.js";
|
|
39
50
|
import "./chunk-LRD242C7.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import {
|
|
42
|
-
useQueryParams
|
|
43
|
-
} from "./chunk-THHRRYRS.js";
|
|
44
|
-
import "./chunk-DZIXC7OE.js";
|
|
51
|
+
import "./chunk-6FLSBL4Q.js";
|
|
45
52
|
import {
|
|
46
53
|
Thumbnail
|
|
47
54
|
} from "./chunk-WIYFXWRI.js";
|
|
48
55
|
import "./chunk-INNFZYX2.js";
|
|
56
|
+
import "./chunk-KZYRC3WR.js";
|
|
57
|
+
import "./chunk-F4OJN2F2.js";
|
|
58
|
+
import "./chunk-LRARA622.js";
|
|
59
|
+
import "./chunk-M6N4ISXL.js";
|
|
60
|
+
import "./chunk-S7EKBD2C.js";
|
|
61
|
+
import "./chunk-VV6IKGCN.js";
|
|
62
|
+
import "./chunk-M3YUT5AY.js";
|
|
63
|
+
import "./chunk-BOZJOOGW.js";
|
|
49
64
|
import {
|
|
50
|
-
|
|
51
|
-
} from "./chunk-
|
|
65
|
+
useShippingProfiles
|
|
66
|
+
} from "./chunk-IQWK723D.js";
|
|
52
67
|
import {
|
|
53
68
|
usePricePreferences
|
|
54
69
|
} from "./chunk-4S6XGIC6.js";
|
|
55
70
|
import {
|
|
56
71
|
useCurrentSeller
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
import
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
} from "./chunk-S23FD6FA.js";
|
|
73
|
+
import "./chunk-7FIPNQM2.js";
|
|
74
|
+
import "./chunk-LTQQRVZG.js";
|
|
75
|
+
import "./chunk-VXWN37PT.js";
|
|
76
|
+
import "./chunk-247L47JD.js";
|
|
77
|
+
import "./chunk-POOTMH3K.js";
|
|
78
|
+
import "./chunk-VXMOPVRH.js";
|
|
64
79
|
import {
|
|
65
80
|
useStockLocations
|
|
66
81
|
} from "./chunk-NBPMNUKZ.js";
|
|
82
|
+
import {
|
|
83
|
+
useBulkCreateOffers
|
|
84
|
+
} from "./chunk-4R5GESED.js";
|
|
85
|
+
import "./chunk-7RGUD6PI.js";
|
|
86
|
+
import "./chunk-3B34B2M2.js";
|
|
67
87
|
import "./chunk-LAVHRER2.js";
|
|
88
|
+
import "./chunk-QHQWEERJ.js";
|
|
68
89
|
import "./chunk-Y7QKP6QU.js";
|
|
90
|
+
import {
|
|
91
|
+
useProducts
|
|
92
|
+
} from "./chunk-TSTUAL6N.js";
|
|
69
93
|
import "./chunk-A5DJIOHN.js";
|
|
70
94
|
import "./chunk-RHKRREUU.js";
|
|
71
95
|
import "./chunk-ZA2KFUFR.js";
|
|
@@ -80,7 +104,7 @@ import { useForm } from "react-hook-form";
|
|
|
80
104
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
81
105
|
|
|
82
106
|
// src/pages/offers/create/create-offer-form/create-offer-catalogue.tsx
|
|
83
|
-
import { Checkbox } from "@medusajs/ui";
|
|
107
|
+
import { Checkbox, Text } from "@medusajs/ui";
|
|
84
108
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
85
109
|
import {
|
|
86
110
|
createColumnHelper
|
|
@@ -88,81 +112,23 @@ import {
|
|
|
88
112
|
import { useEffect, useMemo, useState } from "react";
|
|
89
113
|
import { useFormContext } from "react-hook-form";
|
|
90
114
|
import { useTranslation } from "react-i18next";
|
|
91
|
-
|
|
92
|
-
// src/hooks/table/query/use-product-variants-table-query.tsx
|
|
93
|
-
var DEFAULT_FIELDS = "*options,*inventory_items,*inventory_items.inventory,*inventory_items.inventory.location_levels";
|
|
94
|
-
var useProductVariantsTableQuery = ({
|
|
95
|
-
prefix,
|
|
96
|
-
pageSize = 10
|
|
97
|
-
}) => {
|
|
98
|
-
const queryObject = useQueryParams(
|
|
99
|
-
[
|
|
100
|
-
"offset",
|
|
101
|
-
"order",
|
|
102
|
-
"q",
|
|
103
|
-
"id",
|
|
104
|
-
"sku",
|
|
105
|
-
"title",
|
|
106
|
-
"manage_inventory",
|
|
107
|
-
"allow_backorder",
|
|
108
|
-
"created_at",
|
|
109
|
-
"updated_at"
|
|
110
|
-
],
|
|
111
|
-
prefix
|
|
112
|
-
);
|
|
113
|
-
const {
|
|
114
|
-
offset,
|
|
115
|
-
order,
|
|
116
|
-
q,
|
|
117
|
-
id,
|
|
118
|
-
sku,
|
|
119
|
-
title,
|
|
120
|
-
manage_inventory,
|
|
121
|
-
allow_backorder,
|
|
122
|
-
created_at,
|
|
123
|
-
updated_at
|
|
124
|
-
} = queryObject;
|
|
125
|
-
const searchParams = {
|
|
126
|
-
limit: pageSize,
|
|
127
|
-
offset: offset ? Number(offset) : 0,
|
|
128
|
-
fields: DEFAULT_FIELDS,
|
|
129
|
-
order,
|
|
130
|
-
q,
|
|
131
|
-
id: id ? id.split(",") : void 0,
|
|
132
|
-
sku: sku ? sku.split(",") : void 0,
|
|
133
|
-
title: title ? title.split(",") : void 0,
|
|
134
|
-
manage_inventory: manage_inventory ? manage_inventory === "true" : void 0,
|
|
135
|
-
allow_backorder: allow_backorder ? allow_backorder === "true" : void 0,
|
|
136
|
-
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
137
|
-
updated_at: updated_at ? JSON.parse(updated_at) : void 0
|
|
138
|
-
};
|
|
139
|
-
return {
|
|
140
|
-
searchParams,
|
|
141
|
-
raw: queryObject
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// src/pages/offers/create/create-offer-form/create-offer-catalogue.tsx
|
|
146
115
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
147
116
|
var PAGE_SIZE = 10;
|
|
148
117
|
var FIELDS = [
|
|
149
118
|
"id",
|
|
150
119
|
"title",
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"product.status",
|
|
159
|
-
"product.categories.id",
|
|
160
|
-
"product.categories.name"
|
|
120
|
+
"handle",
|
|
121
|
+
"status",
|
|
122
|
+
"thumbnail",
|
|
123
|
+
"*collection",
|
|
124
|
+
"categories.id",
|
|
125
|
+
"categories.name",
|
|
126
|
+
"variants.id"
|
|
161
127
|
].join(",");
|
|
162
128
|
var Root = () => {
|
|
163
129
|
const { t } = useTranslation();
|
|
164
130
|
const form = useFormContext();
|
|
165
|
-
const initialSelection = (form.getValues("
|
|
131
|
+
const initialSelection = (form.getValues("selected_product_ids") ?? []).reduce(
|
|
166
132
|
(acc, id) => {
|
|
167
133
|
acc[id] = true;
|
|
168
134
|
return acc;
|
|
@@ -174,28 +140,21 @@ var Root = () => {
|
|
|
174
140
|
const state = typeof fn === "function" ? fn(rowSelection) : fn;
|
|
175
141
|
setRowSelection(state);
|
|
176
142
|
const ids = Object.keys(state);
|
|
177
|
-
form.setValue("
|
|
143
|
+
form.setValue("selected_product_ids", ids, {
|
|
178
144
|
shouldDirty: true,
|
|
179
145
|
shouldTouch: true,
|
|
180
146
|
shouldValidate: true
|
|
181
147
|
});
|
|
182
148
|
};
|
|
183
|
-
const { searchParams, raw } =
|
|
184
|
-
|
|
185
|
-
});
|
|
186
|
-
const {
|
|
187
|
-
variants,
|
|
188
|
-
count,
|
|
189
|
-
isPending: isLoading,
|
|
190
|
-
isError,
|
|
191
|
-
error
|
|
192
|
-
} = useVariants(
|
|
149
|
+
const { searchParams, raw } = useProductTableQuery({ pageSize: PAGE_SIZE });
|
|
150
|
+
const { products, count, isLoading, isError, error } = useProducts(
|
|
193
151
|
{ ...searchParams, fields: FIELDS },
|
|
194
152
|
{ placeholderData: keepPreviousData }
|
|
195
153
|
);
|
|
154
|
+
const filters = useProductTableFilters();
|
|
196
155
|
const columns = useColumns();
|
|
197
156
|
const { table } = useDataTable({
|
|
198
|
-
data:
|
|
157
|
+
data: products ?? [],
|
|
199
158
|
columns,
|
|
200
159
|
enablePagination: true,
|
|
201
160
|
enableRowSelection: true,
|
|
@@ -208,7 +167,7 @@ var Root = () => {
|
|
|
208
167
|
}
|
|
209
168
|
});
|
|
210
169
|
useEffect(() => {
|
|
211
|
-
void form.trigger("
|
|
170
|
+
void form.trigger("selected_product_ids");
|
|
212
171
|
}, [rowSelection, form]);
|
|
213
172
|
if (isError) {
|
|
214
173
|
throw error;
|
|
@@ -227,18 +186,24 @@ var Root = () => {
|
|
|
227
186
|
columns,
|
|
228
187
|
pageSize: PAGE_SIZE,
|
|
229
188
|
isLoading,
|
|
189
|
+
filters,
|
|
230
190
|
orderBy: [
|
|
231
191
|
{ key: "title", label: t("fields.title") },
|
|
232
192
|
{ key: "created_at", label: t("fields.createdAt") },
|
|
233
193
|
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
234
194
|
],
|
|
195
|
+
defaultOrderBy: "title",
|
|
235
196
|
queryObject: raw,
|
|
236
197
|
layout: "fill",
|
|
237
198
|
pagination: true,
|
|
238
199
|
search: "autofocus"
|
|
239
200
|
}
|
|
240
201
|
),
|
|
241
|
-
/* @__PURE__ */ jsx("div", { className: "bg-ui-bg-subtle
|
|
202
|
+
/* @__PURE__ */ jsx("div", { className: "bg-ui-bg-subtle border-t px-6 py-4", children: /* @__PURE__ */ jsxs("p", { className: "border-ui-border-strong txt-small text-ui-fg-subtle border-l-2 pl-3", children: [
|
|
203
|
+
/* @__PURE__ */ jsx("span", { className: "text-ui-fg-base font-medium", children: t("offers.create.tipLabel") }),
|
|
204
|
+
" ",
|
|
205
|
+
t("offers.create.tip")
|
|
206
|
+
] }) })
|
|
242
207
|
]
|
|
243
208
|
}
|
|
244
209
|
);
|
|
@@ -269,52 +234,44 @@ var useColumns = () => {
|
|
|
269
234
|
)
|
|
270
235
|
}),
|
|
271
236
|
columnHelper.display({
|
|
272
|
-
id: "
|
|
273
|
-
header:
|
|
274
|
-
cell: ({ row }) =>
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
237
|
+
id: "product",
|
|
238
|
+
header: () => /* @__PURE__ */ jsx(ProductHeader, {}),
|
|
239
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(
|
|
240
|
+
ProductCell,
|
|
241
|
+
{
|
|
242
|
+
product: {
|
|
243
|
+
title: row.original.title ?? "",
|
|
244
|
+
thumbnail: row.original.thumbnail ?? null
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
)
|
|
283
248
|
}),
|
|
284
249
|
columnHelper.display({
|
|
285
250
|
id: "categories",
|
|
286
251
|
header: () => /* @__PURE__ */ jsx(CategoryHeader, {}),
|
|
287
|
-
cell: ({ row }) => /* @__PURE__ */ jsx(CategoryCell, { categories: row.original.
|
|
288
|
-
}),
|
|
289
|
-
columnHelper.accessor("sku", {
|
|
290
|
-
header: t("fields.sku"),
|
|
291
|
-
cell: ({ getValue }) => {
|
|
292
|
-
const sku = getValue();
|
|
293
|
-
if (!sku) return /* @__PURE__ */ jsx(PlaceholderCell, {});
|
|
294
|
-
return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx("span", { className: "truncate", children: sku }) });
|
|
295
|
-
}
|
|
252
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(CategoryCell, { categories: row.original.categories })
|
|
296
253
|
}),
|
|
297
|
-
columnHelper.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
254
|
+
columnHelper.display({
|
|
255
|
+
id: "collection",
|
|
256
|
+
header: t("fields.collection"),
|
|
257
|
+
cell: ({ row }) => {
|
|
258
|
+
const title = row.original.collection?.title;
|
|
259
|
+
if (!title) return /* @__PURE__ */ jsx(PlaceholderCell, {});
|
|
260
|
+
return /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "truncate", children: title });
|
|
303
261
|
}
|
|
304
262
|
}),
|
|
305
|
-
columnHelper.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
263
|
+
columnHelper.display({
|
|
264
|
+
id: "variants",
|
|
265
|
+
header: t("offers.fields.variants"),
|
|
266
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "truncate", children: t("offers.fields.variantsCount", {
|
|
267
|
+
count: row.original.variants?.length ?? 0
|
|
268
|
+
}) })
|
|
312
269
|
}),
|
|
313
270
|
columnHelper.display({
|
|
314
271
|
id: "status",
|
|
315
272
|
header: () => /* @__PURE__ */ jsx(ProductStatusHeader, {}),
|
|
316
273
|
cell: ({ row }) => {
|
|
317
|
-
const status = row.original.
|
|
274
|
+
const status = row.original.status;
|
|
318
275
|
if (!status) return /* @__PURE__ */ jsx(PlaceholderCell, {});
|
|
319
276
|
return /* @__PURE__ */ jsx(ProductStatusCell, { status });
|
|
320
277
|
}
|
|
@@ -326,7 +283,7 @@ var useColumns = () => {
|
|
|
326
283
|
Root._tabMeta = defineTabMeta({
|
|
327
284
|
id: "catalogue",
|
|
328
285
|
labelKey: "offers.create.tabs.catalogue",
|
|
329
|
-
validationFields: ["
|
|
286
|
+
validationFields: ["selected_product_ids"]
|
|
330
287
|
});
|
|
331
288
|
var CreateOfferCatalogueTab = Root;
|
|
332
289
|
|
|
@@ -335,6 +292,7 @@ import { useMemo as useMemo2 } from "react";
|
|
|
335
292
|
import { useFormContext as useFormContext2, useWatch } from "react-hook-form";
|
|
336
293
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
337
294
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
295
|
+
var isGroup = (row) => row.__group === true;
|
|
338
296
|
var Root2 = () => {
|
|
339
297
|
const form = useFormContext2();
|
|
340
298
|
const { setCloseOnEscape } = useRouteModal();
|
|
@@ -346,6 +304,22 @@ var Root2 = () => {
|
|
|
346
304
|
control: form.control,
|
|
347
305
|
name: "variants"
|
|
348
306
|
});
|
|
307
|
+
const gridData = useMemo2(() => {
|
|
308
|
+
const rows = [];
|
|
309
|
+
let lastProductId;
|
|
310
|
+
(variants ?? []).forEach((variant, index) => {
|
|
311
|
+
if (variant.product_id !== lastProductId) {
|
|
312
|
+
rows.push({
|
|
313
|
+
__group: true,
|
|
314
|
+
id: `group-${variant.product_id}`,
|
|
315
|
+
product_title: variant.product_title
|
|
316
|
+
});
|
|
317
|
+
lastProductId = variant.product_id;
|
|
318
|
+
}
|
|
319
|
+
rows.push({ ...variant, __group: false, __formIndex: index });
|
|
320
|
+
});
|
|
321
|
+
return rows;
|
|
322
|
+
}, [variants]);
|
|
349
323
|
const columns = useColumns2({
|
|
350
324
|
currencyCode: currency_code,
|
|
351
325
|
stockLocations: stock_locations,
|
|
@@ -361,7 +335,7 @@ var Root2 = () => {
|
|
|
361
335
|
DataGrid,
|
|
362
336
|
{
|
|
363
337
|
columns,
|
|
364
|
-
data:
|
|
338
|
+
data: gridData,
|
|
365
339
|
state: form,
|
|
366
340
|
onEditingChange: (editing) => setCloseOnEscape(!editing)
|
|
367
341
|
}
|
|
@@ -388,10 +362,20 @@ var useColumns2 = ({
|
|
|
388
362
|
id: "title",
|
|
389
363
|
header: t("fields.title"),
|
|
390
364
|
cell: (context) => {
|
|
391
|
-
const
|
|
392
|
-
|
|
365
|
+
const row = context.row.original;
|
|
366
|
+
if (isGroup(row)) {
|
|
367
|
+
return /* @__PURE__ */ jsx2(DataGrid.ReadonlyCell, { context, children: /* @__PURE__ */ jsx2(
|
|
368
|
+
"span",
|
|
369
|
+
{
|
|
370
|
+
className: "text-ui-fg-subtle truncate font-medium",
|
|
371
|
+
title: row.product_title,
|
|
372
|
+
children: row.product_title
|
|
373
|
+
}
|
|
374
|
+
) });
|
|
375
|
+
}
|
|
376
|
+
const title = row.variant_title || "";
|
|
393
377
|
return /* @__PURE__ */ jsx2(DataGrid.ReadonlyCell, { context, children: /* @__PURE__ */ jsxs2("div", { className: "flex h-full w-full items-center gap-x-2 overflow-hidden", children: [
|
|
394
|
-
/* @__PURE__ */ jsx2(Thumbnail, { src:
|
|
378
|
+
/* @__PURE__ */ jsx2(Thumbnail, { src: row.product_thumbnail ?? null }),
|
|
395
379
|
/* @__PURE__ */ jsx2("span", { className: "truncate", title, children: title })
|
|
396
380
|
] }) });
|
|
397
381
|
},
|
|
@@ -401,40 +385,52 @@ var useColumns2 = ({
|
|
|
401
385
|
id: "sku",
|
|
402
386
|
name: t("fields.sku"),
|
|
403
387
|
header: t("fields.sku"),
|
|
404
|
-
field: (context) =>
|
|
388
|
+
field: (context) => {
|
|
389
|
+
const row = context.row.original;
|
|
390
|
+
return isGroup(row) ? null : `variants.${row.__formIndex}.sku`;
|
|
391
|
+
},
|
|
405
392
|
type: "text",
|
|
406
|
-
cell: (context) => /* @__PURE__ */ jsx2(DataGrid.TextCell, { context })
|
|
393
|
+
cell: (context) => isGroup(context.row.original) ? /* @__PURE__ */ jsx2(DataGrid.ReadonlyCell, { context }) : /* @__PURE__ */ jsx2(DataGrid.TextCell, { context })
|
|
407
394
|
}),
|
|
408
395
|
columnHelper2.column({
|
|
409
396
|
id: "shipping_profile",
|
|
410
|
-
name: t("shippingProfile
|
|
411
|
-
header: t("shippingProfile
|
|
412
|
-
field: (context) =>
|
|
397
|
+
name: t("offers.fields.shippingProfile"),
|
|
398
|
+
header: t("offers.fields.shippingProfile"),
|
|
399
|
+
field: (context) => {
|
|
400
|
+
const row = context.row.original;
|
|
401
|
+
return isGroup(row) ? null : `variants.${row.__formIndex}.shipping_profile_id`;
|
|
402
|
+
},
|
|
413
403
|
type: "select",
|
|
414
|
-
cell: (context) => /* @__PURE__ */ jsx2(
|
|
404
|
+
cell: (context) => isGroup(context.row.original) ? /* @__PURE__ */ jsx2(DataGrid.ReadonlyCell, { context }) : /* @__PURE__ */ jsx2(
|
|
415
405
|
DataGrid.SelectCell,
|
|
416
406
|
{
|
|
417
407
|
context,
|
|
418
408
|
options: shippingProfileOptions,
|
|
419
|
-
placeholder:
|
|
409
|
+
placeholder: ""
|
|
420
410
|
}
|
|
421
411
|
)
|
|
422
412
|
}),
|
|
423
413
|
...createDataGridLocationStockColumns({
|
|
424
414
|
stockLocations,
|
|
415
|
+
isReadyOnly: (context) => isGroup(context.row.original),
|
|
425
416
|
getFieldName: (context, index) => {
|
|
417
|
+
const row = context.row.original;
|
|
418
|
+
if (isGroup(row)) return null;
|
|
426
419
|
const location = stockLocations[index];
|
|
427
420
|
if (!location) return null;
|
|
428
|
-
return `variants.${
|
|
421
|
+
return `variants.${row.__formIndex}.inventory.${location.id}`;
|
|
429
422
|
},
|
|
430
423
|
t
|
|
431
424
|
}),
|
|
432
425
|
...createDataGridPriceColumns({
|
|
433
426
|
currencies,
|
|
434
427
|
pricePreferences,
|
|
428
|
+
isReadyOnly: (context) => isGroup(context.row.original),
|
|
435
429
|
getFieldName: (context, value) => {
|
|
430
|
+
const row = context.row.original;
|
|
431
|
+
if (isGroup(row)) return null;
|
|
436
432
|
if (context.column.id?.startsWith("currency_prices")) {
|
|
437
|
-
return `variants.${
|
|
433
|
+
return `variants.${row.__formIndex}.prices.${value}`;
|
|
438
434
|
}
|
|
439
435
|
return null;
|
|
440
436
|
},
|
|
@@ -471,7 +467,9 @@ var VariantRowSchema = z.object({
|
|
|
471
467
|
).default({})
|
|
472
468
|
});
|
|
473
469
|
var CreateOfferSchema = z.object({
|
|
474
|
-
|
|
470
|
+
// The catalogue tab selects whole products (SPEC-009); the stock &
|
|
471
|
+
// prices tab fans them out to their variants.
|
|
472
|
+
selected_product_ids: z.array(z.string().min(1)).min(1),
|
|
475
473
|
variants: z.array(VariantRowSchema).min(1)
|
|
476
474
|
});
|
|
477
475
|
var numericOrZero = (v) => {
|
|
@@ -502,7 +500,7 @@ var variantRowRequiresSku = (row) => {
|
|
|
502
500
|
// src/pages/offers/create/create-offer-form/create-offer-form.tsx
|
|
503
501
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
504
502
|
var DEFAULTS = {
|
|
505
|
-
|
|
503
|
+
selected_product_ids: [],
|
|
506
504
|
variants: []
|
|
507
505
|
};
|
|
508
506
|
var numericOrZero2 = (v) => {
|
|
@@ -540,19 +538,18 @@ var CreateOfferForm = () => {
|
|
|
540
538
|
const { currency_code } = useCurrentSeller();
|
|
541
539
|
const { stock_locations } = useStockLocations({ limit: 100 });
|
|
542
540
|
const locationIds = (stock_locations ?? []).map((l) => l.id);
|
|
543
|
-
const
|
|
544
|
-
const
|
|
541
|
+
const selectedProductIds = form.watch("selected_product_ids") ?? [];
|
|
542
|
+
const selectedProductIdsKey = selectedProductIds.join(",");
|
|
545
543
|
const locationsKey = locationIds.join(",");
|
|
546
|
-
const {
|
|
544
|
+
const { products: fetchedProducts } = useProducts(
|
|
547
545
|
{
|
|
548
|
-
id:
|
|
549
|
-
limit:
|
|
550
|
-
fields: "id,title,
|
|
546
|
+
id: selectedProductIds,
|
|
547
|
+
limit: selectedProductIds.length || 1,
|
|
548
|
+
fields: "id,title,thumbnail,variants.id,variants.title,variants.sku"
|
|
551
549
|
},
|
|
552
|
-
{ enabled:
|
|
550
|
+
{ enabled: selectedProductIds.length > 0 }
|
|
553
551
|
);
|
|
554
552
|
useEffect2(() => {
|
|
555
|
-
const ids = selectedVariantIdsKey ? selectedVariantIdsKey.split(",") : [];
|
|
556
553
|
const locIds = locationsKey ? locationsKey.split(",") : [];
|
|
557
554
|
const emptyPrices = currency_code ? { [currency_code]: "" } : {};
|
|
558
555
|
const emptyInventory = locIds.reduce((acc, locId) => {
|
|
@@ -564,35 +561,35 @@ var CreateOfferForm = () => {
|
|
|
564
561
|
existing.map((row) => [row.variant_id, row])
|
|
565
562
|
);
|
|
566
563
|
const next = [];
|
|
567
|
-
for (const
|
|
568
|
-
const
|
|
569
|
-
|
|
564
|
+
for (const product of fetchedProducts ?? []) {
|
|
565
|
+
for (const variant of product.variants ?? []) {
|
|
566
|
+
const previous = existingByVariantId.get(variant.id);
|
|
567
|
+
if (previous) {
|
|
568
|
+
next.push({
|
|
569
|
+
...previous,
|
|
570
|
+
prices: { ...emptyPrices, ...previous.prices ?? {} },
|
|
571
|
+
inventory: { ...emptyInventory, ...previous.inventory ?? {} }
|
|
572
|
+
});
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
570
575
|
next.push({
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
576
|
+
variant_id: variant.id,
|
|
577
|
+
product_id: product.id ?? "",
|
|
578
|
+
product_title: product.title ?? "",
|
|
579
|
+
variant_title: variant.title ?? variant.id,
|
|
580
|
+
product_thumbnail: product.thumbnail ?? null,
|
|
581
|
+
variant_sku: variant.sku ?? null,
|
|
582
|
+
sku: variant.sku ?? "",
|
|
583
|
+
shipping_profile_id: "",
|
|
584
|
+
prices: { ...emptyPrices },
|
|
585
|
+
inventory: { ...emptyInventory }
|
|
574
586
|
});
|
|
575
|
-
continue;
|
|
576
587
|
}
|
|
577
|
-
const fetched = (fetchedVariants ?? []).find((v) => v.id === variantId);
|
|
578
|
-
if (!fetched) continue;
|
|
579
|
-
next.push({
|
|
580
|
-
variant_id: variantId,
|
|
581
|
-
product_id: fetched.product_id ?? fetched.product?.id ?? "",
|
|
582
|
-
product_title: fetched.product?.title ?? "",
|
|
583
|
-
variant_title: fetched.title ?? variantId,
|
|
584
|
-
product_thumbnail: fetched.product?.thumbnail ?? null,
|
|
585
|
-
variant_sku: fetched.sku ?? null,
|
|
586
|
-
sku: fetched.sku ?? "",
|
|
587
|
-
shipping_profile_id: "",
|
|
588
|
-
prices: { ...emptyPrices },
|
|
589
|
-
inventory: { ...emptyInventory }
|
|
590
|
-
});
|
|
591
588
|
}
|
|
592
589
|
form.setValue("variants", next, { shouldDirty: false });
|
|
593
590
|
}, [
|
|
594
|
-
|
|
595
|
-
|
|
591
|
+
selectedProductIdsKey,
|
|
592
|
+
fetchedProducts,
|
|
596
593
|
currency_code,
|
|
597
594
|
locationsKey,
|
|
598
595
|
form
|
|
@@ -616,23 +613,21 @@ var CreateOfferForm = () => {
|
|
|
616
613
|
message: t("offers.validation.skuRequired")
|
|
617
614
|
});
|
|
618
615
|
hasValidationError = true;
|
|
619
|
-
|
|
620
|
-
}
|
|
621
|
-
if (sku) {
|
|
616
|
+
} else if (sku) {
|
|
622
617
|
if (skuSeen.has(sku)) {
|
|
623
618
|
form.setError(`variants.${i}.sku`, {
|
|
624
619
|
type: "manual",
|
|
625
620
|
message: t("offers.validation.duplicateSku")
|
|
626
621
|
});
|
|
627
622
|
hasValidationError = true;
|
|
628
|
-
|
|
623
|
+
} else {
|
|
624
|
+
skuSeen.set(sku, i);
|
|
629
625
|
}
|
|
630
|
-
skuSeen.set(sku, i);
|
|
631
626
|
}
|
|
632
627
|
if (!row.shipping_profile_id) {
|
|
633
628
|
form.setError(`variants.${i}.shipping_profile_id`, {
|
|
634
629
|
type: "manual",
|
|
635
|
-
message: t("offers.validation.
|
|
630
|
+
message: t("offers.validation.shippingProfileRequired")
|
|
636
631
|
});
|
|
637
632
|
hasValidationError = true;
|
|
638
633
|
}
|
|
@@ -715,7 +710,7 @@ var CreateOfferForm = () => {
|
|
|
715
710
|
variant: "primary",
|
|
716
711
|
size: "small",
|
|
717
712
|
onClick: () => onNext(),
|
|
718
|
-
disabled: (form.watch("
|
|
713
|
+
disabled: (form.watch("selected_product_ids")?.length ?? 0) === 0,
|
|
719
714
|
children: t("actions.continue")
|
|
720
715
|
},
|
|
721
716
|
"next-button"
|