@medusajs/dashboard 3.0.0-snapshot-20250410112222 → 3.0.0-snapshot-20251104011621
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-ZVOK5XD2.mjs → add-campaign-promotions-ZUJD7HBF.mjs} +14 -14
- package/dist/{adjust-inventory-WYNH75F7.mjs → adjust-inventory-7EWRE2HD.mjs} +3 -3
- package/dist/{api-key-management-create-HWBQGG6O.mjs → api-key-management-create-SPLD3JMO.mjs} +5 -5
- package/dist/{api-key-management-detail-QVWVJ5X6.mjs → api-key-management-detail-MFQTHUN6.mjs} +26 -22
- package/dist/{api-key-management-edit-UX47FHWV.mjs → api-key-management-edit-2VPL7PHB.mjs} +5 -5
- package/dist/{api-key-management-list-XQ5M7CMJ.mjs → api-key-management-list-22GXXJUC.mjs} +17 -18
- package/dist/{api-key-management-sales-channels-PILAZSU6.mjs → api-key-management-sales-channels-MV6FMA4C.mjs} +15 -11
- package/dist/app.css +347 -334
- package/dist/app.js +79816 -56782
- package/dist/app.mjs +28 -23
- package/dist/{campaign-budget-edit-57NSOYJ3.mjs → campaign-budget-edit-V2VMINUO.mjs} +4 -4
- package/dist/{campaign-configuration-QV3OHWBZ.mjs → campaign-configuration-PP4A5ADV.mjs} +3 -3
- package/dist/{campaign-create-NYJ4HILG.mjs → campaign-create-GD2D45NX.mjs} +8 -6
- package/dist/{campaign-detail-ITINMJJH.mjs → campaign-detail-IKHUALTL.mjs} +50 -44
- package/dist/{campaign-edit-3D5WFWCT.mjs → campaign-edit-O3LKMLXK.mjs} +3 -3
- package/dist/{campaign-list-SXMDW6B6.mjs → campaign-list-3452F4Y6.mjs} +17 -18
- package/dist/{categories-metadata-TE7B2OJY.mjs → categories-metadata-2HM7G27P.mjs} +18 -17
- package/dist/{category-create-NVRG7B6E.mjs → category-create-BC2VUVKO.mjs} +41 -20
- package/dist/{category-detail-WTSUKIXM.mjs → category-detail-D4PYJJGJ.mjs} +35 -35
- package/dist/{category-edit-JBZQKNL7.mjs → category-edit-U5Y5KJ2Y.mjs} +38 -18
- package/dist/{category-list-OWRWVUVN.mjs → category-list-MLLB5U6K.mjs} +13 -14
- package/dist/{category-organize-HUXXVJAB.mjs → category-organize-4NXFDN2I.mjs} +5 -6
- package/dist/{category-products-CRKFES6N.mjs → category-products-K5INZSSV.mjs} +35 -35
- package/dist/{chunk-JDZPSIIG.mjs → chunk-2D44OO7A.mjs} +1 -1
- package/dist/{chunk-FVK4ZYYM.mjs → chunk-2O43G3RH.mjs} +1 -1
- package/dist/{chunk-KERJR2T2.mjs → chunk-2WZUO66T.mjs} +1 -1
- package/dist/{chunk-GW6TVOAA.mjs → chunk-3C6WQ7NH.mjs} +21 -1
- package/dist/{chunk-ICR3D7SB.mjs → chunk-3DO2JGVG.mjs} +1 -1
- package/dist/{chunk-NOZD6HRU.mjs → chunk-3EGEJ6Q2.mjs} +3 -2
- package/dist/chunk-3I6G3NRU.mjs +44 -0
- package/dist/{chunk-LQFD6I7N.mjs → chunk-3JJBLFYN.mjs} +1 -1
- package/dist/{chunk-YIZSVS2R.mjs → chunk-3TZOFKX2.mjs} +23 -3
- package/dist/{chunk-6I62UDJA.mjs → chunk-4BGVSXZZ.mjs} +43 -22
- package/dist/{chunk-3WXBLS2P.mjs → chunk-4FM6S5CX.mjs} +2 -1
- package/dist/chunk-4XSXVVYD.mjs +18 -0
- package/dist/{chunk-6UX3SSRT.mjs → chunk-67ORSRVT.mjs} +36 -1
- package/dist/chunk-6CPMXY5N.mjs +18 -0
- package/dist/{chunk-2WQFRVK5.mjs → chunk-6IXLTZ2H.mjs} +5 -2
- package/dist/{chunk-AL4WDQTN.mjs → chunk-6VRDTPH2.mjs} +60 -50
- package/dist/{chunk-FVC7M755.mjs → chunk-6XWHQ6ON.mjs} +1 -1
- package/dist/{chunk-NGEWNLV7.mjs → chunk-7DWBXEH3.mjs} +72 -20
- package/dist/{chunk-ZCO6EK4W.mjs → chunk-AERWK3TJ.mjs} +13 -10
- package/dist/{chunk-TDDYKNA2.mjs → chunk-AHQI2S2Z.mjs} +66 -5
- package/dist/{chunk-HUGE7T5V.mjs → chunk-ALKTJGWS.mjs} +2 -2
- package/dist/chunk-AMRS4CSX.mjs +9 -0
- package/dist/{chunk-OIAPXGI2.mjs → chunk-B6ZOPCPA.mjs} +1 -1
- package/dist/chunk-BW322BVH.mjs +52 -0
- package/dist/chunk-BW4QA6B6.mjs +49 -0
- package/dist/{chunk-AQS3BSDG.mjs → chunk-CBYAN3G4.mjs} +4 -3
- package/dist/{chunk-CF64SRBE.mjs → chunk-CIY65KNH.mjs} +1 -1
- package/dist/{chunk-VDBOSWVE.mjs → chunk-DG7J63J2.mjs} +7 -7
- package/dist/{chunk-MWVM4TYO.mjs → chunk-DK4WIVY6.mjs} +18 -0
- package/dist/{chunk-THZJC662.mjs → chunk-EHAU7SOS.mjs} +10 -1
- package/dist/{chunk-DXOEDXLQ.mjs → chunk-ELPHCFRW.mjs} +13 -8
- package/dist/{chunk-TP7N4YBP.mjs → chunk-EQKJ5FSL.mjs} +1 -1
- package/dist/{chunk-7I5DQGWY.mjs → chunk-F7LJJHQT.mjs} +11 -1
- package/dist/{chunk-EUTK2A3J.mjs → chunk-FA2DYBNX.mjs} +1 -1
- package/dist/{chunk-CIE5NZAY.mjs → chunk-FKIOYL3D.mjs} +81 -13
- package/dist/{chunk-2RQLKDBF.mjs → chunk-GIZFNLKK.mjs} +103 -96
- package/dist/{chunk-ETF2DN4M.mjs → chunk-GLVCH422.mjs} +3 -3
- package/dist/chunk-GRNWRTT3.mjs +822 -0
- package/dist/{chunk-AOFGTNG6.mjs → chunk-HQKGZADC.mjs} +6 -1
- package/dist/{chunk-LBIOZZPA.mjs → chunk-HWKLNKOY.mjs} +1 -1
- package/dist/{chunk-LDJKJLBJ.mjs → chunk-I6E6CALJ.mjs} +14 -0
- package/dist/{chunk-7MM5L2ZM.mjs → chunk-IKXQEHLS.mjs} +1 -1
- package/dist/{chunk-NNBHHXXN.mjs → chunk-INE2QCSC.mjs} +1 -1
- package/dist/{chunk-7ITM2TNQ.mjs → chunk-IVZ6BMDB.mjs} +4 -3
- package/dist/{chunk-XMAWMECC.mjs → chunk-IW4TACOD.mjs} +1 -1
- package/dist/{chunk-3OHH43G6.mjs → chunk-IXZVR3HG.mjs} +1 -1
- package/dist/chunk-KEQOAJC2.mjs +108 -0
- package/dist/chunk-KX4P5L3R.mjs +127 -0
- package/dist/chunk-KXRW6JRE.mjs +354 -0
- package/dist/{chunk-W7KW2VOI.mjs → chunk-LEKWKUIS.mjs} +3 -3
- package/dist/{chunk-LTC6LGS4.mjs → chunk-LOAL44PP.mjs} +1 -1
- package/dist/chunk-MFALVTRQ.mjs +181 -0
- package/dist/{chunk-Q5DI5VYN.mjs → chunk-MLNUGLGT.mjs} +1 -1
- package/dist/{chunk-ZJ3OFMHB.mjs → chunk-MQALAB34.mjs} +1 -1
- package/dist/{chunk-F6IJV2I2.mjs → chunk-N4N4KGET.mjs} +1 -1
- package/dist/{chunk-RZD5DU5K.mjs → chunk-NDXL7ZT5.mjs} +13 -13
- package/dist/{chunk-BC3M3N6P.mjs → chunk-NQIC7ZFS.mjs} +2 -2
- package/dist/{chunk-GZBFGV7Y.mjs → chunk-OFN7DIZA.mjs} +18 -14
- package/dist/{chunk-PNU5HPGY.mjs → chunk-OGAZYXOV.mjs} +1 -1
- package/dist/{chunk-XNVMTSI7.mjs → chunk-ORMX5RJQ.mjs} +3 -3
- package/dist/{chunk-3NJTXRIY.mjs → chunk-OZPB6JBL.mjs} +5 -1
- package/dist/{chunk-FP5F2XCU.mjs → chunk-P777A4W3.mjs} +5 -5
- package/dist/{chunk-PWBTCXBJ.mjs → chunk-PFKKVLZX.mjs} +1 -1
- package/dist/{chunk-O6K7WXYN.mjs → chunk-PJ5EUKOB.mjs} +92 -43
- package/dist/chunk-PMA2D6IL.mjs +49 -0
- package/dist/{chunk-D7H6ZNK4.mjs → chunk-PRLQLEEQ.mjs} +2 -0
- package/dist/{chunk-5ZEHQCGN.mjs → chunk-PYIPIUAY.mjs} +55526 -34216
- package/dist/chunk-Q33G337Z.mjs +98 -0
- package/dist/{chunk-DGRTPKQC.mjs → chunk-QMRGIWOP.mjs} +1 -1
- package/dist/{chunk-RSYDZHZN.mjs → chunk-QXXHLVRQ.mjs} +44 -72
- package/dist/chunk-QZ7TP4HQ.mjs +7 -0
- package/dist/{chunk-G2H6MAK7.mjs → chunk-R2G2B47Y.mjs} +15 -5
- package/dist/chunk-R2QF6AQX.mjs +41 -0
- package/dist/chunk-RM6NY572.mjs +48 -0
- package/dist/{chunk-CVCFQMSO.mjs → chunk-S34JJVBQ.mjs} +58 -17
- package/dist/chunk-S4DMV3ZT.mjs +35 -0
- package/dist/{chunk-43EZDQEG.mjs → chunk-SC6BSTC7.mjs} +2 -2
- package/dist/{chunk-LU7VJVTE.mjs → chunk-SJ3E4T6B.mjs} +1 -1
- package/dist/{chunk-X2Y4KNQI.mjs → chunk-SNDSWB6B.mjs} +21 -9
- package/dist/{chunk-2MPQMCLO.mjs → chunk-TUCPFNIY.mjs} +57 -13
- package/dist/chunk-UC26CCHZ.mjs +45 -0
- package/dist/{chunk-SKR2YX52.mjs → chunk-UKX2FFFV.mjs} +2 -2
- package/dist/{chunk-6LA2RGO4.mjs → chunk-ULQ3V4CC.mjs} +2 -2
- package/dist/{chunk-UCMPRD5U.mjs → chunk-VAIHVNV6.mjs} +1 -1
- package/dist/chunk-VLOA5XAC.mjs +113 -0
- package/dist/{chunk-E46GSGZ5.mjs → chunk-VWXNC2B5.mjs} +5 -5
- package/dist/chunk-W77EPLUD.mjs +1141 -0
- package/dist/{chunk-OV5NMSY6.mjs → chunk-WATKBUHQ.mjs} +1 -1
- package/dist/{chunk-GE4APTT2.mjs → chunk-WEMXXZMY.mjs} +47 -36
- package/dist/chunk-WMOGMKQN.mjs +0 -0
- package/dist/{chunk-DRAV7IQC.mjs → chunk-WT5BXCPV.mjs} +76 -44
- package/dist/{chunk-RWU2ZKWZ.mjs → chunk-WTK7SR6S.mjs} +37 -3
- package/dist/{chunk-PDWBYQOW.mjs → chunk-X6BAAGCL.mjs} +1 -1
- package/dist/{chunk-UAZEQNCO.mjs → chunk-X6DSNTTX.mjs} +1 -1
- package/dist/{chunk-4UY4U2B5.mjs → chunk-XDCNT5GQ.mjs} +4 -6
- package/dist/{chunk-G3QXMPRB.mjs → chunk-XLDQPLK4.mjs} +8 -41
- package/dist/chunk-XWO5BP42.mjs +37 -0
- package/dist/{chunk-C2ZUHW3Z.mjs → chunk-XXROCJ7D.mjs} +191 -309
- package/dist/{chunk-YS65UGPC.mjs → chunk-XYHXWLTJ.mjs} +1 -1
- package/dist/{chunk-3XEXC5WH.mjs → chunk-Y2XQE25L.mjs} +2 -2
- package/dist/{tax-region-tax-override-edit-2T7PD6N3.mjs → chunk-YL4UEHO3.mjs} +52 -236
- package/dist/{chunk-XKXNQ2KV.mjs → chunk-ZCARHA6C.mjs} +1 -1
- package/dist/{chunk-PBEBKGPJ.mjs → chunk-ZUUKLYH4.mjs} +1 -1
- package/dist/{collection-add-products-XERJQKAX.mjs → collection-add-products-TWIDVZMU.mjs} +34 -34
- package/dist/collection-create-CUZFWEOB.mjs +132 -0
- package/dist/{collection-detail-XRN3Y3YT.mjs → collection-detail-B33WPVIW.mjs} +30 -30
- package/dist/{collection-edit-D7OGD4MC.mjs → collection-edit-22I7EEJG.mjs} +4 -4
- package/dist/{collection-list-G5PTIE4I.mjs → collection-list-DAW7WOX5.mjs} +41 -41
- package/dist/{collection-metadata-244B7424.mjs → collection-metadata-ZUFYY4OU.mjs} +18 -17
- package/dist/{customer-create-TKKVS4LF.mjs → customer-create-WCBUYT44.mjs} +2 -2
- package/dist/{customer-create-address-P4YQFUI5.mjs → customer-create-address-VWVIJDMK.mjs} +5 -4
- package/dist/{customer-detail-EW4Y5ZHT.mjs → customer-detail-ATJGSJTH.mjs} +38 -38
- package/dist/{customer-edit-I4K3LK66.mjs → customer-edit-FMK2AWZ5.mjs} +2 -2
- package/dist/{customer-group-add-customers-UJJ77G7K.mjs → customer-group-add-customers-57THRZ6D.mjs} +30 -31
- package/dist/{customer-group-create-5EILGGLH.mjs → customer-group-create-Y5O2CJOI.mjs} +2 -2
- package/dist/{customer-group-detail-WZFJPKZE.mjs → customer-group-detail-OVZIWNPP.mjs} +29 -30
- package/dist/{customer-group-edit-NBVNSBMX.mjs → customer-group-edit-SMVW7PHM.mjs} +2 -2
- package/dist/{customer-group-list-ZYLGQKOU.mjs → customer-group-list-SADXXHAE.mjs} +25 -21
- package/dist/{customer-group-metadata-IRTI56TA.mjs → customer-group-metadata-XJIMV7QU.mjs} +4 -3
- package/dist/{customer-list-3LZRV3ZM.mjs → customer-list-TE7VNBX6.mjs} +15 -16
- package/dist/{customer-metadata-TPIFKFIQ.mjs → customer-metadata-E32DPXXE.mjs} +4 -3
- package/dist/{customers-add-customer-group-F473JGOA.mjs → customers-add-customer-group-XNPZ47LK.mjs} +26 -27
- package/dist/{edit-inventory-item-KQUKSOGO.mjs → edit-inventory-item-5RPZHCM7.mjs} +3 -3
- package/dist/{edit-inventory-item-attributes-I55BRBWC.mjs → edit-inventory-item-attributes-R73ZTBYG.mjs} +6 -5
- package/dist/{edit-reservation-GEJHV6OI.mjs → edit-reservation-WMLAFMYU.mjs} +9 -4
- package/dist/{edit-rules-7MMNZKEQ.mjs → edit-rules-KV43O773.mjs} +44 -9
- package/dist/en.json +3219 -0
- package/dist/{home-KSB2J7CS.mjs → home-KFQGXKRT.mjs} +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/{inventory-create-NZ67QMNB.mjs → inventory-create-NW5WSPBV.mjs} +27 -21
- package/dist/{inventory-detail-UBCCADB3.mjs → inventory-detail-I2CNJC6Y.mjs} +188 -191
- package/dist/{inventory-list-XIL665KR.mjs → inventory-list-I7IXI4KC.mjs} +11 -12
- package/dist/{inventory-metadata-AG5IVFBR.mjs → inventory-metadata-7XR4ON7G.mjs} +18 -17
- package/dist/{inventory-stock-XZWLARFE.mjs → inventory-stock-VTIDGTOY.mjs} +20 -19
- package/dist/{invite-3KXZ7ZZI.mjs → invite-U4I4IUOM.mjs} +1 -1
- package/dist/{location-create-G3CYBYOF.mjs → location-create-GZCUNYDT.mjs} +5 -4
- package/dist/{location-detail-GHY3DXRP.mjs → location-detail-WZM4EXFM.mjs} +24 -23
- package/dist/{location-edit-IMBG32Z4.mjs → location-edit-VNEMLWGR.mjs} +5 -5
- package/dist/{location-fulfillment-providers-ELVN5G5W.mjs → location-fulfillment-providers-F7MMM5KC.mjs} +26 -27
- package/dist/location-list-W6EHBBE5.mjs +323 -0
- package/dist/{location-sales-channels-JODORWDG.mjs → location-sales-channels-J3V26P3Q.mjs} +15 -11
- package/dist/{location-service-zone-create-6DZFP7Y7.mjs → location-service-zone-create-27MNMKPQ.mjs} +10 -11
- package/dist/{location-service-zone-edit-W3G7XOC7.mjs → location-service-zone-edit-LCBBZ2OA.mjs} +2 -2
- package/dist/{location-service-zone-manage-areas-EJIOVS3U.mjs → location-service-zone-manage-areas-U3EPNWSI.mjs} +10 -11
- package/dist/{location-service-zone-shipping-option-create-7KOH5VVW.mjs → location-service-zone-shipping-option-create-F3EQW67U.mjs} +65 -30
- package/dist/location-service-zone-shipping-option-edit-27MYKN7R.mjs +356 -0
- package/dist/{location-service-zone-shipping-option-pricing-SKUSE5YE.mjs → location-service-zone-shipping-option-pricing-GJIO4RRM.mjs} +7 -6
- package/dist/{login-OYY6LIPR.mjs → login-VZALGB6R.mjs} +15 -15
- package/dist/manage-locations-ZRCDYW5V.mjs +247 -0
- package/dist/{no-match-YRNHGOT3.mjs → no-match-7QRDCDCD.mjs} +1 -1
- package/dist/{order-allocate-items-TMQ5M7TG.mjs → order-allocate-items-MZ7Y4FU4.mjs} +53 -25
- package/dist/{order-create-claim-JRJNBW7N.mjs → order-create-claim-VFFKHCI6.mjs} +93 -62
- package/dist/{order-create-edit-IYZYZOJU.mjs → order-create-edit-7TFUOMST.mjs} +35 -35
- package/dist/{order-create-exchange-SWV6T3C2.mjs → order-create-exchange-CXQ5ZM3Q.mjs} +81 -64
- package/dist/{order-create-fulfillment-62OZHL3L.mjs → order-create-fulfillment-VTICR6OE.mjs} +111 -56
- package/dist/order-create-refund-RWDVIXPV.mjs +686 -0
- package/dist/{order-create-return-CDCLNOCB.mjs → order-create-return-AYWH3WMR.mjs} +36 -30
- package/dist/{order-create-shipment-REC24C7Y.mjs → order-create-shipment-2KNYEHSU.mjs} +118 -41
- package/dist/{order-detail-RP63TRG6.mjs → order-detail-IFXJNVTV.mjs} +895 -391
- package/dist/{order-edit-billing-address-XDNORAHG.mjs → order-edit-billing-address-T6BIIRAX.mjs} +20 -19
- package/dist/{order-edit-email-V4DC4GJV.mjs → order-edit-email-SLUOGWRO.mjs} +17 -17
- package/dist/{order-edit-shipping-address-NWT5LDKC.mjs → order-edit-shipping-address-YUES5K5Q.mjs} +20 -19
- package/dist/order-list-4N3OV2PU.mjs +283 -0
- package/dist/{order-metadata-4YNV2NWH.mjs → order-metadata-HS33MC6S.mjs} +18 -17
- package/dist/{order-receive-return-AXAZNUIB.mjs → order-receive-return-E6BGSZVL.mjs} +21 -20
- package/dist/{order-request-transfer-OZNQQL3N.mjs → order-request-transfer-7IIDQ37I.mjs} +19 -19
- package/dist/{price-list-configuration-QDADAJXD.mjs → price-list-configuration-4XY4JW4I.mjs} +13 -14
- package/dist/{price-list-create-7HYQ5R7R.mjs → price-list-create-VFQVCUWV.mjs} +58 -44
- package/dist/{price-list-detail-DWUY4NRM.mjs → price-list-detail-32UKOWNW.mjs} +33 -33
- package/dist/{price-list-edit-TMZCXEFR.mjs → price-list-edit-GXDLVOU4.mjs} +53 -33
- package/dist/{price-list-list-C53HAXU7.mjs → price-list-list-TKXSU27S.mjs} +13 -14
- package/dist/{price-list-prices-add-PGOF7G5W.mjs → price-list-prices-add-AY75YZ7D.mjs} +44 -36
- package/dist/{price-list-prices-edit-JUS5FBBN.mjs → price-list-prices-edit-J7HCNDTO.mjs} +8 -7
- package/dist/{product-attributes-GKM272E2.mjs → product-attributes-3GCAY7KW.mjs} +37 -29
- package/dist/{product-create-6IIIZWTB.mjs → product-create-4TD7FQC7.mjs} +205 -179
- package/dist/{product-create-option-E2GRTBWP.mjs → product-create-option-D2636LJL.mjs} +3 -3
- package/dist/{product-create-variant-3B32EC76.mjs → product-create-variant-ZWY57BX7.mjs} +38 -25
- package/dist/{product-detail-KCPBP53S.mjs → product-detail-J7T7MNUY.mjs} +74 -64
- package/dist/{product-edit-PBISK6ZJ.mjs → product-edit-MJ7VAIVY.mjs} +50 -36
- package/dist/{product-edit-option-RHMF3YKT.mjs → product-edit-option-DYAFZIT2.mjs} +3 -3
- package/dist/{product-export-KJXAVIZ3.mjs → product-export-X64NQWTS.mjs} +47 -37
- package/dist/product-image-variants-edit-J6A5G4AC.mjs +327 -0
- package/dist/{product-import-JCEJKM3F.mjs → product-import-HDNC36SM.mjs} +25 -25
- package/dist/product-list-E7HS4SBG.mjs +445 -0
- package/dist/{product-media-34NDO6DC.mjs → product-media-Z3NNTB7H.mjs} +10 -11
- package/dist/{product-metadata-PQQ7XV63.mjs → product-metadata-LMDEXR3V.mjs} +18 -17
- package/dist/{product-organization-QZ5AXVG5.mjs → product-organization-263TICCI.mjs} +30 -27
- package/dist/{product-prices-BBTCM3XR.mjs → product-prices-MCZYVPQW.mjs} +6 -5
- package/dist/{product-sales-channels-5L64AKRQ.mjs → product-sales-channels-RHZQXWAY.mjs} +14 -10
- package/dist/{product-shipping-profile-Z2MVNVBT.mjs → product-shipping-profile-GVTR3MHD.mjs} +29 -26
- package/dist/{product-stock-TZS75EG7.mjs → product-stock-O2BH5R45.mjs} +22 -20
- package/dist/{product-tag-create-LE4MZ5BW.mjs → product-tag-create-GOJTE5XA.mjs} +16 -16
- package/dist/{product-tag-detail-LQFUS6IU.mjs → product-tag-detail-CK5F4DU3.mjs} +56 -54
- package/dist/{product-tag-edit-E6WEFNFQ.mjs → product-tag-edit-IT4GHLSO.mjs} +16 -16
- package/dist/{product-tag-list-DASW6YQO.mjs → product-tag-list-VNROS2W3.mjs} +55 -54
- package/dist/product-tag-metadata-QV2BOGP2.mjs +70 -0
- package/dist/{product-type-create-GU5IYXQB.mjs → product-type-create-AHVZETDR.mjs} +2 -2
- package/dist/{product-type-detail-VLOGXH6T.mjs → product-type-detail-7K5RLART.mjs} +30 -30
- package/dist/{product-type-edit-S53VUBU3.mjs → product-type-edit-2RGFBZPK.mjs} +2 -2
- package/dist/{product-type-list-A36X6L73.mjs → product-type-list-2ZQ2NE3R.mjs} +15 -16
- package/dist/product-type-metadata-5TDBJGNQ.mjs +70 -0
- package/dist/{product-variant-detail-HKNUYNS5.mjs → product-variant-detail-3SO2MX22.mjs} +111 -53
- package/dist/{product-variant-edit-G6AM27AT.mjs → product-variant-edit-DW27AYBX.mjs} +24 -19
- package/dist/product-variant-manage-inventory-items-T5OB3YX3.mjs +341 -0
- package/dist/product-variant-media-PHRCKUDK.mjs +374 -0
- package/dist/{product-variant-metadata-2V27ZMDS.mjs → product-variant-metadata-4KJE6B2R.mjs} +18 -17
- package/dist/{profile-detail-4HQ3RK2U.mjs → profile-detail-UTJBWZSA.mjs} +5 -4
- package/dist/{profile-edit-VZPQ4NSH.mjs → profile-edit-OOYMTKX6.mjs} +34 -22
- package/dist/{promotion-add-campaign-4VNRQF52.mjs → promotion-add-campaign-XJB2ZKZ3.mjs} +12 -24
- package/dist/{promotion-create-PLDWDZMZ.mjs → promotion-create-F27AOTVZ.mjs} +258 -93
- package/dist/{promotion-detail-DKYNPGDK.mjs → promotion-detail-ZDINJASC.mjs} +146 -87
- package/dist/promotion-edit-details-JMZ77QJ4.mjs +496 -0
- package/dist/{promotion-list-AGVOXS5Q.mjs → promotion-list-MN6YJCYA.mjs} +15 -16
- package/dist/refund-reason-create-5ATQ2IPU.mjs +192 -0
- package/dist/refund-reason-edit-F7AMOTG3.mjs +192 -0
- package/dist/refund-reason-list-SFTHVSPC.mjs +244 -0
- package/dist/{region-add-countries-DGMSV27N.mjs → region-add-countries-KGFPZSRE.mjs} +15 -15
- package/dist/{region-create-NQLVPGUT.mjs → region-create-YJJRTAYO.mjs} +62 -53
- package/dist/{region-detail-BBK4KAZ5.mjs → region-detail-ERE4ZF2I.mjs} +10 -11
- package/dist/region-edit-QCN7SMR5.mjs +308 -0
- package/dist/{region-list-F7I4UPZS.mjs → region-list-W55C3CTH.mjs} +15 -16
- package/dist/{region-metadata-4S6FEUXA.mjs → region-metadata-CRAHVHOC.mjs} +18 -17
- package/dist/{reservation-create-INUIVD55.mjs → reservation-create-YZMZ6HSS.mjs} +5 -5
- package/dist/{reservation-detail-QKUCAH7D.mjs → reservation-detail-6MCBQZAE.mjs} +19 -18
- package/dist/{reservation-list-NAYFTRNY.mjs → reservation-list-IEUC3KXK.mjs} +15 -15
- package/dist/{reservation-metadata-5ZABNMJP.mjs → reservation-metadata-IQNJPNAX.mjs} +18 -17
- package/dist/{reset-password-HHFO6CDI.mjs → reset-password-CUEG23GU.mjs} +3 -2
- package/dist/{return-reason-create-YANSYS43.mjs → return-reason-create-45IARQ5L.mjs} +2 -2
- package/dist/{return-reason-edit-4FSM4H3M.mjs → return-reason-edit-5FIOEJ5Y.mjs} +2 -2
- package/dist/{return-reason-list-YQP7NEIY.mjs → return-reason-list-CBOVMQZF.mjs} +37 -36
- package/dist/{sales-channel-add-products-ACYP5CUR.mjs → sales-channel-add-products-7RKUDBXN.mjs} +29 -29
- package/dist/{sales-channel-create-HVZPII6E.mjs → sales-channel-create-7ISLGNGC.mjs} +6 -4
- package/dist/{sales-channel-detail-UFL3EW5W.mjs → sales-channel-detail-TKVVIAS5.mjs} +30 -30
- package/dist/{sales-channel-edit-BK7O3ZFI.mjs → sales-channel-edit-2PEHGAWF.mjs} +6 -4
- package/dist/{sales-channel-list-2EDYVY5Y.mjs → sales-channel-list-SI7JVBOI.mjs} +25 -22
- package/dist/{sales-channel-metadata-UH4QYASI.mjs → sales-channel-metadata-ZOCPAIGM.mjs} +18 -17
- package/dist/{settings-FQUPXMWF.mjs → settings-FKUZ6EYT.mjs} +1 -1
- package/dist/shipping-option-type-create-YR2QV2OG.mjs +195 -0
- package/dist/shipping-option-type-detail-TYHGCV2X.mjs +178 -0
- package/dist/shipping-option-type-edit-6KL3MHVT.mjs +193 -0
- package/dist/shipping-option-type-list-YPCCUVFZ.mjs +277 -0
- package/dist/{shipping-profile-create-PBDONCGJ.mjs → shipping-profile-create-372EMPUI.mjs} +2 -2
- package/dist/{shipping-profile-detail-EORJZ7NX.mjs → shipping-profile-detail-MRXUOUXK.mjs} +4 -3
- package/dist/{shipping-profile-metadata-UB73OBPJ.mjs → shipping-profile-metadata-A33XKBQN.mjs} +18 -17
- package/dist/{shipping-profiles-list-EFGYH4OS.mjs → shipping-profiles-list-KYYSHLSZ.mjs} +9 -10
- package/dist/{store-add-currencies-2OBWTWKT.mjs → store-add-currencies-SNSW7A6O.mjs} +11 -10
- package/dist/{store-detail-U5HON77R.mjs → store-detail-3ZV7FCPV.mjs} +24 -25
- package/dist/{store-edit-JNSWFWIG.mjs → store-edit-FNKVB3UA.mjs} +29 -17
- package/dist/{store-metadata-GLAZZPP6.mjs → store-metadata-LMRFCZ3J.mjs} +18 -17
- package/dist/{tax-region-create-EW5USMNY.mjs → tax-region-create-5Y6EA7XE.mjs} +103 -36
- package/dist/{tax-region-detail-MVSV7BWW.mjs → tax-region-detail-TTYUBJ3V.mjs} +107 -40
- package/dist/tax-region-edit-IKEWHRUK.mjs +163 -0
- package/dist/{tax-region-list-FNVPRMTQ.mjs → tax-region-list-HQMSVGDD.mjs} +12 -11
- package/dist/{tax-region-province-create-LQ5SPSXW.mjs → tax-region-province-create-6GZCPPGW.mjs} +35 -53
- package/dist/{tax-region-province-detail-4G2WUUBB.mjs → tax-region-province-detail-YCY56CRL.mjs} +81 -28
- package/dist/{tax-region-tax-override-create-EXGXVKBR.mjs → tax-region-tax-override-create-R3PNDP43.mjs} +90 -61
- package/dist/tax-region-tax-override-edit-QLD7MIQY.mjs +270 -0
- package/dist/{tax-region-tax-rate-create-7GNLSDJ2.mjs → tax-region-tax-rate-create-TJLSRCEC.mjs} +7 -6
- package/dist/{tax-region-tax-rate-edit-6U2BQMIE.mjs → tax-region-tax-rate-edit-DEKCUURK.mjs} +7 -6
- package/dist/{user-detail-X2Z2IYNI.mjs → user-detail-DFZPKHG2.mjs} +5 -4
- package/dist/{user-edit-HFSJM4QT.mjs → user-edit-NFRTYOKO.mjs} +2 -2
- package/dist/{user-invite-3V3ZTOJS.mjs → user-invite-FQNKJKMD.mjs} +14 -20
- package/dist/{user-list-35TJ53CP.mjs → user-list-6EVTLPJE.mjs} +15 -10
- package/dist/{user-metadata-GJ6PIXLU.mjs → user-metadata-BQKW4WAU.mjs} +18 -17
- package/dist/{workflow-execution-detail-D26MDYFC.mjs → workflow-execution-detail-D5QUZFTV.mjs} +21 -17
- package/dist/{workflow-execution-list-FKIKX7HK.mjs → workflow-execution-list-JOVBPL45.mjs} +8 -9
- package/package.json +25 -32
- package/src/app.tsx +2 -0
- package/src/components/common/action-menu/action-menu.tsx +3 -1
- package/src/components/common/customer-info/customer-info.tsx +1 -1
- package/src/components/common/infinite-list/infinite-list.tsx +8 -2
- package/src/components/common/json-view-section/json-view-section.tsx +4 -1
- package/src/components/common/sidebar-link/sidebar-link.tsx +1 -1
- package/src/components/common/switch-box/switch-box.tsx +2 -0
- package/src/components/data-grid/components/data-grid-root.tsx +9 -3
- package/src/components/data-grid/components/data-grid-toggleable-number-cell.tsx +2 -1
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +6 -5
- package/src/components/data-table/data-table.tsx +171 -56
- package/src/components/filtering/filter-group/filter-group.tsx +5 -1
- package/src/components/filtering/order-by/order-by.tsx +4 -1
- package/src/components/filtering/query/query.tsx +1 -1
- package/src/components/forms/address-form/address-form.tsx +7 -2
- package/src/components/forms/metadata-form/metadata-form.tsx +6 -3
- package/src/components/inputs/combobox/combobox.tsx +21 -14
- package/src/components/inputs/country-select/country-select.tsx +37 -62
- package/src/components/inputs/percentage-input/percentage-input.tsx +67 -37
- package/src/components/inputs/province-select/province-select.tsx +42 -62
- package/src/components/layout/main-layout/main-layout.tsx +7 -5
- package/src/components/layout/settings-layout/settings-layout.tsx +4 -0
- package/src/components/layout/shell/shell.tsx +6 -6
- package/src/components/layout/user-menu/user-menu.tsx +12 -10
- package/src/components/modals/hooks/use-state-aware-to.tsx +10 -4
- package/src/components/modals/route-modal-form/route-modal-form.tsx +6 -6
- package/src/components/search/search.tsx +5 -3
- package/src/components/search/use-search-results.tsx +1 -1
- package/src/components/table/configurable-data-table/configurable-data-table.tsx +240 -0
- package/src/components/table/configurable-data-table/index.ts +3 -0
- package/src/components/table/configurable-data-table/save-view-dropdown.tsx +87 -0
- package/src/components/table/data-table/data-table-filter/date-filter.tsx +22 -4
- package/src/components/table/data-table/data-table-filter/number-filter.tsx +1 -1
- package/src/components/table/data-table/data-table-filter/string-filter.tsx +1 -1
- package/src/components/table/data-table/data-table-order-by/data-table-order-by.tsx +4 -1
- package/src/components/table/data-table/data-table-root/data-table-root.tsx +3 -3
- package/src/components/table/data-table/data-table-search/data-table-search.tsx +1 -1
- package/src/components/table/save-view-dialog/index.ts +1 -0
- package/src/components/table/save-view-dialog/save-view-dialog.tsx +163 -0
- package/src/components/table/save-view-dropdown/index.ts +1 -0
- package/src/components/table/save-view-dropdown/save-view-dropdown.tsx +88 -0
- package/src/components/table/view-selector/index.ts +2 -0
- package/src/components/table/view-selector/view-pills.tsx +265 -0
- package/src/components/table/view-selector/view-selector.tsx +253 -0
- package/src/components/utilities/i18n/i18n.tsx +9 -1
- package/src/dashboard-app/dashboard-app.tsx +22 -0
- package/src/dashboard-app/forms/form-extension-zone/form-extension-zone.tsx +1 -1
- package/src/dashboard-app/routes/get-route.map.tsx +124 -1
- package/src/dashboard-app/types.ts +7 -0
- package/src/hooks/api/campaigns.tsx +1 -0
- package/src/hooks/api/feature-flags.tsx +22 -0
- package/src/hooks/api/index.ts +3 -0
- package/src/hooks/api/inventory.tsx +7 -1
- package/src/hooks/api/orders.tsx +61 -1
- package/src/hooks/api/payments.tsx +6 -1
- package/src/hooks/api/plugins.tsx +28 -0
- package/src/hooks/api/products.tsx +55 -1
- package/src/hooks/api/promotions.tsx +17 -3
- package/src/hooks/api/refund-reasons.tsx +105 -10
- package/src/hooks/api/shipping-option-types.tsx +128 -0
- package/src/hooks/api/tax-regions.tsx +24 -0
- package/src/hooks/api/views.tsx +244 -0
- package/src/hooks/table/columns/index.ts +1 -0
- package/src/hooks/table/columns/use-column-state.ts +209 -0
- package/src/hooks/table/columns/use-configurable-table-columns.tsx +109 -0
- package/src/hooks/table/columns/use-order-data-table-columns.tsx +234 -0
- package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +39 -0
- package/src/hooks/table/columns/use-shipping-option-table-columns.tsx +89 -0
- package/src/hooks/table/columns/use-shipping-option-type-table-columns.tsx +44 -0
- package/src/hooks/table/filters/use-product-table-filters.tsx +3 -0
- package/src/hooks/table/filters/use-shipping-option-table-filters.tsx +10 -19
- package/src/hooks/table/filters/use-shipping-option-type-table-filters.tsx +5 -0
- package/src/hooks/table/query/index.ts +1 -0
- package/src/hooks/table/query/use-order-table-query.tsx +1 -1
- package/src/hooks/table/query/use-product-variant-table-query.tsx +32 -0
- package/src/hooks/table/query/use-promotion-table-query.tsx +3 -2
- package/src/hooks/table/query/use-refund-reason-table-query.tsx +32 -0
- package/src/hooks/table/query/use-shipping-option-table-query.tsx +16 -4
- package/src/hooks/table/query/use-shipping-option-type-table-query.tsx +32 -0
- package/src/hooks/table/use-table-configuration.tsx +287 -0
- package/src/hooks/use-combobox-data.tsx +27 -3
- package/src/hooks/use-debounced-search.tsx +1 -1
- package/src/hooks/use-document-direction.tsx +54 -0
- package/src/hooks/use-view-configurations.tsx +102 -0
- package/src/i18n/config.ts +2 -5
- package/src/i18n/languages.ts +35 -0
- package/src/i18n/translations/$schema.json +818 -33
- package/src/i18n/translations/ar.json +8 -4
- package/src/i18n/translations/bg.json +8 -4
- package/src/i18n/translations/bs.json +3016 -0
- package/src/i18n/translations/cs.json +136 -14
- package/src/i18n/translations/de.json +42 -38
- package/src/i18n/translations/el.json +8 -4
- package/src/i18n/translations/en.json +239 -25
- package/src/i18n/translations/es.json +344 -28
- package/src/i18n/translations/fa.json +8 -4
- package/src/i18n/translations/fr.json +8 -4
- package/src/i18n/translations/he.json +3017 -0
- package/src/i18n/translations/hu.json +3005 -0
- package/src/i18n/translations/id.json +3020 -0
- package/src/i18n/translations/index.ts +20 -1
- package/src/i18n/translations/it.json +8 -4
- package/src/i18n/translations/ja.json +8 -4
- package/src/i18n/translations/ko.json +234 -212
- package/src/i18n/translations/lt.json +8 -4
- package/src/i18n/translations/mk.json +8 -4
- package/src/i18n/translations/mn.json +8 -4
- package/src/i18n/translations/nl.json +3005 -0
- package/src/i18n/translations/pl.json +149 -30
- package/src/i18n/translations/ptBR.json +8 -4
- package/src/i18n/translations/ro.json +8 -4
- package/src/i18n/translations/ru.json +8 -4
- package/src/i18n/translations/th.json +8 -4
- package/src/i18n/translations/tr.json +8 -4
- package/src/i18n/translations/uk.json +8 -4
- package/src/i18n/translations/vi.json +56 -8
- package/src/i18n/translations/zhCN.json +106 -17
- package/src/lib/common.ts +13 -0
- package/src/lib/credit-line.ts +8 -0
- package/src/lib/data/countries.ts +7 -7
- package/src/lib/data/country-states.ts +9 -0
- package/src/lib/data/currencies.ts +18 -0
- package/src/lib/format-currency.ts +1 -1
- package/src/lib/number-helper.ts +19 -0
- package/src/lib/orders.ts +23 -0
- package/src/lib/percentage-helpers.ts +1 -0
- package/src/lib/plugins.ts +7 -0
- package/src/lib/promotions.ts +3 -1
- package/src/lib/shipping-options.ts +43 -0
- package/src/lib/table/cell-renderers.tsx +313 -0
- package/src/lib/table/entity-adapters.tsx +138 -0
- package/src/lib/table/entity-defaults.ts +73 -0
- package/src/lib/table/field-utils.ts +75 -0
- package/src/lib/table/table-adapters.ts +94 -0
- package/src/lib/table-display-utils.tsx +372 -0
- package/src/module.d.ts +6 -0
- package/src/providers/feature-flag-provider/index.tsx +46 -0
- package/src/providers/i18n-provider/i18n-provider.tsx +9 -4
- package/src/providers/keybind-provider/hooks.tsx +1 -1
- package/src/providers/providers.tsx +6 -4
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +1 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx +1 -1
- package/src/routes/campaigns/campaign-create/components/create-campaign-form/create-campaign-form.tsx +8 -2
- package/src/routes/campaigns/campaign-detail/components/campaign-budget/campaign-budget.tsx +20 -9
- package/src/routes/campaigns/campaign-detail/components/campaign-spend/campaign-spend.tsx +6 -4
- package/src/routes/campaigns/campaign-list/components/campaign-list-table.tsx +1 -1
- package/src/routes/campaigns/common/components/create-campaign-form-fields/create-campaign-form-fields.tsx +61 -6
- package/src/routes/campaigns/common/constants.ts +1 -0
- package/src/routes/categories/category-create/components/create-category-form/create-category-details.tsx +12 -3
- package/src/routes/categories/category-create/components/create-category-form/create-category-form.tsx +4 -3
- package/src/routes/categories/category-detail/components/category-organize-section/category-organize-section.tsx +1 -1
- package/src/routes/categories/category-edit/components/edit-category-form/edit-category-form.tsx +12 -3
- package/src/routes/categories/category-products/components/edit-category-products-form/edit-category-products-form.tsx +10 -8
- package/src/routes/collections/collection-add-products/components/add-products-to-collection-form/add-products-to-collection-form.tsx +10 -8
- package/src/routes/collections/collection-create/components/create-collection-form/create-collection-form.tsx +22 -19
- package/src/routes/customer-groups/customer-group-add-customers/components/add-customers-form/add-customers-form.tsx +16 -14
- package/src/routes/inventory/inventory-create/components/inventory-create-form/inventory-create-form.tsx +3 -1
- package/src/routes/inventory/inventory-detail/components/inventory-item-location-levels.tsx +1 -1
- package/src/routes/inventory/inventory-detail/components/inventory-item-reservations.tsx +1 -1
- package/src/routes/inventory/inventory-detail/components/inventory-item-variants/variants-section.tsx +1 -1
- package/src/routes/inventory/inventory-detail/components/location-levels-table/location-list-table.tsx +12 -18
- package/src/routes/inventory/inventory-detail/components/location-levels-table/use-location-list-table-columns.tsx +79 -6
- package/src/routes/inventory/inventory-detail/components/location-levels-table/use-location-list-table-query.tsx +9 -21
- package/src/routes/inventory/inventory-detail/components/manage-locations/components/location-item.tsx +2 -2
- package/src/routes/inventory/inventory-detail/components/manage-locations/components/location-search-input.tsx +34 -0
- package/src/routes/inventory/inventory-detail/components/manage-locations/components/manage-locations-form.tsx +127 -140
- package/src/routes/locations/common/components/conditional-price-form/conditional-price-form.tsx +1 -1
- package/src/routes/locations/location-edit/components/edit-location-form/edit-location-form.tsx +2 -3
- package/src/routes/locations/location-list/index.ts +0 -1
- package/src/routes/locations/location-list/location-list.tsx +61 -15
- package/src/routes/locations/location-list/use-location-list-table-columns.tsx +185 -0
- package/src/routes/locations/location-list/use-location-list-table-query.tsx +22 -0
- package/src/routes/locations/location-sales-channels/components/edit-sales-channels-form/edit-sales-channels-form.tsx +1 -1
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-option-details-form.tsx +40 -5
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-form.tsx +4 -7
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/schema.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/edit-shipping-option-form.tsx +84 -4
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/order-allocate-items-form.tsx +28 -11
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/order-allocate-items-item.tsx +2 -2
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/utils.ts +28 -0
- package/src/routes/orders/order-balance-settlement/components/order-balance-settlement-form/index.ts +1 -0
- package/src/routes/orders/order-balance-settlement/components/order-balance-settlement-form/order-balance-settlement-form.tsx +396 -0
- package/src/routes/orders/order-balance-settlement/index.ts +1 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx +49 -18
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-item.tsx +1 -1
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-section.tsx +7 -10
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-create-form.tsx +2 -1
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +1 -1
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-create-form.tsx +38 -16
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-item.tsx +1 -1
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-section.tsx +7 -10
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-form.tsx +32 -30
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-item.tsx +71 -16
- package/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx +122 -79
- package/src/routes/orders/order-create-refund/order-create-refund.tsx +7 -14
- package/src/routes/orders/order-create-return/components/return-create-form/return-create-form.tsx +16 -9
- package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/order-create-shipment-form.tsx +108 -44
- package/src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx +20 -12
- package/src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx +30 -13
- package/src/routes/orders/order-detail/components/order-payment-section/order-payment-section.tsx +104 -16
- package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +270 -116
- package/src/routes/orders/order-detail/constants.ts +11 -1
- package/src/routes/orders/order-detail/order-detail.tsx +4 -2
- package/src/routes/orders/order-list/components/order-list-table/components/save-view-dropdown.tsx +81 -0
- package/src/routes/orders/order-list/components/order-list-table/configurable-order-list-table.tsx +16 -0
- package/src/routes/orders/order-list/components/order-list-table/constants.ts +14 -0
- package/src/routes/orders/order-list/components/order-list-table/hooks/use-order-data-table-columns.tsx +153 -0
- package/src/routes/orders/order-list/components/order-list-table/order-list-table.tsx +10 -1
- package/src/routes/orders/order-list/components/order-list-table/order-table-adapter.tsx +68 -0
- package/src/routes/orders/order-list/components/order-list-table/use-order-table-filters.tsx +62 -0
- package/src/routes/orders/order-list/const.ts +2 -2
- package/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx +2 -1
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx +3 -1
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-details-form.tsx +8 -2
- package/src/routes/price-lists/price-list-detail/components/price-list-product-section/price-list-product-section.tsx +1 -1
- package/src/routes/price-lists/price-list-edit/components/price-list-edit-form/edit-price-list-form.tsx +12 -3
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-form.tsx +10 -5
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-product-ids-form.tsx +1 -0
- package/src/routes/product-tags/product-tag-detail/product-tag-detail.tsx +1 -0
- package/src/routes/product-tags/product-tag-metadata/index.ts +1 -0
- package/src/routes/product-tags/product-tag-metadata/product-tag-metadata.tsx +26 -0
- package/src/routes/product-types/product-type-metadata/index.ts +1 -0
- package/src/routes/product-types/product-type-metadata/product-type-metadata.tsx +26 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-media-section/index.ts +1 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-media-section/variant-media-section.tsx +77 -0
- package/src/routes/product-variants/product-variant-detail/constants.ts +1 -1
- package/src/routes/product-variants/product-variant-detail/product-variant-detail.tsx +2 -0
- package/src/routes/product-variants/product-variant-edit/components/product-edit-variant-form/product-edit-variant-form.tsx +4 -0
- package/src/routes/product-variants/product-variant-manage-inventory-items/components/manage-variant-inventory-items-form/manage-variant-inventory-items-form.tsx +183 -115
- package/src/routes/product-variants/product-variant-media/components/edit-product-variant-media-form/edit-product-variant-media-form.tsx +434 -0
- package/src/routes/product-variants/product-variant-media/components/edit-product-variant-media-form/index.ts +1 -0
- package/src/routes/product-variants/product-variant-media/index.ts +1 -0
- package/src/routes/product-variants/product-variant-media/product-variant-media.tsx +38 -0
- package/src/routes/products/common/components/category-combobox/category-combobox.tsx +11 -11
- package/src/routes/products/product-attributes/components/product-attributes-form/product-attributes-form.tsx +8 -4
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +4 -4
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +23 -30
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +3 -1
- package/src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx +148 -109
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx +1 -1
- package/src/routes/products/product-create-variant/components/create-product-variant-form/create-product-variant-form.tsx +10 -5
- package/src/routes/products/product-create-variant/components/create-product-variant-form/details-tab.tsx +6 -1
- package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +6 -1
- package/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx +15 -3
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +21 -28
- package/src/routes/products/product-edit/components/edit-product-form/edit-product-form.tsx +7 -2
- package/src/routes/products/product-export/product-export.tsx +15 -15
- package/src/routes/products/product-image-variants-edit/components/variants-table-form/index.ts +1 -0
- package/src/routes/products/product-image-variants-edit/components/variants-table-form/variants-table-form.tsx +264 -0
- package/src/routes/products/product-image-variants-edit/index.ts +1 -0
- package/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx +61 -0
- package/src/routes/products/product-import/helpers/import-template.ts +6 -7
- package/src/routes/products/product-list/components/product-list-table/configurable-product-list-table.tsx +26 -0
- package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +10 -2
- package/src/routes/products/product-list/components/product-list-table/product-table-adapter.tsx +51 -0
- package/src/routes/products/product-list/components/product-list-table/use-product-table-filters.tsx +104 -0
- package/src/routes/products/product-media/components/edit-product-media-form/edit-product-media-form.tsx +1 -0
- package/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx +3 -3
- package/src/routes/products/product-stock/hooks/use-product-stock-columns.tsx +2 -1
- package/src/routes/profile/profile-edit/components/edit-profile-form/edit-profile-form.tsx +9 -3
- package/src/routes/promotions/common/edit-rules/components/edit-rules-form/edit-rules-form.tsx +8 -1
- package/src/routes/promotions/common/edit-rules/components/edit-rules-form/form-schema.ts +3 -0
- package/src/routes/promotions/common/edit-rules/components/rule-value-form-field/rule-value-form-field.tsx +36 -5
- package/src/routes/promotions/common/edit-rules/components/rules-form-field/rules-form-field.tsx +59 -8
- package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/add-campaign-promotion-form.tsx +48 -49
- package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/campaign-details.tsx +29 -2
- package/src/routes/promotions/promotion-add-campaign/promotion-add-campaign.tsx +4 -21
- package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +195 -80
- package/src/routes/promotions/promotion-create/components/create-promotion-form/form-schema.ts +5 -3
- package/src/routes/promotions/promotion-create/components/create-promotion-form/templates.ts +56 -5
- package/src/routes/promotions/promotion-detail/components/promotion-conditions-section/promotion-conditions-section.tsx +9 -3
- package/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx +16 -0
- package/src/routes/promotions/promotion-detail/promotion-detail.tsx +4 -0
- package/src/routes/promotions/promotion-edit-details/components/edit-promotion-form/edit-promotion-details-form.tsx +242 -122
- package/src/routes/promotions/promotion-list/components/promotion-list-table/promotion-list-table.tsx +1 -1
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +177 -0
- package/src/routes/refund-reasons/refund-reason-create/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx +10 -0
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +141 -0
- package/src/routes/refund-reasons/refund-reason-edit/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx +33 -0
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +138 -0
- package/src/routes/refund-reasons/refund-reason-list/index.ts +2 -0
- package/src/routes/refund-reasons/refund-reason-list/loader.ts +16 -0
- package/src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx +21 -0
- package/src/routes/regions/region-add-countries/components/add-countries-form/add-countries-form.tsx +12 -12
- package/src/routes/regions/region-create/components/create-region-form/create-region-form.tsx +40 -24
- package/src/routes/regions/region-create/region-create.tsx +1 -10
- package/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx +33 -11
- package/src/routes/regions/region-edit/region-edit.tsx +0 -5
- package/src/routes/reservations/reservation-detail/components/edit-reservation/components/edit-reservation-form.tsx +3 -1
- package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-query.tsx +2 -1
- package/src/routes/sales-channels/sales-channel-create/components/create-sales-channel-form/create-sales-channel-form.tsx +2 -0
- package/src/routes/sales-channels/sales-channel-edit/components/edit-sales-channel-form/edit-sales-channel-form.tsx +2 -0
- package/src/routes/shipping-option-types/common/hooks/use-delete-shipping-option-type-action.tsx +43 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/components/create-shipping-option-type-form/create-shipping-option-type-form.tsx +168 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/components/create-shipping-option-type-form/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/shipping-option-type-create.tsx +10 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/breadcrumb.tsx +24 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/components/shipping-option-type-general-section/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/components/shipping-option-type-general-section/shipping-option-type-general-section.tsx +66 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/index.ts +3 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/loader.ts +19 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/shipping-option-type-detail.tsx +46 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/components/edit-shipping-option-type-form/edit-shipping-option-type-form.tsx +145 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/components/edit-shipping-option-type-form/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/shipping-option-type-edit.tsx +31 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/shipping-option-type-list-table.tsx +99 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/shipping-option-type-table-row-actions.tsx +44 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/shipping-option-type-list.tsx +18 -0
- package/src/routes/store/store-add-currencies/components/add-currencies-form/add-currencies-form.tsx +2 -0
- package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +9 -4
- package/src/routes/tax-regions/common/components/target-form/target-form.tsx +157 -6
- package/src/routes/tax-regions/common/components/target-item/target-item.tsx +15 -2
- package/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx +33 -13
- package/src/routes/tax-regions/common/components/tax-region-card/tax-region-card.tsx +23 -5
- package/src/routes/tax-regions/common/constants.ts +1 -0
- package/src/routes/tax-regions/tax-region-create/components/tax-region-create-form/tax-region-create-form.tsx +70 -10
- package/src/routes/tax-regions/tax-region-detail/tax-region-detail.tsx +4 -2
- package/src/routes/tax-regions/tax-region-detail/tax-region-provider-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-detail/tax-region-provider-section/tax-region-provider-section.tsx +28 -0
- package/src/routes/tax-regions/tax-region-edit/components/tax-region-edit/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-edit/components/tax-region-edit/tax-region-edit-form.tsx +109 -0
- package/src/routes/tax-regions/tax-region-edit/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-edit/tax-region-edit.tsx +33 -0
- package/src/routes/tax-regions/tax-region-province-create/components/tax-region-province-create-form/tax-region-province-create-form.tsx +2 -1
- package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-detail-section/tax-region-detail-section.tsx +1 -0
- package/src/routes/tax-regions/tax-region-tax-override-create/components/tax-region-override-create-form/tax-region-tax-override-create.tsx +29 -2
- package/src/routes/tax-regions/tax-region-tax-override-edit/components/tax-region-tax-override-edit-form/tax-region-tax-override-edit-form.tsx +59 -14
- package/src/routes/tax-regions/tax-region-tax-override-edit/tax-region-tax-override-edit.tsx +95 -51
- package/src/routes/tax-regions/tax-region-tax-override-edit/types.ts +4 -3
- package/src/routes/tax-regions/tax-region-tax-rate-create/components/tax-region-tax-rate-create-form/tax-region-tax-rate-create-form.tsx +1 -0
- package/src/routes/tax-regions/tax-region-tax-rate-edit/components/tax-region-tax-rate-edit-form/tax-region-tax-rate-edit-form.tsx +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/workflow-execution-timeline-section.tsx +3 -2
- package/src/utils/column-utils.ts +71 -0
- package/dist/chunk-4GJJIXM6.mjs +0 -64
- package/dist/chunk-ACBS6KFT.mjs +0 -51
- package/dist/chunk-BKJC5BGQ.mjs +0 -53
- package/dist/chunk-CLRTJ6DI.mjs +0 -164
- package/dist/chunk-DDV2HJEV.mjs +0 -318
- package/dist/chunk-DFA6WGYO.mjs +0 -115
- package/dist/chunk-GH77ZQI2.mjs +0 -36
- package/dist/chunk-I5HYE2RW.mjs +0 -31
- package/dist/chunk-K7S5TX6I.mjs +0 -142
- package/dist/chunk-M3VFKDXJ.mjs +0 -62
- package/dist/chunk-MW4K5NNY.mjs +0 -69
- package/dist/chunk-OPZDUI6B.mjs +0 -5241
- package/dist/chunk-R2O6QX4D.mjs +0 -16
- package/dist/chunk-TD3LLNM6.mjs +0 -383
- package/dist/chunk-V3MOBCDF.mjs +0 -10
- package/dist/chunk-YEDAFXMB.mjs +0 -57
- package/dist/chunk-YRY2CZ6I.mjs +0 -73
- package/dist/collection-create-PXO6DJS3.mjs +0 -124
- package/dist/location-list-5UJ6CSA7.mjs +0 -286
- package/dist/location-service-zone-shipping-option-edit-ODUEKZON.mjs +0 -277
- package/dist/manage-locations-E7YAZVH2.mjs +0 -236
- package/dist/order-create-refund-FXUURAS7.mjs +0 -298
- package/dist/order-list-D4WMVRA2.mjs +0 -146
- package/dist/product-list-BGBZJ5WX.mjs +0 -262
- package/dist/product-variant-manage-inventory-items-BKFYUODS.mjs +0 -306
- package/dist/promotion-edit-details-D6M646E6.mjs +0 -377
- package/dist/region-edit-PXIMLBFB.mjs +0 -285
- package/src/routes/inventory/inventory-detail/components/location-levels-table/location-actions.tsx +0 -62
- package/src/routes/locations/location-list/components/location-list-header/index.ts +0 -1
- package/src/routes/locations/location-list/components/location-list-header/location-list-header.tsx +0 -21
- package/src/routes/locations/location-list/loader.ts +0 -36
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toCamelCase
|
|
3
|
+
} from "./chunk-6CPMXY5N.mjs";
|
|
4
|
+
import {
|
|
5
|
+
DisplayIdCell,
|
|
6
|
+
TotalCell
|
|
7
|
+
} from "./chunk-3I6G3NRU.mjs";
|
|
8
|
+
import {
|
|
9
|
+
DateCell
|
|
10
|
+
} from "./chunk-SJ3E4T6B.mjs";
|
|
11
|
+
import {
|
|
12
|
+
MoneyAmountCell
|
|
13
|
+
} from "./chunk-INE2QCSC.mjs";
|
|
14
|
+
import {
|
|
15
|
+
CollectionCell,
|
|
16
|
+
ProductStatusCell,
|
|
17
|
+
SalesChannelsCell,
|
|
18
|
+
VariantCell
|
|
19
|
+
} from "./chunk-XLDQPLK4.mjs";
|
|
20
|
+
import {
|
|
21
|
+
ProductCell
|
|
22
|
+
} from "./chunk-IQBAUTU5.mjs";
|
|
23
|
+
import {
|
|
24
|
+
DataTable,
|
|
25
|
+
SaveViewDialog,
|
|
26
|
+
useViewConfiguration,
|
|
27
|
+
useViewConfigurations
|
|
28
|
+
} from "./chunk-GRNWRTT3.mjs";
|
|
29
|
+
import {
|
|
30
|
+
useQueryParams
|
|
31
|
+
} from "./chunk-C76H5USB.mjs";
|
|
32
|
+
import {
|
|
33
|
+
getCountryByIso2
|
|
34
|
+
} from "./chunk-DG7J63J2.mjs";
|
|
35
|
+
import {
|
|
36
|
+
useFeatureFlag
|
|
37
|
+
} from "./chunk-RM6NY572.mjs";
|
|
38
|
+
import {
|
|
39
|
+
useEntityColumns
|
|
40
|
+
} from "./chunk-KX4P5L3R.mjs";
|
|
41
|
+
|
|
42
|
+
// src/components/table/configurable-data-table/configurable-data-table.tsx
|
|
43
|
+
import { useState as useState3 } from "react";
|
|
44
|
+
import { Container, Button as Button2 } from "@medusajs/ui";
|
|
45
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
46
|
+
|
|
47
|
+
// src/components/table/configurable-data-table/save-view-dropdown.tsx
|
|
48
|
+
import { Button, DropdownMenu, usePrompt } from "@medusajs/ui";
|
|
49
|
+
import { ChevronDownMini } from "@medusajs/icons";
|
|
50
|
+
import { useTranslation } from "react-i18next";
|
|
51
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
52
|
+
var SaveViewDropdown = ({
|
|
53
|
+
isDefaultView,
|
|
54
|
+
currentViewId,
|
|
55
|
+
currentViewName,
|
|
56
|
+
onSaveAsDefault,
|
|
57
|
+
onUpdateExisting,
|
|
58
|
+
onSaveAsNew
|
|
59
|
+
}) => {
|
|
60
|
+
const { t } = useTranslation();
|
|
61
|
+
const prompt = usePrompt();
|
|
62
|
+
const handleSaveAsDefault = async () => {
|
|
63
|
+
const result = await prompt({
|
|
64
|
+
title: t("views.prompts.updateDefault.title"),
|
|
65
|
+
description: t("views.prompts.updateDefault.description"),
|
|
66
|
+
confirmText: t("views.prompts.updateDefault.confirmText"),
|
|
67
|
+
cancelText: t("views.prompts.updateDefault.cancelText")
|
|
68
|
+
});
|
|
69
|
+
if (result) {
|
|
70
|
+
onSaveAsDefault();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const handleUpdateExisting = async () => {
|
|
74
|
+
const result = await prompt({
|
|
75
|
+
title: t("views.prompts.updateView.title"),
|
|
76
|
+
description: t("views.prompts.updateView.description", { name: currentViewName }),
|
|
77
|
+
confirmText: t("views.prompts.updateView.confirmText"),
|
|
78
|
+
cancelText: t("views.prompts.updateView.cancelText")
|
|
79
|
+
});
|
|
80
|
+
if (result) {
|
|
81
|
+
onUpdateExisting();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
86
|
+
Button,
|
|
87
|
+
{
|
|
88
|
+
variant: "secondary",
|
|
89
|
+
size: "small",
|
|
90
|
+
type: "button",
|
|
91
|
+
children: [
|
|
92
|
+
t("views.save"),
|
|
93
|
+
/* @__PURE__ */ jsx(ChevronDownMini, {})
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
) }),
|
|
97
|
+
/* @__PURE__ */ jsx(DropdownMenu.Content, { align: "end", children: isDefaultView ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
98
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, { onClick: handleSaveAsDefault, children: t("views.updateDefaultForEveryone") }),
|
|
99
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, { onClick: onSaveAsNew, children: t("views.saveAsNew") })
|
|
100
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, { onClick: handleUpdateExisting, children: t("views.updateViewName") }),
|
|
102
|
+
/* @__PURE__ */ jsx(DropdownMenu.Item, { onClick: onSaveAsNew, children: t("views.saveAsNew") })
|
|
103
|
+
] }) })
|
|
104
|
+
] });
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// src/hooks/table/use-table-configuration.tsx
|
|
108
|
+
import { useState as useState2, useMemo as useMemo2, useCallback as useCallback2, useEffect as useEffect2 } from "react";
|
|
109
|
+
import { useSearchParams } from "react-router-dom";
|
|
110
|
+
|
|
111
|
+
// src/hooks/table/columns/use-column-state.ts
|
|
112
|
+
import { useState, useCallback, useMemo, useEffect, useRef } from "react";
|
|
113
|
+
function useColumnState(apiColumns, activeView) {
|
|
114
|
+
const [visibleColumns, setVisibleColumns] = useState(
|
|
115
|
+
() => {
|
|
116
|
+
if (apiColumns?.length && activeView?.configuration) {
|
|
117
|
+
const visibility = {};
|
|
118
|
+
apiColumns.forEach((column) => {
|
|
119
|
+
visibility[column.field] = activeView.configuration.visible_columns?.includes(column.field) || false;
|
|
120
|
+
});
|
|
121
|
+
return visibility;
|
|
122
|
+
} else if (apiColumns?.length) {
|
|
123
|
+
return getInitialColumnVisibility(apiColumns);
|
|
124
|
+
}
|
|
125
|
+
return {};
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
const [columnOrder, setColumnOrder] = useState(() => {
|
|
129
|
+
if (activeView?.configuration?.column_order) {
|
|
130
|
+
return activeView.configuration.column_order;
|
|
131
|
+
} else if (apiColumns?.length) {
|
|
132
|
+
return getInitialColumnOrder(apiColumns);
|
|
133
|
+
}
|
|
134
|
+
return [];
|
|
135
|
+
});
|
|
136
|
+
const columnState = useMemo(
|
|
137
|
+
() => ({
|
|
138
|
+
visibility: visibleColumns,
|
|
139
|
+
order: columnOrder
|
|
140
|
+
}),
|
|
141
|
+
[visibleColumns, columnOrder]
|
|
142
|
+
);
|
|
143
|
+
const currentColumns = useMemo(() => {
|
|
144
|
+
const visible = Object.entries(visibleColumns).filter(([_, isVisible]) => isVisible).map(([field]) => field);
|
|
145
|
+
return {
|
|
146
|
+
visible,
|
|
147
|
+
order: columnOrder
|
|
148
|
+
};
|
|
149
|
+
}, [visibleColumns, columnOrder]);
|
|
150
|
+
const handleColumnVisibilityChange = useCallback(
|
|
151
|
+
(visibility) => {
|
|
152
|
+
setVisibleColumns(visibility);
|
|
153
|
+
},
|
|
154
|
+
[]
|
|
155
|
+
);
|
|
156
|
+
const handleViewChange = useCallback(
|
|
157
|
+
(view, apiColumns2) => {
|
|
158
|
+
if (view?.configuration) {
|
|
159
|
+
const newVisibility = {};
|
|
160
|
+
apiColumns2.forEach((column) => {
|
|
161
|
+
newVisibility[column.field] = view.configuration.visible_columns?.includes(column.field) || false;
|
|
162
|
+
});
|
|
163
|
+
setVisibleColumns(newVisibility);
|
|
164
|
+
setColumnOrder(view.configuration.column_order || []);
|
|
165
|
+
} else {
|
|
166
|
+
setVisibleColumns(getInitialColumnVisibility(apiColumns2));
|
|
167
|
+
setColumnOrder(getInitialColumnOrder(apiColumns2));
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
[]
|
|
171
|
+
);
|
|
172
|
+
const initializeColumns = useCallback(
|
|
173
|
+
(apiColumns2) => {
|
|
174
|
+
if (Object.keys(visibleColumns).length === 0) {
|
|
175
|
+
setVisibleColumns(getInitialColumnVisibility(apiColumns2));
|
|
176
|
+
}
|
|
177
|
+
if (columnOrder.length === 0) {
|
|
178
|
+
setColumnOrder(getInitialColumnOrder(apiColumns2));
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
[]
|
|
182
|
+
);
|
|
183
|
+
const prevActiveViewRef = useRef();
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
if (apiColumns?.length) {
|
|
186
|
+
const viewChanged = prevActiveViewRef.current?.id !== activeView?.id;
|
|
187
|
+
const viewUpdated = activeView && prevActiveViewRef.current?.id === activeView.id && prevActiveViewRef.current.updated_at !== activeView.updated_at;
|
|
188
|
+
if (viewChanged || viewUpdated) {
|
|
189
|
+
if (activeView?.configuration) {
|
|
190
|
+
const newVisibility = {};
|
|
191
|
+
apiColumns.forEach((column) => {
|
|
192
|
+
newVisibility[column.field] = activeView.configuration?.visible_columns?.includes(
|
|
193
|
+
column.field
|
|
194
|
+
) || false;
|
|
195
|
+
});
|
|
196
|
+
setVisibleColumns(newVisibility);
|
|
197
|
+
setColumnOrder(activeView.configuration?.column_order || []);
|
|
198
|
+
} else {
|
|
199
|
+
setVisibleColumns(getInitialColumnVisibility(apiColumns));
|
|
200
|
+
setColumnOrder(getInitialColumnOrder(apiColumns));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
prevActiveViewRef.current = activeView;
|
|
205
|
+
}, [activeView, apiColumns]);
|
|
206
|
+
return {
|
|
207
|
+
visibleColumns,
|
|
208
|
+
columnOrder,
|
|
209
|
+
columnState,
|
|
210
|
+
currentColumns,
|
|
211
|
+
setVisibleColumns,
|
|
212
|
+
setColumnOrder,
|
|
213
|
+
handleColumnVisibilityChange,
|
|
214
|
+
handleViewChange,
|
|
215
|
+
initializeColumns
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
var DEFAULT_COLUMN_ORDER = 500;
|
|
219
|
+
function getInitialColumnVisibility(apiColumns) {
|
|
220
|
+
if (!apiColumns || apiColumns.length === 0) {
|
|
221
|
+
return {};
|
|
222
|
+
}
|
|
223
|
+
const visibility = {};
|
|
224
|
+
apiColumns.forEach((column) => {
|
|
225
|
+
visibility[column.field] = column.default_visible ?? true;
|
|
226
|
+
});
|
|
227
|
+
return visibility;
|
|
228
|
+
}
|
|
229
|
+
function getInitialColumnOrder(apiColumns) {
|
|
230
|
+
if (!apiColumns || apiColumns.length === 0) {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
233
|
+
const sortedColumns = [...apiColumns].sort((a, b) => {
|
|
234
|
+
const orderA = a.default_order ?? DEFAULT_COLUMN_ORDER;
|
|
235
|
+
const orderB = b.default_order ?? DEFAULT_COLUMN_ORDER;
|
|
236
|
+
return orderA - orderB;
|
|
237
|
+
});
|
|
238
|
+
return sortedColumns.map((col) => col.field);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/lib/table/entity-defaults.ts
|
|
242
|
+
var ENTITY_DEFAULT_FIELDS = {
|
|
243
|
+
orders: {
|
|
244
|
+
properties: [
|
|
245
|
+
"id",
|
|
246
|
+
"status",
|
|
247
|
+
"created_at",
|
|
248
|
+
"email",
|
|
249
|
+
"display_id",
|
|
250
|
+
"payment_status",
|
|
251
|
+
"fulfillment_status",
|
|
252
|
+
"total",
|
|
253
|
+
"currency_code"
|
|
254
|
+
],
|
|
255
|
+
relations: ["*customer", "*sales_channel"]
|
|
256
|
+
},
|
|
257
|
+
products: {
|
|
258
|
+
properties: ["id", "title", "handle", "status", "thumbnail"],
|
|
259
|
+
relations: ["collection.title", "*sales_channels", "*variants"]
|
|
260
|
+
},
|
|
261
|
+
customers: {
|
|
262
|
+
properties: [
|
|
263
|
+
"id",
|
|
264
|
+
"email",
|
|
265
|
+
"first_name",
|
|
266
|
+
"last_name",
|
|
267
|
+
"created_at",
|
|
268
|
+
"updated_at",
|
|
269
|
+
"has_account"
|
|
270
|
+
],
|
|
271
|
+
relations: ["*groups"]
|
|
272
|
+
},
|
|
273
|
+
inventory: {
|
|
274
|
+
properties: [
|
|
275
|
+
"id",
|
|
276
|
+
"sku",
|
|
277
|
+
"title",
|
|
278
|
+
"description",
|
|
279
|
+
"stocked_quantity",
|
|
280
|
+
"reserved_quantity",
|
|
281
|
+
"created_at",
|
|
282
|
+
"updated_at"
|
|
283
|
+
],
|
|
284
|
+
relations: ["*location_levels"]
|
|
285
|
+
},
|
|
286
|
+
// Default configuration for entities without specific defaults
|
|
287
|
+
default: {
|
|
288
|
+
properties: ["id", "created_at", "updated_at"],
|
|
289
|
+
relations: []
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
function getEntityDefaultFields(entity) {
|
|
293
|
+
const config = ENTITY_DEFAULT_FIELDS[entity] || ENTITY_DEFAULT_FIELDS.default;
|
|
294
|
+
return {
|
|
295
|
+
properties: config.properties,
|
|
296
|
+
relations: config.relations,
|
|
297
|
+
formatted: [...config.properties, ...config.relations].join(",")
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// src/lib/table/field-utils.ts
|
|
302
|
+
function calculateRequiredFields(entity, apiColumns, visibleColumns) {
|
|
303
|
+
const defaults = getEntityDefaultFields(entity);
|
|
304
|
+
const defaultFields = defaults.formatted;
|
|
305
|
+
if (!apiColumns?.length) {
|
|
306
|
+
return defaultFields;
|
|
307
|
+
}
|
|
308
|
+
const visibleColumnObjects = apiColumns.filter((column) => {
|
|
309
|
+
if (Object.keys(visibleColumns).length > 0) {
|
|
310
|
+
return visibleColumns[column.field] === true;
|
|
311
|
+
}
|
|
312
|
+
return column.default_visible;
|
|
313
|
+
});
|
|
314
|
+
const requiredFieldsSet = /* @__PURE__ */ new Set();
|
|
315
|
+
visibleColumnObjects.forEach((column) => {
|
|
316
|
+
if (column.computed) {
|
|
317
|
+
column.computed.required_fields?.forEach((field) => requiredFieldsSet.add(field));
|
|
318
|
+
column.computed.optional_fields?.forEach((field) => requiredFieldsSet.add(field));
|
|
319
|
+
} else if (!column.field.includes(".")) {
|
|
320
|
+
requiredFieldsSet.add(column.field);
|
|
321
|
+
} else {
|
|
322
|
+
requiredFieldsSet.add(column.field);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
const allRequiredFields = Array.from(requiredFieldsSet);
|
|
326
|
+
const visibleRelationshipFields = allRequiredFields.filter((field) => field.includes("."));
|
|
327
|
+
const visibleDirectFields = allRequiredFields.filter((field) => !field.includes("."));
|
|
328
|
+
const additionalRelationshipFields = visibleRelationshipFields.filter((field) => {
|
|
329
|
+
const [relationName] = field.split(".");
|
|
330
|
+
const isAlreadyCovered = defaults.relations.some(
|
|
331
|
+
(rel) => rel === `*${relationName}` || rel === relationName
|
|
332
|
+
);
|
|
333
|
+
return !isAlreadyCovered;
|
|
334
|
+
});
|
|
335
|
+
const additionalDirectFields = visibleDirectFields.filter((field) => {
|
|
336
|
+
const isAlreadyIncluded = defaults.properties.includes(field);
|
|
337
|
+
return !isAlreadyIncluded;
|
|
338
|
+
});
|
|
339
|
+
const additionalFields = [...additionalRelationshipFields, ...additionalDirectFields];
|
|
340
|
+
if (additionalFields.length > 0) {
|
|
341
|
+
return `${defaultFields},${additionalFields.join(",")}`;
|
|
342
|
+
}
|
|
343
|
+
return defaultFields;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/hooks/table/use-table-configuration.tsx
|
|
347
|
+
function parseSortingState(value) {
|
|
348
|
+
return value.startsWith("-") ? { id: value.slice(1), desc: true } : { id: value, desc: false };
|
|
349
|
+
}
|
|
350
|
+
function useTableConfiguration({
|
|
351
|
+
entity,
|
|
352
|
+
queryPrefix = "",
|
|
353
|
+
filters = []
|
|
354
|
+
}) {
|
|
355
|
+
const isViewConfigEnabled = useFeatureFlag("view_configurations");
|
|
356
|
+
const [_, setSearchParams] = useSearchParams();
|
|
357
|
+
const { activeView, createView } = useViewConfigurations(entity);
|
|
358
|
+
const currentActiveView = activeView?.view_configuration || null;
|
|
359
|
+
const { updateView } = useViewConfiguration(entity, currentActiveView?.id || "");
|
|
360
|
+
const { columns: apiColumns, isLoading: isLoadingColumns } = useEntityColumns(entity, {
|
|
361
|
+
enabled: isViewConfigEnabled
|
|
362
|
+
});
|
|
363
|
+
const queryParams = useQueryParams(
|
|
364
|
+
["q", "order", "offset", "limit", ...filters.map((f) => f.id)],
|
|
365
|
+
queryPrefix
|
|
366
|
+
);
|
|
367
|
+
const {
|
|
368
|
+
visibleColumns,
|
|
369
|
+
columnOrder,
|
|
370
|
+
currentColumns,
|
|
371
|
+
setColumnOrder,
|
|
372
|
+
handleColumnVisibilityChange,
|
|
373
|
+
handleViewChange: originalHandleViewChange
|
|
374
|
+
} = useColumnState(apiColumns, currentActiveView);
|
|
375
|
+
useEffect2(() => {
|
|
376
|
+
if (!apiColumns) return;
|
|
377
|
+
originalHandleViewChange(currentActiveView, apiColumns);
|
|
378
|
+
setSearchParams((prev) => {
|
|
379
|
+
const keysToDelete = Array.from(prev.keys()).filter(
|
|
380
|
+
(key) => key.startsWith(queryPrefix + "_") || key === queryPrefix + "_q" || key === queryPrefix + "_order"
|
|
381
|
+
);
|
|
382
|
+
keysToDelete.forEach((key) => prev.delete(key));
|
|
383
|
+
if (currentActiveView) {
|
|
384
|
+
const viewConfig = currentActiveView.configuration;
|
|
385
|
+
if (viewConfig.filters) {
|
|
386
|
+
Object.entries(viewConfig.filters).forEach(([key, value]) => {
|
|
387
|
+
prev.set(`${queryPrefix}_${key}`, JSON.stringify(value));
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
if (viewConfig.sorting) {
|
|
391
|
+
const sortValue = viewConfig.sorting.desc ? `-${viewConfig.sorting.id}` : viewConfig.sorting.id;
|
|
392
|
+
prev.set(`${queryPrefix}_order`, sortValue);
|
|
393
|
+
}
|
|
394
|
+
if (viewConfig.search) {
|
|
395
|
+
prev.set(`${queryPrefix}_q`, viewConfig.search);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return prev;
|
|
399
|
+
});
|
|
400
|
+
}, [currentActiveView, apiColumns]);
|
|
401
|
+
const currentConfiguration = useMemo2(() => {
|
|
402
|
+
const currentFilters = {};
|
|
403
|
+
filters.forEach((filter) => {
|
|
404
|
+
if (queryParams[filter.id] !== void 0) {
|
|
405
|
+
currentFilters[filter.id] = JSON.parse(queryParams[filter.id] || "");
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
return {
|
|
409
|
+
filters: currentFilters,
|
|
410
|
+
sorting: queryParams.order ? parseSortingState(queryParams.order) : null,
|
|
411
|
+
search: queryParams.q || ""
|
|
412
|
+
};
|
|
413
|
+
}, [filters, queryParams]);
|
|
414
|
+
const [debouncedHasConfigChanged, setDebouncedHasConfigChanged] = useState2(false);
|
|
415
|
+
const hasConfigurationChanged = useMemo2(() => {
|
|
416
|
+
const currentFilters = currentConfiguration.filters;
|
|
417
|
+
const currentSorting = currentConfiguration.sorting;
|
|
418
|
+
const currentSearch = currentConfiguration.search;
|
|
419
|
+
const currentVisibleColumns = Object.entries(visibleColumns).filter(([_2, isVisible]) => isVisible).map(([field]) => field).sort();
|
|
420
|
+
if (currentActiveView) {
|
|
421
|
+
const viewFilters = currentActiveView.configuration.filters || {};
|
|
422
|
+
const viewSorting = currentActiveView.configuration.sorting;
|
|
423
|
+
const viewSearch = currentActiveView.configuration.search || "";
|
|
424
|
+
const viewVisibleColumns = [...currentActiveView.configuration.visible_columns || []].sort();
|
|
425
|
+
const viewColumnOrder = currentActiveView.configuration.column_order || [];
|
|
426
|
+
const filterKeys = /* @__PURE__ */ new Set([...Object.keys(currentFilters), ...Object.keys(viewFilters)]);
|
|
427
|
+
for (const key of filterKeys) {
|
|
428
|
+
if (JSON.stringify(currentFilters[key]) !== JSON.stringify(viewFilters[key])) {
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const normalizedCurrentSorting = currentSorting || void 0;
|
|
433
|
+
const normalizedViewSorting = viewSorting || void 0;
|
|
434
|
+
if (JSON.stringify(normalizedCurrentSorting) !== JSON.stringify(normalizedViewSorting)) {
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
if (currentSearch !== viewSearch) {
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
440
|
+
if (JSON.stringify(currentVisibleColumns) !== JSON.stringify(viewVisibleColumns)) {
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
if (JSON.stringify(columnOrder) !== JSON.stringify(viewColumnOrder)) {
|
|
444
|
+
return true;
|
|
445
|
+
}
|
|
446
|
+
} else {
|
|
447
|
+
if (Object.keys(currentFilters).length > 0) return true;
|
|
448
|
+
if (currentSorting !== null) return true;
|
|
449
|
+
if (currentSearch !== "") return true;
|
|
450
|
+
if (apiColumns) {
|
|
451
|
+
const currentVisibleSet = new Set(currentVisibleColumns);
|
|
452
|
+
const defaultVisibleSet = new Set(
|
|
453
|
+
apiColumns.filter((col) => col.default_visible).map((col) => col.field)
|
|
454
|
+
);
|
|
455
|
+
if (currentVisibleSet.size !== defaultVisibleSet.size || [...currentVisibleSet].some((field) => !defaultVisibleSet.has(field))) {
|
|
456
|
+
return true;
|
|
457
|
+
}
|
|
458
|
+
const defaultOrder = apiColumns.sort((a, b) => (a.default_order ?? 500) - (b.default_order ?? 500)).map((col) => col.field);
|
|
459
|
+
if (JSON.stringify(columnOrder) !== JSON.stringify(defaultOrder)) {
|
|
460
|
+
return true;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return false;
|
|
465
|
+
}, [currentActiveView, visibleColumns, columnOrder, currentConfiguration, apiColumns]);
|
|
466
|
+
useEffect2(() => {
|
|
467
|
+
const timer = setTimeout(() => {
|
|
468
|
+
setDebouncedHasConfigChanged(hasConfigurationChanged);
|
|
469
|
+
}, 50);
|
|
470
|
+
return () => clearTimeout(timer);
|
|
471
|
+
}, [hasConfigurationChanged]);
|
|
472
|
+
const handleClearConfiguration = useCallback2(() => {
|
|
473
|
+
if (apiColumns) {
|
|
474
|
+
originalHandleViewChange(currentActiveView, apiColumns);
|
|
475
|
+
}
|
|
476
|
+
setSearchParams((prev) => {
|
|
477
|
+
const keysToDelete = Array.from(prev.keys()).filter(
|
|
478
|
+
(key) => key.startsWith(queryPrefix + "_") || key === queryPrefix + "_q" || key === queryPrefix + "_order"
|
|
479
|
+
);
|
|
480
|
+
keysToDelete.forEach((key) => prev.delete(key));
|
|
481
|
+
if (currentActiveView?.configuration) {
|
|
482
|
+
const viewConfig = currentActiveView.configuration;
|
|
483
|
+
if (viewConfig.filters) {
|
|
484
|
+
Object.entries(viewConfig.filters).forEach(([key, value]) => {
|
|
485
|
+
prev.set(`${queryPrefix}_${key}`, JSON.stringify(value));
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
if (viewConfig.sorting) {
|
|
489
|
+
const sortValue = viewConfig.sorting.desc ? `-${viewConfig.sorting.id}` : viewConfig.sorting.id;
|
|
490
|
+
prev.set(`${queryPrefix}_order`, sortValue);
|
|
491
|
+
}
|
|
492
|
+
if (viewConfig.search) {
|
|
493
|
+
prev.set(`${queryPrefix}_q`, viewConfig.search);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return prev;
|
|
497
|
+
});
|
|
498
|
+
}, [currentActiveView, apiColumns, queryPrefix]);
|
|
499
|
+
const requiredFields = useMemo2(() => {
|
|
500
|
+
return calculateRequiredFields(entity, apiColumns, visibleColumns);
|
|
501
|
+
}, [entity, apiColumns, visibleColumns]);
|
|
502
|
+
return {
|
|
503
|
+
activeView: currentActiveView,
|
|
504
|
+
createView,
|
|
505
|
+
updateView,
|
|
506
|
+
isViewConfigEnabled,
|
|
507
|
+
visibleColumns,
|
|
508
|
+
columnOrder,
|
|
509
|
+
currentColumns,
|
|
510
|
+
setColumnOrder,
|
|
511
|
+
handleColumnVisibilityChange,
|
|
512
|
+
currentConfiguration,
|
|
513
|
+
hasConfigurationChanged: debouncedHasConfigChanged,
|
|
514
|
+
handleClearConfiguration,
|
|
515
|
+
apiColumns,
|
|
516
|
+
isLoadingColumns,
|
|
517
|
+
queryParams,
|
|
518
|
+
requiredFields
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// src/hooks/table/columns/use-configurable-table-columns.tsx
|
|
523
|
+
import { useMemo as useMemo3 } from "react";
|
|
524
|
+
import { createDataTableColumnHelper } from "@medusajs/ui";
|
|
525
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
526
|
+
|
|
527
|
+
// src/lib/table/cell-renderers.tsx
|
|
528
|
+
import { Badge, StatusBadge, Tooltip } from "@medusajs/ui";
|
|
529
|
+
import ReactCountryFlag from "react-country-flag";
|
|
530
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
531
|
+
var cellRenderers = /* @__PURE__ */ new Map();
|
|
532
|
+
var getNestedValue = (obj, path) => {
|
|
533
|
+
return path.split(".").reduce((current, key) => current?.[key], obj);
|
|
534
|
+
};
|
|
535
|
+
var TextRenderer = (value, _row, _column, _t) => {
|
|
536
|
+
if (value === null || value === void 0) return "-";
|
|
537
|
+
return String(value);
|
|
538
|
+
};
|
|
539
|
+
var CountRenderer = (value, _row, _column, t) => {
|
|
540
|
+
const items = value || [];
|
|
541
|
+
const count = Array.isArray(items) ? items.length : 0;
|
|
542
|
+
return t("general.items", { count });
|
|
543
|
+
};
|
|
544
|
+
var StatusRenderer = (value, row, column, t) => {
|
|
545
|
+
if (!value) return "-";
|
|
546
|
+
if (column.field === "status" && row.status && (row.handle || row.is_giftcard !== void 0)) {
|
|
547
|
+
return /* @__PURE__ */ jsx2(ProductStatusCell, { status: row.status });
|
|
548
|
+
}
|
|
549
|
+
const getStatusColor = (status) => {
|
|
550
|
+
switch (status?.toLowerCase()) {
|
|
551
|
+
case "active":
|
|
552
|
+
case "published":
|
|
553
|
+
case "fulfilled":
|
|
554
|
+
case "paid":
|
|
555
|
+
return "green";
|
|
556
|
+
case "pending":
|
|
557
|
+
case "proposed":
|
|
558
|
+
case "processing":
|
|
559
|
+
return "orange";
|
|
560
|
+
case "draft":
|
|
561
|
+
return "grey";
|
|
562
|
+
case "rejected":
|
|
563
|
+
case "failed":
|
|
564
|
+
case "canceled":
|
|
565
|
+
return "red";
|
|
566
|
+
default:
|
|
567
|
+
return "grey";
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
const getTranslatedStatus = (status, column2) => {
|
|
571
|
+
if (!t) return status;
|
|
572
|
+
const lowerStatus = status.toLowerCase();
|
|
573
|
+
const camelCaseStatus = toCamelCase(lowerStatus);
|
|
574
|
+
switch (lowerStatus) {
|
|
575
|
+
case "active":
|
|
576
|
+
return t("general.active", "Active");
|
|
577
|
+
case "published":
|
|
578
|
+
return t("products.productStatus.published", "Published");
|
|
579
|
+
case "draft":
|
|
580
|
+
return t("orders.status.draft", "Draft");
|
|
581
|
+
case "pending":
|
|
582
|
+
return t("orders.status.pending", "Pending");
|
|
583
|
+
case "canceled":
|
|
584
|
+
return t("orders.status.canceled", "Canceled");
|
|
585
|
+
default:
|
|
586
|
+
if (column2.context === "payment") {
|
|
587
|
+
return t(`orders.payment.status.${camelCaseStatus}`, status);
|
|
588
|
+
}
|
|
589
|
+
if (column2.context === "fulfillment") {
|
|
590
|
+
return t(`orders.fulfillment.status.${camelCaseStatus}`, status);
|
|
591
|
+
}
|
|
592
|
+
return t(`status.${lowerStatus}`, status);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
const translatedValue = getTranslatedStatus(value, column);
|
|
596
|
+
return /* @__PURE__ */ jsx2(StatusBadge, { color: getStatusColor(value), children: translatedValue });
|
|
597
|
+
};
|
|
598
|
+
var BadgeListRenderer = (value, row, column, t) => {
|
|
599
|
+
if (column.field === "sales_channels_display" || column.field === "sales_channels") {
|
|
600
|
+
return /* @__PURE__ */ jsx2(SalesChannelsCell, { salesChannels: row.sales_channels });
|
|
601
|
+
}
|
|
602
|
+
if (!Array.isArray(value)) return "-";
|
|
603
|
+
const items = value.slice(0, 2);
|
|
604
|
+
const remaining = value.length - 2;
|
|
605
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex gap-1", children: [
|
|
606
|
+
items.map((item, index) => /* @__PURE__ */ jsx2(Badge, { size: "xsmall", children: typeof item === "string" ? item : item.name || item.title || "-" }, index)),
|
|
607
|
+
remaining > 0 && /* @__PURE__ */ jsx2(Badge, { size: "xsmall", color: "grey", children: t ? t("general.plusCountMore", "+ {{count}} more", { count: remaining }) : `+${remaining}` })
|
|
608
|
+
] });
|
|
609
|
+
};
|
|
610
|
+
var ProductInfoRenderer = (_, row, _column, _t) => {
|
|
611
|
+
return /* @__PURE__ */ jsx2(ProductCell, { product: row });
|
|
612
|
+
};
|
|
613
|
+
var CollectionRenderer = (_, row, _column, _t) => {
|
|
614
|
+
return /* @__PURE__ */ jsx2(CollectionCell, { collection: row.collection });
|
|
615
|
+
};
|
|
616
|
+
var VariantsRenderer = (_, row, _column, _t) => {
|
|
617
|
+
return /* @__PURE__ */ jsx2(VariantCell, { variants: row.variants });
|
|
618
|
+
};
|
|
619
|
+
var CustomerNameRenderer = (_, row, _column, t) => {
|
|
620
|
+
if (row.customer?.first_name || row.customer?.last_name) {
|
|
621
|
+
const fullName = `${row.customer.first_name || ""} ${row.customer.last_name || ""}`.trim();
|
|
622
|
+
if (fullName) return fullName;
|
|
623
|
+
}
|
|
624
|
+
if (row.customer?.email) {
|
|
625
|
+
return row.customer.email;
|
|
626
|
+
}
|
|
627
|
+
if (row.customer?.phone) {
|
|
628
|
+
return row.customer.phone;
|
|
629
|
+
}
|
|
630
|
+
return t ? t("customers.guest", "Guest") : "Guest";
|
|
631
|
+
};
|
|
632
|
+
var AddressSummaryRenderer = (_, row, column, _t) => {
|
|
633
|
+
let address = null;
|
|
634
|
+
if (column.field === "shipping_address_display") {
|
|
635
|
+
address = row.shipping_address;
|
|
636
|
+
} else if (column.field === "billing_address_display") {
|
|
637
|
+
address = row.billing_address;
|
|
638
|
+
} else {
|
|
639
|
+
address = row.shipping_address || row.billing_address;
|
|
640
|
+
}
|
|
641
|
+
if (!address) return "-";
|
|
642
|
+
const parts = [];
|
|
643
|
+
if (address.address_1) {
|
|
644
|
+
parts.push(address.address_1);
|
|
645
|
+
}
|
|
646
|
+
const locationParts = [];
|
|
647
|
+
if (address.city) locationParts.push(address.city);
|
|
648
|
+
if (address.province) locationParts.push(address.province);
|
|
649
|
+
if (address.postal_code) locationParts.push(address.postal_code);
|
|
650
|
+
if (locationParts.length > 0) {
|
|
651
|
+
parts.push(locationParts.join(", "));
|
|
652
|
+
}
|
|
653
|
+
if (address.country_code) {
|
|
654
|
+
parts.push(address.country_code.toUpperCase());
|
|
655
|
+
}
|
|
656
|
+
return parts.join(" \u2022 ") || "-";
|
|
657
|
+
};
|
|
658
|
+
var CountryCodeRenderer = (_, row, _column, _t) => {
|
|
659
|
+
const countryCode = row.shipping_address?.country_code;
|
|
660
|
+
if (!countryCode) return /* @__PURE__ */ jsx2("div", { className: "flex w-full justify-center", children: "-" });
|
|
661
|
+
const country = getCountryByIso2(countryCode);
|
|
662
|
+
const displayName = country?.display_name || countryCode.toUpperCase();
|
|
663
|
+
return /* @__PURE__ */ jsx2("div", { className: "flex w-full items-center justify-center", children: /* @__PURE__ */ jsx2(Tooltip, { content: displayName, children: /* @__PURE__ */ jsx2("div", { className: "flex size-4 items-center justify-center overflow-hidden rounded-sm", children: /* @__PURE__ */ jsx2(
|
|
664
|
+
ReactCountryFlag,
|
|
665
|
+
{
|
|
666
|
+
countryCode: countryCode.toUpperCase(),
|
|
667
|
+
svg: true,
|
|
668
|
+
style: {
|
|
669
|
+
width: "16px",
|
|
670
|
+
height: "16px"
|
|
671
|
+
},
|
|
672
|
+
"aria-label": displayName
|
|
673
|
+
}
|
|
674
|
+
) }) }) });
|
|
675
|
+
};
|
|
676
|
+
var DateRenderer = (value, _row, _column, _t) => {
|
|
677
|
+
return /* @__PURE__ */ jsx2(DateCell, { date: value });
|
|
678
|
+
};
|
|
679
|
+
var DisplayIdRenderer = (value, _row, _column, _t) => {
|
|
680
|
+
return /* @__PURE__ */ jsx2(DisplayIdCell, { displayId: value });
|
|
681
|
+
};
|
|
682
|
+
var CurrencyRenderer = (value, row, _column, _t) => {
|
|
683
|
+
const currencyCode = row.currency_code || "USD";
|
|
684
|
+
return /* @__PURE__ */ jsx2(MoneyAmountCell, { currencyCode, amount: value, align: "right" });
|
|
685
|
+
};
|
|
686
|
+
var TotalRenderer = (value, row, _column, _t) => {
|
|
687
|
+
const currencyCode = row.currency_code || "USD";
|
|
688
|
+
return /* @__PURE__ */ jsx2(TotalCell, { currencyCode, total: value });
|
|
689
|
+
};
|
|
690
|
+
cellRenderers.set("text", TextRenderer);
|
|
691
|
+
cellRenderers.set("count", CountRenderer);
|
|
692
|
+
cellRenderers.set("status", StatusRenderer);
|
|
693
|
+
cellRenderers.set("badge_list", BadgeListRenderer);
|
|
694
|
+
cellRenderers.set("date", DateRenderer);
|
|
695
|
+
cellRenderers.set("timestamp", DateRenderer);
|
|
696
|
+
cellRenderers.set("currency", CurrencyRenderer);
|
|
697
|
+
cellRenderers.set("total", TotalRenderer);
|
|
698
|
+
cellRenderers.set("product_info", ProductInfoRenderer);
|
|
699
|
+
cellRenderers.set("collection", CollectionRenderer);
|
|
700
|
+
cellRenderers.set("variants", VariantsRenderer);
|
|
701
|
+
cellRenderers.set("sales_channels_list", BadgeListRenderer);
|
|
702
|
+
cellRenderers.set("customer_name", CustomerNameRenderer);
|
|
703
|
+
cellRenderers.set("address_summary", AddressSummaryRenderer);
|
|
704
|
+
cellRenderers.set("country_code", CountryCodeRenderer);
|
|
705
|
+
cellRenderers.set("display_id", DisplayIdRenderer);
|
|
706
|
+
function getCellRenderer(renderType, dataType) {
|
|
707
|
+
if (renderType && cellRenderers.has(renderType)) {
|
|
708
|
+
return cellRenderers.get(renderType);
|
|
709
|
+
}
|
|
710
|
+
switch (dataType) {
|
|
711
|
+
case "number":
|
|
712
|
+
case "string":
|
|
713
|
+
return TextRenderer;
|
|
714
|
+
case "date":
|
|
715
|
+
return DateRenderer;
|
|
716
|
+
case "boolean":
|
|
717
|
+
return (value, _row, _column, t) => {
|
|
718
|
+
if (t) {
|
|
719
|
+
return value ? t("fields.yes", "Yes") : t("fields.no", "No");
|
|
720
|
+
}
|
|
721
|
+
return value ? "Yes" : "No";
|
|
722
|
+
};
|
|
723
|
+
case "enum":
|
|
724
|
+
return StatusRenderer;
|
|
725
|
+
case "currency":
|
|
726
|
+
return CurrencyRenderer;
|
|
727
|
+
default:
|
|
728
|
+
return TextRenderer;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function getColumnValue(row, column) {
|
|
732
|
+
if (column.computed) {
|
|
733
|
+
return row;
|
|
734
|
+
}
|
|
735
|
+
return getNestedValue(row, column.field);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// src/hooks/table/columns/use-configurable-table-columns.tsx
|
|
739
|
+
function useConfigurableTableColumns(entity, apiColumns, adapter) {
|
|
740
|
+
const columnHelper = createDataTableColumnHelper();
|
|
741
|
+
const { t } = useTranslation2();
|
|
742
|
+
return useMemo3(() => {
|
|
743
|
+
if (!apiColumns?.length) {
|
|
744
|
+
return [];
|
|
745
|
+
}
|
|
746
|
+
return apiColumns.map((apiColumn) => {
|
|
747
|
+
let renderType = apiColumn.computed?.type;
|
|
748
|
+
if (!renderType) {
|
|
749
|
+
if (apiColumn.semantic_type === "timestamp") {
|
|
750
|
+
renderType = "timestamp";
|
|
751
|
+
} else if (apiColumn.field === "display_id") {
|
|
752
|
+
renderType = "display_id";
|
|
753
|
+
} else if (apiColumn.field === "total") {
|
|
754
|
+
renderType = "total";
|
|
755
|
+
} else if (apiColumn.semantic_type === "currency") {
|
|
756
|
+
renderType = "currency";
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
const renderer = getCellRenderer(
|
|
760
|
+
renderType,
|
|
761
|
+
apiColumn.data_type
|
|
762
|
+
);
|
|
763
|
+
const headerAlign = adapter?.getColumnAlignment ? adapter.getColumnAlignment(apiColumn) : getDefaultColumnAlignment(apiColumn);
|
|
764
|
+
const accessor = (row) => getColumnValue(row, apiColumn);
|
|
765
|
+
return columnHelper.accessor(accessor, {
|
|
766
|
+
id: apiColumn.field,
|
|
767
|
+
header: () => apiColumn.name,
|
|
768
|
+
cell: ({ getValue, row }) => {
|
|
769
|
+
const value = getValue();
|
|
770
|
+
if (adapter?.transformCellValue) {
|
|
771
|
+
const transformed = adapter.transformCellValue(value, row.original, apiColumn);
|
|
772
|
+
if (transformed !== null) {
|
|
773
|
+
return transformed;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
return renderer(value, row.original, apiColumn, t);
|
|
777
|
+
},
|
|
778
|
+
meta: {
|
|
779
|
+
name: apiColumn.name,
|
|
780
|
+
column: apiColumn
|
|
781
|
+
// Store column metadata for future use
|
|
782
|
+
},
|
|
783
|
+
enableHiding: apiColumn.hideable,
|
|
784
|
+
enableSorting: false,
|
|
785
|
+
// Disable sorting for all columns by default
|
|
786
|
+
headerAlign
|
|
787
|
+
// Pass the header alignment to the DataTable
|
|
788
|
+
});
|
|
789
|
+
});
|
|
790
|
+
}, [entity, apiColumns, adapter, t]);
|
|
791
|
+
}
|
|
792
|
+
function getDefaultColumnAlignment(column) {
|
|
793
|
+
if (column.semantic_type === "currency" || column.data_type === "currency") {
|
|
794
|
+
return "right";
|
|
795
|
+
}
|
|
796
|
+
if (column.data_type === "number" && column.context !== "identifier") {
|
|
797
|
+
return "right";
|
|
798
|
+
}
|
|
799
|
+
if (column.field.includes("total") || column.field.includes("amount") || column.field.includes("price") || column.field.includes("quantity") || column.field.includes("count")) {
|
|
800
|
+
return "right";
|
|
801
|
+
}
|
|
802
|
+
if (column.semantic_type === "status") {
|
|
803
|
+
return "center";
|
|
804
|
+
}
|
|
805
|
+
if (column.computed?.type === "country_code" || column.field === "country" || column.field.includes("country_code")) {
|
|
806
|
+
return "center";
|
|
807
|
+
}
|
|
808
|
+
return "left";
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// src/lib/table/entity-adapters.tsx
|
|
812
|
+
var orderColumnAdapter = {
|
|
813
|
+
getColumnAlignment: (column) => {
|
|
814
|
+
if (column.semantic_type === "currency") {
|
|
815
|
+
return "right";
|
|
816
|
+
}
|
|
817
|
+
if (column.semantic_type === "status") {
|
|
818
|
+
return "center";
|
|
819
|
+
}
|
|
820
|
+
if (column.computed?.type === "country_code") {
|
|
821
|
+
return "center";
|
|
822
|
+
}
|
|
823
|
+
return "left";
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
var productColumnAdapter = {
|
|
827
|
+
getColumnAlignment: (column) => {
|
|
828
|
+
if (column.field === "product_display") {
|
|
829
|
+
return "left";
|
|
830
|
+
}
|
|
831
|
+
if (column.field === "collection.title") {
|
|
832
|
+
return "left";
|
|
833
|
+
}
|
|
834
|
+
if (column.field === "sales_channels_display") {
|
|
835
|
+
return "left";
|
|
836
|
+
}
|
|
837
|
+
if (column.field === "variants_count") {
|
|
838
|
+
return "left";
|
|
839
|
+
}
|
|
840
|
+
if (column.field === "sku") {
|
|
841
|
+
return "center";
|
|
842
|
+
}
|
|
843
|
+
if (column.field === "stock") {
|
|
844
|
+
return "right";
|
|
845
|
+
}
|
|
846
|
+
if (column.semantic_type === "currency") {
|
|
847
|
+
return "right";
|
|
848
|
+
}
|
|
849
|
+
if (column.semantic_type === "status") {
|
|
850
|
+
return "left";
|
|
851
|
+
}
|
|
852
|
+
if (column.computed?.type === "product_info") {
|
|
853
|
+
return "left";
|
|
854
|
+
}
|
|
855
|
+
if (column.computed?.type === "count") {
|
|
856
|
+
return "left";
|
|
857
|
+
}
|
|
858
|
+
if (column.computed?.type === "sales_channels_list") {
|
|
859
|
+
return "left";
|
|
860
|
+
}
|
|
861
|
+
return "left";
|
|
862
|
+
},
|
|
863
|
+
transformCellValue: (_value, row, column) => {
|
|
864
|
+
if (column.field === "variants_count" || column.computed?.type === "count") {
|
|
865
|
+
const count = Array.isArray(row.variants) ? row.variants.length : 0;
|
|
866
|
+
return `${count} ${count === 1 ? "variant" : "variants"}`;
|
|
867
|
+
}
|
|
868
|
+
if (column.field === "product_display" || column.computed?.type === "product_info") {
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
if (column.field === "sales_channels_display" || column.computed?.type === "sales_channels_list") {
|
|
872
|
+
return null;
|
|
873
|
+
}
|
|
874
|
+
if (column.field === "status") {
|
|
875
|
+
return null;
|
|
876
|
+
}
|
|
877
|
+
return null;
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
var customerColumnAdapter = {
|
|
881
|
+
getColumnAlignment: (column) => {
|
|
882
|
+
if (column.field === "orders_count") {
|
|
883
|
+
return "right";
|
|
884
|
+
}
|
|
885
|
+
if (column.semantic_type === "currency") {
|
|
886
|
+
return "right";
|
|
887
|
+
}
|
|
888
|
+
if (column.semantic_type === "status") {
|
|
889
|
+
return "center";
|
|
890
|
+
}
|
|
891
|
+
return "left";
|
|
892
|
+
},
|
|
893
|
+
transformCellValue: (_value, row, column) => {
|
|
894
|
+
if (column.field === "name") {
|
|
895
|
+
const { first_name, last_name } = row;
|
|
896
|
+
if (first_name || last_name) {
|
|
897
|
+
return `${first_name || ""} ${last_name || ""}`.trim();
|
|
898
|
+
}
|
|
899
|
+
return "-";
|
|
900
|
+
}
|
|
901
|
+
return null;
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
var inventoryColumnAdapter = {
|
|
905
|
+
getColumnAlignment: (column) => {
|
|
906
|
+
if (column.field === "stocked_quantity") {
|
|
907
|
+
return "right";
|
|
908
|
+
}
|
|
909
|
+
if (column.field === "reserved_quantity") {
|
|
910
|
+
return "right";
|
|
911
|
+
}
|
|
912
|
+
if (column.field === "available_quantity") {
|
|
913
|
+
return "right";
|
|
914
|
+
}
|
|
915
|
+
if (column.semantic_type === "status") {
|
|
916
|
+
return "center";
|
|
917
|
+
}
|
|
918
|
+
return "left";
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
var entityAdapters = {
|
|
922
|
+
orders: orderColumnAdapter,
|
|
923
|
+
products: productColumnAdapter,
|
|
924
|
+
customers: customerColumnAdapter,
|
|
925
|
+
inventory: inventoryColumnAdapter
|
|
926
|
+
};
|
|
927
|
+
function getEntityAdapter(entity) {
|
|
928
|
+
return entityAdapters[entity];
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// src/components/table/configurable-data-table/configurable-data-table.tsx
|
|
932
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
933
|
+
function ConfigurableDataTable({
|
|
934
|
+
adapter,
|
|
935
|
+
heading,
|
|
936
|
+
subHeading,
|
|
937
|
+
pageSize: pageSizeProp,
|
|
938
|
+
queryPrefix: queryPrefixProp,
|
|
939
|
+
layout = "fill",
|
|
940
|
+
actions
|
|
941
|
+
}) {
|
|
942
|
+
const { t } = useTranslation3();
|
|
943
|
+
const [saveDialogOpen, setSaveDialogOpen] = useState3(false);
|
|
944
|
+
const [editingView, setEditingView] = useState3(null);
|
|
945
|
+
const entity = adapter.entity;
|
|
946
|
+
const entityName = adapter.entityName;
|
|
947
|
+
const filters = adapter.filters || [];
|
|
948
|
+
const pageSize = pageSizeProp || adapter.pageSize || 20;
|
|
949
|
+
const queryPrefix = queryPrefixProp || adapter.queryPrefix || "";
|
|
950
|
+
const {
|
|
951
|
+
activeView,
|
|
952
|
+
createView,
|
|
953
|
+
updateView,
|
|
954
|
+
isViewConfigEnabled,
|
|
955
|
+
visibleColumns,
|
|
956
|
+
columnOrder,
|
|
957
|
+
currentColumns,
|
|
958
|
+
setColumnOrder,
|
|
959
|
+
handleColumnVisibilityChange,
|
|
960
|
+
currentConfiguration,
|
|
961
|
+
hasConfigurationChanged,
|
|
962
|
+
handleClearConfiguration,
|
|
963
|
+
isLoadingColumns,
|
|
964
|
+
apiColumns,
|
|
965
|
+
requiredFields,
|
|
966
|
+
queryParams
|
|
967
|
+
} = useTableConfiguration({
|
|
968
|
+
entity,
|
|
969
|
+
pageSize,
|
|
970
|
+
queryPrefix,
|
|
971
|
+
filters
|
|
972
|
+
});
|
|
973
|
+
const parsedQueryParams = { ...queryParams };
|
|
974
|
+
filters.forEach((filter) => {
|
|
975
|
+
const filterKey = filter.id;
|
|
976
|
+
if (parsedQueryParams[filterKey] !== void 0) {
|
|
977
|
+
try {
|
|
978
|
+
parsedQueryParams[filterKey] = JSON.parse(parsedQueryParams[filterKey]);
|
|
979
|
+
} catch {
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
const searchParams = {
|
|
984
|
+
...parsedQueryParams,
|
|
985
|
+
fields: requiredFields,
|
|
986
|
+
limit: pageSize,
|
|
987
|
+
offset: parsedQueryParams.offset ? Number(parsedQueryParams.offset) : 0
|
|
988
|
+
};
|
|
989
|
+
const fetchResult = adapter.useData(requiredFields, searchParams);
|
|
990
|
+
const columnAdapter = adapter.columnAdapter || getEntityAdapter(entity);
|
|
991
|
+
const generatedColumns = useConfigurableTableColumns(entity, apiColumns || [], columnAdapter);
|
|
992
|
+
const columns = adapter.getColumns && apiColumns ? adapter.getColumns(apiColumns) : generatedColumns;
|
|
993
|
+
if (fetchResult.isError) {
|
|
994
|
+
throw fetchResult.error;
|
|
995
|
+
}
|
|
996
|
+
const handleSaveAsDefault = async () => {
|
|
997
|
+
try {
|
|
998
|
+
if (activeView?.is_system_default) {
|
|
999
|
+
await updateView.mutateAsync({
|
|
1000
|
+
name: activeView.name || null,
|
|
1001
|
+
configuration: {
|
|
1002
|
+
visible_columns: currentColumns.visible,
|
|
1003
|
+
column_order: currentColumns.order,
|
|
1004
|
+
filters: currentConfiguration.filters || {},
|
|
1005
|
+
sorting: currentConfiguration.sorting || null,
|
|
1006
|
+
search: currentConfiguration.search || ""
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
} else {
|
|
1010
|
+
await createView.mutateAsync({
|
|
1011
|
+
name: "Default",
|
|
1012
|
+
is_system_default: true,
|
|
1013
|
+
set_active: true,
|
|
1014
|
+
configuration: {
|
|
1015
|
+
visible_columns: currentColumns.visible,
|
|
1016
|
+
column_order: currentColumns.order,
|
|
1017
|
+
filters: currentConfiguration.filters || {},
|
|
1018
|
+
sorting: currentConfiguration.sorting || null,
|
|
1019
|
+
search: currentConfiguration.search || ""
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
} catch (_) {
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
const handleUpdateExisting = async () => {
|
|
1027
|
+
if (!activeView) return;
|
|
1028
|
+
try {
|
|
1029
|
+
await updateView.mutateAsync({
|
|
1030
|
+
name: activeView.name,
|
|
1031
|
+
configuration: {
|
|
1032
|
+
visible_columns: currentColumns.visible,
|
|
1033
|
+
column_order: currentColumns.order,
|
|
1034
|
+
filters: currentConfiguration.filters || {},
|
|
1035
|
+
sorting: currentConfiguration.sorting || null,
|
|
1036
|
+
search: currentConfiguration.search || ""
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
} catch (_) {
|
|
1040
|
+
}
|
|
1041
|
+
};
|
|
1042
|
+
const handleSaveAsNew = () => {
|
|
1043
|
+
setSaveDialogOpen(true);
|
|
1044
|
+
setEditingView(null);
|
|
1045
|
+
};
|
|
1046
|
+
const filterBarContent = hasConfigurationChanged ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1047
|
+
/* @__PURE__ */ jsx3(
|
|
1048
|
+
Button2,
|
|
1049
|
+
{
|
|
1050
|
+
variant: "secondary",
|
|
1051
|
+
size: "small",
|
|
1052
|
+
type: "button",
|
|
1053
|
+
onClick: handleClearConfiguration,
|
|
1054
|
+
children: t("actions.clear")
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
/* @__PURE__ */ jsx3(
|
|
1058
|
+
SaveViewDropdown,
|
|
1059
|
+
{
|
|
1060
|
+
isDefaultView: activeView?.is_system_default || !activeView,
|
|
1061
|
+
currentViewId: activeView?.id,
|
|
1062
|
+
currentViewName: activeView?.name,
|
|
1063
|
+
onSaveAsDefault: handleSaveAsDefault,
|
|
1064
|
+
onUpdateExisting: handleUpdateExisting,
|
|
1065
|
+
onSaveAsNew: handleSaveAsNew
|
|
1066
|
+
}
|
|
1067
|
+
)
|
|
1068
|
+
] }) : null;
|
|
1069
|
+
return /* @__PURE__ */ jsxs3(Container, { className: "divide-y p-0", children: [
|
|
1070
|
+
/* @__PURE__ */ jsx3(
|
|
1071
|
+
DataTable,
|
|
1072
|
+
{
|
|
1073
|
+
data: fetchResult.data || [],
|
|
1074
|
+
columns,
|
|
1075
|
+
filters,
|
|
1076
|
+
getRowId: adapter.getRowId || ((row) => row.id),
|
|
1077
|
+
rowCount: fetchResult.count,
|
|
1078
|
+
enablePagination: true,
|
|
1079
|
+
enableSearch: true,
|
|
1080
|
+
pageSize,
|
|
1081
|
+
isLoading: fetchResult.isLoading || isLoadingColumns,
|
|
1082
|
+
layout,
|
|
1083
|
+
heading: heading || entityName || (entity ? t(`${entity}.domain`) : ""),
|
|
1084
|
+
subHeading,
|
|
1085
|
+
enableColumnVisibility: isViewConfigEnabled,
|
|
1086
|
+
initialColumnVisibility: visibleColumns,
|
|
1087
|
+
onColumnVisibilityChange: handleColumnVisibilityChange,
|
|
1088
|
+
columnOrder,
|
|
1089
|
+
onColumnOrderChange: setColumnOrder,
|
|
1090
|
+
enableViewSelector: isViewConfigEnabled,
|
|
1091
|
+
entity,
|
|
1092
|
+
currentColumns,
|
|
1093
|
+
filterBarContent,
|
|
1094
|
+
rowHref: adapter.getRowHref,
|
|
1095
|
+
emptyState: adapter.emptyState || {
|
|
1096
|
+
empty: {
|
|
1097
|
+
heading: t(`${entity}.list.noRecordsMessage`)
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
prefix: queryPrefix,
|
|
1101
|
+
actions,
|
|
1102
|
+
enableFilterMenu: false
|
|
1103
|
+
}
|
|
1104
|
+
),
|
|
1105
|
+
saveDialogOpen && /* @__PURE__ */ jsx3(
|
|
1106
|
+
SaveViewDialog,
|
|
1107
|
+
{
|
|
1108
|
+
entity,
|
|
1109
|
+
currentColumns,
|
|
1110
|
+
currentConfiguration,
|
|
1111
|
+
editingView,
|
|
1112
|
+
onClose: () => {
|
|
1113
|
+
setSaveDialogOpen(false);
|
|
1114
|
+
setEditingView(null);
|
|
1115
|
+
},
|
|
1116
|
+
onSaved: () => {
|
|
1117
|
+
setSaveDialogOpen(false);
|
|
1118
|
+
setEditingView(null);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
] });
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// src/lib/table/table-adapters.ts
|
|
1126
|
+
function createTableAdapter(adapter) {
|
|
1127
|
+
return {
|
|
1128
|
+
// Provide smart defaults
|
|
1129
|
+
getRowId: (row) => row.id,
|
|
1130
|
+
pageSize: 20,
|
|
1131
|
+
queryPrefix: "",
|
|
1132
|
+
...adapter
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
export {
|
|
1137
|
+
orderColumnAdapter,
|
|
1138
|
+
productColumnAdapter,
|
|
1139
|
+
ConfigurableDataTable,
|
|
1140
|
+
createTableAdapter
|
|
1141
|
+
};
|