@feedmepos/mf-menu 0.31.31-beta.1 → 0.31.31-prod
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-1TX8v7ZA.js → App-Cvgz2kQV.js} +22 -24
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CR7QrFUG.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Bq84uuiq.js} +22 -22
- package/dist/{Catalog-DWClc58s.js → Catalog-Ye-KpQ31.js} +74 -75
- package/dist/{Category-BqKFvFam.js → Category-BPChBqVR.js} +60 -60
- package/dist/{Category-IYMtMoT-.js → Category-CHcxix2b.js} +28 -28
- package/dist/{CookingGuide-BayJ6zj4.js → CookingGuide-DgygBSoB.js} +101 -103
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Ceq86b3d.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-ClV6LD2-.js} +1 -1
- package/dist/{Group-LqSX7ue6.js → Group-223G1Edd.js} +1 -1
- package/dist/{Group-RujTPTns.js → Group-B7EU1xmY.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-Dj9ZmkYe.js → Group.vue_vue_type_script_setup_true_lang-CAZuyOPy.js} +137 -138
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D5GWkh3G.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CdjRWC9z.js} +13 -13
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-C4IrA3es.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BRQm-UTk.js} +5067 -5049
- package/dist/{Ingredient-_tc8llr1.js → Ingredient-Dl1Z5Qt2.js} +64 -65
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DLFDf-VZ.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CxuQTH0k.js} +1061 -1063
- package/dist/{LinkProductSideSheet-C6rF-G1v.js → LinkProductSideSheet-Y-Z9_9Kp.js} +12 -14
- package/dist/{MenuSetting-xDHeeROY.js → MenuSetting-Be44fmVj.js} +26 -27
- package/dist/{PrintRoute-B_TFMn5e.js → PrintRoute-BURAEZ6X.js} +15 -17
- package/dist/{Product-DdEEqrtc.js → Product-DSlVHbgr.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-zcistmwh.js → Product.vue_vue_type_script_setup_true_lang-DtYarO0L.js} +256 -257
- package/dist/{ProductInternalTools-BcC7BF6W.js → ProductInternalTools-gW57aUAO.js} +45 -45
- package/dist/{Products-Cu0cJshV.js → Products-Czr-70M8.js} +72 -74
- package/dist/{Publish-Bm3Xiks1.js → Publish-XCowNW_z.js} +32 -34
- package/dist/{Recipe-DWK-luIZ.js → Recipe-6oNz21AB.js} +63 -65
- package/dist/{Scheduler-Cb1TeBhW.js → Scheduler-UYFuFk5E.js} +19 -19
- package/dist/{ServingSequence-evSIET_8.js → ServingSequence-w66ujU4D.js} +34 -34
- package/dist/{Setting-Cn3kwC9F.js → Setting-Dgn3lOx7.js} +53 -54
- package/dist/{Subcategory-q4m4qHsU.js → Subcategory-lnzuxCCH.js} +34 -34
- package/dist/{Takeaway-ClepHYGu.js → Takeaway-C5Up5Odr.js} +14 -14
- package/dist/{Takeaway-D-rdUZuh.js → Takeaway-DP1GJUPF.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-y9Yxstu2.js → Takeaway.vue_vue_type_script_setup_true_lang-B45keXn7.js} +40 -41
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BSeLfoOA.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-yEIxG4F2.js} +1108 -1109
- package/dist/{Unit-IM8Naj82.js → Unit-Bt8aRidX.js} +12 -12
- package/dist/{Variant-fzGvwaMo.js → Variant-DXoOAa9M.js} +16 -16
- package/dist/{_id_-BsKNG9Qv.js → _id_-D9tvinax.js} +22 -22
- package/dist/{app-BzQRUMTK.js → app-Cnlv4rmj.js} +3 -3
- package/dist/{app-CoVUUCa_.js → app-DiizQWjo.js} +24 -24
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProduct.vue.d.ts +88 -16
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProductDialog.vue.d.ts +44 -8
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +360 -184
- package/dist/apps/mf-menu/src/components/feature/GroupManager/OptionTable.vue.d.ts +80 -28
- package/dist/apps/mf-menu/src/components/feature/GroupManager/UpdateForm.vue.d.ts +44 -8
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +216 -148
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +216 -148
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/category.d.ts +4 -4
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +218 -150
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +142 -82
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +108 -74
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/OptionTable.vue.d.ts +80 -28
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/UpdateForm.vue.d.ts +44 -8
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +176 -32
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +324 -222
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +108 -74
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +1374 -1040
- package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +216 -148
- package/dist/apps/mf-menu/src/helper/import-export.d.ts +1374 -1040
- package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +108 -74
- package/dist/apps/mf-menu/src/helper/menu.d.ts +1523 -1155
- package/dist/apps/mf-menu/src/manager/menu/category.d.ts +4 -4
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +1374 -1040
- package/dist/apps/mf-menu/src/manager/menu/subcategory.d.ts +4 -4
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +324 -222
- package/dist/apps/mf-menu/src/stores/manager/recipe.d.ts +12 -12
- package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +142 -82
- package/dist/apps/mf-menu/src/stores/manager/sku.d.ts +60 -60
- package/dist/apps/mf-menu/src/stores/manager/takeaway.d.ts +6 -6
- package/dist/apps/mf-menu/src/stores/manager/unit.d.ts +12 -12
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1375 -1041
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +216 -148
- package/dist/apps/mf-menu/src/views/CookingGuide/CookingGuideDialog.vue.d.ts +4 -4
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +352 -132
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +84 -32
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +84 -32
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-D7AwcSC5.js +24 -0
- package/dist/assets/override-menu-Y9T4wxEn.js +24 -0
- package/dist/assets/validate-menu-DiAW2jY1.js +24 -0
- package/dist/{catalog-CaXceaA2.js → catalog-DUSCax4J.js} +1 -1
- package/dist/{catalogSetting-BGvckFdh.js → catalogSetting-18FJ5pkA.js} +1 -1
- package/dist/{category-u5eo_Vjd.js → category-B9XvlPFy.js} +3 -5
- package/dist/currency-Sno8fZYc.js +7 -0
- package/dist/{dayjs.min-Bsr3tJCn.js → dayjs.min-BsfKOrNo.js} +1 -1
- package/dist/{index-tRQb7RN_.js → index-BDpkSKDX.js} +1 -1
- package/dist/{index-Bbx4iZ6n.js → index-Eomwf2OO.js} +27 -27
- package/dist/{index-DSAG0yWh.js → index-ltyOwsRO.js} +20 -22
- package/dist/{item-BAqzKh4O.js → item-5Kkzf_eF.js} +1069 -1071
- package/dist/{jszip.min-BKJtvCjM.js → jszip.min-CRfpGjN8.js} +545 -545
- package/dist/menu-Btcr0nsk.js +108040 -0
- package/dist/{menu-CDrsBjmr.js → menu-DYs_VNfB.js} +9 -11
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-DfbHonGe.js → priceTier-DvUjWwCM.js} +4 -4
- package/dist/{scheduler-DTWaBudB.js → scheduler-C76blUlS.js} +11 -13
- package/dist/{subcategory-D-R5r1Tr.js → subcategory-C44qN5Vk.js} +133 -135
- package/dist/{toExcel-84VTtSA7.js → toExcel--vNjpF-b.js} +2 -2
- package/dist/{unit-B4zscxzo.js → unit-C4ghZU8x.js} +23 -24
- package/package.json +5 -5
- package/dist/assets/linked-status-eQqjvOq_.js +0 -24
- package/dist/assets/override-menu-C8NTBJgN.js +0 -24
- package/dist/assets/validate-menu-Dn-OO7Ed.js +0 -24
- package/dist/currency-BPHwez-E.js +0 -7
- package/dist/menu-CsIzrBEr.js +0 -74044
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { shallowRef as X, ref as R, computed as h, shallowReactive as Fe, effectScope as Te, watch as
|
|
2
|
-
import {
|
|
1
|
+
import { shallowRef as X, ref as R, computed as h, shallowReactive as Fe, effectScope as Te, watch as Y, defineComponent as Re, resolveComponent as z, createBlock as Ve, openBlock as xe, unref as x, withCtx as Ne, createVNode as Oe } from "vue";
|
|
2
|
+
import { H as k, B as N, al as Z, G as I, am as G, J as S, I as ee, aa as M, c as D, Y as E, ak as L, an as Pe, ao as Ae, A as Ue, ac as Ke, ap as De, aq as $e, a9 as qe, u as Ye } from "./menu-Btcr0nsk.js";
|
|
3
3
|
import { useCoreStore as J, useI18n as te } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as He, useDialogChild as Be } from "@feedmepos/ui-library";
|
|
5
|
-
import { defineStore as
|
|
6
|
-
|
|
7
|
-
import "@feedmepos/core/entity";
|
|
8
|
-
const je = "/assets/linked-status-eQqjvOq_.js", ze = "/assets/override-menu-C8NTBJgN.js";
|
|
5
|
+
import { defineStore as We } from "pinia";
|
|
6
|
+
const je = "/assets/linked-status-D7AwcSC5.js", ze = "/assets/override-menu-Y9T4wxEn.js";
|
|
9
7
|
function Ge(e) {
|
|
10
8
|
var o;
|
|
11
9
|
const n = k(e), a = (o = n.variant) == null ? void 0 : o.variantCombinations;
|
|
12
10
|
return delete n.variant, delete n.thumbnail, [n, ...a || []];
|
|
13
11
|
}
|
|
14
12
|
function Le(e, n, a, o) {
|
|
15
|
-
const r = k(n),
|
|
13
|
+
const r = k(n), m = a ? r.modules.catalog.find((g) => g._id === a) : null, l = o ? r.modules.scheduler.find((g) => g._id === o) : null, i = m ? k(m) : void 0, d = a ? r.modules.catalog.filter((g) => g._id !== a) : [], u = l ? k(l) : void 0, s = e.reduce((g, y) => (g[y._id] = Ge(y), g), {});
|
|
16
14
|
function p(g = []) {
|
|
17
15
|
const y = e.map((b) => b._id);
|
|
18
16
|
return [
|
|
@@ -49,12 +47,12 @@ function Le(e, n, a, o) {
|
|
|
49
47
|
};
|
|
50
48
|
}
|
|
51
49
|
function T(e, n, a) {
|
|
52
|
-
var
|
|
50
|
+
var m;
|
|
53
51
|
if (a >= 3) return e;
|
|
54
52
|
const o = n.modules.item.find((l) => l._id === e._id);
|
|
55
53
|
if (!o)
|
|
56
54
|
throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
|
|
57
|
-
const r = (
|
|
55
|
+
const r = (m = o.groups) == null ? void 0 : m.map((l) => {
|
|
58
56
|
var u, s, p;
|
|
59
57
|
const i = (u = e == null ? void 0 : e.groups) == null ? void 0 : u.find((g) => g._id === l._id);
|
|
60
58
|
let d;
|
|
@@ -78,24 +76,24 @@ function T(e, n, a) {
|
|
|
78
76
|
};
|
|
79
77
|
}
|
|
80
78
|
function Je(e, n) {
|
|
81
|
-
const a = e.groups.map((
|
|
82
|
-
const l = n.modules.group.find((d) => d._id ===
|
|
79
|
+
const a = e.groups.map((m) => {
|
|
80
|
+
const l = n.modules.group.find((d) => d._id === m._id), i = ((l == null ? void 0 : l.items) || []).map((d) => {
|
|
83
81
|
var p;
|
|
84
|
-
const u = (p =
|
|
82
|
+
const u = (p = m.items) == null ? void 0 : p.find(
|
|
85
83
|
(g) => g._id === d._id && g.combinationKey === d.combinationKey
|
|
86
84
|
);
|
|
87
85
|
if (u)
|
|
88
86
|
return T(u, n, 1);
|
|
89
87
|
const s = {
|
|
90
|
-
...
|
|
88
|
+
...N.generator.initMenuV4ItemOverrider(),
|
|
91
89
|
_id: d._id,
|
|
92
90
|
combinationKey: d.combinationKey
|
|
93
91
|
};
|
|
94
92
|
return T(s, n, 1);
|
|
95
93
|
});
|
|
96
|
-
return { ...
|
|
97
|
-
}), o = e.variant ? e.variant.variantCombinations.map((
|
|
98
|
-
...
|
|
94
|
+
return { ...m, items: i };
|
|
95
|
+
}), o = e.variant ? e.variant.variantCombinations.map((m) => T(m, n, 1)) : [], r = {
|
|
96
|
+
...N.generator.initMenuV4ItemOverrider(),
|
|
99
97
|
_id: e._id,
|
|
100
98
|
name: e.name,
|
|
101
99
|
code: e.code,
|
|
@@ -103,20 +101,20 @@ function Je(e, n) {
|
|
|
103
101
|
};
|
|
104
102
|
return [...o, r];
|
|
105
103
|
}
|
|
106
|
-
function
|
|
104
|
+
function H(e, n) {
|
|
107
105
|
var o;
|
|
108
106
|
if (!n)
|
|
109
107
|
return e;
|
|
110
108
|
const a = { ...e, code: n.code };
|
|
111
109
|
return a.groups = (o = a.groups) == null ? void 0 : o.map((r) => {
|
|
112
110
|
var l, i;
|
|
113
|
-
const
|
|
111
|
+
const m = (l = n.groups) == null ? void 0 : l.find((d) => d._id === r._id);
|
|
114
112
|
return r.items = (i = r.items) == null ? void 0 : i.map((d) => {
|
|
115
113
|
var s;
|
|
116
|
-
const u = (s =
|
|
114
|
+
const u = (s = m == null ? void 0 : m.items) == null ? void 0 : s.find(
|
|
117
115
|
(p) => p._id === d._id && p.combinationKey === d.combinationKey
|
|
118
116
|
);
|
|
119
|
-
return
|
|
117
|
+
return H(d, u);
|
|
120
118
|
}), r;
|
|
121
119
|
}), a;
|
|
122
120
|
}
|
|
@@ -125,12 +123,12 @@ function Qe(e, n) {
|
|
|
125
123
|
n.variant && (n.variant = {
|
|
126
124
|
...n.variant,
|
|
127
125
|
variantCombinations: n.variant.variantCombinations.map((r) => {
|
|
128
|
-
const
|
|
126
|
+
const m = a.find(
|
|
129
127
|
(l) => l._id === r._id && l.combinationKey === r.combinationKey
|
|
130
128
|
);
|
|
131
|
-
if (!
|
|
129
|
+
if (!m)
|
|
132
130
|
throw new Error(`Item overrider not found - ${r._id} - ${r.combinationKey}`);
|
|
133
|
-
return
|
|
131
|
+
return H(m, r);
|
|
134
132
|
})
|
|
135
133
|
});
|
|
136
134
|
const o = a.find((r) => !r.combinationKey);
|
|
@@ -138,24 +136,24 @@ function Qe(e, n) {
|
|
|
138
136
|
throw new Error(`Base item overrider not found - ${n._id}`);
|
|
139
137
|
return n.groups = (o.groups || []).map((r) => {
|
|
140
138
|
var l;
|
|
141
|
-
const
|
|
139
|
+
const m = n.groups.find((i) => i._id === r._id);
|
|
142
140
|
return r.items = (l = r.items) == null ? void 0 : l.map((i) => {
|
|
143
141
|
var u;
|
|
144
|
-
const d = (u =
|
|
142
|
+
const d = (u = m == null ? void 0 : m.items) == null ? void 0 : u.find(
|
|
145
143
|
(s) => s._id === i._id && s.combinationKey === i.combinationKey
|
|
146
144
|
);
|
|
147
|
-
return
|
|
145
|
+
return H(i, d);
|
|
148
146
|
}), r;
|
|
149
147
|
}), {
|
|
150
148
|
...n,
|
|
151
149
|
price: (o == null ? void 0 : o.price) || n.price
|
|
152
150
|
};
|
|
153
151
|
}
|
|
154
|
-
async function
|
|
155
|
-
const l = k(a), i =
|
|
152
|
+
async function dt(e, n, a, o, r, m = !0) {
|
|
153
|
+
const l = k(a), i = m ? Le(n, l, o, r) : l, d = n.reduce((p, g) => (p[g._id] = i.modules.item.find((y) => y._id === g._id), p), {}), u = n.reduce((p, g) => {
|
|
156
154
|
const y = g._id;
|
|
157
155
|
return p[y] = Je(d[y], e), p;
|
|
158
|
-
}, {}), s =
|
|
156
|
+
}, {}), s = N.getFallbackPrices({
|
|
159
157
|
rawMenu: i,
|
|
160
158
|
items: u,
|
|
161
159
|
catalogId: o || void 0,
|
|
@@ -169,12 +167,12 @@ async function ft(e, n, a, o, r, f = !0) {
|
|
|
169
167
|
};
|
|
170
168
|
});
|
|
171
169
|
}
|
|
172
|
-
function
|
|
170
|
+
function mt(e, n) {
|
|
173
171
|
if (e.length === 0) return "";
|
|
174
172
|
const a = e == null ? void 0 : e.split("variant");
|
|
175
|
-
return ((a == null ? void 0 : a.reduce((r,
|
|
176
|
-
if (
|
|
177
|
-
const l = `variant${
|
|
173
|
+
return ((a == null ? void 0 : a.reduce((r, m) => {
|
|
174
|
+
if (m && m.length > 0) {
|
|
175
|
+
const l = `variant${m.split("/")[0]}`, i = m.split("/")[1], u = n.find(
|
|
178
176
|
({ _id: s }) => s === l
|
|
179
177
|
).options.find(({ _id: s }) => s === i);
|
|
180
178
|
r.push(((u == null ? void 0 : u.name) || "").trim());
|
|
@@ -183,7 +181,7 @@ function pt(e, n) {
|
|
|
183
181
|
}, [])) || []).join(" / ");
|
|
184
182
|
}
|
|
185
183
|
const $ = /* @__PURE__ */ new Map();
|
|
186
|
-
async function
|
|
184
|
+
async function ft(e, n) {
|
|
187
185
|
const a = `${e._id}-${e.updatedAt}-${n}`;
|
|
188
186
|
if ($.has(a))
|
|
189
187
|
return $.get(a);
|
|
@@ -203,27 +201,27 @@ async function ne(e, n, a) {
|
|
|
203
201
|
schedulerId: a
|
|
204
202
|
});
|
|
205
203
|
}
|
|
206
|
-
function
|
|
204
|
+
function pt(e, n, a) {
|
|
207
205
|
const o = /* @__PURE__ */ new Set();
|
|
208
|
-
function r(
|
|
209
|
-
if (!e || !
|
|
206
|
+
function r(m, l) {
|
|
207
|
+
if (!e || !m || !l || o.has(l)) return !1;
|
|
210
208
|
o.add(l);
|
|
211
209
|
const i = e.modules.item.find((d) => d._id === l);
|
|
212
|
-
return !i || !i.groups ? !1 : i.groups.some((d) => d._id ===
|
|
210
|
+
return !i || !i.groups ? !1 : i.groups.some((d) => d._id === m) ? !0 : i.groups.some((d) => {
|
|
213
211
|
const u = e.modules.group.find((s) => s._id === d._id);
|
|
214
212
|
for (const s of (u == null ? void 0 : u.items) || [])
|
|
215
|
-
if (r(
|
|
213
|
+
if (r(m, s._id)) return !0;
|
|
216
214
|
return !1;
|
|
217
215
|
});
|
|
218
216
|
}
|
|
219
217
|
return r(n, a);
|
|
220
218
|
}
|
|
221
|
-
function
|
|
219
|
+
function _t(e, n, a) {
|
|
222
220
|
const o = /* @__PURE__ */ new Set();
|
|
223
|
-
function r(
|
|
224
|
-
if (!e || !
|
|
225
|
-
o.add(
|
|
226
|
-
const i = e.modules.group.find((d) => d._id ===
|
|
221
|
+
function r(m, l) {
|
|
222
|
+
if (!e || !m || !l || o.has(m)) return !1;
|
|
223
|
+
o.add(m);
|
|
224
|
+
const i = e.modules.group.find((d) => d._id === m);
|
|
227
225
|
return !i || !i.items ? !1 : i.items.some((d) => d._id === l) ? !0 : i.items.some((d) => {
|
|
228
226
|
const u = e.modules.item.find((s) => s._id === d._id);
|
|
229
227
|
for (const s of (u == null ? void 0 : u.groups) || [])
|
|
@@ -241,9 +239,9 @@ async function Xe(e, n, a) {
|
|
|
241
239
|
const r = await ne(e, n, a);
|
|
242
240
|
return q.set(o, r), r;
|
|
243
241
|
}
|
|
244
|
-
async function
|
|
242
|
+
async function gt(e, n, a) {
|
|
245
243
|
var l, i;
|
|
246
|
-
const o = await Xe(e, n, null), r = [],
|
|
244
|
+
const o = await Xe(e, n, null), r = [], m = (d, u) => {
|
|
247
245
|
const s = k(d);
|
|
248
246
|
for (const p in u)
|
|
249
247
|
u[p] && (s[p] = u[p]);
|
|
@@ -253,11 +251,11 @@ async function yt(e, n, a) {
|
|
|
253
251
|
const u = (l = d.items) == null ? void 0 : l.find((p) => p._id === a && !p.combinationKey), s = e.modules.item.find((p) => p._id === a);
|
|
254
252
|
if (u) {
|
|
255
253
|
const p = (i = d.items) == null ? void 0 : i.filter((y) => y._id === a && y.combinationKey), g = [u, ...p].map((y) => {
|
|
256
|
-
var V,
|
|
257
|
-
const b = y.combinationKey ? (
|
|
258
|
-
(
|
|
259
|
-
) : s, F = b && s ?
|
|
260
|
-
return
|
|
254
|
+
var V, O;
|
|
255
|
+
const b = y.combinationKey ? (O = (V = s == null ? void 0 : s.variant) == null ? void 0 : V.variantCombinations) == null ? void 0 : O.find(
|
|
256
|
+
(P) => P.combinationKey === y.combinationKey
|
|
257
|
+
) : s, F = b && s ? m(s, b) : y;
|
|
258
|
+
return m(F, y);
|
|
261
259
|
});
|
|
262
260
|
r.push({
|
|
263
261
|
group: d,
|
|
@@ -271,7 +269,7 @@ function Ze({
|
|
|
271
269
|
maxHistorySize: e = 50
|
|
272
270
|
}) {
|
|
273
271
|
const n = X([]), a = R(-1), o = h(() => a.value > 0), r = h(() => a.value < n.value.length - 1);
|
|
274
|
-
function
|
|
272
|
+
function m(u) {
|
|
275
273
|
n.value.push(u), a.value++, n.value.length > e && (n.value.shift(), a.value--);
|
|
276
274
|
}
|
|
277
275
|
function l() {
|
|
@@ -286,7 +284,7 @@ function Ze({
|
|
|
286
284
|
n.value = [], a.value = -1;
|
|
287
285
|
}
|
|
288
286
|
return {
|
|
289
|
-
push:
|
|
287
|
+
push: m,
|
|
290
288
|
canUndo: o,
|
|
291
289
|
canRedo: r,
|
|
292
290
|
undo: l,
|
|
@@ -340,7 +338,7 @@ function tt() {
|
|
|
340
338
|
currentSchedulerId: ""
|
|
341
339
|
};
|
|
342
340
|
}
|
|
343
|
-
const nt =
|
|
341
|
+
const nt = We(
|
|
344
342
|
"mf-menu-store-v2",
|
|
345
343
|
() => {
|
|
346
344
|
const e = Fe(tt()), n = J(), a = He(), o = h(() => e.menu.modules.serveSequence ? M(e.menu.modules.serveSequence, {
|
|
@@ -348,7 +346,7 @@ const nt = Ye(
|
|
|
348
346
|
}) : []), r = h(() => {
|
|
349
347
|
var t;
|
|
350
348
|
return ((t = n.currentBusiness.value) == null ? void 0 : t.menuVersion) || D.F_MENU_VERSION.v3;
|
|
351
|
-
}),
|
|
349
|
+
}), m = h(() => r.value === D.F_MENU_VERSION.v4), l = h(() => {
|
|
352
350
|
const t = e.menu.modules.catalog;
|
|
353
351
|
return M(t, { selector: "name" });
|
|
354
352
|
}), i = h(() => e.menu.modules.catalog.find((t) => t._id === e.currentCatalogId)), d = h(() => M(p.value.modules.scheduler, { selector: "name" })), u = h(() => e.menu.modules.scheduler.find(
|
|
@@ -368,23 +366,23 @@ const nt = Ye(
|
|
|
368
366
|
if (e.currentSchedulerId != null) {
|
|
369
367
|
const c = e.menu.modules.catalog.find(
|
|
370
368
|
(_) => _._id === e.currentCatalogId
|
|
371
|
-
),
|
|
369
|
+
), f = c ? c.override.scheduler[e.currentSchedulerId] : e.menu.modules.scheduler.find(
|
|
372
370
|
(_) => _._id === e.currentSchedulerId
|
|
373
|
-
), v = new Set(((
|
|
371
|
+
), v = new Set(((f == null ? void 0 : f.items) || []).map((_) => _._id));
|
|
374
372
|
t.modules.item = t.modules.item.filter((_) => v.has(_._id));
|
|
375
373
|
}
|
|
376
374
|
return p.value = t, g.value = !1, y.value = y.value + 1, t;
|
|
377
375
|
}
|
|
378
376
|
const V = ee.debounce(b, 200);
|
|
379
377
|
Te(!0).run(() => {
|
|
380
|
-
|
|
378
|
+
Y(
|
|
381
379
|
() => [e.menu, e.currentCatalogId, e.currentSchedulerId],
|
|
382
380
|
() => {
|
|
383
381
|
g.value || V();
|
|
384
382
|
}
|
|
385
383
|
);
|
|
386
384
|
});
|
|
387
|
-
const
|
|
385
|
+
const P = h(() => [
|
|
388
386
|
{
|
|
389
387
|
label: "Main",
|
|
390
388
|
value: null
|
|
@@ -393,7 +391,7 @@ const nt = Ye(
|
|
|
393
391
|
label: t.name,
|
|
394
392
|
value: t._id
|
|
395
393
|
}))
|
|
396
|
-
]),
|
|
394
|
+
]), B = h(() => {
|
|
397
395
|
const t = p.value.modules.category;
|
|
398
396
|
return [
|
|
399
397
|
...U.value.item.addon ? [
|
|
@@ -412,26 +410,26 @@ const nt = Ye(
|
|
|
412
410
|
var c;
|
|
413
411
|
let t = p.value.modules.item;
|
|
414
412
|
if (i.value) {
|
|
415
|
-
const
|
|
413
|
+
const f = (c = i.value) == null ? void 0 : c.override.items;
|
|
416
414
|
t = t.filter((v) => {
|
|
417
415
|
var C;
|
|
418
|
-
const _ = (C =
|
|
416
|
+
const _ = (C = f == null ? void 0 : f[v._id]) == null ? void 0 : C.find(
|
|
419
417
|
(ke) => !ke.combinationKey
|
|
420
418
|
);
|
|
421
419
|
return (_ == null ? void 0 : _.orderFrom) !== I.F_ORDER_FROM.enum.NONE;
|
|
422
420
|
});
|
|
423
421
|
}
|
|
424
|
-
return E(t, (
|
|
422
|
+
return E(t, (f) => f.code || f.name);
|
|
425
423
|
}), ae = h(() => {
|
|
426
424
|
const t = e.menu.modules.category, c = E(t, (v) => v.name).reduce(
|
|
427
425
|
(v, _, C) => (v[_._id] = C, v),
|
|
428
426
|
{ "": 0 }
|
|
429
|
-
),
|
|
427
|
+
), f = e.menu.modules.item;
|
|
430
428
|
return E(
|
|
431
|
-
|
|
429
|
+
f,
|
|
432
430
|
(v) => v.code || v.name
|
|
433
431
|
).reduce((v, _, C) => (v[_._id] = C + c[_.category || ""], v), {});
|
|
434
|
-
}), se = h(() => L(A.value,
|
|
432
|
+
}), se = h(() => L(A.value, B.value, W.value)), ue = h(() => {
|
|
435
433
|
const t = U.value.item.addon ? [
|
|
436
434
|
{
|
|
437
435
|
_id: e.currentCatalogId ? "" : null,
|
|
@@ -451,65 +449,65 @@ const nt = Ye(
|
|
|
451
449
|
});
|
|
452
450
|
function ie(t = []) {
|
|
453
451
|
const c = t.map((v) => A.value.find((_) => _._id === v)).filter((v) => !!v);
|
|
454
|
-
return
|
|
452
|
+
return N.fullVariantCombination(c).reduce((v, _) => (v[_.combinationKey] = _.selectionName.join(" / "), v), {});
|
|
455
453
|
}
|
|
456
454
|
const ce = h(() => E(p.value.modules.group, (t) => t.name)), le = h(() => M(p.value.modules.takeaway, { selector: "name" })), de = h(() => M(e.menu.modules.printDepartment || [], {
|
|
457
455
|
selector: "name"
|
|
458
|
-
})), me = h(() => M(e.menu.modules.unit, { selector: "name" })), fe = h(() => M(
|
|
456
|
+
})), me = h(() => M(e.menu.modules.unit, { selector: "name" })), fe = h(() => M(Pe(e.menu.modules.recipe, e.menu.modules.sku), {
|
|
459
457
|
selector: "name"
|
|
460
458
|
})), pe = h(() => e.menu.modules.cookingGuide), _e = h(() => {
|
|
461
459
|
const t = Ae(e.menu.modules.sku);
|
|
462
460
|
return M(t, { selector: "code" });
|
|
463
461
|
}), U = h(() => {
|
|
464
|
-
const t = !e.currentCatalogId, c = r.value === D.F_MENU_VERSION.v4,
|
|
465
|
-
create: t &&
|
|
466
|
-
edit: t &&
|
|
467
|
-
delete: t &&
|
|
462
|
+
const t = !e.currentCatalogId, c = r.value === D.F_MENU_VERSION.v4, f = !e.currentSchedulerId, v = {
|
|
463
|
+
create: t && f,
|
|
464
|
+
edit: t && f,
|
|
465
|
+
delete: t && f
|
|
468
466
|
};
|
|
469
467
|
return {
|
|
470
468
|
item: {
|
|
471
469
|
...v,
|
|
472
|
-
edit: c ||
|
|
473
|
-
sort: c && t &&
|
|
470
|
+
edit: c || f,
|
|
471
|
+
sort: c && t && f,
|
|
474
472
|
addon: c,
|
|
475
|
-
code:
|
|
476
|
-
name: t &&
|
|
477
|
-
description: t &&
|
|
478
|
-
category:
|
|
479
|
-
thumbnail: t &&
|
|
480
|
-
orderFrom: (c || t) &&
|
|
473
|
+
code: f,
|
|
474
|
+
name: t && f,
|
|
475
|
+
description: t && f,
|
|
476
|
+
category: f,
|
|
477
|
+
thumbnail: t && f,
|
|
478
|
+
orderFrom: (c || t) && f,
|
|
481
479
|
orderFromNone: t,
|
|
482
480
|
orderFromActiveOnly: !c,
|
|
483
|
-
openPrice: t &&
|
|
484
|
-
unit: t &&
|
|
481
|
+
openPrice: t && f,
|
|
482
|
+
unit: t && f,
|
|
485
483
|
price: t,
|
|
486
484
|
editPrice: t,
|
|
487
|
-
minPrice: c &&
|
|
488
|
-
costing: c && t &&
|
|
489
|
-
tax: t &&
|
|
490
|
-
variant: t &&
|
|
485
|
+
minPrice: c && f,
|
|
486
|
+
costing: c && t && f,
|
|
487
|
+
tax: t && f,
|
|
488
|
+
variant: t && f,
|
|
491
489
|
maxVariant: c ? 4 : 2,
|
|
492
|
-
group: t &&
|
|
493
|
-
overrideProductGroup: c &&
|
|
494
|
-
inventory: (c || t) &&
|
|
490
|
+
group: t && f,
|
|
491
|
+
overrideProductGroup: c && f,
|
|
492
|
+
inventory: (c || t) && f,
|
|
495
493
|
bindToVariant: c,
|
|
496
|
-
print: t &&
|
|
497
|
-
toRoot: c &&
|
|
498
|
-
takeaway: (_) => !!_ && (c || t) &&
|
|
494
|
+
print: t && f,
|
|
495
|
+
toRoot: c && f,
|
|
496
|
+
takeaway: (_) => !!_ && (c || t) && f,
|
|
499
497
|
multiScheduler: c,
|
|
500
498
|
canRearrange: c,
|
|
501
499
|
printConfig: c
|
|
502
500
|
},
|
|
503
501
|
category: {
|
|
504
502
|
...v,
|
|
505
|
-
sort: t
|
|
503
|
+
sort: t
|
|
506
504
|
},
|
|
507
505
|
group: {
|
|
508
506
|
...v,
|
|
509
|
-
edit: c ||
|
|
507
|
+
edit: c || f,
|
|
510
508
|
sort: t,
|
|
511
509
|
applyProduct: t,
|
|
512
|
-
showAppliedProduct:
|
|
510
|
+
showAppliedProduct: f,
|
|
513
511
|
type: !c,
|
|
514
512
|
insertRawItems: !c,
|
|
515
513
|
multiScheduler: c
|
|
@@ -519,7 +517,7 @@ const nt = Ye(
|
|
|
519
517
|
},
|
|
520
518
|
takeaway: {
|
|
521
519
|
...v,
|
|
522
|
-
edit: (c || t) &&
|
|
520
|
+
edit: (c || t) && f,
|
|
523
521
|
name: t
|
|
524
522
|
},
|
|
525
523
|
catalog: {
|
|
@@ -533,32 +531,32 @@ const nt = Ye(
|
|
|
533
531
|
return `${t.systemCode}/${t.taxCode}`;
|
|
534
532
|
}
|
|
535
533
|
function ge(t) {
|
|
536
|
-
const [c,
|
|
537
|
-
return { systemCode: c, taxCode:
|
|
534
|
+
const [c, f] = t.split("/");
|
|
535
|
+
return { systemCode: c, taxCode: f };
|
|
538
536
|
}
|
|
539
|
-
function ve(t, c,
|
|
540
|
-
return (t ?? c ?? []).map((v) => K(v)).find((v) =>
|
|
537
|
+
function ve(t, c, f) {
|
|
538
|
+
return (t ?? c ?? []).map((v) => K(v)).find((v) => f.some((_) => _.value === v));
|
|
541
539
|
}
|
|
542
540
|
const ye = h(() => {
|
|
543
541
|
var v;
|
|
544
|
-
const t = ["SV5", "SV10"], c =
|
|
542
|
+
const t = ["SV5", "SV10"], c = Ue.Country.getCountryFlattenTaxes(
|
|
545
543
|
J().currentCountry.value
|
|
546
|
-
),
|
|
547
|
-
label: `${_.name} (${
|
|
544
|
+
), f = c.filter((_) => m.value || !t.includes(_.taxCode)).map((_) => ({
|
|
545
|
+
label: `${_.name} (${Ke(_.rate)}%)`,
|
|
548
546
|
value: K(_),
|
|
549
547
|
meta: {
|
|
550
548
|
rate: _.rate
|
|
551
549
|
}
|
|
552
550
|
}));
|
|
553
|
-
return
|
|
551
|
+
return f.sort((_, C) => _.label.localeCompare(C.label, void 0, { numeric: !0 })), {
|
|
554
552
|
systemCode: (v = c[0]) == null ? void 0 : v.systemCode,
|
|
555
|
-
countryTaxOptions:
|
|
553
|
+
countryTaxOptions: f
|
|
556
554
|
};
|
|
557
555
|
}), he = async () => {
|
|
558
|
-
const t = await
|
|
556
|
+
const t = await qe.readMenu();
|
|
559
557
|
e.menu = t ?? e.menu, j(null);
|
|
560
558
|
}, be = async () => {
|
|
561
|
-
const { fetchAllRestaurants: t } =
|
|
559
|
+
const { fetchAllRestaurants: t } = $e();
|
|
562
560
|
await t({
|
|
563
561
|
onBatchEnd: (c) => {
|
|
564
562
|
e.restaurants = c;
|
|
@@ -571,9 +569,9 @@ const nt = Ye(
|
|
|
571
569
|
}, Me = (t) => {
|
|
572
570
|
e.currentCategoryIds = t;
|
|
573
571
|
}, Se = async (t, c) => {
|
|
574
|
-
const
|
|
575
|
-
if (!
|
|
576
|
-
const v =
|
|
572
|
+
const f = Array.isArray(t) ? t : [t];
|
|
573
|
+
if (!f.length) return;
|
|
574
|
+
const v = f.map((_) => ({
|
|
577
575
|
..._,
|
|
578
576
|
_id: e.menu._id,
|
|
579
577
|
_rev: e.menu._rev
|
|
@@ -582,7 +580,7 @@ const nt = Ye(
|
|
|
582
580
|
if (c || v.some(
|
|
583
581
|
(C) => [S.F_OPERATION_TYPE.delete, S.F_OPERATION_TYPE.deleteMany].includes(C.operation)
|
|
584
582
|
)) {
|
|
585
|
-
const C = await
|
|
583
|
+
const C = await De(v, e.menu.modules);
|
|
586
584
|
if (C !== !0) throw new Error(C);
|
|
587
585
|
}
|
|
588
586
|
const _ = await et.updateMenuModule(e.menu, v);
|
|
@@ -612,14 +610,14 @@ const nt = Ye(
|
|
|
612
610
|
mergedMenu: p,
|
|
613
611
|
// Computed
|
|
614
612
|
version: r,
|
|
615
|
-
isV4:
|
|
613
|
+
isV4: m,
|
|
616
614
|
serveSequence: o,
|
|
617
615
|
catalogs: l,
|
|
618
616
|
currentCatalog: i,
|
|
619
617
|
schedulers: d,
|
|
620
618
|
currentScheduler: u,
|
|
621
|
-
catalogOptions:
|
|
622
|
-
categories:
|
|
619
|
+
catalogOptions: P,
|
|
620
|
+
categories: B,
|
|
623
621
|
subcategories: re,
|
|
624
622
|
items: W,
|
|
625
623
|
sortedItems: ae,
|
|
@@ -673,14 +671,14 @@ const nt = Ye(
|
|
|
673
671
|
},
|
|
674
672
|
setup(e) {
|
|
675
673
|
const n = e, { t: a } = te();
|
|
676
|
-
|
|
674
|
+
Y(
|
|
677
675
|
() => n.initialValue,
|
|
678
676
|
(l) => {
|
|
679
677
|
o.value = l ?? "";
|
|
680
678
|
}
|
|
681
679
|
);
|
|
682
|
-
const o = R(n.initialValue), { emitData: r, emitAction:
|
|
683
|
-
return
|
|
680
|
+
const o = R(n.initialValue), { emitData: r, emitAction: m } = Be();
|
|
681
|
+
return Y(
|
|
684
682
|
o,
|
|
685
683
|
(l) => {
|
|
686
684
|
r(l);
|
|
@@ -690,30 +688,30 @@ const nt = Ye(
|
|
|
690
688
|
}
|
|
691
689
|
), (l, i) => {
|
|
692
690
|
const d = z("fm-text-field"), u = z("FmForm");
|
|
693
|
-
return
|
|
694
|
-
onValidationSuccess: i[1] || (i[1] = (s) =>
|
|
691
|
+
return xe(), Ve(u, {
|
|
692
|
+
onValidationSuccess: i[1] || (i[1] = (s) => x(m)("primary"))
|
|
695
693
|
}, {
|
|
696
|
-
default:
|
|
697
|
-
|
|
694
|
+
default: Ne(() => [
|
|
695
|
+
Oe(d, {
|
|
698
696
|
modelValue: o.value,
|
|
699
697
|
"onUpdate:modelValue": i[0] || (i[0] = (s) => o.value = s),
|
|
700
|
-
rules: [(s) => !!s ||
|
|
698
|
+
rules: [(s) => !!s || x(a)("menu.subcategory.dialog.add.name.required")],
|
|
701
699
|
autofocus: "",
|
|
702
|
-
label:
|
|
703
|
-
placeholder:
|
|
700
|
+
label: x(a)("menu.subcategory.dialog.add.name.label"),
|
|
701
|
+
placeholder: x(a)("menu.subcategory.dialog.add.name.placeholder")
|
|
704
702
|
}, null, 8, ["modelValue", "rules", "label", "placeholder"])
|
|
705
703
|
]),
|
|
706
704
|
_: 1
|
|
707
705
|
});
|
|
708
706
|
};
|
|
709
707
|
}
|
|
710
|
-
}),
|
|
708
|
+
}), vt = ({
|
|
711
709
|
dialog: e,
|
|
712
710
|
menuLoader: n,
|
|
713
711
|
isLocalOnly: a = !1
|
|
714
712
|
}) => {
|
|
715
713
|
const { t: o } = te(), r = nt().updateMenu;
|
|
716
|
-
function
|
|
714
|
+
function m() {
|
|
717
715
|
const u = R(!1);
|
|
718
716
|
e.open({
|
|
719
717
|
title: o("menu.subcategory.manager.dialog.add.title"),
|
|
@@ -736,7 +734,7 @@ const nt = Ye(
|
|
|
736
734
|
operation: S.F_OPERATION_TYPE.create,
|
|
737
735
|
data: {
|
|
738
736
|
name: s,
|
|
739
|
-
position:
|
|
737
|
+
position: Ye().subcategories.length
|
|
740
738
|
}
|
|
741
739
|
};
|
|
742
740
|
a ? await r(p) : await n.updateMenu(p, s), e.close();
|
|
@@ -800,20 +798,20 @@ const nt = Ye(
|
|
|
800
798
|
a ? await r(s) : await n.updateMenu(s, "Subcategories");
|
|
801
799
|
}
|
|
802
800
|
return {
|
|
803
|
-
create:
|
|
801
|
+
create: m,
|
|
804
802
|
update: l,
|
|
805
803
|
deleteSubcategory: i,
|
|
806
804
|
rearrange: d
|
|
807
805
|
};
|
|
808
806
|
};
|
|
809
807
|
export {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
808
|
+
vt as a,
|
|
809
|
+
ft as b,
|
|
810
|
+
_t as c,
|
|
811
|
+
pt as d,
|
|
812
|
+
gt as f,
|
|
813
|
+
mt as g,
|
|
814
|
+
dt as m,
|
|
817
815
|
Xe as o,
|
|
818
816
|
nt as u
|
|
819
817
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import "./menu-
|
|
1
|
+
import { b as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BRQm-UTk.js";
|
|
2
|
+
import "./menu-Btcr0nsk.js";
|
|
3
3
|
var Z = {
|
|
4
4
|
defaultAmount: 0,
|
|
5
5
|
defaultCurrency: "USD",
|