@feedmepos/mf-menu 0.18.17 → 0.19.0-beta.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/ApplyProduct.vue_vue_type_script_setup_true_lang-DFJJHptK.js +158 -0
- package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BJ0b_uKf.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CXoRwrTi.js} +2 -2
- package/dist/Catalog-CXzqtCF8.js +551 -0
- package/dist/Category-DKbtLbq8.js +387 -0
- package/dist/CookingGuide-BKon8TdH.js +862 -0
- package/dist/Group-D1UDksBG.js +46 -0
- package/dist/{Group-jEtbECLb.js → Group-izOWb_Bh.js} +1 -1
- package/dist/Group.vue_vue_type_script_setup_true_lang-DAlQcgYp.js +558 -0
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Q7es2wmt.js +237 -0
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bw4uxqAp.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Db0uYw5O.js} +11723 -11723
- package/dist/Ingredient-BIJu9P_9.js +484 -0
- package/dist/LinkProductSideSheet-BNdFZThd.js +104 -0
- package/dist/PrintRoute--fYPFcy7.js +417 -0
- package/dist/{Product-Bnr9oFr2.js → Product-vLtISbkD.js} +1 -1
- package/dist/Product.vue_vue_type_script_setup_true_lang-BHCihe6o.js +826 -0
- package/dist/Products-JaCNtcHS.js +236 -0
- package/dist/Publish-jpmiyB-b.js +525 -0
- package/dist/Recipe-B6y-oLPG.js +320 -0
- package/dist/Scheduler-Dj1rlr-U.js +222 -0
- package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-BVAkohGJ.js +48 -0
- package/dist/ServingSequence-BhIfCyXl.js +4 -0
- package/dist/{Setting-DN8TQdIR.js → Setting-B5R1JfaL.js} +1 -1
- package/dist/Setting.vue_vue_type_script_setup_true_lang-xXtg0JOn.js +253 -0
- package/dist/Takeaway-BSFSz_JL.js +63 -0
- package/dist/{Takeaway-y0Nk0JAb.js → Takeaway-DjFTtbw6.js} +1 -1
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BUGL0wfZ.js +302 -0
- package/dist/TaxSetting-D9Q8XNgJ.js +25 -0
- package/dist/Unit-Cr_8O3zB.js +142 -0
- package/dist/Variant-loUMfNRB.js +222 -0
- package/dist/_id_-0w7KjYyQ.js +189 -0
- package/dist/{app-D7e31gIv.js → app-t9ONnc0s.js} +31701 -26207
- package/dist/app.js +7 -6
- package/dist/apps/mf-menu/src/app.d.ts +2784 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/OrderFrom.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/manager/menu/catalog.d.ts +1 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +1 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +16 -16
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +12 -12
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +4 -4
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +4 -4
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-D5tq3eE2.js → linked-status-DLL4aRiX.js} +8 -8
- package/dist/assets/{validate-menu-AcCpPyQZ.js → validate-menu-CoXc16jh.js} +8 -8
- package/dist/{catalog-Ck7lLTN2.js → catalog-4OmC0JA3.js} +66 -62
- package/dist/category-BE33DRqp.js +155 -0
- package/dist/{currency-CclA5a-2.js → currency-JHgYNbTQ.js} +1 -1
- package/dist/{index-DDd9B_ur.js → index-CE3zjhyh.js} +732 -740
- package/dist/index-pSg9p-28.js +238 -0
- package/dist/item-CEPx51U1.js +6371 -0
- package/dist/{lodash-BIQx_fko.js → lodash-VivR_BQ2.js} +1 -1
- package/dist/{menu-CYzbNubv.js → menu-ETQrtbbU.js} +1 -1
- package/dist/{object-DUtbNpoS.js → object-DEM5FMTB.js} +4 -4
- package/dist/scheduler-SRT_5Nio.js +491 -0
- package/dist/string-DpfFixWH.js +4 -0
- package/dist/style.css +1 -1
- package/dist/takeaway-RcvqKigG.js +267 -0
- package/dist/{toExcel-BXPcj8Gp.js → toExcel-BcgskY3F.js} +2 -2
- package/dist/unit-DLL7xIF1.js +350 -0
- package/package.json +4 -2
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-D9QsJ4vO.js +0 -155
- package/dist/Catalog-CZW54QJU.js +0 -570
- package/dist/Category-DvsP_L7d.js +0 -405
- package/dist/CookingGuide-DC3uXetk.js +0 -848
- package/dist/Group-DK5xqeYX.js +0 -44
- package/dist/Group.vue_vue_type_script_setup_true_lang-DGZ9hnPg.js +0 -538
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BQXqlXw4.js +0 -234
- package/dist/Ingredient-354LLwdX.js +0 -498
- package/dist/LinkProductSideSheet-anxSsu0z.js +0 -102
- package/dist/PrintRoute-DrSvtNLX.js +0 -425
- package/dist/Product.vue_vue_type_script_setup_true_lang-bBY54Q_1.js +0 -815
- package/dist/Products-CZyueqSO.js +0 -234
- package/dist/Publish-kRM1UuPk.js +0 -518
- package/dist/Recipe-nKpLIJs8.js +0 -345
- package/dist/Scheduler-DmZ8atXG.js +0 -233
- package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-CdsxA-p0.js +0 -48
- package/dist/ServingSequence-j00_ko5R.js +0 -4
- package/dist/Setting.vue_vue_type_script_setup_true_lang-Cx06MCJs.js +0 -247
- package/dist/Takeaway-BXZXCAaM.js +0 -61
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-9WVkdLZF.js +0 -316
- package/dist/TaxSetting-DdHx7ACN.js +0 -21
- package/dist/Unit-biPvleyL.js +0 -161
- package/dist/Variant-BP1IRNQx.js +0 -231
- package/dist/_id_-BiaNDI2N.js +0 -188
- package/dist/category-KiA5-36F.js +0 -154
- package/dist/index-BFeZlU8X.js +0 -232
- package/dist/item-Bcg7SiYv.js +0 -6325
- package/dist/scheduler-D1tgE0_9.js +0 -480
- package/dist/takeaway-BKsoD4EL.js +0 -264
- package/dist/unit-CswFvAyc.js +0 -346
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import { defineComponent as T, computed as V, ref as I, resolveComponent as C, openBlock as h, createBlock as L, unref as c, withCtx as R, createElementVNode as o, toDisplayString as F, createVNode as s, createElementBlock as $, Fragment as P, renderList as Y, onMounted as oe, withModifiers as O, createCommentVNode as ne, h as K } from "vue";
|
|
2
|
+
import { n as q, d as W, D as J, c as se, e as ie, a as Q, x as ue, u as ce, b as re, j as de, k as me } from "./app-t9ONnc0s.js";
|
|
3
|
+
import { useSnackbar as X, useDialogChild as pe, useDialog as ge, components as G } from "@feedmepos/ui-library";
|
|
4
|
+
import { u as ve, l as be } from "./lodash-VivR_BQ2.js";
|
|
5
|
+
import { _ as fe } from "./TextChip.vue_vue_type_script_setup_true_lang-CNp85hoQ.js";
|
|
6
|
+
import { _ as _e, w as he } from "./InfoBasic.vue_vue_type_script_setup_true_lang-DxQBDu16.js";
|
|
7
|
+
import { useRouter as ye } from "vue-router";
|
|
8
|
+
import { useCoreStore as Ce } from "@feedmepos/mf-common";
|
|
9
|
+
const ke = { class: "fm-typo-en-title-md-600" }, we = { class: "mt-40" }, xe = { class: "fm-typo-en-title-sm-600" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Fe = { class: "flex gap-8 items-center justify-start" }, Se = /* @__PURE__ */ T({
|
|
10
|
+
__name: "UpdateCatalogDialog",
|
|
11
|
+
props: {
|
|
12
|
+
catalogs: {
|
|
13
|
+
type: Array,
|
|
14
|
+
required: !0
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: ["onComplete"],
|
|
18
|
+
setup(k, { expose: w, emit: l }) {
|
|
19
|
+
const { t: i } = q(), n = k;
|
|
20
|
+
w({
|
|
21
|
+
show: S,
|
|
22
|
+
hide: x
|
|
23
|
+
});
|
|
24
|
+
const p = l;
|
|
25
|
+
function y() {
|
|
26
|
+
return {
|
|
27
|
+
restaurantId: "",
|
|
28
|
+
catalogId: void 0,
|
|
29
|
+
takeawayCatalog: void 0,
|
|
30
|
+
pickupCatalog: null,
|
|
31
|
+
additionalCatalogs: []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const _ = V(() => [
|
|
35
|
+
{
|
|
36
|
+
label: i("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
37
|
+
value: null
|
|
38
|
+
},
|
|
39
|
+
...n.catalogs.map((v) => ({
|
|
40
|
+
label: v.name,
|
|
41
|
+
value: v._id
|
|
42
|
+
}))
|
|
43
|
+
]), g = V(() => [
|
|
44
|
+
{
|
|
45
|
+
label: i("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
46
|
+
value: null
|
|
47
|
+
},
|
|
48
|
+
...n.catalogs.map((v) => ({
|
|
49
|
+
label: v.name,
|
|
50
|
+
value: v._id
|
|
51
|
+
}))
|
|
52
|
+
]), t = I(y()), d = I(!1), f = I(void 0);
|
|
53
|
+
function S(v) {
|
|
54
|
+
f.value = v ? W(v) : y(), t.value = W(f.value), d.value = !0;
|
|
55
|
+
}
|
|
56
|
+
function x() {
|
|
57
|
+
d.value = !1;
|
|
58
|
+
}
|
|
59
|
+
const U = ve(
|
|
60
|
+
() => !be.isEqual(f.value, t.value),
|
|
61
|
+
() => {
|
|
62
|
+
x();
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
function B() {
|
|
66
|
+
x(), p("onComplete", t.value);
|
|
67
|
+
}
|
|
68
|
+
return (v, b) => {
|
|
69
|
+
const A = C("FmSelect"), E = C("FmCheckbox"), M = C("FmButton"), D = C("FmSideSheet");
|
|
70
|
+
return h(), L(D, {
|
|
71
|
+
modelValue: d.value,
|
|
72
|
+
"onUpdate:modelValue": b[5] || (b[5] = (u) => d.value = u),
|
|
73
|
+
"max-width": 560,
|
|
74
|
+
"onOn:clickedAway": c(U)
|
|
75
|
+
}, {
|
|
76
|
+
"side-sheet-header": R(() => [
|
|
77
|
+
o("span", ke, F(c(i)("menu.publish.update_catalog_dialog.title")), 1)
|
|
78
|
+
]),
|
|
79
|
+
"side-sheet-footer": R(() => [
|
|
80
|
+
o("div", Fe, [
|
|
81
|
+
s(M, {
|
|
82
|
+
label: c(i)("menu.publish.update_catalog_dialog.actions.update"),
|
|
83
|
+
size: "lg",
|
|
84
|
+
variant: "primary",
|
|
85
|
+
onClick: b[4] || (b[4] = () => B())
|
|
86
|
+
}, null, 8, ["label"]),
|
|
87
|
+
s(M, {
|
|
88
|
+
label: c(i)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
89
|
+
size: "lg",
|
|
90
|
+
variant: "tertiary",
|
|
91
|
+
onClick: x
|
|
92
|
+
}, null, 8, ["label"])
|
|
93
|
+
])
|
|
94
|
+
]),
|
|
95
|
+
default: R(() => [
|
|
96
|
+
s(A, {
|
|
97
|
+
modelValue: t.value.catalogId,
|
|
98
|
+
"onUpdate:modelValue": b[0] || (b[0] = (u) => t.value.catalogId = u),
|
|
99
|
+
items: _.value,
|
|
100
|
+
class: "mb-24",
|
|
101
|
+
label: c(i)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
102
|
+
}, null, 8, ["modelValue", "items", "label"]),
|
|
103
|
+
s(A, {
|
|
104
|
+
modelValue: t.value.takeawayCatalog,
|
|
105
|
+
"onUpdate:modelValue": b[1] || (b[1] = (u) => t.value.takeawayCatalog = u),
|
|
106
|
+
items: g.value,
|
|
107
|
+
class: "mb-24",
|
|
108
|
+
label: c(i)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
109
|
+
}, null, 8, ["modelValue", "items", "label"]),
|
|
110
|
+
s(A, {
|
|
111
|
+
modelValue: t.value.pickupCatalog,
|
|
112
|
+
"onUpdate:modelValue": b[2] || (b[2] = (u) => t.value.pickupCatalog = u),
|
|
113
|
+
items: g.value,
|
|
114
|
+
label: c(i)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
115
|
+
}, null, 8, ["modelValue", "items", "label"]),
|
|
116
|
+
o("div", we, [
|
|
117
|
+
o("div", xe, F(c(i)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
118
|
+
o("div", Ve, F(c(i)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
119
|
+
(h(!0), $(P, null, Y(k.catalogs, (u) => (h(), $("div", {
|
|
120
|
+
key: u._id
|
|
121
|
+
}, [
|
|
122
|
+
s(E, {
|
|
123
|
+
modelValue: t.value.additionalCatalogs,
|
|
124
|
+
"onUpdate:modelValue": b[3] || (b[3] = (j) => t.value.additionalCatalogs = j),
|
|
125
|
+
label: u.name,
|
|
126
|
+
value: u._id
|
|
127
|
+
}, null, 8, ["modelValue", "label", "value"])
|
|
128
|
+
]))), 128))
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
function Z(k) {
|
|
137
|
+
return k ? J(k).format("DD/MM/YY HH:mm") : "-";
|
|
138
|
+
}
|
|
139
|
+
function Ae(k, w, l) {
|
|
140
|
+
const i = (n, p = !1) => {
|
|
141
|
+
var y;
|
|
142
|
+
return n === void 0 && !p ? "-" : ((y = l.find((_) => _.value === (n || null))) == null ? void 0 : y.label) || "-";
|
|
143
|
+
};
|
|
144
|
+
return k.map((n) => {
|
|
145
|
+
var g;
|
|
146
|
+
const p = (g = w.find(({ _id: t }) => t === n._id)) == null ? void 0 : g.posVersion, y = !!p && !!se.Pos.canUse({ feature: ie.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: p }), _ = i(n.catalogId);
|
|
147
|
+
return {
|
|
148
|
+
...n,
|
|
149
|
+
_default: _,
|
|
150
|
+
_posTakeaway: n.takeawayCatalog ? i(n.takeawayCatalog) : _,
|
|
151
|
+
_additionalCatalogs: (n.additionalCatalogs || []).map((t) => i(t)),
|
|
152
|
+
_lastUpdate: Z(n.updatedAt),
|
|
153
|
+
_pickup: y ? i(n.pickupCatalog, !0) : "-",
|
|
154
|
+
_canUsePickup: y,
|
|
155
|
+
_posVersion: p || "-"
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const Ie = {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "flex items-center justify-center"
|
|
162
|
+
}, $e = {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: "space-y-16"
|
|
165
|
+
}, Me = { class: "text-fm-color-typo-secondary" }, De = { class: "space-y-4" }, Re = /* @__PURE__ */ T({
|
|
166
|
+
__name: "RevertDialog",
|
|
167
|
+
props: {
|
|
168
|
+
restaurant: {}
|
|
169
|
+
},
|
|
170
|
+
setup(k) {
|
|
171
|
+
const w = k, l = X(), { custom: i } = Q(l), n = I(!1), p = I(null);
|
|
172
|
+
async function y() {
|
|
173
|
+
await i(
|
|
174
|
+
async () => {
|
|
175
|
+
var d;
|
|
176
|
+
p.value = await ue.readMenuById(((d = w.restaurant.revertConfig) == null ? void 0 : d._id) || "");
|
|
177
|
+
},
|
|
178
|
+
{ isLoading: n }
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
const _ = V(() => {
|
|
182
|
+
var d;
|
|
183
|
+
return [
|
|
184
|
+
{ label: "Main", value: null },
|
|
185
|
+
...(((d = p.value) == null ? void 0 : d.modules.catalog) || []).map((f) => ({
|
|
186
|
+
label: f.name,
|
|
187
|
+
value: f._id
|
|
188
|
+
}))
|
|
189
|
+
];
|
|
190
|
+
}), { t: g } = q(), t = V(() => {
|
|
191
|
+
var S;
|
|
192
|
+
const d = w.restaurant.revertConfig;
|
|
193
|
+
if (!d) return [];
|
|
194
|
+
const f = Ae(
|
|
195
|
+
[
|
|
196
|
+
{
|
|
197
|
+
...d,
|
|
198
|
+
catalogId: d.catalogId || null
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
Ce().restaurants.value,
|
|
202
|
+
_.value
|
|
203
|
+
)[0];
|
|
204
|
+
return [
|
|
205
|
+
{ label: g("menu.revert.labels.restaurant"), value: w.restaurant.name },
|
|
206
|
+
{
|
|
207
|
+
label: g("menu.revert.labels.revert_to"),
|
|
208
|
+
value: Z((S = p.value) == null ? void 0 : S.updatedAt)
|
|
209
|
+
},
|
|
210
|
+
{ label: g("menu.revert.labels.default"), value: f._default },
|
|
211
|
+
{ label: g("menu.revert.labels.pos_takeaway"), value: f._posTakeaway },
|
|
212
|
+
{ label: g("menu.revert.labels.pickup"), value: f._pickup },
|
|
213
|
+
{
|
|
214
|
+
label: g("menu.revert.labels.additional_catalogs"),
|
|
215
|
+
value: f._additionalCatalogs.join(", ")
|
|
216
|
+
}
|
|
217
|
+
];
|
|
218
|
+
});
|
|
219
|
+
return oe(async () => y()), pe(), (d, f) => {
|
|
220
|
+
const S = C("FmCircularProgress");
|
|
221
|
+
return n.value ? (h(), $("div", Ie, [
|
|
222
|
+
s(S, { size: "lg" })
|
|
223
|
+
])) : (h(), $("div", $e, [
|
|
224
|
+
o("div", Me, F(c(g)("menu.revert.description", { name: w.restaurant.name })), 1),
|
|
225
|
+
o("div", De, [
|
|
226
|
+
(h(!0), $(P, null, Y(t.value, (x) => (h(), L(_e, {
|
|
227
|
+
key: x.label,
|
|
228
|
+
name: x.label,
|
|
229
|
+
value: x.value || "--"
|
|
230
|
+
}, null, 8, ["name", "value"]))), 128))
|
|
231
|
+
])
|
|
232
|
+
]));
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}), Ue = {
|
|
236
|
+
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
237
|
+
}, Le = {
|
|
238
|
+
class: "flex items-center xs:mb-8 mb-24"
|
|
239
|
+
}, Pe = {
|
|
240
|
+
class: "mr-8"
|
|
241
|
+
}, Be = {
|
|
242
|
+
class: "fm-typo-en-title-md-600"
|
|
243
|
+
}, Ee = {
|
|
244
|
+
class: "xs:hidden"
|
|
245
|
+
}, Ne = {
|
|
246
|
+
class: "flex justify-end"
|
|
247
|
+
}, Oe = {
|
|
248
|
+
class: "grow flex flex-col gap-4"
|
|
249
|
+
}, je = {
|
|
250
|
+
class: "flex gap-8 items-center"
|
|
251
|
+
}, ze = {
|
|
252
|
+
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
253
|
+
}, Ke = {
|
|
254
|
+
class: "space-y-4"
|
|
255
|
+
}, Te = {
|
|
256
|
+
class: "fm-typo-en-body-lg-600"
|
|
257
|
+
}, Ye = {
|
|
258
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
259
|
+
}, qe = {
|
|
260
|
+
class: "flex gap-8"
|
|
261
|
+
}, He = {
|
|
262
|
+
class: "xs:block hidden fixed bottom-72 right-16"
|
|
263
|
+
}, ta = /* @__PURE__ */ T({
|
|
264
|
+
__name: "Publish",
|
|
265
|
+
setup(k) {
|
|
266
|
+
const w = ye(), {
|
|
267
|
+
t: l
|
|
268
|
+
} = q(), i = (e) => t.state.menu.updatedAt === e.updatedAt, n = ({
|
|
269
|
+
row: e
|
|
270
|
+
}) => {
|
|
271
|
+
const a = i(e);
|
|
272
|
+
return s(fe, {
|
|
273
|
+
label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
274
|
+
variant: a ? "success" : "warning"
|
|
275
|
+
}, null);
|
|
276
|
+
}, p = I({}), y = [{
|
|
277
|
+
accessorKey: "name",
|
|
278
|
+
header: () => l("menu.publish.table.columns.restaurant"),
|
|
279
|
+
cell: (e) => e.getValue(),
|
|
280
|
+
enableSorting: !0
|
|
281
|
+
}, {
|
|
282
|
+
accessorKey: "catalog",
|
|
283
|
+
header: () => l("menu.publish.table.columns.default"),
|
|
284
|
+
enableSorting: !1,
|
|
285
|
+
cell: (e) => e.getValue().default
|
|
286
|
+
}, {
|
|
287
|
+
accessorKey: "catalog",
|
|
288
|
+
header: () => l("menu.publish.table.columns.pos_takeaway"),
|
|
289
|
+
enableSorting: !1,
|
|
290
|
+
cell: (e) => e.getValue().takeaway
|
|
291
|
+
}, {
|
|
292
|
+
accessorKey: "catalog",
|
|
293
|
+
header: () => l("menu.publish.table.columns.pickup"),
|
|
294
|
+
enableSorting: !1,
|
|
295
|
+
cell: (e) => e.getValue().pickup
|
|
296
|
+
}, {
|
|
297
|
+
accessorKey: "updatedAt",
|
|
298
|
+
header: () => l("menu.publish.table.columns.version"),
|
|
299
|
+
enableSorting: !1,
|
|
300
|
+
cell: (e) => {
|
|
301
|
+
const a = e.getValue();
|
|
302
|
+
return U(a);
|
|
303
|
+
}
|
|
304
|
+
}, {
|
|
305
|
+
accessorKey: "status",
|
|
306
|
+
header: () => l("menu.common.labels.status"),
|
|
307
|
+
enableSorting: !1,
|
|
308
|
+
size: 80,
|
|
309
|
+
cell: (e) => s(n, {
|
|
310
|
+
row: e.row.original
|
|
311
|
+
}, null)
|
|
312
|
+
}, {
|
|
313
|
+
accessorKey: "_id",
|
|
314
|
+
header: "",
|
|
315
|
+
size: 52,
|
|
316
|
+
enableSorting: !1,
|
|
317
|
+
cell: (e) => {
|
|
318
|
+
const a = e.row.original;
|
|
319
|
+
return t.state.menu.updatedAt, a.updatedAt, K("div", {
|
|
320
|
+
class: "flex justify-end gap-8"
|
|
321
|
+
}, [f && a.revertConfig ? he(K(G.FmButton, {
|
|
322
|
+
prependIcon: "undo",
|
|
323
|
+
variant: "secondary",
|
|
324
|
+
onClick: O(async () => {
|
|
325
|
+
await S(e.row.original);
|
|
326
|
+
}, ["stop", "prevent"])
|
|
327
|
+
}), l("menu.publish.actions.revert")) : null, K(G.FmButton, {
|
|
328
|
+
label: l("menu.publish.actions.publish"),
|
|
329
|
+
icon: "ios_share",
|
|
330
|
+
variant: "secondary",
|
|
331
|
+
onClick: O(async () => {
|
|
332
|
+
const m = A(e.row.original);
|
|
333
|
+
await D(m);
|
|
334
|
+
}, ["stop", "prevent"])
|
|
335
|
+
})]);
|
|
336
|
+
},
|
|
337
|
+
meta: {
|
|
338
|
+
width: "150px"
|
|
339
|
+
}
|
|
340
|
+
}], _ = I(""), g = I(), t = ce(), d = ge(), f = V(() => t.version !== re.F_MENU_VERSION.enum.v3);
|
|
341
|
+
async function S(e) {
|
|
342
|
+
e.revertConfig && d.open({
|
|
343
|
+
title: "Revert menu",
|
|
344
|
+
contentComponent: Re,
|
|
345
|
+
contentComponentProps: {
|
|
346
|
+
restaurant: e
|
|
347
|
+
},
|
|
348
|
+
primaryActions: {
|
|
349
|
+
text: "Revert",
|
|
350
|
+
close: !0
|
|
351
|
+
},
|
|
352
|
+
secondaryActions: {
|
|
353
|
+
text: "Cancel",
|
|
354
|
+
close: !0
|
|
355
|
+
}
|
|
356
|
+
}).onPrimary(async () => {
|
|
357
|
+
await M.minor(async () => {
|
|
358
|
+
await t.revertRestaurantMenu(e._id);
|
|
359
|
+
}, {
|
|
360
|
+
customId: e._id,
|
|
361
|
+
message: `Revert menu of ${e.name}`
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
const x = V(() => l("menu.publish.labels.main_version", {
|
|
366
|
+
version: U(t.state.menu.updatedAt)
|
|
367
|
+
}));
|
|
368
|
+
function U(e) {
|
|
369
|
+
return e ? J(e).format("DD/MM/YYYY hh:mmA") : "";
|
|
370
|
+
}
|
|
371
|
+
const B = V(() => t.state.menu.modules.catalog), v = V(() => M.queue.value.some((e) => e.id === t.state.menu._id));
|
|
372
|
+
function b(e) {
|
|
373
|
+
var a;
|
|
374
|
+
return e ? ((a = B.value.find((m) => m._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
|
|
375
|
+
}
|
|
376
|
+
function A(e) {
|
|
377
|
+
return {
|
|
378
|
+
restaurantId: e._id,
|
|
379
|
+
catalogId: e.catalogId || void 0,
|
|
380
|
+
takeawayCatalog: e.takeawayCatalog || void 0,
|
|
381
|
+
pickupCatalog: e.pickupCatalog || null,
|
|
382
|
+
additionalCatalogs: e.additionalCatalogs
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function E(e) {
|
|
386
|
+
var m;
|
|
387
|
+
const a = A(e);
|
|
388
|
+
(m = g.value) == null || m.show(a);
|
|
389
|
+
}
|
|
390
|
+
const M = Q(X());
|
|
391
|
+
async function D(e) {
|
|
392
|
+
var m;
|
|
393
|
+
const a = (m = u.value.find((z) => z._id === e.restaurantId)) == null ? void 0 : m.name;
|
|
394
|
+
await M.minor(async () => await t.publishMenu(e), {
|
|
395
|
+
customId: t.state.menu._id,
|
|
396
|
+
message: `Publishing menu for ${a}`,
|
|
397
|
+
successMessage: `Published to ${a}`
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
const u = V(() => t.state.restaurants.map((e) => ({
|
|
401
|
+
...e,
|
|
402
|
+
catalog: {
|
|
403
|
+
default: b(e.catalogId),
|
|
404
|
+
takeaway: b(e.takeawayCatalog),
|
|
405
|
+
pickup: b(e.pickupCatalog)
|
|
406
|
+
}
|
|
407
|
+
}))), j = V(() => {
|
|
408
|
+
const e = _.value.toLowerCase();
|
|
409
|
+
return u.value.filter(({
|
|
410
|
+
name: a,
|
|
411
|
+
catalog: m
|
|
412
|
+
}) => a.toLowerCase().includes(e) || m.default.toLowerCase().includes(e) || m.takeaway.toLowerCase().includes(e) || m.pickup.toLowerCase().includes(e));
|
|
413
|
+
});
|
|
414
|
+
async function H() {
|
|
415
|
+
if (v.value) return;
|
|
416
|
+
const e = Object.keys(p.value).map(Number).filter((a) => p.value[a]);
|
|
417
|
+
if (e.length === 0 || e.length === u.value.length)
|
|
418
|
+
await M.minor(async () => await t.publishAllMenu(), {
|
|
419
|
+
customId: t.state.menu._id
|
|
420
|
+
});
|
|
421
|
+
else
|
|
422
|
+
for (const a of e) {
|
|
423
|
+
const m = u.value[a];
|
|
424
|
+
await D(A(m));
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return (e, a) => {
|
|
428
|
+
const m = C("FmChip"), z = C("FmSpacer"), N = C("FmButton"), ee = C("FmSearch"), ae = C("FmTable"), te = C("FmListItem"), le = C("FmList");
|
|
429
|
+
return h(), $(P, null, [o("div", Ue, [o("div", Le, [o("div", Pe, [o("div", Be, F(c(l)("menu.publish.title")), 1), a[5] || (a[5] = o("div", {
|
|
430
|
+
class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
431
|
+
}, null, -1))]), s(m, {
|
|
432
|
+
label: x.value,
|
|
433
|
+
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
434
|
+
}, null, 8, ["label"]), s(z), o("div", Ee, [s(N, {
|
|
435
|
+
disabled: v.value,
|
|
436
|
+
icon: "ios_share",
|
|
437
|
+
label: c(l)("menu.publish.actions.publish_all"),
|
|
438
|
+
variant: "primary",
|
|
439
|
+
onClick: a[0] || (a[0] = () => H())
|
|
440
|
+
}, null, 8, ["disabled", "label"])])]), o("div", Ne, [s(ee, {
|
|
441
|
+
modelValue: _.value,
|
|
442
|
+
"onUpdate:modelValue": a[1] || (a[1] = (r) => _.value = r),
|
|
443
|
+
autofocus: "",
|
|
444
|
+
class: "mb-8 w-[320px] xs:w-full",
|
|
445
|
+
placeholder: c(l)("menu.publish.table.search.placeholder")
|
|
446
|
+
}, null, 8, ["modelValue", "placeholder"])]), u.value.length > 0 ? (h(), $(P, {
|
|
447
|
+
key: 0
|
|
448
|
+
}, [s(de, {
|
|
449
|
+
class: "xs:hidden block"
|
|
450
|
+
}, {
|
|
451
|
+
default: R(() => [s(ae, {
|
|
452
|
+
modelValue: p.value,
|
|
453
|
+
"onUpdate:modelValue": a[2] || (a[2] = (r) => p.value = r),
|
|
454
|
+
"column-defs": y,
|
|
455
|
+
loading: v.value,
|
|
456
|
+
"page-size": u.value.length,
|
|
457
|
+
"row-data": u.value,
|
|
458
|
+
"search-value": _.value,
|
|
459
|
+
shrinkAt: !1,
|
|
460
|
+
selection: "multiple",
|
|
461
|
+
"hide-footer": "",
|
|
462
|
+
"pin-header-row": "",
|
|
463
|
+
onRowClick: a[3] || (a[3] = (r) => E(r.original))
|
|
464
|
+
}, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
|
|
465
|
+
_: 1
|
|
466
|
+
}), s(le, {
|
|
467
|
+
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
468
|
+
separator: ""
|
|
469
|
+
}, {
|
|
470
|
+
default: R(() => [(h(!0), $(P, null, Y(j.value, (r) => (h(), L(te, {
|
|
471
|
+
key: r._id,
|
|
472
|
+
label: r.name,
|
|
473
|
+
style: {
|
|
474
|
+
padding: "12px 0 !important"
|
|
475
|
+
},
|
|
476
|
+
onClick: () => E(r)
|
|
477
|
+
}, {
|
|
478
|
+
default: R(() => [o("div", Oe, [o("div", je, [o("div", ze, F(U(r.updatedAt)), 1), s(n, {
|
|
479
|
+
row: r
|
|
480
|
+
}, null, 8, ["row"])]), o("div", Ke, [o("div", Te, F(r.name), 1), o("div", Ye, [o("div", null, "Default: " + F(r.catalog.default), 1), o("div", null, "POS takeaway: " + F(r.catalog.takeaway), 1), o("div", null, "Pickup: " + F(r.catalog.pickup), 1)])])]), o("div", qe, [f.value && r.revertConfig ? (h(), L(N, {
|
|
481
|
+
key: 0,
|
|
482
|
+
disabled: v.value,
|
|
483
|
+
icon: "undo",
|
|
484
|
+
variant: "tertiary",
|
|
485
|
+
onClick: O(() => S(r), ["stop"])
|
|
486
|
+
}, null, 8, ["disabled", "onClick"])) : ne("", !0), s(N, {
|
|
487
|
+
disabled: v.value,
|
|
488
|
+
icon: "ios_share",
|
|
489
|
+
variant: "tertiary",
|
|
490
|
+
onClick: O(() => D(A(r)), ["stop"])
|
|
491
|
+
}, null, 8, ["disabled", "onClick"])])]),
|
|
492
|
+
_: 2
|
|
493
|
+
}, 1032, ["label", "onClick"]))), 128))]),
|
|
494
|
+
_: 1
|
|
495
|
+
})], 64)) : (h(), L(c(me), {
|
|
496
|
+
key: 1,
|
|
497
|
+
title: c(l)("menu.publish.empty.title"),
|
|
498
|
+
subtitle: c(l)("menu.publish.empty.subtitle"),
|
|
499
|
+
action: {
|
|
500
|
+
text: c(l)("menu.publish.empty.action"),
|
|
501
|
+
icon: "add",
|
|
502
|
+
callback: () => {
|
|
503
|
+
c(w).push({
|
|
504
|
+
name: "$settings-my-business"
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}, null, 8, ["title", "subtitle", "action"]))]), o("div", He, [s(N, {
|
|
509
|
+
disabled: v.value,
|
|
510
|
+
icon: "ios_share",
|
|
511
|
+
label: c(l)("menu.publish.actions.publish_all"),
|
|
512
|
+
variant: "fab",
|
|
513
|
+
onClick: a[4] || (a[4] = () => H())
|
|
514
|
+
}, null, 8, ["disabled", "label"])]), s(Se, {
|
|
515
|
+
ref_key: "updateCatalogDialogRef",
|
|
516
|
+
ref: g,
|
|
517
|
+
catalogs: B.value,
|
|
518
|
+
onOnComplete: D
|
|
519
|
+
}, null, 8, ["catalogs"])], 64);
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
export {
|
|
524
|
+
ta as default
|
|
525
|
+
};
|