@feedmepos/mf-menu 0.32.13 → 0.32.15

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 (73) hide show
  1. package/dist/{App-D70-FH5L.js → App-BFUyUrdi.js} +16 -9
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BJdja2N0.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BbjRIN7Z.js} +20 -20
  3. package/dist/{Catalog-WMpN3a0p.js → Catalog-B6VFmr6e.js} +20 -20
  4. package/dist/{Category-C_VsQIHU.js → Category-B-bTjNFI.js} +24 -24
  5. package/dist/{Category-BwHhFTZ-.js → Category-C8uGxpST.js} +84 -84
  6. package/dist/{CookingGuide-D9RNkYDL.js → CookingGuide-BL3uetlO.js} +65 -65
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DtmrxDZm.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-8yIVwc8E.js} +1 -1
  8. package/dist/{Group-DexONgr2.js → Group-BvO-gQZe.js} +1 -1
  9. package/dist/{Group-qRZlg5ST.js → Group-DT9UkkOx.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-DtPY9uUt.js → Group.vue_vue_type_script_setup_true_lang-DZhM1Tpb.js} +56 -56
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5Qpmj2f.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D48u_DHq.js} +5 -5
  12. package/dist/ImportProductDialog.vue_vue_type_script_setup_true_lang-C_X-lTnN.js +72979 -0
  13. package/dist/{Ingredient-BuOS_Wvm.js → Ingredient-7qWDD9e6.js} +26 -26
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DFvXklj9.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CwjW0wfz.js} +2 -2
  15. package/dist/{LinkProductSideSheet-DJj8Nn4X.js → LinkProductSideSheet-BXW6eNgZ.js} +3 -3
  16. package/dist/{MenuSetting-D6B0gCGV.js → MenuSetting-BSF7O2NL.js} +5 -5
  17. package/dist/{PrintRoute-B7G8f1iC.js → PrintRoute-b1ii5Uz9.js} +20 -20
  18. package/dist/{Product-DpS5EepJ.js → Product-Ce0GJb3c.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-CdIukLqA.js → Product.vue_vue_type_script_setup_true_lang-BZVvTAOX.js} +49 -49
  20. package/dist/{ProductInternalTools-CBCyWHOS.js → ProductInternalTools-igbOLRap.js} +20 -20
  21. package/dist/Products-GAyUdhnN.js +292 -0
  22. package/dist/Publish-g60odzhM.js +1300 -0
  23. package/dist/{Recipe-D14rkATU.js → Recipe-B6aye_iC.js} +9 -9
  24. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CdH2ius3.js → RuleView.vue_vue_type_script_setup_true_lang-By8kwuMB.js} +134 -134
  25. package/dist/{Scheduler-DWZqa-jf.js → Scheduler-CyaG6Y5v.js} +7 -7
  26. package/dist/{ServingSequence-Mx7ovvJ1.js → ServingSequence-BXeypgrN.js} +27 -27
  27. package/dist/{Setting-DmHuVXVn.js → Setting-D7GcaNTk.js} +17 -17
  28. package/dist/{Subcategory-DixZPdnT.js → Subcategory-DNUp9ojI.js} +37 -37
  29. package/dist/{Takeaway-BVIymFV_.js → Takeaway-Baqvq5nP.js} +9 -9
  30. package/dist/{Takeaway-DDKeDEbV.js → Takeaway-BjXPeYRv.js} +1 -1
  31. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CTaCQgRv.js → Takeaway.vue_vue_type_script_setup_true_lang-CgXT2UVL.js} +54 -54
  32. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DveI9xvU.js → Thumbnail.vue_vue_type_script_setup_true_lang-CX8cSbDe.js} +12 -12
  33. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-2nBbq_Yk.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DcjGVQEO.js} +756 -763
  34. package/dist/{Unit-utuaNZBw.js → Unit-mI7lLzCf.js} +2 -2
  35. package/dist/{Variant-CzuJNwen.js → Variant-CVwnODRz.js} +14 -14
  36. package/dist/{_id_-DMDhPQCr.js → _id_-fpn0nBru.js} +14 -14
  37. package/dist/{app-BQUkvrAS.js → app-CCKI85Te.js} +26 -26
  38. package/dist/{app-Bqj3cAPJ.js → app-U5MEN4U1.js} +1 -1
  39. package/dist/app.js +1 -1
  40. package/dist/apps/mf-menu/src/Entry.vue.d.ts +1 -0
  41. package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +0 -2
  42. package/dist/apps/mf-menu/src/composable/useClientEvent.d.ts +14 -0
  43. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +22 -22
  44. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +59 -33
  45. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  46. package/dist/assets/{linked-status-ILQVL8r9.js → linked-status-6Jt70XBp.js} +2 -2
  47. package/dist/assets/menu-export-CR0a98CA.js +107 -0
  48. package/dist/assets/{override-menu-DVkGhbA9.js → override-menu-Chsc0CSI.js} +2 -2
  49. package/dist/assets/{validate-menu-y_NQUL02.js → validate-menu-pb0aN4gj.js} +2 -2
  50. package/dist/{catalog-BYzITAmC.js → catalog-BgQmytEA.js} +1 -1
  51. package/dist/{catalogSetting-DAo5tN3P.js → catalogSetting-BS5IaQKq.js} +1 -1
  52. package/dist/{category-D4x8r_lY.js → category-DJMVbmzx.js} +1 -1
  53. package/dist/{currency-CvoBdMM2.js → currency-FHrLDvzy.js} +1 -1
  54. package/dist/dayjs.min-DJGdQr-B.js +6 -0
  55. package/dist/{index-LuH6PJzW.js → index-BywPDIFW.js} +4 -4
  56. package/dist/{index-BLUIaanj.js → index-DYxLHjeC.js} +1 -1
  57. package/dist/{index-6lju0f3r.js → index-XVWDnyu-.js} +17 -17
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-DxF14kn9.js → index.vue_vue_type_script_setup_true_lang-kj6HkxwD.js} +2306 -2306
  59. package/dist/{item-lXMLaKOb.js → item-cmnP2N-a.js} +1089 -1091
  60. package/dist/{jszip.min-CdZ-wY5m.js → jszip.min-psVCZNVl.js} +545 -545
  61. package/dist/{menu-PJc2dQHQ.js → menu-CgQPOu3W.js} +1 -1
  62. package/dist/{menuV2-DinFmdTL.js → menuV2-DHO9OmzU.js} +159 -159
  63. package/dist/mf-menu.css +1 -1
  64. package/dist/{priceTier-CzKIo11g.js → priceTier-CLm9vzaK.js} +1 -1
  65. package/dist/{scheduler-DQjxnoCk.js → scheduler-BMdZdtpj.js} +4 -4
  66. package/dist/{subcategory-CLkDImEU.js → subcategory-Dj_DOvFt.js} +2 -2
  67. package/dist/{toExcel-DPh8DaM0.js → toExcel-XwFFiTiA.js} +2 -2
  68. package/dist/{unit-QYkVoC6_.js → unit-CsuAQsy7.js} +12 -12
  69. package/package.json +3 -3
  70. package/dist/ImportProductDialog.vue_vue_type_script_setup_true_lang-BqhNkaw_.js +0 -96043
  71. package/dist/Products-CcyGNlUl.js +0 -794
  72. package/dist/Publish-rZLHFaJ5.js +0 -1264
  73. package/dist/dayjs.min-C6xioui7.js +0 -6
