@feedmepos/mf-menu 0.32.42-dev.3 → 0.32.43-dev.1

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 (67) hide show
  1. package/dist/{App-1oMjfIcc.js → App-CiqMdAvF.js} +5 -5
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-AIw0Zgzf.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CVs7MfmX.js} +3 -3
  3. package/dist/{Catalog-CvQo24ck.js → Catalog-KzftKfOt.js} +6 -6
  4. package/dist/{Category-DmIaxrrK.js → Category-em6K5yk3.js} +5 -5
  5. package/dist/{Category-C8bM8EwO.js → Category-pNQdkIvn.js} +4 -4
  6. package/dist/{CookingGuide-CKEbyk4o.js → CookingGuide-Bp9CvTAi.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Ci4gwgnH.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BbsxEs6O.js} +1 -1
  8. package/dist/{Group-CoYyRvcx.js → Group-eE_snSRq.js} +1 -1
  9. package/dist/{Group-EnJDk54z.js → Group-mIwdwq58.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-tH2U82rV.js → Group.vue_vue_type_script_setup_true_lang-C5l4ycJB.js} +8 -8
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BDxjuWcY.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B4PznWDZ.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-gVXNoAaN.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-eS8pMvVG.js} +210 -210
  13. package/dist/{Ingredient-7PPPp7Yf.js → Ingredient-BNvYYdb5.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DQPjpqtv.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CzQIddna.js} +2 -2
  15. package/dist/{LinkProductSideSheet-BS-MEIOG.js → LinkProductSideSheet-BQQtUuCr.js} +3 -3
  16. package/dist/{MenuSetting-BNVyT0oG.js → MenuSetting-s9syqMsT.js} +5 -5
  17. package/dist/{PrintRoute-BMdk0zDv.js → PrintRoute-BqMxtnus.js} +4 -4
  18. package/dist/{Product-DbIK7Eog.js → Product-CHhpb-2E.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-FnX_M8lJ.js → Product.vue_vue_type_script_setup_true_lang-DHny0uGc.js} +13 -13
  20. package/dist/{ProductInternalTools-BC8jWpQd.js → ProductInternalTools-DEB8Xhnv.js} +5 -5
  21. package/dist/{Products-CPi2vuUO.js → Products-C7UtJMGZ.js} +34 -34
  22. package/dist/{Publish-BcxHXZ1J.js → Publish-tnJY6n8r.js} +3 -3
  23. package/dist/{Recipe-egyxyFfA.js → Recipe-DDPXv3AU.js} +4 -4
  24. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CP1NjxzF.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-PFRwBb1c.js} +1 -1
  25. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CPMCeAK9.js → RuleView.vue_vue_type_script_setup_true_lang-roEHTZnU.js} +2 -2
  26. package/dist/{Scheduler-Cb-IJtj8.js → Scheduler-CMKwUkNN.js} +3 -3
  27. package/dist/{ServingSequence-B46n34xA.js → ServingSequence-NA0yeDMF.js} +3 -3
  28. package/dist/{Setting-B_dZG5ZC.js → Setting-BRfi_hxY.js} +5 -5
  29. package/dist/{Subcategory-DbjLfXvf.js → Subcategory-W9faZY7n.js} +6 -6
  30. package/dist/{Takeaway-DNu6jYFC.js → Takeaway-5DKxdpZ3.js} +1 -1
  31. package/dist/{Takeaway-D4axornr.js → Takeaway-fijUedLA.js} +4 -4
  32. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BhiFnON_.js +324 -0
  33. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-BjPOOURv.js → Thumbnail.vue_vue_type_script_setup_true_lang-BUNPf1OD.js} +4 -4
  34. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-CXGsdChM.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-DZp38dX4.js} +68 -66
  35. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C9eskCL4.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DC4naR16.js} +13 -13
  36. package/dist/{Unit-jV5Bee8E.js → Unit-582FVjPq.js} +2 -2
  37. package/dist/{Variant-jGcgA-W8.js → Variant-Cb02SmoL.js} +4 -4
  38. package/dist/{_id_-CtvQ64EN.js → _id_-BYU1xwzB.js} +9 -9
  39. package/dist/{app-B6laFmet.js → app-0m01R0SM.js} +31 -31
  40. package/dist/{app-eq7TaFfk.js → app-CcPyLfvj.js} +1 -1
  41. package/dist/app.js +1 -1
  42. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/assets/{linked-status-Db18QnYH.js → linked-status-C1DHqpkR.js} +2 -2
  44. package/dist/assets/{menu-export-24uzPEwW.js → menu-export-Ci-MXpn1.js} +2 -2
  45. package/dist/assets/{override-menu-DreGPEa-.js → override-menu-CajXgOdO.js} +2 -2
  46. package/dist/assets/{validate-menu-BSFHH8O3.js → validate-menu-DDPswAia.js} +2 -2
  47. package/dist/{catalog-CXcQ-QmP.js → catalog-Bs3SNL7n.js} +1 -1
  48. package/dist/{catalogSetting-DnUHD0I1.js → catalogSetting-BN4d_FvT.js} +1 -1
  49. package/dist/{currency-CwtLEvAZ.js → currency-Cma3AX0v.js} +1 -1
  50. package/dist/{dayjs.min-BgQgGKeN.js → dayjs.min-D-HR3H5W.js} +2 -2
  51. package/dist/{index-Cx1Nqii7.js → index-3wsuY29D.js} +6 -6
  52. package/dist/index-DXY5zcNA.js +545 -0
  53. package/dist/{index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js → index.vue_vue_type_script_setup_true_lang-DotsunNI.js} +5 -5
  54. package/dist/{item-CKRLnCIs.js → item-DOcT7NVT.js} +2587 -2587
  55. package/dist/{jszip.min-DOHC0a7i.js → jszip.min-h2cXUF_-.js} +3 -3
  56. package/dist/{menu-BduvULfe.js → menu-CAmS3pcT.js} +1 -1
  57. package/dist/{menuV2-Da1zBhkS.js → menuV2-COwLB3e1.js} +79 -79
  58. package/dist/packages/shared/src/helpers/actionButton.d.ts +2 -2
  59. package/dist/{priceTier-tObdSj6z.js → priceTier-DrrQcFCh.js} +1 -1
  60. package/dist/{rules-DD816lrT.js → rules-DGRdKiV6.js} +4 -4
  61. package/dist/{scheduler-CDhxmmVX.js → scheduler-BpEV0N8K.js} +4 -4
  62. package/dist/{toExcel-tz6MIiQY.js → toExcel-eN1zgiqN.js} +2 -2
  63. package/dist/{translation-Cdap0IVg.js → translation-BCZ1Ruvv.js} +35 -21
  64. package/dist/{unit-NGl3h7Qh.js → unit-BAcozp9s.js} +2 -2
  65. package/package.json +2 -2
  66. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-Dvm8Lfp3.js +0 -316
  67. package/dist/index-D-Saeea8.js +0 -545
