@feedmepos/mf-menu 0.31.19 → 0.31.20-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.
Files changed (62) hide show
  1. package/dist/{App-BYdEhIsB.js → App-DYCbSkbA.js} +7 -7
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9efnIl2.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BNYiizMM.js} +2 -2
  3. package/dist/{Catalog-BeF2MAMf.js → Catalog-Cl8JCoA2.js} +5 -5
  4. package/dist/{Category-68lIDMM4.js → Category-DYSqq7up.js} +5 -5
  5. package/dist/{Category-eYEccy-O.js → Category-GRP8Rp7n.js} +4 -4
  6. package/dist/{CookingGuide-Bz32NiZQ.js → CookingGuide-ChgYVIuo.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BaswgYtj.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-tN0DPdSE.js} +1 -1
  8. package/dist/{Group-D-SiZ516.js → Group-BiZt4XHC.js} +1 -1
  9. package/dist/{Group-D-oLc9Os.js → Group-b5yCTxMB.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-CG3QcCGe.js → Group.vue_vue_type_script_setup_true_lang-dWm6ex2t.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-qxQlfTgt.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-c9NU88_t.js} +10 -10
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BnR_vEb9.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-cFVj1CKD.js} +6 -6
  13. package/dist/{Ingredient-DeVQYu3s.js → Ingredient-6GjB4nmq.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DlT9flpo.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CaBXfb5-.js} +2 -2
  15. package/dist/{LinkProductSideSheet-ff0xiLFx.js → LinkProductSideSheet-BQz_lIYv.js} +1 -1
  16. package/dist/{MenuSetting-CNam7lKG.js → MenuSetting-C4Aq6ooW.js} +4 -4
  17. package/dist/{PrintRoute-E2tr3XLH.js → PrintRoute-DWmlbkwR.js} +3 -3
  18. package/dist/{Product-7Rw1i0n9.js → Product-D6xehZ0l.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-BJQREiRh.js → Product.vue_vue_type_script_setup_true_lang-DWZ7HOmE.js} +11 -11
  20. package/dist/{ProductInternalTools-CQFGWuIO.js → ProductInternalTools-CDCeo3gj.js} +17 -17
  21. package/dist/{Products-CwB99cm_.js → Products-BJkmoOC8.js} +10 -10
  22. package/dist/{Publish-BDqJAGng.js → Publish-CyjsZWck.js} +3 -3
  23. package/dist/{Recipe-DGGfSdFa.js → Recipe-DhIJaDO9.js} +4 -4
  24. package/dist/{Scheduler-B1iXMsp5.js → Scheduler-nJWhxGd4.js} +3 -3
  25. package/dist/{ServingSequence-BsqrZSeV.js → ServingSequence-BT4f_Hh9.js} +3 -3
  26. package/dist/{Setting-Ddkj70Pj.js → Setting-BF4CdTMX.js} +4 -4
  27. package/dist/{Subcategory-BD7SSDO2.js → Subcategory-DeYME7HI.js} +4 -4
  28. package/dist/{Takeaway-xXfHPAqn.js → Takeaway-D5ouwPE9.js} +4 -4
  29. package/dist/{Takeaway-Bbtyr_w5.js → Takeaway-DUDq_41B.js} +1 -1
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-3DMUi72T.js → Takeaway.vue_vue_type_script_setup_true_lang-Dov6BhB_.js} +5 -5
  31. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DdMK0Ep7.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DpL-tq27.js} +12 -12
  32. package/dist/{Unit-C_EGFOQ4.js → Unit-D_Ird2an.js} +2 -2
  33. package/dist/{Variant-BVBmMLiw.js → Variant-C-yqFGmt.js} +3 -3
  34. package/dist/{_id_-6DLakVN6.js → _id_-BvJdq5ZG.js} +9 -9
  35. package/dist/{app-CFqv8Qfi.js → app-B8iuFLnY.js} +24 -24
  36. package/dist/{app-B1yFnYXj.js → app-CxEocWBk.js} +3 -3
  37. package/dist/app.js +1 -1
  38. package/dist/apps/mf-menu/src/api/menu.d.ts +15 -0
  39. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +1 -1
  40. package/dist/apps/mf-menu/src/composable/useRestaurantsBatch.d.ts +11 -0
  41. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  42. package/dist/assets/{linked-status-CP-b_pSy.js → linked-status-DDJX4ZD2.js} +2 -2
  43. package/dist/assets/{override-menu-87snfyRT.js → override-menu-cx5DqfTh.js} +2 -2
  44. package/dist/assets/{validate-menu-Dww7Tx41.js → validate-menu-D0frdex8.js} +2 -2
  45. package/dist/{catalog-DX0Q3bYf.js → catalog-Cto94JaO.js} +1 -1
  46. package/dist/{catalogSetting-6KOBEmHf.js → catalogSetting-ByoGvysT.js} +1 -1
  47. package/dist/{category-OKMOS9eo.js → category-uBjIJb76.js} +1 -1
  48. package/dist/{currency-D6qbJdVG.js → currency-C1Ppozms.js} +1 -1
  49. package/dist/{dayjs.min-S4_KbmYI.js → dayjs.min-B_1l58q2.js} +1 -1
  50. package/dist/{index-DblZ530b.js → index-B7sXhgMx.js} +2 -2
  51. package/dist/{index-CP9yC7xA.js → index-BpbcArZG.js} +3 -3
  52. package/dist/{index-D-TA45UU.js → index-CN1mzsNU.js} +1 -1
  53. package/dist/{item-C2cuTZal.js → item-BHgMhke0.js} +798 -815
  54. package/dist/{jszip.min-Ysft9G9b.js → jszip.min-D0PDanmi.js} +2 -2
  55. package/dist/{menu-BAqyrAAE.js → menu-BJE_lVhN.js} +4697 -4649
  56. package/dist/{menu-D234yO45.js → menu-BetRJ4QU.js} +1 -1
  57. package/dist/{priceTier-CmRIitL5.js → priceTier-6El8rKww.js} +1 -1
  58. package/dist/{scheduler-D73ftK-h.js → scheduler-hXvwHbcP.js} +3 -3
  59. package/dist/{subcategory-DyYiFcK5.js → subcategory-BTccRQGv.js} +125 -125
  60. package/dist/{toExcel-b5XOmBh7.js → toExcel-D2bru5mp.js} +2 -2
  61. package/dist/{unit-f16HjYLX.js → unit-DJuo62fT.js} +1 -1
  62. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { computed as n, onMounted as d, onBeforeUnmount as g } from "vue";
