@feedmepos/mf-menu 0.31.33 → 0.31.34-alpha

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 (101) hide show
  1. package/dist/{App-DNDOc3bV.js → App-CaKDbV0S.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BvrfcWHU.js → ApplyProduct.vue_vue_type_script_setup_true_lang-gY18sRMg.js} +20 -20
  3. package/dist/{Catalog-Zhi-3W6T.js → Catalog-B0zMoi7e.js} +80 -80
  4. package/dist/{Category-BU0bkAGd.js → Category-Dyou6Q17.js} +31 -27
  5. package/dist/{Category-CE9ixFkD.js → Category-rMN8037Q.js} +19 -19
  6. package/dist/{CookingGuide-eghVaeEY.js → CookingGuide-DT2XxaWa.js} +4 -4
  7. package/dist/CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cv9LNAfi.js +113 -0
  8. package/dist/{Group-DWrtP9Au.js → Group-CYSIOe3D.js} +1 -1
  9. package/dist/{Group-DDZPf6LY.js → Group-M4WPAAYz.js} +3 -3
  10. package/dist/Group.vue_vue_type_script_setup_true_lang-B-BH-2WN.js +686 -0
  11. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-TQWka93A.js +367 -0
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Cus0YKUt.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DgSO7SQW.js} +4982 -5081
  13. package/dist/{Ingredient-BJgvOyV9.js → Ingredient-DNvr30pW.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CF99abLi.js → InventoryBinding.vue_vue_type_script_setup_true_lang-G44luws0.js} +1052 -1052
  15. package/dist/LinkProductSideSheet-Cp0HFoP2.js +297 -0
  16. package/dist/LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js +8024 -0
  17. package/dist/{MenuSetting-gkwORUX0.js → MenuSetting-UeQ2NyVm.js} +4 -4
  18. package/dist/{PrintRoute-Cda6sFlL.js → PrintRoute-5uX9ymJY.js} +89 -88
  19. package/dist/{Product-61AAh5L-.js → Product-Dxqf8_iq.js} +1 -1
  20. package/dist/Product.vue_vue_type_script_setup_true_lang-DUtGVRCH.js +1578 -0
  21. package/dist/{ProductInternalTools-o8cVZXCT.js → ProductInternalTools-BCF9q0i_.js} +5 -5
  22. package/dist/Products--adhOQ8n.js +283 -0
  23. package/dist/{Publish-BRgJUzoA.js → Publish-CRaoaFxc.js} +3 -3
  24. package/dist/{Recipe-CV8lvryp.js → Recipe-DPkzZMJi.js} +4 -4
  25. package/dist/{Scheduler-B_ptvb82.js → Scheduler-BuwjNHHj.js} +3 -3
  26. package/dist/{ServingSequence-DABGnLbT.js → ServingSequence-Cdf_Zmat.js} +3 -3
  27. package/dist/Setting-Vr3Thttm.js +259 -0
  28. package/dist/{Subcategory-BiqlAvMs.js → Subcategory-DoXmjcg1.js} +4 -4
  29. package/dist/{Takeaway-BBdkzEiP.js → Takeaway-BRTQu8VT.js} +1 -1
  30. package/dist/{Takeaway-nIjrDu5C.js → Takeaway-t3il54Bd.js} +4 -4
  31. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-D_M2PFO-.js → Takeaway.vue_vue_type_script_setup_true_lang-DtHABSgp.js} +6 -6
  32. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-D_ACNj_Z.js +431 -0
  33. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DAoGiRV-.js +5990 -0
  34. package/dist/{Unit-Di5sUbhV.js → Unit-C_QY3IX_.js} +2 -2
  35. package/dist/{Variant-CiZCtZk9.js → Variant-CR4IEm-Q.js} +3 -3
  36. package/dist/_id_-DOU7ieGB.js +202 -0
  37. package/dist/{app-B63V5b4I.js → app--fRC3N4C.js} +1 -1
  38. package/dist/{app-DuD_IPou.js → app-CrXLAKdw.js} +95 -97
  39. package/dist/app.js +6 -7
  40. package/dist/apps/mf-menu/src/app.d.ts +62 -3
  41. package/dist/apps/mf-menu/src/components/feature/PriceTier/LinkPriceTierSection.vue.d.ts +24 -0
  42. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +30 -0
  43. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +33 -0
  44. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/catalog.d.ts +2 -0
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +80 -1
  46. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +1276 -0
  47. package/dist/apps/mf-menu/src/helper/import-export.d.ts +77 -0
  48. package/dist/apps/mf-menu/src/helper/menu.d.ts +77 -0
  49. package/dist/apps/mf-menu/src/helper/setting/catalogSetting.d.ts +11 -2
  50. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +77 -0
  51. package/dist/apps/mf-menu/src/router/shared.d.ts +0 -1
  52. package/dist/apps/mf-menu/src/stores/manager/catalog.d.ts +2 -0
  53. package/dist/apps/mf-menu/src/stores/menu.d.ts +79 -0
  54. package/dist/apps/mf-menu/src/types/linkProducts.d.ts +21 -0
  55. package/dist/apps/mf-menu/src/views/PrintRoute/PrintDepartmentDialog.vue.d.ts +5 -3
  56. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +82 -0
  57. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/assets/linked-status-BTF_dm9R.js +24 -0
  59. package/dist/assets/override-menu-BPu7TVCy.js +24 -0
  60. package/dist/assets/validate-menu-BQpDfHbr.js +24 -0
  61. package/dist/{catalog-DfYSMjLc.js → catalog-BGiDWODL.js} +1 -1
  62. package/dist/catalogSetting-C34kIcYn.js +71 -0
  63. package/dist/{category-mmjX_QdF.js → category-CayMSpUc.js} +1 -1
  64. package/dist/{currency-3ugQtBPt.js → currency-BggoZpJv.js} +1 -1
  65. package/dist/{dayjs.min-CkV4mNm8.js → dayjs.min-BKDTLohL.js} +1 -1
  66. package/dist/{index-Cztb2LVZ.js → index-BPcRbiW0.js} +3 -3
  67. package/dist/{index-BboaHtmY.js → index-CLFhXi0y.js} +3 -3
  68. package/dist/index-D7yR1j9C.js +215 -0
  69. package/dist/{index-BZaKuDcN.js → index-f9kzXNPD.js} +28 -28
  70. package/dist/{item-CVnDeXhJ.js → item-C51o9ejv.js} +547 -545
  71. package/dist/{jszip.min-GxfcHBC5.js → jszip.min-m57vowh9.js} +353 -353
  72. package/dist/{menu-sGVv4bhQ.js → menu-DHfLxvzU.js} +4 -4
  73. package/dist/menu-DK7wG3S5.js +133287 -0
  74. package/dist/menuV2-B-0V65cx.js +707 -0
  75. package/dist/mf-menu.css +1 -1
  76. package/dist/{priceTier-CHTA0ZEb.js → priceTier-DD-24pkj.js} +1 -1
  77. package/dist/{scheduler-CaMxCHZ0.js → scheduler-NjDv_P4c.js} +16 -17
  78. package/dist/subcategory-DLdBwjHV.js +148 -0
  79. package/dist/{toExcel-WorodvP1.js → toExcel-coJ5igRV.js} +15 -15
  80. package/dist/{unit-DtKZZYL6.js → unit-C7XUV0EW.js} +5 -4
  81. package/package.json +5 -5
  82. package/dist/CustomAttributeChip.vue_vue_type_script_setup_true_lang-BiF8rW4M.js +0 -7949
  83. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +0 -26
  84. package/dist/Group.vue_vue_type_script_setup_true_lang-DyqGsRAW.js +0 -698
  85. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BmRUg94d.js +0 -206
  86. package/dist/LinkProductSideSheet-CTT4oGUY.js +0 -112
  87. package/dist/Product.vue_vue_type_script_setup_true_lang-Cy4uok1E.js +0 -1560
  88. package/dist/Products-D0rrANT6.js +0 -270
  89. package/dist/Setting-3ISlMXOA.js +0 -258
  90. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-DzQ8_6Bi.js +0 -71
  91. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-y0n5hTLk.js +0 -6149
  92. package/dist/_id_-DY8himeL.js +0 -200
  93. package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +0 -70
  94. package/dist/assets/linked-status-CkBKnMXs.js +0 -24
  95. package/dist/assets/override-menu-XZ7XfcfS.js +0 -24
  96. package/dist/assets/validate-menu-Bomogq01.js +0 -24
  97. package/dist/catalogSetting-_4Z0s3_Q.js +0 -65
  98. package/dist/index-Ce4v8o7D.js +0 -106
  99. package/dist/menu-IGORh0Ik.js +0 -108039
  100. package/dist/subcategory-CmVttqlG.js +0 -817
  101. /package/dist/{apps/mf-menu/src/components → packages/shared/src/components/info}/CustomAttributeChip.vue.d.ts +0 -0