@@ -2,17 +2,17 @@ import { defineComponent as A, ref as x, computed as V, watch as te, resolveComp
2
2
  import { useI18n as R } from "@feedmepos/mf-common";
3
3
  import { useSnackbar as P, components as W, useDialog as X, FmButtonVariant as G, useBreakpoints as se, FmButtonColorThemeVariant as ie } from "@feedmepos/ui-library";
4
4
  import { _ as re } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
- import { B as Y, u as J, O as K, J as Z, y as ee, a2 as ce } from "./index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js";
5
+ import { B as Y, u as J, O as K, J as Z, y as ee, a2 as ce } from "./index.vue_vue_type_script_setup_true_lang-DotsunNI.js";
6
6
  import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as me } from "./app-B6laFmet.js";
7
+ import { _ as me } from "./app-0m01R0SM.js";
8
8
  import { c as de } from "./createForm-BoUQeZTd.js";
9
9
  import { u as pe } from "./discardConfirm-BHni0LNu.js";
10
10
  import { c as H } from "./object-DVUNCr7w.js";
11
- import { r as _e, u as ae } from "./rules-DD816lrT.js";
12
- import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-CXGsdChM.js";
11
+ import { r as _e, u as ae } from "./rules-DGRdKiV6.js";
12
+ import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-DZp38dX4.js";
13
13
  import { c as ve } from "./check-C9mY6LiX.js";
14
- import { g as z } from "./translation-Cdap0IVg.js";
15
- import { a as ge } from "./menu-BduvULfe.js";
14
+ import { g as z } from "./translation-BCZ1Ruvv.js";
15
+ import { a as ge } from "./menu-CAmS3pcT.js";
16
16
  const ye = {
17
17
  class: "fm-typo-en-title-md-600"
18
18
  }, be = {
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-Dvm8Lfp3.js";
1
+ import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-BhiFnON_.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as f, computed as y, ref as k, createBlock as i, openBlock as d, unref as a, withCtx as s, createElementVNode as t, toDisplayString as b, createCommentVNode as g, createVNode as m } from "vue";
2
- import { B as x, u as v, O as w, J as E, y as M } from "./index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js";
2
+ import { B as x, u as v, O as w, J as E, y as M } from "./index.vue_vue_type_script_setup_true_lang-DotsunNI.js";
3
3
  import { useI18n as T } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as V } from "@feedmepos/ui-library";
5
5
  import { _ as h } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
6
  import { _ as C } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-Dvm8Lfp3.js";
