@medusajs/dashboard 3.0.0-snapshot-20251216135612 → 3.0.0-snapshot-20260102125810
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 +39 -3
- package/dist/app.js +18590 -16625
- 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-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-7AXHHXCX.mjs +4 -0
- package/dist/{chunk-YKYVCQRS.mjs → chunk-BJ44US4R.mjs} +382 -242
- 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-T6DDBLGY.mjs +13 -0
- 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 +85 -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-EFIRUBRO.mjs → product-attributes-JTPGHUXZ.mjs} +13 -13
- package/dist/{product-create-K6EWZHIT.mjs → product-create-VFLLQWVX.mjs} +485 -561
- package/dist/{product-create-variant-ERKHTEJZ.mjs → product-create-variant-PLZ5Q2R6.mjs} +14 -14
- package/dist/{product-detail-DKPZDEIY.mjs → product-detail-ISHFZV7X.mjs} +45 -66
- package/dist/{product-edit-55YXTIGO.mjs → product-edit-6EDDNIM6.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-JUGLFR2K.mjs +336 -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-4SZDF5H5.mjs +325 -0
- package/dist/{product-organization-N3VBRXF4.mjs → product-organization-OEUSIWNQ.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-HUNKY7CO.mjs → translations-edit-6P3KC4MO.mjs} +285 -320
- 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 +304 -12
- package/src/i18n/translations/en.json +85 -5
- package/src/i18n/translations/es.json +21 -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 +192 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +77 -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 +296 -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 +253 -41
- package/src/routes/translations/translation-list/translation-list.tsx +8 -2
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +337 -380
- 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-S5Z6PG2R.mjs +0 -295
- 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
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TextCell
|
|
3
|
+
} from "./chunk-MSDRGCRR.mjs";
|
|
4
|
+
import "./chunk-P3UUX2T6.mjs";
|
|
5
|
+
import {
|
|
6
|
+
useProductOptionTableFilters
|
|
7
|
+
} from "./chunk-IWNNQ6HA.mjs";
|
|
8
|
+
import "./chunk-CBSCX7RE.mjs";
|
|
9
|
+
import "./chunk-LT4MVCA7.mjs";
|
|
10
|
+
import "./chunk-LEAMWI5H.mjs";
|
|
11
|
+
import "./chunk-W7625H47.mjs";
|
|
12
|
+
import "./chunk-DLZWPHHO.mjs";
|
|
13
|
+
import "./chunk-6OU4CHZI.mjs";
|
|
14
|
+
import "./chunk-LSEYENCI.mjs";
|
|
15
|
+
import "./chunk-QHRAWZGA.mjs";
|
|
16
|
+
import {
|
|
17
|
+
SingleColumnPage
|
|
18
|
+
} from "./chunk-GIZFNLKK.mjs";
|
|
19
|
+
import {
|
|
20
|
+
DataTable
|
|
21
|
+
} from "./chunk-KCWP7RF5.mjs";
|
|
22
|
+
import "./chunk-R4ZOO4ON.mjs";
|
|
23
|
+
import {
|
|
24
|
+
useQueryParams
|
|
25
|
+
} from "./chunk-C76H5USB.mjs";
|
|
26
|
+
import "./chunk-DFFLVEZ5.mjs";
|
|
27
|
+
import "./chunk-G4BWCU5P.mjs";
|
|
28
|
+
import {
|
|
29
|
+
useExtension
|
|
30
|
+
} from "./chunk-C5P5PL3E.mjs";
|
|
31
|
+
import "./chunk-OZPB6JBL.mjs";
|
|
32
|
+
import "./chunk-OC7BQLYI.mjs";
|
|
33
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
34
|
+
import "./chunk-535OVBXR.mjs";
|
|
35
|
+
import "./chunk-74WPAWMW.mjs";
|
|
36
|
+
import "./chunk-I4OBEAOJ.mjs";
|
|
37
|
+
import "./chunk-HI6URQ7H.mjs";
|
|
38
|
+
import "./chunk-6CLQKVAU.mjs";
|
|
39
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
40
|
+
import "./chunk-KI7TOXBR.mjs";
|
|
41
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
42
|
+
import "./chunk-WAXMT4IY.mjs";
|
|
43
|
+
import "./chunk-DYDGGABK.mjs";
|
|
44
|
+
import "./chunk-CN7JXSGW.mjs";
|
|
45
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
46
|
+
import "./chunk-5BQQRHQS.mjs";
|
|
47
|
+
import "./chunk-G35UUG2P.mjs";
|
|
48
|
+
import "./chunk-5AFMB7XQ.mjs";
|
|
49
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
50
|
+
import "./chunk-A63RZVX6.mjs";
|
|
51
|
+
import "./chunk-HBXV7ENS.mjs";
|
|
52
|
+
import "./chunk-CDORR33H.mjs";
|
|
53
|
+
import "./chunk-333HK6Y6.mjs";
|
|
54
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
55
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
56
|
+
import "./chunk-3BF5SC66.mjs";
|
|
57
|
+
import "./chunk-DWH2OQFK.mjs";
|
|
58
|
+
import "./chunk-VCSSQVPD.mjs";
|
|
59
|
+
import "./chunk-HP2JH45P.mjs";
|
|
60
|
+
import "./chunk-SQDIZZDW.mjs";
|
|
61
|
+
import {
|
|
62
|
+
useDeleteProductOptionLazy,
|
|
63
|
+
useProductOptions
|
|
64
|
+
} from "./chunk-UCYUWNJL.mjs";
|
|
65
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
66
|
+
import "./chunk-FXYH54JP.mjs";
|
|
67
|
+
import "./chunk-774WSTCC.mjs";
|
|
68
|
+
import "./chunk-NFEK63OE.mjs";
|
|
69
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
70
|
+
|
|
71
|
+
// src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx
|
|
72
|
+
import {
|
|
73
|
+
Container,
|
|
74
|
+
createDataTableColumnHelper,
|
|
75
|
+
toast,
|
|
76
|
+
usePrompt
|
|
77
|
+
} from "@medusajs/ui";
|
|
78
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
79
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
80
|
+
import { useCallback, useMemo as useMemo2 } from "react";
|
|
81
|
+
import { useNavigate } from "react-router-dom";
|
|
82
|
+
import { PencilSquare, Trash } from "@medusajs/icons";
|
|
83
|
+
|
|
84
|
+
// src/hooks/table/columns/use-product-option-table-columns.tsx
|
|
85
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
86
|
+
import { useMemo } from "react";
|
|
87
|
+
import { useTranslation } from "react-i18next";
|
|
88
|
+
import { Badge } from "@medusajs/ui";
|
|
89
|
+
import { jsx } from "react/jsx-runtime";
|
|
90
|
+
var columnHelper = createColumnHelper();
|
|
91
|
+
var useProductOptionTableColumns = () => {
|
|
92
|
+
const { t } = useTranslation();
|
|
93
|
+
return useMemo(
|
|
94
|
+
() => [
|
|
95
|
+
columnHelper.accessor("title", {
|
|
96
|
+
header: t("fields.title"),
|
|
97
|
+
cell: ({ getValue }) => /* @__PURE__ */ jsx(TextCell, { text: getValue() })
|
|
98
|
+
}),
|
|
99
|
+
columnHelper.accessor("values", {
|
|
100
|
+
header: t("fields.values"),
|
|
101
|
+
cell: ({ getValue }) => {
|
|
102
|
+
const values = getValue();
|
|
103
|
+
const count = values?.length || 0;
|
|
104
|
+
const displayText = count > 0 ? `${count} ${count === 1 ? "value" : "values"}` : "-";
|
|
105
|
+
return /* @__PURE__ */ jsx(TextCell, { text: displayText });
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
columnHelper.accessor("is_exclusive", {
|
|
109
|
+
header: t("fields.status"),
|
|
110
|
+
cell: ({ getValue }) => {
|
|
111
|
+
const isExclusive = getValue();
|
|
112
|
+
return /* @__PURE__ */ jsx(Badge, { size: "xsmall", color: isExclusive ? "grey" : "blue", children: t(`general.${isExclusive ? "exclusive" : "global"}`) });
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
],
|
|
116
|
+
[t]
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// src/hooks/table/query/use-product-option-table-query.tsx
|
|
121
|
+
var useProductOptionTableQuery = ({
|
|
122
|
+
prefix,
|
|
123
|
+
pageSize = 20
|
|
124
|
+
}) => {
|
|
125
|
+
const queryObject = useQueryParams(
|
|
126
|
+
["offset", "q", "order", "created_at", "updated_at", "is_exclusive"],
|
|
127
|
+
prefix
|
|
128
|
+
);
|
|
129
|
+
const { offset, created_at, updated_at, q, order, is_exclusive } = queryObject;
|
|
130
|
+
const searchParams = {
|
|
131
|
+
limit: pageSize,
|
|
132
|
+
offset: offset ? Number(offset) : 0,
|
|
133
|
+
order,
|
|
134
|
+
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
135
|
+
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
136
|
+
is_exclusive: is_exclusive ? JSON.parse(is_exclusive) : void 0,
|
|
137
|
+
q
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
searchParams,
|
|
141
|
+
raw: queryObject
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx
|
|
146
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
147
|
+
var PAGE_SIZE = 20;
|
|
148
|
+
var ProductOptionListTable = () => {
|
|
149
|
+
const { t } = useTranslation2();
|
|
150
|
+
const { searchParams } = useProductOptionTableQuery({
|
|
151
|
+
pageSize: PAGE_SIZE
|
|
152
|
+
});
|
|
153
|
+
const { product_options, count, isError, error, isLoading } = useProductOptions(searchParams, {
|
|
154
|
+
placeholderData: keepPreviousData
|
|
155
|
+
});
|
|
156
|
+
const filters = useProductOptionTableFilters();
|
|
157
|
+
const columns = useColumns();
|
|
158
|
+
if (isError) {
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
return /* @__PURE__ */ jsx2(Container, { className: "divide-y p-0", children: /* @__PURE__ */ jsx2(
|
|
162
|
+
DataTable,
|
|
163
|
+
{
|
|
164
|
+
data: product_options,
|
|
165
|
+
columns,
|
|
166
|
+
filters,
|
|
167
|
+
rowCount: count,
|
|
168
|
+
pageSize: PAGE_SIZE,
|
|
169
|
+
getRowId: (row) => row.id,
|
|
170
|
+
heading: t("productOptions.domain"),
|
|
171
|
+
subHeading: t("productOptions.subtitle"),
|
|
172
|
+
emptyState: {
|
|
173
|
+
empty: {
|
|
174
|
+
heading: t("general.noRecordsMessage")
|
|
175
|
+
},
|
|
176
|
+
filtered: {
|
|
177
|
+
heading: t("general.noRecordsMessage"),
|
|
178
|
+
description: t("general.noRecordsMessageFiltered")
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
actions: [
|
|
182
|
+
{
|
|
183
|
+
label: t("actions.create"),
|
|
184
|
+
to: "create"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
isLoading,
|
|
188
|
+
enableSearch: true,
|
|
189
|
+
rowHref: (row) => `/product-options/${row.id}`
|
|
190
|
+
}
|
|
191
|
+
) });
|
|
192
|
+
};
|
|
193
|
+
var columnHelper2 = createDataTableColumnHelper();
|
|
194
|
+
var useColumns = () => {
|
|
195
|
+
const { t } = useTranslation2();
|
|
196
|
+
const prompt = usePrompt();
|
|
197
|
+
const navigate = useNavigate();
|
|
198
|
+
const base = useProductOptionTableColumns();
|
|
199
|
+
const { mutateAsync } = useDeleteProductOptionLazy();
|
|
200
|
+
const handleDelete = useCallback(
|
|
201
|
+
async (productOption) => {
|
|
202
|
+
const confirm = await prompt({
|
|
203
|
+
title: t("general.areYouSure"),
|
|
204
|
+
description: t("productOptions.delete.confirmation", {
|
|
205
|
+
title: productOption.title
|
|
206
|
+
}),
|
|
207
|
+
confirmText: t("actions.delete"),
|
|
208
|
+
cancelText: t("actions.cancel")
|
|
209
|
+
});
|
|
210
|
+
if (!confirm) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
await mutateAsync(productOption.id, {
|
|
214
|
+
onSuccess: () => {
|
|
215
|
+
toast.success(t("productOptions.delete.successToast"));
|
|
216
|
+
},
|
|
217
|
+
onError: (e) => {
|
|
218
|
+
toast.error(e.message);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
[t, prompt, mutateAsync]
|
|
223
|
+
);
|
|
224
|
+
return useMemo2(
|
|
225
|
+
() => [
|
|
226
|
+
...base,
|
|
227
|
+
columnHelper2.action({
|
|
228
|
+
actions: (ctx) => [
|
|
229
|
+
[
|
|
230
|
+
{
|
|
231
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare, {}),
|
|
232
|
+
label: t("actions.edit"),
|
|
233
|
+
onClick: () => navigate(`/product-options/${ctx.row.original.id}/edit`)
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
{
|
|
238
|
+
icon: /* @__PURE__ */ jsx2(Trash, {}),
|
|
239
|
+
label: t("actions.delete"),
|
|
240
|
+
onClick: () => handleDelete(ctx.row.original)
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
]
|
|
244
|
+
})
|
|
245
|
+
],
|
|
246
|
+
[base, handleDelete, navigate, t]
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
// src/routes/product-options/product-option-list/product-option-list.tsx
|
|
251
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
252
|
+
var ProductOptionList = () => {
|
|
253
|
+
const { getWidgets } = useExtension();
|
|
254
|
+
return /* @__PURE__ */ jsx3(
|
|
255
|
+
SingleColumnPage,
|
|
256
|
+
{
|
|
257
|
+
widgets: {
|
|
258
|
+
after: getWidgets("product_option.list.after"),
|
|
259
|
+
before: getWidgets("product_option.list.before")
|
|
260
|
+
},
|
|
261
|
+
hasOutlet: true,
|
|
262
|
+
children: /* @__PURE__ */ jsx3(ProductOptionListTable, {})
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
export {
|
|
267
|
+
ProductOptionList as Component
|
|
268
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import "./chunk-XRTVFYCW.mjs";
|
|
2
|
+
import {
|
|
3
|
+
MetadataForm
|
|
4
|
+
} from "./chunk-N3SAXQVR.mjs";
|
|
5
|
+
import "./chunk-IUCDCPJU.mjs";
|
|
6
|
+
import "./chunk-6HTZNHPT.mjs";
|
|
7
|
+
import {
|
|
8
|
+
RouteDrawer
|
|
9
|
+
} from "./chunk-WVA4O7QS.mjs";
|
|
10
|
+
import "./chunk-D6UW7URG.mjs";
|
|
11
|
+
import "./chunk-LPEUYMRK.mjs";
|
|
12
|
+
import "./chunk-OC7BQLYI.mjs";
|
|
13
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
14
|
+
import "./chunk-OBQI23QM.mjs";
|
|
15
|
+
import "./chunk-74WPAWMW.mjs";
|
|
16
|
+
import "./chunk-I4OBEAOJ.mjs";
|
|
17
|
+
import "./chunk-HI6URQ7H.mjs";
|
|
18
|
+
import "./chunk-6CLQKVAU.mjs";
|
|
19
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
20
|
+
import "./chunk-KI7TOXBR.mjs";
|
|
21
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
22
|
+
import "./chunk-WAXMT4IY.mjs";
|
|
23
|
+
import "./chunk-DYDGGABK.mjs";
|
|
24
|
+
import "./chunk-CN7JXSGW.mjs";
|
|
25
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
26
|
+
import "./chunk-5BQQRHQS.mjs";
|
|
27
|
+
import "./chunk-G35UUG2P.mjs";
|
|
28
|
+
import "./chunk-5AFMB7XQ.mjs";
|
|
29
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
30
|
+
import "./chunk-A63RZVX6.mjs";
|
|
31
|
+
import "./chunk-HBXV7ENS.mjs";
|
|
32
|
+
import "./chunk-CDORR33H.mjs";
|
|
33
|
+
import "./chunk-333HK6Y6.mjs";
|
|
34
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
35
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
36
|
+
import "./chunk-3BF5SC66.mjs";
|
|
37
|
+
import "./chunk-DWH2OQFK.mjs";
|
|
38
|
+
import "./chunk-VCSSQVPD.mjs";
|
|
39
|
+
import "./chunk-HP2JH45P.mjs";
|
|
40
|
+
import "./chunk-SQDIZZDW.mjs";
|
|
41
|
+
import {
|
|
42
|
+
useProductOption,
|
|
43
|
+
useUpdateProductOption
|
|
44
|
+
} from "./chunk-UCYUWNJL.mjs";
|
|
45
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
46
|
+
import "./chunk-FXYH54JP.mjs";
|
|
47
|
+
import "./chunk-774WSTCC.mjs";
|
|
48
|
+
import "./chunk-NFEK63OE.mjs";
|
|
49
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
50
|
+
|
|
51
|
+
// src/routes/product-options/product-option-metadata/product-option-metadata.tsx
|
|
52
|
+
import { useParams } from "react-router-dom";
|
|
53
|
+
import { jsx } from "react/jsx-runtime";
|
|
54
|
+
var ProductOptionMetadata = () => {
|
|
55
|
+
const { id } = useParams();
|
|
56
|
+
const { product_option, isPending, isError, error } = useProductOption(id);
|
|
57
|
+
const { mutateAsync, isPending: isMutating } = useUpdateProductOption(id);
|
|
58
|
+
if (isError) {
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
return /* @__PURE__ */ jsx(RouteDrawer, { children: /* @__PURE__ */ jsx(
|
|
62
|
+
MetadataForm,
|
|
63
|
+
{
|
|
64
|
+
isPending,
|
|
65
|
+
isMutating,
|
|
66
|
+
hook: mutateAsync,
|
|
67
|
+
metadata: product_option?.metadata
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
ProductOptionMetadata as Component
|
|
73
|
+
};
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Combobox
|
|
3
|
+
} from "./chunk-OYHFHBNL.mjs";
|
|
4
|
+
import {
|
|
5
|
+
PRODUCT_DETAIL_FIELDS
|
|
6
|
+
} from "./chunk-T6DDBLGY.mjs";
|
|
7
|
+
import "./chunk-IUCDCPJU.mjs";
|
|
8
|
+
import {
|
|
9
|
+
KeyboundForm
|
|
10
|
+
} from "./chunk-6HTZNHPT.mjs";
|
|
11
|
+
import {
|
|
12
|
+
RouteDrawer
|
|
13
|
+
} from "./chunk-WVA4O7QS.mjs";
|
|
14
|
+
import {
|
|
15
|
+
useRouteModal
|
|
16
|
+
} from "./chunk-D6UW7URG.mjs";
|
|
17
|
+
import {
|
|
18
|
+
useExtendableForm
|
|
19
|
+
} from "./chunk-BJ44US4R.mjs";
|
|
20
|
+
import "./chunk-2SSUH2HJ.mjs";
|
|
21
|
+
import "./chunk-ONB3JEHR.mjs";
|
|
22
|
+
import "./chunk-YCDDT44O.mjs";
|
|
23
|
+
import "./chunk-4GQOUCX6.mjs";
|
|
24
|
+
import "./chunk-RYJ2UVJE.mjs";
|
|
25
|
+
import "./chunk-D3YQN7HV.mjs";
|
|
26
|
+
import "./chunk-PMA2D6IL.mjs";
|
|
27
|
+
import "./chunk-MNXC6Q4F.mjs";
|
|
28
|
+
import "./chunk-DG7J63J2.mjs";
|
|
29
|
+
import "./chunk-G4BWCU5P.mjs";
|
|
30
|
+
import {
|
|
31
|
+
useExtension
|
|
32
|
+
} from "./chunk-C5P5PL3E.mjs";
|
|
33
|
+
import "./chunk-LPEUYMRK.mjs";
|
|
34
|
+
import "./chunk-ZCARHA6C.mjs";
|
|
35
|
+
import "./chunk-OZPB6JBL.mjs";
|
|
36
|
+
import "./chunk-OC7BQLYI.mjs";
|
|
37
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
38
|
+
import "./chunk-535OVBXR.mjs";
|
|
39
|
+
import {
|
|
40
|
+
Form
|
|
41
|
+
} from "./chunk-OBQI23QM.mjs";
|
|
42
|
+
import "./chunk-74WPAWMW.mjs";
|
|
43
|
+
import "./chunk-I4OBEAOJ.mjs";
|
|
44
|
+
import "./chunk-HI6URQ7H.mjs";
|
|
45
|
+
import "./chunk-6CLQKVAU.mjs";
|
|
46
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
47
|
+
import "./chunk-KI7TOXBR.mjs";
|
|
48
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
49
|
+
import "./chunk-WAXMT4IY.mjs";
|
|
50
|
+
import "./chunk-DYDGGABK.mjs";
|
|
51
|
+
import "./chunk-CN7JXSGW.mjs";
|
|
52
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
53
|
+
import "./chunk-5BQQRHQS.mjs";
|
|
54
|
+
import "./chunk-G35UUG2P.mjs";
|
|
55
|
+
import "./chunk-5AFMB7XQ.mjs";
|
|
56
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
57
|
+
import "./chunk-A63RZVX6.mjs";
|
|
58
|
+
import "./chunk-HBXV7ENS.mjs";
|
|
59
|
+
import "./chunk-CDORR33H.mjs";
|
|
60
|
+
import "./chunk-333HK6Y6.mjs";
|
|
61
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
62
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
63
|
+
import "./chunk-3BF5SC66.mjs";
|
|
64
|
+
import "./chunk-DWH2OQFK.mjs";
|
|
65
|
+
import "./chunk-VCSSQVPD.mjs";
|
|
66
|
+
import "./chunk-HP2JH45P.mjs";
|
|
67
|
+
import "./chunk-SQDIZZDW.mjs";
|
|
68
|
+
import {
|
|
69
|
+
useLinkProductOptions,
|
|
70
|
+
useProduct,
|
|
71
|
+
useProductOptions
|
|
72
|
+
} from "./chunk-UCYUWNJL.mjs";
|
|
73
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
74
|
+
import "./chunk-FXYH54JP.mjs";
|
|
75
|
+
import "./chunk-774WSTCC.mjs";
|
|
76
|
+
import "./chunk-NFEK63OE.mjs";
|
|
77
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
78
|
+
|
|
79
|
+
// src/routes/products/product-options-manage/product-options-manage.tsx
|
|
80
|
+
import { Heading } from "@medusajs/ui";
|
|
81
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
82
|
+
import { useParams } from "react-router-dom";
|
|
83
|
+
|
|
84
|
+
// src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx
|
|
85
|
+
import { Button, Hint, Label, toast, Tooltip } from "@medusajs/ui";
|
|
86
|
+
import { useMemo, useState } from "react";
|
|
87
|
+
import { useTranslation } from "react-i18next";
|
|
88
|
+
import * as zod from "zod";
|
|
89
|
+
import { InformationCircle } from "@medusajs/icons";
|
|
90
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
91
|
+
var ProductOptionsManageSchema = zod.object({
|
|
92
|
+
option_ids: zod.array(zod.string()),
|
|
93
|
+
option_values: zod.record(zod.array(zod.string())).optional()
|
|
94
|
+
});
|
|
95
|
+
var ProductOptionsManageForm = ({
|
|
96
|
+
product
|
|
97
|
+
}) => {
|
|
98
|
+
const { t } = useTranslation();
|
|
99
|
+
const { handleSuccess } = useRouteModal();
|
|
100
|
+
const { getFormConfigs } = useExtension();
|
|
101
|
+
const configs = getFormConfigs("product", "edit");
|
|
102
|
+
const { product_options = [], isLoading } = useProductOptions();
|
|
103
|
+
const productOptionChoices = useMemo(() => {
|
|
104
|
+
return product_options.map((option) => ({
|
|
105
|
+
value: option.id,
|
|
106
|
+
label: option.title
|
|
107
|
+
}));
|
|
108
|
+
}, [product_options]);
|
|
109
|
+
const [selectedOptionIds, setSelectedOptionIds] = useState(
|
|
110
|
+
product.options?.map((opt) => opt.id) || []
|
|
111
|
+
);
|
|
112
|
+
const [selectedOptionValues, setSelectedOptionValues] = useState(() => {
|
|
113
|
+
const initialValues = {};
|
|
114
|
+
product.options?.forEach((opt) => {
|
|
115
|
+
initialValues[opt.id] = opt.values?.map((v) => v.id) || [];
|
|
116
|
+
});
|
|
117
|
+
return initialValues;
|
|
118
|
+
});
|
|
119
|
+
const form = useExtendableForm({
|
|
120
|
+
defaultValues: {
|
|
121
|
+
option_ids: product.options?.map((opt) => opt.id) || [],
|
|
122
|
+
option_values: (() => {
|
|
123
|
+
const initialValues = {};
|
|
124
|
+
product.options?.forEach((opt) => {
|
|
125
|
+
initialValues[opt.id] = opt.values?.map((v) => v.id) || [];
|
|
126
|
+
});
|
|
127
|
+
return initialValues;
|
|
128
|
+
})()
|
|
129
|
+
},
|
|
130
|
+
schema: ProductOptionsManageSchema,
|
|
131
|
+
configs,
|
|
132
|
+
data: product
|
|
133
|
+
});
|
|
134
|
+
const { mutateAsync, isPending } = useLinkProductOptions(product.id);
|
|
135
|
+
const handleProductOptionSelect = (optionIds) => {
|
|
136
|
+
setSelectedOptionIds(optionIds);
|
|
137
|
+
form.setValue("option_ids", optionIds);
|
|
138
|
+
const newSelectedValues = {};
|
|
139
|
+
const selectedProductOptions = product_options.filter(
|
|
140
|
+
(option) => optionIds.includes(option.id)
|
|
141
|
+
);
|
|
142
|
+
selectedProductOptions.forEach((option) => {
|
|
143
|
+
if (selectedOptionValues[option.id]) {
|
|
144
|
+
newSelectedValues[option.id] = selectedOptionValues[option.id];
|
|
145
|
+
} else {
|
|
146
|
+
newSelectedValues[option.id] = option.values?.map((v) => v.id) || [];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
setSelectedOptionValues(newSelectedValues);
|
|
150
|
+
form.setValue("option_values", newSelectedValues);
|
|
151
|
+
};
|
|
152
|
+
const handleValueChange = (optionId, valueIds) => {
|
|
153
|
+
if (valueIds.length === 0) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const updatedSelectedValues = {
|
|
157
|
+
...selectedOptionValues,
|
|
158
|
+
[optionId]: valueIds
|
|
159
|
+
};
|
|
160
|
+
setSelectedOptionValues(updatedSelectedValues);
|
|
161
|
+
form.setValue("option_values", updatedSelectedValues);
|
|
162
|
+
};
|
|
163
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
164
|
+
const currentOptionIds = product.options?.map((opt) => opt.id) || [];
|
|
165
|
+
const newOptionIds = data.option_ids;
|
|
166
|
+
const optionsToAdd = [];
|
|
167
|
+
const optionsToRemove = [];
|
|
168
|
+
for (const currentId of currentOptionIds) {
|
|
169
|
+
if (!newOptionIds.includes(currentId)) {
|
|
170
|
+
optionsToRemove.push(currentId);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
for (const newId of newOptionIds) {
|
|
174
|
+
const isNewOption = !currentOptionIds.includes(newId);
|
|
175
|
+
if (isNewOption) {
|
|
176
|
+
optionsToAdd.push(
|
|
177
|
+
data.option_values ? {
|
|
178
|
+
id: newId,
|
|
179
|
+
value_ids: data.option_values[newId]
|
|
180
|
+
} : newId
|
|
181
|
+
);
|
|
182
|
+
} else {
|
|
183
|
+
const currentOption = product.options?.find((opt) => opt.id === newId);
|
|
184
|
+
const currentValueIds = currentOption?.values?.map((v) => v.id).sort() || [];
|
|
185
|
+
const newValueIds = [...data.option_values?.[newId] || []].sort();
|
|
186
|
+
const valuesChanged = currentValueIds.length !== newValueIds.length || currentValueIds.some((id, index) => id !== newValueIds[index]);
|
|
187
|
+
if (valuesChanged) {
|
|
188
|
+
optionsToRemove.push(newId);
|
|
189
|
+
optionsToAdd.push(
|
|
190
|
+
data.option_values ? {
|
|
191
|
+
id: newId,
|
|
192
|
+
value_ids: data.option_values[newId]
|
|
193
|
+
} : newId
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
await mutateAsync(
|
|
199
|
+
{
|
|
200
|
+
add: optionsToAdd,
|
|
201
|
+
remove: optionsToRemove
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
onSuccess: ({ product: product2 }) => {
|
|
205
|
+
toast.success(
|
|
206
|
+
t("products.organization.edit.toasts.success", {
|
|
207
|
+
title: product2.title
|
|
208
|
+
})
|
|
209
|
+
);
|
|
210
|
+
handleSuccess();
|
|
211
|
+
},
|
|
212
|
+
onError: (error) => {
|
|
213
|
+
toast.error(error.message);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
});
|
|
218
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
|
|
219
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col gap-y-4", children: [
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
Form.Field,
|
|
222
|
+
{
|
|
223
|
+
control: form.control,
|
|
224
|
+
name: "option_ids",
|
|
225
|
+
render: ({ field }) => {
|
|
226
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
227
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("products.options.manage.label") }),
|
|
228
|
+
/* @__PURE__ */ jsx(Form.Hint, { children: t("products.options.manage.hint") }),
|
|
229
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
230
|
+
Combobox,
|
|
231
|
+
{
|
|
232
|
+
...field,
|
|
233
|
+
value: selectedOptionIds,
|
|
234
|
+
onChange: (value) => handleProductOptionSelect(value),
|
|
235
|
+
options: productOptionChoices,
|
|
236
|
+
placeholder: t("products.options.manage.placeholder"),
|
|
237
|
+
disabled: isLoading,
|
|
238
|
+
displayMode: "chips"
|
|
239
|
+
}
|
|
240
|
+
) }),
|
|
241
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
242
|
+
] });
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
selectedOptionIds.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
247
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
248
|
+
/* @__PURE__ */ jsx(Label, { weight: "plus", children: t("fields.values") }),
|
|
249
|
+
/* @__PURE__ */ jsx(Hint, { children: t("products.create.variants.selectValuesHint") })
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-3", children: product_options.filter((option) => selectedOptionIds.includes(option.id)).map((option) => {
|
|
252
|
+
const valueOptions = option.values?.sort((a, b) => {
|
|
253
|
+
const rankA = a.rank ?? Number.MAX_VALUE;
|
|
254
|
+
const rankB = b.rank ?? Number.MAX_VALUE;
|
|
255
|
+
return rankA - rankB;
|
|
256
|
+
}).map((v) => ({
|
|
257
|
+
value: v.id,
|
|
258
|
+
label: v.value
|
|
259
|
+
})) || [];
|
|
260
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-2", children: [
|
|
261
|
+
/* @__PURE__ */ jsxs(
|
|
262
|
+
Label,
|
|
263
|
+
{
|
|
264
|
+
className: "flex items-center gap-x-1",
|
|
265
|
+
size: "small",
|
|
266
|
+
weight: "plus",
|
|
267
|
+
children: [
|
|
268
|
+
option.title,
|
|
269
|
+
option.is_exclusive && /* @__PURE__ */ jsx(
|
|
270
|
+
Tooltip,
|
|
271
|
+
{
|
|
272
|
+
content: t(
|
|
273
|
+
"productOptions.manage.exclusiveOption"
|
|
274
|
+
),
|
|
275
|
+
children: /* @__PURE__ */ jsx(InformationCircle, { className: "text-ui-fg-subtle pt-[1px]" })
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ jsx(
|
|
282
|
+
Combobox,
|
|
283
|
+
{
|
|
284
|
+
value: selectedOptionValues[option.id] || [],
|
|
285
|
+
onChange: (value) => handleValueChange(option.id, value),
|
|
286
|
+
options: valueOptions,
|
|
287
|
+
placeholder: t(
|
|
288
|
+
"products.fields.options.variantionsPlaceholder"
|
|
289
|
+
),
|
|
290
|
+
displayMode: "chips"
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
] }, option.id);
|
|
294
|
+
}) })
|
|
295
|
+
] })
|
|
296
|
+
] }) }),
|
|
297
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
298
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
299
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
|
300
|
+
] }) })
|
|
301
|
+
] }) });
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/routes/products/product-options-manage/product-options-manage.tsx
|
|
305
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
306
|
+
var ProductOptionsManage = () => {
|
|
307
|
+
const { id } = useParams();
|
|
308
|
+
const { t } = useTranslation2();
|
|
309
|
+
const { product, isLoading, isError, error } = useProduct(id, {
|
|
310
|
+
fields: PRODUCT_DETAIL_FIELDS
|
|
311
|
+
});
|
|
312
|
+
if (isError) {
|
|
313
|
+
throw error;
|
|
314
|
+
}
|
|
315
|
+
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
316
|
+
/* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
|
|
317
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("products.options.manage.header") }) }),
|
|
318
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("products.options.manage.description") })
|
|
319
|
+
] }),
|
|
320
|
+
!isLoading && product && /* @__PURE__ */ jsx2(ProductOptionsManageForm, { product })
|
|
321
|
+
] });
|
|
322
|
+
};
|
|
323
|
+
export {
|
|
324
|
+
ProductOptionsManage as Component
|
|
325
|
+
};
|