@feedmepos/mf-menu 0.31.42-prod → 0.31.43-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 (67) hide show
  1. package/dist/{App-2JChZsbD.js → App-DudzVdxN.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-D2LLOZrw.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Cx6BY_nW.js} +3 -3
  3. package/dist/{Catalog-BmiGl1s_.js → Catalog-BMuTQtqx.js} +6 -6
  4. package/dist/{Category-BV4b15dp.js → Category-CUZ_xxMs.js} +4 -4
  5. package/dist/{Category-C4aYzE74.js → Category-NDkmqvdw.js} +6 -6
  6. package/dist/{CookingGuide-CcdqS3EL.js → CookingGuide-3SgKZVRT.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Brcc_WN7.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-FuOBls0m.js} +1 -1
  8. package/dist/{Group-DYnOQq0q.js → Group-ClTlb1X2.js} +1 -1
  9. package/dist/{Group-DTRgvVko.js → Group-CvUWYuaR.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-BJiPe3tH.js → Group.vue_vue_type_script_setup_true_lang-jbtZjvRL.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BBeDpoKA.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C_nvZOlm.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Do-V1ceo.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BiwIRHka.js} +15325 -15684
  13. package/dist/{Ingredient-BGRNUHBO.js → Ingredient-C3a4gt_G.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-B8UmHWQq.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CYoMl-_4.js} +1052 -1052
  15. package/dist/{LinkProductSideSheet-zAHlypah.js → LinkProductSideSheet-4GgEt5LN.js} +3 -3
  16. package/dist/{MenuSetting-CJb8sWNZ.js → MenuSetting-DMDHHBs2.js} +5 -5
  17. package/dist/{PrintRoute-nSaHp9qi.js → PrintRoute-D8mE_R6M.js} +4 -4
  18. package/dist/{Product-BULdwb1Q.js → Product-B7oT5kJ6.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-CBh0gBr2.js → Product.vue_vue_type_script_setup_true_lang-CUn6_bGq.js} +13 -13
  20. package/dist/{ProductInternalTools-CPDtesKz.js → ProductInternalTools-BPnnO5dR.js} +5 -5
  21. package/dist/Products-iYZPVp8Y.js +675 -0
  22. package/dist/{Publish-DHIlFwkI.js → Publish-BCFYIz0P.js} +3 -3
  23. package/dist/{Recipe-CldQTZfD.js → Recipe-Be6kHRWd.js} +4 -4
  24. package/dist/{Scheduler-DHQiJk0r.js → Scheduler-DTULqkZU.js} +3 -3
  25. package/dist/{ServingSequence-HAF3-DVb.js → ServingSequence-1B2t3IOz.js} +3 -3
  26. package/dist/{Setting-C0tsedhx.js → Setting-Bfx_kAhO.js} +5 -5
  27. package/dist/{Subcategory-DeUrA-yT.js → Subcategory-CspNxL0A.js} +4 -4
  28. package/dist/{Takeaway-BAl6SWU-.js → Takeaway-8ZrctPk8.js} +4 -4
  29. package/dist/{Takeaway-CnqY1GJT.js → Takeaway-DS9QWvP4.js} +1 -1
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BLIT_vSE.js → Takeaway.vue_vue_type_script_setup_true_lang-DPtA07uy.js} +5 -5
  31. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-CTXytwNl.js → Thumbnail.vue_vue_type_script_setup_true_lang-CdaiLu5o.js} +4 -4
  32. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DC64EAri.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C39Fg0ZP.js} +14 -14
  33. package/dist/{Unit-BNghOE-p.js → Unit-qDXlKpxA.js} +2 -2
  34. package/dist/{Variant-BJgWQnCr.js → Variant-tGw0WZcw.js} +3 -3
  35. package/dist/{_id_-DyxLgR7H.js → _id_-nUIFi5Lq.js} +10 -10
  36. package/dist/{app-CUB5WG-_.js → app-B-AEzoH6.js} +1 -1
  37. package/dist/{app-BrdLq53I.js → app-BPqH1NSp.js} +25 -25
  38. package/dist/app.js +1 -1
  39. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +123 -0
  40. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +32 -0
  41. package/dist/apps/mf-menu/src/helper/{import-export.d.ts → menuImport.d.ts} +3 -127
  42. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/assets/{linked-status-Dydn-qHJ.js → linked-status-CXZIhnqe.js} +2 -2
  44. package/dist/assets/{override-menu-BZxKccD-.js → override-menu-xw0Dqkm6.js} +2 -2
  45. package/dist/assets/{validate-menu-yzthJ_kL.js → validate-menu-ByQAWT_D.js} +2 -2
  46. package/dist/{catalog-D_-zPbeP.js → catalog-DLqIkhbq.js} +1 -1
  47. package/dist/{catalogSetting-DYqtFHuW.js → catalogSetting-CD1xVSYG.js} +1 -1
  48. package/dist/{category-Ds6mhoE_.js → category-CrJofVZH.js} +1 -1
  49. package/dist/{currency-D0LVH4Rm.js → currency-DvON4euj.js} +1 -1
  50. package/dist/{customAttributes-B0VHSDMv.js → customAttributes-C81bk6Ag.js} +1 -1
  51. package/dist/{dayjs.min-Dv2twIbC.js → dayjs.min-DkxnzHIf.js} +1 -1
  52. package/dist/{index-DZ46q9oh.js → index-Bi-tjPhn.js} +1 -1
  53. package/dist/{index-BHoiDppz.js → index-DoMiLJrG.js} +3 -3
  54. package/dist/{index-DKi3mpaS.js → index-Y2Y_5NeG.js} +1 -1
  55. package/dist/{index-N5K98R3Q.js → index-k8JBMmlm.js} +4 -4
  56. package/dist/{item-C8iSUmWK.js → item-BI77lImE.js} +16 -16
  57. package/dist/{jszip.min-ubvTgNXq.js → jszip.min-K1Xi3iCG.js} +689 -689
  58. package/dist/{menu-Cvzv8myY.js → menu-Cg_li9fp.js} +5 -5
  59. package/dist/{menu-CdKiY8ht.js → menu-v8tF5owz.js} +1 -1
  60. package/dist/{menuV2-h9I06V2J.js → menuV2-BmOhyQh2.js} +46 -46
  61. package/dist/{priceTier-B_8G5Phm.js → priceTier-D89QKPQZ.js} +1 -1
  62. package/dist/{scheduler-C7YXb2vA.js → scheduler-CFnDK-I3.js} +4 -4
  63. package/dist/{subcategory-BoSu3WbF.js → subcategory-CyIY_sdl.js} +2 -2
  64. package/dist/{toExcel-Da46LGX1.js → toExcel-DIGelQ9s.js} +2 -2
  65. package/dist/{unit-a1gpxhcI.js → unit-Bk_zO_6l.js} +2 -2
  66. package/package.json +2 -2
  67. package/dist/Products-B_VJPTVs.js +0 -286
