@feedmepos/mf-menu 0.32.50-dev.1 → 0.32.51-dev
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-fvdXsBmD.js → App-DJ_boY0P.js} +5 -5
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-DH4-Olmt.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BVafiq6l.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-DzROC59N.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CruH5AF9.js} +2 -2
- package/dist/{Catalog-jkEr63nT.js → Catalog-C_7GyzOz.js} +7 -8
- package/dist/{Category-DrwaNYcu.js → Category-B8c8AO0C.js} +4 -4
- package/dist/{Category-B_gO4xPF.js → Category-CJRttg5g.js} +4 -4
- package/dist/{CookingGuide-C33Z5hUV.js → CookingGuide-B-oXAful.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Be7Z3I_Q.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DwwMOoQx.js} +1 -1
- package/dist/{Group-B5T6WfRm.js → Group-DZrcYfeC.js} +3 -3
- package/dist/{Group-BugcY3vS.js → Group-iHKwYfVS.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BAIexmig.js → Group.vue_vue_type_script_setup_true_lang-UrT9_Dv_.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BOQahWyN.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BljvPVAz.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-YS1YynNn.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Cu2_U6gg.js} +7 -7
- package/dist/{Ingredient-DJVD7ZRE.js → Ingredient-EEsIgWLG.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CXFhzaMf.js → InventoryBinding.vue_vue_type_script_setup_true_lang-B_ItCbTf.js} +2 -2
- package/dist/{LinkProductSideSheet-CzpnAdjg.js → LinkProductSideSheet-DwVODI1U.js} +3 -3
- package/dist/{MenuSetting-CkzrUn-g.js → MenuSetting-CP7Vx_cV.js} +6 -6
- package/dist/{OrderPacing-E25vzd0i.js → OrderPacing-Dej0Cp3E.js} +5 -5
- package/dist/{PrintRoute-D_E6EFdK.js → PrintRoute-DOJJ82mH.js} +4 -4
- package/dist/{Product-B65o3iNI.js → Product-BpH2gXii.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DPzs_gu_.js → Product.vue_vue_type_script_setup_true_lang-BhOdWTlM.js} +12 -12
- package/dist/{ProductInternalTools-CK-PGnNo.js → ProductInternalTools-CjoC9z79.js} +5 -5
- package/dist/{Products-Dg1hvUwW.js → Products-BaH1UUlM.js} +44 -44
- package/dist/Publish-D-xjezFx.js +1429 -0
- package/dist/{Recipe-DIF_OoVX.js → Recipe-Dv38pLls.js} +4 -4
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-845QukTh.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-CJwwJ87D.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DjKbPdjk.js → RuleView.vue_vue_type_script_setup_true_lang-a6W_3fVO.js} +2 -2
- package/dist/{Scheduler-Cp16XDHA.js → Scheduler-DEgUjACU.js} +3 -3
- package/dist/{ServingSequence-HG1Uq8jR.js → ServingSequence-C-XRskmz.js} +3 -3
- package/dist/{Setting-BjmlJwG0.js → Setting-C4zIGhS4.js} +5 -5
- package/dist/{Subcategory-COSfYpK6.js → Subcategory-0e7ZQXZl.js} +5 -5
- package/dist/{Takeaway-xH6lMjQI.js → Takeaway-BR6Jm6tq.js} +1 -1
- package/dist/{Takeaway-8UTX6xY6.js → Takeaway-Bk9u-h1u.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DEnn6Uhy.js → Takeaway.vue_vue_type_script_setup_true_lang-DXCVV-UI.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-C12J-MHi.js → Thumbnail.vue_vue_type_script_setup_true_lang-BZRHb8G7.js} +4 -4
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CyAvat5t.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-BrhjUvFq.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-DUfRksjD.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-BKD-EAO3.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-C8RYs2oh.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ch5KY_XM.js} +13 -13
- package/dist/{Unit-B0LxjfWX.js → Unit-BdV3zkYP.js} +2 -2
- package/dist/{Variant-CPBzZOv3.js → Variant-CtcqyPKe.js} +3 -3
- package/dist/{_id_-CM7JtSii.js → _id_-Fo7FbggZ.js} +9 -9
- package/dist/{app-DtexRwSb.js → app-BirB2oNz.js} +1 -1
- package/dist/{app-yVJIrlSz.js → app-DtMGo-8a.js} +32 -32
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/helper/setting/catalogSetting.d.ts +2 -1
- package/dist/assets/{linked-status-CbCxRkaM.js → linked-status-B6SJq-v-.js} +2 -2
- package/dist/assets/{menu-export-BrLAkWSp.js → menu-export-CwiCpw67.js} +2 -2
- package/dist/assets/{override-menu-BrLa8Jm9.js → override-menu-Fx3w0bSY.js} +2 -2
- package/dist/assets/{validate-menu-CsSkhovY.js → validate-menu-BGTp-oO7.js} +2 -2
- package/dist/{catalog-vPinxddm.js → catalog-DtioUeQr.js} +1 -1
- package/dist/{catalogSetting-h7qqtQIw.js → catalogSetting-BRAVGHiH.js} +26 -14
- package/dist/{currency-CcNf-QTk.js → currency-Dntgj8R7.js} +1 -1
- package/dist/{dayjs.min-Cocgeu87.js → dayjs.min-CwKTySXQ.js} +2 -2
- package/dist/{index-CCBv0ODD.js → index-b5UraR94.js} +4 -4
- package/dist/{index-H48-bCoT.js → index-vHMVgpgg.js} +5 -5
- package/dist/{index.vue_vue_type_script_setup_true_lang-BUccfB8b.js → index.vue_vue_type_script_setup_true_lang-CbJ4htzZ.js} +5 -5
- package/dist/{item-BsZG_f4A.js → item-CAdH9ZRb.js} +17 -17
- package/dist/{jszip.min-BnMXGnPr.js → jszip.min-q5-4AKN4.js} +3 -3
- package/dist/{memberPricing-OCuDHRxA.js → memberPricing-BK7Y-pUK.js} +1 -1
- package/dist/{menu-Bw4tAzfN.js → menu-CSDflKWK.js} +1 -1
- package/dist/{menuV2-DI1Os0Vq.js → menuV2-Cf_zeTsx.js} +32 -32
- package/dist/{order_pacing-EeEkEnwJ.js → order_pacing-gM1ob6dp.js} +5 -5
- package/dist/{priceTier-BkoZvNui.js → priceTier-qp7ZHYG1.js} +1 -1
- package/dist/{rules-Ou7rW1c3.js → rules-Bvgey7qo.js} +3 -3
- package/dist/{scheduler-DXQsrkEf.js → scheduler-CLvNHt4g.js} +4 -4
- package/dist/{toExcel-Dngn6umb.js → toExcel-CDs_GgCA.js} +2 -2
- package/dist/{unit-BQ4FpCT5.js → unit-CR4GvsD0.js} +2 -2
- package/package.json +1 -1
- package/dist/Publish-DOZPb_5N.js +0 -1417
package/dist/Publish-DOZPb_5N.js
DELETED
|
@@ -1,1417 +0,0 @@
|
|
|
1
|
-
import { defineComponent as G, ref as I, computed as U, onMounted as ie, resolveComponent as M, createElementBlock as F, openBlock as y, createVNode as h, createElementVNode as f, toDisplayString as E, unref as m, Fragment as j, renderList as W, createBlock as K, watch as de, withCtx as T, h as B, normalizeClass as re, createCommentVNode as Q, createTextVNode as me, mergeProps as $e, normalizeStyle as De, renderSlot as Ae, withModifiers as te, onUnmounted as Ne } from "vue";
|
|
2
|
-
import { D as z } from "./dayjs.min-Cocgeu87.js";
|
|
3
|
-
import { useRouter as Re } from "vue-router";
|
|
4
|
-
import { O as Ue, b as Oe } from "./app-5fxKLAzS.js";
|
|
5
|
-
import { z as Be, D as Te, B as ve, ah as Ee, a5 as be, ai as J, u as _e, G as pe, H as ze, y as Le } from "./index.vue_vue_type_script_setup_true_lang-BUccfB8b.js";
|
|
6
|
-
import { useI18n as X, useCoreStore as ge, RestaurantSelector as ye } from "@feedmepos/mf-common";
|
|
7
|
-
import { useSnackbar as ce, useDialogChild as je, useProxiedModel as Ye, useDialog as ke, FmButtonVariant as fe, components as Z } from "@feedmepos/ui-library";
|
|
8
|
-
import { _ as Ke } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
9
|
-
import { _ as Ce } from "./app-yVJIrlSz.js";
|
|
10
|
-
import { a as He, w as qe } from "./tooltip-B5BiPMx9.js";
|
|
11
|
-
import { u as we } from "./discardConfirm-BHni0LNu.js";
|
|
12
|
-
import { _ as xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
-
function Ve(N) {
|
|
14
|
-
return N ? z(N).format("DD/MM/YY HH:mm") : "-";
|
|
15
|
-
}
|
|
16
|
-
function Ge(N, x, s) {
|
|
17
|
-
const b = (d, _ = !1) => {
|
|
18
|
-
var p;
|
|
19
|
-
return d === void 0 && !_ ? "-" : ((p = s.find((v) => v.value === (d || null))) == null ? void 0 : p.label) || "-";
|
|
20
|
-
};
|
|
21
|
-
return N.map((d) => {
|
|
22
|
-
var e;
|
|
23
|
-
const _ = (e = x.find(({ _id: k }) => k === d._id)) == null ? void 0 : e.posVersion, p = !!_ && !!Be.Pos.canUse({ feature: Te.F_FEATURE.enum.taxAndServiceChargeV4, posVersion: _ }), v = b(d.catalogId);
|
|
24
|
-
return {
|
|
25
|
-
...d,
|
|
26
|
-
_default: v,
|
|
27
|
-
_posTakeaway: d.takeawayCatalog ? b(d.takeawayCatalog) : v,
|
|
28
|
-
_additionalCatalogs: (d.additionalCatalogs || []).map((k) => b(k)),
|
|
29
|
-
_lastUpdate: Ve(d.updatedAt),
|
|
30
|
-
_pickup: p ? b(d.pickupCatalog, !0) : "-",
|
|
31
|
-
_canUsePickup: p,
|
|
32
|
-
_posVersion: _ || "-"
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const Je = {
|
|
37
|
-
key: 0,
|
|
38
|
-
class: "flex items-center justify-center"
|
|
39
|
-
}, We = {
|
|
40
|
-
key: 1,
|
|
41
|
-
class: "space-y-16"
|
|
42
|
-
}, Qe = { class: "text-fm-color-typo-secondary" }, Xe = { class: "space-y-4" }, Ze = /* @__PURE__ */ G({
|
|
43
|
-
__name: "RevertDialog",
|
|
44
|
-
props: {
|
|
45
|
-
restaurant: {}
|
|
46
|
-
},
|
|
47
|
-
setup(N) {
|
|
48
|
-
const x = N, s = ce(), { custom: b } = ve(s), d = I(!1), _ = I(null);
|
|
49
|
-
async function p() {
|
|
50
|
-
await b(
|
|
51
|
-
async () => {
|
|
52
|
-
var t;
|
|
53
|
-
_.value = await Ee.readMenuById(((t = x.restaurant.revertConfig) == null ? void 0 : t._id) || "");
|
|
54
|
-
},
|
|
55
|
-
{ isLoading: d }
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
const v = U(() => {
|
|
59
|
-
var t;
|
|
60
|
-
return [
|
|
61
|
-
{ label: "Main", value: null },
|
|
62
|
-
...(((t = _.value) == null ? void 0 : t.modules.catalog) || []).map((n) => ({
|
|
63
|
-
label: n.name,
|
|
64
|
-
value: n._id
|
|
65
|
-
}))
|
|
66
|
-
];
|
|
67
|
-
}), { t: e } = X(), k = U(() => {
|
|
68
|
-
var o;
|
|
69
|
-
const t = x.restaurant.revertConfig;
|
|
70
|
-
if (!t) return [];
|
|
71
|
-
const n = Ge(
|
|
72
|
-
[
|
|
73
|
-
{
|
|
74
|
-
...t,
|
|
75
|
-
catalogId: t.catalogId || null
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
ge().restaurants.value,
|
|
79
|
-
v.value
|
|
80
|
-
)[0];
|
|
81
|
-
return [
|
|
82
|
-
{ label: e("menu.revert.labels.restaurant"), value: x.restaurant.name },
|
|
83
|
-
{
|
|
84
|
-
label: e("menu.revert.labels.revert_to"),
|
|
85
|
-
value: Ve((o = _.value) == null ? void 0 : o.updatedAt)
|
|
86
|
-
},
|
|
87
|
-
{ label: e("menu.revert.labels.default"), value: n._default },
|
|
88
|
-
{ label: e("menu.revert.labels.pos_takeaway"), value: n._posTakeaway },
|
|
89
|
-
{ label: e("menu.revert.labels.pickup"), value: n._pickup },
|
|
90
|
-
{
|
|
91
|
-
label: e("menu.revert.labels.additional_catalogs"),
|
|
92
|
-
value: n._additionalCatalogs.join(", ")
|
|
93
|
-
}
|
|
94
|
-
];
|
|
95
|
-
});
|
|
96
|
-
ie(async () => p());
|
|
97
|
-
const { emitData: l } = je();
|
|
98
|
-
return (t, n) => {
|
|
99
|
-
const o = M("FmCircularProgress");
|
|
100
|
-
return d.value ? (y(), F("div", Je, [
|
|
101
|
-
h(o, { size: "lg" })
|
|
102
|
-
])) : (y(), F("div", We, [
|
|
103
|
-
f("div", Qe, E(m(e)("menu.revert.description", { name: x.restaurant.name })), 1),
|
|
104
|
-
f("div", Xe, [
|
|
105
|
-
(y(!0), F(j, null, W(k.value, (i) => (y(), K(He, {
|
|
106
|
-
key: i.label,
|
|
107
|
-
name: i.label,
|
|
108
|
-
value: i.value || "--"
|
|
109
|
-
}, null, 8, ["name", "value"]))), 128))
|
|
110
|
-
])
|
|
111
|
-
]));
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
}), et = {
|
|
115
|
-
class: "break-all fm-typo-en-body-lg-400 line-clamp-1"
|
|
116
|
-
}, tt = {
|
|
117
|
-
class: "flex flex-col"
|
|
118
|
-
}, lt = /* @__PURE__ */ G({
|
|
119
|
-
__name: "PublishRestaurantSelector",
|
|
120
|
-
props: {
|
|
121
|
-
restaurants: {
|
|
122
|
-
type: Array,
|
|
123
|
-
required: !0
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
emits: ["update:modelValue"],
|
|
127
|
-
setup(N, {
|
|
128
|
-
emit: x
|
|
129
|
-
}) {
|
|
130
|
-
const s = N, b = x, d = I([]), _ = U(() => s.restaurants.map((o) => ({
|
|
131
|
-
label: o.name,
|
|
132
|
-
value: o._id
|
|
133
|
-
}))), p = I(""), v = U(() => {
|
|
134
|
-
const o = Array.isArray(d.value) ? d.value : [], i = o.map((c) => _.value.find((D) => D.value === c)).filter((c) => c !== void 0);
|
|
135
|
-
let u = [];
|
|
136
|
-
return p.value ? (u = _.value.filter((c) => c.label.toLowerCase().includes(p.value.toLowerCase()) && !o.includes(c.value)), [...i, ...u]) : (u = _.value.filter((c) => !o.includes(c.value)), [...i, ...u]);
|
|
137
|
-
}), e = U(() => d.value.length > 0 && d.value.length === v.value.length), k = U(() => d.value.filter((o) => v.value.some((i) => i.value === o))), l = () => {
|
|
138
|
-
const o = d.value.filter((i) => !k.value.includes(i));
|
|
139
|
-
e.value === !0 ? t(o) : t(v.value.map((i) => i.value));
|
|
140
|
-
}, t = (o) => {
|
|
141
|
-
d.value = o;
|
|
142
|
-
};
|
|
143
|
-
de(d, (o) => {
|
|
144
|
-
b("update:modelValue", o);
|
|
145
|
-
});
|
|
146
|
-
function n(o) {
|
|
147
|
-
return s.restaurants.filter((i) => o.includes(i._id)).map((i) => i.name);
|
|
148
|
-
}
|
|
149
|
-
return (o, i) => {
|
|
150
|
-
const u = M("FmSearch"), c = M("FmCheckbox"), D = M("FmSelect");
|
|
151
|
-
return y(), K(D, {
|
|
152
|
-
modelValue: d.value,
|
|
153
|
-
"onUpdate:modelValue": i[1] || (i[1] = (A) => d.value = A),
|
|
154
|
-
placeholder: "Select Restaurant",
|
|
155
|
-
items: v.value,
|
|
156
|
-
multiselect: !0,
|
|
157
|
-
"hide-chips": !0
|
|
158
|
-
}, {
|
|
159
|
-
default: T(() => [f("p", et, E(d.value.length === s.restaurants.length ? "All restaurants" : n(d.value).join(", ")), 1)]),
|
|
160
|
-
"menu-wrapper": T(() => [f("div", tt, [h(u, {
|
|
161
|
-
class: "py-8",
|
|
162
|
-
modelValue: p.value,
|
|
163
|
-
"onUpdate:modelValue": i[0] || (i[0] = (A) => p.value = A),
|
|
164
|
-
placeholder: "Search Restaurant"
|
|
165
|
-
}, null, 8, ["modelValue"]), h(c, {
|
|
166
|
-
class: "py-8",
|
|
167
|
-
"model-value": e.value,
|
|
168
|
-
label: "All restaurants",
|
|
169
|
-
value: "1",
|
|
170
|
-
indeterminate: d.value.length > 0,
|
|
171
|
-
"onUpdate:modelValue": l
|
|
172
|
-
}, null, 8, ["model-value", "indeterminate"]), (y(!0), F(j, null, W(v.value, (A, H) => (y(), F("div", {
|
|
173
|
-
key: H
|
|
174
|
-
}, [h(c, {
|
|
175
|
-
"model-value": d.value,
|
|
176
|
-
label: A.label,
|
|
177
|
-
value: A.value,
|
|
178
|
-
"onUpdate:modelValue": t
|
|
179
|
-
}, null, 8, ["model-value", "label", "value"])]))), 128))])]),
|
|
180
|
-
_: 1
|
|
181
|
-
}, 8, ["modelValue", "items"]);
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}), at = {
|
|
185
|
-
class: "flex pb-16 w-full items-center justify-between gap-8"
|
|
186
|
-
}, st = {
|
|
187
|
-
class: "flex-1 min-w-0 max-w-[300px]"
|
|
188
|
-
}, nt = {
|
|
189
|
-
key: 0
|
|
190
|
-
}, ot = {
|
|
191
|
-
key: 1,
|
|
192
|
-
class: "text-fm-color-neutral-gray-200"
|
|
193
|
-
}, ut = /* @__PURE__ */ G({
|
|
194
|
-
__name: "RestaurantPublishDetail",
|
|
195
|
-
props: {
|
|
196
|
-
restaurantPublishStatus: {
|
|
197
|
-
type: Object,
|
|
198
|
-
required: !0
|
|
199
|
-
},
|
|
200
|
-
statusMap: {
|
|
201
|
-
type: Object,
|
|
202
|
-
required: !0
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
setup(N) {
|
|
206
|
-
const {
|
|
207
|
-
t: x
|
|
208
|
-
} = X(), s = N, b = ge(), d = [{
|
|
209
|
-
accessorKey: "restaurantName",
|
|
210
|
-
header: x("menu.publish.scheduler_publish.restaurant_publish_details.table.column.restaurant"),
|
|
211
|
-
cell: (t) => {
|
|
212
|
-
const n = t.getValue();
|
|
213
|
-
return B("p", {
|
|
214
|
-
class: "text-balance w-[100px]"
|
|
215
|
-
}, n);
|
|
216
|
-
}
|
|
217
|
-
}, {
|
|
218
|
-
id: "status",
|
|
219
|
-
accessorKey: "publishStatus",
|
|
220
|
-
header: x("menu.publish.scheduler_publish.restaurant_publish_details.table.column.status"),
|
|
221
|
-
cell: ({
|
|
222
|
-
row: t
|
|
223
|
-
}) => {
|
|
224
|
-
const n = t.original.publishStatus, o = Object.values(s.statusMap).find((u) => u.label === n), i = (o == null ? void 0 : o.textColor) ?? "text-fm-color-neutral-gray-300";
|
|
225
|
-
return B("p", {
|
|
226
|
-
class: `${i}`
|
|
227
|
-
}, n);
|
|
228
|
-
}
|
|
229
|
-
}, {
|
|
230
|
-
accessorKey: "publishedAt",
|
|
231
|
-
header: x("menu.publish.scheduler_publish.restaurant_publish_details.table.column.published_at"),
|
|
232
|
-
cell: ({
|
|
233
|
-
row: t
|
|
234
|
-
}) => {
|
|
235
|
-
const n = t.original.publishedAt;
|
|
236
|
-
return B("p", {
|
|
237
|
-
class: "whitespace-nowrap"
|
|
238
|
-
}, n);
|
|
239
|
-
}
|
|
240
|
-
}], _ = I([]), p = U(() => Object.entries(s.statusMap).map(([t, n]) => ({
|
|
241
|
-
label: n.label,
|
|
242
|
-
value: t
|
|
243
|
-
}))), v = I(null), e = U(() => Object.entries(s.restaurantPublishStatus).filter(([t, n]) => _.value.length === 0 ? !0 : _.value.includes(n.status)).filter(([t, n]) => !v.value || v.value.length === 0 ? !0 : v.value.includes(t)).map(([t, n]) => ({
|
|
244
|
-
restaurantName: l(t),
|
|
245
|
-
publishStatus: s.statusMap[n.status].label,
|
|
246
|
-
publishedAt: n.publishedAt ? z(n.publishedAt).format("YYYY-MM-DD HH:mm:ss") : ""
|
|
247
|
-
})).sort((t, n) => t.restaurantName.localeCompare(n.restaurantName))), k = U(() => {
|
|
248
|
-
var n, o;
|
|
249
|
-
const t = {};
|
|
250
|
-
for (const i of b.restaurants.value) {
|
|
251
|
-
if (!(i != null && i._id)) continue;
|
|
252
|
-
const u = (n = i == null ? void 0 : i.profile) == null ? void 0 : n.code, c = (o = i == null ? void 0 : i.profile) == null ? void 0 : o.name;
|
|
253
|
-
t[i._id] = `${u ? u + " - " : ""}${c || "Unknown Restaurant"}`;
|
|
254
|
-
}
|
|
255
|
-
return t;
|
|
256
|
-
});
|
|
257
|
-
function l(t) {
|
|
258
|
-
return k.value[t] ?? "Unknown Restaurant";
|
|
259
|
-
}
|
|
260
|
-
return (t, n) => {
|
|
261
|
-
const o = M("FmSelect"), i = M("FmTable");
|
|
262
|
-
return y(), F(j, null, [f("div", at, [f("div", st, [h(m(ye), {
|
|
263
|
-
multiple: "",
|
|
264
|
-
modelValue: v.value,
|
|
265
|
-
"onUpdate:modelValue": n[0] || (n[0] = (u) => v.value = u)
|
|
266
|
-
}, null, 8, ["modelValue"])]), h(o, {
|
|
267
|
-
class: "flex-shrink-0 min-w-[200px]",
|
|
268
|
-
modelValue: _.value,
|
|
269
|
-
"onUpdate:modelValue": n[1] || (n[1] = (u) => _.value = u),
|
|
270
|
-
items: p.value,
|
|
271
|
-
multiselect: "",
|
|
272
|
-
"hide-chips": ""
|
|
273
|
-
}, {
|
|
274
|
-
default: T(() => [_.value.length > 0 ? (y(), F("div", nt, E(_.value.map((u) => {
|
|
275
|
-
var c;
|
|
276
|
-
return (c = s.statusMap[u]) == null ? void 0 : c.label;
|
|
277
|
-
}).join(", ")), 1)) : (y(), F("div", ot, E(m(x)("menu.publish.scheduler_publish.restaurant_publish_details.select_publish_status")), 1))]),
|
|
278
|
-
_: 1
|
|
279
|
-
}, 8, ["modelValue", "items"])]), h(Ce, null, {
|
|
280
|
-
default: T(() => [e.value.length > 0 ? (y(), K(i, {
|
|
281
|
-
key: 0,
|
|
282
|
-
class: "flex-1 overflow-hidden",
|
|
283
|
-
"column-defs": d,
|
|
284
|
-
"row-data": e.value,
|
|
285
|
-
"page-size": Object.entries(s.restaurantPublishStatus).length,
|
|
286
|
-
"hide-footer": "",
|
|
287
|
-
"pin-header-row": ""
|
|
288
|
-
}, null, 8, ["row-data", "page-size"])) : (y(), K(be, {
|
|
289
|
-
key: 1,
|
|
290
|
-
title: "No publish status found",
|
|
291
|
-
subtitle: ""
|
|
292
|
-
}))]),
|
|
293
|
-
_: 1
|
|
294
|
-
})], 64);
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
}), rt = { class: "fm-calendar__name-row fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, it = ["id"], dt = {
|
|
298
|
-
key: 0,
|
|
299
|
-
class: "fm-calendar__cell__button--today"
|
|
300
|
-
}, ct = ["onClick", "onMouseover"], mt = /* @__PURE__ */ G({
|
|
301
|
-
__name: "FmCalendar",
|
|
302
|
-
props: {
|
|
303
|
-
days: {},
|
|
304
|
-
dayCellClass: { type: [Object, Function], default: void 0 },
|
|
305
|
-
onDayClick: {},
|
|
306
|
-
onCellMouseOver: { type: Function, default: void 0 },
|
|
307
|
-
cellSize: { default: "md" }
|
|
308
|
-
},
|
|
309
|
-
setup(N) {
|
|
310
|
-
const { t: x } = X(), s = () => [
|
|
311
|
-
x("menu.publish.scheduler.calender.day.sun"),
|
|
312
|
-
x("menu.publish.scheduler.calender.day.mon"),
|
|
313
|
-
x("menu.publish.scheduler.calender.day.tue"),
|
|
314
|
-
x("menu.publish.scheduler.calender.day.wed"),
|
|
315
|
-
x("menu.publish.scheduler.calender.day.thu"),
|
|
316
|
-
x("menu.publish.scheduler.calender.day.fri"),
|
|
317
|
-
x("menu.publish.scheduler.calender.day.sat")
|
|
318
|
-
], b = z(), d = (p, v) => typeof p == "function" ? p(...v) : p, _ = (p, v) => {
|
|
319
|
-
if (!v) return;
|
|
320
|
-
const e = {
|
|
321
|
-
"fm-calendar__cell--selected": !1,
|
|
322
|
-
"fm-calendar__cell--selected-start": !1,
|
|
323
|
-
"fm-calendar__cell--selected-end": !1,
|
|
324
|
-
"fm-calendar__cell--selected-between": !1
|
|
325
|
-
};
|
|
326
|
-
let k;
|
|
327
|
-
if (typeof v == "function") {
|
|
328
|
-
const { status: l, className: t } = v(p);
|
|
329
|
-
l && (e["fm-calendar__cell--selected"] = l.isSelected ?? !1, e["fm-calendar__cell--selected-start"] = l.isStart ?? !1, e["fm-calendar__cell--selected-end"] = l.isEnd ?? !1, e["fm-calendar__cell--selected-between"] = l.isBetween ?? !1), k = t ?? "";
|
|
330
|
-
} else {
|
|
331
|
-
const { status: l, className: t } = v;
|
|
332
|
-
l && (e["fm-calendar__cell--selected"] = d(l.isSelected, [p]) ?? !1, e["fm-calendar__cell--selected-start"] = d(l.isStart, [p]) ?? !1, e["fm-calendar__cell--selected-end"] = d(l.isEnd, [p]) ?? !1, e["fm-calendar__cell--selected-between"] = d(l.isBetween, [p]) ?? !1), k = d(t, [p]) ?? "";
|
|
333
|
-
}
|
|
334
|
-
return [e, k];
|
|
335
|
-
};
|
|
336
|
-
return (p, v) => (y(), F("div", null, [
|
|
337
|
-
f("div", rt, [
|
|
338
|
-
(y(!0), F(j, null, W(s(), (e) => (y(), F("div", {
|
|
339
|
-
key: e,
|
|
340
|
-
class: re(["fm-calendar__cell", `fm-calendar__cell__${p.cellSize}`])
|
|
341
|
-
}, E(e), 3))), 128))
|
|
342
|
-
]),
|
|
343
|
-
f("div", null, [
|
|
344
|
-
(y(!0), F(j, null, W(p.days, (e, k) => (y(), F("div", {
|
|
345
|
-
key: k,
|
|
346
|
-
class: "fm-calendar__row fm-typo-en-body-md-400"
|
|
347
|
-
}, [
|
|
348
|
-
(y(!0), F(j, null, W(e, (l) => (y(), F("div", {
|
|
349
|
-
id: `${l.date.toISOString()}`,
|
|
350
|
-
key: l.date.date(),
|
|
351
|
-
class: re(["fm-calendar__cell", [
|
|
352
|
-
`fm-calendar__cell__${p.cellSize}`,
|
|
353
|
-
_(l.date, p.dayCellClass),
|
|
354
|
-
!l.isCurrentMonth && "fm-calendar__cell--not-current-month"
|
|
355
|
-
]])
|
|
356
|
-
}, [
|
|
357
|
-
l.date.isSame(m(b), "day") && l.isCurrentMonth ? (y(), F("div", dt)) : Q("", !0),
|
|
358
|
-
l.isCurrentMonth ? (y(), F("button", {
|
|
359
|
-
key: 1,
|
|
360
|
-
class: "fm-calendar__cell__button",
|
|
361
|
-
type: "button",
|
|
362
|
-
onClick: (t) => p.onDayClick(l),
|
|
363
|
-
onMouseover: (t) => {
|
|
364
|
-
var n;
|
|
365
|
-
return (n = p.onCellMouseOver) == null ? void 0 : n.call(p, l.date);
|
|
366
|
-
}
|
|
367
|
-
}, E(l.date.date()), 41, ct)) : Q("", !0)
|
|
368
|
-
], 10, it))), 128))
|
|
369
|
-
]))), 128))
|
|
370
|
-
])
|
|
371
|
-
]));
|
|
372
|
-
}
|
|
373
|
-
}), he = /* @__PURE__ */ xe(mt, [["__scopeId", "data-v-47484312"]]), pt = { class: "fm-typo-en-body-md-600" }, ft = {
|
|
374
|
-
id: "in-calendar-app",
|
|
375
|
-
class: "h-[264px] overflow-y-auto w-[160px]"
|
|
376
|
-
}, ht = ["onVnodeMounted"], vt = ["onVnodeMounted"], le = /* @__PURE__ */ G({
|
|
377
|
-
__name: "FmDateRangeYearMonthPicker",
|
|
378
|
-
props: {
|
|
379
|
-
modelValue: {},
|
|
380
|
-
picker: {},
|
|
381
|
-
min: {},
|
|
382
|
-
max: {}
|
|
383
|
-
},
|
|
384
|
-
emits: ["update:modelValue"],
|
|
385
|
-
setup(N, { emit: x }) {
|
|
386
|
-
const { t: s } = X(), b = N, d = x, _ = I(!1), p = U(() => {
|
|
387
|
-
const l = z(b.min).startOf("year"), t = z(b.max).startOf("year"), n = t.diff(l, "year"), o = [];
|
|
388
|
-
for (let i = 0; i <= n; i++)
|
|
389
|
-
o.push(t.subtract(i, "year"));
|
|
390
|
-
return o;
|
|
391
|
-
}), v = (l) => {
|
|
392
|
-
const t = z(b.min).startOf("month"), n = z(b.max).startOf("month");
|
|
393
|
-
return l.get("year") === t.get("year") ? l.startOf("month").isAfter(t) || l.get("month") === t.get("month") : l.get("year") === n.get("year") ? l.startOf("month").isBefore(n) || l.get("month") === n.get("month") : !0;
|
|
394
|
-
}, e = (l) => {
|
|
395
|
-
const t = z(b.min).startOf("month"), n = z(b.max).startOf("month");
|
|
396
|
-
if (t.get("year") === l.get("year")) {
|
|
397
|
-
d("update:modelValue", t);
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
if (n.get("year") === l.get("year")) {
|
|
401
|
-
d("update:modelValue", n);
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
d("update:modelValue", l);
|
|
405
|
-
};
|
|
406
|
-
function k(l, t) {
|
|
407
|
-
if (!t)
|
|
408
|
-
return !1;
|
|
409
|
-
const n = l.el, o = n == null ? void 0 : n.parentElement;
|
|
410
|
-
!n || !o || o.scrollTo({
|
|
411
|
-
top: n.offsetTop - 50
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
return (l, t) => {
|
|
415
|
-
const n = M("FmIcon"), o = M("FmMenuItem"), i = M("FmMenu");
|
|
416
|
-
return y(), K(i, {
|
|
417
|
-
trigger: "click",
|
|
418
|
-
onMenuChanged: t[0] || (t[0] = (u) => _.value = u)
|
|
419
|
-
}, {
|
|
420
|
-
"menu-button": T(() => [
|
|
421
|
-
f("div", {
|
|
422
|
-
class: re(["flex gap-4 h-24 items-center px-4 rounded-sm", _.value ? "text-fm-color-primary" : "hover:bg-fm-color-neutral-gray-100"])
|
|
423
|
-
}, [
|
|
424
|
-
f("div", pt, [
|
|
425
|
-
l.picker === "month" ? (y(), F(j, { key: 0 }, [
|
|
426
|
-
me(E(l.modelValue.format(m(s)("menu.publish.scheduler.date.monthFormat"))), 1)
|
|
427
|
-
], 64)) : Q("", !0),
|
|
428
|
-
l.picker === "year" ? (y(), F(j, { key: 1 }, [
|
|
429
|
-
me(E(l.modelValue.format(m(s)("menu.publish.scheduler.date.yearFormat"))), 1)
|
|
430
|
-
], 64)) : Q("", !0)
|
|
431
|
-
]),
|
|
432
|
-
h(n, {
|
|
433
|
-
name: _.value ? "expand_less" : "expand_more",
|
|
434
|
-
size: "md",
|
|
435
|
-
color: "black"
|
|
436
|
-
}, null, 8, ["name"])
|
|
437
|
-
], 2)
|
|
438
|
-
]),
|
|
439
|
-
default: T(() => [
|
|
440
|
-
f("ul", ft, [
|
|
441
|
-
l.picker === "month" ? (y(!0), F(j, { key: 0 }, W(Array.from(Array(12), (u, c) => l.modelValue.month(c)), (u) => (y(), F("li", {
|
|
442
|
-
key: u.format(m(s)("menu.publish.scheduler.date.monthFormat")),
|
|
443
|
-
onVnodeMounted: (c) => k(
|
|
444
|
-
c,
|
|
445
|
-
l.modelValue.format(m(s)("menu.publish.scheduler.date.monthFormat")) === u.format(m(s)("menu.publish.scheduler.date.monthFormat"))
|
|
446
|
-
)
|
|
447
|
-
}, [
|
|
448
|
-
h(o, {
|
|
449
|
-
disabled: !v(u),
|
|
450
|
-
"model-value": l.modelValue.format(m(s)("menu.publish.scheduler.date.monthFormat")) === u.format(m(s)("menu.publish.scheduler.date.monthFormat")),
|
|
451
|
-
label: u.format(m(s)("menu.publish.scheduler.date.monthFormat")),
|
|
452
|
-
"onUpdate:modelValue": (c) => d("update:modelValue", u)
|
|
453
|
-
}, null, 8, ["disabled", "model-value", "label", "onUpdate:modelValue"])
|
|
454
|
-
], 8, ht))), 128)) : Q("", !0),
|
|
455
|
-
l.picker === "year" ? (y(!0), F(j, { key: 1 }, W(p.value, (u) => (y(), F("li", {
|
|
456
|
-
key: u.format(m(s)("menu.publish.scheduler.date.yearFormat")),
|
|
457
|
-
onVnodeMounted: (c) => k(
|
|
458
|
-
c,
|
|
459
|
-
l.modelValue.format(m(s)("menu.publish.scheduler.date.yearFormat")) === u.format(m(s)("menu.publish.scheduler.date.yearFormat"))
|
|
460
|
-
)
|
|
461
|
-
}, [
|
|
462
|
-
h(o, {
|
|
463
|
-
"model-value": l.modelValue.format(m(s)("menu.publish.scheduler.date.yearFormat")) === u.format(m(s)("menu.publish.scheduler.date.yearFormat")),
|
|
464
|
-
label: u.format(m(s)("menu.publish.scheduler.date.yearFormat")),
|
|
465
|
-
"onUpdate:modelValue": (c) => e(u)
|
|
466
|
-
}, null, 8, ["model-value", "label", "onUpdate:modelValue"])
|
|
467
|
-
], 8, vt))), 128)) : Q("", !0)
|
|
468
|
-
])
|
|
469
|
-
]),
|
|
470
|
-
_: 1
|
|
471
|
-
});
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
}), bt = { class: "p-12 space-y-4 w-[552px]" }, _t = { class: "w-max" }, gt = { class: "flex space-x-24" }, yt = { class: "flex items-center py-8 space-x-16" }, kt = { class: "flex space-x-4" }, Ct = { class: "flex items-center justify-end py-8 space-x-16" }, wt = { class: "flex space-x-4" }, xt = { class: "flex gap-8 items-center justify-end w-full" }, ae = "YYYY-MM-DD", Vt = /* @__PURE__ */ G({
|
|
475
|
-
__name: "DateTimePicker",
|
|
476
|
-
props: {
|
|
477
|
-
modelValue: {},
|
|
478
|
-
showValidBorder: { type: Boolean, default: !1 },
|
|
479
|
-
min: { default: () => z().subtract(50, "year").format(ae) },
|
|
480
|
-
max: { default: () => z().add(25, "year").format(ae) },
|
|
481
|
-
zIndex: { default: void 0 },
|
|
482
|
-
label: { default: "" },
|
|
483
|
-
labelMark: { default: "none" },
|
|
484
|
-
labelInfo: { default: "" },
|
|
485
|
-
disabled: { type: Boolean, default: void 0 },
|
|
486
|
-
focused: { type: Boolean, default: !1 },
|
|
487
|
-
rules: { default: () => [] },
|
|
488
|
-
helperText: { default: "" },
|
|
489
|
-
helperState: { default: "none" }
|
|
490
|
-
},
|
|
491
|
-
emits: ["update:schedulerTime"],
|
|
492
|
-
setup(N, { emit: x }) {
|
|
493
|
-
const { t: s } = X(), b = N, d = x, _ = Ye(b, "modelValue"), p = I({
|
|
494
|
-
hours: new Date(_.value).getHours() % 12 || 12,
|
|
495
|
-
minutes: new Date(_.value).getMinutes(),
|
|
496
|
-
period: new Date(_.value).getHours() >= 12 ? "PM" : "AM"
|
|
497
|
-
/* AM */
|
|
498
|
-
}), v = I(z(_.value, ae)), e = I(!1);
|
|
499
|
-
function k(w, r) {
|
|
500
|
-
const [g, V, R] = w.split("-").map(Number), O = new Date(g, V - 1, R);
|
|
501
|
-
let S = r.hours % 12;
|
|
502
|
-
return r.period === "PM" && (S += 12), O.setHours(S), O.setMinutes(r.minutes), O.setSeconds(0), O.setMilliseconds(0), O;
|
|
503
|
-
}
|
|
504
|
-
const l = () => {
|
|
505
|
-
_.value = v.value.format(ae);
|
|
506
|
-
const w = k(_.value, p.value);
|
|
507
|
-
d("update:schedulerTime", w.toISOString()), setTimeout(() => {
|
|
508
|
-
e.value = !1;
|
|
509
|
-
}, 0);
|
|
510
|
-
}, t = () => {
|
|
511
|
-
v.value = _.value ? z(_.value) : null, e.value = !1;
|
|
512
|
-
}, n = (w) => {
|
|
513
|
-
e.value = w, w || t();
|
|
514
|
-
}, o = I(z().startOf("month")), i = I(z().startOf("month").add(1, "month")), u = (w, r) => {
|
|
515
|
-
w === "left" ? (o.value = r, i.value = r.add(1, "month")) : w === "right" && (i.value = r, o.value = r.subtract(1, "month"));
|
|
516
|
-
}, c = U(() => A(o.value)), D = U(() => A(o.value.add(1, "month"))), A = (w) => {
|
|
517
|
-
const r = [], g = w.endOf("month"), V = w.month();
|
|
518
|
-
let R = w.startOf("week"), O = [];
|
|
519
|
-
for (; R.isBefore(g.endOf("week")); )
|
|
520
|
-
R.day() === 0 && O.length > 0 && (r.push(O), O = []), O.push({
|
|
521
|
-
date: R,
|
|
522
|
-
isCurrentMonth: R.month() === V
|
|
523
|
-
}), R = R.add(1, "day");
|
|
524
|
-
return O.length > 0 && r.push(O), r.length < 6 && r.push([]), r;
|
|
525
|
-
}, H = (w) => {
|
|
526
|
-
v.value = w;
|
|
527
|
-
};
|
|
528
|
-
return (w, r) => {
|
|
529
|
-
const g = M("FmIcon"), V = M("FmTimeInput"), R = M("FmButton"), O = M("FmPopover");
|
|
530
|
-
return y(), K(O, {
|
|
531
|
-
"show-popover": e.value,
|
|
532
|
-
"z-index": b.zIndex,
|
|
533
|
-
"exclude-el-from-click-outside": ["in-calendar-app"],
|
|
534
|
-
onPopoverChanged: n
|
|
535
|
-
}, {
|
|
536
|
-
"popover-button": T(() => [
|
|
537
|
-
f("div", $e({
|
|
538
|
-
opened: e.value,
|
|
539
|
-
showValidBorder: w.showValidBorder
|
|
540
|
-
}, { class: "text-fm-color-primary" }), " Select Date & Time ", 16)
|
|
541
|
-
]),
|
|
542
|
-
default: T(() => [
|
|
543
|
-
f("div", bt, [
|
|
544
|
-
f("div", _t, [
|
|
545
|
-
f("div", gt, [
|
|
546
|
-
f("div", null, [
|
|
547
|
-
f("div", yt, [
|
|
548
|
-
h(g, {
|
|
549
|
-
outline: !1,
|
|
550
|
-
class: "cursor-pointer select-none",
|
|
551
|
-
color: "#1C1C1E",
|
|
552
|
-
name: "chevron_left",
|
|
553
|
-
size: "md",
|
|
554
|
-
onClick: r[0] || (r[0] = () => u("left", o.value.subtract(1, "month")))
|
|
555
|
-
}),
|
|
556
|
-
f("div", kt, [
|
|
557
|
-
h(le, {
|
|
558
|
-
max: w.max,
|
|
559
|
-
min: w.min,
|
|
560
|
-
"model-value": o.value,
|
|
561
|
-
picker: "month",
|
|
562
|
-
"onUpdate:modelValue": r[1] || (r[1] = (S) => u("left", S))
|
|
563
|
-
}, null, 8, ["max", "min", "model-value"]),
|
|
564
|
-
h(le, {
|
|
565
|
-
max: w.max,
|
|
566
|
-
min: w.min,
|
|
567
|
-
"model-value": o.value,
|
|
568
|
-
picker: "year",
|
|
569
|
-
"onUpdate:modelValue": r[2] || (r[2] = (S) => u("left", S))
|
|
570
|
-
}, null, 8, ["max", "min", "model-value"])
|
|
571
|
-
])
|
|
572
|
-
]),
|
|
573
|
-
h(he, {
|
|
574
|
-
"day-cell-class": {
|
|
575
|
-
status: {
|
|
576
|
-
isSelected: (S) => S.isSame(v.value, "date")
|
|
577
|
-
}
|
|
578
|
-
},
|
|
579
|
-
days: c.value,
|
|
580
|
-
"on-day-click": (S) => H(S.date)
|
|
581
|
-
}, null, 8, ["day-cell-class", "days", "on-day-click"])
|
|
582
|
-
]),
|
|
583
|
-
f("div", null, [
|
|
584
|
-
f("div", Ct, [
|
|
585
|
-
f("div", wt, [
|
|
586
|
-
h(le, {
|
|
587
|
-
max: w.max,
|
|
588
|
-
min: w.min,
|
|
589
|
-
"model-value": i.value,
|
|
590
|
-
picker: "month",
|
|
591
|
-
"onUpdate:modelValue": r[3] || (r[3] = (S) => u("right", S))
|
|
592
|
-
}, null, 8, ["max", "min", "model-value"]),
|
|
593
|
-
h(le, {
|
|
594
|
-
max: w.max,
|
|
595
|
-
min: w.min,
|
|
596
|
-
"model-value": i.value,
|
|
597
|
-
picker: "year",
|
|
598
|
-
"onUpdate:modelValue": r[4] || (r[4] = (S) => u("right", S))
|
|
599
|
-
}, null, 8, ["max", "min", "model-value"])
|
|
600
|
-
]),
|
|
601
|
-
h(g, {
|
|
602
|
-
outline: !1,
|
|
603
|
-
class: "cursor-pointer select-none",
|
|
604
|
-
color: "#1C1C1E",
|
|
605
|
-
name: "chevron_right",
|
|
606
|
-
size: "md",
|
|
607
|
-
onClick: r[5] || (r[5] = () => u("left", o.value.add(1, "month")))
|
|
608
|
-
})
|
|
609
|
-
]),
|
|
610
|
-
h(he, {
|
|
611
|
-
"day-cell-class": {
|
|
612
|
-
status: {
|
|
613
|
-
isSelected: (S) => S.isSame(v.value, "date")
|
|
614
|
-
}
|
|
615
|
-
},
|
|
616
|
-
days: D.value,
|
|
617
|
-
"on-day-click": (S) => H(S.date)
|
|
618
|
-
}, null, 8, ["day-cell-class", "days", "on-day-click"])
|
|
619
|
-
])
|
|
620
|
-
])
|
|
621
|
-
]),
|
|
622
|
-
h(V, {
|
|
623
|
-
"model-value": p.value ?? {
|
|
624
|
-
hours: 0,
|
|
625
|
-
minutes: 0,
|
|
626
|
-
period: "AM"
|
|
627
|
-
/* AM */
|
|
628
|
-
},
|
|
629
|
-
"onUpdate:modelValue": r[6] || (r[6] = (S) => p.value = S)
|
|
630
|
-
}, null, 8, ["model-value"]),
|
|
631
|
-
f("div", xt, [
|
|
632
|
-
h(R, {
|
|
633
|
-
label: m(s)("common.cancel"),
|
|
634
|
-
size: "md",
|
|
635
|
-
variant: "tertiary",
|
|
636
|
-
onClick: t
|
|
637
|
-
}, null, 8, ["label"]),
|
|
638
|
-
h(R, {
|
|
639
|
-
disabled: !v.value,
|
|
640
|
-
label: m(s)("common.confirm"),
|
|
641
|
-
size: "md",
|
|
642
|
-
variant: "primary",
|
|
643
|
-
onClick: l
|
|
644
|
-
}, null, 8, ["disabled", "label"])
|
|
645
|
-
])
|
|
646
|
-
])
|
|
647
|
-
]),
|
|
648
|
-
_: 1
|
|
649
|
-
}, 8, ["show-popover", "z-index"]);
|
|
650
|
-
};
|
|
651
|
-
}
|
|
652
|
-
}), St = { class: "container" }, Ft = /* @__PURE__ */ G({
|
|
653
|
-
__name: "ProgressBar",
|
|
654
|
-
props: {
|
|
655
|
-
bgcolor: {},
|
|
656
|
-
completed: {}
|
|
657
|
-
},
|
|
658
|
-
setup(N) {
|
|
659
|
-
const x = N, s = U(() => ({
|
|
660
|
-
height: "100%",
|
|
661
|
-
width: `${x.completed ?? 0}%`,
|
|
662
|
-
backgroundColor: x.bgcolor,
|
|
663
|
-
transition: "width 1s ease-in-out",
|
|
664
|
-
borderRadius: "inherit",
|
|
665
|
-
textAlign: "right"
|
|
666
|
-
}));
|
|
667
|
-
return (b, d) => (y(), F("div", St, [
|
|
668
|
-
f("div", {
|
|
669
|
-
style: De(s.value)
|
|
670
|
-
}, null, 4)
|
|
671
|
-
]));
|
|
672
|
-
}
|
|
673
|
-
}), Pt = /* @__PURE__ */ xe(Ft, [["__scopeId", "data-v-709d7500"]]), It = {
|
|
674
|
-
class: "flex items-center gap-24"
|
|
675
|
-
}, Mt = {
|
|
676
|
-
class: "fm-typo-en-title-md-600"
|
|
677
|
-
}, $t = /* @__PURE__ */ G({
|
|
678
|
-
__name: "PublishProgressView",
|
|
679
|
-
props: {
|
|
680
|
-
progress: {
|
|
681
|
-
type: Number,
|
|
682
|
-
required: !1
|
|
683
|
-
},
|
|
684
|
-
restaurants: {
|
|
685
|
-
type: Array,
|
|
686
|
-
required: !0
|
|
687
|
-
}
|
|
688
|
-
},
|
|
689
|
-
emits: ["publishMenu"],
|
|
690
|
-
setup(N, {
|
|
691
|
-
expose: x,
|
|
692
|
-
emit: s
|
|
693
|
-
}) {
|
|
694
|
-
const {
|
|
695
|
-
t: b
|
|
696
|
-
} = X(), d = ce(), _ = ke(), p = N, v = {
|
|
697
|
-
[J.enum.PENDING]: {
|
|
698
|
-
label: b("menu.publish.scheduler_publish.status.pending"),
|
|
699
|
-
textColor: "text-fm-color-neutral-gray-300",
|
|
700
|
-
backgroundColor: "#E0E0DE"
|
|
701
|
-
},
|
|
702
|
-
[J.enum.RUNNING]: {
|
|
703
|
-
label: b("menu.publish.scheduler_publish.status.running"),
|
|
704
|
-
textColor: "text-fm-color-system-warning-300",
|
|
705
|
-
backgroundColor: "#FFB800"
|
|
706
|
-
},
|
|
707
|
-
[J.enum.COMPLETED]: {
|
|
708
|
-
label: b("menu.publish.scheduler_publish.status.completed"),
|
|
709
|
-
textColor: "text-fm-color-system-success-300",
|
|
710
|
-
backgroundColor: "#34C759"
|
|
711
|
-
},
|
|
712
|
-
[J.enum.FAILED]: {
|
|
713
|
-
label: b("menu.publish.scheduler_publish.status.failed"),
|
|
714
|
-
textColor: "text-fm-color-system-error-300",
|
|
715
|
-
backgroundColor: "#FF3B30"
|
|
716
|
-
}
|
|
717
|
-
}, e = _e(), k = I(!1), l = (r) => {
|
|
718
|
-
typeof r == "boolean" ? k.value = r : k.value = !k.value;
|
|
719
|
-
};
|
|
720
|
-
x({
|
|
721
|
-
show: k,
|
|
722
|
-
trigger: l
|
|
723
|
-
});
|
|
724
|
-
const t = s, n = U(() => e.state.nextSchedulerPublish ?? {}), o = U(() => Object.entries(n.value).map(([g, V]) => {
|
|
725
|
-
var S;
|
|
726
|
-
const R = e.runningPublishJob, O = Object.keys(V.restaurants || {}).length;
|
|
727
|
-
return {
|
|
728
|
-
date: g,
|
|
729
|
-
publisher: ((S = V.owner) == null ? void 0 : S.name) ?? "Unknown",
|
|
730
|
-
total_restaurants: `${O} restaurants`,
|
|
731
|
-
restaurantPublishStatus: V.restaurants || {},
|
|
732
|
-
status: V.status,
|
|
733
|
-
progress: R === g ? p.progress ?? 0 : 0
|
|
734
|
-
// Only apply progress to the running job's row
|
|
735
|
-
};
|
|
736
|
-
})), i = I([]), u = I(null), c = I(null), D = [{
|
|
737
|
-
accessorKey: "date",
|
|
738
|
-
header: "Date",
|
|
739
|
-
cell: ({
|
|
740
|
-
row: r
|
|
741
|
-
}) => {
|
|
742
|
-
if (r.original.date === "new") {
|
|
743
|
-
if (u.value !== null)
|
|
744
|
-
return new Date(u.value).toLocaleString();
|
|
745
|
-
const V = z(Date.now()).toISOString();
|
|
746
|
-
return B(Vt, {
|
|
747
|
-
class: "flex h-full items-center",
|
|
748
|
-
modelValue: V,
|
|
749
|
-
"onUpdate:schedulerTime": (R) => {
|
|
750
|
-
u.value = R;
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
return new Date(r.original.date).toLocaleString();
|
|
755
|
-
}
|
|
756
|
-
}, {
|
|
757
|
-
accessorKey: "publisher",
|
|
758
|
-
header: "Publisher Name"
|
|
759
|
-
}, {
|
|
760
|
-
accessorKey: "total_restaurants",
|
|
761
|
-
header: "Total restaurants",
|
|
762
|
-
cell: ({
|
|
763
|
-
row: r
|
|
764
|
-
}) => r.original.date === "new" ? B(lt, {
|
|
765
|
-
restaurants: p.restaurants,
|
|
766
|
-
"onUpdate:modelValue": (V) => {
|
|
767
|
-
i.value = V;
|
|
768
|
-
}
|
|
769
|
-
}) : B("p", {}, r.original.total_restaurants)
|
|
770
|
-
}, {
|
|
771
|
-
accessorKey: "progress",
|
|
772
|
-
header: "Progress",
|
|
773
|
-
cell: ({
|
|
774
|
-
row: r
|
|
775
|
-
}) => {
|
|
776
|
-
const g = r.original.status;
|
|
777
|
-
return r.original.date === "new" ? B("div", {
|
|
778
|
-
class: "flex justify-end items-center gap-8"
|
|
779
|
-
}, [B(Z.FmButton, {
|
|
780
|
-
variant: "tertiary",
|
|
781
|
-
prependIcon: "close",
|
|
782
|
-
textColor: "system-error-300",
|
|
783
|
-
onClick: () => {
|
|
784
|
-
u.value = null, A.value = null, c.value = null;
|
|
785
|
-
}
|
|
786
|
-
}), B(Z.FmButton, {
|
|
787
|
-
variant: "tertiary",
|
|
788
|
-
prependIcon: "check",
|
|
789
|
-
textColor: "system-success-300",
|
|
790
|
-
onClick: async () => {
|
|
791
|
-
if (!u.value || i.value.length === 0) {
|
|
792
|
-
c.value = !1, d.open({
|
|
793
|
-
type: "error",
|
|
794
|
-
message: "Please select date and restaurants to schedule publish."
|
|
795
|
-
});
|
|
796
|
-
return;
|
|
797
|
-
} else
|
|
798
|
-
c.value = !0;
|
|
799
|
-
}
|
|
800
|
-
})]) : B("div", {
|
|
801
|
-
class: "flex justify-between items-center gap-32"
|
|
802
|
-
}, [B("div", {
|
|
803
|
-
class: "flex flex-col w-full gap-4"
|
|
804
|
-
}, [B("div", {
|
|
805
|
-
class: "flex items-center gap-8"
|
|
806
|
-
}, [B("p", {
|
|
807
|
-
class: `fm-typo-en-body-md-400 ${v[g].textColor}`
|
|
808
|
-
}, v[g].label), ...g === J.enum.RUNNING ? [B("p", {
|
|
809
|
-
class: `fm-typo-en-body-md-400 ${v[g].textColor}`
|
|
810
|
-
}, `(${r.original.progress}/${r.original.total_restaurants})`)] : []]), B(Pt, {
|
|
811
|
-
bgcolor: v[g].backgroundColor,
|
|
812
|
-
completed: g === J.enum.PENDING ? 0 : g === J.enum.RUNNING ? Math.floor((r.original.progress ?? 0) / parseInt(r.original.total_restaurants) * 100) : (g === J.enum.COMPLETED, 100)
|
|
813
|
-
})]), B(Z.FmButton, {
|
|
814
|
-
variant: "plain",
|
|
815
|
-
prependIcon: "info",
|
|
816
|
-
disabled: Array.isArray(r.original.restaurantPublishStatus),
|
|
817
|
-
onClick: () => {
|
|
818
|
-
_.open({
|
|
819
|
-
title: b("menu.publish.scheduler_publish.restaurant_publish_details.title"),
|
|
820
|
-
contentComponent: ut,
|
|
821
|
-
contentComponentProps: {
|
|
822
|
-
restaurantPublishStatus: r.original.restaurantPublishStatus,
|
|
823
|
-
statusMap: v
|
|
824
|
-
},
|
|
825
|
-
contentClass: "flex flex-col h-full"
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
}), B(Z.FmButton, {
|
|
829
|
-
variant: "tertiary",
|
|
830
|
-
prependIcon: "delete",
|
|
831
|
-
disabled: g !== J.enum.PENDING,
|
|
832
|
-
textColor: "system-error-300",
|
|
833
|
-
onClick: () => {
|
|
834
|
-
const R = z(r.original.date).toISOString();
|
|
835
|
-
_.open({
|
|
836
|
-
title: "Confirm Remove",
|
|
837
|
-
message: "Are you sure you want to remove this scheduled publish? This action cannot be undone.",
|
|
838
|
-
primaryActions: {
|
|
839
|
-
text: "Remove",
|
|
840
|
-
close: !1
|
|
841
|
-
},
|
|
842
|
-
secondaryActions: {
|
|
843
|
-
text: "Cancel",
|
|
844
|
-
close: !0
|
|
845
|
-
}
|
|
846
|
-
}).onPrimary(() => {
|
|
847
|
-
e.deleteSchedulerPublish(R).then(() => {
|
|
848
|
-
d.open({
|
|
849
|
-
type: "success",
|
|
850
|
-
message: "Scheduled publish deleted successfully."
|
|
851
|
-
});
|
|
852
|
-
}).catch(() => {
|
|
853
|
-
d.open({
|
|
854
|
-
type: "error",
|
|
855
|
-
message: "Failed to delete scheduled publish. Please try again."
|
|
856
|
-
});
|
|
857
|
-
}).finally(() => {
|
|
858
|
-
_.close();
|
|
859
|
-
});
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
})]);
|
|
863
|
-
}
|
|
864
|
-
}];
|
|
865
|
-
ie(async () => {
|
|
866
|
-
await e.getNextSchedulerPublish();
|
|
867
|
-
});
|
|
868
|
-
const A = I(null);
|
|
869
|
-
function H() {
|
|
870
|
-
c.value = !1, A.value = {
|
|
871
|
-
date: "new",
|
|
872
|
-
restaurantsIds: []
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
de(c, async (r) => {
|
|
876
|
-
r && (t("publishMenu", {
|
|
877
|
-
schedulerTime: u.value,
|
|
878
|
-
restaurantIds: i.value
|
|
879
|
-
}), await e.getNextSchedulerPublish(), u.value = null, i.value = [], c.value = !1, A.value = null, c.value = null);
|
|
880
|
-
});
|
|
881
|
-
const w = we(() => c.value !== null && c.value === !1, () => {
|
|
882
|
-
k.value = !1, A.value = null, u.value = null, i.value = [], c.value = null;
|
|
883
|
-
});
|
|
884
|
-
return (r, g) => {
|
|
885
|
-
const V = M("FmButton"), R = M("FmTable"), O = M("FmSideSheet");
|
|
886
|
-
return y(), F(j, null, [Ae(r.$slots, "default", {
|
|
887
|
-
trigger: l
|
|
888
|
-
}), h(O, {
|
|
889
|
-
modelValue: k.value,
|
|
890
|
-
"onUpdate:modelValue": g[1] || (g[1] = (S) => k.value = S),
|
|
891
|
-
"close-button": !1,
|
|
892
|
-
"max-width": 800,
|
|
893
|
-
"onOn:clickedAway": m(w)
|
|
894
|
-
}, {
|
|
895
|
-
"side-sheet-header": T(() => [f("div", It, [h(V, {
|
|
896
|
-
variant: m(fe).Tertiary,
|
|
897
|
-
"prepend-icon": "arrow_back",
|
|
898
|
-
onClick: te(m(w), ["stop"])
|
|
899
|
-
}, null, 8, ["variant", "onClick"]), f("p", Mt, E(m(b)("menu.publish.actions.publish_progress")), 1)])]),
|
|
900
|
-
default: T(() => [f("div", null, [h(R, {
|
|
901
|
-
class: "pb-8",
|
|
902
|
-
"row-data": [...o.value, A.value].filter(Boolean),
|
|
903
|
-
"column-defs": D,
|
|
904
|
-
"shrink-at": !1,
|
|
905
|
-
pageSize: o.value.length + (A.value ? 1 : 0),
|
|
906
|
-
"hide-footer": ""
|
|
907
|
-
}, null, 8, ["row-data", "pageSize"]), m(e).state.featureFlags.schedulerPublish && !A.value ? (y(), K(V, {
|
|
908
|
-
key: 0,
|
|
909
|
-
variant: m(fe).Plain,
|
|
910
|
-
"prepend-icon": "add",
|
|
911
|
-
label: m(b)("menu.publish.actions.add_scheduler_publish"),
|
|
912
|
-
onClick: g[0] || (g[0] = () => H())
|
|
913
|
-
}, null, 8, ["variant", "label"])) : Q("", !0)])]),
|
|
914
|
-
_: 1
|
|
915
|
-
}, 8, ["modelValue", "onOn:clickedAway"])], 64);
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
}), Dt = { class: "fm-typo-en-title-md-600" }, At = { class: "mt-40" }, Nt = { class: "fm-typo-en-title-sm-600" }, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4 mb-8" }, Ut = { class: "flex gap-8 items-center justify-start" }, Ot = /* @__PURE__ */ G({
|
|
919
|
-
__name: "UpdateCatalogDialog",
|
|
920
|
-
props: {
|
|
921
|
-
catalogs: {
|
|
922
|
-
type: Array,
|
|
923
|
-
required: !0
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
emits: ["onComplete"],
|
|
927
|
-
setup(N, { expose: x, emit: s }) {
|
|
928
|
-
const { t: b } = X(), d = N;
|
|
929
|
-
x({
|
|
930
|
-
show: n,
|
|
931
|
-
hide: o
|
|
932
|
-
});
|
|
933
|
-
const _ = s;
|
|
934
|
-
function p() {
|
|
935
|
-
return {
|
|
936
|
-
restaurantId: "",
|
|
937
|
-
catalogId: void 0,
|
|
938
|
-
takeawayCatalog: void 0,
|
|
939
|
-
pickupCatalog: null,
|
|
940
|
-
additionalCatalogs: []
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
const v = U(() => [
|
|
944
|
-
{
|
|
945
|
-
label: b("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
946
|
-
value: null
|
|
947
|
-
},
|
|
948
|
-
...d.catalogs.map((c) => ({
|
|
949
|
-
label: c.name,
|
|
950
|
-
value: c._id
|
|
951
|
-
}))
|
|
952
|
-
]), e = U(() => [
|
|
953
|
-
{
|
|
954
|
-
label: b("menu.publish.update_catalog_dialog.sections.default.use_default"),
|
|
955
|
-
value: null
|
|
956
|
-
},
|
|
957
|
-
...d.catalogs.map((c) => ({
|
|
958
|
-
label: c.name,
|
|
959
|
-
value: c._id
|
|
960
|
-
}))
|
|
961
|
-
]), k = I(p()), l = I(!1), t = I(void 0);
|
|
962
|
-
function n(c) {
|
|
963
|
-
t.value = c ? pe(c) : p(), k.value = pe(t.value), l.value = !0;
|
|
964
|
-
}
|
|
965
|
-
function o() {
|
|
966
|
-
l.value = !1;
|
|
967
|
-
}
|
|
968
|
-
const i = we(
|
|
969
|
-
() => !ze.isEqual(t.value, k.value),
|
|
970
|
-
() => {
|
|
971
|
-
o();
|
|
972
|
-
}
|
|
973
|
-
);
|
|
974
|
-
function u() {
|
|
975
|
-
o(), _("onComplete", k.value);
|
|
976
|
-
}
|
|
977
|
-
return (c, D) => {
|
|
978
|
-
const A = M("FmSelect"), H = M("FmCheckbox"), w = M("FmButton"), r = M("FmSideSheet");
|
|
979
|
-
return y(), K(r, {
|
|
980
|
-
modelValue: l.value,
|
|
981
|
-
"onUpdate:modelValue": D[5] || (D[5] = (g) => l.value = g),
|
|
982
|
-
"max-width": 560,
|
|
983
|
-
"onOn:clickedAway": m(i)
|
|
984
|
-
}, {
|
|
985
|
-
"side-sheet-header": T(() => [
|
|
986
|
-
f("span", Dt, E(m(b)("menu.publish.update_catalog_dialog.title")), 1)
|
|
987
|
-
]),
|
|
988
|
-
"side-sheet-footer": T(() => [
|
|
989
|
-
f("div", Ut, [
|
|
990
|
-
h(w, {
|
|
991
|
-
label: m(b)("menu.publish.update_catalog_dialog.actions.update"),
|
|
992
|
-
size: "lg",
|
|
993
|
-
variant: "primary",
|
|
994
|
-
onClick: D[4] || (D[4] = () => u())
|
|
995
|
-
}, null, 8, ["label"]),
|
|
996
|
-
h(w, {
|
|
997
|
-
label: m(b)("menu.publish.update_catalog_dialog.actions.cancel"),
|
|
998
|
-
size: "lg",
|
|
999
|
-
variant: "tertiary",
|
|
1000
|
-
onClick: o
|
|
1001
|
-
}, null, 8, ["label"])
|
|
1002
|
-
])
|
|
1003
|
-
]),
|
|
1004
|
-
default: T(() => [
|
|
1005
|
-
h(A, {
|
|
1006
|
-
modelValue: k.value.catalogId,
|
|
1007
|
-
"onUpdate:modelValue": D[0] || (D[0] = (g) => k.value.catalogId = g),
|
|
1008
|
-
items: v.value,
|
|
1009
|
-
class: "mb-24",
|
|
1010
|
-
label: m(b)("menu.publish.update_catalog_dialog.sections.default.label")
|
|
1011
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
1012
|
-
h(A, {
|
|
1013
|
-
modelValue: k.value.takeawayCatalog,
|
|
1014
|
-
"onUpdate:modelValue": D[1] || (D[1] = (g) => k.value.takeawayCatalog = g),
|
|
1015
|
-
items: e.value,
|
|
1016
|
-
class: "mb-24",
|
|
1017
|
-
label: m(b)("menu.publish.update_catalog_dialog.sections.pos_takeaway.label")
|
|
1018
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
1019
|
-
h(A, {
|
|
1020
|
-
modelValue: k.value.pickupCatalog,
|
|
1021
|
-
"onUpdate:modelValue": D[2] || (D[2] = (g) => k.value.pickupCatalog = g),
|
|
1022
|
-
items: e.value,
|
|
1023
|
-
label: m(b)("menu.publish.update_catalog_dialog.sections.pickup.label")
|
|
1024
|
-
}, null, 8, ["modelValue", "items", "label"]),
|
|
1025
|
-
f("div", At, [
|
|
1026
|
-
f("div", Nt, E(m(b)("menu.publish.update_catalog_dialog.sections.additional.title")), 1),
|
|
1027
|
-
f("div", Rt, E(m(b)("menu.publish.update_catalog_dialog.sections.additional.subtitle")), 1),
|
|
1028
|
-
(y(!0), F(j, null, W(N.catalogs, (g) => (y(), F("div", {
|
|
1029
|
-
key: g._id
|
|
1030
|
-
}, [
|
|
1031
|
-
h(H, {
|
|
1032
|
-
modelValue: k.value.additionalCatalogs,
|
|
1033
|
-
"onUpdate:modelValue": D[3] || (D[3] = (V) => k.value.additionalCatalogs = V),
|
|
1034
|
-
label: g.name,
|
|
1035
|
-
value: g._id
|
|
1036
|
-
}, null, 8, ["modelValue", "label", "value"])
|
|
1037
|
-
]))), 128))
|
|
1038
|
-
])
|
|
1039
|
-
]),
|
|
1040
|
-
_: 1
|
|
1041
|
-
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
}), Bt = {
|
|
1045
|
-
class: "flex flex-col p-24 bg-fm-color-neutral-white min-h-[calc(100dvh-56px)] xs:max-h-[calc(100dvh-56px)]"
|
|
1046
|
-
}, Tt = {
|
|
1047
|
-
class: "flex items-center xs:mb-8 mb-24"
|
|
1048
|
-
}, Et = {
|
|
1049
|
-
class: "mr-8"
|
|
1050
|
-
}, zt = {
|
|
1051
|
-
class: "fm-typo-en-title-md-600"
|
|
1052
|
-
}, Lt = {
|
|
1053
|
-
class: "xs:hidden mr-16"
|
|
1054
|
-
}, jt = {
|
|
1055
|
-
class: "xs:hidden mr-16"
|
|
1056
|
-
}, Yt = {
|
|
1057
|
-
class: "xs:hidden"
|
|
1058
|
-
}, Kt = {
|
|
1059
|
-
class: "pb-8 flex justify-between items-start xs:flex-col xs:items-stretch gap-8"
|
|
1060
|
-
}, Ht = {
|
|
1061
|
-
class: "grow flex flex-col gap-4"
|
|
1062
|
-
}, qt = {
|
|
1063
|
-
class: "flex gap-8 items-center"
|
|
1064
|
-
}, Gt = {
|
|
1065
|
-
class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
1066
|
-
}, Jt = {
|
|
1067
|
-
class: "space-y-4"
|
|
1068
|
-
}, Wt = {
|
|
1069
|
-
class: "fm-typo-en-body-lg-600"
|
|
1070
|
-
}, Qt = {
|
|
1071
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1072
|
-
}, Xt = {
|
|
1073
|
-
class: "flex gap-8"
|
|
1074
|
-
}, Zt = {
|
|
1075
|
-
class: "xs:block hidden fixed bottom-72 right-16"
|
|
1076
|
-
}, ml = /* @__PURE__ */ G({
|
|
1077
|
-
__name: "Publish",
|
|
1078
|
-
setup(N) {
|
|
1079
|
-
const x = Re(), {
|
|
1080
|
-
t: s
|
|
1081
|
-
} = X(), b = ({
|
|
1082
|
-
row: a
|
|
1083
|
-
}) => {
|
|
1084
|
-
const C = a.status === "latest";
|
|
1085
|
-
return h(Ke, {
|
|
1086
|
-
label: s(C ? "menu.publish.table.status.latest" : "menu.publish.table.status.outdated"),
|
|
1087
|
-
variant: C ? "success" : "warning"
|
|
1088
|
-
}, null);
|
|
1089
|
-
}, d = I({}), _ = [{
|
|
1090
|
-
accessorKey: "name",
|
|
1091
|
-
header: () => s("menu.publish.table.columns.restaurant"),
|
|
1092
|
-
cell: (a) => a.getValue(),
|
|
1093
|
-
enableSorting: !0
|
|
1094
|
-
}, {
|
|
1095
|
-
accessorKey: "catalog",
|
|
1096
|
-
header: () => s("menu.publish.table.columns.default"),
|
|
1097
|
-
enableSorting: !1,
|
|
1098
|
-
cell: (a) => a.getValue().default
|
|
1099
|
-
}, {
|
|
1100
|
-
accessorKey: "catalog",
|
|
1101
|
-
header: () => s("menu.publish.table.columns.pos_takeaway"),
|
|
1102
|
-
enableSorting: !1,
|
|
1103
|
-
cell: (a) => a.getValue().takeaway
|
|
1104
|
-
}, {
|
|
1105
|
-
accessorKey: "catalog",
|
|
1106
|
-
header: () => s("menu.publish.table.columns.pickup"),
|
|
1107
|
-
enableSorting: !1,
|
|
1108
|
-
cell: (a) => a.getValue().pickup
|
|
1109
|
-
}, {
|
|
1110
|
-
accessorKey: "updatedAt",
|
|
1111
|
-
header: () => s("menu.publish.table.columns.version"),
|
|
1112
|
-
enableSorting: !1,
|
|
1113
|
-
cell: (a) => {
|
|
1114
|
-
const C = a.getValue();
|
|
1115
|
-
return o(C);
|
|
1116
|
-
}
|
|
1117
|
-
}, {
|
|
1118
|
-
accessorKey: "status",
|
|
1119
|
-
header: () => s("menu.common.labels.status"),
|
|
1120
|
-
enableSorting: !1,
|
|
1121
|
-
cell: (a) => h(b, {
|
|
1122
|
-
row: a.row.original
|
|
1123
|
-
}, null)
|
|
1124
|
-
}, {
|
|
1125
|
-
accessorKey: "_id",
|
|
1126
|
-
header: "",
|
|
1127
|
-
size: 52,
|
|
1128
|
-
enableSorting: !1,
|
|
1129
|
-
cell: (a) => {
|
|
1130
|
-
const C = a.row.original;
|
|
1131
|
-
return B("div", {
|
|
1132
|
-
class: "flex justify-end gap-8"
|
|
1133
|
-
}, [l.value && C.revertConfig ? qe(B(Z.FmButton, {
|
|
1134
|
-
prependIcon: "undo",
|
|
1135
|
-
variant: "secondary",
|
|
1136
|
-
onClick: te(async () => {
|
|
1137
|
-
await t(a.row.original);
|
|
1138
|
-
}, ["stop", "prevent"])
|
|
1139
|
-
}), s("menu.publish.actions.revert")) : null, B(Z.FmButton, {
|
|
1140
|
-
label: s("menu.publish.actions.publish"),
|
|
1141
|
-
icon: "ios_share",
|
|
1142
|
-
variant: "secondary",
|
|
1143
|
-
onClick: te(async () => {
|
|
1144
|
-
const $ = D(a.row.original);
|
|
1145
|
-
await r($);
|
|
1146
|
-
}, ["stop", "prevent"])
|
|
1147
|
-
})]);
|
|
1148
|
-
},
|
|
1149
|
-
meta: {
|
|
1150
|
-
width: "150px"
|
|
1151
|
-
}
|
|
1152
|
-
}], p = I(""), v = I(), e = _e(), k = ke(), l = U(() => e.version !== Le.enum.v3);
|
|
1153
|
-
async function t(a) {
|
|
1154
|
-
a.revertConfig && k.open({
|
|
1155
|
-
title: "Revert menu",
|
|
1156
|
-
contentComponent: Ze,
|
|
1157
|
-
contentComponentProps: {
|
|
1158
|
-
restaurant: a
|
|
1159
|
-
},
|
|
1160
|
-
primaryActions: {
|
|
1161
|
-
text: "Revert",
|
|
1162
|
-
close: !0
|
|
1163
|
-
},
|
|
1164
|
-
secondaryActions: {
|
|
1165
|
-
text: "Cancel",
|
|
1166
|
-
close: !0
|
|
1167
|
-
}
|
|
1168
|
-
}).onPrimary(async () => {
|
|
1169
|
-
await w.minor(async () => {
|
|
1170
|
-
await e.revertRestaurantMenu(a._id);
|
|
1171
|
-
}, {
|
|
1172
|
-
customId: a._id,
|
|
1173
|
-
message: `Revert menu of ${a.name}`
|
|
1174
|
-
});
|
|
1175
|
-
});
|
|
1176
|
-
}
|
|
1177
|
-
const n = U(() => s("menu.publish.labels.main_version", {
|
|
1178
|
-
version: o(e.state.menu.updatedAt)
|
|
1179
|
-
}));
|
|
1180
|
-
function o(a) {
|
|
1181
|
-
return a ? z(a).format("DD/MM/YYYY hh:mmA") : "";
|
|
1182
|
-
}
|
|
1183
|
-
const i = U(() => e.state.menu.modules.catalog), u = U(() => w.queue.value.some((a) => a.id === e.state.menu._id));
|
|
1184
|
-
function c(a) {
|
|
1185
|
-
var C;
|
|
1186
|
-
return a ? ((C = i.value.find(($) => $._id === a)) == null ? void 0 : C.name) ?? s("menu.publish.labels.catalog.invalid") : s("menu.publish.labels.catalog.main");
|
|
1187
|
-
}
|
|
1188
|
-
function D(a) {
|
|
1189
|
-
return {
|
|
1190
|
-
restaurantId: a._id,
|
|
1191
|
-
catalogId: a.catalogId,
|
|
1192
|
-
takeawayCatalog: a.takeawayCatalog,
|
|
1193
|
-
pickupCatalog: a.pickupCatalog || null,
|
|
1194
|
-
additionalCatalogs: a.additionalCatalogs
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
function A(a) {
|
|
1198
|
-
var $;
|
|
1199
|
-
const C = D(a);
|
|
1200
|
-
($ = v.value) == null || $.show(C);
|
|
1201
|
-
}
|
|
1202
|
-
const H = ce(), w = ve(H);
|
|
1203
|
-
async function r(a) {
|
|
1204
|
-
var $;
|
|
1205
|
-
const C = ($ = V.value.find((q) => q._id === a.restaurantId)) == null ? void 0 : $.name;
|
|
1206
|
-
await w.minor(async () => await e.publishMenu(a), {
|
|
1207
|
-
customId: e.state.menu._id,
|
|
1208
|
-
message: `Publishing menu for ${C}`,
|
|
1209
|
-
successMessage: `Published to ${C}`
|
|
1210
|
-
});
|
|
1211
|
-
}
|
|
1212
|
-
const g = I(null), V = U(() => {
|
|
1213
|
-
const a = p.value.toLowerCase(), C = e.state.menu.updatedAt;
|
|
1214
|
-
return e.state.restaurants.filter(($) => {
|
|
1215
|
-
var q;
|
|
1216
|
-
return !g.value || ((q = g.value) == null ? void 0 : q.includes($._id));
|
|
1217
|
-
}).map(($) => ({
|
|
1218
|
-
...$,
|
|
1219
|
-
catalog: {
|
|
1220
|
-
default: c($.catalogId),
|
|
1221
|
-
takeaway: c($.takeawayCatalog),
|
|
1222
|
-
pickup: c($.pickupCatalog)
|
|
1223
|
-
},
|
|
1224
|
-
status: C === $.updatedAt ? "latest" : "outdated"
|
|
1225
|
-
})).filter(($) => Ue($, R.value)).filter(({
|
|
1226
|
-
name: $,
|
|
1227
|
-
catalog: q
|
|
1228
|
-
}) => a ? $.toLowerCase().includes(a) || q.default.toLowerCase().includes(a) || q.takeaway.toLowerCase().includes(a) || q.pickup.toLowerCase().includes(a) : !0);
|
|
1229
|
-
}), R = I({
|
|
1230
|
-
logic: "AND",
|
|
1231
|
-
rules: []
|
|
1232
|
-
}), O = [{
|
|
1233
|
-
type: "string",
|
|
1234
|
-
key: "status",
|
|
1235
|
-
entity: "menu",
|
|
1236
|
-
values: ["latest", "outdated"]
|
|
1237
|
-
}], S = I(0), L = I(null), ee = I(null), se = I(null);
|
|
1238
|
-
async function Se() {
|
|
1239
|
-
await w.minor(async () => await e.readRestaurants(), {
|
|
1240
|
-
customId: e.state.menu._id
|
|
1241
|
-
}), await e.getNextSchedulerPublish(), e.runningPublishJob !== null ? L.value === null && (L.value = setInterval(async () => {
|
|
1242
|
-
await oe();
|
|
1243
|
-
}, 3e4)) : (se.value && (H.close(se.value), se.value = null), L.value !== null && (clearInterval(L.value), L.value = null), ee.value = null);
|
|
1244
|
-
}
|
|
1245
|
-
async function ne(a) {
|
|
1246
|
-
if (u.value) return;
|
|
1247
|
-
const C = Object.keys(d.value).filter((Y) => d.value[Y]), $ = C.length === 0 || C.length === V.value.length ? V.value : V.value.filter((Y) => C.includes(Y._id));
|
|
1248
|
-
if (a ? a.restaurantIds.length === e.state.restaurants.length : V.value.length === e.state.restaurants.length && (C.length === 0 || C.length === V.value.length))
|
|
1249
|
-
await w.minor(async () => {
|
|
1250
|
-
await e.publishAllMenu(a == null ? void 0 : a.schedulerTime);
|
|
1251
|
-
}, {
|
|
1252
|
-
successMessage: "Menu publish registered for all restaurants."
|
|
1253
|
-
}), ee.value = !1;
|
|
1254
|
-
else {
|
|
1255
|
-
const Y = (a == null ? void 0 : a.restaurantIds) || $.map((ue) => ue._id);
|
|
1256
|
-
await w.minor(async () => {
|
|
1257
|
-
await e.publishMultipleMenu(Y, a == null ? void 0 : a.schedulerTime, !1);
|
|
1258
|
-
}, {
|
|
1259
|
-
successMessage: `Menu publish registered for ${a != null && a.restaurantIds ? a.restaurantIds.length : $.length} restaurant(s).`
|
|
1260
|
-
});
|
|
1261
|
-
}
|
|
1262
|
-
ee.value = !1, S.value = await e.getPublishRestaurantsProgress(), await e.getNextSchedulerPublish(), L.value !== null && (clearInterval(L.value), L.value = null), L.value = setInterval(async () => {
|
|
1263
|
-
await oe();
|
|
1264
|
-
}, 3e4);
|
|
1265
|
-
}
|
|
1266
|
-
async function oe() {
|
|
1267
|
-
await e.getNextSchedulerPublish(), e.runningPublishJob !== null ? (ee.value = !1, S.value = await e.getPublishRestaurantsProgress()) : (ee.value = !0, L.value !== null && (clearInterval(L.value), L.value = null));
|
|
1268
|
-
}
|
|
1269
|
-
return de(() => S.value, async (a) => {
|
|
1270
|
-
await e.readRestaurants();
|
|
1271
|
-
}), ie(async () => {
|
|
1272
|
-
await e.getNextSchedulerPublish(), L.value === null && (L.value = setInterval(async () => {
|
|
1273
|
-
await oe();
|
|
1274
|
-
}, 3e4));
|
|
1275
|
-
}), Ne(() => {
|
|
1276
|
-
L.value != null && (clearInterval(L.value), L.value = null);
|
|
1277
|
-
}), (a, C) => {
|
|
1278
|
-
const $ = M("FmChip"), q = M("FmSpacer"), Y = M("FmButton"), ue = M("FmBadge"), Fe = M("FmSearch"), Pe = M("FmTable"), Ie = M("FmListItem"), Me = M("FmList");
|
|
1279
|
-
return y(), F(j, null, [f("div", Bt, [f("div", Tt, [f("div", Et, [f("div", zt, E(m(s)("menu.publish.title")), 1)]), h($, {
|
|
1280
|
-
label: n.value,
|
|
1281
|
-
class: "xs:hidden text-fm-color-primary bg-fm-color-system-warning-100"
|
|
1282
|
-
}, null, 8, ["label"]), h(q), f("div", Lt, [h(Y, {
|
|
1283
|
-
disabled: u.value,
|
|
1284
|
-
label: m(s)("menu.publish.actions.refresh"),
|
|
1285
|
-
variant: "secondary",
|
|
1286
|
-
onClick: C[0] || (C[0] = () => Se())
|
|
1287
|
-
}, null, 8, ["disabled", "label"])]), f("div", jt, [h($t, {
|
|
1288
|
-
progress: S.value,
|
|
1289
|
-
restaurants: V.value,
|
|
1290
|
-
onPublishMenu: C[1] || (C[1] = (P) => ne(P))
|
|
1291
|
-
}, {
|
|
1292
|
-
default: T(({
|
|
1293
|
-
trigger: P
|
|
1294
|
-
}) => [m(e).runningPublishJob !== null ? (y(), K(ue, {
|
|
1295
|
-
key: 0,
|
|
1296
|
-
variant: "critical",
|
|
1297
|
-
value: 1
|
|
1298
|
-
}, {
|
|
1299
|
-
default: T(() => [h(Y, {
|
|
1300
|
-
variant: "secondary",
|
|
1301
|
-
disabled: u.value,
|
|
1302
|
-
label: m(s)("menu.publish.actions.publish_progress"),
|
|
1303
|
-
onClick: P
|
|
1304
|
-
}, null, 8, ["disabled", "label", "onClick"])]),
|
|
1305
|
-
_: 2
|
|
1306
|
-
}, 1024)) : (y(), K(Y, {
|
|
1307
|
-
key: 1,
|
|
1308
|
-
variant: "secondary",
|
|
1309
|
-
disabled: u.value,
|
|
1310
|
-
label: m(s)("menu.publish.actions.publish_progress"),
|
|
1311
|
-
onClick: P
|
|
1312
|
-
}, null, 8, ["disabled", "label", "onClick"]))]),
|
|
1313
|
-
_: 1
|
|
1314
|
-
}, 8, ["progress", "restaurants"])]), f("div", Yt, [h(Y, {
|
|
1315
|
-
disabled: u.value,
|
|
1316
|
-
icon: "ios_share",
|
|
1317
|
-
label: m(s)("menu.publish.actions.publish_all"),
|
|
1318
|
-
variant: "primary",
|
|
1319
|
-
onClick: C[2] || (C[2] = () => ne())
|
|
1320
|
-
}, null, 8, ["disabled", "label"])])]), f("div", Kt, [h(m(ye), {
|
|
1321
|
-
multiple: "",
|
|
1322
|
-
modelValue: g.value,
|
|
1323
|
-
"onUpdate:modelValue": C[4] || (C[4] = (P) => g.value = P)
|
|
1324
|
-
}, {
|
|
1325
|
-
"append-right": T(() => [h(m(Oe), {
|
|
1326
|
-
modelValue: R.value,
|
|
1327
|
-
"onUpdate:modelValue": C[3] || (C[3] = (P) => R.value = P),
|
|
1328
|
-
attributes: O
|
|
1329
|
-
}, null, 8, ["modelValue"])]),
|
|
1330
|
-
_: 1
|
|
1331
|
-
}, 8, ["modelValue"]), h(Fe, {
|
|
1332
|
-
modelValue: p.value,
|
|
1333
|
-
"onUpdate:modelValue": C[5] || (C[5] = (P) => p.value = P),
|
|
1334
|
-
autofocus: "",
|
|
1335
|
-
class: "w-[320px] xs:w-full",
|
|
1336
|
-
placeholder: m(s)("menu.publish.table.search.placeholder")
|
|
1337
|
-
}, null, 8, ["modelValue", "placeholder"])]), V.value.length > 0 ? (y(), F(j, {
|
|
1338
|
-
key: 0
|
|
1339
|
-
}, [h(Ce, {
|
|
1340
|
-
class: "xs:hidden block"
|
|
1341
|
-
}, {
|
|
1342
|
-
default: T(() => [h(Pe, {
|
|
1343
|
-
modelValue: d.value,
|
|
1344
|
-
"onUpdate:modelValue": C[6] || (C[6] = (P) => d.value = P),
|
|
1345
|
-
"get-row-id": (P) => P._id,
|
|
1346
|
-
"column-defs": _,
|
|
1347
|
-
loading: u.value,
|
|
1348
|
-
"page-size": V.value.length,
|
|
1349
|
-
"row-data": V.value,
|
|
1350
|
-
shrinkAt: !1,
|
|
1351
|
-
virtual: !0,
|
|
1352
|
-
selection: "multiple",
|
|
1353
|
-
"hide-footer": "",
|
|
1354
|
-
"pin-header-row": "",
|
|
1355
|
-
onRowClick: C[7] || (C[7] = (P) => A(P.original))
|
|
1356
|
-
}, null, 8, ["modelValue", "get-row-id", "loading", "page-size", "row-data"])]),
|
|
1357
|
-
_: 1
|
|
1358
|
-
}), h(Me, {
|
|
1359
|
-
class: "flex-col flex-1 min-h-0 overflow-auto xs:flex hidden w-full pb-64",
|
|
1360
|
-
separator: ""
|
|
1361
|
-
}, {
|
|
1362
|
-
default: T(() => [(y(!0), F(j, null, W(V.value, (P) => (y(), K(Ie, {
|
|
1363
|
-
key: P._id,
|
|
1364
|
-
label: P.name,
|
|
1365
|
-
style: {
|
|
1366
|
-
padding: "12px 0 !important"
|
|
1367
|
-
},
|
|
1368
|
-
onClick: () => A(P)
|
|
1369
|
-
}, {
|
|
1370
|
-
default: T(() => [f("div", Ht, [f("div", qt, [f("div", Gt, E(o(P.updatedAt)), 1), h(b, {
|
|
1371
|
-
row: P
|
|
1372
|
-
}, null, 8, ["row"])]), f("div", Jt, [f("div", Wt, E(P.name), 1), f("div", Qt, [f("div", null, "Default: " + E(P.catalog.default), 1), f("div", null, "POS takeaway: " + E(P.catalog.takeaway), 1), f("div", null, "Pickup: " + E(P.catalog.pickup), 1)])])]), f("div", Xt, [l.value && P.revertConfig ? (y(), K(Y, {
|
|
1373
|
-
key: 0,
|
|
1374
|
-
disabled: u.value,
|
|
1375
|
-
icon: "undo",
|
|
1376
|
-
variant: "tertiary",
|
|
1377
|
-
onClick: te(() => t(P), ["stop"])
|
|
1378
|
-
}, null, 8, ["disabled", "onClick"])) : Q("", !0), h(Y, {
|
|
1379
|
-
disabled: u.value,
|
|
1380
|
-
icon: "ios_share",
|
|
1381
|
-
variant: "tertiary",
|
|
1382
|
-
onClick: te(() => r(D(P)), ["stop"])
|
|
1383
|
-
}, null, 8, ["disabled", "onClick"])])]),
|
|
1384
|
-
_: 2
|
|
1385
|
-
}, 1032, ["label", "onClick"]))), 128))]),
|
|
1386
|
-
_: 1
|
|
1387
|
-
})], 64)) : (y(), K(m(be), {
|
|
1388
|
-
key: 1,
|
|
1389
|
-
title: m(s)("menu.publish.empty.title"),
|
|
1390
|
-
subtitle: m(s)("menu.publish.empty.subtitle"),
|
|
1391
|
-
action: {
|
|
1392
|
-
text: m(s)("menu.publish.empty.action"),
|
|
1393
|
-
icon: "add",
|
|
1394
|
-
callback: () => {
|
|
1395
|
-
m(x).push({
|
|
1396
|
-
name: "$settings-my-business"
|
|
1397
|
-
});
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
}, null, 8, ["title", "subtitle", "action"]))]), f("div", Zt, [h(Y, {
|
|
1401
|
-
disabled: u.value,
|
|
1402
|
-
icon: "ios_share",
|
|
1403
|
-
label: m(s)("menu.publish.actions.publish_all"),
|
|
1404
|
-
variant: "fab",
|
|
1405
|
-
onClick: C[8] || (C[8] = () => ne())
|
|
1406
|
-
}, null, 8, ["disabled", "label"])]), h(Ot, {
|
|
1407
|
-
ref_key: "updateCatalogDialogRef",
|
|
1408
|
-
ref: v,
|
|
1409
|
-
catalogs: i.value,
|
|
1410
|
-
onOnComplete: r
|
|
1411
|
-
}, null, 8, ["catalogs"])], 64);
|
|
1412
|
-
};
|
|
1413
|
-
}
|
|
1414
|
-
});
|
|
1415
|
-
export {
|
|
1416
|
-
ml as default
|
|
1417
|
-
};
|