@feedmepos/mf-menu 0.32.82 → 0.32.83-dev.2
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-CP6dKdsG.js → App-CJtpyTsA.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CxKh2z62.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C01hHwqy.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-D5yV-KHS.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-4xmgAa5D.js} +3 -3
- package/dist/{Catalog-rmn_wi_K.js → Catalog-CTUtAc6s.js} +6 -6
- package/dist/{CatalogBinding-B6qmT4ZX.js → CatalogBinding-DQf2xYH8.js} +13 -13
- package/dist/{Category-DSWeQdzi.js → Category-DP6UnoXf.js} +4 -4
- package/dist/{Category-dZn4oK25.js → Category-Q9BCIS4J.js} +4 -4
- package/dist/{CookingGuide-BVTYWxaA.js → CookingGuide-GbojUPLO.js} +5 -5
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Bjfql_55.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CBRNh-O-.js} +1 -1
- package/dist/{Group-CHi-dO5H.js → Group-CJqQLteU.js} +3 -3
- package/dist/{Group-B3C6clax.js → Group-Dsc8PGdX.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-UxVrkBuN.js → Group.vue_vue_type_script_setup_true_lang-FWqqHQ20.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Do1OBBQf.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BcQa7V0d.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CO-vKv_2.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Cb9tTsPG.js} +232 -215
- package/dist/{Ingredient-BiSrkQVk.js → Ingredient-DWEB328H.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-0w-RN_R_.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Dab9-l-S.js} +2 -2
- package/dist/{LinkProductSideSheet-DocQGJPp.js → LinkProductSideSheet-BluWowSV.js} +4 -4
- package/dist/{MenuSetting-CtyVoKWq.js → MenuSetting-C_ZsIERs.js} +7 -7
- package/dist/{OrderPacing-D13DbuOg.js → OrderPacing-BZhIFo4P.js} +5 -5
- package/dist/{PrintRoute-Ci3Iys0w.js → PrintRoute-C5ZJs7tz.js} +5 -5
- package/dist/{Product-9OKt-6KX.js → Product-rESWzhq6.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-B2CRE8lH.js → Product.vue_vue_type_script_setup_true_lang-C-zJ0P53.js} +14 -14
- package/dist/{ProductInternalTools-Cpq_h_Jv.js → ProductInternalTools-tkLzH5hJ.js} +7 -7
- package/dist/{Products-BtUxMJgT.js → Products-DxpE9Hhz.js} +50 -50
- package/dist/Publish-3z09Tj11.js +1608 -0
- package/dist/{Recipe-BLPc5AMa.js → Recipe-Dqtj2Ye9.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BlgHu1wy.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CST9Gy_R.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DddG4OKH.js → RuleView.vue_vue_type_script_setup_true_lang-_MGk1b10.js} +609 -609
- package/dist/{Scheduler-xKSccoH0.js → Scheduler-BgkBxTeC.js} +3 -3
- package/dist/{ServingSequence-DskyUkTW.js → ServingSequence-D92cps_j.js} +3 -3
- package/dist/{Setting-k8Id6cHv.js → Setting-JUioq6ZT.js} +5 -5
- package/dist/{Subcategory-D17FTwWm.js → Subcategory-vjc6gzqd.js} +6 -6
- package/dist/{Takeaway-C3JIyMai.js → Takeaway-BXMBCjFg.js} +1 -1
- package/dist/Takeaway-DSOy02ma.js +64 -0
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-539rI3Ek.js +331 -0
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-DGbxQDG5.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-C37PZJuF.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-CTco6ODU.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-BjsExR0h.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CZhTqKW3.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dy-eMWb4.js} +602 -601
- package/dist/{Unit-Bhn4-m_i.js → Unit-_Eoj6ONR.js} +2 -2
- package/dist/{Variant-CElpkood.js → Variant-D1iCI3U5.js} +3 -3
- package/dist/{_id_-Cd1qbY0n.js → _id_-BUrZucNq.js} +10 -10
- package/dist/{app-UDWbW4OG.js → app-B8GiVUrR.js} +1 -1
- package/dist/{app-DsnkFZ-H.js → app-BJA5-4eB.js} +392 -392
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +25 -0
- package/dist/apps/mf-menu/src/components/feature/TakeAwayManager/Form.vue.d.ts +3 -3
- package/dist/apps/mf-menu/src/helper/takeawayOverride.d.ts +12 -0
- package/dist/apps/mf-menu/src/manager/menu/takeaway.d.ts +14 -0
- package/dist/apps/mf-menu/src/views/Publish/publishError.d.ts +20 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DgsdjPHB.js → linked-status-Bqmqi1JL.js} +3 -3
- package/dist/assets/{menu-export-BGMqa5WQ.js → menu-export-CfrN-LuH.js} +2 -2
- package/dist/assets/{override-menu-D4M8wytN.js → override-menu-Cy7YaK_1.js} +3 -3
- package/dist/assets/{validate-menu-BxFnQvZD.js → validate-menu-BPtUlI3H.js} +12 -12
- package/dist/{catalog-C0qDPI4x.js → catalog-B3YnChlG.js} +1 -1
- package/dist/{catalogSetting-CNiRVcRy.js → catalogSetting-BeiJ3_Fx.js} +1 -1
- package/dist/{currency-CBTIYnEv.js → currency-BKZrZwjw.js} +1 -1
- package/dist/{dayjs.min-Dibo6tEl.js → dayjs.min-WGRuZAMu.js} +2 -2
- package/dist/{discardConfirm-CY30eR1E.js → discardConfirm-CuLDiWC_.js} +1 -1
- package/dist/{index-B0ldk6F6.js → index-BYh87zkc.js} +5 -5
- package/dist/{index-BFShshS2.js → index-C36SngVC.js} +1 -1
- package/dist/{index-CB458_NN.js → index-CUzEne2b.js} +137 -131
- package/dist/{index.vue_vue_type_script_setup_true_lang-D1Voe2H_.js → index.vue_vue_type_script_setup_true_lang-BJZykcBx.js} +25295 -25669
- package/dist/{item-CYQbNtVH.js → item-BQYLe0DU.js} +1290 -1289
- package/dist/{jszip.min-vyjXBfka.js → jszip.min-kAXqpQrc.js} +483 -483
- package/dist/{linkProducts-CxJsNjEk.js → linkProducts-B3BYn9Cw.js} +4 -4
- package/dist/{memberPricing-BT91F3oY.js → memberPricing-DzPTdmS5.js} +1 -1
- package/dist/{menu-DC2L58Mr.js → menu-DUOE-Q12.js} +1 -1
- package/dist/{menuV2-BVrodTOd.js → menuV2-BO3LtBSw.js} +37 -37
- package/dist/{order_pacing-DlMGv564.js → order_pacing-DqVag6W3.js} +5 -5
- package/dist/{priceTier-tLHSa3f-.js → priceTier-BFauU3rd.js} +1 -1
- package/dist/{rules-SVD2wEfD.js → rules-B596A4CJ.js} +3 -3
- package/dist/{scheduler-DwdWTugd.js → scheduler-KT6kOtgK.js} +5 -5
- package/dist/{toExcel-Cw_mdmEb.js → toExcel-CgXzLIId.js} +2 -2
- package/dist/{unit-D7bZ5bN-.js → unit-BJeua1T7.js} +3 -3
- package/package.json +3 -4
- package/dist/Publish-syGXcNlA.js +0 -1582
- package/dist/Takeaway-Bpoi-oyf.js +0 -64
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-Cg6RnIkW.js +0 -324
|
@@ -1,64 +0,0 @@
|
|
|
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 v, u as w, j as x, h as E, i as M } from "./index.vue_vue_type_script_setup_true_lang-D1Voe2H_.js";
|
|
3
|
-
import { useI18n as T } from "@feedmepos/mf-common";
|
|
4
|
-
import { useSnackbar as h } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as V } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
6
|
-
import { _ as C } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
|
|
7
|
-
import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-Cg6RnIkW.js";
|
|
8
|
-
import { T as S, l as L } from "./index-CB458_NN.js";
|
|
9
|
-
import { a as O } from "./menu-DC2L58Mr.js";
|
|
10
|
-
const U = { class: "flex-1 flex justify-between gap-8 pl-8" }, B = { class: "flex items-center" }, F = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, j = { class: "fm-typo-en-body-md-600 font-semibold" }, H = /* @__PURE__ */ f({
|
|
11
|
-
__name: "Takeaway",
|
|
12
|
-
setup(D) {
|
|
13
|
-
const u = h(), l = v(u), c = w(), p = x(l), _ = y(() => c.rules.item.bindToVariant), n = k(0), { t: r } = T();
|
|
14
|
-
return O().resetOnMount(), (I, o) => (d(), i(C, {
|
|
15
|
-
heading: a(r)("menu.takeaway.title")
|
|
16
|
-
}, {
|
|
17
|
-
default: s(() => [
|
|
18
|
-
m(N, {
|
|
19
|
-
"onUpdate:count": o[0] || (o[0] = (e) => n.value = e)
|
|
20
|
-
})
|
|
21
|
-
]),
|
|
22
|
-
"append-heading": s(() => [
|
|
23
|
-
t("div", U, [
|
|
24
|
-
t("div", B, [
|
|
25
|
-
t("div", F, [
|
|
26
|
-
t("p", j, b(n.value), 1)
|
|
27
|
-
])
|
|
28
|
-
]),
|
|
29
|
-
t("div", null, [
|
|
30
|
-
n.value > 0 ? (d(), i(a(S), {
|
|
31
|
-
key: 0,
|
|
32
|
-
"bind-to-variant": _.value,
|
|
33
|
-
action: "add",
|
|
34
|
-
"apply-product": "",
|
|
35
|
-
"onUpdate:takeaway": o[1] || (o[1] = (e) => a(p).updateMenu(
|
|
36
|
-
{
|
|
37
|
-
module: a(M).enum.takeaway,
|
|
38
|
-
operation: a(E.F_OPERATION_TYPE).create,
|
|
39
|
-
data: e,
|
|
40
|
-
link: a(L)(e.usedBy || [])
|
|
41
|
-
},
|
|
42
|
-
e.name
|
|
43
|
-
))
|
|
44
|
-
}, {
|
|
45
|
-
default: s(({ trigger: e }) => [
|
|
46
|
-
m(V, {
|
|
47
|
-
label: a(r)("menu.takeaway.actions.add"),
|
|
48
|
-
"prepend-icon": "add",
|
|
49
|
-
type: "button",
|
|
50
|
-
onClick: e
|
|
51
|
-
}, null, 8, ["label", "onClick"])
|
|
52
|
-
]),
|
|
53
|
-
_: 1
|
|
54
|
-
}, 8, ["bind-to-variant"])) : g("", !0)
|
|
55
|
-
])
|
|
56
|
-
])
|
|
57
|
-
]),
|
|
58
|
-
_: 1
|
|
59
|
-
}, 8, ["heading"]));
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
export {
|
|
63
|
-
H as default
|
|
64
|
-
};
|
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance as te, defineComponent as ne, computed as C, watch as oe, h as S, resolveComponent as E, 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 O, renderList as ie, createBlock as $, createCommentVNode as q, toDisplayString as B, withModifiers as G } from "vue";
|
|
2
|
-
import { b as J, j as Q, u as W, h as F, i as A, f as R, a as se, as as H, _ as re } from "./index.vue_vue_type_script_setup_true_lang-D1Voe2H_.js";
|
|
3
|
-
import { useI18n as X, useCoreStore as le } from "@feedmepos/mf-common";
|
|
4
|
-
import { useDialog as ce, useSnackbar as Z, FmButtonVariant as N, components as de, useBreakpoints as ue } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as me } from "./app-DsnkFZ-H.js";
|
|
6
|
-
import { a as ye, l as ee, T as pe } from "./index-CB458_NN.js";
|
|
7
|
-
import { _ as fe } from "./TranslationViewChip.vue_vue_type_script_setup_true_lang-DiK3fi9J.js";
|
|
8
|
-
import { u as _e } from "./search-BAPEUu1R.js";
|
|
9
|
-
import { f as z } from "./currency-CBTIYnEv.js";
|
|
10
|
-
import { defineStore as ke } from "pinia";
|
|
11
|
-
import { C as ve } from "./catalog-C0qDPI4x.js";
|
|
12
|
-
import { c as we } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
13
|
-
function ge(b, _, l, u) {
|
|
14
|
-
var y, p, k;
|
|
15
|
-
if (u >= 0) {
|
|
16
|
-
const m = (y = b.override.items[_._id][u]) == null ? void 0 : y.takeawayUsed;
|
|
17
|
-
return m == null ? void 0 : R(m);
|
|
18
|
-
}
|
|
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
|
-
}
|
|
22
|
-
function be(b, _, l, u) {
|
|
23
|
-
var k, m;
|
|
24
|
-
const e = R(b);
|
|
25
|
-
e.override.takeaway[l._id] = { price: l.price || void 0 };
|
|
26
|
-
const y = [...l.usedBy, ..._.usedBy];
|
|
27
|
-
for (const n of y) {
|
|
28
|
-
const c = l.usedBy.some(
|
|
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
|
-
if (a >= 0)
|
|
34
|
-
e.override.items[n._id][a].takeawayUsed = c;
|
|
35
|
-
else if (d !== c) {
|
|
36
|
-
const s = {
|
|
37
|
-
_id: n._id,
|
|
38
|
-
combinationKey: n.combinationKey,
|
|
39
|
-
takeawayUsed: c
|
|
40
|
-
};
|
|
41
|
-
e.override.items[n._id] = [...e.override.items[n._id] || [], s];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
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
|
-
(d) => !d.combinationKey
|
|
50
|
-
);
|
|
51
|
-
if (c < 0) continue;
|
|
52
|
-
l.usedBy.some((d) => d._id === n) || (e.override.items[n][c].takeawayUsed = "");
|
|
53
|
-
}
|
|
54
|
-
return e;
|
|
55
|
-
}
|
|
56
|
-
const he = ke("takeaway-manager", () => {
|
|
57
|
-
const b = ce(), _ = Z(), l = J(_), u = Q(l), e = W(), y = te(), { t: p } = X(), k = (a) => {
|
|
58
|
-
var s, h;
|
|
59
|
-
const { vNode: d } = we(
|
|
60
|
-
ye,
|
|
61
|
-
y,
|
|
62
|
-
a
|
|
63
|
-
);
|
|
64
|
-
(h = (s = d.component) == null ? void 0 : s.exposed) == null || h.trigger();
|
|
65
|
-
};
|
|
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
|
-
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 t = R(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
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
async function n(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 u.updateMenu(
|
|
89
|
-
{
|
|
90
|
-
module: A.enum.takeaway,
|
|
91
|
-
operation: F.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 m(a) : await n(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: N.Destructive
|
|
111
|
-
},
|
|
112
|
-
secondaryActions: {
|
|
113
|
-
text: p("menu.common.actions.cancel"),
|
|
114
|
-
close: !0
|
|
115
|
-
}
|
|
116
|
-
}).onPrimary(async () => {
|
|
117
|
-
await u.updateMenu(
|
|
118
|
-
{
|
|
119
|
-
module: A.enum.takeaway,
|
|
120
|
-
operation: F.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
|
-
}, Se = ["onClick"], Ue = {
|
|
144
|
-
class: "flex-1"
|
|
145
|
-
}, Ke = {
|
|
146
|
-
class: "fm-typo-en-body-lg-600 mb-4"
|
|
147
|
-
}, Me = {
|
|
148
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
149
|
-
}, Be = {
|
|
150
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
151
|
-
}, Pe = {
|
|
152
|
-
key: 1,
|
|
153
|
-
class: "xs:pt-24"
|
|
154
|
-
}, qe = /* @__PURE__ */ ne({
|
|
155
|
-
__name: "Takeaway",
|
|
156
|
-
emits: ["update:count"],
|
|
157
|
-
setup(b, {
|
|
158
|
-
emit: _
|
|
159
|
-
}) {
|
|
160
|
-
const l = W(), u = he(), e = C(() => l.rules.item.bindToVariant), y = C(() => l.rules.takeaway), p = Q(J(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, K, Y;
|
|
164
|
-
const T = f.takeawayUsed === t._id;
|
|
165
|
-
if ((!e.value || !((K = (r = f.variant) == null ? void 0 : r.variantGroupIds) != null && K.length)) && T)
|
|
166
|
-
o.push({
|
|
167
|
-
_id: f._id
|
|
168
|
-
});
|
|
169
|
-
else {
|
|
170
|
-
const ae = (((Y = f.variant) == null ? void 0 : Y.variantCombinations) || []).filter((M) => M.takeawayUsed === t._id || M.takeawayUsed == null && T).map((M) => ({
|
|
171
|
-
_id: f._id,
|
|
172
|
-
combinationKey: M.combinationKey
|
|
173
|
-
}));
|
|
174
|
-
o = [...o, ...ae];
|
|
175
|
-
}
|
|
176
|
-
return o;
|
|
177
|
-
}, [])
|
|
178
|
-
}))), {
|
|
179
|
-
filter: v,
|
|
180
|
-
searchKey: c
|
|
181
|
-
} = _e(), a = C(() => n.value.filter((t) => v([t.name, z(t.price, !1)]))), d = _;
|
|
182
|
-
oe(() => a.value.length, (t) => {
|
|
183
|
-
d("update:count", t);
|
|
184
|
-
}, {
|
|
185
|
-
immediate: !0
|
|
186
|
-
});
|
|
187
|
-
const {
|
|
188
|
-
t: s
|
|
189
|
-
} = X(), h = C(() => [{
|
|
190
|
-
accessorKey: "name",
|
|
191
|
-
header: () => s("menu.takeaway.table.columns.name"),
|
|
192
|
-
enableSorting: !1,
|
|
193
|
-
size: 700,
|
|
194
|
-
cell: (t) => {
|
|
195
|
-
const o = t.row.original, f = t.getValue();
|
|
196
|
-
return S("div", {
|
|
197
|
-
class: "flex items-center gap-8"
|
|
198
|
-
}, [S("span", {
|
|
199
|
-
class: "break-all"
|
|
200
|
-
}, f), o.name_locale ? S(fe, {
|
|
201
|
-
nameLocale: o.name_locale ?? {}
|
|
202
|
-
}) : null]);
|
|
203
|
-
}
|
|
204
|
-
}, {
|
|
205
|
-
accessorKey: "price",
|
|
206
|
-
header: () => s("menu.takeaway.table.columns.price", {
|
|
207
|
-
symbol: m.value.symbol
|
|
208
|
-
}),
|
|
209
|
-
enableSorting: !1,
|
|
210
|
-
size: 200,
|
|
211
|
-
meta: {
|
|
212
|
-
textAlign: "right"
|
|
213
|
-
},
|
|
214
|
-
cell: (t) => {
|
|
215
|
-
const o = t.getValue();
|
|
216
|
-
return z(o, !1);
|
|
217
|
-
}
|
|
218
|
-
}, {
|
|
219
|
-
accessorKey: "usedBy",
|
|
220
|
-
header: () => s("menu.takeaway.table.columns.products"),
|
|
221
|
-
enableSorting: !1,
|
|
222
|
-
size: 200,
|
|
223
|
-
cell: (t) => {
|
|
224
|
-
const o = t.getValue(), f = H(l.categorizedItems, o).flatMap((T) => T.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: (t) => S("div", {
|
|
237
|
-
class: "flex justify-end items-center"
|
|
238
|
-
}, [y.value.delete ? S(de.FmButton, {
|
|
239
|
-
prependIcon: "delete",
|
|
240
|
-
variant: N.Tertiary,
|
|
241
|
-
textColor: "neutral-gray-400",
|
|
242
|
-
onClick: (o) => {
|
|
243
|
-
o.stopPropagation(), u.deleteTakeaway(t.row.original);
|
|
244
|
-
}
|
|
245
|
-
}) : null])
|
|
246
|
-
}]), U = ue(), x = C(() => U.breakpoints.value.xs);
|
|
247
|
-
return (t, o) => {
|
|
248
|
-
const f = E("fm-search"), T = E("fm-table"), P = E("fm-button");
|
|
249
|
-
return n.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": o[2] || (o[2] = (r) => j(c) ? c.value = r : 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, (r) => (w(), V("div", {
|
|
260
|
-
key: r._id,
|
|
261
|
-
class: D(["py-12 px-16", "flex space-x-8", "items-center"]),
|
|
262
|
-
onClick: () => {
|
|
263
|
-
y.value.edit && i(u).updateTakeaway(r);
|
|
264
|
-
}
|
|
265
|
-
}, [g("div", Ue, [g("p", Ke, B(r.name), 1), g("p", Me, B(`${i(H)(i(l).categorizedItems, r.usedBy).flatMap((K) => K.items).length ?? 0} items linked`), 1), g("p", Be, " Price: " + B(m.value.symbol) + B(i(z)(r.price, !1)), 1)]), y.value.delete ? (w(), $(P, {
|
|
266
|
-
key: 0,
|
|
267
|
-
variant: i(N).Tertiary,
|
|
268
|
-
"text-color": "neutral-gray-400",
|
|
269
|
-
"prepend-icon": "delete",
|
|
270
|
-
onClick: G(() => i(u).deleteTakeaway(r), ["stop"])
|
|
271
|
-
}, null, 8, ["variant", "onClick"])) : q("", !0)], 8, Se))), 128))])], 64)) : (w(), V("div", xe, [g("div", Ce, [g("div", Te, [I(f, {
|
|
272
|
-
autofocus: "",
|
|
273
|
-
modelValue: i(c),
|
|
274
|
-
"onUpdate:modelValue": o[0] || (o[0] = (r) => j(c) ? c.value = r : null),
|
|
275
|
-
placeholder: i(s)("menu.takeaway.table.search.placeholder")
|
|
276
|
-
}, null, 8, ["modelValue", "placeholder"])])]), I(me, null, {
|
|
277
|
-
default: O(() => [I(T, {
|
|
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: o[1] || (o[1] = (r) => {
|
|
288
|
-
y.value.edit && i(u).updateTakeaway(r.original);
|
|
289
|
-
})
|
|
290
|
-
}, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
|
|
291
|
-
_: 1
|
|
292
|
-
})]))], 64)) : (w(), V("div", Pe, [I(i(re), {
|
|
293
|
-
subtitle: i(s)("menu.takeaway.empty.subtitle"),
|
|
294
|
-
title: i(s)("menu.takeaway.empty.title")
|
|
295
|
-
}, {
|
|
296
|
-
action: O(() => [y.value.create ? (w(), $(i(pe), {
|
|
297
|
-
key: 0,
|
|
298
|
-
"bind-to-variant": e.value,
|
|
299
|
-
action: "add",
|
|
300
|
-
"apply-product": "",
|
|
301
|
-
"onUpdate:takeaway": o[3] || (o[3] = (r) => i(p).updateMenu({
|
|
302
|
-
module: i(A).enum.takeaway,
|
|
303
|
-
operation: i(F.F_OPERATION_TYPE).create,
|
|
304
|
-
data: r,
|
|
305
|
-
link: i(ee)(r.usedBy || [])
|
|
306
|
-
}, r.name))
|
|
307
|
-
}, {
|
|
308
|
-
default: O(({
|
|
309
|
-
trigger: r
|
|
310
|
-
}) => [I(P, {
|
|
311
|
-
"prepend-icon": "add",
|
|
312
|
-
label: i(s)("menu.takeaway.empty.action"),
|
|
313
|
-
onClick: G(r, ["stop"])
|
|
314
|
-
}, null, 8, ["label", "onClick"])]),
|
|
315
|
-
_: 1
|
|
316
|
-
}, 8, ["bind-to-variant"])) : q("", !0)]),
|
|
317
|
-
_: 1
|
|
318
|
-
}, 8, ["subtitle", "title"])]));
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
export {
|
|
323
|
-
qe as _
|
|
324
|
-
};
|