@feedmepos/mf-menu 0.32.83-dev.1 → 0.32.83
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-BYdCC3TK.js → App-Bw-ozzec.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CsMCfu1s.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DHDH7KKi.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CWH86f_J.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-BXUoYPtC.js} +3 -3
- package/dist/{Catalog-BPRRb4QE.js → Catalog-Dmi4r1Zs.js} +6 -6
- package/dist/{CatalogBinding-B2vhvUHz.js → CatalogBinding-B7H-nEwM.js} +13 -13
- package/dist/{Category-zKR2QaeE.js → Category-BKwpeCXh.js} +4 -4
- package/dist/{Category-DeeXKn4P.js → Category-CwBmbR5g.js} +4 -4
- package/dist/{CookingGuide-Wm39wm7Q.js → CookingGuide-Dhsu1zWp.js} +5 -5
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CAHNxiEJ.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DvGdDV9p.js} +1 -1
- package/dist/{Group-BNcZYOU4.js → Group-Ceu7Copf.js} +3 -3
- package/dist/{Group-E2HYqd9f.js → Group-DNC-Usx0.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DPk_cgPi.js → Group.vue_vue_type_script_setup_true_lang-D7J8SXa7.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B0X5brpK.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CHdTcTM3.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DxowkX0c.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-pBlcLv-w.js} +212 -212
- package/dist/{Ingredient-DcJrO6OE.js → Ingredient-CC0JhuTG.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DfrJBP75.js → InventoryBinding.vue_vue_type_script_setup_true_lang-hv2j96xE.js} +2 -2
- package/dist/{LinkProductSideSheet-DTzuEcF5.js → LinkProductSideSheet-TN2_U83N.js} +4 -4
- package/dist/{MenuSetting-DICpAfNK.js → MenuSetting-CVvexu1x.js} +7 -7
- package/dist/{OrderPacing-pD1pgJG5.js → OrderPacing-Bdwdg02x.js} +5 -5
- package/dist/{PrintRoute-BAY_gpJS.js → PrintRoute-CjFa5lDf.js} +5 -5
- package/dist/{Product-B_YsLenC.js → Product-CJju3e91.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DEsNttgJ.js → Product.vue_vue_type_script_setup_true_lang-CgyRlUfF.js} +14 -14
- package/dist/{ProductInternalTools-CfA-6XtS.js → ProductInternalTools-x58c-Eqi.js} +7 -7
- package/dist/{Products-arAA8I2u.js → Products-C1kMAf09.js} +34 -34
- package/dist/Publish-CWU3b98i.js +1608 -0
- package/dist/{Recipe-DRcrzXhA.js → Recipe-DzzZnDyw.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CAVrU6RI.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-C1SJG0VC.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DYnnO3SQ.js → RuleView.vue_vue_type_script_setup_true_lang-DKCI5FWu.js} +731 -731
- package/dist/{Scheduler-oxLqE74K.js → Scheduler-BNfWt8Dg.js} +3 -3
- package/dist/{ServingSequence-DVkB7hDy.js → ServingSequence-Cd4h0cg6.js} +3 -3
- package/dist/{Setting-DOsTp22X.js → Setting-Doi12dmL.js} +5 -5
- package/dist/{Subcategory-BaclYZ5p.js → Subcategory-DWeszc_Q.js} +6 -6
- package/dist/Takeaway-BN4ALKLd.js +64 -0
- package/dist/{Takeaway-D2jvmsuu.js → Takeaway-hxK-Doql.js} +1 -1
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-6IZPDhaJ.js +331 -0
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-M3Oh6Dr6.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-CoJ6I8th.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-DjswjUjQ.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-R8Uq2q8a.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dcd1ek03.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CDE3C737.js} +602 -601
- package/dist/{Unit-Dx8HMvAE.js → Unit-eH2N7G3C.js} +2 -2
- package/dist/{Variant-Dx6EWp55.js → Variant-6Le_fght.js} +3 -3
- package/dist/{_id_-DIsWlajV.js → _id_-DEsYj32K.js} +10 -10
- package/dist/{app-curMXZbh.js → app-BchMdmn0.js} +1 -1
- package/dist/{app-BdtPzkjA.js → app-C3fvLdk6.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-DsxqMxwe.js → linked-status-6gBSlnSK.js} +2 -2
- package/dist/assets/{menu-export-DcW52Lu3.js → menu-export--ku4LX8B.js} +2 -2
- package/dist/assets/{override-menu-DPPsvKsd.js → override-menu-Cfr4mD2N.js} +2 -2
- package/dist/assets/{validate-menu-Byl7hJI2.js → validate-menu-p5dTyV3b.js} +2 -2
- package/dist/{catalog-D4uhTN3P.js → catalog-BBW_JOmi.js} +1 -1
- package/dist/{catalogSetting-_zy50XFm.js → catalogSetting-FUxG-o8e.js} +1 -1
- package/dist/{currency-8AD3AdtT.js → currency-dN61r7Dj.js} +1 -1
- package/dist/{dayjs.min-CSadJcjJ.js → dayjs.min-zUn0kE7h.js} +2 -2
- package/dist/{discardConfirm-egY5vwUU.js → discardConfirm-JSuBPCBO.js} +1 -1
- package/dist/{index-B0hyUFIc.js → index-26hFA0dv.js} +1 -1
- package/dist/{index-BPGZgTH-.js → index-BXf2ffOW.js} +5 -5
- package/dist/{index-BpoYrrVu.js → index-wndkX4SS.js} +137 -131
- package/dist/{index.vue_vue_type_script_setup_true_lang-qUahjdoy.js → index.vue_vue_type_script_setup_true_lang-BAVu4NTt.js} +10602 -10592
- package/dist/{item-CGqK7sn4.js → item-D6itBJWi.js} +1290 -1289
- package/dist/{jszip.min-Qb_fhEy6.js → jszip.min-CJAQHq0K.js} +3 -3
- package/dist/{linkProducts-DwBnfj3L.js → linkProducts-BCBOugXd.js} +4 -4
- package/dist/{memberPricing-CcXhcbV9.js → memberPricing-D4BvlT66.js} +1 -1
- package/dist/{menu-Cmz90lOu.js → menu-Bn85J25r.js} +1 -1
- package/dist/{menuV2-yXOZpuda.js → menuV2-DwgKWOb1.js} +38 -38
- package/dist/{order_pacing-Bp1Hpcp2.js → order_pacing-DlMIzFpD.js} +5 -5
- package/dist/{priceTier-B14Zw5XH.js → priceTier-mtlQOB7P.js} +1 -1
- package/dist/{rules-COZi7aRn.js → rules-CpmrQrSF.js} +3 -3
- package/dist/{scheduler-eoUNmYqB.js → scheduler-574B11my.js} +5 -5
- package/dist/{toExcel-BkhEG-vD.js → toExcel-B-Qbf0yE.js} +2 -2
- package/dist/{unit-Bmje7das.js → unit-BvrDtd_s.js} +3 -3
- package/package.json +2 -2
- package/dist/Publish-BORONVKG.js +0 -1582
- package/dist/Takeaway-BbcmF6t2.js +0 -64
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BpswLmDw.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-qUahjdoy.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-BpswLmDw.js";
|
|
8
|
-
import { T as S, l as L } from "./index-BpoYrrVu.js";
|
|
9
|
-
import { a as O } from "./menu-Cmz90lOu.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-qUahjdoy.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-BdtPzkjA.js";
|
|
6
|
-
import { a as ye, l as ee, T as pe } from "./index-BpoYrrVu.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-8AD3AdtT.js";
|
|
10
|
-
import { defineStore as ke } from "pinia";
|
|
11
|
-
import { C as ve } from "./catalog-D4uhTN3P.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
|
-
};
|