@feedmepos/mf-menu 0.32.43 → 0.32.45-dev
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.
- package/dist/{App-C9b4SjED.js → App-u5AOIdU4.js} +1472 -1459
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C1T4Ewek.js → ApplyProduct.vue_vue_type_script_setup_true_lang-RTdI8EVk.js} +3 -3
- package/dist/{Catalog-BVrf3VaX.js → Catalog-DDMz6wD9.js} +44 -44
- package/dist/{Category-BkReM5IG.js → Category-BE0d0_de.js} +24 -24
- package/dist/{Category-BMzIQqIE.js → Category-DoIleKPb.js} +78 -78
- package/dist/{CookingGuide-CvctI1TH.js → CookingGuide-iP5hFtlB.js} +105 -105
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-bYSEp6Wb.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CSaMT7Gr.js} +1 -1
- package/dist/{Group-CHkNuuHE.js → Group-AXDRjsKC.js} +3 -3
- package/dist/{Group-BQzmXagr.js → Group-xjimyqnO.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BkruJTpL.js → Group.vue_vue_type_script_setup_true_lang-DB_X7ws3.js} +173 -173
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CBz83Qd1.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D_IUSYDa.js} +30 -30
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dpx4meDa.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Suib7m8i.js} +1750 -1751
- package/dist/{Ingredient-BNsKYrQB.js → Ingredient-yr2DWIMw.js} +20 -20
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DzzwwdA_.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BpiU1gRP.js} +2 -2
- package/dist/{LinkProductSideSheet-C6-wef-M.js → LinkProductSideSheet-2MbaATTn.js} +45 -45
- package/dist/{MenuSetting-DRaw7b6m.js → MenuSetting-BhkjzPiN.js} +47 -47
- package/dist/{PrintRoute-BKB-thVp.js → PrintRoute-ChqpbVo4.js} +39 -39
- package/dist/{Product-vviXmBR1.js → Product-BpnGnMzm.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-5h-k6zad.js → Product.vue_vue_type_script_setup_true_lang-COkk299w.js} +465 -463
- package/dist/{ProductInternalTools-DtLk3xFR.js → ProductInternalTools-BEwLYcEn.js} +66 -66
- package/dist/Products-lONe7x_i.js +291 -0
- package/dist/{Publish-jx0_H_26.js → Publish-CXRgBz-S.js} +29 -29
- package/dist/{Recipe-Dk04ge-_.js → Recipe-Bbt3hG6N.js} +24 -24
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DaCVUn1i.js → RuleView.vue_vue_type_script_setup_true_lang-DXisBADc.js} +366 -366
- package/dist/{Scheduler-vFTvCVcY.js → Scheduler-DJsgP_Hi.js} +11 -11
- package/dist/{ServingSequence-DiBqQ_iS.js → ServingSequence-DALjVV2I.js} +44 -44
- package/dist/{Setting-CtzJ_pVM.js → Setting-B23o5SoS.js} +17 -17
- package/dist/{Subcategory-Cmv2W67T.js → Subcategory-CS4MEgtM.js} +109 -110
- package/dist/{Takeaway-DBW4UPFZ.js → Takeaway-CI2Y-_LF.js} +13 -13
- package/dist/{Takeaway-ChaYk0Ix.js → Takeaway-D27iA6M6.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-C7RL3ITP.js → Takeaway.vue_vue_type_script_setup_true_lang-Ca3qK9zO.js} +111 -111
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-edwJ1203.js → Thumbnail.vue_vue_type_script_setup_true_lang-Da2jQE45.js} +27 -27
- package/dist/TranslationFieldSection.vue_vue_type_script_setup_true_lang-DUScE-82.js +278 -0
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-E3-hgVdd.js +140 -0
- package/dist/TranslationViewChip.vue_vue_type_script_setup_true_lang-BlACWsDs.js +60 -0
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DnuNFxC7.js +6130 -0
- package/dist/{Unit-BgLqPMLe.js → Unit-5pv3oxSc.js} +8 -8
- package/dist/Variant-CTAI6p6r.js +248 -0
- package/dist/{_id_-CDN7as0K.js → _id_-D09xegPQ.js} +28 -28
- package/dist/{app-0AQBxO0B.js → app-8-JCz9b5.js} +1 -1
- package/dist/app-Bk0DN7oZ.js +363 -0
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/components/translation/LanguageChip.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/translation/LanguageSelector.vue.d.ts +33 -0
- package/dist/apps/mf-menu/src/components/translation/LocaleIconBadge.vue.d.ts +29 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationFieldRow.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationViewChip.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/composable/translationLanguages.d.ts +16 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/translation.d.ts +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DTIHdzDw.js → linked-status-dENy3aw3.js} +5 -5
- package/dist/assets/{menu-export-CpcyYnR-.js → menu-export-E9V7bg-T.js} +2 -2
- package/dist/assets/{override-menu-CASoFjhZ.js → override-menu-HaI7O9Fu.js} +5 -5
- package/dist/assets/{validate-menu-C5AkexWv.js → validate-menu-C8LhbVSM.js} +2 -2
- package/dist/{catalog-BA1e4WAu.js → catalog-DhXoYsFF.js} +1 -1
- package/dist/{catalogSetting-DE5rjVfj.js → catalogSetting-DyRqWzdW.js} +1 -1
- package/dist/{currency-D5qYOpxI.js → currency-BkmIftYM.js} +1 -1
- package/dist/dayjs.min-nQqVHQcC.js +6 -0
- package/dist/index-28XF3UnN.js +246 -0
- package/dist/{index-vPs04fVf.js → index-BQ95VVc6.js} +33 -32
- package/dist/index-BXWquw9Z.js +472 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-DSZsSghE.js → index.vue_vue_type_script_setup_true_lang-CJO2XWIn.js} +270 -244
- package/dist/{item-Dp17qTYi.js → item-DmTvGVsp.js} +3270 -3406
- package/dist/{jszip.min-DlpCmtaR.js → jszip.min-8Z5To_Pk.js} +6 -7
- package/dist/{menu-BOVrJ7di.js → menu-Csu9X1_I.js} +1 -1
- package/dist/{menuV2-BHnldQiM.js → menuV2-CC-vGiv5.js} +71 -71
- package/dist/{priceTier-BRQz1GRF.js → priceTier-Bj9Y6SSr.js} +1 -1
- package/dist/{rules-CO49kqfr.js → rules-Dod2cBHH.js} +12 -12
- package/dist/{scheduler-BDHjl8t7.js → scheduler-B3M-715v.js} +29 -29
- package/dist/{toExcel-DGdZKSxT.js → toExcel-67ufpOxx.js} +2 -2
- package/dist/{unit-D7QVgTp_.js → unit-BQrnccs6.js} +35 -35
- package/package.json +1 -1
- package/dist/Products-BR3iBVFd.js +0 -307
- package/dist/RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-I6qrPmxY.js +0 -144
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-Cs6s_csi.js +0 -196
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DIbjlDVn.js +0 -5767
- package/dist/Variant-B8yxF5mJ.js +0 -247
- package/dist/app-BU6wILmn.js +0 -2286
- package/dist/dayjs.min-BFDAHpA8.js +0 -7
- package/dist/index--nQbIQ0d.js +0 -545
- package/dist/translation-BCZ1Ruvv.js +0 -93
- /package/dist/apps/mf-menu/src/components/{TranslationBadge.vue.d.ts → translation/TranslationBadge.vue.d.ts} +0 -0
- /package/dist/apps/mf-menu/src/components/{TranslationFieldSection.vue.d.ts → translation/TranslationFieldSection.vue.d.ts} +0 -0
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { getCurrentInstance as te, defineComponent as ne, computed as
|
|
2
|
-
import {
|
|
1
|
+
import { getCurrentInstance as te, defineComponent as ne, computed as C, watch as oe, h as M, resolveComponent as L, createElementBlock as V, openBlock as w, Fragment as P, normalizeClass as D, createElementVNode as g, createVNode as I, unref as i, isRef as $, withCtx as O, renderList as ie, createBlock as j, createCommentVNode as G, toDisplayString as S, withModifiers as q } from "vue";
|
|
2
|
+
import { G as H, u as J, Q as W, M as N, A as z, I as Y, B as se, ap as Q, a4 as re } from "./index.vue_vue_type_script_setup_true_lang-CJO2XWIn.js";
|
|
3
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
|
|
5
|
-
import { _ as
|
|
6
|
-
import { a as ye, l as ee, T as pe } from "./index-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
function ge(b, _, l,
|
|
4
|
+
import { useDialog as ce, useSnackbar as Z, FmButtonVariant as A, components as de, useBreakpoints as ue } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as me } from "./app-Bk0DN7oZ.js";
|
|
6
|
+
import { a as ye, l as ee, T as pe } from "./index-BQ95VVc6.js";
|
|
7
|
+
import { _ as fe } from "./TranslationViewChip.vue_vue_type_script_setup_true_lang-BlACWsDs.js";
|
|
8
|
+
import { u as _e } from "./search-BAPEUu1R.js";
|
|
9
|
+
import { f as F } from "./currency-BkmIftYM.js";
|
|
10
|
+
import { defineStore as ke } from "pinia";
|
|
11
|
+
import { C as ve } from "./catalog-DhXoYsFF.js";
|
|
12
|
+
import { c as we } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
13
|
+
function ge(b, _, l, u) {
|
|
14
14
|
var y, p, k;
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
return
|
|
15
|
+
if (u >= 0) {
|
|
16
|
+
const m = (y = b.override.items[_._id][u]) == null ? void 0 : y.takeawayUsed;
|
|
17
|
+
return m == null ? void 0 : Y(m);
|
|
18
18
|
}
|
|
19
|
-
const e = l.find((
|
|
20
|
-
return _.combinationKey ? ((k = (p = e == null ? void 0 : e.variant) == null ? void 0 : p.variantCombinations.find((
|
|
19
|
+
const e = l.find((m) => m._id === _._id);
|
|
20
|
+
return _.combinationKey ? ((k = (p = e == null ? void 0 : e.variant) == null ? void 0 : p.variantCombinations.find((m) => m.combinationKey === _.combinationKey)) == null ? void 0 : k.takeawayUsed) ?? (e == null ? void 0 : e.takeawayUsed) : e == null ? void 0 : e.takeawayUsed;
|
|
21
21
|
}
|
|
22
|
-
function be(b, _, l,
|
|
23
|
-
var k,
|
|
22
|
+
function be(b, _, l, u) {
|
|
23
|
+
var k, m;
|
|
24
24
|
const e = Y(b);
|
|
25
25
|
e.override.takeaway[l._id] = { price: l.price || void 0 };
|
|
26
26
|
const y = [...l.usedBy, ..._.usedBy];
|
|
27
|
-
for (const
|
|
27
|
+
for (const n of y) {
|
|
28
28
|
const c = l.usedBy.some(
|
|
29
|
-
(s) => s._id ===
|
|
30
|
-
) ? l._id : "", a = (e.override.items[
|
|
31
|
-
(s) => s.combinationKey ===
|
|
32
|
-
), d = ge(e,
|
|
29
|
+
(s) => s._id === n._id && s.combinationKey === n.combinationKey
|
|
30
|
+
) ? l._id : "", a = (e.override.items[n._id] || []).findIndex(
|
|
31
|
+
(s) => s.combinationKey === n.combinationKey
|
|
32
|
+
), d = ge(e, n, u, a);
|
|
33
33
|
if (a >= 0)
|
|
34
|
-
e.override.items[
|
|
34
|
+
e.override.items[n._id][a].takeawayUsed = c;
|
|
35
35
|
else if (d !== c) {
|
|
36
36
|
const s = {
|
|
37
|
-
_id:
|
|
38
|
-
combinationKey:
|
|
37
|
+
_id: n._id,
|
|
38
|
+
combinationKey: n.combinationKey,
|
|
39
39
|
takeawayUsed: c
|
|
40
40
|
};
|
|
41
|
-
e.override.items[
|
|
41
|
+
e.override.items[n._id] = [...e.override.items[n._id] || [], s];
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const p = [...new Set(y.map((
|
|
45
|
-
for (const
|
|
46
|
-
const v =
|
|
47
|
-
if (!((
|
|
48
|
-
const c = (e.override.items[
|
|
44
|
+
const p = [...new Set(y.map((n) => n._id))];
|
|
45
|
+
for (const n of p) {
|
|
46
|
+
const v = u.find((d) => d._id === n);
|
|
47
|
+
if (!((m = (k = v == null ? void 0 : v.variant) == null ? void 0 : k.variantCombinations) != null && m.length)) continue;
|
|
48
|
+
const c = (e.override.items[n] || []).findIndex(
|
|
49
49
|
(d) => !d.combinationKey
|
|
50
50
|
);
|
|
51
51
|
if (c < 0) continue;
|
|
52
|
-
l.usedBy.some((d) => d._id ===
|
|
52
|
+
l.usedBy.some((d) => d._id === n) || (e.override.items[n][c].takeawayUsed = "");
|
|
53
53
|
}
|
|
54
54
|
return e;
|
|
55
55
|
}
|
|
56
|
-
const he =
|
|
57
|
-
const b = ce(), _ = Z(), l = H(_),
|
|
56
|
+
const he = ke("takeaway-manager", () => {
|
|
57
|
+
const b = ce(), _ = Z(), l = H(_), u = W(l), e = J(), y = te(), { t: p } = X(), k = (a) => {
|
|
58
58
|
var s, h;
|
|
59
|
-
const { vNode: d } =
|
|
59
|
+
const { vNode: d } = we(
|
|
60
60
|
ye,
|
|
61
61
|
y,
|
|
62
62
|
a
|
|
63
63
|
);
|
|
64
64
|
(h = (s = d.component) == null ? void 0 : s.exposed) == null || h.trigger();
|
|
65
65
|
};
|
|
66
|
-
async function
|
|
67
|
-
var h,
|
|
68
|
-
const s = ((
|
|
66
|
+
async function m(a) {
|
|
67
|
+
var h, U;
|
|
68
|
+
const s = ((U = (h = e.currentCatalog) == null ? void 0 : h.override.takeaway[a._id]) == null ? void 0 : U.price) ? null : e.state.menu.modules.takeaway.find((x) => x._id === a._id);
|
|
69
69
|
k({
|
|
70
70
|
initialValue: a,
|
|
71
71
|
applyProduct: !0,
|
|
@@ -73,22 +73,22 @@ const he = _e("takeaway-manager", () => {
|
|
|
73
73
|
fallback: s,
|
|
74
74
|
action: "update",
|
|
75
75
|
"onUpdate:takeaway": async (x) => {
|
|
76
|
-
let
|
|
77
|
-
x.price ?
|
|
76
|
+
let t = Y(e.currentCatalog);
|
|
77
|
+
x.price ? t.override.takeaway[a._id] = { price: x.price } : delete t.override.takeaway[a._id], t = be(t, a, x, e.state.menu.modules.item), await new ve(t, e, u.updateMenu, b).update();
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
async function
|
|
81
|
+
async function n(a) {
|
|
82
82
|
k({
|
|
83
83
|
initialValue: a,
|
|
84
84
|
bindToVariant: e.rules.item.bindToVariant,
|
|
85
85
|
applyProduct: !0,
|
|
86
86
|
action: "update",
|
|
87
87
|
"onUpdate:takeaway": async (d) => {
|
|
88
|
-
await
|
|
88
|
+
await u.updateMenu(
|
|
89
89
|
{
|
|
90
|
-
module:
|
|
91
|
-
operation:
|
|
90
|
+
module: z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
91
|
+
operation: N.F_OPERATION_TYPE.update,
|
|
92
92
|
data: d,
|
|
93
93
|
link: ee(d.usedBy || [])
|
|
94
94
|
},
|
|
@@ -98,7 +98,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
async function v(a) {
|
|
101
|
-
e.currentCatalog ? await
|
|
101
|
+
e.currentCatalog ? await m(a) : await n(a);
|
|
102
102
|
}
|
|
103
103
|
async function c(a) {
|
|
104
104
|
b.open({
|
|
@@ -114,10 +114,10 @@ const he = _e("takeaway-manager", () => {
|
|
|
114
114
|
close: !0
|
|
115
115
|
}
|
|
116
116
|
}).onPrimary(async () => {
|
|
117
|
-
await
|
|
117
|
+
await u.updateMenu(
|
|
118
118
|
{
|
|
119
|
-
module:
|
|
120
|
-
operation:
|
|
119
|
+
module: z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
120
|
+
operation: N.F_OPERATION_TYPE.delete,
|
|
121
121
|
data: a._id
|
|
122
122
|
},
|
|
123
123
|
a.name,
|
|
@@ -140,7 +140,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
140
140
|
class: "px-16 pt-8"
|
|
141
141
|
}, Ie = {
|
|
142
142
|
class: /* @__PURE__ */ D(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100"])
|
|
143
|
-
},
|
|
143
|
+
}, Me = ["onClick"], Ue = {
|
|
144
144
|
class: "flex-1"
|
|
145
145
|
}, Ee = {
|
|
146
146
|
class: "fm-typo-en-body-lg-600 mb-4"
|
|
@@ -151,77 +151,77 @@ const he = _e("takeaway-manager", () => {
|
|
|
151
151
|
}, Be = {
|
|
152
152
|
key: 1,
|
|
153
153
|
class: "xs:pt-24"
|
|
154
|
-
},
|
|
154
|
+
}, Ge = /* @__PURE__ */ ne({
|
|
155
155
|
__name: "Takeaway",
|
|
156
156
|
emits: ["update:count"],
|
|
157
157
|
setup(b, {
|
|
158
158
|
emit: _
|
|
159
159
|
}) {
|
|
160
|
-
const l =
|
|
161
|
-
...
|
|
162
|
-
usedBy: l.items.reduce((
|
|
163
|
-
var
|
|
164
|
-
const
|
|
165
|
-
if ((!e.value || !((
|
|
166
|
-
|
|
160
|
+
const l = J(), u = he(), e = C(() => l.rules.item.bindToVariant), y = C(() => l.rules.takeaway), p = W(H(Z())), k = le(), m = C(() => se.Country.getCountry(k.currentCountry.value).currency), n = C(() => l.takeaways.map((t) => ({
|
|
161
|
+
...t,
|
|
162
|
+
usedBy: l.items.reduce((o, f) => {
|
|
163
|
+
var r, E, R;
|
|
164
|
+
const T = f.takeawayUsed === t._id;
|
|
165
|
+
if ((!e.value || !((E = (r = f.variant) == null ? void 0 : r.variantGroupIds) != null && E.length)) && T)
|
|
166
|
+
o.push({
|
|
167
167
|
_id: f._id
|
|
168
168
|
});
|
|
169
169
|
else {
|
|
170
|
-
const ae = (((R = f.variant) == null ? void 0 : R.variantCombinations) || []).filter((
|
|
170
|
+
const ae = (((R = f.variant) == null ? void 0 : R.variantCombinations) || []).filter((K) => K.takeawayUsed === t._id || K.takeawayUsed == null && T).map((K) => ({
|
|
171
171
|
_id: f._id,
|
|
172
|
-
combinationKey:
|
|
172
|
+
combinationKey: K.combinationKey
|
|
173
173
|
}));
|
|
174
|
-
|
|
174
|
+
o = [...o, ...ae];
|
|
175
175
|
}
|
|
176
|
-
return
|
|
176
|
+
return o;
|
|
177
177
|
}, [])
|
|
178
178
|
}))), {
|
|
179
179
|
filter: v,
|
|
180
180
|
searchKey: c
|
|
181
|
-
} =
|
|
182
|
-
oe(() => a.value.length, (
|
|
183
|
-
d("update:count",
|
|
181
|
+
} = _e(), a = C(() => n.value.filter((t) => v([t.name, F(t.price, !1)]))), d = _;
|
|
182
|
+
oe(() => a.value.length, (t) => {
|
|
183
|
+
d("update:count", t);
|
|
184
184
|
}, {
|
|
185
185
|
immediate: !0
|
|
186
186
|
});
|
|
187
187
|
const {
|
|
188
188
|
t: s
|
|
189
|
-
} = X(), h =
|
|
189
|
+
} = X(), h = C(() => [{
|
|
190
190
|
accessorKey: "name",
|
|
191
191
|
header: () => s("menu.takeaway.table.columns.name"),
|
|
192
192
|
enableSorting: !1,
|
|
193
193
|
size: 700,
|
|
194
|
-
cell: (
|
|
195
|
-
const
|
|
194
|
+
cell: (t) => {
|
|
195
|
+
const o = t.row.original, f = t.getValue();
|
|
196
196
|
return M("div", {
|
|
197
197
|
class: "flex items-center gap-8"
|
|
198
198
|
}, [M("span", {
|
|
199
199
|
class: "break-all"
|
|
200
|
-
}, f),
|
|
201
|
-
|
|
202
|
-
}
|
|
200
|
+
}, f), o.name_locale ? M(fe, {
|
|
201
|
+
nameLocale: o.name_locale ?? {}
|
|
202
|
+
}) : null]);
|
|
203
203
|
}
|
|
204
204
|
}, {
|
|
205
205
|
accessorKey: "price",
|
|
206
206
|
header: () => s("menu.takeaway.table.columns.price", {
|
|
207
|
-
symbol:
|
|
207
|
+
symbol: m.value.symbol
|
|
208
208
|
}),
|
|
209
209
|
enableSorting: !1,
|
|
210
210
|
size: 200,
|
|
211
211
|
meta: {
|
|
212
212
|
textAlign: "right"
|
|
213
213
|
},
|
|
214
|
-
cell: (
|
|
215
|
-
const
|
|
216
|
-
return F(
|
|
214
|
+
cell: (t) => {
|
|
215
|
+
const o = t.getValue();
|
|
216
|
+
return F(o, !1);
|
|
217
217
|
}
|
|
218
218
|
}, {
|
|
219
219
|
accessorKey: "usedBy",
|
|
220
220
|
header: () => s("menu.takeaway.table.columns.products"),
|
|
221
221
|
enableSorting: !1,
|
|
222
222
|
size: 200,
|
|
223
|
-
cell: (
|
|
224
|
-
const
|
|
223
|
+
cell: (t) => {
|
|
224
|
+
const o = t.getValue(), f = Q(l.categorizedItems, o).flatMap((T) => T.items).length ?? 0;
|
|
225
225
|
return s("menu.takeaway.table.items_linked", {
|
|
226
226
|
count: f
|
|
227
227
|
});
|
|
@@ -233,48 +233,48 @@ const he = _e("takeaway-manager", () => {
|
|
|
233
233
|
cellClass: "pl-16",
|
|
234
234
|
headerContentClass: "-mx-16"
|
|
235
235
|
},
|
|
236
|
-
cell: (
|
|
236
|
+
cell: (t) => M("div", {
|
|
237
237
|
class: "flex justify-end items-center"
|
|
238
238
|
}, [y.value.delete ? M(de.FmButton, {
|
|
239
239
|
prependIcon: "delete",
|
|
240
240
|
variant: A.Tertiary,
|
|
241
241
|
textColor: "neutral-gray-400",
|
|
242
|
-
onClick: (
|
|
243
|
-
|
|
242
|
+
onClick: (o) => {
|
|
243
|
+
o.stopPropagation(), u.deleteTakeaway(t.row.original);
|
|
244
244
|
}
|
|
245
245
|
}) : null])
|
|
246
|
-
}]),
|
|
247
|
-
return (
|
|
248
|
-
const f =
|
|
249
|
-
return
|
|
246
|
+
}]), U = ue(), x = C(() => U.breakpoints.value.xs);
|
|
247
|
+
return (t, o) => {
|
|
248
|
+
const f = L("fm-search"), T = L("fm-table"), B = L("fm-button");
|
|
249
|
+
return n.value.length ? (w(), V(P, {
|
|
250
250
|
key: 0
|
|
251
|
-
}, [x.value ? (w(), V(
|
|
251
|
+
}, [x.value ? (w(), V(P, {
|
|
252
252
|
key: 1
|
|
253
253
|
}, [g("div", Ve, [I(f, {
|
|
254
254
|
class: "w-full",
|
|
255
255
|
autofocus: "",
|
|
256
256
|
modelValue: i(c),
|
|
257
|
-
"onUpdate:modelValue":
|
|
257
|
+
"onUpdate:modelValue": o[2] || (o[2] = (r) => $(c) ? c.value = r : null),
|
|
258
258
|
placeholder: i(s)("menu.takeaway.table.search.placeholder")
|
|
259
|
-
}, null, 8, ["modelValue", "placeholder"])]), g("div", Ie, [(w(!0), V(
|
|
260
|
-
key:
|
|
259
|
+
}, null, 8, ["modelValue", "placeholder"])]), g("div", Ie, [(w(!0), V(P, null, ie(a.value, (r) => (w(), V("div", {
|
|
260
|
+
key: r._id,
|
|
261
261
|
class: D(["py-12 px-16", "flex space-x-8", "items-center"]),
|
|
262
262
|
onClick: () => {
|
|
263
|
-
y.value.edit && i(
|
|
263
|
+
y.value.edit && i(u).updateTakeaway(r);
|
|
264
264
|
}
|
|
265
|
-
}, [g("div",
|
|
265
|
+
}, [g("div", Ue, [g("p", Ee, S(r.name), 1), g("p", Ke, S(`${i(Q)(i(l).categorizedItems, r.usedBy).flatMap((E) => E.items).length ?? 0} items linked`), 1), g("p", Se, " Price: " + S(m.value.symbol) + S(i(F)(r.price, !1)), 1)]), y.value.delete ? (w(), j(B, {
|
|
266
266
|
key: 0,
|
|
267
267
|
variant: i(A).Tertiary,
|
|
268
268
|
"text-color": "neutral-gray-400",
|
|
269
269
|
"prepend-icon": "delete",
|
|
270
|
-
onClick: q(() => i(
|
|
271
|
-
}, null, 8, ["variant", "onClick"])) :
|
|
270
|
+
onClick: q(() => i(u).deleteTakeaway(r), ["stop"])
|
|
271
|
+
}, null, 8, ["variant", "onClick"])) : G("", !0)], 8, Me))), 128))])], 64)) : (w(), V("div", xe, [g("div", Ce, [g("div", Te, [I(f, {
|
|
272
272
|
autofocus: "",
|
|
273
273
|
modelValue: i(c),
|
|
274
|
-
"onUpdate:modelValue":
|
|
274
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => $(c) ? c.value = r : null),
|
|
275
275
|
placeholder: i(s)("menu.takeaway.table.search.placeholder")
|
|
276
|
-
}, null, 8, ["modelValue", "placeholder"])])]), I(
|
|
277
|
-
default:
|
|
276
|
+
}, null, 8, ["modelValue", "placeholder"])])]), I(me, null, {
|
|
277
|
+
default: O(() => [I(T, {
|
|
278
278
|
"column-defs": h.value,
|
|
279
279
|
loading: i(p).checkMenuIsLoading(),
|
|
280
280
|
"page-size": a.value.length,
|
|
@@ -284,8 +284,8 @@ const he = _e("takeaway-manager", () => {
|
|
|
284
284
|
class: "flex-1 overflow-hidden",
|
|
285
285
|
"hide-footer": "",
|
|
286
286
|
"pin-header-row": "",
|
|
287
|
-
onRowClick:
|
|
288
|
-
y.value.edit && i(
|
|
287
|
+
onRowClick: o[1] || (o[1] = (r) => {
|
|
288
|
+
y.value.edit && i(u).updateTakeaway(r.original);
|
|
289
289
|
})
|
|
290
290
|
}, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
|
|
291
291
|
_: 1
|
|
@@ -293,32 +293,32 @@ const he = _e("takeaway-manager", () => {
|
|
|
293
293
|
subtitle: i(s)("menu.takeaway.empty.subtitle"),
|
|
294
294
|
title: i(s)("menu.takeaway.empty.title")
|
|
295
295
|
}, {
|
|
296
|
-
action:
|
|
296
|
+
action: O(() => [y.value.create ? (w(), j(i(pe), {
|
|
297
297
|
key: 0,
|
|
298
298
|
"bind-to-variant": e.value,
|
|
299
299
|
action: "add",
|
|
300
300
|
"apply-product": "",
|
|
301
|
-
"onUpdate:takeaway":
|
|
302
|
-
module: i(
|
|
303
|
-
operation: i(
|
|
304
|
-
data:
|
|
305
|
-
link: i(ee)(
|
|
306
|
-
},
|
|
301
|
+
"onUpdate:takeaway": o[3] || (o[3] = (r) => i(p).updateMenu({
|
|
302
|
+
module: i(z.F_MENU_MODULE_V4_KEY).enum.takeaway,
|
|
303
|
+
operation: i(N.F_OPERATION_TYPE).create,
|
|
304
|
+
data: r,
|
|
305
|
+
link: i(ee)(r.usedBy || [])
|
|
306
|
+
}, r.name))
|
|
307
307
|
}, {
|
|
308
|
-
default:
|
|
309
|
-
trigger:
|
|
310
|
-
}) => [I(
|
|
308
|
+
default: O(({
|
|
309
|
+
trigger: r
|
|
310
|
+
}) => [I(B, {
|
|
311
311
|
"prepend-icon": "add",
|
|
312
312
|
label: i(s)("menu.takeaway.empty.action"),
|
|
313
|
-
onClick: q(
|
|
313
|
+
onClick: q(r, ["stop"])
|
|
314
314
|
}, null, 8, ["label", "onClick"])]),
|
|
315
315
|
_: 1
|
|
316
|
-
}, 8, ["bind-to-variant"])) :
|
|
316
|
+
}, 8, ["bind-to-variant"])) : G("", !0)]),
|
|
317
317
|
_: 1
|
|
318
318
|
}, 8, ["subtitle", "title"])]));
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
});
|
|
322
322
|
export {
|
|
323
|
-
|
|
323
|
+
Ge as _
|
|
324
324
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computed as d, defineComponent as x, ref as F, resolveComponent as b, createElementBlock as L, openBlock as w, normalizeClass as
|
|
2
|
-
import {
|
|
3
|
-
import { u as S } from "./menuV2-
|
|
4
|
-
import { C as v, h as N } from "./catalog-
|
|
5
|
-
import { useSnackbar as P, useDialog as
|
|
6
|
-
import { a as T } from "./LinkProductSideSheet-
|
|
7
|
-
import { useI18n as
|
|
8
|
-
function
|
|
1
|
+
import { computed as d, defineComponent as x, ref as F, resolveComponent as b, createElementBlock as L, openBlock as w, normalizeClass as R, createVNode as K, normalizeStyle as $, withCtx as B, createBlock as U, createCommentVNode as j } from "vue";
|
|
2
|
+
import { A as h, M as E, G as C, Q as O, al as Y, u as y, a as G } from "./index.vue_vue_type_script_setup_true_lang-CJO2XWIn.js";
|
|
3
|
+
import { u as S } from "./menuV2-CC-vGiv5.js";
|
|
4
|
+
import { C as v, h as N } from "./catalog-DhXoYsFF.js";
|
|
5
|
+
import { useSnackbar as P, useDialog as z } from "@feedmepos/ui-library";
|
|
6
|
+
import { a as T } from "./LinkProductSideSheet-2MbaATTn.js";
|
|
7
|
+
import { useI18n as Q } from "@feedmepos/mf-common";
|
|
8
|
+
function q() {
|
|
9
9
|
const t = S(), o = d(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), i = d(() => {
|
|
10
10
|
const u = t.currentCatalog;
|
|
11
11
|
return u ? v.getItemAvailable(u).map((n) => ({ _id: n })) : [];
|
|
@@ -43,10 +43,10 @@ function G() {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
async function g(u) {
|
|
46
|
-
await
|
|
46
|
+
await A(u, !0);
|
|
47
47
|
}
|
|
48
48
|
async function p(u) {
|
|
49
|
-
await
|
|
49
|
+
await A(u, !1);
|
|
50
50
|
}
|
|
51
51
|
async function _(u) {
|
|
52
52
|
const n = t.currentCatalog;
|
|
@@ -70,7 +70,7 @@ function G() {
|
|
|
70
70
|
saveLinkItemRules: _
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
async function
|
|
73
|
+
async function A(t, o) {
|
|
74
74
|
var u;
|
|
75
75
|
const i = S(), c = i.currentCatalog;
|
|
76
76
|
if (!c || t.length === 0) return;
|
|
@@ -97,7 +97,7 @@ async function Y(t, o) {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function H() {
|
|
100
|
-
const t = S(), o = P(), i =
|
|
100
|
+
const t = S(), o = P(), i = z(), c = C(o), g = O(c), p = d(() => {
|
|
101
101
|
const n = t.categorizedRawMenuItems, a = new Set(
|
|
102
102
|
t.currentCatalog ? v.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((e) => e._id)
|
|
103
103
|
);
|
|
@@ -135,7 +135,7 @@ function H() {
|
|
|
135
135
|
(l, m) => {
|
|
136
136
|
const f = a.items.filter((I) => I._id == m) ?? [];
|
|
137
137
|
return l = l.concat(
|
|
138
|
-
|
|
138
|
+
Y(m, f, (I) => ({
|
|
139
139
|
...I,
|
|
140
140
|
orderFrom: null
|
|
141
141
|
}))
|
|
@@ -159,8 +159,8 @@ function H() {
|
|
|
159
159
|
applyProduct: u
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
const
|
|
163
|
-
const t = y(), o = P(), i =
|
|
162
|
+
const J = () => {
|
|
163
|
+
const t = y(), o = P(), i = C(o), c = O(i), g = d(() => t.categorizedRawMenuItems.filter((n) => n.items.length > 0)), p = d(() => {
|
|
164
164
|
const n = t.currentCatalog;
|
|
165
165
|
return n ? v.getItemAvailable(n).map((a) => ({ _id: a })) : [];
|
|
166
166
|
});
|
|
@@ -174,7 +174,7 @@ const Q = () => {
|
|
|
174
174
|
f,
|
|
175
175
|
I,
|
|
176
176
|
e.has(f),
|
|
177
|
-
t.version ===
|
|
177
|
+
t.version === G.F_MENU_VERSION.v3
|
|
178
178
|
), m;
|
|
179
179
|
},
|
|
180
180
|
{}
|
|
@@ -219,7 +219,7 @@ const Q = () => {
|
|
|
219
219
|
saveLinkItemRules: u
|
|
220
220
|
};
|
|
221
221
|
}, W = () => {
|
|
222
|
-
const t = y(), o = P(), i =
|
|
222
|
+
const t = y(), o = P(), i = z(), c = C(o), g = O(c), p = d(() => {
|
|
223
223
|
const n = t.categorizedRawMenuItems, a = new Set(
|
|
224
224
|
t.currentCatalog ? v.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((e) => e._id)
|
|
225
225
|
);
|
|
@@ -248,7 +248,7 @@ const Q = () => {
|
|
|
248
248
|
(l, m) => {
|
|
249
249
|
const f = a.items.filter((I) => I._id == m) ?? [];
|
|
250
250
|
return l = l.concat(
|
|
251
|
-
|
|
251
|
+
Y(m, f, (I) => ({
|
|
252
252
|
...I,
|
|
253
253
|
orderFrom: null
|
|
254
254
|
}))
|
|
@@ -287,7 +287,7 @@ function se(t) {
|
|
|
287
287
|
const e = y(), r = d(() => e.state.menu.modules.item ?? []), s = d(() => {
|
|
288
288
|
var M;
|
|
289
289
|
return ((M = e.currentCatalog) == null ? void 0 : M.linkItemRules) ?? null;
|
|
290
|
-
}), l = W(), m =
|
|
290
|
+
}), l = W(), m = J(), f = d(() => !e.state.currentSchedulerId), I = (M) => {
|
|
291
291
|
if (M.mode === T.Rules)
|
|
292
292
|
m.saveLinkItemRules(M.linkItemRules);
|
|
293
293
|
else {
|
|
@@ -308,7 +308,7 @@ function se(t) {
|
|
|
308
308
|
const i = S(), c = d(() => i.state.menu.modules.item ?? []), g = d(() => {
|
|
309
309
|
var e;
|
|
310
310
|
return ((e = i.currentCatalog) == null ? void 0 : e.linkItemRules) ?? null;
|
|
311
|
-
}), p = H(), _ =
|
|
311
|
+
}), p = H(), _ = q(), u = d(() => !i.state.currentSchedulerId), n = (e) => {
|
|
312
312
|
if (e.mode === T.Rules)
|
|
313
313
|
_.saveLinkItemRules(e.linkItemRules);
|
|
314
314
|
else {
|
|
@@ -336,7 +336,7 @@ const X = ["alt", "src", "crossorigin"], ue = /* @__PURE__ */ x({
|
|
|
336
336
|
crossorigin: { type: Boolean, default: !0 }
|
|
337
337
|
},
|
|
338
338
|
setup(t) {
|
|
339
|
-
const o = t, { t: i } =
|
|
339
|
+
const o = t, { t: i } = Q(), c = F(!1), g = F(!o.src), p = () => {
|
|
340
340
|
c.value = !1, g.value = !0;
|
|
341
341
|
}, _ = () => {
|
|
342
342
|
c.value = !0, g.value = !0;
|
|
@@ -357,18 +357,18 @@ const X = ["alt", "src", "crossorigin"], ue = /* @__PURE__ */ x({
|
|
|
357
357
|
return (e, r) => {
|
|
358
358
|
const s = b("fm-icon"), l = b("fm-card");
|
|
359
359
|
return w(), L("div", {
|
|
360
|
-
class:
|
|
360
|
+
class: R([e.className, "flex items-center justify-center"])
|
|
361
361
|
}, [
|
|
362
362
|
K(l, {
|
|
363
|
-
class:
|
|
364
|
-
style:
|
|
363
|
+
class: R(["flex items-center justify-center", "rounded-md"]),
|
|
364
|
+
style: $({ width: `${n.value.width}px`, height: `${n.value.height}px` }),
|
|
365
365
|
variant: "outlined"
|
|
366
366
|
}, {
|
|
367
|
-
default:
|
|
367
|
+
default: B(() => [
|
|
368
368
|
a.value && !c.value ? (w(), L("img", {
|
|
369
369
|
key: 0,
|
|
370
370
|
alt: u.value,
|
|
371
|
-
class:
|
|
371
|
+
class: R(["w-full h-full", "object-cover", g.value ? "" : "hidden"]),
|
|
372
372
|
src: a.value,
|
|
373
373
|
crossorigin: o.crossorigin ? "anonymous" : void 0,
|
|
374
374
|
onError: _,
|
|
@@ -394,6 +394,6 @@ const X = ["alt", "src", "crossorigin"], ue = /* @__PURE__ */ x({
|
|
|
394
394
|
});
|
|
395
395
|
export {
|
|
396
396
|
ue as _,
|
|
397
|
-
|
|
397
|
+
q as a,
|
|
398
398
|
se as u
|
|
399
399
|
};
|