@feedmepos/mf-menu 0.31.44 → 0.31.45-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 (64) hide show
  1. package/dist/{App-Bx2oHz_2.js → App-Dk_k4HVK.js} +9 -9
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-DC53jOxl.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DSrvQozf.js} +3 -3
  3. package/dist/{Catalog-orxlAEbo.js → Catalog-DoeX2gZt.js} +6 -6
  4. package/dist/{Category-DN6-D26x.js → Category-Bdj8nyJX.js} +4 -4
  5. package/dist/{Category-EC-9REG9.js → Category-DYtmrs0d.js} +6 -6
  6. package/dist/{CookingGuide-CeFTfwDB.js → CookingGuide-BoH8324W.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cpmh3G5W.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-C8L7yQhT.js} +1 -1
  8. package/dist/{Group-cg8h5KLx.js → Group-oBgB4Rip.js} +1 -1
  9. package/dist/{Group-B0TQdnHG.js → Group-rSlBX4PW.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-DwkvSn8N.js → Group.vue_vue_type_script_setup_true_lang-BbqYVzXV.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Bt5rER7h.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Bp25dogQ.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-c4FmNdn4.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DfNllbYR.js} +7 -7
  13. package/dist/{Ingredient-B_1B5u9o.js → Ingredient-B0QEmsUg.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CvrPVG7Q.js → InventoryBinding.vue_vue_type_script_setup_true_lang-C3v4DUZE.js} +1052 -1052
  15. package/dist/{LinkProductSideSheet-DZJY3u1w.js → LinkProductSideSheet-DtDRjTMM.js} +3 -3
  16. package/dist/{MenuSetting-Bguf-YJI.js → MenuSetting-D6ZFB-Qf.js} +5 -5
  17. package/dist/{PrintRoute-CkEOWCgg.js → PrintRoute-Dvy6YKcl.js} +4 -4
  18. package/dist/{Product-DQyZCauS.js → Product-Cxc7kiAq.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-DOsLhx9w.js → Product.vue_vue_type_script_setup_true_lang-Dw5K4Jij.js} +13 -13
  20. package/dist/{ProductInternalTools-BI7b-zg-.js → ProductInternalTools-hKp2e1fc.js} +6 -6
  21. package/dist/{Products-D6u_d8Ey.js → Products-DjDJR2jH.js} +11 -11
  22. package/dist/{Publish-CBbyfrHe.js → Publish-DCD7a33W.js} +3 -3
  23. package/dist/{Recipe-C9QEKfjo.js → Recipe-Dr0P6NlR.js} +4 -4
  24. package/dist/{Scheduler-C6OiFU1O.js → Scheduler-Cw-Ddftq.js} +3 -3
  25. package/dist/{ServingSequence-CdHMuMCB.js → ServingSequence-CTcsTU8R.js} +3 -3
  26. package/dist/{Setting-CkNI0nqs.js → Setting-BSh-A_8a.js} +5 -5
  27. package/dist/{Subcategory-C7RViT1r.js → Subcategory-BXJriD4G.js} +4 -4
  28. package/dist/{Takeaway-D4B2y4nE.js → Takeaway-BJo2d3vL.js} +4 -4
  29. package/dist/{Takeaway-COo_m0x1.js → Takeaway-DKWUpJDp.js} +1 -1
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-C9umCqte.js → Takeaway.vue_vue_type_script_setup_true_lang-B6kGoFDg.js} +5 -5
  31. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CPqU17LK.js +411 -0
  32. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CL80TqrT.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BdIozq8u.js} +18 -18
  33. package/dist/{Unit-5FYoPgac.js → Unit-DZ_r81gD.js} +2 -2
  34. package/dist/{Variant-CSDZm3n7.js → Variant-C5V9MFVb.js} +3 -3
  35. package/dist/{_id_-9odGt4jf.js → _id_-BW85oNN8.js} +10 -10
  36. package/dist/{app-DKARBM7u.js → app-D_jTNakc.js} +1 -1
  37. package/dist/{app-2bbd_O98.js → app-ntt4GRm3.js} +25 -25
  38. package/dist/app.js +1 -1
  39. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/catalog.d.ts +1 -1
  40. package/dist/assets/{linked-status-DmIP1URe.js → linked-status-DzqW-dIk.js} +2 -2
  41. package/dist/assets/{override-menu-CjsD2KBQ.js → override-menu-DsppwnGw.js} +2 -2
  42. package/dist/assets/{validate-menu-CC3BocRS.js → validate-menu-CzYoNU7o.js} +2 -2
  43. package/dist/{catalog-DOFgYg6K.js → catalog-CyrRQdAE.js} +1 -1
  44. package/dist/{catalogSetting-B1naZ9jL.js → catalogSetting-BYOaDF2P.js} +1 -1
  45. package/dist/{category-Bz2zsVto.js → category-DSVtFwDD.js} +1 -1
  46. package/dist/{currency-BZV6-QY3.js → currency-Bv61mvXo.js} +1 -1
  47. package/dist/{customAttributes-BInvsXiT.js → customAttributes-CRleIu8c.js} +1 -1
  48. package/dist/{dayjs.min-CnQWW-Z3.js → dayjs.min-BXVEjQmH.js} +1 -1
  49. package/dist/{index-BHCnGQ06.js → index-BPUDGOpG.js} +3 -3
  50. package/dist/{index--1Md4WEj.js → index-CWEcdMBL.js} +1 -1
  51. package/dist/{index-DV7CU53l.js → index-ZL08gfPT.js} +4 -4
  52. package/dist/{index-C7lfKWR2.js → index-eJ8bZn8o.js} +1 -1
  53. package/dist/{item-ChaIX32X.js → item-Baro-Xs_.js} +386 -386
  54. package/dist/{jszip.min-C8gqwhwa.js → jszip.min-C4St6GUn.js} +245 -245
  55. package/dist/{menu-Cp9RL0oR.js → menu-DChbKKEr.js} +1 -1
  56. package/dist/{menu-B52eM23G.js → menu-DQ8YB87t.js} +7 -7
  57. package/dist/{menuV2-D3ExhOoi.js → menuV2-2md8qjF6.js} +63 -63
  58. package/dist/{priceTier-Ccww0TxU.js → priceTier-DbVxTs3S.js} +1 -1
  59. package/dist/{scheduler-B8XcfMpi.js → scheduler-BNI0t9f5.js} +4 -4
  60. package/dist/{subcategory-CbtqvGF5.js → subcategory-gc2qoY5w.js} +2 -2
  61. package/dist/{toExcel-C04qiFny.js → toExcel-TQ5H4xEZ.js} +2 -2
  62. package/dist/{unit-_s_zv_iK.js → unit-Dduk5zqJ.js} +2 -2
  63. package/package.json +1 -1
  64. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-DHFaag4B.js +0 -436