2
- import { u as a } from "./menu-BAqyrAAE.js";
2
+ import { u as a } from "./menu-BJE_lVhN.js";
3
3
  import "@feedmepos/mf-common";
4
4
  import "@feedmepos/ui-library";
5
5
  function p() {
@@ -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, D as M } from "./menu-BAqyrAAE.js";
4
+ import { u as k, D as M } from "./menu-BJE_lVhN.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 { H as b, G as d, u as ie, I as de, J as X } from "./menu-BAqyrAAE.js";
2
+ import { H as b, G as d, u as ie, I as de, J as X } from "./menu-BJE_lVhN.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-D234yO45.js";
9
- import { L as _e } from "./LinkProductSideSheet-ff0xiLFx.js";
8
+ import { u as pe } from "./menu-BetRJ4QU.js";
9
+ import { L as _e } from "./LinkProductSideSheet-BQz_lIYv.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 Z, ref as R, computed as h, shallowReactive as Te, effectScope as Re, watch as H, defineComponent as Ve, resolveComponent as z, createBlock as Ne, openBlock as Oe, unref as N, withCtx as Pe, createVNode as xe } from "vue";
2
- import { H as k, B as O, aj as ee, G as I, ak as G, J as S, I as te, a9 as M, c as D, Y as E, ai as L, al as Ae, am as Ue, A as Ke, ab as De, an as $e, a8 as J, u as qe } from "./menu-BAqyrAAE.js";
3
- import { useCoreStore as Q, useI18n as ne } from "@feedmepos/mf-common";
4
- import { useSnackbar as He, useDialogChild as Ye } from "@feedmepos/ui-library";
1
+ import { shallowRef as Z, ref as R, computed as h, shallowReactive as Fe, effectScope as Te, watch as H, 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, ak as Q, G as I, al as G, J as S, I as ee, aa as M, c as D, Y as E, aj as L, am as Pe, an as Ae, A as Ue, ac as Ke, ao as De, ap as $e, a9 as qe, u as He } from "./menu-BJE_lVhN.js";
3
+ import { useCoreStore as J, useI18n as te } from "@feedmepos/mf-common";
4
+ import { useSnackbar as Ye, useDialogChild as Be } from "@feedmepos/ui-library";
5
5
  import { defineStore as We } from "pinia";
