@medusajs/dashboard 2.12.3-preview-20251217120154 → 2.12.3-snapshot-20251216185234
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-4QLXO46G.mjs → add-campaign-promotions-OYPGISTF.mjs} +2 -2
- package/dist/{adjust-inventory-2MFA656V.mjs → adjust-inventory-26YXAXQL.mjs} +4 -3
- package/dist/{api-key-management-create-ZUVF3SLR.mjs → api-key-management-create-EMP32G2D.mjs} +6 -5
- package/dist/{api-key-management-detail-THD74G7I.mjs → api-key-management-detail-6RCDH73M.mjs} +11 -10
- package/dist/{api-key-management-edit-42HNUSXL.mjs → api-key-management-edit-IBM3ZXHK.mjs} +6 -5
- package/dist/{api-key-management-list-66CFOILY.mjs → api-key-management-list-KC5GOWAU.mjs} +4 -3
- package/dist/{api-key-management-sales-channels-HN3THM5J.mjs → api-key-management-sales-channels-LUB5G6RC.mjs} +6 -5
- package/dist/app.css +53 -0
- package/dist/app.js +13537 -11320
- package/dist/app.mjs +12 -11
- package/dist/{campaign-budget-edit-6DMZGUCI.mjs → campaign-budget-edit-B5MSE26J.mjs} +2 -2
- package/dist/{campaign-configuration-UNFRB5HR.mjs → campaign-configuration-QOE3D2BE.mjs} +2 -2
- package/dist/{campaign-create-QXG7PD3S.mjs → campaign-create-FJOECKGT.mjs} +3 -3
- package/dist/{campaign-detail-WR3XHHV2.mjs → campaign-detail-5Q4BYCPX.mjs} +11 -10
- package/dist/{campaign-edit-HN4US7DV.mjs → campaign-edit-K2POQH7M.mjs} +2 -2
- package/dist/{categories-metadata-BCZ463KN.mjs → categories-metadata-J7M3XWI7.mjs} +14 -13
- package/dist/{category-create-FFIBWXAH.mjs → category-create-KHJZSC7G.mjs} +5 -4
- package/dist/{category-detail-4HXJ5Z7N.mjs → category-detail-S5IPXMHX.mjs} +29 -13
- package/dist/{category-edit-74MZ6TXN.mjs → category-edit-CTA2EPDG.mjs} +5 -4
- package/dist/{category-list-OCJY2UJV.mjs → category-list-QBYJ4T3R.mjs} +20 -4
- package/dist/{category-organize-B6EFBFKB.mjs → category-organize-SXP33XET.mjs} +5 -4
- package/dist/{category-products-2HXLZDHL.mjs → category-products-KPW6BA5J.mjs} +14 -13
- package/dist/{chunk-XIVBRONM.mjs → chunk-23GTCEOV.mjs} +1 -1
- package/dist/{chunk-2NZDHAOE.mjs → chunk-27MGH3HR.mjs} +2 -2
- package/dist/{chunk-N3FCYZV6.mjs → chunk-2XTBDCGE.mjs} +1 -1
- package/dist/{chunk-RU4ZS47V.mjs → chunk-4JQR6QNW.mjs} +2 -2
- package/dist/{chunk-Z6NHG5LQ.mjs → chunk-6P4Q4AAP.mjs} +3 -3
- package/dist/{chunk-F5NZDW7L.mjs → chunk-A2WBKOXJ.mjs} +2 -2
- package/dist/{chunk-F63F3FIT.mjs → chunk-A4XYK3MY.mjs} +2 -2
- package/dist/{chunk-NT6C7CHT.mjs → chunk-AWRCV3ME.mjs} +1 -1
- package/dist/{chunk-5X6SKB2P.mjs → chunk-BMS2QLJY.mjs} +1 -1
- package/dist/{chunk-3YPRDSZ6.mjs → chunk-BZKI5J2M.mjs} +1 -1
- package/dist/{chunk-25UWYEJX.mjs → chunk-CQOOXWPZ.mjs} +1 -1
- package/dist/{chunk-5DUMSVP6.mjs → chunk-CVHJAKLQ.mjs} +3 -3
- package/dist/{chunk-42OOM4DJ.mjs → chunk-D6UW7URG.mjs} +23 -6
- package/dist/{chunk-LHNU4DYZ.mjs → chunk-DBXWB3RF.mjs} +2 -2
- package/dist/{chunk-N4O5FAUC.mjs → chunk-FYWHE3W5.mjs} +1 -1
- package/dist/{chunk-QPKW37WR.mjs → chunk-GRZSG4EP.mjs} +244 -14
- package/dist/chunk-HGRIOEAR.mjs +32 -0
- package/dist/{chunk-Y5UO73CH.mjs → chunk-HTCYX4VD.mjs} +1 -1
- package/dist/{chunk-34KFHPN6.mjs → chunk-IAV7IKJ6.mjs} +1 -1
- package/dist/{chunk-6W3BKVOC.mjs → chunk-KFYQTOGB.mjs} +1 -1
- package/dist/{chunk-EQTBJSBZ.mjs → chunk-KIIT4BNH.mjs} +3 -0
- package/dist/{chunk-W7SLPIO2.mjs → chunk-LZFWCKOF.mjs} +655 -147
- package/dist/{chunk-PNPT4W2F.mjs → chunk-MJDHVDOW.mjs} +1 -1
- package/dist/{chunk-D4J3CEWH.mjs → chunk-N3SAXQVR.mjs} +2 -2
- package/dist/{chunk-Q6MSICBU.mjs → chunk-O333RR6K.mjs} +1 -1
- package/dist/{chunk-F65T2X7G.mjs → chunk-OL24RDYM.mjs} +5 -5
- package/dist/{chunk-7ZYDO3XO.mjs → chunk-OL6MEUKW.mjs} +295 -194
- package/dist/{chunk-7AX6R6G6.mjs → chunk-OSHH5GAS.mjs} +13 -1
- package/dist/{chunk-YAPTGHGP.mjs → chunk-PHLCT2HA.mjs} +1 -1
- package/dist/{chunk-35LSPN2U.mjs → chunk-QKALAT7P.mjs} +1 -1
- package/dist/{chunk-UM4OIJZ3.mjs → chunk-S22SJRPO.mjs} +1 -1
- package/dist/{chunk-4YAPXPLM.mjs → chunk-ST4P6BQN.mjs} +1 -1
- package/dist/{chunk-B3AOQW2B.mjs → chunk-U6G4M5LP.mjs} +1 -1
- package/dist/{chunk-HWKLNKOY.mjs → chunk-U726TGCM.mjs} +1 -1
- package/dist/{chunk-HKIF5HVL.mjs → chunk-UJ2TMPV4.mjs} +12 -0
- package/dist/{chunk-NHDFPGQ3.mjs → chunk-UWY5ZV66.mjs} +13 -1
- package/dist/{chunk-XXBP2Z5M.mjs → chunk-WVA4O7QS.mjs} +1 -1
- package/dist/{chunk-PXJFCRIV.mjs → chunk-WYATCUOM.mjs} +4 -4
- package/dist/{chunk-AH4DORIW.mjs → chunk-XY7A7GZJ.mjs} +1 -1
- package/dist/{chunk-FQDPOKEK.mjs → chunk-Y2YVTIJI.mjs} +1 -1
- package/dist/{chunk-L4NOVTH5.mjs → chunk-YIOBBZUB.mjs} +2 -2
- package/dist/{chunk-MY6I7UJG.mjs → chunk-YYOPBKME.mjs} +3 -3
- package/dist/{chunk-LEJUZW3P.mjs → chunk-Z6BFNHEO.mjs} +12 -0
- package/dist/{chunk-HFT7Q5Y5.mjs → chunk-ZMG5B4FG.mjs} +1 -1
- package/dist/{collection-add-products-JWAQ277T.mjs → collection-add-products-FU2BS3D3.mjs} +14 -13
- package/dist/{collection-create-DCRW344Z.mjs → collection-create-GWKWVT7B.mjs} +5 -4
- package/dist/{collection-detail-F4ON763T.mjs → collection-detail-VJE7XHLV.mjs} +28 -12
- package/dist/{collection-edit-UNFEW6HT.mjs → collection-edit-EZIO2BR5.mjs} +5 -4
- package/dist/{collection-list-4C5HVO6Y.mjs → collection-list-IGA6SCNF.mjs} +29 -13
- package/dist/{collection-metadata-P4A5DXBQ.mjs → collection-metadata-QK7MI3D2.mjs} +14 -13
- package/dist/{customer-create-XCLZENJS.mjs → customer-create-IA56MXE6.mjs} +2 -2
- package/dist/{customer-create-address-4HZUIAM7.mjs → customer-create-address-27M25HTO.mjs} +2 -2
- package/dist/{customer-detail-X3RQJPXP.mjs → customer-detail-MOV2T3LF.mjs} +12 -11
- package/dist/{customer-edit-BW5GVTQI.mjs → customer-edit-XQ5NWIVX.mjs} +2 -2
- package/dist/{customer-group-add-customers-SOXMSWQH.mjs → customer-group-add-customers-XMR2WBXX.mjs} +2 -2
- package/dist/{customer-group-create-6YV7W6TI.mjs → customer-group-create-RY4FVEIW.mjs} +2 -2
- package/dist/{customer-group-detail-NG32WKJT.mjs → customer-group-detail-6T7OXGQD.mjs} +11 -10
- package/dist/{customer-group-edit-7NXU34BQ.mjs → customer-group-edit-MQWARIQZ.mjs} +2 -2
- package/dist/{customer-group-list-EBETHKKO.mjs → customer-group-list-AJEAF5D2.mjs} +11 -10
- package/dist/{customer-group-metadata-WK2BGEGO.mjs → customer-group-metadata-JQJRLLXG.mjs} +3 -3
- package/dist/{customer-metadata-ZUWCUTM7.mjs → customer-metadata-HN2DYD5I.mjs} +3 -3
- package/dist/{customers-add-customer-group-7FYD54MZ.mjs → customers-add-customer-group-QVTVSQYM.mjs} +13 -12
- package/dist/{edit-inventory-item-Y5W6VTHJ.mjs → edit-inventory-item-H7DAZWIT.mjs} +4 -3
- package/dist/{edit-inventory-item-attributes-NAAZDFEJ.mjs → edit-inventory-item-attributes-7HTXXPGZ.mjs} +4 -3
- package/dist/{edit-reservation-2UD4RZJX.mjs → edit-reservation-OVTRZHJR.mjs} +5 -4
- package/dist/{edit-rules-2W3BXEXR.mjs → edit-rules-SMVRTCUP.mjs} +13 -12
- package/dist/en.json +38 -0
- package/dist/{inventory-create-VQEK7C5T.mjs → inventory-create-BK52VALF.mjs} +14 -13
- package/dist/{inventory-detail-HUHQ6ZNE.mjs → inventory-detail-ZPSEMYI2.mjs} +11 -10
- package/dist/{inventory-list-RUSSPKHE.mjs → inventory-list-RXJPSVZE.mjs} +2 -1
- package/dist/{inventory-metadata-X52VGHA7.mjs → inventory-metadata-FNEJ3RAT.mjs} +14 -13
- package/dist/{inventory-stock-EKTOYN2F.mjs → inventory-stock-6WYWLWJ7.mjs} +15 -14
- package/dist/{invite-VKHAAF4Z.mjs → invite-FVE4ZBKB.mjs} +2 -2
- package/dist/{location-create-RPLEXUZR.mjs → location-create-WZ43K3W7.mjs} +2 -2
- package/dist/{location-detail-UVWYE6Q2.mjs → location-detail-N3GUZSY7.mjs} +12 -11
- package/dist/{location-edit-L4ISEQHX.mjs → location-edit-VCS7GVWQ.mjs} +2 -2
- package/dist/{location-fulfillment-providers-HZZUHPVL.mjs → location-fulfillment-providers-7ZUJAGNY.mjs} +15 -14
- package/dist/{location-list-Z42ZYHUF.mjs → location-list-KVBA6J47.mjs} +2 -2
- package/dist/{location-sales-channels-XIMOK66B.mjs → location-sales-channels-P3QJTFDT.mjs} +5 -4
- package/dist/{location-service-zone-create-7ZNVLEE3.mjs → location-service-zone-create-J43WN6G4.mjs} +3 -3
- package/dist/{location-service-zone-edit-6OUAFEZD.mjs → location-service-zone-edit-KHHMSPXD.mjs} +2 -2
- package/dist/{location-service-zone-manage-areas-EOULKRYD.mjs → location-service-zone-manage-areas-6ZPMKMSX.mjs} +3 -3
- package/dist/{location-service-zone-shipping-option-create-M7G4SKNP.mjs → location-service-zone-shipping-option-create-CNRWYZQC.mjs} +15 -14
- package/dist/{location-service-zone-shipping-option-edit-M2HJAASG.mjs → location-service-zone-shipping-option-edit-4CGPQ3VT.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-pricing-23QLNSBT.mjs → location-service-zone-shipping-option-pricing-OGWI7VPT.mjs} +4 -4
- package/dist/{login-NSCAMAU6.mjs → login-VNOLI5YG.mjs} +13 -12
- package/dist/{manage-locations-JD6FSBOT.mjs → manage-locations-7HH6R4UP.mjs} +4 -3
- package/dist/{order-allocate-items-5T57NZOB.mjs → order-allocate-items-HZGGYJ42.mjs} +6 -5
- package/dist/{order-create-claim-TE56IE7P.mjs → order-create-claim-SCDJGM46.mjs} +15 -14
- package/dist/{order-create-edit-RDFYBVFY.mjs → order-create-edit-2WALBPXS.mjs} +14 -13
- package/dist/{order-create-exchange-B5ZOEQCJ.mjs → order-create-exchange-LQU4YN7F.mjs} +15 -14
- package/dist/{order-create-fulfillment-SRRP6X64.mjs → order-create-fulfillment-OWUVTZXW.mjs} +13 -12
- package/dist/{order-create-refund-PTOM65QK.mjs → order-create-refund-Q6HQY42R.mjs} +13 -12
- package/dist/{order-create-return-3C2QVNYN.mjs → order-create-return-52GHGW5Z.mjs} +7 -6
- package/dist/{order-create-shipment-HNILNFXB.mjs → order-create-shipment-WAGGEPRW.mjs} +13 -12
- package/dist/{order-detail-3OUZOQ7G.mjs → order-detail-PVPGEWGY.mjs} +15 -14
- package/dist/{order-edit-billing-address-3IO7GXIK.mjs → order-edit-billing-address-UM76J4KX.mjs} +13 -12
- package/dist/{order-edit-email-QIAEOUBV.mjs → order-edit-email-CL3KNOCM.mjs} +13 -12
- package/dist/{order-edit-shipping-address-QGGMHGBC.mjs → order-edit-shipping-address-PIESTGVL.mjs} +13 -12
- package/dist/{order-export-JYYFTOWR.mjs → order-export-LE363ZLB.mjs} +14 -13
- package/dist/{order-list-RFR3HNDQ.mjs → order-list-GRLQWN4L.mjs} +6 -5
- package/dist/{order-metadata-ZBDTMBHZ.mjs → order-metadata-FHBB7MTG.mjs} +14 -13
- package/dist/{order-receive-return-V42FTCFY.mjs → order-receive-return-PRVKP6J2.mjs} +14 -13
- package/dist/{order-request-transfer-A6NNIN2O.mjs → order-request-transfer-XSAGRUMT.mjs} +13 -12
- package/dist/{price-list-configuration-RTUEJENE.mjs → price-list-configuration-6S3MLNXQ.mjs} +6 -5
- package/dist/{price-list-create-GRT27KOM.mjs → price-list-create-K5JEZT57.mjs} +17 -16
- package/dist/{price-list-detail-VKIWM7HP.mjs → price-list-detail-Q5VG5VGW.mjs} +13 -12
- package/dist/{price-list-edit-SW7YIR3Z.mjs → price-list-edit-53UW35L3.mjs} +5 -4
- package/dist/{price-list-list-LF2PL4B5.mjs → price-list-list-DG5YEZ44.mjs} +4 -3
- package/dist/{price-list-prices-add-ISLZDQNI.mjs → price-list-prices-add-2MQ226U4.mjs} +16 -15
- package/dist/{price-list-prices-edit-C6SX2TLJ.mjs → price-list-prices-edit-OJZLV7OS.mjs} +7 -6
- package/dist/{product-attributes-REJ5NF2D.mjs → product-attributes-YF4TZOIO.mjs} +14 -13
- package/dist/{product-create-4TFE3JHQ.mjs → product-create-KJML2332.mjs} +16 -15
- package/dist/{product-create-option-GEGQNSMQ.mjs → product-create-option-7AOXAA4S.mjs} +4 -3
- package/dist/{product-create-variant-WI6D5CDG.mjs → product-create-variant-5EBCLM54.mjs} +14 -13
- package/dist/{product-detail-BEIDGPKY.mjs → product-detail-QG72542C.mjs} +59 -17
- package/dist/{product-edit-ZRQUK5OQ.mjs → product-edit-DZZR775Q.mjs} +14 -13
- package/dist/{product-edit-option-HBIOBQTS.mjs → product-edit-option-LWJT3CYJ.mjs} +4 -3
- package/dist/{product-export-GIEFG4MA.mjs → product-export-5AD7NELI.mjs} +15 -14
- package/dist/{product-image-variants-edit-AAMRK4KQ.mjs → product-image-variants-edit-M6QF2RLE.mjs} +13 -12
- package/dist/{product-import-43UXKCL3.mjs → product-import-V3KQN4TV.mjs} +13 -12
- package/dist/{product-list-D4CVUBQQ.mjs → product-list-EUWZIFTM.mjs} +25 -12
- package/dist/{product-media-EGK66SRX.mjs → product-media-3VJ7KENL.mjs} +4 -3
- package/dist/{product-metadata-55CAQTPS.mjs → product-metadata-GL2MVPDI.mjs} +14 -13
- package/dist/{product-organization-7J7MUM6F.mjs → product-organization-O7RHELMQ.mjs} +15 -14
- package/dist/{product-prices-WQDE4XYT.mjs → product-prices-YWV6MSM6.mjs} +5 -4
- package/dist/{product-sales-channels-GIJ7Q57M.mjs → product-sales-channels-PPXUG4KT.mjs} +5 -4
- package/dist/{product-shipping-profile-KIDRTPWA.mjs → product-shipping-profile-ETQFZ7DC.mjs} +4 -3
- package/dist/{product-stock-22S2HGMM.mjs → product-stock-AKEFMK5O.mjs} +15 -14
- package/dist/{product-tag-create-7GPE246H.mjs → product-tag-create-PQMDDKWH.mjs} +13 -12
- package/dist/{product-tag-detail-R6C2TTA4.mjs → product-tag-detail-I3MBZX7U.mjs} +30 -14
- package/dist/{product-tag-edit-WA6FGSIP.mjs → product-tag-edit-K3BBQLJR.mjs} +13 -12
- package/dist/{product-tag-list-U7PLHMLF.mjs → product-tag-list-JUWSOMB7.mjs} +30 -14
- package/dist/{product-tag-metadata-EJ7FEXSE.mjs → product-tag-metadata-MJH5LH7E.mjs} +14 -13
- package/dist/{product-type-create-HBDROTGB.mjs → product-type-create-DRFXTL5O.mjs} +4 -3
- package/dist/{product-type-detail-TYQ7MJFE.mjs → product-type-detail-RKHT5NBL.mjs} +29 -13
- package/dist/{product-type-edit-H3JCMVRV.mjs → product-type-edit-SRHCZDK7.mjs} +4 -3
- package/dist/{product-type-list-KIKWBPD7.mjs → product-type-list-QQKAHBJ3.mjs} +19 -3
- package/dist/{product-type-metadata-Q6W5GL7Z.mjs → product-type-metadata-CDJDFFGQ.mjs} +14 -13
- package/dist/{product-variant-detail-SPJ7MZTK.mjs → product-variant-detail-XAYG5CKE.mjs} +27 -11
- package/dist/{product-variant-edit-BW7QMHC5.mjs → product-variant-edit-DEZEY2H2.mjs} +13 -12
- package/dist/{product-variant-manage-inventory-items-BLHCH6QD.mjs → product-variant-manage-inventory-items-Y2VEOHP7.mjs} +4 -3
- package/dist/{product-variant-media-KLSUISGH.mjs → product-variant-media-2WLVNGI4.mjs} +4 -3
- package/dist/{product-variant-metadata-GDMVC4MZ.mjs → product-variant-metadata-VTZDNWUT.mjs} +14 -13
- package/dist/{profile-edit-YBBXXCCK.mjs → profile-edit-ZNXO6WME.mjs} +2 -2
- package/dist/{promotion-add-campaign-JRTM7WBR.mjs → promotion-add-campaign-DO67QK6M.mjs} +3 -3
- package/dist/{promotion-create-HF6DTKCC.mjs → promotion-create-HWFNUQXG.mjs} +15 -14
- package/dist/{promotion-detail-HTM3F2VO.mjs → promotion-detail-QC36KXB3.mjs} +11 -10
- package/dist/{promotion-edit-details-AREFQ6O5.mjs → promotion-edit-details-6BSOOWQN.mjs} +2 -2
- package/dist/{refund-reason-create-RKIH46D6.mjs → refund-reason-create-YHCDEHGQ.mjs} +13 -12
- package/dist/{refund-reason-edit-V3KC6NMO.mjs → refund-reason-edit-CZ5QZ2SZ.mjs} +13 -12
- package/dist/{refund-reason-list-M5BOHFWU.mjs → refund-reason-list-OJYYEYJE.mjs} +11 -10
- package/dist/{region-add-countries-OF5RUSYU.mjs → region-add-countries-2VAVXMJQ.mjs} +2 -2
- package/dist/{region-create-BGOWVCTR.mjs → region-create-NA7Y2LN4.mjs} +2 -2
- package/dist/{region-edit-5GO25GDF.mjs → region-edit-WAU347DP.mjs} +2 -2
- package/dist/{region-metadata-5NGUNAXZ.mjs → region-metadata-H6XXUQ4S.mjs} +14 -13
- package/dist/{reservation-create-Z2SUMBGT.mjs → reservation-create-ZCIYM6JI.mjs} +5 -4
- package/dist/{reservation-detail-JH77TQHN.mjs → reservation-detail-LZAQL4XA.mjs} +11 -10
- package/dist/{reservation-list-WHBGZSVH.mjs → reservation-list-B47DXTA7.mjs} +3 -2
- package/dist/{reservation-metadata-ERCWXYVL.mjs → reservation-metadata-5HZSDDOK.mjs} +14 -13
- package/dist/{reset-password-5TAYQEUV.mjs → reset-password-Y5WVXV4Q.mjs} +2 -2
- package/dist/{return-reason-create-NXWDC6AC.mjs → return-reason-create-HM54WRJY.mjs} +2 -2
- package/dist/{return-reason-edit-M6IKNNKB.mjs → return-reason-edit-VSIRHVQ6.mjs} +2 -2
- package/dist/{sales-channel-add-products-DTAXWL6H.mjs → sales-channel-add-products-F7YV4MO5.mjs} +14 -13
- package/dist/{sales-channel-create-E7BDTPWD.mjs → sales-channel-create-MI7HHZYE.mjs} +5 -4
- package/dist/{sales-channel-detail-XWHV7J7X.mjs → sales-channel-detail-MXIPZCGA.mjs} +12 -11
- package/dist/{sales-channel-edit-HMPA3Y3L.mjs → sales-channel-edit-VSHOIR37.mjs} +5 -4
- package/dist/{sales-channel-list-7NSEFCXQ.mjs → sales-channel-list-RLGL7FM3.mjs} +11 -10
- package/dist/{sales-channel-metadata-CMZN74K7.mjs → sales-channel-metadata-M364R4RJ.mjs} +14 -13
- package/dist/{shipping-option-type-create-4BN2GBHP.mjs → shipping-option-type-create-C5WUWON7.mjs} +13 -12
- package/dist/{shipping-option-type-detail-YB3TCED2.mjs → shipping-option-type-detail-PENS2K73.mjs} +12 -11
- package/dist/{shipping-option-type-edit-MDO7ALAU.mjs → shipping-option-type-edit-CIU5EHRP.mjs} +13 -12
- package/dist/{shipping-option-type-list-DJAT4RKX.mjs → shipping-option-type-list-DIOX7VG7.mjs} +12 -11
- package/dist/{shipping-profile-create-752TMBBE.mjs → shipping-profile-create-26R64I3Z.mjs} +2 -2
- package/dist/{shipping-profile-metadata-HQI7PCPU.mjs → shipping-profile-metadata-75G2NNMA.mjs} +14 -13
- package/dist/{store-add-currencies-PEWNEWCH.mjs → store-add-currencies-OX2WXFMS.mjs} +2 -2
- package/dist/{store-add-locales-JLRTXG3Q.mjs → store-add-locales-VJ4RJ7UI.mjs} +12 -11
- package/dist/{store-detail-MOLAYNQZ.mjs → store-detail-JSNPOB2F.mjs} +11 -10
- package/dist/{store-edit-FTLPT55E.mjs → store-edit-5ZS562ZO.mjs} +2 -2
- package/dist/{store-metadata-ZJD23O4D.mjs → store-metadata-CYXTVJUE.mjs} +14 -13
- package/dist/{tax-region-create-NCO2OQ3I.mjs → tax-region-create-DWGL4EUT.mjs} +13 -12
- package/dist/{tax-region-detail-RIABXU7D.mjs → tax-region-detail-2AE2EFI3.mjs} +21 -20
- package/dist/{tax-region-edit-YZALLSZY.mjs → tax-region-edit-EEVEEU2Q.mjs} +13 -12
- package/dist/{tax-region-list-BXZBUXRJ.mjs → tax-region-list-P4LDOPZD.mjs} +3 -3
- package/dist/{tax-region-province-create-5JP3PVID.mjs → tax-region-province-create-GKJ7WMRS.mjs} +2 -2
- package/dist/{tax-region-province-detail-UKLRVJS2.mjs → tax-region-province-detail-4ERSEQFF.mjs} +20 -19
- package/dist/{tax-region-tax-override-create-33XGHH7A.mjs → tax-region-tax-override-create-PHCGEF7V.mjs} +16 -15
- package/dist/{tax-region-tax-override-edit-WOKZSPTY.mjs → tax-region-tax-override-edit-SMRPSILC.mjs} +17 -16
- package/dist/{tax-region-tax-rate-create-O2SDSXCH.mjs → tax-region-tax-rate-create-MECFGVPL.mjs} +2 -2
- package/dist/{tax-region-tax-rate-edit-W62VEVKT.mjs → tax-region-tax-rate-edit-7DYSPYOD.mjs} +2 -2
- package/dist/translation-list-UF7FLXOW.mjs +441 -0
- package/dist/translations-edit-USQJNMAY.mjs +707 -0
- package/dist/{user-detail-KEDJ7N3Q.mjs → user-detail-BJUXLZZQ.mjs} +2 -1
- package/dist/{user-edit-LXQCTDGA.mjs → user-edit-ZBB4RMTP.mjs} +2 -2
- package/dist/{user-invite-YH33WUC2.mjs → user-invite-GAGIM5DO.mjs} +2 -2
- package/dist/{user-metadata-4WOICEE7.mjs → user-metadata-2WPJOEJA.mjs} +14 -13
- package/dist/{workflow-execution-detail-OKM6P4SX.mjs → workflow-execution-detail-H2AKEZJX.mjs} +11 -10
- package/package.json +9 -9
- package/src/components/common/icon-avatar/icon-avatar.tsx +4 -0
- package/src/components/data-grid/components/data-grid-cell-container.tsx +13 -4
- package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +13 -3
- package/src/components/data-grid/components/data-grid-root.tsx +271 -60
- package/src/components/data-grid/components/data-grid-text-cell.tsx +7 -7
- package/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx +233 -0
- package/src/components/data-grid/components/index.ts +2 -0
- package/src/components/data-grid/data-grid.tsx +16 -1
- package/src/components/data-grid/helpers/create-data-grid-column-helper.ts +18 -0
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +12 -1
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +43 -3
- package/src/components/data-grid/types.ts +1 -0
- package/src/components/layout/settings-layout/settings-layout.tsx +11 -1
- package/src/components/modals/route-focus-modal/route-focus-modal.tsx +8 -3
- package/src/components/modals/route-modal-form/route-modal-form.tsx +6 -1
- package/src/components/modals/route-modal-provider/route-provider.tsx +16 -4
- package/src/dashboard-app/routes/get-route.map.tsx +19 -0
- package/src/hooks/api/categories.tsx +32 -0
- package/src/hooks/api/collections.tsx +31 -0
- package/src/hooks/api/index.ts +1 -0
- package/src/hooks/api/product-types.tsx +32 -0
- package/src/hooks/api/product-variants.tsx +47 -3
- package/src/hooks/api/products.tsx +29 -0
- package/src/hooks/api/tags.tsx +32 -0
- package/src/hooks/api/translations.tsx +306 -0
- package/src/hooks/use-infinite-list.tsx +92 -0
- package/src/i18n/translations/$schema.json +122 -0
- package/src/i18n/translations/en.json +38 -0
- package/src/i18n/translations/es.json +38 -0
- package/src/routes/categories/category-detail/components/category-general-section/category-general-section.tsx +16 -1
- package/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +16 -1
- package/src/routes/collections/collection-detail/components/collection-general-section/collection-general-section.tsx +16 -1
- package/src/routes/collections/collection-list/components/collection-list-table/collection-row-actions.tsx +16 -1
- package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/product-tag-general-section.tsx +16 -1
- package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/product-tag-list-table.tsx +16 -1
- package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +16 -1
- package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +16 -1
- package/src/routes/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx +16 -1
- package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +16 -1
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +32 -1
- package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +15 -1
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +68 -0
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +44 -0
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +224 -0
- package/src/routes/translations/translation-list/index.tsx +1 -0
- package/src/routes/translations/translation-list/translation-list.tsx +138 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/index.ts +1 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +792 -0
- package/src/routes/translations/translations-edit/index.ts +1 -0
- package/src/routes/translations/translations-edit/translations-edit.tsx +90 -0
|
@@ -251,6 +251,15 @@ var useDataGridCell = ({
|
|
|
251
251
|
nativeInputValueSetter?.call(inputRef.current, e.key);
|
|
252
252
|
const event = new Event("input", { bubbles: true });
|
|
253
253
|
inputRef.current.dispatchEvent(event);
|
|
254
|
+
} else if (inputRef.current instanceof HTMLTextAreaElement) {
|
|
255
|
+
inputRef.current.value = "";
|
|
256
|
+
const nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(
|
|
257
|
+
window.HTMLTextAreaElement.prototype,
|
|
258
|
+
"value"
|
|
259
|
+
)?.set;
|
|
260
|
+
nativeTextAreaValueSetter?.call(inputRef.current, e.key);
|
|
261
|
+
const event = new Event("input", { bubbles: true });
|
|
262
|
+
inputRef.current.dispatchEvent(event);
|
|
254
263
|
}
|
|
255
264
|
e.stopPropagation();
|
|
256
265
|
e.preventDefault();
|
|
@@ -265,7 +274,7 @@ var useDataGridCell = ({
|
|
|
265
274
|
}, [type]);
|
|
266
275
|
useEffect(() => {
|
|
267
276
|
if (isAnchor && !containerRef.current?.contains(document.activeElement)) {
|
|
268
|
-
containerRef.current?.focus();
|
|
277
|
+
containerRef.current?.focus({ preventScroll: true });
|
|
269
278
|
}
|
|
270
279
|
}, [isAnchor]);
|
|
271
280
|
const renderProps = {
|
|
@@ -1510,6 +1519,7 @@ var useDataGridKeydownEvent = ({
|
|
|
1510
1519
|
break;
|
|
1511
1520
|
case "number":
|
|
1512
1521
|
case "text":
|
|
1522
|
+
case "multiline-text":
|
|
1513
1523
|
handleSpaceKeyTextOrNumber(anchor);
|
|
1514
1524
|
break;
|
|
1515
1525
|
}
|
|
@@ -1570,6 +1580,19 @@ var useDataGridKeydownEvent = ({
|
|
|
1570
1580
|
},
|
|
1571
1581
|
[handleMoveOnEnter, handleEditOnEnter, isEditing]
|
|
1572
1582
|
);
|
|
1583
|
+
const handleEnterKeyMultilineText = useCallback9(
|
|
1584
|
+
(e, anchor2) => {
|
|
1585
|
+
if (isEditing) {
|
|
1586
|
+
if (e.shiftKey) {
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
handleMoveOnEnter(e, anchor2);
|
|
1590
|
+
return;
|
|
1591
|
+
}
|
|
1592
|
+
handleEditOnEnter(anchor2);
|
|
1593
|
+
},
|
|
1594
|
+
[handleMoveOnEnter, handleEditOnEnter, isEditing]
|
|
1595
|
+
);
|
|
1573
1596
|
const handleEnterKeyBoolean = useCallback9(
|
|
1574
1597
|
(e, anchor2) => {
|
|
1575
1598
|
const field = matrix.getCellField(anchor2);
|
|
@@ -1603,9 +1626,15 @@ var useDataGridKeydownEvent = ({
|
|
|
1603
1626
|
if (!anchor) {
|
|
1604
1627
|
return;
|
|
1605
1628
|
}
|
|
1606
|
-
e.preventDefault();
|
|
1607
1629
|
const type = matrix.getCellType(anchor);
|
|
1630
|
+
if (type === "multiline-text" && isEditing && e.shiftKey) {
|
|
1631
|
+
return;
|
|
1632
|
+
}
|
|
1633
|
+
e.preventDefault();
|
|
1608
1634
|
switch (type) {
|
|
1635
|
+
case "multiline-text":
|
|
1636
|
+
handleEnterKeyMultilineText(e, anchor);
|
|
1637
|
+
break;
|
|
1609
1638
|
case "togglable-number":
|
|
1610
1639
|
case "text":
|
|
1611
1640
|
case "number":
|
|
@@ -1617,7 +1646,14 @@ var useDataGridKeydownEvent = ({
|
|
|
1617
1646
|
}
|
|
1618
1647
|
}
|
|
1619
1648
|
},
|
|
1620
|
-
[
|
|
1649
|
+
[
|
|
1650
|
+
anchor,
|
|
1651
|
+
matrix,
|
|
1652
|
+
isEditing,
|
|
1653
|
+
handleEnterKeyTextOrNumber,
|
|
1654
|
+
handleEnterKeyBoolean,
|
|
1655
|
+
handleEnterKeyMultilineText
|
|
1656
|
+
]
|
|
1621
1657
|
);
|
|
1622
1658
|
const handleDeleteKeyTogglableNumber = useCallback9(
|
|
1623
1659
|
(anchor2, rangeEnd2) => {
|
|
@@ -1680,6 +1716,7 @@ var useDataGridKeydownEvent = ({
|
|
|
1680
1716
|
}
|
|
1681
1717
|
switch (type) {
|
|
1682
1718
|
case "text":
|
|
1719
|
+
case "multiline-text":
|
|
1683
1720
|
case "number":
|
|
1684
1721
|
handleDeleteKeyTextOrNumber(anchor, rangeEnd);
|
|
1685
1722
|
break;
|
|
@@ -2015,17 +2052,20 @@ var DataGridCellContainer = ({
|
|
|
2015
2052
|
children,
|
|
2016
2053
|
errors,
|
|
2017
2054
|
rowErrors,
|
|
2018
|
-
outerComponent
|
|
2055
|
+
outerComponent,
|
|
2056
|
+
isMultiLine
|
|
2019
2057
|
}) => {
|
|
2020
2058
|
const error = get2(errors, field);
|
|
2021
2059
|
const hasError = !!error;
|
|
2022
|
-
return /* @__PURE__ */ jsxs3("div", { className: "group/container relative
|
|
2060
|
+
return /* @__PURE__ */ jsxs3("div", { className: clx("group/container relative h-full w-full"), children: [
|
|
2023
2061
|
/* @__PURE__ */ jsxs3(
|
|
2024
2062
|
"div",
|
|
2025
2063
|
{
|
|
2026
2064
|
className: clx(
|
|
2027
|
-
"bg-ui-bg-base group/cell relative flex
|
|
2065
|
+
"bg-ui-bg-base group/cell relative flex h-full w-full gap-x-2 px-4 py-2.5 outline-none",
|
|
2028
2066
|
{
|
|
2067
|
+
"items-center": !isMultiLine,
|
|
2068
|
+
"items-start": isMultiLine,
|
|
2029
2069
|
"bg-ui-tag-red-bg text-ui-tag-red-text": hasError && !isAnchor && !isSelected && !isDragSelected,
|
|
2030
2070
|
"ring-ui-bg-interactive ring-2 ring-inset": isAnchor,
|
|
2031
2071
|
"bg-ui-bg-highlight [&:has([data-field]:focus)]:bg-ui-bg-base": isSelected || isAnchor,
|
|
@@ -2045,7 +2085,16 @@ var DataGridCellContainer = ({
|
|
|
2045
2085
|
}
|
|
2046
2086
|
}
|
|
2047
2087
|
),
|
|
2048
|
-
/* @__PURE__ */ jsx3(
|
|
2088
|
+
/* @__PURE__ */ jsx3(
|
|
2089
|
+
"div",
|
|
2090
|
+
{
|
|
2091
|
+
className: clx("relative z-[1] flex h-full w-full", {
|
|
2092
|
+
"items-center justify-center": !isMultiLine,
|
|
2093
|
+
"items-start": isMultiLine
|
|
2094
|
+
}),
|
|
2095
|
+
children: /* @__PURE__ */ jsx3(RenderChildren, { isAnchor, placeholder, children })
|
|
2096
|
+
}
|
|
2097
|
+
),
|
|
2049
2098
|
/* @__PURE__ */ jsx3(DataGridRowErrorIndicator, { rowErrors }),
|
|
2050
2099
|
showOverlay && /* @__PURE__ */ jsx3(
|
|
2051
2100
|
"div",
|
|
@@ -2230,14 +2279,13 @@ var Inner2 = ({
|
|
|
2230
2279
|
] });
|
|
2231
2280
|
};
|
|
2232
2281
|
|
|
2233
|
-
// src/components/data-grid/components/data-grid-
|
|
2282
|
+
// src/components/data-grid/components/data-grid-multiline-cell.tsx
|
|
2234
2283
|
import { clx as clx2 } from "@medusajs/ui";
|
|
2235
|
-
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
2284
|
+
import { useCallback as useCallback13, useEffect as useEffect4, useRef as useRef3, useState as useState5 } from "react";
|
|
2236
2285
|
import { Controller as Controller3 } from "react-hook-form";
|
|
2237
2286
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
2238
|
-
var
|
|
2239
|
-
context
|
|
2240
|
-
...rest
|
|
2287
|
+
var DataGridMultilineCell = ({
|
|
2288
|
+
context
|
|
2241
2289
|
}) => {
|
|
2242
2290
|
const { field, control, renderProps } = useDataGridCell({
|
|
2243
2291
|
context
|
|
@@ -2250,12 +2298,92 @@ var DataGridNumberCell = ({
|
|
|
2250
2298
|
control,
|
|
2251
2299
|
name: field,
|
|
2252
2300
|
render: ({ field: field2 }) => {
|
|
2253
|
-
return /* @__PURE__ */ jsx6(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx6(Inner3, { field: field2, inputProps: input
|
|
2301
|
+
return /* @__PURE__ */ jsx6(DataGridCellContainer, { ...container, ...errorProps, isMultiLine: true, children: /* @__PURE__ */ jsx6(Inner3, { field: field2, inputProps: input }) });
|
|
2254
2302
|
}
|
|
2255
2303
|
}
|
|
2256
2304
|
);
|
|
2257
2305
|
};
|
|
2258
2306
|
var Inner3 = ({
|
|
2307
|
+
field,
|
|
2308
|
+
inputProps
|
|
2309
|
+
}) => {
|
|
2310
|
+
const { onChange: _, onBlur, ref, value, ...rest } = field;
|
|
2311
|
+
const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps;
|
|
2312
|
+
const [localValue, setLocalValue] = useState5(value);
|
|
2313
|
+
const textareaRef = useRef3(null);
|
|
2314
|
+
useEffect4(() => {
|
|
2315
|
+
setLocalValue(value);
|
|
2316
|
+
}, [value]);
|
|
2317
|
+
const combinedRefs = useCombinedRefs(inputRef, ref, textareaRef);
|
|
2318
|
+
const adjustTextareaHeight = useCallback13(() => {
|
|
2319
|
+
const textarea = textareaRef.current;
|
|
2320
|
+
if (textarea) {
|
|
2321
|
+
textarea.style.height = "0px";
|
|
2322
|
+
const newHeight = Math.max(textarea.scrollHeight, 24);
|
|
2323
|
+
textarea.style.height = `${newHeight}px`;
|
|
2324
|
+
}
|
|
2325
|
+
}, []);
|
|
2326
|
+
useEffect4(() => {
|
|
2327
|
+
adjustTextareaHeight();
|
|
2328
|
+
}, [localValue, adjustTextareaHeight]);
|
|
2329
|
+
useEffect4(() => {
|
|
2330
|
+
adjustTextareaHeight();
|
|
2331
|
+
const timeoutId = setTimeout(adjustTextareaHeight, 50);
|
|
2332
|
+
return () => clearTimeout(timeoutId);
|
|
2333
|
+
}, [adjustTextareaHeight]);
|
|
2334
|
+
return /* @__PURE__ */ jsx6(
|
|
2335
|
+
"textarea",
|
|
2336
|
+
{
|
|
2337
|
+
className: clx2(
|
|
2338
|
+
"txt-compact-small text-ui-fg-subtle flex w-full cursor-pointer bg-transparent outline-none",
|
|
2339
|
+
"focus:cursor-text",
|
|
2340
|
+
"resize-none overflow-hidden py-2"
|
|
2341
|
+
),
|
|
2342
|
+
autoComplete: "off",
|
|
2343
|
+
tabIndex: -1,
|
|
2344
|
+
value: localValue ?? "",
|
|
2345
|
+
onChange: (e) => {
|
|
2346
|
+
setLocalValue(e.target.value);
|
|
2347
|
+
adjustTextareaHeight();
|
|
2348
|
+
},
|
|
2349
|
+
ref: combinedRefs,
|
|
2350
|
+
onBlur: () => {
|
|
2351
|
+
onBlur();
|
|
2352
|
+
onInputBlur();
|
|
2353
|
+
onChange(localValue, value);
|
|
2354
|
+
},
|
|
2355
|
+
...input,
|
|
2356
|
+
...rest
|
|
2357
|
+
}
|
|
2358
|
+
);
|
|
2359
|
+
};
|
|
2360
|
+
|
|
2361
|
+
// src/components/data-grid/components/data-grid-number-cell.tsx
|
|
2362
|
+
import { clx as clx3 } from "@medusajs/ui";
|
|
2363
|
+
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
2364
|
+
import { Controller as Controller4 } from "react-hook-form";
|
|
2365
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
2366
|
+
var DataGridNumberCell = ({
|
|
2367
|
+
context,
|
|
2368
|
+
...rest
|
|
2369
|
+
}) => {
|
|
2370
|
+
const { field, control, renderProps } = useDataGridCell({
|
|
2371
|
+
context
|
|
2372
|
+
});
|
|
2373
|
+
const errorProps = useDataGridCellError({ context });
|
|
2374
|
+
const { container, input } = renderProps;
|
|
2375
|
+
return /* @__PURE__ */ jsx7(
|
|
2376
|
+
Controller4,
|
|
2377
|
+
{
|
|
2378
|
+
control,
|
|
2379
|
+
name: field,
|
|
2380
|
+
render: ({ field: field2 }) => {
|
|
2381
|
+
return /* @__PURE__ */ jsx7(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx7(Inner4, { field: field2, inputProps: input, ...rest }) });
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2385
|
+
};
|
|
2386
|
+
var Inner4 = ({
|
|
2259
2387
|
field,
|
|
2260
2388
|
inputProps,
|
|
2261
2389
|
...props
|
|
@@ -2268,12 +2396,12 @@ var Inner3 = ({
|
|
|
2268
2396
|
onFocus,
|
|
2269
2397
|
...attributes
|
|
2270
2398
|
} = inputProps;
|
|
2271
|
-
const [localValue, setLocalValue] =
|
|
2272
|
-
|
|
2399
|
+
const [localValue, setLocalValue] = useState6(value);
|
|
2400
|
+
useEffect5(() => {
|
|
2273
2401
|
setLocalValue(value);
|
|
2274
2402
|
}, [value]);
|
|
2275
2403
|
const combinedRefs = useCombinedRefs(inputRef, ref);
|
|
2276
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ jsx7("div", { className: "size-full", children: /* @__PURE__ */ jsx7(
|
|
2277
2405
|
"input",
|
|
2278
2406
|
{
|
|
2279
2407
|
ref: combinedRefs,
|
|
@@ -2287,7 +2415,7 @@ var Inner3 = ({
|
|
|
2287
2415
|
onFocus,
|
|
2288
2416
|
type: "number",
|
|
2289
2417
|
inputMode: "decimal",
|
|
2290
|
-
className:
|
|
2418
|
+
className: clx3(
|
|
2291
2419
|
"txt-compact-small size-full bg-transparent outline-none",
|
|
2292
2420
|
"placeholder:text-ui-fg-muted"
|
|
2293
2421
|
),
|
|
@@ -2300,25 +2428,36 @@ var Inner3 = ({
|
|
|
2300
2428
|
};
|
|
2301
2429
|
|
|
2302
2430
|
// src/components/data-grid/components/data-grid-readonly-cell.tsx
|
|
2303
|
-
import { clx as
|
|
2304
|
-
import { jsx as
|
|
2431
|
+
import { clx as clx4 } from "@medusajs/ui";
|
|
2432
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2305
2433
|
var DataGridReadonlyCell = ({
|
|
2306
2434
|
context,
|
|
2307
2435
|
color = "muted",
|
|
2308
|
-
children
|
|
2436
|
+
children,
|
|
2437
|
+
isMultiLine = false
|
|
2309
2438
|
}) => {
|
|
2310
2439
|
const { rowErrors } = useDataGridCellError({ context });
|
|
2311
2440
|
return /* @__PURE__ */ jsxs5(
|
|
2312
2441
|
"div",
|
|
2313
2442
|
{
|
|
2314
|
-
className:
|
|
2315
|
-
"txt-compact-small text-ui-fg-subtle flex
|
|
2443
|
+
className: clx4(
|
|
2444
|
+
"txt-compact-small text-ui-fg-subtle flex w-full cursor-not-allowed justify-between overflow-hidden px-4 py-2.5 outline-none",
|
|
2316
2445
|
color === "muted" && "bg-ui-bg-subtle",
|
|
2317
|
-
color === "normal" && "bg-ui-bg-base"
|
|
2446
|
+
color === "normal" && "bg-ui-bg-base",
|
|
2447
|
+
"h-full items-center"
|
|
2318
2448
|
),
|
|
2319
2449
|
children: [
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
|
|
2450
|
+
/* @__PURE__ */ jsx8(
|
|
2451
|
+
"div",
|
|
2452
|
+
{
|
|
2453
|
+
className: clx4("flex-1", {
|
|
2454
|
+
truncate: !isMultiLine,
|
|
2455
|
+
"whitespace-pre-wrap break-words": isMultiLine
|
|
2456
|
+
}),
|
|
2457
|
+
children
|
|
2458
|
+
}
|
|
2459
|
+
),
|
|
2460
|
+
/* @__PURE__ */ jsx8(DataGridRowErrorIndicator, { rowErrors })
|
|
2322
2461
|
]
|
|
2323
2462
|
}
|
|
2324
2463
|
);
|
|
@@ -2330,30 +2469,32 @@ import {
|
|
|
2330
2469
|
AdjustmentsDone,
|
|
2331
2470
|
ExclamationCircle as ExclamationCircle2
|
|
2332
2471
|
} from "@medusajs/icons";
|
|
2333
|
-
import { Button as Button2, DropdownMenu, clx as
|
|
2472
|
+
import { Button as Button2, DropdownMenu, clx as clx6 } from "@medusajs/ui";
|
|
2334
2473
|
import {
|
|
2335
2474
|
flexRender,
|
|
2336
2475
|
getCoreRowModel,
|
|
2337
2476
|
useReactTable
|
|
2338
2477
|
} from "@tanstack/react-table";
|
|
2339
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
2340
2478
|
import {
|
|
2341
|
-
|
|
2342
|
-
|
|
2479
|
+
useVirtualizer
|
|
2480
|
+
} from "@tanstack/react-virtual";
|
|
2481
|
+
import {
|
|
2482
|
+
useCallback as useCallback15,
|
|
2483
|
+
useEffect as useEffect6,
|
|
2343
2484
|
useMemo as useMemo5,
|
|
2344
|
-
useRef as
|
|
2345
|
-
useState as
|
|
2485
|
+
useRef as useRef4,
|
|
2486
|
+
useState as useState9
|
|
2346
2487
|
} from "react";
|
|
2347
2488
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
2348
2489
|
|
|
2349
2490
|
// src/hooks/use-command-history.tsx
|
|
2350
|
-
import { useCallback as
|
|
2491
|
+
import { useCallback as useCallback14, useState as useState7 } from "react";
|
|
2351
2492
|
var useCommandHistory = (maxHistory = 20) => {
|
|
2352
|
-
const [past, setPast] =
|
|
2353
|
-
const [future, setFuture] =
|
|
2493
|
+
const [past, setPast] = useState7([]);
|
|
2494
|
+
const [future, setFuture] = useState7([]);
|
|
2354
2495
|
const canUndo = past.length > 0;
|
|
2355
2496
|
const canRedo = future.length > 0;
|
|
2356
|
-
const undo =
|
|
2497
|
+
const undo = useCallback14(() => {
|
|
2357
2498
|
if (!canUndo) {
|
|
2358
2499
|
return;
|
|
2359
2500
|
}
|
|
@@ -2363,7 +2504,7 @@ var useCommandHistory = (maxHistory = 20) => {
|
|
|
2363
2504
|
setPast(newPast);
|
|
2364
2505
|
setFuture([previous, ...future.slice(0, maxHistory - 1)]);
|
|
2365
2506
|
}, [canUndo, future, past, maxHistory]);
|
|
2366
|
-
const redo =
|
|
2507
|
+
const redo = useCallback14(() => {
|
|
2367
2508
|
if (!canRedo) {
|
|
2368
2509
|
return;
|
|
2369
2510
|
}
|
|
@@ -2373,7 +2514,7 @@ var useCommandHistory = (maxHistory = 20) => {
|
|
|
2373
2514
|
setPast([...past, next].slice(0, maxHistory - 1));
|
|
2374
2515
|
setFuture(newFuture);
|
|
2375
2516
|
}, [canRedo, future, past, maxHistory]);
|
|
2376
|
-
const execute =
|
|
2517
|
+
const execute = useCallback14(
|
|
2377
2518
|
(command) => {
|
|
2378
2519
|
command.execute();
|
|
2379
2520
|
setPast((past2) => [...past2, command].slice(0, maxHistory - 1));
|
|
@@ -2394,7 +2535,7 @@ var useCommandHistory = (maxHistory = 20) => {
|
|
|
2394
2535
|
import { XMark } from "@medusajs/icons";
|
|
2395
2536
|
import {
|
|
2396
2537
|
Button,
|
|
2397
|
-
clx as
|
|
2538
|
+
clx as clx5,
|
|
2398
2539
|
Heading,
|
|
2399
2540
|
IconButton,
|
|
2400
2541
|
Input,
|
|
@@ -2402,9 +2543,9 @@ import {
|
|
|
2402
2543
|
Text
|
|
2403
2544
|
} from "@medusajs/ui";
|
|
2404
2545
|
import { Dialog as RadixDialog } from "radix-ui";
|
|
2405
|
-
import { useMemo as useMemo4, useState as
|
|
2546
|
+
import { useMemo as useMemo4, useState as useState8 } from "react";
|
|
2406
2547
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
2407
|
-
import { jsx as
|
|
2548
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2408
2549
|
var useDataGridShortcuts = () => {
|
|
2409
2550
|
const { t } = useTranslation2();
|
|
2410
2551
|
const shortcuts = useMemo4(
|
|
@@ -2552,7 +2693,7 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
2552
2693
|
onOpenChange
|
|
2553
2694
|
}) => {
|
|
2554
2695
|
const { t } = useTranslation2();
|
|
2555
|
-
const [searchValue, onSearchValueChange] =
|
|
2696
|
+
const [searchValue, onSearchValueChange] = useState8("");
|
|
2556
2697
|
const shortcuts = useDataGridShortcuts();
|
|
2557
2698
|
const searchResults = useMemo4(() => {
|
|
2558
2699
|
return shortcuts.filter(
|
|
@@ -2560,12 +2701,12 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
2560
2701
|
);
|
|
2561
2702
|
}, [searchValue, shortcuts]);
|
|
2562
2703
|
return /* @__PURE__ */ jsxs6(RadixDialog.Root, { open, onOpenChange, children: [
|
|
2563
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ jsx9(RadixDialog.Trigger, { asChild: true, children: /* @__PURE__ */ jsx9(Button, { size: "small", variant: "secondary", children: t("dataGrid.shortcuts.label") }) }),
|
|
2564
2705
|
/* @__PURE__ */ jsxs6(RadixDialog.Portal, { children: [
|
|
2565
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ jsx9(
|
|
2566
2707
|
RadixDialog.Overlay,
|
|
2567
2708
|
{
|
|
2568
|
-
className:
|
|
2709
|
+
className: clx5(
|
|
2569
2710
|
"bg-ui-bg-overlay fixed inset-0",
|
|
2570
2711
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
2571
2712
|
)
|
|
@@ -2575,15 +2716,15 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
2575
2716
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-y-3 px-6 py-4", children: [
|
|
2576
2717
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between", children: [
|
|
2577
2718
|
/* @__PURE__ */ jsxs6("div", { children: [
|
|
2578
|
-
/* @__PURE__ */
|
|
2579
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsx9(RadixDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx9(Heading, { children: t("app.menus.user.shortcuts") }) }),
|
|
2720
|
+
/* @__PURE__ */ jsx9(RadixDialog.Description, { className: "sr-only" })
|
|
2580
2721
|
] }),
|
|
2581
2722
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-2", children: [
|
|
2582
|
-
/* @__PURE__ */
|
|
2583
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ jsx9(Kbd, { children: "esc" }),
|
|
2724
|
+
/* @__PURE__ */ jsx9(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx9(IconButton, { variant: "transparent", size: "small", children: /* @__PURE__ */ jsx9(XMark, {}) }) })
|
|
2584
2725
|
] })
|
|
2585
2726
|
] }),
|
|
2586
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9(
|
|
2587
2728
|
Input,
|
|
2588
2729
|
{
|
|
2589
2730
|
type: "search",
|
|
@@ -2593,15 +2734,15 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
2593
2734
|
}
|
|
2594
2735
|
) })
|
|
2595
2736
|
] }),
|
|
2596
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ jsx9("div", { className: "flex flex-col divide-y overflow-y-auto", children: searchResults.map((shortcut, index) => {
|
|
2597
2738
|
return /* @__PURE__ */ jsxs6(
|
|
2598
2739
|
"div",
|
|
2599
2740
|
{
|
|
2600
2741
|
className: "text-ui-fg-subtle flex items-center justify-between px-6 py-3",
|
|
2601
2742
|
children: [
|
|
2602
|
-
/* @__PURE__ */
|
|
2603
|
-
/* @__PURE__ */
|
|
2604
|
-
return /* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsx9(Text, { size: "small", children: shortcut.label }),
|
|
2744
|
+
/* @__PURE__ */ jsx9("div", { className: "flex items-center gap-x-1", children: shortcut.keys.Mac?.map((key, index2) => {
|
|
2745
|
+
return /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ jsx9(Kbd, { children: key }) }, index2);
|
|
2605
2746
|
}) })
|
|
2606
2747
|
]
|
|
2607
2748
|
},
|
|
@@ -2614,7 +2755,7 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
2614
2755
|
};
|
|
2615
2756
|
|
|
2616
2757
|
// src/components/data-grid/components/data-grid-root.tsx
|
|
2617
|
-
import { jsx as
|
|
2758
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2618
2759
|
var ROW_HEIGHT = 40;
|
|
2619
2760
|
var getCommonPinningStyles = (column) => {
|
|
2620
2761
|
const isPinned = column.getIsPinned();
|
|
@@ -2637,9 +2778,16 @@ var DataGridRoot = ({
|
|
|
2637
2778
|
getSubRows,
|
|
2638
2779
|
onEditingChange,
|
|
2639
2780
|
disableInteractions,
|
|
2640
|
-
multiColumnSelection = false
|
|
2781
|
+
multiColumnSelection = false,
|
|
2782
|
+
showColumnsDropdown = true,
|
|
2783
|
+
totalRowCount,
|
|
2784
|
+
onFetchMore,
|
|
2785
|
+
isFetchingMore,
|
|
2786
|
+
hasNextPage,
|
|
2787
|
+
headerContent
|
|
2641
2788
|
}) => {
|
|
2642
|
-
const
|
|
2789
|
+
const isLazyMode = totalRowCount !== void 0;
|
|
2790
|
+
const containerRef = useRef4(null);
|
|
2643
2791
|
const { redo, undo, execute } = useCommandHistory();
|
|
2644
2792
|
const {
|
|
2645
2793
|
register,
|
|
@@ -2648,16 +2796,16 @@ var DataGridRoot = ({
|
|
|
2648
2796
|
setValue: setValue2,
|
|
2649
2797
|
formState: { errors }
|
|
2650
2798
|
} = state;
|
|
2651
|
-
const [internalTrapActive, setTrapActive] =
|
|
2799
|
+
const [internalTrapActive, setTrapActive] = useState9(true);
|
|
2652
2800
|
const trapActive = !disableInteractions && internalTrapActive;
|
|
2653
|
-
const [anchor, setAnchor] =
|
|
2654
|
-
const [rangeEnd, setRangeEnd] =
|
|
2655
|
-
const [dragEnd, setDragEnd] =
|
|
2656
|
-
const [isSelecting, setIsSelecting] =
|
|
2657
|
-
const [isDragging, setIsDragging] =
|
|
2658
|
-
const [isEditing, setIsEditing] =
|
|
2659
|
-
const [columnVisibility, setColumnVisibility] =
|
|
2660
|
-
const [rowVisibility, setRowVisibility] =
|
|
2801
|
+
const [anchor, setAnchor] = useState9(null);
|
|
2802
|
+
const [rangeEnd, setRangeEnd] = useState9(null);
|
|
2803
|
+
const [dragEnd, setDragEnd] = useState9(null);
|
|
2804
|
+
const [isSelecting, setIsSelecting] = useState9(false);
|
|
2805
|
+
const [isDragging, setIsDragging] = useState9(false);
|
|
2806
|
+
const [isEditing, setIsEditing] = useState9(false);
|
|
2807
|
+
const [columnVisibility, setColumnVisibility] = useState9({});
|
|
2808
|
+
const [rowVisibility, setRowVisibility] = useState9({});
|
|
2661
2809
|
const grid = useReactTable({
|
|
2662
2810
|
data,
|
|
2663
2811
|
columns,
|
|
@@ -2684,10 +2832,13 @@ var DataGridRoot = ({
|
|
|
2684
2832
|
[flatRows, rowVisibility]
|
|
2685
2833
|
);
|
|
2686
2834
|
const visibleColumns = grid.getVisibleLeafColumns();
|
|
2835
|
+
const effectiveRowCount = isLazyMode ? totalRowCount : visibleRows.length;
|
|
2687
2836
|
const rowVirtualizer = useVirtualizer({
|
|
2688
|
-
count:
|
|
2837
|
+
count: effectiveRowCount,
|
|
2689
2838
|
estimateSize: () => ROW_HEIGHT,
|
|
2690
2839
|
getScrollElement: () => containerRef.current,
|
|
2840
|
+
// Measure actual row heights for dynamic sizing (disabled in Firefox due to measurement issues). Taken from Tanstack
|
|
2841
|
+
measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element?.getBoundingClientRect().height : void 0,
|
|
2691
2842
|
overscan: 5,
|
|
2692
2843
|
rangeExtractor: (range) => {
|
|
2693
2844
|
const toRender = new Set(
|
|
@@ -2706,6 +2857,56 @@ var DataGridRoot = ({
|
|
|
2706
2857
|
}
|
|
2707
2858
|
});
|
|
2708
2859
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
2860
|
+
const lazyLoadingRefs = useRef4({
|
|
2861
|
+
onFetchMore,
|
|
2862
|
+
hasNextPage,
|
|
2863
|
+
isFetchingMore,
|
|
2864
|
+
loadedRowCount: visibleRows.length
|
|
2865
|
+
});
|
|
2866
|
+
useEffect6(() => {
|
|
2867
|
+
lazyLoadingRefs.current = {
|
|
2868
|
+
onFetchMore,
|
|
2869
|
+
hasNextPage,
|
|
2870
|
+
isFetchingMore,
|
|
2871
|
+
loadedRowCount: visibleRows.length
|
|
2872
|
+
};
|
|
2873
|
+
}, [onFetchMore, hasNextPage, isFetchingMore, visibleRows.length]);
|
|
2874
|
+
const hasData = visibleRows.length > 0;
|
|
2875
|
+
const handleScroll = useCallback15(() => {
|
|
2876
|
+
const { onFetchMore: onFetchMore2, hasNextPage: hasNextPage2, isFetchingMore: isFetchingMore2, loadedRowCount } = lazyLoadingRefs.current;
|
|
2877
|
+
if (!onFetchMore2 || !hasNextPage2 || isFetchingMore2) {
|
|
2878
|
+
return;
|
|
2879
|
+
}
|
|
2880
|
+
const scrollElement = containerRef.current;
|
|
2881
|
+
const { scrollTop, clientHeight } = scrollElement;
|
|
2882
|
+
const loadedHeight = loadedRowCount * ROW_HEIGHT;
|
|
2883
|
+
const viewportBottom = scrollTop + clientHeight;
|
|
2884
|
+
const fetchThreshold = loadedHeight - ROW_HEIGHT * 10;
|
|
2885
|
+
if (viewportBottom >= fetchThreshold) {
|
|
2886
|
+
onFetchMore2();
|
|
2887
|
+
}
|
|
2888
|
+
}, [lazyLoadingRefs, containerRef]);
|
|
2889
|
+
useEffect6(() => {
|
|
2890
|
+
if (!isLazyMode || !hasData) {
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
const container = containerRef.current;
|
|
2894
|
+
if (!container) {
|
|
2895
|
+
return;
|
|
2896
|
+
}
|
|
2897
|
+
const timeoutId = setTimeout(() => {
|
|
2898
|
+
const scrollElement = containerRef.current;
|
|
2899
|
+
if (!scrollElement) {
|
|
2900
|
+
return;
|
|
2901
|
+
}
|
|
2902
|
+
scrollElement.addEventListener("scroll", handleScroll);
|
|
2903
|
+
}, 100);
|
|
2904
|
+
return () => {
|
|
2905
|
+
clearTimeout(timeoutId);
|
|
2906
|
+
const scrollElement = containerRef.current;
|
|
2907
|
+
scrollElement?.removeEventListener("scroll", handleScroll);
|
|
2908
|
+
};
|
|
2909
|
+
}, [isLazyMode, hasData]);
|
|
2709
2910
|
const columnVirtualizer = useVirtualizer({
|
|
2710
2911
|
count: visibleColumns.length,
|
|
2711
2912
|
estimateSize: (index) => visibleColumns[index].getSize(),
|
|
@@ -2747,7 +2948,7 @@ var DataGridRoot = ({
|
|
|
2747
2948
|
[flatRows, columns, multiColumnSelection]
|
|
2748
2949
|
);
|
|
2749
2950
|
const queryTool = useDataGridQueryTool(containerRef);
|
|
2750
|
-
const setSingleRange =
|
|
2951
|
+
const setSingleRange = useCallback15(
|
|
2751
2952
|
(coordinates) => {
|
|
2752
2953
|
setAnchor(coordinates);
|
|
2753
2954
|
setRangeEnd(coordinates);
|
|
@@ -2755,7 +2956,7 @@ var DataGridRoot = ({
|
|
|
2755
2956
|
[]
|
|
2756
2957
|
);
|
|
2757
2958
|
const { errorCount, isHighlighted, toggleErrorHighlighting } = useDataGridErrorHighlighting(matrix, grid, errors);
|
|
2758
|
-
const handleToggleErrorHighlighting =
|
|
2959
|
+
const handleToggleErrorHighlighting = useCallback15(() => {
|
|
2759
2960
|
toggleErrorHighlighting(
|
|
2760
2961
|
rowVisibility,
|
|
2761
2962
|
columnVisibility,
|
|
@@ -2769,7 +2970,7 @@ var DataGridRoot = ({
|
|
|
2769
2970
|
handleResetColumns,
|
|
2770
2971
|
isDisabled: isColumsDisabled
|
|
2771
2972
|
} = useDataGridColumnVisibility(grid, matrix);
|
|
2772
|
-
const handleToggleColumnVisibility =
|
|
2973
|
+
const handleToggleColumnVisibility = useCallback15(
|
|
2773
2974
|
(index) => {
|
|
2774
2975
|
return handleToggleColumn(index);
|
|
2775
2976
|
},
|
|
@@ -2791,7 +2992,7 @@ var DataGridRoot = ({
|
|
|
2791
2992
|
matrix,
|
|
2792
2993
|
form: state
|
|
2793
2994
|
});
|
|
2794
|
-
const onEditingChangeHandler =
|
|
2995
|
+
const onEditingChangeHandler = useCallback15(
|
|
2795
2996
|
(value) => {
|
|
2796
2997
|
if (onEditingChange) {
|
|
2797
2998
|
onEditingChange(value);
|
|
@@ -2879,7 +3080,7 @@ var DataGridRoot = ({
|
|
|
2879
3080
|
const { getCellErrorMetadata, getCellMetadata } = useDataGridCellMetadata({
|
|
2880
3081
|
matrix
|
|
2881
3082
|
});
|
|
2882
|
-
|
|
3083
|
+
useEffect6(() => {
|
|
2883
3084
|
if (!trapActive) {
|
|
2884
3085
|
return;
|
|
2885
3086
|
}
|
|
@@ -2900,7 +3101,7 @@ var DataGridRoot = ({
|
|
|
2900
3101
|
handleCopyEvent,
|
|
2901
3102
|
handlePasteEvent
|
|
2902
3103
|
]);
|
|
2903
|
-
|
|
3104
|
+
useEffect6(() => {
|
|
2904
3105
|
const specialFocusHandler = (e) => {
|
|
2905
3106
|
if (isSpecialFocusKey(e)) {
|
|
2906
3107
|
handleSpecialFocusKeys(e);
|
|
@@ -2912,12 +3113,12 @@ var DataGridRoot = ({
|
|
|
2912
3113
|
window.removeEventListener("keydown", specialFocusHandler);
|
|
2913
3114
|
};
|
|
2914
3115
|
}, [handleSpecialFocusKeys]);
|
|
2915
|
-
const handleHeaderInteractionChange =
|
|
3116
|
+
const handleHeaderInteractionChange = useCallback15((isActive) => {
|
|
2916
3117
|
if (isActive) {
|
|
2917
3118
|
setTrapActive(false);
|
|
2918
3119
|
}
|
|
2919
3120
|
}, []);
|
|
2920
|
-
|
|
3121
|
+
useEffect6(() => {
|
|
2921
3122
|
if (!anchor) {
|
|
2922
3123
|
return;
|
|
2923
3124
|
}
|
|
@@ -2926,7 +3127,7 @@ var DataGridRoot = ({
|
|
|
2926
3127
|
}
|
|
2927
3128
|
setRangeEnd(anchor);
|
|
2928
3129
|
}, [anchor, rangeEnd]);
|
|
2929
|
-
|
|
3130
|
+
useEffect6(() => {
|
|
2930
3131
|
if (!anchor && matrix) {
|
|
2931
3132
|
const coords = matrix.getFirstNavigableCell();
|
|
2932
3133
|
if (coords) {
|
|
@@ -2978,7 +3179,7 @@ var DataGridRoot = ({
|
|
|
2978
3179
|
navigateToField
|
|
2979
3180
|
]
|
|
2980
3181
|
);
|
|
2981
|
-
const handleRestoreGridFocus =
|
|
3182
|
+
const handleRestoreGridFocus = useCallback15(() => {
|
|
2982
3183
|
if (anchor && !trapActive) {
|
|
2983
3184
|
setTrapActive(true);
|
|
2984
3185
|
setSingleRange(anchor);
|
|
@@ -2988,10 +3189,11 @@ var DataGridRoot = ({
|
|
|
2988
3189
|
});
|
|
2989
3190
|
}
|
|
2990
3191
|
}, [anchor, trapActive, setSingleRange, scrollToCoordinates, queryTool]);
|
|
2991
|
-
return /* @__PURE__ */
|
|
2992
|
-
/* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx10(DataGridContext.Provider, { value: values, children: /* @__PURE__ */ jsxs7("div", { className: "bg-ui-bg-subtle flex size-full flex-col", children: [
|
|
3193
|
+
/* @__PURE__ */ jsx10(
|
|
2993
3194
|
DataGridHeader,
|
|
2994
3195
|
{
|
|
3196
|
+
showColumnsDropdown,
|
|
2995
3197
|
columnOptions,
|
|
2996
3198
|
isDisabled: isColumsDisabled,
|
|
2997
3199
|
onToggleColumn: handleToggleColumnVisibility,
|
|
@@ -2999,10 +3201,11 @@ var DataGridRoot = ({
|
|
|
2999
3201
|
onToggleErrorHighlighting: handleToggleErrorHighlighting,
|
|
3000
3202
|
onResetColumns: handleResetColumns,
|
|
3001
3203
|
isHighlighted,
|
|
3002
|
-
onHeaderInteractionChange: handleHeaderInteractionChange
|
|
3204
|
+
onHeaderInteractionChange: handleHeaderInteractionChange,
|
|
3205
|
+
headerContent
|
|
3003
3206
|
}
|
|
3004
3207
|
),
|
|
3005
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsx10("div", { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx10(
|
|
3006
3209
|
"div",
|
|
3007
3210
|
{
|
|
3008
3211
|
ref: containerRef,
|
|
@@ -3014,7 +3217,7 @@ var DataGridRoot = ({
|
|
|
3014
3217
|
"data-container": true,
|
|
3015
3218
|
role: "application",
|
|
3016
3219
|
children: /* @__PURE__ */ jsxs7("div", { role: "grid", className: "text-ui-fg-subtle grid", children: [
|
|
3017
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ jsx10(
|
|
3018
3221
|
"div",
|
|
3019
3222
|
{
|
|
3020
3223
|
role: "rowgroup",
|
|
@@ -3025,7 +3228,7 @@ var DataGridRoot = ({
|
|
|
3025
3228
|
role: "row",
|
|
3026
3229
|
className: "flex h-10 w-full",
|
|
3027
3230
|
children: [
|
|
3028
|
-
virtualPaddingLeft ? /* @__PURE__ */
|
|
3231
|
+
virtualPaddingLeft ? /* @__PURE__ */ jsx10(
|
|
3029
3232
|
"div",
|
|
3030
3233
|
{
|
|
3031
3234
|
role: "presentation",
|
|
@@ -3037,7 +3240,7 @@ var DataGridRoot = ({
|
|
|
3037
3240
|
const previousVC = array[index - 1];
|
|
3038
3241
|
if (previousVC && vc.index !== previousVC.index + 1) {
|
|
3039
3242
|
acc.push(
|
|
3040
|
-
/* @__PURE__ */
|
|
3243
|
+
/* @__PURE__ */ jsx10(
|
|
3041
3244
|
"div",
|
|
3042
3245
|
{
|
|
3043
3246
|
role: "presentation",
|
|
@@ -3051,7 +3254,7 @@ var DataGridRoot = ({
|
|
|
3051
3254
|
);
|
|
3052
3255
|
}
|
|
3053
3256
|
acc.push(
|
|
3054
|
-
/* @__PURE__ */
|
|
3257
|
+
/* @__PURE__ */ jsx10(
|
|
3055
3258
|
"div",
|
|
3056
3259
|
{
|
|
3057
3260
|
role: "columnheader",
|
|
@@ -3071,7 +3274,7 @@ var DataGridRoot = ({
|
|
|
3071
3274
|
);
|
|
3072
3275
|
return acc;
|
|
3073
3276
|
}, []),
|
|
3074
|
-
virtualPaddingRight ? /* @__PURE__ */
|
|
3277
|
+
virtualPaddingRight ? /* @__PURE__ */ jsx10(
|
|
3075
3278
|
"div",
|
|
3076
3279
|
{
|
|
3077
3280
|
role: "presentation",
|
|
@@ -3087,7 +3290,7 @@ var DataGridRoot = ({
|
|
|
3087
3290
|
))
|
|
3088
3291
|
}
|
|
3089
3292
|
),
|
|
3090
|
-
/* @__PURE__ */
|
|
3293
|
+
/* @__PURE__ */ jsx10(
|
|
3091
3294
|
"div",
|
|
3092
3295
|
{
|
|
3093
3296
|
role: "rowgroup",
|
|
@@ -3097,13 +3300,26 @@ var DataGridRoot = ({
|
|
|
3097
3300
|
},
|
|
3098
3301
|
children: virtualRows.map((virtualRow) => {
|
|
3099
3302
|
const row = visibleRows[virtualRow.index];
|
|
3303
|
+
if (!row) {
|
|
3304
|
+
return /* @__PURE__ */ jsx10(
|
|
3305
|
+
DataGridRowSkeleton,
|
|
3306
|
+
{
|
|
3307
|
+
virtualRow,
|
|
3308
|
+
virtualColumns,
|
|
3309
|
+
virtualPaddingLeft,
|
|
3310
|
+
virtualPaddingRight
|
|
3311
|
+
},
|
|
3312
|
+
`skeleton-${virtualRow.index}`
|
|
3313
|
+
);
|
|
3314
|
+
}
|
|
3100
3315
|
const rowIndex = flatRows.findIndex((r) => r.id === row.id);
|
|
3101
|
-
return /* @__PURE__ */
|
|
3316
|
+
return /* @__PURE__ */ jsx10(
|
|
3102
3317
|
DataGridRow,
|
|
3103
3318
|
{
|
|
3104
3319
|
row,
|
|
3105
3320
|
rowIndex,
|
|
3106
3321
|
virtualRow,
|
|
3322
|
+
rowVirtualizer,
|
|
3107
3323
|
flatColumns,
|
|
3108
3324
|
virtualColumns,
|
|
3109
3325
|
anchor,
|
|
@@ -3130,10 +3346,12 @@ var DataGridHeader = ({
|
|
|
3130
3346
|
isHighlighted,
|
|
3131
3347
|
errorCount,
|
|
3132
3348
|
onToggleErrorHighlighting,
|
|
3133
|
-
onHeaderInteractionChange
|
|
3349
|
+
onHeaderInteractionChange,
|
|
3350
|
+
showColumnsDropdown,
|
|
3351
|
+
headerContent
|
|
3134
3352
|
}) => {
|
|
3135
|
-
const [shortcutsOpen, setShortcutsOpen] =
|
|
3136
|
-
const [columnsOpen, setColumnsOpen] =
|
|
3353
|
+
const [shortcutsOpen, setShortcutsOpen] = useState9(false);
|
|
3354
|
+
const [columnsOpen, setColumnsOpen] = useState9(false);
|
|
3137
3355
|
const { t } = useTranslation3();
|
|
3138
3356
|
const direction = useDocumentDirection();
|
|
3139
3357
|
const hasChanged = columnOptions.some((column) => !column.checked);
|
|
@@ -3146,7 +3364,7 @@ var DataGridHeader = ({
|
|
|
3146
3364
|
setColumnsOpen(value);
|
|
3147
3365
|
};
|
|
3148
3366
|
return /* @__PURE__ */ jsxs7("div", { className: "bg-ui-bg-base flex items-center justify-between border-b p-4", children: [
|
|
3149
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-2", children: [
|
|
3367
|
+
showColumnsDropdown && /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-2", children: [
|
|
3150
3368
|
/* @__PURE__ */ jsxs7(
|
|
3151
3369
|
DropdownMenu,
|
|
3152
3370
|
{
|
|
@@ -3154,23 +3372,23 @@ var DataGridHeader = ({
|
|
|
3154
3372
|
open: columnsOpen,
|
|
3155
3373
|
onOpenChange: handleColumnsOpenChange,
|
|
3156
3374
|
children: [
|
|
3157
|
-
/* @__PURE__ */
|
|
3375
|
+
/* @__PURE__ */ jsx10(
|
|
3158
3376
|
ConditionalTooltip,
|
|
3159
3377
|
{
|
|
3160
3378
|
showTooltip: isDisabled,
|
|
3161
3379
|
content: t("dataGrid.columns.disabled"),
|
|
3162
|
-
children: /* @__PURE__ */
|
|
3163
|
-
hasChanged ? /* @__PURE__ */
|
|
3380
|
+
children: /* @__PURE__ */ jsx10(DropdownMenu.Trigger, { asChild: true, disabled: isDisabled, children: /* @__PURE__ */ jsxs7(Button2, { size: "small", variant: "secondary", children: [
|
|
3381
|
+
hasChanged ? /* @__PURE__ */ jsx10(AdjustmentsDone, {}) : /* @__PURE__ */ jsx10(Adjustments, {}),
|
|
3164
3382
|
t("dataGrid.columns.view")
|
|
3165
3383
|
] }) })
|
|
3166
3384
|
}
|
|
3167
3385
|
),
|
|
3168
|
-
/* @__PURE__ */
|
|
3386
|
+
/* @__PURE__ */ jsx10(DropdownMenu.Content, { children: columnOptions.map((column, index) => {
|
|
3169
3387
|
const { checked, disabled, id, name } = column;
|
|
3170
3388
|
if (disabled) {
|
|
3171
3389
|
return null;
|
|
3172
3390
|
}
|
|
3173
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ jsx10(
|
|
3174
3392
|
DropdownMenu.CheckboxItem,
|
|
3175
3393
|
{
|
|
3176
3394
|
checked,
|
|
@@ -3184,7 +3402,7 @@ var DataGridHeader = ({
|
|
|
3184
3402
|
]
|
|
3185
3403
|
}
|
|
3186
3404
|
),
|
|
3187
|
-
hasChanged && /* @__PURE__ */
|
|
3405
|
+
hasChanged && /* @__PURE__ */ jsx10(
|
|
3188
3406
|
Button2,
|
|
3189
3407
|
{
|
|
3190
3408
|
size: "small",
|
|
@@ -3197,7 +3415,8 @@ var DataGridHeader = ({
|
|
|
3197
3415
|
}
|
|
3198
3416
|
)
|
|
3199
3417
|
] }),
|
|
3200
|
-
|
|
3418
|
+
headerContent,
|
|
3419
|
+
/* @__PURE__ */ jsxs7("div", { className: "ml-auto flex items-center gap-x-2", children: [
|
|
3201
3420
|
errorCount > 0 && /* @__PURE__ */ jsxs7(
|
|
3202
3421
|
Button2,
|
|
3203
3422
|
{
|
|
@@ -3205,18 +3424,18 @@ var DataGridHeader = ({
|
|
|
3205
3424
|
variant: "secondary",
|
|
3206
3425
|
type: "button",
|
|
3207
3426
|
onClick: onToggleErrorHighlighting,
|
|
3208
|
-
className:
|
|
3427
|
+
className: clx6({
|
|
3209
3428
|
"bg-ui-button-neutral-pressed": isHighlighted
|
|
3210
3429
|
}),
|
|
3211
3430
|
children: [
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
3431
|
+
/* @__PURE__ */ jsx10(ExclamationCircle2, { className: "text-ui-fg-subtle" }),
|
|
3432
|
+
/* @__PURE__ */ jsx10("span", { children: t("dataGrid.errors.count", {
|
|
3214
3433
|
count: errorCount
|
|
3215
3434
|
}) })
|
|
3216
3435
|
]
|
|
3217
3436
|
}
|
|
3218
3437
|
),
|
|
3219
|
-
/* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ jsx10(
|
|
3220
3439
|
DataGridKeyboardShortcutModal,
|
|
3221
3440
|
{
|
|
3222
3441
|
open: shortcutsOpen,
|
|
@@ -3239,7 +3458,7 @@ var DataGridCell = ({
|
|
|
3239
3458
|
col: columnIndex
|
|
3240
3459
|
};
|
|
3241
3460
|
const isAnchor = isCellMatch(coords, anchor);
|
|
3242
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ jsx10(
|
|
3243
3462
|
"div",
|
|
3244
3463
|
{
|
|
3245
3464
|
role: "gridcell",
|
|
@@ -3251,21 +3470,21 @@ var DataGridCell = ({
|
|
|
3251
3470
|
},
|
|
3252
3471
|
"data-row-index": rowIndex,
|
|
3253
3472
|
"data-column-index": columnIndex,
|
|
3254
|
-
className:
|
|
3255
|
-
"relative flex items-
|
|
3473
|
+
className: clx6(
|
|
3474
|
+
"relative flex items-stretch border-b border-r p-0 outline-none"
|
|
3256
3475
|
),
|
|
3257
3476
|
tabIndex: -1,
|
|
3258
|
-
children: /* @__PURE__ */ jsxs7("div", { className: "relative
|
|
3477
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "relative w-full", children: [
|
|
3259
3478
|
flexRender(cell.column.columnDef.cell, {
|
|
3260
3479
|
...cell.getContext(),
|
|
3261
3480
|
columnIndex,
|
|
3262
3481
|
rowIndex
|
|
3263
3482
|
}),
|
|
3264
|
-
isAnchor && /* @__PURE__ */
|
|
3483
|
+
isAnchor && /* @__PURE__ */ jsx10(
|
|
3265
3484
|
"div",
|
|
3266
3485
|
{
|
|
3267
3486
|
onMouseDown: onDragToFillStart,
|
|
3268
|
-
className:
|
|
3487
|
+
className: clx6(
|
|
3269
3488
|
"bg-ui-fg-interactive absolute bottom-0 right-0 z-[3] size-1.5 cursor-ns-resize",
|
|
3270
3489
|
{
|
|
3271
3490
|
"cursor-nwse-resize": multiColumnSelection
|
|
@@ -3281,6 +3500,7 @@ var DataGridRow = ({
|
|
|
3281
3500
|
row,
|
|
3282
3501
|
rowIndex,
|
|
3283
3502
|
virtualRow,
|
|
3503
|
+
rowVirtualizer,
|
|
3284
3504
|
virtualPaddingLeft,
|
|
3285
3505
|
virtualPaddingRight,
|
|
3286
3506
|
virtualColumns,
|
|
@@ -3295,12 +3515,14 @@ var DataGridRow = ({
|
|
|
3295
3515
|
{
|
|
3296
3516
|
role: "row",
|
|
3297
3517
|
"aria-rowindex": virtualRow.index,
|
|
3518
|
+
"data-index": virtualRow.index,
|
|
3519
|
+
ref: (node) => rowVirtualizer.measureElement(node),
|
|
3298
3520
|
style: {
|
|
3299
3521
|
transform: `translateY(${virtualRow.start}px)`
|
|
3300
3522
|
},
|
|
3301
|
-
className: "bg-ui-bg-subtle txt-compact-small absolute flex h-10 w-full",
|
|
3523
|
+
className: "bg-ui-bg-subtle txt-compact-small absolute flex min-h-10 w-full",
|
|
3302
3524
|
children: [
|
|
3303
|
-
virtualPaddingLeft ? /* @__PURE__ */
|
|
3525
|
+
virtualPaddingLeft ? /* @__PURE__ */ jsx10(
|
|
3304
3526
|
"div",
|
|
3305
3527
|
{
|
|
3306
3528
|
role: "presentation",
|
|
@@ -3314,7 +3536,7 @@ var DataGridRow = ({
|
|
|
3314
3536
|
const previousVC = array[index - 1];
|
|
3315
3537
|
if (previousVC && vc.index !== previousVC.index + 1) {
|
|
3316
3538
|
acc.push(
|
|
3317
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsx10(
|
|
3318
3540
|
"div",
|
|
3319
3541
|
{
|
|
3320
3542
|
role: "presentation",
|
|
@@ -3328,7 +3550,7 @@ var DataGridRow = ({
|
|
|
3328
3550
|
);
|
|
3329
3551
|
}
|
|
3330
3552
|
acc.push(
|
|
3331
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ jsx10(
|
|
3332
3554
|
DataGridCell,
|
|
3333
3555
|
{
|
|
3334
3556
|
cell,
|
|
@@ -3343,7 +3565,73 @@ var DataGridRow = ({
|
|
|
3343
3565
|
);
|
|
3344
3566
|
return acc;
|
|
3345
3567
|
}, []),
|
|
3346
|
-
virtualPaddingRight ? /* @__PURE__ */
|
|
3568
|
+
virtualPaddingRight ? /* @__PURE__ */ jsx10(
|
|
3569
|
+
"div",
|
|
3570
|
+
{
|
|
3571
|
+
role: "presentation",
|
|
3572
|
+
style: { display: "flex", width: virtualPaddingRight }
|
|
3573
|
+
}
|
|
3574
|
+
) : null
|
|
3575
|
+
]
|
|
3576
|
+
}
|
|
3577
|
+
);
|
|
3578
|
+
};
|
|
3579
|
+
var DataGridRowSkeleton = ({
|
|
3580
|
+
virtualRow,
|
|
3581
|
+
virtualPaddingLeft,
|
|
3582
|
+
virtualPaddingRight,
|
|
3583
|
+
virtualColumns
|
|
3584
|
+
}) => {
|
|
3585
|
+
return /* @__PURE__ */ jsxs7(
|
|
3586
|
+
"div",
|
|
3587
|
+
{
|
|
3588
|
+
role: "row",
|
|
3589
|
+
"aria-rowindex": virtualRow.index,
|
|
3590
|
+
style: {
|
|
3591
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
3592
|
+
},
|
|
3593
|
+
className: "bg-ui-bg-subtle txt-compact-small absolute flex h-10 w-full",
|
|
3594
|
+
children: [
|
|
3595
|
+
virtualPaddingLeft ? /* @__PURE__ */ jsx10(
|
|
3596
|
+
"div",
|
|
3597
|
+
{
|
|
3598
|
+
role: "presentation",
|
|
3599
|
+
style: { display: "flex", width: virtualPaddingLeft }
|
|
3600
|
+
}
|
|
3601
|
+
) : null,
|
|
3602
|
+
virtualColumns.map((vc, index, array) => {
|
|
3603
|
+
const previousVC = array[index - 1];
|
|
3604
|
+
const elements = [];
|
|
3605
|
+
if (previousVC && vc.index !== previousVC.index + 1) {
|
|
3606
|
+
elements.push(
|
|
3607
|
+
/* @__PURE__ */ jsx10(
|
|
3608
|
+
"div",
|
|
3609
|
+
{
|
|
3610
|
+
role: "presentation",
|
|
3611
|
+
style: {
|
|
3612
|
+
display: "flex",
|
|
3613
|
+
width: `${vc.start - previousVC.end}px`
|
|
3614
|
+
}
|
|
3615
|
+
},
|
|
3616
|
+
`padding-${previousVC.index}-${vc.index}`
|
|
3617
|
+
)
|
|
3618
|
+
);
|
|
3619
|
+
}
|
|
3620
|
+
elements.push(
|
|
3621
|
+
/* @__PURE__ */ jsx10(
|
|
3622
|
+
"div",
|
|
3623
|
+
{
|
|
3624
|
+
role: "gridcell",
|
|
3625
|
+
style: { width: vc.size },
|
|
3626
|
+
className: "relative flex items-center border-b border-r p-0 outline-none",
|
|
3627
|
+
children: /* @__PURE__ */ jsx10("div", { className: "flex h-full w-full items-center px-4", children: /* @__PURE__ */ jsx10("div", { className: "bg-ui-bg-component h-4 w-3/4 animate-pulse rounded" }) })
|
|
3628
|
+
},
|
|
3629
|
+
`skeleton-cell-${vc.index}`
|
|
3630
|
+
)
|
|
3631
|
+
);
|
|
3632
|
+
return elements;
|
|
3633
|
+
}),
|
|
3634
|
+
virtualPaddingRight ? /* @__PURE__ */ jsx10(
|
|
3347
3635
|
"div",
|
|
3348
3636
|
{
|
|
3349
3637
|
role: "presentation",
|
|
@@ -3356,10 +3644,10 @@ var DataGridRow = ({
|
|
|
3356
3644
|
};
|
|
3357
3645
|
|
|
3358
3646
|
// src/components/data-grid/components/data-grid-text-cell.tsx
|
|
3359
|
-
import { clx as
|
|
3360
|
-
import { useEffect as
|
|
3361
|
-
import { Controller as
|
|
3362
|
-
import { jsx as
|
|
3647
|
+
import { clx as clx7 } from "@medusajs/ui";
|
|
3648
|
+
import { useEffect as useEffect7, useRef as useRef5, useState as useState10 } from "react";
|
|
3649
|
+
import { Controller as Controller5 } from "react-hook-form";
|
|
3650
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
3363
3651
|
var DataGridTextCell = ({
|
|
3364
3652
|
context
|
|
3365
3653
|
}) => {
|
|
@@ -3368,38 +3656,40 @@ var DataGridTextCell = ({
|
|
|
3368
3656
|
});
|
|
3369
3657
|
const errorProps = useDataGridCellError({ context });
|
|
3370
3658
|
const { container, input } = renderProps;
|
|
3371
|
-
return /* @__PURE__ */
|
|
3372
|
-
|
|
3659
|
+
return /* @__PURE__ */ jsx11(
|
|
3660
|
+
Controller5,
|
|
3373
3661
|
{
|
|
3374
3662
|
control,
|
|
3375
3663
|
name: field,
|
|
3376
3664
|
render: ({ field: field2 }) => {
|
|
3377
|
-
return /* @__PURE__ */
|
|
3665
|
+
return /* @__PURE__ */ jsx11(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx11(Inner5, { field: field2, inputProps: input }) });
|
|
3378
3666
|
}
|
|
3379
3667
|
}
|
|
3380
3668
|
);
|
|
3381
3669
|
};
|
|
3382
|
-
var
|
|
3670
|
+
var Inner5 = ({
|
|
3383
3671
|
field,
|
|
3384
3672
|
inputProps
|
|
3385
3673
|
}) => {
|
|
3386
3674
|
const { onChange: _, onBlur, ref, value, ...rest } = field;
|
|
3387
3675
|
const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps;
|
|
3388
|
-
const [localValue, setLocalValue] =
|
|
3389
|
-
|
|
3676
|
+
const [localValue, setLocalValue] = useState10(value);
|
|
3677
|
+
const inputElRef = useRef5(null);
|
|
3678
|
+
useEffect7(() => {
|
|
3390
3679
|
setLocalValue(value);
|
|
3391
3680
|
}, [value]);
|
|
3392
|
-
const combinedRefs = useCombinedRefs(inputRef, ref);
|
|
3393
|
-
return /* @__PURE__ */
|
|
3681
|
+
const combinedRefs = useCombinedRefs(inputRef, ref, inputElRef);
|
|
3682
|
+
return /* @__PURE__ */ jsx11(
|
|
3394
3683
|
"input",
|
|
3395
3684
|
{
|
|
3396
|
-
className:
|
|
3397
|
-
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer
|
|
3398
|
-
"focus:cursor-text"
|
|
3685
|
+
className: clx7(
|
|
3686
|
+
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer bg-transparent outline-none",
|
|
3687
|
+
"focus:cursor-text",
|
|
3688
|
+
"items-center justify-center"
|
|
3399
3689
|
),
|
|
3400
3690
|
autoComplete: "off",
|
|
3401
3691
|
tabIndex: -1,
|
|
3402
|
-
value: localValue,
|
|
3692
|
+
value: localValue ?? "",
|
|
3403
3693
|
onChange: (e) => setLocalValue(e.target.value),
|
|
3404
3694
|
ref: combinedRefs,
|
|
3405
3695
|
onBlur: () => {
|
|
@@ -3413,23 +3703,235 @@ var Inner4 = ({
|
|
|
3413
3703
|
);
|
|
3414
3704
|
};
|
|
3415
3705
|
|
|
3706
|
+
// src/components/data-grid/components/data-grid-textarea-modal-cell.tsx
|
|
3707
|
+
import { clx as clx8, Textarea } from "@medusajs/ui";
|
|
3708
|
+
import { Popover as RadixPopover } from "radix-ui";
|
|
3709
|
+
import { useCallback as useCallback16, useEffect as useEffect8, useRef as useRef6, useState as useState11 } from "react";
|
|
3710
|
+
import { Controller as Controller6 } from "react-hook-form";
|
|
3711
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3712
|
+
var DataGridExpandableTextCell = ({
|
|
3713
|
+
context,
|
|
3714
|
+
fieldLabel
|
|
3715
|
+
}) => {
|
|
3716
|
+
const { field, control, renderProps } = useDataGridCell({
|
|
3717
|
+
context
|
|
3718
|
+
});
|
|
3719
|
+
const errorProps = useDataGridCellError({ context });
|
|
3720
|
+
const { container, input } = renderProps;
|
|
3721
|
+
return /* @__PURE__ */ jsx12(
|
|
3722
|
+
Controller6,
|
|
3723
|
+
{
|
|
3724
|
+
control,
|
|
3725
|
+
name: field,
|
|
3726
|
+
render: ({ field: field2 }) => {
|
|
3727
|
+
return /* @__PURE__ */ jsx12(
|
|
3728
|
+
Inner6,
|
|
3729
|
+
{
|
|
3730
|
+
field: field2,
|
|
3731
|
+
inputProps: input,
|
|
3732
|
+
fieldLabel,
|
|
3733
|
+
container,
|
|
3734
|
+
errorProps
|
|
3735
|
+
}
|
|
3736
|
+
);
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
);
|
|
3740
|
+
};
|
|
3741
|
+
var Inner6 = ({
|
|
3742
|
+
field,
|
|
3743
|
+
inputProps,
|
|
3744
|
+
fieldLabel: _fieldLabel,
|
|
3745
|
+
container,
|
|
3746
|
+
errorProps
|
|
3747
|
+
}) => {
|
|
3748
|
+
const { onChange: _, onBlur, ref, value, ...rest } = field;
|
|
3749
|
+
const { ref: inputRef, onBlur: onInputBlur, onChange, ...input } = inputProps;
|
|
3750
|
+
const { setSingleRange, anchor } = useDataGridContext();
|
|
3751
|
+
const { row, col } = anchor || { row: 0, col: 0 };
|
|
3752
|
+
const [localValue, setLocalValue] = useState11(value || "");
|
|
3753
|
+
const [isPopoverOpen, setIsPopoverOpen] = useState11(false);
|
|
3754
|
+
const [popoverValue, setPopoverValue] = useState11(value || "");
|
|
3755
|
+
const popoverContentRef = useRef6(null);
|
|
3756
|
+
useEffect8(() => {
|
|
3757
|
+
setLocalValue(value || "");
|
|
3758
|
+
}, [value]);
|
|
3759
|
+
useEffect8(() => {
|
|
3760
|
+
if (isPopoverOpen) {
|
|
3761
|
+
setPopoverValue(value || "");
|
|
3762
|
+
}
|
|
3763
|
+
}, [isPopoverOpen, value]);
|
|
3764
|
+
useEffect8(() => {
|
|
3765
|
+
if (!isPopoverOpen || !popoverContentRef.current) {
|
|
3766
|
+
return;
|
|
3767
|
+
}
|
|
3768
|
+
const handleKeyDownCapture = (e) => {
|
|
3769
|
+
const target = e.target;
|
|
3770
|
+
const isTextarea = target.tagName === "TEXTAREA";
|
|
3771
|
+
const isInPopover = popoverContentRef.current && popoverContentRef.current.contains(target);
|
|
3772
|
+
if (isTextarea || isInPopover) {
|
|
3773
|
+
const dataGridKeys = [
|
|
3774
|
+
"Enter",
|
|
3775
|
+
"Delete",
|
|
3776
|
+
"Backspace",
|
|
3777
|
+
"ArrowUp",
|
|
3778
|
+
"ArrowDown",
|
|
3779
|
+
"ArrowLeft",
|
|
3780
|
+
"ArrowRight",
|
|
3781
|
+
"Tab",
|
|
3782
|
+
" "
|
|
3783
|
+
];
|
|
3784
|
+
if (dataGridKeys.includes(e.key) && e.key !== "Escape") {
|
|
3785
|
+
e.stopImmediatePropagation();
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
};
|
|
3789
|
+
window.addEventListener("keydown", handleKeyDownCapture, true);
|
|
3790
|
+
return () => {
|
|
3791
|
+
window.removeEventListener("keydown", handleKeyDownCapture, true);
|
|
3792
|
+
};
|
|
3793
|
+
}, [isPopoverOpen]);
|
|
3794
|
+
const combinedRefs = useCombinedRefs(inputRef, ref);
|
|
3795
|
+
const handleOverlayMouseDown = useCallback16(
|
|
3796
|
+
(e) => {
|
|
3797
|
+
if (e.detail === 2) {
|
|
3798
|
+
e.preventDefault();
|
|
3799
|
+
e.stopPropagation();
|
|
3800
|
+
setSingleRange({ row, col });
|
|
3801
|
+
setIsPopoverOpen(true);
|
|
3802
|
+
return;
|
|
3803
|
+
}
|
|
3804
|
+
container.overlayProps.onMouseDown?.(e);
|
|
3805
|
+
},
|
|
3806
|
+
[container.overlayProps, setSingleRange, row, col]
|
|
3807
|
+
);
|
|
3808
|
+
const customContainer = {
|
|
3809
|
+
...container,
|
|
3810
|
+
overlayProps: {
|
|
3811
|
+
...container.overlayProps,
|
|
3812
|
+
onMouseDown: handleOverlayMouseDown
|
|
3813
|
+
}
|
|
3814
|
+
};
|
|
3815
|
+
const handlePopoverSave = () => {
|
|
3816
|
+
onChange(popoverValue, value);
|
|
3817
|
+
setLocalValue(popoverValue);
|
|
3818
|
+
setIsPopoverOpen(false);
|
|
3819
|
+
onBlur();
|
|
3820
|
+
onInputBlur();
|
|
3821
|
+
};
|
|
3822
|
+
const handlePopoverKeyDown = useCallback16((e) => {
|
|
3823
|
+
if (e.key !== "Escape") {
|
|
3824
|
+
e.stopPropagation();
|
|
3825
|
+
}
|
|
3826
|
+
}, []);
|
|
3827
|
+
const displayValue = localValue || "";
|
|
3828
|
+
const truncatedValue = displayValue.length > 50 ? `${displayValue.substring(0, 50)}...` : displayValue;
|
|
3829
|
+
return /* @__PURE__ */ jsxs8(
|
|
3830
|
+
RadixPopover.Root,
|
|
3831
|
+
{
|
|
3832
|
+
open: isPopoverOpen,
|
|
3833
|
+
onOpenChange: (open) => {
|
|
3834
|
+
if (!open) {
|
|
3835
|
+
handlePopoverSave();
|
|
3836
|
+
} else {
|
|
3837
|
+
setIsPopoverOpen(true);
|
|
3838
|
+
}
|
|
3839
|
+
},
|
|
3840
|
+
children: [
|
|
3841
|
+
/* @__PURE__ */ jsxs8(DataGridCellContainer, { ...customContainer, ...errorProps, children: [
|
|
3842
|
+
/* @__PURE__ */ jsx12(RadixPopover.Anchor, { asChild: true, children: /* @__PURE__ */ jsx12(
|
|
3843
|
+
"div",
|
|
3844
|
+
{
|
|
3845
|
+
className: clx8(
|
|
3846
|
+
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer items-center justify-center bg-transparent outline-none",
|
|
3847
|
+
"focus:cursor-text"
|
|
3848
|
+
),
|
|
3849
|
+
children: /* @__PURE__ */ jsx12("span", { className: "w-full truncate text-center", children: truncatedValue })
|
|
3850
|
+
}
|
|
3851
|
+
) }),
|
|
3852
|
+
/* @__PURE__ */ jsx12(
|
|
3853
|
+
"input",
|
|
3854
|
+
{
|
|
3855
|
+
className: "sr-only",
|
|
3856
|
+
autoComplete: "off",
|
|
3857
|
+
tabIndex: -1,
|
|
3858
|
+
value: localValue,
|
|
3859
|
+
onChange: (e) => setLocalValue(e.target.value),
|
|
3860
|
+
ref: combinedRefs,
|
|
3861
|
+
onBlur: () => {
|
|
3862
|
+
onBlur();
|
|
3863
|
+
onInputBlur();
|
|
3864
|
+
onChange(localValue, value);
|
|
3865
|
+
},
|
|
3866
|
+
...input,
|
|
3867
|
+
...rest
|
|
3868
|
+
}
|
|
3869
|
+
)
|
|
3870
|
+
] }),
|
|
3871
|
+
/* @__PURE__ */ jsx12(RadixPopover.Portal, { children: /* @__PURE__ */ jsx12(
|
|
3872
|
+
RadixPopover.Content,
|
|
3873
|
+
{
|
|
3874
|
+
className: clx8(
|
|
3875
|
+
"bg-ui-bg-base shadow-elevation-flyout flex max-h-[80vh] w-[600px] overflow-hidden p-0 outline-none"
|
|
3876
|
+
),
|
|
3877
|
+
align: "start",
|
|
3878
|
+
side: "bottom",
|
|
3879
|
+
sideOffset: -29,
|
|
3880
|
+
alignOffset: -16,
|
|
3881
|
+
collisionPadding: 24,
|
|
3882
|
+
onEscapeKeyDown: handlePopoverSave,
|
|
3883
|
+
onKeyDown: handlePopoverKeyDown,
|
|
3884
|
+
children: /* @__PURE__ */ jsx12("div", { ref: popoverContentRef, className: "h-full w-full", children: /* @__PURE__ */ jsx12(
|
|
3885
|
+
Textarea,
|
|
3886
|
+
{
|
|
3887
|
+
value: popoverValue,
|
|
3888
|
+
onChange: (e) => setPopoverValue(e.target.value),
|
|
3889
|
+
onKeyDown: (e) => {
|
|
3890
|
+
e.stopPropagation();
|
|
3891
|
+
},
|
|
3892
|
+
className: "!bg-ui-bg-base h-full min-h-[300px] w-full resize-none border-0 p-4 !shadow-none focus-visible:!shadow-none"
|
|
3893
|
+
}
|
|
3894
|
+
) })
|
|
3895
|
+
}
|
|
3896
|
+
) })
|
|
3897
|
+
]
|
|
3898
|
+
}
|
|
3899
|
+
);
|
|
3900
|
+
};
|
|
3901
|
+
|
|
3416
3902
|
// src/components/data-grid/data-grid.tsx
|
|
3417
|
-
import { jsx as
|
|
3903
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
3418
3904
|
var _DataGrid = ({
|
|
3419
3905
|
isLoading,
|
|
3906
|
+
// Lazy loading props - passed through to DataGridRoot
|
|
3907
|
+
totalRowCount,
|
|
3908
|
+
onFetchMore,
|
|
3909
|
+
isFetchingMore,
|
|
3910
|
+
hasNextPage,
|
|
3420
3911
|
...props
|
|
3421
3912
|
}) => {
|
|
3422
|
-
return isLoading ? /* @__PURE__ */
|
|
3913
|
+
return isLoading ? /* @__PURE__ */ jsx13(
|
|
3423
3914
|
DataGridSkeleton,
|
|
3424
3915
|
{
|
|
3425
3916
|
columns: props.columns,
|
|
3426
3917
|
rows: props.data?.length && props.data.length > 0 ? props.data.length : 10
|
|
3427
3918
|
}
|
|
3428
|
-
) : /* @__PURE__ */
|
|
3919
|
+
) : /* @__PURE__ */ jsx13(
|
|
3920
|
+
DataGridRoot,
|
|
3921
|
+
{
|
|
3922
|
+
...props,
|
|
3923
|
+
totalRowCount,
|
|
3924
|
+
onFetchMore,
|
|
3925
|
+
isFetchingMore,
|
|
3926
|
+
hasNextPage
|
|
3927
|
+
}
|
|
3928
|
+
);
|
|
3429
3929
|
};
|
|
3430
3930
|
var DataGrid = Object.assign(_DataGrid, {
|
|
3431
3931
|
BooleanCell: DataGridBooleanCell,
|
|
3432
3932
|
TextCell: DataGridTextCell,
|
|
3933
|
+
MultilineCell: DataGridMultilineCell,
|
|
3934
|
+
ExpandableTextCell: DataGridExpandableTextCell,
|
|
3433
3935
|
NumberCell: DataGridNumberCell,
|
|
3434
3936
|
CurrencyCell: DataGridCurrencyCell,
|
|
3435
3937
|
ReadonlyCell: DataGridReadonlyCell
|
|
@@ -3449,12 +3951,18 @@ function createDataGridHelper() {
|
|
|
3449
3951
|
cell,
|
|
3450
3952
|
disableHiding = false,
|
|
3451
3953
|
field,
|
|
3452
|
-
type
|
|
3954
|
+
type,
|
|
3955
|
+
size,
|
|
3956
|
+
minSize,
|
|
3957
|
+
maxSize
|
|
3453
3958
|
}) => columnHelper.display({
|
|
3454
3959
|
id,
|
|
3455
3960
|
header,
|
|
3456
3961
|
cell,
|
|
3457
3962
|
enableHiding: !disableHiding,
|
|
3963
|
+
size,
|
|
3964
|
+
minSize,
|
|
3965
|
+
maxSize,
|
|
3458
3966
|
meta: {
|
|
3459
3967
|
name,
|
|
3460
3968
|
field,
|
|
@@ -3468,23 +3976,23 @@ function createDataGridHelper() {
|
|
|
3468
3976
|
import { TaxExclusive, TaxInclusive } from "@medusajs/icons";
|
|
3469
3977
|
import { Tooltip as Tooltip3 } from "@medusajs/ui";
|
|
3470
3978
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
3471
|
-
import { jsx as
|
|
3979
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
3472
3980
|
var IncludesTaxTooltip = ({
|
|
3473
3981
|
includesTax
|
|
3474
3982
|
}) => {
|
|
3475
3983
|
const { t } = useTranslation4();
|
|
3476
|
-
return /* @__PURE__ */
|
|
3984
|
+
return /* @__PURE__ */ jsx14(
|
|
3477
3985
|
Tooltip3,
|
|
3478
3986
|
{
|
|
3479
3987
|
maxWidth: 999,
|
|
3480
3988
|
content: includesTax ? t("general.includesTaxTooltip") : t("general.excludesTaxTooltip"),
|
|
3481
|
-
children: includesTax ? /* @__PURE__ */
|
|
3989
|
+
children: includesTax ? /* @__PURE__ */ jsx14(TaxInclusive, { className: "text-ui-fg-muted shrink-0" }) : /* @__PURE__ */ jsx14(TaxExclusive, { className: "text-ui-fg-muted shrink-0" })
|
|
3482
3990
|
}
|
|
3483
3991
|
);
|
|
3484
3992
|
};
|
|
3485
3993
|
|
|
3486
3994
|
// src/components/data-grid/helpers/create-data-grid-price-columns.tsx
|
|
3487
|
-
import { jsx as
|
|
3995
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3488
3996
|
var createDataGridPriceColumns = ({
|
|
3489
3997
|
currencies: currencies2,
|
|
3490
3998
|
regions,
|
|
@@ -3515,15 +4023,15 @@ var createDataGridPriceColumns = ({
|
|
|
3515
4023
|
return getFieldName(context, currency);
|
|
3516
4024
|
},
|
|
3517
4025
|
type: "number",
|
|
3518
|
-
header: () => /* @__PURE__ */
|
|
3519
|
-
/* @__PURE__ */
|
|
3520
|
-
/* @__PURE__ */
|
|
4026
|
+
header: () => /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
4027
|
+
/* @__PURE__ */ jsx15("span", { className: "truncate", title: translatedCurrencyName, children: translatedCurrencyName }),
|
|
4028
|
+
/* @__PURE__ */ jsx15(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
|
|
3521
4029
|
] }),
|
|
3522
4030
|
cell: (context) => {
|
|
3523
4031
|
if (isReadyOnly?.(context)) {
|
|
3524
|
-
return /* @__PURE__ */
|
|
4032
|
+
return /* @__PURE__ */ jsx15(DataGridReadonlyCell, { context });
|
|
3525
4033
|
}
|
|
3526
|
-
return /* @__PURE__ */
|
|
4034
|
+
return /* @__PURE__ */ jsx15(DataGridCurrencyCell, { code: currency, context });
|
|
3527
4035
|
}
|
|
3528
4036
|
});
|
|
3529
4037
|
}) ?? [],
|
|
@@ -3547,19 +4055,19 @@ var createDataGridPriceColumns = ({
|
|
|
3547
4055
|
return getFieldName(context, region.id);
|
|
3548
4056
|
},
|
|
3549
4057
|
type: "number",
|
|
3550
|
-
header: () => /* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3552
|
-
/* @__PURE__ */
|
|
4058
|
+
header: () => /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
4059
|
+
/* @__PURE__ */ jsx15("span", { className: "truncate", title: translatedRegionName, children: translatedRegionName }),
|
|
4060
|
+
/* @__PURE__ */ jsx15(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
|
|
3553
4061
|
] }),
|
|
3554
4062
|
cell: (context) => {
|
|
3555
4063
|
if (isReadyOnly?.(context)) {
|
|
3556
|
-
return /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsx15(DataGridReadonlyCell, { context });
|
|
3557
4065
|
}
|
|
3558
4066
|
const currency = currencies2?.find((c) => c === region.currency_code);
|
|
3559
4067
|
if (!currency) {
|
|
3560
4068
|
return null;
|
|
3561
4069
|
}
|
|
3562
|
-
return /* @__PURE__ */
|
|
4070
|
+
return /* @__PURE__ */ jsx15(
|
|
3563
4071
|
DataGridCurrencyCell,
|
|
3564
4072
|
{
|
|
3565
4073
|
code: region.currency_code,
|