@feedmepos/mf-menu 0.31.22-prod → 0.31.23-prod
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-DpdW2RHk.js → App-DJYaG22M.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C4b9xCO_.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CMctomEh.js} +2 -2
- package/dist/{Catalog-QVYGye4A.js → Catalog-CvAKnJX6.js} +5 -5
- package/dist/{Category-DbInw9CJ.js → Category-DH-Wh-cE.js} +5 -5
- package/dist/{Category-C517AQmB.js → Category-DuKbHX_a.js} +4 -4
- package/dist/{CookingGuide-CA-GtI8N.js → CookingGuide-ruWE5CR7.js} +3 -3
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-COqN_H4w.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CUM43rW1.js} +1 -1
- package/dist/{Group-CBZIa6ak.js → Group-CorFuet3.js} +3 -3
- package/dist/{Group-Dw-JDmi9.js → Group-DgtAnNFS.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-D9H_cvxr.js → Group.vue_vue_type_script_setup_true_lang-srfCUP6a.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Bda8xXur.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BHt95qtc.js} +3 -3
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-D2rOi4X4.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Di5ITRsA.js} +6 -6
- package/dist/{Ingredient-a0kfI9hR.js → Ingredient-YZJOV0UG.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-VAbCO-Hc.js → InventoryBinding.vue_vue_type_script_setup_true_lang-uZkLQs-b.js} +1052 -1052
- package/dist/{LinkProductSideSheet-CmJe-QtW.js → LinkProductSideSheet-DRJ-sYbM.js} +1 -1
- package/dist/{MenuSetting-hhrMQoRn.js → MenuSetting-6nNt4wPn.js} +4 -4
- package/dist/{PrintRoute-BajVAWUX.js → PrintRoute-DCTfjCJi.js} +3 -3
- package/dist/{Product-CUrxKd71.js → Product-CzCSHIOC.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-roEiMV6q.js → Product.vue_vue_type_script_setup_true_lang-jQs4xUmj.js} +11 -11
- package/dist/{ProductInternalTools-DKvVAjU3.js → ProductInternalTools-CWTJl1g7.js} +5 -5
- package/dist/{Products-5FqZ7dA-.js → Products-CD4VucQC.js} +10 -10
- package/dist/{Publish-BFPtJC-m.js → Publish-tZJlSfeE.js} +185 -169
- package/dist/{Recipe-CzMu754B.js → Recipe-BwvObWYK.js} +4 -4
- package/dist/{Scheduler-DllpkTzR.js → Scheduler-DRHaOH5X.js} +3 -3
- package/dist/{ServingSequence-CZwijDik.js → ServingSequence-CL6ovJPc.js} +3 -3
- package/dist/{Setting-4Si49ZLx.js → Setting-BMmkxEhb.js} +4 -4
- package/dist/{Subcategory-BnHTbsS3.js → Subcategory-kwVB3haR.js} +4 -4
- package/dist/{Takeaway-C8ctGmQD.js → Takeaway-DRQKI9cD.js} +1 -1
- package/dist/{Takeaway-BMDV98k6.js → Takeaway-VAfS-v1v.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DN51jcjn.js → Takeaway.vue_vue_type_script_setup_true_lang-BX-RHTl9.js} +5 -5
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DIP1_ztB.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-KP0lR_fT.js} +12 -12
- package/dist/{Unit-fGa_P0ok.js → Unit-C2XUA3ZV.js} +2 -2
- package/dist/{Variant-Cuk5Ijlo.js → Variant-ibBSu4u0.js} +3 -3
- package/dist/{_id_-D3hi4r2C.js → _id_-peGrIAdG.js} +9 -9
- package/dist/{app-jX_wY4Ba.js → app-BAfbywN2.js} +1 -1
- package/dist/app-tKhKZO8e.js +2063 -0
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +12 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-YyZ8Rs8j.js → linked-status-CKyAQ14q.js} +2 -2
- package/dist/assets/{override-menu-399cxcOo.js → override-menu-BWGUe-Ds.js} +2 -2
- package/dist/assets/{validate-menu-Cip9RfSb.js → validate-menu-BLscMlHh.js} +2 -2
- package/dist/{catalog-Dzu5Rz__.js → catalog-BRb3OqBO.js} +1 -1
- package/dist/{catalogSetting-eeymZcnx.js → catalogSetting-D4WVJDdG.js} +1 -1
- package/dist/{category-fILFRv6e.js → category-Df614h_D.js} +1 -1
- package/dist/{currency-Bc55xebV.js → currency-BjTyZEAh.js} +1 -1
- package/dist/{dayjs.min-WG2jjNdv.js → dayjs.min-BDmWh9jM.js} +1 -1
- package/dist/{index-BDESnYHi.js → index-CqRKUawK.js} +1 -1
- package/dist/{index-DYvofZsf.js → index-D7Vv8zpT.js} +3 -3
- package/dist/{index-BUgRi_EG.js → index-DDEgOTgT.js} +2 -2
- package/dist/{item-DFBtbpX2.js → item-Vm4KGaaQ.js} +1232 -1229
- package/dist/{jszip.min-BfQ-B0zc.js → jszip.min-CW5_vNOk.js} +2 -2
- package/dist/{menu-xB8NsHMU.js → menu-DcNv7MsL.js} +1 -1
- package/dist/{menu-CmrGK0pD.js → menu-Jj1EC4nG.js} +375 -375
- package/dist/{priceTier-DTSUztx0.js → priceTier-COa4cXXQ.js} +1 -1
- package/dist/{scheduler-D4ifHi0F.js → scheduler-D6GK1atn.js} +3 -3
- package/dist/{subcategory-B4HNXJFc.js → subcategory-Cf2Y1FxH.js} +62 -62
- package/dist/{toExcel-cDAXbr_K.js → toExcel-DuEUH3fU.js} +2 -2
- package/dist/{unit-DI5s5QXo.js → unit-BhUi5qtf.js} +1 -1
- package/package.json +1 -1
- package/dist/app-sSmNsn94.js +0 -2063
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as j, ref as
|
|
2
|
-
import { D as Q } from "./dayjs.min-
|
|
1
|
+
import { defineComponent as j, ref as $, computed as V, onMounted as se, resolveComponent as C, createElementBlock as D, openBlock as h, createVNode as s, createElementVNode as o, toDisplayString as F, unref as u, Fragment as B, renderList as Y, createBlock as E, withCtx as U, createCommentVNode as ne, withModifiers as K, h as T } from "vue";
|
|
2
|
+
import { D as Q } from "./dayjs.min-BDmWh9jM.js";
|
|
3
3
|
import { useRouter as ue } from "vue-router";
|
|
4
|
-
import { A as ie, e as re, D as X, a9 as ce, H as W, I as de, u as me, G as pe } from "./menu-
|
|
5
|
-
import { useI18n as q, useCoreStore as ve, RestaurantSelector as
|
|
6
|
-
import { useSnackbar as Z, useDialogChild as fe, useDialog as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { u as
|
|
11
|
-
import { _ as
|
|
4
|
+
import { A as ie, e as re, D as X, a9 as ce, H as W, I as de, u as me, G as pe, a1 as ge } from "./menu-Jj1EC4nG.js";
|
|
5
|
+
import { useI18n as q, useCoreStore as ve, RestaurantSelector as be } from "@feedmepos/mf-common";
|
|
6
|
+
import { useSnackbar as Z, useDialogChild as fe, useDialog as _e, components as J } from "@feedmepos/ui-library";
|
|
7
|
+
import { _ as he } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
8
|
+
import { _ as ye } from "./app-tKhKZO8e.js";
|
|
9
|
+
import { a as Ce, w as ke } from "./tooltip-B5BiPMx9.js";
|
|
10
|
+
import { u as we } from "./discardConfirm-BHni0LNu.js";
|
|
11
|
+
import { _ as xe } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
12
12
|
function ee(w) {
|
|
13
13
|
return w ? Q(w).format("DD/MM/YY HH:mm") : "-";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Ve(w, x, l) {
|
|
16
16
|
const r = (i, m = !1) => {
|
|
17
17
|
var y;
|
|
18
|
-
return i === void 0 && !m ? "-" : ((y = l.find((
|
|
18
|
+
return i === void 0 && !m ? "-" : ((y = l.find((f) => f.value === (i || null))) == null ? void 0 : y.label) || "-";
|
|
19
19
|
};
|
|
20
20
|
return w.map((i) => {
|
|
21
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 }),
|
|
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 }), f = r(i.catalogId);
|
|
23
23
|
return {
|
|
24
24
|
...i,
|
|
25
|
-
_default:
|
|
26
|
-
_posTakeaway: i.takeawayCatalog ? r(i.takeawayCatalog) :
|
|
25
|
+
_default: f,
|
|
26
|
+
_posTakeaway: i.takeawayCatalog ? r(i.takeawayCatalog) : f,
|
|
27
27
|
_additionalCatalogs: (i.additionalCatalogs || []).map((t) => r(t)),
|
|
28
28
|
_lastUpdate: ee(i.updatedAt),
|
|
29
29
|
_pickup: y ? r(i.pickupCatalog, !0) : "-",
|
|
@@ -32,50 +32,50 @@ function xe(w, x, l) {
|
|
|
32
32
|
};
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const Fe = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "flex items-center justify-center"
|
|
38
|
-
},
|
|
38
|
+
}, Se = {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "space-y-16"
|
|
41
|
-
},
|
|
41
|
+
}, Ie = { class: "text-fm-color-typo-secondary" }, $e = { class: "space-y-4" }, Ae = /* @__PURE__ */ j({
|
|
42
42
|
__name: "RevertDialog",
|
|
43
43
|
props: {
|
|
44
44
|
restaurant: {}
|
|
45
45
|
},
|
|
46
46
|
setup(w) {
|
|
47
|
-
const x = w, l = Z(), { custom: r } = X(l), i =
|
|
47
|
+
const x = w, l = Z(), { custom: r } = X(l), i = $(!1), m = $(null);
|
|
48
48
|
async function y() {
|
|
49
49
|
await r(
|
|
50
50
|
async () => {
|
|
51
|
-
var
|
|
52
|
-
m.value = await ce.readMenuById(((
|
|
51
|
+
var d;
|
|
52
|
+
m.value = await ce.readMenuById(((d = x.restaurant.revertConfig) == null ? void 0 : d._id) || "");
|
|
53
53
|
},
|
|
54
54
|
{ isLoading: i }
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
var
|
|
57
|
+
const f = V(() => {
|
|
58
|
+
var d;
|
|
59
59
|
return [
|
|
60
60
|
{ label: "Main", value: null },
|
|
61
|
-
...(((
|
|
61
|
+
...(((d = m.value) == null ? void 0 : d.modules.catalog) || []).map((_) => ({
|
|
62
62
|
label: _.name,
|
|
63
63
|
value: _._id
|
|
64
64
|
}))
|
|
65
65
|
];
|
|
66
66
|
}), { t: p } = q(), t = V(() => {
|
|
67
67
|
var k;
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
70
|
-
const _ =
|
|
68
|
+
const d = x.restaurant.revertConfig;
|
|
69
|
+
if (!d) return [];
|
|
70
|
+
const _ = Ve(
|
|
71
71
|
[
|
|
72
72
|
{
|
|
73
|
-
...
|
|
74
|
-
catalogId:
|
|
73
|
+
...d,
|
|
74
|
+
catalogId: d.catalogId || null
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
77
|
ve().restaurants.value,
|
|
78
|
-
|
|
78
|
+
f.value
|
|
79
79
|
)[0];
|
|
80
80
|
return [
|
|
81
81
|
{ label: p("menu.revert.labels.restaurant"), value: x.restaurant.name },
|
|
@@ -92,16 +92,16 @@ const Ve = {
|
|
|
92
92
|
}
|
|
93
93
|
];
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
const { emitData:
|
|
97
|
-
return (
|
|
95
|
+
se(async () => y());
|
|
96
|
+
const { emitData: R } = fe();
|
|
97
|
+
return (d, _) => {
|
|
98
98
|
const k = C("FmCircularProgress");
|
|
99
|
-
return i.value ? (h(), D("div",
|
|
100
|
-
|
|
101
|
-
])) : (h(), D("div",
|
|
102
|
-
o("div",
|
|
103
|
-
o("div",
|
|
104
|
-
(h(!0), D(
|
|
99
|
+
return i.value ? (h(), D("div", Fe, [
|
|
100
|
+
s(k, { size: "lg" })
|
|
101
|
+
])) : (h(), D("div", Se, [
|
|
102
|
+
o("div", Ie, F(u(p)("menu.revert.description", { name: x.restaurant.name })), 1),
|
|
103
|
+
o("div", $e, [
|
|
104
|
+
(h(!0), D(B, null, Y(t.value, (S) => (h(), E(Ce, {
|
|
105
105
|
key: S.label,
|
|
106
106
|
name: S.label,
|
|
107
107
|
value: S.value || "--"
|
|
@@ -110,7 +110,7 @@ const Ve = {
|
|
|
110
110
|
]));
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
}),
|
|
113
|
+
}), Me = { class: "fm-typo-en-title-md-600" }, De = { class: "mt-40" }, Re = { class: "fm-typo-en-title-sm-600" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Le = { class: "flex gap-8 items-center justify-start" }, Pe = /* @__PURE__ */ j({
|
|
114
114
|
__name: "UpdateCatalogDialog",
|
|
115
115
|
props: {
|
|
116
116
|
catalogs: {
|
|
@@ -135,60 +135,60 @@ const Ve = {
|
|
|
135
135
|
additionalCatalogs: []
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
const
|
|
138
|
+
const f = V(() => [
|
|
139
139
|
{
|
|
140
140
|
label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
141
141
|
value: null
|
|
142
142
|
},
|
|
143
|
-
...i.catalogs.map((
|
|
144
|
-
label:
|
|
145
|
-
value:
|
|
143
|
+
...i.catalogs.map((g) => ({
|
|
144
|
+
label: g.name,
|
|
145
|
+
value: g._id
|
|
146
146
|
}))
|
|
147
147
|
]), p = V(() => [
|
|
148
148
|
{
|
|
149
149
|
label: r("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
150
150
|
value: null
|
|
151
151
|
},
|
|
152
|
-
...i.catalogs.map((
|
|
153
|
-
label:
|
|
154
|
-
value:
|
|
152
|
+
...i.catalogs.map((g) => ({
|
|
153
|
+
label: g.name,
|
|
154
|
+
value: g._id
|
|
155
155
|
}))
|
|
156
|
-
]), t =
|
|
157
|
-
function _(
|
|
158
|
-
|
|
156
|
+
]), t = $(y()), R = $(!1), d = $(void 0);
|
|
157
|
+
function _(g) {
|
|
158
|
+
d.value = g ? W(g) : y(), t.value = W(d.value), R.value = !0;
|
|
159
159
|
}
|
|
160
160
|
function k() {
|
|
161
|
-
|
|
161
|
+
R.value = !1;
|
|
162
162
|
}
|
|
163
|
-
const S =
|
|
164
|
-
() => !de.isEqual(
|
|
163
|
+
const S = we(
|
|
164
|
+
() => !de.isEqual(d.value, t.value),
|
|
165
165
|
() => {
|
|
166
166
|
k();
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
|
-
function
|
|
169
|
+
function z() {
|
|
170
170
|
k(), m("onComplete", t.value);
|
|
171
171
|
}
|
|
172
|
-
return (
|
|
173
|
-
const
|
|
174
|
-
return h(), E(
|
|
175
|
-
modelValue:
|
|
176
|
-
"onUpdate:modelValue":
|
|
172
|
+
return (g, v) => {
|
|
173
|
+
const A = C("FmSelect"), N = C("FmCheckbox"), M = C("FmButton"), P = C("FmSideSheet");
|
|
174
|
+
return h(), E(P, {
|
|
175
|
+
modelValue: R.value,
|
|
176
|
+
"onUpdate:modelValue": v[5] || (v[5] = (b) => R.value = b),
|
|
177
177
|
"max-width": 560,
|
|
178
178
|
"onOn:clickedAway": u(S)
|
|
179
179
|
}, {
|
|
180
180
|
"side-sheet-header": U(() => [
|
|
181
|
-
o("span",
|
|
181
|
+
o("span", Me, F(u(r)("menu.publish.update_catalog_dialog.title")), 1)
|
|
182
182
|
]),
|
|
183
183
|
"side-sheet-footer": U(() => [
|
|
184
|
-
o("div",
|
|
185
|
-
|
|
184
|
+
o("div", Le, [
|
|
185
|
+
s(M, {
|
|
186
186
|
label: u(r)("menu.publish.update_catalog_dialog.actions.update"),
|
|
187
187
|
size: "lg",
|
|
188
188
|
variant: "primary",
|
|
189
|
-
onClick:
|
|
189
|
+
onClick: v[4] || (v[4] = () => z())
|
|
190
190
|
}, null, 8, ["label"]),
|
|
191
|
-
|
|
191
|
+
s(M, {
|
|
192
192
|
label: u(r)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
193
193
|
size: "lg",
|
|
194
194
|
variant: "tertiary",
|
|
@@ -197,37 +197,37 @@ const Ve = {
|
|
|
197
197
|
])
|
|
198
198
|
]),
|
|
199
199
|
default: U(() => [
|
|
200
|
-
|
|
200
|
+
s(A, {
|
|
201
201
|
modelValue: t.value.catalogId,
|
|
202
|
-
"onUpdate:modelValue":
|
|
203
|
-
items:
|
|
202
|
+
"onUpdate:modelValue": v[0] || (v[0] = (b) => t.value.catalogId = b),
|
|
203
|
+
items: f.value,
|
|
204
204
|
class: "mb-24",
|
|
205
205
|
label: u(r)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
206
206
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
207
|
-
|
|
207
|
+
s(A, {
|
|
208
208
|
modelValue: t.value.takeawayCatalog,
|
|
209
|
-
"onUpdate:modelValue":
|
|
209
|
+
"onUpdate:modelValue": v[1] || (v[1] = (b) => t.value.takeawayCatalog = b),
|
|
210
210
|
items: p.value,
|
|
211
211
|
class: "mb-24",
|
|
212
212
|
label: u(r)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
213
213
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
214
|
-
|
|
214
|
+
s(A, {
|
|
215
215
|
modelValue: t.value.pickupCatalog,
|
|
216
|
-
"onUpdate:modelValue":
|
|
216
|
+
"onUpdate:modelValue": v[2] || (v[2] = (b) => t.value.pickupCatalog = b),
|
|
217
217
|
items: p.value,
|
|
218
218
|
label: u(r)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
219
219
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
220
220
|
o("div", De, [
|
|
221
|
-
o("div",
|
|
222
|
-
o("div",
|
|
223
|
-
(h(!0), D(
|
|
224
|
-
key:
|
|
221
|
+
o("div", Re, F(u(r)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
222
|
+
o("div", Ue, F(u(r)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
223
|
+
(h(!0), D(B, null, Y(w.catalogs, (b) => (h(), D("div", {
|
|
224
|
+
key: b._id
|
|
225
225
|
}, [
|
|
226
|
-
|
|
226
|
+
s(N, {
|
|
227
227
|
modelValue: t.value.additionalCatalogs,
|
|
228
|
-
"onUpdate:modelValue":
|
|
229
|
-
label:
|
|
230
|
-
value:
|
|
228
|
+
"onUpdate:modelValue": v[3] || (v[3] = (I) => t.value.additionalCatalogs = I),
|
|
229
|
+
label: b.name,
|
|
230
|
+
value: b._id
|
|
231
231
|
}, null, 8, ["modelValue", "label", "value"])
|
|
232
232
|
]))), 128))
|
|
233
233
|
])
|
|
@@ -236,35 +236,35 @@ const Ve = {
|
|
|
236
236
|
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
}),
|
|
239
|
+
}), Be = {
|
|
240
240
|
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
241
241
|
}, Ee = {
|
|
242
242
|
class: "flex items-center xs:mb-8 mb-24"
|
|
243
|
-
},
|
|
243
|
+
}, ze = {
|
|
244
244
|
class: "mr-8"
|
|
245
245
|
}, Ne = {
|
|
246
246
|
class: "fm-typo-en-title-md-600"
|
|
247
247
|
}, Oe = {
|
|
248
248
|
class: "xs:hidden"
|
|
249
|
-
}, ze = {
|
|
250
|
-
class: "pb-8 flex justify-between xs:flex-col gap-8"
|
|
251
249
|
}, Ke = {
|
|
252
|
-
class: "
|
|
250
|
+
class: "pb-8 flex justify-between xs:flex-col gap-8"
|
|
253
251
|
}, Te = {
|
|
254
|
-
class: "flex
|
|
252
|
+
class: "grow flex flex-col gap-4"
|
|
255
253
|
}, je = {
|
|
256
|
-
class: "
|
|
254
|
+
class: "flex gap-8 items-center"
|
|
257
255
|
}, Ye = {
|
|
258
|
-
class: "
|
|
256
|
+
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
259
257
|
}, qe = {
|
|
260
|
-
class: "
|
|
258
|
+
class: "space-y-4"
|
|
261
259
|
}, He = {
|
|
262
|
-
class: "fm-typo-en-body-
|
|
260
|
+
class: "fm-typo-en-body-lg-600"
|
|
263
261
|
}, Ge = {
|
|
264
|
-
class: "
|
|
262
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
265
263
|
}, We = {
|
|
264
|
+
class: "flex gap-8"
|
|
265
|
+
}, Je = {
|
|
266
266
|
class: "xs:block hidden fixed bottom-72 right-16"
|
|
267
|
-
},
|
|
267
|
+
}, ia = /* @__PURE__ */ j({
|
|
268
268
|
__name: "Publish",
|
|
269
269
|
setup(w) {
|
|
270
270
|
const x = ue(), {
|
|
@@ -273,11 +273,11 @@ const Ve = {
|
|
|
273
273
|
row: e
|
|
274
274
|
}) => {
|
|
275
275
|
const a = r(e);
|
|
276
|
-
return
|
|
276
|
+
return s(he, {
|
|
277
277
|
label: l(a ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
278
278
|
variant: a ? "success" : "warning"
|
|
279
279
|
}, null);
|
|
280
|
-
}, m =
|
|
280
|
+
}, m = $({}), y = [{
|
|
281
281
|
accessorKey: "name",
|
|
282
282
|
header: () => l("menu.publish.table.columns.restaurant"),
|
|
283
283
|
cell: (e) => e.getValue(),
|
|
@@ -310,7 +310,7 @@ const Ve = {
|
|
|
310
310
|
header: () => l("menu.common.labels.status"),
|
|
311
311
|
enableSorting: !1,
|
|
312
312
|
size: 80,
|
|
313
|
-
cell: (e) =>
|
|
313
|
+
cell: (e) => s(i, {
|
|
314
314
|
row: e.row.original
|
|
315
315
|
}, null)
|
|
316
316
|
}, {
|
|
@@ -322,7 +322,7 @@ const Ve = {
|
|
|
322
322
|
const a = e.row.original;
|
|
323
323
|
return t.state.menu.updatedAt, a.updatedAt, T("div", {
|
|
324
324
|
class: "flex justify-end gap-8"
|
|
325
|
-
}, [
|
|
325
|
+
}, [d.value && a.revertConfig ? ke(T(J.FmButton, {
|
|
326
326
|
prependIcon: "undo",
|
|
327
327
|
variant: "secondary",
|
|
328
328
|
onClick: K(async () => {
|
|
@@ -333,17 +333,17 @@ const Ve = {
|
|
|
333
333
|
icon: "ios_share",
|
|
334
334
|
variant: "secondary",
|
|
335
335
|
onClick: K(async () => {
|
|
336
|
-
const
|
|
337
|
-
await
|
|
336
|
+
const c = A(e.row.original);
|
|
337
|
+
await P(c);
|
|
338
338
|
}, ["stop", "prevent"])
|
|
339
339
|
})]);
|
|
340
340
|
},
|
|
341
341
|
meta: {
|
|
342
342
|
width: "150px"
|
|
343
343
|
}
|
|
344
|
-
}],
|
|
344
|
+
}], f = $(""), p = $(), t = me(), R = _e(), d = V(() => t.version !== pe.F_MENU_VERSION.enum.v3);
|
|
345
345
|
async function _(e) {
|
|
346
|
-
e.revertConfig &&
|
|
346
|
+
e.revertConfig && R.open({
|
|
347
347
|
title: "Revert menu",
|
|
348
348
|
contentComponent: Ae,
|
|
349
349
|
contentComponentProps: {
|
|
@@ -358,7 +358,7 @@ const Ve = {
|
|
|
358
358
|
close: !0
|
|
359
359
|
}
|
|
360
360
|
}).onPrimary(async () => {
|
|
361
|
-
await
|
|
361
|
+
await M.minor(async () => {
|
|
362
362
|
await t.revertRestaurantMenu(e._id);
|
|
363
363
|
}, {
|
|
364
364
|
customId: e._id,
|
|
@@ -372,12 +372,12 @@ const Ve = {
|
|
|
372
372
|
function S(e) {
|
|
373
373
|
return e ? Q(e).format("DD/MM/YYYY hh:mmA") : "";
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
function
|
|
375
|
+
const z = V(() => t.state.menu.modules.catalog), g = V(() => M.queue.value.some((e) => e.id === t.state.menu._id));
|
|
376
|
+
function v(e) {
|
|
377
377
|
var a;
|
|
378
|
-
return e ? ((a =
|
|
378
|
+
return e ? ((a = z.value.find((c) => c._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function A(e) {
|
|
381
381
|
return {
|
|
382
382
|
restaurantId: e._id,
|
|
383
383
|
catalogId: e.catalogId,
|
|
@@ -387,134 +387,150 @@ const Ve = {
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
function N(e) {
|
|
390
|
-
var
|
|
391
|
-
const a =
|
|
392
|
-
(
|
|
390
|
+
var c;
|
|
391
|
+
const a = A(e);
|
|
392
|
+
(c = p.value) == null || c.show(a);
|
|
393
393
|
}
|
|
394
|
-
const
|
|
395
|
-
async function
|
|
396
|
-
var
|
|
397
|
-
const a = (
|
|
398
|
-
await
|
|
394
|
+
const M = X(Z());
|
|
395
|
+
async function P(e) {
|
|
396
|
+
var c;
|
|
397
|
+
const a = (c = I.value.find((L) => L._id === e.restaurantId)) == null ? void 0 : c.name;
|
|
398
|
+
await M.minor(async () => await t.publishMenu(e), {
|
|
399
399
|
customId: t.state.menu._id,
|
|
400
400
|
message: `Publishing menu for ${a}`,
|
|
401
401
|
successMessage: `Published to ${a}`
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
const
|
|
404
|
+
const b = $(null), I = V(() => t.state.restaurants.filter((e) => {
|
|
405
405
|
var a;
|
|
406
|
-
return !
|
|
406
|
+
return !b.value || ((a = b.value) == null ? void 0 : a.includes(e._id));
|
|
407
407
|
}).map((e) => ({
|
|
408
408
|
...e,
|
|
409
409
|
catalog: {
|
|
410
|
-
default:
|
|
411
|
-
takeaway:
|
|
412
|
-
pickup:
|
|
410
|
+
default: v(e.catalogId),
|
|
411
|
+
takeaway: v(e.takeawayCatalog),
|
|
412
|
+
pickup: v(e.pickupCatalog)
|
|
413
413
|
}
|
|
414
414
|
}))), ae = V(() => {
|
|
415
|
-
const e =
|
|
415
|
+
const e = f.value.toLowerCase();
|
|
416
416
|
return I.value.filter(({
|
|
417
417
|
name: a,
|
|
418
|
-
catalog:
|
|
419
|
-
}) => a.toLowerCase().includes(e) ||
|
|
418
|
+
catalog: c
|
|
419
|
+
}) => a.toLowerCase().includes(e) || c.default.toLowerCase().includes(e) || c.takeaway.toLowerCase().includes(e) || c.pickup.toLowerCase().includes(e));
|
|
420
420
|
});
|
|
421
421
|
async function H() {
|
|
422
|
-
if (
|
|
422
|
+
if (g.value) return;
|
|
423
423
|
const e = Object.keys(m.value).map(Number).filter((a) => m.value[a]);
|
|
424
424
|
if (e.length === 0 || e.length === I.value.length)
|
|
425
|
-
await
|
|
425
|
+
await M.minor(async () => await t.publishAllMenu(), {
|
|
426
426
|
customId: t.state.menu._id
|
|
427
427
|
});
|
|
428
|
-
else
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
await
|
|
432
|
-
|
|
428
|
+
else {
|
|
429
|
+
const a = e.map((c) => I.value[c]);
|
|
430
|
+
await M.minor(async () => {
|
|
431
|
+
await ge({
|
|
432
|
+
items: a,
|
|
433
|
+
processor: async (c) => {
|
|
434
|
+
const L = A(c);
|
|
435
|
+
return await t.publishMenu(L, !1);
|
|
436
|
+
},
|
|
437
|
+
batchSize: 5,
|
|
438
|
+
batchDelay: 50,
|
|
439
|
+
// 50ms delay to reduce server load
|
|
440
|
+
progressMessage: void 0
|
|
441
|
+
// Don't show progress message as we already have loading state
|
|
442
|
+
}), await t.readRestaurants(), await t.readMenu();
|
|
443
|
+
}, {
|
|
444
|
+
customId: t.state.menu._id,
|
|
445
|
+
message: `Publishing menu to ${a.length} restaurant${a.length > 1 ? "s" : ""}`,
|
|
446
|
+
successMessage: `Published to ${a.length} restaurant${a.length > 1 ? "s" : ""}`
|
|
447
|
+
});
|
|
448
|
+
}
|
|
433
449
|
}
|
|
434
450
|
return (e, a) => {
|
|
435
|
-
const
|
|
436
|
-
return h(), D(
|
|
451
|
+
const c = C("FmChip"), L = C("FmSpacer"), O = C("FmButton"), G = C("FmSearch"), te = C("FmTable"), le = C("FmListItem"), oe = C("FmList");
|
|
452
|
+
return h(), D(B, null, [o("div", Be, [o("div", Ee, [o("div", ze, [o("div", Ne, F(u(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
|
|
437
453
|
class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
438
|
-
}, null, -1))]),
|
|
454
|
+
}, null, -1))]), s(c, {
|
|
439
455
|
label: k.value,
|
|
440
456
|
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
441
|
-
}, null, 8, ["label"]),
|
|
442
|
-
disabled:
|
|
457
|
+
}, null, 8, ["label"]), s(L), o("div", Oe, [s(O, {
|
|
458
|
+
disabled: g.value,
|
|
443
459
|
icon: "ios_share",
|
|
444
460
|
label: u(l)("menu.publish.actions.publish_all"),
|
|
445
461
|
variant: "primary",
|
|
446
462
|
onClick: a[0] || (a[0] = () => H())
|
|
447
|
-
}, null, 8, ["disabled", "label"])])]), o("div",
|
|
463
|
+
}, null, 8, ["disabled", "label"])])]), o("div", Ke, [s(u(be), {
|
|
448
464
|
multiple: "",
|
|
449
|
-
modelValue:
|
|
450
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
465
|
+
modelValue: b.value,
|
|
466
|
+
"onUpdate:modelValue": a[2] || (a[2] = (n) => b.value = n)
|
|
451
467
|
}, {
|
|
452
|
-
"append-right": U(() => [
|
|
468
|
+
"append-right": U(() => [s(L, {
|
|
453
469
|
class: "xs:hidden"
|
|
454
|
-
}),
|
|
455
|
-
modelValue:
|
|
456
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
470
|
+
}), s(G, {
|
|
471
|
+
modelValue: f.value,
|
|
472
|
+
"onUpdate:modelValue": a[1] || (a[1] = (n) => f.value = n),
|
|
457
473
|
autofocus: "",
|
|
458
474
|
class: "w-[320px] xs:hidden",
|
|
459
475
|
placeholder: u(l)("menu.publish.table.search.placeholder")
|
|
460
476
|
}, null, 8, ["modelValue", "placeholder"])]),
|
|
461
477
|
_: 1
|
|
462
|
-
}, 8, ["modelValue"]),
|
|
463
|
-
modelValue:
|
|
464
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
478
|
+
}, 8, ["modelValue"]), s(G, {
|
|
479
|
+
modelValue: f.value,
|
|
480
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => f.value = n),
|
|
465
481
|
autofocus: "",
|
|
466
482
|
class: "w-full xs:block hidden",
|
|
467
483
|
placeholder: u(l)("menu.publish.table.search.placeholder")
|
|
468
|
-
}, null, 8, ["modelValue", "placeholder"])]), I.value.length > 0 ? (h(), D(
|
|
484
|
+
}, null, 8, ["modelValue", "placeholder"])]), I.value.length > 0 ? (h(), D(B, {
|
|
469
485
|
key: 0
|
|
470
|
-
}, [
|
|
486
|
+
}, [s(ye, {
|
|
471
487
|
class: "xs:hidden block"
|
|
472
488
|
}, {
|
|
473
|
-
default: U(() => [
|
|
489
|
+
default: U(() => [s(te, {
|
|
474
490
|
modelValue: m.value,
|
|
475
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
491
|
+
"onUpdate:modelValue": a[4] || (a[4] = (n) => m.value = n),
|
|
476
492
|
"column-defs": y,
|
|
477
|
-
loading:
|
|
493
|
+
loading: g.value,
|
|
478
494
|
"page-size": I.value.length,
|
|
479
495
|
"row-data": I.value,
|
|
480
|
-
"search-value":
|
|
496
|
+
"search-value": f.value,
|
|
481
497
|
shrinkAt: !1,
|
|
482
498
|
selection: "multiple",
|
|
483
499
|
"hide-footer": "",
|
|
484
500
|
"pin-header-row": "",
|
|
485
|
-
onRowClick: a[5] || (a[5] = (
|
|
501
|
+
onRowClick: a[5] || (a[5] = (n) => N(n.original))
|
|
486
502
|
}, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
|
|
487
503
|
_: 1
|
|
488
|
-
}),
|
|
504
|
+
}), s(oe, {
|
|
489
505
|
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
490
506
|
separator: ""
|
|
491
507
|
}, {
|
|
492
|
-
default: U(() => [(h(!0), D(
|
|
493
|
-
key:
|
|
494
|
-
label:
|
|
508
|
+
default: U(() => [(h(!0), D(B, null, Y(ae.value, (n) => (h(), E(le, {
|
|
509
|
+
key: n._id,
|
|
510
|
+
label: n.name,
|
|
495
511
|
style: {
|
|
496
512
|
padding: "12px 0 !important"
|
|
497
513
|
},
|
|
498
|
-
onClick: () => N(
|
|
514
|
+
onClick: () => N(n)
|
|
499
515
|
}, {
|
|
500
|
-
default: U(() => [o("div",
|
|
501
|
-
row:
|
|
502
|
-
}, null, 8, ["row"])]), o("div",
|
|
516
|
+
default: U(() => [o("div", Te, [o("div", je, [o("div", Ye, F(S(n.updatedAt)), 1), s(i, {
|
|
517
|
+
row: n
|
|
518
|
+
}, null, 8, ["row"])]), o("div", qe, [o("div", He, F(n.name), 1), o("div", Ge, [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", We, [d.value && n.revertConfig ? (h(), E(O, {
|
|
503
519
|
key: 0,
|
|
504
|
-
disabled:
|
|
520
|
+
disabled: g.value,
|
|
505
521
|
icon: "undo",
|
|
506
522
|
variant: "tertiary",
|
|
507
|
-
onClick: K(() => _(
|
|
508
|
-
}, null, 8, ["disabled", "onClick"])) :
|
|
509
|
-
disabled:
|
|
523
|
+
onClick: K(() => _(n), ["stop"])
|
|
524
|
+
}, null, 8, ["disabled", "onClick"])) : ne("", !0), s(O, {
|
|
525
|
+
disabled: g.value,
|
|
510
526
|
icon: "ios_share",
|
|
511
527
|
variant: "tertiary",
|
|
512
|
-
onClick: K(() =>
|
|
528
|
+
onClick: K(() => P(A(n)), ["stop"])
|
|
513
529
|
}, null, 8, ["disabled", "onClick"])])]),
|
|
514
530
|
_: 2
|
|
515
531
|
}, 1032, ["label", "onClick"]))), 128))]),
|
|
516
532
|
_: 1
|
|
517
|
-
})], 64)) : (h(), E(u(
|
|
533
|
+
})], 64)) : (h(), E(u(xe), {
|
|
518
534
|
key: 1,
|
|
519
535
|
title: u(l)("menu.publish.empty.title"),
|
|
520
536
|
subtitle: u(l)("menu.publish.empty.subtitle"),
|
|
@@ -527,21 +543,21 @@ const Ve = {
|
|
|
527
543
|
});
|
|
528
544
|
}
|
|
529
545
|
}
|
|
530
|
-
}, null, 8, ["title", "subtitle", "action"]))]), o("div",
|
|
531
|
-
disabled:
|
|
546
|
+
}, null, 8, ["title", "subtitle", "action"]))]), o("div", Je, [s(O, {
|
|
547
|
+
disabled: g.value,
|
|
532
548
|
icon: "ios_share",
|
|
533
549
|
label: u(l)("menu.publish.actions.publish_all"),
|
|
534
550
|
variant: "fab",
|
|
535
551
|
onClick: a[6] || (a[6] = () => H())
|
|
536
|
-
}, null, 8, ["disabled", "label"])]),
|
|
552
|
+
}, null, 8, ["disabled", "label"])]), s(Pe, {
|
|
537
553
|
ref_key: "updateCatalogDialogRef",
|
|
538
554
|
ref: p,
|
|
539
|
-
catalogs:
|
|
540
|
-
onOnComplete:
|
|
555
|
+
catalogs: z.value,
|
|
556
|
+
onOnComplete: P
|
|
541
557
|
}, null, 8, ["catalogs"])], 64);
|
|
542
558
|
};
|
|
543
559
|
}
|
|
544
560
|
});
|
|
545
561
|
export {
|
|
546
|
-
|
|
562
|
+
ia as default
|
|
547
563
|
};
|