@@ -1,436 +0,0 @@
1
- import { computed as i, defineComponent as V, ref as k, resolveComponent as b, createElementBlock as L, openBlock as O, normalizeClass as v, createVNode as K, normalizeStyle as x, withCtx as $, createBlock as U, createCommentVNode as B } from "vue";
2
- import { A as p, J as E, G as S, O as N, ah as A, u as y, c as j } from "./menu-B52eM23G.js";
3
- import { u as C } from "./menuV2-D3ExhOoi.js";
4
- import { C as w, h as G } from "./catalog-DOFgYg6K.js";
5
- import { useSnackbar as F, useDialog as Y } from "@feedmepos/ui-library";
6
- import { a as T } from "./LinkProductSideSheet-DZJY3u1w.js";
7
- import { useI18n as J } from "@feedmepos/mf-common";
8
- function q() {
9
- const t = C(), s = i(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), m = i(() => {
10
- const u = t.currentCatalog;
11
- return u ? w.getItemAvailable(u).map((e) => ({ _id: e })) : [];
12
- });
13
- async function d(u) {
14
- const e = t.currentCatalog;
15
- if (!e) return;
16
- const a = u.reduce(
17
- (o, r) => (o[r] = R(
18
- r,
19
- e.override.items[r],
20
- u.includes(r),
21
- t.version === p.F_MENU_VERSION.enum.v3
22
- ), o),
23
- {}
24
- ), n = {
25
- ...e,
26
- override: {
27
- ...e.override,
28
- items: {
29
- ...a
30
- }
31
- }
32
- };
33
- await t.updateMenu({
34
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
35
- operation: E.F_OPERATION_TYPE.update,
36
- data: n
37
- });
38
- }
39
- async function l(u) {
40
- const e = t.currentCatalog;
41
- if (!e) return;
42
- const a = u.reduce(
43
- (o, r) => {
44
- const c = e.override.items[r];
45
- return o[r] = R(
46
- r,
47
- c,
48
- !0,
49
- t.version === p.F_MENU_VERSION.enum.v3
50
- ), o;
51
- },
52
- {}
53
- ), n = {
54
- ...e,
55
- override: {
56
- ...e.override,
57
- items: a
58
- },
59
- /**
60
- * linkItemRules and items under override are two ways to manage linked items under catalog,
61
- * if we changed items under override, we should clear linkItemRules to avoid conflict.
62
- */
63
- linkItemRules: null
64
- };
65
- await t.updateMenu({
66
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
67
- operation: E.F_OPERATION_TYPE.update,
68
- data: n
69
- });
70
- }
71
- async function f(u) {
72
- var o;
73
- const e = t.currentCatalog;
74
- if (!e) return;
75
- const a = u.reduce(
76
- (r, c) => {
77
- const g = e.override.items[c];
78
- return r[c] = R(
79
- c,
80
- g,
81
- !1,
82
- t.version === p.F_MENU_VERSION.enum.v3
83
- ), r;
84
- },
85
- {}
86
- ), n = {
87
- ...e,
88
- override: {
89
- ...e.override,
90
- items: {
91
- ...((o = e.override) == null ? void 0 : o.items) || {},
92
- ...a
93
- }
94
- }
95
- };
96
- await t.updateMenu({
97
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
98
- operation: E.F_OPERATION_TYPE.update,
99
- data: n
100
- });
101
- }
102
- async function _(u) {
103
- const e = t.currentCatalog;
104
- if (!e) return;
105
- const a = {
106
- ...e,
107
- linkItemRules: u
108
- };
109
- await t.updateMenu({
110
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
111
- operation: E.F_OPERATION_TYPE.update,
112
- data: a
113
- });
114
- }
115
- return {
116
- linkableItems: s,
117
- currentItems: m,
118
- setProduct: d,
119
- applyProduct: l,
120
- removeProduct: f,
121
- saveLinkItemRules: _
122
- };
123
- }
124
- function R(t, s, m, d) {
125
- const l = s == null ? void 0 : s.find((u) => !u.combinationKey), f = m ? null : p.F_ORDER_FROM.enum.NONE, _ = d ? m ? null : "" : l == null ? void 0 : l.category;
126
- return [
127
- {
128
- ...l ?? {},
129
- orderFrom: f,
130
- category: _,
131
- _id: t
132
- },
133
- ...(s == null ? void 0 : s.filter((u) => !!u.combinationKey)) ?? []
134
- ];
135
- }
136
- function H() {
137
- const t = C(), s = F(), m = Y(), d = S(s), l = N(d), f = i(() => {
138
- const e = t.categorizedRawMenuItems, a = new Set(
139
- t.currentCatalog ? w.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((n) => n._id)
140
- );
141
- return e.map((n) => ({
142
- ...n,
143
- items: n.items.filter((o) => a.has(o._id))
144
- })).filter((n) => n.items.length > 0);
145
- }), _ = i(() => {
146
- var o;
147
- const e = t.currentScheduler;
148
- if (!e) return [];
149
- const a = t.currentCatalog, n = a ? ((o = a.override.scheduler[e._id]) == null ? void 0 : o.items) ?? [] : e.items;
150
- return [
151
- ...new Set(n.filter((r) => r.orderFrom != p.F_ORDER_FROM.enum.NONE).map((r) => r._id))
152
- ].map((r) => ({ _id: r }));
153
- });
154
- async function u(e) {
155
- const a = t.currentScheduler;
156
- if (!a) return;
157
- const n = t.currentCatalog;
158
- if (n && t.rules.scheduler.override) {
159
- const o = new w(
160
- n,
161
- t,
162
- l.updateMenu,
163
- m
164
- );
165
- o.overrideCatalogSchedulerItems(e, a._id), await t.updateMenu({
166
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
167
- operation: E.F_OPERATION_TYPE.update,
168
- data: o.getCatalog()
169
- });
170
- } else {
171
- const o = e.reduce(
172
- (c, g) => {
173
- const M = a.items.filter((h) => h._id == g) ?? [];
174
- return c = c.concat(
175
- A(g, M, (h) => ({
176
- ...h,
177
- orderFrom: null
178
- }))
179
- ), c;
180
- },
181
- []
182
- ), r = {
183
- ...a,
184
- items: o
185
- };
186
- await t.updateMenu({
187
- module: p.F_MENU_MODULE_V4_KEY.enum.scheduler,
188
- operation: E.F_OPERATION_TYPE.update,
189
- data: r
190
- });
191
- }
192
- }
193
- return {
194
- linkableItems: f,
195
- currentItems: _,
196
- applyProduct: u
197
- };
198
- }
199
- const Q = () => {
200
- const t = y(), s = F(), m = S(s), d = N(m), l = i(() => t.categorizedRawMenuItems.filter((e) => e.items.length > 0)), f = i(() => {
201
- const e = t.currentCatalog;
202
- return e ? w.getItemAvailable(e).map((a) => ({ _id: a })) : [];
203
- });
204
- async function _(e) {
205
- const a = t.currentCatalog;
206
- if (!a) return;
207
- const o = t.state.menu.modules.item.map((c) => c._id).reduce(
208
- (c, g) => {
209
- const M = a.override.items[g];
210
- return c[g] = G(
211
- g,
212
- M,
213
- e.includes(g),
214
- t.version === j.F_MENU_VERSION.v3
215
- ), c;
216
- },
217
- {}
218
- ), r = {
219
- ...a,
220
- override: { ...a.override, items: o },
221
- /**
222
- * linkItemRules and items under override are two ways to manage linked items under catalog,
223
- * if we changed items under override, we should clear linkItemRules to avoid conflict.
224
- */
225
- linkItemRules: null
226
- };
227
- await d.updateMenu(
228
- {
229
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
230
- operation: E.F_OPERATION_TYPE.update,
231
- data: r
232
- },
233
- r.name
234
- );
235
- }
236
- async function u(e) {
237
- const a = t.currentCatalog;
238
- if (!a) return;
239
- const n = {
240
- ...a,
241
- linkItemRules: e
242
- };
243
- await d.updateMenu(
244
- {
245
- module: p.F_MENU_MODULE_V4_KEY.enum.catalog,
246
- operation: E.F_OPERATION_TYPE.update,
247
- data: n
248
- },
249
- n.name
250
- );
251
- }
252
- return {
253
- linkableItems: l,
254
- currentItems: f,
255
- applyProduct: _,
256
- saveLinkItemRules: u
257
- };
258
- }, W = () => {
259
- const t = y(), s = F(), m = Y(), d = S(s), l = N(d), f = i(() => {
260
- const e = t.categorizedRawMenuItems, a = new Set(
261
- t.currentCatalog ? w.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((n) => n._id)
262
- );
263
- return e.map((n) => ({
264
- ...n,
265
- items: n.items.filter((o) => a.has(o._id))
266
- })).filter((n) => n.items.length > 0);
267
- }), _ = i(() => {
268
- var o;
269
- const e = t.currentScheduler;
270
- if (!e) return [];
271
- const a = t.currentCatalog, n = a ? ((o = a.override.scheduler[e._id]) == null ? void 0 : o.items) ?? [] : e.items;
272
- return [
273
- ...new Set(n.filter((r) => r.orderFrom != p.F_ORDER_FROM.enum.NONE).map((r) => r._id))
274
- ].map((r) => ({ _id: r }));
275
- });
276
- async function u(e) {
277
- const a = t.currentScheduler;
278
- if (!a) return;
279
- const n = t.currentCatalog;
280
- if (n && t.rules.scheduler.override) {
281
- const o = new w(n, t, l.updateMenu, m);
282
- o.overrideCatalogSchedulerItems(e, a._id), await o.update();
283
- } else {
284
- const o = e.reduce(
285
- (c, g) => {
286
- const M = a.items.filter((h) => h._id == g) ?? [];
287
- return c = c.concat(
288
- A(g, M, (h) => ({
289
- ...h,
290
- orderFrom: null
291
- }))
292
- ), c;
293
- },
294
- []
295
- ), r = {
296
- ...a,
297
- items: o
298
- };
299
- await l.updateMenu(
300
- {
301
- module: p.F_MENU_MODULE_V4_KEY.enum.scheduler,
302
- operation: E.F_OPERATION_TYPE.update,
303
- data: r
304
- },
305
- r.name
306
- );
307
- }
308
- }
309
- return {
310
- linkableItems: f,
311
- currentItems: _,
312
- applyProduct: u
313
- };
314
- };
315
- function se(t) {
316
- const s = {
317
- // Under FdoMenuV4Category _id is string, but here we need null for Addon, so we bypass the type checking
318
- // @ts-ignore
319
- _id: null,
320
- name: "Addon",
321
- position: 0
322
- };
323
- if (!t) {
324
- const n = y(), o = i(() => n.state.menu.modules.item ?? []), r = i(() => {
325
- var I;
326
- return ((I = n.currentCatalog) == null ? void 0 : I.linkItemRules) ?? null;
327
- }), c = W(), g = Q(), M = i(() => !n.state.currentSchedulerId), h = (I) => {
328
- if (I.mode === T.Rules)
329
- g.saveLinkItemRules(I.linkItemRules);
330
- else {
331
- const P = I.items.map((z) => z._id);
332
- M.value ? g.applyProduct(P) : c.applyProduct(P);
333
- }
334
- }, D = i(() => [s, ...n.state.menu.modules.category ?? []]);
335
- return {
336
- menuItems: o,
337
- categories: D,
338
- linkItemRules: r,
339
- catalogManager: g,
340
- schedulerManager: c,
341
- noScheduler: M,
342
- handleSubmit: h
343
- };
344
- }
345
- const m = C(), d = i(() => m.state.menu.modules.item ?? []), l = i(() => {
346
- var n;
347
- return ((n = m.currentCatalog) == null ? void 0 : n.linkItemRules) ?? null;
348
- }), f = H(), _ = q(), u = i(() => !m.state.currentSchedulerId), e = (n) => {
349
- if (n.mode === T.Rules)
350
- _.saveLinkItemRules(n.linkItemRules);
351
- else {
352
- const o = n.items.map((r) => r._id);
353
- u.value ? _.applyProduct(o) : f.applyProduct(o);
354
- }
355
- }, a = i(() => [s, ...m.state.menu.modules.category ?? []]);
356
- return {
357
- menuItems: d,
358
- categories: a,
359
- linkItemRules: l,
360
- catalogManager: _,
361
- schedulerManager: f,
362
- noScheduler: u,
363
- handleSubmit: e
364
- };
365
- }
366
- const X = ["alt", "src", "crossorigin"], ue = /* @__PURE__ */ V({
367
- __name: "Thumbnail",
368
- props: {
369
- src: {},
370
- alt: {},
371
- className: {},
372
- size: {},
373
- crossorigin: { type: Boolean, default: !0 }
374
- },
375
- setup(t) {
376
- const s = t, { t: m } = J(), d = k(!1), l = k(!s.src), f = () => {
377
- d.value = !1, l.value = !0;
378
- }, _ = () => {
379
- d.value = !0, l.value = !0;
380
- }, u = i(() => s.alt ? m("menu.thumbnail.alt.with_name", { name: s.alt }) : m("menu.thumbnail.alt.default")), e = i(() => typeof s.size == "number" ? {
381
- width: s.size,
382
- height: s.size
383
- } : {
384
- width: s.size.width,
385
- height: s.size.height
386
- }), a = i(() => {
387
- if (!s.src) return null;
388
- if (s.crossorigin) {
389
- const n = s.src.includes("?") ? "&" : "?";
390
- return `${s.src}${n}_cors=${Date.now()}`;
391
- }
392
- return s.src;
393
- });
394
- return (n, o) => {
395
- const r = b("fm-icon"), c = b("fm-card");
396
- return O(), L("div", {
397
- class: v([n.className, "flex items-center justify-center"])
398
- }, [
399
- K(c, {
400
- class: v(["flex items-center justify-center", "rounded-md"]),
401
- style: x({ width: `${e.value.width}px`, height: `${e.value.height}px` }),
402
- variant: "outlined"
403
- }, {
404
- default: $(() => [
405
- a.value && !d.value ? (O(), L("img", {
406
- key: 0,
407
- alt: u.value,
408
- class: v(["w-full h-full", "object-cover", l.value ? "" : "hidden"]),
409
- src: a.value,
410
- crossorigin: s.crossorigin ? "anonymous" : void 0,
411
- onError: _,
412
- onLoad: f
413
- }, null, 42, X)) : (O(), U(r, {
414
- key: 1,
415
- color: "neutral-gray-300",
416
- name: "image",
417
- outline: ""
418
- })),
419
- l.value ? B("", !0) : (O(), U(r, {
420
- key: 2,
421
- class: "animate-spin",
422
- name: "progress_activity",
423
- spin: ""
424
- }))
425
- ]),
426
- _: 1
427
- }, 8, ["style"])
428
- ], 2);
429
- };
430
- }
431
- });
432
- export {
433
- ue as _,
434
- q as a,
435
- se as u
436
- };