@feedmepos/mf-menu 0.32.37 → 0.32.38-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-Dl-BiHwh.js → App-Cfc6q7R4.js} +7 -7
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Z4PgBxr3.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BXtuSeAK.js} +3 -3
- package/dist/{Catalog-BSZ8BAbX.js → Catalog-BwWG8aVq.js} +6 -6
- package/dist/Category-CTSxrlD3.js +224 -0
- package/dist/{Category-bGvXpr0F.js → Category-lIONtEO5.js} +9 -9
- package/dist/{CookingGuide-DijUR2JM.js → CookingGuide-Ba6fLxDH.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-B30t_PW1.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BDUxrr9V.js} +1 -1
- package/dist/{Group-CrqE40ia.js → Group-Bs1GXOJ6.js} +7 -7
- package/dist/{Group-O4L3iHx0.js → Group-C577jf-a.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-CsM72Jnq.js → Group.vue_vue_type_script_setup_true_lang-DwIQSBka.js} +227 -216
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BGR4kFzj.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DC41D4_B.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-wf0Wm51b.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DydOyrWz.js} +1743 -1743
- package/dist/{Ingredient-DvvuwOdH.js → Ingredient-DMdt_R8F.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-anFCPZZD.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DExCzIH7.js} +2 -2
- package/dist/{LinkProductSideSheet-ImK8azTA.js → LinkProductSideSheet-C5EJF94w.js} +3 -3
- package/dist/{MenuSetting-BX0ohmwF.js → MenuSetting-DWPluEWH.js} +5 -5
- package/dist/{PrintRoute-CXYZHJsf.js → PrintRoute-BmebtmN5.js} +4 -4
- package/dist/{Product-BnnwL5DZ.js → Product-D2GO3tYo.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DUBnQJZ1.js → Product.vue_vue_type_script_setup_true_lang-r6xF3HkK.js} +348 -337
- package/dist/{ProductInternalTools-DzRnmE1r.js → ProductInternalTools-Dep9C9sT.js} +23 -23
- package/dist/{Products-CtzHONQZ.js → Products-kXzyZ-qw.js} +24 -24
- package/dist/{Publish-DmIbDy8-.js → Publish-DiFxcujy.js} +3 -3
- package/dist/{Recipe-D_0Ezt1C.js → Recipe-Bb0_R7pY.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DdeQnyfQ.js → RuleView.vue_vue_type_script_setup_true_lang-BZi9zjue.js} +176 -176
- package/dist/{Scheduler-BgQsbdVM.js → Scheduler-BosF_svj.js} +3 -3
- package/dist/{ServingSequence-DCRzJsrs.js → ServingSequence-Ka7ZszUb.js} +3 -3
- package/dist/{Setting-CgtttPN_.js → Setting-ZZ-N5_ht.js} +5 -5
- package/dist/Subcategory-BGCzSst1.js +345 -0
- package/dist/{Takeaway-BfcHs1we.js → Takeaway-CILmyRDs.js} +1 -1
- package/dist/{Takeaway-CExKsbN5.js → Takeaway-Daa_CJ-H.js} +4 -4
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-B1jejzX7.js +316 -0
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-Br279NC_.js → Thumbnail.vue_vue_type_script_setup_true_lang-CCBa35X7.js} +4 -4
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-PbYAxItr.js +185 -0
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-j4xROEG7.js +6122 -0
- package/dist/{Unit-B6P_ykM-.js → Unit-D21SP540.js} +2 -2
- package/dist/Variant-BDf9DDmG.js +247 -0
- package/dist/{_id_-D2ozS9Ck.js → _id_-R8SE-ZmQ.js} +9 -9
- package/dist/app-BASWdzxI.js +363 -0
- package/dist/{app-DqyNXgYz.js → app-CqvEAGdq.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +264 -0
- package/dist/apps/mf-menu/src/components/ProductTranslationDialog.vue.d.ts +41 -0
- package/dist/apps/mf-menu/src/components/TranslationBadge.vue.d.ts +29 -0
- package/dist/apps/mf-menu/src/components/TranslationFieldSection.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/TranslationSideSheet.vue.d.ts +23 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProduct.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProductDialog.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +54 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/Form.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/OptionTable.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/ProductOverrideTranslation.vue.d.ts +22 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/UpdateForm.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/category.d.ts +8 -2
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +24 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/OptionTable.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/UpdateForm.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +24 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +30 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +125 -1
- package/dist/apps/mf-menu/src/components/feature/VariantManager/ProductVariantTranslation.vue.d.ts +37 -0
- package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +16 -0
- package/dist/apps/mf-menu/src/helper/item.d.ts +1 -0
- package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +10 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +11 -0
- package/dist/apps/mf-menu/src/helper/menuImport.d.ts +125 -1
- package/dist/apps/mf-menu/src/helper/menuSanitizer.d.ts +125 -1
- package/dist/apps/mf-menu/src/manager/menu/category.d.ts +8 -2
- package/dist/apps/mf-menu/src/manager/menu/group.d.ts +1 -0
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +125 -1
- package/dist/apps/mf-menu/src/manager/menu/subcategory.d.ts +6 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +31 -1
- package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +16 -0
- package/dist/apps/mf-menu/src/stores/manager/takeaway.d.ts +9 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +125 -1
- package/dist/apps/mf-menu/src/utils/translation.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddCategoryDialogContentComponent.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +46 -0
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +10 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-Cq9TLj-4.js +13 -0
- package/dist/assets/menu-export-Blxjlc7o.js +107 -0
- package/dist/assets/override-menu-Cny8YlWs.js +13 -0
- package/dist/assets/validate-menu-CAWtxE9g.js +13 -0
- package/dist/{catalog-CFKVaXk7.js → catalog-D1ldj55y.js} +1 -1
- package/dist/{catalogSetting-N4nT-nGm.js → catalogSetting-DdCMyQ1n.js} +1 -1
- package/dist/{currency-Bi_GukGE.js → currency-CozWj5-6.js} +1 -1
- package/dist/dayjs.min-DjVUMZe1.js +6 -0
- package/dist/{index-uiJS0BKT.js → index-B3uidhol.js} +1 -1
- package/dist/index-CZ2slj-T.js +539 -0
- package/dist/index-Cw3iqI80.js +335 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-CL6a622s.js → index.vue_vue_type_script_setup_true_lang-BMBAQiGH.js} +19063 -18861
- package/dist/item-ncimpz9a.js +8120 -0
- package/dist/{jszip.min-v__o3BM4.js → jszip.min-DaMSaZr3.js} +383 -383
- package/dist/{menu-LtIuM7Qj.js → menu-Cb5CM_BJ.js} +1 -1
- package/dist/{menuV2-N0hB53Gw.js → menuV2-2B1i4-4v.js} +24 -24
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-DZeAvlXs.js → priceTier-H4TWDspA.js} +1 -1
- package/dist/rules-aP3AB4aS.js +212 -0
- package/dist/{scheduler-FVlscyjB.js → scheduler-CnQo8MiW.js} +4 -4
- package/dist/{toExcel-DBCbupeI.js → toExcel-C99U873x.js} +2 -2
- package/dist/translation-BeqjfyEb.js +75 -0
- package/dist/{unit-DNphv-4C.js → unit-DiCr5V9I.js} +2 -2
- package/package.json +3 -3
- package/dist/Category-DMgNea31.js +0 -392
- package/dist/Subcategory-6SgvwWpX.js +0 -280
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-GAZ3S2_n.js +0 -305
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BFwMfAlB.js +0 -6024
- package/dist/Variant-DmNuLi96.js +0 -230
- package/dist/app-CE0yoao0.js +0 -363
- package/dist/assets/linked-status-BB6BrSUB.js +0 -13
- package/dist/assets/menu-export-C1TBcoi-.js +0 -107
- package/dist/assets/override-menu-C0RijOOI.js +0 -13
- package/dist/assets/validate-menu-9VpR7oZY.js +0 -13
- package/dist/category-BSGaVgyv.js +0 -156
- package/dist/dayjs.min-DgXlcVSD.js +0 -6
- package/dist/index-BaxQ5Nq0.js +0 -273
- package/dist/index-Bun2EboK.js +0 -239
- package/dist/item-DPivBmJh.js +0 -6950
- package/dist/rules-CIWTZQfh.js +0 -6
- package/dist/subcategory-CIctYwBF.js +0 -148
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { getCurrentInstance as te, defineComponent as oe, computed as x, watch as ne, h as E, resolveComponent as O, 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 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 A, B as se, ap as q, a4 as re } from "./index.vue_vue_type_script_setup_true_lang-BMBAQiGH.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-BASWdzxI.js";
|
|
6
|
+
import { a as pe, l as ee, T as ye } from "./index-Cw3iqI80.js";
|
|
7
|
+
import { u as fe } from "./search-BAPEUu1R.js";
|
|
8
|
+
import { f as L } from "./currency-CozWj5-6.js";
|
|
9
|
+
import { defineStore as _e } from "pinia";
|
|
10
|
+
import { C as ke } from "./catalog-D1ldj55y.js";
|
|
11
|
+
import { c as ve } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
12
|
+
import { g as we } from "./translation-BeqjfyEb.js";
|
|
13
|
+
function ge(T, M, 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, ...M.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(), M = Z(), l = H(M), p = W(l), s = J(), 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: z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
83
|
+
operation: N.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: z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
112
|
+
operation: N.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
|
+
}, Me = ["onClick"], Ue = {
|
|
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: M
|
|
151
|
+
}) {
|
|
152
|
+
const l = J(), 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, L(o.price, !1)]))), d = M;
|
|
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(), U = 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), ...U.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 L(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 = O("fm-search"), h = O("fm-table"), U = O("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", Ue, [k("p", Ee, S(t.name), 1), k("p", Ke, S(`${n(q)(n(l).categorizedItems, t.usedBy).flatMap((I) => I.items).length ?? 0} items linked`), 1), k("p", Ie, " Price: " + S(w.value.symbol) + S(n(L)(t.price, !1)), 1)]), f.value.delete ? (_(), G(U, {
|
|
258
|
+
key: 0,
|
|
259
|
+
variant: n(D).Tertiary,
|
|
260
|
+
"text-color": "neutral-gray-400",
|
|
261
|
+
"prepend-icon": "delete",
|
|
262
|
+
onClick: Q(() => n(p).deleteTakeaway(t), ["stop"])
|
|
263
|
+
}, null, 8, ["variant", "onClick"])) : $("", !0)], 8, Me))), 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(z.F_MENU_MODULE_V4_KEY).enum.takeaway,
|
|
295
|
+
operation: n(N.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(U, {
|
|
303
|
+
"prepend-icon": "add",
|
|
304
|
+
label: n(e)("menu.takeaway.empty.action"),
|
|
305
|
+
onClick: Q(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
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed as d, defineComponent as x, ref as F, resolveComponent as b, createElementBlock as L, openBlock as w, normalizeClass as 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,
|
|
3
|
-
import { u as S } from "./menuV2-
|
|
4
|
-
import { C as v, h as N } from "./catalog-
|
|
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-BMBAQiGH.js";
|
|
3
|
+
import { u as S } from "./menuV2-2B1i4-4v.js";
|
|
4
|
+
import { C as v, h as N } from "./catalog-D1ldj55y.js";
|
|
5
5
|
import { useSnackbar as P, useDialog as z } from "@feedmepos/ui-library";
|
|
6
|
-
import { a as T } from "./LinkProductSideSheet-
|
|
6
|
+
import { a as T } from "./LinkProductSideSheet-C5EJF94w.js";
|
|
7
7
|
import { useI18n as Q } from "@feedmepos/mf-common";
|
|
8
8
|
function q() {
|
|
9
9
|
const t = S(), o = d(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), i = d(() => {
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { defineComponent as J, ref as w, watch as G, computed as j, unref as t, resolveComponent as f, createBlock as E, openBlock as d, withCtx as _, createElementVNode as e, toDisplayString as c, createElementBlock as m, createCommentVNode as F, Fragment as g, renderList as b, createVNode as r } from "vue";
|
|
2
|
+
import { J as B } from "./index.vue_vue_type_script_setup_true_lang-BMBAQiGH.js";
|
|
3
|
+
import { useI18n as H, useLocale as K } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as P } from "./discardConfirm-BHni0LNu.js";
|
|
5
|
+
import { g as x, a as D, _ as Q, b as R } from "./translation-BeqjfyEb.js";
|
|
6
|
+
const W = { class: "fm-typo-en-title-md-600" }, X = { class: "pt-8 space-y-24" }, Y = { class: "flex flex-col gap-8" }, Z = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, ee = { class: "flex items-center gap-8 flex-wrap" }, oe = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, te = { class: "fm-typo-en-body-md-600" }, le = ["onClick"], ne = { class: "flex items-center gap-8" }, ae = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, se = { class: "fm-typo-en-body-md-400" }, ce = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, ie = { class: "fm-typo-en-body-lg-600" }, re = { class: "flex flex-col gap-32 pl-32" }, me = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "space-y-8"
|
|
9
|
+
}, ue = { class: "flex w-[100px] items-center gap-8" }, pe = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, fe = { class: "fm-typo-en-body-md-400" }, _e = { class: "flex-1" }, ve = { class: "flex gap-8 items-center justify-start" }, Ce = /* @__PURE__ */ J({
|
|
10
|
+
__name: "TranslationSideSheet",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: { type: Boolean },
|
|
13
|
+
title: {},
|
|
14
|
+
name: {},
|
|
15
|
+
nameLocale: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue", "update:nameLocale"],
|
|
18
|
+
setup(I, { emit: N }) {
|
|
19
|
+
const u = I, p = N, { t: i } = H(), { localeList: v } = K(), s = w([]), C = w([]);
|
|
20
|
+
function O() {
|
|
21
|
+
return !u.nameLocale || Object.keys(u.nameLocale).length === 0 ? [] : Object.entries(u.nameLocale).map(([o, n]) => ({
|
|
22
|
+
localeCode: o,
|
|
23
|
+
value: n
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
G(
|
|
27
|
+
() => [u.modelValue, u.nameLocale],
|
|
28
|
+
([o]) => {
|
|
29
|
+
o && (s.value = O(), C.value = B.clone(s.value));
|
|
30
|
+
},
|
|
31
|
+
{ immediate: !0 }
|
|
32
|
+
);
|
|
33
|
+
const k = j(() => {
|
|
34
|
+
const o = new Set(s.value.map((a) => a.localeCode));
|
|
35
|
+
return t(v).filter((a) => !o.has(a.code)).map((a) => ({
|
|
36
|
+
code: a.code,
|
|
37
|
+
name: a.name,
|
|
38
|
+
icon: x(a.code)
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
function S(o) {
|
|
42
|
+
const n = t(v).find((a) => a.code === o);
|
|
43
|
+
n && s.value.push({
|
|
44
|
+
localeCode: n.code,
|
|
45
|
+
value: ""
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function T(o) {
|
|
49
|
+
s.value = s.value.filter((n) => n.localeCode !== o);
|
|
50
|
+
}
|
|
51
|
+
function $() {
|
|
52
|
+
return !B.isEqual(s.value, C.value);
|
|
53
|
+
}
|
|
54
|
+
function z() {
|
|
55
|
+
const o = s.value.filter((n) => n.value.trim());
|
|
56
|
+
if (o.length === 0)
|
|
57
|
+
p("update:nameLocale", void 0);
|
|
58
|
+
else {
|
|
59
|
+
const n = {};
|
|
60
|
+
o.forEach((a) => {
|
|
61
|
+
n[a.localeCode] = a.value.trim();
|
|
62
|
+
}), p("update:nameLocale", n);
|
|
63
|
+
}
|
|
64
|
+
p("update:modelValue", !1);
|
|
65
|
+
}
|
|
66
|
+
function U() {
|
|
67
|
+
p("update:modelValue", !1);
|
|
68
|
+
}
|
|
69
|
+
const L = P($, U), V = j({
|
|
70
|
+
get: () => u.modelValue,
|
|
71
|
+
set: (o) => p("update:modelValue", o)
|
|
72
|
+
});
|
|
73
|
+
return (o, n) => {
|
|
74
|
+
const a = f("FmIcon"), y = f("fm-button"), A = f("FmMenu"), M = f("fm-text-field"), q = f("fm-side-sheet");
|
|
75
|
+
return d(), E(q, {
|
|
76
|
+
modelValue: V.value,
|
|
77
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => V.value = l),
|
|
78
|
+
"max-width": 720,
|
|
79
|
+
"onOn:clickedAway": t(L)
|
|
80
|
+
}, {
|
|
81
|
+
"side-sheet-header": _(() => [
|
|
82
|
+
e("p", W, c(o.title) + " " + c(t(i)("menu.common.translation.title_suffix")), 1)
|
|
83
|
+
]),
|
|
84
|
+
"side-sheet-footer": _(() => [
|
|
85
|
+
e("div", ve, [
|
|
86
|
+
r(y, {
|
|
87
|
+
label: t(i)("common.save"),
|
|
88
|
+
size: "lg",
|
|
89
|
+
variant: "primary",
|
|
90
|
+
onClick: z
|
|
91
|
+
}, null, 8, ["label"]),
|
|
92
|
+
r(y, {
|
|
93
|
+
label: t(i)("common.cancel"),
|
|
94
|
+
size: "lg",
|
|
95
|
+
variant: "tertiary",
|
|
96
|
+
onClick: t(L)
|
|
97
|
+
}, null, 8, ["label", "onClick"])
|
|
98
|
+
])
|
|
99
|
+
]),
|
|
100
|
+
default: _(() => [
|
|
101
|
+
e("div", X, [
|
|
102
|
+
e("div", Y, [
|
|
103
|
+
e("p", Z, c(t(i)("menu.common.translation.language")), 1),
|
|
104
|
+
e("div", ee, [
|
|
105
|
+
(d(!0), m(g, null, b(s.value, (l) => (d(), m("div", {
|
|
106
|
+
key: l.localeCode,
|
|
107
|
+
class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
|
|
108
|
+
}, [
|
|
109
|
+
e("div", oe, c(t(x)(l.localeCode)), 1),
|
|
110
|
+
e("span", te, c(t(D)(l.localeCode, t(v))), 1),
|
|
111
|
+
r(a, {
|
|
112
|
+
name: "close",
|
|
113
|
+
class: "cursor-pointer",
|
|
114
|
+
variant: "secondary",
|
|
115
|
+
onClick: (h) => T(l.localeCode)
|
|
116
|
+
}, null, 8, ["onClick"])
|
|
117
|
+
]))), 128)),
|
|
118
|
+
k.value.length > 0 ? (d(), E(A, { key: 0 }, {
|
|
119
|
+
"menu-button": _(() => [
|
|
120
|
+
r(y, {
|
|
121
|
+
variant: "secondary",
|
|
122
|
+
"border-color": "neutral-gray-300",
|
|
123
|
+
"text-color": "neutral-gray-400",
|
|
124
|
+
icon: "add"
|
|
125
|
+
})
|
|
126
|
+
]),
|
|
127
|
+
default: _(() => [
|
|
128
|
+
(d(!0), m(g, null, b(k.value, (l) => (d(), m("div", {
|
|
129
|
+
class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
|
|
130
|
+
key: l.code,
|
|
131
|
+
onClick: (h) => S(l.code)
|
|
132
|
+
}, [
|
|
133
|
+
e("div", ne, [
|
|
134
|
+
e("div", ae, c(l.icon), 1),
|
|
135
|
+
e("span", se, c(l.name), 1)
|
|
136
|
+
])
|
|
137
|
+
], 8, le))), 128))
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
})) : F("", !0)
|
|
141
|
+
])
|
|
142
|
+
]),
|
|
143
|
+
e("div", ce, [
|
|
144
|
+
e("div", de, [
|
|
145
|
+
r(a, { name: "keyboard_arrow_down" }),
|
|
146
|
+
e("p", ie, c(t(i)("menu.common.translation.name_section", { entity: o.title })), 1)
|
|
147
|
+
]),
|
|
148
|
+
e("div", re, [
|
|
149
|
+
r(Q, {
|
|
150
|
+
label: t(i)("menu.common.translation.default"),
|
|
151
|
+
"model-value": o.name
|
|
152
|
+
}, null, 8, ["label", "model-value"]),
|
|
153
|
+
s.value.length > 0 ? (d(), m("div", me, [
|
|
154
|
+
r(R, {
|
|
155
|
+
label: t(i)("menu.common.translation.translation_label")
|
|
156
|
+
}, null, 8, ["label"]),
|
|
157
|
+
(d(!0), m(g, null, b(s.value, (l) => (d(), m("div", {
|
|
158
|
+
key: l.localeCode,
|
|
159
|
+
class: "flex items-center gap-16"
|
|
160
|
+
}, [
|
|
161
|
+
e("div", ue, [
|
|
162
|
+
e("div", pe, c(t(x)(l.localeCode)), 1),
|
|
163
|
+
e("span", fe, c(t(D)(l.localeCode, t(v))), 1)
|
|
164
|
+
]),
|
|
165
|
+
e("div", _e, [
|
|
166
|
+
r(M, {
|
|
167
|
+
modelValue: l.value,
|
|
168
|
+
"onUpdate:modelValue": (h) => l.value = h,
|
|
169
|
+
placeholder: t(i)("menu.group.translation.placeholder")
|
|
170
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
171
|
+
])
|
|
172
|
+
]))), 128))
|
|
173
|
+
])) : F("", !0)
|
|
174
|
+
])
|
|
175
|
+
])
|
|
176
|
+
])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
export {
|
|
184
|
+
Ce as _
|
|
185
|
+
};
|