8
- import { T as O, l as S } from "./index-Cx1Nqii7.js";
9
- import { a as B } from "./menu-BduvULfe.js";
7
+ import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-BhiFnON_.js";
8
+ import { T as O, l as S } from "./index-3wsuY29D.js";
9
+ import { a as B } from "./menu-CAmS3pcT.js";
10
10
  const L = { class: "flex-1 flex justify-between gap-8 pl-8" }, U = { class: "flex items-center" }, F = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, D = { class: "fm-typo-en-body-md-600 font-semibold" }, G = /* @__PURE__ */ f({
11
11
  __name: "Takeaway",
12
12
  setup(I) {
@@ -0,0 +1,324 @@
1
+ import { getCurrentInstance as te, defineComponent as ne, computed as T, watch as oe, h as M, resolveComponent as O, createElementBlock as V, openBlock as w, Fragment as L, normalizeClass as D, createElementVNode as g, createVNode as I, unref as i, isRef as j, withCtx as P, renderList as ie, createBlock as G, createCommentVNode as $, toDisplayString as B, withModifiers as q } from "vue";
2
+ import { B as H, u as Q, O as W, J as z, y as N, G as Y, z as se, am as J, a2 as re } from "./index.vue_vue_type_script_setup_true_lang-DotsunNI.js";
3
+ import { useI18n as X, useCoreStore as le } from "@feedmepos/mf-common";
4
+ import { useDialog as ce, useSnackbar as Z, FmButtonVariant as A, components as de, useBreakpoints as me } from "@feedmepos/ui-library";
5
+ import { _ as ue } from "./app-0m01R0SM.js";
6
+ import { a as ye, l as ee, T as pe } from "./index-3wsuY29D.js";
7
+ import { u as fe } from "./search-BAPEUu1R.js";
8
+ import { f as F } from "./currency-Cma3AX0v.js";
9
+ import { defineStore as _e } from "pinia";
10
+ import { C as ke } from "./catalog-Bs3SNL7n.js";
11
+ import { c as ve } from "./createComponentProgrammatically-Bt2rn1IQ.js";
12
+ import { g as we } from "./translation-BCZ1Ruvv.js";
13
+ function ge(b, _, l, m) {
14
+ var y, p, k;
15
+ if (m >= 0) {
16
+ const u = (y = b.override.items[_._id][m]) == null ? void 0 : y.takeawayUsed;
17
+ return u == null ? void 0 : Y(u);
18
+ }
19
+ const e = l.find((u) => u._id === _._id);
20
+ return _.combinationKey ? ((k = (p = e == null ? void 0 : e.variant) == null ? void 0 : p.variantCombinations.find((u) => u.combinationKey === _.combinationKey)) == null ? void 0 : k.takeawayUsed) ?? (e == null ? void 0 : e.takeawayUsed) : e == null ? void 0 : e.takeawayUsed;
21
+ }
22
+ function be(b, _, l, m) {
23
+ var k, u;
24
+ const e = Y(b);
25
+ e.override.takeaway[l._id] = { price: l.price || void 0 };
26
+ const y = [...l.usedBy, ..._.usedBy];
27
+ for (const o of y) {
28
+ const c = l.usedBy.some(
29
+ (s) => s._id === o._id && s.combinationKey === o.combinationKey
30
+ ) ? l._id : "", a = (e.override.items[o._id] || []).findIndex(
31
+ (s) => s.combinationKey === o.combinationKey
32
+ ), d = ge(e, o, m, a);
33
+ if (a >= 0)
34
+ e.override.items[o._id][a].takeawayUsed = c;
35
+ else if (d !== c) {
36
+ const s = {
37
+ _id: o._id,
38
+ combinationKey: o.combinationKey,
39
+ takeawayUsed: c
40
+ };
41
+ e.override.items[o._id] = [...e.override.items[o._id] || [], s];
42
+ }
43
+ }
44
+ const p = [...new Set(y.map((o) => o._id))];
45
+ for (const o of p) {
46
+ const v = m.find((d) => d._id === o);
47
+ if (!((u = (k = v == null ? void 0 : v.variant) == null ? void 0 : k.variantCombinations) != null && u.length)) continue;
48
+ const c = (e.override.items[o] || []).findIndex(
49
+ (d) => !d.combinationKey
50
+ );
51
+ if (c < 0) continue;
52
+ l.usedBy.some((d) => d._id === o) || (e.override.items[o][c].takeawayUsed = "");
53
+ }
54
+ return e;
55
+ }
56
+ const he = _e("takeaway-manager", () => {
57
+ const b = ce(), _ = Z(), l = H(_), m = W(l), e = Q(), y = te(), { t: p } = X(), k = (a) => {
58
+ var s, h;
59
+ const { vNode: d } = ve(
60
+ ye,
61
+ y,
62
+ a
63
+ );
64
+ (h = (s = d.component) == null ? void 0 : s.exposed) == null || h.trigger();
65
+ };
66
+ async function u(a) {
67
+ var h, E;
68
+ const s = ((E = (h = e.currentCatalog) == null ? void 0 : h.override.takeaway[a._id]) == null ? void 0 : E.price) ? null : e.state.menu.modules.takeaway.find((x) => x._id === a._id);
69
+ k({
70
+ initialValue: a,
71
+ applyProduct: !0,
72
+ bindToVariant: e.rules.item.bindToVariant,
73
+ fallback: s,
74
+ action: "update",
75
+ "onUpdate:takeaway": async (x) => {
76
+ let n = Y(e.currentCatalog);
77
+ x.price ? n.override.takeaway[a._id] = { price: x.price } : delete n.override.takeaway[a._id], n = be(n, a, x, e.state.menu.modules.item), await new ke(n, e, m.updateMenu, b).update();
78
+ }
79
+ });
80
+ }
81
+ async function o(a) {
82
+ k({
83
+ initialValue: a,
84
+ bindToVariant: e.rules.item.bindToVariant,
85
+ applyProduct: !0,
86
+ action: "update",
87
+ "onUpdate:takeaway": async (d) => {
88
+ await m.updateMenu(
89
+ {
90
+ module: N.F_MENU_MODULE_V4_KEY.enum.takeaway,
91
+ operation: z.F_OPERATION_TYPE.update,
92
+ data: d,
93
+ link: ee(d.usedBy || [])
94
+ },
95
+ d.name
96
+ );
97
+ }
98
+ });
99
+ }
100
+ async function v(a) {
101
+ e.currentCatalog ? await u(a) : await o(a);
102
+ }
103
+ async function c(a) {
104
+ b.open({
105
+ title: p("menu.common.dialog.remove.takeaway.title"),
106
+ message: p("menu.common.dialog.remove.takeaway.message", { name: a.name }),
107
+ primaryActions: {
108
+ text: p("menu.common.actions.remove"),
109
+ close: !0,
110
+ variant: A.Destructive
111
+ },
112
+ secondaryActions: {
113
+ text: p("menu.common.actions.cancel"),
114
+ close: !0
115
+ }
116
+ }).onPrimary(async () => {
117
+ await m.updateMenu(
118
+ {
119
+ module: N.F_MENU_MODULE_V4_KEY.enum.takeaway,
120
+ operation: z.F_OPERATION_TYPE.delete,
121
+ data: a._id
122
+ },
123
+ a.name,
124
+ !0
125
+ );
126
+ });
127
+ }
128
+ return {
129
+ deleteTakeaway: c,
130
+ updateTakeaway: v
131
+ };
132
+ }), xe = {
133
+ key: 0,
134
+ class: /* @__PURE__ */ D(["flex-1 overflow-hidden", "space-y-16", "flex flex-col", "overflow-hidden", "pt-16"])
135
+ }, Ce = {
136
+ class: "flex items-center space-x-8 justify-end"
137
+ }, Te = {
138
+ class: "w-[320px]"
139
+ }, Ve = {
140
+ class: "px-16 pt-8"
141
+ }, Ie = {
142
+ class: /* @__PURE__ */ D(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100"])
143
+ }, Ue = ["onClick"], Me = {
144
+ class: "flex-1"
145
+ }, Ee = {
146
+ class: "fm-typo-en-body-lg-600 mb-4"
147
+ }, Ke = {
148
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
149
+ }, Se = {
150
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
151
+ }, Be = {
152
+ key: 1,
153
+ class: "xs:pt-24"
154
+ }, $e = /* @__PURE__ */ ne({
155
+ __name: "Takeaway",
156
+ emits: ["update:count"],
157
+ setup(b, {
158
+ emit: _
159
+ }) {
160
+ const l = Q(), m = he(), e = T(() => l.rules.item.bindToVariant), y = T(() => l.rules.takeaway), p = W(H(Z())), k = le(), u = T(() => se.Country.getCountry(k.currentCountry.value).currency), o = T(() => l.takeaways.map((n) => ({
161
+ ...n,
162
+ usedBy: l.items.reduce((r, f) => {
163
+ var t, K, R;
164
+ const C = f.takeawayUsed === n._id;
165
+ if ((!e.value || !((K = (t = f.variant) == null ? void 0 : t.variantGroupIds) != null && K.length)) && C)
166
+ r.push({
167
+ _id: f._id
168
+ });
169
+ else {
170
+ const ae = (((R = f.variant) == null ? void 0 : R.variantCombinations) || []).filter((S) => S.takeawayUsed === n._id || S.takeawayUsed == null && C).map((S) => ({
171
+ _id: f._id,
172
+ combinationKey: S.combinationKey
173
+ }));
174
+ r = [...r, ...ae];
175
+ }
176
+ return r;
177
+ }, [])
178
+ }))), {
179
+ filter: v,
180
+ searchKey: c
181
+ } = fe(), a = T(() => o.value.filter((n) => v([n.name, F(n.price, !1)]))), d = _;
182
+ oe(() => a.value.length, (n) => {
183
+ d("update:count", n);
184
+ }, {
185
+ immediate: !0
186
+ });
187
+ const {
188
+ t: s
189
+ } = X(), h = T(() => [{
190
+ accessorKey: "name",
191
+ header: () => s("menu.takeaway.table.columns.name"),
192
+ enableSorting: !1,
193
+ size: 700,
194
+ cell: (n) => {
195
+ const r = n.row.original, f = n.getValue(), U = Object.keys(r.name_locale ?? {}).map((t) => we(t));
196
+ return M("div", {
197
+ class: "flex items-center gap-8"
198
+ }, [M("span", {
199
+ class: "break-all"
200
+ }, f), ...U.map((t) => M("div", {
201
+ class: "rounded-lg border border-fm-color-primary text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600 px-8"
202
+ }, t))]);
203
+ }
204
+ }, {
205
+ accessorKey: "price",
206
+ header: () => s("menu.takeaway.table.columns.price", {
207
+ symbol: u.value.symbol
208
+ }),
209
+ enableSorting: !1,
210
+ size: 200,
211
+ meta: {
212
+ textAlign: "right"
213
+ },
214
+ cell: (n) => {
215
+ const r = n.getValue();
216
+ return F(r, !1);
217
+ }
218
+ }, {
219
+ accessorKey: "usedBy",
220
+ header: () => s("menu.takeaway.table.columns.products"),
221
+ enableSorting: !1,
222
+ size: 200,
223
+ cell: (n) => {
224
+ const r = n.getValue(), f = J(l.categorizedItems, r).flatMap((C) => C.items).length ?? 0;
225
+ return s("menu.takeaway.table.items_linked", {
226
+ count: f
227
+ });
228
+ }
229
+ }, {
230
+ id: "action",
231
+ size: 52,
232
+ meta: {
233
+ cellClass: "pl-16",
234
+ headerContentClass: "-mx-16"
235
+ },
236
+ cell: (n) => M("div", {
237
+ class: "flex justify-end items-center"
238
+ }, [y.value.delete ? M(de.FmButton, {
239
+ prependIcon: "delete",
240
+ variant: A.Tertiary,
241
+ textColor: "neutral-gray-400",
242
+ onClick: (r) => {
243
+ r.stopPropagation(), m.deleteTakeaway(n.row.original);
244
+ }
245
+ }) : null])
246
+ }]), E = me(), x = T(() => E.breakpoints.value.xs);
247
+ return (n, r) => {
248
+ const f = O("fm-search"), C = O("fm-table"), U = O("fm-button");
249
+ return o.value.length ? (w(), V(L, {
250
+ key: 0
251
+ }, [x.value ? (w(), V(L, {
252
+ key: 1
253
+ }, [g("div", Ve, [I(f, {
254
+ class: "w-full",
255
+ autofocus: "",
256
+ modelValue: i(c),
257
+ "onUpdate:modelValue": r[2] || (r[2] = (t) => j(c) ? c.value = t : null),
258
+ placeholder: i(s)("menu.takeaway.table.search.placeholder")
259
+ }, null, 8, ["modelValue", "placeholder"])]), g("div", Ie, [(w(!0), V(L, null, ie(a.value, (t) => (w(), V("div", {
260
+ key: t._id,
261
+ class: D(["py-12 px-16", "flex space-x-8", "items-center"]),
262
+ onClick: () => {
263
+ y.value.edit && i(m).updateTakeaway(t);
264
+ }
265
+ }, [g("div", Me, [g("p", Ee, B(t.name), 1), g("p", Ke, B(`${i(J)(i(l).categorizedItems, t.usedBy).flatMap((K) => K.items).length ?? 0} items linked`), 1), g("p", Se, " Price: " + B(u.value.symbol) + B(i(F)(t.price, !1)), 1)]), y.value.delete ? (w(), G(U, {
266
+ key: 0,
267
+ variant: i(A).Tertiary,
268
+ "text-color": "neutral-gray-400",
269
+ "prepend-icon": "delete",
270
+ onClick: q(() => i(m).deleteTakeaway(t), ["stop"])
271
+ }, null, 8, ["variant", "onClick"])) : $("", !0)], 8, Ue))), 128))])], 64)) : (w(), V("div", xe, [g("div", Ce, [g("div", Te, [I(f, {
272
+ autofocus: "",
273
+ modelValue: i(c),
274
+ "onUpdate:modelValue": r[0] || (r[0] = (t) => j(c) ? c.value = t : null),
275
+ placeholder: i(s)("menu.takeaway.table.search.placeholder")
276
+ }, null, 8, ["modelValue", "placeholder"])])]), I(ue, null, {
277
+ default: P(() => [I(C, {
278
+ "column-defs": h.value,
279
+ loading: i(p).checkMenuIsLoading(),
280
+ "page-size": a.value.length,
281
+ "row-data": a.value,
282
+ "search-value": i(c),
283
+ "shrink-at": !1,
284
+ class: "flex-1 overflow-hidden",
285
+ "hide-footer": "",
286
+ "pin-header-row": "",
287
+ onRowClick: r[1] || (r[1] = (t) => {
288
+ y.value.edit && i(m).updateTakeaway(t.original);
289
+ })
290
+ }, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
291
+ _: 1
292
+ })]))], 64)) : (w(), V("div", Be, [I(i(re), {
293
+ subtitle: i(s)("menu.takeaway.empty.subtitle"),
294
+ title: i(s)("menu.takeaway.empty.title")
295
+ }, {
296
+ action: P(() => [y.value.create ? (w(), G(i(pe), {
297
+ key: 0,
298
+ "bind-to-variant": e.value,
299
+ action: "add",
300
+ "apply-product": "",
301
+ "onUpdate:takeaway": r[3] || (r[3] = (t) => i(p).updateMenu({
302
+ module: i(N.F_MENU_MODULE_V4_KEY).enum.takeaway,
303
+ operation: i(z.F_OPERATION_TYPE).create,
304
+ data: t,
305
+ link: i(ee)(t.usedBy || [])
306
+ }, t.name))
307
+ }, {
308
+ default: P(({
309
+ trigger: t
310
+ }) => [I(U, {
311
+ "prepend-icon": "add",
312
+ label: i(s)("menu.takeaway.empty.action"),
313
+ onClick: q(t, ["stop"])
314
+ }, null, 8, ["label", "onClick"])]),
315
+ _: 1
316
+ }, 8, ["bind-to-variant"])) : $("", !0)]),
317
+ _: 1
318
+ }, 8, ["subtitle", "title"])]));
319
+ };
320
+ }
321
+ });
322
+ export {
323
+ $e as _
324
+ };
@@ -1,9 +1,9 @@
1
1
  import { computed as d, defineComponent as x, ref as F, resolveComponent as b, createElementBlock as L, openBlock as w, normalizeClass as O, createVNode as K, normalizeStyle as B, withCtx as $, createBlock as U, createCommentVNode as j } from "vue";
2
- import { y as h, J as E, B as R, O as C, ai as z, u as y, c as J } from "./index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js";
3
- import { u as S } from "./menuV2-Da1zBhkS.js";
4
- import { C as v, h as N } from "./catalog-CXcQ-QmP.js";
2
+ import { y as h, J as E, B as R, O as C, ai as z, u as y, c as J } from "./index.vue_vue_type_script_setup_true_lang-DotsunNI.js";
3
+ import { u as S } from "./menuV2-COwLB3e1.js";
4
+ import { C as v, h as N } from "./catalog-Bs3SNL7n.js";
5
5
  import { useSnackbar as P, useDialog as A } from "@feedmepos/ui-library";
6
- import { a as T } from "./LinkProductSideSheet-BS-MEIOG.js";
6
+ import { a as T } from "./LinkProductSideSheet-BQQtUuCr.js";
7
7
  import { useI18n as q } from "@feedmepos/mf-common";
8
8
  function G() {
9
9
  const t = S(), o = d(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), i = d(() => {
@@ -1,12 +1,12 @@
1
- import { defineComponent as K, ref as y, watch as E, computed as F, unref as a, resolveComponent as _, createBlock as T, openBlock as i, withCtx as v, createElementVNode as t, toDisplayString as m, createElementBlock as p, createCommentVNode as B, Fragment as x, renderList as C, createVNode as r } from "vue";
2
- import { H as D } from "./index.vue_vue_type_script_setup_true_lang-CA1qH7Vf.js";
3
- import { useI18n as P, useLocale as Q } from "@feedmepos/mf-common";
4
- import { u as R } from "./discardConfirm-BHni0LNu.js";
5
- import { g as V, a as I, _ as W, b as X } from "./translation-Cdap0IVg.js";
6
- const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }, ee = { class: "flex flex-col gap-8" }, oe = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, le = { class: "flex items-center gap-8 flex-wrap" }, te = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, ae = { class: "fm-typo-en-body-md-600" }, ne = ["onClick"], se = { class: "flex items-center gap-8" }, ce = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, me = { class: "fm-typo-en-body-md-400" }, ie = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, re = { class: "fm-typo-en-body-lg-600" }, ue = { class: "flex flex-col gap-32 pl-32" }, pe = {
1
+ import { defineComponent as J, ref as h, watch as O, computed as j, resolveComponent as _, createBlock as T, openBlock as d, unref as a, withCtx as v, createElementVNode as t, toDisplayString as m, createElementBlock as p, createCommentVNode as F, Fragment as x, renderList as C, createVNode as r } from "vue";
2
+ import { H as I } from "./index.vue_vue_type_script_setup_true_lang-DotsunNI.js";
3
+ import { useI18n as K, ALL_LOCALE_OPTIONS as y } from "@feedmepos/mf-common";
4
+ import { u as Q } from "./discardConfirm-BHni0LNu.js";
5
+ import { g as V, a as S, _ as R, b as W } from "./translation-BCZ1Ruvv.js";
6
+ const X = { class: "fm-typo-en-title-md-600" }, Y = { class: "pt-8 space-y-24" }, Z = { class: "flex flex-col gap-8" }, ee = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, oe = { class: "flex items-center gap-8 flex-wrap" }, le = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, te = { class: "fm-typo-en-body-md-600" }, ae = ["onClick"], ne = { class: "flex items-center gap-8" }, se = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, ce = { class: "fm-typo-en-body-md-400" }, me = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, ie = { class: "fm-typo-en-body-lg-600" }, re = { class: "flex flex-col gap-32 pl-32" }, ue = {
7
7
  key: 0,
8
8
  class: "space-y-8"
9
- }, fe = { class: "flex w-[100px] items-center gap-8" }, _e = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, ve = { class: "fm-typo-en-body-md-400" }, he = { class: "flex-1" }, ye = { class: "flex gap-8 items-center justify-start" }, ke = /* @__PURE__ */ K({
9
+ }, pe = { class: "flex w-[100px] items-center gap-8" }, fe = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, _e = { class: "fm-typo-en-body-md-400" }, ve = { class: "flex-1" }, he = { class: "flex gap-8 items-center justify-start" }, Ve = /* @__PURE__ */ J({
10
10
  __name: "TranslationSideSheet",
11
11
  props: {
12
12
  modelValue: { type: Boolean },
@@ -15,47 +15,49 @@ const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }
15
15
  nameLocale: {}
16
16
  },
17
17
  emits: ["update:modelValue", "update:name", "update:nameLocale"],
18
- setup(O, { emit: S }) {
19
- const s = O, f = S, { t: d } = P(), { localeList: h } = Q(), c = y([]), k = y([]), u = y(s.name), L = y(s.name);
20
- E(
18
+ setup(A, { emit: B }) {
19
+ const s = A, f = B, { t: i } = K(), c = h([]), k = h([]), u = h(s.name), L = h(s.name);
20
+ O(
21
21
  () => s.name,
22
22
  (e) => {
23
23
  u.value = e;
24
24
  }
25
25
  );
26
- function U() {
26
+ function D() {
27
27
  return !s.nameLocale || Object.keys(s.nameLocale).length === 0 ? [] : Object.entries(s.nameLocale).map(([e, o]) => ({
28
28
  localeCode: e,
29
29
  value: o
30
30
  }));
31
31
  }
32
- E(
32
+ O(
33
33
  () => [s.modelValue, s.nameLocale],
34
34
  ([e]) => {
35
- e && (c.value = U(), k.value = D.clone(c.value), u.value = s.name, L.value = s.name);
35
+ e && (c.value = D(), k.value = I.clone(c.value), u.value = s.name, L.value = s.name);
36
36
  },
37
37
  { immediate: !0 }
38
38
  );
39
- const w = F(() => {
39
+ const w = j(() => {
40
40
  const e = new Set(c.value.map((n) => n.localeCode));
41
- return a(h).filter((n) => !e.has(n.code)).map((n) => ({
42
- code: n.code,
43
- name: n.name,
44
- icon: V(n.code)
45
- }));
41
+ return y.filter((n) => !e.has(n.code)).map(
42
+ (n) => ({
43
+ code: n.code,
44
+ name: n.name,
45
+ icon: V(n.code)
46
+ })
47
+ );
46
48
  });
47
- function $(e) {
48
- const o = a(h).find((n) => n.code === e);
49
+ function U(e) {
50
+ const o = y.find((n) => n.code === e);
49
51
  o && c.value.push({
50
52
  localeCode: o.code,
51
53
  value: ""
52
54
  });
53
55
  }
54
- function z(e) {
56
+ function $(e) {
55
57
  c.value = c.value.filter((o) => o.localeCode !== e);
56
58
  }
57
- function A() {
58
- const e = u.value !== L.value, o = !D.isEqual(c.value, k.value);
59
+ function z() {
60
+ const e = u.value !== L.value, o = !I.isEqual(c.value, k.value);
59
61
  return e || o;
60
62
  }
61
63
  function M() {
@@ -74,31 +76,31 @@ const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }
74
76
  function q() {
75
77
  f("update:modelValue", !1);
76
78
  }
77
- const N = R(A, q), j = F({
79
+ const N = Q(z, q), E = j({
78
80
  get: () => s.modelValue,
79
81
  set: (e) => f("update:modelValue", e)
80
82
  });
81
83
  return (e, o) => {
82
- const n = _("FmIcon"), g = _("fm-button"), H = _("FmMenu"), G = _("fm-text-field"), J = _("fm-side-sheet");
83
- return i(), T(J, {
84
- modelValue: j.value,
85
- "onUpdate:modelValue": o[1] || (o[1] = (l) => j.value = l),
84
+ const n = _("FmIcon"), g = _("fm-button"), H = _("FmMenu"), P = _("fm-text-field"), G = _("fm-side-sheet");
85
+ return d(), T(G, {
86
+ modelValue: E.value,
87
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => E.value = l),
86
88
  "max-width": 720,
87
89
  "onOn:clickedAway": a(N)
88
90
  }, {
89
91
  "side-sheet-header": v(() => [
90
- t("p", Y, m(e.title) + " " + m(a(d)("menu.common.translation.title_suffix")), 1)
92
+ t("p", X, m(e.title) + " " + m(a(i)("menu.common.translation.title_suffix")), 1)
91
93
  ]),
92
94
  "side-sheet-footer": v(() => [
93
- t("div", ye, [
95
+ t("div", he, [
94
96
  r(g, {
95
- label: a(d)("common.save"),
97
+ label: a(i)("common.save"),
96
98
  size: "lg",
97
99
  variant: "primary",
98
100
  onClick: M
99
101
  }, null, 8, ["label"]),
100
102
  r(g, {
101
- label: a(d)("common.cancel"),
103
+ label: a(i)("common.cancel"),
102
104
  size: "lg",
103
105
  variant: "tertiary",
104
106
  onClick: a(N)
@@ -106,24 +108,24 @@ const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }
106
108
  ])
107
109
  ]),
108
110
  default: v(() => [
109
- t("div", Z, [
110
- t("div", ee, [
111
- t("p", oe, m(a(d)("menu.common.translation.language")), 1),
112
- t("div", le, [
113
- (i(!0), p(x, null, C(c.value, (l) => (i(), p("div", {
111
+ t("div", Y, [
112
+ t("div", Z, [
113
+ t("p", ee, m(a(i)("menu.common.translation.language")), 1),
114
+ t("div", oe, [
115
+ (d(!0), p(x, null, C(c.value, (l) => (d(), p("div", {
114
116
  key: l.localeCode,
115
117
  class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
116
118
  }, [
117
- t("div", te, m(a(V)(l.localeCode)), 1),
118
- t("span", ae, m(a(I)(l.localeCode, a(h))), 1),
119
+ t("div", le, m(a(V)(l.localeCode)), 1),
120
+ t("span", te, m(a(S)(l.localeCode, a(y))), 1),
119
121
  r(n, {
120
122
  name: "close",
121
123
  class: "cursor-pointer",
122
124
  variant: "secondary",
123
- onClick: (b) => z(l.localeCode)
125
+ onClick: (b) => $(l.localeCode)
124
126
  }, null, 8, ["onClick"])
125
127
  ]))), 128)),
126
- w.value.length > 0 ? (i(), T(H, { key: 0 }, {
128
+ w.value.length > 0 ? (d(), T(H, { key: 0 }, {
127
129
  "menu-button": v(() => [
128
130
  r(g, {
129
131
  variant: "secondary",
@@ -133,53 +135,53 @@ const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }
133
135
  })
134
136
  ]),
135
137
  default: v(() => [
136
- (i(!0), p(x, null, C(w.value, (l) => (i(), p("div", {
138
+ (d(!0), p(x, null, C(w.value, (l) => (d(), p("div", {
137
139
  class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
138
140
  key: l.code,
139
- onClick: (b) => $(l.code)
141
+ onClick: (b) => U(l.code)
140
142
  }, [
141
- t("div", se, [
142
- t("div", ce, m(l.icon), 1),
143
- t("span", me, m(l.name), 1)
143
+ t("div", ne, [
144
+ t("div", se, m(l.icon), 1),
145
+ t("span", ce, m(l.name), 1)
144
146
  ])
145
- ], 8, ne))), 128))
147
+ ], 8, ae))), 128))
146
148
  ]),
147
149
  _: 1
148
- })) : B("", !0)
150
+ })) : F("", !0)
149
151
  ])
150
152
  ]),
151
- t("div", ie, [
153
+ t("div", me, [
152
154
  t("div", de, [
153
155
  r(n, { name: "keyboard_arrow_down" }),
154
- t("p", re, m(a(d)("menu.common.translation.name_section", { entity: e.title })), 1)
156
+ t("p", ie, m(a(i)("menu.common.translation.name_section", { entity: e.title })), 1)
155
157
  ]),
156
- t("div", ue, [
157
- r(W, {
158
- label: a(d)("menu.common.translation.default"),
158
+ t("div", re, [
159
+ r(R, {
160
+ label: a(i)("menu.common.translation.default"),
159
161
  modelValue: u.value,
160
162
  "onUpdate:modelValue": o[0] || (o[0] = (l) => u.value = l)
161
163
  }, null, 8, ["label", "modelValue"]),
162
- c.value.length > 0 ? (i(), p("div", pe, [
163
- r(X, {
164
- label: a(d)("menu.common.translation.translation_label")
164
+ c.value.length > 0 ? (d(), p("div", ue, [
165
+ r(W, {
166
+ label: a(i)("menu.common.translation.translation_label")
165
167
  }, null, 8, ["label"]),
166
- (i(!0), p(x, null, C(c.value, (l) => (i(), p("div", {
168
+ (d(!0), p(x, null, C(c.value, (l) => (d(), p("div", {
167
169
  key: l.localeCode,
168
170
  class: "flex items-center gap-16"
169
171
  }, [
170
- t("div", fe, [
171
- t("div", _e, m(a(V)(l.localeCode)), 1),
172
- t("span", ve, m(a(I)(l.localeCode, a(h))), 1)
172
+ t("div", pe, [
173
+ t("div", fe, m(a(V)(l.localeCode)), 1),
174
+ t("span", _e, m(a(S)(l.localeCode, a(y))), 1)
173
175
  ]),
174
- t("div", he, [
175
- r(G, {
176
+ t("div", ve, [
177
+ r(P, {
176
178
  modelValue: l.value,
177
179
  "onUpdate:modelValue": (b) => l.value = b,
178
- placeholder: a(d)("menu.group.translation.placeholder")
180
+ placeholder: a(i)("menu.group.translation.placeholder")
179
181
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
180
182
  ])
181
183
  ]))), 128))
182
- ])) : B("", !0)
184
+ ])) : F("", !0)
183
185
  ])
184
186
  ])
185
187
  ])
@@ -190,5 +192,5 @@ const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }
190
192
  }
191
193
  });
192
194
  export {
193
- ke as _
195
+ Ve as _
194
196
  };