@feedmepos/mf-menu 0.31.40-beta.2 → 0.31.40-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 (91) hide show
  1. package/dist/{App-CoKv0BFp.js → App-aWEH-ZEk.js} +9 -9
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-B14Q0hS_.js → ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js} +3 -3
  3. package/dist/{Catalog-BRovMtuI.js → Catalog-BoFfFdn8.js} +9 -8
  4. package/dist/{Category-DytZqgIt.js → Category-CWYbb3Jn.js} +4 -4
  5. package/dist/{Category-CT8-B4zh.js → Category-DZ45uikR.js} +6 -6
  6. package/dist/{CookingGuide-Ct5qRLG0.js → CookingGuide-BU0PRWIQ.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-D3R3TCba.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js} +1 -1
  8. package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +50 -0
  9. package/dist/{Group-Dk1yQTTt.js → Group-BMQDeqiS.js} +1 -1
  10. package/dist/{Group-G_H8i5_8.js → Group-C0T_uknK.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-CoTdB2d5.js → Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js} +8 -8
  12. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +367 -0
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BKx7uQtR.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js} +14 -13
  14. package/dist/{Ingredient-ChynYQq6.js → Ingredient-3lwDUQx_.js} +3 -3
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DyaUxnMx.js → InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js} +2 -2
  16. package/dist/LinkProductSideSheet-LDZjKX95.js +297 -0
  17. package/dist/{app-CiBqmBzO.js → LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js} +2084 -2120
  18. package/dist/MenuSetting-AhutsCVy.js +185 -0
  19. package/dist/{PrintRoute-DwAZHUrQ.js → PrintRoute-DfJ-vUAb.js} +4 -4
  20. package/dist/{Product-Bx2NPQvC.js → Product-F4PoLm9v.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-od_O6x7E.js → Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js} +465 -468
  22. package/dist/{ProductInternalTools-BOguHh06.js → ProductInternalTools-DSGU-OqU.js} +6 -6
  23. package/dist/{Products-DA2hOsxr.js → Products-COzW2Z4g.js} +85 -88
  24. package/dist/{Publish-WATQWkjh.js → Publish-CDXVWCk2.js} +3 -3
  25. package/dist/{Recipe-WPwGgur3.js → Recipe-BZx4wrcP.js} +4 -4
  26. package/dist/{Scheduler-Djjggrh2.js → Scheduler-wHCWSeU2.js} +3 -3
  27. package/dist/{ServingSequence-CryZJTWA.js → ServingSequence-BbYEhDYh.js} +3 -3
  28. package/dist/{Setting-BtLsmoqY.js → Setting-C9Tlw1Iy.js} +45 -44
  29. package/dist/{Subcategory-BvlYDquD.js → Subcategory-C8AwfrKb.js} +4 -4
  30. package/dist/{Takeaway-8khxlcKQ.js → Takeaway-DaEUn-yM.js} +4 -4
  31. package/dist/{Takeaway-BBvFxAlx.js → Takeaway-t1053wg2.js} +1 -1
  32. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-B8blN-yJ.js → Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js} +5 -5
  33. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-CA9RlNkt.js → Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js} +95 -97
  34. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js +5998 -0
  35. package/dist/{Unit-Diu00sM2.js → Unit-CnqptGCz.js} +2 -2
  36. package/dist/{Variant-CO15W0wb.js → Variant-DiOYOwJs.js} +3 -3
  37. package/dist/{_id_-CxA_FzSG.js → _id_-BSfU16VO.js} +75 -78
  38. package/dist/{app-Blbof2Ga.js → app-Cou6qPF2.js} +1 -1
  39. package/dist/{app-5ESai6-B.js → app-Ddb81PNo.js} +278 -278
  40. package/dist/app.js +1 -1
  41. package/dist/apps/mf-menu/src/api/menu.d.ts +1 -2
  42. package/dist/apps/mf-menu/src/app.d.ts +0 -144
  43. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +0 -36
  44. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +3 -9
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +9 -2
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +4 -294
  47. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +0 -40
  48. package/dist/apps/mf-menu/src/helper/import-export.d.ts +0 -285
  49. package/dist/apps/mf-menu/src/helper/menu.d.ts +0 -285
  50. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +0 -285
  51. package/dist/apps/mf-menu/src/stores/menu.d.ts +3 -293
  52. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +0 -166
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/linked-status-B_crHhZH.js +24 -0
  55. package/dist/assets/override-menu-BmlCEpHH.js +24 -0
  56. package/dist/assets/validate-menu-CF-psoB-.js +24 -0
  57. package/dist/{catalog-CXjEQ80k.js → catalog-DSuJhsUb.js} +1 -1
  58. package/dist/{catalogSetting-aJSUDY_z.js → catalogSetting-C3gEw9ov.js} +1 -1
  59. package/dist/{category-TqQULuHq.js → category-CwWq3KCE.js} +1 -1
  60. package/dist/{currency-CRjh8ne7.js → currency-g45Sh-t6.js} +1 -1
  61. package/dist/{dayjs.min-MBmYgyRY.js → dayjs.min-g3eN5z-V.js} +1 -1
  62. package/dist/index-0Q5T9VZV.js +214 -0
  63. package/dist/{index-dkHuztwB.js → index-0yRUi7LL.js} +1 -1
  64. package/dist/{index-CzjFGFvP.js → index-BLQCYEc6.js} +8 -7
  65. package/dist/{index-B1NS2hBa.js → index-QsLFbxyG.js} +4 -4
  66. package/dist/{item-Dj14On9a.js → item-BvvQ9urP.js} +386 -386
  67. package/dist/{jszip.min-Be1afVon.js → jszip.min-DzdUiaR4.js} +353 -353
  68. package/dist/{menu-C0Xu-iTb.js → menu-DFNvhoNQ.js} +31149 -31298
  69. package/dist/{menu-kRDoPBjm.js → menu-QrVg2Ph7.js} +7 -7
  70. package/dist/{menuV2-D6Gmxd9X.js → menuV2-Ezf_jW40.js} +137 -142
  71. package/dist/mf-menu.css +1 -1
  72. package/dist/{priceTier-CJlFGOpm.js → priceTier-zENsn3P_.js} +1 -1
  73. package/dist/{scheduler-B11d6fJr.js → scheduler-BuwGSv6A.js} +8 -8
  74. package/dist/{subcategory-D6hTbHP-.js → subcategory-O3L_zCJA.js} +2 -2
  75. package/dist/{toExcel-BedErXvS.js → toExcel-CpRy_4nG.js} +2 -2
  76. package/dist/{unit-D5jDzsM2.js → unit-Ct_7Hfa2.js} +41 -42
  77. package/package.json +3 -3
  78. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B_Yv8Thl.js +0 -399
  79. package/dist/LinkProductSideSheet-DsoPo7Q_.js +0 -361
  80. package/dist/MenuSetting-CDSc-56P.js +0 -618
  81. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-LVWB5CIa.js +0 -5994
  82. package/dist/apps/mf-menu/src/composable/attributes.d.ts +0 -26
  83. package/dist/apps/mf-menu/src/utils/array.d.ts +0 -1
  84. package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +0 -12
  85. package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +0 -2
  86. package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +0 -176
  87. package/dist/assets/linked-status-x1efKEih.js +0 -13
  88. package/dist/assets/override-menu-D8d9BWzy.js +0 -13
  89. package/dist/assets/validate-menu-DUJ20GHx.js +0 -13
  90. package/dist/customAttributes-32VmzFKZ.js +0 -177
  91. package/dist/index-FzHOAFSW.js +0 -246
