@feedmepos/mf-menu 0.18.17 → 0.19.0-beta.2

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 (90) hide show
  1. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-DFJJHptK.js +158 -0
  2. package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BJ0b_uKf.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CXoRwrTi.js} +2 -2
  3. package/dist/Catalog-CXzqtCF8.js +551 -0
  4. package/dist/Category-DKbtLbq8.js +387 -0
  5. package/dist/CookingGuide-BKon8TdH.js +862 -0
  6. package/dist/Group-D1UDksBG.js +46 -0
  7. package/dist/{Group-jEtbECLb.js → Group-izOWb_Bh.js} +1 -1
  8. package/dist/Group.vue_vue_type_script_setup_true_lang-DAlQcgYp.js +558 -0
  9. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Q7es2wmt.js +237 -0
  10. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bw4uxqAp.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Db0uYw5O.js} +11723 -11723
  11. package/dist/Ingredient-BIJu9P_9.js +484 -0
  12. package/dist/LinkProductSideSheet-BNdFZThd.js +104 -0
  13. package/dist/PrintRoute--fYPFcy7.js +417 -0
  14. package/dist/{Product-Bnr9oFr2.js → Product-vLtISbkD.js} +1 -1
  15. package/dist/Product.vue_vue_type_script_setup_true_lang-BHCihe6o.js +826 -0
  16. package/dist/Products-JaCNtcHS.js +236 -0
  17. package/dist/Publish-jpmiyB-b.js +525 -0
  18. package/dist/Recipe-B6y-oLPG.js +320 -0
  19. package/dist/Scheduler-Dj1rlr-U.js +222 -0
  20. package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-BVAkohGJ.js +48 -0
  21. package/dist/ServingSequence-BhIfCyXl.js +4 -0
  22. package/dist/{Setting-DN8TQdIR.js → Setting-B5R1JfaL.js} +1 -1
  23. package/dist/Setting.vue_vue_type_script_setup_true_lang-xXtg0JOn.js +253 -0
  24. package/dist/Takeaway-BSFSz_JL.js +63 -0
  25. package/dist/{Takeaway-y0Nk0JAb.js → Takeaway-DjFTtbw6.js} +1 -1
  26. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BUGL0wfZ.js +302 -0
  27. package/dist/TaxSetting-D9Q8XNgJ.js +25 -0
  28. package/dist/Unit-Cr_8O3zB.js +142 -0
  29. package/dist/Variant-loUMfNRB.js +222 -0
  30. package/dist/_id_-0w7KjYyQ.js +189 -0
  31. package/dist/{app-D7e31gIv.js → app-t9ONnc0s.js} +31701 -26207
  32. package/dist/app.js +7 -6
  33. package/dist/apps/mf-menu/src/app.d.ts +2784 -0
  34. package/dist/apps/mf-menu/src/components/feature/Fields/OrderFrom.vue.d.ts +2 -2
  35. package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +2 -2
  36. package/dist/apps/mf-menu/src/manager/menu/catalog.d.ts +1 -0
  37. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +1 -1
  38. package/dist/apps/mf-menu/src/stores/menu.d.ts +16 -16
  39. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +12 -12
  40. package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +4 -4
  41. package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +4 -4
  42. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/assets/{linked-status-D5tq3eE2.js → linked-status-DLL4aRiX.js} +8 -8
  44. package/dist/assets/{validate-menu-AcCpPyQZ.js → validate-menu-CoXc16jh.js} +8 -8
  45. package/dist/{catalog-Ck7lLTN2.js → catalog-4OmC0JA3.js} +66 -62
  46. package/dist/category-BE33DRqp.js +155 -0
  47. package/dist/{currency-CclA5a-2.js → currency-JHgYNbTQ.js} +1 -1
  48. package/dist/{index-DDd9B_ur.js → index-CE3zjhyh.js} +732 -740
  49. package/dist/index-pSg9p-28.js +238 -0
  50. package/dist/item-CEPx51U1.js +6371 -0
  51. package/dist/{lodash-BIQx_fko.js → lodash-VivR_BQ2.js} +1 -1
  52. package/dist/{menu-CYzbNubv.js → menu-ETQrtbbU.js} +1 -1
  53. package/dist/{object-DUtbNpoS.js → object-DEM5FMTB.js} +4 -4
  54. package/dist/scheduler-SRT_5Nio.js +491 -0
  55. package/dist/string-DpfFixWH.js +4 -0
  56. package/dist/style.css +1 -1
  57. package/dist/takeaway-RcvqKigG.js +267 -0
  58. package/dist/{toExcel-BXPcj8Gp.js → toExcel-BcgskY3F.js} +2 -2
  59. package/dist/unit-DLL7xIF1.js +350 -0
  60. package/package.json +4 -2
  61. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-D9QsJ4vO.js +0 -155
  62. package/dist/Catalog-CZW54QJU.js +0 -570
  63. package/dist/Category-DvsP_L7d.js +0 -405
  64. package/dist/CookingGuide-DC3uXetk.js +0 -848
  65. package/dist/Group-DK5xqeYX.js +0 -44
  66. package/dist/Group.vue_vue_type_script_setup_true_lang-DGZ9hnPg.js +0 -538
  67. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BQXqlXw4.js +0 -234
  68. package/dist/Ingredient-354LLwdX.js +0 -498
  69. package/dist/LinkProductSideSheet-anxSsu0z.js +0 -102
  70. package/dist/PrintRoute-DrSvtNLX.js +0 -425
  71. package/dist/Product.vue_vue_type_script_setup_true_lang-bBY54Q_1.js +0 -815
  72. package/dist/Products-CZyueqSO.js +0 -234
  73. package/dist/Publish-kRM1UuPk.js +0 -518
  74. package/dist/Recipe-nKpLIJs8.js +0 -345
  75. package/dist/Scheduler-DmZ8atXG.js +0 -233
  76. package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-CdsxA-p0.js +0 -48
  77. package/dist/ServingSequence-j00_ko5R.js +0 -4
  78. package/dist/Setting.vue_vue_type_script_setup_true_lang-Cx06MCJs.js +0 -247
  79. package/dist/Takeaway-BXZXCAaM.js +0 -61
  80. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-9WVkdLZF.js +0 -316
  81. package/dist/TaxSetting-DdHx7ACN.js +0 -21
  82. package/dist/Unit-biPvleyL.js +0 -161
  83. package/dist/Variant-BP1IRNQx.js +0 -231
  84. package/dist/_id_-BiaNDI2N.js +0 -188
  85. package/dist/category-KiA5-36F.js +0 -154
  86. package/dist/index-BFeZlU8X.js +0 -232
  87. package/dist/item-Bcg7SiYv.js +0 -6325
  88. package/dist/scheduler-D1tgE0_9.js +0 -480
  89. package/dist/takeaway-BKsoD4EL.js +0 -264
  90. package/dist/unit-CswFvAyc.js +0 -346
