@medusajs/dashboard 3.0.0-snapshot-20251216135612 → 3.0.0-snapshot-20260102125810
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-locales-2OZXZCT5.mjs +81 -0
- package/dist/{adjust-inventory-26YXAXQL.mjs → adjust-inventory-47KGDWME.mjs} +2 -2
- package/dist/{api-key-management-create-EMP32G2D.mjs → api-key-management-create-EFPPZPZ7.mjs} +4 -4
- package/dist/{api-key-management-detail-6RCDH73M.mjs → api-key-management-detail-4IFED7SF.mjs} +15 -15
- package/dist/{api-key-management-edit-IBM3ZXHK.mjs → api-key-management-edit-QGVBNLUL.mjs} +4 -4
- package/dist/{api-key-management-list-KC5GOWAU.mjs → api-key-management-list-ROIJIIPQ.mjs} +4 -4
- package/dist/{api-key-management-sales-channels-LUB5G6RC.mjs → api-key-management-sales-channels-7P5L45AT.mjs} +6 -6
- package/dist/app.css +39 -3
- package/dist/app.js +18590 -16625
- package/dist/app.mjs +13 -13
- package/dist/{campaign-create-FJOECKGT.mjs → campaign-create-EZGZ4SBQ.mjs} +3 -3
- package/dist/{campaign-detail-5Q4BYCPX.mjs → campaign-detail-NFKLFPY4.mjs} +12 -12
- package/dist/{categories-metadata-J7M3XWI7.mjs → categories-metadata-G7BACZ26.mjs} +12 -12
- package/dist/{category-create-KHJZSC7G.mjs → category-create-7MV25HYX.mjs} +6 -6
- package/dist/{category-detail-S5IPXMHX.mjs → category-detail-XJQQ7UU4.mjs} +14 -14
- package/dist/{category-edit-CTA2EPDG.mjs → category-edit-LV7EARAB.mjs} +3 -3
- package/dist/{category-list-QBYJ4T3R.mjs → category-list-NIVLV5S3.mjs} +6 -6
- package/dist/{category-organize-SXP33XET.mjs → category-organize-SCRGWKDG.mjs} +3 -3
- package/dist/{category-products-KPW6BA5J.mjs → category-products-FXFSMCR6.mjs} +13 -13
- package/dist/{chunk-OXPE5TAY.mjs → chunk-24C2YVFU.mjs} +1 -1
- package/dist/{chunk-4JQR6QNW.mjs → chunk-333HK6Y6.mjs} +2 -2
- package/dist/{chunk-DODQ3KJT.mjs → chunk-3RRA56WC.mjs} +8 -3
- package/dist/{chunk-5LGRZSEH.mjs → chunk-3YPZ3R4U.mjs} +1 -1
- package/dist/{chunk-2DULKOPN.mjs → chunk-5ISRTMYH.mjs} +1 -1
- package/dist/{chunk-PHLCT2HA.mjs → chunk-5ZPKY5XP.mjs} +1 -1
- package/dist/{chunk-U6G4M5LP.mjs → chunk-6EXKKRZY.mjs} +1 -1
- package/dist/{chunk-GRZSG4EP.mjs → chunk-74WPAWMW.mjs} +127 -226
- package/dist/chunk-7AXHHXCX.mjs +4 -0
- package/dist/{chunk-YKYVCQRS.mjs → chunk-BJ44US4R.mjs} +382 -242
- package/dist/{chunk-BMS2QLJY.mjs → chunk-BMJ5RYIO.mjs} +1 -1
- package/dist/{chunk-Y2YVTIJI.mjs → chunk-CW5PQUJ6.mjs} +1 -1
- package/dist/{chunk-IAV7IKJ6.mjs → chunk-DN5BRKVN.mjs} +1 -1
- package/dist/{chunk-RS7DWLEP.mjs → chunk-DQUXK4WW.mjs} +1 -1
- package/dist/{chunk-2XTBDCGE.mjs → chunk-DWH2OQFK.mjs} +1 -1
- package/dist/{chunk-CCQD65EY.mjs → chunk-FKNW5MLZ.mjs} +360 -288
- package/dist/{chunk-HTCYX4VD.mjs → chunk-G35UUG2P.mjs} +1 -1
- package/dist/{chunk-QKALAT7P.mjs → chunk-GGONMC2N.mjs} +1 -1
- package/dist/{chunk-FYWHE3W5.mjs → chunk-GJN5SXGZ.mjs} +1 -1
- package/dist/{chunk-CVHJAKLQ.mjs → chunk-HDO2UCKF.mjs} +1 -1
- package/dist/{chunk-3C6WQ7NH.mjs → chunk-IWNNQ6HA.mjs} +37 -3
- package/dist/{chunk-OL24RDYM.mjs → chunk-KHJL6MUQ.mjs} +8 -8
- package/dist/{chunk-6P4Q4AAP.mjs → chunk-KPI4WFJU.mjs} +3 -3
- package/dist/{chunk-AHZLMCZF.mjs → chunk-KSDXSKJ7.mjs} +1 -1
- package/dist/{chunk-BZKI5J2M.mjs → chunk-L7A2JIQY.mjs} +3 -3
- package/dist/{chunk-XY7A7GZJ.mjs → chunk-LEAMWI5H.mjs} +1 -1
- package/dist/{chunk-A4XYK3MY.mjs → chunk-LG5B2BVB.mjs} +2 -2
- package/dist/{chunk-23GTCEOV.mjs → chunk-ML7BA2NY.mjs} +1 -1
- package/dist/{chunk-OFN7DIZA.mjs → chunk-OYHFHBNL.mjs} +94 -7
- package/dist/{chunk-OSHH5GAS.mjs → chunk-Q34TRFIW.mjs} +1 -13
- package/dist/{chunk-UJ2TMPV4.mjs → chunk-QBIQEVTU.mjs} +0 -12
- package/dist/{chunk-YYOPBKME.mjs → chunk-QHRAWZGA.mjs} +3 -3
- package/dist/{chunk-A2WBKOXJ.mjs → chunk-SO2DE6MM.mjs} +2 -2
- package/dist/chunk-T6DDBLGY.mjs +13 -0
- package/dist/{chunk-EHU67PIM.mjs → chunk-TOCMU7UV.mjs} +7 -3
- package/dist/{chunk-YIOBBZUB.mjs → chunk-U7KANQ5A.mjs} +2 -2
- package/dist/{chunk-Z6BFNHEO.mjs → chunk-UCYUWNJL.mjs} +109 -62
- package/dist/{chunk-WYATCUOM.mjs → chunk-V2RGYIAG.mjs} +10 -10
- package/dist/{chunk-UWY5ZV66.mjs → chunk-VQ73B7ZZ.mjs} +1 -13
- package/dist/chunk-XD72PXRS.mjs +329 -0
- package/dist/{store-add-locales-VJ4RJ7UI.mjs → chunk-YFXI6CWD.mjs} +2 -67
- package/dist/{chunk-AWRCV3ME.mjs → chunk-YM4XGCHB.mjs} +1 -1
- package/dist/{chunk-ZMG5B4FG.mjs → chunk-ZGV5NOTE.mjs} +1 -1
- package/dist/{collection-add-products-FU2BS3D3.mjs → collection-add-products-YDMBU2JY.mjs} +13 -13
- package/dist/{collection-create-GWKWVT7B.mjs → collection-create-RXHEXU6T.mjs} +3 -3
- package/dist/{collection-detail-VJE7XHLV.mjs → collection-detail-75XPGVOX.mjs} +13 -13
- package/dist/{collection-edit-EZIO2BR5.mjs → collection-edit-CGF47VIN.mjs} +3 -3
- package/dist/{collection-list-IGA6SCNF.mjs → collection-list-75N5NYXQ.mjs} +18 -17
- package/dist/{collection-metadata-QK7MI3D2.mjs → collection-metadata-TGGC6HM2.mjs} +12 -12
- package/dist/{customer-detail-MOV2T3LF.mjs → customer-detail-KDLZ23B3.mjs} +17 -16
- package/dist/{customer-group-detail-6T7OXGQD.mjs → customer-group-detail-ZIAVMOYS.mjs} +12 -12
- package/dist/{customer-group-list-AJEAF5D2.mjs → customer-group-list-BDDC5VVZ.mjs} +15 -15
- package/dist/{customers-add-customer-group-QVTVSQYM.mjs → customers-add-customer-group-B3ASQGP6.mjs} +12 -12
- package/dist/{edit-inventory-item-H7DAZWIT.mjs → edit-inventory-item-OKAXQRJ5.mjs} +2 -2
- package/dist/{edit-inventory-item-attributes-7HTXXPGZ.mjs → edit-inventory-item-attributes-FVWDV6O5.mjs} +2 -2
- package/dist/{edit-reservation-OVTRZHJR.mjs → edit-reservation-3PU6YSNJ.mjs} +3 -3
- package/dist/{edit-rules-SMVRTCUP.mjs → edit-rules-LOJ3P4YB.mjs} +14 -14
- package/dist/en.json +85 -5
- package/dist/{inventory-create-ANYUM4P5.mjs → inventory-create-C2WWS7QR.mjs} +13 -13
- package/dist/{inventory-detail-ZPSEMYI2.mjs → inventory-detail-AKOZ4T3Z.mjs} +12 -12
- package/dist/{inventory-list-RXJPSVZE.mjs → inventory-list-DRFJIU2O.mjs} +2 -2
- package/dist/{inventory-metadata-FNEJ3RAT.mjs → inventory-metadata-N6CJZEWD.mjs} +12 -12
- package/dist/{inventory-stock-FD4ZM4BB.mjs → inventory-stock-IJ2N7LKC.mjs} +14 -14
- package/dist/{location-detail-N3GUZSY7.mjs → location-detail-PL4Y43RS.mjs} +16 -16
- package/dist/{location-fulfillment-providers-7ZUJAGNY.mjs → location-fulfillment-providers-2PLOVSXC.mjs} +17 -16
- package/dist/{location-sales-channels-P3QJTFDT.mjs → location-sales-channels-SZARSLWT.mjs} +5 -5
- package/dist/{location-service-zone-shipping-option-create-ZJ4GIBTJ.mjs → location-service-zone-shipping-option-create-CUNSAP24.mjs} +15 -15
- package/dist/{location-service-zone-shipping-option-edit-4CGPQ3VT.mjs → location-service-zone-shipping-option-edit-OJ462SVM.mjs} +1 -1
- package/dist/{location-service-zone-shipping-option-pricing-CR4BVYG3.mjs → location-service-zone-shipping-option-pricing-5HN2Z5RB.mjs} +2 -2
- package/dist/login-VBUNWZHI.mjs +301 -0
- package/dist/{manage-locations-7HH6R4UP.mjs → manage-locations-JPCSBA5D.mjs} +2 -2
- package/dist/{order-allocate-items-HZGGYJ42.mjs → order-allocate-items-6QHQASQJ.mjs} +4 -4
- package/dist/{order-create-claim-SCDJGM46.mjs → order-create-claim-ECVSH5GC.mjs} +22 -22
- package/dist/{order-create-edit-JIE3HDHP.mjs → order-create-edit-EVIOJIXE.mjs} +14 -13
- package/dist/{order-create-exchange-LQU4YN7F.mjs → order-create-exchange-ZVYYOGI3.mjs} +22 -22
- package/dist/{order-create-fulfillment-OWUVTZXW.mjs → order-create-fulfillment-FDIFEV6X.mjs} +16 -16
- package/dist/{order-create-refund-Q6HQY42R.mjs → order-create-refund-TNPGKR5P.mjs} +17 -17
- package/dist/{order-create-return-52GHGW5Z.mjs → order-create-return-NR6XQLDD.mjs} +9 -9
- package/dist/{order-create-shipment-WAGGEPRW.mjs → order-create-shipment-UP3WGRWB.mjs} +12 -12
- package/dist/{order-detail-PVPGEWGY.mjs → order-detail-F6D5DV74.mjs} +28 -28
- package/dist/{order-edit-billing-address-UM76J4KX.mjs → order-edit-billing-address-D4AJ6Z5Q.mjs} +44 -12
- package/dist/{order-edit-email-CL3KNOCM.mjs → order-edit-email-MXYA5BII.mjs} +12 -12
- package/dist/{order-edit-shipping-address-PIESTGVL.mjs → order-edit-shipping-address-GKW2ZPGR.mjs} +42 -12
- package/dist/{order-export-LE363ZLB.mjs → order-export-KQUI2TK7.mjs} +14 -14
- package/dist/{order-list-GRLQWN4L.mjs → order-list-7A5UKGXR.mjs} +11 -11
- package/dist/{order-metadata-FHBB7MTG.mjs → order-metadata-2IXELA7C.mjs} +12 -12
- package/dist/{order-receive-return-PRVKP6J2.mjs → order-receive-return-XXHOXGDC.mjs} +13 -13
- package/dist/{order-request-transfer-XSAGRUMT.mjs → order-request-transfer-2ENR64VR.mjs} +13 -13
- package/dist/{price-list-configuration-6S3MLNXQ.mjs → price-list-configuration-BZ3ZH5FY.mjs} +3 -3
- package/dist/{price-list-create-MFRUQADC.mjs → price-list-create-GFGNP6OS.mjs} +16 -16
- package/dist/{price-list-detail-Q5VG5VGW.mjs → price-list-detail-SNNOR5N7.mjs} +17 -17
- package/dist/{price-list-edit-53UW35L3.mjs → price-list-edit-YW5BXBF2.mjs} +3 -3
- package/dist/{price-list-list-DG5YEZ44.mjs → price-list-list-OF562HME.mjs} +4 -4
- package/dist/{price-list-prices-add-SDU5YZAT.mjs → price-list-prices-add-F7A2EV7L.mjs} +15 -15
- package/dist/{price-list-prices-edit-5USQR4D4.mjs → price-list-prices-edit-PQ26MOJE.mjs} +5 -5
- package/dist/{product-attributes-EFIRUBRO.mjs → product-attributes-JTPGHUXZ.mjs} +13 -13
- package/dist/{product-create-K6EWZHIT.mjs → product-create-VFLLQWVX.mjs} +485 -561
- package/dist/{product-create-variant-ERKHTEJZ.mjs → product-create-variant-PLZ5Q2R6.mjs} +14 -14
- package/dist/{product-detail-DKPZDEIY.mjs → product-detail-ISHFZV7X.mjs} +45 -66
- package/dist/{product-edit-55YXTIGO.mjs → product-edit-6EDDNIM6.mjs} +13 -13
- package/dist/{product-export-5AD7NELI.mjs → product-export-UMMROQ7T.mjs} +18 -17
- package/dist/{product-image-variants-edit-M6QF2RLE.mjs → product-image-variants-edit-VRG3AJID.mjs} +12 -12
- package/dist/{product-import-V3KQN4TV.mjs → product-import-EPS4KDID.mjs} +12 -12
- package/dist/{product-list-EUWZIFTM.mjs → product-list-37O7VB2L.mjs} +20 -20
- package/dist/{product-media-3VJ7KENL.mjs → product-media-IV5NUSLW.mjs} +3 -3
- package/dist/{product-metadata-GL2MVPDI.mjs → product-metadata-KTVRI7B3.mjs} +12 -12
- package/dist/product-option-create-JUGLFR2K.mjs +336 -0
- package/dist/product-option-detail-VVK3YBCE.mjs +331 -0
- package/dist/product-option-edit-7FQSKI2R.mjs +325 -0
- package/dist/product-option-list-YHGRI7OJ.mjs +268 -0
- package/dist/product-option-metadata-P2DHDGYR.mjs +73 -0
- package/dist/product-options-manage-4SZDF5H5.mjs +325 -0
- package/dist/{product-organization-N3VBRXF4.mjs → product-organization-OEUSIWNQ.mjs} +15 -15
- package/dist/{product-prices-4C36AG4R.mjs → product-prices-GUO3KM2U.mjs} +3 -3
- package/dist/{product-sales-channels-PPXUG4KT.mjs → product-sales-channels-BOZD3AC3.mjs} +5 -5
- package/dist/{product-shipping-profile-ETQFZ7DC.mjs → product-shipping-profile-FNFRDY47.mjs} +3 -3
- package/dist/{product-stock-VEGE6SUZ.mjs → product-stock-2DNYG73L.mjs} +14 -14
- package/dist/{product-tag-create-PQMDDKWH.mjs → product-tag-create-CW7GUCZW.mjs} +12 -12
- package/dist/{product-tag-detail-I3MBZX7U.mjs → product-tag-detail-IB5VIZ3K.mjs} +26 -25
- package/dist/{product-tag-edit-K3BBQLJR.mjs → product-tag-edit-ZSXD3DOC.mjs} +12 -12
- package/dist/{product-tag-list-JUWSOMB7.mjs → product-tag-list-MJO5PURP.mjs} +24 -23
- package/dist/{product-tag-metadata-MJH5LH7E.mjs → product-tag-metadata-DAKCXWZF.mjs} +12 -12
- package/dist/{product-type-create-DRFXTL5O.mjs → product-type-create-NRLNMABQ.mjs} +2 -2
- package/dist/{product-type-detail-RKHT5NBL.mjs → product-type-detail-J2IMAZW6.mjs} +14 -14
- package/dist/{product-type-edit-SRHCZDK7.mjs → product-type-edit-BHTPMMVI.mjs} +2 -2
- package/dist/{product-type-list-QQKAHBJ3.mjs → product-type-list-MQ2PW2IE.mjs} +3 -3
- package/dist/{product-type-metadata-CDJDFFGQ.mjs → product-type-metadata-BCZMUG3K.mjs} +12 -12
- package/dist/{product-variant-detail-XAYG5CKE.mjs → product-variant-detail-4L6DHT3K.mjs} +12 -12
- package/dist/{product-variant-edit-DEZEY2H2.mjs → product-variant-edit-PZU4P65H.mjs} +13 -13
- package/dist/{product-variant-manage-inventory-items-Y2VEOHP7.mjs → product-variant-manage-inventory-items-E3GPBPEZ.mjs} +3 -3
- package/dist/{product-variant-media-2WLVNGI4.mjs → product-variant-media-BSNCO642.mjs} +2 -2
- package/dist/{product-variant-metadata-VTZDNWUT.mjs → product-variant-metadata-FHGGZGPV.mjs} +12 -12
- package/dist/{promotion-add-campaign-DO67QK6M.mjs → promotion-add-campaign-NQSIFI33.mjs} +3 -3
- package/dist/{promotion-create-HWFNUQXG.mjs → promotion-create-GBZWJVAI.mjs} +24 -21
- package/dist/{promotion-detail-QC36KXB3.mjs → promotion-detail-W2OGUESO.mjs} +12 -12
- package/dist/{refund-reason-create-YHCDEHGQ.mjs → refund-reason-create-DLVRT5OU.mjs} +12 -12
- package/dist/{refund-reason-edit-CZ5QZ2SZ.mjs → refund-reason-edit-XCSU7RMH.mjs} +12 -12
- package/dist/{refund-reason-list-OJYYEYJE.mjs → refund-reason-list-G6UNVGPG.mjs} +18 -18
- package/dist/{region-create-NA7Y2LN4.mjs → region-create-2CRTF7HJ.mjs} +1 -1
- package/dist/{region-edit-WAU347DP.mjs → region-edit-IB3PJE7V.mjs} +1 -1
- package/dist/{region-metadata-H6XXUQ4S.mjs → region-metadata-WBEUKOI6.mjs} +12 -12
- package/dist/{reservation-create-ZCIYM6JI.mjs → reservation-create-ERFJUBME.mjs} +4 -4
- package/dist/{reservation-detail-LZAQL4XA.mjs → reservation-detail-Y6UZRZXY.mjs} +12 -12
- package/dist/{reservation-list-B47DXTA7.mjs → reservation-list-LEDZB7KL.mjs} +3 -3
- package/dist/{reservation-metadata-5HZSDDOK.mjs → reservation-metadata-7KH4EXMN.mjs} +12 -12
- package/dist/{return-reason-list-SCBGTOEI.mjs → return-reason-list-UUQAL464.mjs} +6 -6
- package/dist/{sales-channel-add-products-F7YV4MO5.mjs → sales-channel-add-products-GSPG7OTK.mjs} +14 -14
- package/dist/{sales-channel-create-MI7HHZYE.mjs → sales-channel-create-MM237EBQ.mjs} +3 -3
- package/dist/{sales-channel-detail-MXIPZCGA.mjs → sales-channel-detail-65ZFV2OI.mjs} +14 -14
- package/dist/{sales-channel-edit-VSHOIR37.mjs → sales-channel-edit-AC2J4N3M.mjs} +3 -3
- package/dist/{sales-channel-list-RLGL7FM3.mjs → sales-channel-list-LXLW7X3U.mjs} +14 -14
- package/dist/{sales-channel-metadata-M364R4RJ.mjs → sales-channel-metadata-QUAL2RH6.mjs} +13 -13
- package/dist/{shipping-option-type-create-C5WUWON7.mjs → shipping-option-type-create-EU75JC2Q.mjs} +12 -12
- package/dist/{shipping-option-type-detail-PENS2K73.mjs → shipping-option-type-detail-5GYEWATD.mjs} +13 -13
- package/dist/{shipping-option-type-edit-CIU5EHRP.mjs → shipping-option-type-edit-YR4JXT5M.mjs} +12 -12
- package/dist/{shipping-option-type-list-DIOX7VG7.mjs → shipping-option-type-list-BLC4Z5QW.mjs} +13 -13
- package/dist/{shipping-profile-metadata-75G2NNMA.mjs → shipping-profile-metadata-64YRWPDA.mjs} +12 -12
- package/dist/store-add-locales-TSMLNFZP.mjs +81 -0
- package/dist/{store-detail-JSNPOB2F.mjs → store-detail-3SS53LZR.mjs} +13 -13
- package/dist/{store-edit-5ZS562ZO.mjs → store-edit-SMEWFETF.mjs} +1 -1
- package/dist/{store-metadata-CYXTVJUE.mjs → store-metadata-IJGVDDA6.mjs} +12 -12
- package/dist/{tax-region-create-DWGL4EUT.mjs → tax-region-create-XLYIS5XX.mjs} +13 -13
- package/dist/{tax-region-detail-2AE2EFI3.mjs → tax-region-detail-66FKEGFB.mjs} +29 -28
- package/dist/{tax-region-edit-EEVEEU2Q.mjs → tax-region-edit-GBR4EDW7.mjs} +13 -13
- package/dist/{tax-region-province-detail-4ERSEQFF.mjs → tax-region-province-detail-OBA7Q7MQ.mjs} +29 -28
- package/dist/{tax-region-tax-override-create-PHCGEF7V.mjs → tax-region-tax-override-create-34WYD2QZ.mjs} +28 -27
- package/dist/{tax-region-tax-override-edit-SMRPSILC.mjs → tax-region-tax-override-edit-6WJVOGWA.mjs} +27 -26
- package/dist/translation-list-J65VNNAX.mjs +527 -0
- package/dist/{translations-edit-HUNKY7CO.mjs → translations-edit-6P3KC4MO.mjs} +285 -320
- package/dist/{user-detail-BJUXLZZQ.mjs → user-detail-VMOJFHIJ.mjs} +2 -2
- package/dist/{user-metadata-2WPJOEJA.mjs → user-metadata-UOPVFX2L.mjs} +12 -12
- package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-WAQ7IG4T.mjs} +12 -12
- package/package.json +9 -9
- package/src/components/data-grid/components/data-grid-cell-container.tsx +7 -10
- package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +1 -4
- package/src/components/data-grid/components/data-grid-root.tsx +68 -51
- package/src/components/data-grid/components/data-grid-text-cell.tsx +6 -76
- package/src/components/data-grid/components/index.ts +1 -0
- package/src/components/data-grid/data-grid.tsx +2 -0
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +12 -0
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +1 -0
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +65 -7
- package/src/components/data-grid/types.ts +1 -0
- package/src/components/inputs/combobox/combobox.tsx +185 -95
- package/src/components/layout/main-layout/main-layout.tsx +7 -4
- package/src/components/table/table-cells/order/country-cell/country-cell.tsx +5 -1
- package/src/dashboard-app/routes/get-route.map.tsx +68 -12
- package/src/hooks/api/cloud.tsx +41 -0
- package/src/hooks/api/index.ts +3 -1
- package/src/hooks/api/product-options.tsx +151 -0
- package/src/hooks/api/products.tsx +26 -66
- package/src/hooks/api/translations.tsx +103 -191
- package/src/hooks/table/columns/use-order-table-columns.tsx +5 -3
- package/src/hooks/table/columns/use-product-option-table-columns.tsx +44 -0
- package/src/hooks/table/filters/index.ts +1 -0
- package/src/hooks/table/filters/use-product-option-table-filters.tsx +33 -0
- package/src/hooks/table/query/use-product-option-table-query.tsx +34 -0
- package/src/i18n/translations/$schema.json +304 -12
- package/src/i18n/translations/en.json +85 -5
- package/src/i18n/translations/es.json +21 -1
- package/src/routes/customers/customer-detail/components/customer-order-section/customer-order-section.tsx +1 -1
- package/src/routes/login/components/cloud-auth-login.tsx +114 -0
- package/src/routes/login/login.tsx +9 -1
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +1 -0
- package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +34 -0
- package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/edit-order-shipping-address-form.tsx +32 -0
- package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +41 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +71 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +192 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +77 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +1 -0
- package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +15 -0
- package/src/routes/product-options/product-option-create/index.ts +1 -0
- package/src/routes/product-options/product-option-create/product-option-create.tsx +10 -0
- package/src/routes/product-options/product-option-detail/breadcrumb.tsx +14 -0
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +1 -0
- package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +84 -0
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +1 -0
- package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +82 -0
- package/src/routes/product-options/product-option-detail/index.ts +3 -0
- package/src/routes/product-options/product-option-detail/loader.ts +18 -0
- package/src/routes/product-options/product-option-detail/product-option-detail.tsx +50 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +94 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +116 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +77 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +1 -0
- package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +13 -0
- package/src/routes/product-options/product-option-edit/index.ts +1 -0
- package/src/routes/product-options/product-option-edit/product-option-edit.tsx +34 -0
- package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +1 -0
- package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +140 -0
- package/src/routes/product-options/product-option-list/index.ts +1 -0
- package/src/routes/product-options/product-option-list/product-option-list.tsx +19 -0
- package/src/routes/product-options/product-option-metadata/index.ts +1 -0
- package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +27 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +16 -4
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +327 -194
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +4 -7
- package/src/routes/products/product-create/constants.ts +2 -0
- package/src/routes/products/product-create/utils.ts +6 -1
- package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +33 -51
- package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +1 -0
- package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +296 -0
- package/src/routes/products/product-options-manage/index.ts +1 -0
- package/src/routes/products/product-options-manage/product-options-manage.tsx +35 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +6 -0
- package/src/routes/translations/add-locales/add-locales.tsx +29 -0
- package/src/routes/translations/add-locales/index.tsx +1 -0
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +42 -17
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +5 -1
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +253 -41
- package/src/routes/translations/translation-list/translation-list.tsx +8 -2
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +337 -380
- package/src/routes/translations/translations-edit/translations-edit.tsx +8 -13
- package/dist/chunk-HGRIOEAR.mjs +0 -32
- package/dist/chunk-XDJ7OMBR.mjs +0 -160
- package/dist/login-VNOLI5YG.mjs +0 -201
- package/dist/product-create-option-7AOXAA4S.mjs +0 -151
- package/dist/product-edit-option-LWJT3CYJ.mjs +0 -156
- package/dist/translation-list-S5Z6PG2R.mjs +0 -295
- package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +0 -122
- package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +0 -1
- package/src/routes/products/product-create-option/index.ts +0 -1
- package/src/routes/products/product-create-option/product-create-option.tsx +0 -30
- package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +0 -123
- package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +0 -1
- package/src/routes/products/product-edit-option/index.ts +0 -1
- package/src/routes/products/product-edit-option/product-edit-option.tsx +0 -35
- package/dist/{chunk-FBYTX6K7.mjs → chunk-ORWRXJJT.mjs} +4 -4
- package/dist/{location-list-KVBA6J47.mjs → location-list-3WP65J3E.mjs} +1 -1
- package/dist/{user-list-YTZQNYSO.mjs → user-list-3EAKK4XC.mjs} +3 -3
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
} from "./chunk-5BQQRHQS.mjs";
|
|
19
19
|
import {
|
|
20
20
|
productsQueryKeys
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-UCYUWNJL.mjs";
|
|
22
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
23
23
|
import {
|
|
24
24
|
queryClient
|
|
25
25
|
} from "./chunk-FXYH54JP.mjs";
|
|
@@ -12,37 +12,37 @@ import "./chunk-LPEUYMRK.mjs";
|
|
|
12
12
|
import "./chunk-OC7BQLYI.mjs";
|
|
13
13
|
import "./chunk-S4DMV3ZT.mjs";
|
|
14
14
|
import "./chunk-OBQI23QM.mjs";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-74WPAWMW.mjs";
|
|
16
16
|
import "./chunk-I4OBEAOJ.mjs";
|
|
17
17
|
import "./chunk-HI6URQ7H.mjs";
|
|
18
18
|
import "./chunk-6CLQKVAU.mjs";
|
|
19
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
19
20
|
import "./chunk-KI7TOXBR.mjs";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-23GTCEOV.mjs";
|
|
21
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
22
22
|
import "./chunk-WAXMT4IY.mjs";
|
|
23
23
|
import "./chunk-DYDGGABK.mjs";
|
|
24
|
-
import "./chunk-LGNTHZ5Y.mjs";
|
|
25
24
|
import "./chunk-CN7JXSGW.mjs";
|
|
25
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
26
26
|
import {
|
|
27
27
|
useUpdateUser,
|
|
28
28
|
useUser
|
|
29
29
|
} from "./chunk-5BQQRHQS.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-G35UUG2P.mjs";
|
|
31
31
|
import "./chunk-5AFMB7XQ.mjs";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
33
33
|
import "./chunk-A63RZVX6.mjs";
|
|
34
34
|
import "./chunk-HBXV7ENS.mjs";
|
|
35
35
|
import "./chunk-CDORR33H.mjs";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-2XTBDCGE.mjs";
|
|
36
|
+
import "./chunk-333HK6Y6.mjs";
|
|
37
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
38
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
40
39
|
import "./chunk-3BF5SC66.mjs";
|
|
40
|
+
import "./chunk-DWH2OQFK.mjs";
|
|
41
41
|
import "./chunk-VCSSQVPD.mjs";
|
|
42
42
|
import "./chunk-HP2JH45P.mjs";
|
|
43
43
|
import "./chunk-SQDIZZDW.mjs";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-UCYUWNJL.mjs";
|
|
45
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
46
46
|
import "./chunk-FXYH54JP.mjs";
|
|
47
47
|
import "./chunk-774WSTCC.mjs";
|
|
48
48
|
import "./chunk-NFEK63OE.mjs";
|
package/dist/{workflow-execution-detail-H2AKEZJX.mjs → workflow-execution-detail-WAQ7IG4T.mjs}
RENAMED
|
@@ -20,37 +20,37 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
useDocumentDirection
|
|
22
22
|
} from "./chunk-S4DMV3ZT.mjs";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-74WPAWMW.mjs";
|
|
24
24
|
import "./chunk-I4OBEAOJ.mjs";
|
|
25
25
|
import "./chunk-HI6URQ7H.mjs";
|
|
26
26
|
import "./chunk-6CLQKVAU.mjs";
|
|
27
|
+
import "./chunk-ML7BA2NY.mjs";
|
|
27
28
|
import {
|
|
28
29
|
useWorkflowExecution,
|
|
29
30
|
workflowExecutionsQueryKeys
|
|
30
31
|
} from "./chunk-KI7TOXBR.mjs";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-23GTCEOV.mjs";
|
|
32
|
+
import "./chunk-QBIQEVTU.mjs";
|
|
33
33
|
import "./chunk-WAXMT4IY.mjs";
|
|
34
34
|
import "./chunk-DYDGGABK.mjs";
|
|
35
|
-
import "./chunk-LGNTHZ5Y.mjs";
|
|
36
35
|
import "./chunk-CN7JXSGW.mjs";
|
|
36
|
+
import "./chunk-LGNTHZ5Y.mjs";
|
|
37
37
|
import "./chunk-5BQQRHQS.mjs";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-G35UUG2P.mjs";
|
|
39
39
|
import "./chunk-5AFMB7XQ.mjs";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-VQ73B7ZZ.mjs";
|
|
41
41
|
import "./chunk-A63RZVX6.mjs";
|
|
42
42
|
import "./chunk-HBXV7ENS.mjs";
|
|
43
43
|
import "./chunk-CDORR33H.mjs";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-2XTBDCGE.mjs";
|
|
44
|
+
import "./chunk-333HK6Y6.mjs";
|
|
45
|
+
import "./chunk-GJN5SXGZ.mjs";
|
|
46
|
+
import "./chunk-Q34TRFIW.mjs";
|
|
48
47
|
import "./chunk-3BF5SC66.mjs";
|
|
48
|
+
import "./chunk-DWH2OQFK.mjs";
|
|
49
49
|
import "./chunk-VCSSQVPD.mjs";
|
|
50
50
|
import "./chunk-HP2JH45P.mjs";
|
|
51
51
|
import "./chunk-SQDIZZDW.mjs";
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-UCYUWNJL.mjs";
|
|
53
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
54
54
|
import {
|
|
55
55
|
queryClient
|
|
56
56
|
} from "./chunk-FXYH54JP.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/dashboard",
|
|
3
|
-
"version": "3.0.0-snapshot-
|
|
3
|
+
"version": "3.0.0-snapshot-20260102125810",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
|
6
6
|
"dev": "../../../node_modules/.bin/vite",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
47
47
|
"@hookform/error-message": "^2.0.1",
|
|
48
48
|
"@hookform/resolvers": "3.4.2",
|
|
49
|
-
"@medusajs/admin-shared": "3.0.0-snapshot-
|
|
50
|
-
"@medusajs/icons": "3.0.0-snapshot-
|
|
51
|
-
"@medusajs/js-sdk": "3.0.0-snapshot-
|
|
52
|
-
"@medusajs/ui": "4.0.
|
|
49
|
+
"@medusajs/admin-shared": "3.0.0-snapshot-20260102125810",
|
|
50
|
+
"@medusajs/icons": "3.0.0-snapshot-20260102125810",
|
|
51
|
+
"@medusajs/js-sdk": "3.0.0-snapshot-20260102125810",
|
|
52
|
+
"@medusajs/ui": "4.0.32-snapshot-20260102125810",
|
|
53
53
|
"@radix-ui/react-dialog": "1.1.4",
|
|
54
54
|
"@radix-ui/react-dismissable-layer": "1.1.4",
|
|
55
55
|
"@tanstack/react-query": "5.64.2",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"zod": "3.25.76"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@medusajs/admin-shared": "3.0.0-snapshot-
|
|
84
|
-
"@medusajs/admin-vite-plugin": "3.0.0-snapshot-
|
|
85
|
-
"@medusajs/types": "3.0.0-snapshot-
|
|
86
|
-
"@medusajs/ui-preset": "3.0.0-snapshot-
|
|
83
|
+
"@medusajs/admin-shared": "3.0.0-snapshot-20260102125810",
|
|
84
|
+
"@medusajs/admin-vite-plugin": "3.0.0-snapshot-20260102125810",
|
|
85
|
+
"@medusajs/types": "3.0.0-snapshot-20260102125810",
|
|
86
|
+
"@medusajs/ui-preset": "3.0.0-snapshot-20260102125810"
|
|
87
87
|
},
|
|
88
88
|
"packageManager": "yarn@3.2.1"
|
|
89
89
|
}
|
|
@@ -21,21 +21,18 @@ export const DataGridCellContainer = ({
|
|
|
21
21
|
rowErrors,
|
|
22
22
|
outerComponent,
|
|
23
23
|
isMultiLine,
|
|
24
|
-
}: DataGridCellContainerProps &
|
|
24
|
+
}: DataGridCellContainerProps &
|
|
25
|
+
DataGridErrorRenderProps<any> & { isMultiLine?: boolean }) => {
|
|
25
26
|
const error = get(errors, field)
|
|
26
27
|
const hasError = !!error
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<div
|
|
30
|
-
className={clx("group/container relative w-full", {
|
|
31
|
-
"h-full": !isMultiLine,
|
|
32
|
-
})}
|
|
33
|
-
>
|
|
30
|
+
<div className={clx("group/container relative h-full w-full")}>
|
|
34
31
|
<div
|
|
35
32
|
className={clx(
|
|
36
|
-
"bg-ui-bg-base group/cell relative flex w-full gap-x-2 px-4 py-2.5 outline-none",
|
|
33
|
+
"bg-ui-bg-base group/cell relative flex h-full w-full gap-x-2 px-4 py-2.5 outline-none",
|
|
37
34
|
{
|
|
38
|
-
"
|
|
35
|
+
"items-center": !isMultiLine,
|
|
39
36
|
"items-start": isMultiLine,
|
|
40
37
|
"bg-ui-tag-red-bg text-ui-tag-red-text":
|
|
41
38
|
hasError && !isAnchor && !isSelected && !isDragSelected,
|
|
@@ -62,8 +59,8 @@ export const DataGridCellContainer = ({
|
|
|
62
59
|
}}
|
|
63
60
|
/>
|
|
64
61
|
<div
|
|
65
|
-
className={clx("relative z-[1] flex w-full", {
|
|
66
|
-
"
|
|
62
|
+
className={clx("relative z-[1] flex h-full w-full", {
|
|
63
|
+
"items-center justify-center": !isMultiLine,
|
|
67
64
|
"items-start": isMultiLine,
|
|
68
65
|
})}
|
|
69
66
|
>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { clx } from "@medusajs/ui"
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react"
|
|
3
|
+
import { Controller, ControllerRenderProps } from "react-hook-form"
|
|
4
|
+
|
|
5
|
+
import { useCombinedRefs } from "../../../hooks/use-combined-refs"
|
|
6
|
+
import { useDataGridCell, useDataGridCellError } from "../hooks"
|
|
7
|
+
import { DataGridCellProps, InputProps } from "../types"
|
|
8
|
+
import { DataGridCellContainer } from "./data-grid-cell-container"
|
|
9
|
+
|
|
10
|
+
export const DataGridMultilineCell = <TData, TValue = any>({
|
|
11
|
+
context,
|
|
12
|
+
}: DataGridCellProps<TData, TValue>) => {
|
|
13
|
+
const { field, control, renderProps } = useDataGridCell({
|
|
14
|
+
context,
|
|
15
|
+
})
|
|
16
|
+
const errorProps = useDataGridCellError({ context })
|
|
17
|
+
|
|
18
|
+
const { container, input } = renderProps
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Controller
|
|
22
|
+
control={control}
|
|
23
|
+
name={field}
|
|
24
|
+
render={({ field }) => {
|
|
25
|
+
return (
|
|
26
|
+
<DataGridCellContainer {...container} {...errorProps} isMultiLine>
|
|
27
|
+
<Inner field={field} inputProps={input} />
|
|
28
|
+
</DataGridCellContainer>
|
|
29
|
+
)
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const Inner = ({
|
|
36
|
+
field,
|
|
37
|
+
inputProps,
|
|
38
|
+
}: {
|
|
39
|
+
field: ControllerRenderProps<any, string>
|
|
40
|
+
inputProps: InputProps
|
|
41
|
+
}) => {
|
|
42
|
+
const { onChange: _, onBlur, ref, value, ...rest } = field
|
|
43
|
+
const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps
|
|
44
|
+
|
|
45
|
+
const [localValue, setLocalValue] = useState(value)
|
|
46
|
+
const textareaRef = useRef<HTMLTextAreaElement>(null)
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
setLocalValue(value)
|
|
50
|
+
}, [value])
|
|
51
|
+
|
|
52
|
+
const combinedRefs = useCombinedRefs(inputRef, ref, textareaRef)
|
|
53
|
+
|
|
54
|
+
const adjustTextareaHeight = useCallback(() => {
|
|
55
|
+
const textarea = textareaRef.current
|
|
56
|
+
if (textarea) {
|
|
57
|
+
// Reset height to 0 to get accurate scrollHeight
|
|
58
|
+
textarea.style.height = "0px"
|
|
59
|
+
// Set the height to match content (minimum 24px for min visible height)
|
|
60
|
+
const newHeight = Math.max(textarea.scrollHeight, 24)
|
|
61
|
+
textarea.style.height = `${newHeight}px`
|
|
62
|
+
}
|
|
63
|
+
}, [])
|
|
64
|
+
|
|
65
|
+
// Adjust height when value changes
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
adjustTextareaHeight()
|
|
68
|
+
}, [localValue, adjustTextareaHeight])
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
// Immediate adjustment
|
|
72
|
+
adjustTextareaHeight()
|
|
73
|
+
// Delayed adjustment to handle any layout shifts
|
|
74
|
+
const timeoutId = setTimeout(adjustTextareaHeight, 50)
|
|
75
|
+
return () => clearTimeout(timeoutId)
|
|
76
|
+
}, [adjustTextareaHeight])
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<textarea
|
|
80
|
+
className={clx(
|
|
81
|
+
"txt-compact-small text-ui-fg-subtle flex w-full cursor-pointer bg-transparent outline-none",
|
|
82
|
+
"focus:cursor-text",
|
|
83
|
+
"resize-none overflow-hidden py-2"
|
|
84
|
+
)}
|
|
85
|
+
autoComplete="off"
|
|
86
|
+
tabIndex={-1}
|
|
87
|
+
value={localValue ?? ""}
|
|
88
|
+
onChange={(e) => {
|
|
89
|
+
setLocalValue(e.target.value)
|
|
90
|
+
adjustTextareaHeight()
|
|
91
|
+
}}
|
|
92
|
+
ref={combinedRefs}
|
|
93
|
+
onBlur={() => {
|
|
94
|
+
onBlur()
|
|
95
|
+
onInputBlur()
|
|
96
|
+
onChange(localValue, value)
|
|
97
|
+
}}
|
|
98
|
+
{...input}
|
|
99
|
+
{...rest}
|
|
100
|
+
/>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -26,10 +26,7 @@ export const DataGridReadonlyCell = <TData, TValue = any>({
|
|
|
26
26
|
"txt-compact-small text-ui-fg-subtle flex w-full cursor-not-allowed justify-between overflow-hidden px-4 py-2.5 outline-none",
|
|
27
27
|
color === "muted" && "bg-ui-bg-subtle",
|
|
28
28
|
color === "normal" && "bg-ui-bg-base",
|
|
29
|
-
|
|
30
|
-
"h-full items-center": !isMultiLine,
|
|
31
|
-
"items-start": isMultiLine,
|
|
32
|
-
}
|
|
29
|
+
"h-full items-center"
|
|
33
30
|
)}
|
|
34
31
|
>
|
|
35
32
|
<div
|
|
@@ -64,6 +64,12 @@ export interface DataGridRootProps<
|
|
|
64
64
|
onEditingChange?: (isEditing: boolean) => void
|
|
65
65
|
disableInteractions?: boolean
|
|
66
66
|
multiColumnSelection?: boolean
|
|
67
|
+
showColumnsDropdown?: boolean
|
|
68
|
+
/**
|
|
69
|
+
* Custom content to render in the header, positioned between the column visibility
|
|
70
|
+
* controls and the error/shortcuts section.
|
|
71
|
+
*/
|
|
72
|
+
headerContent?: ReactNode
|
|
67
73
|
/**
|
|
68
74
|
* Lazy loading props - when totalRowCount is provided, the grid enters lazy loading mode.
|
|
69
75
|
* In this mode, the virtualizer will size based on totalRowCount and trigger onFetchMore
|
|
@@ -123,10 +129,12 @@ export const DataGridRoot = <
|
|
|
123
129
|
onEditingChange,
|
|
124
130
|
disableInteractions,
|
|
125
131
|
multiColumnSelection = false,
|
|
132
|
+
showColumnsDropdown = true,
|
|
126
133
|
totalRowCount,
|
|
127
134
|
onFetchMore,
|
|
128
135
|
isFetchingMore,
|
|
129
136
|
hasNextPage,
|
|
137
|
+
headerContent,
|
|
130
138
|
}: DataGridRootProps<TData, TFieldValues>) => {
|
|
131
139
|
// TODO: remove once everything is lazy loaded
|
|
132
140
|
const isLazyMode = totalRowCount !== undefined
|
|
@@ -653,6 +661,7 @@ export const DataGridRoot = <
|
|
|
653
661
|
<DataGridContext.Provider value={values}>
|
|
654
662
|
<div className="bg-ui-bg-subtle flex size-full flex-col">
|
|
655
663
|
<DataGridHeader
|
|
664
|
+
showColumnsDropdown={showColumnsDropdown}
|
|
656
665
|
columnOptions={columnOptions}
|
|
657
666
|
isDisabled={isColumsDisabled}
|
|
658
667
|
onToggleColumn={handleToggleColumnVisibility}
|
|
@@ -661,6 +670,7 @@ export const DataGridRoot = <
|
|
|
661
670
|
onResetColumns={handleResetColumns}
|
|
662
671
|
isHighlighted={isHighlighted}
|
|
663
672
|
onHeaderInteractionChange={handleHeaderInteractionChange}
|
|
673
|
+
headerContent={headerContent}
|
|
664
674
|
/>
|
|
665
675
|
<div className="size-full overflow-hidden">
|
|
666
676
|
<div
|
|
@@ -796,12 +806,14 @@ export const DataGridRoot = <
|
|
|
796
806
|
type DataGridHeaderProps = {
|
|
797
807
|
columnOptions: GridColumnOption[]
|
|
798
808
|
isDisabled: boolean
|
|
809
|
+
showColumnsDropdown: boolean
|
|
799
810
|
onToggleColumn: (index: number) => (value: boolean) => void
|
|
800
811
|
onResetColumns: () => void
|
|
801
812
|
isHighlighted: boolean
|
|
802
813
|
errorCount: number
|
|
803
814
|
onToggleErrorHighlighting: () => void
|
|
804
815
|
onHeaderInteractionChange: (isActive: boolean) => void
|
|
816
|
+
headerContent?: ReactNode
|
|
805
817
|
}
|
|
806
818
|
|
|
807
819
|
const DataGridHeader = ({
|
|
@@ -813,6 +825,8 @@ const DataGridHeader = ({
|
|
|
813
825
|
errorCount,
|
|
814
826
|
onToggleErrorHighlighting,
|
|
815
827
|
onHeaderInteractionChange,
|
|
828
|
+
showColumnsDropdown,
|
|
829
|
+
headerContent,
|
|
816
830
|
}: DataGridHeaderProps) => {
|
|
817
831
|
const [shortcutsOpen, setShortcutsOpen] = useState(false)
|
|
818
832
|
const [columnsOpen, setColumnsOpen] = useState(false)
|
|
@@ -833,58 +847,61 @@ const DataGridHeader = ({
|
|
|
833
847
|
}
|
|
834
848
|
return (
|
|
835
849
|
<div className="bg-ui-bg-base flex items-center justify-between border-b p-4">
|
|
836
|
-
|
|
837
|
-
<
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
<ConditionalTooltip
|
|
843
|
-
showTooltip={isDisabled}
|
|
844
|
-
content={t("dataGrid.columns.disabled")}
|
|
845
|
-
>
|
|
846
|
-
<DropdownMenu.Trigger asChild disabled={isDisabled}>
|
|
847
|
-
<Button size="small" variant="secondary">
|
|
848
|
-
{hasChanged ? <AdjustmentsDone /> : <Adjustments />}
|
|
849
|
-
{t("dataGrid.columns.view")}
|
|
850
|
-
</Button>
|
|
851
|
-
</DropdownMenu.Trigger>
|
|
852
|
-
</ConditionalTooltip>
|
|
853
|
-
<DropdownMenu.Content>
|
|
854
|
-
{columnOptions.map((column, index) => {
|
|
855
|
-
const { checked, disabled, id, name } = column
|
|
856
|
-
|
|
857
|
-
if (disabled) {
|
|
858
|
-
return null
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
return (
|
|
862
|
-
<DropdownMenu.CheckboxItem
|
|
863
|
-
key={id}
|
|
864
|
-
checked={checked}
|
|
865
|
-
onCheckedChange={onToggleColumn(index)}
|
|
866
|
-
onSelect={(e) => e.preventDefault()}
|
|
867
|
-
>
|
|
868
|
-
{name}
|
|
869
|
-
</DropdownMenu.CheckboxItem>
|
|
870
|
-
)
|
|
871
|
-
})}
|
|
872
|
-
</DropdownMenu.Content>
|
|
873
|
-
</DropdownMenu>
|
|
874
|
-
{hasChanged && (
|
|
875
|
-
<Button
|
|
876
|
-
size="small"
|
|
877
|
-
variant="transparent"
|
|
878
|
-
type="button"
|
|
879
|
-
onClick={onResetColumns}
|
|
880
|
-
className="text-ui-fg-muted hover:text-ui-fg-subtle"
|
|
881
|
-
data-id="reset-columns"
|
|
850
|
+
{showColumnsDropdown && (
|
|
851
|
+
<div className="flex items-center gap-x-2">
|
|
852
|
+
<DropdownMenu
|
|
853
|
+
dir={direction}
|
|
854
|
+
open={columnsOpen}
|
|
855
|
+
onOpenChange={handleColumnsOpenChange}
|
|
882
856
|
>
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
857
|
+
<ConditionalTooltip
|
|
858
|
+
showTooltip={isDisabled}
|
|
859
|
+
content={t("dataGrid.columns.disabled")}
|
|
860
|
+
>
|
|
861
|
+
<DropdownMenu.Trigger asChild disabled={isDisabled}>
|
|
862
|
+
<Button size="small" variant="secondary">
|
|
863
|
+
{hasChanged ? <AdjustmentsDone /> : <Adjustments />}
|
|
864
|
+
{t("dataGrid.columns.view")}
|
|
865
|
+
</Button>
|
|
866
|
+
</DropdownMenu.Trigger>
|
|
867
|
+
</ConditionalTooltip>
|
|
868
|
+
<DropdownMenu.Content>
|
|
869
|
+
{columnOptions.map((column, index) => {
|
|
870
|
+
const { checked, disabled, id, name } = column
|
|
871
|
+
|
|
872
|
+
if (disabled) {
|
|
873
|
+
return null
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return (
|
|
877
|
+
<DropdownMenu.CheckboxItem
|
|
878
|
+
key={id}
|
|
879
|
+
checked={checked}
|
|
880
|
+
onCheckedChange={onToggleColumn(index)}
|
|
881
|
+
onSelect={(e) => e.preventDefault()}
|
|
882
|
+
>
|
|
883
|
+
{name}
|
|
884
|
+
</DropdownMenu.CheckboxItem>
|
|
885
|
+
)
|
|
886
|
+
})}
|
|
887
|
+
</DropdownMenu.Content>
|
|
888
|
+
</DropdownMenu>
|
|
889
|
+
{hasChanged && (
|
|
890
|
+
<Button
|
|
891
|
+
size="small"
|
|
892
|
+
variant="transparent"
|
|
893
|
+
type="button"
|
|
894
|
+
onClick={onResetColumns}
|
|
895
|
+
className="text-ui-fg-muted hover:text-ui-fg-subtle"
|
|
896
|
+
data-id="reset-columns"
|
|
897
|
+
>
|
|
898
|
+
{t("dataGrid.columns.resetToDefault")}
|
|
899
|
+
</Button>
|
|
900
|
+
)}
|
|
901
|
+
</div>
|
|
902
|
+
)}
|
|
903
|
+
{headerContent}
|
|
904
|
+
<div className="ml-auto flex items-center gap-x-2">
|
|
888
905
|
{errorCount > 0 && (
|
|
889
906
|
<Button
|
|
890
907
|
size="small"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clx } from "@medusajs/ui"
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useRef, useState } from "react"
|
|
3
3
|
import { Controller, ControllerRenderProps } from "react-hook-form"
|
|
4
4
|
|
|
5
5
|
import { useCombinedRefs } from "../../../hooks/use-combined-refs"
|
|
@@ -7,17 +7,9 @@ import { useDataGridCell, useDataGridCellError } from "../hooks"
|
|
|
7
7
|
import { DataGridCellProps, InputProps } from "../types"
|
|
8
8
|
import { DataGridCellContainer } from "./data-grid-cell-container"
|
|
9
9
|
|
|
10
|
-
type DataGridTextCellProps<TData, TValue = any> = DataGridCellProps<
|
|
11
|
-
TData,
|
|
12
|
-
TValue
|
|
13
|
-
> & {
|
|
14
|
-
isMultiLine?: boolean
|
|
15
|
-
}
|
|
16
|
-
|
|
17
10
|
export const DataGridTextCell = <TData, TValue = any>({
|
|
18
11
|
context,
|
|
19
|
-
|
|
20
|
-
}: DataGridTextCellProps<TData, TValue>) => {
|
|
12
|
+
}: DataGridCellProps<TData, TValue>) => {
|
|
21
13
|
const { field, control, renderProps } = useDataGridCell({
|
|
22
14
|
context,
|
|
23
15
|
})
|
|
@@ -31,12 +23,8 @@ export const DataGridTextCell = <TData, TValue = any>({
|
|
|
31
23
|
name={field}
|
|
32
24
|
render={({ field }) => {
|
|
33
25
|
return (
|
|
34
|
-
<DataGridCellContainer
|
|
35
|
-
{
|
|
36
|
-
{...errorProps}
|
|
37
|
-
isMultiLine={isMultiLine}
|
|
38
|
-
>
|
|
39
|
-
<Inner field={field} inputProps={input} isMultiLine={isMultiLine} />
|
|
26
|
+
<DataGridCellContainer {...container} {...errorProps}>
|
|
27
|
+
<Inner field={field} inputProps={input} />
|
|
40
28
|
</DataGridCellContainer>
|
|
41
29
|
)
|
|
42
30
|
}}
|
|
@@ -47,79 +35,21 @@ export const DataGridTextCell = <TData, TValue = any>({
|
|
|
47
35
|
const Inner = ({
|
|
48
36
|
field,
|
|
49
37
|
inputProps,
|
|
50
|
-
isMultiLine,
|
|
51
38
|
}: {
|
|
52
39
|
field: ControllerRenderProps<any, string>
|
|
53
40
|
inputProps: InputProps
|
|
54
|
-
isMultiLine: boolean
|
|
55
41
|
}) => {
|
|
56
42
|
const { onChange: _, onBlur, ref, value, ...rest } = field
|
|
57
43
|
const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps
|
|
58
44
|
|
|
59
45
|
const [localValue, setLocalValue] = useState(value)
|
|
60
|
-
const
|
|
46
|
+
const inputElRef = useRef<HTMLInputElement>(null)
|
|
61
47
|
|
|
62
48
|
useEffect(() => {
|
|
63
49
|
setLocalValue(value)
|
|
64
50
|
}, [value])
|
|
65
51
|
|
|
66
|
-
const combinedRefs = useCombinedRefs(inputRef, ref)
|
|
67
|
-
const textareaCombinedRefs = useCombinedRefs(inputRef, ref, textareaRef)
|
|
68
|
-
|
|
69
|
-
const adjustTextareaHeight = useCallback(() => {
|
|
70
|
-
const textarea = textareaRef.current
|
|
71
|
-
if (textarea) {
|
|
72
|
-
// Reset height to 0 to get accurate scrollHeight
|
|
73
|
-
textarea.style.height = "0px"
|
|
74
|
-
// Set the height to match content (minimum 24px for min visible height)
|
|
75
|
-
const newHeight = Math.max(textarea.scrollHeight, 24)
|
|
76
|
-
textarea.style.height = `${newHeight}px`
|
|
77
|
-
}
|
|
78
|
-
}, [])
|
|
79
|
-
|
|
80
|
-
// Adjust height when value changes
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
if (isMultiLine) {
|
|
83
|
-
adjustTextareaHeight()
|
|
84
|
-
}
|
|
85
|
-
}, [localValue, isMultiLine, adjustTextareaHeight])
|
|
86
|
-
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
if (isMultiLine) {
|
|
89
|
-
// Immediate adjustment
|
|
90
|
-
adjustTextareaHeight()
|
|
91
|
-
// Delayed adjustment to handle any layout shifts
|
|
92
|
-
const timeoutId = setTimeout(adjustTextareaHeight, 50)
|
|
93
|
-
return () => clearTimeout(timeoutId)
|
|
94
|
-
}
|
|
95
|
-
}, [isMultiLine, adjustTextareaHeight])
|
|
96
|
-
|
|
97
|
-
if (isMultiLine) {
|
|
98
|
-
return (
|
|
99
|
-
<textarea
|
|
100
|
-
className={clx(
|
|
101
|
-
"txt-compact-small text-ui-fg-subtle flex w-full cursor-pointer bg-transparent outline-none",
|
|
102
|
-
"focus:cursor-text",
|
|
103
|
-
"resize-none overflow-hidden py-2"
|
|
104
|
-
)}
|
|
105
|
-
autoComplete="off"
|
|
106
|
-
tabIndex={-1}
|
|
107
|
-
value={localValue ?? ""}
|
|
108
|
-
onChange={(e) => {
|
|
109
|
-
setLocalValue(e.target.value)
|
|
110
|
-
adjustTextareaHeight()
|
|
111
|
-
}}
|
|
112
|
-
ref={textareaCombinedRefs}
|
|
113
|
-
onBlur={() => {
|
|
114
|
-
onBlur()
|
|
115
|
-
onInputBlur()
|
|
116
|
-
onChange(localValue, value)
|
|
117
|
-
}}
|
|
118
|
-
{...input}
|
|
119
|
-
{...rest}
|
|
120
|
-
/>
|
|
121
|
-
)
|
|
122
|
-
}
|
|
52
|
+
const combinedRefs = useCombinedRefs(inputRef, ref, inputElRef)
|
|
123
53
|
|
|
124
54
|
return (
|
|
125
55
|
<input
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { DataGridBooleanCell } from "./data-grid-boolean-cell"
|
|
2
2
|
export { DataGridCurrencyCell } from "./data-grid-currency-cell"
|
|
3
|
+
export { DataGridMultilineCell } from "./data-grid-multiline-cell"
|
|
3
4
|
export { DataGridNumberCell } from "./data-grid-number-cell"
|
|
4
5
|
export { DataGridReadonlyCell as DataGridReadOnlyCell } from "./data-grid-readonly-cell"
|
|
5
6
|
export { DataGridRoot, type DataGridRootProps } from "./data-grid-root"
|
|
@@ -3,6 +3,7 @@ import { FieldValues } from "react-hook-form"
|
|
|
3
3
|
import {
|
|
4
4
|
DataGridBooleanCell,
|
|
5
5
|
DataGridCurrencyCell,
|
|
6
|
+
DataGridMultilineCell,
|
|
6
7
|
DataGridNumberCell,
|
|
7
8
|
DataGridReadOnlyCell,
|
|
8
9
|
DataGridRoot,
|
|
@@ -47,6 +48,7 @@ const _DataGrid = <TData, TFieldValues extends FieldValues = FieldValues>({
|
|
|
47
48
|
export const DataGrid = Object.assign(_DataGrid, {
|
|
48
49
|
BooleanCell: DataGridBooleanCell,
|
|
49
50
|
TextCell: DataGridTextCell,
|
|
51
|
+
MultilineCell: DataGridMultilineCell,
|
|
50
52
|
ExpandableTextCell: DataGridExpandableTextCell,
|
|
51
53
|
NumberCell: DataGridNumberCell,
|
|
52
54
|
CurrencyCell: DataGridCurrencyCell,
|
|
@@ -128,6 +128,7 @@ export const useDataGridCell = <TData, TValue>({
|
|
|
128
128
|
case "number":
|
|
129
129
|
return numberCharacterRegex.test(key)
|
|
130
130
|
case "text":
|
|
131
|
+
case "multiline-text":
|
|
131
132
|
return textCharacterRegex.test(key)
|
|
132
133
|
default:
|
|
133
134
|
// KeyboardEvents should not be forwareded to other types of cells
|
|
@@ -180,6 +181,17 @@ export const useDataGridCell = <TData, TValue>({
|
|
|
180
181
|
)?.set
|
|
181
182
|
nativeInputValueSetter?.call(inputRef.current, e.key)
|
|
182
183
|
|
|
184
|
+
const event = new Event("input", { bubbles: true })
|
|
185
|
+
inputRef.current.dispatchEvent(event)
|
|
186
|
+
} else if (inputRef.current instanceof HTMLTextAreaElement) {
|
|
187
|
+
inputRef.current.value = ""
|
|
188
|
+
|
|
189
|
+
const nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(
|
|
190
|
+
window.HTMLTextAreaElement.prototype,
|
|
191
|
+
"value"
|
|
192
|
+
)?.set
|
|
193
|
+
nativeTextAreaValueSetter?.call(inputRef.current, e.key)
|
|
194
|
+
|
|
183
195
|
// Trigger input event to notify react-hook-form
|
|
184
196
|
const event = new Event("input", { bubbles: true })
|
|
185
197
|
inputRef.current.dispatchEvent(event)
|