@@ -0,0 +1,297 @@
1
+ import { defineComponent as G, createElementBlock as b, openBlock as c, createElementVNode as u, renderSlot as U, createCommentVNode as w, toDisplayString as B, ref as A, computed as S, watch as D, resolveComponent as R, Fragment as O, createVNode as n, unref as l, withCtx as v, createBlock as N, renderList as de } from "vue";
2
+ import { H as V, Q as ce, u as pe, A as fe, I as j } from "./menu-DFNvhoNQ.js";
3
+ import { N as Q, b as T, x as P } from "./LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js";
4
+ import { useI18n as ve, isEmptyRule as C, useCustomAttributes as H, useCoreStore as be, ItemSelector as _e, EMPTY_RULE as F, isEmptyMongoQuery as Y } from "@feedmepos/mf-common";
5
+ import { components as ye, FmButtonVariant as q } from "@feedmepos/ui-library";
6
+ import { u as he } from "./discardConfirm-BHni0LNu.js";
7
+ import { u as ke } from "./menuV2-Ezf_jW40.js";
8
+ import { c as Ae } from "./check-C9mY6LiX.js";
9
+ const Re = (r, p) => {
10
+ const s = r.__vccOpts || r;
11
+ for (const [g, i] of p)
12
+ s[g] = i;
13
+ return s;
14
+ }, ge = { class: "space-y-8" }, Ie = { class: "flex items-center justify-between" }, Se = { class: "space-y-8" }, Ve = { class: "fm-typo-en-body-lg-600" }, Ce = {
15
+ key: 0,
16
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
17
+ }, $ = /* @__PURE__ */ G({
18
+ __name: "FormItem",
19
+ props: {
20
+ label: {},
21
+ description: {}
22
+ },
23
+ setup(r) {
24
+ return (p, s) => (c(), b("div", ge, [
25
+ u("div", Ie, [
26
+ u("div", Se, [
27
+ u("p", Ve, B(p.label), 1),
28
+ p.description ? (c(), b("p", Ce, B(p.description), 1)) : w("", !0)
29
+ ]),
30
+ U(p.$slots, "append")
31
+ ]),
32
+ U(p.$slots, "default")
33
+ ]));
34
+ }
35
+ });
36
+ var m = /* @__PURE__ */ ((r) => (r[r.Normal = 0] = "Normal", r[r.Rules = 1] = "Rules", r))(m || {});
37
+ const Fe = { class: "fm-typo-en-title-md-600 mr-auto" }, we = {
38
+ key: 1,
39
+ class: "flex items-center gap-12"
40
+ }, Be = { class: "flex items-center gap-8" }, Ee = { class: "text-neutral-600 fm-typo-body-sm" }, Oe = { class: "grid md:grid-cols-3 gap-16" }, Ne = { class: "md:col-span-2 space-y-16" }, $e = { class: "flex justify-end" }, Ue = { class: "flex gap-8 items-center justify-start" }, Le = /* @__PURE__ */ G({
41
+ __name: "LinkProductSideSheet",
42
+ props: {
43
+ initialValue: { default: () => [] },
44
+ linkItemRules: {},
45
+ menuItems: {},
46
+ noScheduler: { type: Boolean },
47
+ isLocalOnly: { type: Boolean, default: !1 },
48
+ categorizedItems: { default: () => [] },
49
+ selectVariant: { type: Boolean, default: !1 },
50
+ showVariant: { type: Boolean, default: !1 },
51
+ showAddon: { type: Boolean, default: !0 },
52
+ title: { default: void 0 },
53
+ useCloseBtn: { type: Boolean }
54
+ },
55
+ emits: ["submit"],
56
+ setup(r, { emit: p }) {
57
+ const s = r, g = p, { t: i } = ve(), _ = A(m.Normal);
58
+ function J(t) {
59
+ _.value = t;
60
+ }
61
+ const f = A(!1), L = (t) => {
62
+ Ae.isBoolean(t) ? f.value = t : f.value = !f.value;
63
+ };
64
+ function E(t) {
65
+ return t.reduce((e, a) => (e[a._id] = [...e[a._id] ?? [], a], e), {});
66
+ }
67
+ const K = s.initialValue, h = A(E(V(K))), M = S(() => Object.values(h.value).flatMap((t) => t)), k = A(
68
+ V(s.linkItemRules)
69
+ ), o = A();
70
+ function x() {
71
+ var t;
72
+ return (t = k.value) == null ? void 0 : t.map((e) => ({
73
+ ...e,
74
+ restaurantAttributes: Y(e.restaurantAttributes) ? F : P.build(e.restaurantAttributes),
75
+ itemAttributes: Y(e.itemAttributes) ? F : P.build(e.itemAttributes)
76
+ }));
77
+ }
78
+ o.value = x(), D(
79
+ o,
80
+ (t) => {
81
+ k.value = t == null ? void 0 : t.map((e) => ({
82
+ ...e,
83
+ restaurantAttributes: C(e.restaurantAttributes) ? null : Q.build(e.restaurantAttributes),
84
+ itemAttributes: C(e.itemAttributes) ? null : Q.build(e.itemAttributes)
85
+ }));
86
+ },
87
+ { deep: !0 }
88
+ );
89
+ const W = he(
90
+ () => !j.isEqual(E(s.initialValue), h.value) || !j.isEqual(s.linkItemRules, k.value),
91
+ () => {
92
+ f.value = !1;
93
+ }
94
+ );
95
+ function X() {
96
+ _.value === m.Rules ? g("submit", {
97
+ mode: m.Rules,
98
+ linkItemRules: k.value || []
99
+ }) : g("submit", {
100
+ mode: m.Normal,
101
+ items: M.value
102
+ }), f.value = !1;
103
+ }
104
+ D(
105
+ () => f.value,
106
+ () => {
107
+ h.value = E(V(s.initialValue)), k.value = V(s.linkItemRules), o.value = x(), _.value = s.noScheduler && s.linkItemRules && s.linkItemRules.length > 0 ? m.Rules : m.Normal;
108
+ }
109
+ );
110
+ const Z = S(() => {
111
+ const t = ce();
112
+ return Object.values(t).sort((e, a) => a.sortingIndex - e.sortingIndex).map((e) => ({ label: e.label, value: e.value }));
113
+ }), { attributes: ee } = H({
114
+ valueSource: be().restaurants,
115
+ entity: "restaurant"
116
+ }), te = S(() => s.menuItems || []), { attributes: le } = H({
117
+ valueSource: te,
118
+ entity: "item"
119
+ });
120
+ function ae() {
121
+ const t = [
122
+ ...o.value || [],
123
+ {
124
+ orderFrom: fe.F_ORDER_FROM.enum.ALL,
125
+ restaurantAttributes: null,
126
+ itemAttributes: null
127
+ }
128
+ ];
129
+ o.value = t;
130
+ }
131
+ function se(t) {
132
+ if (!o.value) return;
133
+ const e = [...o.value];
134
+ e.splice(t, 1), o.value = e.length ? e : [];
135
+ }
136
+ function oe(t, e) {
137
+ if (!o.value) return;
138
+ const a = [...o.value];
139
+ C(e) ? a[t].restaurantAttributes = null : a[t].restaurantAttributes = e, o.value = a;
140
+ }
141
+ function ne(t, e) {
142
+ if (!o.value) return;
143
+ const a = [...o.value];
144
+ C(e) ? a[t].itemAttributes = null : a[t].itemAttributes = e, o.value = a;
145
+ }
146
+ const z = S(() => {
147
+ const t = s.isLocalOnly ? ke() : pe();
148
+ return s.noScheduler && t.currentCatalog;
149
+ });
150
+ return (t, e) => {
151
+ const a = R("fm-button"), ue = R("fm-switch"), re = R("FmSelect"), ie = R("FmCard"), me = R("fm-side-sheet");
152
+ return c(), b(O, null, [
153
+ U(t.$slots, "default", { trigger: L }, void 0, !0),
154
+ n(me, {
155
+ id: "group-form",
156
+ modelValue: f.value,
157
+ "onUpdate:modelValue": e[3] || (e[3] = (d) => f.value = d),
158
+ "close-button": t.useCloseBtn,
159
+ "is-container": l(ye).FmForm,
160
+ "is-container-props": {
161
+ onValidationSuccess: X,
162
+ blameFormChildOnValidationFailed: !0
163
+ },
164
+ "max-width": 760,
165
+ "onOn:clickedAway": l(W)
166
+ }, {
167
+ "side-sheet-header": v(() => [
168
+ t.useCloseBtn ? w("", !0) : (c(), N(a, {
169
+ key: 0,
170
+ variant: l(q).Tertiary,
171
+ class: "cursor-pointer mr-4",
172
+ "prepend-icon": "arrow_back",
173
+ onClick: L
174
+ }, null, 8, ["variant"])),
175
+ u("p", Fe, B(t.title || l(i)("menu.link_product.title")), 1),
176
+ z.value ? (c(), b("div", we, [
177
+ u("div", Be, [
178
+ n(ue, {
179
+ label: l(i)("menu.link_product.rules.section_title"),
180
+ "model-value": _.value === l(m).Rules,
181
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => J(d ? l(m).Rules : l(m).Normal))
182
+ }, null, 8, ["label", "model-value"])
183
+ ])
184
+ ])) : w("", !0)
185
+ ]),
186
+ "side-sheet-footer": v(() => [
187
+ u("div", Ue, [
188
+ n(a, {
189
+ label: l(i)("menu.common.actions.confirm"),
190
+ size: "lg",
191
+ type: "submit",
192
+ variant: "primary"
193
+ }, null, 8, ["label"]),
194
+ n(a, {
195
+ label: l(i)("menu.common.actions.cancel"),
196
+ size: "lg",
197
+ variant: "tertiary",
198
+ onClick: e[2] || (e[2] = () => f.value = !1)
199
+ }, null, 8, ["label"])
200
+ ])
201
+ ]),
202
+ default: v(() => [
203
+ (c(), b("div", {
204
+ class: "py-8 px-8 overflow-y-auto space-y-24",
205
+ key: _.value
206
+ }, [
207
+ _.value === l(m).Normal ? (c(), N(l(_e), {
208
+ key: 0,
209
+ "auto-focus-search": !0,
210
+ "categorized-items": t.categorizedItems,
211
+ data: h.value,
212
+ "select-variant": t.selectVariant,
213
+ "selected-items": M.value,
214
+ "show-variant": t.showVariant,
215
+ "show-addon": t.showAddon,
216
+ "onUpdate:data": e[1] || (e[1] = (d) => h.value = d)
217
+ }, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant", "show-addon"])) : z.value ? (c(), b(O, { key: 1 }, [
218
+ u("p", Ee, B(l(i)("menu.link_product.rules.hint")), 1),
219
+ (c(!0), b(O, null, de(o.value, (d, I) => (c(), N(ie, {
220
+ key: I,
221
+ class: "p-16 space-y-16",
222
+ variant: "outlined"
223
+ }, {
224
+ default: v(() => [
225
+ u("div", Oe, [
226
+ u("div", null, [
227
+ n($, {
228
+ label: l(i)("menu.link_product.rules.order_from")
229
+ }, {
230
+ default: v(() => [
231
+ n(re, {
232
+ items: Z.value,
233
+ "model-value": d.orderFrom,
234
+ "onUpdate:modelValue": (y) => d.orderFrom = y
235
+ }, null, 8, ["items", "model-value", "onUpdate:modelValue"])
236
+ ]),
237
+ _: 2
238
+ }, 1032, ["label"])
239
+ ]),
240
+ u("div", Ne, [
241
+ n($, {
242
+ label: l(i)("menu.link_product.rules.restaurant_filter")
243
+ }, {
244
+ default: v(() => [
245
+ n(l(T), {
246
+ attributes: l(ee),
247
+ "model-value": d.restaurantAttributes || l(F),
248
+ "onUpdate:modelValue": (y) => oe(I, y)
249
+ }, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])
250
+ ]),
251
+ _: 2
252
+ }, 1032, ["label"]),
253
+ n($, {
254
+ label: l(i)("menu.link_product.rules.item_filter")
255
+ }, {
256
+ default: v(() => [
257
+ n(l(T), {
258
+ attributes: l(le),
259
+ "model-value": d.itemAttributes || l(F),
260
+ "onUpdate:modelValue": (y) => ne(I, y)
261
+ }, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])
262
+ ]),
263
+ _: 2
264
+ }, 1032, ["label"])
265
+ ])
266
+ ]),
267
+ u("div", $e, [
268
+ n(a, {
269
+ variant: l(q).Tertiary,
270
+ "prepend-icon": "delete",
271
+ onClick: (y) => se(I)
272
+ }, null, 8, ["variant", "onClick"])
273
+ ])
274
+ ]),
275
+ _: 2
276
+ }, 1024))), 128)),
277
+ u("div", null, [
278
+ n(a, {
279
+ label: l(i)("menu.link_product.rules.add_rule"),
280
+ onClick: ae
281
+ }, null, 8, ["label"])
282
+ ])
283
+ ], 64)) : w("", !0)
284
+ ]))
285
+ ]),
286
+ _: 1
287
+ }, 8, ["modelValue", "close-button", "is-container", "is-container-props", "onOn:clickedAway"])
288
+ ], 64);
289
+ };
290
+ }
291
+ }), He = /* @__PURE__ */ Re(Le, [["__scopeId", "data-v-97fa9d58"]]);
292
+ export {
293
+ He as L,
294
+ Re as _,
295
+ $ as a,
296
+ m as b
297
+ };