@medusajs/dashboard 2.22.0 → 2.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-campaign-promotions-VGH4LCDR.mjs → add-campaign-promotions-IUQHZ5QA.mjs} +1 -1
- package/dist/{add-locales-3OTB5FQM.mjs → add-locales-FQQ5W3MB.mjs} +2 -2
- package/dist/{adjust-inventory-UPEEXXFU.mjs → adjust-inventory-DJFQZTLA.mjs} +1 -1
- package/dist/{api-key-management-create-ROQ6LKUO.mjs → api-key-management-create-7T2MCQ3T.mjs} +1 -1
- package/dist/{api-key-management-detail-PPQ6XGZ4.mjs → api-key-management-detail-X3AUNHCO.mjs} +9 -8
- package/dist/{api-key-management-edit-QGKZADJX.mjs → api-key-management-edit-S3GYYNWM.mjs} +1 -1
- package/dist/{api-key-management-list-OCQN2VOQ.mjs → api-key-management-list-WHT7LED5.mjs} +8 -7
- package/dist/{api-key-management-sales-channels-4NTNDHYS.mjs → api-key-management-sales-channels-3WYYKLST.mjs} +1 -1
- package/dist/app.js +13056 -12895
- package/dist/app.mjs +6 -6
- package/dist/{campaign-budget-edit-U6ZGFZCN.mjs → campaign-budget-edit-MVPC66RJ.mjs} +2 -2
- package/dist/{campaign-configuration-SESM5XWE.mjs → campaign-configuration-LTA6NKGQ.mjs} +1 -1
- package/dist/{campaign-create-KUN2YHP2.mjs → campaign-create-XZ3ZCDTE.mjs} +4 -4
- package/dist/{campaign-detail-EW4RJY64.mjs → campaign-detail-ILZA4DJG.mjs} +9 -8
- package/dist/{campaign-edit-TPU6ACYT.mjs → campaign-edit-V7KUN7M5.mjs} +1 -1
- package/dist/{campaign-list-ZGAMG2HJ.mjs → campaign-list-TPH4BBDI.mjs} +8 -7
- package/dist/{categories-metadata-3IX3Y7NM.mjs → categories-metadata-H3TZ7ZC7.mjs} +2 -2
- package/dist/{category-create-NMOUVBVL.mjs → category-create-AKYJLVJ2.mjs} +1 -1
- package/dist/{category-detail-ZIEUC7DM.mjs → category-detail-I6RNSMTN.mjs} +8 -7
- package/dist/{category-edit-HXRXUXIX.mjs → category-edit-PS34TOQX.mjs} +1 -1
- package/dist/{category-products-5GM6K37K.mjs → category-products-6DCNKT6C.mjs} +1 -1
- package/dist/{chunk-QQOHHUDU.mjs → chunk-23BHNQ2L.mjs} +2 -2
- package/dist/chunk-25A53KSK.mjs +156 -0
- package/dist/{chunk-SWN424AE.mjs → chunk-2XG5UPAM.mjs} +3 -3
- package/dist/{chunk-ZCERNCOX.mjs → chunk-34AF5R5P.mjs} +193 -193
- package/dist/{chunk-SOUK6BUQ.mjs → chunk-3M5AAW4J.mjs} +4 -4
- package/dist/{chunk-NANNVVYP.mjs → chunk-4KQBZRB4.mjs} +1 -1
- package/dist/{chunk-JLY6YSEE.mjs → chunk-7FR6ZF6H.mjs} +18 -181
- package/dist/{chunk-JNIMWJV2.mjs → chunk-AFAE54E2.mjs} +2 -2
- package/dist/{chunk-6HTZNHPT.mjs → chunk-B3R53QK3.mjs} +1 -1
- package/dist/{chunk-7ZGGLSE2.mjs → chunk-BXF2VPJX.mjs} +1 -1
- package/dist/{chunk-C36TGGI7.mjs → chunk-DBSNE3L2.mjs} +2 -2
- package/dist/{chunk-DJF6GPIA.mjs → chunk-DOJWUV5E.mjs} +1 -1
- package/dist/{chunk-L6OMZR2J.mjs → chunk-EBK5S7WC.mjs} +1 -1
- package/dist/chunk-HGXZ5BJO.mjs +153 -0
- package/dist/{chunk-WCLL7RVP.mjs → chunk-JPXF73N2.mjs} +1 -1
- package/dist/{chunk-G6CQOB4G.mjs → chunk-JZXJXG3V.mjs} +1 -1
- package/dist/{chunk-AKDC6BWT.mjs → chunk-M7FQTSDS.mjs} +2 -2
- package/dist/{chunk-3UMI3ISU.mjs → chunk-PRJK2BND.mjs} +41 -0
- package/dist/{chunk-LT7MP5JO.mjs → chunk-QFE4OVWT.mjs} +1 -1
- package/dist/{chunk-HZXJDVPI.mjs → chunk-QIK2SODO.mjs} +1 -1
- package/dist/{chunk-6MTTMX7E.mjs → chunk-QW3P2QHZ.mjs} +1 -1
- package/dist/{chunk-UHB4DWUF.mjs → chunk-R2A5UDCT.mjs} +1 -1
- package/dist/{chunk-ZH57KBU7.mjs → chunk-RDBROTJE.mjs} +6 -0
- package/dist/{chunk-Y5ZQ26VN.mjs → chunk-V3TXAU2Y.mjs} +1 -1
- package/dist/{chunk-3NS4FYII.mjs → chunk-VJIURRDA.mjs} +3 -3
- package/dist/{chunk-7QQQEODJ.mjs → chunk-WHWDHRC2.mjs} +1 -1
- package/dist/{chunk-O6JNJQ4K.mjs → chunk-Y2CXBS7S.mjs} +1 -1
- package/dist/{chunk-ZNSPQGIO.mjs → chunk-Z4CMG3I4.mjs} +1 -1
- package/dist/{collection-add-products-JZIEEVAD.mjs → collection-add-products-VHX3EDMB.mjs} +1 -1
- package/dist/{collection-create-ZGCQ3UZ4.mjs → collection-create-BIMST735.mjs} +1 -1
- package/dist/{collection-detail-STCDEYFR.mjs → collection-detail-7SG445Z7.mjs} +8 -7
- package/dist/{collection-edit-Q6UBZJBA.mjs → collection-edit-7E6KSC2T.mjs} +1 -1
- package/dist/{collection-list-7Q74YH4K.mjs → collection-list-4DQ3KSL6.mjs} +8 -7
- package/dist/{collection-metadata-G7HJW3YY.mjs → collection-metadata-CE5JGMBU.mjs} +2 -2
- package/dist/components.js +303 -294
- package/dist/components.mjs +10 -9
- package/dist/{customer-create-5OKTED3S.mjs → customer-create-DUJEC4OL.mjs} +1 -1
- package/dist/{customer-create-address-DXGXL3AR.mjs → customer-create-address-WB6EQTF7.mjs} +1 -1
- package/dist/{customer-detail-VDUTRECH.mjs → customer-detail-OCGWUEAC.mjs} +9 -8
- package/dist/{customer-edit-FCJB2CR3.mjs → customer-edit-45JRYR7C.mjs} +1 -1
- package/dist/{customer-export-CBHVVHT7.mjs → customer-export-SJ7TPUYZ.mjs} +1 -1
- package/dist/{customer-group-add-customers-2MXCI4AU.mjs → customer-group-add-customers-2LO4JWCL.mjs} +1 -1
- package/dist/{customer-group-create-UWEI2IIX.mjs → customer-group-create-46IX5XKC.mjs} +1 -1
- package/dist/{customer-group-detail-537L3QCV.mjs → customer-group-detail-YF4N3ZJQ.mjs} +8 -7
- package/dist/{customer-group-edit-OVOHPO3H.mjs → customer-group-edit-AE5DT44M.mjs} +1 -1
- package/dist/{customer-group-list-KTNZYQTD.mjs → customer-group-list-3ESALQFX.mjs} +8 -7
- package/dist/{customer-group-metadata-5FBOQTIC.mjs → customer-group-metadata-6VTJ63KW.mjs} +2 -2
- package/dist/{customer-list-F7FBYGDK.mjs → customer-list-6QEB7GKU.mjs} +8 -7
- package/dist/{customer-metadata-4AX44PFG.mjs → customer-metadata-MWH222DL.mjs} +2 -2
- package/dist/{customers-add-customer-group-V6FHGHBA.mjs → customers-add-customer-group-K4URSJBC.mjs} +1 -1
- package/dist/{edit-inventory-item-FIAC6T5S.mjs → edit-inventory-item-SIBKLOQ5.mjs} +1 -1
- package/dist/{edit-inventory-item-attributes-32SIJNVQ.mjs → edit-inventory-item-attributes-FX3YWI36.mjs} +1 -1
- package/dist/{edit-reservation-LKXCTILV.mjs → edit-reservation-E6WLT7GE.mjs} +1 -1
- package/dist/{edit-rules-P2W5U34C.mjs → edit-rules-VDWS7LUQ.mjs} +1 -1
- package/dist/{inventory-create-GZQWBRNZ.mjs → inventory-create-XQ6JNL34.mjs} +3 -3
- package/dist/{inventory-list-TNCHH5AH.mjs → inventory-list-XDAGS3IC.mjs} +8 -7
- package/dist/{inventory-metadata-WFC6F5S4.mjs → inventory-metadata-J5VYM2KL.mjs} +2 -2
- package/dist/{inventory-stock-ALPB5DHU.mjs → inventory-stock-OTM7XOOH.mjs} +4 -4
- package/dist/lib.js +6 -0
- package/dist/lib.mjs +5 -5
- package/dist/{location-create-W3N4OIRN.mjs → location-create-65BKVUH7.mjs} +1 -1
- package/dist/{location-edit-WR3GUO2A.mjs → location-edit-XWALWBUW.mjs} +1 -1
- package/dist/{location-fulfillment-providers-IPV42XHK.mjs → location-fulfillment-providers-KSYCKAE3.mjs} +1 -1
- package/dist/{location-list-WX3A2AFK.mjs → location-list-3YQAKOXL.mjs} +8 -7
- package/dist/{location-metadata-H6KEPDM6.mjs → location-metadata-AL6Y2C5Z.mjs} +2 -2
- package/dist/{location-sales-channels-Z4KJ6TA7.mjs → location-sales-channels-P2EKHRGZ.mjs} +1 -1
- package/dist/{location-service-zone-create-LPN2I2A6.mjs → location-service-zone-create-L7MUFXZ7.mjs} +1 -1
- package/dist/{location-service-zone-edit-J5ZQRLT6.mjs → location-service-zone-edit-EH6B7A24.mjs} +1 -1
- package/dist/{location-service-zone-manage-areas-S3D2NRGT.mjs → location-service-zone-manage-areas-SDLDMJO7.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-create-ZNL5ZAEF.mjs → location-service-zone-shipping-option-create-LOYMYV5B.mjs} +6 -6
- package/dist/{location-service-zone-shipping-option-edit-DUIVARUT.mjs → location-service-zone-shipping-option-edit-BARLZ7H6.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-pricing-ESOFTO36.mjs → location-service-zone-shipping-option-pricing-6DR7Z2W5.mjs} +6 -6
- package/dist/{order-allocate-items-WM3SQ6YO.mjs → order-allocate-items-CTQLV42Q.mjs} +1 -1
- package/dist/{order-create-claim-W2PFYFZZ.mjs → order-create-claim-P5WL2XWX.mjs} +5 -5
- package/dist/{order-create-edit-V52ZDF54.mjs → order-create-edit-7NCWX6UB.mjs} +4 -4
- package/dist/{order-create-exchange-5U3ULMBH.mjs → order-create-exchange-MU566SDR.mjs} +5 -5
- package/dist/{order-create-fulfillment-CT5XV576.mjs → order-create-fulfillment-57GSNWKY.mjs} +1 -1
- package/dist/{order-create-refund-VUOUFSMS.mjs → order-create-refund-SZT2AGMZ.mjs} +3 -3
- package/dist/{order-create-return-NWPAQFIJ.mjs → order-create-return-NNDQSKD3.mjs} +5 -5
- package/dist/{order-create-shipment-FVFRAISJ.mjs → order-create-shipment-RQK7EC47.mjs} +1 -1
- package/dist/{order-detail-DMWYRRGT.mjs → order-detail-ERHRK6W3.mjs} +2 -2
- package/dist/{order-edit-billing-address-NDCMYXJ6.mjs → order-edit-billing-address-XCGDGT6L.mjs} +1 -1
- package/dist/{order-edit-email-COPXQGIB.mjs → order-edit-email-7DJEDL7L.mjs} +1 -1
- package/dist/{order-edit-shipping-address-VZKXPB2N.mjs → order-edit-shipping-address-G6UVC32Y.mjs} +1 -1
- package/dist/{order-export-KZ7DK7W7.mjs → order-export-X4GFB4OT.mjs} +1 -1
- package/dist/{order-list-NQT2DVHU.mjs → order-list-Y4KAYHDB.mjs} +9 -8
- package/dist/{order-metadata-STLSWSXP.mjs → order-metadata-LX5ZWHQF.mjs} +2 -2
- package/dist/{order-receive-return-JA3JNAHR.mjs → order-receive-return-QXVVZFHF.mjs} +3 -3
- package/dist/{order-request-transfer-ZD5KDNCB.mjs → order-request-transfer-ZEQOYAL6.mjs} +1 -1
- package/dist/{policy-list-45PG7GBA.mjs → policy-list-ENDXAWFU.mjs} +1 -1
- package/dist/{price-list-configuration-TPUOHUER.mjs → price-list-configuration-BQZRBNXQ.mjs} +1 -1
- package/dist/{price-list-create-QPBMO7LD.mjs → price-list-create-XN53E6RE.mjs} +6 -6
- package/dist/{price-list-detail-SM4DA6L7.mjs → price-list-detail-2R24L2L3.mjs} +8 -7
- package/dist/{price-list-edit-5E2FLEHN.mjs → price-list-edit-7EIZ3FVK.mjs} +1 -1
- package/dist/{price-list-list-V4XVXOAV.mjs → price-list-list-B3PGM3ND.mjs} +8 -7
- package/dist/{price-list-metadata-DCSZAO2C.mjs → price-list-metadata-NTJKQEOE.mjs} +2 -2
- package/dist/{price-list-prices-add-QB2QORIN.mjs → price-list-prices-add-E3O2OI7K.mjs} +6 -6
- package/dist/{price-list-prices-edit-3EWBS4PO.mjs → price-list-prices-edit-L45MXHZR.mjs} +6 -6
- package/dist/{product-attributes-VDTTOEN6.mjs → product-attributes-FXOAXOQ5.mjs} +2 -2
- package/dist/{product-create-WUZ22WMJ.mjs → product-create-3XQUET7Y.mjs} +4 -4
- package/dist/{product-create-variant-ZMBY5CDO.mjs → product-create-variant-KZAUREQY.mjs} +3 -3
- package/dist/{product-detail-Q7R6CEZD.mjs → product-detail-EFCAHRXH.mjs} +2 -2
- package/dist/{product-edit-FIAXOVZP.mjs → product-edit-YKIGN4M3.mjs} +2 -2
- package/dist/product-export-VTUEQCYE.mjs +260 -0
- package/dist/{product-image-variants-edit-6MOKSV2U.mjs → product-image-variants-edit-Y3M56B2U.mjs} +1 -1
- package/dist/{product-list-UKJVYCMV.mjs → product-list-XAW4AQNH.mjs} +32 -174
- package/dist/{product-media-72TTTVV5.mjs → product-media-HGLANNNT.mjs} +10 -6
- package/dist/{product-metadata-4KPGJ36Y.mjs → product-metadata-LTW4M2N3.mjs} +2 -2
- package/dist/{product-option-create-4C2BHWTH.mjs → product-option-create-EIKW4V3P.mjs} +1 -1
- package/dist/{product-option-detail-WQCRUROA.mjs → product-option-detail-LE44YFQQ.mjs} +9 -8
- package/dist/{product-option-edit-O354X7DK.mjs → product-option-edit-5ZP4YBAR.mjs} +1 -1
- package/dist/{product-option-list-52TQV6GJ.mjs → product-option-list-JQGZMNPD.mjs} +8 -7
- package/dist/{product-option-metadata-K5E6CV4U.mjs → product-option-metadata-2G47V6ZL.mjs} +2 -2
- package/dist/{product-option-value-metadata-QJ6D5GPI.mjs → product-option-value-metadata-PDG22GD2.mjs} +2 -2
- package/dist/{product-options-manage-H3RCESKS.mjs → product-options-manage-NXZ6CDGE.mjs} +3 -3
- package/dist/{product-organization-PAEWTW56.mjs → product-organization-K6EGAZZC.mjs} +2 -2
- package/dist/{product-prices-DK6LKOIN.mjs → product-prices-B3DJOMTS.mjs} +3 -3
- package/dist/{product-shipping-profile-CGQN7EL4.mjs → product-shipping-profile-NDMCCENZ.mjs} +1 -1
- package/dist/{product-stock-G3QGRX2B.mjs → product-stock-FNMVF2RH.mjs} +4 -4
- package/dist/{product-tag-create-QRJM6LX5.mjs → product-tag-create-HBIXYJDZ.mjs} +1 -1
- package/dist/{product-tag-detail-27XONTR7.mjs → product-tag-detail-ZSPQRFDC.mjs} +9 -8
- package/dist/{product-tag-edit-XE5MJ7M2.mjs → product-tag-edit-TO2ACUK3.mjs} +1 -1
- package/dist/{product-tag-list-FB25LCY5.mjs → product-tag-list-D5HZNBL3.mjs} +9 -8
- package/dist/{product-tag-metadata-K563ZKCO.mjs → product-tag-metadata-7P3JGVYS.mjs} +2 -2
- package/dist/{product-type-create-T36A3NSA.mjs → product-type-create-2AZKVK35.mjs} +1 -1
- package/dist/{product-type-detail-HCA2AKIV.mjs → product-type-detail-JNFFSUC2.mjs} +8 -7
- package/dist/{product-type-edit-TGVPP66B.mjs → product-type-edit-SOLNOW3Y.mjs} +1 -1
- package/dist/{product-type-list-G3ROKD3W.mjs → product-type-list-2FWI6OVE.mjs} +8 -7
- package/dist/{product-type-metadata-Q4TNWB2C.mjs → product-type-metadata-HTEP2YTQ.mjs} +2 -2
- package/dist/{product-variant-detail-IEV2JJM7.mjs → product-variant-detail-FDCRPWMV.mjs} +2 -2
- package/dist/{product-variant-edit-CVG5DWFB.mjs → product-variant-edit-Z4ELZB47.mjs} +1 -1
- package/dist/{product-variant-manage-inventory-items-GJNQW7JC.mjs → product-variant-manage-inventory-items-W3ZQDUML.mjs} +1 -1
- package/dist/{product-variant-media-XT2EQ5M2.mjs → product-variant-media-JARM7GQW.mjs} +1 -1
- package/dist/{product-variant-metadata-YXMJ3XTG.mjs → product-variant-metadata-LP3RK7D3.mjs} +2 -2
- package/dist/{profile-edit-L3F567PF.mjs → profile-edit-S4F52I66.mjs} +1 -1
- package/dist/{promotion-add-campaign-5Q7YXHM3.mjs → promotion-add-campaign-MFC6I5JW.mjs} +4 -4
- package/dist/{promotion-create-G5A3CLSU.mjs → promotion-create-USUUTWHS.mjs} +5 -5
- package/dist/{promotion-edit-details-7BKQR36L.mjs → promotion-edit-details-3INVCAPZ.mjs} +2 -2
- package/dist/{promotion-list-F4UKF55J.mjs → promotion-list-SRJ6MO3U.mjs} +9 -8
- package/dist/{promotion-metadata-CFGQFARL.mjs → promotion-metadata-QNNWNI6S.mjs} +2 -2
- package/dist/{property-labels-WALH2AGU.mjs → property-labels-4PJQJXTH.mjs} +5 -5
- package/dist/{property-labels-edit-WOGYPDDG.mjs → property-labels-edit-5QFRPGAO.mjs} +3 -3
- package/dist/{refund-reason-create-PY3Z64HW.mjs → refund-reason-create-QXHOKWDZ.mjs} +1 -1
- package/dist/{refund-reason-edit-UYQP4C6W.mjs → refund-reason-edit-RQFGSNGN.mjs} +1 -1
- package/dist/{refund-reason-list-SM5XTUD5.mjs → refund-reason-list-RKULHAWA.mjs} +9 -8
- package/dist/{region-add-countries-ICNGZMFP.mjs → region-add-countries-L3LBC5SS.mjs} +1 -1
- package/dist/{region-create-VWAGH4BK.mjs → region-create-IISVSM64.mjs} +2 -2
- package/dist/{region-detail-IXDWO6A6.mjs → region-detail-L3YT7CAJ.mjs} +1 -1
- package/dist/{region-edit-LDKU5GRF.mjs → region-edit-6TJFOZ6L.mjs} +2 -2
- package/dist/{region-list-P5BUNYLG.mjs → region-list-UOWKWKH3.mjs} +8 -7
- package/dist/{region-metadata-QNHAH2KJ.mjs → region-metadata-2GTR2Q4K.mjs} +2 -2
- package/dist/{reservation-create-OFCQFQAO.mjs → reservation-create-TJPEHJO4.mjs} +1 -1
- package/dist/{reservation-list-7R3KIRZM.mjs → reservation-list-3IBGFDFV.mjs} +8 -7
- package/dist/{reservation-metadata-W4CVXJXT.mjs → reservation-metadata-H6XWWZ7O.mjs} +2 -2
- package/dist/{return-reason-create-NNPGF6E6.mjs → return-reason-create-GLORKWFC.mjs} +1 -1
- package/dist/{return-reason-edit-BMSZB2JK.mjs → return-reason-edit-G2KHDOVU.mjs} +1 -1
- package/dist/{return-reason-list-IIKH6WL6.mjs → return-reason-list-2NBTNAH3.mjs} +9 -8
- package/dist/{role-add-users-UIEDW5HE.mjs → role-add-users-O7CTRYF2.mjs} +1 -1
- package/dist/{role-create-M3Y7KHT5.mjs → role-create-J5TXRN2A.mjs} +1 -1
- package/dist/{role-edit-76JHBTDL.mjs → role-edit-6CTPHWGH.mjs} +1 -1
- package/dist/{role-permissions-7D7D37MZ.mjs → role-permissions-F6WANR5D.mjs} +1 -1
- package/dist/{sales-channel-add-products-OUWMFPUM.mjs → sales-channel-add-products-S7NJUD3G.mjs} +1 -1
- package/dist/{sales-channel-create-YMFBTQTV.mjs → sales-channel-create-YDM7SRWK.mjs} +1 -1
- package/dist/{sales-channel-edit-CQOUQ4HC.mjs → sales-channel-edit-BPTKLMWV.mjs} +1 -1
- package/dist/{sales-channel-list-26DGOXPN.mjs → sales-channel-list-P7JPONDZ.mjs} +9 -8
- package/dist/{sales-channel-metadata-DYXIDARU.mjs → sales-channel-metadata-R36JO2U7.mjs} +2 -2
- package/dist/{search-index-list-UMBYJEE2.mjs → search-index-list-UUJXL4UL.mjs} +1 -1
- package/dist/{settings-NUX5MO5M.mjs → settings-L3FQOPX3.mjs} +1 -1
- package/dist/{shipping-option-type-create-E3U6A5AP.mjs → shipping-option-type-create-O62NAECA.mjs} +1 -1
- package/dist/{shipping-option-type-edit-AWLY6VGH.mjs → shipping-option-type-edit-NZQQSODS.mjs} +1 -1
- package/dist/{shipping-option-type-list-IS33BXIS.mjs → shipping-option-type-list-MZGGUXYT.mjs} +8 -7
- package/dist/{shipping-profile-create-Q4MANTUB.mjs → shipping-profile-create-WPLVLDXG.mjs} +1 -1
- package/dist/{shipping-profile-metadata-3E3MFK6S.mjs → shipping-profile-metadata-IEQP6IVY.mjs} +2 -2
- package/dist/{shipping-profiles-list-R2OKGF64.mjs → shipping-profiles-list-3TNRV7U4.mjs} +8 -7
- package/dist/{store-add-currencies-PM37F2M6.mjs → store-add-currencies-HBAN3GWA.mjs} +1 -1
- package/dist/{store-add-locales-TF4A4LOI.mjs → store-add-locales-VJWN65EE.mjs} +2 -2
- package/dist/{store-edit-BUNHDYE2.mjs → store-edit-SKGGBBFN.mjs} +1 -1
- package/dist/{store-metadata-XQI3KTO6.mjs → store-metadata-4P3U6G7J.mjs} +2 -2
- package/dist/{tax-region-create-HESVWGCI.mjs → tax-region-create-AI2IQGAX.mjs} +1 -1
- package/dist/{tax-region-detail-4N5VVAA3.mjs → tax-region-detail-OOB7SOFT.mjs} +10 -10
- package/dist/{tax-region-edit-T534TZN6.mjs → tax-region-edit-AAVTEU6A.mjs} +1 -1
- package/dist/{tax-region-province-create-PM3ZTK5Q.mjs → tax-region-province-create-UDBHBE66.mjs} +1 -1
- package/dist/{tax-region-province-detail-LP6LQFU3.mjs → tax-region-province-detail-RW6ORJ3I.mjs} +10 -10
- package/dist/{tax-region-tax-override-create-EOSGUTGM.mjs → tax-region-tax-override-create-7BXNHR5F.mjs} +8 -8
- package/dist/{tax-region-tax-override-edit-RFHZPX7T.mjs → tax-region-tax-override-edit-VTP7B3W3.mjs} +9 -9
- package/dist/{tax-region-tax-rate-create-23WNEWRS.mjs → tax-region-tax-rate-create-4MNRDQMB.mjs} +1 -1
- package/dist/{tax-region-tax-rate-edit-II6LQJU7.mjs → tax-region-tax-rate-edit-EQEPSONV.mjs} +1 -1
- package/dist/{translations-edit-IGHIRXSY.mjs → translations-edit-3264U52X.mjs} +3 -3
- package/dist/{user-edit-QAGGKUD5.mjs → user-edit-UYE4NST2.mjs} +1 -1
- package/dist/{user-invite-DDESHVJK.mjs → user-invite-RLAG4P4K.mjs} +1 -1
- package/dist/{user-list-KIRMDCPZ.mjs → user-list-GN3FM5YA.mjs} +8 -7
- package/dist/{user-metadata-FIHOQQBD.mjs → user-metadata-BVIBE7ID.mjs} +2 -2
- package/package.json +9 -9
- package/src/__tests__/vite-config.spec.ts +46 -0
- package/src/components/table/configurable-data-table/configurable-data-table.tsx +1 -27
- package/src/components/utilities/keybound-form/__tests__/keybound-form.spec.ts +65 -0
- package/src/components/utilities/keybound-form/keybound-form.tsx +3 -1
- package/src/hooks/table/query/index.ts +1 -0
- package/src/hooks/table/query/parse-prefixed-query-params.ts +64 -0
- package/src/hooks/table/use-column-filters.tsx +44 -0
- package/src/hooks/table/use-table-configuration.tsx +3 -34
- package/src/lib/data/currencies.ts +6 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-inbound-item.tsx +2 -1
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-item.tsx +2 -1
- package/src/routes/orders/order-create-return/components/return-create-form/return-item.tsx +2 -1
- package/src/routes/products/product-export/components/configurable-export-filters.spec.tsx +69 -0
- package/src/routes/products/product-export/components/configurable-export-filters.tsx +104 -0
- package/src/routes/products/product-export/components/export-filters.tsx +14 -2
- package/src/routes/products/product-export/product-export.spec.tsx +131 -0
- package/src/routes/products/product-export/product-export.tsx +24 -4
- package/src/routes/products/product-media/components/edit-product-media-form/edit-product-media-form.spec.tsx +164 -0
- package/src/routes/products/product-media/components/edit-product-media-form/edit-product-media-form.tsx +13 -9
- package/dist/product-export-FVEBRZUJ.mjs +0 -138
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLocaleAmount
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JPXF73N2.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DataGridCellContainer,
|
|
6
6
|
useCombinedRefs,
|
|
7
7
|
useDataGridCell,
|
|
8
8
|
useDataGridCellError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QIK2SODO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
KeyboundForm
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-B3R53QK3.mjs";
|
|
13
13
|
import {
|
|
14
14
|
currencies
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RDBROTJE.mjs";
|
|
16
16
|
import {
|
|
17
17
|
StackedFocusModal
|
|
18
18
|
} from "./chunk-M6QL27ZL.mjs";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
useColumnFilters
|
|
3
|
+
} from "./chunk-HGXZ5BJO.mjs";
|
|
4
|
+
import {
|
|
5
|
+
expandDottedKeys,
|
|
2
6
|
parseFilterParam
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PRJK2BND.mjs";
|
|
4
8
|
import {
|
|
5
9
|
createActionsColumn,
|
|
6
10
|
createSelectColumn
|
|
@@ -9,7 +13,7 @@ import {
|
|
|
9
13
|
calculateRequiredFields,
|
|
10
14
|
getCellRenderer,
|
|
11
15
|
getColumnValue
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EBK5S7WC.mjs";
|
|
13
17
|
import {
|
|
14
18
|
DataTable,
|
|
15
19
|
SaveViewDialog,
|
|
@@ -25,12 +29,9 @@ import {
|
|
|
25
29
|
import {
|
|
26
30
|
useEntityColumns
|
|
27
31
|
} from "./chunk-ACQJSQ5A.mjs";
|
|
28
|
-
import {
|
|
29
|
-
sdk
|
|
30
|
-
} from "./chunk-NFEK63OE.mjs";
|
|
31
32
|
|
|
32
33
|
// src/components/table/configurable-data-table/configurable-data-table.tsx
|
|
33
|
-
import { useMemo as
|
|
34
|
+
import { useMemo as useMemo4, useState as useState3 } from "react";
|
|
34
35
|
import { Container, Button as Button2 } from "@medusajs/ui";
|
|
35
36
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
36
37
|
|
|
@@ -88,7 +89,7 @@ var SaveViewDropdown = ({
|
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
// src/hooks/table/use-table-configuration.tsx
|
|
91
|
-
import { useState as useState2, useMemo as
|
|
92
|
+
import { useState as useState2, useMemo as useMemo2, useCallback as useCallback2, useEffect as useEffect2 } from "react";
|
|
92
93
|
import { useSearchParams } from "react-router-dom";
|
|
93
94
|
|
|
94
95
|
// src/hooks/table/columns/use-column-state.ts
|
|
@@ -221,131 +222,6 @@ function getInitialColumnOrder(apiColumns) {
|
|
|
221
222
|
return sortedColumns.map((col) => col.field);
|
|
222
223
|
}
|
|
223
224
|
|
|
224
|
-
// src/lib/table/filter-utils.ts
|
|
225
|
-
import { createDataTableFilterHelper } from "@medusajs/ui";
|
|
226
|
-
var filterHelper = createDataTableFilterHelper();
|
|
227
|
-
function getFilterType(column) {
|
|
228
|
-
if (column.filter?.relationship || column.data_type === "enum" || column.filter?.enumValues) {
|
|
229
|
-
return "multiselect";
|
|
230
|
-
}
|
|
231
|
-
if (column.data_type === "date") {
|
|
232
|
-
return "date";
|
|
233
|
-
}
|
|
234
|
-
if (column.data_type === "boolean") {
|
|
235
|
-
return "radio";
|
|
236
|
-
}
|
|
237
|
-
if (column.data_type === "number" || column.data_type === "currency") {
|
|
238
|
-
return "number";
|
|
239
|
-
}
|
|
240
|
-
if (column.data_type === "string") {
|
|
241
|
-
return "string";
|
|
242
|
-
}
|
|
243
|
-
return "custom";
|
|
244
|
-
}
|
|
245
|
-
function generateFiltersFromColumns(apiColumns, relationshipOptions) {
|
|
246
|
-
const filters = [];
|
|
247
|
-
const filterableColumns = apiColumns.filter(
|
|
248
|
-
(col) => col.filter?.enabled === true
|
|
249
|
-
);
|
|
250
|
-
for (const column of filterableColumns) {
|
|
251
|
-
const filterType = getFilterType(column);
|
|
252
|
-
const filterConfig = {
|
|
253
|
-
label: column.name,
|
|
254
|
-
type: filterType
|
|
255
|
-
};
|
|
256
|
-
if (column.filter?.enumValues) {
|
|
257
|
-
filterConfig.options = column.filter.enumValues.map((value) => ({
|
|
258
|
-
label: value,
|
|
259
|
-
value
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
if (column.data_type === "boolean") {
|
|
263
|
-
filterConfig.options = [
|
|
264
|
-
{ label: "True", value: "true" },
|
|
265
|
-
{ label: "False", value: "false" }
|
|
266
|
-
];
|
|
267
|
-
}
|
|
268
|
-
if (column.filter?.relationship) {
|
|
269
|
-
const options = relationshipOptions?.[column.field];
|
|
270
|
-
if (options) {
|
|
271
|
-
filterConfig.options = options;
|
|
272
|
-
filterConfig.searchable = true;
|
|
273
|
-
} else {
|
|
274
|
-
filterConfig.type = "string";
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
if (filterType === "number") {
|
|
278
|
-
filterConfig.includeOperators = true;
|
|
279
|
-
}
|
|
280
|
-
if (filterType === "date") {
|
|
281
|
-
filterConfig.options = [];
|
|
282
|
-
}
|
|
283
|
-
const filterKey = column.filter?.relationship?.filter_key || column.field;
|
|
284
|
-
filters.push(filterHelper.accessor(filterKey, filterConfig));
|
|
285
|
-
}
|
|
286
|
-
return filters;
|
|
287
|
-
}
|
|
288
|
-
function getRelationshipFilterConfigs(apiColumns) {
|
|
289
|
-
return apiColumns.filter((col) => col.filter?.enabled && col.filter.relationship).map((col) => ({
|
|
290
|
-
field: col.field,
|
|
291
|
-
config: col.filter.relationship
|
|
292
|
-
}));
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// src/hooks/table/use-relationship-filter-options.tsx
|
|
296
|
-
import { useMemo as useMemo2 } from "react";
|
|
297
|
-
import { useQueries } from "@tanstack/react-query";
|
|
298
|
-
function useRelationshipFilterOptions(configs) {
|
|
299
|
-
const queries = useQueries({
|
|
300
|
-
queries: configs.map((config) => ({
|
|
301
|
-
queryKey: ["relationship-filter-options", config.config.endpoint],
|
|
302
|
-
queryFn: async () => {
|
|
303
|
-
const response = await sdk.client.fetch(
|
|
304
|
-
config.config.endpoint,
|
|
305
|
-
{
|
|
306
|
-
method: "GET",
|
|
307
|
-
query: {
|
|
308
|
-
fields: `${config.config.value_field},${config.config.display_field}`,
|
|
309
|
-
limit: 1e3
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
);
|
|
313
|
-
const dataKey = Object.keys(response).find(
|
|
314
|
-
(key) => Array.isArray(response[key])
|
|
315
|
-
);
|
|
316
|
-
if (!dataKey) {
|
|
317
|
-
console.warn(
|
|
318
|
-
`Could not find data array in response from ${config.config.endpoint}`
|
|
319
|
-
);
|
|
320
|
-
return [];
|
|
321
|
-
}
|
|
322
|
-
const data = response[dataKey];
|
|
323
|
-
return data.map((item) => ({
|
|
324
|
-
label: item[config.config.display_field],
|
|
325
|
-
value: item[config.config.value_field]
|
|
326
|
-
}));
|
|
327
|
-
},
|
|
328
|
-
staleTime: 5 * 60 * 1e3,
|
|
329
|
-
enabled: configs.length > 0
|
|
330
|
-
}))
|
|
331
|
-
});
|
|
332
|
-
const optionsMap = useMemo2(() => {
|
|
333
|
-
const map = {};
|
|
334
|
-
configs.forEach((config, index) => {
|
|
335
|
-
const query = queries[index];
|
|
336
|
-
if (query.data) {
|
|
337
|
-
map[config.field] = query.data;
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
return map;
|
|
341
|
-
}, [configs, queries]);
|
|
342
|
-
const isLoading = queries.some((q) => q.isLoading);
|
|
343
|
-
return {
|
|
344
|
-
options: optionsMap,
|
|
345
|
-
isLoading
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
|
|
349
225
|
// src/hooks/table/use-table-configuration.tsx
|
|
350
226
|
function parseSortingState(value) {
|
|
351
227
|
return value.startsWith("-") ? { id: value.slice(1), desc: true } : { id: value, desc: false };
|
|
@@ -381,39 +257,19 @@ function useTableConfiguration({
|
|
|
381
257
|
const { columns: rawApiColumns, isLoading: isLoadingColumns } = useEntityColumns(entity, {
|
|
382
258
|
enabled: isViewConfigEnabled
|
|
383
259
|
});
|
|
384
|
-
const apiColumns =
|
|
260
|
+
const apiColumns = useMemo2(() => {
|
|
385
261
|
if (!rawApiColumns) {
|
|
386
262
|
return void 0;
|
|
387
263
|
}
|
|
388
264
|
const transformed = transformColumns ? transformColumns(rawApiColumns) : rawApiColumns;
|
|
389
265
|
return extraColumns?.length ? [...transformed, ...extraColumns] : transformed;
|
|
390
266
|
}, [rawApiColumns, transformColumns, extraColumns]);
|
|
391
|
-
const
|
|
392
|
-
if (!apiColumns) {
|
|
393
|
-
return [];
|
|
394
|
-
}
|
|
395
|
-
const filterableColumns = apiColumns.filter(
|
|
396
|
-
(column) => column.filter?.enabled
|
|
397
|
-
);
|
|
398
|
-
return getRelationshipFilterConfigs(filterableColumns);
|
|
399
|
-
}, [apiColumns]);
|
|
400
|
-
const { options: relationshipOptions, isLoading: isLoadingFilterOptions } = useRelationshipFilterOptions(
|
|
401
|
-
relationshipFilterConfigs
|
|
402
|
-
);
|
|
403
|
-
const resolvedFilters = useMemo3(() => {
|
|
404
|
-
if (!apiColumns) {
|
|
405
|
-
return [];
|
|
406
|
-
}
|
|
407
|
-
const filterableColumns = apiColumns.filter(
|
|
408
|
-
(column) => column.filter?.enabled
|
|
409
|
-
);
|
|
410
|
-
return generateFiltersFromColumns(filterableColumns, relationshipOptions);
|
|
411
|
-
}, [apiColumns, relationshipOptions]);
|
|
267
|
+
const { filters: resolvedFilters, isLoading: isLoadingFilterOptions } = useColumnFilters(apiColumns);
|
|
412
268
|
const queryParams = useQueryParams(
|
|
413
269
|
["q", "order", "offset", "limit", ...resolvedFilters.map((f) => f.id)],
|
|
414
270
|
queryPrefix
|
|
415
271
|
);
|
|
416
|
-
const columnsToRender =
|
|
272
|
+
const columnsToRender = useMemo2(() => {
|
|
417
273
|
return apiColumns?.filter((column) => column.context !== "filter");
|
|
418
274
|
}, [apiColumns]);
|
|
419
275
|
const {
|
|
@@ -458,7 +314,7 @@ function useTableConfiguration({
|
|
|
458
314
|
return prev;
|
|
459
315
|
});
|
|
460
316
|
}, [activeViewSignature, columnsSignature]);
|
|
461
|
-
const currentConfiguration =
|
|
317
|
+
const currentConfiguration = useMemo2(() => {
|
|
462
318
|
const currentFilters = {};
|
|
463
319
|
resolvedFilters.forEach((filter) => {
|
|
464
320
|
if (queryParams[filter.id] !== void 0) {
|
|
@@ -472,7 +328,7 @@ function useTableConfiguration({
|
|
|
472
328
|
};
|
|
473
329
|
}, [resolvedFilters, queryParams]);
|
|
474
330
|
const [debouncedHasConfigChanged, setDebouncedHasConfigChanged] = useState2(false);
|
|
475
|
-
const hasConfigurationChanged =
|
|
331
|
+
const hasConfigurationChanged = useMemo2(() => {
|
|
476
332
|
const currentFilters = currentConfiguration.filters;
|
|
477
333
|
const currentSorting = currentConfiguration.sorting;
|
|
478
334
|
const currentSearch = currentConfiguration.search;
|
|
@@ -583,7 +439,7 @@ function useTableConfiguration({
|
|
|
583
439
|
return prev;
|
|
584
440
|
});
|
|
585
441
|
}, [currentActiveView, columnsToRender, queryPrefix]);
|
|
586
|
-
const requiredFields =
|
|
442
|
+
const requiredFields = useMemo2(() => {
|
|
587
443
|
return calculateRequiredFields(columnsToRender || [], visibleColumns);
|
|
588
444
|
}, [columnsToRender, visibleColumns]);
|
|
589
445
|
return {
|
|
@@ -609,14 +465,14 @@ function useTableConfiguration({
|
|
|
609
465
|
}
|
|
610
466
|
|
|
611
467
|
// src/hooks/table/columns/use-configurable-table-columns.tsx
|
|
612
|
-
import { useMemo as
|
|
468
|
+
import { useMemo as useMemo3 } from "react";
|
|
613
469
|
import { createDataTableColumnHelper } from "@medusajs/ui";
|
|
614
470
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
615
471
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
616
472
|
function useConfigurableTableColumns(apiColumns, adapter) {
|
|
617
|
-
const columnHelper =
|
|
473
|
+
const columnHelper = useMemo3(() => createDataTableColumnHelper(), []);
|
|
618
474
|
const { t } = useTranslation2();
|
|
619
|
-
return
|
|
475
|
+
return useMemo3(() => {
|
|
620
476
|
if (!apiColumns?.length) {
|
|
621
477
|
return [];
|
|
622
478
|
}
|
|
@@ -688,25 +544,6 @@ function useConfigurableTableColumns(apiColumns, adapter) {
|
|
|
688
544
|
|
|
689
545
|
// src/components/table/configurable-data-table/configurable-data-table.tsx
|
|
690
546
|
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
691
|
-
function expandDottedKeys(params) {
|
|
692
|
-
const result = {};
|
|
693
|
-
for (const [key, value] of Object.entries(params)) {
|
|
694
|
-
if (!key.includes(".")) {
|
|
695
|
-
result[key] = value;
|
|
696
|
-
continue;
|
|
697
|
-
}
|
|
698
|
-
const parts = key.split(".");
|
|
699
|
-
let node = result;
|
|
700
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
701
|
-
if (typeof node[parts[i]] !== "object" || node[parts[i]] === null) {
|
|
702
|
-
node[parts[i]] = {};
|
|
703
|
-
}
|
|
704
|
-
node = node[parts[i]];
|
|
705
|
-
}
|
|
706
|
-
node[parts[parts.length - 1]] = value;
|
|
707
|
-
}
|
|
708
|
-
return result;
|
|
709
|
-
}
|
|
710
547
|
function ConfigurableDataTable({
|
|
711
548
|
adapter,
|
|
712
549
|
heading,
|
|
@@ -727,7 +564,7 @@ function ConfigurableDataTable({
|
|
|
727
564
|
const entityName = adapter.entityName;
|
|
728
565
|
const pageSize = pageSizeProp || adapter.pageSize || 20;
|
|
729
566
|
const queryPrefix = queryPrefixProp || adapter.queryPrefix || "";
|
|
730
|
-
const extraColumns =
|
|
567
|
+
const extraColumns = useMemo4(() => {
|
|
731
568
|
const cols = [
|
|
732
569
|
adapter.enableRowSelection ? createSelectColumn() : null,
|
|
733
570
|
adapter.renderRowActions ? createActionsColumn(t("fields.actions")) : null
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DISPLAY_OVERRIDE_ITEMS_LIMIT
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M7FQTSDS.mjs";
|
|
4
4
|
import {
|
|
5
5
|
TaxRateRuleReferenceType
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JZXJXG3V.mjs";
|
|
7
7
|
import {
|
|
8
8
|
LocalizedTablePagination,
|
|
9
9
|
useDeleteTaxRateAction
|
|
@@ -8,7 +8,7 @@ var KeyboundForm = React.forwardRef(({ onSubmit, onKeyDown, ...rest }, ref) => {
|
|
|
8
8
|
};
|
|
9
9
|
const handleKeyDown = (event) => {
|
|
10
10
|
if (event.key === "Enter") {
|
|
11
|
-
if (event.target instanceof HTMLTextAreaElement && !(event.metaKey || event.ctrlKey)) {
|
|
11
|
+
if ((event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLButtonElement || event.target instanceof HTMLAnchorElement) && !(event.metaKey || event.ctrlKey)) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
event.preventDefault();
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
defineCellRenderer,
|
|
9
9
|
registerCellResolver
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EBK5S7WC.mjs";
|
|
11
11
|
|
|
12
12
|
// src/routes/promotions/promotion-list/components/promotion-list-table/promotion-list-table-renderers.tsx
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-F6ZOHZVB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CreateCampaignFormFields
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Z4CMG3I4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
KeyboundForm
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-B3R53QK3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
RouteFocusModal,
|
|
12
12
|
useRouteModal
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sdk
|
|
3
|
+
} from "./chunk-NFEK63OE.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/table/use-column-filters.tsx
|
|
6
|
+
import { useMemo as useMemo2 } from "react";
|
|
7
|
+
|
|
8
|
+
// src/lib/table/filter-utils.ts
|
|
9
|
+
import { createDataTableFilterHelper } from "@medusajs/ui";
|
|
10
|
+
var filterHelper = createDataTableFilterHelper();
|
|
11
|
+
function getFilterType(column) {
|
|
12
|
+
if (column.filter?.relationship || column.data_type === "enum" || column.filter?.enumValues) {
|
|
13
|
+
return "multiselect";
|
|
14
|
+
}
|
|
15
|
+
if (column.data_type === "date") {
|
|
16
|
+
return "date";
|
|
17
|
+
}
|
|
18
|
+
if (column.data_type === "boolean") {
|
|
19
|
+
return "radio";
|
|
20
|
+
}
|
|
21
|
+
if (column.data_type === "number" || column.data_type === "currency") {
|
|
22
|
+
return "number";
|
|
23
|
+
}
|
|
24
|
+
if (column.data_type === "string") {
|
|
25
|
+
return "string";
|
|
26
|
+
}
|
|
27
|
+
return "custom";
|
|
28
|
+
}
|
|
29
|
+
function generateFiltersFromColumns(apiColumns, relationshipOptions) {
|
|
30
|
+
const filters = [];
|
|
31
|
+
const filterableColumns = apiColumns.filter(
|
|
32
|
+
(col) => col.filter?.enabled === true
|
|
33
|
+
);
|
|
34
|
+
for (const column of filterableColumns) {
|
|
35
|
+
const filterType = getFilterType(column);
|
|
36
|
+
const filterConfig = {
|
|
37
|
+
label: column.name,
|
|
38
|
+
type: filterType
|
|
39
|
+
};
|
|
40
|
+
if (column.filter?.enumValues) {
|
|
41
|
+
filterConfig.options = column.filter.enumValues.map((value) => ({
|
|
42
|
+
label: value,
|
|
43
|
+
value
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
if (column.data_type === "boolean") {
|
|
47
|
+
filterConfig.options = [
|
|
48
|
+
{ label: "True", value: "true" },
|
|
49
|
+
{ label: "False", value: "false" }
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
if (column.filter?.relationship) {
|
|
53
|
+
const options = relationshipOptions?.[column.field];
|
|
54
|
+
if (options) {
|
|
55
|
+
filterConfig.options = options;
|
|
56
|
+
filterConfig.searchable = true;
|
|
57
|
+
} else {
|
|
58
|
+
filterConfig.type = "string";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (filterType === "number") {
|
|
62
|
+
filterConfig.includeOperators = true;
|
|
63
|
+
}
|
|
64
|
+
if (filterType === "date") {
|
|
65
|
+
filterConfig.options = [];
|
|
66
|
+
}
|
|
67
|
+
const filterKey = column.filter?.relationship?.filter_key || column.field;
|
|
68
|
+
filters.push(filterHelper.accessor(filterKey, filterConfig));
|
|
69
|
+
}
|
|
70
|
+
return filters;
|
|
71
|
+
}
|
|
72
|
+
function getRelationshipFilterConfigs(apiColumns) {
|
|
73
|
+
return apiColumns.filter((col) => col.filter?.enabled && col.filter.relationship).map((col) => ({
|
|
74
|
+
field: col.field,
|
|
75
|
+
config: col.filter.relationship
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/hooks/table/use-relationship-filter-options.tsx
|
|
80
|
+
import { useMemo } from "react";
|
|
81
|
+
import { useQueries } from "@tanstack/react-query";
|
|
82
|
+
function useRelationshipFilterOptions(configs) {
|
|
83
|
+
const queries = useQueries({
|
|
84
|
+
queries: configs.map((config) => ({
|
|
85
|
+
queryKey: ["relationship-filter-options", config.config.endpoint],
|
|
86
|
+
queryFn: async () => {
|
|
87
|
+
const response = await sdk.client.fetch(
|
|
88
|
+
config.config.endpoint,
|
|
89
|
+
{
|
|
90
|
+
method: "GET",
|
|
91
|
+
query: {
|
|
92
|
+
fields: `${config.config.value_field},${config.config.display_field}`,
|
|
93
|
+
limit: 1e3
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
const dataKey = Object.keys(response).find(
|
|
98
|
+
(key) => Array.isArray(response[key])
|
|
99
|
+
);
|
|
100
|
+
if (!dataKey) {
|
|
101
|
+
console.warn(
|
|
102
|
+
`Could not find data array in response from ${config.config.endpoint}`
|
|
103
|
+
);
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
const data = response[dataKey];
|
|
107
|
+
return data.map((item) => ({
|
|
108
|
+
label: item[config.config.display_field],
|
|
109
|
+
value: item[config.config.value_field]
|
|
110
|
+
}));
|
|
111
|
+
},
|
|
112
|
+
staleTime: 5 * 60 * 1e3,
|
|
113
|
+
enabled: configs.length > 0
|
|
114
|
+
}))
|
|
115
|
+
});
|
|
116
|
+
const optionsMap = useMemo(() => {
|
|
117
|
+
const map = {};
|
|
118
|
+
configs.forEach((config, index) => {
|
|
119
|
+
const query = queries[index];
|
|
120
|
+
if (query.data) {
|
|
121
|
+
map[config.field] = query.data;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
return map;
|
|
125
|
+
}, [configs, queries]);
|
|
126
|
+
const isLoading = queries.some((q) => q.isLoading);
|
|
127
|
+
return {
|
|
128
|
+
options: optionsMap,
|
|
129
|
+
isLoading
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// src/hooks/table/use-column-filters.tsx
|
|
134
|
+
function useColumnFilters(apiColumns) {
|
|
135
|
+
const filterableColumns = useMemo2(
|
|
136
|
+
() => apiColumns?.filter((column) => column.filter?.enabled),
|
|
137
|
+
[apiColumns]
|
|
138
|
+
);
|
|
139
|
+
const relationshipFilterConfigs = useMemo2(() => {
|
|
140
|
+
return filterableColumns ? getRelationshipFilterConfigs(filterableColumns) : [];
|
|
141
|
+
}, [filterableColumns]);
|
|
142
|
+
const { options: relationshipOptions, isLoading } = useRelationshipFilterOptions(
|
|
143
|
+
relationshipFilterConfigs
|
|
144
|
+
);
|
|
145
|
+
const filters = useMemo2(() => {
|
|
146
|
+
return filterableColumns ? generateFiltersFromColumns(filterableColumns, relationshipOptions) : [];
|
|
147
|
+
}, [filterableColumns, relationshipOptions]);
|
|
148
|
+
return { filters, isLoading };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
useColumnFilters
|
|
153
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
TargetItem,
|
|
4
4
|
TaxRateRuleReferenceSchema,
|
|
5
5
|
createTaxRulePayload
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JZXJXG3V.mjs";
|
|
7
7
|
import {
|
|
8
8
|
PercentageInput
|
|
9
9
|
} from "./chunk-677UVYOL.mjs";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-PRLQLEEQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
KeyboundForm
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-B3R53QK3.mjs";
|
|
16
16
|
import {
|
|
17
17
|
RouteDrawer,
|
|
18
18
|
StackedDrawer
|
|
@@ -19,6 +19,45 @@ function parseFilterParam(raw) {
|
|
|
19
19
|
return value;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// src/hooks/table/query/parse-prefixed-query-params.ts
|
|
23
|
+
var NON_FILTER_KEYS = ["offset", "limit", "order"];
|
|
24
|
+
function expandDottedKeys(params) {
|
|
25
|
+
const result = {};
|
|
26
|
+
for (const [key, value] of Object.entries(params)) {
|
|
27
|
+
if (!key.includes(".")) {
|
|
28
|
+
result[key] = value;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const parts = key.split(".");
|
|
32
|
+
let node = result;
|
|
33
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
34
|
+
if (typeof node[parts[i]] !== "object" || node[parts[i]] === null) {
|
|
35
|
+
node[parts[i]] = {};
|
|
36
|
+
}
|
|
37
|
+
node = node[parts[i]];
|
|
38
|
+
}
|
|
39
|
+
node[parts[parts.length - 1]] = value;
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
function parsePrefixedQueryParams(searchParams, prefix) {
|
|
44
|
+
const params = {};
|
|
45
|
+
searchParams.forEach((raw, prefixedKey) => {
|
|
46
|
+
if (!prefixedKey.startsWith(`${prefix}_`)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const key = prefixedKey.slice(prefix.length + 1);
|
|
50
|
+
if (NON_FILTER_KEYS.includes(key)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const value = key === "q" ? raw || void 0 : parseFilterParam(raw);
|
|
54
|
+
if (value !== void 0) {
|
|
55
|
+
params[key] = value;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return expandDottedKeys(params);
|
|
59
|
+
}
|
|
60
|
+
|
|
22
61
|
// src/hooks/table/query/use-order-table-query.tsx
|
|
23
62
|
var useOrderTableQuery = ({
|
|
24
63
|
prefix,
|
|
@@ -312,6 +351,8 @@ var useTaxRateTableQuery = ({
|
|
|
312
351
|
|
|
313
352
|
export {
|
|
314
353
|
parseFilterParam,
|
|
354
|
+
expandDottedKeys,
|
|
355
|
+
parsePrefixedQueryParams,
|
|
315
356
|
useCampaignTableQuery,
|
|
316
357
|
useCollectionTableQuery,
|
|
317
358
|
useOrderTableQuery,
|