@feedmepos/mf-menu 0.32.13 → 0.32.15
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-D70-FH5L.js → App-BFUyUrdi.js} +16 -9
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BJdja2N0.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BbjRIN7Z.js} +20 -20
- package/dist/{Catalog-WMpN3a0p.js → Catalog-B6VFmr6e.js} +20 -20
- package/dist/{Category-C_VsQIHU.js → Category-B-bTjNFI.js} +24 -24
- package/dist/{Category-BwHhFTZ-.js → Category-C8uGxpST.js} +84 -84
- package/dist/{CookingGuide-D9RNkYDL.js → CookingGuide-BL3uetlO.js} +65 -65
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DtmrxDZm.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-8yIVwc8E.js} +1 -1
- package/dist/{Group-DexONgr2.js → Group-BvO-gQZe.js} +1 -1
- package/dist/{Group-qRZlg5ST.js → Group-DT9UkkOx.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DtPY9uUt.js → Group.vue_vue_type_script_setup_true_lang-DZhM1Tpb.js} +56 -56
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B5Qpmj2f.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D48u_DHq.js} +5 -5
- package/dist/ImportProductDialog.vue_vue_type_script_setup_true_lang-C_X-lTnN.js +72979 -0
- package/dist/{Ingredient-BuOS_Wvm.js → Ingredient-7qWDD9e6.js} +26 -26
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DFvXklj9.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CwjW0wfz.js} +2 -2
- package/dist/{LinkProductSideSheet-DJj8Nn4X.js → LinkProductSideSheet-BXW6eNgZ.js} +3 -3
- package/dist/{MenuSetting-D6B0gCGV.js → MenuSetting-BSF7O2NL.js} +5 -5
- package/dist/{PrintRoute-B7G8f1iC.js → PrintRoute-b1ii5Uz9.js} +20 -20
- package/dist/{Product-DpS5EepJ.js → Product-Ce0GJb3c.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CdIukLqA.js → Product.vue_vue_type_script_setup_true_lang-BZVvTAOX.js} +49 -49
- package/dist/{ProductInternalTools-CBCyWHOS.js → ProductInternalTools-igbOLRap.js} +20 -20
- package/dist/Products-GAyUdhnN.js +292 -0
- package/dist/Publish-g60odzhM.js +1300 -0
- package/dist/{Recipe-D14rkATU.js → Recipe-B6aye_iC.js} +9 -9
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CdH2ius3.js → RuleView.vue_vue_type_script_setup_true_lang-By8kwuMB.js} +134 -134
- package/dist/{Scheduler-DWZqa-jf.js → Scheduler-CyaG6Y5v.js} +7 -7
- package/dist/{ServingSequence-Mx7ovvJ1.js → ServingSequence-BXeypgrN.js} +27 -27
- package/dist/{Setting-DmHuVXVn.js → Setting-D7GcaNTk.js} +17 -17
- package/dist/{Subcategory-DixZPdnT.js → Subcategory-DNUp9ojI.js} +37 -37
- package/dist/{Takeaway-BVIymFV_.js → Takeaway-Baqvq5nP.js} +9 -9
- package/dist/{Takeaway-DDKeDEbV.js → Takeaway-BjXPeYRv.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CTaCQgRv.js → Takeaway.vue_vue_type_script_setup_true_lang-CgXT2UVL.js} +54 -54
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DveI9xvU.js → Thumbnail.vue_vue_type_script_setup_true_lang-CX8cSbDe.js} +12 -12
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-2nBbq_Yk.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DcjGVQEO.js} +756 -763
- package/dist/{Unit-utuaNZBw.js → Unit-mI7lLzCf.js} +2 -2
- package/dist/{Variant-CzuJNwen.js → Variant-CVwnODRz.js} +14 -14
- package/dist/{_id_-DMDhPQCr.js → _id_-fpn0nBru.js} +14 -14
- package/dist/{app-BQUkvrAS.js → app-CCKI85Te.js} +26 -26
- package/dist/{app-Bqj3cAPJ.js → app-U5MEN4U1.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/Entry.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +0 -2
- package/dist/apps/mf-menu/src/composable/useClientEvent.d.ts +14 -0
- package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +22 -22
- package/dist/apps/mf-menu/src/helper/menuExport.d.ts +59 -33
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-ILQVL8r9.js → linked-status-6Jt70XBp.js} +2 -2
- package/dist/assets/menu-export-CR0a98CA.js +107 -0
- package/dist/assets/{override-menu-DVkGhbA9.js → override-menu-Chsc0CSI.js} +2 -2
- package/dist/assets/{validate-menu-y_NQUL02.js → validate-menu-pb0aN4gj.js} +2 -2
- package/dist/{catalog-BYzITAmC.js → catalog-BgQmytEA.js} +1 -1
- package/dist/{catalogSetting-DAo5tN3P.js → catalogSetting-BS5IaQKq.js} +1 -1
- package/dist/{category-D4x8r_lY.js → category-DJMVbmzx.js} +1 -1
- package/dist/{currency-CvoBdMM2.js → currency-FHrLDvzy.js} +1 -1
- package/dist/dayjs.min-DJGdQr-B.js +6 -0
- package/dist/{index-LuH6PJzW.js → index-BywPDIFW.js} +4 -4
- package/dist/{index-BLUIaanj.js → index-DYxLHjeC.js} +1 -1
- package/dist/{index-6lju0f3r.js → index-XVWDnyu-.js} +17 -17
- package/dist/{index.vue_vue_type_script_setup_true_lang-DxF14kn9.js → index.vue_vue_type_script_setup_true_lang-kj6HkxwD.js} +2306 -2306
- package/dist/{item-lXMLaKOb.js → item-cmnP2N-a.js} +1089 -1091
- package/dist/{jszip.min-CdZ-wY5m.js → jszip.min-psVCZNVl.js} +545 -545
- package/dist/{menu-PJc2dQHQ.js → menu-CgQPOu3W.js} +1 -1
- package/dist/{menuV2-DinFmdTL.js → menuV2-DHO9OmzU.js} +159 -159
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-CzKIo11g.js → priceTier-CLm9vzaK.js} +1 -1
- package/dist/{scheduler-DQjxnoCk.js → scheduler-BMdZdtpj.js} +4 -4
- package/dist/{subcategory-CLkDImEU.js → subcategory-Dj_DOvFt.js} +2 -2
- package/dist/{toExcel-DPh8DaM0.js → toExcel-XwFFiTiA.js} +2 -2
- package/dist/{unit-QYkVoC6_.js → unit-CsuAQsy7.js} +12 -12
- package/package.json +3 -3
- package/dist/ImportProductDialog.vue_vue_type_script_setup_true_lang-BqhNkaw_.js +0 -96043
- package/dist/Products-CcyGNlUl.js +0 -794
- package/dist/Publish-rZLHFaJ5.js +0 -1264
- package/dist/dayjs.min-C6xioui7.js +0 -6
package/dist/Publish-rZLHFaJ5.js
DELETED
|
@@ -1,1264 +0,0 @@
|
|
|
1
|
-
import { defineComponent as W, ref as P, computed as R, onMounted as ie, resolveComponent as U, createElementBlock as M, openBlock as g, createVNode as f, createElementVNode as i, toDisplayString as L, unref as d, Fragment as H, renderList as G, createBlock as j, watch as de, withCtx as E, normalizeClass as re, createCommentVNode as Q, createTextVNode as me, mergeProps as Fe, normalizeStyle as Ve, renderSlot as Ie, withModifiers as te, h as T, onUnmounted as Pe } from "vue";
|
|
2
|
-
import { D as z } from "./dayjs.min-C6xioui7.js";
|
|
3
|
-
import { useRouter as Me } from "vue-router";
|
|
4
|
-
import { O as $e, b as Ue } from "./app-5fxKLAzS.js";
|
|
5
|
-
import { B as Be, H as Ae, G as he, ab as De, A as q, u as _e, I as pe, J as Te, a3 as Re } from "./index.vue_vue_type_script_setup_true_lang-DxF14kn9.js";
|
|
6
|
-
import { useI18n as Z, useCoreStore as Oe, RestaurantSelector as Ne } from "@feedmepos/mf-common";
|
|
7
|
-
import { useSnackbar as ce, useDialogChild as Ee, useProxiedModel as Le, FmButtonVariant as fe, components as X, useDialog as ze } from "@feedmepos/ui-library";
|
|
8
|
-
import { _ as He } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
9
|
-
import { _ as Je } from "./app-BQUkvrAS.js";
|
|
10
|
-
import { a as Ye, w as Ke } from "./tooltip-B5BiPMx9.js";
|
|
11
|
-
import { u as be } from "./discardConfirm-BHni0LNu.js";
|
|
12
|
-
import { _ as ge } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
-
function ye(B) {
|
|
14
|
-
return B ? z(B).format("DD/MM/YY HH:mm") : "-";
|
|
15
|
-
}
|
|
16
|
-
function je(B, F, n) {
|
|
17
|
-
const b = (o, k = !1) => {
|
|
18
|
-
var r;
|
|
19
|
-
return o === void 0 && !k ? "-" : ((r = n.find((h) => h.value === (o || null))) == null ? void 0 : r.label) || "-";
|
|
20
|
-
};
|
|
21
|
-
return B.map((o) => {
|
|
22
|
-
var e;
|
|
23
|
-
const k = (e = F.find(({ _id: C }) => C === o._id)) == null ? void 0 : e.posVersion, r = !!k && !!Be.Pos.canUse({ feature: Ae.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: k }), h = b(o.catalogId);
|
|
24
|
-
return {
|
|
25
|
-
...o,
|
|
26
|
-
_default: h,
|
|
27
|
-
_posTakeaway: o.takeawayCatalog ? b(o.takeawayCatalog) : h,
|
|
28
|
-
_additionalCatalogs: (o.additionalCatalogs || []).map((C) => b(C)),
|
|
29
|
-
_lastUpdate: ye(o.updatedAt),
|
|
30
|
-
_pickup: r ? b(o.pickupCatalog, !0) : "-",
|
|
31
|
-
_canUsePickup: r,
|
|
32
|
-
_posVersion: k || "-"
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const qe = {
|
|
37
|
-
key: 0,
|
|
38
|
-
class: "flex items-center justify-center"
|
|
39
|
-
}, Ge = {
|
|
40
|
-
key: 1,
|
|
41
|
-
class: "space-y-16"
|
|
42
|
-
}, We = { class: "text-fm-color-typo-secondary" }, Qe = { class: "space-y-4" }, Xe = /* @__PURE__ */ W({
|
|
43
|
-
__name: "RevertDialog",
|
|
44
|
-
props: {
|
|
45
|
-
restaurant: {}
|
|
46
|
-
},
|
|
47
|
-
setup(B) {
|
|
48
|
-
const F = B, n = ce(), { custom: b } = he(n), o = P(!1), k = P(null);
|
|
49
|
-
async function r() {
|
|
50
|
-
await b(
|
|
51
|
-
async () => {
|
|
52
|
-
var c;
|
|
53
|
-
k.value = await De.readMenuById(((c = F.restaurant.revertConfig) == null ? void 0 : c._id) || "");
|
|
54
|
-
},
|
|
55
|
-
{ isLoading: o }
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
const h = R(() => {
|
|
59
|
-
var c;
|
|
60
|
-
return [
|
|
61
|
-
{ label: "Main", value: null },
|
|
62
|
-
...(((c = k.value) == null ? void 0 : c.modules.catalog) || []).map((_) => ({
|
|
63
|
-
label: _.name,
|
|
64
|
-
value: _._id
|
|
65
|
-
}))
|
|
66
|
-
];
|
|
67
|
-
}), { t: e } = Z(), C = R(() => {
|
|
68
|
-
var s;
|
|
69
|
-
const c = F.restaurant.revertConfig;
|
|
70
|
-
if (!c) return [];
|
|
71
|
-
const _ = je(
|
|
72
|
-
[
|
|
73
|
-
{
|
|
74
|
-
...c,
|
|
75
|
-
catalogId: c.catalogId || null
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
Oe().restaurants.value,
|
|
79
|
-
h.value
|
|
80
|
-
)[0];
|
|
81
|
-
return [
|
|
82
|
-
{ label: e("menu.revert.labels.restaurant"), value: F.restaurant.name },
|
|
83
|
-
{
|
|
84
|
-
label: e("menu.revert.labels.revert_to"),
|
|
85
|
-
value: ye((s = k.value) == null ? void 0 : s.updatedAt)
|
|
86
|
-
},
|
|
87
|
-
{ label: e("menu.revert.labels.default"), value: _._default },
|
|
88
|
-
{ label: e("menu.revert.labels.pos_takeaway"), value: _._posTakeaway },
|
|
89
|
-
{ label: e("menu.revert.labels.pickup"), value: _._pickup },
|
|
90
|
-
{
|
|
91
|
-
label: e("menu.revert.labels.additional_catalogs"),
|
|
92
|
-
value: _._additionalCatalogs.join(", ")
|
|
93
|
-
}
|
|
94
|
-
];
|
|
95
|
-
});
|
|
96
|
-
ie(async () => r());
|
|
97
|
-
const { emitData: a } = Ee();
|
|
98
|
-
return (c, _) => {
|
|
99
|
-
const s = U("FmCircularProgress");
|
|
100
|
-
return o.value ? (g(), M("div", qe, [
|
|
101
|
-
f(s, { size: "lg" })
|
|
102
|
-
])) : (g(), M("div", Ge, [
|
|
103
|
-
i("div", We, L(d(e)("menu.revert.description", { name: F.restaurant.name })), 1),
|
|
104
|
-
i("div", Qe, [
|
|
105
|
-
(g(!0), M(H, null, G(C.value, (m) => (g(), j(Ye, {
|
|
106
|
-
key: m.label,
|
|
107
|
-
name: m.label,
|
|
108
|
-
value: m.value || "--"
|
|
109
|
-
}, null, 8, ["name", "value"]))), 128))
|
|
110
|
-
])
|
|
111
|
-
]));
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}), Ze = {
|
|
115
|
-
class: "break-all fm-typo-en-body-lg-400 line-clamp-1"
|
|
116
|
-
}, et = {
|
|
117
|
-
class: "flex flex-col"
|
|
118
|
-
}, tt = /* @__PURE__ */ W({
|
|
119
|
-
__name: "PublishRestaurantSelector",
|
|
120
|
-
props: {
|
|
121
|
-
restaurants: {
|
|
122
|
-
type: Array,
|
|
123
|
-
required: !0
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
emits: ["update:modelValue"],
|
|
127
|
-
setup(B, {
|
|
128
|
-
emit: F
|
|
129
|
-
}) {
|
|
130
|
-
const n = B, b = F, o = P([]), k = R(() => n.restaurants.map((s) => ({
|
|
131
|
-
label: s.name,
|
|
132
|
-
value: s._id
|
|
133
|
-
}))), r = P(""), h = R(() => {
|
|
134
|
-
const s = Array.isArray(o.value) ? o.value : [], m = s.map((y) => k.value.find((S) => S.value === y)).filter((y) => y !== void 0);
|
|
135
|
-
let u = [];
|
|
136
|
-
return r.value ? (u = k.value.filter((y) => y.label.toLowerCase().includes(r.value.toLowerCase()) && !s.includes(y.value)), [...m, ...u]) : (u = k.value.filter((y) => !s.includes(y.value)), [...m, ...u]);
|
|
137
|
-
}), e = R(() => o.value.length > 0 && o.value.length === h.value.length), C = R(() => o.value.filter((s) => h.value.some((m) => m.value === s))), a = () => {
|
|
138
|
-
const s = o.value.filter((m) => !C.value.includes(m));
|
|
139
|
-
e.value === !0 ? c(s) : c(h.value.map((m) => m.value));
|
|
140
|
-
}, c = (s) => {
|
|
141
|
-
o.value = s;
|
|
142
|
-
};
|
|
143
|
-
de(o, (s) => {
|
|
144
|
-
b("update:modelValue", s);
|
|
145
|
-
});
|
|
146
|
-
function _(s) {
|
|
147
|
-
return n.restaurants.filter((m) => s.includes(m._id)).map((m) => m.name);
|
|
148
|
-
}
|
|
149
|
-
return (s, m) => {
|
|
150
|
-
const u = U("FmSearch"), y = U("FmCheckbox"), S = U("FmSelect");
|
|
151
|
-
return g(), j(S, {
|
|
152
|
-
modelValue: o.value,
|
|
153
|
-
"onUpdate:modelValue": m[1] || (m[1] = (O) => o.value = O),
|
|
154
|
-
placeholder: "Select Restaurant",
|
|
155
|
-
items: h.value,
|
|
156
|
-
multiselect: !0,
|
|
157
|
-
"hide-chips": !0
|
|
158
|
-
}, {
|
|
159
|
-
default: E(() => [i("p", Ze, L(o.value.length === n.restaurants.length ? "All restaurants" : _(o.value).join(", ")), 1)]),
|
|
160
|
-
"menu-wrapper": E(() => [i("div", et, [f(u, {
|
|
161
|
-
class: "py-8",
|
|
162
|
-
modelValue: r.value,
|
|
163
|
-
"onUpdate:modelValue": m[0] || (m[0] = (O) => r.value = O),
|
|
164
|
-
placeholder: "Search Restaurant"
|
|
165
|
-
}, null, 8, ["modelValue"]), f(y, {
|
|
166
|
-
class: "py-8",
|
|
167
|
-
"model-value": e.value,
|
|
168
|
-
label: "All restaurants",
|
|
169
|
-
value: "1",
|
|
170
|
-
indeterminate: o.value.length > 0,
|
|
171
|
-
"onUpdate:modelValue": a
|
|
172
|
-
}, null, 8, ["model-value", "indeterminate"]), (g(!0), M(H, null, G(h.value, (O, J) => (g(), M("div", {
|
|
173
|
-
key: J
|
|
174
|
-
}, [f(y, {
|
|
175
|
-
"model-value": o.value,
|
|
176
|
-
label: O.label,
|
|
177
|
-
value: O.value,
|
|
178
|
-
"onUpdate:modelValue": c
|
|
179
|
-
}, null, 8, ["model-value", "label", "value"])]))), 128))])]),
|
|
180
|
-
_: 1
|
|
181
|
-
}, 8, ["modelValue", "items"]);
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}), at = { class: "fm-calendar__name-row fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, lt = ["id"], nt = {
|
|
185
|
-
key: 0,
|
|
186
|
-
class: "fm-calendar__cell__button--today"
|
|
187
|
-
}, st = ["onClick", "onMouseover"], ot = /* @__PURE__ */ W({
|
|
188
|
-
__name: "FmCalendar",
|
|
189
|
-
props: {
|
|
190
|
-
days: {},
|
|
191
|
-
dayCellClass: { type: [Object, Function], default: void 0 },
|
|
192
|
-
onDayClick: {},
|
|
193
|
-
onCellMouseOver: { type: Function, default: void 0 },
|
|
194
|
-
cellSize: { default: "md" }
|
|
195
|
-
},
|
|
196
|
-
setup(B) {
|
|
197
|
-
const { t: F } = Z(), n = () => [
|
|
198
|
-
F("menu.publish.scheduler.calender.day.sun"),
|
|
199
|
-
F("menu.publish.scheduler.calender.day.mon"),
|
|
200
|
-
F("menu.publish.scheduler.calender.day.tue"),
|
|
201
|
-
F("menu.publish.scheduler.calender.day.wed"),
|
|
202
|
-
F("menu.publish.scheduler.calender.day.thu"),
|
|
203
|
-
F("menu.publish.scheduler.calender.day.fri"),
|
|
204
|
-
F("menu.publish.scheduler.calender.day.sat")
|
|
205
|
-
], b = z(), o = (r, h) => typeof r == "function" ? r(...h) : r, k = (r, h) => {
|
|
206
|
-
if (!h) return;
|
|
207
|
-
const e = {
|
|
208
|
-
"fm-calendar__cell--selected": !1,
|
|
209
|
-
"fm-calendar__cell--selected-start": !1,
|
|
210
|
-
"fm-calendar__cell--selected-end": !1,
|
|
211
|
-
"fm-calendar__cell--selected-between": !1
|
|
212
|
-
};
|
|
213
|
-
let C;
|
|
214
|
-
if (typeof h == "function") {
|
|
215
|
-
const { status: a, className: c } = h(r);
|
|
216
|
-
a && (e["fm-calendar__cell--selected"] = a.isSelected ?? !1, e["fm-calendar__cell--selected-start"] = a.isStart ?? !1, e["fm-calendar__cell--selected-end"] = a.isEnd ?? !1, e["fm-calendar__cell--selected-between"] = a.isBetween ?? !1), C = c ?? "";
|
|
217
|
-
} else {
|
|
218
|
-
const { status: a, className: c } = h;
|
|
219
|
-
a && (e["fm-calendar__cell--selected"] = o(a.isSelected, [r]) ?? !1, e["fm-calendar__cell--selected-start"] = o(a.isStart, [r]) ?? !1, e["fm-calendar__cell--selected-end"] = o(a.isEnd, [r]) ?? !1, e["fm-calendar__cell--selected-between"] = o(a.isBetween, [r]) ?? !1), C = o(c, [r]) ?? "";
|
|
220
|
-
}
|
|
221
|
-
return [e, C];
|
|
222
|
-
};
|
|
223
|
-
return (r, h) => (g(), M("div", null, [
|
|
224
|
-
i("div", at, [
|
|
225
|
-
(g(!0), M(H, null, G(n(), (e) => (g(), M("div", {
|
|
226
|
-
key: e,
|
|
227
|
-
class: re(["fm-calendar__cell", `fm-calendar__cell__${r.cellSize}`])
|
|
228
|
-
}, L(e), 3))), 128))
|
|
229
|
-
]),
|
|
230
|
-
i("div", null, [
|
|
231
|
-
(g(!0), M(H, null, G(r.days, (e, C) => (g(), M("div", {
|
|
232
|
-
key: C,
|
|
233
|
-
class: "fm-calendar__row fm-typo-en-body-md-400"
|
|
234
|
-
}, [
|
|
235
|
-
(g(!0), M(H, null, G(e, (a) => (g(), M("div", {
|
|
236
|
-
id: `${a.date.toISOString()}`,
|
|
237
|
-
key: a.date.date(),
|
|
238
|
-
class: re(["fm-calendar__cell", [
|
|
239
|
-
`fm-calendar__cell__${r.cellSize}`,
|
|
240
|
-
k(a.date, r.dayCellClass),
|
|
241
|
-
!a.isCurrentMonth && "fm-calendar__cell--not-current-month"
|
|
242
|
-
]])
|
|
243
|
-
}, [
|
|
244
|
-
a.date.isSame(d(b), "day") && a.isCurrentMonth ? (g(), M("div", nt)) : Q("", !0),
|
|
245
|
-
a.isCurrentMonth ? (g(), M("button", {
|
|
246
|
-
key: 1,
|
|
247
|
-
class: "fm-calendar__cell__button",
|
|
248
|
-
type: "button",
|
|
249
|
-
onClick: (c) => r.onDayClick(a),
|
|
250
|
-
onMouseover: (c) => {
|
|
251
|
-
var _;
|
|
252
|
-
return (_ = r.onCellMouseOver) == null ? void 0 : _.call(r, a.date);
|
|
253
|
-
}
|
|
254
|
-
}, L(a.date.date()), 41, st)) : Q("", !0)
|
|
255
|
-
], 10, lt))), 128))
|
|
256
|
-
]))), 128))
|
|
257
|
-
])
|
|
258
|
-
]));
|
|
259
|
-
}
|
|
260
|
-
}), ve = /* @__PURE__ */ ge(ot, [["__scopeId", "data-v-47484312"]]), ut = { class: "fm-typo-en-body-md-600" }, rt = {
|
|
261
|
-
id: "in-calendar-app",
|
|
262
|
-
class: "h-[264px] overflow-y-auto w-[160px]"
|
|
263
|
-
}, it = ["onVnodeMounted"], dt = ["onVnodeMounted"], ae = /* @__PURE__ */ W({
|
|
264
|
-
__name: "FmDateRangeYearMonthPicker",
|
|
265
|
-
props: {
|
|
266
|
-
modelValue: {},
|
|
267
|
-
picker: {},
|
|
268
|
-
min: {},
|
|
269
|
-
max: {}
|
|
270
|
-
},
|
|
271
|
-
emits: ["update:modelValue"],
|
|
272
|
-
setup(B, { emit: F }) {
|
|
273
|
-
const { t: n } = Z(), b = B, o = F, k = P(!1), r = R(() => {
|
|
274
|
-
const a = z(b.min).startOf("year"), c = z(b.max).startOf("year"), _ = c.diff(a, "year"), s = [];
|
|
275
|
-
for (let m = 0; m <= _; m++)
|
|
276
|
-
s.push(c.subtract(m, "year"));
|
|
277
|
-
return s;
|
|
278
|
-
}), h = (a) => {
|
|
279
|
-
const c = z(b.min).startOf("month"), _ = z(b.max).startOf("month");
|
|
280
|
-
return a.get("year") === c.get("year") ? a.startOf("month").isAfter(c) || a.get("month") === c.get("month") : a.get("year") === _.get("year") ? a.startOf("month").isBefore(_) || a.get("month") === _.get("month") : !0;
|
|
281
|
-
}, e = (a) => {
|
|
282
|
-
const c = z(b.min).startOf("month"), _ = z(b.max).startOf("month");
|
|
283
|
-
if (c.get("year") === a.get("year")) {
|
|
284
|
-
o("update:modelValue", c);
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
if (_.get("year") === a.get("year")) {
|
|
288
|
-
o("update:modelValue", _);
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
o("update:modelValue", a);
|
|
292
|
-
};
|
|
293
|
-
function C(a, c) {
|
|
294
|
-
if (!c)
|
|
295
|
-
return !1;
|
|
296
|
-
const _ = a.el, s = _ == null ? void 0 : _.parentElement;
|
|
297
|
-
!_ || !s || s.scrollTo({
|
|
298
|
-
top: _.offsetTop - 50
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
return (a, c) => {
|
|
302
|
-
const _ = U("FmIcon"), s = U("FmMenuItem"), m = U("FmMenu");
|
|
303
|
-
return g(), j(m, {
|
|
304
|
-
trigger: "click",
|
|
305
|
-
onMenuChanged: c[0] || (c[0] = (u) => k.value = u)
|
|
306
|
-
}, {
|
|
307
|
-
"menu-button": E(() => [
|
|
308
|
-
i("div", {
|
|
309
|
-
class: re(["flex gap-4 h-24 items-center px-4 rounded-sm", k.value ? "text-fm-color-primary" : "hover:bg-fm-color-neutral-gray-100"])
|
|
310
|
-
}, [
|
|
311
|
-
i("div", ut, [
|
|
312
|
-
a.picker === "month" ? (g(), M(H, { key: 0 }, [
|
|
313
|
-
me(L(a.modelValue.format(d(n)("menu.publish.scheduler.date.monthFormat"))), 1)
|
|
314
|
-
], 64)) : Q("", !0),
|
|
315
|
-
a.picker === "year" ? (g(), M(H, { key: 1 }, [
|
|
316
|
-
me(L(a.modelValue.format(d(n)("menu.publish.scheduler.date.yearFormat"))), 1)
|
|
317
|
-
], 64)) : Q("", !0)
|
|
318
|
-
]),
|
|
319
|
-
f(_, {
|
|
320
|
-
name: k.value ? "expand_less" : "expand_more",
|
|
321
|
-
size: "md",
|
|
322
|
-
color: "black"
|
|
323
|
-
}, null, 8, ["name"])
|
|
324
|
-
], 2)
|
|
325
|
-
]),
|
|
326
|
-
default: E(() => [
|
|
327
|
-
i("ul", rt, [
|
|
328
|
-
a.picker === "month" ? (g(!0), M(H, { key: 0 }, G(Array.from(Array(12), (u, y) => a.modelValue.month(y)), (u) => (g(), M("li", {
|
|
329
|
-
key: u.format(d(n)("menu.publish.scheduler.date.monthFormat")),
|
|
330
|
-
onVnodeMounted: (y) => C(
|
|
331
|
-
y,
|
|
332
|
-
a.modelValue.format(d(n)("menu.publish.scheduler.date.monthFormat")) === u.format(d(n)("menu.publish.scheduler.date.monthFormat"))
|
|
333
|
-
)
|
|
334
|
-
}, [
|
|
335
|
-
f(s, {
|
|
336
|
-
disabled: !h(u),
|
|
337
|
-
"model-value": a.modelValue.format(d(n)("menu.publish.scheduler.date.monthFormat")) === u.format(d(n)("menu.publish.scheduler.date.monthFormat")),
|
|
338
|
-
label: u.format(d(n)("menu.publish.scheduler.date.monthFormat")),
|
|
339
|
-
"onUpdate:modelValue": (y) => o("update:modelValue", u)
|
|
340
|
-
}, null, 8, ["disabled", "model-value", "label", "onUpdate:modelValue"])
|
|
341
|
-
], 8, it))), 128)) : Q("", !0),
|
|
342
|
-
a.picker === "year" ? (g(!0), M(H, { key: 1 }, G(r.value, (u) => (g(), M("li", {
|
|
343
|
-
key: u.format(d(n)("menu.publish.scheduler.date.yearFormat")),
|
|
344
|
-
onVnodeMounted: (y) => C(
|
|
345
|
-
y,
|
|
346
|
-
a.modelValue.format(d(n)("menu.publish.scheduler.date.yearFormat")) === u.format(d(n)("menu.publish.scheduler.date.yearFormat"))
|
|
347
|
-
)
|
|
348
|
-
}, [
|
|
349
|
-
f(s, {
|
|
350
|
-
"model-value": a.modelValue.format(d(n)("menu.publish.scheduler.date.yearFormat")) === u.format(d(n)("menu.publish.scheduler.date.yearFormat")),
|
|
351
|
-
label: u.format(d(n)("menu.publish.scheduler.date.yearFormat")),
|
|
352
|
-
"onUpdate:modelValue": (y) => e(u)
|
|
353
|
-
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])
|
|
354
|
-
], 8, dt))), 128)) : Q("", !0)
|
|
355
|
-
])
|
|
356
|
-
]),
|
|
357
|
-
_: 1
|
|
358
|
-
});
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
}), ct = { class: "p-12 space-y-4 w-[552px]" }, mt = { class: "w-max" }, pt = { class: "flex space-x-24" }, ft = { class: "flex items-center py-8 space-x-16" }, vt = { class: "flex space-x-4" }, ht = { class: "flex items-center justify-end py-8 space-x-16" }, _t = { class: "flex space-x-4" }, bt = { class: "flex gap-8 items-center justify-end w-full" }, le = "YYYY-MM-DD", gt = /* @__PURE__ */ W({
|
|
362
|
-
__name: "DateTimePicker",
|
|
363
|
-
props: {
|
|
364
|
-
modelValue: {},
|
|
365
|
-
showValidBorder: { type: Boolean, default: !1 },
|
|
366
|
-
min: { default: () => z().subtract(50, "year").format(le) },
|
|
367
|
-
max: { default: () => z().add(25, "year").format(le) },
|
|
368
|
-
zIndex: { default: void 0 },
|
|
369
|
-
label: { default: "" },
|
|
370
|
-
labelMark: { default: "none" },
|
|
371
|
-
labelInfo: { default: "" },
|
|
372
|
-
disabled: { type: Boolean, default: void 0 },
|
|
373
|
-
focused: { type: Boolean, default: !1 },
|
|
374
|
-
rules: { default: () => [] },
|
|
375
|
-
helperText: { default: "" },
|
|
376
|
-
helperState: { default: "none" }
|
|
377
|
-
},
|
|
378
|
-
emits: ["update:schedulerTime"],
|
|
379
|
-
setup(B, { emit: F }) {
|
|
380
|
-
const { t: n } = Z(), b = B, o = F, k = Le(b, "modelValue"), r = P({
|
|
381
|
-
hours: new Date(k.value).getHours() % 12 || 12,
|
|
382
|
-
minutes: new Date(k.value).getMinutes(),
|
|
383
|
-
period: new Date(k.value).getHours() >= 12 ? "PM" : "AM"
|
|
384
|
-
/* AM */
|
|
385
|
-
}), h = P(z(k.value, le)), e = P(!1);
|
|
386
|
-
function C(w, l) {
|
|
387
|
-
const [p, x, A] = w.split("-").map(Number), D = new Date(p, x - 1, A);
|
|
388
|
-
let I = l.hours % 12;
|
|
389
|
-
return l.period === "PM" && (I += 12), D.setHours(I), D.setMinutes(l.minutes), D.setSeconds(0), D.setMilliseconds(0), D;
|
|
390
|
-
}
|
|
391
|
-
const a = () => {
|
|
392
|
-
k.value = h.value.format(le);
|
|
393
|
-
const w = C(k.value, r.value);
|
|
394
|
-
o("update:schedulerTime", w.toISOString()), setTimeout(() => {
|
|
395
|
-
e.value = !1;
|
|
396
|
-
}, 0);
|
|
397
|
-
}, c = () => {
|
|
398
|
-
h.value = k.value ? z(k.value) : null, e.value = !1;
|
|
399
|
-
}, _ = (w) => {
|
|
400
|
-
e.value = w, w || c();
|
|
401
|
-
}, s = P(z().startOf("month")), m = P(z().startOf("month").add(1, "month")), u = (w, l) => {
|
|
402
|
-
w === "left" ? (s.value = l, m.value = l.add(1, "month")) : w === "right" && (m.value = l, s.value = l.subtract(1, "month"));
|
|
403
|
-
}, y = R(() => O(s.value)), S = R(() => O(s.value.add(1, "month"))), O = (w) => {
|
|
404
|
-
const l = [], p = w.endOf("month"), x = w.month();
|
|
405
|
-
let A = w.startOf("week"), D = [];
|
|
406
|
-
for (; A.isBefore(p.endOf("week")); )
|
|
407
|
-
A.day() === 0 && D.length > 0 && (l.push(D), D = []), D.push({
|
|
408
|
-
date: A,
|
|
409
|
-
isCurrentMonth: A.month() === x
|
|
410
|
-
}), A = A.add(1, "day");
|
|
411
|
-
return D.length > 0 && l.push(D), l.length < 6 && l.push([]), l;
|
|
412
|
-
}, J = (w) => {
|
|
413
|
-
h.value = w;
|
|
414
|
-
};
|
|
415
|
-
return (w, l) => {
|
|
416
|
-
const p = U("FmIcon"), x = U("FmTimeInput"), A = U("FmButton"), D = U("FmPopover");
|
|
417
|
-
return g(), j(D, {
|
|
418
|
-
"show-popover": e.value,
|
|
419
|
-
"z-index": b.zIndex,
|
|
420
|
-
"exclude-el-from-click-outside": ["in-calendar-app"],
|
|
421
|
-
onPopoverChanged: _
|
|
422
|
-
}, {
|
|
423
|
-
"popover-button": E(() => [
|
|
424
|
-
i("div", Fe({
|
|
425
|
-
opened: e.value,
|
|
426
|
-
showValidBorder: w.showValidBorder
|
|
427
|
-
}, { class: "text-fm-color-primary" }), " Select Date & Time ", 16)
|
|
428
|
-
]),
|
|
429
|
-
default: E(() => [
|
|
430
|
-
i("div", ct, [
|
|
431
|
-
i("div", mt, [
|
|
432
|
-
i("div", pt, [
|
|
433
|
-
i("div", null, [
|
|
434
|
-
i("div", ft, [
|
|
435
|
-
f(p, {
|
|
436
|
-
outline: !1,
|
|
437
|
-
class: "cursor-pointer select-none",
|
|
438
|
-
color: "#1C1C1E",
|
|
439
|
-
name: "chevron_left",
|
|
440
|
-
size: "md",
|
|
441
|
-
onClick: l[0] || (l[0] = () => u("left", s.value.subtract(1, "month")))
|
|
442
|
-
}),
|
|
443
|
-
i("div", vt, [
|
|
444
|
-
f(ae, {
|
|
445
|
-
max: w.max,
|
|
446
|
-
min: w.min,
|
|
447
|
-
"model-value": s.value,
|
|
448
|
-
picker: "month",
|
|
449
|
-
"onUpdate:modelValue": l[1] || (l[1] = (I) => u("left", I))
|
|
450
|
-
}, null, 8, ["max", "min", "model-value"]),
|
|
451
|
-
f(ae, {
|
|
452
|
-
max: w.max,
|
|
453
|
-
min: w.min,
|
|
454
|
-
"model-value": s.value,
|
|
455
|
-
picker: "year",
|
|
456
|
-
"onUpdate:modelValue": l[2] || (l[2] = (I) => u("left", I))
|
|
457
|
-
}, null, 8, ["max", "min", "model-value"])
|
|
458
|
-
])
|
|
459
|
-
]),
|
|
460
|
-
f(ve, {
|
|
461
|
-
"day-cell-class": {
|
|
462
|
-
status: {
|
|
463
|
-
isSelected: (I) => I.isSame(h.value, "date")
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
days: y.value,
|
|
467
|
-
"on-day-click": (I) => J(I.date)
|
|
468
|
-
}, null, 8, ["day-cell-class", "days", "on-day-click"])
|
|
469
|
-
]),
|
|
470
|
-
i("div", null, [
|
|
471
|
-
i("div", ht, [
|
|
472
|
-
i("div", _t, [
|
|
473
|
-
f(ae, {
|
|
474
|
-
max: w.max,
|
|
475
|
-
min: w.min,
|
|
476
|
-
"model-value": m.value,
|
|
477
|
-
picker: "month",
|
|
478
|
-
"onUpdate:modelValue": l[3] || (l[3] = (I) => u("right", I))
|
|
479
|
-
}, null, 8, ["max", "min", "model-value"]),
|
|
480
|
-
f(ae, {
|
|
481
|
-
max: w.max,
|
|
482
|
-
min: w.min,
|
|
483
|
-
"model-value": m.value,
|
|
484
|
-
picker: "year",
|
|
485
|
-
"onUpdate:modelValue": l[4] || (l[4] = (I) => u("right", I))
|
|
486
|
-
}, null, 8, ["max", "min", "model-value"])
|
|
487
|
-
]),
|
|
488
|
-
f(p, {
|
|
489
|
-
outline: !1,
|
|
490
|
-
class: "cursor-pointer select-none",
|
|
491
|
-
color: "#1C1C1E",
|
|
492
|
-
name: "chevron_right",
|
|
493
|
-
size: "md",
|
|
494
|
-
onClick: l[5] || (l[5] = () => u("left", s.value.add(1, "month")))
|
|
495
|
-
})
|
|
496
|
-
]),
|
|
497
|
-
f(ve, {
|
|
498
|
-
"day-cell-class": {
|
|
499
|
-
status: {
|
|
500
|
-
isSelected: (I) => I.isSame(h.value, "date")
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
days: S.value,
|
|
504
|
-
"on-day-click": (I) => J(I.date)
|
|
505
|
-
}, null, 8, ["day-cell-class", "days", "on-day-click"])
|
|
506
|
-
])
|
|
507
|
-
])
|
|
508
|
-
]),
|
|
509
|
-
f(x, {
|
|
510
|
-
"model-value": r.value ?? {
|
|
511
|
-
hours: 0,
|
|
512
|
-
minutes: 0,
|
|
513
|
-
period: "AM"
|
|
514
|
-
/* AM */
|
|
515
|
-
},
|
|
516
|
-
"onUpdate:modelValue": l[6] || (l[6] = (I) => r.value = I)
|
|
517
|
-
}, null, 8, ["model-value"]),
|
|
518
|
-
i("div", bt, [
|
|
519
|
-
f(A, {
|
|
520
|
-
label: d(n)("common.cancel"),
|
|
521
|
-
size: "md",
|
|
522
|
-
variant: "tertiary",
|
|
523
|
-
onClick: c
|
|
524
|
-
}, null, 8, ["label"]),
|
|
525
|
-
f(A, {
|
|
526
|
-
disabled: !h.value,
|
|
527
|
-
label: d(n)("common.confirm"),
|
|
528
|
-
size: "md",
|
|
529
|
-
variant: "primary",
|
|
530
|
-
onClick: a
|
|
531
|
-
}, null, 8, ["disabled", "label"])
|
|
532
|
-
])
|
|
533
|
-
])
|
|
534
|
-
]),
|
|
535
|
-
_: 1
|
|
536
|
-
}, 8, ["show-popover", "z-index"]);
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
}), yt = { class: "container" }, kt = /* @__PURE__ */ W({
|
|
540
|
-
__name: "ProgressBar",
|
|
541
|
-
props: {
|
|
542
|
-
bgcolor: {},
|
|
543
|
-
completed: {}
|
|
544
|
-
},
|
|
545
|
-
setup(B) {
|
|
546
|
-
const F = B, n = R(() => ({
|
|
547
|
-
height: "100%",
|
|
548
|
-
width: `${F.completed ?? 0}%`,
|
|
549
|
-
backgroundColor: F.bgcolor,
|
|
550
|
-
transition: "width 1s ease-in-out",
|
|
551
|
-
borderRadius: "inherit",
|
|
552
|
-
textAlign: "right"
|
|
553
|
-
}));
|
|
554
|
-
return (b, o) => (g(), M("div", yt, [
|
|
555
|
-
i("div", {
|
|
556
|
-
style: Ve(n.value)
|
|
557
|
-
}, null, 4)
|
|
558
|
-
]));
|
|
559
|
-
}
|
|
560
|
-
}), Ct = /* @__PURE__ */ ge(kt, [["__scopeId", "data-v-709d7500"]]), wt = {
|
|
561
|
-
class: "flex items-center gap-24"
|
|
562
|
-
}, xt = {
|
|
563
|
-
class: "fm-typo-en-title-md-600"
|
|
564
|
-
}, St = /* @__PURE__ */ W({
|
|
565
|
-
__name: "PublishProgressView",
|
|
566
|
-
props: {
|
|
567
|
-
progress: {
|
|
568
|
-
type: Number,
|
|
569
|
-
required: !1
|
|
570
|
-
},
|
|
571
|
-
restaurants: {
|
|
572
|
-
type: Array,
|
|
573
|
-
required: !0
|
|
574
|
-
}
|
|
575
|
-
},
|
|
576
|
-
emits: ["publishMenu"],
|
|
577
|
-
setup(B, {
|
|
578
|
-
expose: F,
|
|
579
|
-
emit: n
|
|
580
|
-
}) {
|
|
581
|
-
const {
|
|
582
|
-
t: b
|
|
583
|
-
} = Z(), o = ce(), k = B, r = {
|
|
584
|
-
[q.F_PUBLISH_JOB_STATUS.Enum.PENDING]: {
|
|
585
|
-
label: "Pending",
|
|
586
|
-
textColor: "text-fm-color-neutral-gray-300",
|
|
587
|
-
backgroundColor: "#E0E0DE"
|
|
588
|
-
},
|
|
589
|
-
[q.F_PUBLISH_JOB_STATUS.Enum.RUNNING]: {
|
|
590
|
-
label: "Running",
|
|
591
|
-
textColor: "text-fm-color-system-warning-300",
|
|
592
|
-
backgroundColor: "#FFB800"
|
|
593
|
-
},
|
|
594
|
-
[q.F_PUBLISH_JOB_STATUS.Enum.COMPLETED]: {
|
|
595
|
-
label: "Completed",
|
|
596
|
-
textColor: "text-fm-color-system-success-300",
|
|
597
|
-
backgroundColor: "#34C759"
|
|
598
|
-
},
|
|
599
|
-
[q.F_PUBLISH_JOB_STATUS.Enum.FAILED]: {
|
|
600
|
-
label: "Failed",
|
|
601
|
-
textColor: "text-fm-color-system-error-300",
|
|
602
|
-
backgroundColor: "#FF3B30"
|
|
603
|
-
}
|
|
604
|
-
}, h = _e(), e = P(!1), C = (l) => {
|
|
605
|
-
typeof l == "boolean" ? e.value = l : e.value = !e.value;
|
|
606
|
-
};
|
|
607
|
-
F({
|
|
608
|
-
show: e,
|
|
609
|
-
trigger: C
|
|
610
|
-
});
|
|
611
|
-
const a = n, c = R(() => h.state.nextSchedulerPublish ?? {}), _ = R(() => Object.entries(c.value).map(([p, x]) => {
|
|
612
|
-
const A = h.runningPublishJob, D = x.restaurants ? x.restaurants.length : 0;
|
|
613
|
-
return {
|
|
614
|
-
date: new Date(p).toLocaleString(),
|
|
615
|
-
total_restaurants: `${D} restaurants`,
|
|
616
|
-
selectedRestaurantIds: x.restaurants || [],
|
|
617
|
-
status: x.status,
|
|
618
|
-
progress: A === p ? k.progress ?? 0 : 0
|
|
619
|
-
// Only apply progress to the running job's row
|
|
620
|
-
};
|
|
621
|
-
})), s = P([]), m = P(null), u = P(null), y = [{
|
|
622
|
-
accessorKey: "date",
|
|
623
|
-
header: "Date",
|
|
624
|
-
cell: ({
|
|
625
|
-
row: l
|
|
626
|
-
}) => {
|
|
627
|
-
if (l.original.date === "new") {
|
|
628
|
-
if (m.value !== null)
|
|
629
|
-
return new Date(m.value).toLocaleString();
|
|
630
|
-
const x = z(Date.now()).toISOString();
|
|
631
|
-
return T(gt, {
|
|
632
|
-
class: "flex h-full items-center",
|
|
633
|
-
modelValue: x,
|
|
634
|
-
"onUpdate:schedulerTime": (A) => {
|
|
635
|
-
m.value = A;
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
return l.original.date;
|
|
640
|
-
}
|
|
641
|
-
}, {
|
|
642
|
-
accessorKey: "total_restaurants",
|
|
643
|
-
header: "Total restaurants",
|
|
644
|
-
cell: ({
|
|
645
|
-
row: l
|
|
646
|
-
}) => l.original.date === "new" ? T(tt, {
|
|
647
|
-
restaurants: k.restaurants,
|
|
648
|
-
"onUpdate:modelValue": (x) => {
|
|
649
|
-
s.value = x;
|
|
650
|
-
}
|
|
651
|
-
}) : T("div", {
|
|
652
|
-
class: "flex items-center justify-between"
|
|
653
|
-
}, [T("p", {}, l.original.total_restaurants), T(X.FmMenu, {}, {
|
|
654
|
-
"menu-button": () => T(X.FmIcon, {
|
|
655
|
-
name: "info",
|
|
656
|
-
class: "text-fm-color-neutral-gray-300 cursor-pointer"
|
|
657
|
-
}),
|
|
658
|
-
default: () => w(l.original.selectedRestaurantIds).map((x) => T(X.FmMenuItem, {
|
|
659
|
-
key: x,
|
|
660
|
-
label: x
|
|
661
|
-
}))
|
|
662
|
-
})])
|
|
663
|
-
}, {
|
|
664
|
-
accessorKey: "progress",
|
|
665
|
-
header: "Progress",
|
|
666
|
-
cell: ({
|
|
667
|
-
row: l
|
|
668
|
-
}) => {
|
|
669
|
-
const p = l.original.status;
|
|
670
|
-
return l.original.date === "new" ? T("div", {
|
|
671
|
-
class: "flex justify-end items-center gap-8"
|
|
672
|
-
}, [T(X.FmButton, {
|
|
673
|
-
variant: "tertiary",
|
|
674
|
-
prependIcon: "close",
|
|
675
|
-
textColor: "system-error-300",
|
|
676
|
-
onClick: () => {
|
|
677
|
-
m.value = null, S.value = null, u.value = null;
|
|
678
|
-
}
|
|
679
|
-
}), T(X.FmButton, {
|
|
680
|
-
variant: "tertiary",
|
|
681
|
-
prependIcon: "check",
|
|
682
|
-
textColor: "system-success-300",
|
|
683
|
-
onClick: async () => {
|
|
684
|
-
if (!m.value || s.value.length === 0) {
|
|
685
|
-
u.value = !1, o.open({
|
|
686
|
-
type: "error",
|
|
687
|
-
message: "Please select date and restaurants to schedule publish."
|
|
688
|
-
});
|
|
689
|
-
return;
|
|
690
|
-
} else
|
|
691
|
-
u.value = !0, o.open({
|
|
692
|
-
type: "success",
|
|
693
|
-
message: "Schedule publish added successfully."
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
})]) : T("div", {
|
|
697
|
-
class: "flex justify-between items-center gap-32"
|
|
698
|
-
}, [T("div", {
|
|
699
|
-
class: "flex flex-col w-full gap-4"
|
|
700
|
-
}, [T("div", {
|
|
701
|
-
class: "flex items-center gap-8"
|
|
702
|
-
}, [T("p", {
|
|
703
|
-
class: `fm-typo-en-body-md-400 ${r[p].textColor}`
|
|
704
|
-
}, r[p].label), ...p === q.F_PUBLISH_JOB_STATUS.Enum.RUNNING ? [T("p", {
|
|
705
|
-
class: `fm-typo-en-body-md-400 ${r[p].textColor}`
|
|
706
|
-
}, `(${l.original.progress}/${l.original.total_restaurants})`)] : []]), T(Ct, {
|
|
707
|
-
bgcolor: r[p].backgroundColor,
|
|
708
|
-
completed: p === q.F_PUBLISH_JOB_STATUS.Enum.PENDING ? 0 : p === q.F_PUBLISH_JOB_STATUS.Enum.RUNNING ? Math.floor((l.original.progress ?? 0) / parseInt(l.original.total_restaurants) * 100) : (p === q.F_PUBLISH_JOB_STATUS.Enum.COMPLETED, 100)
|
|
709
|
-
})])]);
|
|
710
|
-
}
|
|
711
|
-
}];
|
|
712
|
-
ie(async () => {
|
|
713
|
-
await h.getNextSchedulerPublish();
|
|
714
|
-
});
|
|
715
|
-
const S = P(null);
|
|
716
|
-
function O() {
|
|
717
|
-
u.value = !1, S.value = {
|
|
718
|
-
date: "new",
|
|
719
|
-
restaurantsIds: []
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
de(u, async (l) => {
|
|
723
|
-
l && (a("publishMenu", {
|
|
724
|
-
schedulerTime: m.value,
|
|
725
|
-
restaurantIds: s.value
|
|
726
|
-
}), await h.getNextSchedulerPublish(), m.value = null, s.value = [], u.value = !1, S.value = null, u.value = null);
|
|
727
|
-
});
|
|
728
|
-
const J = be(() => u.value !== null && u.value === !1, () => {
|
|
729
|
-
e.value = !1, S.value = null, m.value = null, s.value = [], u.value = null;
|
|
730
|
-
});
|
|
731
|
-
function w(l) {
|
|
732
|
-
return k.restaurants.filter((p) => l.includes(p._id)).map((p) => p.name);
|
|
733
|
-
}
|
|
734
|
-
return (l, p) => {
|
|
735
|
-
const x = U("FmButton"), A = U("FmTable"), D = U("FmSideSheet");
|
|
736
|
-
return g(), M(H, null, [Ie(l.$slots, "default", {
|
|
737
|
-
trigger: C
|
|
738
|
-
}), f(D, {
|
|
739
|
-
modelValue: e.value,
|
|
740
|
-
"onUpdate:modelValue": p[1] || (p[1] = (I) => e.value = I),
|
|
741
|
-
"close-button": !1,
|
|
742
|
-
"max-width": 800,
|
|
743
|
-
"onOn:clickedAway": d(J)
|
|
744
|
-
}, {
|
|
745
|
-
"side-sheet-header": E(() => [i("div", wt, [f(x, {
|
|
746
|
-
variant: d(fe).Tertiary,
|
|
747
|
-
"prepend-icon": "arrow_back",
|
|
748
|
-
onClick: te(d(J), ["stop"])
|
|
749
|
-
}, null, 8, ["variant", "onClick"]), i("p", xt, L(d(b)("menu.publish.actions.publish_progress")), 1)])]),
|
|
750
|
-
default: E(() => [i("div", null, [f(A, {
|
|
751
|
-
class: "pb-8",
|
|
752
|
-
"row-data": [..._.value, S.value].filter(Boolean),
|
|
753
|
-
"column-defs": y,
|
|
754
|
-
"shrink-at": !1,
|
|
755
|
-
pageSize: _.value.length + (S.value ? 1 : 0),
|
|
756
|
-
"hide-footer": ""
|
|
757
|
-
}, null, 8, ["row-data", "pageSize"]), d(h).state.featureFlags.schedulerPublish && !S.value ? (g(), j(x, {
|
|
758
|
-
key: 0,
|
|
759
|
-
variant: d(fe).Plain,
|
|
760
|
-
"prepend-icon": "add",
|
|
761
|
-
label: d(b)("menu.publish.actions.add_scheduler_publish"),
|
|
762
|
-
onClick: p[0] || (p[0] = () => O())
|
|
763
|
-
}, null, 8, ["variant", "label"])) : Q("", !0)])]),
|
|
764
|
-
_: 1
|
|
765
|
-
}, 8, ["modelValue", "onOn:clickedAway"])], 64);
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
}), Ft = { class: "fm-typo-en-title-md-600" }, Vt = { class: "mt-40" }, It = { class: "fm-typo-en-title-sm-600" }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Mt = { class: "flex gap-8 items-center justify-start" }, $t = /* @__PURE__ */ W({
|
|
769
|
-
__name: "UpdateCatalogDialog",
|
|
770
|
-
props: {
|
|
771
|
-
catalogs: {
|
|
772
|
-
type: Array,
|
|
773
|
-
required: !0
|
|
774
|
-
}
|
|
775
|
-
},
|
|
776
|
-
emits: ["onComplete"],
|
|
777
|
-
setup(B, { expose: F, emit: n }) {
|
|
778
|
-
const { t: b } = Z(), o = B;
|
|
779
|
-
F({
|
|
780
|
-
show: _,
|
|
781
|
-
hide: s
|
|
782
|
-
});
|
|
783
|
-
const k = n;
|
|
784
|
-
function r() {
|
|
785
|
-
return {
|
|
786
|
-
restaurantId: "",
|
|
787
|
-
catalogId: void 0,
|
|
788
|
-
takeawayCatalog: void 0,
|
|
789
|
-
pickupCatalog: null,
|
|
790
|
-
additionalCatalogs: []
|
|
791
|
-
};
|
|
792
|
-
}
|
|
793
|
-
const h = R(() => [
|
|
794
|
-
{
|
|
795
|
-
label: b("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
796
|
-
value: null
|
|
797
|
-
},
|
|
798
|
-
...o.catalogs.map((y) => ({
|
|
799
|
-
label: y.name,
|
|
800
|
-
value: y._id
|
|
801
|
-
}))
|
|
802
|
-
]), e = R(() => [
|
|
803
|
-
{
|
|
804
|
-
label: b("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
805
|
-
value: null
|
|
806
|
-
},
|
|
807
|
-
...o.catalogs.map((y) => ({
|
|
808
|
-
label: y.name,
|
|
809
|
-
value: y._id
|
|
810
|
-
}))
|
|
811
|
-
]), C = P(r()), a = P(!1), c = P(void 0);
|
|
812
|
-
function _(y) {
|
|
813
|
-
c.value = y ? pe(y) : r(), C.value = pe(c.value), a.value = !0;
|
|
814
|
-
}
|
|
815
|
-
function s() {
|
|
816
|
-
a.value = !1;
|
|
817
|
-
}
|
|
818
|
-
const m = be(
|
|
819
|
-
() => !Te.isEqual(c.value, C.value),
|
|
820
|
-
() => {
|
|
821
|
-
s();
|
|
822
|
-
}
|
|
823
|
-
);
|
|
824
|
-
function u() {
|
|
825
|
-
s(), k("onComplete", C.value);
|
|
826
|
-
}
|
|
827
|
-
return (y, S) => {
|
|
828
|
-
const O = U("FmSelect"), J = U("FmCheckbox"), w = U("FmButton"), l = U("FmSideSheet");
|
|
829
|
-
return g(), j(l, {
|
|
830
|
-
modelValue: a.value,
|
|
831
|
-
"onUpdate:modelValue": S[5] || (S[5] = (p) => a.value = p),
|
|
832
|
-
"max-width": 560,
|
|
833
|
-
"onOn:clickedAway": d(m)
|
|
834
|
-
}, {
|
|
835
|
-
"side-sheet-header": E(() => [
|
|
836
|
-
i("span", Ft, L(d(b)("menu.publish.update_catalog_dialog.title")), 1)
|
|
837
|
-
]),
|
|
838
|
-
"side-sheet-footer": E(() => [
|
|
839
|
-
i("div", Mt, [
|
|
840
|
-
f(w, {
|
|
841
|
-
label: d(b)("menu.publish.update_catalog_dialog.actions.update"),
|
|
842
|
-
size: "lg",
|
|
843
|
-
variant: "primary",
|
|
844
|
-
onClick: S[4] || (S[4] = () => u())
|
|
845
|
-
}, null, 8, ["label"]),
|
|
846
|
-
f(w, {
|
|
847
|
-
label: d(b)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
848
|
-
size: "lg",
|
|
849
|
-
variant: "tertiary",
|
|
850
|
-
onClick: s
|
|
851
|
-
}, null, 8, ["label"])
|
|
852
|
-
])
|
|
853
|
-
]),
|
|
854
|
-
default: E(() => [
|
|
855
|
-
f(O, {
|
|
856
|
-
modelValue: C.value.catalogId,
|
|
857
|
-
"onUpdate:modelValue": S[0] || (S[0] = (p) => C.value.catalogId = p),
|
|
858
|
-
items: h.value,
|
|
859
|
-
class: "mb-24",
|
|
860
|
-
label: d(b)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
861
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
862
|
-
f(O, {
|
|
863
|
-
modelValue: C.value.takeawayCatalog,
|
|
864
|
-
"onUpdate:modelValue": S[1] || (S[1] = (p) => C.value.takeawayCatalog = p),
|
|
865
|
-
items: e.value,
|
|
866
|
-
class: "mb-24",
|
|
867
|
-
label: d(b)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
868
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
869
|
-
f(O, {
|
|
870
|
-
modelValue: C.value.pickupCatalog,
|
|
871
|
-
"onUpdate:modelValue": S[2] || (S[2] = (p) => C.value.pickupCatalog = p),
|
|
872
|
-
items: e.value,
|
|
873
|
-
label: d(b)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
874
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
875
|
-
i("div", Vt, [
|
|
876
|
-
i("div", It, L(d(b)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
877
|
-
i("div", Pt, L(d(b)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
878
|
-
(g(!0), M(H, null, G(B.catalogs, (p) => (g(), M("div", {
|
|
879
|
-
key: p._id
|
|
880
|
-
}, [
|
|
881
|
-
f(J, {
|
|
882
|
-
modelValue: C.value.additionalCatalogs,
|
|
883
|
-
"onUpdate:modelValue": S[3] || (S[3] = (x) => C.value.additionalCatalogs = x),
|
|
884
|
-
label: p.name,
|
|
885
|
-
value: p._id
|
|
886
|
-
}, null, 8, ["modelValue", "label", "value"])
|
|
887
|
-
]))), 128))
|
|
888
|
-
])
|
|
889
|
-
]),
|
|
890
|
-
_: 1
|
|
891
|
-
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
892
|
-
};
|
|
893
|
-
}
|
|
894
|
-
}), Ut = {
|
|
895
|
-
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
896
|
-
}, Bt = {
|
|
897
|
-
class: "flex items-center xs:mb-8 mb-24"
|
|
898
|
-
}, At = {
|
|
899
|
-
class: "mr-8"
|
|
900
|
-
}, Dt = {
|
|
901
|
-
class: "fm-typo-en-title-md-600"
|
|
902
|
-
}, Tt = {
|
|
903
|
-
class: "xs:hidden mr-16"
|
|
904
|
-
}, Rt = {
|
|
905
|
-
class: "xs:hidden mr-16"
|
|
906
|
-
}, Ot = {
|
|
907
|
-
class: "xs:hidden"
|
|
908
|
-
}, Nt = {
|
|
909
|
-
class: "pb-8 flex justify-between items-start xs:flex-col xs:items-stretch gap-8"
|
|
910
|
-
}, Et = {
|
|
911
|
-
class: "grow flex flex-col gap-4"
|
|
912
|
-
}, Lt = {
|
|
913
|
-
class: "flex gap-8 items-center"
|
|
914
|
-
}, zt = {
|
|
915
|
-
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
916
|
-
}, Ht = {
|
|
917
|
-
class: "space-y-4"
|
|
918
|
-
}, Jt = {
|
|
919
|
-
class: "fm-typo-en-body-lg-600"
|
|
920
|
-
}, Yt = {
|
|
921
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
922
|
-
}, Kt = {
|
|
923
|
-
class: "flex gap-8"
|
|
924
|
-
}, jt = {
|
|
925
|
-
class: "xs:block hidden fixed bottom-72 right-16"
|
|
926
|
-
}, oa = /* @__PURE__ */ W({
|
|
927
|
-
__name: "Publish",
|
|
928
|
-
setup(B) {
|
|
929
|
-
const F = Me(), {
|
|
930
|
-
t: n
|
|
931
|
-
} = Z(), b = ({
|
|
932
|
-
row: t
|
|
933
|
-
}) => {
|
|
934
|
-
const v = t.status === "latest";
|
|
935
|
-
return f(He, {
|
|
936
|
-
label: n(v ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
937
|
-
variant: v ? "success" : "warning"
|
|
938
|
-
}, null);
|
|
939
|
-
}, o = P({}), k = [{
|
|
940
|
-
accessorKey: "name",
|
|
941
|
-
header: () => n("menu.publish.table.columns.restaurant"),
|
|
942
|
-
cell: (t) => t.getValue(),
|
|
943
|
-
enableSorting: !0
|
|
944
|
-
}, {
|
|
945
|
-
accessorKey: "catalog",
|
|
946
|
-
header: () => n("menu.publish.table.columns.default"),
|
|
947
|
-
enableSorting: !1,
|
|
948
|
-
cell: (t) => t.getValue().default
|
|
949
|
-
}, {
|
|
950
|
-
accessorKey: "catalog",
|
|
951
|
-
header: () => n("menu.publish.table.columns.pos_takeaway"),
|
|
952
|
-
enableSorting: !1,
|
|
953
|
-
cell: (t) => t.getValue().takeaway
|
|
954
|
-
}, {
|
|
955
|
-
accessorKey: "catalog",
|
|
956
|
-
header: () => n("menu.publish.table.columns.pickup"),
|
|
957
|
-
enableSorting: !1,
|
|
958
|
-
cell: (t) => t.getValue().pickup
|
|
959
|
-
}, {
|
|
960
|
-
accessorKey: "updatedAt",
|
|
961
|
-
header: () => n("menu.publish.table.columns.version"),
|
|
962
|
-
enableSorting: !1,
|
|
963
|
-
cell: (t) => {
|
|
964
|
-
const v = t.getValue();
|
|
965
|
-
return s(v);
|
|
966
|
-
}
|
|
967
|
-
}, {
|
|
968
|
-
accessorKey: "status",
|
|
969
|
-
header: () => n("menu.common.labels.status"),
|
|
970
|
-
enableSorting: !1,
|
|
971
|
-
cell: (t) => f(b, {
|
|
972
|
-
row: t.row.original
|
|
973
|
-
}, null)
|
|
974
|
-
}, {
|
|
975
|
-
accessorKey: "_id",
|
|
976
|
-
header: "",
|
|
977
|
-
size: 52,
|
|
978
|
-
enableSorting: !1,
|
|
979
|
-
cell: (t) => {
|
|
980
|
-
const v = t.row.original;
|
|
981
|
-
return T("div", {
|
|
982
|
-
class: "flex justify-end gap-8"
|
|
983
|
-
}, [a.value && v.revertConfig ? Ke(T(X.FmButton, {
|
|
984
|
-
prependIcon: "undo",
|
|
985
|
-
variant: "secondary",
|
|
986
|
-
onClick: te(async () => {
|
|
987
|
-
await c(t.row.original);
|
|
988
|
-
}, ["stop", "prevent"])
|
|
989
|
-
}), n("menu.publish.actions.revert")) : null, T(X.FmButton, {
|
|
990
|
-
label: n("menu.publish.actions.publish"),
|
|
991
|
-
icon: "ios_share",
|
|
992
|
-
variant: "secondary",
|
|
993
|
-
onClick: te(async () => {
|
|
994
|
-
const $ = S(t.row.original);
|
|
995
|
-
await l($);
|
|
996
|
-
}, ["stop", "prevent"])
|
|
997
|
-
})]);
|
|
998
|
-
},
|
|
999
|
-
meta: {
|
|
1000
|
-
width: "150px"
|
|
1001
|
-
}
|
|
1002
|
-
}], r = P(""), h = P(), e = _e(), C = ze(), a = R(() => e.version !== q.F_MENU_VERSION.enum.v3);
|
|
1003
|
-
async function c(t) {
|
|
1004
|
-
t.revertConfig && C.open({
|
|
1005
|
-
title: "Revert menu",
|
|
1006
|
-
contentComponent: Xe,
|
|
1007
|
-
contentComponentProps: {
|
|
1008
|
-
restaurant: t
|
|
1009
|
-
},
|
|
1010
|
-
primaryActions: {
|
|
1011
|
-
text: "Revert",
|
|
1012
|
-
close: !0
|
|
1013
|
-
},
|
|
1014
|
-
secondaryActions: {
|
|
1015
|
-
text: "Cancel",
|
|
1016
|
-
close: !0
|
|
1017
|
-
}
|
|
1018
|
-
}).onPrimary(async () => {
|
|
1019
|
-
await w.minor(async () => {
|
|
1020
|
-
await e.revertRestaurantMenu(t._id);
|
|
1021
|
-
}, {
|
|
1022
|
-
customId: t._id,
|
|
1023
|
-
message: `Revert menu of ${t.name}`
|
|
1024
|
-
});
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
const _ = R(() => n("menu.publish.labels.main_version", {
|
|
1028
|
-
version: s(e.state.menu.updatedAt)
|
|
1029
|
-
}));
|
|
1030
|
-
function s(t) {
|
|
1031
|
-
return t ? z(t).format("DD/MM/YYYY hh:mmA") : "";
|
|
1032
|
-
}
|
|
1033
|
-
const m = R(() => e.state.menu.modules.catalog), u = R(() => w.queue.value.some((t) => t.id === e.state.menu._id));
|
|
1034
|
-
function y(t) {
|
|
1035
|
-
var v;
|
|
1036
|
-
return t ? ((v = m.value.find(($) => $._id === t)) == null ? void 0 : v.name) ?? n("menu.publish.labels.catalog.invalid") : n("menu.publish.labels.catalog.main");
|
|
1037
|
-
}
|
|
1038
|
-
function S(t) {
|
|
1039
|
-
return {
|
|
1040
|
-
restaurantId: t._id,
|
|
1041
|
-
catalogId: t.catalogId,
|
|
1042
|
-
takeawayCatalog: t.takeawayCatalog,
|
|
1043
|
-
pickupCatalog: t.pickupCatalog || null,
|
|
1044
|
-
additionalCatalogs: t.additionalCatalogs
|
|
1045
|
-
};
|
|
1046
|
-
}
|
|
1047
|
-
function O(t) {
|
|
1048
|
-
var $;
|
|
1049
|
-
const v = S(t);
|
|
1050
|
-
($ = h.value) == null || $.show(v);
|
|
1051
|
-
}
|
|
1052
|
-
const J = ce(), w = he(J);
|
|
1053
|
-
async function l(t) {
|
|
1054
|
-
var $;
|
|
1055
|
-
const v = ($ = x.value.find((Y) => Y._id === t.restaurantId)) == null ? void 0 : $.name;
|
|
1056
|
-
await w.minor(async () => await e.publishMenu(t), {
|
|
1057
|
-
customId: e.state.menu._id,
|
|
1058
|
-
message: `Publishing menu for ${v}`,
|
|
1059
|
-
successMessage: `Published to ${v}`
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
const p = P(null), x = R(() => {
|
|
1063
|
-
const t = r.value.toLowerCase(), v = e.state.menu.updatedAt;
|
|
1064
|
-
return e.state.restaurants.filter(($) => {
|
|
1065
|
-
var Y;
|
|
1066
|
-
return !p.value || ((Y = p.value) == null ? void 0 : Y.includes($._id));
|
|
1067
|
-
}).map(($) => ({
|
|
1068
|
-
...$,
|
|
1069
|
-
catalog: {
|
|
1070
|
-
default: y($.catalogId),
|
|
1071
|
-
takeaway: y($.takeawayCatalog),
|
|
1072
|
-
pickup: y($.pickupCatalog)
|
|
1073
|
-
},
|
|
1074
|
-
status: v === $.updatedAt ? "latest" : "outdated"
|
|
1075
|
-
})).filter(($) => $e($, A.value)).filter(({
|
|
1076
|
-
name: $,
|
|
1077
|
-
catalog: Y
|
|
1078
|
-
}) => t ? $.toLowerCase().includes(t) || Y.default.toLowerCase().includes(t) || Y.takeaway.toLowerCase().includes(t) || Y.pickup.toLowerCase().includes(t) : !0);
|
|
1079
|
-
}), A = P({
|
|
1080
|
-
logic: "AND",
|
|
1081
|
-
rules: []
|
|
1082
|
-
}), D = [{
|
|
1083
|
-
type: "string",
|
|
1084
|
-
key: "status",
|
|
1085
|
-
entity: "menu",
|
|
1086
|
-
values: ["latest", "outdated"]
|
|
1087
|
-
}], I = P(0), N = P(null), ee = P(null), ne = P(null);
|
|
1088
|
-
async function ke() {
|
|
1089
|
-
await w.minor(async () => await e.readRestaurants(), {
|
|
1090
|
-
customId: e.state.menu._id
|
|
1091
|
-
}), await e.getNextSchedulerPublish(), e.runningPublishJob !== null ? N.value === null && (N.value = setInterval(async () => {
|
|
1092
|
-
await oe();
|
|
1093
|
-
}, 3e4)) : (ne.value && (J.close(ne.value), ne.value = null), N.value !== null && (clearInterval(N.value), N.value = null), ee.value = null);
|
|
1094
|
-
}
|
|
1095
|
-
async function se(t) {
|
|
1096
|
-
if (u.value) return;
|
|
1097
|
-
const v = Object.keys(o.value).filter((K) => o.value[K]), $ = v.length === 0 || v.length === x.value.length ? x.value : x.value.filter((K) => v.includes(K._id)), Y = t ? t.restaurantIds.length === e.state.restaurants.length : x.value.length === e.state.restaurants.length && (v.length === 0 || v.length === x.value.length);
|
|
1098
|
-
if (J.open({
|
|
1099
|
-
message: Y ? "Menu publish registered for all restaurants." : `Menu publish registered for ${t != null && t.restaurantIds ? t.restaurantIds.length : $.length} restaurant(s).`,
|
|
1100
|
-
type: "info"
|
|
1101
|
-
}), Y)
|
|
1102
|
-
await e.publishAllMenu(t == null ? void 0 : t.schedulerTime), ee.value = !1;
|
|
1103
|
-
else {
|
|
1104
|
-
const K = (t == null ? void 0 : t.restaurantIds) || $.map((ue) => ue._id);
|
|
1105
|
-
await e.publishMultipleMenu(K, t == null ? void 0 : t.schedulerTime, !1);
|
|
1106
|
-
}
|
|
1107
|
-
ee.value = !1, I.value = await e.getPublishRestaurantsProgress(), N.value !== null && (clearInterval(N.value), N.value = null), N.value = setInterval(async () => {
|
|
1108
|
-
await oe();
|
|
1109
|
-
}, 3e4);
|
|
1110
|
-
}
|
|
1111
|
-
async function oe() {
|
|
1112
|
-
await e.getNextSchedulerPublish(), e.runningPublishJob !== null ? (ee.value = !1, I.value = await e.getPublishRestaurantsProgress()) : (ee.value = !0, N.value !== null && (clearInterval(N.value), N.value = null));
|
|
1113
|
-
}
|
|
1114
|
-
return de(() => I.value, async (t) => {
|
|
1115
|
-
await e.readRestaurants();
|
|
1116
|
-
}), ie(async () => {
|
|
1117
|
-
await e.getNextSchedulerPublish(), N.value === null && (N.value = setInterval(async () => {
|
|
1118
|
-
await oe();
|
|
1119
|
-
}, 3e4));
|
|
1120
|
-
}), Pe(() => {
|
|
1121
|
-
N.value != null && (clearInterval(N.value), N.value = null);
|
|
1122
|
-
}), (t, v) => {
|
|
1123
|
-
const $ = U("FmChip"), Y = U("FmSpacer"), K = U("FmButton"), ue = U("FmBadge"), Ce = U("FmSearch"), we = U("FmTable"), xe = U("FmListItem"), Se = U("FmList");
|
|
1124
|
-
return g(), M(H, null, [i("div", Ut, [i("div", Bt, [i("div", At, [i("div", Dt, L(d(n)("menu.publish.title")), 1), v[9] || (v[9] = i("div", {
|
|
1125
|
-
class: "hidden xs:block fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1126
|
-
}, null, -1))]), f($, {
|
|
1127
|
-
label: _.value,
|
|
1128
|
-
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
1129
|
-
}, null, 8, ["label"]), f(Y), i("div", Tt, [f(K, {
|
|
1130
|
-
disabled: u.value,
|
|
1131
|
-
label: d(n)("menu.publish.actions.refresh"),
|
|
1132
|
-
variant: "secondary",
|
|
1133
|
-
onClick: v[0] || (v[0] = () => ke())
|
|
1134
|
-
}, null, 8, ["disabled", "label"])]), i("div", Rt, [f(St, {
|
|
1135
|
-
progress: I.value,
|
|
1136
|
-
restaurants: x.value,
|
|
1137
|
-
onPublishMenu: v[1] || (v[1] = (V) => se(V))
|
|
1138
|
-
}, {
|
|
1139
|
-
default: E(({
|
|
1140
|
-
trigger: V
|
|
1141
|
-
}) => [d(e).runningPublishJob !== null ? (g(), j(ue, {
|
|
1142
|
-
key: 0,
|
|
1143
|
-
variant: "critical",
|
|
1144
|
-
value: 1
|
|
1145
|
-
}, {
|
|
1146
|
-
default: E(() => [f(K, {
|
|
1147
|
-
variant: "secondary",
|
|
1148
|
-
disabled: u.value,
|
|
1149
|
-
label: d(n)("menu.publish.actions.publish_progress"),
|
|
1150
|
-
onClick: V
|
|
1151
|
-
}, null, 8, ["disabled", "label", "onClick"])]),
|
|
1152
|
-
_: 2
|
|
1153
|
-
}, 1024)) : (g(), j(K, {
|
|
1154
|
-
key: 1,
|
|
1155
|
-
variant: "secondary",
|
|
1156
|
-
disabled: u.value,
|
|
1157
|
-
label: d(n)("menu.publish.actions.publish_progress"),
|
|
1158
|
-
onClick: V
|
|
1159
|
-
}, null, 8, ["disabled", "label", "onClick"]))]),
|
|
1160
|
-
_: 1
|
|
1161
|
-
}, 8, ["progress", "restaurants"])]), i("div", Ot, [f(K, {
|
|
1162
|
-
disabled: u.value,
|
|
1163
|
-
icon: "ios_share",
|
|
1164
|
-
label: d(n)("menu.publish.actions.publish_all"),
|
|
1165
|
-
variant: "primary",
|
|
1166
|
-
onClick: v[2] || (v[2] = () => se())
|
|
1167
|
-
}, null, 8, ["disabled", "label"])])]), i("div", Nt, [f(d(Ne), {
|
|
1168
|
-
multiple: "",
|
|
1169
|
-
modelValue: p.value,
|
|
1170
|
-
"onUpdate:modelValue": v[4] || (v[4] = (V) => p.value = V)
|
|
1171
|
-
}, {
|
|
1172
|
-
"append-right": E(() => [f(d(Ue), {
|
|
1173
|
-
modelValue: A.value,
|
|
1174
|
-
"onUpdate:modelValue": v[3] || (v[3] = (V) => A.value = V),
|
|
1175
|
-
attributes: D
|
|
1176
|
-
}, null, 8, ["modelValue"])]),
|
|
1177
|
-
_: 1
|
|
1178
|
-
}, 8, ["modelValue"]), f(Ce, {
|
|
1179
|
-
modelValue: r.value,
|
|
1180
|
-
"onUpdate:modelValue": v[5] || (v[5] = (V) => r.value = V),
|
|
1181
|
-
autofocus: "",
|
|
1182
|
-
class: "w-[320px] xs:w-full",
|
|
1183
|
-
placeholder: d(n)("menu.publish.table.search.placeholder")
|
|
1184
|
-
}, null, 8, ["modelValue", "placeholder"])]), x.value.length > 0 ? (g(), M(H, {
|
|
1185
|
-
key: 0
|
|
1186
|
-
}, [f(Je, {
|
|
1187
|
-
class: "xs:hidden block"
|
|
1188
|
-
}, {
|
|
1189
|
-
default: E(() => [f(we, {
|
|
1190
|
-
modelValue: o.value,
|
|
1191
|
-
"onUpdate:modelValue": v[6] || (v[6] = (V) => o.value = V),
|
|
1192
|
-
"get-row-id": (V) => V._id,
|
|
1193
|
-
"column-defs": k,
|
|
1194
|
-
loading: u.value,
|
|
1195
|
-
"page-size": x.value.length,
|
|
1196
|
-
"row-data": x.value,
|
|
1197
|
-
shrinkAt: !1,
|
|
1198
|
-
virtual: !0,
|
|
1199
|
-
selection: "multiple",
|
|
1200
|
-
"hide-footer": "",
|
|
1201
|
-
"pin-header-row": "",
|
|
1202
|
-
onRowClick: v[7] || (v[7] = (V) => O(V.original))
|
|
1203
|
-
}, null, 8, ["modelValue", "get-row-id", "loading", "page-size", "row-data"])]),
|
|
1204
|
-
_: 1
|
|
1205
|
-
}), f(Se, {
|
|
1206
|
-
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
1207
|
-
separator: ""
|
|
1208
|
-
}, {
|
|
1209
|
-
default: E(() => [(g(!0), M(H, null, G(x.value, (V) => (g(), j(xe, {
|
|
1210
|
-
key: V._id,
|
|
1211
|
-
label: V.name,
|
|
1212
|
-
style: {
|
|
1213
|
-
padding: "12px 0 !important"
|
|
1214
|
-
},
|
|
1215
|
-
onClick: () => O(V)
|
|
1216
|
-
}, {
|
|
1217
|
-
default: E(() => [i("div", Et, [i("div", Lt, [i("div", zt, L(s(V.updatedAt)), 1), f(b, {
|
|
1218
|
-
row: V
|
|
1219
|
-
}, null, 8, ["row"])]), i("div", Ht, [i("div", Jt, L(V.name), 1), i("div", Yt, [i("div", null, "Default: " + L(V.catalog.default), 1), i("div", null, "POS takeaway: " + L(V.catalog.takeaway), 1), i("div", null, "Pickup: " + L(V.catalog.pickup), 1)])])]), i("div", Kt, [a.value && V.revertConfig ? (g(), j(K, {
|
|
1220
|
-
key: 0,
|
|
1221
|
-
disabled: u.value,
|
|
1222
|
-
icon: "undo",
|
|
1223
|
-
variant: "tertiary",
|
|
1224
|
-
onClick: te(() => c(V), ["stop"])
|
|
1225
|
-
}, null, 8, ["disabled", "onClick"])) : Q("", !0), f(K, {
|
|
1226
|
-
disabled: u.value,
|
|
1227
|
-
icon: "ios_share",
|
|
1228
|
-
variant: "tertiary",
|
|
1229
|
-
onClick: te(() => l(S(V)), ["stop"])
|
|
1230
|
-
}, null, 8, ["disabled", "onClick"])])]),
|
|
1231
|
-
_: 2
|
|
1232
|
-
}, 1032, ["label", "onClick"]))), 128))]),
|
|
1233
|
-
_: 1
|
|
1234
|
-
})], 64)) : (g(), j(d(Re), {
|
|
1235
|
-
key: 1,
|
|
1236
|
-
title: d(n)("menu.publish.empty.title"),
|
|
1237
|
-
subtitle: d(n)("menu.publish.empty.subtitle"),
|
|
1238
|
-
action: {
|
|
1239
|
-
text: d(n)("menu.publish.empty.action"),
|
|
1240
|
-
icon: "add",
|
|
1241
|
-
callback: () => {
|
|
1242
|
-
d(F).push({
|
|
1243
|
-
name: "$settings-my-business"
|
|
1244
|
-
});
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
}, null, 8, ["title", "subtitle", "action"]))]), i("div", jt, [f(K, {
|
|
1248
|
-
disabled: u.value,
|
|
1249
|
-
icon: "ios_share",
|
|
1250
|
-
label: d(n)("menu.publish.actions.publish_all"),
|
|
1251
|
-
variant: "fab",
|
|
1252
|
-
onClick: v[8] || (v[8] = () => se())
|
|
1253
|
-
}, null, 8, ["disabled", "label"])]), f($t, {
|
|
1254
|
-
ref_key: "updateCatalogDialogRef",
|
|
1255
|
-
ref: h,
|
|
1256
|
-
catalogs: m.value,
|
|
1257
|
-
onOnComplete: l
|
|
1258
|
-
}, null, 8, ["catalogs"])], 64);
|
|
1259
|
-
};
|
|
1260
|
-
}
|
|
1261
|
-
});
|
|
1262
|
-
export {
|
|
1263
|
-
oa as default
|
|
1264
|
-
};
|