@@ -1,16 +1,16 @@
1
- import { ao as L, H as k, D as I, A as J, ap as W, J as D, I as Y, a9 as w, c as x, X as E, aj as j, aq as Me, ar as Ee, B as ke, ab as Ie, as as Re, at as Te, a8 as Fe } from "./menu-Cvzv8myY.js";
1
+ import { ao as L, H as E, D as I, A as J, ap as j, J as U, I as X, a9 as w, c as x, X as k, aj as B, aq as Me, ar as ke, B as Ee, ab as Ie, as as Re, at as Te, a8 as Fe } from "./menu-Cg_li9fp.js";
2
2
  import { defineStore as Ae } from "pinia";
3
- import { shallowRef as X, ref as U, computed as h, shallowReactive as Ke, effectScope as Pe, watch as Oe } from "vue";
3
+ import { shallowRef as Y, ref as D, computed as h, shallowReactive as Pe, effectScope as Ke, watch as Oe } from "vue";
4
4
  import { useCoreStore as z } from "@feedmepos/mf-common";
5
5
  import { useSnackbar as Ve } from "@feedmepos/ui-library";
6
- const xe = "/assets/linked-status-Dydn-qHJ.js", Ne = "/assets/override-menu-BZxKccD-.js";
6
+ const xe = "/assets/linked-status-CXZIhnqe.js", Ne = "/assets/override-menu-xw0Dqkm6.js";
7
7
  function $e(e) {
8
8
  var a;
9
- const n = k(e), o = (a = n.variant) == null ? void 0 : a.variantCombinations;
9
+ const n = E(e), o = (a = n.variant) == null ? void 0 : a.variantCombinations;
10
10
  return delete n.variant, delete n.thumbnail, [n, ...o || []];
11
11
  }
