@mercurjs/vendor 2.2.1 → 2.3.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]-3TCOLUQH.js +197 -0
- package/dist/{[id]-YB3DBBXT.js → [id]-4QVLDR3S.js} +13 -10
- package/dist/{[id]-RJRAZN3T.js → [id]-4VX7CTRZ.js} +8 -6
- package/dist/{[id]-OE5TUWNF.js → [id]-5FP6JZM3.js} +9 -7
- package/dist/[id]-6FEVCKQU.js +949 -0
- package/dist/{[id]-47SUX5X3.js → [id]-7QVJAIDU.js} +13 -10
- package/dist/{[id]-BHU5BSQT.js → [id]-CFVBH66J.js} +20 -17
- package/dist/{[id]-SKU5SFBG.js → [id]-HAJ3735Z.js} +137 -204
- package/dist/{[id]-NGRV5I2A.js → [id]-PBNGQSNY.js} +9 -7
- package/dist/[id]-QGZ26C6D.js +286 -0
- package/dist/{[id]-ZD5HBP2R.js → [id]-RAJUZUNH.js} +13 -10
- package/dist/[id]-RJ3MUR4M.js +697 -0
- package/dist/{[id]-PIB2DEVI.js → [id]-RRVYKA7U.js} +12 -9
- package/dist/{[id]-BPQNQFVE.js → [id]-Y4HRAAV2.js} +75 -124
- package/dist/{[province_id]-CUWKNPBW.js → [province_id]-VWN4OOGM.js} +9 -7
- package/dist/{add-MYV5IOGP.js → add-57LM6WKL.js} +157 -227
- package/dist/{add-YEUSE5QA.js → add-7HIVF77P.js} +10 -8
- package/dist/{add-customer-groups-Q3F357F2.js → add-customer-groups-VJYI5J5Z.js} +8 -6
- package/dist/{add-products-WVNYODC6.js → add-products-XWU5ZUTZ.js} +13 -10
- package/dist/{add-promotions-F62YE3BE.js → add-promotions-DOJS6CEE.js} +27 -9
- package/dist/{add-to-campaign-WBSCTSKW.js → add-to-campaign-B3PGGNFA.js} +3 -2
- package/dist/{address-ZMZ4ST5T.js → address-X4TXBPUG.js} +7 -5
- package/dist/{adjust-inventory-QUGKDXOC.js → adjust-inventory-2OKDFVLK.js} +2 -3
- package/dist/{allocate-items-7NSBGXSF.js → allocate-items-QAYROQMK.js} +4 -2
- package/dist/{areas-EJCZBY2E.js → areas-WQ44GWQO.js} +2 -2
- package/dist/{breadcrumb-M657ZCG6.js → breadcrumb-4I7MU2QY.js} +1 -1
- package/dist/{breadcrumb-KNBZ3JNR.js → breadcrumb-7ZFC43R4.js} +1 -1
- package/dist/{breadcrumb-C7M5PG2Q.js → breadcrumb-HMW2K4DW.js} +7 -5
- package/dist/{breadcrumb-KLNC72RI.js → breadcrumb-MH2L34OD.js} +2 -2
- package/dist/{breadcrumb-QPV566YX.js → breadcrumb-Q7FS3IDL.js} +8 -6
- package/dist/{breadcrumb-JWFTKHLE.js → breadcrumb-RQ52GELM.js} +2 -1
- package/dist/{breadcrumb-M6NW3DRQ.js → breadcrumb-WBUUK3AP.js} +1 -1
- package/dist/breadcrumb-XCPUUZUO.js +26 -0
- package/dist/{breadcrumb-MXYWEBK6.js → breadcrumb-Z2QUGZM3.js} +7 -5
- package/dist/{campaigns-BPLAE6QQ.js → campaigns-LIPKZKI7.js} +5 -4
- package/dist/{categories-H2XAJCGC.js → categories-D2U6VLH5.js} +2 -2
- package/dist/{chunk-4RVWITM2.js → chunk-3JWHERV7.js} +76 -23
- package/dist/{chunk-BCXREBMV.js → chunk-4ATO577Q.js} +1 -1
- package/dist/{chunk-VHFKJLDH.js → chunk-4JVORTN4.js} +1 -1
- package/dist/{chunk-HHD2VUED.js → chunk-4UKAKFKL.js} +1 -1
- package/dist/{chunk-3L7WHWKB.js → chunk-5DRYAIOY.js} +3 -3
- package/dist/{chunk-7TIZP4YG.js → chunk-5RWK4U4V.js} +26 -0
- package/dist/{chunk-XQUF3WIS.js → chunk-5ZHZVKNQ.js} +4 -0
- package/dist/{chunk-IWAL74YU.js → chunk-6GQLSWOO.js} +1 -1
- package/dist/{chunk-HCUIYIIY.js → chunk-6OZQTHCR.js} +1 -1
- package/dist/chunk-6XMUN2BZ.js +0 -0
- package/dist/{chunk-RLRWDHME.js → chunk-6YQR2AWM.js} +3 -20
- package/dist/{chunk-26OOAKQ6.js → chunk-7H6NMQ6U.js} +8 -1
- package/dist/{chunk-OKJHUQBY.js → chunk-7JVJIAWS.js} +17 -29
- package/dist/chunk-7LIENHWP.js +26 -0
- package/dist/{chunk-EPSRO7C5.js → chunk-7LIT4GXO.js} +2 -2
- package/dist/chunk-7POOMBIN.js +108 -0
- package/dist/{chunk-PF7R7LMW.js → chunk-AHR2FIMC.js} +22 -0
- package/dist/{chunk-EJBOBB4B.js → chunk-AQT2G6K2.js} +46 -46
- package/dist/{chunk-UEKRQS5Q.js → chunk-ATYOOL7K.js} +2 -2
- package/dist/chunk-BR6PEFXX.js +27 -0
- package/dist/{chunk-SDFZUBS3.js → chunk-CDZALZ5E.js} +1 -1
- package/dist/{chunk-3XW55FZY.js → chunk-CRVVPIFZ.js} +6 -6
- package/dist/{chunk-72HQFLZI.js → chunk-CSEB2RNO.js} +1 -1
- package/dist/{chunk-X6ZQMFCT.js → chunk-DAOSTHVB.js} +44 -25
- package/dist/{chunk-UUBGLS7U.js → chunk-EWJTXSKI.js} +211 -36
- package/dist/chunk-FKKI62AC.js +282 -0
- package/dist/{chunk-VBKW4GWP.js → chunk-FPBXQIFJ.js} +1 -1
- package/dist/{chunk-SI55QRZ4.js → chunk-G5NNOOHR.js} +59 -6
- package/dist/chunk-G6J5ZKM3.js +31 -0
- package/dist/{chunk-U5V6HNVW.js → chunk-GL3XVUAY.js} +1 -1
- package/dist/{chunk-RJE4MAYB.js → chunk-GYLRZXWS.js} +1 -1
- package/dist/{chunk-SVYBMLVN.js → chunk-HHCLMWXT.js} +1 -1
- package/dist/{chunk-YUQA6TUA.js → chunk-JOCO7JOB.js} +3 -3
- package/dist/{chunk-OGUTFP6B.js → chunk-JYUHDM23.js} +13 -51
- package/dist/{chunk-QB7BI4B7.js → chunk-K2DXXPNA.js} +153 -86
- package/dist/{chunk-XG76XXM2.js → chunk-KKMA6VPG.js} +1 -1
- package/dist/chunk-KVAD5JGS.js +11 -0
- package/dist/{chunk-YRZ53SAN.js → chunk-L26J5MO2.js} +2 -2
- package/dist/{chunk-63XYNXUL.js → chunk-LYP7XK5O.js} +1 -1
- package/dist/chunk-MVVFD2JT.js +51 -0
- package/dist/{chunk-RVFPWOR2.js → chunk-MY5H7C3A.js} +2 -2
- package/dist/{chunk-3GSR455R.js → chunk-NQMHP2LC.js} +1 -1
- package/dist/{chunk-2S2WK2OG.js → chunk-NV2RZAHW.js} +1 -10
- package/dist/{chunk-4IIATKG7.js → chunk-O7OWHKWA.js} +6 -6
- package/dist/{chunk-GIKVFOQL.js → chunk-OJCMHDZI.js} +2 -2
- package/dist/chunk-QLOJNFUE.js +53 -0
- package/dist/{chunk-GTNCNKTC.js → chunk-RBWIHKUF.js} +1 -1
- package/dist/{chunk-XVBONKRV.js → chunk-RCMKDW6O.js} +1 -1
- package/dist/{chunk-WJF24CGA.js → chunk-RDLVH6CM.js} +33 -5
- package/dist/chunk-SF5N2HX4.js +268 -0
- package/dist/{chunk-MQR26KYT.js → chunk-SYHA2RVL.js} +1 -1
- package/dist/{chunk-ZXDMPIXN.js → chunk-U3OEGBHH.js} +2 -2
- package/dist/chunk-UTGI6R2X.js +334 -0
- package/dist/{chunk-VBRTC2VU.js → chunk-VAFGNDAP.js} +4 -3
- package/dist/{chunk-4UQMRTSC.js → chunk-VH3TGSWE.js} +46 -2
- package/dist/{chunk-ZEKV7LGF.js → chunk-VV2K3EBF.js} +1 -1
- package/dist/{chunk-S2VYK3YC.js → chunk-WI2ZAFZF.js} +1 -1
- package/dist/chunk-WP3B4NEU.js +32 -0
- package/dist/{chunk-DY3XQPHC.js → chunk-WW2XYOHJ.js} +5 -3
- package/dist/{chunk-IVYIMGQC.js → chunk-X44P463Q.js} +45 -10
- package/dist/{chunk-FEVCBT24.js → chunk-X4G64W5Q.js} +2 -2
- package/dist/{chunk-R5KN6IFB.js → chunk-XHWBTV72.js} +2 -2
- package/dist/{chunk-OVHIUZ3K.js → chunk-XQ47NZJC.js} +1 -1
- package/dist/{chunk-LN7XHEPJ.js → chunk-YT4RAUWM.js} +2 -2
- package/dist/{chunk-6VKJM537.js → chunk-ZK4DIDXG.js} +1 -1
- package/dist/{collections-52DJLHWW.js → collections-5TH7H2QP.js} +14 -13
- package/dist/{configuration-UMRBE5RQ.js → configuration-QK2FW2CV.js} +2 -2
- package/dist/{configuration-QEDVL2WF.js → configuration-RYH3VUBV.js} +15 -48
- package/dist/{create-ALUKAFJS.js → create-5M66YUYY.js} +2 -2
- package/dist/{create-ABRPUMHQ.js → create-A6KZEZMH.js} +7 -6
- package/dist/{create-LYNWCP2N.js → create-BTODQ4T4.js} +6 -5
- package/dist/{create-2I3GAX4C.js → create-FI6H4AJE.js} +16 -7
- package/dist/{create-6IRD2CVC.js → create-GF76Z5I7.js} +15 -13
- package/dist/create-ICCAEOSA.js +343 -0
- package/dist/{create-NTZH45DW.js → create-JZLU44WB.js} +14 -12
- package/dist/{create-GEYXN6SW.js → create-ME43PNL6.js} +7 -5
- package/dist/{create-MFGMTZ5A.js → create-MIYJCLAJ.js} +8 -6
- package/dist/{create-7SJ5DSQK.js → create-PRDQJ5WI.js} +20 -17
- package/dist/{create-S7VYYTUD.js → create-Q6B6JR4K.js} +10 -8
- package/dist/{create-5RQ32XPT.js → create-SKQAJNDF.js} +287 -287
- package/dist/{create-7FT7N2NH.js → create-WPN3OUJU.js} +3 -2
- package/dist/{create-H77ZUZG5.js → create-XBGN6XEF.js} +10 -8
- package/dist/{create-G76MVCJU.js → create-ZVGYET6W.js} +5 -4
- package/dist/customer-availability-VAOKKCTK.js +164 -0
- package/dist/{customer-group-add-customers-T7OYWJCB.js → customer-group-add-customers-BSMUKWVO.js} +1 -1
- package/dist/{customer-group-detail-E7HRZ3LE.js → customer-group-detail-QCPC2YWK.js} +2 -2
- package/dist/{customer-groups-26HJ55MF.js → customer-groups-6WGUNFHG.js} +2 -2
- package/dist/{customers-EXFRZX5F.js → customers-7OGYQSGA.js} +2 -2
- package/dist/edit-2BKYNGYL.js +262 -0
- package/dist/{edit-WHGYNDEB.js → edit-3S3EH372.js} +20 -17
- package/dist/{edit-MPOTIGUY.js → edit-4WP5SGH6.js} +23 -39
- package/dist/{edit-QBUYHSE7.js → edit-7D2OZBJS.js} +8 -6
- package/dist/{edit-2RN3OT27.js → edit-7T2JMZG3.js} +7 -56
- package/dist/edit-AK4E63X6.js +179 -0
- package/dist/{edit-NB5VN2E4.js → edit-DRT6VOAA.js} +5 -4
- package/dist/{edit-EGBVEWXS.js → edit-GBDHDJK4.js} +9 -7
- package/dist/{edit-TIBQEQVV.js → edit-P7FNRVGB.js} +10 -8
- package/dist/{edit-6VJWRZHQ.js → edit-PZN7UAJI.js} +7 -5
- package/dist/{edit-M4AP65HO.js → edit-RNSXXJVU.js} +8 -6
- package/dist/edit-SKRFQ4WN.js +81 -0
- package/dist/{edit-H5FJ45ZT.js → edit-ZM7NJVRE.js} +1 -1
- package/dist/{edit-budget-PYPHUJPW.js → edit-budget-MOZETGZV.js} +1 -1
- package/dist/{edit-inventory-item-BCVECCLT.js → edit-inventory-item-HFGHS732.js} +17 -14
- package/dist/{edit-inventory-item-attributes-GWEMP67O.js → edit-inventory-item-attributes-5ORZJF4I.js} +18 -1
- package/dist/{edit-price-GLAEAO7R.js → edit-price-KY7LX5QA.js} +2 -2
- package/dist/edit-reservation-LSYQUDYQ.js +294 -0
- package/dist/{edit-stock-E3PM2YOP.js → edit-stock-77VKJR4Z.js} +2 -2
- package/dist/extension-targets.d.ts +6 -3
- package/dist/{fulfillment-HDU7GATG.js → fulfillment-DEGKZL42.js} +7 -5
- package/dist/{fulfillment-providers-6RZNNT7U.js → fulfillment-providers-LDFPZGNX.js} +12 -11
- package/dist/index.css +17 -14
- package/dist/index.js +265 -155
- package/dist/{inventory-XJ2E6DPC.js → inventory-CMIRAJJY.js} +2 -2
- package/dist/{inventory-CKA34HWM.js → inventory-RKAUTQAU.js} +2 -2
- package/dist/{invite-755AJC3M.js → invite-KAHF2MCE.js} +7 -5
- package/dist/{invite-FD2TXZTW.js → invite-S5O7LFEY.js} +10 -8
- package/dist/{loader-UUSAVCK6.js → loader-3BXYSKPT.js} +1 -1
- package/dist/{loader-B4T2VBGV.js → loader-CF54CDM6.js} +2 -2
- package/dist/{login-UGKYRKMD.js → login-CRSALS6Y.js} +9 -7
- package/dist/manage-items-63FPRK7Z.js +302 -0
- package/dist/{manage-locations-PRQI5TI4.js → manage-locations-5B4HP6NQ.js} +24 -5
- package/dist/{media-TGFAHFBV.js → media-74PEXOLV.js} +8 -6
- package/dist/{media-2KEHXPRU.js → media-NKCXFG6X.js} +11 -9
- package/dist/{metadata-7JWZ4VFM.js → metadata-22BCBKVE.js} +7 -5
- package/dist/{metadata-BQQFHVKF.js → metadata-E3BDAMIO.js} +7 -5
- package/dist/{metadata-5TVRCKWX.js → metadata-FRXIY35J.js} +7 -5
- package/dist/{metadata-4ZZ4ZIWJ.js → metadata-L6IA2Z26.js} +7 -5
- package/dist/metadata-WN6Y35RV.js +69 -0
- package/dist/{metadata-G73TILNE.js → metadata-ZZMJNWS3.js} +7 -5
- package/dist/{offer-create-page-PPXRYET4.js → offer-create-page-N5CKYGSS.js} +12 -9
- package/dist/{offer-detail-page-BFGKAS4L.js → offer-detail-page-AJG6TMJC.js} +3 -3
- package/dist/{offer-variant-detail-page-BLHRF4MK.js → offer-variant-detail-page-CEOS2MVM.js} +40 -8
- package/dist/{offers-7I67VSHI.js → offers-WFJ6UGVG.js} +15 -11
- package/dist/{onboarding-7MURQYXX.js → onboarding-2AZ2KEWJ.js} +7 -5
- package/dist/{orders-D7NZNDUS.js → orders-NWYLN6BE.js} +13 -12
- package/dist/{organization-T6ZTYMMW.js → organization-PAWIWKHV.js} +9 -7
- package/dist/pages/index.d.ts +9 -1
- package/dist/pages/index.js +57 -48
- package/dist/{payment-details-UQ65D5AY.js → payment-details-O57HNHWS.js} +7 -5
- package/dist/{payouts-A336D2HG.js → payouts-26ZOYDRP.js} +2 -2
- package/dist/{price-lists-3WRT4TR2.js → price-lists-U5ASDHMI.js} +5 -8
- package/dist/{pricing-3NLEJYRP.js → pricing-C425JTFQ.js} +2 -2
- package/dist/{pricing-CPPIL627.js → pricing-PDOCJEDS.js} +9 -7
- package/dist/{product-tags-7DTA73YT.js → product-tags-MMQ4ZR4W.js} +20 -17
- package/dist/{product-types-OB26NF2D.js → product-types-CMI33S32.js} +3 -4
- package/dist/{product-variant-detail-4DDE6RJ5.js → product-variant-detail-D73ILATK.js} +7 -5
- package/dist/{product-variant-edit-SAZUI4E3.js → product-variant-edit-XN6WGKI2.js} +10 -8
- package/dist/{products-RYXTZFGT.js → products-OZJHGW2K.js} +19 -16
- package/dist/{products-GJ2KTGBZ.js → products-VWH5TAFY.js} +13 -10
- package/dist/{professional-details-UN5B4YDJ.js → professional-details-ZJT6YKZB.js} +7 -5
- package/dist/{profile-6MIDTK52.js → profile-EU46MXFW.js} +7 -5
- package/dist/{promotions-SQ47TCZL.js → promotions-ALWQ7J7A.js} +5 -5
- package/dist/{receive-ZG6FFN7H.js → receive-RRZK3FP2.js} +4 -3
- package/dist/{refund-KJX74N6T.js → refund-FLCZAMPR.js} +3 -2
- package/dist/{register-RDSK4E4D.js → register-C6ON6OL2.js} +9 -7
- package/dist/reservations-C326XEVA.js +350 -0
- package/dist/{reset-password-C462PDN2.js → reset-password-ASLKY3GK.js} +1 -1
- package/dist/respond-IPRDCH57.js +132 -0
- package/dist/{return-reasons-MY63HNF6.js → return-reasons-2BUKIQBO.js} +9 -7
- package/dist/reviews-LBLCFBRQ.js +14 -0
- package/dist/{settings-TJ6HPHMK.js → settings-Q5GAL2LK.js} +28 -25
- package/dist/{shipment-6CTA2GHU.js → shipment-XOU6F7AS.js} +7 -5
- package/dist/{shipping-TKKMYQHJ.js → shipping-IMCP7UDV.js} +2 -2
- package/dist/{shipping-profile-CFISOMTE.js → shipping-profile-7P3RPEIJ.js} +1 -1
- package/dist/{shipping-profiles-5UAZNYKJ.js → shipping-profiles-647FLCNK.js} +9 -7
- package/dist/{stock-465GEUY3.js → stock-D3HCV5UR.js} +22 -8
- package/dist/{store-2PQB2XWE.js → store-XBNFP6O4.js} +8 -6
- package/dist/{store-closure-DYW54VHB.js → store-closure-55EUSKE4.js} +7 -5
- package/dist/{store-select-6A5YR7WH.js → store-select-DEOEGT2O.js} +8 -6
- package/dist/{team-GXEBC57M.js → team-7MJ3NJUT.js} +10 -8
- package/package.json +12 -9
- package/dist/[id]-HEVGSOAV.js +0 -598
- package/dist/[id]-MU7A6SZO.js +0 -526
- package/dist/chunk-2ZFELO2L.js +0 -13
- package/dist/chunk-6IJMSVC6.js +0 -16
- package/dist/chunk-BNOKKKUU.js +0 -88
- package/dist/chunk-BX3JE7IE.js +0 -247
- package/dist/edit-4B364HGZ.js +0 -222
- package/dist/edit-735HBYH2.js +0 -103
- package/dist/edit-SQU5UOGE.js +0 -105
- package/dist/{chunk-CYE7HVAV.js → chunk-SCJBJQCL.js} +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/vendor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-canary.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -12,15 +12,18 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.js"
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
16
17
|
},
|
|
17
18
|
"./pages": {
|
|
18
19
|
"types": "./dist/pages/index.d.ts",
|
|
19
|
-
"import": "./dist/pages/index.js"
|
|
20
|
+
"import": "./dist/pages/index.js",
|
|
21
|
+
"default": "./dist/pages/index.js"
|
|
20
22
|
},
|
|
21
23
|
"./extension-targets": {
|
|
22
24
|
"types": "./dist/extension-targets.d.ts",
|
|
23
|
-
"import": "./dist/extension-targets.js"
|
|
25
|
+
"import": "./dist/extension-targets.js",
|
|
26
|
+
"default": "./dist/extension-targets.js"
|
|
24
27
|
},
|
|
25
28
|
"./index.css": "./dist/index.css"
|
|
26
29
|
},
|
|
@@ -34,8 +37,8 @@
|
|
|
34
37
|
"lint": "oxlint --max-warnings 0"
|
|
35
38
|
},
|
|
36
39
|
"dependencies": {
|
|
37
|
-
"@mercurjs/dashboard-shared": "2.
|
|
38
|
-
"@mercurjs/client": "2.
|
|
40
|
+
"@mercurjs/dashboard-shared": "2.3.0-canary.1",
|
|
41
|
+
"@mercurjs/client": "2.3.0-canary.1",
|
|
39
42
|
"@ariakit/react": "^0.4.15",
|
|
40
43
|
"@babel/runtime": "^8.0.0",
|
|
41
44
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -88,8 +91,8 @@
|
|
|
88
91
|
"tsup": "^8.0.2",
|
|
89
92
|
"typescript": "5.9.3",
|
|
90
93
|
"@medusajs/types": "2.17.2",
|
|
91
|
-
"@mercurjs/core": "2.
|
|
92
|
-
"@mercurjs/dashboard-sdk": "2.
|
|
93
|
-
"@mercurjs/types": "2.
|
|
94
|
+
"@mercurjs/core": "2.3.0-canary.1",
|
|
95
|
+
"@mercurjs/dashboard-sdk": "2.3.0-canary.1",
|
|
96
|
+
"@mercurjs/types": "2.3.0-canary.1"
|
|
94
97
|
}
|
|
95
98
|
}
|
package/dist/[id]-HEVGSOAV.js
DELETED
|
@@ -1,598 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
INVENTORY_DETAIL_FIELDS
|
|
3
|
-
} from "./chunk-ZEKV7LGF.js";
|
|
4
|
-
import {
|
|
5
|
-
getFormattedCountry
|
|
6
|
-
} from "./chunk-W6Y3PPU5.js";
|
|
7
|
-
import "./chunk-JRTZWK77.js";
|
|
8
|
-
import {
|
|
9
|
-
PlaceholderCell
|
|
10
|
-
} from "./chunk-PHOCVOZ5.js";
|
|
11
|
-
import {
|
|
12
|
-
SectionRow
|
|
13
|
-
} from "./chunk-4TLP3TAA.js";
|
|
14
|
-
import {
|
|
15
|
-
TwoColumnPage
|
|
16
|
-
} from "./chunk-YV6MK4PZ.js";
|
|
17
|
-
import "./chunk-FQERBIVS.js";
|
|
18
|
-
import {
|
|
19
|
-
_DataTable,
|
|
20
|
-
useDataTable
|
|
21
|
-
} from "./chunk-IWAL74YU.js";
|
|
22
|
-
import "./chunk-YN3FGNJM.js";
|
|
23
|
-
import "./chunk-KCHYLLVG.js";
|
|
24
|
-
import "./chunk-3EF54XFY.js";
|
|
25
|
-
import {
|
|
26
|
-
useQueryParams
|
|
27
|
-
} from "./chunk-THHRRYRS.js";
|
|
28
|
-
import "./chunk-LRD242C7.js";
|
|
29
|
-
import {
|
|
30
|
-
Thumbnail
|
|
31
|
-
} from "./chunk-WIYFXWRI.js";
|
|
32
|
-
import {
|
|
33
|
-
TwoColumnPageSkeleton
|
|
34
|
-
} from "./chunk-INNFZYX2.js";
|
|
35
|
-
import {
|
|
36
|
-
ActionMenu
|
|
37
|
-
} from "./chunk-BDGZ4EQO.js";
|
|
38
|
-
import "./chunk-LAVHRER2.js";
|
|
39
|
-
import "./chunk-QHQWEERJ.js";
|
|
40
|
-
import "./chunk-Y7QKP6QU.js";
|
|
41
|
-
import {
|
|
42
|
-
inventoryItemsQueryKeys,
|
|
43
|
-
useDeleteInventoryItemLevel,
|
|
44
|
-
useInventoryItem,
|
|
45
|
-
useInventoryItemLevels
|
|
46
|
-
} from "./chunk-EMUCGKHP.js";
|
|
47
|
-
import "./chunk-A5DJIOHN.js";
|
|
48
|
-
import {
|
|
49
|
-
queryClient
|
|
50
|
-
} from "./chunk-RHKRREUU.js";
|
|
51
|
-
import "./chunk-ZA2KFUFR.js";
|
|
52
|
-
import {
|
|
53
|
-
fetchQuery
|
|
54
|
-
} from "./chunk-DTGEFKK4.js";
|
|
55
|
-
import "./chunk-NBMM2TZK.js";
|
|
56
|
-
|
|
57
|
-
// src/pages/inventory/[id]/loader.tsx
|
|
58
|
-
import { getLinkQuery } from "@mercurjs/dashboard-shared";
|
|
59
|
-
var inventoryDetailQuery = (id) => {
|
|
60
|
-
const query = getLinkQuery("inventory_item", INVENTORY_DETAIL_FIELDS);
|
|
61
|
-
return {
|
|
62
|
-
queryKey: inventoryItemsQueryKeys.detail(id, query),
|
|
63
|
-
queryFn: async () => fetchQuery(
|
|
64
|
-
`/vendor/inventory-items/${id}?fields=${query.fields}`,
|
|
65
|
-
{ method: "GET" }
|
|
66
|
-
)
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
var loader = async ({ params }) => {
|
|
70
|
-
const id = params.id;
|
|
71
|
-
const query = inventoryDetailQuery(id);
|
|
72
|
-
return queryClient.ensureQueryData(query);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// src/pages/inventory/[id]/inventory-detail-page.tsx
|
|
76
|
-
import { Children } from "react";
|
|
77
|
-
import { useLoaderData, useParams } from "react-router-dom";
|
|
78
|
-
import { useLinkQuery, WidgetZone } from "@mercurjs/dashboard-shared";
|
|
79
|
-
|
|
80
|
-
// src/pages/inventory/[id]/_components/inventory-item-attributes/attributes-section.tsx
|
|
81
|
-
import { Container, Heading } from "@medusajs/ui";
|
|
82
|
-
import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
|
|
83
|
-
import { PencilSquare } from "@medusajs/icons";
|
|
84
|
-
import { useTranslation } from "react-i18next";
|
|
85
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
86
|
-
var InventoryItemAttributeSection = ({
|
|
87
|
-
inventoryItem
|
|
88
|
-
}) => {
|
|
89
|
-
const { t } = useTranslation();
|
|
90
|
-
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
91
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
92
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("products.attributes") }),
|
|
93
|
-
/* @__PURE__ */ jsx(
|
|
94
|
-
ActionMenu,
|
|
95
|
-
{
|
|
96
|
-
groups: [
|
|
97
|
-
{
|
|
98
|
-
actions: [
|
|
99
|
-
{
|
|
100
|
-
label: t("actions.edit"),
|
|
101
|
-
to: "attributes",
|
|
102
|
-
icon: /* @__PURE__ */ jsx(PencilSquare, {})
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
] }),
|
|
110
|
-
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.height"), value: inventoryItem.height }),
|
|
111
|
-
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.width"), value: inventoryItem.width }),
|
|
112
|
-
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.length"), value: inventoryItem.length }),
|
|
113
|
-
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.weight"), value: inventoryItem.weight }),
|
|
114
|
-
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.midCode"), value: inventoryItem.mid_code }),
|
|
115
|
-
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.hsCode"), value: inventoryItem.hs_code }),
|
|
116
|
-
/* @__PURE__ */ jsx(
|
|
117
|
-
SectionRow,
|
|
118
|
-
{
|
|
119
|
-
title: t("fields.countryOfOrigin"),
|
|
120
|
-
value: getFormattedCountry(inventoryItem.origin_country)
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
/* @__PURE__ */ jsx(
|
|
124
|
-
DisplayExtensionZone,
|
|
125
|
-
{
|
|
126
|
-
model: "inventory_item",
|
|
127
|
-
zone: "attributes",
|
|
128
|
-
data: inventoryItem
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
] });
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
// src/pages/inventory/[id]/_components/inventory-item-general-section.tsx
|
|
135
|
-
import { Container as Container2, Heading as Heading2 } from "@medusajs/ui";
|
|
136
|
-
import { PencilSquare as PencilSquare2 } from "@medusajs/icons";
|
|
137
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
138
|
-
import { DisplayExtensionZone as DisplayExtensionZone2, DisplayField } from "@mercurjs/dashboard-shared";
|
|
139
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
140
|
-
var GENERAL_FIELD_IDS = ["title", "sku", "in_stock", "reserved", "available"];
|
|
141
|
-
var InventoryItemGeneralSection = ({
|
|
142
|
-
inventoryItem
|
|
143
|
-
}) => {
|
|
144
|
-
const { t } = useTranslation2();
|
|
145
|
-
const stockedQuantity = inventoryItem.location_levels?.reduce(
|
|
146
|
-
(acc, level) => acc + level.stocked_quantity,
|
|
147
|
-
0
|
|
148
|
-
) || 0;
|
|
149
|
-
const reservedQuantity = inventoryItem.location_levels?.reduce(
|
|
150
|
-
(acc, level) => acc + level.reserved_quantity,
|
|
151
|
-
0
|
|
152
|
-
) || 0;
|
|
153
|
-
const availableQuantity = stockedQuantity - reservedQuantity;
|
|
154
|
-
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
155
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
156
|
-
/* @__PURE__ */ jsx2(
|
|
157
|
-
DisplayField,
|
|
158
|
-
{
|
|
159
|
-
model: "inventory_item",
|
|
160
|
-
zone: "general",
|
|
161
|
-
id: "title",
|
|
162
|
-
data: inventoryItem,
|
|
163
|
-
children: /* @__PURE__ */ jsxs2(Heading2, { children: [
|
|
164
|
-
inventoryItem.title ?? inventoryItem.sku,
|
|
165
|
-
" ",
|
|
166
|
-
t("fields.details")
|
|
167
|
-
] })
|
|
168
|
-
}
|
|
169
|
-
),
|
|
170
|
-
/* @__PURE__ */ jsx2(
|
|
171
|
-
ActionMenu,
|
|
172
|
-
{
|
|
173
|
-
groups: [
|
|
174
|
-
{
|
|
175
|
-
actions: [
|
|
176
|
-
{
|
|
177
|
-
icon: /* @__PURE__ */ jsx2(PencilSquare2, {}),
|
|
178
|
-
label: t("actions.edit"),
|
|
179
|
-
to: "edit"
|
|
180
|
-
}
|
|
181
|
-
]
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
] }),
|
|
187
|
-
/* @__PURE__ */ jsx2(
|
|
188
|
-
DisplayField,
|
|
189
|
-
{
|
|
190
|
-
model: "inventory_item",
|
|
191
|
-
zone: "general",
|
|
192
|
-
id: "sku",
|
|
193
|
-
data: inventoryItem,
|
|
194
|
-
children: /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.sku"), value: inventoryItem.sku ?? "-" })
|
|
195
|
-
}
|
|
196
|
-
),
|
|
197
|
-
/* @__PURE__ */ jsx2(
|
|
198
|
-
DisplayField,
|
|
199
|
-
{
|
|
200
|
-
model: "inventory_item",
|
|
201
|
-
zone: "general",
|
|
202
|
-
id: "in_stock",
|
|
203
|
-
data: inventoryItem,
|
|
204
|
-
children: /* @__PURE__ */ jsx2(
|
|
205
|
-
SectionRow,
|
|
206
|
-
{
|
|
207
|
-
title: t("fields.inStock"),
|
|
208
|
-
value: getQuantityFormat(
|
|
209
|
-
stockedQuantity,
|
|
210
|
-
inventoryItem.location_levels?.length
|
|
211
|
-
)
|
|
212
|
-
}
|
|
213
|
-
)
|
|
214
|
-
}
|
|
215
|
-
),
|
|
216
|
-
/* @__PURE__ */ jsx2(
|
|
217
|
-
DisplayField,
|
|
218
|
-
{
|
|
219
|
-
model: "inventory_item",
|
|
220
|
-
zone: "general",
|
|
221
|
-
id: "reserved",
|
|
222
|
-
data: inventoryItem,
|
|
223
|
-
children: /* @__PURE__ */ jsx2(
|
|
224
|
-
SectionRow,
|
|
225
|
-
{
|
|
226
|
-
title: t("inventory.reserved"),
|
|
227
|
-
value: getQuantityFormat(
|
|
228
|
-
reservedQuantity,
|
|
229
|
-
inventoryItem.location_levels?.length
|
|
230
|
-
)
|
|
231
|
-
}
|
|
232
|
-
)
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
/* @__PURE__ */ jsx2(
|
|
236
|
-
DisplayField,
|
|
237
|
-
{
|
|
238
|
-
model: "inventory_item",
|
|
239
|
-
zone: "general",
|
|
240
|
-
id: "available",
|
|
241
|
-
data: inventoryItem,
|
|
242
|
-
children: /* @__PURE__ */ jsx2(
|
|
243
|
-
SectionRow,
|
|
244
|
-
{
|
|
245
|
-
title: t("inventory.available"),
|
|
246
|
-
value: getQuantityFormat(
|
|
247
|
-
availableQuantity,
|
|
248
|
-
inventoryItem.location_levels?.length
|
|
249
|
-
)
|
|
250
|
-
}
|
|
251
|
-
)
|
|
252
|
-
}
|
|
253
|
-
),
|
|
254
|
-
/* @__PURE__ */ jsx2(
|
|
255
|
-
DisplayExtensionZone2,
|
|
256
|
-
{
|
|
257
|
-
model: "inventory_item",
|
|
258
|
-
zone: "general",
|
|
259
|
-
data: inventoryItem,
|
|
260
|
-
builtInFieldIds: GENERAL_FIELD_IDS
|
|
261
|
-
}
|
|
262
|
-
)
|
|
263
|
-
] });
|
|
264
|
-
};
|
|
265
|
-
var getQuantityFormat = (quantity, locations) => {
|
|
266
|
-
if (quantity !== void 0 && !isNaN(quantity)) {
|
|
267
|
-
return `${quantity} across ${locations ?? "-"} locations`;
|
|
268
|
-
}
|
|
269
|
-
return "-";
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
// src/pages/inventory/[id]/_components/inventory-item-location-levels.tsx
|
|
273
|
-
import { Button, Container as Container3, Heading as Heading3 } from "@medusajs/ui";
|
|
274
|
-
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
275
|
-
import { Link } from "react-router-dom";
|
|
276
|
-
import { DisplayExtensionZone as DisplayExtensionZone3 } from "@mercurjs/dashboard-shared";
|
|
277
|
-
|
|
278
|
-
// src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-columns.tsx
|
|
279
|
-
import { createColumnHelper } from "@tanstack/react-table";
|
|
280
|
-
import { useMemo } from "react";
|
|
281
|
-
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
282
|
-
|
|
283
|
-
// src/pages/inventory/[id]/_components/location-levels-table/location-actions.tsx
|
|
284
|
-
import { PencilSquare as PencilSquare3, Trash } from "@medusajs/icons";
|
|
285
|
-
import { usePrompt } from "@medusajs/ui";
|
|
286
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
287
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
288
|
-
var LocationActions = ({
|
|
289
|
-
level
|
|
290
|
-
}) => {
|
|
291
|
-
const { t } = useTranslation3();
|
|
292
|
-
const prompt = usePrompt();
|
|
293
|
-
const { mutateAsync } = useDeleteInventoryItemLevel(
|
|
294
|
-
level.inventory_item_id,
|
|
295
|
-
level.location_id
|
|
296
|
-
);
|
|
297
|
-
const handleDelete = async () => {
|
|
298
|
-
const res = await prompt({
|
|
299
|
-
title: t("general.areYouSure"),
|
|
300
|
-
description: t("inventory.deleteWarning"),
|
|
301
|
-
confirmText: t("actions.delete"),
|
|
302
|
-
cancelText: t("actions.cancel")
|
|
303
|
-
});
|
|
304
|
-
if (!res) {
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
await mutateAsync();
|
|
308
|
-
};
|
|
309
|
-
return /* @__PURE__ */ jsx3(
|
|
310
|
-
ActionMenu,
|
|
311
|
-
{
|
|
312
|
-
groups: [
|
|
313
|
-
{
|
|
314
|
-
actions: [
|
|
315
|
-
{
|
|
316
|
-
icon: /* @__PURE__ */ jsx3(PencilSquare3, {}),
|
|
317
|
-
label: t("actions.edit"),
|
|
318
|
-
to: `locations/${level.location_id}`
|
|
319
|
-
}
|
|
320
|
-
]
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
actions: [
|
|
324
|
-
{
|
|
325
|
-
icon: /* @__PURE__ */ jsx3(Trash, {}),
|
|
326
|
-
label: t("actions.delete"),
|
|
327
|
-
onClick: handleDelete,
|
|
328
|
-
disabled: level.reserved_quantity > 0 || level.stocked_quantity > 0
|
|
329
|
-
}
|
|
330
|
-
]
|
|
331
|
-
}
|
|
332
|
-
]
|
|
333
|
-
}
|
|
334
|
-
);
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
// src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-columns.tsx
|
|
338
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
339
|
-
var columnHelper = createColumnHelper();
|
|
340
|
-
var useLocationListTableColumns = () => {
|
|
341
|
-
const { t } = useTranslation4();
|
|
342
|
-
return useMemo(
|
|
343
|
-
() => [
|
|
344
|
-
columnHelper.display({
|
|
345
|
-
id: "location",
|
|
346
|
-
header: t("fields.location"),
|
|
347
|
-
cell: ({ row }) => {
|
|
348
|
-
const locationName = row.original.stock_locations?.map((location) => location.name).join(", ");
|
|
349
|
-
if (!locationName) {
|
|
350
|
-
return /* @__PURE__ */ jsx4(PlaceholderCell, {});
|
|
351
|
-
}
|
|
352
|
-
return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: locationName.toString() }) });
|
|
353
|
-
}
|
|
354
|
-
}),
|
|
355
|
-
columnHelper.accessor("reserved_quantity", {
|
|
356
|
-
header: t("inventory.reserved"),
|
|
357
|
-
cell: ({ getValue }) => {
|
|
358
|
-
const quantity = getValue();
|
|
359
|
-
if (Number.isNaN(quantity)) {
|
|
360
|
-
return /* @__PURE__ */ jsx4(PlaceholderCell, {});
|
|
361
|
-
}
|
|
362
|
-
return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: quantity }) });
|
|
363
|
-
}
|
|
364
|
-
}),
|
|
365
|
-
columnHelper.accessor("stocked_quantity", {
|
|
366
|
-
header: t("fields.inStock"),
|
|
367
|
-
cell: ({ getValue }) => {
|
|
368
|
-
const stockedQuantity = getValue();
|
|
369
|
-
if (Number.isNaN(stockedQuantity)) {
|
|
370
|
-
return /* @__PURE__ */ jsx4(PlaceholderCell, {});
|
|
371
|
-
}
|
|
372
|
-
return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: stockedQuantity }) });
|
|
373
|
-
}
|
|
374
|
-
}),
|
|
375
|
-
columnHelper.accessor("available_quantity", {
|
|
376
|
-
header: t("inventory.available"),
|
|
377
|
-
cell: ({ getValue }) => {
|
|
378
|
-
const availableQuantity = getValue();
|
|
379
|
-
if (Number.isNaN(availableQuantity)) {
|
|
380
|
-
return /* @__PURE__ */ jsx4(PlaceholderCell, {});
|
|
381
|
-
}
|
|
382
|
-
return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: availableQuantity }) });
|
|
383
|
-
}
|
|
384
|
-
}),
|
|
385
|
-
columnHelper.display({
|
|
386
|
-
id: "actions",
|
|
387
|
-
cell: ({ row }) => /* @__PURE__ */ jsx4(LocationActions, { level: row.original })
|
|
388
|
-
})
|
|
389
|
-
],
|
|
390
|
-
[t]
|
|
391
|
-
);
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
// src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-query.tsx
|
|
395
|
-
var useLocationLevelTableQuery = ({
|
|
396
|
-
pageSize = 20,
|
|
397
|
-
prefix
|
|
398
|
-
}) => {
|
|
399
|
-
const raw = useQueryParams(
|
|
400
|
-
[
|
|
401
|
-
"id",
|
|
402
|
-
"location_id",
|
|
403
|
-
"stocked_quantity",
|
|
404
|
-
"reserved_quantity",
|
|
405
|
-
"incoming_quantity",
|
|
406
|
-
"available_quantity",
|
|
407
|
-
"*stock_locations"
|
|
408
|
-
],
|
|
409
|
-
prefix
|
|
410
|
-
);
|
|
411
|
-
const { reserved_quantity, stocked_quantity, available_quantity, ...params } = raw;
|
|
412
|
-
const searchParams = {
|
|
413
|
-
limit: pageSize,
|
|
414
|
-
reserved_quantity: reserved_quantity ? JSON.parse(reserved_quantity) : void 0,
|
|
415
|
-
stocked_quantity: stocked_quantity ? JSON.parse(stocked_quantity) : void 0,
|
|
416
|
-
available_quantity: available_quantity ? JSON.parse(available_quantity) : void 0,
|
|
417
|
-
...params
|
|
418
|
-
};
|
|
419
|
-
return {
|
|
420
|
-
searchParams,
|
|
421
|
-
raw
|
|
422
|
-
};
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
// src/pages/inventory/[id]/_components/location-levels-table/location-list-table.tsx
|
|
426
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
427
|
-
var PAGE_SIZE = 20;
|
|
428
|
-
var ItemLocationListTable = ({
|
|
429
|
-
inventory_item_id
|
|
430
|
-
}) => {
|
|
431
|
-
const { searchParams, raw } = useLocationLevelTableQuery({
|
|
432
|
-
pageSize: PAGE_SIZE
|
|
433
|
-
});
|
|
434
|
-
const { inventory_levels, count, isLoading } = useInventoryItemLevels(
|
|
435
|
-
inventory_item_id,
|
|
436
|
-
{
|
|
437
|
-
...searchParams,
|
|
438
|
-
fields: "*stock_locations"
|
|
439
|
-
}
|
|
440
|
-
);
|
|
441
|
-
const columns = useLocationListTableColumns();
|
|
442
|
-
const filteredLocationLevels = inventory_levels?.filter(
|
|
443
|
-
(level) => level.stock_locations.length > 0
|
|
444
|
-
);
|
|
445
|
-
const { table } = useDataTable({
|
|
446
|
-
data: filteredLocationLevels ?? [],
|
|
447
|
-
columns,
|
|
448
|
-
count,
|
|
449
|
-
enablePagination: true,
|
|
450
|
-
getRowId: (row) => row.id,
|
|
451
|
-
pageSize: PAGE_SIZE
|
|
452
|
-
});
|
|
453
|
-
return /* @__PURE__ */ jsx5(
|
|
454
|
-
_DataTable,
|
|
455
|
-
{
|
|
456
|
-
table,
|
|
457
|
-
columns,
|
|
458
|
-
pageSize: PAGE_SIZE,
|
|
459
|
-
count: filteredLocationLevels?.length,
|
|
460
|
-
isLoading,
|
|
461
|
-
pagination: true,
|
|
462
|
-
queryObject: raw
|
|
463
|
-
}
|
|
464
|
-
);
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
// src/pages/inventory/[id]/_components/inventory-item-location-levels.tsx
|
|
468
|
-
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
469
|
-
var InventoryItemLocationLevelsSection = ({
|
|
470
|
-
inventoryItem
|
|
471
|
-
}) => {
|
|
472
|
-
const { t } = useTranslation5();
|
|
473
|
-
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
|
|
474
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
475
|
-
/* @__PURE__ */ jsx6(Heading3, { children: t("inventory.locationLevels") }),
|
|
476
|
-
/* @__PURE__ */ jsx6(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx6(Link, { to: "locations", children: t("inventory.manageLocations") }) })
|
|
477
|
-
] }),
|
|
478
|
-
/* @__PURE__ */ jsx6(ItemLocationListTable, { inventory_item_id: inventoryItem.id }),
|
|
479
|
-
/* @__PURE__ */ jsx6(
|
|
480
|
-
DisplayExtensionZone3,
|
|
481
|
-
{
|
|
482
|
-
model: "inventory_item",
|
|
483
|
-
zone: "locations",
|
|
484
|
-
data: inventoryItem
|
|
485
|
-
}
|
|
486
|
-
)
|
|
487
|
-
] });
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
// src/pages/inventory/[id]/_components/inventory-item-variants/variants-section.tsx
|
|
491
|
-
import { TriangleRightMini } from "@medusajs/icons";
|
|
492
|
-
import { Container as Container4, Heading as Heading4 } from "@medusajs/ui";
|
|
493
|
-
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
494
|
-
import { Link as Link2 } from "react-router-dom";
|
|
495
|
-
import { DisplayExtensionZone as DisplayExtensionZone4 } from "@mercurjs/dashboard-shared";
|
|
496
|
-
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
497
|
-
var InventoryItemVariantsSection = ({
|
|
498
|
-
variants
|
|
499
|
-
}) => {
|
|
500
|
-
const { t } = useTranslation6();
|
|
501
|
-
if (!variants?.length) {
|
|
502
|
-
return null;
|
|
503
|
-
}
|
|
504
|
-
return /* @__PURE__ */ jsxs4(Container4, { className: "p-0", children: [
|
|
505
|
-
/* @__PURE__ */ jsx7("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx7(Heading4, { level: "h2", children: t("inventory.associatedVariants") }) }),
|
|
506
|
-
/* @__PURE__ */ jsx7("div", { className: "txt-small flex flex-col gap-2 px-2 pb-2", children: variants.map((variant) => {
|
|
507
|
-
const link = variant.product ? `/products/${variant.product.id}/variants/${variant.id}` : null;
|
|
508
|
-
const Inner = /* @__PURE__ */ jsx7("div", { className: "shadow-elevation-card-rest bg-ui-bg-component rounded-md px-4 py-2 transition-colors", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
|
|
509
|
-
/* @__PURE__ */ jsx7("div", { className: "shadow-elevation-card-rest rounded-md", children: /* @__PURE__ */ jsx7(Thumbnail, { src: variant.product?.thumbnail }) }),
|
|
510
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex flex-1 flex-col", children: [
|
|
511
|
-
/* @__PURE__ */ jsx7("span", { className: "text-ui-fg-base font-medium", children: variant.title }),
|
|
512
|
-
/* @__PURE__ */ jsx7("span", { className: "text-ui-fg-subtle", children: variant.options.map((o) => o.value).join(" \u22C5 ") })
|
|
513
|
-
] }),
|
|
514
|
-
/* @__PURE__ */ jsx7("div", { className: "size-7 flex items-center justify-center", children: /* @__PURE__ */ jsx7(TriangleRightMini, { className: "text-ui-fg-muted" }) })
|
|
515
|
-
] }) });
|
|
516
|
-
if (!link) {
|
|
517
|
-
return /* @__PURE__ */ jsx7("div", { children: Inner }, variant.id);
|
|
518
|
-
}
|
|
519
|
-
return /* @__PURE__ */ jsx7(
|
|
520
|
-
Link2,
|
|
521
|
-
{
|
|
522
|
-
to: link,
|
|
523
|
-
className: "outline-none focus-within:shadow-borders-interactive-with-focus rounded-md [&:hover>div]:bg-ui-bg-component-hover",
|
|
524
|
-
children: Inner
|
|
525
|
-
},
|
|
526
|
-
variant.id
|
|
527
|
-
);
|
|
528
|
-
}) }),
|
|
529
|
-
/* @__PURE__ */ jsx7(
|
|
530
|
-
DisplayExtensionZone4,
|
|
531
|
-
{
|
|
532
|
-
model: "inventory_item",
|
|
533
|
-
zone: "variants",
|
|
534
|
-
data: variants
|
|
535
|
-
}
|
|
536
|
-
)
|
|
537
|
-
] });
|
|
538
|
-
};
|
|
539
|
-
|
|
540
|
-
// src/pages/inventory/[id]/inventory-detail-page.tsx
|
|
541
|
-
import { Fragment, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
542
|
-
var Root = ({ children }) => {
|
|
543
|
-
const { id } = useParams();
|
|
544
|
-
const initialData = useLoaderData();
|
|
545
|
-
const { inventory_item, isPending: isLoading } = useInventoryItem(
|
|
546
|
-
id,
|
|
547
|
-
useLinkQuery("inventory_item", INVENTORY_DETAIL_FIELDS),
|
|
548
|
-
{ initialData }
|
|
549
|
-
);
|
|
550
|
-
if (isLoading || !inventory_item) {
|
|
551
|
-
return /* @__PURE__ */ jsx8(
|
|
552
|
-
TwoColumnPageSkeleton,
|
|
553
|
-
{
|
|
554
|
-
showJSON: true,
|
|
555
|
-
mainSections: 3,
|
|
556
|
-
sidebarSections: 2,
|
|
557
|
-
showMetadata: true
|
|
558
|
-
}
|
|
559
|
-
);
|
|
560
|
-
}
|
|
561
|
-
return /* @__PURE__ */ jsx8(Fragment, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs5(TwoColumnPage, { data: inventory_item, children: [
|
|
562
|
-
/* @__PURE__ */ jsx8(TwoColumnPage.Main, { children: /* @__PURE__ */ jsxs5(WidgetZone, { id: "inventory.detail.main", data: inventory_item, children: [
|
|
563
|
-
/* @__PURE__ */ jsx8(InventoryItemGeneralSection, { inventoryItem: inventory_item }),
|
|
564
|
-
/* @__PURE__ */ jsx8(
|
|
565
|
-
InventoryItemLocationLevelsSection,
|
|
566
|
-
{
|
|
567
|
-
inventoryItem: inventory_item
|
|
568
|
-
}
|
|
569
|
-
)
|
|
570
|
-
] }) }),
|
|
571
|
-
/* @__PURE__ */ jsx8(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsxs5(WidgetZone, { id: "inventory.detail.side", data: inventory_item, children: [
|
|
572
|
-
/* @__PURE__ */ jsx8(
|
|
573
|
-
InventoryItemVariantsSection,
|
|
574
|
-
{
|
|
575
|
-
variants: inventory_item.variants
|
|
576
|
-
}
|
|
577
|
-
),
|
|
578
|
-
/* @__PURE__ */ jsx8(
|
|
579
|
-
InventoryItemAttributeSection,
|
|
580
|
-
{
|
|
581
|
-
inventoryItem: inventory_item
|
|
582
|
-
}
|
|
583
|
-
)
|
|
584
|
-
] }) })
|
|
585
|
-
] }) });
|
|
586
|
-
};
|
|
587
|
-
var InventoryDetailPage = Object.assign(Root, {
|
|
588
|
-
Main: TwoColumnPage.Main,
|
|
589
|
-
Sidebar: TwoColumnPage.Sidebar,
|
|
590
|
-
MainGeneralSection: InventoryItemGeneralSection,
|
|
591
|
-
MainLocationLevelsSection: InventoryItemLocationLevelsSection,
|
|
592
|
-
SidebarVariantsSection: InventoryItemVariantsSection,
|
|
593
|
-
SidebarAttributeSection: InventoryItemAttributeSection
|
|
594
|
-
});
|
|
595
|
-
export {
|
|
596
|
-
InventoryDetailPage,
|
|
597
|
-
loader
|
|
598
|
-
};
|