6
- const je = "/assets/linked-status-CP-b_pSy.js", Be = "/assets/override-menu-87snfyRT.js";
7
- function ze(e) {
6
+ const je = "/assets/linked-status-DDJX4ZD2.js", ze = "/assets/override-menu-cx5DqfTh.js";
7
+ function Ge(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
- function Ge(e, n, a, o) {
13
- const r = k(n), f = a ? r.modules.catalog.find((g) => g._id === a) : null, l = o ? r.modules.scheduler.find((g) => g._id === o) : null, i = f ? k(f) : 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] = ze(y), g), {});
12
+ function Le(e, n, a, o) {
13
+ const r = k(n), f = a ? r.modules.catalog.find((g) => g._id === a) : null, l = o ? r.modules.scheduler.find((g) => g._id === o) : null, i = f ? k(f) : 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), {});
14
14
  function p(g = []) {
15
15
  const y = e.map((b) => b._id);
16
16
  return [
@@ -75,7 +75,7 @@ function T(e, n, a) {
75
75
  groups: r
76
76
  };
77
77
  }
78
- function Le(e, n) {
78
+ function Je(e, n) {
79
79
  const a = e.groups.map((f) => {
80
80
  const l = n.modules.group.find((d) => d._id === f._id), i = ((l == null ? void 0 : l.items) || []).map((d) => {
81
81
  var p;
@@ -85,7 +85,7 @@ function Le(e, n) {
85
85
  if (u)
86
86
  return T(u, n, 1);
87
87
  const s = {
88
- ...O.generator.initMenuV4ItemOverrider(),
88
+ ...N.generator.initMenuV4ItemOverrider(),
89
89
  _id: d._id,
90
90
  combinationKey: d.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
- ...O.generator.initMenuV4ItemOverrider(),
96
+ ...N.generator.initMenuV4ItemOverrider(),
97
97
  _id: e._id,
98
98
  name: e.name,
99
99
  code: e.code,
@@ -118,7 +118,7 @@ function Y(e, n) {
118
118
  }), r;
119
119
  }), a;
120
120
  }
121
- function Je(e, n) {
121
+ function Xe(e, n) {
122
122
  const a = e.items[n._id];
123
123
  n.variant && (n.variant = {
124
124
  ...n.variant,
@@ -149,11 +149,11 @@ function Je(e, n) {
149
149
  price: (o == null ? void 0 : o.price) || n.price
150
150
  };
151
151
  }
152
- async function lt(e, n, a, o, r, f = !0) {
153
- const l = k(a), i = f ? Ge(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) => {
152
+ async function dt(e, n, a, o, r, f = !0) {
153
+ const l = k(a), i = f ? 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) => {
154
154
  const y = g._id;
155
- return p[y] = Le(d[y], e), p;
156
- }, {}), s = O.getFallbackPrices({
155
+ return p[y] = Je(d[y], e), p;
156
+ }, {}), s = N.getFallbackPrices({
157
157
  rawMenu: i,
158
158
  items: u,
159
159
  catalogId: o || void 0,
@@ -162,12 +162,12 @@ async function lt(e, n, a, o, r, f = !0) {
162
162
  return n.map((p) => {
163
163
  const g = p._id, y = d[g];
164
164
  return {
165
- ...Je(s, y),
165
+ ...Xe(s, y),
166
166
  category: o || r ? y == null ? void 0 : y.category : null
167
167
  };
168
168
  });
169
169
  }
170
- function dt(e, n) {
170
+ function mt(e, n) {
171
171
  if (e.length === 0) return "";
172
172
  const a = e == null ? void 0 : e.split("variant");
173
173
  return ((a == null ? void 0 : a.reduce((r, f) => {
@@ -181,11 +181,11 @@ function dt(e, n) {
181
181
  }, [])) || []).join(" / ");
182
182
  }
183
183
  const $ = /* @__PURE__ */ new Map();
184
- async function mt(e, n) {
184
+ async function ft(e, n) {
185
185
  const a = `${e._id}-${e.updatedAt}-${n}`;
186
186
  if ($.has(a))
187
187
  return $.get(a);
188
- const o = await ee(
188
+ const o = await Q(
189
189
  je,
190
190
  JSON.stringify({
191
191
  menu: e,
@@ -194,14 +194,14 @@ async function mt(e, n) {
194
194
  );
195
195
  return $.set(a, o), o;
196
196
  }
197
- async function oe(e, n, a) {
198
- return await ee(Be, {
197
+ async function ne(e, n, a) {
198
+ return await Q(ze, {
199
199
  menu: e,
200
200
  catalogId: n,
201
201
  schedulerId: a
202
202
  });
203
203
  }
204
- function ft(e, n, a) {
204
+ function pt(e, n, a) {
205
205
  const o = /* @__PURE__ */ new Set();
206
206
  function r(f, l) {
207
207
  if (!e || !f || !l || o.has(l)) return !1;
@@ -216,7 +216,7 @@ function ft(e, n, a) {
216
216
  }
217
217
  return r(n, a);
218
218
  }
219
- function pt(e, n, a) {
219
+ function _t(e, n, a) {
220
220
  const o = /* @__PURE__ */ new Set();
221
221
  function r(f, l) {
222
222
  if (!e || !f || !l || o.has(f)) return !1;
@@ -232,16 +232,16 @@ function pt(e, n, a) {
232
232
  return r(n, a);
233
233
  }
234
234
  const q = /* @__PURE__ */ new Map();
235
- async function Qe(e, n, a) {
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);
239
- const r = await oe(e, n, a);
239
+ const r = await ne(e, n, a);
240
240
  return q.set(o, r), r;
241
241
  }
242
- async function _t(e, n, a) {
242
+ async function gt(e, n, a) {
243
243
  var l, i;
244
- const o = await Qe(e, n, null), r = [], f = (d, u) => {
244
+ const o = await Ze(e, n, null), r = [], f = (d, u) => {
245
245
  const s = k(d);
246
246
  for (const p in u)
247
247
  u[p] && (s[p] = u[p]);
@@ -251,9 +251,9 @@ async function _t(e, n, a) {
251
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);
252
252
  if (u) {
253
253
  const p = (i = d.items) == null ? void 0 : i.filter((y) => y._id === a && y.combinationKey), g = [u, ...p].map((y) => {
254
- var V, P;
255
- const b = y.combinationKey ? (P = (V = s == null ? void 0 : s.variant) == null ? void 0 : V.variantCombinations) == null ? void 0 : P.find(
256
- (x) => x.combinationKey === y.combinationKey
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
257
  ) : s, F = b && s ? f(s, b) : y;
258
258
  return f(F, y);
259
259
  });
@@ -265,7 +265,7 @@ async function _t(e, n, a) {
265
265
  }
266
266
  return r;
267
267
  }
268
- function Xe({
268
+ function Qe({
269
269
  maxHistorySize: e = 50
270
270
  }) {
271
271
  const n = Z([]), a = R(-1), o = h(() => a.value > 0), r = h(() => a.value < n.value.length - 1);
@@ -292,7 +292,7 @@ function Xe({
292
292
  clear: d
293
293
  };
294
294
  }
295
- const Ze = {
295
+ const et = {
296
296
  async updateMenuModule(e, n) {
297
297
  const a = S.RequestRunner.operation(n, e.modules);
298
298
  if (a.validateError.length > 0)
@@ -303,10 +303,10 @@ const Ze = {
303
303
  modules: a.result || e.modules,
304
304
  _rev: a.id ?? ""
305
305
  };
306
- return te.cloneDeep({ menu: o, updateId: a.id ?? null });
306
+ return ee.cloneDeep({ menu: o, updateId: a.id ?? null });
307
307
  }
308
308
  };
309
- function re() {
309
+ function oe() {
310
310
  return {
311
311
  _id: "",
312
312
  masterCatalogSetting: { inclusiveTaxes: [] },
@@ -329,19 +329,19 @@ function re() {
329
329
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
330
330
  };
331
331
  }
332
- function et() {
332
+ function tt() {
333
333
  return {
334
334
  restaurants: [],
335
- menu: { ...re(), _rev: "" },
335
+ menu: { ...oe(), _rev: "" },
336
336
  currentCatalogId: null,
337
337
  currentCategoryIds: null,
338
338
  currentSchedulerId: ""
339
339
  };
340
340
  }
341
- const tt = We(
341
+ const nt = We(
342
342
  "mf-menu-store-v2",
343
343
  () => {
344
- const e = Te(et()), n = Q(), a = He(), o = h(() => e.menu.modules.serveSequence ? M(e.menu.modules.serveSequence, {
344
+ const e = Fe(tt()), n = J(), a = Ye(), o = h(() => e.menu.modules.serveSequence ? M(e.menu.modules.serveSequence, {
345
345
  selector: "position"
346
346
  }) : []), r = h(() => {
347
347
  var t;
@@ -355,10 +355,10 @@ const tt = We(
355
355
  function s(t, c = !0) {
356
356
  e.menu = { ...t, _rev: e.menu._rev }, c && w.push(e.menu);
357
357
  }
358
- const p = Z(re()), g = R(!1), y = R(1);
358
+ const p = Z(oe()), g = R(!1), y = R(1);
359
359
  async function b() {
360
360
  g.value = !0;
361
- const t = await oe(
361
+ const t = await ne(
362
362
  e.menu,
363
363
  e.currentCatalogId,
364
364
  e.currentSchedulerId
@@ -373,8 +373,8 @@ const tt = We(
373
373
  }
374
374
  return p.value = t, g.value = !1, y.value = y.value + 1, t;
375
375
  }
376
- const V = te.debounce(b, 200);
377
- Re(!0).run(() => {
376
+ const V = ee.debounce(b, 200);
377
+ Te(!0).run(() => {
378
378
  H(
379
379
  () => [e.menu, e.currentCatalogId, e.currentSchedulerId],
380
380
  () => {
@@ -382,7 +382,7 @@ const tt = We(
382
382
  }
383
383
  );
384
384
  });
385
- const x = h(() => [
385
+ const P = h(() => [
386
386
  {
387
387
  label: "Main",
388
388
  value: null
@@ -391,7 +391,7 @@ const tt = We(
391
391
  label: t.name,
392
392
  value: t._id
393
393
  }))
394
- ]), W = h(() => {
394
+ ]), B = h(() => {
395
395
  const t = p.value.modules.category;
396
396
  return [
397
397
  ...U.value.item.addon ? [
@@ -403,10 +403,10 @@ const tt = We(
403
403
  ] : [],
404
404
  ...E(t, (c) => c.name)
405
405
  ];
406
- }), ae = h(() => {
406
+ }), re = h(() => {
407
407
  const t = p.value.modules.subCategory || [];
408
408
  return E(t, (c) => c.name);
409
- }), j = h(() => {
409
+ }), W = h(() => {
410
410
  var c;
411
411
  let t = p.value.modules.item;
412
412
  if (i.value) {
@@ -414,13 +414,13 @@ const tt = We(
414
414
  t = t.filter((v) => {
415
415
  var C;
416
416
  const _ = (C = m == null ? void 0 : m[v._id]) == null ? void 0 : C.find(
417
- (Fe) => !Fe.combinationKey
417
+ (ke) => !ke.combinationKey
418
418
  );
419
419
  return (_ == null ? void 0 : _.orderFrom) !== I.F_ORDER_FROM.enum.NONE;
420
420
  });
421
421
  }
422
422
  return E(t, (m) => m.code || m.name);
423
- }), se = h(() => {
423
+ }), ae = h(() => {
424
424
  const t = e.menu.modules.category, c = E(t, (v) => v.name).reduce(
425
425
  (v, _, C) => (v[_._id] = C, v),
426
426
  { "": 0 }
@@ -429,7 +429,7 @@ const tt = We(
429
429
  m,
430
430
  (v) => v.code || v.name
431
431
  ).reduce((v, _, C) => (v[_._id] = C + c[_.category || ""], v), {});
432
- }), ue = h(() => L(A.value, W.value, j.value)), ie = h(() => {
432
+ }), se = h(() => L(A.value, B.value, W.value)), ue = h(() => {
433
433
  const t = U.value.item.addon ? [
434
434
  {
435
435
  _id: e.currentCatalogId ? "" : null,
@@ -447,16 +447,16 @@ const tt = We(
447
447
  const t = p.value.modules.variant;
448
448
  return M(t, { selector: "name" });
449
449
  });
450
- function ce(t = []) {
450
+ function ie(t = []) {
451
451
  const c = t.map((v) => A.value.find((_) => _._id === v)).filter((v) => !!v);
452
- return O.fullVariantCombination(c).reduce((v, _) => (v[_.combinationKey] = _.selectionName.join(" / "), v), {});
452
+ return N.fullVariantCombination(c).reduce((v, _) => (v[_.combinationKey] = _.selectionName.join(" / "), v), {});
453
453
  }
454
- const le = h(() => E(p.value.modules.group, (t) => t.name)), de = h(() => M(p.value.modules.takeaway, { selector: "name" })), me = h(() => M(e.menu.modules.printDepartment || [], {
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 || [], {
455
455
  selector: "name"
456
- })), fe = h(() => M(e.menu.modules.unit, { selector: "name" })), pe = h(() => M(Ae(e.menu.modules.recipe, e.menu.modules.sku), {
456
+ })), me = h(() => M(e.menu.modules.unit, { selector: "name" })), fe = h(() => M(Pe(e.menu.modules.recipe, e.menu.modules.sku), {
457
457
  selector: "name"
458
- })), _e = h(() => e.menu.modules.cookingGuide), ge = h(() => {
459
- const t = Ue(e.menu.modules.sku);
458
+ })), pe = h(() => e.menu.modules.cookingGuide), _e = h(() => {
459
+ const t = Ae(e.menu.modules.sku);
460
460
  return M(t, { selector: "code" });
461
461
  }), U = h(() => {
462
462
  const t = !e.currentCatalogId, c = r.value === D.F_MENU_VERSION.v4, m = !e.currentSchedulerId, v = {
@@ -530,19 +530,19 @@ const tt = We(
530
530
  function K(t) {
531
531
  return `${t.systemCode}/${t.taxCode}`;
532
532
  }
533
- function ve(t) {
533
+ function ge(t) {
534
534
  const [c, m] = t.split("/");
535
535
  return { systemCode: c, taxCode: m };
536
536
  }
537
- function ye(t, c, m) {
537
+ function ve(t, c, m) {
538
538
  return (t ?? c ?? []).map((v) => K(v)).find((v) => m.some((_) => _.value === v));
539
539
  }
540
- const he = h(() => {
540
+ const ye = h(() => {
541
541
  var v;
542
- const t = ["SV5", "SV10"], c = Ke.Country.getCountryFlattenTaxes(
543
- Q().currentCountry.value
542
+ const t = ["SV5", "SV10"], c = Ue.Country.getCountryFlattenTaxes(
543
+ J().currentCountry.value
544
544
  ), m = c.filter((_) => f.value || !t.includes(_.taxCode)).map((_) => ({
545
- label: `${_.name} (${De(_.rate)}%)`,
545
+ label: `${_.name} (${Ke(_.rate)}%)`,
546
546
  value: K(_),
547
547
  meta: {
548
548
  rate: _.rate
@@ -552,19 +552,19 @@ const tt = We(
552
552
  systemCode: (v = c[0]) == null ? void 0 : v.systemCode,
553
553
  countryTaxOptions: m
554
554
  };
555
- }), be = async () => {
556
- const t = await J.readMenu();
557
- e.menu = t ?? e.menu, B(null);
558
- }, Ce = async () => {
559
- const t = await J.readRestaurantsWithMenu();
560
- e.restaurants = M(t, { selector: "name" });
561
- }, B = (t) => {
555
+ }), he = async () => {
556
+ const t = await qe.readMenu();
557
+ e.menu = t ?? e.menu, j(null);
558
+ }, be = async () => {
559
+ const { fetchAllRestaurants: t } = $e(), c = await t();
560
+ e.restaurants = M(c, { selector: "name" });
561
+ }, j = (t) => {
562
562
  e.currentCatalogId = t;
563
- }, Me = (t) => {
563
+ }, Ce = (t) => {
564
564
  e.currentSchedulerId = t;
565
- }, Se = (t) => {
565
+ }, Me = (t) => {
566
566
  e.currentCategoryIds = t;
567
- }, we = async (t, c) => {
567
+ }, Se = async (t, c) => {
568
568
  const m = Array.isArray(t) ? t : [t];
569
569
  if (!m.length) return;
570
570
  const v = m.map((_) => ({
@@ -576,10 +576,10 @@ const tt = We(
576
576
  if (c || v.some(
577
577
  (C) => [S.F_OPERATION_TYPE.delete, S.F_OPERATION_TYPE.deleteMany].includes(C.operation)
578
578
  )) {
579
- const C = await $e(v, e.menu.modules);
579
+ const C = await De(v, e.menu.modules);
580
580
  if (C !== !0) throw new Error(C);
581
581
  }
582
- const _ = await Ze.updateMenuModule(e.menu, v);
582
+ const _ = await et.updateMenuModule(e.menu, v);
583
583
  return s(_.menu), _;
584
584
  } catch (_) {
585
585
  a.open({
@@ -588,7 +588,7 @@ const tt = We(
588
588
  message: _
589
589
  });
590
590
  }
591
- }, Ee = async (t) => {
591
+ }, we = async (t) => {
592
592
  const c = {
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(c), c;
599
- }, w = Xe({ maxHistorySize: 50 }), Ie = h(() => w.canUndo.value), ke = h(() => w.canRedo.value);
599
+ }, w = Qe({ maxHistorySize: 50 }), Ee = h(() => w.canUndo.value), Ie = h(() => w.canRedo.value);
600
600
  return {
601
601
  state: e,
602
602
  // loading state
@@ -612,41 +612,41 @@ const tt = We(
612
612
  currentCatalog: i,
613
613
  schedulers: d,
614
614
  currentScheduler: u,
615
- catalogOptions: x,
616
- categories: W,
617
- subcategories: ae,
618
- items: j,
619
- sortedItems: se,
620
- categorizedItems: ue,
621
- categorizedRawMenuItems: ie,
615
+ catalogOptions: P,
616
+ categories: B,
617
+ subcategories: re,
618
+ items: W,
619
+ sortedItems: ae,
620
+ categorizedItems: se,
621
+ categorizedRawMenuItems: ue,
622
622
  variants: A,
623
- groups: le,
624
- takeaways: de,
625
- printDepartments: me,
626
- units: fe,
627
- recipes: pe,
628
- cookingGuide: _e,
629
- skus: ge,
623
+ groups: ce,
624
+ takeaways: le,
625
+ printDepartments: de,
626
+ units: me,
627
+ recipes: fe,
628
+ cookingGuide: pe,
629
+ skus: _e,
630
630
  rules: U,
631
- taxSetting: he,
631
+ taxSetting: ye,
632
632
  // Action
633
633
  setMenu: s,
634
- readMenu: be,
635
- readRestaurants: Ce,
636
- selectCatalog: B,
637
- selectScheduler: Me,
638
- selectCategory: Se,
639
- updateMenu: we,
640
- updateMenuSetting: Ee,
634
+ readMenu: he,
635
+ readRestaurants: be,
636
+ selectCatalog: j,
637
+ selectScheduler: Ce,
638
+ selectCategory: Me,
639
+ updateMenu: Se,
640
+ updateMenuSetting: we,
641
641
  computeMergedMenu: b,
642
642
  // helper
643
643
  encodeTax: K,
644
- decodeTax: ve,
645
- getSelectedTax: ye,
646
- mapVariant: ce,
644
+ decodeTax: ge,
645
+ getSelectedTax: ve,
646
+ mapVariant: ie,
647
647
  // history
648
- canUndoHistory: Ie,
649
- canRedoHistory: ke,
648
+ canUndoHistory: Ee,
649
+ canRedoHistory: Ie,
650
650
  undoHistory: () => {
651
651
  const t = w.undo();
652
652
  t && s(t, !1);
@@ -660,20 +660,20 @@ const tt = We(
660
660
  }
661
661
  };
662
662
  }
663
- ), X = /* @__PURE__ */ Ve({
663
+ ), X = /* @__PURE__ */ Re({
664
664
  __name: "AddSubcategoryDialogContentComponent",
665
665
  props: {
666
666
  initialValue: {}
667
667
  },
668
668
  setup(e) {
669
- const n = e, { t: a } = ne();
669
+ const n = e, { t: a } = te();
670
670
  H(
671
671
  () => n.initialValue,
672
672
  (l) => {
673
673
  o.value = l ?? "";
674
674
  }
675
675
  );
676
- const o = R(n.initialValue), { emitData: r, emitAction: f } = Ye();
676
+ const o = R(n.initialValue), { emitData: r, emitAction: f } = Be();
677
677
  return H(
678
678
  o,
679
679
  (l) => {
@@ -684,29 +684,29 @@ const tt = We(
684
684
  }
685
685
  ), (l, i) => {
686
686
  const d = z("fm-text-field"), u = z("FmForm");
687
- return Oe(), Ne(u, {
688
- onValidationSuccess: i[1] || (i[1] = (s) => N(f)("primary"))
687
+ return xe(), Ve(u, {
688
+ onValidationSuccess: i[1] || (i[1] = (s) => x(f)("primary"))
689
689
  }, {
690
- default: Pe(() => [
691
- xe(d, {
690
+ default: Ne(() => [
691
+ Oe(d, {
692
692
  modelValue: o.value,
693
693
  "onUpdate:modelValue": i[0] || (i[0] = (s) => o.value = s),
694
- rules: [(s) => !!s || N(a)("menu.subcategory.dialog.add.name.required")],
694
+ rules: [(s) => !!s || x(a)("menu.subcategory.dialog.add.name.required")],
695
695
  autofocus: "",
696
- label: N(a)("menu.subcategory.dialog.add.name.label"),
697
- placeholder: N(a)("menu.subcategory.dialog.add.name.placeholder")
696
+ label: x(a)("menu.subcategory.dialog.add.name.label"),
697
+ placeholder: x(a)("menu.subcategory.dialog.add.name.placeholder")
698
698
  }, null, 8, ["modelValue", "rules", "label", "placeholder"])
699
699
  ]),
700
700
  _: 1
701
701
  });
702
702
  };
703
703
  }
704
- }), gt = ({
704
+ }), vt = ({
705
705
  dialog: e,
706
706
  menuLoader: n,
707
707
  isLocalOnly: a = !1
708
708
  }) => {
709
- const { t: o } = ne(), r = tt().updateMenu;
709
+ const { t: o } = te(), r = nt().updateMenu;
710
710
  function f() {
711
711
  const u = R(!1);
712
712
  e.open({
@@ -730,7 +730,7 @@ const tt = We(
730
730
  operation: S.F_OPERATION_TYPE.create,
731
731
  data: {
732
732
  name: s,
733
- position: qe().subcategories.length
733
+ position: He().subcategories.length
734
734
  }
735
735
  };
736
736
  a ? await r(p) : await n.updateMenu(p, s), e.close();
@@ -801,13 +801,13 @@ const tt = We(
801
801
  };
802
802
  };
803
803
  export {
804
- gt as a,
805
- mt as b,
806
- pt as c,
807
- ft as d,
808
- _t as f,
809
- dt as g,
810
- lt as m,
811
- Qe as o,
812
- tt as u
804
+ vt as a,
805
+ ft as b,
806
+ _t as c,
807
+ pt as d,
808
+ gt as f,
809
+ mt as g,
810
+ dt as m,
811
+ Ze as o,
812
+ nt as u
813
813
  };
@@ -1,5 +1,5 @@
1
- import { b as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BnR_vEb9.js";
2
- import "./menu-BAqyrAAE.js";
1
+ import { b as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-cFVj1CKD.js";
2
+ import "./menu-BJE_lVhN.js";
3
3
  var Z = {
4
4
  defaultAmount: 0,
5
5
  defaultCurrency: "USD",
@@ -1,6 +1,6 @@
1
1
  import { defineStore as J } from "pinia";
2
2
  import { defineComponent as O, computed as U, ref as h, watch as T, resolveComponent as V, createBlock as W, openBlock as F, withCtx as w, createVNode as m, createElementVNode as f, normalizeClass as Q, 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 B, a7 as te, a4 as P, H as k, O as $, D as I, B as E, I as ne, a5 as ae, J as C, G as D, u as oe } from "./menu-BAqyrAAE.js";
3
+ import { a7 as B, a8 as te, a5 as P, H as k, O as $, D as I, B as E, I as ne, a6 as ae, J as C, G as D, u as oe } from "./menu-BJE_lVhN.js";
4
4
  import { useI18n as L } 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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-menu",
3
- "version": "0.31.19",
3
+ "version": "0.31.20-prod",
4
4
  "files": [
5
5
  "dist"
6
6
  ],