@feedmepos/mf-menu 0.31.14-beta.1 → 0.31.15-beta.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-zFX3uush.js → App-D87EP5SE.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CHUFMaWx.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnthFRoy.js} +2 -2
- package/dist/{Catalog-D2FTURpx.js → Catalog-DS4wKymx.js} +5 -5
- package/dist/{Category-BmYM9mSA.js → Category-D1TPC-aA.js} +5 -5
- package/dist/{Category-Weso_H_Z.js → Category-GbhIPLBW.js} +4 -4
- package/dist/{CookingGuide-uJHE_Fb6.js → CookingGuide-C39Ecv1F.js} +3 -3
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Dk5FypdM.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DUeeVaHx.js} +1 -1
- package/dist/{Group-DyJJJzzC.js → Group-BzhEIgZk.js} +1 -1
- package/dist/{Group-Br4SVdfw.js → Group-dErNLF6H.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-0NLKlLn0.js → Group.vue_vue_type_script_setup_true_lang-BFXGHdMi.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B9qitqLz.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5lGsR6N.js} +3 -3
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-L3eIj10P.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-D24MTd_K.js} +211 -211
- package/dist/{Ingredient-C8Gdb9xg.js → Ingredient-laBtGjS5.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DhSZIPOD.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DL8q7CNv.js} +1052 -1052
- package/dist/{LinkProductSideSheet-NwwdRb-j.js → LinkProductSideSheet-DX-MRKfp.js} +1 -1
- package/dist/{MenuSetting-CKS0c1Kc.js → MenuSetting-BIT1THUu.js} +4 -4
- package/dist/{PrintRoute-DLwub8uW.js → PrintRoute-BIvz4aN1.js} +3 -3
- package/dist/{Product-DowKo0s7.js → Product-CtfrgVK0.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DiK-MIBy.js → Product.vue_vue_type_script_setup_true_lang-CvlMJdJf.js} +11 -11
- package/dist/{Products-Bn7xaGhh.js → Products-Ds2Yxmxo.js} +511 -511
- package/dist/Publish-BOWb-F33.js +569 -0
- package/dist/{Recipe-DH_e8MrT.js → Recipe-ul4kMBPm.js} +4 -4
- package/dist/{Scheduler-PXidqEyf.js → Scheduler-CoGSCUHZ.js} +3 -3
- package/dist/{ServingSequence-DzWaHfwb.js → ServingSequence-BLf6AqJ8.js} +3 -3
- package/dist/{Setting-EtztudWO.js → Setting-Du7gpreX.js} +4 -4
- package/dist/{Subcategory-DkkEu6gx.js → Subcategory-DTwKpA8u.js} +4 -4
- package/dist/{Takeaway-CArF4v3D.js → Takeaway-8xbOp8Xa.js} +1 -1
- package/dist/{Takeaway-BP96ZCL2.js → Takeaway-DxgaJnU0.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-dOCLq4xp.js → Takeaway.vue_vue_type_script_setup_true_lang-vdmvli1A.js} +5 -5
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DCV9KgmK.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-b9NscJTY.js} +12 -12
- package/dist/{Unit-SA3YP3kw.js → Unit-Ap7qpY-q.js} +2 -2
- package/dist/{Variant-CzNIvE36.js → Variant-POkEu-3s.js} +3 -3
- package/dist/{_id_-8uQ9YdPK.js → _id_--9S7--di.js} +9 -9
- package/dist/{app-BolRuPEq.js → app-BFZyK9BE.js} +1 -1
- package/dist/{app-My0NMUdz.js → app-CK6ZrpdZ.js} +26 -25
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-CEPycTlk.js → linked-status-CXhE5uCO.js} +2 -2
- package/dist/assets/{override-menu-_OICQSvN.js → override-menu-DVX8Orl1.js} +2 -2
- package/dist/assets/{validate-menu-yLFq_6YK.js → validate-menu-Di70DZHf.js} +2 -2
- package/dist/{catalog--wILrjkl.js → catalog-cJG6G1UU.js} +1 -1
- package/dist/{catalogSetting-B_tAzhVc.js → catalogSetting-CXaK7AC0.js} +1 -1
- package/dist/{category-csE2-2hB.js → category-RIXHr3i-.js} +1 -1
- package/dist/{currency-BDn4uyqM.js → currency-Bh0cQzAv.js} +1 -1
- package/dist/{dayjs.min-CEFQW6qP.js → dayjs.min-CeOhrh22.js} +1 -1
- package/dist/{index-Ctkjk6Ve.js → index-9k68QbSm.js} +3 -3
- package/dist/{index-gHNvvnIH.js → index-BjLVYbeK.js} +2 -2
- package/dist/{index-DQvyosax.js → index-CkF36-Yy.js} +1 -1
- package/dist/{item-DBg87Y2g.js → item-hh2futyR.js} +14 -14
- package/dist/{menu-CnPKcWjf.js → menu-CkxpNa3P.js} +2273 -2273
- package/dist/{menu-CcLYdceI.js → menu-b1EX-c7r.js} +1 -1
- package/dist/{priceTier-Bofl7Ezb.js → priceTier-_xtW9BQW.js} +1 -1
- package/dist/{scheduler-C7vSQnXy.js → scheduler-DpPfzjup.js} +3 -3
- package/dist/{subcategory-tMzAqsJC.js → subcategory-CH1FS_Is.js} +36 -36
- package/dist/{toExcel-CwKo0jnF.js → toExcel-C808hu94.js} +2 -2
- package/dist/{unit-C7iGFlv7.js → unit-Bj_UFAWe.js} +1 -1
- package/package.json +1 -1
- package/dist/Publish-CpNC0tWj.js +0 -547
package/dist/Publish-CpNC0tWj.js
DELETED
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, ref as A, computed as V, onMounted as ne, resolveComponent as C, createElementBlock as D, openBlock as h, createVNode as n, createElementVNode as o, toDisplayString as F, unref as u, Fragment as P, renderList as Y, createBlock as E, withCtx as U, createCommentVNode as se, withModifiers as O, h as T } from "vue";
|
|
2
|
-
import { D as Q } from "./dayjs.min-CEFQW6qP.js";
|
|
3
|
-
import { useRouter as ue } from "vue-router";
|
|
4
|
-
import { z as ie, H as re, G as X, a8 as ce, J, K as de, u as me, I as pe } from "./menu-CnPKcWjf.js";
|
|
5
|
-
import { useI18n as q, useCoreStore as ve, RestaurantSelector as ge } from "@feedmepos/mf-common";
|
|
6
|
-
import { useSnackbar as Z, useDialogChild as fe, useDialog as be, components as W } from "@feedmepos/ui-library";
|
|
7
|
-
import { _ as _e } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
8
|
-
import { _ as he } from "./app-My0NMUdz.js";
|
|
9
|
-
import { a as ye, w as Ce } from "./tooltip-B5BiPMx9.js";
|
|
10
|
-
import { u as ke } from "./discardConfirm-BHni0LNu.js";
|
|
11
|
-
import { _ as we } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
12
|
-
function ee(w) {
|
|
13
|
-
return w ? Q(w).format("DD/MM/YY HH:mm") : "-";
|
|
14
|
-
}
|
|
15
|
-
function xe(w, x, l) {
|
|
16
|
-
const r = (i, m = !1) => {
|
|
17
|
-
var y;
|
|
18
|
-
return i === void 0 && !m ? "-" : ((y = l.find((b) => b.value === (i || null))) == null ? void 0 : y.label) || "-";
|
|
19
|
-
};
|
|
20
|
-
return w.map((i) => {
|
|
21
|
-
var p;
|
|
22
|
-
const m = (p = x.find(({ _id: t }) => t === i._id)) == null ? void 0 : p.posVersion, y = !!m && !!ie.Pos.canUse({ feature: re.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), b = r(i.catalogId);
|
|
23
|
-
return {
|
|
24
|
-
...i,
|
|
25
|
-
_default: b,
|
|
26
|
-
_posTakeaway: i.takeawayCatalog ? r(i.takeawayCatalog) : b,
|
|
27
|
-
_additionalCatalogs: (i.additionalCatalogs || []).map((t) => r(t)),
|
|
28
|
-
_lastUpdate: ee(i.updatedAt),
|
|
29
|
-
_pickup: y ? r(i.pickupCatalog, !0) : "-",
|
|
30
|
-
_canUsePickup: y,
|
|
31
|
-
_posVersion: m || "-"
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const Ve = {
|
|
36
|
-
key: 0,
|
|
37
|
-
class: "flex items-center justify-center"
|
|
38
|
-
}, Fe = {
|
|
39
|
-
key: 1,
|
|
40
|
-
class: "space-y-16"
|
|
41
|
-
}, Se = { class: "text-fm-color-typo-secondary" }, Ie = { class: "space-y-4" }, Ae = /* @__PURE__ */ j({
|
|
42
|
-
__name: "RevertDialog",
|
|
43
|
-
props: {
|
|
44
|
-
restaurant: {}
|
|
45
|
-
},
|
|
46
|
-
setup(w) {
|
|
47
|
-
const x = w, l = Z(), { custom: r } = X(l), i = A(!1), m = A(null);
|
|
48
|
-
async function y() {
|
|
49
|
-
await r(
|
|
50
|
-
async () => {
|
|
51
|
-
var c;
|
|
52
|
-
m.value = await ce.readMenuById(((c = x.restaurant.revertConfig) == null ? void 0 : c._id) || "");
|
|
53
|
-
},
|
|
54
|
-
{ isLoading: i }
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
const b = V(() => {
|
|
58
|
-
var c;
|
|
59
|
-
return [
|
|
60
|
-
{ label: "Main", value: null },
|
|
61
|
-
...(((c = m.value) == null ? void 0 : c.modules.catalog) || []).map((_) => ({
|
|
62
|
-
label: _.name,
|
|
63
|
-
value: _._id
|
|
64
|
-
}))
|
|
65
|
-
];
|
|
66
|
-
}), { t: p } = q(), t = V(() => {
|
|
67
|
-
var k;
|
|
68
|
-
const c = x.restaurant.revertConfig;
|
|
69
|
-
if (!c) return [];
|
|
70
|
-
const _ = xe(
|
|
71
|
-
[
|
|
72
|
-
{
|
|
73
|
-
...c,
|
|
74
|
-
catalogId: c.catalogId || null
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
ve().restaurants.value,
|
|
78
|
-
b.value
|
|
79
|
-
)[0];
|
|
80
|
-
return [
|
|
81
|
-
{ label: p("menu.revert.labels.restaurant"), value: x.restaurant.name },
|
|
82
|
-
{
|
|
83
|
-
label: p("menu.revert.labels.revert_to"),
|
|
84
|
-
value: ee((k = m.value) == null ? void 0 : k.updatedAt)
|
|
85
|
-
},
|
|
86
|
-
{ label: p("menu.revert.labels.default"), value: _._default },
|
|
87
|
-
{ label: p("menu.revert.labels.pos_takeaway"), value: _._posTakeaway },
|
|
88
|
-
{ label: p("menu.revert.labels.pickup"), value: _._pickup },
|
|
89
|
-
{
|
|
90
|
-
label: p("menu.revert.labels.additional_catalogs"),
|
|
91
|
-
value: _._additionalCatalogs.join(", ")
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
|
-
});
|
|
95
|
-
ne(async () => y());
|
|
96
|
-
const { emitData: M } = fe();
|
|
97
|
-
return (c, _) => {
|
|
98
|
-
const k = C("FmCircularProgress");
|
|
99
|
-
return i.value ? (h(), D("div", Ve, [
|
|
100
|
-
n(k, { size: "lg" })
|
|
101
|
-
])) : (h(), D("div", Fe, [
|
|
102
|
-
o("div", Se, F(u(p)("menu.revert.description", { name: x.restaurant.name })), 1),
|
|
103
|
-
o("div", Ie, [
|
|
104
|
-
(h(!0), D(P, null, Y(t.value, (S) => (h(), E(ye, {
|
|
105
|
-
key: S.label,
|
|
106
|
-
name: S.label,
|
|
107
|
-
value: S.value || "--"
|
|
108
|
-
}, null, 8, ["name", "value"]))), 128))
|
|
109
|
-
])
|
|
110
|
-
]));
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}), $e = { class: "fm-typo-en-title-md-600" }, De = { class: "mt-40" }, Me = { class: "fm-typo-en-title-sm-600" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Ue = { class: "flex gap-8 items-center justify-start" }, Le = /* @__PURE__ */ j({
|
|
114
|
-
__name: "UpdateCatalogDialog",
|
|
115
|
-
props: {
|
|
116
|
-
catalogs: {
|
|
117
|
-
type: Array,
|
|
118
|
-
required: !0
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
emits: ["onComplete"],
|
|
122
|
-
setup(w, { expose: x, emit: l }) {
|
|
123
|
-
const { t: r } = q(), i = w;
|
|
124
|
-
x({
|
|
125
|
-
show: _,
|
|
126
|
-
hide: k
|
|
127
|
-
});
|
|
128
|
-
const m = l;
|
|
129
|
-
function y() {
|
|
130
|
-
return {
|
|
131
|
-
restaurantId: "",
|
|
132
|
-
catalogId: void 0,
|
|
133
|
-
takeawayCatalog: void 0,
|
|
134
|
-
pickupCatalog: null,
|
|
135
|
-
additionalCatalogs: []
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const b = V(() => [
|
|
139
|
-
{
|
|
140
|
-
label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
141
|
-
value: null
|
|
142
|
-
},
|
|
143
|
-
...i.catalogs.map((v) => ({
|
|
144
|
-
label: v.name,
|
|
145
|
-
value: v._id
|
|
146
|
-
}))
|
|
147
|
-
]), p = V(() => [
|
|
148
|
-
{
|
|
149
|
-
label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
150
|
-
value: null
|
|
151
|
-
},
|
|
152
|
-
...i.catalogs.map((v) => ({
|
|
153
|
-
label: v.name,
|
|
154
|
-
value: v._id
|
|
155
|
-
}))
|
|
156
|
-
]), t = A(y()), M = A(!1), c = A(void 0);
|
|
157
|
-
function _(v) {
|
|
158
|
-
c.value = v ? J(v) : y(), t.value = J(c.value), M.value = !0;
|
|
159
|
-
}
|
|
160
|
-
function k() {
|
|
161
|
-
M.value = !1;
|
|
162
|
-
}
|
|
163
|
-
const S = ke(
|
|
164
|
-
() => !de.isEqual(c.value, t.value),
|
|
165
|
-
() => {
|
|
166
|
-
k();
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
function B() {
|
|
170
|
-
k(), m("onComplete", t.value);
|
|
171
|
-
}
|
|
172
|
-
return (v, g) => {
|
|
173
|
-
const $ = C("FmSelect"), z = C("FmCheckbox"), R = C("FmButton"), L = C("FmSideSheet");
|
|
174
|
-
return h(), E(L, {
|
|
175
|
-
modelValue: M.value,
|
|
176
|
-
"onUpdate:modelValue": g[5] || (g[5] = (f) => M.value = f),
|
|
177
|
-
"max-width": 560,
|
|
178
|
-
"onOn:clickedAway": u(S)
|
|
179
|
-
}, {
|
|
180
|
-
"side-sheet-header": U(() => [
|
|
181
|
-
o("span", $e, F(u(r)("menu.publish.update_catalog_dialog.title")), 1)
|
|
182
|
-
]),
|
|
183
|
-
"side-sheet-footer": U(() => [
|
|
184
|
-
o("div", Ue, [
|
|
185
|
-
n(R, {
|
|
186
|
-
label: u(r)("menu.publish.update_catalog_dialog.actions.update"),
|
|
187
|
-
size: "lg",
|
|
188
|
-
variant: "primary",
|
|
189
|
-
onClick: g[4] || (g[4] = () => B())
|
|
190
|
-
}, null, 8, ["label"]),
|
|
191
|
-
n(R, {
|
|
192
|
-
label: u(r)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
193
|
-
size: "lg",
|
|
194
|
-
variant: "tertiary",
|
|
195
|
-
onClick: k
|
|
196
|
-
}, null, 8, ["label"])
|
|
197
|
-
])
|
|
198
|
-
]),
|
|
199
|
-
default: U(() => [
|
|
200
|
-
n($, {
|
|
201
|
-
modelValue: t.value.catalogId,
|
|
202
|
-
"onUpdate:modelValue": g[0] || (g[0] = (f) => t.value.catalogId = f),
|
|
203
|
-
items: b.value,
|
|
204
|
-
class: "mb-24",
|
|
205
|
-
label: u(r)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
206
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
207
|
-
n($, {
|
|
208
|
-
modelValue: t.value.takeawayCatalog,
|
|
209
|
-
"onUpdate:modelValue": g[1] || (g[1] = (f) => t.value.takeawayCatalog = f),
|
|
210
|
-
items: p.value,
|
|
211
|
-
class: "mb-24",
|
|
212
|
-
label: u(r)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
213
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
214
|
-
n($, {
|
|
215
|
-
modelValue: t.value.pickupCatalog,
|
|
216
|
-
"onUpdate:modelValue": g[2] || (g[2] = (f) => t.value.pickupCatalog = f),
|
|
217
|
-
items: p.value,
|
|
218
|
-
label: u(r)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
219
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
220
|
-
o("div", De, [
|
|
221
|
-
o("div", Me, F(u(r)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
222
|
-
o("div", Re, F(u(r)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
223
|
-
(h(!0), D(P, null, Y(w.catalogs, (f) => (h(), D("div", {
|
|
224
|
-
key: f._id
|
|
225
|
-
}, [
|
|
226
|
-
n(z, {
|
|
227
|
-
modelValue: t.value.additionalCatalogs,
|
|
228
|
-
"onUpdate:modelValue": g[3] || (g[3] = (I) => t.value.additionalCatalogs = I),
|
|
229
|
-
label: f.name,
|
|
230
|
-
value: f._id
|
|
231
|
-
}, null, 8, ["modelValue", "label", "value"])
|
|
232
|
-
]))), 128))
|
|
233
|
-
])
|
|
234
|
-
]),
|
|
235
|
-
_: 1
|
|
236
|
-
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
}), Pe = {
|
|
240
|
-
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
241
|
-
}, Ee = {
|
|
242
|
-
class: "flex items-center xs:mb-8 mb-24"
|
|
243
|
-
}, Be = {
|
|
244
|
-
class: "mr-8"
|
|
245
|
-
}, ze = {
|
|
246
|
-
class: "fm-typo-en-title-md-600"
|
|
247
|
-
}, Ke = {
|
|
248
|
-
class: "xs:hidden"
|
|
249
|
-
}, Ne = {
|
|
250
|
-
class: "pb-8 flex justify-between xs:flex-col gap-8"
|
|
251
|
-
}, Oe = {
|
|
252
|
-
class: "grow flex flex-col gap-4"
|
|
253
|
-
}, Te = {
|
|
254
|
-
class: "flex gap-8 items-center"
|
|
255
|
-
}, je = {
|
|
256
|
-
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
257
|
-
}, Ye = {
|
|
258
|
-
class: "space-y-4"
|
|
259
|
-
}, qe = {
|
|
260
|
-
class: "fm-typo-en-body-lg-600"
|
|
261
|
-
}, He = {
|
|
262
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
263
|
-
}, Ge = {
|
|
264
|
-
class: "flex gap-8"
|
|
265
|
-
}, Je = {
|
|
266
|
-
class: "xs:block hidden fixed bottom-72 right-16"
|
|
267
|
-
}, ua = /* @__PURE__ */ j({
|
|
268
|
-
__name: "Publish",
|
|
269
|
-
setup(w) {
|
|
270
|
-
const x = ue(), {
|
|
271
|
-
t: l
|
|
272
|
-
} = q(), r = (e) => t.state.menu.updatedAt === e.updatedAt, i = ({
|
|
273
|
-
row: e
|
|
274
|
-
}) => {
|
|
275
|
-
const a = r(e);
|
|
276
|
-
return n(_e, {
|
|
277
|
-
label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
278
|
-
variant: a ? "success" : "warning"
|
|
279
|
-
}, null);
|
|
280
|
-
}, m = A({}), y = [{
|
|
281
|
-
accessorKey: "name",
|
|
282
|
-
header: () => l("menu.publish.table.columns.restaurant"),
|
|
283
|
-
cell: (e) => e.getValue(),
|
|
284
|
-
enableSorting: !0
|
|
285
|
-
}, {
|
|
286
|
-
accessorKey: "catalog",
|
|
287
|
-
header: () => l("menu.publish.table.columns.default"),
|
|
288
|
-
enableSorting: !1,
|
|
289
|
-
cell: (e) => e.getValue().default
|
|
290
|
-
}, {
|
|
291
|
-
accessorKey: "catalog",
|
|
292
|
-
header: () => l("menu.publish.table.columns.pos_takeaway"),
|
|
293
|
-
enableSorting: !1,
|
|
294
|
-
cell: (e) => e.getValue().takeaway
|
|
295
|
-
}, {
|
|
296
|
-
accessorKey: "catalog",
|
|
297
|
-
header: () => l("menu.publish.table.columns.pickup"),
|
|
298
|
-
enableSorting: !1,
|
|
299
|
-
cell: (e) => e.getValue().pickup
|
|
300
|
-
}, {
|
|
301
|
-
accessorKey: "updatedAt",
|
|
302
|
-
header: () => l("menu.publish.table.columns.version"),
|
|
303
|
-
enableSorting: !1,
|
|
304
|
-
cell: (e) => {
|
|
305
|
-
const a = e.getValue();
|
|
306
|
-
return S(a);
|
|
307
|
-
}
|
|
308
|
-
}, {
|
|
309
|
-
accessorKey: "status",
|
|
310
|
-
header: () => l("menu.common.labels.status"),
|
|
311
|
-
enableSorting: !1,
|
|
312
|
-
size: 80,
|
|
313
|
-
cell: (e) => n(i, {
|
|
314
|
-
row: e.row.original
|
|
315
|
-
}, null)
|
|
316
|
-
}, {
|
|
317
|
-
accessorKey: "_id",
|
|
318
|
-
header: "",
|
|
319
|
-
size: 52,
|
|
320
|
-
enableSorting: !1,
|
|
321
|
-
cell: (e) => {
|
|
322
|
-
const a = e.row.original;
|
|
323
|
-
return t.state.menu.updatedAt, a.updatedAt, T("div", {
|
|
324
|
-
class: "flex justify-end gap-8"
|
|
325
|
-
}, [c.value && a.revertConfig ? Ce(T(W.FmButton, {
|
|
326
|
-
prependIcon: "undo",
|
|
327
|
-
variant: "secondary",
|
|
328
|
-
onClick: O(async () => {
|
|
329
|
-
await _(e.row.original);
|
|
330
|
-
}, ["stop", "prevent"])
|
|
331
|
-
}), l("menu.publish.actions.revert")) : null, T(W.FmButton, {
|
|
332
|
-
label: l("menu.publish.actions.publish"),
|
|
333
|
-
icon: "ios_share",
|
|
334
|
-
variant: "secondary",
|
|
335
|
-
onClick: O(async () => {
|
|
336
|
-
const d = $(e.row.original);
|
|
337
|
-
await L(d);
|
|
338
|
-
}, ["stop", "prevent"])
|
|
339
|
-
})]);
|
|
340
|
-
},
|
|
341
|
-
meta: {
|
|
342
|
-
width: "150px"
|
|
343
|
-
}
|
|
344
|
-
}], b = A(""), p = A(), t = me(), M = be(), c = V(() => t.version !== pe.F_MENU_VERSION.enum.v3);
|
|
345
|
-
async function _(e) {
|
|
346
|
-
e.revertConfig && M.open({
|
|
347
|
-
title: "Revert menu",
|
|
348
|
-
contentComponent: Ae,
|
|
349
|
-
contentComponentProps: {
|
|
350
|
-
restaurant: e
|
|
351
|
-
},
|
|
352
|
-
primaryActions: {
|
|
353
|
-
text: "Revert",
|
|
354
|
-
close: !0
|
|
355
|
-
},
|
|
356
|
-
secondaryActions: {
|
|
357
|
-
text: "Cancel",
|
|
358
|
-
close: !0
|
|
359
|
-
}
|
|
360
|
-
}).onPrimary(async () => {
|
|
361
|
-
await R.minor(async () => {
|
|
362
|
-
await t.revertRestaurantMenu(e._id);
|
|
363
|
-
}, {
|
|
364
|
-
customId: e._id,
|
|
365
|
-
message: `Revert menu of ${e.name}`
|
|
366
|
-
});
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
const k = V(() => l("menu.publish.labels.main_version", {
|
|
370
|
-
version: S(t.state.menu.updatedAt)
|
|
371
|
-
}));
|
|
372
|
-
function S(e) {
|
|
373
|
-
return e ? Q(e).format("DD/MM/YYYY hh:mmA") : "";
|
|
374
|
-
}
|
|
375
|
-
const B = V(() => t.state.menu.modules.catalog), v = V(() => R.queue.value.some((e) => e.id === t.state.menu._id));
|
|
376
|
-
function g(e) {
|
|
377
|
-
var a;
|
|
378
|
-
return e ? ((a = B.value.find((d) => d._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
|
|
379
|
-
}
|
|
380
|
-
function $(e) {
|
|
381
|
-
return {
|
|
382
|
-
restaurantId: e._id,
|
|
383
|
-
catalogId: e.catalogId,
|
|
384
|
-
takeawayCatalog: e.takeawayCatalog,
|
|
385
|
-
pickupCatalog: e.pickupCatalog || null,
|
|
386
|
-
additionalCatalogs: e.additionalCatalogs
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function z(e) {
|
|
390
|
-
var d;
|
|
391
|
-
const a = $(e);
|
|
392
|
-
(d = p.value) == null || d.show(a);
|
|
393
|
-
}
|
|
394
|
-
const R = X(Z());
|
|
395
|
-
async function L(e) {
|
|
396
|
-
var d;
|
|
397
|
-
const a = (d = I.value.find((K) => K._id === e.restaurantId)) == null ? void 0 : d.name;
|
|
398
|
-
await R.minor(async () => await t.publishMenu(e), {
|
|
399
|
-
customId: t.state.menu._id,
|
|
400
|
-
message: `Publishing menu for ${a}`,
|
|
401
|
-
successMessage: `Published to ${a}`
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
const f = A(null), I = V(() => t.state.restaurants.filter((e) => {
|
|
405
|
-
var a;
|
|
406
|
-
return !f.value || ((a = f.value) == null ? void 0 : a.includes(e._id));
|
|
407
|
-
}).map((e) => ({
|
|
408
|
-
...e,
|
|
409
|
-
catalog: {
|
|
410
|
-
default: g(e.catalogId),
|
|
411
|
-
takeaway: g(e.takeawayCatalog),
|
|
412
|
-
pickup: g(e.pickupCatalog)
|
|
413
|
-
}
|
|
414
|
-
}))), ae = V(() => {
|
|
415
|
-
const e = b.value.toLowerCase();
|
|
416
|
-
return I.value.filter(({
|
|
417
|
-
name: a,
|
|
418
|
-
catalog: d
|
|
419
|
-
}) => a.toLowerCase().includes(e) || d.default.toLowerCase().includes(e) || d.takeaway.toLowerCase().includes(e) || d.pickup.toLowerCase().includes(e));
|
|
420
|
-
});
|
|
421
|
-
async function H() {
|
|
422
|
-
if (v.value) return;
|
|
423
|
-
const e = Object.keys(m.value).map(Number).filter((a) => m.value[a]);
|
|
424
|
-
if (e.length === 0 || e.length === I.value.length)
|
|
425
|
-
await R.minor(async () => await t.publishAllMenu(), {
|
|
426
|
-
customId: t.state.menu._id
|
|
427
|
-
});
|
|
428
|
-
else
|
|
429
|
-
for (const a of e) {
|
|
430
|
-
const d = I.value[a];
|
|
431
|
-
await L($(d));
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
return (e, a) => {
|
|
435
|
-
const d = C("FmChip"), K = C("FmSpacer"), N = C("FmButton"), G = C("FmSearch"), te = C("FmTable"), le = C("FmListItem"), oe = C("FmList");
|
|
436
|
-
return h(), D(P, null, [o("div", Pe, [o("div", Ee, [o("div", Be, [o("div", ze, F(u(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
|
|
437
|
-
class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
438
|
-
}, null, -1))]), n(d, {
|
|
439
|
-
label: k.value,
|
|
440
|
-
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
441
|
-
}, null, 8, ["label"]), n(K), o("div", Ke, [n(N, {
|
|
442
|
-
disabled: v.value,
|
|
443
|
-
icon: "ios_share",
|
|
444
|
-
label: u(l)("menu.publish.actions.publish_all"),
|
|
445
|
-
variant: "primary",
|
|
446
|
-
onClick: a[0] || (a[0] = () => H())
|
|
447
|
-
}, null, 8, ["disabled", "label"])])]), o("div", Ne, [n(u(ge), {
|
|
448
|
-
multiple: "",
|
|
449
|
-
modelValue: f.value,
|
|
450
|
-
"onUpdate:modelValue": a[2] || (a[2] = (s) => f.value = s)
|
|
451
|
-
}, {
|
|
452
|
-
"append-right": U(() => [n(K, {
|
|
453
|
-
class: "xs:hidden"
|
|
454
|
-
}), n(G, {
|
|
455
|
-
modelValue: b.value,
|
|
456
|
-
"onUpdate:modelValue": a[1] || (a[1] = (s) => b.value = s),
|
|
457
|
-
autofocus: "",
|
|
458
|
-
class: "w-[320px] xs:hidden",
|
|
459
|
-
placeholder: u(l)("menu.publish.table.search.placeholder")
|
|
460
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
461
|
-
_: 1
|
|
462
|
-
}, 8, ["modelValue"]), n(G, {
|
|
463
|
-
modelValue: b.value,
|
|
464
|
-
"onUpdate:modelValue": a[3] || (a[3] = (s) => b.value = s),
|
|
465
|
-
autofocus: "",
|
|
466
|
-
class: "w-full xs:block hidden",
|
|
467
|
-
placeholder: u(l)("menu.publish.table.search.placeholder")
|
|
468
|
-
}, null, 8, ["modelValue", "placeholder"])]), I.value.length > 0 ? (h(), D(P, {
|
|
469
|
-
key: 0
|
|
470
|
-
}, [n(he, {
|
|
471
|
-
class: "xs:hidden block"
|
|
472
|
-
}, {
|
|
473
|
-
default: U(() => [n(te, {
|
|
474
|
-
modelValue: m.value,
|
|
475
|
-
"onUpdate:modelValue": a[4] || (a[4] = (s) => m.value = s),
|
|
476
|
-
"column-defs": y,
|
|
477
|
-
loading: v.value,
|
|
478
|
-
"page-size": I.value.length,
|
|
479
|
-
"row-data": I.value,
|
|
480
|
-
"search-value": b.value,
|
|
481
|
-
shrinkAt: !1,
|
|
482
|
-
selection: "multiple",
|
|
483
|
-
"hide-footer": "",
|
|
484
|
-
"pin-header-row": "",
|
|
485
|
-
onRowClick: a[5] || (a[5] = (s) => z(s.original))
|
|
486
|
-
}, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
|
|
487
|
-
_: 1
|
|
488
|
-
}), n(oe, {
|
|
489
|
-
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
490
|
-
separator: ""
|
|
491
|
-
}, {
|
|
492
|
-
default: U(() => [(h(!0), D(P, null, Y(ae.value, (s) => (h(), E(le, {
|
|
493
|
-
key: s._id,
|
|
494
|
-
label: s.name,
|
|
495
|
-
style: {
|
|
496
|
-
padding: "12px 0 !important"
|
|
497
|
-
},
|
|
498
|
-
onClick: () => z(s)
|
|
499
|
-
}, {
|
|
500
|
-
default: U(() => [o("div", Oe, [o("div", Te, [o("div", je, F(S(s.updatedAt)), 1), n(i, {
|
|
501
|
-
row: s
|
|
502
|
-
}, null, 8, ["row"])]), o("div", Ye, [o("div", qe, F(s.name), 1), o("div", He, [o("div", null, "Default: " + F(s.catalog.default), 1), o("div", null, "POS takeaway: " + F(s.catalog.takeaway), 1), o("div", null, "Pickup: " + F(s.catalog.pickup), 1)])])]), o("div", Ge, [c.value && s.revertConfig ? (h(), E(N, {
|
|
503
|
-
key: 0,
|
|
504
|
-
disabled: v.value,
|
|
505
|
-
icon: "undo",
|
|
506
|
-
variant: "tertiary",
|
|
507
|
-
onClick: O(() => _(s), ["stop"])
|
|
508
|
-
}, null, 8, ["disabled", "onClick"])) : se("", !0), n(N, {
|
|
509
|
-
disabled: v.value,
|
|
510
|
-
icon: "ios_share",
|
|
511
|
-
variant: "tertiary",
|
|
512
|
-
onClick: O(() => L($(s)), ["stop"])
|
|
513
|
-
}, null, 8, ["disabled", "onClick"])])]),
|
|
514
|
-
_: 2
|
|
515
|
-
}, 1032, ["label", "onClick"]))), 128))]),
|
|
516
|
-
_: 1
|
|
517
|
-
})], 64)) : (h(), E(u(we), {
|
|
518
|
-
key: 1,
|
|
519
|
-
title: u(l)("menu.publish.empty.title"),
|
|
520
|
-
subtitle: u(l)("menu.publish.empty.subtitle"),
|
|
521
|
-
action: {
|
|
522
|
-
text: u(l)("menu.publish.empty.action"),
|
|
523
|
-
icon: "add",
|
|
524
|
-
callback: () => {
|
|
525
|
-
u(x).push({
|
|
526
|
-
name: "$settings-my-business"
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}, null, 8, ["title", "subtitle", "action"]))]), o("div", Je, [n(N, {
|
|
531
|
-
disabled: v.value,
|
|
532
|
-
icon: "ios_share",
|
|
533
|
-
label: u(l)("menu.publish.actions.publish_all"),
|
|
534
|
-
variant: "fab",
|
|
535
|
-
onClick: a[6] || (a[6] = () => H())
|
|
536
|
-
}, null, 8, ["disabled", "label"])]), n(Le, {
|
|
537
|
-
ref_key: "updateCatalogDialogRef",
|
|
538
|
-
ref: p,
|
|
539
|
-
catalogs: B.value,
|
|
540
|
-
onOnComplete: L
|
|
541
|
-
}, null, 8, ["catalogs"])], 64);
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
export {
|
|
546
|
-
ua as default
|
|
547
|
-
};
|