@feedmepos/mf-menu 0.31.48-prod → 0.31.50-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-D-dcqNRb.js → App-DXXisW3y.js} +9 -9
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-na_OOlYX.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DRPvBB9r.js} +3 -3
- package/dist/{Catalog-BT_NvH4H.js → Catalog-xqNebB7d.js} +6 -6
- package/dist/{Category-CIlVNPov.js → Category-CYt-0_IK.js} +4 -4
- package/dist/{Category-bsYxspvu.js → Category-DRXXgCoT.js} +6 -6
- package/dist/{CookingGuide-C7IxQzTM.js → CookingGuide-DLfr6-fm.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CJnE543q.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-toajeers.js} +1 -1
- package/dist/{Group-CuQ0gDgC.js → Group-BKYzG6fU.js} +3 -3
- package/dist/{Group-B5882UFx.js → Group-DIA_XL_I.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-Btk8J3Tp.js → Group.vue_vue_type_script_setup_true_lang-CgpkpOvk.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-yIXsPtY4.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Dt0ELF4j.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DFSHCb9I.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CvrZKjus.js} +806 -825
- package/dist/{Ingredient-24hSAj8Z.js → Ingredient-BI44dYAP.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BVcdOrDO.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CBnGxphp.js} +2 -2
- package/dist/{LinkProductSideSheet-CD9mIEpc.js → LinkProductSideSheet-CCAges9q.js} +3 -3
- package/dist/{MenuSetting-CVySuMK8.js → MenuSetting-CVakiCVk.js} +5 -5
- package/dist/{PrintRoute-CT0-6o2w.js → PrintRoute-DlW6n7Mn.js} +4 -4
- package/dist/{Product-C2CtWFM5.js → Product-m8cMT1LX.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-Ts0KnCTU.js → Product.vue_vue_type_script_setup_true_lang-a55WiF4U.js} +13 -13
- package/dist/{ProductInternalTools-CyKeO24R.js → ProductInternalTools-CkTx11_s.js} +6 -6
- package/dist/{Products-wRIs1LNY.js → Products-BJuWo6iE.js} +11 -11
- package/dist/{Publish-BKRVvye3.js → Publish-CM8QYU-j.js} +150 -150
- package/dist/{Recipe-BQvRhIeZ.js → Recipe-BRDAybvK.js} +4 -4
- package/dist/{Scheduler-CaQu66-9.js → Scheduler-BTRJwBGC.js} +3 -3
- package/dist/{ServingSequence-BlUi0Hzb.js → ServingSequence-CD_DdM9d.js} +3 -3
- package/dist/{Setting-DFsZYxSB.js → Setting-BeO4Vkut.js} +5 -5
- package/dist/{Subcategory-BYnb9L7M.js → Subcategory-_1l7Bx1S.js} +4 -4
- package/dist/{Takeaway-BQINJijW.js → Takeaway-BFI4svUt.js} +4 -4
- package/dist/{Takeaway-DYiN0Yws.js → Takeaway-BZk0NtGE.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CnMEeZrd.js → Takeaway.vue_vue_type_script_setup_true_lang-CIfMWu9j.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-Bp40RcvB.js → Thumbnail.vue_vue_type_script_setup_true_lang-BP9fJ0Bu.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-jzJLp-Ac.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-t1fMjOZR.js} +16 -16
- package/dist/{Unit-rT9SjnsI.js → Unit-Ctw281mK.js} +2 -2
- package/dist/{Variant-B7aqcbez.js → Variant-C3ZYOitW.js} +3 -3
- package/dist/{_id_-DY1Fitul.js → _id_-CoT8bjO6.js} +10 -10
- package/dist/{app-BO6bn7uh.js → app-Brm1kWbu.js} +26 -26
- package/dist/{app-RULuHy55.js → app-OcteyEm5.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/menu.d.ts +1 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DRWIBDK1.js → linked-status-DAHyhlx2.js} +2 -2
- package/dist/assets/{override-menu-BLjzPUsy.js → override-menu-BnY4XZnY.js} +2 -2
- package/dist/assets/{validate-menu-5sybvnwS.js → validate-menu-BraLzbnR.js} +2 -2
- package/dist/{catalog-bwlWW8PZ.js → catalog-gKppJzig.js} +1 -1
- package/dist/{catalogSetting-DzX172wP.js → catalogSetting-Su45SyJ-.js} +1 -1
- package/dist/{category-B28CLR_r.js → category-8y6-08Mv.js} +1 -1
- package/dist/{currency-SjGU_s1p.js → currency-B_e-dhFu.js} +1 -1
- package/dist/{customAttributes-D8y8beXk.js → customAttributes-C2vr-SKM.js} +1 -1
- package/dist/{dayjs.min-CUujDjy2.js → dayjs.min-dKmkrzl4.js} +1 -1
- package/dist/{index-BjlPBJit.js → index-BHvV964b.js} +4 -4
- package/dist/{index-KiKL6590.js → index-C9tWvhY2.js} +1 -1
- package/dist/{index-TqIfnnRh.js → index-D4faLWap.js} +3 -3
- package/dist/{index-Dc0tIOma.js → index-Dr59iGVp.js} +1 -1
- package/dist/{item-Bk4ePGsA.js → item-DEucLegT.js} +386 -386
- package/dist/iteration-BoeoXAHD.js +23 -0
- package/dist/{jszip.min-Cb0oLCRU.js → jszip.min-yRZ7rNLS.js} +2 -2
- package/dist/{menu-J976EXhb.js → menu-C_Qpm-ah.js} +1 -1
- package/dist/{menu-CKvTLOA7.js → menu-D1ph5NBB.js} +6569 -6521
- package/dist/{menuV2-BWSBAnVp.js → menuV2-DlyT8PNo.js} +60 -60
- package/dist/{priceTier-BpWKl-29.js → priceTier-BsiwgiPs.js} +1 -1
- package/dist/{scheduler-CnU_uh6T.js → scheduler-Cyq65N6m.js} +4 -4
- package/dist/{subcategory-Bn1Jr1uy.js → subcategory-CMW9rWpo.js} +2 -2
- package/dist/{toExcel-DxAn19PY.js → toExcel-B9qHcJCR.js} +2 -2
- package/dist/{unit-BzHG0aHZ.js → unit-bsmM8Os6.js} +2 -2
- package/package.json +1 -1
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { D as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { B as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { useSnackbar as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { defineComponent as q, ref as I, computed as S, onMounted as ue, resolveComponent as C, createElementBlock as D, openBlock as h, createVNode as s, createElementVNode as o, toDisplayString as F, unref as i, Fragment as E, renderList as G, createBlock as O, withCtx as P, createCommentVNode as ie, withModifiers as H, h as j } from "vue";
|
|
2
|
+
import { D as ae } from "./dayjs.min-dKmkrzl4.js";
|
|
3
|
+
import { useRouter as re } from "vue-router";
|
|
4
|
+
import { B as ce, e as de, G as te, a7 as me, H as Z, I as pe, u as ge, A as ve } from "./menu-D1ph5NBB.js";
|
|
5
|
+
import { useI18n as W, useCoreStore as be, RestaurantSelector as fe } from "@feedmepos/mf-common";
|
|
6
|
+
import { useSnackbar as le, useDialogChild as _e, useDialog as he, components as ee } from "@feedmepos/ui-library";
|
|
7
|
+
import { _ as ye } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
8
|
+
import { _ as Ce } from "./app-Brm1kWbu.js";
|
|
9
|
+
import { c as ke } from "./iteration-BoeoXAHD.js";
|
|
10
|
+
import { a as we, w as xe, p as Ve } from "./tooltip-CQW9YRO5.js";
|
|
11
|
+
import { u as Se } from "./discardConfirm-BHni0LNu.js";
|
|
12
|
+
import { _ as Fe } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
13
|
+
function oe(x) {
|
|
14
|
+
return x ? ae(x).format("DD/MM/YY HH:mm") : "-";
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function Ie(x, V, l) {
|
|
16
17
|
const c = (r, m = !1) => {
|
|
17
18
|
var y;
|
|
18
19
|
return r === void 0 && !m ? "-" : ((y = l.find((f) => f.value === (r || null))) == null ? void 0 : y.label) || "-";
|
|
19
20
|
};
|
|
20
21
|
return x.map((r) => {
|
|
21
22
|
var p;
|
|
22
|
-
const m = (p = V.find(({ _id: t }) => t === r._id)) == null ? void 0 : p.posVersion, y = !!m && !!
|
|
23
|
+
const m = (p = V.find(({ _id: t }) => t === r._id)) == null ? void 0 : p.posVersion, y = !!m && !!ce.Pos.canUse({ feature: de.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), f = c(r.catalogId);
|
|
23
24
|
return {
|
|
24
25
|
...r,
|
|
25
26
|
_default: f,
|
|
26
27
|
_posTakeaway: r.takeawayCatalog ? c(r.takeawayCatalog) : f,
|
|
27
28
|
_additionalCatalogs: (r.additionalCatalogs || []).map((t) => c(t)),
|
|
28
|
-
_lastUpdate:
|
|
29
|
+
_lastUpdate: oe(r.updatedAt),
|
|
29
30
|
_pickup: y ? c(r.pickupCatalog, !0) : "-",
|
|
30
31
|
_canUsePickup: y,
|
|
31
32
|
_posVersion: m || "-"
|
|
32
33
|
};
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
const
|
|
36
|
+
const $e = {
|
|
36
37
|
key: 0,
|
|
37
38
|
class: "flex items-center justify-center"
|
|
38
|
-
},
|
|
39
|
+
}, Ae = {
|
|
39
40
|
key: 1,
|
|
40
41
|
class: "space-y-16"
|
|
41
|
-
},
|
|
42
|
+
}, Me = { class: "text-fm-color-typo-secondary" }, De = { class: "space-y-4" }, Re = /* @__PURE__ */ q({
|
|
42
43
|
__name: "RevertDialog",
|
|
43
44
|
props: {
|
|
44
45
|
restaurant: {}
|
|
45
46
|
},
|
|
46
47
|
setup(x) {
|
|
47
|
-
const V = x, l =
|
|
48
|
+
const V = x, l = le(), { custom: c } = te(l), r = I(!1), m = I(null);
|
|
48
49
|
async function y() {
|
|
49
50
|
await c(
|
|
50
51
|
async () => {
|
|
51
52
|
var d;
|
|
52
|
-
m.value = await
|
|
53
|
+
m.value = await me.readMenuById(((d = V.restaurant.revertConfig) == null ? void 0 : d._id) || "");
|
|
53
54
|
},
|
|
54
55
|
{ isLoading: r }
|
|
55
56
|
);
|
|
@@ -63,25 +64,25 @@ const Fe = {
|
|
|
63
64
|
value: _._id
|
|
64
65
|
}))
|
|
65
66
|
];
|
|
66
|
-
}), { t: p } =
|
|
67
|
+
}), { t: p } = W(), t = S(() => {
|
|
67
68
|
var k;
|
|
68
69
|
const d = V.restaurant.revertConfig;
|
|
69
70
|
if (!d) return [];
|
|
70
|
-
const _ =
|
|
71
|
+
const _ = Ie(
|
|
71
72
|
[
|
|
72
73
|
{
|
|
73
74
|
...d,
|
|
74
75
|
catalogId: d.catalogId || null
|
|
75
76
|
}
|
|
76
77
|
],
|
|
77
|
-
|
|
78
|
+
be().restaurants.value,
|
|
78
79
|
f.value
|
|
79
80
|
)[0];
|
|
80
81
|
return [
|
|
81
82
|
{ label: p("menu.revert.labels.restaurant"), value: V.restaurant.name },
|
|
82
83
|
{
|
|
83
84
|
label: p("menu.revert.labels.revert_to"),
|
|
84
|
-
value:
|
|
85
|
+
value: oe((k = m.value) == null ? void 0 : k.updatedAt)
|
|
85
86
|
},
|
|
86
87
|
{ label: p("menu.revert.labels.default"), value: _._default },
|
|
87
88
|
{ label: p("menu.revert.labels.pos_takeaway"), value: _._posTakeaway },
|
|
@@ -92,16 +93,16 @@ const Fe = {
|
|
|
92
93
|
}
|
|
93
94
|
];
|
|
94
95
|
});
|
|
95
|
-
|
|
96
|
-
const { emitData:
|
|
96
|
+
ue(async () => y());
|
|
97
|
+
const { emitData: R } = _e();
|
|
97
98
|
return (d, _) => {
|
|
98
99
|
const k = C("FmCircularProgress");
|
|
99
|
-
return r.value ? (h(),
|
|
100
|
-
|
|
101
|
-
])) : (h(),
|
|
102
|
-
o("div",
|
|
103
|
-
o("div",
|
|
104
|
-
(h(!0),
|
|
100
|
+
return r.value ? (h(), D("div", $e, [
|
|
101
|
+
s(k, { size: "lg" })
|
|
102
|
+
])) : (h(), D("div", Ae, [
|
|
103
|
+
o("div", Me, F(i(p)("menu.revert.description", { name: V.restaurant.name })), 1),
|
|
104
|
+
o("div", De, [
|
|
105
|
+
(h(!0), D(E, null, G(t.value, ($) => (h(), O(we, {
|
|
105
106
|
key: $.label,
|
|
106
107
|
name: $.label,
|
|
107
108
|
value: $.value || "--"
|
|
@@ -110,7 +111,7 @@ const Fe = {
|
|
|
110
111
|
]));
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
|
-
}),
|
|
114
|
+
}), Ue = { class: "fm-typo-en-title-md-600" }, Le = { class: "mt-40" }, Pe = { class: "fm-typo-en-title-sm-600" }, Be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Ee = { class: "flex gap-8 items-center justify-start" }, Oe = /* @__PURE__ */ q({
|
|
114
115
|
__name: "UpdateCatalogDialog",
|
|
115
116
|
props: {
|
|
116
117
|
catalogs: {
|
|
@@ -120,7 +121,7 @@ const Fe = {
|
|
|
120
121
|
},
|
|
121
122
|
emits: ["onComplete"],
|
|
122
123
|
setup(x, { expose: V, emit: l }) {
|
|
123
|
-
const { t: c } =
|
|
124
|
+
const { t: c } = W(), r = x;
|
|
124
125
|
V({
|
|
125
126
|
show: _,
|
|
126
127
|
hide: k
|
|
@@ -153,15 +154,15 @@ const Fe = {
|
|
|
153
154
|
label: g.name,
|
|
154
155
|
value: g._id
|
|
155
156
|
}))
|
|
156
|
-
]), t = I(y()),
|
|
157
|
+
]), t = I(y()), R = I(!1), d = I(void 0);
|
|
157
158
|
function _(g) {
|
|
158
|
-
d.value = g ?
|
|
159
|
+
d.value = g ? Z(g) : y(), t.value = Z(d.value), R.value = !0;
|
|
159
160
|
}
|
|
160
161
|
function k() {
|
|
161
|
-
|
|
162
|
+
R.value = !1;
|
|
162
163
|
}
|
|
163
|
-
const $ =
|
|
164
|
-
() => !
|
|
164
|
+
const $ = Se(
|
|
165
|
+
() => !pe.isEqual(d.value, t.value),
|
|
165
166
|
() => {
|
|
166
167
|
k();
|
|
167
168
|
}
|
|
@@ -170,25 +171,25 @@ const Fe = {
|
|
|
170
171
|
k(), m("onComplete", t.value);
|
|
171
172
|
}
|
|
172
173
|
return (g, v) => {
|
|
173
|
-
const
|
|
174
|
+
const U = C("FmSelect"), N = C("FmCheckbox"), M = C("FmButton"), B = C("FmSideSheet");
|
|
174
175
|
return h(), O(B, {
|
|
175
|
-
modelValue:
|
|
176
|
-
"onUpdate:modelValue": v[5] || (v[5] = (b) =>
|
|
176
|
+
modelValue: R.value,
|
|
177
|
+
"onUpdate:modelValue": v[5] || (v[5] = (b) => R.value = b),
|
|
177
178
|
"max-width": 560,
|
|
178
179
|
"onOn:clickedAway": i($)
|
|
179
180
|
}, {
|
|
180
|
-
"side-sheet-header":
|
|
181
|
-
o("span",
|
|
181
|
+
"side-sheet-header": P(() => [
|
|
182
|
+
o("span", Ue, F(i(c)("menu.publish.update_catalog_dialog.title")), 1)
|
|
182
183
|
]),
|
|
183
|
-
"side-sheet-footer":
|
|
184
|
-
o("div",
|
|
185
|
-
|
|
184
|
+
"side-sheet-footer": P(() => [
|
|
185
|
+
o("div", Ee, [
|
|
186
|
+
s(M, {
|
|
186
187
|
label: i(c)("menu.publish.update_catalog_dialog.actions.update"),
|
|
187
188
|
size: "lg",
|
|
188
189
|
variant: "primary",
|
|
189
190
|
onClick: v[4] || (v[4] = () => T())
|
|
190
191
|
}, null, 8, ["label"]),
|
|
191
|
-
|
|
192
|
+
s(M, {
|
|
192
193
|
label: i(c)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
193
194
|
size: "lg",
|
|
194
195
|
variant: "tertiary",
|
|
@@ -196,34 +197,34 @@ const Fe = {
|
|
|
196
197
|
}, null, 8, ["label"])
|
|
197
198
|
])
|
|
198
199
|
]),
|
|
199
|
-
default:
|
|
200
|
-
|
|
200
|
+
default: P(() => [
|
|
201
|
+
s(U, {
|
|
201
202
|
modelValue: t.value.catalogId,
|
|
202
203
|
"onUpdate:modelValue": v[0] || (v[0] = (b) => t.value.catalogId = b),
|
|
203
204
|
items: f.value,
|
|
204
205
|
class: "mb-24",
|
|
205
206
|
label: i(c)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
206
207
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
207
|
-
|
|
208
|
+
s(U, {
|
|
208
209
|
modelValue: t.value.takeawayCatalog,
|
|
209
210
|
"onUpdate:modelValue": v[1] || (v[1] = (b) => t.value.takeawayCatalog = b),
|
|
210
211
|
items: p.value,
|
|
211
212
|
class: "mb-24",
|
|
212
213
|
label: i(c)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
213
214
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
214
|
-
|
|
215
|
+
s(U, {
|
|
215
216
|
modelValue: t.value.pickupCatalog,
|
|
216
217
|
"onUpdate:modelValue": v[2] || (v[2] = (b) => t.value.pickupCatalog = b),
|
|
217
218
|
items: p.value,
|
|
218
219
|
label: i(c)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
219
220
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
220
|
-
o("div",
|
|
221
|
-
o("div",
|
|
222
|
-
o("div",
|
|
223
|
-
(h(!0),
|
|
221
|
+
o("div", Le, [
|
|
222
|
+
o("div", Pe, F(i(c)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
223
|
+
o("div", Be, F(i(c)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
224
|
+
(h(!0), D(E, null, G(x.catalogs, (b) => (h(), D("div", {
|
|
224
225
|
key: b._id
|
|
225
226
|
}, [
|
|
226
|
-
|
|
227
|
+
s(N, {
|
|
227
228
|
modelValue: t.value.additionalCatalogs,
|
|
228
229
|
"onUpdate:modelValue": v[3] || (v[3] = (w) => t.value.additionalCatalogs = w),
|
|
229
230
|
label: b.name,
|
|
@@ -236,44 +237,44 @@ const Fe = {
|
|
|
236
237
|
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
237
238
|
};
|
|
238
239
|
}
|
|
239
|
-
}),
|
|
240
|
+
}), Te = {
|
|
240
241
|
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
241
|
-
},
|
|
242
|
+
}, Ne = {
|
|
242
243
|
class: "flex items-center xs:mb-8 mb-24"
|
|
243
|
-
},
|
|
244
|
+
}, ze = {
|
|
244
245
|
class: "mr-8"
|
|
245
|
-
},
|
|
246
|
+
}, He = {
|
|
246
247
|
class: "fm-typo-en-title-md-600"
|
|
247
|
-
},
|
|
248
|
+
}, Ke = {
|
|
248
249
|
class: "xs:hidden"
|
|
249
|
-
},
|
|
250
|
+
}, je = {
|
|
250
251
|
class: "pb-8 flex justify-between xs:flex-col gap-8"
|
|
251
|
-
},
|
|
252
|
+
}, Ye = {
|
|
252
253
|
class: "grow flex flex-col gap-4"
|
|
253
|
-
},
|
|
254
|
+
}, qe = {
|
|
254
255
|
class: "flex gap-8 items-center"
|
|
255
|
-
},
|
|
256
|
+
}, Ge = {
|
|
256
257
|
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
257
|
-
},
|
|
258
|
+
}, We = {
|
|
258
259
|
class: "space-y-4"
|
|
259
|
-
},
|
|
260
|
+
}, Je = {
|
|
260
261
|
class: "fm-typo-en-body-lg-600"
|
|
261
|
-
},
|
|
262
|
+
}, Qe = {
|
|
262
263
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
263
|
-
},
|
|
264
|
+
}, Xe = {
|
|
264
265
|
class: "flex gap-8"
|
|
265
|
-
},
|
|
266
|
+
}, Ze = {
|
|
266
267
|
class: "xs:block hidden fixed bottom-72 right-16"
|
|
267
|
-
},
|
|
268
|
+
}, Y = 40, ma = /* @__PURE__ */ q({
|
|
268
269
|
__name: "Publish",
|
|
269
270
|
setup(x) {
|
|
270
|
-
const V =
|
|
271
|
+
const V = re(), {
|
|
271
272
|
t: l
|
|
272
|
-
} =
|
|
273
|
+
} = W(), c = (e) => t.state.menu.updatedAt === e.updatedAt, r = ({
|
|
273
274
|
row: e
|
|
274
275
|
}) => {
|
|
275
276
|
const a = c(e);
|
|
276
|
-
return
|
|
277
|
+
return s(ye, {
|
|
277
278
|
label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
278
279
|
variant: a ? "success" : "warning"
|
|
279
280
|
}, null);
|
|
@@ -309,7 +310,7 @@ const Fe = {
|
|
|
309
310
|
accessorKey: "status",
|
|
310
311
|
header: () => l("menu.common.labels.status"),
|
|
311
312
|
enableSorting: !1,
|
|
312
|
-
cell: (e) =>
|
|
313
|
+
cell: (e) => s(r, {
|
|
313
314
|
row: e.row.original
|
|
314
315
|
}, null)
|
|
315
316
|
}, {
|
|
@@ -319,32 +320,32 @@ const Fe = {
|
|
|
319
320
|
enableSorting: !1,
|
|
320
321
|
cell: (e) => {
|
|
321
322
|
const a = e.row.original;
|
|
322
|
-
return t.state.menu.updatedAt, a.updatedAt,
|
|
323
|
+
return t.state.menu.updatedAt, a.updatedAt, j("div", {
|
|
323
324
|
class: "flex justify-end gap-8"
|
|
324
|
-
}, [d.value && a.revertConfig ?
|
|
325
|
+
}, [d.value && a.revertConfig ? xe(j(ee.FmButton, {
|
|
325
326
|
prependIcon: "undo",
|
|
326
327
|
variant: "secondary",
|
|
327
|
-
onClick:
|
|
328
|
+
onClick: H(async () => {
|
|
328
329
|
await _(e.row.original);
|
|
329
330
|
}, ["stop", "prevent"])
|
|
330
|
-
}), l("menu.publish.actions.revert")) : null,
|
|
331
|
+
}), l("menu.publish.actions.revert")) : null, j(ee.FmButton, {
|
|
331
332
|
label: l("menu.publish.actions.publish"),
|
|
332
333
|
icon: "ios_share",
|
|
333
334
|
variant: "secondary",
|
|
334
|
-
onClick:
|
|
335
|
-
const
|
|
336
|
-
await B(
|
|
335
|
+
onClick: H(async () => {
|
|
336
|
+
const u = U(e.row.original);
|
|
337
|
+
await B(u);
|
|
337
338
|
}, ["stop", "prevent"])
|
|
338
339
|
})]);
|
|
339
340
|
},
|
|
340
341
|
meta: {
|
|
341
342
|
width: "150px"
|
|
342
343
|
}
|
|
343
|
-
}], f = I(""), p = I(), t =
|
|
344
|
+
}], f = I(""), p = I(), t = ge(), R = he(), d = S(() => t.version !== ve.F_MENU_VERSION.enum.v3);
|
|
344
345
|
async function _(e) {
|
|
345
|
-
e.revertConfig &&
|
|
346
|
+
e.revertConfig && R.open({
|
|
346
347
|
title: "Revert menu",
|
|
347
|
-
contentComponent:
|
|
348
|
+
contentComponent: Re,
|
|
348
349
|
contentComponentProps: {
|
|
349
350
|
restaurant: e
|
|
350
351
|
},
|
|
@@ -369,14 +370,14 @@ const Fe = {
|
|
|
369
370
|
version: $(t.state.menu.updatedAt)
|
|
370
371
|
}));
|
|
371
372
|
function $(e) {
|
|
372
|
-
return e ?
|
|
373
|
+
return e ? ae(e).format("DD/MM/YYYY hh:mmA") : "";
|
|
373
374
|
}
|
|
374
375
|
const T = S(() => t.state.menu.modules.catalog), g = S(() => M.queue.value.some((e) => e.id === t.state.menu._id));
|
|
375
376
|
function v(e) {
|
|
376
377
|
var a;
|
|
377
|
-
return e ? ((a = T.value.find((
|
|
378
|
+
return e ? ((a = T.value.find((u) => u._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
+
function U(e) {
|
|
380
381
|
return {
|
|
381
382
|
restaurantId: e._id,
|
|
382
383
|
catalogId: e.catalogId,
|
|
@@ -386,14 +387,14 @@ const Fe = {
|
|
|
386
387
|
};
|
|
387
388
|
}
|
|
388
389
|
function N(e) {
|
|
389
|
-
var
|
|
390
|
-
const a =
|
|
391
|
-
(
|
|
390
|
+
var u;
|
|
391
|
+
const a = U(e);
|
|
392
|
+
(u = p.value) == null || u.show(a);
|
|
392
393
|
}
|
|
393
|
-
const M =
|
|
394
|
+
const M = te(le());
|
|
394
395
|
async function B(e) {
|
|
395
|
-
var
|
|
396
|
-
const a = (
|
|
396
|
+
var u;
|
|
397
|
+
const a = (u = w.value.find((L) => L._id === e.restaurantId)) == null ? void 0 : u.name;
|
|
397
398
|
await M.minor(async () => await t.publishMenu(e), {
|
|
398
399
|
customId: t.state.menu._id,
|
|
399
400
|
message: `Publishing menu for ${a}`,
|
|
@@ -410,88 +411,87 @@ const Fe = {
|
|
|
410
411
|
takeaway: v(e.takeawayCatalog),
|
|
411
412
|
pickup: v(e.pickupCatalog)
|
|
412
413
|
}
|
|
413
|
-
}))),
|
|
414
|
+
}))), se = S(() => {
|
|
414
415
|
const e = f.value.toLowerCase();
|
|
415
416
|
return w.value.filter(({
|
|
416
417
|
name: a,
|
|
417
|
-
catalog:
|
|
418
|
-
}) => a.toLowerCase().includes(e) ||
|
|
418
|
+
catalog: u
|
|
419
|
+
}) => a.toLowerCase().includes(e) || u.default.toLowerCase().includes(e) || u.takeaway.toLowerCase().includes(e) || u.pickup.toLowerCase().includes(e));
|
|
419
420
|
});
|
|
420
|
-
async function
|
|
421
|
-
const a = I("");
|
|
421
|
+
async function J(e) {
|
|
422
|
+
const a = e.map((A) => A._id), u = ke(a, Y), L = I("");
|
|
422
423
|
await M.minor(async () => {
|
|
423
|
-
await
|
|
424
|
-
items:
|
|
425
|
-
processor: async (
|
|
426
|
-
|
|
427
|
-
return await t.publishMenu(D, !1);
|
|
428
|
-
},
|
|
429
|
-
batchSize: 5,
|
|
424
|
+
await Ve({
|
|
425
|
+
items: u,
|
|
426
|
+
processor: async (A) => await t.publishMultipleMenu(A, !1),
|
|
427
|
+
batchSize: 1,
|
|
430
428
|
batchDelay: 50,
|
|
431
429
|
// 50ms delay to reduce server load
|
|
432
430
|
onProgress({
|
|
433
|
-
total:
|
|
434
|
-
batchStart:
|
|
435
|
-
batchEnd:
|
|
431
|
+
total: A,
|
|
432
|
+
batchStart: z,
|
|
433
|
+
batchEnd: X
|
|
436
434
|
}) {
|
|
437
|
-
|
|
435
|
+
const K = (z - 1) * Y;
|
|
436
|
+
L.value = `Processed ${K} of ${e.length} restaurants`;
|
|
438
437
|
}
|
|
439
438
|
}), await t.readRestaurants(), await t.readMenu();
|
|
440
439
|
}, {
|
|
441
440
|
customId: t.state.menu._id,
|
|
442
|
-
message:
|
|
441
|
+
message: "Publishing menu",
|
|
442
|
+
caption: L,
|
|
443
443
|
successMessage: `Published to ${e.length} restaurant${e.length > 1 ? "s" : ""}`
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
|
-
async function
|
|
446
|
+
async function Q() {
|
|
447
447
|
if (g.value) return;
|
|
448
|
-
const e = Object.keys(m.value).map(Number).filter((
|
|
449
|
-
a.length >
|
|
448
|
+
const e = Object.keys(m.value).map(Number).filter((u) => m.value[u]), a = e.length === 0 || e.length === w.value.length ? w.value : e.map((u) => w.value[u]);
|
|
449
|
+
a.length > Y ? await J(a) : e.length === 0 || e.length === w.value.length ? await M.minor(async () => await t.publishAllMenu(), {
|
|
450
450
|
customId: t.state.menu._id
|
|
451
|
-
}) : await
|
|
451
|
+
}) : await J(a);
|
|
452
452
|
}
|
|
453
453
|
return (e, a) => {
|
|
454
|
-
const
|
|
455
|
-
return h(),
|
|
454
|
+
const u = C("FmChip"), L = C("FmSpacer"), A = C("FmButton"), z = C("FmSearch"), X = C("FmTable"), K = C("FmListItem"), ne = C("FmList");
|
|
455
|
+
return h(), D(E, null, [o("div", Te, [o("div", Ne, [o("div", ze, [o("div", He, F(i(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
|
|
456
456
|
class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
457
|
-
}, null, -1))]),
|
|
457
|
+
}, null, -1))]), s(u, {
|
|
458
458
|
label: k.value,
|
|
459
459
|
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
460
|
-
}, null, 8, ["label"]),
|
|
460
|
+
}, null, 8, ["label"]), s(L), o("div", Ke, [s(A, {
|
|
461
461
|
disabled: g.value,
|
|
462
462
|
icon: "ios_share",
|
|
463
463
|
label: i(l)("menu.publish.actions.publish_all"),
|
|
464
464
|
variant: "primary",
|
|
465
|
-
onClick: a[0] || (a[0] = () =>
|
|
466
|
-
}, null, 8, ["disabled", "label"])])]), o("div",
|
|
465
|
+
onClick: a[0] || (a[0] = () => Q())
|
|
466
|
+
}, null, 8, ["disabled", "label"])])]), o("div", je, [s(i(fe), {
|
|
467
467
|
multiple: "",
|
|
468
468
|
modelValue: b.value,
|
|
469
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
469
|
+
"onUpdate:modelValue": a[2] || (a[2] = (n) => b.value = n)
|
|
470
470
|
}, {
|
|
471
|
-
"append-right":
|
|
471
|
+
"append-right": P(() => [s(L, {
|
|
472
472
|
class: "xs:hidden"
|
|
473
|
-
}),
|
|
473
|
+
}), s(z, {
|
|
474
474
|
modelValue: f.value,
|
|
475
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
475
|
+
"onUpdate:modelValue": a[1] || (a[1] = (n) => f.value = n),
|
|
476
476
|
autofocus: "",
|
|
477
477
|
class: "w-[320px] xs:hidden",
|
|
478
478
|
placeholder: i(l)("menu.publish.table.search.placeholder")
|
|
479
479
|
}, null, 8, ["modelValue", "placeholder"])]),
|
|
480
480
|
_: 1
|
|
481
|
-
}, 8, ["modelValue"]),
|
|
481
|
+
}, 8, ["modelValue"]), s(z, {
|
|
482
482
|
modelValue: f.value,
|
|
483
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
483
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => f.value = n),
|
|
484
484
|
autofocus: "",
|
|
485
485
|
class: "w-full xs:block hidden",
|
|
486
486
|
placeholder: i(l)("menu.publish.table.search.placeholder")
|
|
487
|
-
}, null, 8, ["modelValue", "placeholder"])]), w.value.length > 0 ? (h(),
|
|
487
|
+
}, null, 8, ["modelValue", "placeholder"])]), w.value.length > 0 ? (h(), D(E, {
|
|
488
488
|
key: 0
|
|
489
|
-
}, [
|
|
489
|
+
}, [s(Ce, {
|
|
490
490
|
class: "xs:hidden block"
|
|
491
491
|
}, {
|
|
492
|
-
default:
|
|
492
|
+
default: P(() => [s(X, {
|
|
493
493
|
modelValue: m.value,
|
|
494
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
494
|
+
"onUpdate:modelValue": a[4] || (a[4] = (n) => m.value = n),
|
|
495
495
|
"column-defs": y,
|
|
496
496
|
loading: g.value,
|
|
497
497
|
"page-size": w.value.length,
|
|
@@ -502,39 +502,39 @@ const Fe = {
|
|
|
502
502
|
selection: "multiple",
|
|
503
503
|
"hide-footer": "",
|
|
504
504
|
"pin-header-row": "",
|
|
505
|
-
onRowClick: a[5] || (a[5] = (
|
|
505
|
+
onRowClick: a[5] || (a[5] = (n) => N(n.original))
|
|
506
506
|
}, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
|
|
507
507
|
_: 1
|
|
508
|
-
}),
|
|
508
|
+
}), s(ne, {
|
|
509
509
|
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
510
510
|
separator: ""
|
|
511
511
|
}, {
|
|
512
|
-
default:
|
|
513
|
-
key:
|
|
514
|
-
label:
|
|
512
|
+
default: P(() => [(h(!0), D(E, null, G(se.value, (n) => (h(), O(K, {
|
|
513
|
+
key: n._id,
|
|
514
|
+
label: n.name,
|
|
515
515
|
style: {
|
|
516
516
|
padding: "12px 0 !important"
|
|
517
517
|
},
|
|
518
|
-
onClick: () => N(
|
|
518
|
+
onClick: () => N(n)
|
|
519
519
|
}, {
|
|
520
|
-
default:
|
|
521
|
-
row:
|
|
522
|
-
}, null, 8, ["row"])]), o("div",
|
|
520
|
+
default: P(() => [o("div", Ye, [o("div", qe, [o("div", Ge, F($(n.updatedAt)), 1), s(r, {
|
|
521
|
+
row: n
|
|
522
|
+
}, null, 8, ["row"])]), o("div", We, [o("div", Je, F(n.name), 1), o("div", Qe, [o("div", null, "Default: " + F(n.catalog.default), 1), o("div", null, "POS takeaway: " + F(n.catalog.takeaway), 1), o("div", null, "Pickup: " + F(n.catalog.pickup), 1)])])]), o("div", Xe, [d.value && n.revertConfig ? (h(), O(A, {
|
|
523
523
|
key: 0,
|
|
524
524
|
disabled: g.value,
|
|
525
525
|
icon: "undo",
|
|
526
526
|
variant: "tertiary",
|
|
527
|
-
onClick:
|
|
528
|
-
}, null, 8, ["disabled", "onClick"])) :
|
|
527
|
+
onClick: H(() => _(n), ["stop"])
|
|
528
|
+
}, null, 8, ["disabled", "onClick"])) : ie("", !0), s(A, {
|
|
529
529
|
disabled: g.value,
|
|
530
530
|
icon: "ios_share",
|
|
531
531
|
variant: "tertiary",
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: H(() => B(U(n)), ["stop"])
|
|
533
533
|
}, null, 8, ["disabled", "onClick"])])]),
|
|
534
534
|
_: 2
|
|
535
535
|
}, 1032, ["label", "onClick"]))), 128))]),
|
|
536
536
|
_: 1
|
|
537
|
-
})], 64)) : (h(), O(i(
|
|
537
|
+
})], 64)) : (h(), O(i(Fe), {
|
|
538
538
|
key: 1,
|
|
539
539
|
title: i(l)("menu.publish.empty.title"),
|
|
540
540
|
subtitle: i(l)("menu.publish.empty.subtitle"),
|
|
@@ -547,13 +547,13 @@ const Fe = {
|
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
}, null, 8, ["title", "subtitle", "action"]))]), o("div",
|
|
550
|
+
}, null, 8, ["title", "subtitle", "action"]))]), o("div", Ze, [s(A, {
|
|
551
551
|
disabled: g.value,
|
|
552
552
|
icon: "ios_share",
|
|
553
553
|
label: i(l)("menu.publish.actions.publish_all"),
|
|
554
554
|
variant: "fab",
|
|
555
|
-
onClick: a[6] || (a[6] = () =>
|
|
556
|
-
}, null, 8, ["disabled", "label"])]),
|
|
555
|
+
onClick: a[6] || (a[6] = () => Q())
|
|
556
|
+
}, null, 8, ["disabled", "label"])]), s(Oe, {
|
|
557
557
|
ref_key: "updateCatalogDialogRef",
|
|
558
558
|
ref: p,
|
|
559
559
|
catalogs: T.value,
|
|
@@ -563,5 +563,5 @@ const Fe = {
|
|
|
563
563
|
}
|
|
564
564
|
});
|
|
565
565
|
export {
|
|
566
|
-
|
|
566
|
+
ma as default
|
|
567
567
|
};
|
|
@@ -2,15 +2,15 @@ import { defineComponent as z, computed as h, ref as w, reactive as Q, watch as
|
|
|
2
2
|
import { useI18n as U } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as A, components as j, useDialog as ne, FmButtonVariant as G, useBreakpoints as oe } from "@feedmepos/ui-library";
|
|
4
4
|
import { _ as ae } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import { _ as le } from "./app-
|
|
6
|
-
import { O as q, G as $, H as ie, D as P, I as se, e as Y, J as I, A as T, u as H } from "./menu-
|
|
5
|
+
import { _ as le } from "./app-Brm1kWbu.js";
|
|
6
|
+
import { O as q, G as $, H as ie, D as P, I as se, e as Y, J as I, A as T, u as H } from "./menu-D1ph5NBB.js";
|
|
7
7
|
import { _ as re } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
8
8
|
import { _ as ce } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
9
9
|
import { defineStore as ue } from "pinia";
|
|
10
|
-
import { _ as B, g as me } from "./InventoryBinding.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { _ as B, g as me } from "./InventoryBinding.vue_vue_type_script_setup_true_lang-CBnGxphp.js";
|
|
11
11
|
import { u as de } from "./discardConfirm-BHni0LNu.js";
|
|
12
12
|
import { c as pe } from "./check-C9mY6LiX.js";
|
|
13
|
-
import "./unit-
|
|
13
|
+
import "./unit-bsmM8Os6.js";
|
|
14
14
|
import { c as fe } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
15
15
|
const _e = { class: "fm-typo-en-title-md-600" }, ve = { class: "pt-8 space-y-40" }, ye = { class: "flex flex-row gap-16" }, ge = { class: "flex gap-8 items-center justify-start" }, be = /* @__PURE__ */ z({
|
|
16
16
|
__name: "Form",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as N, computed as y, h as c, withModifiers as U, ref as V, resolveComponent as _, createBlock as k, openBlock as d, unref as m, withCtx as h, createElementBlock as D, createVNode as f, Fragment as H, createElementVNode as l, renderList as T, toDisplayString as S, createCommentVNode as I } from "vue";
|
|
2
|
-
import { A as i, O as W, u as G, G as Q } from "./menu-
|
|
2
|
+
import { A as i, O as W, u as G, G as Q } from "./menu-D1ph5NBB.js";
|
|
3
3
|
import { useI18n as J } from "@feedmepos/mf-common";
|
|
4
4
|
import { components as X, useDialog as Z, useSnackbar as ee } from "@feedmepos/ui-library";
|
|
5
5
|
import { _ as te } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
6
|
-
import { _ as ne } from "./app-
|
|
7
|
-
import { d as ae, _ as oe, u as se, c as le } from "./scheduler-
|
|
6
|
+
import { _ as ne } from "./app-Brm1kWbu.js";
|
|
7
|
+
import { d as ae, _ as oe, u as se, c as le } from "./scheduler-Cyq65N6m.js";
|
|
8
8
|
import { _ as re } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
9
9
|
import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
10
10
|
const ce = {
|