@@ -0,0 +1,292 @@
1
+ import { defineComponent as E, computed as g, ref as j, resolveComponent as C, createBlock as y, openBlock as m, unref as e, withCtx as c, createElementVNode as l, toDisplayString as q, createVNode as o, createCommentVNode as G, createElementBlock as A, Fragment as P } from "vue";
2
+ import { D as F } from "./dayjs.min-DJGdQr-B.js";
3
+ import { J as oe, F as ne } from "./jszip.min-psVCZNVl.js";
4
+ import { u as J, G as W, B as R, H, A as Z, D as ae, I as re, J as U, K as se } from "./index.vue_vue_type_script_setup_true_lang-kj6HkxwD.js";
5
+ import { w as ie } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-C_X-lTnN.js";
6
+ import { useCoreStore as K, useI18n as le } from "@feedmepos/mf-common";
7
+ import { useDialog as Q, useDialogChild as ue, useSnackbar as X, useBreakpoints as ce, FmButtonVariant as $, FmButtonColorThemeVariant as S } 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 z } 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-CgQPOu3W.js";
12
+ import { u as _e } from "./item-cmnP2N-a.js";
13
+ import { _ as L, a as ve } from "./Product.vue_vue_type_script_setup_true_lang-BZVvTAOX.js";
14
+ import { L as O } from "./LinkProductSideSheet-BXW6eNgZ.js";
15
+ import { _ as ge } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DcjGVQEO.js";
16
+ import { u as be } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CX8cSbDe.js";
17
+ import { m as ye } from "./toExcel-XwFFiTiA.js";
18
+ const ke = { class: "space-y-24 mb-24" }, xe = ["innerHTML"], he = { class: "flex justify-end gap-8" }, Se = /* @__PURE__ */ E({
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(w) {
26
+ const t = w, M = g(() => t.message.replace("[[value]]", t.value)), k = j(""), a = Q(), { emitAction: x } = ue();
27
+ return (d, r) => {
28
+ const p = C("FmTextField"), f = C("FmButton"), _ = C("FmForm");
29
+ return m(), y(_, {
30
+ "on-validation-success": () => e(x)("primary"),
31
+ "blame-form-child-on-validation-failed": ""
32
+ }, {
33
+ default: c(() => [
34
+ l("div", ke, [
35
+ l("div", null, q(d.description), 1),
36
+ l("div", { innerHTML: M.value }, null, 8, xe),
37
+ l("div", null, [
38
+ o(p, {
39
+ modelValue: k.value,
40
+ "onUpdate:modelValue": [
41
+ r[0] || (r[0] = (u) => k.value = u),
42
+ r[1] || (r[1] = () => {
43
+ })
44
+ ],
45
+ placeholder: d.value,
46
+ rules: [(u) => u === d.value || "Value does not match"]
47
+ }, null, 8, ["modelValue", "placeholder", "rules"])
48
+ ]),
49
+ l("div", he, [
50
+ o(f, {
51
+ label: "Cancel",
52
+ variant: "secondary",
53
+ onClick: r[2] || (r[2] = (u) => e(a).close())
54
+ }),
55
+ o(f, {
56
+ label: "Confirm",
57
+ type: "submit"
58
+ })
59
+ ])
60
+ ])
61
+ ]),
62
+ _: 1
63
+ }, 8, ["on-validation-success"]);
64
+ };
65
+ }
66
+ }), Me = /* @__PURE__ */ E({
67
+ __name: "Migrate",
68
+ setup(w) {
69
+ const t = J(), M = K(), k = X(), { minor: a } = W(k), x = j(!1), d = Q();
70
+ async function r() {
71
+ p.value || x.value || d.open({
72
+ title: "Migrate to new version",
73
+ contentComponent: Se,
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
+ d.close(), await a(
80
+ async () => {
81
+ await t.migrate(), setTimeout(() => {
82
+ window.location.reload();
83
+ }, 2e3);
84
+ },
85
+ {
86
+ isLoading: x,
87
+ customId: t.state.menu._id,
88
+ message: "Migrating menu",
89
+ successMessage: "Migration completed"
90
+ }
91
+ );
92
+ });
93
+ }
94
+ const p = g(() => {
95
+ const f = M.restaurants.value;
96
+ if (!f.length) return "Required at least one restaurant to migrate";
97
+ const _ = f.filter((b) => !b.posVersion || !R.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: b.posVersion }));
98
+ return _.length ? `Upgrade POS to V${R.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${_.map((b) => b.profile.name).join(", ")}` : null;
99
+ });
100
+ return g(() => p.value ? p.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (f, _) => {
101
+ const u = C("FmSnackbar");
102
+ return !p.value && e(t).version !== e(Z.F_MENU_VERSION).enum.v4 ? (m(), y(u, {
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: r
111
+ })) : G("", !0);
112
+ };
113
+ }
114
+ }), Ce = "/assets/menu-export-CR0a98CA.js", we = { class: "flex-1 flex justify-between gap-8 pl-8" }, Fe = { class: "flex items-center" }, $e = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ve = { class: "fm-typo-en-body-md-600 font-semibold" }, Ee = { class: "flex gap-8" }, Je = /* @__PURE__ */ E({
115
+ __name: "Products",
116
+ setup(w) {
117
+ const { t } = le(), M = K(), k = W(X()), a = J(), x = g(() => a.rules.item), d = _e(), r = g(() => !a.state.currentSchedulerId), { selectedCategories: p } = pe(), f = g(() => ({
118
+ ...ae.menuV4ToV3(re(a.state.menu)),
119
+ _id: a.state.menu._id,
120
+ _rev: a.state.menu._rev
121
+ })), _ = g(() => {
122
+ const v = U.flatten(p.value.map((s) => s.items));
123
+ return U.uniqBy(v, (s) => s._id).length;
124
+ });
125
+ async function u(v, s) {
126
+ const i = new oe();
127
+ for (let h = 0; h < v.length; h++)
128
+ i.file(`${s[h]}.xlsx`, v[h]);
129
+ const n = await i.generateAsync({ type: "blob" });
130
+ ne.saveAs(n, `books_${F().format("DD-MM-YYYY_HH-mm")}.zip`);
131
+ }
132
+ async function b() {
133
+ await k.minor(
134
+ async () => {
135
+ var v;
136
+ if (await a.readMenu(), a.version === Z.F_MENU_VERSION.enum.v4) {
137
+ const s = a.state.menu, i = F().format("DD-MM-YYYY_HH-mm"), n = [
138
+ `menu_${i}`,
139
+ `addonGroup_${i}`,
140
+ `itemLinkedAddon_${i}`
141
+ ], h = await se(
142
+ Ce,
143
+ JSON.stringify({
144
+ menu: s,
145
+ attributeSettings: ((v = M.currentBusiness.value) == null ? void 0 : v.attributeSettings) ?? []
146
+ })
147
+ );
148
+ await u(h, n);
149
+ } else {
150
+ const s = ye(f.value), i = `menu_${F().format("DD-MM-YYYY_HH-mm")}`;
151
+ await ie(s, `${i}.xlsx`, {
152
+ bookType: "xlsx",
153
+ bookSST: !0,
154
+ type: "array",
155
+ compression: !0
156
+ });
157
+ }
158
+ },
159
+ { successMessage: "Menu exported", customId: a.state.menu._id }
160
+ );
161
+ }
162
+ const {
163
+ menuItems: T,
164
+ categories: I,
165
+ linkItemRules: D,
166
+ handleSubmit: N,
167
+ catalogManager: B,
168
+ schedulerManager: Y
169
+ } = be(!1), ee = ce(), te = g(() => ee.breakpoints.value.xs);
170
+ return fe().resetOnMount(), (v, s) => {
171
+ const i = C("fm-button");
172
+ return m(), y(de, {
173
+ heading: e(t)("menu.products.title")
174
+ }, {
175
+ default: c(() => [
176
+ o(Me),
177
+ o(ve)
178
+ ]),
179
+ "append-heading": c(() => [
180
+ l("div", we, [
181
+ l("div", Fe, [
182
+ l("div", $e, [
183
+ l("p", Ve, q(_.value), 1)
184
+ ])
185
+ ]),
186
+ l("div", Ee, [
187
+ te.value ? (m(), y(L, { key: 1 }, {
188
+ default: c(({ trigger: n }) => [
189
+ o(me, null, {
190
+ default: c(() => [
191
+ o(z, {
192
+ label: e(t)("menu.products.actions.export"),
193
+ onClick: b
194
+ }, null, 8, ["label"]),
195
+ o(z, {
196
+ label: e(t)("menu.products.actions.import"),
197
+ onClick: n
198
+ }, null, 8, ["label", "onClick"])
199
+ ]),
200
+ _: 2
201
+ }, 1024)
202
+ ]),
203
+ _: 1
204
+ })) : (m(), A(P, { key: 0 }, [
205
+ o(ge, null, {
206
+ default: c(({ trigger: n }) => [
207
+ o(i, {
208
+ label: e(t)("menu.tree_editor.title"),
209
+ "bg-color": e(S).NeutralGray100,
210
+ "text-color": e(S).TypoSecondary,
211
+ variant: e($).Primary,
212
+ onClick: n
213
+ }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
214
+ ]),
215
+ _: 1
216
+ }),
217
+ o(i, {
218
+ "bg-color": e(S).NeutralGray100,
219
+ "text-color": e(S).TypoSecondary,
220
+ variant: e($).Primary,
221
+ label: e(t)("menu.products.actions.export"),
222
+ onClick: b
223
+ }, null, 8, ["bg-color", "text-color", "variant", "label"]),
224
+ o(L, null, {
225
+ default: c(({ trigger: n }) => [
226
+ o(i, {
227
+ "bg-color": e(S).NeutralGray100,
228
+ "text-color": e(S).TypoSecondary,
229
+ variant: e($).Primary,
230
+ label: e(t)("menu.products.actions.import"),
231
+ onClick: n
232
+ }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
233
+ ]),
234
+ _: 1
235
+ })
236
+ ], 64)),
237
+ _.value > 0 ? (m(), A(P, { key: 2 }, [
238
+ x.value.create ? (m(), y(V, {
239
+ key: 0,
240
+ label: e(t)("menu.products.actions.add"),
241
+ "prepend-icon": "add",
242
+ onClick: s[0] || (s[0] = (n) => e(d).create(null))
243
+ }, null, 8, ["label"])) : r.value ? (m(), y(O, {
244
+ key: 1,
245
+ "categorized-items": e(B).linkableItems.value,
246
+ "initial-value": e(B).currentItems.value,
247
+ "show-variant": !1,
248
+ "menu-items": e(T),
249
+ categories: e(I),
250
+ "link-item-rules": e(D),
251
+ "no-scheduler": r.value,
252
+ onSubmit: e(N)
253
+ }, {
254
+ default: c(({ trigger: n }) => [
255
+ o(V, {
256
+ label: e(t)("menu.products.actions.link"),
257
+ "prepend-icon": "link",
258
+ onClick: n
259
+ }, null, 8, ["label", "onClick"])
260
+ ]),
261
+ _: 1
262
+ }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (m(), y(O, {
263
+ key: 2,
264
+ "categorized-items": e(Y).linkableItems.value,
265
+ "initial-value": e(Y).currentItems.value,
266
+ "show-variant": !1,
267
+ "menu-items": e(T),
268
+ categories: e(I),
269
+ "link-item-rules": e(D),
270
+ "no-scheduler": r.value,
271
+ onSubmit: e(N)
272
+ }, {
273
+ default: c(({ trigger: n }) => [
274
+ o(V, {
275
+ label: e(t)("menu.products.actions.apply_scheduler"),
276
+ onClick: n
277
+ }, null, 8, ["label", "onClick"])
278
+ ]),
279
+ _: 1
280
+ }, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"]))
281
+ ], 64)) : G("", !0)
282
+ ])
283
+ ])
284
+ ]),
285
+ _: 1
286
+ }, 8, ["heading"]);
287
+ };
288
+ }
289
+ });
290
+ export {
291
+ Je as default
292
+ };