@@ -1,8 +1,12 @@
1
- import { u as h, b as n, h as u, B as _ } from "./app-D7e31gIv.js";
1
+ var _ = Object.defineProperty;
2
+ var p = (l, t, e) => t in l ? _(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
+ var g = (l, t, e) => p(l, typeof t != "symbol" ? t + "" : t, e);
4
+ import { n as f, u as v, b as s, h as c, C as E } from "./app-t9ONnc0s.js";
2
5
  import "@feedmepos/ui-library";
3
- class c {
4
- constructor(t, e, a, r) {
5
- this.catalog = t, this.menuStore = e, this.updateMenu = a, this.dialog = r;
6
+ class d {
7
+ constructor(t, e, a, o) {
8
+ g(this, "t", f().t);
9
+ this.catalog = t, this.menuStore = e, this.updateMenu = a, this.dialog = o;
6
10
  }
7
11
  // private promptCatalogDialog(
8
12
  // catalog: FdoMenuV4Catalog | undefined,
@@ -25,19 +29,19 @@ class c {
25
29
  static getItemAvailable(t) {
26
30
  return Object.entries(t.override.items).filter(([, e]) => {
27
31
  const a = e.find(
28
- (o) => !o.combinationKey
29
- ), r = h().version === n.F_MENU_VERSION.enum.v4;
30
- return (a == null ? void 0 : a.orderFrom) !== n.F_ORDER_FROM.enum.NONE && (r || (a == null ? void 0 : a.category) !== "");
32
+ (i) => !i.combinationKey
33
+ ), o = v().version === s.F_MENU_VERSION.enum.v4;
34
+ return (a == null ? void 0 : a.orderFrom) !== s.F_ORDER_FROM.enum.NONE && (o || (a == null ? void 0 : a.category) !== "");
31
35
  }).map(([e]) => e);
32
36
  }
33
37
  static getSellingItem(t, e) {
34
38
  const a = new Map(
35
- e.modules.item.map((r) => [r._id, r])
39
+ e.modules.item.map((o) => [o._id, o])
36
40
  );
37
- return c.getItemAvailable(t).filter(
38
- (r) => {
39
- var o;
40
- return !!((o = a.get(r)) != null && o.category);
41
+ return d.getItemAvailable(t).filter(
42
+ (o) => {
43
+ var i;
44
+ return !!((i = a.get(o)) != null && i.category);
41
45
  }
42
46
  );
43
47
  }
@@ -58,8 +62,8 @@ class c {
58
62
  async update() {
59
63
  this.catalog && await this.updateMenu(
60
64
  {
61
- module: n.F_MENU_MODULE_V4_KEY.enum.catalog,
62
- operation: u.F_OPERATION_TYPE.update,
65
+ module: s.F_MENU_MODULE_V4_KEY.enum.catalog,
66
+ operation: c.F_OPERATION_TYPE.update,
63
67
  data: this.catalog
64
68
  },
65
69
  this.catalog.name
@@ -68,13 +72,13 @@ class c {
68
72
  delete() {
69
73
  const t = this.catalog;
70
74
  t && this.dialog.open({
71
- title: "Remove catalog",
72
- message: `Are you sure to remove ${t.name}?`
75
+ title: this.t("menu.common.dialog.remove.catalog.title"),
76
+ message: this.t("menu.common.dialog.remove.catalog.message", { name: t.name })
73
77
  }).onPrimary(async () => {
74
78
  await this.updateMenu(
75
79
  {
76
- module: n.F_MENU_MODULE_V4_KEY.enum.catalog,
77
- operation: u.F_OPERATION_TYPE.delete,
80
+ module: s.F_MENU_MODULE_V4_KEY.enum.catalog,
81
+ operation: c.F_OPERATION_TYPE.delete,
78
82
  data: t._id
79
83
  },
80
84
  t.name,
@@ -87,8 +91,8 @@ class c {
87
91
  return this.catalog ? ((e = this.catalog) == null ? void 0 : e.override.groups[t]) ?? { _id: t, groupKey: "" } : null;
88
92
  }
89
93
  getCatalogSchedulerGroup(t, e) {
90
- var a, r, o;
91
- return this.catalog ? ((o = (r = (a = this.catalog) == null ? void 0 : a.override.scheduler[e]) == null ? void 0 : r.groups) == null ? void 0 : o.find((i) => i._id === t)) ?? {
94
+ var a, o, i;
95
+ return this.catalog ? ((i = (o = (a = this.catalog) == null ? void 0 : a.override.scheduler[e]) == null ? void 0 : o.groups) == null ? void 0 : i.find((r) => r._id === t)) ?? {
92
96
  _id: t,
93
97
  groupKey: ""
94
98
  } : null;
@@ -97,10 +101,10 @@ class c {
97
101
  if (!this.catalog) return null;
98
102
  const e = {
99
103
  ...this.catalog.override.groups,
100
- ...t.reduce((a, r) => (a[r._id] = {
101
- _id: r._id,
104
+ ...t.reduce((a, o) => (a[o._id] = {
105
+ _id: o._id,
102
106
  groupKey: "",
103
- items: r.items
107
+ items: o.items
104
108
  }, a), {})
105
109
  };
106
110
  this.catalog = {
@@ -109,14 +113,14 @@ class c {
109
113
  };
110
114
  }
111
115
  overrideCatalogSchedulerGroups(t, e) {
112
- var i;
116
+ var r;
113
117
  if (!this.catalog) return null;
114
- const a = ((i = this.catalog.override.scheduler[e]) == null ? void 0 : i.groups) ?? [], r = t.map((l) => l._id), o = [
115
- ...a.filter((l) => !r.includes(l._id)),
116
- ...t.map((l) => ({
117
- _id: l._id,
118
+ const a = ((r = this.catalog.override.scheduler[e]) == null ? void 0 : r.groups) ?? [], o = t.map((n) => n._id), i = [
119
+ ...a.filter((n) => !o.includes(n._id)),
120
+ ...t.map((n) => ({
121
+ _id: n._id,
118
122
  groupKey: "",
119
- items: l.items
123
+ items: n.items
120
124
  }))
121
125
  ];
122
126
  this.catalog = {
@@ -128,7 +132,7 @@ class c {
128
132
  [e]: {
129
133
  ...this.catalog.override.scheduler[e],
130
134
  _id: e,
131
- groups: o
135
+ groups: i
132
136
  }
133
137
  }
134
138
  }
@@ -154,25 +158,25 @@ class c {
154
158
  if (!this.catalog) return null;
155
159
  const a = this.getCatalogScheduler(e);
156
160
  if (!a) return;
157
- const r = t.reduce((i, l) => {
158
- var d;
159
- const m = ((d = a.items) == null ? void 0 : d.filter((s) => s._id == l)) ?? [];
160
- return i = i.concat(
161
- _(l, m, (s) => ({
162
- ...s,
161
+ const o = t.reduce((r, n) => {
162
+ var m;
163
+ const h = ((m = a.items) == null ? void 0 : m.filter((u) => u._id == n)) ?? [];
164
+ return r = r.concat(
165
+ E(n, h, (u) => ({
166
+ ...u,
163
167
  orderFrom: null
164
168
  }))
165
- ), i;
166
- }, []), o = {
169
+ ), r;
170
+ }, []), i = {
167
171
  ...a,
168
- items: r
172
+ items: o
169
173
  };
170
- this.overrideCatalogScheduler(o);
174
+ this.overrideCatalogScheduler(i);
171
175
  }
172
176
  injectCatalogToMenu() {
173
177
  const t = this.catalog;
174
178
  if (!t) return null;
175
- const e = this.menuStore.state.menu, a = e.modules.catalog.map((r) => r._id === t._id ? t : r);
179
+ const e = this.menuStore.state.menu, a = e.modules.catalog.map((o) => o._id === t._id ? t : o);
176
180
  return {
177
181
  ...e,
178
182
  modules: {
@@ -183,14 +187,14 @@ class c {
183
187
  }
184
188
  async unlinkProduct(t) {
185
189
  this.catalog && (this.updateItemAvailable(
186
- c.getItemAvailable(this.catalog).filter((e) => !t.includes(e))
190
+ d.getItemAvailable(this.catalog).filter((e) => !t.includes(e))
187
191
  ), await this.update());
188
192
  }
189
193
  async create(t) {
190
194
  await this.updateMenu(
191
195
  {
192
- module: n.F_MENU_MODULE_V4_KEY.enum.catalog,
193
- operation: u.F_OPERATION_TYPE.create,
196
+ module: s.F_MENU_MODULE_V4_KEY.enum.catalog,
197
+ operation: c.F_OPERATION_TYPE.create,
194
198
  data: t
195
199
  },
196
200
  t.name
@@ -201,34 +205,34 @@ class c {
201
205
  updateItemAvailable(t) {
202
206
  const e = this.catalog;
203
207
  if (!e) return null;
204
- const r = this.menuStore.state.menu.modules.item.map((o) => o._id).reduce((o, i) => {
205
- const l = e.override.items[i];
206
- return o[i] = p(
207
- i,
208
- l,
209
- t.includes(i),
210
- this.menuStore.version === n.F_MENU_VERSION.enum.v3
211
- ), o;
208
+ const o = this.menuStore.state.menu.modules.item.map((i) => i._id).reduce((i, r) => {
209
+ const n = e.override.items[r];
210
+ return i[r] = O(
211
+ r,
212
+ n,
213
+ t.includes(r),
214
+ this.menuStore.version === s.F_MENU_VERSION.enum.v3
215
+ ), i;
212
216
  }, {});
213
217
  this.catalog = {
214
218
  ...e,
215
- override: { ...e.override, items: r }
219
+ override: { ...e.override, items: o }
216
220
  };
217
221
  }
218
222
  }
219
- function p(g, t, e, a) {
220
- const r = t == null ? void 0 : t.find((l) => !l.combinationKey), o = e ? null : n.F_ORDER_FROM.enum.NONE, i = a ? e ? null : "" : r == null ? void 0 : r.category;
223
+ function O(l, t, e, a) {
224
+ const o = t == null ? void 0 : t.find((n) => !n.combinationKey), i = e ? null : s.F_ORDER_FROM.enum.NONE, r = a ? e ? null : "" : o == null ? void 0 : o.category;
221
225
  return [
222
226
  {
223
- ...r ?? {},
224
- orderFrom: o,
225
- category: i,
226
- _id: g
227
+ ...o ?? {},
228
+ orderFrom: i,
229
+ category: r,
230
+ _id: l
227
231
  },
228
- ...(t == null ? void 0 : t.filter((l) => !!l.combinationKey)) ?? []
232
+ ...(t == null ? void 0 : t.filter((n) => !!n.combinationKey)) ?? []
229
233
  ];
230
234
  }
231
235
  export {
232
- c as C,
233
- p as h
236
+ d as C,
237
+ O as h
234
238
  };
@@ -0,0 +1,155 @@
1
+ import { n as f, b as l, h as u, u as M } from "./app-t9ONnc0s.js";
2
+ import { useDialogChild as C } from "@feedmepos/ui-library";
3
+ import { defineComponent as V, watch as g, ref as E, resolveComponent as _, openBlock as A, createBlock as F, unref as s, withCtx as O, createVNode as P } from "vue";
4
+ import "@feedmepos/mf-common";
5
+ const y = /* @__PURE__ */ V({
6
+ __name: "AddCategoryDialogContentComponent",
7
+ props: {
8
+ initialValue: {}
9
+ },
10
+ setup(n) {
11
+ const r = n, { t } = f();
12
+ g(
13
+ () => r.initialValue,
14
+ (c) => {
15
+ i.value = c ?? "";
16
+ }
17
+ );
18
+ const i = E(r.initialValue), { emitData: d, emitAction: p } = C();
19
+ return g(
20
+ i,
21
+ (c) => {
22
+ d(c);
23
+ },
24
+ {
25
+ immediate: !0
26
+ }
27
+ ), (c, e) => {
28
+ const o = _("fm-text-field"), a = _("FmForm");
29
+ return A(), F(a, {
30
+ onValidationSuccess: e[1] || (e[1] = (m) => s(p)("primary"))
31
+ }, {
32
+ default: O(() => [
33
+ P(o, {
34
+ modelValue: i.value,
35
+ "onUpdate:modelValue": e[0] || (e[0] = (m) => i.value = m),
36
+ rules: [(m) => !!m || s(t)("menu.category.dialog.add.name.required")],
37
+ autofocus: "",
38
+ label: s(t)("menu.category.dialog.add.name.label"),
39
+ placeholder: s(t)("menu.category.dialog.add.name.placeholder")
40
+ }, null, 8, ["modelValue", "rules", "label", "placeholder"])
41
+ ]),
42
+ _: 1
43
+ });
44
+ };
45
+ }
46
+ }), x = ({
47
+ dialog: n,
48
+ menuLoader: r
49
+ }) => {
50
+ const { t } = f();
51
+ function i() {
52
+ const { updateMenu: e } = r, o = E(!1);
53
+ n.open({
54
+ title: t("menu.category.manager.dialog.add.title"),
55
+ contentComponent: y,
56
+ primaryActions: {
57
+ text: t("menu.category.manager.dialog.add.action"),
58
+ close: !1,
59
+ isLoading: o
60
+ },
61
+ secondaryActions: {
62
+ text: t("menu.common.actions.cancel"),
63
+ close: !0
64
+ }
65
+ }).onPrimary(async (a) => {
66
+ if (a)
67
+ try {
68
+ o.value = !0, await e(
69
+ {
70
+ module: l.F_MENU_MODULE_V4_KEY.enum.category,
71
+ operation: u.F_OPERATION_TYPE.create,
72
+ data: {
73
+ name: a,
74
+ position: M().categories.length
75
+ }
76
+ },
77
+ a
78
+ ), n.close();
79
+ } finally {
80
+ o.value = !1;
81
+ }
82
+ });
83
+ }
84
+ function d(e) {
85
+ const { updateMenu: o } = r;
86
+ n.open({
87
+ title: t("menu.category.manager.dialog.update.title"),
88
+ contentComponent: y,
89
+ contentComponentProps: {
90
+ initialValue: e.name
91
+ },
92
+ primaryActions: {
93
+ text: t("menu.category.manager.dialog.update.action"),
94
+ close: !1
95
+ },
96
+ secondaryActions: {
97
+ text: t("menu.common.actions.cancel"),
98
+ close: !0
99
+ }
100
+ }).onPrimary(async (a) => {
101
+ a && (await o(
102
+ {
103
+ module: l.F_MENU_MODULE_V4_KEY.enum.category,
104
+ operation: u.F_OPERATION_TYPE.update,
105
+ data: { ...e, name: a ?? e.name }
106
+ },
107
+ a
108
+ ), n.close());
109
+ });
110
+ }
111
+ function p(e) {
112
+ const { updateMenu: o } = r;
113
+ n.open({
114
+ title: t("menu.common.dialog.remove.category.title"),
115
+ message: t("menu.common.dialog.remove.category.message", { name: e.name }),
116
+ primaryActions: {
117
+ text: t("menu.common.actions.remove"),
118
+ close: !1
119
+ },
120
+ secondaryActions: {
121
+ text: t("menu.common.actions.cancel"),
122
+ close: !0
123
+ }
124
+ }).onPrimary(async () => {
125
+ await o(
126
+ {
127
+ module: l.F_MENU_MODULE_V4_KEY.enum.category,
128
+ operation: u.F_OPERATION_TYPE.delete,
129
+ data: e._id
130
+ },
131
+ e.name,
132
+ !0
133
+ ), n.close();
134
+ });
135
+ }
136
+ async function c(e) {
137
+ await r.updateMenu(
138
+ {
139
+ module: l.F_MENU_MODULE_V4_KEY.enum.category,
140
+ operation: u.F_OPERATION_TYPE.rearrange,
141
+ data: e
142
+ },
143
+ "Categories"
144
+ );
145
+ }
146
+ return {
147
+ create: i,
148
+ update: d,
149
+ deleteCategory: p,
150
+ rearrange: c
151
+ };
152
+ }, Y = x;
153
+ export {
154
+ Y as u
155
+ };
@@ -1,4 +1,4 @@
1
- import { c as e } from "./app-D7e31gIv.js";
1
+ import { c as e } from "./app-t9ONnc0s.js";
2
2
  function n(r, o = !0) {
3
3
  return e.Dinero.fromFdoDinero(r).toFormat(o).replaceAll(" ", "");
4
4
  }