@mercurjs/vendor 2.2.1 → 2.3.0-canary.0
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]-47SUX5X3.js → [id]-3IFUEMOA.js} +12 -9
- package/dist/{[id]-PIB2DEVI.js → [id]-3NM7G2QP.js} +11 -8
- package/dist/[id]-3TCOLUQH.js +197 -0
- package/dist/{[id]-SKU5SFBG.js → [id]-4IWSF6TW.js} +137 -204
- package/dist/{[id]-BPQNQFVE.js → [id]-AMZFAAJ3.js} +75 -124
- package/dist/[id]-C3TB6V2O.js +286 -0
- package/dist/{[id]-NGRV5I2A.js → [id]-HEDNHQ5Z.js} +8 -6
- package/dist/[id]-KFACDZAI.js +949 -0
- package/dist/{[id]-BHU5BSQT.js → [id]-KFRGBNLH.js} +19 -16
- package/dist/{[id]-OE5TUWNF.js → [id]-OVWD6DNG.js} +8 -6
- package/dist/{[id]-RJRAZN3T.js → [id]-PJ2K4O3C.js} +7 -5
- package/dist/{[id]-ZD5HBP2R.js → [id]-ROMWNPJA.js} +13 -10
- package/dist/[id]-UPNI3OCU.js +697 -0
- package/dist/{[id]-YB3DBBXT.js → [id]-YFLQXZGC.js} +12 -9
- package/dist/{[province_id]-CUWKNPBW.js → [province_id]-IM22PLJP.js} +8 -6
- package/dist/{add-YEUSE5QA.js → add-AUSWWCA3.js} +9 -7
- package/dist/{add-MYV5IOGP.js → add-MBCWT6XT.js} +157 -227
- package/dist/{add-customer-groups-Q3F357F2.js → add-customer-groups-3FD754Z2.js} +7 -5
- package/dist/{add-products-WVNYODC6.js → add-products-IS22SHHN.js} +12 -9
- package/dist/{add-promotions-F62YE3BE.js → add-promotions-VDD5PKMN.js} +27 -9
- package/dist/{add-to-campaign-WBSCTSKW.js → add-to-campaign-B3PGGNFA.js} +3 -2
- package/dist/{address-ZMZ4ST5T.js → address-7HSQSXUS.js} +6 -4
- 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-IDLCUHX3.js} +6 -4
- package/dist/{breadcrumb-MXYWEBK6.js → breadcrumb-OXRGEOVL.js} +6 -4
- package/dist/{breadcrumb-JWFTKHLE.js → breadcrumb-RQ52GELM.js} +2 -1
- package/dist/{breadcrumb-QPV566YX.js → breadcrumb-UDSK4EUS.js} +7 -5
- package/dist/breadcrumb-XCPUUZUO.js +26 -0
- 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-UEKRQS5Q.js → chunk-6ECHPZS3.js} +2 -2
- 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-SVYBMLVN.js → chunk-7J2QRH4V.js} +1 -1
- 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-SDFZUBS3.js → chunk-CDZALZ5E.js} +1 -1
- package/dist/{chunk-72HQFLZI.js → chunk-CSEB2RNO.js} +1 -1
- package/dist/{chunk-X6ZQMFCT.js → chunk-DAOSTHVB.js} +44 -25
- 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-3XW55FZY.js → chunk-IYQHEISY.js} +6 -6
- package/dist/chunk-IZI2PKL7.js +27 -0
- package/dist/chunk-JN6MHI6V.js +334 -0
- 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-FEVCBT24.js → chunk-LOSVZJXS.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-GTNCNKTC.js → chunk-NP5TISFX.js} +1 -1
- 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-OKJHUQBY.js → chunk-QSS7ATY3.js} +15 -27
- 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-EJBOBB4B.js → chunk-V3N2Y4OL.js} +46 -46
- package/dist/{chunk-UUBGLS7U.js → chunk-V43BEBDT.js} +187 -35
- 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-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-3MEKABDT.js} +13 -12
- 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-75C65ZIS.js} +6 -5
- package/dist/{create-6IRD2CVC.js → create-A3CQXIRQ.js} +11 -9
- package/dist/{create-LYNWCP2N.js → create-GYNDVCY2.js} +5 -4
- package/dist/create-ICCAEOSA.js +343 -0
- package/dist/{create-5RQ32XPT.js → create-KBDT33O2.js} +287 -287
- package/dist/{create-GEYXN6SW.js → create-L5HMOVY5.js} +6 -4
- package/dist/{create-MFGMTZ5A.js → create-M2W5N6QV.js} +7 -5
- package/dist/{create-NTZH45DW.js → create-NSJGRO4L.js} +13 -11
- package/dist/{create-H77ZUZG5.js → create-O4K6TO4G.js} +9 -7
- package/dist/{create-S7VYYTUD.js → create-PW5L3MJI.js} +9 -7
- package/dist/{create-7SJ5DSQK.js → create-UQ26QTPQ.js} +19 -16
- package/dist/{create-2I3GAX4C.js → create-WIGBFSRH.js} +15 -6
- package/dist/{create-7FT7N2NH.js → create-WPN3OUJU.js} +3 -2
- 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-M4AP65HO.js → edit-32ZGQUWZ.js} +7 -5
- package/dist/{edit-MPOTIGUY.js → edit-3OXHBHY4.js} +22 -38
- package/dist/{edit-2RN3OT27.js → edit-7T2JMZG3.js} +7 -56
- package/dist/{edit-6VJWRZHQ.js → edit-AFWQY3BZ.js} +6 -4
- package/dist/{edit-NB5VN2E4.js → edit-EDXF3T7F.js} +4 -3
- package/dist/edit-GJCXPD5A.js +81 -0
- package/dist/{edit-WHGYNDEB.js → edit-KOLDPZ4H.js} +19 -16
- package/dist/{edit-TIBQEQVV.js → edit-LZFD3RSY.js} +9 -7
- package/dist/{edit-QBUYHSE7.js → edit-QVK3BEPA.js} +7 -5
- package/dist/{edit-EGBVEWXS.js → edit-ZLZR7F33.js} +8 -6
- 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-reservation-LSYQUDYQ.js +294 -0
- package/dist/extension-targets.d.ts +6 -3
- package/dist/{fulfillment-HDU7GATG.js → fulfillment-TVRF5TID.js} +6 -4
- package/dist/{fulfillment-providers-6RZNNT7U.js → fulfillment-providers-TEV23LGB.js} +11 -10
- package/dist/index.css +14 -14
- package/dist/index.js +252 -146
- package/dist/{inventory-XJ2E6DPC.js → inventory-CMIRAJJY.js} +2 -2
- package/dist/{invite-755AJC3M.js → invite-K3R2GRYF.js} +6 -4
- package/dist/{invite-FD2TXZTW.js → invite-ZMIYLOWJ.js} +9 -7
- package/dist/{login-UGKYRKMD.js → login-LG3XH6B2.js} +8 -6
- package/dist/{manage-locations-PRQI5TI4.js → manage-locations-5B4HP6NQ.js} +24 -5
- package/dist/{media-TGFAHFBV.js → media-DY2XDZYT.js} +7 -5
- package/dist/{media-2KEHXPRU.js → media-OGO6M3CP.js} +10 -8
- package/dist/{metadata-BQQFHVKF.js → metadata-AW5Y72BI.js} +6 -4
- package/dist/metadata-HS6CLO4Z.js +69 -0
- package/dist/{metadata-5TVRCKWX.js → metadata-HXXVD3VP.js} +6 -4
- package/dist/{metadata-7JWZ4VFM.js → metadata-TXNUZBPX.js} +6 -4
- package/dist/{metadata-G73TILNE.js → metadata-UVOHT2VF.js} +6 -4
- package/dist/{metadata-4ZZ4ZIWJ.js → metadata-ZBSZL74N.js} +6 -4
- package/dist/{offer-create-page-PPXRYET4.js → offer-create-page-53P65U2V.js} +11 -8
- package/dist/{offer-detail-page-BFGKAS4L.js → offer-detail-page-BGFLDXO7.js} +1 -1
- package/dist/{offer-variant-detail-page-BLHRF4MK.js → offer-variant-detail-page-DCTRZUTM.js} +1 -1
- package/dist/{offers-7I67VSHI.js → offers-5776XUH5.js} +13 -9
- package/dist/{onboarding-7MURQYXX.js → onboarding-ROLIHG3L.js} +6 -4
- package/dist/{orders-D7NZNDUS.js → orders-VA3HNJAY.js} +12 -11
- package/dist/{organization-T6ZTYMMW.js → organization-UH4IUA62.js} +8 -6
- package/dist/pages/index.d.ts +9 -1
- package/dist/pages/index.js +53 -44
- package/dist/{payment-details-UQ65D5AY.js → payment-details-CD4GZEUL.js} +6 -4
- 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-CPPIL627.js → pricing-SWUZSQL3.js} +8 -6
- package/dist/{product-tags-7DTA73YT.js → product-tags-4V65LOJJ.js} +19 -16
- package/dist/{product-types-OB26NF2D.js → product-types-CMI33S32.js} +3 -4
- package/dist/{product-variant-detail-4DDE6RJ5.js → product-variant-detail-NW3LQZE7.js} +6 -4
- package/dist/{product-variant-edit-SAZUI4E3.js → product-variant-edit-MNYFEZND.js} +9 -7
- package/dist/{products-RYXTZFGT.js → products-L2H6HOL2.js} +18 -15
- package/dist/{products-GJ2KTGBZ.js → products-YIF6FPBO.js} +12 -9
- package/dist/{professional-details-UN5B4YDJ.js → professional-details-QO5BWMRD.js} +6 -4
- package/dist/{profile-6MIDTK52.js → profile-2KKBVKAL.js} +6 -4
- package/dist/{promotions-SQ47TCZL.js → promotions-C5YWXVP5.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-SZ2T6QQA.js} +8 -6
- package/dist/reservations-C326XEVA.js +350 -0
- package/dist/{reset-password-C462PDN2.js → reset-password-H66R27K4.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-THSRJ5WS.js} +26 -23
- package/dist/{shipment-6CTA2GHU.js → shipment-X2WWJ3AE.js} +6 -4
- package/dist/{shipping-profile-CFISOMTE.js → shipping-profile-7P3RPEIJ.js} +1 -1
- package/dist/{shipping-profiles-5UAZNYKJ.js → shipping-profiles-JPBRRMPD.js} +8 -6
- package/dist/{stock-465GEUY3.js → stock-UMESDWV5.js} +21 -7
- package/dist/{store-2PQB2XWE.js → store-5YMOSKVT.js} +7 -5
- package/dist/{store-closure-DYW54VHB.js → store-closure-EPGDOV7U.js} +6 -4
- package/dist/{store-select-6A5YR7WH.js → store-select-JEEV4V57.js} +7 -5
- package/dist/{team-GXEBC57M.js → team-R6ARMF73.js} +9 -7
- 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-SQU5UOGE.js +0 -105
- package/dist/{[location_id]-OXNC5E4F.js → [location_id]-IGPM7LDR.js} +1 -1
- package/dist/{chunk-CYE7HVAV.js → chunk-SCJBJQCL.js} +3 -3
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
currencies,
|
|
3
3
|
getCurrencySymbol
|
|
4
4
|
} from "./chunk-IQPN4PZJ.js";
|
|
5
|
+
import {
|
|
6
|
+
Combobox
|
|
7
|
+
} from "./chunk-VAFGNDAP.js";
|
|
5
8
|
import {
|
|
6
9
|
Form
|
|
7
10
|
} from "./chunk-3QSRE5LS.js";
|
|
@@ -13,6 +16,7 @@ import {
|
|
|
13
16
|
import {
|
|
14
17
|
CurrencyInput,
|
|
15
18
|
DatePicker,
|
|
19
|
+
Divider,
|
|
16
20
|
Heading,
|
|
17
21
|
Input,
|
|
18
22
|
RadioGroup,
|
|
@@ -94,7 +98,7 @@ var CreateCampaignFormFields = ({
|
|
|
94
98
|
name: `${fieldScope}campaign_identifier`,
|
|
95
99
|
render: ({ field }) => {
|
|
96
100
|
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
97
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("campaigns.fields.identifier") }),
|
|
101
|
+
/* @__PURE__ */ jsx(Form.Label, { tooltip: t("campaigns.fields.identifier_tooltip"), children: t("campaigns.fields.identifier") }),
|
|
98
102
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field, value: field.value ?? "" }) }),
|
|
99
103
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
100
104
|
] });
|
|
@@ -163,7 +167,8 @@ var CreateCampaignFormFields = ({
|
|
|
163
167
|
}
|
|
164
168
|
)
|
|
165
169
|
] }),
|
|
166
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ jsx(Divider, { variant: "dashed", "data-testid": "campaign-create-form-fields-budget-divider" }),
|
|
171
|
+
/* @__PURE__ */ jsxs("div", { "data-testid": "campaign-create-form-fields-budget-header", children: [
|
|
167
172
|
/* @__PURE__ */ jsx(Heading, { children: t("campaigns.budget.create.header") }),
|
|
168
173
|
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("campaigns.budget.create.hint") })
|
|
169
174
|
] }),
|
|
@@ -184,7 +189,7 @@ var CreateCampaignFormFields = ({
|
|
|
184
189
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
|
|
185
190
|
RadioGroup,
|
|
186
191
|
{
|
|
187
|
-
className: "
|
|
192
|
+
className: "grid grid-cols-2 gap-4",
|
|
188
193
|
...field,
|
|
189
194
|
value: field.value,
|
|
190
195
|
onValueChange: field.onChange,
|
|
@@ -237,7 +242,12 @@ var CreateCampaignFormFields = ({
|
|
|
237
242
|
onValueChange: onChange,
|
|
238
243
|
disabled: !!fieldScope?.length,
|
|
239
244
|
children: [
|
|
240
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(
|
|
245
|
+
/* @__PURE__ */ jsx(Select.Trigger, { ref, className: "w-full", children: /* @__PURE__ */ jsx(
|
|
246
|
+
Select.Value,
|
|
247
|
+
{
|
|
248
|
+
placeholder: t("campaigns.budget.fields.selectCurrency")
|
|
249
|
+
}
|
|
250
|
+
) }),
|
|
241
251
|
/* @__PURE__ */ jsx(Select.Content, { children: Object.values(currencies).filter(
|
|
242
252
|
(currency2) => !!sellerCurrencyCode && currency2.code.toLowerCase() === sellerCurrencyCode.toLowerCase()
|
|
243
253
|
).map((currency2) => /* @__PURE__ */ jsx(
|
|
@@ -262,10 +272,11 @@ var CreateCampaignFormFields = ({
|
|
|
262
272
|
control: form.control,
|
|
263
273
|
name: `${fieldScope}budget.limit`,
|
|
264
274
|
render: ({ field: { onChange, value, ...field } }) => {
|
|
265
|
-
return /* @__PURE__ */ jsxs(Form.Item, {
|
|
275
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
266
276
|
/* @__PURE__ */ jsx(
|
|
267
277
|
Form.Label,
|
|
268
278
|
{
|
|
279
|
+
optional: true,
|
|
269
280
|
tooltip: !currency && isTypeSpend ? t("promotions.fields.amount.tooltip") : void 0,
|
|
270
281
|
children: t("campaigns.budget.fields.limit")
|
|
271
282
|
}
|
|
@@ -300,8 +311,50 @@ var CreateCampaignFormFields = ({
|
|
|
300
311
|
] });
|
|
301
312
|
}
|
|
302
313
|
}
|
|
314
|
+
),
|
|
315
|
+
!isTypeSpend && /* @__PURE__ */ jsx(
|
|
316
|
+
Form.Field,
|
|
317
|
+
{
|
|
318
|
+
control: form.control,
|
|
319
|
+
name: `${fieldScope}budget.attribute`,
|
|
320
|
+
render: ({ field }) => {
|
|
321
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
322
|
+
/* @__PURE__ */ jsx(
|
|
323
|
+
Form.Label,
|
|
324
|
+
{
|
|
325
|
+
optional: true,
|
|
326
|
+
tooltip: t("campaigns.budget.fields.budgetAttributeTooltip"),
|
|
327
|
+
children: t("campaigns.budget.fields.budgetAttribute")
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
331
|
+
Combobox,
|
|
332
|
+
{
|
|
333
|
+
className: "w-full",
|
|
334
|
+
...field,
|
|
335
|
+
value: field.value ?? void 0,
|
|
336
|
+
onChange: (e) => {
|
|
337
|
+
field.onChange(typeof e === "undefined" ? null : e);
|
|
338
|
+
},
|
|
339
|
+
allowClear: true,
|
|
340
|
+
options: [
|
|
341
|
+
{ label: t("fields.customer"), value: "customer_id" },
|
|
342
|
+
{ label: t("fields.email"), value: "customer_email" },
|
|
343
|
+
{
|
|
344
|
+
label: t("fields.promotionCode"),
|
|
345
|
+
value: "promotion_code"
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"attribute"
|
|
350
|
+
) }),
|
|
351
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
352
|
+
] });
|
|
353
|
+
}
|
|
354
|
+
}
|
|
303
355
|
)
|
|
304
|
-
] })
|
|
356
|
+
] }),
|
|
357
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("campaigns.budget.noLimitHint") })
|
|
305
358
|
] });
|
|
306
359
|
};
|
|
307
360
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/pages/reviews/common/utils.tsx
|
|
2
|
+
import { StarSolid } from "@medusajs/icons";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var getReviewStatusProps = (status, t) => {
|
|
5
|
+
switch (status) {
|
|
6
|
+
case "published":
|
|
7
|
+
return { color: "green", label: t("reviews.status.published") };
|
|
8
|
+
case "rejected":
|
|
9
|
+
return { color: "red", label: t("reviews.status.rejected") };
|
|
10
|
+
case "pending":
|
|
11
|
+
default:
|
|
12
|
+
return { color: "orange", label: t("reviews.status.pending") };
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var StarRating = ({ rating }) => {
|
|
16
|
+
const value = Math.max(0, Math.min(5, Math.round(rating)));
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-0.5", "aria-label": `${value} / 5`, children: Array.from({ length: 5 }).map(
|
|
18
|
+
(_, index) => index < value ? /* @__PURE__ */ jsx(StarSolid, { className: "text-ui-tag-orange-icon" }, index) : /* @__PURE__ */ jsx(
|
|
19
|
+
StarSolid,
|
|
20
|
+
{
|
|
21
|
+
className: "text-ui-tag-orange-icon opacity-30"
|
|
22
|
+
},
|
|
23
|
+
index
|
|
24
|
+
)
|
|
25
|
+
) });
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
getReviewStatusProps,
|
|
30
|
+
StarRating
|
|
31
|
+
};
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
} from "./chunk-OVPAOBZB.js";
|
|
20
20
|
import {
|
|
21
21
|
UploadMediaFormItem
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7J2QRH4V.js";
|
|
23
23
|
import {
|
|
24
24
|
PRODUCT_CREATE_FORM_DEFAULTS,
|
|
25
25
|
ProductCreateSchema,
|
|
26
26
|
generateVariantsFromAttributes,
|
|
27
27
|
normalizeProductFormValues
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-6ECHPZS3.js";
|
|
29
29
|
import {
|
|
30
30
|
ChipInput
|
|
31
31
|
} from "./chunk-KDE4HKH2.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from "./chunk-4OQLPIUZ.js";
|
|
36
36
|
import {
|
|
37
37
|
Combobox
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VAFGNDAP.js";
|
|
39
39
|
import {
|
|
40
40
|
TabbedForm,
|
|
41
41
|
useTabbedForm
|
|
@@ -52,16 +52,16 @@ import {
|
|
|
52
52
|
import {
|
|
53
53
|
_DataTable,
|
|
54
54
|
useDataTable
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-6GQLSWOO.js";
|
|
56
56
|
import {
|
|
57
57
|
require_dist
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-VH3TGSWE.js";
|
|
59
59
|
import {
|
|
60
60
|
ActionMenu
|
|
61
61
|
} from "./chunk-BDGZ4EQO.js";
|
|
62
62
|
import {
|
|
63
63
|
useFeatureFlags
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-6YQR2AWM.js";
|
|
65
65
|
import {
|
|
66
66
|
useCreateProduct,
|
|
67
67
|
useProductAttributes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OfferListActions,
|
|
3
|
+
OfferListDataTable,
|
|
4
|
+
OfferListHeader,
|
|
5
|
+
OfferListTable,
|
|
6
|
+
OfferListTitle
|
|
7
|
+
} from "./chunk-QSS7ATY3.js";
|
|
8
|
+
import {
|
|
9
|
+
SingleColumnPage
|
|
10
|
+
} from "./chunk-YV6MK4PZ.js";
|
|
11
|
+
|
|
12
|
+
// src/pages/offers/offer-list-page.tsx
|
|
13
|
+
import { Children } from "react";
|
|
14
|
+
import { WidgetZone } from "@mercurjs/dashboard-shared";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
var Root = ({ children }) => /* @__PURE__ */ jsx(SingleColumnPage, { children: /* @__PURE__ */ jsx(WidgetZone, { id: "offers.list", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx(OfferListTable, {}) }) });
|
|
17
|
+
var OfferListPage = Object.assign(Root, {
|
|
18
|
+
Table: OfferListTable,
|
|
19
|
+
Header: OfferListHeader,
|
|
20
|
+
HeaderTitle: OfferListTitle,
|
|
21
|
+
HeaderActions: OfferListActions,
|
|
22
|
+
DataTable: OfferListDataTable
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
OfferListPage
|
|
27
|
+
};
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PriceListUpdateOffersSchema,
|
|
3
|
+
usePriceListCurrencyData,
|
|
4
|
+
usePriceListGridColumns
|
|
5
|
+
} from "./chunk-DAOSTHVB.js";
|
|
6
|
+
import {
|
|
7
|
+
DataGrid
|
|
8
|
+
} from "./chunk-5FBQOAXU.js";
|
|
9
|
+
import {
|
|
10
|
+
castNumber
|
|
11
|
+
} from "./chunk-SMQT3ZNO.js";
|
|
12
|
+
import {
|
|
13
|
+
KeyboundForm
|
|
14
|
+
} from "./chunk-SITRHMZZ.js";
|
|
15
|
+
import {
|
|
16
|
+
RouteFocusModal,
|
|
17
|
+
useRouteModal
|
|
18
|
+
} from "./chunk-GDWBOQI5.js";
|
|
19
|
+
import {
|
|
20
|
+
useBatchPriceListPrices,
|
|
21
|
+
usePriceList
|
|
22
|
+
} from "./chunk-NV2RZAHW.js";
|
|
23
|
+
import {
|
|
24
|
+
useOffers
|
|
25
|
+
} from "./chunk-PF7R7LMW.js";
|
|
26
|
+
import {
|
|
27
|
+
useProducts
|
|
28
|
+
} from "./chunk-EMUCGKHP.js";
|
|
29
|
+
|
|
30
|
+
// src/pages/price-lists/[id]/products/[variant_id]/edit/price-list-prices-edit-form/use-price-list-edit-grid.tsx
|
|
31
|
+
import { buildOfferGridData } from "@mercurjs/dashboard-shared";
|
|
32
|
+
import { useMemo } from "react";
|
|
33
|
+
var extractOfferId = (price) => price.rules?.offer_id ?? price.price_rules?.find((r) => r.attribute === "offer_id")?.value ?? void 0;
|
|
34
|
+
var usePriceListEditGrid = (id, productFilter) => {
|
|
35
|
+
const { price_list, isLoading, isError, error } = usePriceList(id, {
|
|
36
|
+
fields: "id,title,+prices.amount,+prices.currency_code,+prices.price_set.variant.id,+prices.price_rules.attribute,+prices.price_rules.value"
|
|
37
|
+
});
|
|
38
|
+
const offerIds = useMemo(() => {
|
|
39
|
+
const set = /* @__PURE__ */ new Set();
|
|
40
|
+
for (const price of price_list?.prices ?? []) {
|
|
41
|
+
const offerId = extractOfferId(price);
|
|
42
|
+
if (offerId) {
|
|
43
|
+
set.add(offerId);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return Array.from(set);
|
|
47
|
+
}, [price_list]);
|
|
48
|
+
const { offers: pricedOffers } = useOffers(
|
|
49
|
+
{
|
|
50
|
+
id: offerIds,
|
|
51
|
+
limit: offerIds.length || 1,
|
|
52
|
+
fields: "id,product_id"
|
|
53
|
+
},
|
|
54
|
+
{ enabled: offerIds.length > 0 }
|
|
55
|
+
);
|
|
56
|
+
const pricedProductIds = useMemo(() => {
|
|
57
|
+
const set = /* @__PURE__ */ new Set();
|
|
58
|
+
for (const offer of pricedOffers ?? []) {
|
|
59
|
+
set.add(offer.product_id);
|
|
60
|
+
}
|
|
61
|
+
return set;
|
|
62
|
+
}, [pricedOffers]);
|
|
63
|
+
const { offers: allOffers } = useOffers(
|
|
64
|
+
{
|
|
65
|
+
limit: 1e3,
|
|
66
|
+
fields: "id,variant_id,product_id,sku,product.title,product.thumbnail"
|
|
67
|
+
},
|
|
68
|
+
{ enabled: pricedProductIds.size > 0 }
|
|
69
|
+
);
|
|
70
|
+
const scopedOffers = useMemo(() => {
|
|
71
|
+
const allowed = productFilter ? new Set(productFilter) : void 0;
|
|
72
|
+
return (allOffers ?? []).filter(
|
|
73
|
+
(o) => pricedProductIds.has(o.product_id) && (!allowed || allowed.has(o.product_id))
|
|
74
|
+
);
|
|
75
|
+
}, [allOffers, pricedProductIds, productFilter]);
|
|
76
|
+
const productIds = useMemo(
|
|
77
|
+
() => Array.from(new Set(scopedOffers.map((o) => o.product_id))),
|
|
78
|
+
[scopedOffers]
|
|
79
|
+
);
|
|
80
|
+
const {
|
|
81
|
+
products,
|
|
82
|
+
isLoading: isProductsLoading,
|
|
83
|
+
isError: isProductsError,
|
|
84
|
+
error: productError
|
|
85
|
+
} = useProducts(
|
|
86
|
+
{
|
|
87
|
+
id: productIds,
|
|
88
|
+
limit: productIds.length || 1,
|
|
89
|
+
fields: "id,*variants"
|
|
90
|
+
},
|
|
91
|
+
{ enabled: productIds.length > 0 }
|
|
92
|
+
);
|
|
93
|
+
const { gridData, variantIdByOffer } = useMemo(
|
|
94
|
+
() => buildOfferGridData(
|
|
95
|
+
scopedOffers,
|
|
96
|
+
products ?? []
|
|
97
|
+
),
|
|
98
|
+
[scopedOffers, products]
|
|
99
|
+
);
|
|
100
|
+
const currencyData = usePriceListCurrencyData();
|
|
101
|
+
const gridDataReady = offerIds.length === 0 || allOffers !== void 0 && (productIds.length === 0 || products !== void 0);
|
|
102
|
+
const ready = currencyData.isReady && !isLoading && !!price_list && !isProductsLoading && gridDataReady;
|
|
103
|
+
return {
|
|
104
|
+
price_list,
|
|
105
|
+
gridData,
|
|
106
|
+
variantIdByOffer,
|
|
107
|
+
currencyData,
|
|
108
|
+
ready,
|
|
109
|
+
isError,
|
|
110
|
+
error,
|
|
111
|
+
isProductsError,
|
|
112
|
+
productError
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// src/pages/price-lists/[id]/products/[variant_id]/edit/price-list-prices-edit-form/price-list-prices-edit-form.tsx
|
|
117
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
118
|
+
import { Button, toast } from "@medusajs/ui";
|
|
119
|
+
import { useRef } from "react";
|
|
120
|
+
import { useForm } from "react-hook-form";
|
|
121
|
+
import { useTranslation } from "react-i18next";
|
|
122
|
+
import { z } from "zod";
|
|
123
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
124
|
+
var PricingOfferPricesSchema = z.object({
|
|
125
|
+
offers: PriceListUpdateOffersSchema
|
|
126
|
+
});
|
|
127
|
+
var PriceListPricesEditForm = ({
|
|
128
|
+
priceList,
|
|
129
|
+
gridData,
|
|
130
|
+
variantIdByOffer,
|
|
131
|
+
regions,
|
|
132
|
+
currencies,
|
|
133
|
+
pricePreferences
|
|
134
|
+
}) => {
|
|
135
|
+
const { t } = useTranslation();
|
|
136
|
+
const { handleSuccess, setCloseOnEscape } = useRouteModal();
|
|
137
|
+
const initialValue = useRef(initRecord(priceList, variantIdByOffer));
|
|
138
|
+
const form = useForm({
|
|
139
|
+
defaultValues: {
|
|
140
|
+
offers: initialValue.current
|
|
141
|
+
},
|
|
142
|
+
resolver: zodResolver(PricingOfferPricesSchema)
|
|
143
|
+
});
|
|
144
|
+
const { mutateAsync, isPending } = useBatchPriceListPrices(priceList.id);
|
|
145
|
+
const handleSubmit = form.handleSubmit(async (values) => {
|
|
146
|
+
const { pricesToDelete, pricesToCreate, pricesToUpdate } = sortPrices(
|
|
147
|
+
values.offers,
|
|
148
|
+
initialValue.current,
|
|
149
|
+
regions,
|
|
150
|
+
variantIdByOffer
|
|
151
|
+
);
|
|
152
|
+
mutateAsync(
|
|
153
|
+
{
|
|
154
|
+
delete: pricesToDelete,
|
|
155
|
+
update: pricesToUpdate,
|
|
156
|
+
create: pricesToCreate
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
onSuccess: () => {
|
|
160
|
+
toast.success(t("priceLists.products.edit.successToast"));
|
|
161
|
+
handleSuccess();
|
|
162
|
+
},
|
|
163
|
+
onError: (error) => {
|
|
164
|
+
toast.error(error.message);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
const columns = usePriceListGridColumns({
|
|
170
|
+
currencies,
|
|
171
|
+
regions,
|
|
172
|
+
pricePreferences
|
|
173
|
+
});
|
|
174
|
+
return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex size-full flex-col", children: [
|
|
175
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
|
|
176
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-col overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
177
|
+
DataGrid,
|
|
178
|
+
{
|
|
179
|
+
columns,
|
|
180
|
+
data: gridData,
|
|
181
|
+
state: form,
|
|
182
|
+
onEditingChange: (editing) => setCloseOnEscape(!editing)
|
|
183
|
+
}
|
|
184
|
+
) }),
|
|
185
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
186
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
187
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
|
188
|
+
] }) })
|
|
189
|
+
] }) });
|
|
190
|
+
};
|
|
191
|
+
function initRecord(priceList, variantIdByOffer = {}) {
|
|
192
|
+
const record = {};
|
|
193
|
+
for (const [offerId, variantId] of Object.entries(variantIdByOffer)) {
|
|
194
|
+
record[offerId] = {
|
|
195
|
+
variant_id: variantId,
|
|
196
|
+
currency_prices: {},
|
|
197
|
+
region_prices: {}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
for (const price of priceList.prices ?? []) {
|
|
201
|
+
const offerId = price.rules?.offer_id;
|
|
202
|
+
const variantId = price.variant_id;
|
|
203
|
+
if (!offerId || !variantId) {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
const entry = record[offerId] ?? (record[offerId] = {
|
|
207
|
+
variant_id: variantId,
|
|
208
|
+
currency_prices: {},
|
|
209
|
+
region_prices: {}
|
|
210
|
+
});
|
|
211
|
+
const regionId = price.rules?.region_id;
|
|
212
|
+
if (regionId) {
|
|
213
|
+
entry.region_prices[regionId] = {
|
|
214
|
+
amount: price.amount.toString(),
|
|
215
|
+
id: price.id
|
|
216
|
+
};
|
|
217
|
+
} else {
|
|
218
|
+
entry.currency_prices[price.currency_code] = {
|
|
219
|
+
amount: price.amount.toString(),
|
|
220
|
+
id: price.id
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return record;
|
|
225
|
+
}
|
|
226
|
+
function convertToPriceArray(data, regions) {
|
|
227
|
+
const prices = [];
|
|
228
|
+
const regionCurrencyMap = regions.reduce(
|
|
229
|
+
(map, region) => {
|
|
230
|
+
map[region.id] = region.currency_code;
|
|
231
|
+
return map;
|
|
232
|
+
},
|
|
233
|
+
{}
|
|
234
|
+
);
|
|
235
|
+
for (const [offerId, offer] of Object.entries(data || {})) {
|
|
236
|
+
const { variant_id, currency_prices, region_prices } = offer || {};
|
|
237
|
+
for (const [currencyCode, price] of Object.entries(currency_prices || {})) {
|
|
238
|
+
if (price?.amount !== "" && typeof price?.amount !== "undefined") {
|
|
239
|
+
prices.push({
|
|
240
|
+
offerId,
|
|
241
|
+
variantId: variant_id,
|
|
242
|
+
currencyCode,
|
|
243
|
+
amount: castNumber(price.amount),
|
|
244
|
+
id: price.id
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
for (const [regionId, price] of Object.entries(region_prices || {})) {
|
|
249
|
+
if (price?.amount !== "" && typeof price?.amount !== "undefined") {
|
|
250
|
+
prices.push({
|
|
251
|
+
offerId,
|
|
252
|
+
variantId: variant_id,
|
|
253
|
+
regionId,
|
|
254
|
+
currencyCode: regionCurrencyMap[regionId],
|
|
255
|
+
amount: castNumber(price.amount),
|
|
256
|
+
id: price.id
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return prices;
|
|
262
|
+
}
|
|
263
|
+
function createMapKey(obj) {
|
|
264
|
+
return `${obj.offerId}-${obj.currencyCode}-${obj.regionId || "none"}-${obj.id || "none"}`;
|
|
265
|
+
}
|
|
266
|
+
function buildRules(price) {
|
|
267
|
+
return {
|
|
268
|
+
offer_id: price.offerId,
|
|
269
|
+
...price.regionId ? { region_id: price.regionId } : {}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function comparePrices(initialPrices, newPrices) {
|
|
273
|
+
const pricesToUpdate = [];
|
|
274
|
+
const pricesToCreate = [];
|
|
275
|
+
const pricesToDelete = [];
|
|
276
|
+
const initialPriceMap = initialPrices.reduce(
|
|
277
|
+
(map, price) => {
|
|
278
|
+
map[createMapKey(price)] = price;
|
|
279
|
+
return map;
|
|
280
|
+
},
|
|
281
|
+
{}
|
|
282
|
+
);
|
|
283
|
+
const newPriceMap = newPrices.reduce(
|
|
284
|
+
(map, price) => {
|
|
285
|
+
map[createMapKey(price)] = price;
|
|
286
|
+
return map;
|
|
287
|
+
},
|
|
288
|
+
{}
|
|
289
|
+
);
|
|
290
|
+
const keys = /* @__PURE__ */ new Set([
|
|
291
|
+
...Object.keys(initialPriceMap),
|
|
292
|
+
...Object.keys(newPriceMap)
|
|
293
|
+
]);
|
|
294
|
+
for (const key of keys) {
|
|
295
|
+
const initialPrice = initialPriceMap[key];
|
|
296
|
+
const newPrice = newPriceMap[key];
|
|
297
|
+
if (initialPrice && newPrice) {
|
|
298
|
+
if (isNaN(newPrice.amount) && newPrice.id) {
|
|
299
|
+
pricesToDelete.push(newPrice.id);
|
|
300
|
+
}
|
|
301
|
+
if (initialPrice.amount !== newPrice.amount && newPrice.id) {
|
|
302
|
+
pricesToUpdate.push({
|
|
303
|
+
id: newPrice.id,
|
|
304
|
+
variant_id: newPrice.variantId,
|
|
305
|
+
currency_code: newPrice.currencyCode,
|
|
306
|
+
rules: buildRules(newPrice),
|
|
307
|
+
amount: newPrice.amount
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (!initialPrice && newPrice) {
|
|
312
|
+
pricesToCreate.push({
|
|
313
|
+
variant_id: newPrice.variantId,
|
|
314
|
+
currency_code: newPrice.currencyCode,
|
|
315
|
+
rules: buildRules(newPrice),
|
|
316
|
+
amount: newPrice.amount
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
if (initialPrice && !newPrice && initialPrice.id) {
|
|
320
|
+
pricesToDelete.push(initialPrice.id);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return { pricesToDelete, pricesToCreate, pricesToUpdate };
|
|
324
|
+
}
|
|
325
|
+
function sortPrices(data, initialValue, regions, _variantIdByOffer) {
|
|
326
|
+
const initialPrices = convertToPriceArray(initialValue, regions);
|
|
327
|
+
const newPrices = convertToPriceArray(data, regions);
|
|
328
|
+
return comparePrices(initialPrices, newPrices);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export {
|
|
332
|
+
usePriceListEditGrid,
|
|
333
|
+
PriceListPricesEditForm
|
|
334
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useProductTableColumns
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NQMHP2LC.js";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_FIELDS,
|
|
6
6
|
useProductTableQuery
|
|
7
7
|
} from "./chunk-BEPAXQMU.js";
|
|
8
8
|
import {
|
|
9
9
|
useProductTableFilters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-U3OEGBHH.js";
|
|
11
11
|
import {
|
|
12
12
|
SingleColumnPage
|
|
13
13
|
} from "./chunk-YV6MK4PZ.js";
|
|
14
14
|
import {
|
|
15
15
|
_DataTable,
|
|
16
16
|
useDataTable
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6GQLSWOO.js";
|
|
18
18
|
import {
|
|
19
19
|
ActionMenu
|
|
20
20
|
} from "./chunk-BDGZ4EQO.js";
|