@mercurjs/vendor 2.1.2 → 2.2.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{[id]-PDGHF5J2.js → [id]-2DQX3YWJ.js} +35 -31
- package/dist/{[id]-TO6KT3ZE.js → [id]-4OBGG7OH.js} +23 -21
- package/dist/{[id]-X4DDKOMQ.js → [id]-4PKMKNJH.js} +26 -22
- package/dist/[id]-4STHLE4N.js +1442 -0
- package/dist/{[id]-4VCL3MMM.js → [id]-5UFO4RKF.js} +26 -22
- package/dist/{[id]-H3C3ZSC6.js → [id]-6MXCVV5J.js} +25 -21
- package/dist/{[id]-6PXEWRG7.js → [id]-7BAKUHUO.js} +13 -13
- package/dist/{[id]-7RUAH3TI.js → [id]-K2CT7BXQ.js} +4 -4
- package/dist/{[id]-3G5G7ZFV.js → [id]-KJIQTFGE.js} +22 -20
- package/dist/{[id]-INOFZHL7.js → [id]-LTNOHLGE.js} +16 -16
- package/dist/{[id]-B3LHVQM5.js → [id]-PGIT5WJC.js} +25 -21
- package/dist/{[id]-T2ROPEGY.js → [id]-Y2ISCLUD.js} +7 -7
- package/dist/{[id]-Y7GAMNC5.js → [id]-ZCMSBEVM.js} +4 -4
- package/dist/{[id]-UTKO3VG4.js → [id]-ZWWMJAKI.js} +9 -9
- package/dist/{[location_id]-D55RQOXT.js → [location_id]-NUBXDDJC.js} +9 -9
- package/dist/{[province_id]-OFH2ZOFQ.js → [province_id]-H2QAPKVH.js} +20 -18
- package/dist/{add-C6OX5C54.js → add-GZJ7OMV3.js} +34 -30
- package/dist/add-KQAABWCR.js +392 -0
- package/dist/{add-customer-groups-PJRJUWS2.js → add-customer-groups-RAHCP67U.js} +16 -14
- package/dist/{add-products-INOLNPO6.js → add-products-TSVQHC67.js} +23 -19
- package/dist/{add-promotions-AHDOP52Q.js → add-promotions-CSCAJZHV.js} +7 -7
- package/dist/{add-to-campaign-HL6NGRR4.js → add-to-campaign-DLP7PSQB.js} +4 -4
- package/dist/{address-KRENKSLP.js → address-7F5SN7PV.js} +17 -15
- package/dist/{adjust-inventory-H4EUP7J3.js → adjust-inventory-SZF4W7LR.js} +2 -2
- package/dist/{allocate-items-SUCUZU4D.js → allocate-items-SDFS5GYN.js} +6 -6
- package/dist/{areas-UUMZDXLX.js → areas-7Y6BVS5A.js} +8 -8
- package/dist/{attributes-CALEHJJG.js → attributes-MBZ76HVZ.js} +3 -3
- package/dist/{breadcrumb-BS7Y5OKF.js → breadcrumb-65SAGUUL.js} +2 -2
- package/dist/{breadcrumb-6W2VP3OZ.js → breadcrumb-7PURSRTT.js} +13 -11
- package/dist/{breadcrumb-M5Z5WA6I.js → breadcrumb-EDPMEN2P.js} +2 -2
- package/dist/breadcrumb-FLDHJRVY.js +26 -0
- package/dist/{breadcrumb-VNNZ3TTW.js → breadcrumb-HND5FFWC.js} +2 -2
- package/dist/{breadcrumb-OIGGCB3L.js → breadcrumb-QV2IAX7N.js} +8 -2
- package/dist/{breadcrumb-KQSFIXQ4.js → breadcrumb-VWELWDB2.js} +1 -1
- package/dist/{breadcrumb-IG7VZGW2.js → breadcrumb-WRG4SITG.js} +13 -11
- package/dist/{breadcrumb-TW5JEOYS.js → breadcrumb-ZCG2RHIU.js} +12 -10
- package/dist/{campaigns-HS6MIO7X.js → campaigns-L6ULR6KR.js} +5 -5
- package/dist/{categories-PKWR3FM3.js → categories-FUZQKBXV.js} +6 -6
- package/dist/{chunk-PDQSPKG5.js → chunk-2DXNJURE.js} +1 -1
- package/dist/{chunk-ZZO3INVE.js → chunk-2MDGYHWN.js} +128 -25
- package/dist/{chunk-5UD4P6YL.js → chunk-2USXZSTK.js} +4 -4
- package/dist/{chunk-6SBMVLJ2.js → chunk-36L54SQQ.js} +1 -1
- package/dist/chunk-37G4Y5I7.js +101 -0
- package/dist/{chunk-5M3SL4UZ.js → chunk-3CVJA5UE.js} +9 -104
- package/dist/chunk-432S4FGR.js +0 -0
- package/dist/{chunk-KQGVSLUI.js → chunk-44RQ5PTN.js} +1803 -914
- package/dist/{chunk-Y2QI7KWS.js → chunk-4LVP635F.js} +408 -664
- package/dist/{chunk-UL4O5M4S.js → chunk-4S6XGIC6.js} +1 -18
- package/dist/chunk-5ZVWOCAC.js +426 -0
- package/dist/{chunk-WITQNQXN.js → chunk-6BS2AVGJ.js} +3 -3
- package/dist/{chunk-ZYOXKUKZ.js → chunk-7LBY5JLV.js} +1 -1
- package/dist/chunk-7SLWXX6L.js +811 -0
- package/dist/{chunk-LQYMBSRQ.js → chunk-AIZM66CG.js} +1 -1
- package/dist/{chunk-IZ5RG5XI.js → chunk-AJLGY3LQ.js} +1 -21
- package/dist/{chunk-WFE6CT6M.js → chunk-AVOIZO63.js} +21 -77
- package/dist/chunk-C2FG3SX2.js +68 -0
- package/dist/chunk-CFRWIQIZ.js +43 -0
- package/dist/{chunk-WNVEMFIK.js → chunk-CNMY5HVP.js} +2 -2
- package/dist/{chunk-BLVJAKBA.js → chunk-DDH7ULIQ.js} +1 -1
- package/dist/chunk-DIW4GRTI.js +503 -0
- package/dist/{chunk-JQP7MOFH.js → chunk-DVEKYLPV.js} +1 -1
- package/dist/{chunk-QX45GVAL.js → chunk-EIUYXS7E.js} +8 -8
- package/dist/{chunk-N7OVXN72.js → chunk-EROX26D4.js} +1 -1
- package/dist/{chunk-2RHAI7WK.js → chunk-EZ3JOAUS.js} +1 -1
- package/dist/{chunk-HFRHHT36.js → chunk-FDR22JMM.js} +63 -8
- package/dist/{chunk-PEKANQ3T.js → chunk-FJUUGFXL.js} +2 -2
- package/dist/{chunk-3CK6OINO.js → chunk-GDWBOQI5.js} +3 -5
- package/dist/{chunk-47SXTGLN.js → chunk-GXIAIITP.js} +63 -200
- package/dist/{chunk-4MFMCZEJ.js → chunk-H6LZ77GX.js} +2 -2
- package/dist/chunk-IWLDKGYQ.js +95 -0
- package/dist/chunk-K4X324QP.js +18 -0
- package/dist/{chunk-VQ5EKDA3.js → chunk-KD7RYE6R.js} +1 -1
- package/dist/chunk-LEWA4BPH.js +18 -0
- package/dist/{chunk-7Q5SDEK7.js → chunk-LNM2D2I4.js} +4 -4
- package/dist/{chunk-LPOAVK6Y.js → chunk-LQD232FW.js} +47 -12
- package/dist/{chunk-OXXL4WQU.js → chunk-M7KSRYRI.js} +5 -5
- package/dist/chunk-MBFHMJHN.js +2063 -0
- package/dist/{chunk-I2IKYOZX.js → chunk-N4MVIBFM.js} +19 -19
- package/dist/{chunk-PCMNEUMV.js → chunk-NHFEY3EI.js} +1 -1
- package/dist/{chunk-RTAWYMQP.js → chunk-NJMNYS7G.js} +1 -1
- package/dist/{chunk-HGQTL7NX.js → chunk-NSZQERLE.js} +2 -2
- package/dist/{chunk-RL7SFZOF.js → chunk-NXNJQZCP.js} +1 -1
- package/dist/{chunk-CNLP35S7.js → chunk-OD3U3TX4.js} +16 -31
- package/dist/{chunk-D2MA5TAP.js → chunk-PBD36EZJ.js} +2 -2
- package/dist/{chunk-4ZGFODSC.js → chunk-PZ44R4AS.js} +1 -1
- package/dist/{chunk-ZEVYT6IX.js → chunk-QNNJN4H6.js} +116 -286
- package/dist/{chunk-WBI7FEGI.js → chunk-QS6RWIBL.js} +1 -1
- package/dist/chunk-QT7YFHCA.js +198 -0
- package/dist/{chunk-GYV6SKY7.js → chunk-QXLRABYH.js} +4 -6
- package/dist/chunk-RXZFEFNV.js +73 -0
- package/dist/{chunk-RUE5BPC2.js → chunk-RZLN2Q6G.js} +1 -1
- package/dist/{chunk-NYDJTWRL.js → chunk-SGR4DMCW.js} +4 -4
- package/dist/chunk-T6LHVNWO.js +27 -0
- package/dist/{chunk-DKQ4XMSN.js → chunk-TNVYTMBL.js} +6 -6
- package/dist/{chunk-32RYSB2V.js → chunk-TODJFRLH.js} +2 -2
- package/dist/{chunk-P3ZTO6T2.js → chunk-UAF2S447.js} +1 -1
- package/dist/{chunk-J6BRLL3F.js → chunk-UCQKXXLD.js} +2 -2
- package/dist/chunk-UORPTGV2.js +114 -0
- package/dist/{chunk-CYTNBXWF.js → chunk-UX7J5NZG.js} +9 -9
- package/dist/{chunk-X4FLOQ45.js → chunk-WBHFU3MG.js} +2 -2
- package/dist/chunk-WLT7K7K7.js +63 -0
- package/dist/{chunk-4URLUCTD.js → chunk-WUPJADSO.js} +2 -2
- package/dist/{chunk-ITI54CII.js → chunk-X4INVIWL.js} +5 -5
- package/dist/{chunk-PTW7JNAP.js → chunk-XFQJU6FA.js} +4 -4
- package/dist/{collections-DJZI2RM2.js → collections-3OPR3DSD.js} +22 -19
- package/dist/{configuration-RHPIO2QT.js → configuration-C4IGBNXH.js} +1 -1
- package/dist/{configuration-GN3TO77H.js → configuration-UOSNP45I.js} +3 -3
- package/dist/{create-3EK5CNNX.js → create-2MQFQHTE.js} +33 -29
- package/dist/{create-YO55Z3YD.js → create-2PCLG7TV.js} +32 -38
- package/dist/{create-G4T2PAJH.js → create-35MYQPVM.js} +23 -21
- package/dist/{create-HKJVSFB7.js → create-BJ4OO6LS.js} +23 -21
- package/dist/create-DDPIXCXT.js +210 -0
- package/dist/{create-7S7CZWEN.js → create-GB3ZA4LH.js} +4 -4
- package/dist/create-JDGM5KXE.js +193 -0
- package/dist/{create-IDVCZHIX.js → create-ORXYT74H.js} +14 -12
- package/dist/{create-GHM7OTCR.js → create-R7K3ECN6.js} +1 -1
- package/dist/{create-D6EW3EWC.js → create-SFU3W3ZH.js} +1 -1
- package/dist/{create-3ZVXEPX5.js → create-SQ3FYMGI.js} +25 -21
- package/dist/{create-33TRLASX.js → create-UPYB65PD.js} +1 -1
- package/dist/{create-OCFPLNNY.js → create-UQNYMVBM.js} +6 -6
- package/dist/{create-OGLPDVOI.js → create-XAD5NMSJ.js} +37 -35
- package/dist/{create-KGYL7FBM.js → create-XVHOCZHJ.js} +1 -1
- package/dist/{create-4AE3VTWN.js → create-YBF4YGWG.js} +2 -2
- package/dist/{customers-6ZLE65UX.js → customers-ETXVNM3G.js} +5 -5
- package/dist/{edit-QBISX7D3.js → edit-2Q7TRUTL.js} +14 -12
- package/dist/{edit-B5B3XKDM.js → edit-522DG3BY.js} +1 -1
- package/dist/{edit-ATXE6CM5.js → edit-C4OCKQVU.js} +1 -1
- package/dist/{edit-IR6V2IDN.js → edit-FKXIQ6ZI.js} +19 -17
- package/dist/{edit-4HZHLYI3.js → edit-GQNIINRR.js} +1 -1
- package/dist/{edit-LRRJTHV2.js → edit-KAKVPHZZ.js} +1 -1
- package/dist/{edit-ZSOI56BQ.js → edit-L5ZZLMAY.js} +22 -22
- package/dist/{edit-FNDDSSMT.js → edit-NYD45J2Q.js} +37 -8
- package/dist/{edit-GIJXLMC3.js → edit-O4JLGKQR.js} +2 -2
- package/dist/{edit-5CJZRHAA.js → edit-ORXS3A2Y.js} +1 -1
- package/dist/{edit-FC64DWB2.js → edit-Q3UQIOLS.js} +1 -1
- package/dist/{edit-7HTH2UJF.js → edit-REDDBLTA.js} +3 -3
- package/dist/{edit-2KRJIPRK.js → edit-SGUY2CCK.js} +19 -17
- package/dist/{edit-B75KK5ZX.js → edit-SWRWWFW6.js} +35 -31
- package/dist/{edit-7GVP6SRA.js → edit-ZAHCMF5U.js} +1 -1
- package/dist/{edit-RNT555GP.js → edit-ZCXUG42Q.js} +13 -11
- package/dist/{edit-MYSWY6W4.js → edit-ZMERG3L7.js} +1 -1
- package/dist/{edit-budget-J27CSEZH.js → edit-budget-L3CCEWNF.js} +1 -1
- package/dist/{edit-inventory-item-US77M2FF.js → edit-inventory-item-6B7ITDGD.js} +2 -2
- package/dist/{edit-inventory-item-attributes-UGAE2NAZ.js → edit-inventory-item-attributes-Y7MQZLXI.js} +3 -3
- package/dist/{fulfillment-DCS67LTK.js → fulfillment-75Z4H23W.js} +16 -14
- package/dist/{fulfillment-providers-GM5PO6N3.js → fulfillment-providers-KCQWL62T.js} +20 -17
- package/dist/index.css +27 -62
- package/dist/index.d.ts +3 -10
- package/dist/index.js +522 -458
- package/dist/{inventory-OPZ2FSEE.js → inventory-KAUVPMPZ.js} +6 -6
- package/dist/{invite-764K3TJS.js → invite-6CPYVHDX.js} +24 -21
- package/dist/{invite-KEJLNXEZ.js → invite-CI2P4GF6.js} +15 -12
- package/dist/loader-FBB5OQRT.js +31 -0
- package/dist/{locations-ZVPTQCQY.js → locations-INS6FTMJ.js} +4 -4
- package/dist/{login-OUHRNNXA.js → login-KY342RMK.js} +12 -10
- package/dist/{manage-locations-YUKEFCBJ.js → manage-locations-WNHEBS3A.js} +2 -2
- package/dist/{media-4KYFHB5V.js → media-KOYAOXG6.js} +41 -9
- package/dist/{metadata-NYYL26MQ.js → metadata-2CMH4I6U.js} +16 -14
- package/dist/{metadata-AWUKZ25V.js → metadata-5BPOBBU2.js} +3 -3
- package/dist/{metadata-OCE6A3JE.js → metadata-GWI6R4ES.js} +15 -13
- package/dist/{metadata-G7KZXVNE.js → metadata-NUXUC2JA.js} +15 -13
- package/dist/{metadata-XP3ZYW2M.js → metadata-TLDUF5KV.js} +17 -15
- package/dist/{metadata-PYY4IB7K.js → metadata-WR4RFXO5.js} +16 -14
- package/dist/offer-create-page-YKMHHTU5.js +743 -0
- package/dist/offer-detail-page-6MAHNNIO.js +488 -0
- package/dist/offer-edit-page-DYQFU6JU.js +151 -0
- package/dist/offer-inventory-batch-page-WKCWNDNK.js +290 -0
- package/dist/offer-pricing-edit-page-4TYGGSOE.js +195 -0
- package/dist/offers-UGQJNGTD.js +32 -0
- package/dist/{onboarding-WXZHW62K.js → onboarding-43LQQQGQ.js} +22 -20
- package/dist/{orders-LWJ472VM.js → orders-R2LOJ6N5.js} +24 -21
- package/dist/organization-XGFU4YDG.js +375 -0
- package/dist/{organize-RFOMQCBG.js → organize-HNJUHEEG.js} +4 -4
- package/dist/{organize-OVKJ3HZO.js → organize-K6QMAMEN.js} +4 -4
- package/dist/pages/index.d.ts +415 -758
- package/dist/pages/index.js +81 -77
- package/dist/{payment-details-UVXYCTUK.js → payment-details-64US5XWD.js} +17 -15
- package/dist/{payouts-TR7K5I37.js → payouts-UXJDTXDL.js} +6 -6
- package/dist/{price-lists-S2WNELFZ.js → price-lists-KBPUVSZI.js} +8 -8
- package/dist/{pricing-UF27DAXA.js → pricing-DF6C5XK4.js} +35 -32
- package/dist/{product-tags-2CKH2M6D.js → product-tags-CL7HSEDI.js} +32 -28
- package/dist/{product-types-FX43JEO2.js → product-types-UUHBV4IZ.js} +5 -5
- package/dist/product-variant-detail-RVWEYVPC.js +220 -0
- package/dist/{product-variant-edit-P3DSIFE3.js → product-variant-edit-MNCS7ZYW.js} +126 -66
- package/dist/{products-H5EMRJYS.js → products-4KV5Y2JY.js} +23 -19
- package/dist/{products-2LHGS7X3.js → products-SXYTQFJ3.js} +40 -43
- package/dist/{professional-details-HYKTH44B.js → professional-details-5T2VS6MM.js} +16 -14
- package/dist/{profile-PB27WIRW.js → profile-6XGHAT7H.js} +20 -18
- package/dist/{promotions-5EYPGHJP.js → promotions-O7U4BTK6.js} +8 -8
- package/dist/{register-4O4F6YZK.js → register-GDKN3SKM.js} +16 -14
- package/dist/{reset-password-GTWLBOFK.js → reset-password-EICPAY2N.js} +1 -1
- package/dist/{return-reasons-LOKYRGMI.js → return-reasons-M6IR77XW.js} +16 -14
- package/dist/{sales-channels-7R2IY3KG.js → sales-channels-B6FULRWI.js} +8 -7
- package/dist/{sales-channels-Y4LRP7JC.js → sales-channels-JW3QUYR7.js} +8 -7
- package/dist/{settings-2XDLFYMS.js → settings-SAAHTUZZ.js} +39 -35
- package/dist/{shipment-4GW2JFWB.js → shipment-Q33QBMXX.js} +13 -11
- package/dist/{shipping-profile-R3NABPQF.js → shipping-profile-Y4SNEPZX.js} +2 -2
- package/dist/{shipping-profiles-QVKNFLCW.js → shipping-profiles-2NWKCEJK.js} +18 -16
- package/dist/{stock-5RXNUPUT.js → stock-7CSVEJJU.js} +19 -17
- package/dist/{store-DE2RGX7T.js → store-GHFWU7EV.js} +28 -25
- package/dist/{store-closure-DNMCHUXD.js → store-closure-P5PD2RSV.js} +16 -14
- package/dist/{store-select-GZEJHRZ7.js → store-select-KDT6USQA.js} +17 -15
- package/dist/{tax-regions-UD6P5FVC.js → tax-regions-YXZW7UVX.js} +5 -5
- package/dist/{team-JXKAVRPU.js → team-EDJ62747.js} +25 -23
- package/dist/types-CtCEtTE6.d.ts +16 -0
- package/package.json +3 -3
- package/dist/[id]-BYP37PU4.js +0 -1314
- package/dist/add-KRAGFFBJ.js +0 -158
- package/dist/bulk-edit-3SMBLIOA.js +0 -244
- package/dist/chunk-4KX6CBJ4.js +0 -178
- package/dist/chunk-DLNNTQRY.js +0 -217
- package/dist/chunk-FX4V5JCF.js +0 -37
- package/dist/chunk-GC33DBKG.js +0 -143
- package/dist/chunk-NK4NR6MN.js +0 -173
- package/dist/chunk-PFU6FSXY.js +0 -430
- package/dist/chunk-QJEOPT2P.js +0 -330
- package/dist/chunk-QSGR43JM.js +0 -30
- package/dist/chunk-STR3NGWE.js +0 -3736
- package/dist/create-3DOO3RNH.js +0 -716
- package/dist/create-I7HV3RM6.js +0 -150
- package/dist/edit-K2AD335I.js +0 -237
- package/dist/edit-VO5XLIEL.js +0 -362
- package/dist/edit-stocks-and-prices-MHHQFWFA.js +0 -408
- package/dist/organization-LPYQRTQC.js +0 -303
- package/dist/prices-3OXV5RGY.js +0 -270
- package/dist/product-variant-detail-WV4KXVXR.js +0 -590
- package/dist/stock-GPC3BCL6.js +0 -500
- package/dist/{chunk-SDSEW72R.js → chunk-E2HQPY32.js} +3 -3
- package/dist/{chunk-6WY5X4PE.js → chunk-L7QKFC5N.js} +7 -7
- /package/dist/{chunk-CAS74NLJ.js → chunk-YV6MK4PZ.js} +0 -0
|
@@ -2,73 +2,18 @@ import {
|
|
|
2
2
|
currencies
|
|
3
3
|
} from "./chunk-IQPN4PZJ.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
Skeleton
|
|
6
|
+
} from "./chunk-INNFZYX2.js";
|
|
7
7
|
import {
|
|
8
8
|
ConditionalTooltip
|
|
9
9
|
} from "./chunk-LAVHRER2.js";
|
|
10
10
|
import {
|
|
11
11
|
useDocumentDirection
|
|
12
12
|
} from "./chunk-Y7QKP6QU.js";
|
|
13
|
-
import {
|
|
14
|
-
Skeleton
|
|
15
|
-
} from "./chunk-INNFZYX2.js";
|
|
16
13
|
import {
|
|
17
14
|
__publicField
|
|
18
15
|
} from "./chunk-NBMM2TZK.js";
|
|
19
16
|
|
|
20
|
-
// src/components/data-grid/components/data-grid-skeleton.tsx
|
|
21
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
var DataGridSkeleton = ({
|
|
23
|
-
columns,
|
|
24
|
-
rows: rowCount = 10
|
|
25
|
-
}) => {
|
|
26
|
-
const rows = Array.from({ length: rowCount }, (_, i) => i);
|
|
27
|
-
const colCount = columns.length;
|
|
28
|
-
return /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle size-full", children: [
|
|
29
|
-
/* @__PURE__ */ jsx("div", { className: "bg-ui-bg-base border-b p-4", children: /* @__PURE__ */ jsx("div", { className: "bg-ui-button-neutral h-7 w-[116px] animate-pulse rounded-md" }) }),
|
|
30
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle size-full overflow-auto", children: [
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
className: "grid",
|
|
35
|
-
style: {
|
|
36
|
-
gridTemplateColumns: `repeat(${colCount}, 1fr)`
|
|
37
|
-
},
|
|
38
|
-
children: columns.map((_col, i) => {
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
"div",
|
|
41
|
-
{
|
|
42
|
-
className: "bg-ui-bg-base flex h-10 w-[200px] items-center border-b border-r px-4 py-2.5 last:border-r-0",
|
|
43
|
-
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[14px] w-[164px]" })
|
|
44
|
-
},
|
|
45
|
-
i
|
|
46
|
-
);
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ jsx("div", { children: rows.map((_, j) => /* @__PURE__ */ jsx(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: "grid",
|
|
54
|
-
style: { gridTemplateColumns: `repeat(${colCount}, 1fr)` },
|
|
55
|
-
children: columns.map((_col, k) => {
|
|
56
|
-
return /* @__PURE__ */ jsx(
|
|
57
|
-
"div",
|
|
58
|
-
{
|
|
59
|
-
className: "bg-ui-bg-base flex h-10 w-[200px] items-center border-b border-r px-4 py-2.5 last:border-r-0",
|
|
60
|
-
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[14px] w-[164px]" })
|
|
61
|
-
},
|
|
62
|
-
k
|
|
63
|
-
);
|
|
64
|
-
})
|
|
65
|
-
},
|
|
66
|
-
j
|
|
67
|
-
)) })
|
|
68
|
-
] })
|
|
69
|
-
] });
|
|
70
|
-
};
|
|
71
|
-
|
|
72
17
|
// src/components/data-grid/components/data-grid-boolean-cell.tsx
|
|
73
18
|
import { Checkbox } from "@medusajs/ui";
|
|
74
19
|
import { Controller } from "react-hook-form";
|
|
@@ -274,7 +219,7 @@ var useDataGridCell = ({
|
|
|
274
219
|
return anchor ? isCellMatch(coords, anchor) : false;
|
|
275
220
|
}, [anchor, coords]);
|
|
276
221
|
const fieldWithoutOverlay = useMemo(() => {
|
|
277
|
-
return type === "boolean";
|
|
222
|
+
return type === "boolean" || type === "select";
|
|
278
223
|
}, [type]);
|
|
279
224
|
useEffect(() => {
|
|
280
225
|
if (isAnchor && !containerRef.current?.contains(document.activeElement)) {
|
|
@@ -1082,15 +1027,6 @@ function getColumnName(column) {
|
|
|
1082
1027
|
|
|
1083
1028
|
// src/components/data-grid/hooks/use-data-grid-duplicate-cell.tsx
|
|
1084
1029
|
import { useWatch } from "react-hook-form";
|
|
1085
|
-
var useDataGridDuplicateCell = ({
|
|
1086
|
-
duplicateOf
|
|
1087
|
-
}) => {
|
|
1088
|
-
const { control } = useDataGridContext();
|
|
1089
|
-
const watchedValue = useWatch({ control, name: duplicateOf });
|
|
1090
|
-
return {
|
|
1091
|
-
watchedValue
|
|
1092
|
-
};
|
|
1093
|
-
};
|
|
1094
1030
|
|
|
1095
1031
|
// src/components/data-grid/hooks/use-data-grid-error-highlighting.tsx
|
|
1096
1032
|
import { useCallback as useCallback7, useMemo as useMemo3, useState as useState3 } from "react";
|
|
@@ -1331,6 +1267,7 @@ function convertArrayToPrimitive(values, type) {
|
|
|
1331
1267
|
return values.map(convertToBoolean);
|
|
1332
1268
|
case "text":
|
|
1333
1269
|
case "multiline-text":
|
|
1270
|
+
case "select":
|
|
1334
1271
|
return values.map(covertToString);
|
|
1335
1272
|
default:
|
|
1336
1273
|
throw new Error(`Unsupported target type "${type}".`);
|
|
@@ -2024,7 +1961,7 @@ import { get as get2 } from "react-hook-form";
|
|
|
2024
1961
|
// src/components/data-grid/components/data-grid-row-error-indicator.tsx
|
|
2025
1962
|
import { Badge, Tooltip } from "@medusajs/ui";
|
|
2026
1963
|
import { useTranslation } from "react-i18next";
|
|
2027
|
-
import { jsx
|
|
1964
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2028
1965
|
var DataGridRowErrorIndicator = ({
|
|
2029
1966
|
rowErrors
|
|
2030
1967
|
}) => {
|
|
@@ -2032,12 +1969,12 @@ var DataGridRowErrorIndicator = ({
|
|
|
2032
1969
|
if (!rowErrors || rowErrorCount <= 0) {
|
|
2033
1970
|
return null;
|
|
2034
1971
|
}
|
|
2035
|
-
return /* @__PURE__ */
|
|
1972
|
+
return /* @__PURE__ */ jsx(
|
|
2036
1973
|
Tooltip,
|
|
2037
1974
|
{
|
|
2038
|
-
content: /* @__PURE__ */
|
|
1975
|
+
content: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-y-3", children: rowErrors.map((error, index) => /* @__PURE__ */ jsx(DataGridRowErrorLine, { error }, index)) }),
|
|
2039
1976
|
delayDuration: 0,
|
|
2040
|
-
children: /* @__PURE__ */
|
|
1977
|
+
children: /* @__PURE__ */ jsx(Badge, { color: "red", size: "2xsmall", className: "cursor-default", children: rowErrorCount })
|
|
2041
1978
|
}
|
|
2042
1979
|
);
|
|
2043
1980
|
};
|
|
@@ -2045,9 +1982,9 @@ var DataGridRowErrorLine = ({
|
|
|
2045
1982
|
error
|
|
2046
1983
|
}) => {
|
|
2047
1984
|
const { t } = useTranslation();
|
|
2048
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ jsxs("li", { className: "txt-compact-small flex flex-col items-start", children: [
|
|
2049
1986
|
error.message,
|
|
2050
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ jsx(
|
|
2051
1988
|
"button",
|
|
2052
1989
|
{
|
|
2053
1990
|
type: "button",
|
|
@@ -2060,7 +1997,7 @@ var DataGridRowErrorLine = ({
|
|
|
2060
1997
|
};
|
|
2061
1998
|
|
|
2062
1999
|
// src/components/data-grid/components/data-grid-cell-container.tsx
|
|
2063
|
-
import { jsx as
|
|
2000
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2064
2001
|
var DataGridCellContainer = ({
|
|
2065
2002
|
isAnchor,
|
|
2066
2003
|
isSelected,
|
|
@@ -2078,8 +2015,8 @@ var DataGridCellContainer = ({
|
|
|
2078
2015
|
}) => {
|
|
2079
2016
|
const error = get2(errors, field);
|
|
2080
2017
|
const hasError = !!error;
|
|
2081
|
-
return /* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ jsxs2("div", { className: clx("group/container relative h-full w-full"), children: [
|
|
2019
|
+
/* @__PURE__ */ jsxs2(
|
|
2083
2020
|
"div",
|
|
2084
2021
|
{
|
|
2085
2022
|
className: clx(
|
|
@@ -2096,28 +2033,28 @@ var DataGridCellContainer = ({
|
|
|
2096
2033
|
tabIndex: -1,
|
|
2097
2034
|
...innerProps,
|
|
2098
2035
|
children: [
|
|
2099
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ jsx2(
|
|
2100
2037
|
ErrorMessage,
|
|
2101
2038
|
{
|
|
2102
2039
|
name: field,
|
|
2103
2040
|
errors,
|
|
2104
2041
|
render: ({ message }) => {
|
|
2105
|
-
return /* @__PURE__ */
|
|
2042
|
+
return /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx2(Tooltip2, { content: message, delayDuration: 0, children: /* @__PURE__ */ jsx2(ExclamationCircle, { className: "text-ui-tag-red-icon z-[3]" }) }) });
|
|
2106
2043
|
}
|
|
2107
2044
|
}
|
|
2108
2045
|
),
|
|
2109
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx2(
|
|
2110
2047
|
"div",
|
|
2111
2048
|
{
|
|
2112
2049
|
className: clx("relative z-[1] flex h-full w-full", {
|
|
2113
2050
|
"items-center justify-center": !isMultiLine,
|
|
2114
2051
|
"items-start": isMultiLine
|
|
2115
2052
|
}),
|
|
2116
|
-
children: /* @__PURE__ */
|
|
2053
|
+
children: /* @__PURE__ */ jsx2(RenderChildren, { isAnchor, placeholder, children })
|
|
2117
2054
|
}
|
|
2118
2055
|
),
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
showOverlay && /* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ jsx2(DataGridRowErrorIndicator, { rowErrors }),
|
|
2057
|
+
showOverlay && /* @__PURE__ */ jsx2(
|
|
2121
2058
|
"div",
|
|
2122
2059
|
{
|
|
2123
2060
|
...overlayProps,
|
|
@@ -2143,7 +2080,7 @@ var RenderChildren = ({
|
|
|
2143
2080
|
};
|
|
2144
2081
|
|
|
2145
2082
|
// src/components/data-grid/components/data-grid-boolean-cell.tsx
|
|
2146
|
-
import { jsx as
|
|
2083
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2147
2084
|
var DataGridBooleanCell = ({
|
|
2148
2085
|
context,
|
|
2149
2086
|
disabled
|
|
@@ -2153,13 +2090,13 @@ var DataGridBooleanCell = ({
|
|
|
2153
2090
|
});
|
|
2154
2091
|
const errorProps = useDataGridCellError({ context });
|
|
2155
2092
|
const { container, input } = renderProps;
|
|
2156
|
-
return /* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ jsx3(
|
|
2157
2094
|
Controller,
|
|
2158
2095
|
{
|
|
2159
2096
|
control,
|
|
2160
2097
|
name: field,
|
|
2161
2098
|
render: ({ field: field2 }) => {
|
|
2162
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ jsx3(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx3(Inner, { field: field2, inputProps: input, disabled }) });
|
|
2163
2100
|
}
|
|
2164
2101
|
}
|
|
2165
2102
|
);
|
|
@@ -2178,7 +2115,7 @@ var Inner = ({
|
|
|
2178
2115
|
...attributes
|
|
2179
2116
|
} = inputProps;
|
|
2180
2117
|
const combinedRefs = useCombinedRefs(ref, inputRef);
|
|
2181
|
-
return /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ jsx3(
|
|
2182
2119
|
Checkbox,
|
|
2183
2120
|
{
|
|
2184
2121
|
disabled: disabled || fieldDisabled,
|
|
@@ -2200,322 +2137,19 @@ var Inner = ({
|
|
|
2200
2137
|
// src/components/data-grid/components/data-grid-boolean-with-text-cell.tsx
|
|
2201
2138
|
import { Switch } from "@medusajs/ui";
|
|
2202
2139
|
import { Controller as Controller2 } from "react-hook-form";
|
|
2203
|
-
import { jsx as
|
|
2204
|
-
var DataGridBooleanWithTextCell = ({
|
|
2205
|
-
context,
|
|
2206
|
-
trueLabel = "True",
|
|
2207
|
-
falseLabel = "False"
|
|
2208
|
-
}) => {
|
|
2209
|
-
const { field, control, renderProps } = useDataGridCell({
|
|
2210
|
-
context
|
|
2211
|
-
});
|
|
2212
|
-
const errorProps = useDataGridCellError({ context });
|
|
2213
|
-
const { container, input } = renderProps;
|
|
2214
|
-
return /* @__PURE__ */ jsx5(
|
|
2215
|
-
Controller2,
|
|
2216
|
-
{
|
|
2217
|
-
control,
|
|
2218
|
-
name: field,
|
|
2219
|
-
render: ({ field: field2 }) => {
|
|
2220
|
-
return /* @__PURE__ */ jsx5(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx5(
|
|
2221
|
-
Inner2,
|
|
2222
|
-
{
|
|
2223
|
-
field: field2,
|
|
2224
|
-
inputProps: input,
|
|
2225
|
-
trueLabel,
|
|
2226
|
-
falseLabel
|
|
2227
|
-
}
|
|
2228
|
-
) });
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
);
|
|
2232
|
-
};
|
|
2233
|
-
var Inner2 = ({
|
|
2234
|
-
field,
|
|
2235
|
-
inputProps,
|
|
2236
|
-
trueLabel,
|
|
2237
|
-
falseLabel
|
|
2238
|
-
}) => {
|
|
2239
|
-
const { ref, value, onBlur } = field;
|
|
2240
|
-
const {
|
|
2241
|
-
ref: inputRef,
|
|
2242
|
-
onBlur: onInputBlur,
|
|
2243
|
-
onChange,
|
|
2244
|
-
onFocus,
|
|
2245
|
-
...attributes
|
|
2246
|
-
} = inputProps;
|
|
2247
|
-
const combinedRefs = useCombinedRefs(ref, inputRef);
|
|
2248
|
-
return /* @__PURE__ */ jsxs4("div", { className: "flex size-full items-center justify-between py-2.5", children: [
|
|
2249
|
-
/* @__PURE__ */ jsx5(
|
|
2250
|
-
Switch,
|
|
2251
|
-
{
|
|
2252
|
-
ref: combinedRefs,
|
|
2253
|
-
size: "small",
|
|
2254
|
-
checked: value,
|
|
2255
|
-
onCheckedChange: (newValue) => {
|
|
2256
|
-
onChange(newValue === true, value);
|
|
2257
|
-
},
|
|
2258
|
-
onFocus,
|
|
2259
|
-
onBlur: () => {
|
|
2260
|
-
onBlur();
|
|
2261
|
-
onInputBlur();
|
|
2262
|
-
},
|
|
2263
|
-
tabIndex: -1,
|
|
2264
|
-
...attributes
|
|
2265
|
-
}
|
|
2266
|
-
),
|
|
2267
|
-
/* @__PURE__ */ jsx5("span", { className: "txt-compact-small text-ui-fg-subtle", children: value ? trueLabel : falseLabel })
|
|
2268
|
-
] });
|
|
2269
|
-
};
|
|
2140
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2270
2141
|
|
|
2271
2142
|
// src/components/data-grid/components/data-grid-media-cell.tsx
|
|
2272
2143
|
import { useEffect as useEffect3, useRef as useRef3, useState as useState4 } from "react";
|
|
2273
2144
|
import { Plus } from "@medusajs/icons";
|
|
2274
2145
|
import { Controller as Controller3 } from "react-hook-form";
|
|
2275
|
-
import { Fragment, jsx as
|
|
2276
|
-
var DataGridMediaCell = ({
|
|
2277
|
-
context,
|
|
2278
|
-
onOpenMediaModal,
|
|
2279
|
-
disabled,
|
|
2280
|
-
...rest
|
|
2281
|
-
}) => {
|
|
2282
|
-
const { field, control, renderProps } = useDataGridCell({
|
|
2283
|
-
context
|
|
2284
|
-
});
|
|
2285
|
-
const errorProps = useDataGridCellError({ context });
|
|
2286
|
-
const { container, input } = renderProps;
|
|
2287
|
-
return /* @__PURE__ */ jsx6(
|
|
2288
|
-
Controller3,
|
|
2289
|
-
{
|
|
2290
|
-
control,
|
|
2291
|
-
name: field,
|
|
2292
|
-
render: ({ field: field2 }) => {
|
|
2293
|
-
return /* @__PURE__ */ jsx6(
|
|
2294
|
-
DataGridCellContainer,
|
|
2295
|
-
{
|
|
2296
|
-
...container,
|
|
2297
|
-
...errorProps,
|
|
2298
|
-
outerComponent: /* @__PURE__ */ jsx6(
|
|
2299
|
-
OuterComponent,
|
|
2300
|
-
{
|
|
2301
|
-
isAnchor: container.isAnchor,
|
|
2302
|
-
onOpenMediaModal,
|
|
2303
|
-
disabled
|
|
2304
|
-
}
|
|
2305
|
-
),
|
|
2306
|
-
children: /* @__PURE__ */ jsx6(
|
|
2307
|
-
Inner3,
|
|
2308
|
-
{
|
|
2309
|
-
field: field2,
|
|
2310
|
-
inputProps: input,
|
|
2311
|
-
disabled,
|
|
2312
|
-
...rest
|
|
2313
|
-
}
|
|
2314
|
-
)
|
|
2315
|
-
}
|
|
2316
|
-
);
|
|
2317
|
-
}
|
|
2318
|
-
}
|
|
2319
|
-
);
|
|
2320
|
-
};
|
|
2321
|
-
var OuterComponent = ({
|
|
2322
|
-
isAnchor,
|
|
2323
|
-
onOpenMediaModal,
|
|
2324
|
-
disabled
|
|
2325
|
-
}) => {
|
|
2326
|
-
const buttonRef = useRef3(null);
|
|
2327
|
-
useEffect3(() => {
|
|
2328
|
-
const handleKeyDown = (e) => {
|
|
2329
|
-
if (isAnchor && e.key === "Enter" && onOpenMediaModal && !disabled) {
|
|
2330
|
-
e.preventDefault();
|
|
2331
|
-
onOpenMediaModal();
|
|
2332
|
-
}
|
|
2333
|
-
};
|
|
2334
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
2335
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
2336
|
-
}, [isAnchor, onOpenMediaModal, disabled]);
|
|
2337
|
-
return /* @__PURE__ */ jsx6("div", { className: "absolute inset-y-0 right-4 z-[3] flex w-fit items-center justify-center opacity-0 transition-opacity group-hover/container:opacity-100", children: /* @__PURE__ */ jsx6(
|
|
2338
|
-
"button",
|
|
2339
|
-
{
|
|
2340
|
-
ref: buttonRef,
|
|
2341
|
-
type: "button",
|
|
2342
|
-
onClick: onOpenMediaModal,
|
|
2343
|
-
className: "txt-compact-small-plus flex items-center justify-center rounded-[4px] p-1 text-ui-fg-interactive outline-none transition-fg hover:text-ui-fg-interactive-hover focus-visible:shadow-borders-focus disabled:cursor-not-allowed disabled:opacity-50",
|
|
2344
|
-
disabled: !onOpenMediaModal || disabled,
|
|
2345
|
-
children: /* @__PURE__ */ jsx6(
|
|
2346
|
-
Plus,
|
|
2347
|
-
{
|
|
2348
|
-
className: disabled ? "text-ui-fg-muted" : void 0
|
|
2349
|
-
}
|
|
2350
|
-
)
|
|
2351
|
-
}
|
|
2352
|
-
) });
|
|
2353
|
-
};
|
|
2354
|
-
var Inner3 = ({
|
|
2355
|
-
field,
|
|
2356
|
-
inputProps,
|
|
2357
|
-
disabled
|
|
2358
|
-
}) => {
|
|
2359
|
-
const { ref, value, onChange: _, onBlur, ...fieldProps } = field;
|
|
2360
|
-
const {
|
|
2361
|
-
ref: inputRef,
|
|
2362
|
-
onChange,
|
|
2363
|
-
onBlur: onInputBlur,
|
|
2364
|
-
onFocus
|
|
2365
|
-
} = inputProps;
|
|
2366
|
-
const [localValue, setLocalValue] = useState4(value || []);
|
|
2367
|
-
useEffect3(() => {
|
|
2368
|
-
setLocalValue(value || []);
|
|
2369
|
-
}, [value]);
|
|
2370
|
-
const combinedRef = useCombinedRefs2(inputRef, ref);
|
|
2371
|
-
const handleOnChange = () => {
|
|
2372
|
-
onChange(localValue, value);
|
|
2373
|
-
};
|
|
2374
|
-
const hasMedia = localValue && localValue.length > 0;
|
|
2375
|
-
const MAX_VISIBLE_THUMBNAILS = 4;
|
|
2376
|
-
return /* @__PURE__ */ jsx6(
|
|
2377
|
-
"div",
|
|
2378
|
-
{
|
|
2379
|
-
className: `flex size-full items-center gap-x-2 ${disabled ? "opacity-50" : ""}`,
|
|
2380
|
-
...fieldProps,
|
|
2381
|
-
children: /* @__PURE__ */ jsx6(
|
|
2382
|
-
"div",
|
|
2383
|
-
{
|
|
2384
|
-
ref: combinedRef,
|
|
2385
|
-
className: `flex h-full flex-1 items-center gap-1.5 overflow-hidden py-2.5 ${disabled ? "cursor-not-allowed" : "cursor-default"}`,
|
|
2386
|
-
onFocus: disabled ? void 0 : onFocus,
|
|
2387
|
-
onBlur: disabled ? void 0 : () => {
|
|
2388
|
-
onBlur();
|
|
2389
|
-
onInputBlur();
|
|
2390
|
-
handleOnChange();
|
|
2391
|
-
},
|
|
2392
|
-
tabIndex: disabled ? -1 : -1,
|
|
2393
|
-
children: hasMedia ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
2394
|
-
localValue.slice(0, MAX_VISIBLE_THUMBNAILS).map((media, index) => /* @__PURE__ */ jsx6(
|
|
2395
|
-
"div",
|
|
2396
|
-
{
|
|
2397
|
-
className: "shrink-0",
|
|
2398
|
-
children: /* @__PURE__ */ jsx6(
|
|
2399
|
-
Thumbnail,
|
|
2400
|
-
{
|
|
2401
|
-
src: media.url,
|
|
2402
|
-
alt: media.url ? `Product image ${index + 1}` : void 0,
|
|
2403
|
-
size: "small"
|
|
2404
|
-
}
|
|
2405
|
-
)
|
|
2406
|
-
},
|
|
2407
|
-
media.id || `media-${index}`
|
|
2408
|
-
)),
|
|
2409
|
-
localValue.length > MAX_VISIBLE_THUMBNAILS && /* @__PURE__ */ jsxs5("div", { className: "flex h-5 w-4 shrink-0 items-center justify-center rounded border border-ui-border-base bg-ui-bg-component text-[10px] font-medium text-ui-fg-subtle", children: [
|
|
2410
|
-
"+",
|
|
2411
|
-
localValue.length - MAX_VISIBLE_THUMBNAILS
|
|
2412
|
-
] })
|
|
2413
|
-
] }) : /* @__PURE__ */ jsx6(Thumbnail, { size: "small" })
|
|
2414
|
-
}
|
|
2415
|
-
)
|
|
2416
|
-
}
|
|
2417
|
-
);
|
|
2418
|
-
};
|
|
2419
|
-
function useCombinedRefs2(...refs) {
|
|
2420
|
-
return (value) => {
|
|
2421
|
-
refs.forEach((ref) => {
|
|
2422
|
-
if (typeof ref === "function") {
|
|
2423
|
-
ref(value);
|
|
2424
|
-
} else if (ref) {
|
|
2425
|
-
;
|
|
2426
|
-
ref.current = value;
|
|
2427
|
-
}
|
|
2428
|
-
});
|
|
2429
|
-
};
|
|
2430
|
-
}
|
|
2146
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2431
2147
|
|
|
2432
2148
|
// src/components/data-grid/components/data-grid-status-cell.tsx
|
|
2433
2149
|
import { clx as clx2, Select } from "@medusajs/ui";
|
|
2434
2150
|
import { Controller as Controller4 } from "react-hook-form";
|
|
2435
2151
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
2436
|
-
import { jsx as
|
|
2437
|
-
var DataGridStatusCell = ({
|
|
2438
|
-
context
|
|
2439
|
-
}) => {
|
|
2440
|
-
const { field, control, renderProps } = useDataGridCell({
|
|
2441
|
-
context
|
|
2442
|
-
});
|
|
2443
|
-
const errorProps = useDataGridCellError({ context });
|
|
2444
|
-
const { container, input } = renderProps;
|
|
2445
|
-
return /* @__PURE__ */ jsx7(
|
|
2446
|
-
Controller4,
|
|
2447
|
-
{
|
|
2448
|
-
control,
|
|
2449
|
-
name: field,
|
|
2450
|
-
render: ({ field: field2 }) => {
|
|
2451
|
-
return /* @__PURE__ */ jsx7(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx7(
|
|
2452
|
-
Inner4,
|
|
2453
|
-
{
|
|
2454
|
-
field: field2,
|
|
2455
|
-
inputProps: input,
|
|
2456
|
-
isAnchor: container.isAnchor
|
|
2457
|
-
}
|
|
2458
|
-
) });
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
);
|
|
2462
|
-
};
|
|
2463
|
-
var Inner4 = ({
|
|
2464
|
-
field,
|
|
2465
|
-
inputProps,
|
|
2466
|
-
isAnchor
|
|
2467
|
-
}) => {
|
|
2468
|
-
const { t } = useTranslation2();
|
|
2469
|
-
const { ref, value, onChange, onBlur } = field;
|
|
2470
|
-
const {
|
|
2471
|
-
ref: inputRef,
|
|
2472
|
-
onBlur: onInputBlur,
|
|
2473
|
-
onFocus,
|
|
2474
|
-
onChange: _onChange,
|
|
2475
|
-
...attributes
|
|
2476
|
-
} = inputProps;
|
|
2477
|
-
const combinedRefs = useCombinedRefs(ref, inputRef);
|
|
2478
|
-
const options = [
|
|
2479
|
-
{
|
|
2480
|
-
label: t("products.productStatus.draft"),
|
|
2481
|
-
value: "draft"
|
|
2482
|
-
},
|
|
2483
|
-
{
|
|
2484
|
-
label: t("products.productStatus.published"),
|
|
2485
|
-
value: "published"
|
|
2486
|
-
}
|
|
2487
|
-
];
|
|
2488
|
-
return /* @__PURE__ */ jsxs6(
|
|
2489
|
-
Select,
|
|
2490
|
-
{
|
|
2491
|
-
value,
|
|
2492
|
-
onValueChange: (newValue) => {
|
|
2493
|
-
onChange(newValue);
|
|
2494
|
-
},
|
|
2495
|
-
children: [
|
|
2496
|
-
/* @__PURE__ */ jsx7(
|
|
2497
|
-
Select.Trigger,
|
|
2498
|
-
{
|
|
2499
|
-
ref: combinedRefs,
|
|
2500
|
-
className: clx2(
|
|
2501
|
-
"txt-compact-small h-full w-full rounded-none border-none bg-transparent px-0 py-2.5 shadow-none outline-none",
|
|
2502
|
-
"hover:bg-transparent focus:shadow-none data-[state=open]:!shadow-none"
|
|
2503
|
-
),
|
|
2504
|
-
onPointerDown: !isAnchor ? (e) => e.preventDefault() : void 0,
|
|
2505
|
-
onFocus,
|
|
2506
|
-
onBlur: () => {
|
|
2507
|
-
onBlur();
|
|
2508
|
-
onInputBlur();
|
|
2509
|
-
},
|
|
2510
|
-
...attributes,
|
|
2511
|
-
children: /* @__PURE__ */ jsx7(Select.Value, {})
|
|
2512
|
-
}
|
|
2513
|
-
),
|
|
2514
|
-
/* @__PURE__ */ jsx7(Select.Content, { children: options.map((option) => /* @__PURE__ */ jsx7(Select.Item, { value: option.value, children: option.label }, option.value)) })
|
|
2515
|
-
]
|
|
2516
|
-
}
|
|
2517
|
-
);
|
|
2518
|
-
};
|
|
2152
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2519
2153
|
|
|
2520
2154
|
// src/components/data-grid/components/data-grid-currency-cell.tsx
|
|
2521
2155
|
import CurrencyInput, {
|
|
@@ -2523,7 +2157,7 @@ import CurrencyInput, {
|
|
|
2523
2157
|
} from "react-currency-input-field";
|
|
2524
2158
|
import { Controller as Controller5 } from "react-hook-form";
|
|
2525
2159
|
import { useCallback as useCallback12, useEffect as useEffect4, useState as useState5 } from "react";
|
|
2526
|
-
import { jsx as
|
|
2160
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2527
2161
|
var DataGridCurrencyCell = ({
|
|
2528
2162
|
context,
|
|
2529
2163
|
code
|
|
@@ -2534,18 +2168,18 @@ var DataGridCurrencyCell = ({
|
|
|
2534
2168
|
const errorProps = useDataGridCellError({ context });
|
|
2535
2169
|
const { container, input } = renderProps;
|
|
2536
2170
|
const currency = currencies[code.toUpperCase()];
|
|
2537
|
-
return /* @__PURE__ */
|
|
2171
|
+
return /* @__PURE__ */ jsx7(
|
|
2538
2172
|
Controller5,
|
|
2539
2173
|
{
|
|
2540
2174
|
control,
|
|
2541
2175
|
name: field,
|
|
2542
2176
|
render: ({ field: field2 }) => {
|
|
2543
|
-
return /* @__PURE__ */
|
|
2177
|
+
return /* @__PURE__ */ jsx7(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx7(Inner2, { field: field2, inputProps: input, currencyInfo: currency }) });
|
|
2544
2178
|
}
|
|
2545
2179
|
}
|
|
2546
2180
|
);
|
|
2547
2181
|
};
|
|
2548
|
-
var
|
|
2182
|
+
var Inner2 = ({
|
|
2549
2183
|
field,
|
|
2550
2184
|
inputProps,
|
|
2551
2185
|
currencyInfo
|
|
@@ -2586,8 +2220,8 @@ var Inner5 = ({
|
|
|
2586
2220
|
setLocalValue(update);
|
|
2587
2221
|
}, [value, formatter]);
|
|
2588
2222
|
const combinedRed = useCombinedRefs(inputRef, ref);
|
|
2589
|
-
return /* @__PURE__ */
|
|
2590
|
-
/* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsxs6("div", { className: "relative flex size-full items-center", children: [
|
|
2224
|
+
/* @__PURE__ */ jsx7(
|
|
2591
2225
|
"span",
|
|
2592
2226
|
{
|
|
2593
2227
|
className: "txt-compact-small text-ui-fg-muted pointer-events-none absolute left-0 w-fit min-w-4",
|
|
@@ -2595,7 +2229,7 @@ var Inner5 = ({
|
|
|
2595
2229
|
children: currencyInfo.symbol_native
|
|
2596
2230
|
}
|
|
2597
2231
|
),
|
|
2598
|
-
/* @__PURE__ */
|
|
2232
|
+
/* @__PURE__ */ jsx7(
|
|
2599
2233
|
CurrencyInput,
|
|
2600
2234
|
{
|
|
2601
2235
|
...rest,
|
|
@@ -2624,7 +2258,7 @@ var Inner5 = ({
|
|
|
2624
2258
|
import { clx as clx3 } from "@medusajs/ui";
|
|
2625
2259
|
import { useCallback as useCallback13, useEffect as useEffect5, useRef as useRef4, useState as useState6 } from "react";
|
|
2626
2260
|
import { Controller as Controller6 } from "react-hook-form";
|
|
2627
|
-
import { jsx as
|
|
2261
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2628
2262
|
var DataGridMultilineCell = ({
|
|
2629
2263
|
context
|
|
2630
2264
|
}) => {
|
|
@@ -2633,18 +2267,18 @@ var DataGridMultilineCell = ({
|
|
|
2633
2267
|
});
|
|
2634
2268
|
const errorProps = useDataGridCellError({ context });
|
|
2635
2269
|
const { container, input } = renderProps;
|
|
2636
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ jsx8(
|
|
2637
2271
|
Controller6,
|
|
2638
2272
|
{
|
|
2639
2273
|
control,
|
|
2640
2274
|
name: field,
|
|
2641
2275
|
render: ({ field: field2 }) => {
|
|
2642
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ jsx8(DataGridCellContainer, { ...container, ...errorProps, isMultiLine: true, children: /* @__PURE__ */ jsx8(Inner3, { field: field2, inputProps: input }) });
|
|
2643
2277
|
}
|
|
2644
2278
|
}
|
|
2645
2279
|
);
|
|
2646
2280
|
};
|
|
2647
|
-
var
|
|
2281
|
+
var Inner3 = ({
|
|
2648
2282
|
field,
|
|
2649
2283
|
inputProps
|
|
2650
2284
|
}) => {
|
|
@@ -2672,7 +2306,7 @@ var Inner6 = ({
|
|
|
2672
2306
|
const timeoutId = setTimeout(adjustTextareaHeight, 50);
|
|
2673
2307
|
return () => clearTimeout(timeoutId);
|
|
2674
2308
|
}, [adjustTextareaHeight]);
|
|
2675
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx8(
|
|
2676
2310
|
"textarea",
|
|
2677
2311
|
{
|
|
2678
2312
|
className: clx3(
|
|
@@ -2703,7 +2337,7 @@ var Inner6 = ({
|
|
|
2703
2337
|
import { clx as clx4 } from "@medusajs/ui";
|
|
2704
2338
|
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
2705
2339
|
import { Controller as Controller7 } from "react-hook-form";
|
|
2706
|
-
import { jsx as
|
|
2340
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2707
2341
|
var DataGridNumberCell = ({
|
|
2708
2342
|
context,
|
|
2709
2343
|
...rest
|
|
@@ -2713,18 +2347,18 @@ var DataGridNumberCell = ({
|
|
|
2713
2347
|
});
|
|
2714
2348
|
const errorProps = useDataGridCellError({ context });
|
|
2715
2349
|
const { container, input } = renderProps;
|
|
2716
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx9(
|
|
2717
2351
|
Controller7,
|
|
2718
2352
|
{
|
|
2719
2353
|
control,
|
|
2720
2354
|
name: field,
|
|
2721
2355
|
render: ({ field: field2 }) => {
|
|
2722
|
-
return /* @__PURE__ */
|
|
2356
|
+
return /* @__PURE__ */ jsx9(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx9(Inner4, { field: field2, inputProps: input, ...rest }) });
|
|
2723
2357
|
}
|
|
2724
2358
|
}
|
|
2725
2359
|
);
|
|
2726
2360
|
};
|
|
2727
|
-
var
|
|
2361
|
+
var Inner4 = ({
|
|
2728
2362
|
field,
|
|
2729
2363
|
inputProps,
|
|
2730
2364
|
...props
|
|
@@ -2742,7 +2376,7 @@ var Inner7 = ({
|
|
|
2742
2376
|
setLocalValue(value);
|
|
2743
2377
|
}, [value]);
|
|
2744
2378
|
const combinedRefs = useCombinedRefs(inputRef, ref);
|
|
2745
|
-
return /* @__PURE__ */
|
|
2379
|
+
return /* @__PURE__ */ jsx9("div", { className: "size-full", children: /* @__PURE__ */ jsx9(
|
|
2746
2380
|
"input",
|
|
2747
2381
|
{
|
|
2748
2382
|
ref: combinedRefs,
|
|
@@ -2770,7 +2404,7 @@ var Inner7 = ({
|
|
|
2770
2404
|
|
|
2771
2405
|
// src/components/data-grid/components/data-grid-readonly-cell.tsx
|
|
2772
2406
|
import { clx as clx5 } from "@medusajs/ui";
|
|
2773
|
-
import { jsx as
|
|
2407
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2774
2408
|
var DataGridReadonlyCell = ({
|
|
2775
2409
|
context,
|
|
2776
2410
|
color = "muted",
|
|
@@ -2778,7 +2412,7 @@ var DataGridReadonlyCell = ({
|
|
|
2778
2412
|
isMultiLine = false
|
|
2779
2413
|
}) => {
|
|
2780
2414
|
const { rowErrors } = useDataGridCellError({ context });
|
|
2781
|
-
return /* @__PURE__ */
|
|
2415
|
+
return /* @__PURE__ */ jsxs7(
|
|
2782
2416
|
"div",
|
|
2783
2417
|
{
|
|
2784
2418
|
className: clx5(
|
|
@@ -2788,7 +2422,7 @@ var DataGridReadonlyCell = ({
|
|
|
2788
2422
|
"h-full items-center"
|
|
2789
2423
|
),
|
|
2790
2424
|
children: [
|
|
2791
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ jsx10(
|
|
2792
2426
|
"div",
|
|
2793
2427
|
{
|
|
2794
2428
|
className: clx5("flex-1", {
|
|
@@ -2798,7 +2432,7 @@ var DataGridReadonlyCell = ({
|
|
|
2798
2432
|
children
|
|
2799
2433
|
}
|
|
2800
2434
|
),
|
|
2801
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ jsx10(DataGridRowErrorIndicator, { rowErrors })
|
|
2802
2436
|
]
|
|
2803
2437
|
}
|
|
2804
2438
|
);
|
|
@@ -2886,7 +2520,7 @@ import {
|
|
|
2886
2520
|
import { Dialog as RadixDialog } from "radix-ui";
|
|
2887
2521
|
import { useMemo as useMemo4, useState as useState9 } from "react";
|
|
2888
2522
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
2889
|
-
import { jsx as
|
|
2523
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2890
2524
|
var useDataGridShortcuts = () => {
|
|
2891
2525
|
const { t } = useTranslation3();
|
|
2892
2526
|
const shortcuts = useMemo4(
|
|
@@ -3041,10 +2675,10 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
3041
2675
|
(shortcut) => shortcut.label.toLowerCase().includes(searchValue.toLowerCase())
|
|
3042
2676
|
);
|
|
3043
2677
|
}, [searchValue, shortcuts]);
|
|
3044
|
-
return /* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3047
|
-
/* @__PURE__ */
|
|
2678
|
+
return /* @__PURE__ */ jsxs8(RadixDialog.Root, { open, onOpenChange, children: [
|
|
2679
|
+
/* @__PURE__ */ jsx11(RadixDialog.Trigger, { asChild: true, children: /* @__PURE__ */ jsx11(Button, { size: "small", variant: "secondary", children: t("dataGrid.shortcuts.label") }) }),
|
|
2680
|
+
/* @__PURE__ */ jsxs8(RadixDialog.Portal, { children: [
|
|
2681
|
+
/* @__PURE__ */ jsx11(
|
|
3048
2682
|
RadixDialog.Overlay,
|
|
3049
2683
|
{
|
|
3050
2684
|
className: clx6(
|
|
@@ -3053,19 +2687,19 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
3053
2687
|
)
|
|
3054
2688
|
}
|
|
3055
2689
|
),
|
|
3056
|
-
/* @__PURE__ */
|
|
3057
|
-
/* @__PURE__ */
|
|
3058
|
-
/* @__PURE__ */
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsxs8(RadixDialog.Content, { className: "bg-ui-bg-subtle shadow-elevation-modal fixed left-[50%] top-[50%] flex h-full max-h-[612px] w-full max-w-[560px] translate-x-[-50%] translate-y-[-50%] flex-col divide-y overflow-hidden rounded-lg outline-none", children: [
|
|
2691
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-y-3 px-6 py-4", children: [
|
|
2692
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
2693
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
2694
|
+
/* @__PURE__ */ jsx11(RadixDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx11(Heading, { children: t("app.menus.user.shortcuts") }) }),
|
|
2695
|
+
/* @__PURE__ */ jsx11(RadixDialog.Description, { className: "sr-only" })
|
|
3062
2696
|
] }),
|
|
3063
|
-
/* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3065
|
-
/* @__PURE__ */
|
|
2697
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-x-2", children: [
|
|
2698
|
+
/* @__PURE__ */ jsx11(Kbd, { children: "esc" }),
|
|
2699
|
+
/* @__PURE__ */ jsx11(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx11(IconButton, { variant: "transparent", size: "small", children: /* @__PURE__ */ jsx11(XMark, {}) }) })
|
|
3066
2700
|
] })
|
|
3067
2701
|
] }),
|
|
3068
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11(
|
|
3069
2703
|
Input,
|
|
3070
2704
|
{
|
|
3071
2705
|
type: "search",
|
|
@@ -3074,15 +2708,15 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
3074
2708
|
}
|
|
3075
2709
|
) })
|
|
3076
2710
|
] }),
|
|
3077
|
-
/* @__PURE__ */
|
|
3078
|
-
return /* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ jsx11("div", { className: "flex flex-col divide-y overflow-y-auto", children: searchResults.map((shortcut, index) => {
|
|
2712
|
+
return /* @__PURE__ */ jsxs8(
|
|
3079
2713
|
"div",
|
|
3080
2714
|
{
|
|
3081
2715
|
className: "text-ui-fg-subtle flex items-center justify-between px-6 py-3",
|
|
3082
2716
|
children: [
|
|
3083
|
-
/* @__PURE__ */
|
|
3084
|
-
/* @__PURE__ */
|
|
3085
|
-
return /* @__PURE__ */
|
|
2717
|
+
/* @__PURE__ */ jsx11(Text, { size: "small", children: shortcut.label }),
|
|
2718
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center gap-x-1", children: shortcut.keys.Mac?.map((key, index2) => {
|
|
2719
|
+
return /* @__PURE__ */ jsx11("div", { className: "flex items-center gap-x-1", children: /* @__PURE__ */ jsx11(Kbd, { children: key }) }, index2);
|
|
3086
2720
|
}) })
|
|
3087
2721
|
]
|
|
3088
2722
|
},
|
|
@@ -3095,7 +2729,7 @@ var DataGridKeyboardShortcutModal = ({
|
|
|
3095
2729
|
};
|
|
3096
2730
|
|
|
3097
2731
|
// src/components/data-grid/components/data-grid-root.tsx
|
|
3098
|
-
import { jsx as
|
|
2732
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3099
2733
|
var ROW_HEIGHT = 40;
|
|
3100
2734
|
var getCommonPinningStyles = (column) => {
|
|
3101
2735
|
const isPinned = column.getIsPinned();
|
|
@@ -3532,8 +3166,8 @@ var DataGridRoot = ({
|
|
|
3532
3166
|
});
|
|
3533
3167
|
}
|
|
3534
3168
|
}, [anchor, trapActive, setSingleRange, scrollToCoordinates, queryTool]);
|
|
3535
|
-
return /* @__PURE__ */
|
|
3536
|
-
/* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsx12(DataGridContext.Provider, { value: values, children: /* @__PURE__ */ jsxs9("div", { className: "bg-ui-bg-subtle flex size-full flex-col", children: [
|
|
3170
|
+
/* @__PURE__ */ jsx12(
|
|
3537
3171
|
DataGridHeader,
|
|
3538
3172
|
{
|
|
3539
3173
|
showColumnsDropdown,
|
|
@@ -3548,7 +3182,7 @@ var DataGridRoot = ({
|
|
|
3548
3182
|
headerContent
|
|
3549
3183
|
}
|
|
3550
3184
|
),
|
|
3551
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsx12("div", { className: "size-full overflow-hidden", children: /* @__PURE__ */ jsx12(
|
|
3552
3186
|
"div",
|
|
3553
3187
|
{
|
|
3554
3188
|
ref: containerRef,
|
|
@@ -3558,19 +3192,19 @@ var DataGridRoot = ({
|
|
|
3558
3192
|
onClick: handleRestoreGridFocus,
|
|
3559
3193
|
"data-container": true,
|
|
3560
3194
|
role: "application",
|
|
3561
|
-
children: /* @__PURE__ */
|
|
3562
|
-
/* @__PURE__ */
|
|
3195
|
+
children: /* @__PURE__ */ jsxs9("div", { role: "grid", className: "text-ui-fg-subtle grid", children: [
|
|
3196
|
+
/* @__PURE__ */ jsx12(
|
|
3563
3197
|
"div",
|
|
3564
3198
|
{
|
|
3565
3199
|
role: "rowgroup",
|
|
3566
3200
|
className: "txt-compact-small-plus bg-ui-bg-subtle sticky top-0 z-[1] grid",
|
|
3567
|
-
children: grid.getHeaderGroups().map((headerGroup) => /* @__PURE__ */
|
|
3201
|
+
children: grid.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxs9(
|
|
3568
3202
|
"div",
|
|
3569
3203
|
{
|
|
3570
3204
|
role: "row",
|
|
3571
3205
|
className: "flex h-10 w-full",
|
|
3572
3206
|
children: [
|
|
3573
|
-
virtualPaddingLeft ? /* @__PURE__ */
|
|
3207
|
+
virtualPaddingLeft ? /* @__PURE__ */ jsx12(
|
|
3574
3208
|
"div",
|
|
3575
3209
|
{
|
|
3576
3210
|
role: "presentation",
|
|
@@ -3582,7 +3216,7 @@ var DataGridRoot = ({
|
|
|
3582
3216
|
const previousVC = array[index - 1];
|
|
3583
3217
|
if (previousVC && vc.index !== previousVC.index + 1) {
|
|
3584
3218
|
acc.push(
|
|
3585
|
-
/* @__PURE__ */
|
|
3219
|
+
/* @__PURE__ */ jsx12(
|
|
3586
3220
|
"div",
|
|
3587
3221
|
{
|
|
3588
3222
|
role: "presentation",
|
|
@@ -3596,7 +3230,7 @@ var DataGridRoot = ({
|
|
|
3596
3230
|
);
|
|
3597
3231
|
}
|
|
3598
3232
|
acc.push(
|
|
3599
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx12(
|
|
3600
3234
|
"div",
|
|
3601
3235
|
{
|
|
3602
3236
|
role: "columnheader",
|
|
@@ -3616,7 +3250,7 @@ var DataGridRoot = ({
|
|
|
3616
3250
|
);
|
|
3617
3251
|
return acc;
|
|
3618
3252
|
}, []),
|
|
3619
|
-
virtualPaddingRight ? /* @__PURE__ */
|
|
3253
|
+
virtualPaddingRight ? /* @__PURE__ */ jsx12(
|
|
3620
3254
|
"div",
|
|
3621
3255
|
{
|
|
3622
3256
|
role: "presentation",
|
|
@@ -3632,7 +3266,7 @@ var DataGridRoot = ({
|
|
|
3632
3266
|
))
|
|
3633
3267
|
}
|
|
3634
3268
|
),
|
|
3635
|
-
/* @__PURE__ */
|
|
3269
|
+
/* @__PURE__ */ jsx12(
|
|
3636
3270
|
"div",
|
|
3637
3271
|
{
|
|
3638
3272
|
role: "rowgroup",
|
|
@@ -3643,7 +3277,7 @@ var DataGridRoot = ({
|
|
|
3643
3277
|
children: virtualRows.map((virtualRow) => {
|
|
3644
3278
|
const row = visibleRows[virtualRow.index];
|
|
3645
3279
|
if (!row) {
|
|
3646
|
-
return /* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ jsx12(
|
|
3647
3281
|
DataGridRowSkeleton,
|
|
3648
3282
|
{
|
|
3649
3283
|
virtualRow,
|
|
@@ -3655,7 +3289,7 @@ var DataGridRoot = ({
|
|
|
3655
3289
|
);
|
|
3656
3290
|
}
|
|
3657
3291
|
const rowIndex = flatRows.findIndex((r) => r.id === row.id);
|
|
3658
|
-
return /* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ jsx12(
|
|
3659
3293
|
DataGridRow,
|
|
3660
3294
|
{
|
|
3661
3295
|
row,
|
|
@@ -3705,32 +3339,32 @@ var DataGridHeader = ({
|
|
|
3705
3339
|
onHeaderInteractionChange(value);
|
|
3706
3340
|
setColumnsOpen(value);
|
|
3707
3341
|
};
|
|
3708
|
-
return /* @__PURE__ */
|
|
3709
|
-
showColumnsDropdown && /* @__PURE__ */
|
|
3710
|
-
/* @__PURE__ */
|
|
3342
|
+
return /* @__PURE__ */ jsxs9("div", { className: "bg-ui-bg-base flex items-center justify-between border-b p-4", children: [
|
|
3343
|
+
showColumnsDropdown && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-x-2", children: [
|
|
3344
|
+
/* @__PURE__ */ jsxs9(
|
|
3711
3345
|
DropdownMenu,
|
|
3712
3346
|
{
|
|
3713
3347
|
dir: direction,
|
|
3714
3348
|
open: columnsOpen,
|
|
3715
3349
|
onOpenChange: handleColumnsOpenChange,
|
|
3716
3350
|
children: [
|
|
3717
|
-
/* @__PURE__ */
|
|
3351
|
+
/* @__PURE__ */ jsx12(
|
|
3718
3352
|
ConditionalTooltip,
|
|
3719
3353
|
{
|
|
3720
3354
|
showTooltip: isDisabled,
|
|
3721
3355
|
content: t("dataGrid.columns.disabled"),
|
|
3722
|
-
children: /* @__PURE__ */
|
|
3723
|
-
hasChanged ? /* @__PURE__ */
|
|
3356
|
+
children: /* @__PURE__ */ jsx12(DropdownMenu.Trigger, { asChild: true, disabled: isDisabled, children: /* @__PURE__ */ jsxs9(Button2, { size: "small", variant: "secondary", children: [
|
|
3357
|
+
hasChanged ? /* @__PURE__ */ jsx12(AdjustmentsDone, {}) : /* @__PURE__ */ jsx12(Adjustments, {}),
|
|
3724
3358
|
t("dataGrid.columns.view")
|
|
3725
3359
|
] }) })
|
|
3726
3360
|
}
|
|
3727
3361
|
),
|
|
3728
|
-
/* @__PURE__ */
|
|
3362
|
+
/* @__PURE__ */ jsx12(DropdownMenu.Content, { children: columnOptions.map((column, index) => {
|
|
3729
3363
|
const { checked, disabled, id, name } = column;
|
|
3730
3364
|
if (disabled) {
|
|
3731
3365
|
return null;
|
|
3732
3366
|
}
|
|
3733
|
-
return /* @__PURE__ */
|
|
3367
|
+
return /* @__PURE__ */ jsx12(
|
|
3734
3368
|
DropdownMenu.CheckboxItem,
|
|
3735
3369
|
{
|
|
3736
3370
|
checked,
|
|
@@ -3744,7 +3378,7 @@ var DataGridHeader = ({
|
|
|
3744
3378
|
]
|
|
3745
3379
|
}
|
|
3746
3380
|
),
|
|
3747
|
-
hasChanged && /* @__PURE__ */
|
|
3381
|
+
hasChanged && /* @__PURE__ */ jsx12(
|
|
3748
3382
|
Button2,
|
|
3749
3383
|
{
|
|
3750
3384
|
size: "small",
|
|
@@ -3758,8 +3392,8 @@ var DataGridHeader = ({
|
|
|
3758
3392
|
)
|
|
3759
3393
|
] }),
|
|
3760
3394
|
headerContent,
|
|
3761
|
-
/* @__PURE__ */
|
|
3762
|
-
errorCount > 0 && /* @__PURE__ */
|
|
3395
|
+
/* @__PURE__ */ jsxs9("div", { className: "ml-auto flex items-center gap-x-2", children: [
|
|
3396
|
+
errorCount > 0 && /* @__PURE__ */ jsxs9(
|
|
3763
3397
|
Button2,
|
|
3764
3398
|
{
|
|
3765
3399
|
size: "small",
|
|
@@ -3770,14 +3404,14 @@ var DataGridHeader = ({
|
|
|
3770
3404
|
"bg-ui-button-neutral-pressed": isHighlighted
|
|
3771
3405
|
}),
|
|
3772
3406
|
children: [
|
|
3773
|
-
/* @__PURE__ */
|
|
3774
|
-
/* @__PURE__ */
|
|
3407
|
+
/* @__PURE__ */ jsx12(ExclamationCircle2, { className: "text-ui-fg-subtle" }),
|
|
3408
|
+
/* @__PURE__ */ jsx12("span", { children: t("dataGrid.errors.count", {
|
|
3775
3409
|
count: errorCount
|
|
3776
3410
|
}) })
|
|
3777
3411
|
]
|
|
3778
3412
|
}
|
|
3779
3413
|
),
|
|
3780
|
-
/* @__PURE__ */
|
|
3414
|
+
/* @__PURE__ */ jsx12(
|
|
3781
3415
|
DataGridKeyboardShortcutModal,
|
|
3782
3416
|
{
|
|
3783
3417
|
open: shortcutsOpen,
|
|
@@ -3800,7 +3434,7 @@ var DataGridCell = ({
|
|
|
3800
3434
|
col: columnIndex
|
|
3801
3435
|
};
|
|
3802
3436
|
const isAnchor = isCellMatch(coords, anchor);
|
|
3803
|
-
return /* @__PURE__ */
|
|
3437
|
+
return /* @__PURE__ */ jsx12(
|
|
3804
3438
|
"div",
|
|
3805
3439
|
{
|
|
3806
3440
|
role: "gridcell",
|
|
@@ -3816,13 +3450,13 @@ var DataGridCell = ({
|
|
|
3816
3450
|
"relative flex items-stretch border-b border-r p-0 outline-none"
|
|
3817
3451
|
),
|
|
3818
3452
|
tabIndex: -1,
|
|
3819
|
-
children: /* @__PURE__ */
|
|
3453
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "relative w-full", children: [
|
|
3820
3454
|
flexRender(cell.column.columnDef.cell, {
|
|
3821
3455
|
...cell.getContext(),
|
|
3822
3456
|
columnIndex,
|
|
3823
3457
|
rowIndex
|
|
3824
3458
|
}),
|
|
3825
|
-
isAnchor && /* @__PURE__ */
|
|
3459
|
+
isAnchor && /* @__PURE__ */ jsx12(
|
|
3826
3460
|
"div",
|
|
3827
3461
|
{
|
|
3828
3462
|
onMouseDown: onDragToFillStart,
|
|
@@ -3852,7 +3486,7 @@ var DataGridRow = ({
|
|
|
3852
3486
|
multiColumnSelection
|
|
3853
3487
|
}) => {
|
|
3854
3488
|
const visibleCells = row.getVisibleCells();
|
|
3855
|
-
return /* @__PURE__ */
|
|
3489
|
+
return /* @__PURE__ */ jsxs9(
|
|
3856
3490
|
"div",
|
|
3857
3491
|
{
|
|
3858
3492
|
role: "row",
|
|
@@ -3864,7 +3498,7 @@ var DataGridRow = ({
|
|
|
3864
3498
|
},
|
|
3865
3499
|
className: "bg-ui-bg-subtle txt-compact-small absolute flex min-h-10 w-full",
|
|
3866
3500
|
children: [
|
|
3867
|
-
virtualPaddingLeft ? /* @__PURE__ */
|
|
3501
|
+
virtualPaddingLeft ? /* @__PURE__ */ jsx12(
|
|
3868
3502
|
"div",
|
|
3869
3503
|
{
|
|
3870
3504
|
role: "presentation",
|
|
@@ -3878,7 +3512,7 @@ var DataGridRow = ({
|
|
|
3878
3512
|
const previousVC = array[index - 1];
|
|
3879
3513
|
if (previousVC && vc.index !== previousVC.index + 1) {
|
|
3880
3514
|
acc.push(
|
|
3881
|
-
/* @__PURE__ */
|
|
3515
|
+
/* @__PURE__ */ jsx12(
|
|
3882
3516
|
"div",
|
|
3883
3517
|
{
|
|
3884
3518
|
role: "presentation",
|
|
@@ -3892,7 +3526,7 @@ var DataGridRow = ({
|
|
|
3892
3526
|
);
|
|
3893
3527
|
}
|
|
3894
3528
|
acc.push(
|
|
3895
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsx12(
|
|
3896
3530
|
DataGridCell,
|
|
3897
3531
|
{
|
|
3898
3532
|
cell,
|
|
@@ -3907,7 +3541,7 @@ var DataGridRow = ({
|
|
|
3907
3541
|
);
|
|
3908
3542
|
return acc;
|
|
3909
3543
|
}, []),
|
|
3910
|
-
virtualPaddingRight ? /* @__PURE__ */
|
|
3544
|
+
virtualPaddingRight ? /* @__PURE__ */ jsx12(
|
|
3911
3545
|
"div",
|
|
3912
3546
|
{
|
|
3913
3547
|
role: "presentation",
|
|
@@ -3924,7 +3558,7 @@ var DataGridRowSkeleton = ({
|
|
|
3924
3558
|
virtualPaddingRight,
|
|
3925
3559
|
virtualColumns
|
|
3926
3560
|
}) => {
|
|
3927
|
-
return /* @__PURE__ */
|
|
3561
|
+
return /* @__PURE__ */ jsxs9(
|
|
3928
3562
|
"div",
|
|
3929
3563
|
{
|
|
3930
3564
|
role: "row",
|
|
@@ -3934,7 +3568,7 @@ var DataGridRowSkeleton = ({
|
|
|
3934
3568
|
},
|
|
3935
3569
|
className: "bg-ui-bg-subtle txt-compact-small absolute flex h-10 w-full",
|
|
3936
3570
|
children: [
|
|
3937
|
-
virtualPaddingLeft ? /* @__PURE__ */
|
|
3571
|
+
virtualPaddingLeft ? /* @__PURE__ */ jsx12(
|
|
3938
3572
|
"div",
|
|
3939
3573
|
{
|
|
3940
3574
|
role: "presentation",
|
|
@@ -3946,7 +3580,7 @@ var DataGridRowSkeleton = ({
|
|
|
3946
3580
|
const elements = [];
|
|
3947
3581
|
if (previousVC && vc.index !== previousVC.index + 1) {
|
|
3948
3582
|
elements.push(
|
|
3949
|
-
/* @__PURE__ */
|
|
3583
|
+
/* @__PURE__ */ jsx12(
|
|
3950
3584
|
"div",
|
|
3951
3585
|
{
|
|
3952
3586
|
role: "presentation",
|
|
@@ -3960,20 +3594,20 @@ var DataGridRowSkeleton = ({
|
|
|
3960
3594
|
);
|
|
3961
3595
|
}
|
|
3962
3596
|
elements.push(
|
|
3963
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ jsx12(
|
|
3964
3598
|
"div",
|
|
3965
3599
|
{
|
|
3966
3600
|
role: "gridcell",
|
|
3967
3601
|
style: { width: vc.size },
|
|
3968
3602
|
className: "relative flex items-center border-b border-r p-0 outline-none",
|
|
3969
|
-
children: /* @__PURE__ */
|
|
3603
|
+
children: /* @__PURE__ */ jsx12("div", { className: "flex h-full w-full items-center px-4", children: /* @__PURE__ */ jsx12("div", { className: "bg-ui-bg-component h-4 w-3/4 animate-pulse rounded" }) })
|
|
3970
3604
|
},
|
|
3971
3605
|
`skeleton-cell-${vc.index}`
|
|
3972
3606
|
)
|
|
3973
3607
|
);
|
|
3974
3608
|
return elements;
|
|
3975
3609
|
}),
|
|
3976
|
-
virtualPaddingRight ? /* @__PURE__ */
|
|
3610
|
+
virtualPaddingRight ? /* @__PURE__ */ jsx12(
|
|
3977
3611
|
"div",
|
|
3978
3612
|
{
|
|
3979
3613
|
role: "presentation",
|
|
@@ -3985,11 +3619,143 @@ var DataGridRowSkeleton = ({
|
|
|
3985
3619
|
);
|
|
3986
3620
|
};
|
|
3987
3621
|
|
|
3622
|
+
// src/components/data-grid/components/data-grid-select-cell.tsx
|
|
3623
|
+
import { Select as Select2, clx as clx8 } from "@medusajs/ui";
|
|
3624
|
+
import { Controller as Controller8 } from "react-hook-form";
|
|
3625
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3626
|
+
var DataGridSelectCell = ({
|
|
3627
|
+
context,
|
|
3628
|
+
options,
|
|
3629
|
+
placeholder
|
|
3630
|
+
}) => {
|
|
3631
|
+
const { field, control, renderProps } = useDataGridCell({ context });
|
|
3632
|
+
const errorProps = useDataGridCellError({ context });
|
|
3633
|
+
const { container, input } = renderProps;
|
|
3634
|
+
return /* @__PURE__ */ jsx13(
|
|
3635
|
+
Controller8,
|
|
3636
|
+
{
|
|
3637
|
+
control,
|
|
3638
|
+
name: field,
|
|
3639
|
+
render: ({ field: field2 }) => /* @__PURE__ */ jsx13(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx13(
|
|
3640
|
+
Inner5,
|
|
3641
|
+
{
|
|
3642
|
+
field: field2,
|
|
3643
|
+
inputProps: input,
|
|
3644
|
+
options,
|
|
3645
|
+
placeholder
|
|
3646
|
+
}
|
|
3647
|
+
) })
|
|
3648
|
+
}
|
|
3649
|
+
);
|
|
3650
|
+
};
|
|
3651
|
+
var Inner5 = ({
|
|
3652
|
+
field,
|
|
3653
|
+
inputProps,
|
|
3654
|
+
options,
|
|
3655
|
+
placeholder
|
|
3656
|
+
}) => {
|
|
3657
|
+
const { ref, value, onChange, onBlur, ...fieldProps } = field;
|
|
3658
|
+
const {
|
|
3659
|
+
ref: inputRef,
|
|
3660
|
+
onChange: _onInputChange,
|
|
3661
|
+
onBlur: onInputBlur,
|
|
3662
|
+
onFocus,
|
|
3663
|
+
...attributes
|
|
3664
|
+
} = inputProps;
|
|
3665
|
+
const combinedRefs = useCombinedRefs(inputRef, ref);
|
|
3666
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
3667
|
+
return /* @__PURE__ */ jsxs10(
|
|
3668
|
+
Select2,
|
|
3669
|
+
{
|
|
3670
|
+
value: value ?? "",
|
|
3671
|
+
onValueChange: (next) => {
|
|
3672
|
+
onChange(next);
|
|
3673
|
+
onBlur();
|
|
3674
|
+
onInputBlur();
|
|
3675
|
+
},
|
|
3676
|
+
...fieldProps,
|
|
3677
|
+
children: [
|
|
3678
|
+
/* @__PURE__ */ jsx13(
|
|
3679
|
+
Select2.Trigger,
|
|
3680
|
+
{
|
|
3681
|
+
ref: combinedRefs,
|
|
3682
|
+
onFocus,
|
|
3683
|
+
onBlur: () => {
|
|
3684
|
+
onBlur();
|
|
3685
|
+
onInputBlur();
|
|
3686
|
+
},
|
|
3687
|
+
className: clx8(
|
|
3688
|
+
"size-full rounded-none border-0 bg-transparent px-0 text-left shadow-none",
|
|
3689
|
+
"focus:shadow-none data-[state=open]:!shadow-none hover:bg-transparent"
|
|
3690
|
+
),
|
|
3691
|
+
tabIndex: -1,
|
|
3692
|
+
...attributes,
|
|
3693
|
+
children: /* @__PURE__ */ jsx13(Select2.Value, { placeholder, children: selectedOption?.label ?? placeholder })
|
|
3694
|
+
}
|
|
3695
|
+
),
|
|
3696
|
+
/* @__PURE__ */ jsx13(Select2.Content, { children: options.map((option) => /* @__PURE__ */ jsx13(Select2.Item, { value: option.value, children: option.label }, option.value)) })
|
|
3697
|
+
]
|
|
3698
|
+
}
|
|
3699
|
+
);
|
|
3700
|
+
};
|
|
3701
|
+
|
|
3702
|
+
// src/components/data-grid/components/data-grid-skeleton.tsx
|
|
3703
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3704
|
+
var DataGridSkeleton = ({
|
|
3705
|
+
columns,
|
|
3706
|
+
rows: rowCount = 10
|
|
3707
|
+
}) => {
|
|
3708
|
+
const rows = Array.from({ length: rowCount }, (_, i) => i);
|
|
3709
|
+
const colCount = columns.length;
|
|
3710
|
+
return /* @__PURE__ */ jsxs11("div", { className: "bg-ui-bg-subtle size-full", children: [
|
|
3711
|
+
/* @__PURE__ */ jsx14("div", { className: "bg-ui-bg-base border-b p-4", children: /* @__PURE__ */ jsx14("div", { className: "bg-ui-button-neutral h-7 w-[116px] animate-pulse rounded-md" }) }),
|
|
3712
|
+
/* @__PURE__ */ jsxs11("div", { className: "bg-ui-bg-subtle size-full overflow-auto", children: [
|
|
3713
|
+
/* @__PURE__ */ jsx14(
|
|
3714
|
+
"div",
|
|
3715
|
+
{
|
|
3716
|
+
className: "grid",
|
|
3717
|
+
style: {
|
|
3718
|
+
gridTemplateColumns: `repeat(${colCount}, 1fr)`
|
|
3719
|
+
},
|
|
3720
|
+
children: columns.map((_col, i) => {
|
|
3721
|
+
return /* @__PURE__ */ jsx14(
|
|
3722
|
+
"div",
|
|
3723
|
+
{
|
|
3724
|
+
className: "bg-ui-bg-base flex h-10 w-[200px] items-center border-b border-r px-4 py-2.5 last:border-r-0",
|
|
3725
|
+
children: /* @__PURE__ */ jsx14(Skeleton, { className: "h-[14px] w-[164px]" })
|
|
3726
|
+
},
|
|
3727
|
+
i
|
|
3728
|
+
);
|
|
3729
|
+
})
|
|
3730
|
+
}
|
|
3731
|
+
),
|
|
3732
|
+
/* @__PURE__ */ jsx14("div", { children: rows.map((_, j) => /* @__PURE__ */ jsx14(
|
|
3733
|
+
"div",
|
|
3734
|
+
{
|
|
3735
|
+
className: "grid",
|
|
3736
|
+
style: { gridTemplateColumns: `repeat(${colCount}, 1fr)` },
|
|
3737
|
+
children: columns.map((_col, k) => {
|
|
3738
|
+
return /* @__PURE__ */ jsx14(
|
|
3739
|
+
"div",
|
|
3740
|
+
{
|
|
3741
|
+
className: "bg-ui-bg-base flex h-10 w-[200px] items-center border-b border-r px-4 py-2.5 last:border-r-0",
|
|
3742
|
+
children: /* @__PURE__ */ jsx14(Skeleton, { className: "h-[14px] w-[164px]" })
|
|
3743
|
+
},
|
|
3744
|
+
k
|
|
3745
|
+
);
|
|
3746
|
+
})
|
|
3747
|
+
},
|
|
3748
|
+
j
|
|
3749
|
+
)) })
|
|
3750
|
+
] })
|
|
3751
|
+
] });
|
|
3752
|
+
};
|
|
3753
|
+
|
|
3988
3754
|
// src/components/data-grid/components/data-grid-text-cell.tsx
|
|
3989
|
-
import { clx as
|
|
3755
|
+
import { clx as clx9 } from "@medusajs/ui";
|
|
3990
3756
|
import { useEffect as useEffect8, useRef as useRef6, useState as useState11 } from "react";
|
|
3991
|
-
import { Controller as
|
|
3992
|
-
import { jsx as
|
|
3757
|
+
import { Controller as Controller9 } from "react-hook-form";
|
|
3758
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3993
3759
|
var DataGridTextCell = ({
|
|
3994
3760
|
context
|
|
3995
3761
|
}) => {
|
|
@@ -3998,18 +3764,18 @@ var DataGridTextCell = ({
|
|
|
3998
3764
|
});
|
|
3999
3765
|
const errorProps = useDataGridCellError({ context });
|
|
4000
3766
|
const { container, input } = renderProps;
|
|
4001
|
-
return /* @__PURE__ */
|
|
4002
|
-
|
|
3767
|
+
return /* @__PURE__ */ jsx15(
|
|
3768
|
+
Controller9,
|
|
4003
3769
|
{
|
|
4004
3770
|
control,
|
|
4005
3771
|
name: field,
|
|
4006
3772
|
render: ({ field: field2 }) => {
|
|
4007
|
-
return /* @__PURE__ */
|
|
3773
|
+
return /* @__PURE__ */ jsx15(DataGridCellContainer, { ...container, ...errorProps, children: /* @__PURE__ */ jsx15(Inner6, { field: field2, inputProps: input }) });
|
|
4008
3774
|
}
|
|
4009
3775
|
}
|
|
4010
3776
|
);
|
|
4011
3777
|
};
|
|
4012
|
-
var
|
|
3778
|
+
var Inner6 = ({
|
|
4013
3779
|
field,
|
|
4014
3780
|
inputProps
|
|
4015
3781
|
}) => {
|
|
@@ -4021,10 +3787,10 @@ var Inner8 = ({
|
|
|
4021
3787
|
setLocalValue(value);
|
|
4022
3788
|
}, [value]);
|
|
4023
3789
|
const combinedRefs = useCombinedRefs(inputRef, ref, inputElRef);
|
|
4024
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ jsx15(
|
|
4025
3791
|
"input",
|
|
4026
3792
|
{
|
|
4027
|
-
className:
|
|
3793
|
+
className: clx9(
|
|
4028
3794
|
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer bg-transparent outline-none",
|
|
4029
3795
|
"focus:cursor-text",
|
|
4030
3796
|
"items-center justify-center"
|
|
@@ -4046,11 +3812,11 @@ var Inner8 = ({
|
|
|
4046
3812
|
};
|
|
4047
3813
|
|
|
4048
3814
|
// src/components/data-grid/components/data-grid-textarea-modal-cell.tsx
|
|
4049
|
-
import { clx as
|
|
3815
|
+
import { clx as clx10, Textarea } from "@medusajs/ui";
|
|
4050
3816
|
import { Popover as RadixPopover } from "radix-ui";
|
|
4051
3817
|
import { useCallback as useCallback16, useEffect as useEffect9, useRef as useRef7, useState as useState12 } from "react";
|
|
4052
|
-
import { Controller as
|
|
4053
|
-
import { jsx as
|
|
3818
|
+
import { Controller as Controller10 } from "react-hook-form";
|
|
3819
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4054
3820
|
var DataGridExpandableTextCell = ({
|
|
4055
3821
|
context,
|
|
4056
3822
|
fieldLabel
|
|
@@ -4060,14 +3826,14 @@ var DataGridExpandableTextCell = ({
|
|
|
4060
3826
|
});
|
|
4061
3827
|
const errorProps = useDataGridCellError({ context });
|
|
4062
3828
|
const { container, input } = renderProps;
|
|
4063
|
-
return /* @__PURE__ */
|
|
4064
|
-
|
|
3829
|
+
return /* @__PURE__ */ jsx16(
|
|
3830
|
+
Controller10,
|
|
4065
3831
|
{
|
|
4066
3832
|
control,
|
|
4067
3833
|
name: field,
|
|
4068
3834
|
render: ({ field: field2 }) => {
|
|
4069
|
-
return /* @__PURE__ */
|
|
4070
|
-
|
|
3835
|
+
return /* @__PURE__ */ jsx16(
|
|
3836
|
+
Inner7,
|
|
4071
3837
|
{
|
|
4072
3838
|
field: field2,
|
|
4073
3839
|
inputProps: input,
|
|
@@ -4080,7 +3846,7 @@ var DataGridExpandableTextCell = ({
|
|
|
4080
3846
|
}
|
|
4081
3847
|
);
|
|
4082
3848
|
};
|
|
4083
|
-
var
|
|
3849
|
+
var Inner7 = ({
|
|
4084
3850
|
field,
|
|
4085
3851
|
inputProps,
|
|
4086
3852
|
fieldLabel: _fieldLabel,
|
|
@@ -4168,7 +3934,7 @@ var Inner9 = ({
|
|
|
4168
3934
|
}, []);
|
|
4169
3935
|
const displayValue = localValue || "";
|
|
4170
3936
|
const truncatedValue = displayValue.length > 50 ? `${displayValue.substring(0, 50)}...` : displayValue;
|
|
4171
|
-
return /* @__PURE__ */
|
|
3937
|
+
return /* @__PURE__ */ jsxs12(
|
|
4172
3938
|
RadixPopover.Root,
|
|
4173
3939
|
{
|
|
4174
3940
|
open: isPopoverOpen,
|
|
@@ -4180,18 +3946,18 @@ var Inner9 = ({
|
|
|
4180
3946
|
}
|
|
4181
3947
|
},
|
|
4182
3948
|
children: [
|
|
4183
|
-
/* @__PURE__ */
|
|
4184
|
-
/* @__PURE__ */
|
|
3949
|
+
/* @__PURE__ */ jsxs12(DataGridCellContainer, { ...customContainer, ...errorProps, children: [
|
|
3950
|
+
/* @__PURE__ */ jsx16(RadixPopover.Anchor, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
4185
3951
|
"div",
|
|
4186
3952
|
{
|
|
4187
|
-
className:
|
|
3953
|
+
className: clx10(
|
|
4188
3954
|
"txt-compact-small text-ui-fg-subtle flex size-full cursor-pointer items-center justify-center bg-transparent outline-none",
|
|
4189
3955
|
"focus:cursor-text"
|
|
4190
3956
|
),
|
|
4191
|
-
children: /* @__PURE__ */
|
|
3957
|
+
children: /* @__PURE__ */ jsx16("span", { className: "w-full truncate text-center", children: truncatedValue })
|
|
4192
3958
|
}
|
|
4193
3959
|
) }),
|
|
4194
|
-
/* @__PURE__ */
|
|
3960
|
+
/* @__PURE__ */ jsx16(
|
|
4195
3961
|
"input",
|
|
4196
3962
|
{
|
|
4197
3963
|
className: "sr-only",
|
|
@@ -4210,10 +3976,10 @@ var Inner9 = ({
|
|
|
4210
3976
|
}
|
|
4211
3977
|
)
|
|
4212
3978
|
] }),
|
|
4213
|
-
/* @__PURE__ */
|
|
3979
|
+
/* @__PURE__ */ jsx16(RadixPopover.Portal, { children: /* @__PURE__ */ jsx16(
|
|
4214
3980
|
RadixPopover.Content,
|
|
4215
3981
|
{
|
|
4216
|
-
className:
|
|
3982
|
+
className: clx10(
|
|
4217
3983
|
"bg-ui-bg-base shadow-elevation-flyout flex max-h-[80vh] w-[600px] overflow-hidden p-0 outline-none"
|
|
4218
3984
|
),
|
|
4219
3985
|
align: "start",
|
|
@@ -4223,7 +3989,7 @@ var Inner9 = ({
|
|
|
4223
3989
|
collisionPadding: 24,
|
|
4224
3990
|
onEscapeKeyDown: handlePopoverSave,
|
|
4225
3991
|
onKeyDown: handlePopoverKeyDown,
|
|
4226
|
-
children: /* @__PURE__ */
|
|
3992
|
+
children: /* @__PURE__ */ jsx16("div", { ref: popoverContentRef, className: "h-full w-full", children: /* @__PURE__ */ jsx16(
|
|
4227
3993
|
Textarea,
|
|
4228
3994
|
{
|
|
4229
3995
|
value: popoverValue,
|
|
@@ -4242,7 +4008,7 @@ var Inner9 = ({
|
|
|
4242
4008
|
};
|
|
4243
4009
|
|
|
4244
4010
|
// src/components/data-grid/data-grid.tsx
|
|
4245
|
-
import { jsx as
|
|
4011
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
4246
4012
|
var _DataGrid = ({
|
|
4247
4013
|
isLoading,
|
|
4248
4014
|
// Lazy loading props - passed through to DataGridRoot
|
|
@@ -4252,13 +4018,13 @@ var _DataGrid = ({
|
|
|
4252
4018
|
hasNextPage,
|
|
4253
4019
|
...props
|
|
4254
4020
|
}) => {
|
|
4255
|
-
return isLoading ? /* @__PURE__ */
|
|
4021
|
+
return isLoading ? /* @__PURE__ */ jsx17(
|
|
4256
4022
|
DataGridSkeleton,
|
|
4257
4023
|
{
|
|
4258
4024
|
columns: props.columns,
|
|
4259
4025
|
rows: props.data?.length && props.data.length > 0 ? props.data.length : 10
|
|
4260
4026
|
}
|
|
4261
|
-
) : /* @__PURE__ */
|
|
4027
|
+
) : /* @__PURE__ */ jsx17(
|
|
4262
4028
|
DataGridRoot,
|
|
4263
4029
|
{
|
|
4264
4030
|
...props,
|
|
@@ -4276,7 +4042,8 @@ var DataGrid = Object.assign(_DataGrid, {
|
|
|
4276
4042
|
ExpandableTextCell: DataGridExpandableTextCell,
|
|
4277
4043
|
NumberCell: DataGridNumberCell,
|
|
4278
4044
|
CurrencyCell: DataGridCurrencyCell,
|
|
4279
|
-
ReadonlyCell: DataGridReadonlyCell
|
|
4045
|
+
ReadonlyCell: DataGridReadonlyCell,
|
|
4046
|
+
SelectCell: DataGridSelectCell
|
|
4280
4047
|
});
|
|
4281
4048
|
|
|
4282
4049
|
// src/components/data-grid/helpers/create-data-grid-column-helper.ts
|
|
@@ -4314,13 +4081,121 @@ function createDataGridHelper() {
|
|
|
4314
4081
|
};
|
|
4315
4082
|
}
|
|
4316
4083
|
|
|
4084
|
+
// src/components/common/tax-badge/tax-badge.tsx
|
|
4085
|
+
import { TaxExclusive, TaxInclusive } from "@medusajs/icons";
|
|
4086
|
+
import { Tooltip as Tooltip3 } from "@medusajs/ui";
|
|
4087
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
4088
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
4089
|
+
var IncludesTaxTooltip = ({
|
|
4090
|
+
includesTax
|
|
4091
|
+
}) => {
|
|
4092
|
+
const { t } = useTranslation5();
|
|
4093
|
+
return /* @__PURE__ */ jsx18(
|
|
4094
|
+
Tooltip3,
|
|
4095
|
+
{
|
|
4096
|
+
maxWidth: 999,
|
|
4097
|
+
content: includesTax ? t("general.includesTaxTooltip") : t("general.excludesTaxTooltip"),
|
|
4098
|
+
children: includesTax ? /* @__PURE__ */ jsx18(TaxInclusive, { className: "text-ui-fg-muted shrink-0" }) : /* @__PURE__ */ jsx18(TaxExclusive, { className: "text-ui-fg-muted shrink-0" })
|
|
4099
|
+
}
|
|
4100
|
+
);
|
|
4101
|
+
};
|
|
4102
|
+
|
|
4103
|
+
// src/components/data-grid/helpers/create-data-grid-price-columns.tsx
|
|
4104
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4105
|
+
var createDataGridPriceColumns = ({
|
|
4106
|
+
currencies: currencies2,
|
|
4107
|
+
regions,
|
|
4108
|
+
pricePreferences,
|
|
4109
|
+
isReadyOnly,
|
|
4110
|
+
getFieldName,
|
|
4111
|
+
t
|
|
4112
|
+
}) => {
|
|
4113
|
+
const columnHelper = createDataGridHelper();
|
|
4114
|
+
return [
|
|
4115
|
+
...currencies2?.map((currency) => {
|
|
4116
|
+
const preference = pricePreferences?.find(
|
|
4117
|
+
(p) => p.attribute === "currency_code" && p.value === currency
|
|
4118
|
+
);
|
|
4119
|
+
const translatedCurrencyName = t("fields.priceTemplate", {
|
|
4120
|
+
regionOrCurrency: currency.toUpperCase()
|
|
4121
|
+
});
|
|
4122
|
+
return columnHelper.column({
|
|
4123
|
+
id: `currency_prices.${currency}`,
|
|
4124
|
+
name: t("fields.priceTemplate", {
|
|
4125
|
+
regionOrCurrency: currency.toUpperCase()
|
|
4126
|
+
}),
|
|
4127
|
+
field: (context) => {
|
|
4128
|
+
const isReadyOnlyValue = isReadyOnly?.(context);
|
|
4129
|
+
if (isReadyOnlyValue) {
|
|
4130
|
+
return null;
|
|
4131
|
+
}
|
|
4132
|
+
return getFieldName(context, currency);
|
|
4133
|
+
},
|
|
4134
|
+
type: "number",
|
|
4135
|
+
header: () => /* @__PURE__ */ jsxs13("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
4136
|
+
/* @__PURE__ */ jsx19("span", { className: "truncate", title: translatedCurrencyName, children: translatedCurrencyName }),
|
|
4137
|
+
/* @__PURE__ */ jsx19(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
|
|
4138
|
+
] }),
|
|
4139
|
+
cell: (context) => {
|
|
4140
|
+
if (isReadyOnly?.(context)) {
|
|
4141
|
+
return /* @__PURE__ */ jsx19(DataGridReadonlyCell, { context });
|
|
4142
|
+
}
|
|
4143
|
+
return /* @__PURE__ */ jsx19(DataGridCurrencyCell, { code: currency, context });
|
|
4144
|
+
}
|
|
4145
|
+
});
|
|
4146
|
+
}) ?? [],
|
|
4147
|
+
...regions?.map((region) => {
|
|
4148
|
+
const preference = pricePreferences?.find(
|
|
4149
|
+
(p) => p.attribute === "region_id" && p.value === region.id
|
|
4150
|
+
);
|
|
4151
|
+
const translatedRegionName = t("fields.priceTemplate", {
|
|
4152
|
+
regionOrCurrency: region.name
|
|
4153
|
+
});
|
|
4154
|
+
return columnHelper.column({
|
|
4155
|
+
id: `region_prices.${region.id}`,
|
|
4156
|
+
name: t("fields.priceTemplate", {
|
|
4157
|
+
regionOrCurrency: region.name
|
|
4158
|
+
}),
|
|
4159
|
+
field: (context) => {
|
|
4160
|
+
const isReadyOnlyValue = isReadyOnly?.(context);
|
|
4161
|
+
if (isReadyOnlyValue) {
|
|
4162
|
+
return null;
|
|
4163
|
+
}
|
|
4164
|
+
return getFieldName(context, region.id);
|
|
4165
|
+
},
|
|
4166
|
+
type: "number",
|
|
4167
|
+
header: () => /* @__PURE__ */ jsxs13("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
4168
|
+
/* @__PURE__ */ jsx19("span", { className: "truncate", title: translatedRegionName, children: translatedRegionName }),
|
|
4169
|
+
/* @__PURE__ */ jsx19(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
|
|
4170
|
+
] }),
|
|
4171
|
+
cell: (context) => {
|
|
4172
|
+
if (isReadyOnly?.(context)) {
|
|
4173
|
+
return /* @__PURE__ */ jsx19(DataGridReadonlyCell, { context });
|
|
4174
|
+
}
|
|
4175
|
+
const currency = currencies2?.find((c) => c === region.currency_code);
|
|
4176
|
+
if (!currency) {
|
|
4177
|
+
return null;
|
|
4178
|
+
}
|
|
4179
|
+
return /* @__PURE__ */ jsx19(
|
|
4180
|
+
DataGridCurrencyCell,
|
|
4181
|
+
{
|
|
4182
|
+
code: region.currency_code,
|
|
4183
|
+
context
|
|
4184
|
+
}
|
|
4185
|
+
);
|
|
4186
|
+
}
|
|
4187
|
+
});
|
|
4188
|
+
}) ?? []
|
|
4189
|
+
];
|
|
4190
|
+
};
|
|
4191
|
+
|
|
4317
4192
|
// src/components/data-grid/components/data-grid-toggleable-number-cell.tsx
|
|
4318
4193
|
import { Switch as Switch2 } from "@medusajs/ui";
|
|
4319
4194
|
import { useEffect as useEffect10, useRef as useRef8, useState as useState13 } from "react";
|
|
4320
4195
|
import CurrencyInput2 from "react-currency-input-field";
|
|
4321
|
-
import { Controller as
|
|
4322
|
-
import { useTranslation as
|
|
4323
|
-
import { jsx as
|
|
4196
|
+
import { Controller as Controller11 } from "react-hook-form";
|
|
4197
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
4198
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4324
4199
|
var DataGridTogglableNumberCell = ({
|
|
4325
4200
|
context,
|
|
4326
4201
|
disabledToggleTooltip,
|
|
@@ -4332,19 +4207,19 @@ var DataGridTogglableNumberCell = ({
|
|
|
4332
4207
|
});
|
|
4333
4208
|
const errorProps = useDataGridCellError({ context });
|
|
4334
4209
|
const { container, input } = renderProps;
|
|
4335
|
-
return /* @__PURE__ */
|
|
4336
|
-
|
|
4210
|
+
return /* @__PURE__ */ jsx20(
|
|
4211
|
+
Controller11,
|
|
4337
4212
|
{
|
|
4338
4213
|
control,
|
|
4339
4214
|
name: field,
|
|
4340
4215
|
render: ({ field: field2 }) => {
|
|
4341
|
-
return /* @__PURE__ */
|
|
4216
|
+
return /* @__PURE__ */ jsx20(
|
|
4342
4217
|
DataGridCellContainer,
|
|
4343
4218
|
{
|
|
4344
4219
|
...container,
|
|
4345
4220
|
...errorProps,
|
|
4346
|
-
outerComponent: /* @__PURE__ */
|
|
4347
|
-
|
|
4221
|
+
outerComponent: /* @__PURE__ */ jsx20(
|
|
4222
|
+
OuterComponent,
|
|
4348
4223
|
{
|
|
4349
4224
|
field: field2,
|
|
4350
4225
|
inputProps: input,
|
|
@@ -4352,14 +4227,14 @@ var DataGridTogglableNumberCell = ({
|
|
|
4352
4227
|
tooltip: disabledToggleTooltip
|
|
4353
4228
|
}
|
|
4354
4229
|
),
|
|
4355
|
-
children: /* @__PURE__ */
|
|
4230
|
+
children: /* @__PURE__ */ jsx20(Inner8, { field: field2, inputProps: input, hideInput, ...rest })
|
|
4356
4231
|
}
|
|
4357
4232
|
);
|
|
4358
4233
|
}
|
|
4359
4234
|
}
|
|
4360
4235
|
);
|
|
4361
4236
|
};
|
|
4362
|
-
var
|
|
4237
|
+
var OuterComponent = ({
|
|
4363
4238
|
field,
|
|
4364
4239
|
inputProps,
|
|
4365
4240
|
isAnchor,
|
|
@@ -4377,6 +4252,9 @@ var OuterComponent2 = ({
|
|
|
4377
4252
|
if (update && (newValue.quantity === "" || newValue.quantity === null || newValue.quantity === void 0)) {
|
|
4378
4253
|
newValue.quantity = 0;
|
|
4379
4254
|
}
|
|
4255
|
+
if (!update && !newValue.disabledToggle) {
|
|
4256
|
+
newValue.quantity = "";
|
|
4257
|
+
}
|
|
4380
4258
|
setLocalValue(newValue);
|
|
4381
4259
|
onChange(newValue, value);
|
|
4382
4260
|
};
|
|
@@ -4390,12 +4268,12 @@ var OuterComponent2 = ({
|
|
|
4390
4268
|
document.addEventListener("keydown", handleKeyDown);
|
|
4391
4269
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
4392
4270
|
}, [isAnchor]);
|
|
4393
|
-
return /* @__PURE__ */
|
|
4271
|
+
return /* @__PURE__ */ jsx20(
|
|
4394
4272
|
ConditionalTooltip,
|
|
4395
4273
|
{
|
|
4396
4274
|
showTooltip: localValue.disabledToggle && tooltip,
|
|
4397
4275
|
content: tooltip,
|
|
4398
|
-
children: /* @__PURE__ */
|
|
4276
|
+
children: /* @__PURE__ */ jsx20("div", { className: "absolute inset-y-0 left-4 z-[3] flex w-fit items-center justify-center", children: /* @__PURE__ */ jsx20(
|
|
4399
4277
|
Switch2,
|
|
4400
4278
|
{
|
|
4401
4279
|
dir: "ltr",
|
|
@@ -4410,14 +4288,14 @@ var OuterComponent2 = ({
|
|
|
4410
4288
|
}
|
|
4411
4289
|
);
|
|
4412
4290
|
};
|
|
4413
|
-
var
|
|
4291
|
+
var Inner8 = ({
|
|
4414
4292
|
field,
|
|
4415
4293
|
inputProps,
|
|
4416
4294
|
placeholder: _placeholder,
|
|
4417
4295
|
hideInput,
|
|
4418
4296
|
...props
|
|
4419
4297
|
}) => {
|
|
4420
|
-
const { t } =
|
|
4298
|
+
const { t } = useTranslation6();
|
|
4421
4299
|
const { ref, value, onChange: _, onBlur, ...fieldProps } = field;
|
|
4422
4300
|
const {
|
|
4423
4301
|
ref: inputRef,
|
|
@@ -4434,10 +4312,8 @@ var Inner10 = ({
|
|
|
4434
4312
|
const handleInputChange = (updatedValue, _name, _values) => {
|
|
4435
4313
|
const ensuredValue = updatedValue !== void 0 ? updatedValue : "";
|
|
4436
4314
|
const newValue = { ...localValue, quantity: ensuredValue };
|
|
4437
|
-
if (ensuredValue !== "") {
|
|
4315
|
+
if (ensuredValue !== "" && !newValue.checked) {
|
|
4438
4316
|
newValue.checked = true;
|
|
4439
|
-
} else if (newValue.checked && newValue.disabledToggle === false) {
|
|
4440
|
-
newValue.checked = false;
|
|
4441
4317
|
}
|
|
4442
4318
|
setLocalValue(newValue);
|
|
4443
4319
|
};
|
|
@@ -4448,27 +4324,8 @@ var Inner10 = ({
|
|
|
4448
4324
|
onChange(localValue, value);
|
|
4449
4325
|
};
|
|
4450
4326
|
if (hideInput) {
|
|
4451
|
-
return /* @__PURE__ */
|
|
4452
|
-
/* @__PURE__ */
|
|
4453
|
-
"input",
|
|
4454
|
-
{
|
|
4455
|
-
ref: combinedRefs,
|
|
4456
|
-
className: "sr-only",
|
|
4457
|
-
onFocus,
|
|
4458
|
-
onBlur: () => {
|
|
4459
|
-
onBlur();
|
|
4460
|
-
onInputBlur();
|
|
4461
|
-
},
|
|
4462
|
-
tabIndex: -1,
|
|
4463
|
-
readOnly: true
|
|
4464
|
-
}
|
|
4465
|
-
),
|
|
4466
|
-
/* @__PURE__ */ jsx17("span", { className: "txt-compact-small text-ui-fg-subtle", children: localValue?.checked ? t("dataGrid.toggle.enabled") : t("dataGrid.toggle.notEnabled") })
|
|
4467
|
-
] });
|
|
4468
|
-
}
|
|
4469
|
-
if (!localValue?.checked) {
|
|
4470
|
-
return /* @__PURE__ */ jsxs12("div", { className: "flex size-full items-center gap-x-2 pl-8", children: [
|
|
4471
|
-
/* @__PURE__ */ jsx17(
|
|
4327
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex size-full items-center gap-x-2 pl-8", children: [
|
|
4328
|
+
/* @__PURE__ */ jsx20(
|
|
4472
4329
|
"input",
|
|
4473
4330
|
{
|
|
4474
4331
|
ref: combinedRefs,
|
|
@@ -4482,10 +4339,10 @@ var Inner10 = ({
|
|
|
4482
4339
|
readOnly: true
|
|
4483
4340
|
}
|
|
4484
4341
|
),
|
|
4485
|
-
/* @__PURE__ */
|
|
4342
|
+
/* @__PURE__ */ jsx20("span", { className: "txt-compact-small text-ui-fg-subtle", children: localValue?.checked ? t("dataGrid.toggle.enabled") : t("dataGrid.toggle.notEnabled") })
|
|
4486
4343
|
] });
|
|
4487
4344
|
}
|
|
4488
|
-
return /* @__PURE__ */
|
|
4345
|
+
return /* @__PURE__ */ jsx20("div", { className: "flex size-full items-center gap-x-2", children: /* @__PURE__ */ jsx20(
|
|
4489
4346
|
CurrencyInput2,
|
|
4490
4347
|
{
|
|
4491
4348
|
...fieldProps,
|
|
@@ -4504,13 +4361,14 @@ var Inner10 = ({
|
|
|
4504
4361
|
onFocus,
|
|
4505
4362
|
decimalsLimit: 0,
|
|
4506
4363
|
autoComplete: "off",
|
|
4507
|
-
tabIndex: -1
|
|
4364
|
+
tabIndex: -1,
|
|
4365
|
+
placeholder: !localValue?.checked ? t("dataGrid.toggle.notEnabled") : void 0
|
|
4508
4366
|
}
|
|
4509
4367
|
) });
|
|
4510
4368
|
};
|
|
4511
4369
|
|
|
4512
4370
|
// src/components/data-grid/helpers/create-data-grid-location-stock-columns.tsx
|
|
4513
|
-
import { jsx as
|
|
4371
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
4514
4372
|
var createDataGridLocationStockColumns = ({
|
|
4515
4373
|
stockLocations,
|
|
4516
4374
|
isReadyOnly,
|
|
@@ -4531,12 +4389,12 @@ var createDataGridLocationStockColumns = ({
|
|
|
4531
4389
|
return getFieldName(context, index);
|
|
4532
4390
|
},
|
|
4533
4391
|
type: "togglable-number",
|
|
4534
|
-
header: () => /* @__PURE__ */
|
|
4392
|
+
header: () => /* @__PURE__ */ jsx21("div", { className: "flex w-full items-center justify-between gap-3", children: /* @__PURE__ */ jsx21("span", { className: "truncate", title: stockLocation.name, children: stockLocation.name }) }),
|
|
4535
4393
|
cell: (context) => {
|
|
4536
4394
|
if (isReadyOnly?.(context)) {
|
|
4537
|
-
return /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsx21(DataGridReadonlyCell, { context });
|
|
4538
4396
|
}
|
|
4539
|
-
return /* @__PURE__ */
|
|
4397
|
+
return /* @__PURE__ */ jsx21(
|
|
4540
4398
|
DataGridTogglableNumberCell,
|
|
4541
4399
|
{
|
|
4542
4400
|
context,
|
|
@@ -4549,126 +4407,12 @@ var createDataGridLocationStockColumns = ({
|
|
|
4549
4407
|
];
|
|
4550
4408
|
};
|
|
4551
4409
|
|
|
4552
|
-
// src/components/common/tax-badge/tax-badge.tsx
|
|
4553
|
-
import { TaxExclusive, TaxInclusive } from "@medusajs/icons";
|
|
4554
|
-
import { Tooltip as Tooltip3 } from "@medusajs/ui";
|
|
4555
|
-
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
4556
|
-
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
4557
|
-
var IncludesTaxTooltip = ({
|
|
4558
|
-
includesTax
|
|
4559
|
-
}) => {
|
|
4560
|
-
const { t } = useTranslation6();
|
|
4561
|
-
return /* @__PURE__ */ jsx19(
|
|
4562
|
-
Tooltip3,
|
|
4563
|
-
{
|
|
4564
|
-
maxWidth: 999,
|
|
4565
|
-
content: includesTax ? t("general.includesTaxTooltip") : t("general.excludesTaxTooltip"),
|
|
4566
|
-
children: includesTax ? /* @__PURE__ */ jsx19(TaxInclusive, { className: "text-ui-fg-muted shrink-0" }) : /* @__PURE__ */ jsx19(TaxExclusive, { className: "text-ui-fg-muted shrink-0" })
|
|
4567
|
-
}
|
|
4568
|
-
);
|
|
4569
|
-
};
|
|
4570
|
-
|
|
4571
|
-
// src/components/data-grid/helpers/create-data-grid-price-columns.tsx
|
|
4572
|
-
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4573
|
-
var createDataGridPriceColumns = ({
|
|
4574
|
-
currencies: currencies2,
|
|
4575
|
-
regions,
|
|
4576
|
-
pricePreferences,
|
|
4577
|
-
isReadyOnly,
|
|
4578
|
-
getFieldName,
|
|
4579
|
-
t
|
|
4580
|
-
}) => {
|
|
4581
|
-
const columnHelper = createDataGridHelper();
|
|
4582
|
-
return [
|
|
4583
|
-
...currencies2?.map((currency) => {
|
|
4584
|
-
const preference = pricePreferences?.find(
|
|
4585
|
-
(p) => p.attribute === "currency_code" && p.value === currency
|
|
4586
|
-
);
|
|
4587
|
-
const translatedCurrencyName = t("fields.priceTemplate", {
|
|
4588
|
-
regionOrCurrency: currency.toUpperCase()
|
|
4589
|
-
});
|
|
4590
|
-
return columnHelper.column({
|
|
4591
|
-
id: `currency_prices.${currency}`,
|
|
4592
|
-
name: t("fields.priceTemplate", {
|
|
4593
|
-
regionOrCurrency: currency.toUpperCase()
|
|
4594
|
-
}),
|
|
4595
|
-
field: (context) => {
|
|
4596
|
-
const isReadyOnlyValue = isReadyOnly?.(context);
|
|
4597
|
-
if (isReadyOnlyValue) {
|
|
4598
|
-
return null;
|
|
4599
|
-
}
|
|
4600
|
-
return getFieldName(context, currency);
|
|
4601
|
-
},
|
|
4602
|
-
type: "number",
|
|
4603
|
-
header: () => /* @__PURE__ */ jsxs13("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
4604
|
-
/* @__PURE__ */ jsx20("span", { className: "truncate", title: translatedCurrencyName, children: translatedCurrencyName }),
|
|
4605
|
-
/* @__PURE__ */ jsx20(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
|
|
4606
|
-
] }),
|
|
4607
|
-
cell: (context) => {
|
|
4608
|
-
if (isReadyOnly?.(context)) {
|
|
4609
|
-
return /* @__PURE__ */ jsx20(DataGridReadonlyCell, { context });
|
|
4610
|
-
}
|
|
4611
|
-
return /* @__PURE__ */ jsx20(DataGridCurrencyCell, { code: currency, context });
|
|
4612
|
-
}
|
|
4613
|
-
});
|
|
4614
|
-
}) ?? [],
|
|
4615
|
-
...regions?.map((region) => {
|
|
4616
|
-
const preference = pricePreferences?.find(
|
|
4617
|
-
(p) => p.attribute === "region_id" && p.value === region.id
|
|
4618
|
-
);
|
|
4619
|
-
const translatedRegionName = t("fields.priceTemplate", {
|
|
4620
|
-
regionOrCurrency: region.name
|
|
4621
|
-
});
|
|
4622
|
-
return columnHelper.column({
|
|
4623
|
-
id: `region_prices.${region.id}`,
|
|
4624
|
-
name: t("fields.priceTemplate", {
|
|
4625
|
-
regionOrCurrency: region.name
|
|
4626
|
-
}),
|
|
4627
|
-
field: (context) => {
|
|
4628
|
-
const isReadyOnlyValue = isReadyOnly?.(context);
|
|
4629
|
-
if (isReadyOnlyValue) {
|
|
4630
|
-
return null;
|
|
4631
|
-
}
|
|
4632
|
-
return getFieldName(context, region.id);
|
|
4633
|
-
},
|
|
4634
|
-
type: "number",
|
|
4635
|
-
header: () => /* @__PURE__ */ jsxs13("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
4636
|
-
/* @__PURE__ */ jsx20("span", { className: "truncate", title: translatedRegionName, children: translatedRegionName }),
|
|
4637
|
-
/* @__PURE__ */ jsx20(IncludesTaxTooltip, { includesTax: preference?.is_tax_inclusive })
|
|
4638
|
-
] }),
|
|
4639
|
-
cell: (context) => {
|
|
4640
|
-
if (isReadyOnly?.(context)) {
|
|
4641
|
-
return /* @__PURE__ */ jsx20(DataGridReadonlyCell, { context });
|
|
4642
|
-
}
|
|
4643
|
-
const currency = currencies2?.find((c) => c === region.currency_code);
|
|
4644
|
-
if (!currency) {
|
|
4645
|
-
return null;
|
|
4646
|
-
}
|
|
4647
|
-
return /* @__PURE__ */ jsx20(
|
|
4648
|
-
DataGridCurrencyCell,
|
|
4649
|
-
{
|
|
4650
|
-
code: region.currency_code,
|
|
4651
|
-
context
|
|
4652
|
-
}
|
|
4653
|
-
);
|
|
4654
|
-
}
|
|
4655
|
-
});
|
|
4656
|
-
}) ?? []
|
|
4657
|
-
];
|
|
4658
|
-
};
|
|
4659
|
-
|
|
4660
4410
|
export {
|
|
4661
4411
|
useCombinedRefs,
|
|
4662
4412
|
useDataGridCell,
|
|
4663
4413
|
useDataGridCellError,
|
|
4664
|
-
useDataGridDuplicateCell,
|
|
4665
4414
|
DataGridCellContainer,
|
|
4666
|
-
DataGridBooleanWithTextCell,
|
|
4667
|
-
DataGridMediaCell,
|
|
4668
|
-
DataGridStatusCell,
|
|
4669
4415
|
DataGridReadonlyCell,
|
|
4670
|
-
DataGridSkeleton,
|
|
4671
|
-
DataGridTextCell,
|
|
4672
4416
|
DataGrid,
|
|
4673
4417
|
createDataGridHelper,
|
|
4674
4418
|
DataGridTogglableNumberCell,
|