@feedmepos/mf-menu 0.31.15-beta.1 → 0.31.16-beta.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/{App-D87EP5SE.js → App-Bsppf5CN.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BnthFRoy.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DTuPAGEJ.js} +2 -2
- package/dist/{Catalog-DS4wKymx.js → Catalog-Bj3MNcLG.js} +5 -5
- package/dist/{Category-D1TPC-aA.js → Category-CHvG2e6b.js} +5 -5
- package/dist/{Category-GbhIPLBW.js → Category-WLIH1Zyc.js} +4 -4
- package/dist/{CookingGuide-C39Ecv1F.js → CookingGuide-C8N45xnL.js} +3 -3
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DUeeVaHx.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-GriZxAIw.js} +1 -1
- package/dist/{Group-dErNLF6H.js → Group-Byj3qEBv.js} +3 -3
- package/dist/{Group-BzhEIgZk.js → Group-CR3LWKXE.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BFXGHdMi.js → Group.vue_vue_type_script_setup_true_lang-tecpeqJT.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5lGsR6N.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BkLHDcZV.js} +3 -3
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-D24MTd_K.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BRlU0arf.js} +12380 -12246
- package/dist/{Ingredient-laBtGjS5.js → Ingredient-BCfCDCFS.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DL8q7CNv.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CpXnjduY.js} +2 -2
- package/dist/{LinkProductSideSheet-DX-MRKfp.js → LinkProductSideSheet-BGlLnnm9.js} +1 -1
- package/dist/{MenuSetting-BIT1THUu.js → MenuSetting-CdKhTxyc.js} +4 -4
- package/dist/{PrintRoute-BIvz4aN1.js → PrintRoute-B-UlUlSD.js} +3 -3
- package/dist/{Product-CtfrgVK0.js → Product-BggNPOwm.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CvlMJdJf.js → Product.vue_vue_type_script_setup_true_lang-DPOaafZ-.js} +11 -11
- package/dist/{Products-Ds2Yxmxo.js → Products-DZFgAKxB.js} +685 -684
- package/dist/Publish-BTPdN1Ub.js +547 -0
- package/dist/{Recipe-ul4kMBPm.js → Recipe-CibJRxHH.js} +4 -4
- package/dist/{Scheduler-CoGSCUHZ.js → Scheduler-DAShXnol.js} +3 -3
- package/dist/{ServingSequence-BLf6AqJ8.js → ServingSequence-DFs7VR5V.js} +3 -3
- package/dist/{Setting-Du7gpreX.js → Setting-aApApOKZ.js} +4 -4
- package/dist/{Subcategory-DTwKpA8u.js → Subcategory-CGnGq5Kd.js} +4 -4
- package/dist/{Takeaway-DxgaJnU0.js → Takeaway-C8M-Z4eK.js} +4 -4
- package/dist/{Takeaway-8xbOp8Xa.js → Takeaway-rJDqoozq.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-vdmvli1A.js → Takeaway.vue_vue_type_script_setup_true_lang-CrFeCwvr.js} +5 -5
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-b9NscJTY.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CCVSPoDB.js} +12 -12
- package/dist/{Unit-Ap7qpY-q.js → Unit-CcWjE73k.js} +2 -2
- package/dist/{Variant-POkEu-3s.js → Variant-BDPjFaAa.js} +3 -3
- package/dist/{_id_--9S7--di.js → _id_-mUBoDBKS.js} +9 -9
- package/dist/{app-CK6ZrpdZ.js → app-BBoQR7rs.js} +25 -26
- package/dist/{app-BFZyK9BE.js → app-sdhJyRKX.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +4 -4
- package/dist/apps/mf-menu/src/helper/import-export.d.ts +9 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-CXhE5uCO.js → linked-status-BkX3Y-ws.js} +2 -2
- package/dist/assets/{override-menu-DVX8Orl1.js → override-menu-Bo0ZNZ-U.js} +2 -2
- package/dist/assets/{validate-menu-Di70DZHf.js → validate-menu-CIWz9YXT.js} +2 -2
- package/dist/{catalog-cJG6G1UU.js → catalog-BbukcamZ.js} +1 -1
- package/dist/{catalogSetting-CXaK7AC0.js → catalogSetting-7ZMZjqGs.js} +1 -1
- package/dist/{category-RIXHr3i-.js → category-Cq2MmCBq.js} +1 -1
- package/dist/{currency-Bh0cQzAv.js → currency-OQd6moI9.js} +1 -1
- package/dist/{dayjs.min-CeOhrh22.js → dayjs.min-m51FMJgI.js} +1 -1
- package/dist/{index-CkF36-Yy.js → index-B5uSVMTf.js} +1 -1
- package/dist/{index-9k68QbSm.js → index-DlTid7hh.js} +3 -3
- package/dist/{index-BjLVYbeK.js → index-b9FcXU4s.js} +2 -2
- package/dist/{item-hh2futyR.js → item-96CGb3Kx.js} +14 -14
- package/dist/{menu-b1EX-c7r.js → menu-BmBsIlGC.js} +1 -1
- package/dist/{menu-CkxpNa3P.js → menu-Bqiz6B2P.js} +2273 -2273
- package/dist/{priceTier-_xtW9BQW.js → priceTier-Ck8MqQWD.js} +1 -1
- package/dist/{scheduler-DpPfzjup.js → scheduler-DeOCwKnf.js} +3 -3
- package/dist/{subcategory-CH1FS_Is.js → subcategory-DbiQCCF5.js} +99 -99
- package/dist/{toExcel-C808hu94.js → toExcel-BsguLQA5.js} +2 -2
- package/dist/{unit-Bj_UFAWe.js → unit-CnM6N-39.js} +1 -1
- package/package.json +1 -1
- package/dist/Publish-BOWb-F33.js +0 -569
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as d, ref as g, watch as _, resolveComponent as S, createBlock as T, openBlock as f, unref as y, computed as h } from "vue";
|
|
2
2
|
import { useI18n as m } from "@feedmepos/mf-common";
|
|
3
3
|
import { useDialogChild as w, useDialog as x, useSnackbar as C } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as k, G as M } from "./menu-
|
|
4
|
+
import { u as k, G as M } from "./menu-Bqiz6B2P.js";
|
|
5
5
|
const v = /* @__PURE__ */ d({
|
|
6
6
|
__name: "AddPriceGroupDialog",
|
|
7
7
|
setup(s) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as le, computed as Y, resolveComponent as v, createElementBlock as i, openBlock as u, createVNode as l, createCommentVNode as g, unref as a, toDisplayString as P, createElementVNode as y, withCtx as _, Fragment as D, renderList as A, createBlock as N, ref as T, Transition as ee, createTextVNode as se } from "vue";
|
|
2
|
-
import { J as b, I as d, u as ie, K as de, M as X } from "./menu-
|
|
2
|
+
import { J as b, I as d, u as ie, K as de, M as X } from "./menu-Bqiz6B2P.js";
|
|
3
3
|
import { useI18n as te } from "@feedmepos/mf-common";
|
|
4
4
|
import { components as re } from "@feedmepos/ui-library";
|
|
5
5
|
import { _ as ce } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
6
6
|
import { _ as W } from "./FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js";
|
|
7
7
|
import { u as me } from "./discardConfirm-BHni0LNu.js";
|
|
8
|
-
import { u as pe } from "./menu-
|
|
9
|
-
import { L as _e } from "./LinkProductSideSheet-
|
|
8
|
+
import { u as pe } from "./menu-BmBsIlGC.js";
|
|
9
|
+
import { L as _e } from "./LinkProductSideSheet-BGlLnnm9.js";
|
|
10
10
|
const ve = { class: "space-y-8" }, fe = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "space-y-16"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
import { J as k, A as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
1
|
+
import { shallowRef as Q, ref as R, computed as h, shallowReactive as Te, effectScope as Re, watch as Y, defineComponent as Ne, resolveComponent as z, createBlock as Ve, openBlock as Oe, unref as V, withCtx as Pe, createVNode as xe } from "vue";
|
|
2
|
+
import { J as k, A as O, aj as ee, I, ak as G, M as S, K as te, a9 as C, c as $, $ as E, ai as L, al as Ue, am as Ae, z as Ke, ab as $e, an as De, a8 as J, u as qe } from "./menu-Bqiz6B2P.js";
|
|
3
|
+
import { useCoreStore as Z, useI18n as ne } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as Ye, useDialogChild as He } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as We } from "pinia";
|
|
6
|
-
const
|
|
7
|
-
function
|
|
6
|
+
const Be = "/assets/linked-status-BkX3Y-ws.js", je = "/assets/override-menu-Bo0ZNZ-U.js";
|
|
7
|
+
function ze(e) {
|
|
8
8
|
var o;
|
|
9
9
|
const n = k(e), a = (o = n.variant) == null ? void 0 : o.variantCombinations;
|
|
10
10
|
return delete n.variant, delete n.thumbnail, [n, ...a || []];
|
|
11
11
|
}
|
|
12
12
|
function Ge(e, n, a, o) {
|
|
13
|
-
const r = k(n), f = a ? r.modules.catalog.find((_) => _._id === a) : null, d = o ? r.modules.scheduler.find((_) => _._id === o) : null, i = f ? k(f) : void 0, m = a ? r.modules.catalog.filter((_) => _._id !== a) : [], u = d ? k(d) : void 0, s = e.reduce((_, y) => (_[y._id] =
|
|
13
|
+
const r = k(n), f = a ? r.modules.catalog.find((_) => _._id === a) : null, d = o ? r.modules.scheduler.find((_) => _._id === o) : null, i = f ? k(f) : void 0, m = a ? r.modules.catalog.filter((_) => _._id !== a) : [], u = d ? k(d) : void 0, s = e.reduce((_, y) => (_[y._id] = ze(y), _), {});
|
|
14
14
|
function p(_ = []) {
|
|
15
15
|
const y = e.map((b) => b._id);
|
|
16
16
|
return [
|
|
@@ -85,7 +85,7 @@ function Le(e, n) {
|
|
|
85
85
|
if (u)
|
|
86
86
|
return T(u, n, 1);
|
|
87
87
|
const s = {
|
|
88
|
-
...
|
|
88
|
+
...O.generator.initMenuV4ItemOverrider(),
|
|
89
89
|
_id: m._id,
|
|
90
90
|
combinationKey: m.combinationKey
|
|
91
91
|
};
|
|
@@ -93,7 +93,7 @@ function Le(e, n) {
|
|
|
93
93
|
});
|
|
94
94
|
return { ...f, items: i };
|
|
95
95
|
}), o = e.variant ? e.variant.variantCombinations.map((f) => T(f, n, 1)) : [], r = {
|
|
96
|
-
...
|
|
96
|
+
...O.generator.initMenuV4ItemOverrider(),
|
|
97
97
|
_id: e._id,
|
|
98
98
|
name: e.name,
|
|
99
99
|
code: e.code,
|
|
@@ -101,7 +101,7 @@ function Le(e, n) {
|
|
|
101
101
|
};
|
|
102
102
|
return [...o, r];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function H(e, n) {
|
|
105
105
|
var o;
|
|
106
106
|
if (!n)
|
|
107
107
|
return e;
|
|
@@ -114,7 +114,7 @@ function Y(e, n) {
|
|
|
114
114
|
const u = (s = f == null ? void 0 : f.items) == null ? void 0 : s.find(
|
|
115
115
|
(p) => p._id === m._id && p.combinationKey === m.combinationKey
|
|
116
116
|
);
|
|
117
|
-
return
|
|
117
|
+
return H(m, u);
|
|
118
118
|
}), r;
|
|
119
119
|
}), a;
|
|
120
120
|
}
|
|
@@ -128,7 +128,7 @@ function Je(e, n) {
|
|
|
128
128
|
);
|
|
129
129
|
if (!f)
|
|
130
130
|
throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
|
|
131
|
-
return
|
|
131
|
+
return H(f, r);
|
|
132
132
|
})
|
|
133
133
|
});
|
|
134
134
|
const o = a.find((r) => !r.combinationKey);
|
|
@@ -142,7 +142,7 @@ function Je(e, n) {
|
|
|
142
142
|
const m = (u = f == null ? void 0 : f.items) == null ? void 0 : u.find(
|
|
143
143
|
(s) => s._id === i._id && s.combinationKey === i.combinationKey
|
|
144
144
|
);
|
|
145
|
-
return
|
|
145
|
+
return H(i, m);
|
|
146
146
|
}), r;
|
|
147
147
|
}), {
|
|
148
148
|
...n,
|
|
@@ -153,7 +153,7 @@ async function lt(e, n, a, o, r, f = !0) {
|
|
|
153
153
|
const d = k(a), i = f ? Ge(n, d, o, r) : d, m = n.reduce((p, _) => (p[_._id] = i.modules.item.find((y) => y._id === _._id), p), {}), u = n.reduce((p, _) => {
|
|
154
154
|
const y = _._id;
|
|
155
155
|
return p[y] = Le(m[y], e), p;
|
|
156
|
-
}, {}), s =
|
|
156
|
+
}, {}), s = O.getFallbackPrices({
|
|
157
157
|
rawMenu: i,
|
|
158
158
|
items: u,
|
|
159
159
|
catalogId: o || void 0,
|
|
@@ -180,22 +180,22 @@ function dt(e, n) {
|
|
|
180
180
|
return r;
|
|
181
181
|
}, [])) || []).join(" / ");
|
|
182
182
|
}
|
|
183
|
-
const
|
|
183
|
+
const D = /* @__PURE__ */ new Map();
|
|
184
184
|
async function mt(e, n) {
|
|
185
185
|
const a = `${e._id}-${e.updatedAt}-${n}`;
|
|
186
|
-
if (
|
|
187
|
-
return
|
|
186
|
+
if (D.has(a))
|
|
187
|
+
return D.get(a);
|
|
188
188
|
const o = await ee(
|
|
189
|
-
|
|
189
|
+
Be,
|
|
190
190
|
JSON.stringify({
|
|
191
191
|
menu: e,
|
|
192
192
|
itemId: n
|
|
193
193
|
})
|
|
194
194
|
);
|
|
195
|
-
return
|
|
195
|
+
return D.set(a, o), o;
|
|
196
196
|
}
|
|
197
197
|
async function oe(e, n, a) {
|
|
198
|
-
return await ee(
|
|
198
|
+
return await ee(je, {
|
|
199
199
|
menu: e,
|
|
200
200
|
catalogId: n,
|
|
201
201
|
schedulerId: a
|
|
@@ -232,7 +232,7 @@ function pt(e, n, a) {
|
|
|
232
232
|
return r(n, a);
|
|
233
233
|
}
|
|
234
234
|
const q = /* @__PURE__ */ new Map();
|
|
235
|
-
async function
|
|
235
|
+
async function Ze(e, n, a) {
|
|
236
236
|
const o = `${e._id}-${e.updatedAt}-${n || "null"}-${a || "null"}`;
|
|
237
237
|
if (q.has(o))
|
|
238
238
|
return q.get(o);
|
|
@@ -241,7 +241,7 @@ async function Xe(e, n, a) {
|
|
|
241
241
|
}
|
|
242
242
|
async function _t(e, n, a) {
|
|
243
243
|
var d, i;
|
|
244
|
-
const o = await
|
|
244
|
+
const o = await Ze(e, n, null), r = [], f = (m, u) => {
|
|
245
245
|
const s = k(m);
|
|
246
246
|
for (const p in u)
|
|
247
247
|
u[p] && (s[p] = u[p]);
|
|
@@ -251,8 +251,8 @@ async function _t(e, n, a) {
|
|
|
251
251
|
const u = (d = m.items) == null ? void 0 : d.find((p) => p._id === a && !p.combinationKey), s = e.modules.item.find((p) => p._id === a);
|
|
252
252
|
if (u) {
|
|
253
253
|
const p = (i = m.items) == null ? void 0 : i.filter((y) => y._id === a && y.combinationKey), _ = [u, ...p].map((y) => {
|
|
254
|
-
var
|
|
255
|
-
const b = y.combinationKey ? (P = (
|
|
254
|
+
var N, P;
|
|
255
|
+
const b = y.combinationKey ? (P = (N = s == null ? void 0 : s.variant) == null ? void 0 : N.variantCombinations) == null ? void 0 : P.find(
|
|
256
256
|
(x) => x.combinationKey === y.combinationKey
|
|
257
257
|
) : s, F = b && s ? f(s, b) : y;
|
|
258
258
|
return f(F, y);
|
|
@@ -265,10 +265,10 @@ async function _t(e, n, a) {
|
|
|
265
265
|
}
|
|
266
266
|
return r;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Xe({
|
|
269
269
|
maxHistorySize: e = 50
|
|
270
270
|
}) {
|
|
271
|
-
const n =
|
|
271
|
+
const n = Q([]), a = R(-1), o = h(() => a.value > 0), r = h(() => a.value < n.value.length - 1);
|
|
272
272
|
function f(u) {
|
|
273
273
|
n.value.push(u), a.value++, n.value.length > e && (n.value.shift(), a.value--);
|
|
274
274
|
}
|
|
@@ -292,7 +292,7 @@ function Qe({
|
|
|
292
292
|
clear: m
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
const
|
|
295
|
+
const Qe = {
|
|
296
296
|
async updateMenuModule(e, n) {
|
|
297
297
|
const a = S.RequestRunner.operation(n, e.modules);
|
|
298
298
|
if (a.validateError.length > 0)
|
|
@@ -341,21 +341,21 @@ function et() {
|
|
|
341
341
|
const tt = We(
|
|
342
342
|
"mf-menu-store-v2",
|
|
343
343
|
() => {
|
|
344
|
-
const e = Te(et()), n =
|
|
344
|
+
const e = Te(et()), n = Z(), a = Ye(), o = h(() => e.menu.modules.serveSequence ? C(e.menu.modules.serveSequence, {
|
|
345
345
|
selector: "position"
|
|
346
346
|
}) : []), r = h(() => {
|
|
347
347
|
var t;
|
|
348
|
-
return ((t = n.currentBusiness.value) == null ? void 0 : t.menuVersion) ||
|
|
349
|
-
}), f = h(() => r.value ===
|
|
348
|
+
return ((t = n.currentBusiness.value) == null ? void 0 : t.menuVersion) || $.F_MENU_VERSION.v3;
|
|
349
|
+
}), f = h(() => r.value === $.F_MENU_VERSION.v4), d = h(() => {
|
|
350
350
|
const t = e.menu.modules.catalog;
|
|
351
|
-
return
|
|
352
|
-
}), i = h(() => e.menu.modules.catalog.find((t) => t._id === e.currentCatalogId)), m = h(() =>
|
|
351
|
+
return C(t, { selector: "name" });
|
|
352
|
+
}), i = h(() => e.menu.modules.catalog.find((t) => t._id === e.currentCatalogId)), m = h(() => C(p.value.modules.scheduler, { selector: "name" })), u = h(() => e.menu.modules.scheduler.find(
|
|
353
353
|
(t) => t._id === e.currentSchedulerId
|
|
354
354
|
));
|
|
355
355
|
function s(t, l = !0) {
|
|
356
|
-
e.menu = { ...t, _rev: e.menu._rev }, l &&
|
|
356
|
+
e.menu = { ...t, _rev: e.menu._rev }, l && w.push(e.menu);
|
|
357
357
|
}
|
|
358
|
-
const p =
|
|
358
|
+
const p = Q(re()), _ = R(!1), y = R(1);
|
|
359
359
|
async function b() {
|
|
360
360
|
_.value = !0;
|
|
361
361
|
const t = await oe(
|
|
@@ -373,12 +373,12 @@ const tt = We(
|
|
|
373
373
|
}
|
|
374
374
|
return p.value = t, _.value = !1, y.value = y.value + 1, t;
|
|
375
375
|
}
|
|
376
|
-
const
|
|
376
|
+
const N = te.debounce(b, 200);
|
|
377
377
|
Re(!0).run(() => {
|
|
378
|
-
|
|
378
|
+
Y(
|
|
379
379
|
() => [e.menu, e.currentCatalogId, e.currentSchedulerId],
|
|
380
380
|
() => {
|
|
381
|
-
_.value ||
|
|
381
|
+
_.value || N();
|
|
382
382
|
}
|
|
383
383
|
);
|
|
384
384
|
});
|
|
@@ -394,43 +394,43 @@ const tt = We(
|
|
|
394
394
|
]), W = h(() => {
|
|
395
395
|
const t = p.value.modules.category;
|
|
396
396
|
return [
|
|
397
|
-
...
|
|
397
|
+
...A.value.item.addon ? [
|
|
398
398
|
{
|
|
399
399
|
_id: e.currentCatalogId ? "" : null,
|
|
400
400
|
name: "Addon",
|
|
401
401
|
position: 0
|
|
402
402
|
}
|
|
403
403
|
] : [],
|
|
404
|
-
...
|
|
404
|
+
...E(t, (l) => l.name)
|
|
405
405
|
];
|
|
406
406
|
}), ae = h(() => {
|
|
407
407
|
const t = p.value.modules.subCategory || [];
|
|
408
|
-
return
|
|
409
|
-
}),
|
|
408
|
+
return E(t, (l) => l.name);
|
|
409
|
+
}), B = h(() => {
|
|
410
410
|
var l;
|
|
411
411
|
let t = p.value.modules.item;
|
|
412
412
|
if (i.value) {
|
|
413
413
|
const c = (l = i.value) == null ? void 0 : l.override.items;
|
|
414
414
|
t = t.filter((g) => {
|
|
415
|
-
var
|
|
416
|
-
const v = (
|
|
415
|
+
var M;
|
|
416
|
+
const v = (M = c == null ? void 0 : c[g._id]) == null ? void 0 : M.find(
|
|
417
417
|
(Fe) => !Fe.combinationKey
|
|
418
418
|
);
|
|
419
419
|
return (v == null ? void 0 : v.orderFrom) !== I.F_ORDER_FROM.enum.NONE;
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
return
|
|
422
|
+
return E(t, (c) => c.code || c.name);
|
|
423
423
|
}), se = h(() => {
|
|
424
|
-
const t = e.menu.modules.category, l =
|
|
425
|
-
(g, v,
|
|
424
|
+
const t = e.menu.modules.category, l = E(t, (g) => g.name).reduce(
|
|
425
|
+
(g, v, M) => (g[v._id] = M, g),
|
|
426
426
|
{ "": 0 }
|
|
427
427
|
), c = e.menu.modules.item;
|
|
428
|
-
return
|
|
428
|
+
return E(
|
|
429
429
|
c,
|
|
430
430
|
(g) => g.code || g.name
|
|
431
|
-
).reduce((g, v,
|
|
432
|
-
}), ue = h(() => L(
|
|
433
|
-
const t =
|
|
431
|
+
).reduce((g, v, M) => (g[v._id] = M + l[v.category || ""], g), {});
|
|
432
|
+
}), ue = h(() => L(U.value, W.value, B.value)), ie = h(() => {
|
|
433
|
+
const t = A.value.item.addon ? [
|
|
434
434
|
{
|
|
435
435
|
_id: e.currentCatalogId ? "" : null,
|
|
436
436
|
name: "Addon",
|
|
@@ -443,23 +443,23 @@ const tt = We(
|
|
|
443
443
|
t,
|
|
444
444
|
e.menu.modules.item
|
|
445
445
|
);
|
|
446
|
-
}),
|
|
446
|
+
}), U = h(() => {
|
|
447
447
|
const t = p.value.modules.variant;
|
|
448
|
-
return
|
|
448
|
+
return C(t, { selector: "name" });
|
|
449
449
|
});
|
|
450
450
|
function ce(t = []) {
|
|
451
|
-
const l = t.map((g) =>
|
|
452
|
-
return
|
|
451
|
+
const l = t.map((g) => U.value.find((v) => v._id === g)).filter((g) => !!g);
|
|
452
|
+
return O.fullVariantCombination(l).reduce((g, v) => (g[v.combinationKey] = v.selectionName.join(" / "), g), {});
|
|
453
453
|
}
|
|
454
|
-
const le = h(() =>
|
|
454
|
+
const le = h(() => E(p.value.modules.group, (t) => t.name)), de = h(() => C(p.value.modules.takeaway, { selector: "name" })), me = h(() => C(e.menu.modules.printDepartment || [], {
|
|
455
455
|
selector: "name"
|
|
456
|
-
})), fe = h(() =>
|
|
456
|
+
})), fe = h(() => C(e.menu.modules.unit, { selector: "name" })), pe = h(() => C(Ue(e.menu.modules.recipe, e.menu.modules.sku), {
|
|
457
457
|
selector: "name"
|
|
458
458
|
})), _e = h(() => e.menu.modules.cookingGuide), ge = h(() => {
|
|
459
|
-
const t =
|
|
460
|
-
return
|
|
461
|
-
}),
|
|
462
|
-
const t = !e.currentCatalogId, l = r.value ===
|
|
459
|
+
const t = Ae(e.menu.modules.sku);
|
|
460
|
+
return C(t, { selector: "code" });
|
|
461
|
+
}), A = h(() => {
|
|
462
|
+
const t = !e.currentCatalogId, l = r.value === $.F_MENU_VERSION.v4, c = !e.currentSchedulerId, g = {
|
|
463
463
|
create: t && c,
|
|
464
464
|
edit: t && c,
|
|
465
465
|
delete: t && c
|
|
@@ -527,7 +527,7 @@ const tt = We(
|
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
});
|
|
530
|
-
function
|
|
530
|
+
function K(t) {
|
|
531
531
|
return `${t.systemCode}/${t.taxCode}`;
|
|
532
532
|
}
|
|
533
533
|
function ve(t) {
|
|
@@ -535,18 +535,18 @@ const tt = We(
|
|
|
535
535
|
return { systemCode: l, taxCode: c };
|
|
536
536
|
}
|
|
537
537
|
function ye(t, l, c) {
|
|
538
|
-
return (t ?? l ?? []).map((g) =>
|
|
538
|
+
return (t ?? l ?? []).map((g) => K(g)).find((g) => c.some((v) => v.value === g));
|
|
539
539
|
}
|
|
540
540
|
const he = h(() => {
|
|
541
541
|
var l;
|
|
542
|
-
const t =
|
|
543
|
-
|
|
542
|
+
const t = Ke.Country.getCountryFlattenTaxes(
|
|
543
|
+
Z().currentCountry.value
|
|
544
544
|
);
|
|
545
545
|
return {
|
|
546
546
|
systemCode: (l = t[0]) == null ? void 0 : l.systemCode,
|
|
547
547
|
countryTaxOptions: t.map((c) => ({
|
|
548
|
-
label: `${c.name} (${
|
|
549
|
-
value:
|
|
548
|
+
label: `${c.name} (${$e(c.rate)}%)`,
|
|
549
|
+
value: K(c),
|
|
550
550
|
meta: {
|
|
551
551
|
rate: c.rate
|
|
552
552
|
}
|
|
@@ -554,17 +554,17 @@ const tt = We(
|
|
|
554
554
|
};
|
|
555
555
|
}), be = async () => {
|
|
556
556
|
const t = await J.readMenu();
|
|
557
|
-
e.menu = t ?? e.menu,
|
|
558
|
-
},
|
|
557
|
+
e.menu = t ?? e.menu, j(null);
|
|
558
|
+
}, Me = async () => {
|
|
559
559
|
const t = await J.readRestaurantsWithMenu();
|
|
560
|
-
e.restaurants =
|
|
561
|
-
},
|
|
560
|
+
e.restaurants = C(t, { selector: "name" });
|
|
561
|
+
}, j = (t) => {
|
|
562
562
|
e.currentCatalogId = t;
|
|
563
|
-
},
|
|
563
|
+
}, Ce = (t) => {
|
|
564
564
|
e.currentSchedulerId = t;
|
|
565
565
|
}, Se = (t) => {
|
|
566
566
|
e.currentCategoryIds = t;
|
|
567
|
-
},
|
|
567
|
+
}, we = async (t, l) => {
|
|
568
568
|
const c = Array.isArray(t) ? t : [t];
|
|
569
569
|
if (!c.length) return;
|
|
570
570
|
const g = c.map((v) => ({
|
|
@@ -574,12 +574,12 @@ const tt = We(
|
|
|
574
574
|
}));
|
|
575
575
|
try {
|
|
576
576
|
if (l || g.some(
|
|
577
|
-
(
|
|
577
|
+
(M) => [S.F_OPERATION_TYPE.delete, S.F_OPERATION_TYPE.deleteMany].includes(M.operation)
|
|
578
578
|
)) {
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
579
|
+
const M = await De(g, e.menu.modules);
|
|
580
|
+
if (M !== !0) throw new Error(M);
|
|
581
581
|
}
|
|
582
|
-
const v = await
|
|
582
|
+
const v = await Qe.updateMenuModule(e.menu, g);
|
|
583
583
|
return s(v.menu), v;
|
|
584
584
|
} catch (v) {
|
|
585
585
|
a.open({
|
|
@@ -588,7 +588,7 @@ const tt = We(
|
|
|
588
588
|
message: v
|
|
589
589
|
});
|
|
590
590
|
}
|
|
591
|
-
},
|
|
591
|
+
}, Ee = async (t) => {
|
|
592
592
|
const l = {
|
|
593
593
|
...e.menu,
|
|
594
594
|
masterCatalogSetting: t.masterCatalogSetting,
|
|
@@ -596,7 +596,7 @@ const tt = We(
|
|
|
596
596
|
priceTierSettings: t.priceTierSettings
|
|
597
597
|
};
|
|
598
598
|
return s(l), l;
|
|
599
|
-
},
|
|
599
|
+
}, w = Xe({ maxHistorySize: 50 }), Ie = h(() => w.canUndo.value), ke = h(() => w.canRedo.value);
|
|
600
600
|
return {
|
|
601
601
|
state: e,
|
|
602
602
|
// loading state
|
|
@@ -615,11 +615,11 @@ const tt = We(
|
|
|
615
615
|
catalogOptions: x,
|
|
616
616
|
categories: W,
|
|
617
617
|
subcategories: ae,
|
|
618
|
-
items:
|
|
618
|
+
items: B,
|
|
619
619
|
sortedItems: se,
|
|
620
620
|
categorizedItems: ue,
|
|
621
621
|
categorizedRawMenuItems: ie,
|
|
622
|
-
variants:
|
|
622
|
+
variants: U,
|
|
623
623
|
groups: le,
|
|
624
624
|
takeaways: de,
|
|
625
625
|
printDepartments: me,
|
|
@@ -627,20 +627,20 @@ const tt = We(
|
|
|
627
627
|
recipes: pe,
|
|
628
628
|
cookingGuide: _e,
|
|
629
629
|
skus: ge,
|
|
630
|
-
rules:
|
|
630
|
+
rules: A,
|
|
631
631
|
taxSetting: he,
|
|
632
632
|
// Action
|
|
633
633
|
setMenu: s,
|
|
634
634
|
readMenu: be,
|
|
635
|
-
readRestaurants:
|
|
636
|
-
selectCatalog:
|
|
637
|
-
selectScheduler:
|
|
635
|
+
readRestaurants: Me,
|
|
636
|
+
selectCatalog: j,
|
|
637
|
+
selectScheduler: Ce,
|
|
638
638
|
selectCategory: Se,
|
|
639
|
-
updateMenu:
|
|
640
|
-
updateMenuSetting:
|
|
639
|
+
updateMenu: we,
|
|
640
|
+
updateMenuSetting: Ee,
|
|
641
641
|
computeMergedMenu: b,
|
|
642
642
|
// helper
|
|
643
|
-
encodeTax:
|
|
643
|
+
encodeTax: K,
|
|
644
644
|
decodeTax: ve,
|
|
645
645
|
getSelectedTax: ye,
|
|
646
646
|
mapVariant: ce,
|
|
@@ -648,33 +648,33 @@ const tt = We(
|
|
|
648
648
|
canUndoHistory: Ie,
|
|
649
649
|
canRedoHistory: ke,
|
|
650
650
|
undoHistory: () => {
|
|
651
|
-
const t =
|
|
651
|
+
const t = w.undo();
|
|
652
652
|
t && s(t, !1);
|
|
653
653
|
},
|
|
654
654
|
redoHistory: () => {
|
|
655
|
-
const t =
|
|
655
|
+
const t = w.redo();
|
|
656
656
|
t && s(t, !1);
|
|
657
657
|
},
|
|
658
658
|
clearHistory: () => {
|
|
659
|
-
|
|
659
|
+
w.clear();
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
|
-
),
|
|
663
|
+
), X = /* @__PURE__ */ Ne({
|
|
664
664
|
__name: "AddSubcategoryDialogContentComponent",
|
|
665
665
|
props: {
|
|
666
666
|
initialValue: {}
|
|
667
667
|
},
|
|
668
668
|
setup(e) {
|
|
669
669
|
const n = e, { t: a } = ne();
|
|
670
|
-
|
|
670
|
+
Y(
|
|
671
671
|
() => n.initialValue,
|
|
672
672
|
(d) => {
|
|
673
673
|
o.value = d ?? "";
|
|
674
674
|
}
|
|
675
675
|
);
|
|
676
|
-
const o = R(n.initialValue), { emitData: r, emitAction: f } =
|
|
677
|
-
return
|
|
676
|
+
const o = R(n.initialValue), { emitData: r, emitAction: f } = He();
|
|
677
|
+
return Y(
|
|
678
678
|
o,
|
|
679
679
|
(d) => {
|
|
680
680
|
r(d);
|
|
@@ -683,8 +683,8 @@ const tt = We(
|
|
|
683
683
|
immediate: !0
|
|
684
684
|
}
|
|
685
685
|
), (d, i) => {
|
|
686
|
-
const m =
|
|
687
|
-
return
|
|
686
|
+
const m = z("fm-text-field"), u = z("FmForm");
|
|
687
|
+
return Oe(), Ve(u, {
|
|
688
688
|
onValidationSuccess: i[1] || (i[1] = (s) => V(f)("primary"))
|
|
689
689
|
}, {
|
|
690
690
|
default: Pe(() => [
|
|
@@ -711,7 +711,7 @@ const tt = We(
|
|
|
711
711
|
const u = R(!1);
|
|
712
712
|
e.open({
|
|
713
713
|
title: o("menu.subcategory.manager.dialog.add.title"),
|
|
714
|
-
contentComponent:
|
|
714
|
+
contentComponent: X,
|
|
715
715
|
primaryActions: {
|
|
716
716
|
text: o("menu.subcategory.manager.dialog.add.action"),
|
|
717
717
|
close: !1,
|
|
@@ -742,7 +742,7 @@ const tt = We(
|
|
|
742
742
|
function d(u) {
|
|
743
743
|
e.open({
|
|
744
744
|
title: o("menu.subcategory.manager.dialog.update.title"),
|
|
745
|
-
contentComponent:
|
|
745
|
+
contentComponent: X,
|
|
746
746
|
contentComponentProps: {
|
|
747
747
|
initialValue: u.name
|
|
748
748
|
},
|
|
@@ -808,6 +808,6 @@ export {
|
|
|
808
808
|
_t as f,
|
|
809
809
|
dt as g,
|
|
810
810
|
lt as m,
|
|
811
|
-
|
|
811
|
+
Ze as o,
|
|
812
812
|
tt as u
|
|
813
813
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import "./menu-
|
|
1
|
+
import { c as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BRlU0arf.js";
|
|
2
|
+
import "./menu-Bqiz6B2P.js";
|
|
3
3
|
var Z = {
|
|
4
4
|
defaultAmount: 0,
|
|
5
5
|
defaultCurrency: "USD",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStore as Q } from "pinia";
|
|
2
2
|
import { defineComponent as T, computed as U, ref as h, watch as L, resolveComponent as V, createBlock as W, openBlock as F, withCtx as w, createVNode as m, createElementVNode as f, normalizeClass as H, createElementBlock as A, toDisplayString as M, unref as l, Fragment as q, renderSlot as X, renderList as Z, getCurrentInstance as ee } from "vue";
|
|
3
|
-
import { a6 as P, a7 as te, a4 as B, J as k, Q as $, G as I, A as E, K as ne, a5 as ae, M as C, I as D, u as oe } from "./menu-
|
|
3
|
+
import { a6 as P, a7 as te, a4 as B, J as k, Q as $, G as I, A as E, K as ne, a5 as ae, M as C, I as D, u as oe } from "./menu-Bqiz6B2P.js";
|
|
4
4
|
import { useI18n as N } from "@feedmepos/mf-common";
|
|
5
5
|
import { useSnackbar as j, components as le, useDialog as ue, FmButtonVariant as ie } from "@feedmepos/ui-library";
|
|
6
6
|
import { u as se } from "./discardConfirm-BHni0LNu.js";
|