@medusajs/dashboard 3.0.0-snapshot-20251216145629 → 3.0.0-snapshot-20260102134455
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-locales-2OZXZCT5.mjs +81 -0
- package/dist/{adjust-inventory-26YXAXQL.mjs → adjust-inventory-47KGDWME.mjs} +2 -2
- package/dist/{api-key-management-create-EMP32G2D.mjs → api-key-management-create-EFPPZPZ7.mjs} +4 -4
- package/dist/{api-key-management-detail-6RCDH73M.mjs → api-key-management-detail-4IFED7SF.mjs} +15 -15
- package/dist/{api-key-management-edit-IBM3ZXHK.mjs → api-key-management-edit-QGVBNLUL.mjs} +4 -4
- package/dist/{api-key-management-list-KC5GOWAU.mjs → api-key-management-list-ROIJIIPQ.mjs} +4 -4
- package/dist/{api-key-management-sales-channels-LUB5G6RC.mjs → api-key-management-sales-channels-7P5L45AT.mjs} +6 -6
- package/dist/app.css +33 -3
- package/dist/app.js +18467 -16698
- package/dist/app.mjs +13 -13
- package/dist/{campaign-create-FJOECKGT.mjs → campaign-create-EZGZ4SBQ.mjs} +3 -3
- package/dist/{campaign-detail-5Q4BYCPX.mjs → campaign-detail-NFKLFPY4.mjs} +12 -12
- package/dist/{categories-metadata-J7M3XWI7.mjs → categories-metadata-G7BACZ26.mjs} +12 -12
- package/dist/{category-create-KHJZSC7G.mjs → category-create-7MV25HYX.mjs} +6 -6
- package/dist/{category-detail-S5IPXMHX.mjs → category-detail-XJQQ7UU4.mjs} +14 -14
- package/dist/{category-edit-CTA2EPDG.mjs → category-edit-LV7EARAB.mjs} +3 -3
- package/dist/{category-list-QBYJ4T3R.mjs → category-list-NIVLV5S3.mjs} +6 -6
- package/dist/{category-organize-SXP33XET.mjs → category-organize-SCRGWKDG.mjs} +3 -3
- package/dist/{category-products-KPW6BA5J.mjs → category-products-FXFSMCR6.mjs} +13 -13
- package/dist/{chunk-OXPE5TAY.mjs → chunk-24C2YVFU.mjs} +1 -1
- package/dist/{chunk-4JQR6QNW.mjs → chunk-333HK6Y6.mjs} +2 -2
- package/dist/{chunk-DODQ3KJT.mjs → chunk-3RRA56WC.mjs} +8 -3
- package/dist/{chunk-5LGRZSEH.mjs → chunk-3YPZ3R4U.mjs} +1 -1
- package/dist/chunk-5BUFAGKR.mjs +13 -0
- package/dist/{chunk-2DULKOPN.mjs → chunk-5ISRTMYH.mjs} +1 -1
- package/dist/{chunk-PHLCT2HA.mjs → chunk-5ZPKY5XP.mjs} +1 -1
- package/dist/{chunk-U6G4M5LP.mjs → chunk-6EXKKRZY.mjs} +1 -1
- package/dist/{chunk-GRZSG4EP.mjs → chunk-74WPAWMW.mjs} +127 -226
- package/dist/{chunk-UULAOAFM.mjs → chunk-772OR7OQ.mjs} +358 -242
- package/dist/chunk-7AXHHXCX.mjs +4 -0
- package/dist/{chunk-BMS2QLJY.mjs → chunk-BMJ5RYIO.mjs} +1 -1
- package/dist/{chunk-Y2YVTIJI.mjs → chunk-CW5PQUJ6.mjs} +1 -1
- package/dist/{chunk-IAV7IKJ6.mjs → chunk-DN5BRKVN.mjs} +1 -1
- package/dist/{chunk-RS7DWLEP.mjs → chunk-DQUXK4WW.mjs} +1 -1
- package/dist/{chunk-2XTBDCGE.mjs → chunk-DWH2OQFK.mjs} +1 -1
- package/dist/{chunk-CCQD65EY.mjs → chunk-FKNW5MLZ.mjs} +360 -288
- package/dist/{chunk-HTCYX4VD.mjs → chunk-G35UUG2P.mjs} +1 -1
- package/dist/{chunk-QKALAT7P.mjs → chunk-GGONMC2N.mjs} +1 -1
- package/dist/{chunk-FYWHE3W5.mjs → chunk-GJN5SXGZ.mjs} +1 -1
- package/dist/{chunk-CVHJAKLQ.mjs → chunk-HDO2UCKF.mjs} +1 -1
- package/dist/{chunk-3C6WQ7NH.mjs → chunk-IWNNQ6HA.mjs} +37 -3
- package/dist/{chunk-OL24RDYM.mjs → chunk-KHJL6MUQ.mjs} +8 -8
- package/dist/{chunk-6P4Q4AAP.mjs → chunk-KPI4WFJU.mjs} +3 -3
- package/dist/{chunk-AHZLMCZF.mjs → chunk-KSDXSKJ7.mjs} +1 -1
- package/dist/{chunk-BZKI5J2M.mjs → chunk-L7A2JIQY.mjs} +3 -3
- package/dist/{chunk-XY7A7GZJ.mjs → chunk-LEAMWI5H.mjs} +1 -1
- package/dist/{chunk-A4XYK3MY.mjs → chunk-LG5B2BVB.mjs} +2 -2
- package/dist/{chunk-23GTCEOV.mjs → chunk-ML7BA2NY.mjs} +1 -1
- package/dist/{chunk-OFN7DIZA.mjs → chunk-OYHFHBNL.mjs} +94 -7
- package/dist/{chunk-OSHH5GAS.mjs → chunk-Q34TRFIW.mjs} +1 -13
- package/dist/{chunk-UJ2TMPV4.mjs → chunk-QBIQEVTU.mjs} +0 -12
- package/dist/{chunk-YYOPBKME.mjs → chunk-QHRAWZGA.mjs} +3 -3
- package/dist/{chunk-A2WBKOXJ.mjs → chunk-SO2DE6MM.mjs} +2 -2
- package/dist/{chunk-EHU67PIM.mjs → chunk-TOCMU7UV.mjs} +7 -3
- package/dist/{chunk-YIOBBZUB.mjs → chunk-U7KANQ5A.mjs} +2 -2
- package/dist/{chunk-Z6BFNHEO.mjs → chunk-UCYUWNJL.mjs} +109 -62
- package/dist/{chunk-WYATCUOM.mjs → chunk-V2RGYIAG.mjs} +10 -10
- package/dist/{chunk-UWY5ZV66.mjs → chunk-VQ73B7ZZ.mjs} +1 -13
- package/dist/chunk-XD72PXRS.mjs +329 -0
- package/dist/{store-add-locales-VJ4RJ7UI.mjs → chunk-YFXI6CWD.mjs} +2 -67
- package/dist/{chunk-AWRCV3ME.mjs → chunk-YM4XGCHB.mjs} +1 -1
- package/dist/{chunk-ZMG5B4FG.mjs → chunk-ZGV5NOTE.mjs} +1 -1
- package/dist/{collection-add-products-FU2BS3D3.mjs → collection-add-products-YDMBU2JY.mjs} +13 -13
- package/dist/{collection-create-GWKWVT7B.mjs → collection-create-RXHEXU6T.mjs} +3 -3
- package/dist/{collection-detail-VJE7XHLV.mjs → collection-detail-75XPGVOX.mjs} +13 -13
- package/dist/{collection-edit-EZIO2BR5.mjs → collection-edit-CGF47VIN.mjs} +3 -3
- package/dist/{collection-list-IGA6SCNF.mjs → collection-list-75N5NYXQ.mjs} +18 -17
- package/dist/{collection-metadata-QK7MI3D2.mjs → collection-metadata-TGGC6HM2.mjs} +12 -12
- package/dist/{customer-detail-MOV2T3LF.mjs → customer-detail-KDLZ23B3.mjs} +17 -16
- package/dist/{customer-group-detail-6T7OXGQD.mjs → customer-group-detail-ZIAVMOYS.mjs} +12 -12
- package/dist/{customer-group-list-AJEAF5D2.mjs → customer-group-list-BDDC5VVZ.mjs} +15 -15
- package/dist/{customers-add-customer-group-QVTVSQYM.mjs → customers-add-customer-group-B3ASQGP6.mjs} +12 -12
- package/dist/{edit-inventory-item-H7DAZWIT.mjs → edit-inventory-item-OKAXQRJ5.mjs} +2 -2
- package/dist/{edit-inventory-item-attributes-7HTXXPGZ.mjs → edit-inventory-item-attributes-FVWDV6O5.mjs} +2 -2
- package/dist/{edit-reservation-OVTRZHJR.mjs → edit-reservation-3PU6YSNJ.mjs} +3 -3
- package/dist/{edit-rules-SMVRTCUP.mjs → edit-rules-LOJ3P4YB.mjs} +14 -14
- package/dist/en.json +73 -5
- package/dist/{inventory-create-ANYUM4P5.mjs → inventory-create-C2WWS7QR.mjs} +13 -13
- package/dist/{inventory-detail-ZPSEMYI2.mjs → inventory-detail-AKOZ4T3Z.mjs} +12 -12
- package/dist/{inventory-list-RXJPSVZE.mjs → inventory-list-DRFJIU2O.mjs} +2 -2
- package/dist/{inventory-metadata-FNEJ3RAT.mjs → inventory-metadata-N6CJZEWD.mjs} +12 -12
- package/dist/{inventory-stock-FD4ZM4BB.mjs → inventory-stock-IJ2N7LKC.mjs} +14 -14
- package/dist/{location-detail-N3GUZSY7.mjs → location-detail-PL4Y43RS.mjs} +16 -16
- package/dist/{location-fulfillment-providers-7ZUJAGNY.mjs → location-fulfillment-providers-2PLOVSXC.mjs} +17 -16
- package/dist/{location-sales-channels-P3QJTFDT.mjs → location-sales-channels-SZARSLWT.mjs} +5 -5
- package/dist/{location-service-zone-shipping-option-create-ZJ4GIBTJ.mjs → location-service-zone-shipping-option-create-CUNSAP24.mjs} +15 -15
- package/dist/{location-service-zone-shipping-option-edit-4CGPQ3VT.mjs → location-service-zone-shipping-option-edit-OJ462SVM.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-pricing-CR4BVYG3.mjs → location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs} +2 -2
- package/dist/login-VBUNWZHI.mjs +301 -0
- package/dist/{manage-locations-7HH6R4UP.mjs → manage-locations-JPCSBA5D.mjs} +2 -2
- package/dist/{order-allocate-items-HZGGYJ42.mjs → order-allocate-items-6QHQASQJ.mjs} +4 -4
- package/dist/{order-create-claim-SCDJGM46.mjs → order-create-claim-ECVSH5GC.mjs} +22 -22
- package/dist/{order-create-edit-JIE3HDHP.mjs → order-create-edit-EVIOJIXE.mjs} +14 -13
- package/dist/{order-create-exchange-LQU4YN7F.mjs → order-create-exchange-ZVYYOGI3.mjs} +22 -22
- package/dist/{order-create-fulfillment-OWUVTZXW.mjs → order-create-fulfillment-FDIFEV6X.mjs} +16 -16
- package/dist/{order-create-refund-Q6HQY42R.mjs → order-create-refund-TNPGKR5P.mjs} +17 -17
- package/dist/{order-create-return-52GHGW5Z.mjs → order-create-return-NR6XQLDD.mjs} +9 -9
- package/dist/{order-create-shipment-WAGGEPRW.mjs → order-create-shipment-UP3WGRWB.mjs} +12 -12
- package/dist/{order-detail-PVPGEWGY.mjs → order-detail-F6D5DV74.mjs} +28 -28
- package/dist/{order-edit-billing-address-UM76J4KX.mjs → order-edit-billing-address-D4AJ6Z5Q.mjs} +44 -12
- package/dist/{order-edit-email-CL3KNOCM.mjs → order-edit-email-MXYA5BII.mjs} +12 -12
- package/dist/{order-edit-shipping-address-PIESTGVL.mjs → order-edit-shipping-address-GKW2ZPGR.mjs} +42 -12
- package/dist/{order-export-LE363ZLB.mjs → order-export-KQUI2TK7.mjs} +14 -14
- package/dist/{order-list-GRLQWN4L.mjs → order-list-7A5UKGXR.mjs} +11 -11
- package/dist/{order-metadata-FHBB7MTG.mjs → order-metadata-2IXELA7C.mjs} +12 -12
- package/dist/{order-receive-return-PRVKP6J2.mjs → order-receive-return-XXHOXGDC.mjs} +13 -13
- package/dist/{order-request-transfer-XSAGRUMT.mjs → order-request-transfer-2ENR64VR.mjs} +13 -13
- package/dist/{price-list-configuration-6S3MLNXQ.mjs → price-list-configuration-BZ3ZH5FY.mjs} +3 -3
- package/dist/{price-list-create-MFRUQADC.mjs → price-list-create-GFGNP6OS.mjs} +16 -16
- package/dist/{price-list-detail-Q5VG5VGW.mjs → price-list-detail-SNNOR5N7.mjs} +17 -17
- package/dist/{price-list-edit-53UW35L3.mjs → price-list-edit-YW5BXBF2.mjs} +3 -3
- package/dist/{price-list-list-DG5YEZ44.mjs → price-list-list-OF562HME.mjs} +4 -4
- package/dist/{price-list-prices-add-SDU5YZAT.mjs → price-list-prices-add-F7A2EV7L.mjs} +15 -15
- package/dist/{price-list-prices-edit-5USQR4D4.mjs → price-list-prices-edit-PQ26MOJE.mjs} +5 -5
- package/dist/{product-attributes-K4FGFORS.mjs → product-attributes-HO2B4OHP.mjs} +13 -13
- package/dist/{product-create-7YTRHZQQ.mjs → product-create-UEVW5JO4.mjs} +485 -561
- package/dist/{product-create-variant-ERKHTEJZ.mjs → product-create-variant-PLZ5Q2R6.mjs} +14 -14
- package/dist/{product-detail-32ZXNWOP.mjs → product-detail-Z7K5TGZY.mjs} +45 -66
- package/dist/{product-edit-FBAKONMR.mjs → product-edit-6I6JG4GP.mjs} +13 -13
- package/dist/{product-export-5AD7NELI.mjs → product-export-UMMROQ7T.mjs} +18 -17
- package/dist/{product-image-variants-edit-M6QF2RLE.mjs → product-image-variants-edit-VRG3AJID.mjs} +12 -12
- package/dist/{product-import-V3KQN4TV.mjs → product-import-EPS4KDID.mjs} +12 -12
- package/dist/{product-list-EUWZIFTM.mjs → product-list-37O7VB2L.mjs} +20 -20
- package/dist/{product-media-3VJ7KENL.mjs → product-media-IV5NUSLW.mjs} +3 -3
- package/dist/{product-metadata-GL2MVPDI.mjs → product-metadata-KTVRI7B3.mjs} +12 -12
- package/dist/product-option-create-C5BPN6P6.mjs +268 -0
- package/dist/product-option-detail-VVK3YBCE.mjs +331 -0
- package/dist/product-option-edit-7FQSKI2R.mjs +325 -0
- package/dist/product-option-list-YHGRI7OJ.mjs +268 -0
- package/dist/product-option-metadata-P2DHDGYR.mjs +73 -0
- package/dist/product-options-manage-B4N54NCR.mjs +358 -0
- package/dist/{product-organization-IUSVX22S.mjs → product-organization-L23V4JA7.mjs} +15 -15
- package/dist/{product-prices-4C36AG4R.mjs → product-prices-GUO3KM2U.mjs} +3 -3
- package/dist/{product-sales-channels-PPXUG4KT.mjs → product-sales-channels-BOZD3AC3.mjs} +5 -5
- package/dist/{product-shipping-profile-ETQFZ7DC.mjs → product-shipping-profile-FNFRDY47.mjs} +3 -3
- package/dist/{product-stock-VEGE6SUZ.mjs → product-stock-2DNYG73L.mjs} +14 -14
- package/dist/{product-tag-create-PQMDDKWH.mjs → product-tag-create-CW7GUCZW.mjs} +12 -12
- package/dist/{product-tag-detail-I3MBZX7U.mjs → product-tag-detail-IB5VIZ3K.mjs} +26 -25
- package/dist/{product-tag-edit-K3BBQLJR.mjs → product-tag-edit-ZSXD3DOC.mjs} +12 -12
- package/dist/{product-tag-list-JUWSOMB7.mjs → product-tag-list-MJO5PURP.mjs} +24 -23
- package/dist/{product-tag-metadata-MJH5LH7E.mjs → product-tag-metadata-DAKCXWZF.mjs} +12 -12
- package/dist/{product-type-create-DRFXTL5O.mjs → product-type-create-NRLNMABQ.mjs} +2 -2
- package/dist/{product-type-detail-RKHT5NBL.mjs → product-type-detail-J2IMAZW6.mjs} +14 -14
- package/dist/{product-type-edit-SRHCZDK7.mjs → product-type-edit-BHTPMMVI.mjs} +2 -2
- package/dist/{product-type-list-QQKAHBJ3.mjs → product-type-list-MQ2PW2IE.mjs} +3 -3
- package/dist/{product-type-metadata-CDJDFFGQ.mjs → product-type-metadata-BCZMUG3K.mjs} +12 -12
- package/dist/{product-variant-detail-XAYG5CKE.mjs → product-variant-detail-4L6DHT3K.mjs} +12 -12
- package/dist/{product-variant-edit-DEZEY2H2.mjs → product-variant-edit-PZU4P65H.mjs} +13 -13
- package/dist/{product-variant-manage-inventory-items-Y2VEOHP7.mjs → product-variant-manage-inventory-items-E3GPBPEZ.mjs} +3 -3
- package/dist/{product-variant-media-2WLVNGI4.mjs → product-variant-media-BSNCO642.mjs} +2 -2
- package/dist/{product-variant-metadata-VTZDNWUT.mjs → product-variant-metadata-FHGGZGPV.mjs} +12 -12
- package/dist/{promotion-add-campaign-DO67QK6M.mjs → promotion-add-campaign-NQSIFI33.mjs} +3 -3
- package/dist/{promotion-create-HWFNUQXG.mjs → promotion-create-GBZWJVAI.mjs} +24 -21
- package/dist/{promotion-detail-QC36KXB3.mjs → promotion-detail-W2OGUESO.mjs} +12 -12
- package/dist/{refund-reason-create-YHCDEHGQ.mjs → refund-reason-create-DLVRT5OU.mjs} +12 -12
- package/dist/{refund-reason-edit-CZ5QZ2SZ.mjs → refund-reason-edit-XCSU7RMH.mjs} +12 -12
- package/dist/{refund-reason-list-OJYYEYJE.mjs → refund-reason-list-G6UNVGPG.mjs} +18 -18
- package/dist/{region-create-NA7Y2LN4.mjs → region-create-2CRTF7HJ.mjs} +1 -1
- package/dist/{region-edit-WAU347DP.mjs → region-edit-IB3PJE7V.mjs} +1 -1
- package/dist/{region-metadata-H6XXUQ4S.mjs → region-metadata-WBEUKOI6.mjs} +12 -12
- package/dist/{reservation-create-ZCIYM6JI.mjs → reservation-create-ERFJUBME.mjs} +4 -4
- package/dist/{reservation-detail-LZAQL4XA.mjs → reservation-detail-Y6UZRZXY.mjs} +12 -12
- package/dist/{reservation-list-B47DXTA7.mjs → reservation-list-LEDZB7KL.mjs} +3 -3
- package/dist/{reservation-metadata-5HZSDDOK.mjs → reservation-metadata-7KH4EXMN.mjs} +12 -12
- package/dist/{return-reason-list-SCBGTOEI.mjs → return-reason-list-UUQAL464.mjs} +6 -6
- package/dist/{sales-channel-add-products-F7YV4MO5.mjs → sales-channel-add-products-GSPG7OTK.mjs} +14 -14
- package/dist/{sales-channel-create-MI7HHZYE.mjs → sales-channel-create-MM237EBQ.mjs} +3 -3
- package/dist/{sales-channel-detail-MXIPZCGA.mjs → sales-channel-detail-65ZFV2OI.mjs} +14 -14
- package/dist/{sales-channel-edit-VSHOIR37.mjs → sales-channel-edit-AC2J4N3M.mjs} +3 -3
- package/dist/{sales-channel-list-RLGL7FM3.mjs → sales-channel-list-LXLW7X3U.mjs} +14 -14
- package/dist/{sales-channel-metadata-M364R4RJ.mjs → sales-channel-metadata-QUAL2RH6.mjs} +13 -13
- package/dist/{shipping-option-type-create-C5WUWON7.mjs → shipping-option-type-create-EU75JC2Q.mjs} +12 -12
- package/dist/{shipping-option-type-detail-PENS2K73.mjs → shipping-option-type-detail-5GYEWATD.mjs} +13 -13
- package/dist/{shipping-option-type-edit-CIU5EHRP.mjs → shipping-option-type-edit-YR4JXT5M.mjs} +12 -12
- package/dist/{shipping-option-type-list-DIOX7VG7.mjs → shipping-option-type-list-BLC4Z5QW.mjs} +13 -13
- package/dist/{shipping-profile-metadata-75G2NNMA.mjs → shipping-profile-metadata-64YRWPDA.mjs} +12 -12
- package/dist/store-add-locales-TSMLNFZP.mjs +81 -0
- package/dist/{store-detail-JSNPOB2F.mjs → store-detail-3SS53LZR.mjs} +13 -13
- package/dist/{store-edit-5ZS562ZO.mjs → store-edit-SMEWFETF.mjs} +1 -1
- package/dist/{store-metadata-CYXTVJUE.mjs → store-metadata-IJGVDDA6.mjs} +12 -12
- package/dist/{tax-region-create-DWGL4EUT.mjs → tax-region-create-XLYIS5XX.mjs} +13 -13
- package/dist/{tax-region-detail-2AE2EFI3.mjs → tax-region-detail-66FKEGFB.mjs} +29 -28
- package/dist/{tax-region-edit-EEVEEU2Q.mjs → tax-region-edit-GBR4EDW7.mjs} +13 -13
- package/dist/{tax-region-province-detail-4ERSEQFF.mjs → tax-region-province-detail-OBA7Q7MQ.mjs} +29 -28
- package/dist/{tax-region-tax-override-create-PHCGEF7V.mjs → tax-region-tax-override-create-34WYD2QZ.mjs} +28 -27
- package/dist/{tax-region-tax-override-edit-SMRPSILC.mjs → tax-region-tax-override-edit-6WJVOGWA.mjs} +27 -26
- package/dist/translation-list-J65VNNAX.mjs +527 -0
- package/dist/{translations-edit-KECSHYZY.mjs → translations-edit-6P3KC4MO.mjs} +280 -304
- package/dist/{user-detail-BJUXLZZQ.mjs → user-detail-VMOJFHIJ.mjs} +2 -2
- package/dist/{user-metadata-2WPJOEJA.mjs → user-metadata-UOPVFX2L.mjs} +12 -12
- package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-WAQ7IG4T.mjs} +12 -12
- package/package.json +9 -9
- package/src/components/data-grid/components/data-grid-cell-container.tsx +7 -10
- package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +1 -4
- package/src/components/data-grid/components/data-grid-root.tsx +68 -51
- package/src/components/data-grid/components/data-grid-text-cell.tsx +6 -76
- package/src/components/data-grid/components/index.ts +1 -0
- package/src/components/data-grid/data-grid.tsx +2 -0
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +12 -0
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +1 -0
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +65 -7
- package/src/components/data-grid/types.ts +1 -0
- package/src/components/inputs/combobox/combobox.tsx +185 -95
- package/src/components/layout/main-layout/main-layout.tsx +7 -4
- package/src/components/table/table-cells/order/country-cell/country-cell.tsx +5 -1
- package/src/dashboard-app/routes/get-route.map.tsx +68 -12
- package/src/hooks/api/cloud.tsx +41 -0
- package/src/hooks/api/index.ts +3 -1
- package/src/hooks/api/product-options.tsx +151 -0
- package/src/hooks/api/products.tsx +26 -66
- package/src/hooks/api/translations.tsx +103 -191
- package/src/hooks/table/columns/use-order-table-columns.tsx +5 -3
- package/src/hooks/table/columns/use-product-option-table-columns.tsx +44 -0
- package/src/hooks/table/filters/index.ts +1 -0
- package/src/hooks/table/filters/use-product-option-table-filters.tsx +33 -0
- package/src/hooks/table/query/use-product-option-table-query.tsx +34 -0
- package/src/i18n/translations/$schema.json +290 -32
- package/src/i18n/translations/en.json +73 -5
- package/src/i18n/translations/es.json +9 -1
- package/src/routes/customers/customer-detail/components/customer-order-section/customer-order-section.tsx +1 -1
- package/src/routes/login/components/cloud-auth-login.tsx +114 -0
- package/src/routes/login/login.tsx +9 -1
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +1 -0
- package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +34 -0
- package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/edit-order-shipping-address-form.tsx +32 -0
- package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +41 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +71 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +97 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +92 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +1 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +15 -0
- package/src/routes/product-options/product-option-create/index.ts +1 -0
- package/src/routes/product-options/product-option-create/product-option-create.tsx +10 -0
- package/src/routes/product-options/product-option-detail/breadcrumb.tsx +14 -0
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +1 -0
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +84 -0
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +1 -0
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +82 -0
- package/src/routes/product-options/product-option-detail/index.ts +3 -0
- package/src/routes/product-options/product-option-detail/loader.ts +18 -0
- package/src/routes/product-options/product-option-detail/product-option-detail.tsx +50 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +94 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +116 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +77 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +1 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +13 -0
- package/src/routes/product-options/product-option-edit/index.ts +1 -0
- package/src/routes/product-options/product-option-edit/product-option-edit.tsx +34 -0
- package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +1 -0
- package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +140 -0
- package/src/routes/product-options/product-option-list/index.ts +1 -0
- package/src/routes/product-options/product-option-list/product-option-list.tsx +19 -0
- package/src/routes/product-options/product-option-metadata/index.ts +1 -0
- package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +27 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +16 -4
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +327 -194
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +4 -7
- package/src/routes/products/product-create/constants.ts +2 -0
- package/src/routes/products/product-create/utils.ts +6 -1
- package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +33 -51
- package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +1 -0
- package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +328 -0
- package/src/routes/products/product-options-manage/index.ts +1 -0
- package/src/routes/products/product-options-manage/product-options-manage.tsx +35 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +6 -0
- package/src/routes/translations/add-locales/add-locales.tsx +29 -0
- package/src/routes/translations/add-locales/index.tsx +1 -0
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +42 -17
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +5 -1
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +182 -121
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +330 -361
- package/src/routes/translations/translations-edit/translations-edit.tsx +8 -13
- package/dist/chunk-HGRIOEAR.mjs +0 -32
- package/dist/chunk-XDJ7OMBR.mjs +0 -160
- package/dist/login-VNOLI5YG.mjs +0 -201
- package/dist/product-create-option-7AOXAA4S.mjs +0 -151
- package/dist/product-edit-option-LWJT3CYJ.mjs +0 -156
- package/dist/translation-list-UF7FLXOW.mjs +0 -441
- package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +0 -122
- package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +0 -1
- package/src/routes/products/product-create-option/index.ts +0 -1
- package/src/routes/products/product-create-option/product-create-option.tsx +0 -30
- package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +0 -123
- package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +0 -1
- package/src/routes/products/product-edit-option/index.ts +0 -1
- package/src/routes/products/product-edit-option/product-edit-option.tsx +0 -35
- package/dist/{chunk-FBYTX6K7.mjs → chunk-ORWRXJJT.mjs} +4 -4
- package/dist/{location-list-KVBA6J47.mjs → location-list-3WP65J3E.mjs} +1 -1
- package/dist/{user-list-YTZQNYSO.mjs → user-list-3EAKK4XC.mjs} +3 -3
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChipGroup
|
|
3
3
|
} from "./chunk-X5VECN6S.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ChipInput,
|
|
6
|
+
SortableList
|
|
7
|
+
} from "./chunk-XD72PXRS.mjs";
|
|
4
8
|
import {
|
|
5
9
|
HandleInput
|
|
6
10
|
} from "./chunk-7OYLCEKK.mjs";
|
|
7
|
-
import {
|
|
8
|
-
ChipInput
|
|
9
|
-
} from "./chunk-XDJ7OMBR.mjs";
|
|
10
11
|
import {
|
|
11
12
|
useSalesChannelTableColumns,
|
|
12
13
|
useSalesChannelTableEmptyState,
|
|
@@ -16,32 +17,32 @@ import {
|
|
|
16
17
|
import "./chunk-BTYBTKWK.mjs";
|
|
17
18
|
import {
|
|
18
19
|
CategoryCombobox
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CW5PQUJ6.mjs";
|
|
20
21
|
import {
|
|
21
22
|
useComboboxData
|
|
22
23
|
} from "./chunk-3TZOFKX2.mjs";
|
|
23
24
|
import {
|
|
24
25
|
Combobox
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OYHFHBNL.mjs";
|
|
26
27
|
import {
|
|
27
28
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
28
29
|
ProductCreateSchema,
|
|
29
30
|
UploadMediaFormItem,
|
|
30
31
|
decorateVariantsWithDefaultValues,
|
|
31
32
|
normalizeProductFormValues
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-3RRA56WC.mjs";
|
|
33
34
|
import "./chunk-ZQRKUG6J.mjs";
|
|
34
35
|
import {
|
|
35
36
|
DataGrid,
|
|
36
37
|
createDataGridHelper,
|
|
37
38
|
createDataGridPriceColumns
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-FKNW5MLZ.mjs";
|
|
39
40
|
import "./chunk-DK4WIVY6.mjs";
|
|
40
41
|
import "./chunk-BYOPZAGX.mjs";
|
|
41
|
-
import "./chunk-R4ZOO4ON.mjs";
|
|
42
42
|
import {
|
|
43
43
|
DataTable
|
|
44
44
|
} from "./chunk-KCWP7RF5.mjs";
|
|
45
|
+
import "./chunk-R4ZOO4ON.mjs";
|
|
45
46
|
import "./chunk-C76H5USB.mjs";
|
|
46
47
|
import "./chunk-DFFLVEZ5.mjs";
|
|
47
48
|
import {
|
|
@@ -63,7 +64,7 @@ import {
|
|
|
63
64
|
import {
|
|
64
65
|
FormExtensionZone,
|
|
65
66
|
useExtendableForm
|
|
66
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-772OR7OQ.mjs";
|
|
67
68
|
import "./chunk-2SSUH2HJ.mjs";
|
|
68
69
|
import "./chunk-ONB3JEHR.mjs";
|
|
69
70
|
import "./chunk-YCDDT44O.mjs";
|
|
@@ -90,32 +91,32 @@ import "./chunk-535OVBXR.mjs";
|
|
|
90
91
|
import {
|
|
91
92
|
Form
|
|
92
93
|
} from "./chunk-OBQI23QM.mjs";
|
|
93
|
-
import "./chunk-
|
|
94
|
+
import "./chunk-74WPAWMW.mjs";
|
|
94
95
|
import "./chunk-I4OBEAOJ.mjs";
|
|
95
96
|
import "./chunk-HI6URQ7H.mjs";
|
|
96
97
|
import "./chunk-6CLQKVAU.mjs";
|
|
98
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
97
99
|
import "./chunk-KI7TOXBR.mjs";
|
|
98
|
-
import "./chunk-
|
|
99
|
-
import "./chunk-23GTCEOV.mjs";
|
|
100
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
100
101
|
import "./chunk-WAXMT4IY.mjs";
|
|
101
102
|
import "./chunk-DYDGGABK.mjs";
|
|
102
|
-
import "./chunk-LGNTHZ5Y.mjs";
|
|
103
103
|
import "./chunk-CN7JXSGW.mjs";
|
|
104
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
104
105
|
import "./chunk-5BQQRHQS.mjs";
|
|
105
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-G35UUG2P.mjs";
|
|
106
107
|
import "./chunk-5AFMB7XQ.mjs";
|
|
107
|
-
import "./chunk-
|
|
108
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
108
109
|
import "./chunk-A63RZVX6.mjs";
|
|
109
110
|
import "./chunk-HBXV7ENS.mjs";
|
|
110
111
|
import "./chunk-CDORR33H.mjs";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
113
|
-
import "./chunk-
|
|
112
|
+
import "./chunk-333HK6Y6.mjs";
|
|
113
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
114
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
115
|
+
import "./chunk-3BF5SC66.mjs";
|
|
114
116
|
import {
|
|
115
117
|
useSalesChannel,
|
|
116
118
|
useSalesChannels
|
|
117
|
-
} from "./chunk-
|
|
118
|
-
import "./chunk-3BF5SC66.mjs";
|
|
119
|
+
} from "./chunk-DWH2OQFK.mjs";
|
|
119
120
|
import {
|
|
120
121
|
useStore
|
|
121
122
|
} from "./chunk-VCSSQVPD.mjs";
|
|
@@ -126,9 +127,10 @@ import {
|
|
|
126
127
|
usePricePreferences
|
|
127
128
|
} from "./chunk-SQDIZZDW.mjs";
|
|
128
129
|
import {
|
|
129
|
-
useCreateProduct
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
useCreateProduct,
|
|
131
|
+
useProductOptions
|
|
132
|
+
} from "./chunk-UCYUWNJL.mjs";
|
|
133
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
132
134
|
import "./chunk-FXYH54JP.mjs";
|
|
133
135
|
import "./chunk-774WSTCC.mjs";
|
|
134
136
|
import {
|
|
@@ -140,8 +142,8 @@ import "./chunk-QZ7TP4HQ.mjs";
|
|
|
140
142
|
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
141
143
|
|
|
142
144
|
// src/routes/products/product-create/components/product-create-form/product-create-form.tsx
|
|
143
|
-
import { Button as
|
|
144
|
-
import { useEffect as useEffect2, useMemo as useMemo4, useState as
|
|
145
|
+
import { Button as Button4, ProgressTabs, toast } from "@medusajs/ui";
|
|
146
|
+
import { useEffect as useEffect2, useMemo as useMemo4, useState as useState3 } from "react";
|
|
145
147
|
import { useWatch as useWatch4 } from "react-hook-form";
|
|
146
148
|
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
147
149
|
|
|
@@ -167,7 +169,13 @@ var ProductCreateGeneralSection = ({
|
|
|
167
169
|
render: ({ field }) => {
|
|
168
170
|
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
169
171
|
/* @__PURE__ */ jsx(Form.Label, { children: t("products.fields.title.label") }),
|
|
170
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
172
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
173
|
+
Input,
|
|
174
|
+
{
|
|
175
|
+
...field,
|
|
176
|
+
placeholder: t("products.fields.title.placeholder")
|
|
177
|
+
}
|
|
178
|
+
) })
|
|
171
179
|
] });
|
|
172
180
|
}
|
|
173
181
|
}
|
|
@@ -180,7 +188,13 @@ var ProductCreateGeneralSection = ({
|
|
|
180
188
|
render: ({ field }) => {
|
|
181
189
|
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
182
190
|
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("products.fields.subtitle.label") }),
|
|
183
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
191
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
192
|
+
Input,
|
|
193
|
+
{
|
|
194
|
+
...field,
|
|
195
|
+
placeholder: t("products.fields.subtitle.placeholder")
|
|
196
|
+
}
|
|
197
|
+
) })
|
|
184
198
|
] });
|
|
185
199
|
}
|
|
186
200
|
}
|
|
@@ -200,7 +214,13 @@ var ProductCreateGeneralSection = ({
|
|
|
200
214
|
children: t("fields.handle")
|
|
201
215
|
}
|
|
202
216
|
),
|
|
203
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
217
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
218
|
+
HandleInput,
|
|
219
|
+
{
|
|
220
|
+
...field,
|
|
221
|
+
placeholder: t("products.fields.handle.placeholder")
|
|
222
|
+
}
|
|
223
|
+
) })
|
|
204
224
|
] });
|
|
205
225
|
}
|
|
206
226
|
}
|
|
@@ -214,7 +234,13 @@ var ProductCreateGeneralSection = ({
|
|
|
214
234
|
render: ({ field }) => {
|
|
215
235
|
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
216
236
|
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("products.fields.description.label") }),
|
|
217
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
237
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
238
|
+
Textarea,
|
|
239
|
+
{
|
|
240
|
+
...field,
|
|
241
|
+
placeholder: t("products.fields.description.placeholder")
|
|
242
|
+
}
|
|
243
|
+
) })
|
|
218
244
|
] });
|
|
219
245
|
}
|
|
220
246
|
}
|
|
@@ -515,197 +541,23 @@ function formatFileSize(bytes, decimalPlaces = 2) {
|
|
|
515
541
|
}
|
|
516
542
|
|
|
517
543
|
// src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx
|
|
518
|
-
import { XMarkMini } from "@medusajs/icons";
|
|
519
544
|
import {
|
|
520
545
|
Alert,
|
|
521
|
-
Button,
|
|
522
546
|
Checkbox,
|
|
523
|
-
clx
|
|
547
|
+
clx,
|
|
524
548
|
Heading,
|
|
525
549
|
Hint,
|
|
526
|
-
IconButton as IconButton3,
|
|
527
550
|
InlineTip,
|
|
528
|
-
Input as Input2,
|
|
529
551
|
Label,
|
|
530
552
|
Text as Text2
|
|
531
553
|
} from "@medusajs/ui";
|
|
532
554
|
import {
|
|
533
|
-
Controller,
|
|
534
555
|
useFieldArray as useFieldArray2,
|
|
535
556
|
useWatch
|
|
536
557
|
} from "react-hook-form";
|
|
537
558
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
import {
|
|
541
|
-
DndContext as DndContext2,
|
|
542
|
-
DragOverlay as DragOverlay2,
|
|
543
|
-
KeyboardSensor as KeyboardSensor2,
|
|
544
|
-
PointerSensor as PointerSensor2,
|
|
545
|
-
defaultDropAnimationSideEffects as defaultDropAnimationSideEffects2,
|
|
546
|
-
useSensor as useSensor2,
|
|
547
|
-
useSensors as useSensors2
|
|
548
|
-
} from "@dnd-kit/core";
|
|
549
|
-
import {
|
|
550
|
-
SortableContext as SortableContext2,
|
|
551
|
-
arrayMove as arrayMove2,
|
|
552
|
-
sortableKeyboardCoordinates as sortableKeyboardCoordinates2,
|
|
553
|
-
useSortable as useSortable2
|
|
554
|
-
} from "@dnd-kit/sortable";
|
|
555
|
-
import { CSS as CSS2 } from "@dnd-kit/utilities";
|
|
556
|
-
import { DotsSix as DotsSix2 } from "@medusajs/icons";
|
|
557
|
-
import { IconButton as IconButton2, clx } from "@medusajs/ui";
|
|
558
|
-
import {
|
|
559
|
-
Fragment,
|
|
560
|
-
createContext,
|
|
561
|
-
useContext,
|
|
562
|
-
useMemo,
|
|
563
|
-
useState as useState2
|
|
564
|
-
} from "react";
|
|
565
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
566
|
-
var List = ({
|
|
567
|
-
items,
|
|
568
|
-
onChange,
|
|
569
|
-
renderItem
|
|
570
|
-
}) => {
|
|
571
|
-
const [active, setActive] = useState2(null);
|
|
572
|
-
const [activeItem, activeIndex] = useMemo(() => {
|
|
573
|
-
if (active === null) {
|
|
574
|
-
return [null, null];
|
|
575
|
-
}
|
|
576
|
-
const index = items.findIndex(({ id }) => id === active.id);
|
|
577
|
-
return [items[index], index];
|
|
578
|
-
}, [active, items]);
|
|
579
|
-
const sensors = useSensors2(
|
|
580
|
-
useSensor2(PointerSensor2),
|
|
581
|
-
useSensor2(KeyboardSensor2, {
|
|
582
|
-
coordinateGetter: sortableKeyboardCoordinates2
|
|
583
|
-
})
|
|
584
|
-
);
|
|
585
|
-
const handleDragStart = ({ active: active2 }) => {
|
|
586
|
-
setActive(active2);
|
|
587
|
-
};
|
|
588
|
-
const handleDragEnd = ({ active: active2, over }) => {
|
|
589
|
-
if (over && active2.id !== over.id) {
|
|
590
|
-
const activeIndex2 = items.findIndex(({ id }) => id === active2.id);
|
|
591
|
-
const overIndex = items.findIndex(({ id }) => id === over.id);
|
|
592
|
-
onChange(arrayMove2(items, activeIndex2, overIndex));
|
|
593
|
-
}
|
|
594
|
-
setActive(null);
|
|
595
|
-
};
|
|
596
|
-
const handleDragCancel = () => {
|
|
597
|
-
setActive(null);
|
|
598
|
-
};
|
|
599
|
-
return /* @__PURE__ */ jsxs3(
|
|
600
|
-
DndContext2,
|
|
601
|
-
{
|
|
602
|
-
sensors,
|
|
603
|
-
onDragStart: handleDragStart,
|
|
604
|
-
onDragEnd: handleDragEnd,
|
|
605
|
-
onDragCancel: handleDragCancel,
|
|
606
|
-
children: [
|
|
607
|
-
/* @__PURE__ */ jsx3(Overlay, { children: activeItem && activeIndex !== null ? renderItem(activeItem, activeIndex) : null }),
|
|
608
|
-
/* @__PURE__ */ jsx3(SortableContext2, { items, children: /* @__PURE__ */ jsx3(
|
|
609
|
-
"ul",
|
|
610
|
-
{
|
|
611
|
-
role: "application",
|
|
612
|
-
className: "flex list-inside list-none list-image-none flex-col p-0",
|
|
613
|
-
children: items.map((item, index) => /* @__PURE__ */ jsx3(Fragment, { children: renderItem(item, index) }, item.id))
|
|
614
|
-
}
|
|
615
|
-
) })
|
|
616
|
-
]
|
|
617
|
-
}
|
|
618
|
-
);
|
|
619
|
-
};
|
|
620
|
-
var dropAnimationConfig2 = {
|
|
621
|
-
sideEffects: defaultDropAnimationSideEffects2({
|
|
622
|
-
styles: {
|
|
623
|
-
active: {
|
|
624
|
-
opacity: "0.4"
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
})
|
|
628
|
-
};
|
|
629
|
-
var Overlay = ({ children }) => {
|
|
630
|
-
return /* @__PURE__ */ jsx3(
|
|
631
|
-
DragOverlay2,
|
|
632
|
-
{
|
|
633
|
-
className: "shadow-elevation-card-hover overflow-hidden rounded-md [&>li]:border-b-0",
|
|
634
|
-
dropAnimation: dropAnimationConfig2,
|
|
635
|
-
children
|
|
636
|
-
}
|
|
637
|
-
);
|
|
638
|
-
};
|
|
639
|
-
var SortableItemContext = createContext(null);
|
|
640
|
-
var useSortableItemContext = () => {
|
|
641
|
-
const context = useContext(SortableItemContext);
|
|
642
|
-
if (!context) {
|
|
643
|
-
throw new Error(
|
|
644
|
-
"useSortableItemContext must be used within a SortableItemContext"
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
return context;
|
|
648
|
-
};
|
|
649
|
-
var Item = ({
|
|
650
|
-
id,
|
|
651
|
-
className,
|
|
652
|
-
children
|
|
653
|
-
}) => {
|
|
654
|
-
const {
|
|
655
|
-
attributes,
|
|
656
|
-
isDragging,
|
|
657
|
-
listeners,
|
|
658
|
-
setNodeRef,
|
|
659
|
-
setActivatorNodeRef,
|
|
660
|
-
transform,
|
|
661
|
-
transition
|
|
662
|
-
} = useSortable2({ id });
|
|
663
|
-
const context = useMemo(
|
|
664
|
-
() => ({
|
|
665
|
-
attributes,
|
|
666
|
-
listeners,
|
|
667
|
-
ref: setActivatorNodeRef,
|
|
668
|
-
isDragging
|
|
669
|
-
}),
|
|
670
|
-
[attributes, listeners, setActivatorNodeRef, isDragging]
|
|
671
|
-
);
|
|
672
|
-
const style = {
|
|
673
|
-
opacity: isDragging ? 0.4 : void 0,
|
|
674
|
-
transform: CSS2.Translate.toString(transform),
|
|
675
|
-
transition
|
|
676
|
-
};
|
|
677
|
-
return /* @__PURE__ */ jsx3(SortableItemContext.Provider, { value: context, children: /* @__PURE__ */ jsx3(
|
|
678
|
-
"li",
|
|
679
|
-
{
|
|
680
|
-
className: clx("transition-fg flex flex-1 list-none", className),
|
|
681
|
-
ref: setNodeRef,
|
|
682
|
-
style,
|
|
683
|
-
children
|
|
684
|
-
}
|
|
685
|
-
) });
|
|
686
|
-
};
|
|
687
|
-
var DragHandle = () => {
|
|
688
|
-
const { attributes, listeners, ref } = useSortableItemContext();
|
|
689
|
-
return /* @__PURE__ */ jsx3(
|
|
690
|
-
IconButton2,
|
|
691
|
-
{
|
|
692
|
-
variant: "transparent",
|
|
693
|
-
size: "small",
|
|
694
|
-
...attributes,
|
|
695
|
-
...listeners,
|
|
696
|
-
ref,
|
|
697
|
-
className: "cursor-grab touch-none active:cursor-grabbing",
|
|
698
|
-
children: /* @__PURE__ */ jsx3(DotsSix2, { className: "text-ui-fg-muted" })
|
|
699
|
-
}
|
|
700
|
-
);
|
|
701
|
-
};
|
|
702
|
-
var SortableList = Object.assign(List, {
|
|
703
|
-
Item,
|
|
704
|
-
DragHandle
|
|
705
|
-
});
|
|
706
|
-
|
|
707
|
-
// src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx
|
|
708
|
-
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
559
|
+
import { useMemo } from "react";
|
|
560
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
709
561
|
var getPermutations = (data) => {
|
|
710
562
|
if (data.length === 0) {
|
|
711
563
|
return [];
|
|
@@ -731,10 +583,6 @@ var ProductCreateVariantsSection = ({
|
|
|
731
583
|
form
|
|
732
584
|
}) => {
|
|
733
585
|
const { t } = useTranslation3();
|
|
734
|
-
const options = useFieldArray2({
|
|
735
|
-
control: form.control,
|
|
736
|
-
name: "options"
|
|
737
|
-
});
|
|
738
586
|
const variants = useFieldArray2({
|
|
739
587
|
control: form.control,
|
|
740
588
|
name: "variants"
|
|
@@ -756,72 +604,147 @@ var ProductCreateVariantsSection = ({
|
|
|
756
604
|
});
|
|
757
605
|
const showInvalidOptionsMessage = !!form.formState.errors.options?.length;
|
|
758
606
|
const showInvalidVariantsMessage = form.formState.errors.variants?.root?.message === "invalid_length";
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
const
|
|
764
|
-
|
|
607
|
+
const { product_options = [], isLoading } = useProductOptions({
|
|
608
|
+
is_exclusive: false
|
|
609
|
+
});
|
|
610
|
+
const productOptionChoices = useMemo(() => {
|
|
611
|
+
const existingChoices = product_options.map((option) => ({
|
|
612
|
+
value: option.id,
|
|
613
|
+
label: option.title
|
|
614
|
+
}));
|
|
615
|
+
const newChoices = watchedOptions.filter((opt) => !opt.id && opt.title).map((opt) => ({
|
|
616
|
+
value: opt.title,
|
|
617
|
+
label: opt.title
|
|
618
|
+
}));
|
|
619
|
+
return [...existingChoices, ...newChoices];
|
|
620
|
+
}, [product_options, watchedOptions]);
|
|
621
|
+
const selectedOptionValues = useMemo(() => {
|
|
622
|
+
return watchedOptions.map((opt) => opt.id || opt.title);
|
|
623
|
+
}, [watchedOptions]);
|
|
624
|
+
const handleProductOptionSelect = (optionValues) => {
|
|
625
|
+
const existingOptionIds = optionValues.filter(
|
|
626
|
+
(val) => product_options.some((opt) => opt.id === val)
|
|
765
627
|
);
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
return permutations.find(
|
|
769
|
-
(permutation) => Object.keys(options2).every((key) => options2[key] === permutation[key])
|
|
770
|
-
);
|
|
771
|
-
};
|
|
772
|
-
const newVariants = oldVariants.reduce((variants2, variant) => {
|
|
773
|
-
const match = findMatchingPermutation(variant.options);
|
|
774
|
-
if (match) {
|
|
775
|
-
variants2.push({
|
|
776
|
-
...variant,
|
|
777
|
-
title: getVariantName(match),
|
|
778
|
-
options: match
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
return variants2;
|
|
782
|
-
}, []);
|
|
783
|
-
const usedPermutations = new Set(
|
|
784
|
-
newVariants.map((variant) => variant.options)
|
|
628
|
+
const newOptionTitles = optionValues.filter(
|
|
629
|
+
(val) => !product_options.some((opt) => opt.id === val)
|
|
785
630
|
);
|
|
786
|
-
const
|
|
787
|
-
|
|
631
|
+
const allSelectedOptions = [];
|
|
632
|
+
const selectedProductOptions = product_options.filter(
|
|
633
|
+
(option) => existingOptionIds.includes(option.id)
|
|
788
634
|
);
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
}
|
|
635
|
+
allSelectedOptions.push(...selectedProductOptions);
|
|
636
|
+
const watchedOptions2 = form.getValues("options");
|
|
637
|
+
watchedOptions2.forEach((opt) => {
|
|
638
|
+
if (!opt.id && opt.title && newOptionTitles.includes(opt.title)) {
|
|
639
|
+
allSelectedOptions.push({
|
|
640
|
+
title: opt.title,
|
|
641
|
+
values: opt.values || []
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
const newSelectedValues = {};
|
|
646
|
+
allSelectedOptions.forEach((option) => {
|
|
647
|
+
if ("id" in option && option.id) {
|
|
648
|
+
const currentOption = watchedOptions2.find((opt) => opt.id === option.id);
|
|
649
|
+
if (currentOption?.value_ids) {
|
|
650
|
+
newSelectedValues[option.id] = currentOption.value_ids;
|
|
651
|
+
} else {
|
|
652
|
+
newSelectedValues[option.id] = option.values?.map((v) => v.id) || [];
|
|
653
|
+
}
|
|
654
|
+
}
|
|
798
655
|
});
|
|
656
|
+
updateFormWithSelectedValues(allSelectedOptions, newSelectedValues);
|
|
657
|
+
};
|
|
658
|
+
const generateAndSetVariants = (options) => {
|
|
659
|
+
const permutations = getPermutations(
|
|
660
|
+
options.filter(({ values }) => values && values.length > 0)
|
|
661
|
+
);
|
|
662
|
+
const newVariants = permutations.map((permutation, index) => ({
|
|
663
|
+
title: getVariantName(permutation),
|
|
664
|
+
options: permutation,
|
|
665
|
+
should_create: true,
|
|
666
|
+
variant_rank: index,
|
|
667
|
+
inventory: [{ inventory_item_id: "", required_quantity: "" }]
|
|
668
|
+
}));
|
|
799
669
|
form.setValue("variants", newVariants);
|
|
800
670
|
};
|
|
801
|
-
const
|
|
802
|
-
if (
|
|
671
|
+
const handleValueChange = (optionId, valueIds) => {
|
|
672
|
+
if (valueIds.length === 0) {
|
|
803
673
|
return;
|
|
804
674
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
});
|
|
675
|
+
const currentOption = watchedOptions.find((opt) => opt.id === optionId);
|
|
676
|
+
if (!currentOption) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
const productOption = product_options.find((opt) => opt.id === optionId);
|
|
680
|
+
const existingValueIds = new Set(
|
|
681
|
+
productOption?.values?.map((v) => v.id) || []
|
|
682
|
+
);
|
|
683
|
+
const validValueIds = [];
|
|
684
|
+
const newValueNames = [];
|
|
685
|
+
valueIds.forEach((id) => {
|
|
686
|
+
if (existingValueIds.has(id)) {
|
|
687
|
+
validValueIds.push(id);
|
|
688
|
+
} else {
|
|
689
|
+
newValueNames.push(id);
|
|
821
690
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
691
|
+
});
|
|
692
|
+
const updatedOptions = watchedOptions.map((opt) => {
|
|
693
|
+
if (opt.id === optionId) {
|
|
694
|
+
const selectedExistingValues = productOption?.values?.filter((v) => validValueIds.includes(v.id)).map((v) => v.value) || [];
|
|
695
|
+
return {
|
|
696
|
+
...opt,
|
|
697
|
+
value_ids: valueIds,
|
|
698
|
+
values: [...selectedExistingValues, ...newValueNames]
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
return opt;
|
|
702
|
+
});
|
|
703
|
+
form.setValue("options", updatedOptions);
|
|
704
|
+
generateAndSetVariants(updatedOptions);
|
|
705
|
+
};
|
|
706
|
+
const handleNewOptionValueChange = (optionTitle, valueNames) => {
|
|
707
|
+
const updatedOptions = watchedOptions.map((opt) => {
|
|
708
|
+
if (!opt.id && opt.title === optionTitle) {
|
|
709
|
+
return {
|
|
710
|
+
...opt,
|
|
711
|
+
values: valueNames
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
return opt;
|
|
715
|
+
});
|
|
716
|
+
form.setValue("options", updatedOptions);
|
|
717
|
+
generateAndSetVariants(updatedOptions);
|
|
718
|
+
};
|
|
719
|
+
const updateFormWithSelectedValues = (selectedProductOptions, valueSelections) => {
|
|
720
|
+
const newOptions = selectedProductOptions.map(
|
|
721
|
+
(option) => {
|
|
722
|
+
if ("id" in option && option.id !== void 0) {
|
|
723
|
+
const existingOption = option;
|
|
724
|
+
const selectedValueIds = valueSelections[existingOption.id] || [];
|
|
725
|
+
const allValues = option.values || [];
|
|
726
|
+
const selectedValues = allValues.filter((v) => selectedValueIds.includes(v.id)).sort((a, b) => {
|
|
727
|
+
const rankA = a.rank ?? Number.MAX_VALUE;
|
|
728
|
+
const rankB = b.rank ?? Number.MAX_VALUE;
|
|
729
|
+
return rankA - rankB;
|
|
730
|
+
}).map((v) => v.value);
|
|
731
|
+
return {
|
|
732
|
+
id: existingOption.id,
|
|
733
|
+
title: existingOption.title,
|
|
734
|
+
values: selectedValues,
|
|
735
|
+
value_ids: selectedValueIds.length > 0 ? selectedValueIds : void 0
|
|
736
|
+
};
|
|
737
|
+
} else {
|
|
738
|
+
const newOption = option;
|
|
739
|
+
return {
|
|
740
|
+
title: newOption.title,
|
|
741
|
+
values: newOption.values
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
form.setValue("options", newOptions);
|
|
747
|
+
generateAndSetVariants(newOptions);
|
|
825
748
|
};
|
|
826
749
|
const handleRankChange = (items) => {
|
|
827
750
|
const update = items.map((item, index) => {
|
|
@@ -892,10 +815,10 @@ var ProductCreateVariantsSection = ({
|
|
|
892
815
|
])
|
|
893
816
|
);
|
|
894
817
|
};
|
|
895
|
-
return /* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
/* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ jsxs3("div", { id: "variants", className: "flex flex-col gap-y-8", children: [
|
|
819
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
|
|
820
|
+
/* @__PURE__ */ jsx3(Heading, { level: "h2", children: t("products.create.variants.header") }),
|
|
821
|
+
/* @__PURE__ */ jsx3(
|
|
899
822
|
SwitchBox,
|
|
900
823
|
{
|
|
901
824
|
control: form.control,
|
|
@@ -918,137 +841,141 @@ var ProductCreateVariantsSection = ({
|
|
|
918
841
|
}
|
|
919
842
|
)
|
|
920
843
|
] }),
|
|
921
|
-
watchedAreVariantsEnabled && /* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
844
|
+
watchedAreVariantsEnabled && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
845
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
|
|
846
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
|
|
847
|
+
/* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("products.create.variants.productOptions.label") }),
|
|
848
|
+
/* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.productOptions.hint") })
|
|
849
|
+
] }),
|
|
850
|
+
showInvalidOptionsMessage && /* @__PURE__ */ jsx3(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.options") }),
|
|
851
|
+
/* @__PURE__ */ jsx3(
|
|
852
|
+
Combobox,
|
|
853
|
+
{
|
|
854
|
+
value: selectedOptionValues,
|
|
855
|
+
onChange: (value) => handleProductOptionSelect(value),
|
|
856
|
+
options: productOptionChoices,
|
|
857
|
+
onCreateOption: async (options) => {
|
|
858
|
+
const optionTitle = options[options.length - 1]?.trim();
|
|
859
|
+
if (!optionTitle) {
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
const allSelectedOptions = [];
|
|
863
|
+
const valueSelections = {};
|
|
864
|
+
watchedOptions.forEach((opt) => {
|
|
865
|
+
if (opt.id) {
|
|
866
|
+
const productOption = product_options.find(
|
|
867
|
+
(p) => p.id === opt.id
|
|
868
|
+
);
|
|
869
|
+
if (productOption) {
|
|
870
|
+
allSelectedOptions.push(productOption);
|
|
871
|
+
if (opt.value_ids) {
|
|
872
|
+
valueSelections[opt.id] = opt.value_ids;
|
|
873
|
+
}
|
|
947
874
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
);
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
)
|
|
1022
|
-
] }),
|
|
1023
|
-
/* @__PURE__ */ jsx4(
|
|
1024
|
-
IconButton3,
|
|
1025
|
-
{
|
|
1026
|
-
type: "button",
|
|
1027
|
-
size: "small",
|
|
1028
|
-
variant: "transparent",
|
|
1029
|
-
className: "text-ui-fg-muted",
|
|
1030
|
-
disabled: index === 0,
|
|
1031
|
-
onClick: () => handleRemoveOption(index),
|
|
1032
|
-
children: /* @__PURE__ */ jsx4(XMarkMini, {})
|
|
1033
|
-
}
|
|
1034
|
-
)
|
|
1035
|
-
]
|
|
875
|
+
} else {
|
|
876
|
+
allSelectedOptions.push({
|
|
877
|
+
title: opt.title,
|
|
878
|
+
values: opt.values || []
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
const newOption = {
|
|
883
|
+
title: optionTitle,
|
|
884
|
+
is_exclusive: true,
|
|
885
|
+
values: []
|
|
886
|
+
};
|
|
887
|
+
allSelectedOptions.push(newOption);
|
|
888
|
+
updateFormWithSelectedValues(
|
|
889
|
+
allSelectedOptions,
|
|
890
|
+
valueSelections
|
|
891
|
+
);
|
|
892
|
+
},
|
|
893
|
+
placeholder: t("products.fields.options.optionTitlePlaceholder"),
|
|
894
|
+
disabled: isLoading,
|
|
895
|
+
displayMode: "chips"
|
|
896
|
+
}
|
|
897
|
+
)
|
|
898
|
+
] }),
|
|
899
|
+
watchedOptions.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-4", children: [
|
|
900
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
|
|
901
|
+
/* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("fields.values") }),
|
|
902
|
+
/* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.selectValuesHint") })
|
|
903
|
+
] }),
|
|
904
|
+
/* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-y-3", children: watchedOptions.map((opt, index) => {
|
|
905
|
+
if (opt.id) {
|
|
906
|
+
const productOption = product_options.find(
|
|
907
|
+
(p) => p.id === opt.id
|
|
908
|
+
);
|
|
909
|
+
const existingValues = productOption?.values || [];
|
|
910
|
+
const customValueNames = opt.values?.filter(
|
|
911
|
+
(v) => !existingValues.some((ev) => ev.value === v)
|
|
912
|
+
) || [];
|
|
913
|
+
const existingValueOptions = existingValues.sort((a, b) => {
|
|
914
|
+
const rankA = a.rank ?? Number.MAX_VALUE;
|
|
915
|
+
const rankB = b.rank ?? Number.MAX_VALUE;
|
|
916
|
+
return rankA - rankB;
|
|
917
|
+
}).map((v) => ({
|
|
918
|
+
value: v.id,
|
|
919
|
+
label: v.value
|
|
920
|
+
}));
|
|
921
|
+
const customValueOptions = customValueNames.map((v) => ({
|
|
922
|
+
value: v,
|
|
923
|
+
label: v
|
|
924
|
+
}));
|
|
925
|
+
const valueOptions = [
|
|
926
|
+
...existingValueOptions,
|
|
927
|
+
...customValueOptions
|
|
928
|
+
];
|
|
929
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-2", children: [
|
|
930
|
+
/* @__PURE__ */ jsx3(Label, { size: "small", weight: "plus", children: opt.title }),
|
|
931
|
+
/* @__PURE__ */ jsx3(
|
|
932
|
+
Combobox,
|
|
933
|
+
{
|
|
934
|
+
value: opt.value_ids ?? [],
|
|
935
|
+
onChange: (value) => handleValueChange(opt.id, value),
|
|
936
|
+
onCreateOption: async (values) => {
|
|
937
|
+
const newValueName = values[values.length - 1]?.trim();
|
|
938
|
+
if (newValueName && opt.id) {
|
|
939
|
+
const currentValueIds = opt.value_ids || [];
|
|
940
|
+
handleValueChange(opt.id, [
|
|
941
|
+
...currentValueIds,
|
|
942
|
+
newValueName
|
|
943
|
+
]);
|
|
944
|
+
}
|
|
1036
945
|
},
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
946
|
+
options: valueOptions,
|
|
947
|
+
placeholder: t(
|
|
948
|
+
"products.fields.options.variantionsPlaceholder"
|
|
949
|
+
),
|
|
950
|
+
displayMode: "chips"
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
] }, opt.id);
|
|
954
|
+
} else {
|
|
955
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-2", children: [
|
|
956
|
+
/* @__PURE__ */ jsx3(Label, { size: "small", weight: "plus", children: opt.title }),
|
|
957
|
+
/* @__PURE__ */ jsx3(
|
|
958
|
+
ChipInput,
|
|
959
|
+
{
|
|
960
|
+
value: opt.values ?? [],
|
|
961
|
+
onChange: (value) => handleNewOptionValueChange(opt.title, value),
|
|
962
|
+
placeholder: t(
|
|
963
|
+
"products.fields.options.variantionsPlaceholder"
|
|
964
|
+
)
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
] }, index);
|
|
1041
968
|
}
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
969
|
+
}) })
|
|
970
|
+
] }),
|
|
971
|
+
/* @__PURE__ */ jsx3("div", { className: "grid grid-cols-1 gap-x-4 gap-y-8", children: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
|
|
972
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
|
|
973
|
+
/* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("products.create.variants.productVariants.label") }),
|
|
974
|
+
/* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.productVariants.hint") })
|
|
1048
975
|
] }),
|
|
1049
|
-
!showInvalidOptionsMessage && showInvalidVariantsMessage && /* @__PURE__ */
|
|
1050
|
-
variants.fields.length > 0 ? /* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
976
|
+
!showInvalidOptionsMessage && showInvalidVariantsMessage && /* @__PURE__ */ jsx3(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.variants") }),
|
|
977
|
+
variants.fields.length > 0 ? /* @__PURE__ */ jsxs3("div", { className: "overflow-hidden rounded-xl border", children: [
|
|
978
|
+
/* @__PURE__ */ jsxs3(
|
|
1052
979
|
"div",
|
|
1053
980
|
{
|
|
1054
981
|
className: "bg-ui-bg-component text-ui-fg-subtle grid items-center gap-3 border-b px-6 py-2.5",
|
|
@@ -1056,7 +983,7 @@ var ProductCreateVariantsSection = ({
|
|
|
1056
983
|
gridTemplateColumns: `20px 28px repeat(${watchedOptions.length}, 1fr)`
|
|
1057
984
|
},
|
|
1058
985
|
children: [
|
|
1059
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(
|
|
1060
987
|
Checkbox,
|
|
1061
988
|
{
|
|
1062
989
|
className: "relative",
|
|
@@ -1064,25 +991,25 @@ var ProductCreateVariantsSection = ({
|
|
|
1064
991
|
onCheckedChange: onCheckboxChange
|
|
1065
992
|
}
|
|
1066
993
|
) }),
|
|
1067
|
-
/* @__PURE__ */
|
|
1068
|
-
watchedOptions.map((option, index) => /* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ jsx3("div", {}),
|
|
995
|
+
watchedOptions.map((option, index) => /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: option.title }) }, index))
|
|
1069
996
|
]
|
|
1070
997
|
}
|
|
1071
998
|
),
|
|
1072
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ jsx3(
|
|
1073
1000
|
SortableList,
|
|
1074
1001
|
{
|
|
1075
1002
|
items: variants.fields,
|
|
1076
1003
|
onChange: handleRankChange,
|
|
1077
1004
|
renderItem: (item, index) => {
|
|
1078
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ jsx3(
|
|
1079
1006
|
SortableList.Item,
|
|
1080
1007
|
{
|
|
1081
1008
|
id: item.id,
|
|
1082
|
-
className:
|
|
1009
|
+
className: clx("bg-ui-bg-base border-b", {
|
|
1083
1010
|
"border-b-0": index === variants.fields.length - 1
|
|
1084
1011
|
}),
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1012
|
+
children: /* @__PURE__ */ jsxs3(
|
|
1086
1013
|
"div",
|
|
1087
1014
|
{
|
|
1088
1015
|
className: "text-ui-fg-subtle grid w-full items-center gap-3 px-6 py-2.5",
|
|
@@ -1090,7 +1017,7 @@ var ProductCreateVariantsSection = ({
|
|
|
1090
1017
|
gridTemplateColumns: `20px 28px repeat(${watchedOptions.length}, 1fr)`
|
|
1091
1018
|
},
|
|
1092
1019
|
children: [
|
|
1093
|
-
/* @__PURE__ */
|
|
1020
|
+
/* @__PURE__ */ jsx3(
|
|
1094
1021
|
Form.Field,
|
|
1095
1022
|
{
|
|
1096
1023
|
control: form.control,
|
|
@@ -1098,7 +1025,7 @@ var ProductCreateVariantsSection = ({
|
|
|
1098
1025
|
render: ({
|
|
1099
1026
|
field: { value, onChange, ...field }
|
|
1100
1027
|
}) => {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ jsx3(Form.Item, { children: /* @__PURE__ */ jsx3(Form.Control, { children: /* @__PURE__ */ jsx3(
|
|
1102
1029
|
Checkbox,
|
|
1103
1030
|
{
|
|
1104
1031
|
className: "relative",
|
|
@@ -1110,8 +1037,8 @@ var ProductCreateVariantsSection = ({
|
|
|
1110
1037
|
}
|
|
1111
1038
|
}
|
|
1112
1039
|
),
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
Object.values(item.options).map((value, index2) => /* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ jsx3(SortableList.DragHandle, {}),
|
|
1041
|
+
Object.values(item.options).map((value, index2) => /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: value }, index2))
|
|
1115
1042
|
]
|
|
1116
1043
|
}
|
|
1117
1044
|
)
|
|
@@ -1120,40 +1047,40 @@ var ProductCreateVariantsSection = ({
|
|
|
1120
1047
|
}
|
|
1121
1048
|
}
|
|
1122
1049
|
)
|
|
1123
|
-
] }) : /* @__PURE__ */
|
|
1124
|
-
variants.fields.length > 0 && /* @__PURE__ */
|
|
1050
|
+
] }) : /* @__PURE__ */ jsx3(Alert, { children: t("products.create.variants.productVariants.alert") }),
|
|
1051
|
+
variants.fields.length > 0 && /* @__PURE__ */ jsx3(InlineTip, { label: t("general.tip"), children: t("products.create.variants.productVariants.tip") })
|
|
1125
1052
|
] }) })
|
|
1126
1053
|
] })
|
|
1127
1054
|
] });
|
|
1128
1055
|
};
|
|
1129
1056
|
|
|
1130
1057
|
// src/routes/products/product-create/components/product-create-details-form/product-create-details-form.tsx
|
|
1131
|
-
import { jsx as
|
|
1058
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1132
1059
|
var ProductCreateDetailsForm = ({ form }) => {
|
|
1133
1060
|
const { getFormFields } = useExtension();
|
|
1134
1061
|
const fields = getFormFields("product", "create", "general");
|
|
1135
|
-
return /* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs4("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
1063
|
+
/* @__PURE__ */ jsx4(Header, {}),
|
|
1064
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx4(ProductCreateGeneralSection, { form }),
|
|
1066
|
+
/* @__PURE__ */ jsx4(FormExtensionZone, { fields, form }),
|
|
1067
|
+
/* @__PURE__ */ jsx4(ProductCreateMediaSection, { form })
|
|
1141
1068
|
] }),
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ jsx4(Divider, {}),
|
|
1070
|
+
/* @__PURE__ */ jsx4(ProductCreateVariantsSection, { form })
|
|
1144
1071
|
] }) });
|
|
1145
1072
|
};
|
|
1146
1073
|
var Header = () => {
|
|
1147
1074
|
const { t } = useTranslation4();
|
|
1148
|
-
return /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ jsx4("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx4(Heading2, { children: t("products.create.header") }) });
|
|
1149
1076
|
};
|
|
1150
1077
|
|
|
1151
1078
|
// src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx
|
|
1152
|
-
import { Button
|
|
1079
|
+
import { Button, Heading as Heading3, IconButton as IconButton2, Input as Input2, Label as Label2 } from "@medusajs/ui";
|
|
1153
1080
|
import { useFieldArray as useFieldArray3, useWatch as useWatch2 } from "react-hook-form";
|
|
1154
|
-
import { XMarkMini
|
|
1081
|
+
import { XMarkMini } from "@medusajs/icons";
|
|
1155
1082
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
1156
|
-
import { jsx as
|
|
1083
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1157
1084
|
function InventoryItemRow({
|
|
1158
1085
|
form,
|
|
1159
1086
|
variantIndex,
|
|
@@ -1177,13 +1104,13 @@ function InventoryItemRow({
|
|
|
1177
1104
|
value: item.id
|
|
1178
1105
|
}))
|
|
1179
1106
|
});
|
|
1180
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ jsxs5(
|
|
1181
1108
|
"li",
|
|
1182
1109
|
{
|
|
1183
1110
|
className: "bg-ui-bg-component shadow-elevation-card-rest grid grid-cols-[1fr_28px] items-center gap-1.5 rounded-xl p-1.5",
|
|
1184
1111
|
children: [
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
|
|
1113
|
+
/* @__PURE__ */ jsx5("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx5(
|
|
1187
1114
|
Label2,
|
|
1188
1115
|
{
|
|
1189
1116
|
size: "xsmall",
|
|
@@ -1193,13 +1120,13 @@ function InventoryItemRow({
|
|
|
1193
1120
|
children: t("fields.item")
|
|
1194
1121
|
}
|
|
1195
1122
|
) }),
|
|
1196
|
-
/* @__PURE__ */
|
|
1123
|
+
/* @__PURE__ */ jsx5(
|
|
1197
1124
|
Form.Field,
|
|
1198
1125
|
{
|
|
1199
1126
|
control: form.control,
|
|
1200
1127
|
name: `variants.${variantIndex}.inventory.${inventoryIndex}.inventory_item_id`,
|
|
1201
1128
|
render: ({ field }) => {
|
|
1202
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ jsx5(Form.Item, { children: /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(
|
|
1203
1130
|
Combobox,
|
|
1204
1131
|
{
|
|
1205
1132
|
...field,
|
|
@@ -1218,7 +1145,7 @@ function InventoryItemRow({
|
|
|
1218
1145
|
}
|
|
1219
1146
|
}
|
|
1220
1147
|
),
|
|
1221
|
-
/* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ jsx5("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx5(
|
|
1222
1149
|
Label2,
|
|
1223
1150
|
{
|
|
1224
1151
|
size: "xsmall",
|
|
@@ -1228,15 +1155,15 @@ function InventoryItemRow({
|
|
|
1228
1155
|
children: t("fields.quantity")
|
|
1229
1156
|
}
|
|
1230
1157
|
) }),
|
|
1231
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ jsx5(
|
|
1232
1159
|
Form.Field,
|
|
1233
1160
|
{
|
|
1234
1161
|
control: form.control,
|
|
1235
1162
|
name: `variants.${variantIndex}.inventory.${inventoryIndex}.required_quantity`,
|
|
1236
1163
|
render: ({ field: { onChange, value, ...field } }) => {
|
|
1237
|
-
return /* @__PURE__ */
|
|
1238
|
-
/* @__PURE__ */
|
|
1239
|
-
|
|
1164
|
+
return /* @__PURE__ */ jsxs5(Form.Item, { children: [
|
|
1165
|
+
/* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(
|
|
1166
|
+
Input2,
|
|
1240
1167
|
{
|
|
1241
1168
|
type: "number",
|
|
1242
1169
|
className: "bg-ui-bg-field-component",
|
|
@@ -1256,21 +1183,21 @@ function InventoryItemRow({
|
|
|
1256
1183
|
)
|
|
1257
1184
|
}
|
|
1258
1185
|
) }),
|
|
1259
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ jsx5(Form.ErrorMessage, {})
|
|
1260
1187
|
] });
|
|
1261
1188
|
}
|
|
1262
1189
|
}
|
|
1263
1190
|
)
|
|
1264
1191
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
|
|
1192
|
+
/* @__PURE__ */ jsx5(
|
|
1193
|
+
IconButton2,
|
|
1267
1194
|
{
|
|
1268
1195
|
type: "button",
|
|
1269
1196
|
size: "small",
|
|
1270
1197
|
variant: "transparent",
|
|
1271
1198
|
className: "text-ui-fg-muted",
|
|
1272
1199
|
onClick: onRemove,
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1200
|
+
children: /* @__PURE__ */ jsx5(XMarkMini, {})
|
|
1274
1201
|
}
|
|
1275
1202
|
)
|
|
1276
1203
|
]
|
|
@@ -1293,14 +1220,14 @@ function VariantSection({ form, variant, index }) {
|
|
|
1293
1220
|
(i, index2) => index2 != inventoryIndex && i.inventory_item_id === option.value
|
|
1294
1221
|
);
|
|
1295
1222
|
};
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1223
|
+
return /* @__PURE__ */ jsxs5("div", { className: "grid gap-y-4", children: [
|
|
1224
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
1225
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
|
|
1226
|
+
/* @__PURE__ */ jsx5(Form.Label, { children: variant.title }),
|
|
1227
|
+
/* @__PURE__ */ jsx5(Form.Hint, { children: t("products.create.inventory.label") })
|
|
1301
1228
|
] }),
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
|
|
1229
|
+
/* @__PURE__ */ jsx5(
|
|
1230
|
+
Button,
|
|
1304
1231
|
{
|
|
1305
1232
|
size: "small",
|
|
1306
1233
|
variant: "secondary",
|
|
@@ -1315,7 +1242,7 @@ function VariantSection({ form, variant, index }) {
|
|
|
1315
1242
|
}
|
|
1316
1243
|
)
|
|
1317
1244
|
] }),
|
|
1318
|
-
inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */
|
|
1245
|
+
inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */ jsx5(
|
|
1319
1246
|
InventoryItemRow,
|
|
1320
1247
|
{
|
|
1321
1248
|
form,
|
|
@@ -1337,9 +1264,9 @@ var ProductCreateInventoryKitSection = ({
|
|
|
1337
1264
|
control: form.control,
|
|
1338
1265
|
name: "variants"
|
|
1339
1266
|
});
|
|
1340
|
-
return /* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */
|
|
1267
|
+
return /* @__PURE__ */ jsxs5("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
|
|
1268
|
+
/* @__PURE__ */ jsx5(Heading3, { children: t("products.create.inventory.heading") }),
|
|
1269
|
+
variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */ jsx5(
|
|
1343
1270
|
VariantSection,
|
|
1344
1271
|
{
|
|
1345
1272
|
form,
|
|
@@ -1352,18 +1279,18 @@ var ProductCreateInventoryKitSection = ({
|
|
|
1352
1279
|
};
|
|
1353
1280
|
|
|
1354
1281
|
// src/routes/products/product-create/components/product-create-inventory-kit-form/product-create-inventory-kit-form.tsx
|
|
1355
|
-
import { jsx as
|
|
1282
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1356
1283
|
var ProductCreateInventoryKitForm = ({
|
|
1357
1284
|
form
|
|
1358
1285
|
}) => {
|
|
1359
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ jsx6("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx6("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx6(ProductCreateInventoryKitSection, { form }) }) });
|
|
1360
1287
|
};
|
|
1361
1288
|
|
|
1362
1289
|
// src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx
|
|
1363
|
-
import { Button as
|
|
1290
|
+
import { Button as Button2, Heading as Heading4 } from "@medusajs/ui";
|
|
1364
1291
|
import { useFieldArray as useFieldArray4 } from "react-hook-form";
|
|
1365
1292
|
import { Trans, useTranslation as useTranslation6 } from "react-i18next";
|
|
1366
|
-
import { jsx as
|
|
1293
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1367
1294
|
var ProductCreateOrganizationSection = ({
|
|
1368
1295
|
form
|
|
1369
1296
|
}) => {
|
|
@@ -1408,9 +1335,9 @@ var ProductCreateOrganizationSection = ({
|
|
|
1408
1335
|
const handleClearAllSalesChannels = () => {
|
|
1409
1336
|
replace([]);
|
|
1410
1337
|
};
|
|
1411
|
-
return /* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ jsxs6("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
|
|
1339
|
+
/* @__PURE__ */ jsx7(Heading4, { children: t("products.organization.header") }),
|
|
1340
|
+
/* @__PURE__ */ jsx7(
|
|
1414
1341
|
SwitchBox,
|
|
1415
1342
|
{
|
|
1416
1343
|
control: form.control,
|
|
@@ -1420,16 +1347,16 @@ var ProductCreateOrganizationSection = ({
|
|
|
1420
1347
|
optional: true
|
|
1421
1348
|
}
|
|
1422
1349
|
),
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1351
|
+
/* @__PURE__ */ jsx7(
|
|
1425
1352
|
Form.Field,
|
|
1426
1353
|
{
|
|
1427
1354
|
control: form.control,
|
|
1428
1355
|
name: "type_id",
|
|
1429
1356
|
render: ({ field }) => {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
/* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { children: [
|
|
1358
|
+
/* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.type.label") }),
|
|
1359
|
+
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1433
1360
|
Combobox,
|
|
1434
1361
|
{
|
|
1435
1362
|
...field,
|
|
@@ -1439,20 +1366,20 @@ var ProductCreateOrganizationSection = ({
|
|
|
1439
1366
|
fetchNextPage: types.fetchNextPage
|
|
1440
1367
|
}
|
|
1441
1368
|
) }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1369
|
+
/* @__PURE__ */ jsx7(Form.ErrorMessage, {})
|
|
1443
1370
|
] });
|
|
1444
1371
|
}
|
|
1445
1372
|
}
|
|
1446
1373
|
),
|
|
1447
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ jsx7(
|
|
1448
1375
|
Form.Field,
|
|
1449
1376
|
{
|
|
1450
1377
|
control: form.control,
|
|
1451
1378
|
name: "collection_id",
|
|
1452
1379
|
render: ({ field }) => {
|
|
1453
|
-
return /* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { children: [
|
|
1381
|
+
/* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.collection.label") }),
|
|
1382
|
+
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1456
1383
|
Combobox,
|
|
1457
1384
|
{
|
|
1458
1385
|
...field,
|
|
@@ -1462,36 +1389,36 @@ var ProductCreateOrganizationSection = ({
|
|
|
1462
1389
|
fetchNextPage: collections.fetchNextPage
|
|
1463
1390
|
}
|
|
1464
1391
|
) }),
|
|
1465
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ jsx7(Form.ErrorMessage, {})
|
|
1466
1393
|
] });
|
|
1467
1394
|
}
|
|
1468
1395
|
}
|
|
1469
1396
|
)
|
|
1470
1397
|
] }),
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1399
|
+
/* @__PURE__ */ jsx7(
|
|
1473
1400
|
Form.Field,
|
|
1474
1401
|
{
|
|
1475
1402
|
control: form.control,
|
|
1476
1403
|
name: "categories",
|
|
1477
1404
|
render: ({ field }) => {
|
|
1478
|
-
return /* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1405
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { children: [
|
|
1406
|
+
/* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.categories.label") }),
|
|
1407
|
+
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(CategoryCombobox, { ...field }) }),
|
|
1408
|
+
/* @__PURE__ */ jsx7(Form.ErrorMessage, {})
|
|
1482
1409
|
] });
|
|
1483
1410
|
}
|
|
1484
1411
|
}
|
|
1485
1412
|
),
|
|
1486
|
-
/* @__PURE__ */
|
|
1413
|
+
/* @__PURE__ */ jsx7(
|
|
1487
1414
|
Form.Field,
|
|
1488
1415
|
{
|
|
1489
1416
|
control: form.control,
|
|
1490
1417
|
name: "tags",
|
|
1491
1418
|
render: ({ field }) => {
|
|
1492
|
-
return /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { children: [
|
|
1420
|
+
/* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.tags.label") }),
|
|
1421
|
+
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1495
1422
|
Combobox,
|
|
1496
1423
|
{
|
|
1497
1424
|
...field,
|
|
@@ -1501,25 +1428,25 @@ var ProductCreateOrganizationSection = ({
|
|
|
1501
1428
|
fetchNextPage: tags.fetchNextPage
|
|
1502
1429
|
}
|
|
1503
1430
|
) }),
|
|
1504
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsx7(Form.ErrorMessage, {})
|
|
1505
1432
|
] });
|
|
1506
1433
|
}
|
|
1507
1434
|
}
|
|
1508
1435
|
)
|
|
1509
1436
|
] }),
|
|
1510
|
-
/* @__PURE__ */
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
1438
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1439
|
+
/* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.shipping_profile.label") }),
|
|
1440
|
+
/* @__PURE__ */ jsx7(Form.Hint, { children: /* @__PURE__ */ jsx7(Trans, { i18nKey: "products.fields.shipping_profile.hint" }) })
|
|
1514
1441
|
] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ jsx7(
|
|
1516
1443
|
Form.Field,
|
|
1517
1444
|
{
|
|
1518
1445
|
control: form.control,
|
|
1519
1446
|
name: "shipping_profile_id",
|
|
1520
1447
|
render: ({ field }) => {
|
|
1521
|
-
return /* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { children: [
|
|
1449
|
+
/* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
|
|
1523
1450
|
Combobox,
|
|
1524
1451
|
{
|
|
1525
1452
|
...field,
|
|
@@ -1529,33 +1456,33 @@ var ProductCreateOrganizationSection = ({
|
|
|
1529
1456
|
fetchNextPage: shippingProfiles.fetchNextPage
|
|
1530
1457
|
}
|
|
1531
1458
|
) }),
|
|
1532
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ jsx7(Form.ErrorMessage, {})
|
|
1533
1460
|
] });
|
|
1534
1461
|
}
|
|
1535
1462
|
}
|
|
1536
1463
|
)
|
|
1537
1464
|
] }),
|
|
1538
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ jsx7("div", { className: "grid grid-cols-1 gap-y-4", children: /* @__PURE__ */ jsx7(
|
|
1539
1466
|
Form.Field,
|
|
1540
1467
|
{
|
|
1541
1468
|
control: form.control,
|
|
1542
1469
|
name: "sales_channels",
|
|
1543
1470
|
render: () => {
|
|
1544
|
-
return /* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1471
|
+
return /* @__PURE__ */ jsxs6(Form.Item, { children: [
|
|
1472
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-start justify-between gap-x-4", children: [
|
|
1473
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1474
|
+
/* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.sales_channels.label") }),
|
|
1475
|
+
/* @__PURE__ */ jsx7(Form.Hint, { children: /* @__PURE__ */ jsx7(Trans, { i18nKey: "products.fields.sales_channels.hint" }) })
|
|
1549
1476
|
] }),
|
|
1550
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ jsx7(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx7(Button2, { size: "small", variant: "secondary", type: "button", children: t("actions.add") }) })
|
|
1551
1478
|
] }),
|
|
1552
|
-
/* @__PURE__ */
|
|
1479
|
+
/* @__PURE__ */ jsx7(Form.Control, { className: "mt-0", children: fields.length > 0 && /* @__PURE__ */ jsx7(
|
|
1553
1480
|
ChipGroup,
|
|
1554
1481
|
{
|
|
1555
1482
|
onClearAll: handleClearAllSalesChannels,
|
|
1556
1483
|
onRemove: remove,
|
|
1557
1484
|
className: "py-4",
|
|
1558
|
-
children: fields.map((field, index) => /* @__PURE__ */
|
|
1485
|
+
children: fields.map((field, index) => /* @__PURE__ */ jsx7(ChipGroup.Chip, { index, children: field.name }, field.key))
|
|
1559
1486
|
}
|
|
1560
1487
|
) })
|
|
1561
1488
|
] });
|
|
@@ -1567,10 +1494,10 @@ var ProductCreateOrganizationSection = ({
|
|
|
1567
1494
|
|
|
1568
1495
|
// src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
|
|
1569
1496
|
import {
|
|
1570
|
-
Button as
|
|
1497
|
+
Button as Button3,
|
|
1571
1498
|
createDataTableColumnHelper
|
|
1572
1499
|
} from "@medusajs/ui";
|
|
1573
|
-
import { useEffect, useMemo as useMemo2, useState as
|
|
1500
|
+
import { useEffect, useMemo as useMemo2, useState as useState2 } from "react";
|
|
1574
1501
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
1575
1502
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
1576
1503
|
|
|
@@ -1578,7 +1505,7 @@ import { keepPreviousData } from "@tanstack/react-query";
|
|
|
1578
1505
|
var SC_STACKED_MODAL_ID = "sc";
|
|
1579
1506
|
|
|
1580
1507
|
// src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
|
|
1581
|
-
import { jsx as
|
|
1508
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1582
1509
|
var PAGE_SIZE = 20;
|
|
1583
1510
|
var ProductCreateSalesChannelStackedModal = ({
|
|
1584
1511
|
form
|
|
@@ -1586,10 +1513,10 @@ var ProductCreateSalesChannelStackedModal = ({
|
|
|
1586
1513
|
const { t } = useTranslation7();
|
|
1587
1514
|
const { getValues, setValue } = form;
|
|
1588
1515
|
const { setIsOpen, getIsOpen } = useStackedModal();
|
|
1589
|
-
const [rowSelection, setRowSelection] =
|
|
1516
|
+
const [rowSelection, setRowSelection] = useState2(
|
|
1590
1517
|
{}
|
|
1591
1518
|
);
|
|
1592
|
-
const [state, setState] =
|
|
1519
|
+
const [state, setState] = useState2([]);
|
|
1593
1520
|
const searchParams = useSalesChannelTableQuery({
|
|
1594
1521
|
pageSize: PAGE_SIZE,
|
|
1595
1522
|
prefix: SC_STACKED_MODAL_ID
|
|
@@ -1652,9 +1579,9 @@ var ProductCreateSalesChannelStackedModal = ({
|
|
|
1652
1579
|
if (isError) {
|
|
1653
1580
|
throw error;
|
|
1654
1581
|
}
|
|
1655
|
-
return /* @__PURE__ */
|
|
1656
|
-
/* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */
|
|
1582
|
+
return /* @__PURE__ */ jsxs7(StackedFocusModal.Content, { className: "flex flex-col overflow-hidden", children: [
|
|
1583
|
+
/* @__PURE__ */ jsx8(StackedFocusModal.Header, {}),
|
|
1584
|
+
/* @__PURE__ */ jsx8(StackedFocusModal.Body, { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx8(
|
|
1658
1585
|
DataTable,
|
|
1659
1586
|
{
|
|
1660
1587
|
data: sales_channels,
|
|
@@ -1673,9 +1600,9 @@ var ProductCreateSalesChannelStackedModal = ({
|
|
|
1673
1600
|
prefix: SC_STACKED_MODAL_ID
|
|
1674
1601
|
}
|
|
1675
1602
|
) }),
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1603
|
+
/* @__PURE__ */ jsx8(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
1604
|
+
/* @__PURE__ */ jsx8(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx8(Button3, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
|
|
1605
|
+
/* @__PURE__ */ jsx8(Button3, { size: "small", onClick: handleAdd, type: "button", children: t("actions.save") })
|
|
1679
1606
|
] }) })
|
|
1680
1607
|
] });
|
|
1681
1608
|
};
|
|
@@ -1686,16 +1613,16 @@ var useColumns = () => {
|
|
|
1686
1613
|
};
|
|
1687
1614
|
|
|
1688
1615
|
// src/routes/products/product-create/components/product-create-organize-form/product-create-organize-form.tsx
|
|
1689
|
-
import { jsx as
|
|
1616
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1690
1617
|
var ProductCreateOrganizeForm = ({ form }) => {
|
|
1691
1618
|
const { getFormFields } = useExtension();
|
|
1692
1619
|
const fields = getFormFields("product", "create", "organize");
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
/* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsxs8(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
|
|
1621
|
+
/* @__PURE__ */ jsx9("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs8("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
1622
|
+
/* @__PURE__ */ jsx9(ProductCreateOrganizationSection, { form }),
|
|
1623
|
+
/* @__PURE__ */ jsx9(FormExtensionZone, { fields, form })
|
|
1697
1624
|
] }) }),
|
|
1698
|
-
/* @__PURE__ */
|
|
1625
|
+
/* @__PURE__ */ jsx9(ProductCreateSalesChannelStackedModal, { form })
|
|
1699
1626
|
] });
|
|
1700
1627
|
};
|
|
1701
1628
|
|
|
@@ -1703,7 +1630,7 @@ var ProductCreateOrganizeForm = ({ form }) => {
|
|
|
1703
1630
|
import { useMemo as useMemo3 } from "react";
|
|
1704
1631
|
import { useWatch as useWatch3 } from "react-hook-form";
|
|
1705
1632
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
1706
|
-
import { jsx as
|
|
1633
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1707
1634
|
var ProductCreateVariantsForm = ({
|
|
1708
1635
|
form,
|
|
1709
1636
|
regions,
|
|
@@ -1740,7 +1667,7 @@ var ProductCreateVariantsForm = ({
|
|
|
1740
1667
|
});
|
|
1741
1668
|
return ret;
|
|
1742
1669
|
}, [variants]);
|
|
1743
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ jsx10("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx10(
|
|
1744
1671
|
DataGrid,
|
|
1745
1672
|
{
|
|
1746
1673
|
columns,
|
|
@@ -1762,9 +1689,9 @@ var useColumns2 = ({
|
|
|
1762
1689
|
() => [
|
|
1763
1690
|
columnHelper2.column({
|
|
1764
1691
|
id: "options",
|
|
1765
|
-
header: () => /* @__PURE__ */
|
|
1692
|
+
header: () => /* @__PURE__ */ jsx10("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx10("span", { className: "truncate", children: options.map((o) => o.title).join(" / ") }) }),
|
|
1766
1693
|
cell: (context) => {
|
|
1767
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ jsx10(DataGrid.ReadonlyCell, { context, children: options.map((o) => context.row.original.options[o.title]).join(" / ") });
|
|
1768
1695
|
},
|
|
1769
1696
|
disableHiding: true
|
|
1770
1697
|
}),
|
|
@@ -1775,7 +1702,7 @@ var useColumns2 = ({
|
|
|
1775
1702
|
field: (context) => `variants.${context.row.original.originalIndex}.title`,
|
|
1776
1703
|
type: "text",
|
|
1777
1704
|
cell: (context) => {
|
|
1778
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ jsx10(DataGrid.TextCell, { context });
|
|
1779
1706
|
}
|
|
1780
1707
|
}),
|
|
1781
1708
|
columnHelper2.column({
|
|
@@ -1785,7 +1712,7 @@ var useColumns2 = ({
|
|
|
1785
1712
|
field: (context) => `variants.${context.row.original.originalIndex}.sku`,
|
|
1786
1713
|
type: "text",
|
|
1787
1714
|
cell: (context) => {
|
|
1788
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ jsx10(DataGrid.TextCell, { context });
|
|
1789
1716
|
}
|
|
1790
1717
|
}),
|
|
1791
1718
|
columnHelper2.column({
|
|
@@ -1795,7 +1722,7 @@ var useColumns2 = ({
|
|
|
1795
1722
|
field: (context) => `variants.${context.row.original.originalIndex}.manage_inventory`,
|
|
1796
1723
|
type: "boolean",
|
|
1797
1724
|
cell: (context) => {
|
|
1798
|
-
return /* @__PURE__ */
|
|
1725
|
+
return /* @__PURE__ */ jsx10(DataGrid.BooleanCell, { context });
|
|
1799
1726
|
}
|
|
1800
1727
|
}),
|
|
1801
1728
|
columnHelper2.column({
|
|
@@ -1805,7 +1732,7 @@ var useColumns2 = ({
|
|
|
1805
1732
|
field: (context) => `variants.${context.row.original.originalIndex}.allow_backorder`,
|
|
1806
1733
|
type: "boolean",
|
|
1807
1734
|
cell: (context) => {
|
|
1808
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ jsx10(DataGrid.BooleanCell, { context });
|
|
1809
1736
|
}
|
|
1810
1737
|
}),
|
|
1811
1738
|
columnHelper2.column({
|
|
@@ -1815,7 +1742,7 @@ var useColumns2 = ({
|
|
|
1815
1742
|
field: (context) => `variants.${context.row.original.originalIndex}.inventory_kit`,
|
|
1816
1743
|
type: "boolean",
|
|
1817
1744
|
cell: (context) => {
|
|
1818
|
-
return /* @__PURE__ */
|
|
1745
|
+
return /* @__PURE__ */ jsx10(
|
|
1819
1746
|
DataGrid.BooleanCell,
|
|
1820
1747
|
{
|
|
1821
1748
|
context,
|
|
@@ -1842,7 +1769,7 @@ var useColumns2 = ({
|
|
|
1842
1769
|
};
|
|
1843
1770
|
|
|
1844
1771
|
// src/routes/products/product-create/components/product-create-form/product-create-form.tsx
|
|
1845
|
-
import { jsx as
|
|
1772
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1846
1773
|
var SAVE_DRAFT_BUTTON = "save-draft-button";
|
|
1847
1774
|
var ProductCreateForm = ({
|
|
1848
1775
|
defaultChannel,
|
|
@@ -1850,8 +1777,8 @@ var ProductCreateForm = ({
|
|
|
1850
1777
|
store,
|
|
1851
1778
|
pricePreferences
|
|
1852
1779
|
}) => {
|
|
1853
|
-
const [tab, setTab] =
|
|
1854
|
-
const [tabState, setTabState] =
|
|
1780
|
+
const [tab, setTab] = useState3("details" /* DETAILS */);
|
|
1781
|
+
const [tabState, setTabState] = useState3({
|
|
1855
1782
|
["details" /* DETAILS */]: "in-progress",
|
|
1856
1783
|
["organize" /* ORGANIZE */]: "not-started",
|
|
1857
1784
|
["variants" /* VARIANTS */]: "not-started",
|
|
@@ -1875,13 +1802,10 @@ var ProductCreateForm = ({
|
|
|
1875
1802
|
if (!regions?.length) {
|
|
1876
1803
|
return {};
|
|
1877
1804
|
}
|
|
1878
|
-
return regions.reduce(
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
},
|
|
1883
|
-
{}
|
|
1884
|
-
);
|
|
1805
|
+
return regions.reduce((acc, reg) => {
|
|
1806
|
+
acc[reg.id] = reg.currency_code;
|
|
1807
|
+
return acc;
|
|
1808
|
+
}, {});
|
|
1885
1809
|
}, [regions]);
|
|
1886
1810
|
const watchedVariants = useWatch4({
|
|
1887
1811
|
control: form.control,
|
|
@@ -1983,7 +1907,7 @@ var ProductCreateForm = ({
|
|
|
1983
1907
|
}
|
|
1984
1908
|
setTabState({ ...currentState });
|
|
1985
1909
|
}, [tab]);
|
|
1986
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ jsx11(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs9(
|
|
1987
1911
|
KeyboundForm,
|
|
1988
1912
|
{
|
|
1989
1913
|
onKeyDown: (e) => {
|
|
@@ -2006,7 +1930,7 @@ var ProductCreateForm = ({
|
|
|
2006
1930
|
onSubmit: handleSubmit,
|
|
2007
1931
|
className: "flex h-full flex-col",
|
|
2008
1932
|
children: [
|
|
2009
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsxs9(
|
|
2010
1934
|
ProgressTabs,
|
|
2011
1935
|
{
|
|
2012
1936
|
dir: direction,
|
|
@@ -2020,8 +1944,8 @@ var ProductCreateForm = ({
|
|
|
2020
1944
|
},
|
|
2021
1945
|
className: "flex h-full flex-col overflow-hidden",
|
|
2022
1946
|
children: [
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ jsx11(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx11("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsxs9(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: [
|
|
1948
|
+
/* @__PURE__ */ jsx11(
|
|
2025
1949
|
ProgressTabs.Trigger,
|
|
2026
1950
|
{
|
|
2027
1951
|
status: tabState["details" /* DETAILS */],
|
|
@@ -2030,7 +1954,7 @@ var ProductCreateForm = ({
|
|
|
2030
1954
|
children: t("products.create.tabs.details")
|
|
2031
1955
|
}
|
|
2032
1956
|
),
|
|
2033
|
-
/* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ jsx11(
|
|
2034
1958
|
ProgressTabs.Trigger,
|
|
2035
1959
|
{
|
|
2036
1960
|
status: tabState["organize" /* ORGANIZE */],
|
|
@@ -2039,7 +1963,7 @@ var ProductCreateForm = ({
|
|
|
2039
1963
|
children: t("products.create.tabs.organize")
|
|
2040
1964
|
}
|
|
2041
1965
|
),
|
|
2042
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ jsx11(
|
|
2043
1967
|
ProgressTabs.Trigger,
|
|
2044
1968
|
{
|
|
2045
1969
|
status: tabState["variants" /* VARIANTS */],
|
|
@@ -2048,7 +1972,7 @@ var ProductCreateForm = ({
|
|
|
2048
1972
|
children: t("products.create.tabs.variants")
|
|
2049
1973
|
}
|
|
2050
1974
|
),
|
|
2051
|
-
showInventoryTab && /* @__PURE__ */
|
|
1975
|
+
showInventoryTab && /* @__PURE__ */ jsx11(
|
|
2052
1976
|
ProgressTabs.Trigger,
|
|
2053
1977
|
{
|
|
2054
1978
|
status: tabState["inventory" /* INVENTORY */],
|
|
@@ -2058,29 +1982,29 @@ var ProductCreateForm = ({
|
|
|
2058
1982
|
}
|
|
2059
1983
|
)
|
|
2060
1984
|
] }) }) }),
|
|
2061
|
-
/* @__PURE__ */
|
|
2062
|
-
/* @__PURE__ */
|
|
1985
|
+
/* @__PURE__ */ jsxs9(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: [
|
|
1986
|
+
/* @__PURE__ */ jsx11(
|
|
2063
1987
|
ProgressTabs.Content,
|
|
2064
1988
|
{
|
|
2065
1989
|
className: "size-full overflow-y-auto",
|
|
2066
1990
|
value: "details" /* DETAILS */,
|
|
2067
|
-
children: /* @__PURE__ */
|
|
1991
|
+
children: /* @__PURE__ */ jsx11(ProductCreateDetailsForm, { form })
|
|
2068
1992
|
}
|
|
2069
1993
|
),
|
|
2070
|
-
/* @__PURE__ */
|
|
1994
|
+
/* @__PURE__ */ jsx11(
|
|
2071
1995
|
ProgressTabs.Content,
|
|
2072
1996
|
{
|
|
2073
1997
|
className: "size-full overflow-y-auto",
|
|
2074
1998
|
value: "organize" /* ORGANIZE */,
|
|
2075
|
-
children: /* @__PURE__ */
|
|
1999
|
+
children: /* @__PURE__ */ jsx11(ProductCreateOrganizeForm, { form })
|
|
2076
2000
|
}
|
|
2077
2001
|
),
|
|
2078
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ jsx11(
|
|
2079
2003
|
ProgressTabs.Content,
|
|
2080
2004
|
{
|
|
2081
2005
|
className: "size-full overflow-y-auto",
|
|
2082
2006
|
value: "variants" /* VARIANTS */,
|
|
2083
|
-
children: /* @__PURE__ */
|
|
2007
|
+
children: /* @__PURE__ */ jsx11(
|
|
2084
2008
|
ProductCreateVariantsForm,
|
|
2085
2009
|
{
|
|
2086
2010
|
form,
|
|
@@ -2091,22 +2015,22 @@ var ProductCreateForm = ({
|
|
|
2091
2015
|
)
|
|
2092
2016
|
}
|
|
2093
2017
|
),
|
|
2094
|
-
showInventoryTab && /* @__PURE__ */
|
|
2018
|
+
showInventoryTab && /* @__PURE__ */ jsx11(
|
|
2095
2019
|
ProgressTabs.Content,
|
|
2096
2020
|
{
|
|
2097
2021
|
className: "size-full overflow-y-auto",
|
|
2098
2022
|
value: "inventory" /* INVENTORY */,
|
|
2099
|
-
children: /* @__PURE__ */
|
|
2023
|
+
children: /* @__PURE__ */ jsx11(ProductCreateInventoryKitForm, { form })
|
|
2100
2024
|
}
|
|
2101
2025
|
)
|
|
2102
2026
|
] })
|
|
2103
2027
|
]
|
|
2104
2028
|
}
|
|
2105
2029
|
),
|
|
2106
|
-
/* @__PURE__ */
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
|
|
2030
|
+
/* @__PURE__ */ jsx11(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
2031
|
+
/* @__PURE__ */ jsx11(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx11(Button4, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
|
|
2032
|
+
/* @__PURE__ */ jsx11(
|
|
2033
|
+
Button4,
|
|
2110
2034
|
{
|
|
2111
2035
|
"data-name": SAVE_DRAFT_BUTTON,
|
|
2112
2036
|
size: "small",
|
|
@@ -2116,7 +2040,7 @@ var ProductCreateForm = ({
|
|
|
2116
2040
|
children: t("actions.saveAsDraft")
|
|
2117
2041
|
}
|
|
2118
2042
|
),
|
|
2119
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ jsx11(
|
|
2120
2044
|
PrimaryButton,
|
|
2121
2045
|
{
|
|
2122
2046
|
tab,
|
|
@@ -2138,8 +2062,8 @@ var PrimaryButton = ({
|
|
|
2138
2062
|
}) => {
|
|
2139
2063
|
const { t } = useTranslation9();
|
|
2140
2064
|
if (tab === "variants" /* VARIANTS */ && !showInventoryTab || tab === "inventory" /* INVENTORY */ && showInventoryTab) {
|
|
2141
|
-
return /* @__PURE__ */
|
|
2142
|
-
|
|
2065
|
+
return /* @__PURE__ */ jsx11(
|
|
2066
|
+
Button4,
|
|
2143
2067
|
{
|
|
2144
2068
|
"data-name": "publish-button",
|
|
2145
2069
|
type: "submit",
|
|
@@ -2151,8 +2075,8 @@ var PrimaryButton = ({
|
|
|
2151
2075
|
"submit-button"
|
|
2152
2076
|
);
|
|
2153
2077
|
}
|
|
2154
|
-
return /* @__PURE__ */
|
|
2155
|
-
|
|
2078
|
+
return /* @__PURE__ */ jsx11(
|
|
2079
|
+
Button4,
|
|
2156
2080
|
{
|
|
2157
2081
|
type: "button",
|
|
2158
2082
|
variant: "primary",
|
|
@@ -2165,7 +2089,7 @@ var PrimaryButton = ({
|
|
|
2165
2089
|
};
|
|
2166
2090
|
|
|
2167
2091
|
// src/routes/products/product-create/product-create.tsx
|
|
2168
|
-
import { jsx as
|
|
2092
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2169
2093
|
var ProductCreate = () => {
|
|
2170
2094
|
const { t } = useTranslation10();
|
|
2171
2095
|
const {
|
|
@@ -2211,10 +2135,10 @@ var ProductCreate = () => {
|
|
|
2211
2135
|
if (isPricePreferencesError) {
|
|
2212
2136
|
throw pricePreferencesError;
|
|
2213
2137
|
}
|
|
2214
|
-
return /* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
ready && /* @__PURE__ */
|
|
2138
|
+
return /* @__PURE__ */ jsxs10(RouteFocusModal, { children: [
|
|
2139
|
+
/* @__PURE__ */ jsx12(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: t("products.create.title") }) }),
|
|
2140
|
+
/* @__PURE__ */ jsx12(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: t("products.create.description") }) }),
|
|
2141
|
+
ready && /* @__PURE__ */ jsx12(
|
|
2218
2142
|
ProductCreateForm,
|
|
2219
2143
|
{
|
|
2220
2144
|
defaultChannel: sales_channel,
|