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