@medusajs/dashboard 3.0.0-snapshot-20251114155958 → 3.0.0-snapshot-20251126221441
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/{adjust-inventory-ZB3AVET7.mjs → adjust-inventory-WZOCLB5V.mjs} +1 -1
- package/dist/{api-key-management-create-U6VGZK7R.mjs → api-key-management-create-W7NL2IYN.mjs} +3 -3
- package/dist/{api-key-management-detail-B5XNEGKF.mjs → api-key-management-detail-3F77JKQT.mjs} +13 -13
- package/dist/{api-key-management-edit-TJM737A7.mjs → api-key-management-edit-TLVLXAVK.mjs} +3 -3
- package/dist/{api-key-management-list-ZRYMMTF5.mjs → api-key-management-list-FTLC3ELT.mjs} +3 -3
- package/dist/{api-key-management-sales-channels-D2RAHI7W.mjs → api-key-management-sales-channels-NYY3NZOE.mjs} +4 -4
- package/dist/app.css +3 -3
- package/dist/app.js +16021 -17376
- package/dist/app.mjs +11 -11
- package/dist/{campaign-create-IXOWJQ4L.mjs → campaign-create-LHL7FKQK.mjs} +3 -3
- package/dist/{campaign-detail-RCA3TBE4.mjs → campaign-detail-G2FIHVM2.mjs} +10 -10
- package/dist/{categories-metadata-5NBC7HX4.mjs → categories-metadata-YEF2WFML.mjs} +10 -10
- package/dist/{category-create-BTMZYQ5R.mjs → category-create-ELMCLH4J.mjs} +5 -5
- package/dist/{category-detail-RBUJVFPN.mjs → category-detail-ORXA4DBA.mjs} +14 -14
- package/dist/{category-edit-Q3KEELHO.mjs → category-edit-TYKLEYGE.mjs} +2 -2
- package/dist/{category-list-Z6HS6N75.mjs → category-list-IJ3DLPYQ.mjs} +5 -5
- package/dist/{category-organize-45NPSRNG.mjs → category-organize-PDLC54E2.mjs} +2 -2
- package/dist/{category-products-KREOO2KQ.mjs → category-products-GXTUJNT6.mjs} +13 -13
- package/dist/{chunk-SAZHCRHS.mjs → chunk-2PZVZSZW.mjs} +1 -1
- package/dist/{chunk-NFEW5CVI.mjs → chunk-3C6WQ7NH.mjs} +3 -37
- package/dist/{chunk-KF22R23X.mjs → chunk-3UOOSL7Y.mjs} +1 -1
- package/dist/{chunk-BYZSMXJ7.mjs → chunk-4DDI2KIE.mjs} +1 -1
- package/dist/{chunk-5N33TBBX.mjs → chunk-56TDUOXV.mjs} +1 -1
- package/dist/{chunk-67RC6SEX.mjs → chunk-5LGRZSEH.mjs} +1 -1
- package/dist/{chunk-W4TIFG3A.mjs → chunk-6KMZSZIA.mjs} +5 -5
- package/dist/{chunk-P23S5LDK.mjs → chunk-7V2JZU2B.mjs} +2 -2
- package/dist/{chunk-GHBURGZC.mjs → chunk-A6PWH2CK.mjs} +1 -1
- package/dist/{chunk-KJU3T6BK.mjs → chunk-AEMKNDRM.mjs} +2 -2
- package/dist/{chunk-QW4SQVMT.mjs → chunk-AENRV3N7.mjs} +50 -109
- package/dist/{chunk-O5DGX2NZ.mjs → chunk-AF7A24XI.mjs} +1 -1
- package/dist/{chunk-F7LJJHQT.mjs → chunk-C7F7MMXS.mjs} +1 -0
- package/dist/{chunk-CWIMWR6L.mjs → chunk-D6DIMX3W.mjs} +15 -15
- package/dist/{chunk-3RRA56WC.mjs → chunk-DODQ3KJT.mjs} +3 -8
- package/dist/{chunk-FJHAGJ5G.mjs → chunk-ETOJCN3Q.mjs} +1 -1
- package/dist/{chunk-YVQIO3JS.mjs → chunk-GYHQTVXN.mjs} +236 -318
- package/dist/{chunk-FNQ227BC.mjs → chunk-K5QWNI6V.mjs} +1 -1
- package/dist/{chunk-ZOJRDXH3.mjs → chunk-KC64IT2X.mjs} +1 -1
- package/dist/{chunk-K75OQ7QA.mjs → chunk-KHNOLBMA.mjs} +2 -2
- package/dist/{chunk-MOGV3UZD.mjs → chunk-KLNRCI3K.mjs} +1 -1
- package/dist/{chunk-YGEJFHC3.mjs → chunk-M3CKVBZC.mjs} +1 -1
- package/dist/{chunk-VW34SZWE.mjs → chunk-MDVO5GXZ.mjs} +2 -2
- package/dist/{chunk-7H6DB666.mjs → chunk-O4RZ3Y65.mjs} +1 -1
- package/dist/{chunk-5AM254NB.mjs → chunk-OFN7DIZA.mjs} +3 -83
- package/dist/{chunk-42TMWI76.mjs → chunk-OXPE5TAY.mjs} +1 -1
- package/dist/{chunk-NZNJSGGE.mjs → chunk-SIR4PJ4E.mjs} +3 -3
- package/dist/{chunk-QPJUVTKW.mjs → chunk-SWS2BE3M.mjs} +1 -1
- package/dist/{chunk-OMRGW7JS.mjs → chunk-T2ANPJ36.mjs} +3 -3
- package/dist/{chunk-ZE34KAKV.mjs → chunk-U63NCO35.mjs} +2 -2
- package/dist/{chunk-2WLOIS3L.mjs → chunk-WGRVE7KY.mjs} +21 -2
- package/dist/{chunk-BKJMQ6RP.mjs → chunk-WYITLR2E.mjs} +1 -1
- package/dist/{chunk-Y5TTJDGO.mjs → chunk-ZT7CR32D.mjs} +1 -1
- package/dist/{collection-add-products-KM4VO5G5.mjs → collection-add-products-D2KOVZPZ.mjs} +14 -14
- package/dist/{collection-create-RIGJHEX5.mjs → collection-create-I2A2X4VK.mjs} +2 -2
- package/dist/{collection-detail-MLVNULUS.mjs → collection-detail-ZT535E5T.mjs} +14 -14
- package/dist/{collection-edit-WX5G3FHR.mjs → collection-edit-RGH7NCUE.mjs} +2 -2
- package/dist/{collection-list-KWAHQGFE.mjs → collection-list-53JPFHPN.mjs} +23 -24
- package/dist/{collection-metadata-OMFOP3LA.mjs → collection-metadata-SQCA35II.mjs} +11 -11
- package/dist/{customer-detail-SVDGB2QD.mjs → customer-detail-W55EJ6LX.mjs} +14 -14
- package/dist/{customer-group-detail-OCQTI4GG.mjs → customer-group-detail-2WFTU5KU.mjs} +13 -13
- package/dist/{customer-group-list-K5MTMFLG.mjs → customer-group-list-GLF37WEN.mjs} +13 -13
- package/dist/{customers-add-customer-group-2LLBHTX3.mjs → customers-add-customer-group-KXT7RDV3.mjs} +13 -13
- package/dist/{edit-inventory-item-O6JLGZE4.mjs → edit-inventory-item-LMDNUI6M.mjs} +1 -1
- package/dist/{edit-inventory-item-attributes-AUVR3GYY.mjs → edit-inventory-item-attributes-DPJIHBP3.mjs} +1 -1
- package/dist/{edit-reservation-GQ6R6GVA.mjs → edit-reservation-IOOZBJ2T.mjs} +2 -2
- package/dist/{edit-rules-G7YMD5RC.mjs → edit-rules-7TG76PR3.mjs} +12 -12
- package/dist/en.json +3 -49
- package/dist/{inventory-create-GMFEGLE4.mjs → inventory-create-NQUETR3V.mjs} +10 -10
- package/dist/{inventory-detail-3BTAVXLJ.mjs → inventory-detail-ADLVUQJM.mjs} +10 -10
- package/dist/{inventory-list-ADJQDNX5.mjs → inventory-list-RQBI7UJX.mjs} +1 -1
- package/dist/{inventory-metadata-JJBXLQJG.mjs → inventory-metadata-45YATS7H.mjs} +10 -10
- package/dist/{inventory-stock-RHLN6ARK.mjs → inventory-stock-UG3CW3TM.mjs} +10 -10
- package/dist/{location-detail-F5QYFPUH.mjs → location-detail-BBPTVSP5.mjs} +15 -15
- package/dist/{location-fulfillment-providers-7JXNE6YT.mjs → location-fulfillment-providers-6AHWONY4.mjs} +14 -15
- package/dist/{location-sales-channels-JPH5BTUY.mjs → location-sales-channels-UVYT52SH.mjs} +3 -3
- package/dist/{location-service-zone-shipping-option-create-7VTPJAPA.mjs → location-service-zone-shipping-option-create-WEIDYZZT.mjs} +11 -11
- package/dist/{location-service-zone-shipping-option-edit-OYTEZGGC.mjs → location-service-zone-shipping-option-edit-TQNTCYII.mjs} +4 -4
- package/dist/{login-BGH5LSM4.mjs → login-VQ7YFW6V.mjs} +10 -10
- package/dist/{manage-locations-ATCDVTSR.mjs → manage-locations-2VDQ3ILT.mjs} +1 -1
- package/dist/{order-allocate-items-PHIW64XK.mjs → order-allocate-items-SSDLHV7A.mjs} +3 -3
- package/dist/{order-create-claim-NPQ6E5DR.mjs → order-create-claim-RAGNQ2RR.mjs} +18 -18
- package/dist/{order-create-edit-R4ZITC5I.mjs → order-create-edit-PRJWTWWE.mjs} +31 -16
- package/dist/{order-create-exchange-6XPYKVYN.mjs → order-create-exchange-DRSFEEL3.mjs} +60 -34
- package/dist/{order-create-fulfillment-7DVPBUES.mjs → order-create-fulfillment-URKHLFR7.mjs} +14 -14
- package/dist/{order-create-refund-7KEOYZTF.mjs → order-create-refund-VZG3UXLV.mjs} +15 -15
- package/dist/{order-create-return-J23AFCKP.mjs → order-create-return-P3OCXJSI.mjs} +6 -6
- package/dist/{order-create-shipment-KNXCANID.mjs → order-create-shipment-QZBUE342.mjs} +10 -10
- package/dist/{order-detail-7ATBL7GN.mjs → order-detail-32Y6JK42.mjs} +31 -31
- package/dist/{order-edit-billing-address-VS75YMUY.mjs → order-edit-billing-address-MUICLYNN.mjs} +11 -11
- package/dist/{order-edit-email-GEE7SF2E.mjs → order-edit-email-ADNCGCS3.mjs} +11 -11
- package/dist/{order-edit-shipping-address-HSRXSRLU.mjs → order-edit-shipping-address-NZF3KMVV.mjs} +11 -11
- package/dist/{order-list-GJTJHLZF.mjs → order-list-33SMDKZD.mjs} +5 -4
- package/dist/{order-metadata-LUBKP5Y4.mjs → order-metadata-UEKHMTAD.mjs} +10 -10
- package/dist/{order-receive-return-FLI44JN2.mjs → order-receive-return-5SB26KCQ.mjs} +11 -11
- package/dist/{order-request-transfer-NH2XCHMV.mjs → order-request-transfer-QS3LMEBW.mjs} +12 -12
- package/dist/{price-list-configuration-SS2VMD4N.mjs → price-list-configuration-CZPMKLNL.mjs} +4 -4
- package/dist/{price-list-create-DZR7JCDG.mjs → price-list-create-2YZRNBRI.mjs} +17 -17
- package/dist/{price-list-detail-4INABJQQ.mjs → price-list-detail-EGGLDH5B.mjs} +24 -20
- package/dist/{price-list-edit-VRI5T4W3.mjs → price-list-edit-3VNSZH4F.mjs} +2 -2
- package/dist/{price-list-list-S2HWTXKV.mjs → price-list-list-AU4IVCQN.mjs} +34 -18
- package/dist/{price-list-prices-add-DO43IEAD.mjs → price-list-prices-add-YRXYOXUG.mjs} +16 -14
- package/dist/{price-list-prices-edit-TRCLLGU4.mjs → price-list-prices-edit-UHOZKA75.mjs} +5 -3
- package/dist/{product-attributes-D6MNCAJB.mjs → product-attributes-W2PIZ6AU.mjs} +12 -12
- package/dist/{product-create-JQQTUEQL.mjs → product-create-UY3QXGNY.mjs} +554 -377
- package/dist/product-create-option-GAEPSU6J.mjs +145 -0
- package/dist/{product-create-variant-6UQRMACE.mjs → product-create-variant-RQEPRPG5.mjs} +11 -11
- package/dist/{product-detail-JMOULY3O.mjs → product-detail-FOLQUXCM.mjs} +54 -38
- package/dist/{product-edit-CC4OUBEC.mjs → product-edit-WRONAZ5F.mjs} +12 -12
- package/dist/product-edit-option-VIU3ZICO.mjs +150 -0
- package/dist/{product-export-BVREOXJT.mjs → product-export-ITQPBLG7.mjs} +22 -23
- package/dist/{product-image-variants-edit-7BBTFZO7.mjs → product-image-variants-edit-P2ZWO6DN.mjs} +10 -10
- package/dist/{product-import-UEXWOHOZ.mjs → product-import-WEHFNQXM.mjs} +10 -10
- package/dist/{product-list-RHHY3NAS.mjs → product-list-7QL2GZEA.mjs} +17 -17
- package/dist/{product-media-EKXMOSO4.mjs → product-media-WCLPCVR3.mjs} +2 -2
- package/dist/{product-metadata-DU2CNDKQ.mjs → product-metadata-LP3B3LXR.mjs} +10 -10
- package/dist/{product-organization-HU6YVPPV.mjs → product-organization-GKKUOJQV.mjs} +14 -14
- package/dist/{product-prices-UMEIS5AZ.mjs → product-prices-MKMKBH6P.mjs} +1 -1
- package/dist/{product-sales-channels-2SALTLTF.mjs → product-sales-channels-5YIO22UW.mjs} +3 -3
- package/dist/{product-shipping-profile-T4ZKHINJ.mjs → product-shipping-profile-GOESXQYV.mjs} +13 -13
- package/dist/{product-stock-CKBS4YDA.mjs → product-stock-KZ5NJINL.mjs} +10 -10
- package/dist/{product-tag-create-GFGPI7ML.mjs → product-tag-create-KOTNIDPO.mjs} +10 -10
- package/dist/{product-tag-detail-TTEWVF3I.mjs → product-tag-detail-4NEU4CQ4.mjs} +27 -28
- package/dist/{product-tag-edit-3XNTLATZ.mjs → product-tag-edit-UBVJB75M.mjs} +10 -10
- package/dist/{product-tag-list-24IJRVFR.mjs → product-tag-list-2JDK7DBC.mjs} +25 -26
- package/dist/{product-tag-metadata-JANWHZ3K.mjs → product-tag-metadata-H4QYJB5I.mjs} +10 -10
- package/dist/{product-type-detail-MAUHCM3C.mjs → product-type-detail-QSKBQZOO.mjs} +13 -13
- package/dist/{product-type-metadata-FAKUWQQF.mjs → product-type-metadata-OSGO33SD.mjs} +10 -10
- package/dist/{product-variant-detail-WHPECDUY.mjs → product-variant-detail-ATHRI3BX.mjs} +10 -10
- package/dist/{product-variant-edit-GR4RNE5G.mjs → product-variant-edit-457GNHH5.mjs} +11 -11
- package/dist/{product-variant-manage-inventory-items-IGDCLZQE.mjs → product-variant-manage-inventory-items-B7TUBSD5.mjs} +2 -2
- package/dist/{product-variant-media-EKI4BTEV.mjs → product-variant-media-6WWLRINP.mjs} +1 -1
- package/dist/{product-variant-metadata-DA2HKXXB.mjs → product-variant-metadata-GOUTYBDT.mjs} +10 -10
- package/dist/{promotion-add-campaign-DOALJUKJ.mjs → promotion-add-campaign-MKDYE7MW.mjs} +3 -3
- package/dist/{promotion-create-GGZULF2B.mjs → promotion-create-WCECPK2G.mjs} +18 -18
- package/dist/{promotion-detail-XK7U73XH.mjs → promotion-detail-JBM2LBZ4.mjs} +10 -10
- package/dist/{refund-reason-create-H7MHJ5C5.mjs → refund-reason-create-IAOKE37M.mjs} +10 -10
- package/dist/{refund-reason-edit-QY36CQVS.mjs → refund-reason-edit-D2VDINGV.mjs} +10 -10
- package/dist/{refund-reason-list-KSQW33QC.mjs → refund-reason-list-Q4TU7OVA.mjs} +13 -13
- package/dist/{region-create-UVJICJRX.mjs → region-create-QLPSK6TX.mjs} +1 -1
- package/dist/{region-edit-3NVXQECN.mjs → region-edit-JCJHA6TY.mjs} +1 -1
- package/dist/{region-metadata-4KQG6UL6.mjs → region-metadata-YLNPW7CL.mjs} +10 -10
- package/dist/{reservation-create-Z7TWUE2L.mjs → reservation-create-BW4CDTWR.mjs} +3 -3
- package/dist/{reservation-detail-W3FULMXT.mjs → reservation-detail-SMO3C2R5.mjs} +10 -10
- package/dist/{reservation-list-MN22JYAW.mjs → reservation-list-RGL67CIU.mjs} +2 -2
- package/dist/{reservation-metadata-AKAN5XNE.mjs → reservation-metadata-KU5AJF7S.mjs} +10 -10
- package/dist/{sales-channel-add-products-POHTQHMV.mjs → sales-channel-add-products-WGRIVVJA.mjs} +13 -13
- package/dist/{sales-channel-create-UFFXX5HK.mjs → sales-channel-create-TOBEDYFD.mjs} +2 -2
- package/dist/{sales-channel-detail-AACIFU2E.mjs → sales-channel-detail-VSTGXEZD.mjs} +13 -13
- package/dist/{sales-channel-edit-SP2HF4E3.mjs → sales-channel-edit-XUTE5GB5.mjs} +2 -2
- package/dist/{sales-channel-list-BY3KTVV6.mjs → sales-channel-list-2LXIRNZP.mjs} +11 -11
- package/dist/{sales-channel-metadata-KGOLI4BZ.mjs → sales-channel-metadata-RZMQYG4F.mjs} +10 -10
- package/dist/{shipping-option-type-create-PSQZW3RN.mjs → shipping-option-type-create-EQPBH6EA.mjs} +10 -10
- package/dist/{shipping-option-type-detail-WAW6TKJU.mjs → shipping-option-type-detail-BCCCVIIJ.mjs} +11 -11
- package/dist/{shipping-option-type-edit-2I44YHND.mjs → shipping-option-type-edit-CGTJ3HAR.mjs} +10 -10
- package/dist/{shipping-option-type-list-F4FRLW3P.mjs → shipping-option-type-list-3TLR4QZF.mjs} +11 -11
- package/dist/{shipping-profile-metadata-AZXPMPHG.mjs → shipping-profile-metadata-JSRQPOAD.mjs} +10 -10
- package/dist/{store-detail-AKRR64I6.mjs → store-detail-H53F5ESM.mjs} +10 -10
- package/dist/{store-edit-Q25HCMCQ.mjs → store-edit-3XS6IC2Z.mjs} +1 -1
- package/dist/{store-metadata-VLEDLAIJ.mjs → store-metadata-GHSJRHAV.mjs} +10 -10
- package/dist/{tax-region-create-JTM53LCS.mjs → tax-region-create-HYT3EOQO.mjs} +11 -11
- package/dist/{tax-region-detail-XBFYCVSH.mjs → tax-region-detail-TQS5425G.mjs} +28 -29
- package/dist/{tax-region-edit-2RRF7C7P.mjs → tax-region-edit-ZB36A456.mjs} +11 -11
- package/dist/{tax-region-province-detail-LGCYSFKE.mjs → tax-region-province-detail-CABVSQRU.mjs} +28 -29
- package/dist/{tax-region-tax-override-create-2W25EZNZ.mjs → tax-region-tax-override-create-ROK47GNE.mjs} +27 -28
- package/dist/{tax-region-tax-override-edit-ZSYNTYUG.mjs → tax-region-tax-override-edit-WRODO4LC.mjs} +26 -27
- package/dist/{user-detail-K5UMPO2L.mjs → user-detail-N6PT3KRP.mjs} +1 -1
- package/dist/{user-metadata-KOGHOQTW.mjs → user-metadata-DKZHLCPN.mjs} +10 -10
- package/dist/{workflow-execution-detail-4QAQ44YB.mjs → workflow-execution-detail-BQEMJSH6.mjs} +10 -10
- package/package.json +11 -11
- package/src/components/inputs/combobox/combobox.tsx +92 -173
- package/src/components/layout/main-layout/main-layout.tsx +4 -7
- package/src/dashboard-app/routes/get-route.map.tsx +12 -64
- package/src/hooks/api/index.ts +0 -1
- package/src/hooks/api/price-lists.tsx +32 -1
- package/src/hooks/api/products.tsx +66 -26
- package/src/hooks/table/filters/index.ts +0 -1
- package/src/i18n/translations/$schema.json +4 -172
- package/src/i18n/translations/en.json +3 -49
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +28 -3
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-item.tsx +29 -4
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-item.tsx +23 -4
- package/src/routes/orders/order-detail/constants.ts +1 -0
- package/src/routes/orders/order-list/const.ts +1 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-general-section/price-list-general-section.tsx +10 -4
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-count-cell.tsx +19 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-columns.tsx +5 -6
- package/src/routes/price-lists/price-list-prices-add/price-list-prices-add.tsx +4 -1
- package/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +3 -1
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +4 -16
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +198 -220
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +7 -4
- package/src/routes/products/product-create/constants.ts +0 -2
- package/src/routes/products/product-create/utils.ts +1 -6
- package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +122 -0
- package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +1 -0
- package/src/routes/products/product-create-option/index.ts +1 -0
- package/src/routes/products/product-create-option/product-create-option.tsx +26 -0
- package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +49 -31
- package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +123 -0
- package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +1 -0
- package/src/routes/products/product-edit-option/index.ts +1 -0
- package/src/routes/products/product-edit-option/product-edit-option.tsx +32 -0
- package/dist/chunk-ZHH3W7CN.mjs +0 -171
- package/dist/product-option-create-ML66ZKF3.mjs +0 -336
- package/dist/product-option-detail-DT7HJF5Q.mjs +0 -322
- package/dist/product-option-edit-GUKWRQQH.mjs +0 -324
- package/dist/product-option-list-KF3JSQ6Y.mjs +0 -262
- package/dist/product-option-metadata-BWWRRSAW.mjs +0 -71
- package/dist/product-options-manage-QYWBIHJA.mjs +0 -304
- package/src/hooks/api/product-options.tsx +0 -151
- package/src/hooks/table/columns/use-product-option-table-columns.tsx +0 -44
- package/src/hooks/table/filters/use-product-option-table-filters.tsx +0 -33
- package/src/hooks/table/query/use-product-option-table-query.tsx +0 -34
- package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +0 -41
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +0 -71
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +0 -192
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +0 -77
- package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +0 -1
- package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +0 -15
- package/src/routes/product-options/product-option-create/index.ts +0 -1
- package/src/routes/product-options/product-option-create/product-option-create.tsx +0 -10
- package/src/routes/product-options/product-option-detail/breadcrumb.tsx +0 -14
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +0 -1
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +0 -81
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +0 -1
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +0 -74
- package/src/routes/product-options/product-option-detail/index.ts +0 -3
- package/src/routes/product-options/product-option-detail/loader.ts +0 -17
- package/src/routes/product-options/product-option-detail/product-option-detail.tsx +0 -50
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +0 -94
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +0 -116
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +0 -77
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +0 -1
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +0 -13
- package/src/routes/product-options/product-option-edit/index.ts +0 -1
- package/src/routes/product-options/product-option-edit/product-option-edit.tsx +0 -34
- package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +0 -1
- package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +0 -131
- package/src/routes/product-options/product-option-list/index.ts +0 -1
- package/src/routes/product-options/product-option-list/product-option-list.tsx +0 -19
- package/src/routes/product-options/product-option-metadata/index.ts +0 -1
- package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +0 -27
- package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +0 -1
- package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +0 -284
- package/src/routes/products/product-options-manage/index.ts +0 -1
- package/src/routes/products/product-options-manage/product-options-manage.tsx +0 -35
- package/dist/{chunk-2QH2TBJ2.mjs → chunk-ACJ3PPQJ.mjs} +3 -3
- package/dist/{customer-group-add-customers-2Y2GVCDV.mjs → customer-group-add-customers-QU4Q56SS.mjs} +3 -3
- package/dist/{customer-list-TG4D4QOT.mjs → customer-list-ZXCGIXJC.mjs} +3 -3
- package/dist/{location-list-ZJMZZ6T3.mjs → location-list-OYBI7EGV.mjs} +1 -1
- package/dist/{product-type-list-7WQ5D2KV.mjs → product-type-list-QX7QC6RI.mjs} +3 -3
- package/dist/{region-list-JAQXIBYD.mjs → region-list-XQRIBDMF.mjs} +3 -3
- package/dist/{return-reason-list-ATE2XU4H.mjs → return-reason-list-VYLLXDG4.mjs} +3 -3
- package/dist/{user-list-KPI3BTOA.mjs → user-list-6KATHOTJ.mjs} +3 -3
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Combobox
|
|
3
|
-
} from "./chunk-5AM254NB.mjs";
|
|
4
|
-
import "./chunk-IUCDCPJU.mjs";
|
|
5
|
-
import {
|
|
6
|
-
KeyboundForm
|
|
7
|
-
} from "./chunk-6HTZNHPT.mjs";
|
|
8
|
-
import {
|
|
9
|
-
RouteDrawer,
|
|
10
|
-
useRouteModal
|
|
11
|
-
} from "./chunk-AERWK3TJ.mjs";
|
|
12
|
-
import {
|
|
13
|
-
PRODUCT_DETAIL_FIELDS
|
|
14
|
-
} from "./chunk-QPJUVTKW.mjs";
|
|
15
|
-
import {
|
|
16
|
-
useExtendableForm
|
|
17
|
-
} from "./chunk-YVQIO3JS.mjs";
|
|
18
|
-
import "./chunk-2SSUH2HJ.mjs";
|
|
19
|
-
import "./chunk-ONB3JEHR.mjs";
|
|
20
|
-
import "./chunk-YCDDT44O.mjs";
|
|
21
|
-
import "./chunk-4GQOUCX6.mjs";
|
|
22
|
-
import "./chunk-RYJ2UVJE.mjs";
|
|
23
|
-
import "./chunk-D3YQN7HV.mjs";
|
|
24
|
-
import "./chunk-PMA2D6IL.mjs";
|
|
25
|
-
import "./chunk-MNXC6Q4F.mjs";
|
|
26
|
-
import "./chunk-DG7J63J2.mjs";
|
|
27
|
-
import "./chunk-M32MJOJN.mjs";
|
|
28
|
-
import {
|
|
29
|
-
useExtension
|
|
30
|
-
} from "./chunk-C5P5PL3E.mjs";
|
|
31
|
-
import "./chunk-LPEUYMRK.mjs";
|
|
32
|
-
import "./chunk-ZCARHA6C.mjs";
|
|
33
|
-
import "./chunk-OZPB6JBL.mjs";
|
|
34
|
-
import "./chunk-OC7BQLYI.mjs";
|
|
35
|
-
import "./chunk-S4DMV3ZT.mjs";
|
|
36
|
-
import "./chunk-SUYYSKCB.mjs";
|
|
37
|
-
import {
|
|
38
|
-
Form
|
|
39
|
-
} from "./chunk-OBQI23QM.mjs";
|
|
40
|
-
import "./chunk-ZOJRDXH3.mjs";
|
|
41
|
-
import "./chunk-I4OBEAOJ.mjs";
|
|
42
|
-
import "./chunk-YGEJFHC3.mjs";
|
|
43
|
-
import "./chunk-HI6URQ7H.mjs";
|
|
44
|
-
import "./chunk-6CLQKVAU.mjs";
|
|
45
|
-
import "./chunk-KI7TOXBR.mjs";
|
|
46
|
-
import "./chunk-HKIF5HVL.mjs";
|
|
47
|
-
import "./chunk-WAXMT4IY.mjs";
|
|
48
|
-
import "./chunk-DYDGGABK.mjs";
|
|
49
|
-
import "./chunk-LGNTHZ5Y.mjs";
|
|
50
|
-
import "./chunk-CN7JXSGW.mjs";
|
|
51
|
-
import "./chunk-5BQQRHQS.mjs";
|
|
52
|
-
import "./chunk-7H6DB666.mjs";
|
|
53
|
-
import "./chunk-2WLOIS3L.mjs";
|
|
54
|
-
import "./chunk-5AFMB7XQ.mjs";
|
|
55
|
-
import "./chunk-A63RZVX6.mjs";
|
|
56
|
-
import "./chunk-HBXV7ENS.mjs";
|
|
57
|
-
import "./chunk-CDORR33H.mjs";
|
|
58
|
-
import "./chunk-VW34SZWE.mjs";
|
|
59
|
-
import "./chunk-MOGV3UZD.mjs";
|
|
60
|
-
import "./chunk-5N33TBBX.mjs";
|
|
61
|
-
import "./chunk-FNQ227BC.mjs";
|
|
62
|
-
import "./chunk-3BF5SC66.mjs";
|
|
63
|
-
import "./chunk-VCSSQVPD.mjs";
|
|
64
|
-
import "./chunk-HP2JH45P.mjs";
|
|
65
|
-
import "./chunk-SQDIZZDW.mjs";
|
|
66
|
-
import {
|
|
67
|
-
useLinkProductOptions,
|
|
68
|
-
useProduct,
|
|
69
|
-
useProductOptions
|
|
70
|
-
} from "./chunk-QW4SQVMT.mjs";
|
|
71
|
-
import "./chunk-FXYH54JP.mjs";
|
|
72
|
-
import "./chunk-774WSTCC.mjs";
|
|
73
|
-
import "./chunk-NFEK63OE.mjs";
|
|
74
|
-
import "./chunk-QZ7TP4HQ.mjs";
|
|
75
|
-
|
|
76
|
-
// src/routes/products/product-options-manage/product-options-manage.tsx
|
|
77
|
-
import { Heading } from "@medusajs/ui";
|
|
78
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
79
|
-
import { useParams } from "react-router-dom";
|
|
80
|
-
|
|
81
|
-
// src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx
|
|
82
|
-
import { Button, Hint, Label, toast } from "@medusajs/ui";
|
|
83
|
-
import { useMemo, useState } from "react";
|
|
84
|
-
import { useTranslation } from "react-i18next";
|
|
85
|
-
import * as zod from "zod";
|
|
86
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
87
|
-
var ProductOptionsManageSchema = zod.object({
|
|
88
|
-
option_ids: zod.array(zod.string()),
|
|
89
|
-
option_values: zod.record(zod.array(zod.string())).optional()
|
|
90
|
-
});
|
|
91
|
-
var ProductOptionsManageForm = ({
|
|
92
|
-
product
|
|
93
|
-
}) => {
|
|
94
|
-
const { t } = useTranslation();
|
|
95
|
-
const { handleSuccess } = useRouteModal();
|
|
96
|
-
const { getFormConfigs } = useExtension();
|
|
97
|
-
const configs = getFormConfigs("product", "edit");
|
|
98
|
-
const { product_options = [], isLoading } = useProductOptions({
|
|
99
|
-
is_exclusive: false
|
|
100
|
-
});
|
|
101
|
-
const productOptionChoices = useMemo(() => {
|
|
102
|
-
return product_options.map((option) => ({
|
|
103
|
-
value: option.id,
|
|
104
|
-
label: option.title
|
|
105
|
-
}));
|
|
106
|
-
}, [product_options]);
|
|
107
|
-
const [selectedOptionIds, setSelectedOptionIds] = useState(
|
|
108
|
-
product.options?.map((opt) => opt.id) || []
|
|
109
|
-
);
|
|
110
|
-
const [selectedOptionValues, setSelectedOptionValues] = useState(() => {
|
|
111
|
-
const initialValues = {};
|
|
112
|
-
product.options?.forEach((opt) => {
|
|
113
|
-
initialValues[opt.id] = opt.values?.map((v) => v.id) || [];
|
|
114
|
-
});
|
|
115
|
-
return initialValues;
|
|
116
|
-
});
|
|
117
|
-
const form = useExtendableForm({
|
|
118
|
-
defaultValues: {
|
|
119
|
-
option_ids: product.options?.map((opt) => opt.id) || [],
|
|
120
|
-
option_values: (() => {
|
|
121
|
-
const initialValues = {};
|
|
122
|
-
product.options?.forEach((opt) => {
|
|
123
|
-
initialValues[opt.id] = opt.values?.map((v) => v.id) || [];
|
|
124
|
-
});
|
|
125
|
-
return initialValues;
|
|
126
|
-
})()
|
|
127
|
-
},
|
|
128
|
-
schema: ProductOptionsManageSchema,
|
|
129
|
-
configs,
|
|
130
|
-
data: product
|
|
131
|
-
});
|
|
132
|
-
const { mutateAsync, isPending } = useLinkProductOptions(product.id);
|
|
133
|
-
const handleProductOptionSelect = (optionIds) => {
|
|
134
|
-
setSelectedOptionIds(optionIds);
|
|
135
|
-
form.setValue("option_ids", optionIds);
|
|
136
|
-
const newSelectedValues = {};
|
|
137
|
-
const selectedProductOptions = product_options.filter(
|
|
138
|
-
(option) => optionIds.includes(option.id)
|
|
139
|
-
);
|
|
140
|
-
selectedProductOptions.forEach((option) => {
|
|
141
|
-
if (selectedOptionValues[option.id]) {
|
|
142
|
-
newSelectedValues[option.id] = selectedOptionValues[option.id];
|
|
143
|
-
} else {
|
|
144
|
-
newSelectedValues[option.id] = option.values?.map((v) => v.id) || [];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
setSelectedOptionValues(newSelectedValues);
|
|
148
|
-
form.setValue("option_values", newSelectedValues);
|
|
149
|
-
};
|
|
150
|
-
const handleValueChange = (optionId, valueIds) => {
|
|
151
|
-
if (valueIds.length === 0) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const updatedSelectedValues = {
|
|
155
|
-
...selectedOptionValues,
|
|
156
|
-
[optionId]: valueIds
|
|
157
|
-
};
|
|
158
|
-
setSelectedOptionValues(updatedSelectedValues);
|
|
159
|
-
form.setValue("option_values", updatedSelectedValues);
|
|
160
|
-
};
|
|
161
|
-
const handleSubmit = form.handleSubmit(async (data) => {
|
|
162
|
-
const currentOptionIds = product.options?.map((opt) => opt.id) || [];
|
|
163
|
-
const newOptionIds = data.option_ids;
|
|
164
|
-
const optionsToAdd = [];
|
|
165
|
-
const optionsToRemove = [];
|
|
166
|
-
for (const currentId of currentOptionIds) {
|
|
167
|
-
if (!newOptionIds.includes(currentId)) {
|
|
168
|
-
optionsToRemove.push(currentId);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
for (const newId of newOptionIds) {
|
|
172
|
-
const isNewOption = !currentOptionIds.includes(newId);
|
|
173
|
-
if (isNewOption) {
|
|
174
|
-
optionsToAdd.push(
|
|
175
|
-
data.option_values ? {
|
|
176
|
-
id: newId,
|
|
177
|
-
value_ids: data.option_values[newId]
|
|
178
|
-
} : newId
|
|
179
|
-
);
|
|
180
|
-
} else {
|
|
181
|
-
const currentOption = product.options?.find((opt) => opt.id === newId);
|
|
182
|
-
const currentValueIds = currentOption?.values?.map((v) => v.id).sort() || [];
|
|
183
|
-
const newValueIds = [...data.option_values?.[newId] || []].sort();
|
|
184
|
-
const valuesChanged = currentValueIds.length !== newValueIds.length || currentValueIds.some((id, index) => id !== newValueIds[index]);
|
|
185
|
-
if (valuesChanged) {
|
|
186
|
-
optionsToRemove.push(newId);
|
|
187
|
-
optionsToAdd.push(
|
|
188
|
-
data.option_values ? {
|
|
189
|
-
id: newId,
|
|
190
|
-
value_ids: data.option_values[newId]
|
|
191
|
-
} : newId
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
await mutateAsync(
|
|
197
|
-
{
|
|
198
|
-
add: optionsToAdd,
|
|
199
|
-
remove: optionsToRemove
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
onSuccess: ({ product: product2 }) => {
|
|
203
|
-
toast.success(
|
|
204
|
-
t("products.organization.edit.toasts.success", {
|
|
205
|
-
title: product2.title
|
|
206
|
-
})
|
|
207
|
-
);
|
|
208
|
-
handleSuccess();
|
|
209
|
-
},
|
|
210
|
-
onError: (error) => {
|
|
211
|
-
toast.error(error.message);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
);
|
|
215
|
-
});
|
|
216
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex h-full flex-col", children: [
|
|
217
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col gap-y-4", children: [
|
|
218
|
-
/* @__PURE__ */ jsx(
|
|
219
|
-
Form.Field,
|
|
220
|
-
{
|
|
221
|
-
control: form.control,
|
|
222
|
-
name: "option_ids",
|
|
223
|
-
render: ({ field }) => {
|
|
224
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
225
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("products.options.manage.label") }),
|
|
226
|
-
/* @__PURE__ */ jsx(Form.Hint, { children: t("products.options.manage.hint") }),
|
|
227
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
228
|
-
Combobox,
|
|
229
|
-
{
|
|
230
|
-
...field,
|
|
231
|
-
value: selectedOptionIds,
|
|
232
|
-
onChange: (value) => handleProductOptionSelect(value),
|
|
233
|
-
options: productOptionChoices,
|
|
234
|
-
placeholder: t("products.options.manage.placeholder"),
|
|
235
|
-
disabled: isLoading,
|
|
236
|
-
displayMode: "chips"
|
|
237
|
-
}
|
|
238
|
-
) }),
|
|
239
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
240
|
-
] });
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
selectedOptionIds.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
245
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
246
|
-
/* @__PURE__ */ jsx(Label, { weight: "plus", children: t("fields.values") }),
|
|
247
|
-
/* @__PURE__ */ jsx(Hint, { children: t("products.create.variants.selectValuesHint") })
|
|
248
|
-
] }),
|
|
249
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-3", children: product_options.filter((option) => selectedOptionIds.includes(option.id)).map((option) => {
|
|
250
|
-
const valueOptions = option.values?.sort((a, b) => {
|
|
251
|
-
const rankA = a.rank ?? Number.MAX_VALUE;
|
|
252
|
-
const rankB = b.rank ?? Number.MAX_VALUE;
|
|
253
|
-
return rankA - rankB;
|
|
254
|
-
}).map((v) => ({
|
|
255
|
-
value: v.id,
|
|
256
|
-
label: v.value
|
|
257
|
-
})) || [];
|
|
258
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-2", children: [
|
|
259
|
-
/* @__PURE__ */ jsx(Label, { size: "small", weight: "plus", children: option.title }),
|
|
260
|
-
/* @__PURE__ */ jsx(
|
|
261
|
-
Combobox,
|
|
262
|
-
{
|
|
263
|
-
value: selectedOptionValues[option.id] || [],
|
|
264
|
-
onChange: (value) => handleValueChange(option.id, value),
|
|
265
|
-
options: valueOptions,
|
|
266
|
-
placeholder: t(
|
|
267
|
-
"products.fields.options.variantionsPlaceholder"
|
|
268
|
-
),
|
|
269
|
-
displayMode: "chips"
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
] }, option.id);
|
|
273
|
-
}) })
|
|
274
|
-
] })
|
|
275
|
-
] }) }),
|
|
276
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
277
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
278
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
|
279
|
-
] }) })
|
|
280
|
-
] }) });
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
// src/routes/products/product-options-manage/product-options-manage.tsx
|
|
284
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
285
|
-
var ProductOptionsManage = () => {
|
|
286
|
-
const { id } = useParams();
|
|
287
|
-
const { t } = useTranslation2();
|
|
288
|
-
const { product, isLoading, isError, error } = useProduct(id, {
|
|
289
|
-
fields: PRODUCT_DETAIL_FIELDS
|
|
290
|
-
});
|
|
291
|
-
if (isError) {
|
|
292
|
-
throw error;
|
|
293
|
-
}
|
|
294
|
-
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
295
|
-
/* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
|
|
296
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("products.options.manage.header") }) }),
|
|
297
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("products.options.manage.description") })
|
|
298
|
-
] }),
|
|
299
|
-
!isLoading && product && /* @__PURE__ */ jsx2(ProductOptionsManageForm, { product })
|
|
300
|
-
] });
|
|
301
|
-
};
|
|
302
|
-
export {
|
|
303
|
-
ProductOptionsManage as Component
|
|
304
|
-
};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { FetchError } from "@medusajs/js-sdk"
|
|
2
|
-
import {
|
|
3
|
-
QueryKey,
|
|
4
|
-
useMutation,
|
|
5
|
-
UseMutationOptions,
|
|
6
|
-
useQuery,
|
|
7
|
-
UseQueryOptions,
|
|
8
|
-
} from "@tanstack/react-query"
|
|
9
|
-
import { sdk } from "../../lib/client"
|
|
10
|
-
import { queryKeysFactory } from "../../lib/query-key-factory"
|
|
11
|
-
import { HttpTypes } from "@medusajs/types"
|
|
12
|
-
import { queryClient } from "../../lib/query-client.ts"
|
|
13
|
-
|
|
14
|
-
const PRODUCT_OPTIONS_QUERY_KEY = "product_options" as const
|
|
15
|
-
export const productOptionsQueryKeys = queryKeysFactory(
|
|
16
|
-
PRODUCT_OPTIONS_QUERY_KEY
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
export const useProductOption = (
|
|
20
|
-
id: string,
|
|
21
|
-
query?: HttpTypes.AdminProductOptionParams,
|
|
22
|
-
options?: Omit<
|
|
23
|
-
UseQueryOptions<
|
|
24
|
-
HttpTypes.AdminProductOptionResponse,
|
|
25
|
-
FetchError,
|
|
26
|
-
HttpTypes.AdminProductOptionResponse,
|
|
27
|
-
QueryKey
|
|
28
|
-
>,
|
|
29
|
-
"queryFn" | "queryKey"
|
|
30
|
-
>
|
|
31
|
-
) => {
|
|
32
|
-
const { data, ...rest } = useQuery({
|
|
33
|
-
queryKey: productOptionsQueryKeys.detail(id, query),
|
|
34
|
-
queryFn: () => sdk.admin.productOption.retrieve(id, query),
|
|
35
|
-
...options,
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
return { ...data, ...rest }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const useProductOptions = (
|
|
42
|
-
query?: HttpTypes.AdminProductOptionListParams,
|
|
43
|
-
options?: Omit<
|
|
44
|
-
UseQueryOptions<
|
|
45
|
-
HttpTypes.AdminProductOptionListResponse,
|
|
46
|
-
FetchError,
|
|
47
|
-
HttpTypes.AdminProductOptionListResponse,
|
|
48
|
-
QueryKey
|
|
49
|
-
>,
|
|
50
|
-
"queryFn" | "queryKey"
|
|
51
|
-
>
|
|
52
|
-
) => {
|
|
53
|
-
const { data, ...rest } = useQuery({
|
|
54
|
-
queryFn: () => sdk.admin.productOption.list(query),
|
|
55
|
-
queryKey: productOptionsQueryKeys.list(query),
|
|
56
|
-
...options,
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
return { ...data, ...rest }
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const useCreateProductOption = (
|
|
63
|
-
options?: UseMutationOptions<
|
|
64
|
-
HttpTypes.AdminProductOptionResponse,
|
|
65
|
-
FetchError,
|
|
66
|
-
HttpTypes.AdminCreateProductOption
|
|
67
|
-
>
|
|
68
|
-
) => {
|
|
69
|
-
return useMutation({
|
|
70
|
-
mutationFn: (payload) => sdk.admin.productOption.create(payload),
|
|
71
|
-
onSuccess: (data, variables, context) => {
|
|
72
|
-
queryClient.invalidateQueries({
|
|
73
|
-
queryKey: productOptionsQueryKeys.lists(),
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
options?.onSuccess?.(data, variables, context)
|
|
77
|
-
},
|
|
78
|
-
...options,
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export const useUpdateProductOption = (
|
|
83
|
-
id: string,
|
|
84
|
-
options?: UseMutationOptions<
|
|
85
|
-
HttpTypes.AdminProductOptionResponse,
|
|
86
|
-
FetchError,
|
|
87
|
-
HttpTypes.AdminUpdateProductOption
|
|
88
|
-
>
|
|
89
|
-
) => {
|
|
90
|
-
return useMutation({
|
|
91
|
-
mutationFn: (payload) => sdk.admin.productOption.update(id, payload),
|
|
92
|
-
onSuccess: (data, variables, context) => {
|
|
93
|
-
queryClient.invalidateQueries({
|
|
94
|
-
queryKey: productOptionsQueryKeys.lists(),
|
|
95
|
-
})
|
|
96
|
-
queryClient.invalidateQueries({
|
|
97
|
-
queryKey: productOptionsQueryKeys.detail(id),
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
options?.onSuccess?.(data, variables, context)
|
|
101
|
-
},
|
|
102
|
-
...options,
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export const useDeleteProductOption = (
|
|
107
|
-
id: string,
|
|
108
|
-
options?: UseMutationOptions<
|
|
109
|
-
HttpTypes.AdminProductOptionDeleteResponse,
|
|
110
|
-
FetchError,
|
|
111
|
-
void
|
|
112
|
-
>
|
|
113
|
-
) => {
|
|
114
|
-
return useMutation({
|
|
115
|
-
mutationFn: () => sdk.admin.productOption.delete(id),
|
|
116
|
-
onSuccess: (data, variables, context) => {
|
|
117
|
-
queryClient.invalidateQueries({
|
|
118
|
-
queryKey: productOptionsQueryKeys.lists(),
|
|
119
|
-
})
|
|
120
|
-
queryClient.invalidateQueries({
|
|
121
|
-
queryKey: productOptionsQueryKeys.detail(id),
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
options?.onSuccess?.(data, variables, context)
|
|
125
|
-
},
|
|
126
|
-
...options,
|
|
127
|
-
})
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export const useDeleteProductOptionLazy = (
|
|
131
|
-
options?: UseMutationOptions<
|
|
132
|
-
HttpTypes.AdminProductOptionDeleteResponse,
|
|
133
|
-
FetchError,
|
|
134
|
-
string
|
|
135
|
-
>
|
|
136
|
-
) => {
|
|
137
|
-
return useMutation({
|
|
138
|
-
mutationFn: (id: string) => sdk.admin.productOption.delete(id),
|
|
139
|
-
onSuccess: (data, variables, context) => {
|
|
140
|
-
queryClient.invalidateQueries({
|
|
141
|
-
queryKey: productOptionsQueryKeys.lists(),
|
|
142
|
-
})
|
|
143
|
-
queryClient.invalidateQueries({
|
|
144
|
-
queryKey: productOptionsQueryKeys.details(),
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
options?.onSuccess?.(data, variables, context)
|
|
148
|
-
},
|
|
149
|
-
...options,
|
|
150
|
-
})
|
|
151
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createColumnHelper } from "@tanstack/react-table"
|
|
2
|
-
import { useMemo } from "react"
|
|
3
|
-
import { useTranslation } from "react-i18next"
|
|
4
|
-
import { TextCell } from "../../../components/table/table-cells/common/text-cell"
|
|
5
|
-
import { HttpTypes } from "@medusajs/types"
|
|
6
|
-
import { Badge } from "@medusajs/ui"
|
|
7
|
-
|
|
8
|
-
const columnHelper = createColumnHelper<HttpTypes.AdminProductOption>()
|
|
9
|
-
|
|
10
|
-
export const useProductOptionTableColumns = () => {
|
|
11
|
-
const { t } = useTranslation()
|
|
12
|
-
|
|
13
|
-
return useMemo(
|
|
14
|
-
() => [
|
|
15
|
-
columnHelper.accessor("title", {
|
|
16
|
-
header: t("fields.title"),
|
|
17
|
-
cell: ({ getValue }) => <TextCell text={getValue()} />,
|
|
18
|
-
}),
|
|
19
|
-
columnHelper.accessor("values", {
|
|
20
|
-
header: t("fields.values"),
|
|
21
|
-
cell: ({ getValue }) => {
|
|
22
|
-
const values = getValue()
|
|
23
|
-
const count = values?.length || 0
|
|
24
|
-
const displayText =
|
|
25
|
-
count > 0 ? `${count} ${count === 1 ? "value" : "values"}` : "-"
|
|
26
|
-
|
|
27
|
-
return <TextCell text={displayText} />
|
|
28
|
-
},
|
|
29
|
-
}),
|
|
30
|
-
columnHelper.accessor("is_exclusive", {
|
|
31
|
-
header: t("fields.status"),
|
|
32
|
-
cell: ({ getValue }) => {
|
|
33
|
-
const isExclusive = getValue()
|
|
34
|
-
return (
|
|
35
|
-
<Badge size="xsmall" color={isExclusive ? "grey" : "blue"}>
|
|
36
|
-
{t(`general.${isExclusive ? "exclusive" : "global"}`)}
|
|
37
|
-
</Badge>
|
|
38
|
-
)
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
],
|
|
42
|
-
[t]
|
|
43
|
-
)
|
|
44
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from "react-i18next"
|
|
2
|
-
import { createDataTableFilterHelper } from "@medusajs/ui"
|
|
3
|
-
import { HttpTypes } from "@medusajs/types"
|
|
4
|
-
import { useDataTableDateFilters } from "../../../components/data-table/helpers/general/use-data-table-date-filters.tsx"
|
|
5
|
-
import { useMemo } from "react"
|
|
6
|
-
|
|
7
|
-
const filterHelper = createDataTableFilterHelper<HttpTypes.AdminProductOption>()
|
|
8
|
-
|
|
9
|
-
export const useProductOptionTableFilters = () => {
|
|
10
|
-
const { t } = useTranslation()
|
|
11
|
-
const dateFilters = useDataTableDateFilters()
|
|
12
|
-
|
|
13
|
-
return useMemo(
|
|
14
|
-
() => [
|
|
15
|
-
filterHelper.accessor("is_exclusive", {
|
|
16
|
-
label: t("fields.type"),
|
|
17
|
-
type: "radio",
|
|
18
|
-
options: [
|
|
19
|
-
{
|
|
20
|
-
label: t("general.exclusive"),
|
|
21
|
-
value: "true",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: t("general.global"),
|
|
25
|
-
value: "false",
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
}),
|
|
29
|
-
...dateFilters,
|
|
30
|
-
],
|
|
31
|
-
[dateFilters, t]
|
|
32
|
-
)
|
|
33
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { HttpTypes } from "@medusajs/types"
|
|
2
|
-
import { useQueryParams } from "../../use-query-params"
|
|
3
|
-
|
|
4
|
-
type UseProductOptionTableQueryProps = {
|
|
5
|
-
prefix?: string
|
|
6
|
-
pageSize?: number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const useProductOptionTableQuery = ({
|
|
10
|
-
prefix,
|
|
11
|
-
pageSize = 20,
|
|
12
|
-
}: UseProductOptionTableQueryProps) => {
|
|
13
|
-
const queryObject = useQueryParams(
|
|
14
|
-
["offset", "q", "order", "created_at", "updated_at", "is_exclusive"],
|
|
15
|
-
prefix
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
const { offset, created_at, updated_at, q, order, is_exclusive } = queryObject
|
|
19
|
-
|
|
20
|
-
const searchParams: HttpTypes.AdminProductOptionListParams = {
|
|
21
|
-
limit: pageSize,
|
|
22
|
-
offset: offset ? Number(offset) : 0,
|
|
23
|
-
order,
|
|
24
|
-
created_at: created_at ? JSON.parse(created_at) : undefined,
|
|
25
|
-
updated_at: updated_at ? JSON.parse(updated_at) : undefined,
|
|
26
|
-
is_exclusive: is_exclusive === "true" ? true : is_exclusive === "false" ? false : undefined,
|
|
27
|
-
q,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
searchParams,
|
|
32
|
-
raw: queryObject,
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useNavigate } from "react-router-dom"
|
|
2
|
-
import { toast, usePrompt } from "@medusajs/ui"
|
|
3
|
-
import { useTranslation } from "react-i18next"
|
|
4
|
-
import { useDeleteProductOption } from "../../../../hooks/api"
|
|
5
|
-
import { HttpTypes } from "@medusajs/types"
|
|
6
|
-
|
|
7
|
-
export const useDeleteProductOptionAction = ({
|
|
8
|
-
id,
|
|
9
|
-
title,
|
|
10
|
-
}: HttpTypes.AdminProductOption) => {
|
|
11
|
-
const { t } = useTranslation()
|
|
12
|
-
const prompt = usePrompt()
|
|
13
|
-
const navigate = useNavigate()
|
|
14
|
-
|
|
15
|
-
const { mutateAsync } = useDeleteProductOption(id)
|
|
16
|
-
|
|
17
|
-
return async () => {
|
|
18
|
-
const result = await prompt({
|
|
19
|
-
title: t("general.areYouSure"),
|
|
20
|
-
description: t("productOptions.delete.confirmation", { title }),
|
|
21
|
-
confirmText: t("actions.delete"),
|
|
22
|
-
cancelText: t("actions.cancel"),
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
if (!result) {
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
await mutateAsync(undefined, {
|
|
30
|
-
onSuccess: () => {
|
|
31
|
-
navigate("/product-options", {
|
|
32
|
-
replace: true,
|
|
33
|
-
})
|
|
34
|
-
toast.success(t("productOptions.delete.successToast", { title }))
|
|
35
|
-
},
|
|
36
|
-
onError: (e) => {
|
|
37
|
-
toast.error(e.message)
|
|
38
|
-
},
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Heading, Input, Text } from "@medusajs/ui"
|
|
2
|
-
import { UseFormReturn } from "react-hook-form"
|
|
3
|
-
import { useTranslation } from "react-i18next"
|
|
4
|
-
|
|
5
|
-
import { Form } from "../../../../../components/common/form"
|
|
6
|
-
import { ChipInput } from "../../../../../components/inputs/chip-input"
|
|
7
|
-
import { CreateProductOptionSchema } from "./schema"
|
|
8
|
-
|
|
9
|
-
type CreateProductOptionDetailsProps = {
|
|
10
|
-
form: UseFormReturn<CreateProductOptionSchema>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const CreateProductOptionDetails = ({
|
|
14
|
-
form,
|
|
15
|
-
}: CreateProductOptionDetailsProps) => {
|
|
16
|
-
const { t } = useTranslation()
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="flex flex-col items-center p-16">
|
|
20
|
-
<div className="flex w-full max-w-[720px] flex-col gap-y-8">
|
|
21
|
-
<div>
|
|
22
|
-
<Heading>{t("productOptions.create.header")}</Heading>
|
|
23
|
-
<Text size="small" className="text-ui-fg-subtle">
|
|
24
|
-
{t("productOptions.create.hint")}
|
|
25
|
-
</Text>
|
|
26
|
-
</div>
|
|
27
|
-
<Form.Field
|
|
28
|
-
control={form.control}
|
|
29
|
-
name="title"
|
|
30
|
-
render={({ field }) => {
|
|
31
|
-
return (
|
|
32
|
-
<Form.Item>
|
|
33
|
-
<Form.Label>
|
|
34
|
-
{t("productOptions.fields.title.label")}
|
|
35
|
-
</Form.Label>
|
|
36
|
-
<Form.Control>
|
|
37
|
-
<Input
|
|
38
|
-
autoComplete="off"
|
|
39
|
-
{...field}
|
|
40
|
-
placeholder={t("productOptions.fields.title.placeholder")}
|
|
41
|
-
/>
|
|
42
|
-
</Form.Control>
|
|
43
|
-
<Form.ErrorMessage />
|
|
44
|
-
</Form.Item>
|
|
45
|
-
)
|
|
46
|
-
}}
|
|
47
|
-
/>
|
|
48
|
-
<Form.Field
|
|
49
|
-
control={form.control}
|
|
50
|
-
name="values"
|
|
51
|
-
render={({ field }) => {
|
|
52
|
-
return (
|
|
53
|
-
<Form.Item>
|
|
54
|
-
<Form.Label>
|
|
55
|
-
{t("productOptions.fields.values.label")}
|
|
56
|
-
</Form.Label>
|
|
57
|
-
<Form.Control>
|
|
58
|
-
<ChipInput
|
|
59
|
-
{...field}
|
|
60
|
-
placeholder={t("productOptions.fields.values.placeholder")}
|
|
61
|
-
/>
|
|
62
|
-
</Form.Control>
|
|
63
|
-
<Form.ErrorMessage />
|
|
64
|
-
</Form.Item>
|
|
65
|
-
)
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
)
|
|
71
|
-
}
|