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