12
- function De(e, n, o, a) {
13
- const r = k(n), l = o ? r.modules.catalog.find((_) => _._id === o) : null, d = a ? r.modules.scheduler.find((_) => _._id === a) : null, i = l ? k(l) : void 0, c = o ? r.modules.catalog.filter((_) => _._id !== o) : [], m = d ? k(d) : void 0, f = e.reduce((_, y) => (_[y._id] = $e(y), _), {});
12
+ function Ue(e, n, o, a) {
13
+ const r = E(n), l = o ? r.modules.catalog.find((_) => _._id === o) : null, d = a ? r.modules.scheduler.find((_) => _._id === a) : null, i = l ? E(l) : void 0, c = o ? r.modules.catalog.filter((_) => _._id !== o) : [], m = d ? E(d) : void 0, f = e.reduce((_, y) => (_[y._id] = $e(y), _), {});
14
14
  function v(_ = []) {
15
15
  const y = e.map((C) => C._id);
16
16
  return [
@@ -35,9 +35,9 @@ function De(e, n, o, a) {
35
35
  ...r.modules.scheduler.filter((_) => _._id !== a),
36
36
  m
37
37
  ], r) : {
38
- ...W(),
38
+ ...j(),
39
39
  modules: {
40
- ...W().modules,
40
+ ...j().modules,
41
41
  catalog: r.modules.catalog,
42
42
  item: r.modules.item,
43
43
  group: r.modules.group,
@@ -75,7 +75,7 @@ function T(e, n, o) {
75
75
  groups: r
76
76
  };
77
77
  }
78
- function Ue(e, n) {
78
+ function De(e, n) {
79
79
  const o = e.groups.map((l) => {
80
80
  const d = n.modules.group.find((c) => c._id === l._id), i = ((d == null ? void 0 : d.items) || []).map((c) => {
81
81
  var v;
@@ -150,9 +150,9 @@ function He(e, n) {
150
150
  };
151
151
  }
152
152
  async function et(e, n, o, a, r, l = !0) {
153
- const d = k(o), i = l ? De(n, d, a, r) : d, c = n.reduce((v, _) => (v[_._id] = i.modules.item.find((y) => y._id === _._id), v), {}), m = n.reduce((v, _) => {
153
+ const d = E(o), i = l ? Ue(n, d, a, r) : d, c = n.reduce((v, _) => (v[_._id] = i.modules.item.find((y) => y._id === _._id), v), {}), m = n.reduce((v, _) => {
154
154
  const y = _._id;
155
- return v[y] = Ue(c[y], e), v;
155
+ return v[y] = De(c[y], e), v;
156
156
  }, {}), f = I.getFallbackPrices({
157
157
  rawMenu: i,
158
158
  items: m,
@@ -242,7 +242,7 @@ async function qe(e, n, o) {
242
242
  async function st(e, n, o) {
243
243
  var d, i;
244
244
  const a = await qe(e, n, null), r = [], l = (c, m) => {
245
- const f = k(c);
245
+ const f = E(c);
246
246
  for (const v in m)
247
247
  m[v] && (f[v] = m[v]);
248
248
  return f;
@@ -253,7 +253,7 @@ async function st(e, n, o) {
253
253
  const v = (i = c.items) == null ? void 0 : i.filter((y) => y._id === o && y.combinationKey), _ = [m, ...v].map((y) => {
254
254
  var F, A;
255
255
  const C = y.combinationKey ? (A = (F = f == null ? void 0 : f.variant) == null ? void 0 : F.variantCombinations) == null ? void 0 : A.find(
256
- (K) => K.combinationKey === y.combinationKey
256
+ (P) => P.combinationKey === y.combinationKey
257
257
  ) : f, R = C && f ? l(f, C) : y;
258
258
  return l(R, y);
259
259
  });
@@ -265,10 +265,10 @@ async function st(e, n, o) {
265
265
  }
266
266
  return r;
267
267
  }
268
- function Be({
268
+ function Ge({
269
269
  maxHistorySize: e = 50
270
270
  }) {
271
- const n = X([]), o = U(-1), a = h(() => o.value > 0), r = h(() => o.value < n.value.length - 1);
271
+ const n = Y([]), o = D(-1), a = h(() => o.value > 0), r = h(() => o.value < n.value.length - 1);
272
272
  function l(m) {
273
273
  n.value.push(m), o.value++, n.value.length > e && (n.value.shift(), o.value--);
274
274
  }
@@ -292,9 +292,9 @@ function Be({
292
292
  clear: c
293
293
  };
294
294
  }
295
- const Ge = {
295
+ const We = {
296
296
  async updateMenuModule(e, n) {
297
- const o = D.RequestRunner.operation(n, e.modules);
297
+ const o = U.RequestRunner.operation(n, e.modules);
298
298
  if (o.validateError.length > 0)
299
299
  throw new Error(o.validateError.join(`
300
300
  `));
@@ -303,7 +303,7 @@ const Ge = {
303
303
  modules: o.result || e.modules,
304
304
  _rev: o.id ?? ""
305
305
  };
306
- return Y.cloneDeep({ menu: a, updateId: o.id ?? null });
306
+ return X.cloneDeep({ menu: a, updateId: o.id ?? null });
307
307
  }
308
308
  };
309
309
  function Q() {
@@ -329,7 +329,7 @@ function Q() {
329
329
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
330
330
  };
331
331
  }
332
- function We() {
332
+ function je() {
333
333
  return {
334
334
  restaurants: [],
335
335
  menu: { ...Q(), _rev: "" },
@@ -345,7 +345,7 @@ function We() {
345
345
  const at = Ae(
346
346
  "mf-menu-store-v2",
347
347
  () => {
348
- const e = Ke(We()), n = z(), o = Ve(), a = h(() => e.menu.modules.serveSequence ? w(e.menu.modules.serveSequence, {
348
+ const e = Pe(je()), n = z(), o = Ve(), a = h(() => e.menu.modules.serveSequence ? w(e.menu.modules.serveSequence, {
349
349
  selector: "position"
350
350
  }) : []), r = h(() => {
351
351
  var t;
@@ -370,7 +370,7 @@ const at = Ae(
370
370
  function f(t, s = !0) {
371
371
  e.menu = { ...t, _rev: e.menu._rev }, s && M.push(e.menu);
372
372
  }
373
- const v = X(Q()), _ = U(!1), y = U(1);
373
+ const v = Y(Q()), _ = D(!1), y = D(1);
374
374
  async function C() {
375
375
  var u;
376
376
  _.value = !0;
@@ -405,8 +405,8 @@ const at = Ae(
405
405
  }
406
406
  return v.value = s, _.value = !1, y.value = y.value + 1, s;
407
407
  }
408
- const F = Y.debounce(C, 200);
409
- Pe(!0).run(() => {
408
+ const F = X.debounce(C, 200);
409
+ Ke(!0).run(() => {
410
410
  Oe(
411
411
  () => [e.menu, e.currentCatalogId, e.currentSchedulerId],
412
412
  () => {
@@ -414,7 +414,7 @@ const at = Ae(
414
414
  }
415
415
  );
416
416
  });
417
- const K = h(() => [
417
+ const P = h(() => [
418
418
  {
419
419
  label: "Main",
420
420
  value: null
@@ -433,12 +433,12 @@ const at = Ae(
433
433
  position: 0
434
434
  }
435
435
  ] : [],
436
- ...E(t, (s) => s.name)
436
+ ...k(t, (s) => s.name)
437
437
  ];
438
438
  }), ee = h(() => {
439
439
  const t = v.value.modules.subCategory || [];
440
- return E(t, (s) => s.name);
441
- }), B = h(() => {
440
+ return k(t, (s) => s.name);
441
+ }), G = h(() => {
442
442
  var s;
443
443
  let t = v.value.modules.item;
444
444
  if (i.value) {
@@ -451,17 +451,17 @@ const at = Ae(
451
451
  return (g == null ? void 0 : g.orderFrom) !== J.F_ORDER_FROM.enum.NONE;
452
452
  });
453
453
  }
454
- return E(t, (u) => u.code || u.name);
454
+ return k(t, (u) => u.code || u.name);
455
455
  }), te = h(() => {
456
- const t = e.menu.modules.category, s = E(t, (p) => p.name).reduce(
456
+ const t = e.menu.modules.category, s = k(t, (p) => p.name).reduce(
457
457
  (p, g, S) => (p[g._id] = S, p),
458
458
  { "": 0 }
459
459
  ), u = e.menu.modules.item;
460
- return E(
460
+ return k(
461
461
  u,
462
462
  (p) => p.code || p.name
463
463
  ).reduce((p, g, S) => (p[g._id] = S + s[g.category || ""], p), {});
464
- }), ne = h(() => j(P.value, q.value, B.value)), re = h(() => {
464
+ }), ne = h(() => B(K.value, q.value, G.value)), re = h(() => {
465
465
  const t = O.value.item.addon ? [
466
466
  {
467
467
  _id: e.currentCatalogId ? "" : null,
@@ -470,25 +470,25 @@ const at = Ae(
470
470
  },
471
471
  ...e.menu.modules.category
472
472
  ] : e.menu.modules.category;
473
- return j(
473
+ return B(
474
474
  e.menu.modules.variant,
475
475
  t,
476
476
  e.menu.modules.item
477
477
  );
478
- }), P = h(() => {
478
+ }), K = h(() => {
479
479
  const t = v.value.modules.variant;
480
480
  return w(t, { selector: "name" });
481
481
  });
482
482
  function oe(t = []) {
483
- const s = t.map((p) => P.value.find((g) => g._id === p)).filter((p) => !!p);
483
+ const s = t.map((p) => K.value.find((g) => g._id === p)).filter((p) => !!p);
484
484
  return I.fullVariantCombination(s).reduce((p, g) => (p[g.combinationKey] = g.selectionName.join(" / "), p), {});
485
485
  }
486
- const se = h(() => E(v.value.modules.group, (t) => t.name)), ae = h(() => w(v.value.modules.takeaway, { selector: "name" })), ue = h(() => w(e.menu.modules.printDepartment || [], {
486
+ const se = h(() => k(v.value.modules.group, (t) => t.name)), ae = h(() => w(v.value.modules.takeaway, { selector: "name" })), ue = h(() => w(e.menu.modules.printDepartment || [], {
487
487
  selector: "name"
488
488
  })), ie = h(() => w(e.menu.modules.unit, { selector: "name" })), ce = h(() => w(Me(e.menu.modules.recipe, e.menu.modules.sku), {
489
489
  selector: "name"
490
490
  })), le = h(() => e.menu.modules.cookingGuide), de = h(() => {
491
- const t = Ee(e.menu.modules.sku);
491
+ const t = ke(e.menu.modules.sku);
492
492
  return w(t, { selector: "code" });
493
493
  }), O = h(() => {
494
494
  const t = !e.currentCatalogId, s = r.value === x.F_MENU_VERSION.v4, u = !e.currentSchedulerId, p = {
@@ -571,7 +571,7 @@ const at = Ae(
571
571
  }
572
572
  const pe = h(() => {
573
573
  var p;
574
- const t = ["SV5", "SV10"], s = ke.Country.getCountryFlattenTaxes(
574
+ const t = ["SV5", "SV10"], s = Ee.Country.getCountryFlattenTaxes(
575
575
  z().currentCountry.value
576
576
  ), u = s.filter((g) => l.value || !t.includes(g.taxCode)).map((g) => ({
577
577
  label: `${g.name} (${Ie(g.rate)}%)`,
@@ -586,7 +586,7 @@ const at = Ae(
586
586
  };
587
587
  }), ve = async () => {
588
588
  const t = await Fe.readMenu();
589
- e.menu = t ?? e.menu, G(null);
589
+ e.menu = t ?? e.menu, W(null);
590
590
  }, ge = async () => {
591
591
  const { fetchAllRestaurants: t } = Te();
592
592
  await t({
@@ -594,7 +594,7 @@ const at = Ae(
594
594
  e.restaurants = s;
595
595
  }
596
596
  });
597
- }, G = (t) => {
597
+ }, W = (t) => {
598
598
  e.currentCatalogId = t;
599
599
  }, _e = (t) => {
600
600
  e.currentSchedulerId = t;
@@ -612,12 +612,12 @@ const at = Ae(
612
612
  }));
613
613
  try {
614
614
  if (s || p.some(
615
- (S) => [D.F_OPERATION_TYPE.delete, D.F_OPERATION_TYPE.deleteMany].includes(S.operation)
615
+ (S) => [U.F_OPERATION_TYPE.delete, U.F_OPERATION_TYPE.deleteMany].includes(S.operation)
616
616
  )) {
617
617
  const S = await Re(p, e.menu.modules);
618
618
  if (S !== !0) throw new Error(S);
619
619
  }
620
- const g = await Ge.updateMenuModule(e.menu, p);
620
+ const g = await We.updateMenuModule(e.menu, p);
621
621
  return f(g.menu), g;
622
622
  } catch (g) {
623
623
  o.open({
@@ -634,7 +634,7 @@ const at = Ae(
634
634
  priceTierSettings: t.priceTierSettings
635
635
  };
636
636
  return f(s), s;
637
- }, M = Be({ maxHistorySize: 50 }), be = h(() => M.canUndo.value), we = h(() => M.canRedo.value);
637
+ }, M = Ge({ maxHistorySize: 50 }), be = h(() => M.canUndo.value), we = h(() => M.canRedo.value);
638
638
  return {
639
639
  state: e,
640
640
  // loading state
@@ -650,14 +650,14 @@ const at = Ae(
650
650
  currentCatalog: i,
651
651
  schedulers: c,
652
652
  currentScheduler: m,
653
- catalogOptions: K,
653
+ catalogOptions: P,
654
654
  categories: q,
655
655
  subcategories: ee,
656
- items: B,
656
+ items: G,
657
657
  sortedItems: te,
658
658
  categorizedItems: ne,
659
659
  categorizedRawMenuItems: re,
660
- variants: P,
660
+ variants: K,
661
661
  groups: se,
662
662
  takeaways: ae,
663
663
  printDepartments: ue,
@@ -671,7 +671,7 @@ const at = Ae(
671
671
  setMenu: f,
672
672
  readMenu: ve,
673
673
  readRestaurants: ge,
674
- selectCatalog: G,
674
+ selectCatalog: W,
675
675
  selectScheduler: _e,
676
676
  selectCategory: ye,
677
677
  setRestaurantAttrParams: he,
@@ -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-Cvzv8myY.js";
4
+ import { u as k, G as M } from "./menu-Cg_li9fp.js";
5
5
  const v = /* @__PURE__ */ d({
6
6
  __name: "AddPriceGroupDialog",
7
7
  setup(s) {
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as ie, computed as Y, resolveComponent as _, createElementBlock as d, openBlock as u, createVNode as t, createCommentVNode as F, unref as n, toDisplayString as L, createElementVNode as h, withCtx as v, Fragment as N, renderList as M, createBlock as I, ref as H, Transition as se, createTextVNode as me } from "vue";
2
- import { H as S, A as r, u as pe, I as ve, J as ue } from "./menu-Cvzv8myY.js";
2
+ import { H as S, A as r, u as pe, I as ve, J as ue } from "./menu-Cg_li9fp.js";
3
3
  import { useI18n as de } from "@feedmepos/mf-common";
4
4
  import { components as _e } from "@feedmepos/ui-library";
5
- import { _ as ne, a as fe } from "./customAttributes-B0VHSDMv.js";
5
+ import { _ as ne, a as fe } from "./customAttributes-C81bk6Ag.js";
6
6
  import { u as ye } from "./discardConfirm-BHni0LNu.js";
7
- import { u as he } from "./menu-CdKiY8ht.js";
8
- import { L as ge } from "./LinkProductSideSheet-zAHlypah.js";
7
+ import { u as he } from "./menu-v8tF5owz.js";
8
+ import { L as ge } from "./LinkProductSideSheet-4GgEt5LN.js";
9
9
  const Ve = { class: "space-y-8" }, Fe = {
10
10
  key: 0,
11
11
  class: "space-y-16"
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as M, watch as _, ref as E, resolveComponent as f, createBlock as x, openBlock as A, unref as c, withCtx as C, createVNode as V } from "vue";
2
- import { J as l, A as d, u as F } from "./menu-Cvzv8myY.js";
2
+ import { J as l, A as d, u as F } from "./menu-Cg_li9fp.js";
3
3
  import { useI18n as b } from "@feedmepos/mf-common";
4
4
  import { useDialogChild as P } from "@feedmepos/ui-library";
5
- import { u as v } from "./menuV2-h9I06V2J.js";
5
+ import { u as v } from "./menuV2-BmOhyQh2.js";
6
6
  const y = /* @__PURE__ */ M({
7
7
  __name: "AddSubcategoryDialogContentComponent",
8
8
  props: {
@@ -1,5 +1,5 @@
1
- import { u as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Do-V1ceo.js";
2
- import "./menu-Cvzv8myY.js";
1
+ import { u as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BiwIRHka.js";
2
+ import "./menu-Cg_li9fp.js";
3
3
  var Z = {
4
4
  defaultAmount: 0,
5
5
  defaultCurrency: "USD",
@@ -1,13 +1,13 @@
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 P, a7 as te, a4 as B, H as k, O as $, G as I, D as E, a5 as ne, J as C, A as D, I as oe, u as ae } from "./menu-Cvzv8myY.js";
3
+ import { a6 as P, a7 as te, a4 as B, H as k, O as $, G as I, D as E, a5 as ne, J as C, A as D, I as oe, u as ae } from "./menu-Cg_li9fp.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";
7
7
  import { c as re } from "./check-C9mY6LiX.js";
8
8
  import "./vuedraggable-CK8z7qA8.js";
9
9
  import "./app-CiBqmBzO.js";
10
- import "./menuV2-h9I06V2J.js";
10
+ import "./menuV2-BmOhyQh2.js";
11
11
  /* empty css */
12
12
  import { c as me } from "./createComponentProgrammatically-Bt2rn1IQ.js";
13
13
  const de = ["value", "disabled"], ce = /* @__PURE__ */ O({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-menu",
3
- "version": "0.31.42-prod",
3
+ "version": "0.31.43-prod",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -53,7 +53,7 @@
53
53
  "vue3-lottie": "^3.3.0",
54
54
  "vuedraggable": "^4.1.0",
55
55
  "xlsx": "^0.18.5",
56
- "@feedmepos/mf-common": "^1.27.3"
56
+ "@feedmepos/mf-common": "^1.27.4"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@rollup/plugin-commonjs": "^28.0.2",
@@ -1,286 +0,0 @@
1
- import { defineComponent as Y, computed as v, ref as G, resolveComponent as w, createBlock as y, openBlock as p, unref as e, withCtx as d, createElementVNode as u, toDisplayString as O, createVNode as o, createCommentVNode as j, createElementBlock as N, Fragment as B } from "vue";
2
- import { D as S } from "./dayjs.min-Dv2twIbC.js";
3
- import { M as oe, w as ne } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Do-V1ceo.js";
4
- import { J as ae, F as re } from "./jszip.min-ubvTgNXq.js";
5
- import { u as J, G as Z, B as P, e as A, A as K, D as se, H as R, I as z } from "./menu-Cvzv8myY.js";
6
- import { useCoreStore as ie, useI18n as le } from "@feedmepos/mf-common";
7
- import { useDialog as Q, useDialogChild as ue, useSnackbar as W, useBreakpoints as ce, FmButtonVariant as $, FmButtonColorThemeVariant as x } from "@feedmepos/ui-library";
8
- import { _ as V } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
9
- import { _ as me, a as L } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
10
- import { _ as de } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
11
- import { u as pe, a as fe } from "./menu-CdKiY8ht.js";
12
- import { u as _e } from "./item-C8iSUmWK.js";
13
- import { _ as U, a as ve } from "./Product.vue_vue_type_script_setup_true_lang-CBh0gBr2.js";
14
- import { L as q } from "./LinkProductSideSheet-zAHlypah.js";
15
- import { _ as ge } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DC64EAri.js";
16
- import { u as be } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CTXytwNl.js";
17
- import { m as ye } from "./toExcel-Da46LGX1.js";
18
- const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], Me = { class: "flex justify-end gap-8" }, he = /* @__PURE__ */ Y({
19
- __name: "ConfirmActionDialog",
20
- props: {
21
- description: {},
22
- value: {},
23
- message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
24
- },
25
- setup(F) {
26
- const t = F, M = v(() => t.message.replace("[[value]]", t.value)), n = G(""), h = Q(), { emitAction: k } = ue();
27
- return (s, i) => {
28
- const f = w("FmTextField"), c = w("FmButton"), g = w("FmForm");
29
- return p(), y(g, {
30
- "on-validation-success": () => e(k)("primary"),
31
- "blame-form-child-on-validation-failed": ""
32
- }, {
33
- default: d(() => [
34
- u("div", ke, [
35
- u("div", null, O(s.description), 1),
36
- u("div", { innerHTML: M.value }, null, 8, xe),
37
- u("div", null, [
38
- o(f, {
39
- modelValue: n.value,
40
- "onUpdate:modelValue": [
41
- i[0] || (i[0] = (l) => n.value = l),
42
- i[1] || (i[1] = () => {
43
- })
44
- ],
45
- placeholder: s.value,
46
- rules: [(l) => l === s.value || "Value does not match"]
47
- }, null, 8, ["modelValue", "placeholder", "rules"])
48
- ]),
49
- u("div", Me, [
50
- o(c, {
51
- label: "Cancel",
52
- variant: "secondary",
53
- onClick: i[2] || (i[2] = (l) => e(h).close())
54
- }),
55
- o(c, {
56
- label: "Confirm",
57
- type: "submit"
58
- })
59
- ])
60
- ])
61
- ]),
62
- _: 1
63
- }, 8, ["on-validation-success"]);
64
- };
65
- }
66
- }), Se = /* @__PURE__ */ Y({
67
- __name: "Migrate",
68
- setup(F) {
69
- const t = J(), M = ie(), n = W(), { minor: h } = Z(n), k = G(!1), s = Q();
70
- async function i() {
71
- f.value || k.value || s.open({
72
- title: "Migrate to new version",
73
- contentComponent: he,
74
- contentComponentProps: {
75
- value: "MIGRATE",
76
- description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
77
- }
78
- }).onPrimary(async () => {
79
- s.close(), await h(
80
- async () => {
81
- await t.migrate(), setTimeout(() => {
82
- window.location.reload();
83
- }, 2e3);
84
- },
85
- {
86
- isLoading: k,
87
- customId: t.state.menu._id,
88
- message: "Migrating menu",
89
- successMessage: "Migration completed"
90
- }
91
- );
92
- });
93
- }
94
- const f = v(() => {
95
- const c = M.restaurants.value;
96
- if (!c.length) return "Required at least one restaurant to migrate";
97
- const g = c.filter((b) => !b.posVersion || !P.Pos.canUse({ feature: A.F_FEATURE.enum.menuV4, posVersion: b.posVersion }));
98
- return g.length ? `Upgrade POS to V${P.Pos.minVersionToUse(A.F_FEATURE.enum.menuV4)} to use new menu: ${g.map((b) => b.profile.name).join(", ")}` : null;
99
- });
100
- return v(() => f.value ? f.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (c, g) => {
101
- const l = w("FmSnackbar");
102
- return !f.value && e(t).version !== e(K.F_MENU_VERSION).enum.v4 ? (p(), y(l, {
103
- key: 0,
104
- class: "!max-w-full",
105
- title: "New version of menu is out now!",
106
- description: "Migrate your current menu version to the latest to enjoy more features such as product sequential dispatch, serving sequence, scheduler and more! Your content and current setting will be preserved.",
107
- variant: "info",
108
- action: "Migrate",
109
- "z-index": 0,
110
- onOnAction: i
111
- })) : j("", !0);
112
- };
113
- }
114
- }), we = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ce = { class: "flex items-center" }, Fe = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, $e = { class: "fm-typo-en-body-md-600 font-semibold" }, Ve = { class: "flex gap-8" }, je = /* @__PURE__ */ Y({
115
- __name: "Products",
116
- setup(F) {
117
- const { t } = le(), M = Z(W()), n = J(), h = v(() => n.rules.item), k = _e(), s = v(() => !n.state.currentSchedulerId), { selectedCategories: i } = pe(), f = v(() => ({
118
- ...se.menuV4ToV3(R(n.state.menu)),
119
- _id: n.state.menu._id,
120
- _rev: n.state.menu._rev
121
- })), c = v(() => {
122
- const m = z.flatten(i.value.map((a) => a.items));
123
- return z.uniqBy(m, (a) => a._id).length;
124
- });
125
- async function g(m, a) {
126
- const _ = new ae();
127
- for (let C = 0; C < m.length; C++) {
128
- const te = await m[C].xlsx.writeBuffer();
129
- _.file(`${a[C]}.xlsx`, te);
130
- }
131
- const r = await _.generateAsync({ type: "blob" });
132
- re.saveAs(r, `books_${S().format("DD-MM-YYYY_HH-mm")}.zip`);
133
- }
134
- async function l() {
135
- await M.minor(
136
- async () => {
137
- if (await n.readMenu(), n.version === K.F_MENU_VERSION.enum.v4) {
138
- const m = R(n.state.menu), a = new oe(m).exportToExcel(), _ = [
139
- `menu_${S().format("DD-MM-YYYY_HH-mm")}`,
140
- `addonGroup_${S().format("DD-MM-YYYY_HH-mm")}`,
141
- `itemLinkedAddon${S().format("DD-MM-YYYY_HH-mm")}`
142
- ];
143
- g(a, _);
144
- } else {
145
- const m = ye(f.value), a = `menu_${S().format("DD-MM-YYYY_HH-mm")}`;
146
- await ne(m, `${a}.xlsx`, {
147
- bookType: "xlsx",
148
- bookSST: !1,
149
- type: "array"
150
- });
151
- }
152
- },
153
- { successMessage: "Menu exported", customId: n.state.menu._id }
154
- );
155
- }
156
- const {
157
- menuItems: b,
158
- categories: E,
159
- linkItemRules: D,
160
- handleSubmit: T,
161
- catalogManager: I,
162
- schedulerManager: H
163
- } = be(!1), X = ce(), ee = v(() => X.breakpoints.value.xs);
164
- return fe().resetOnMount(), (m, a) => {
165
- const _ = w("fm-button");
166
- return p(), y(de, {
167
- heading: e(t)("menu.products.title")
168
- }, {
169
- default: d(() => [
170
- o(Se),
171
- o(ve)
172
- ]),
173
- "append-heading": d(() => [
174
- u("div", we, [
175
- u("div", Ce, [
176
- u("div", Fe, [
177
- u("p", $e, O(c.value), 1)
178
- ])
179
- ]),
180
- u("div", Ve, [
181
- ee.value ? (p(), y(U, { key: 1 }, {
182
- default: d(({ trigger: r }) => [
183
- o(me, null, {
184
- default: d(() => [
185
- o(L, {
186
- label: e(t)("menu.products.actions.export"),
187
- onClick: l
188
- }, null, 8, ["label"]),
189
- o(L, {
190
- label: e(t)("menu.products.actions.import"),
191
- onClick: r
192
- }, null, 8, ["label", "onClick"])
193
- ]),
194
- _: 2
195
- }, 1024)
196
- ]),
197
- _: 1
198
- })) : (p(), N(B, { key: 0 }, [
199
- o(ge, null, {
200
- default: d(({ trigger: r }) => [
201
- o(_, {
202
- label: e(t)("menu.tree_editor.title"),
203
- "bg-color": e(x).NeutralGray100,
204
- "text-color": e(x).TypoSecondary,
205
- variant: e($).Primary,
206
- onClick: r
207
- }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
208
- ]),
209
- _: 1
210
- }),
211
- o(_, {
212
- "bg-color": e(x).NeutralGray100,
213
- "text-color": e(x).TypoSecondary,
214
- variant: e($).Primary,
215
- label: e(t)("menu.products.actions.export"),
216
- onClick: l
217
- }, null, 8, ["bg-color", "text-color", "variant", "label"]),
218
- o(U, null, {
219
- default: d(({ trigger: r }) => [
220
- o(_, {
221
- "bg-color": e(x).NeutralGray100,
222
- "text-color": e(x).TypoSecondary,
223
- variant: e($).Primary,
224
- label: e(t)("menu.products.actions.import"),
225
- onClick: r
226
- }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
227
- ]),
228
- _: 1
229
- })
230
- ], 64)),
231
- c.value > 0 ? (p(), N(B, { key: 2 }, [
232
- h.value.create ? (p(), y(V, {
233
- key: 0,
234
- label: e(t)("menu.products.actions.add"),
235
- "prepend-icon": "add",
236
- onClick: a[0] || (a[0] = (r) => e(k).create(null))
237
- }, null, 8, ["label"])) : s.value ? (p(), y(q, {
238
- key: 1,
239
- "categorized-items": e(I).linkableItems.value,
240
- "initial-value": e(I).currentItems.value,
241
- "show-variant": !1,
242
- "menu-items": e(b),
243
- categories: e(E),
244
- "link-item-rules": e(D),
245
- "no-scheduler": s.value,
246
- onSubmit: e(T)
247
- }, {
248
- default: d(({ trigger: r }) => [
249
- o(V, {
250
- label: e(t)("menu.products.actions.link"),
251
- "prepend-icon": "link",
252
- onClick: r
253
- }, null, 8, ["label", "onClick"])
254
- ]),
255
- _: 1
256
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (p(), y(q, {
257
- key: 2,
258
- "categorized-items": e(H).linkableItems.value,
259
- "initial-value": e(H).currentItems.value,
260
- "show-variant": !1,
261
- "menu-items": e(b),
262
- categories: e(E),
263
- "link-item-rules": e(D),
264
- "no-scheduler": s.value,
265
- onSubmit: e(T)
266
- }, {
267
- default: d(({ trigger: r }) => [
268
- o(V, {
269
- label: e(t)("menu.products.actions.apply_scheduler"),
270
- onClick: r
271
- }, null, 8, ["label", "onClick"])
272
- ]),
273
- _: 1
274
- }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"]))
275
- ], 64)) : j("", !0)
276
- ])
277
- ])
278
- ]),
279
- _: 1
280
- }, 8, ["heading"]);
281
- };
282
- }
283
- });
284
- export {
285
- je as default
286
- };