@@ -1,270 +0,0 @@
1
- import { defineComponent as Y, computed as g, ref as z, resolveComponent as h, createBlock as y, openBlock as d, unref as e, withCtx as m, createElementVNode as u, toDisplayString as U, createVNode as a, createCommentVNode as L, createElementBlock as D, Fragment as T } from "vue";
2
- import { D as C } from "./dayjs.min-CkV4mNm8.js";
3
- import { u as W, a as X, M as ee, w as te } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Cus0YKUt.js";
4
- import { J as oe, F as ne } from "./jszip.min-GxfcHBC5.js";
5
- import { u as q, D as G, A as I, e as H, G as O, B as ae, H as N, I as B } from "./menu-IGORh0Ik.js";
6
- import { useCoreStore as re, useI18n as se } from "@feedmepos/mf-common";
7
- import { useDialog as j, useDialogChild as ie, useSnackbar as J, useBreakpoints as le, FmButtonVariant as $, FmButtonColorThemeVariant as M } from "@feedmepos/ui-library";
8
- import { _ as V } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
9
- import { _ as ue, a as P } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
10
- import { _ as ce } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
11
- import { u as me, a as de } from "./menu-sGVv4bhQ.js";
12
- import { u as pe } from "./item-CVnDeXhJ.js";
13
- import { _ as A, a as fe } from "./Product.vue_vue_type_script_setup_true_lang-Cy4uok1E.js";
14
- import { L as R } from "./LinkProductSideSheet-CTT4oGUY.js";
15
- import { _ as _e } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-y0n5hTLk.js";
16
- import { m as ve } from "./toExcel-WorodvP1.js";
17
- const ge = { class: "space-y-24 mb-24" }, be = ["innerHTML"], ye = { class: "flex justify-end gap-8" }, xe = /* @__PURE__ */ Y({
18
- __name: "ConfirmActionDialog",
19
- props: {
20
- description: {},
21
- value: {},
22
- message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
23
- },
24
- setup(F) {
25
- const t = F, S = g(() => t.message.replace("[[value]]", t.value)), r = z(""), w = j(), { emitAction: x } = ie();
26
- return (p, s) => {
27
- const i = h("FmTextField"), f = h("FmButton"), b = h("FmForm");
28
- return d(), y(b, {
29
- "on-validation-success": () => e(x)("primary"),
30
- "blame-form-child-on-validation-failed": ""
31
- }, {
32
- default: m(() => [
33
- u("div", ge, [
34
- u("div", null, U(p.description), 1),
35
- u("div", { innerHTML: S.value }, null, 8, be),
36
- u("div", null, [
37
- a(i, {
38
- modelValue: r.value,
39
- "onUpdate:modelValue": [
40
- s[0] || (s[0] = (l) => r.value = l),
41
- s[1] || (s[1] = () => {
42
- })
43
- ],
44
- placeholder: p.value,
45
- rules: [(l) => l === p.value || "Value does not match"]
46
- }, null, 8, ["modelValue", "placeholder", "rules"])
47
- ]),
48
- u("div", ye, [
49
- a(f, {
50
- label: "Cancel",
51
- variant: "secondary",
52
- onClick: s[2] || (s[2] = (l) => e(w).close())
53
- }),
54
- a(f, {
55
- label: "Confirm",
56
- type: "submit"
57
- })
58
- ])
59
- ])
60
- ]),
61
- _: 1
62
- }, 8, ["on-validation-success"]);
63
- };
64
- }
65
- }), ke = /* @__PURE__ */ Y({
66
- __name: "Migrate",
67
- setup(F) {
68
- const t = q(), S = re(), r = J(), { minor: w } = G(r), x = z(!1), p = j();
69
- async function s() {
70
- i.value || x.value || p.open({
71
- title: "Migrate to new version",
72
- contentComponent: xe,
73
- contentComponentProps: {
74
- value: "MIGRATE",
75
- description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
76
- }
77
- }).onPrimary(async () => {
78
- p.close(), await w(
79
- async () => {
80
- await t.migrate(), setTimeout(() => {
81
- window.location.reload();
82
- }, 2e3);
83
- },
84
- {
85
- isLoading: x,
86
- customId: t.state.menu._id,
87
- message: "Migrating menu",
88
- successMessage: "Migration completed"
89
- }
90
- );
91
- });
92
- }
93
- const i = g(() => {
94
- const f = S.restaurants.value;
95
- if (!f.length) return "Required at least one restaurant to migrate";
96
- const b = f.filter((k) => !k.posVersion || !I.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: k.posVersion }));
97
- return b.length ? `Upgrade POS to V${I.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${b.map((k) => k.profile.name).join(", ")}` : null;
98
- });
99
- return g(() => i.value ? i.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (f, b) => {
100
- const l = h("FmSnackbar");
101
- return !i.value && e(t).version !== e(O.F_MENU_VERSION).enum.v4 ? (d(), y(l, {
102
- key: 0,
103
- class: "!max-w-full",
104
- title: "New version of menu is out now!",
105
- 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.",
106
- variant: "info",
107
- action: "Migrate",
108
- "z-index": 0,
109
- onOnAction: s
110
- })) : L("", !0);
111
- };
112
- }
113
- }), Me = { class: "flex-1 flex justify-between gap-8 pl-8" }, Se = { class: "flex items-center" }, we = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ce = { class: "fm-typo-en-body-md-600 font-semibold" }, he = { class: "flex gap-8" }, Le = /* @__PURE__ */ Y({
114
- __name: "Products",
115
- setup(F) {
116
- const { t } = se(), S = G(J()), r = q(), w = g(() => r.rules.item), x = pe(), p = g(() => !r.state.currentSchedulerId), s = W(), i = X(), { selectedCategories: f } = me(), b = g(() => ({
117
- ...ae.menuV4ToV3(N(r.state.menu)),
118
- _id: r.state.menu._id,
119
- _rev: r.state.menu._rev
120
- })), l = g(() => {
121
- const c = B.flatten(f.value.map((o) => o.items));
122
- return B.uniqBy(c, (o) => o._id).length;
123
- });
124
- async function k(c, o) {
125
- const _ = new oe();
126
- for (let v = 0; v < c.length; v++) {
127
- const Q = await c[v].xlsx.writeBuffer();
128
- _.file(`${o[v]}.xlsx`, Q);
129
- }
130
- const n = await _.generateAsync({ type: "blob" });
131
- ne.saveAs(n, `books_${C().format("DD-MM-YYYY_HH-mm")}.zip`);
132
- }
133
- async function E() {
134
- await S.minor(
135
- async () => {
136
- if (await r.readMenu(), r.version === O.F_MENU_VERSION.enum.v4) {
137
- const c = N(r.state.menu), o = new ee(c).exportToExcel(), _ = [
138
- `menu_${C().format("DD-MM-YYYY_HH-mm")}`,
139
- `addonGroup_${C().format("DD-MM-YYYY_HH-mm")}`,
140
- `itemLinkedAddon${C().format("DD-MM-YYYY_HH-mm")}`
141
- ];
142
- k(o, _);
143
- } else {
144
- const c = ve(b.value), o = `menu_${C().format("DD-MM-YYYY_HH-mm")}`;
145
- await te(c, `${o}.xlsx`, {
146
- bookType: "xlsx",
147
- bookSST: !1,
148
- type: "array"
149
- });
150
- }
151
- },
152
- { successMessage: "Menu exported", customId: r.state.menu._id }
153
- );
154
- }
155
- const Z = le(), K = g(() => Z.breakpoints.value.xs);
156
- return de().resetOnMount(), (c, o) => {
157
- const _ = h("fm-button");
158
- return d(), y(ce, {
159
- heading: e(t)("menu.products.title")
160
- }, {
161
- default: m(() => [
162
- a(ke),
163
- a(fe)
164
- ]),
165
- "append-heading": m(() => [
166
- u("div", Me, [
167
- u("div", Se, [
168
- u("div", we, [
169
- u("p", Ce, U(l.value), 1)
170
- ])
171
- ]),
172
- u("div", he, [
173
- K.value ? (d(), y(A, { key: 1 }, {
174
- default: m(({ trigger: n }) => [
175
- a(ue, null, {
176
- default: m(() => [
177
- a(P, {
178
- label: e(t)("menu.products.actions.export"),
179
- onClick: E
180
- }, null, 8, ["label"]),
181
- a(P, {
182
- label: e(t)("menu.products.actions.import"),
183
- onClick: n
184
- }, null, 8, ["label", "onClick"])
185
- ]),
186
- _: 2
187
- }, 1024)
188
- ]),
189
- _: 1
190
- })) : (d(), D(T, { key: 0 }, [
191
- a(_e, null, {
192
- default: m(({ trigger: n }) => [
193
- a(_, {
194
- label: e(t)("menu.tree_editor.title"),
195
- "bg-color": e(M).NeutralGray100,
196
- "text-color": e(M).TypoSecondary,
197
- variant: e($).Primary,
198
- onClick: n
199
- }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
200
- ]),
201
- _: 1
202
- }),
203
- a(_, {
204
- "bg-color": e(M).NeutralGray100,
205
- "text-color": e(M).TypoSecondary,
206
- variant: e($).Primary,
207
- label: e(t)("menu.products.actions.export"),
208
- onClick: E
209
- }, null, 8, ["bg-color", "text-color", "variant", "label"]),
210
- a(A, null, {
211
- default: m(({ trigger: n }) => [
212
- a(_, {
213
- "bg-color": e(M).NeutralGray100,
214
- "text-color": e(M).TypoSecondary,
215
- variant: e($).Primary,
216
- label: e(t)("menu.products.actions.import"),
217
- onClick: n
218
- }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
219
- ]),
220
- _: 1
221
- })
222
- ], 64)),
223
- l.value > 0 ? (d(), D(T, { key: 2 }, [
224
- w.value.create ? (d(), y(V, {
225
- key: 0,
226
- label: e(t)("menu.products.actions.add"),
227
- "prepend-icon": "add",
228
- onClick: o[0] || (o[0] = (n) => e(x).create(null))
229
- }, null, 8, ["label"])) : p.value ? (d(), y(R, {
230
- key: 1,
231
- "categorized-items": e(s).linkableItems.value,
232
- "initial-value": e(s).currentItems.value,
233
- "show-variant": !1,
234
- onSubmit: o[1] || (o[1] = (n) => e(s).applyProduct(n.map((v) => v._id)))
235
- }, {
236
- default: m(({ trigger: n }) => [
237
- a(V, {
238
- label: e(t)("menu.products.actions.link"),
239
- "prepend-icon": "link",
240
- onClick: n
241
- }, null, 8, ["label", "onClick"])
242
- ]),
243
- _: 1
244
- }, 8, ["categorized-items", "initial-value"])) : (d(), y(R, {
245
- key: 2,
246
- "categorized-items": e(i).linkableItems.value,
247
- "initial-value": e(i).currentItems.value,
248
- "show-variant": !1,
249
- onSubmit: o[2] || (o[2] = (n) => e(i).applyProduct(n.map((v) => v._id)))
250
- }, {
251
- default: m(({ trigger: n }) => [
252
- a(V, {
253
- label: e(t)("menu.products.actions.apply_scheduler"),
254
- onClick: n
255
- }, null, 8, ["label", "onClick"])
256
- ]),
257
- _: 1
258
- }, 8, ["categorized-items", "initial-value"]))
259
- ], 64)) : L("", !0)
260
- ])
261
- ])
262
- ]),
263
- _: 1
264
- }, 8, ["heading"]);
265
- };
266
- }
267
- });
268
- export {
269
- Le as default
270
- };
@@ -1,258 +0,0 @@
1
- import { defineComponent as ue, computed as p, ref as P, watch as ie, watchEffect as re, resolveComponent as m, createElementBlock as M, openBlock as r, normalizeClass as J, createVNode as s, withCtx as c, createElementVNode as g, createBlock as v, createCommentVNode as f, unref as e, Fragment as $, renderList as H, createTextVNode as me, toDisplayString as N } from "vue";
2
- import { u as ce, D as de, O as pe, G as _, A as ve, H as w } from "./menu-IGORh0Ik.js";
3
- import { useCoreStore as ge, useI18n as fe } from "@feedmepos/mf-common";
4
- import { useSnackbar as _e, useDialog as be, FmButtonVariant as z, FmButtonColorThemeVariant as j, components as ye } from "@feedmepos/ui-library";
5
- import { _ as E } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
6
- import { _ as ke } from "./FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js";
7
- import { _ as q, a as xe } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BmRUg94d.js";
8
- import { C as b, a as x } from "./catalogSetting-_4Z0s3_Q.js";
9
- import { C as G } from "./catalog-DfYSMjLc.js";
10
- const Ce = {
11
- class: /* @__PURE__ */ J(["overflow-scroll", "flex-1", "xs:px-16 xs:py-16"])
12
- }, Oe = {
13
- class: "space-y-32"
14
- }, Se = {
15
- key: 0,
16
- class: "pl-32 space-x-8"
17
- }, Me = {
18
- class: "pl-[60px] space-y-16"
19
- }, Fe = {
20
- class: "space-x-16 flex items-center"
21
- }, Ve = {
22
- class: "flex-1 space-y-4"
23
- }, he = {
24
- class: "fm-typo-en-body-lg-400"
25
- }, Re = {
26
- class: "fm-typo-en-body-md-400"
27
- }, Ue = {
28
- class: "flex justify-end"
29
- }, je = /* @__PURE__ */ ue({
30
- __name: "Setting",
31
- setup(Ne) {
32
- const F = ge(), u = ce(), W = _e(), T = de(W), {
33
- custom: we,
34
- minor: Y
35
- } = T, A = be(), {
36
- t: o
37
- } = fe(), C = p(() => u.currentCatalog);
38
- p(() => new G(C.value, u, I, A));
39
- const y = p(() => !C.value), S = p(() => u.version === _.F_MENU_VERSION.enum.v4), {
40
- checkMenuIsLoading: Ee,
41
- updateMenu: I
42
- } = pe(T), l = P(b.initCatalogSetting()), K = p(() => u.catalogs.filter((t) => t._id !== u.state.currentCatalogId).map((t) => t.name)), Q = p(() => u.state.restaurants.filter((t) => [...t.additionalCatalogs, t.inHouseDelivery, ...t.linkedDeliveryCatalogs.map((n) => n.catalog), t.pickupCatalog, t.takeawayCatalog, t.catalogId].includes(u.state.currentCatalogId)).map((t) => t.name));
43
- function L() {
44
- return Q.value.length > 0 ? s("div", {
45
- class: ["flex items-center", "bg-fm-color-system-warning-100", "rounded-lg", "py-16 px-24 space-x-8"]
46
- }, [s(ye.FmIcon, {
47
- color: "system-warning-300",
48
- name: "warning"
49
- }, null), s("p", {
50
- class: "fm-typo-en-body-lg-400"
51
- }, [o("menu.setting.catalog.warnings.delivery")])]) : null;
52
- }
53
- function D() {
54
- const t = C.value;
55
- l.value = t ? b.fromCatalog(t, S.value) : b.fromMainCatalog(u.state.menu.masterCatalogSetting);
56
- }
57
- ie(() => u.state.currentCatalogId, D), P(!1);
58
- const V = p(() => {
59
- if (!F.currentCountry.value) return [];
60
- const t = l.value.taxSetting.mode === x.MANUAL ? l.value.taxSetting.inclusive ?? [] : [];
61
- return ve.Country.getCountry(F.currentCountry.value).taxSystems.map((i) => {
62
- const d = t.find((O) => O.systemCode === i.code);
63
- return {
64
- inclusive: (d == null ? void 0 : d.inclusive) || !1,
65
- systemCode: i.code
66
- };
67
- });
68
- });
69
- function X(t) {
70
- const n = l.value.taxSetting, i = n.mode === x.AUTO ? b.manualTax(V.value) : w(n);
71
- i.inclusive ?? (i.inclusive = []);
72
- const d = i.inclusive.findIndex((O) => O.systemCode === t.systemCode);
73
- d < 0 ? i.inclusive.push(t) : i.inclusive.splice(d, 1, t), h.value = i;
74
- }
75
- re(async () => {
76
- F.currentBusiness.value && (y.value && !u.state.menu._id || D());
77
- });
78
- const h = p({
79
- get: () => l.value.taxSetting,
80
- set: (t) => {
81
- l.value.taxSetting = t;
82
- }
83
- }), Z = async () => {
84
- const t = b.toCatalog(l.value);
85
- C.value ? await new G({
86
- ...C.value,
87
- ...t
88
- }, u, I, A).update() : await Y(async () => {
89
- await u.updateMainCatalogSetting({
90
- inclusiveTaxes: t.inclusiveTaxes
91
- });
92
- }, {
93
- successMessage: "Main catalog updated",
94
- customId: u.state.menu._id
95
- });
96
- };
97
- function ee(t, n) {
98
- const i = w(l.value);
99
- i.markupOptions && (i.markupOptions[t] = n, l.value = i);
100
- }
101
- function te(t) {
102
- const n = w(l.value);
103
- n.markupOptions && (n.markupOptions.splice(t, 1), l.value = n);
104
- }
105
- return (t, n) => {
106
- const i = m("fm-text-field"), d = m("fm-radio"), O = m("fm-radio-group"), ae = m("fm-checkbox"), B = m("fm-switch"), le = m("fm-select"), R = m("fm-button"), ne = m("fm-chip"), oe = m("fm-card"), se = m("fm-form");
107
- return r(), M("div", Ce, [s(se, {
108
- class: J(["space-y-40 max-w-[751px]", "h-fit"]),
109
- "blame-form-child-on-validation-failed": "",
110
- onValidationSuccess: Z
111
- }, {
112
- default: c(() => [g("div", Oe, [y.value ? f("", !0) : (r(), v(ke, {
113
- key: 0,
114
- title: e(o)("menu.setting.catalog.title")
115
- }, {
116
- default: c(() => [s(i, {
117
- modelValue: l.value.name,
118
- "onUpdate:modelValue": n[0] || (n[0] = (a) => l.value.name = a),
119
- rules: [(a) => !K.value.includes(a.trim()) || e(o)("menu.setting.catalog.fields.name.used"), (a) => !!a.trim() || e(o)("menu.setting.catalog.fields.name.required")],
120
- label: e(o)("menu.setting.catalog.fields.name.label")
121
- }, null, 8, ["modelValue", "rules", "label"]), s(L)]),
122
- _: 1
123
- }, 8, ["title"])), s(E, {
124
- label: e(o)("menu.setting.tax.title")
125
- }, {
126
- default: c(() => [s(O, {
127
- "model-value": l.value.taxSetting.mode,
128
- "onUpdate:modelValue": n[1] || (n[1] = (a) => {
129
- a === e(x).AUTO ? h.value = e(b).autoTax() : h.value = e(b).manualTax(V.value);
130
- })
131
- }, {
132
- default: c(() => [s(d, {
133
- value: e(x).AUTO,
134
- label: e(o)("menu.setting.tax.modes.auto.label"),
135
- sublabel: e(o)("menu.setting.tax.modes.auto.sublabel")
136
- }, null, 8, ["value", "label", "sublabel"]), s(d, {
137
- value: e(x).MANUAL,
138
- label: e(o)("menu.setting.tax.modes.manual.label"),
139
- sublabel: e(o)("menu.setting.tax.modes.manual.sublabel")
140
- }, null, 8, ["value", "label", "sublabel"])]),
141
- _: 1
142
- }, 8, ["model-value"]), l.value.taxSetting.mode === e(x).MANUAL ? (r(), M("div", Se, [(r(!0), M($, null, H(V.value, (a) => (r(), v(ae, {
143
- key: a.systemCode,
144
- "model-value": a.inclusive,
145
- value: !0,
146
- label: a.systemCode + " inclusive",
147
- "onUpdate:modelValue": (k) => {
148
- X({
149
- ...a,
150
- inclusive: k
151
- });
152
- }
153
- }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))])) : f("", !0)]),
154
- _: 1
155
- }, 8, ["label"]), !y.value && S.value ? (r(), v(E, {
156
- key: 1,
157
- label: e(o)("menu.setting.link.title")
158
- }, {
159
- default: c(() => [s(B, {
160
- "model-value": l.value.orderFrom && l.value.orderFrom !== e(_.F_ORDER_FROM).enum.NONE,
161
- label: e(o)("menu.setting.link.auto_link.label"),
162
- "label-placement": "right",
163
- sublabel: e(o)("menu.setting.link.auto_link.sublabel"),
164
- "onUpdate:modelValue": n[2] || (n[2] = (a) => l.value.orderFrom = a ? e(_.F_ORDER_FROM).enum.ALL : e(_.F_ORDER_FROM).enum.NONE)
165
- }, null, 8, ["model-value", "label", "sublabel"]), l.value.orderFrom !== e(_.F_ORDER_FROM).enum.NONE ? (r(), v(le, {
166
- key: 0,
167
- class: "ml-[60px]",
168
- items: [{
169
- label: "Available for all",
170
- value: e(_.F_ORDER_FROM).enum.ALL
171
- }, {
172
- label: "Order on POS only",
173
- value: e(_.F_ORDER_FROM).enum.POS_ONLY
174
- }],
175
- "model-value": l.value.orderFrom,
176
- "onUpdate:modelValue": n[3] || (n[3] = (a) => l.value.orderFrom = a)
177
- }, null, 8, ["items", "model-value"])) : f("", !0)]),
178
- _: 1
179
- }, 8, ["label"])) : f("", !0), !y.value && S.value ? (r(), v(E, {
180
- key: 2,
181
- label: e(o)("menu.setting.markup.title")
182
- }, {
183
- default: c(() => [s(B, {
184
- "model-value": !!l.value.markupOptions,
185
- label: e(o)("menu.setting.markup.auto_markup.label"),
186
- "label-placement": "right",
187
- sublabel: e(o)("menu.setting.markup.auto_markup.sublabel"),
188
- "onUpdate:modelValue": n[4] || (n[4] = (a) => l.value.markupOptions = a ? [] : null)
189
- }, null, 8, ["model-value", "label", "sublabel"]), g("div", Me, [s(q, {
190
- categories: e(u).categories,
191
- items: e(u).items,
192
- action: "add",
193
- "onUpdate:modelValue": n[5] || (n[5] = (a) => l.value.markupOptions = [...l.value.markupOptions ?? [], a])
194
- }, {
195
- default: c(({
196
- trigger: a
197
- }) => [s(R, {
198
- "text-color": e(j).ColorPrimary,
199
- "border-color": e(j).ColorPrimary,
200
- variant: e(z).Secondary,
201
- label: "Add markup configuration",
202
- "prepend-icon": "add",
203
- onClick: a
204
- }, null, 8, ["text-color", "border-color", "variant", "onClick"])]),
205
- _: 1
206
- }, 8, ["categories", "items"]), (r(!0), M($, null, H(l.value.markupOptions, (a, k) => (r(), v(q, {
207
- key: k,
208
- categories: e(u).categories,
209
- items: e(u).items,
210
- "model-value": a,
211
- action: "update",
212
- "onUpdate:modelValue": (U) => ee(k, U)
213
- }, {
214
- default: c(({
215
- trigger: U
216
- }) => [s(oe, {
217
- id: JSON.stringify(a),
218
- class: "py-12 px-16 cursor-pointer",
219
- variant: "outlined",
220
- onClick: U
221
- }, {
222
- default: c(() => [g("div", Fe, [g("div", Ve, [s(ne, {
223
- class: "text-fm-color-typo-info bg-fm-color-system-info-100 font-semibold"
224
- }, {
225
- default: c(() => [me(" Markup percentage: " + N(a.percentage) + "% ", 1)]),
226
- _: 2
227
- }, 1024), g("p", he, N(e(o)("menu.setting.markup.config", {
228
- number: k + 1
229
- })), 1), g("p", Re, N(a.includeItems ? e(o)("menu.setting.markup.products.linked", {
230
- count: a.includeItems.length
231
- }) : e(o)("menu.setting.markup.products.all")), 1)]), s(R, {
232
- variant: e(z).Tertiary,
233
- "prepend-icon": "delete",
234
- onClick: (Te) => te(k)
235
- }, null, 8, ["variant", "onClick"])])]),
236
- _: 2
237
- }, 1032, ["id", "onClick"])]),
238
- _: 2
239
- }, 1032, ["categories", "items", "model-value", "onUpdate:modelValue"]))), 128))])]),
240
- _: 1
241
- }, 8, ["label"])) : f("", !0), !y.value && S.value ? (r(), v(xe, {
242
- key: 3,
243
- "model-value": l.value.usePriceTiers,
244
- "onUpdate:modelValue": n[6] || (n[6] = (a) => l.value.usePriceTiers = a)
245
- }, null, 8, ["model-value"])) : f("", !0), y.value ? (r(), v(L, {
246
- key: 4
247
- })) : f("", !0)]), g("div", Ue, [s(R, {
248
- label: e(o)("common.save"),
249
- type: "submit"
250
- }, null, 8, ["label"])])]),
251
- _: 1
252
- })]);
253
- };
254
- }
255
- });
256
- export {
257
- je as default
258
- };
@@ -1,71 +0,0 @@
1
- import { defineComponent as w, ref as m, computed as r, resolveComponent as d, createElementBlock as h, openBlock as n, normalizeClass as a, createVNode as z, normalizeStyle as x, withCtx as k, createBlock as f, createCommentVNode as b } from "vue";
2
- import { useI18n as C } from "@feedmepos/mf-common";
3
- const $ = ["alt", "src", "crossorigin"], E = /* @__PURE__ */ w({
4
- __name: "Thumbnail",
5
- props: {
6
- src: {},
7
- alt: {},
8
- className: {},
9
- size: {},
10
- crossorigin: { type: Boolean, default: !0 }
11
- },
12
- setup(p) {
13
- const e = p, { t: l } = C(), o = m(!1), t = m(!e.src), _ = () => {
14
- o.value = !1, t.value = !0;
15
- }, v = () => {
16
- o.value = !0, t.value = !0;
17
- }, g = r(() => e.alt ? l("menu.thumbnail.alt.with_name", { name: e.alt }) : l("menu.thumbnail.alt.default")), i = r(() => typeof e.size == "number" ? {
18
- width: e.size,
19
- height: e.size
20
- } : {
21
- width: e.size.width,
22
- height: e.size.height
23
- }), c = r(() => {
24
- if (!e.src) return null;
25
- if (e.crossorigin) {
26
- const s = e.src.includes("?") ? "&" : "?";
27
- return `${e.src}${s}_cors=${Date.now()}`;
28
- }
29
- return e.src;
30
- });
31
- return (s, B) => {
32
- const u = d("fm-icon"), y = d("fm-card");
33
- return n(), h("div", {
34
- class: a([s.className, "flex items-center justify-center"])
35
- }, [
36
- z(y, {
37
- class: a(["flex items-center justify-center", "rounded-md"]),
38
- style: x({ width: `${i.value.width}px`, height: `${i.value.height}px` }),
39
- variant: "outlined"
40
- }, {
41
- default: k(() => [
42
- c.value && !o.value ? (n(), h("img", {
43
- key: 0,
44
- alt: g.value,
45
- class: a(["w-full h-full", "object-cover", t.value ? "" : "hidden"]),
46
- src: c.value,
47
- crossorigin: e.crossorigin ? "anonymous" : void 0,
48
- onError: v,
49
- onLoad: _
50
- }, null, 42, $)) : (n(), f(u, {
51
- key: 1,
52
- color: "neutral-gray-300",
53
- name: "image",
54
- outline: ""
55
- })),
56
- t.value ? b("", !0) : (n(), f(u, {
57
- key: 2,
58
- class: "animate-spin",
59
- name: "progress_activity",
60
- spin: ""
61
- }))
62
- ]),
63
- _: 1
64
- }, 8, ["style"])
65
- ], 2);
66
- };
67
- }
68
- });
69
- export {
70
- E as _
71
- };