@feedmepos/mf-menu 0.31.28-beta.1 → 0.31.28-beta.3
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-Ca6EfbM0.js → App-JT3apZxV.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-TjghlPjP.js → ApplyProduct.vue_vue_type_script_setup_true_lang-3GZupnr5.js} +2 -2
- package/dist/{Catalog-DcqEymK_.js → Catalog-kAI60cdJ.js} +5 -5
- package/dist/{Category-DqhkqPn5.js → Category-CkAn_OV_.js} +5 -5
- package/dist/{Category-DrV8RFw0.js → Category-DQjWYgVj.js} +4 -4
- package/dist/{CookingGuide-D5324ACr.js → CookingGuide-Bthk1y77.js} +3 -3
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-C1eTlRgY.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-NpRnwCY7.js} +1 -1
- package/dist/{Group-DPr6FkUR.js → Group-BGGn1Cm2.js} +3 -3
- package/dist/{Group-DdKAKDX5.js → Group-BkosIIKm.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DHUn8wtV.js → Group.vue_vue_type_script_setup_true_lang-wJdVCYYu.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CcL8xIIp.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DnS02X6c.js} +3 -3
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CxG33Zfx.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-B_82rlxL.js} +317 -317
- package/dist/{Ingredient-CPMYSTHx.js → Ingredient-CFTQ0Bfc.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-B8edmN9o.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Ibea3-vX.js} +2 -2
- package/dist/{LinkProductSideSheet-CMv-Cl8o.js → LinkProductSideSheet-BecKfPsC.js} +1 -1
- package/dist/{MenuSetting-DTlVQhH-.js → MenuSetting-DuIDUokD.js} +4 -4
- package/dist/{PrintRoute-DZ_go_P2.js → PrintRoute-BcnNriE8.js} +3 -3
- package/dist/{Product-C_fICCS0.js → Product-BOOAm4a0.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-B5_7D3Uf.js → Product.vue_vue_type_script_setup_true_lang-CTIrwGpO.js} +11 -11
- package/dist/{ProductInternalTools-BB1Fx1SL.js → ProductInternalTools-CLAl51zu.js} +5 -5
- package/dist/{Products-BSP9BtpB.js → Products-DVKuBS8J.js} +10 -10
- package/dist/{Publish-DfLwMpi0.js → Publish-CNg_VIIx.js} +215 -211
- package/dist/{Recipe-ckiwtBvy.js → Recipe-BcrMcQeV.js} +4 -4
- package/dist/{Scheduler-GoFfvH3g.js → Scheduler-NByYPuMo.js} +3 -3
- package/dist/{ServingSequence-DJRYP2Wa.js → ServingSequence-BoyIqIYh.js} +3 -3
- package/dist/{Setting-BaVXtHHw.js → Setting-WbjnZJVn.js} +4 -4
- package/dist/{Subcategory-D1ellIJv.js → Subcategory-CEv5BrCf.js} +4 -4
- package/dist/{Takeaway-4mhVvPZX.js → Takeaway-Cc1bVUje.js} +1 -1
- package/dist/{Takeaway-D4kbxdXq.js → Takeaway-CfPmTA0E.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DmyujVsL.js → Takeaway.vue_vue_type_script_setup_true_lang-Bs50mb8k.js} +5 -5
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DlXbq9hl.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CClYMK28.js} +12 -12
- package/dist/{Unit-PRuwV5nD.js → Unit-DQsNQ73i.js} +2 -2
- package/dist/{Variant-DiA_U-c8.js → Variant-BbotXK2d.js} +3 -3
- package/dist/{_id_-CX0cWun0.js → _id_-2-upiNil.js} +9 -9
- package/dist/{app-BbWAbjQS.js → app-CbNCInHo.js} +24 -24
- package/dist/{app-DhM14nc-.js → app-CbnHCo8C.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/composable/useRestaurantsBatch.d.ts +5 -4
- package/dist/apps/mf-menu/src/utils/batchProcessor.d.ts +7 -0
- package/dist/apps/mf-menu/src/utils/images.d.ts +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-D9s16EpF.js → linked-status-DQrcb0dN.js} +2 -2
- package/dist/assets/{override-menu-DJ-HMb-L.js → override-menu-ABYeceI6.js} +2 -2
- package/dist/assets/{validate-menu-B4g9NVpd.js → validate-menu-BUUUwe6X.js} +2 -2
- package/dist/{catalog-DICGX26b.js → catalog-n3cxFx7B.js} +1 -1
- package/dist/{catalogSetting-DNi3sae4.js → catalogSetting-Coex2wx4.js} +1 -1
- package/dist/{category-BVdpkvEY.js → category-DDDCcevC.js} +1 -1
- package/dist/{currency-D6GTzLnp.js → currency-YRHxgBh7.js} +1 -1
- package/dist/{dayjs.min-D1QpwzEr.js → dayjs.min-Bwk93uaZ.js} +1 -1
- package/dist/{index-7J2wjscT.js → index-BPAfFydt.js} +1 -1
- package/dist/{index-DnV90eV6.js → index-CbWCuRqD.js} +2 -2
- package/dist/{index-CiHIyK0U.js → index-CcHAK_Wv.js} +3 -3
- package/dist/{item-D-55zj01.js → item-BIRYK1Ue.js} +3950 -3949
- package/dist/{jszip.min-Dc1Q_2By.js → jszip.min-CRbsELup.js} +2 -2
- package/dist/{menu-DCNRkoVE.js → menu-DFzGLWUA.js} +1 -1
- package/dist/{menu-qiZp8pU6.js → menu-ipD3lXXk.js} +1147 -1129
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-DH9-fsOO.js → priceTier-DB6-pxHE.js} +1 -1
- package/dist/{scheduler-v8esE-NR.js → scheduler-vy0G0HXI.js} +3 -3
- package/dist/{subcategory-vXszdIfw.js → subcategory-YqL6bVw8.js} +19 -15
- package/dist/{toExcel-CXJmxvpO.js → toExcel-CsQHeX96.js} +2 -2
- package/dist/{unit-Fgtp7mfX.js → unit-CuKfQHtl.js} +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { D as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { A as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { useSnackbar as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { u as
|
|
11
|
-
import { _ as
|
|
12
|
-
function
|
|
13
|
-
return
|
|
1
|
+
import { defineComponent as K, ref as I, computed as S, onMounted as ne, resolveComponent as C, createElementBlock as R, openBlock as h, createVNode as n, createElementVNode as o, toDisplayString as F, unref as i, Fragment as E, renderList as j, createBlock as O, withCtx as L, createCommentVNode as ue, withModifiers as N, h as H } from "vue";
|
|
2
|
+
import { D as X } from "./dayjs.min-Bwk93uaZ.js";
|
|
3
|
+
import { useRouter as ie } from "vue-router";
|
|
4
|
+
import { A as re, e as ce, D as Z, a9 as de, H as J, I as me, u as pe, G as ge, a1 as ve } from "./menu-ipD3lXXk.js";
|
|
5
|
+
import { useI18n as Y, useCoreStore as be, RestaurantSelector as fe } from "@feedmepos/mf-common";
|
|
6
|
+
import { useSnackbar as ee, useDialogChild as _e, useDialog as he, components as Q } 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-CbNCInHo.js";
|
|
9
|
+
import { a as ke, w as we } from "./tooltip-B5BiPMx9.js";
|
|
10
|
+
import { u as xe } from "./discardConfirm-BHni0LNu.js";
|
|
11
|
+
import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
12
|
+
function ae(x) {
|
|
13
|
+
return x ? X(x).format("DD/MM/YY HH:mm") : "-";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
15
|
+
function Se(x, V, l) {
|
|
16
|
+
const c = (r, m = !1) => {
|
|
17
17
|
var y;
|
|
18
|
-
return
|
|
18
|
+
return r === void 0 && !m ? "-" : ((y = l.find((f) => f.value === (r || null))) == null ? void 0 : y.label) || "-";
|
|
19
19
|
};
|
|
20
|
-
return
|
|
20
|
+
return x.map((r) => {
|
|
21
21
|
var p;
|
|
22
|
-
const m = (p =
|
|
22
|
+
const m = (p = V.find(({ _id: t }) => t === r._id)) == null ? void 0 : p.posVersion, y = !!m && !!re.Pos.canUse({ feature: ce.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: m }), f = c(r.catalogId);
|
|
23
23
|
return {
|
|
24
|
-
...
|
|
24
|
+
...r,
|
|
25
25
|
_default: f,
|
|
26
|
-
_posTakeaway:
|
|
27
|
-
_additionalCatalogs: (
|
|
28
|
-
_lastUpdate:
|
|
29
|
-
_pickup: y ? r
|
|
26
|
+
_posTakeaway: r.takeawayCatalog ? c(r.takeawayCatalog) : f,
|
|
27
|
+
_additionalCatalogs: (r.additionalCatalogs || []).map((t) => c(t)),
|
|
28
|
+
_lastUpdate: ae(r.updatedAt),
|
|
29
|
+
_pickup: y ? c(r.pickupCatalog, !0) : "-",
|
|
30
30
|
_canUsePickup: y,
|
|
31
31
|
_posVersion: m || "-"
|
|
32
32
|
};
|
|
@@ -35,26 +35,26 @@ function Ve(w, x, l) {
|
|
|
35
35
|
const Fe = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "flex items-center justify-center"
|
|
38
|
-
},
|
|
38
|
+
}, Ie = {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "space-y-16"
|
|
41
|
-
},
|
|
41
|
+
}, $e = { class: "text-fm-color-typo-secondary" }, Ae = { class: "space-y-4" }, Me = /* @__PURE__ */ K({
|
|
42
42
|
__name: "RevertDialog",
|
|
43
43
|
props: {
|
|
44
44
|
restaurant: {}
|
|
45
45
|
},
|
|
46
|
-
setup(
|
|
47
|
-
const
|
|
46
|
+
setup(x) {
|
|
47
|
+
const V = x, l = ee(), { custom: c } = Z(l), r = I(!1), m = I(null);
|
|
48
48
|
async function y() {
|
|
49
|
-
await
|
|
49
|
+
await c(
|
|
50
50
|
async () => {
|
|
51
51
|
var d;
|
|
52
|
-
m.value = await
|
|
52
|
+
m.value = await de.readMenuById(((d = V.restaurant.revertConfig) == null ? void 0 : d._id) || "");
|
|
53
53
|
},
|
|
54
|
-
{ isLoading:
|
|
54
|
+
{ isLoading: r }
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
const f =
|
|
57
|
+
const f = S(() => {
|
|
58
58
|
var d;
|
|
59
59
|
return [
|
|
60
60
|
{ label: "Main", value: null },
|
|
@@ -63,25 +63,25 @@ const Fe = {
|
|
|
63
63
|
value: _._id
|
|
64
64
|
}))
|
|
65
65
|
];
|
|
66
|
-
}), { t: p } =
|
|
66
|
+
}), { t: p } = Y(), t = S(() => {
|
|
67
67
|
var k;
|
|
68
|
-
const d =
|
|
68
|
+
const d = V.restaurant.revertConfig;
|
|
69
69
|
if (!d) return [];
|
|
70
|
-
const _ =
|
|
70
|
+
const _ = Se(
|
|
71
71
|
[
|
|
72
72
|
{
|
|
73
73
|
...d,
|
|
74
74
|
catalogId: d.catalogId || null
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
|
-
|
|
77
|
+
be().restaurants.value,
|
|
78
78
|
f.value
|
|
79
79
|
)[0];
|
|
80
80
|
return [
|
|
81
|
-
{ label: p("menu.revert.labels.restaurant"), value:
|
|
81
|
+
{ label: p("menu.revert.labels.restaurant"), value: V.restaurant.name },
|
|
82
82
|
{
|
|
83
83
|
label: p("menu.revert.labels.revert_to"),
|
|
84
|
-
value:
|
|
84
|
+
value: ae((k = m.value) == null ? void 0 : k.updatedAt)
|
|
85
85
|
},
|
|
86
86
|
{ label: p("menu.revert.labels.default"), value: _._default },
|
|
87
87
|
{ label: p("menu.revert.labels.pos_takeaway"), value: _._posTakeaway },
|
|
@@ -92,25 +92,25 @@ const Fe = {
|
|
|
92
92
|
}
|
|
93
93
|
];
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
const { emitData:
|
|
95
|
+
ne(async () => y());
|
|
96
|
+
const { emitData: U } = _e();
|
|
97
97
|
return (d, _) => {
|
|
98
98
|
const k = C("FmCircularProgress");
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
])) : (h(),
|
|
102
|
-
o("div",
|
|
103
|
-
o("div",
|
|
104
|
-
(h(!0),
|
|
105
|
-
key:
|
|
106
|
-
name:
|
|
107
|
-
value:
|
|
99
|
+
return r.value ? (h(), R("div", Fe, [
|
|
100
|
+
n(k, { size: "lg" })
|
|
101
|
+
])) : (h(), R("div", Ie, [
|
|
102
|
+
o("div", $e, F(i(p)("menu.revert.description", { name: V.restaurant.name })), 1),
|
|
103
|
+
o("div", Ae, [
|
|
104
|
+
(h(!0), R(E, null, j(t.value, ($) => (h(), O(ke, {
|
|
105
|
+
key: $.label,
|
|
106
|
+
name: $.label,
|
|
107
|
+
value: $.value || "--"
|
|
108
108
|
}, null, 8, ["name", "value"]))), 128))
|
|
109
109
|
])
|
|
110
110
|
]));
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
}),
|
|
113
|
+
}), De = { class: "fm-typo-en-title-md-600" }, Re = { class: "mt-40" }, Ue = { class: "fm-typo-en-title-sm-600" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Pe = { class: "flex gap-8 items-center justify-start" }, Be = /* @__PURE__ */ K({
|
|
114
114
|
__name: "UpdateCatalogDialog",
|
|
115
115
|
props: {
|
|
116
116
|
catalogs: {
|
|
@@ -119,9 +119,9 @@ const Fe = {
|
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
emits: ["onComplete"],
|
|
122
|
-
setup(
|
|
123
|
-
const { t:
|
|
124
|
-
|
|
122
|
+
setup(x, { expose: V, emit: l }) {
|
|
123
|
+
const { t: c } = Y(), r = x;
|
|
124
|
+
V({
|
|
125
125
|
show: _,
|
|
126
126
|
hide: k
|
|
127
127
|
});
|
|
@@ -135,97 +135,97 @@ const Fe = {
|
|
|
135
135
|
additionalCatalogs: []
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
const f =
|
|
138
|
+
const f = S(() => [
|
|
139
139
|
{
|
|
140
|
-
label:
|
|
140
|
+
label: c("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
141
141
|
value: null
|
|
142
142
|
},
|
|
143
|
-
...
|
|
143
|
+
...r.catalogs.map((g) => ({
|
|
144
144
|
label: g.name,
|
|
145
145
|
value: g._id
|
|
146
146
|
}))
|
|
147
|
-
]), p =
|
|
147
|
+
]), p = S(() => [
|
|
148
148
|
{
|
|
149
|
-
label:
|
|
149
|
+
label: c("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
150
150
|
value: null
|
|
151
151
|
},
|
|
152
|
-
...
|
|
152
|
+
...r.catalogs.map((g) => ({
|
|
153
153
|
label: g.name,
|
|
154
154
|
value: g._id
|
|
155
155
|
}))
|
|
156
|
-
]), t =
|
|
156
|
+
]), t = I(y()), U = I(!1), d = I(void 0);
|
|
157
157
|
function _(g) {
|
|
158
|
-
d.value = g ?
|
|
158
|
+
d.value = g ? J(g) : y(), t.value = J(d.value), U.value = !0;
|
|
159
159
|
}
|
|
160
160
|
function k() {
|
|
161
|
-
|
|
161
|
+
U.value = !1;
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
() => !
|
|
163
|
+
const $ = xe(
|
|
164
|
+
() => !me.isEqual(d.value, t.value),
|
|
165
165
|
() => {
|
|
166
166
|
k();
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
|
-
function
|
|
169
|
+
function T() {
|
|
170
170
|
k(), m("onComplete", t.value);
|
|
171
171
|
}
|
|
172
172
|
return (g, v) => {
|
|
173
|
-
const A = C("FmSelect"),
|
|
174
|
-
return h(),
|
|
175
|
-
modelValue:
|
|
176
|
-
"onUpdate:modelValue": v[5] || (v[5] = (b) =>
|
|
173
|
+
const A = C("FmSelect"), z = C("FmCheckbox"), M = C("FmButton"), B = C("FmSideSheet");
|
|
174
|
+
return h(), O(B, {
|
|
175
|
+
modelValue: U.value,
|
|
176
|
+
"onUpdate:modelValue": v[5] || (v[5] = (b) => U.value = b),
|
|
177
177
|
"max-width": 560,
|
|
178
|
-
"onOn:clickedAway":
|
|
178
|
+
"onOn:clickedAway": i($)
|
|
179
179
|
}, {
|
|
180
|
-
"side-sheet-header":
|
|
181
|
-
o("span",
|
|
180
|
+
"side-sheet-header": L(() => [
|
|
181
|
+
o("span", De, F(i(c)("menu.publish.update_catalog_dialog.title")), 1)
|
|
182
182
|
]),
|
|
183
|
-
"side-sheet-footer":
|
|
184
|
-
o("div",
|
|
185
|
-
|
|
186
|
-
label:
|
|
183
|
+
"side-sheet-footer": L(() => [
|
|
184
|
+
o("div", Pe, [
|
|
185
|
+
n(M, {
|
|
186
|
+
label: i(c)("menu.publish.update_catalog_dialog.actions.update"),
|
|
187
187
|
size: "lg",
|
|
188
188
|
variant: "primary",
|
|
189
|
-
onClick: v[4] || (v[4] = () =>
|
|
189
|
+
onClick: v[4] || (v[4] = () => T())
|
|
190
190
|
}, null, 8, ["label"]),
|
|
191
|
-
|
|
192
|
-
label:
|
|
191
|
+
n(M, {
|
|
192
|
+
label: i(c)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
193
193
|
size: "lg",
|
|
194
194
|
variant: "tertiary",
|
|
195
195
|
onClick: k
|
|
196
196
|
}, null, 8, ["label"])
|
|
197
197
|
])
|
|
198
198
|
]),
|
|
199
|
-
default:
|
|
200
|
-
|
|
199
|
+
default: L(() => [
|
|
200
|
+
n(A, {
|
|
201
201
|
modelValue: t.value.catalogId,
|
|
202
202
|
"onUpdate:modelValue": v[0] || (v[0] = (b) => t.value.catalogId = b),
|
|
203
203
|
items: f.value,
|
|
204
204
|
class: "mb-24",
|
|
205
|
-
label:
|
|
205
|
+
label: i(c)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
206
206
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
207
|
-
|
|
207
|
+
n(A, {
|
|
208
208
|
modelValue: t.value.takeawayCatalog,
|
|
209
209
|
"onUpdate:modelValue": v[1] || (v[1] = (b) => t.value.takeawayCatalog = b),
|
|
210
210
|
items: p.value,
|
|
211
211
|
class: "mb-24",
|
|
212
|
-
label:
|
|
212
|
+
label: i(c)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
213
213
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
214
|
-
|
|
214
|
+
n(A, {
|
|
215
215
|
modelValue: t.value.pickupCatalog,
|
|
216
216
|
"onUpdate:modelValue": v[2] || (v[2] = (b) => t.value.pickupCatalog = b),
|
|
217
217
|
items: p.value,
|
|
218
|
-
label:
|
|
218
|
+
label: i(c)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
219
219
|
}, null, 8, ["modelValue", "items", "label"]),
|
|
220
|
-
o("div",
|
|
221
|
-
o("div",
|
|
222
|
-
o("div",
|
|
223
|
-
(h(!0),
|
|
220
|
+
o("div", Re, [
|
|
221
|
+
o("div", Ue, F(i(c)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
222
|
+
o("div", Le, F(i(c)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
223
|
+
(h(!0), R(E, null, j(x.catalogs, (b) => (h(), R("div", {
|
|
224
224
|
key: b._id
|
|
225
225
|
}, [
|
|
226
|
-
|
|
226
|
+
n(z, {
|
|
227
227
|
modelValue: t.value.additionalCatalogs,
|
|
228
|
-
"onUpdate:modelValue": v[3] || (v[3] = (
|
|
228
|
+
"onUpdate:modelValue": v[3] || (v[3] = (w) => t.value.additionalCatalogs = w),
|
|
229
229
|
label: b.name,
|
|
230
230
|
value: b._id
|
|
231
231
|
}, null, 8, ["modelValue", "label", "value"])
|
|
@@ -236,19 +236,19 @@ const Fe = {
|
|
|
236
236
|
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
}),
|
|
239
|
+
}), Ee = {
|
|
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
|
+
}, Oe = {
|
|
242
242
|
class: "flex items-center xs:mb-8 mb-24"
|
|
243
|
-
},
|
|
243
|
+
}, Te = {
|
|
244
244
|
class: "mr-8"
|
|
245
|
-
},
|
|
245
|
+
}, ze = {
|
|
246
246
|
class: "fm-typo-en-title-md-600"
|
|
247
|
-
},
|
|
247
|
+
}, Ne = {
|
|
248
248
|
class: "xs:hidden"
|
|
249
|
-
},
|
|
249
|
+
}, He = {
|
|
250
250
|
class: "pb-8 flex justify-between xs:flex-col gap-8"
|
|
251
|
-
},
|
|
251
|
+
}, Ke = {
|
|
252
252
|
class: "grow flex flex-col gap-4"
|
|
253
253
|
}, je = {
|
|
254
254
|
class: "flex gap-8 items-center"
|
|
@@ -256,28 +256,28 @@ const Fe = {
|
|
|
256
256
|
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
257
257
|
}, qe = {
|
|
258
258
|
class: "space-y-4"
|
|
259
|
-
}, He = {
|
|
260
|
-
class: "fm-typo-en-body-lg-600"
|
|
261
259
|
}, Ge = {
|
|
262
|
-
class: "fm-typo-en-body-
|
|
260
|
+
class: "fm-typo-en-body-lg-600"
|
|
263
261
|
}, We = {
|
|
264
|
-
class: "
|
|
262
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
265
263
|
}, Je = {
|
|
264
|
+
class: "flex gap-8"
|
|
265
|
+
}, Qe = {
|
|
266
266
|
class: "xs:block hidden fixed bottom-72 right-16"
|
|
267
|
-
},
|
|
267
|
+
}, Xe = 40, ca = /* @__PURE__ */ K({
|
|
268
268
|
__name: "Publish",
|
|
269
|
-
setup(
|
|
270
|
-
const
|
|
269
|
+
setup(x) {
|
|
270
|
+
const V = ie(), {
|
|
271
271
|
t: l
|
|
272
|
-
} =
|
|
272
|
+
} = Y(), c = (e) => t.state.menu.updatedAt === e.updatedAt, r = ({
|
|
273
273
|
row: e
|
|
274
274
|
}) => {
|
|
275
|
-
const a =
|
|
276
|
-
return
|
|
275
|
+
const a = c(e);
|
|
276
|
+
return n(ye, {
|
|
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 = I({}), y = [{
|
|
281
281
|
accessorKey: "name",
|
|
282
282
|
header: () => l("menu.publish.table.columns.restaurant"),
|
|
283
283
|
cell: (e) => e.getValue(),
|
|
@@ -303,14 +303,14 @@ const Fe = {
|
|
|
303
303
|
enableSorting: !1,
|
|
304
304
|
cell: (e) => {
|
|
305
305
|
const a = e.getValue();
|
|
306
|
-
return
|
|
306
|
+
return $(a);
|
|
307
307
|
}
|
|
308
308
|
}, {
|
|
309
309
|
accessorKey: "status",
|
|
310
310
|
header: () => l("menu.common.labels.status"),
|
|
311
311
|
enableSorting: !1,
|
|
312
312
|
size: 80,
|
|
313
|
-
cell: (e) =>
|
|
313
|
+
cell: (e) => n(r, {
|
|
314
314
|
row: e.row.original
|
|
315
315
|
}, null)
|
|
316
316
|
}, {
|
|
@@ -320,32 +320,32 @@ const Fe = {
|
|
|
320
320
|
enableSorting: !1,
|
|
321
321
|
cell: (e) => {
|
|
322
322
|
const a = e.row.original;
|
|
323
|
-
return t.state.menu.updatedAt, a.updatedAt,
|
|
323
|
+
return t.state.menu.updatedAt, a.updatedAt, H("div", {
|
|
324
324
|
class: "flex justify-end gap-8"
|
|
325
|
-
}, [d.value && a.revertConfig ?
|
|
325
|
+
}, [d.value && a.revertConfig ? we(H(Q.FmButton, {
|
|
326
326
|
prependIcon: "undo",
|
|
327
327
|
variant: "secondary",
|
|
328
|
-
onClick:
|
|
328
|
+
onClick: N(async () => {
|
|
329
329
|
await _(e.row.original);
|
|
330
330
|
}, ["stop", "prevent"])
|
|
331
|
-
}), l("menu.publish.actions.revert")) : null,
|
|
331
|
+
}), l("menu.publish.actions.revert")) : null, H(Q.FmButton, {
|
|
332
332
|
label: l("menu.publish.actions.publish"),
|
|
333
333
|
icon: "ios_share",
|
|
334
334
|
variant: "secondary",
|
|
335
|
-
onClick:
|
|
336
|
-
const
|
|
337
|
-
await
|
|
335
|
+
onClick: N(async () => {
|
|
336
|
+
const s = A(e.row.original);
|
|
337
|
+
await B(s);
|
|
338
338
|
}, ["stop", "prevent"])
|
|
339
339
|
})]);
|
|
340
340
|
},
|
|
341
341
|
meta: {
|
|
342
342
|
width: "150px"
|
|
343
343
|
}
|
|
344
|
-
}], f =
|
|
344
|
+
}], f = I(""), p = I(), t = pe(), U = he(), d = S(() => t.version !== ge.F_MENU_VERSION.enum.v3);
|
|
345
345
|
async function _(e) {
|
|
346
|
-
e.revertConfig &&
|
|
346
|
+
e.revertConfig && U.open({
|
|
347
347
|
title: "Revert menu",
|
|
348
|
-
contentComponent:
|
|
348
|
+
contentComponent: Me,
|
|
349
349
|
contentComponentProps: {
|
|
350
350
|
restaurant: e
|
|
351
351
|
},
|
|
@@ -366,16 +366,16 @@ const Fe = {
|
|
|
366
366
|
});
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
const k =
|
|
370
|
-
version:
|
|
369
|
+
const k = S(() => l("menu.publish.labels.main_version", {
|
|
370
|
+
version: $(t.state.menu.updatedAt)
|
|
371
371
|
}));
|
|
372
|
-
function
|
|
373
|
-
return e ?
|
|
372
|
+
function $(e) {
|
|
373
|
+
return e ? X(e).format("DD/MM/YYYY hh:mmA") : "";
|
|
374
374
|
}
|
|
375
|
-
const
|
|
375
|
+
const T = S(() => t.state.menu.modules.catalog), g = S(() => M.queue.value.some((e) => e.id === t.state.menu._id));
|
|
376
376
|
function v(e) {
|
|
377
377
|
var a;
|
|
378
|
-
return e ? ((a =
|
|
378
|
+
return e ? ((a = T.value.find((s) => s._id === e)) == null ? void 0 : a.name) ?? l("menu.publish.labels.catalog.invalid") : l("menu.publish.labels.catalog.main");
|
|
379
379
|
}
|
|
380
380
|
function A(e) {
|
|
381
381
|
return {
|
|
@@ -386,22 +386,22 @@ const Fe = {
|
|
|
386
386
|
additionalCatalogs: e.additionalCatalogs
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
var
|
|
389
|
+
function z(e) {
|
|
390
|
+
var s;
|
|
391
391
|
const a = A(e);
|
|
392
|
-
(
|
|
392
|
+
(s = p.value) == null || s.show(a);
|
|
393
393
|
}
|
|
394
|
-
const M =
|
|
395
|
-
async function
|
|
396
|
-
var
|
|
397
|
-
const a = (
|
|
394
|
+
const M = Z(ee());
|
|
395
|
+
async function B(e) {
|
|
396
|
+
var s;
|
|
397
|
+
const a = (s = w.value.find((D) => D._id === e.restaurantId)) == null ? void 0 : s.name;
|
|
398
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 b =
|
|
404
|
+
const b = I(null), w = S(() => t.state.restaurants.filter((e) => {
|
|
405
405
|
var a;
|
|
406
406
|
return !b.value || ((a = b.value) == null ? void 0 : a.includes(e._id));
|
|
407
407
|
}).map((e) => ({
|
|
@@ -411,153 +411,157 @@ const Fe = {
|
|
|
411
411
|
takeaway: v(e.takeawayCatalog),
|
|
412
412
|
pickup: v(e.pickupCatalog)
|
|
413
413
|
}
|
|
414
|
-
}))),
|
|
414
|
+
}))), te = S(() => {
|
|
415
415
|
const e = f.value.toLowerCase();
|
|
416
|
-
return
|
|
416
|
+
return w.value.filter(({
|
|
417
417
|
name: a,
|
|
418
|
-
catalog:
|
|
419
|
-
}) => a.toLowerCase().includes(e) ||
|
|
418
|
+
catalog: s
|
|
419
|
+
}) => a.toLowerCase().includes(e) || s.default.toLowerCase().includes(e) || s.takeaway.toLowerCase().includes(e) || s.pickup.toLowerCase().includes(e));
|
|
420
420
|
});
|
|
421
|
-
async function
|
|
421
|
+
async function q(e) {
|
|
422
|
+
const a = I("");
|
|
423
|
+
await M.minor(async () => {
|
|
424
|
+
await ve({
|
|
425
|
+
items: e,
|
|
426
|
+
processor: async (s) => {
|
|
427
|
+
const D = A(s);
|
|
428
|
+
return await t.publishMenu(D, !1);
|
|
429
|
+
},
|
|
430
|
+
batchSize: 5,
|
|
431
|
+
batchDelay: 50,
|
|
432
|
+
// 50ms delay to reduce server load
|
|
433
|
+
onProgress({
|
|
434
|
+
total: s,
|
|
435
|
+
batchStart: D,
|
|
436
|
+
batchEnd: P
|
|
437
|
+
}) {
|
|
438
|
+
a.value = `Publishing menu to restaurants ${D}-${P} of ${s}...`;
|
|
439
|
+
}
|
|
440
|
+
}), await t.readRestaurants(), await t.readMenu();
|
|
441
|
+
}, {
|
|
442
|
+
customId: t.state.menu._id,
|
|
443
|
+
message: a,
|
|
444
|
+
successMessage: `Published to ${e.length} restaurant${e.length > 1 ? "s" : ""}`
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
async function G() {
|
|
422
448
|
if (g.value) return;
|
|
423
|
-
const e = Object.keys(m.value).map(Number).filter((
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
});
|
|
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
|
-
}
|
|
449
|
+
const e = Object.keys(m.value).map(Number).filter((s) => m.value[s]), a = e.length === 0 || e.length === w.value.length ? w.value : e.map((s) => w.value[s]);
|
|
450
|
+
a.length > Xe ? await q(a) : e.length === 0 || e.length === w.value.length ? await M.minor(async () => await t.publishAllMenu(), {
|
|
451
|
+
customId: t.state.menu._id
|
|
452
|
+
}) : await q(a);
|
|
449
453
|
}
|
|
450
454
|
return (e, a) => {
|
|
451
|
-
const
|
|
452
|
-
return h(),
|
|
455
|
+
const s = C("FmChip"), D = C("FmSpacer"), P = C("FmButton"), W = C("FmSearch"), le = C("FmTable"), oe = C("FmListItem"), se = C("FmList");
|
|
456
|
+
return h(), R(E, null, [o("div", Ee, [o("div", Oe, [o("div", Te, [o("div", ze, F(i(l)("menu.publish.title")), 1), a[7] || (a[7] = o("div", {
|
|
453
457
|
class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
454
|
-
}, null, -1))]), s
|
|
458
|
+
}, null, -1))]), n(s, {
|
|
455
459
|
label: k.value,
|
|
456
460
|
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
457
|
-
}, null, 8, ["label"]),
|
|
461
|
+
}, null, 8, ["label"]), n(D), o("div", Ne, [n(P, {
|
|
458
462
|
disabled: g.value,
|
|
459
463
|
icon: "ios_share",
|
|
460
|
-
label:
|
|
464
|
+
label: i(l)("menu.publish.actions.publish_all"),
|
|
461
465
|
variant: "primary",
|
|
462
|
-
onClick: a[0] || (a[0] = () =>
|
|
463
|
-
}, null, 8, ["disabled", "label"])])]), o("div",
|
|
466
|
+
onClick: a[0] || (a[0] = () => G())
|
|
467
|
+
}, null, 8, ["disabled", "label"])])]), o("div", He, [n(i(fe), {
|
|
464
468
|
multiple: "",
|
|
465
469
|
modelValue: b.value,
|
|
466
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
470
|
+
"onUpdate:modelValue": a[2] || (a[2] = (u) => b.value = u)
|
|
467
471
|
}, {
|
|
468
|
-
"append-right":
|
|
472
|
+
"append-right": L(() => [n(D, {
|
|
469
473
|
class: "xs:hidden"
|
|
470
|
-
}),
|
|
474
|
+
}), n(W, {
|
|
471
475
|
modelValue: f.value,
|
|
472
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
476
|
+
"onUpdate:modelValue": a[1] || (a[1] = (u) => f.value = u),
|
|
473
477
|
autofocus: "",
|
|
474
478
|
class: "w-[320px] xs:hidden",
|
|
475
|
-
placeholder:
|
|
479
|
+
placeholder: i(l)("menu.publish.table.search.placeholder")
|
|
476
480
|
}, null, 8, ["modelValue", "placeholder"])]),
|
|
477
481
|
_: 1
|
|
478
|
-
}, 8, ["modelValue"]),
|
|
482
|
+
}, 8, ["modelValue"]), n(W, {
|
|
479
483
|
modelValue: f.value,
|
|
480
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
484
|
+
"onUpdate:modelValue": a[3] || (a[3] = (u) => f.value = u),
|
|
481
485
|
autofocus: "",
|
|
482
486
|
class: "w-full xs:block hidden",
|
|
483
|
-
placeholder:
|
|
484
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
487
|
+
placeholder: i(l)("menu.publish.table.search.placeholder")
|
|
488
|
+
}, null, 8, ["modelValue", "placeholder"])]), w.value.length > 0 ? (h(), R(E, {
|
|
485
489
|
key: 0
|
|
486
|
-
}, [
|
|
490
|
+
}, [n(Ce, {
|
|
487
491
|
class: "xs:hidden block"
|
|
488
492
|
}, {
|
|
489
|
-
default:
|
|
493
|
+
default: L(() => [n(le, {
|
|
490
494
|
modelValue: m.value,
|
|
491
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
495
|
+
"onUpdate:modelValue": a[4] || (a[4] = (u) => m.value = u),
|
|
492
496
|
"column-defs": y,
|
|
493
497
|
loading: g.value,
|
|
494
|
-
"page-size":
|
|
495
|
-
"row-data":
|
|
498
|
+
"page-size": w.value.length,
|
|
499
|
+
"row-data": w.value,
|
|
496
500
|
"search-value": f.value,
|
|
497
501
|
shrinkAt: !1,
|
|
498
502
|
selection: "multiple",
|
|
499
503
|
"hide-footer": "",
|
|
500
504
|
"pin-header-row": "",
|
|
501
|
-
onRowClick: a[5] || (a[5] = (
|
|
505
|
+
onRowClick: a[5] || (a[5] = (u) => z(u.original))
|
|
502
506
|
}, null, 8, ["modelValue", "loading", "page-size", "row-data", "search-value"])]),
|
|
503
507
|
_: 1
|
|
504
|
-
}),
|
|
508
|
+
}), n(se, {
|
|
505
509
|
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
506
510
|
separator: ""
|
|
507
511
|
}, {
|
|
508
|
-
default:
|
|
509
|
-
key:
|
|
510
|
-
label:
|
|
512
|
+
default: L(() => [(h(!0), R(E, null, j(te.value, (u) => (h(), O(oe, {
|
|
513
|
+
key: u._id,
|
|
514
|
+
label: u.name,
|
|
511
515
|
style: {
|
|
512
516
|
padding: "12px 0 !important"
|
|
513
517
|
},
|
|
514
|
-
onClick: () =>
|
|
518
|
+
onClick: () => z(u)
|
|
515
519
|
}, {
|
|
516
|
-
default:
|
|
517
|
-
row:
|
|
518
|
-
}, null, 8, ["row"])]), o("div", qe, [o("div",
|
|
520
|
+
default: L(() => [o("div", Ke, [o("div", je, [o("div", Ye, F($(u.updatedAt)), 1), n(r, {
|
|
521
|
+
row: u
|
|
522
|
+
}, null, 8, ["row"])]), o("div", qe, [o("div", Ge, F(u.name), 1), o("div", We, [o("div", null, "Default: " + F(u.catalog.default), 1), o("div", null, "POS takeaway: " + F(u.catalog.takeaway), 1), o("div", null, "Pickup: " + F(u.catalog.pickup), 1)])])]), o("div", Je, [d.value && u.revertConfig ? (h(), O(P, {
|
|
519
523
|
key: 0,
|
|
520
524
|
disabled: g.value,
|
|
521
525
|
icon: "undo",
|
|
522
526
|
variant: "tertiary",
|
|
523
|
-
onClick:
|
|
524
|
-
}, null, 8, ["disabled", "onClick"])) :
|
|
527
|
+
onClick: N(() => _(u), ["stop"])
|
|
528
|
+
}, null, 8, ["disabled", "onClick"])) : ue("", !0), n(P, {
|
|
525
529
|
disabled: g.value,
|
|
526
530
|
icon: "ios_share",
|
|
527
531
|
variant: "tertiary",
|
|
528
|
-
onClick:
|
|
532
|
+
onClick: N(() => B(A(u)), ["stop"])
|
|
529
533
|
}, null, 8, ["disabled", "onClick"])])]),
|
|
530
534
|
_: 2
|
|
531
535
|
}, 1032, ["label", "onClick"]))), 128))]),
|
|
532
536
|
_: 1
|
|
533
|
-
})], 64)) : (h(),
|
|
537
|
+
})], 64)) : (h(), O(i(Ve), {
|
|
534
538
|
key: 1,
|
|
535
|
-
title:
|
|
536
|
-
subtitle:
|
|
539
|
+
title: i(l)("menu.publish.empty.title"),
|
|
540
|
+
subtitle: i(l)("menu.publish.empty.subtitle"),
|
|
537
541
|
action: {
|
|
538
|
-
text:
|
|
542
|
+
text: i(l)("menu.publish.empty.action"),
|
|
539
543
|
icon: "add",
|
|
540
544
|
callback: () => {
|
|
541
|
-
|
|
545
|
+
i(V).push({
|
|
542
546
|
name: "$settings-my-business"
|
|
543
547
|
});
|
|
544
548
|
}
|
|
545
549
|
}
|
|
546
|
-
}, null, 8, ["title", "subtitle", "action"]))]), o("div",
|
|
550
|
+
}, null, 8, ["title", "subtitle", "action"]))]), o("div", Qe, [n(P, {
|
|
547
551
|
disabled: g.value,
|
|
548
552
|
icon: "ios_share",
|
|
549
|
-
label:
|
|
553
|
+
label: i(l)("menu.publish.actions.publish_all"),
|
|
550
554
|
variant: "fab",
|
|
551
|
-
onClick: a[6] || (a[6] = () =>
|
|
552
|
-
}, null, 8, ["disabled", "label"])]),
|
|
555
|
+
onClick: a[6] || (a[6] = () => G())
|
|
556
|
+
}, null, 8, ["disabled", "label"])]), n(Be, {
|
|
553
557
|
ref_key: "updateCatalogDialogRef",
|
|
554
558
|
ref: p,
|
|
555
|
-
catalogs:
|
|
556
|
-
onOnComplete:
|
|
559
|
+
catalogs: T.value,
|
|
560
|
+
onOnComplete: B
|
|
557
561
|
}, null, 8, ["catalogs"])], 64);
|
|
558
562
|
};
|
|
559
563
|
}
|
|
560
564
|
});
|
|
561
565
|
export {
|
|
562
|
-
|
|
566
|
+
ca as default
|
|
563
567
|
};
|