@feedmepos/mf-report 5.21.45 → 5.21.46

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.
Files changed (28) hide show
  1. package/dist/App-DUh6U-OB.js +272 -0
  2. package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-CcZBwZrG.js → BaseDialog.vue_vue_type_script_setup_true_lang-yBoJyNC8.js} +35 -6
  3. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-FajTQaEF.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-tB8numVw.js} +2 -2
  4. package/dist/{Default.vue_vue_type_script_setup_true_lang-D8Anmn3U.js → Default.vue_vue_type_script_setup_true_lang-Cfl5Ct4b.js} +2 -2
  5. package/dist/{FilterSelector.vue_vue_type_script_setup_true_lang-C3dnlKD1.js → FilterSelector.vue_vue_type_script_setup_true_lang-DuhjAzQP.js} +1000 -988
  6. package/dist/{InsightView-BcaNLAio.js → InsightView-DkIcQpCD.js} +6 -6
  7. package/dist/{Integration-B2oUigBV.js → Integration-C0f0Q2os.js} +3 -3
  8. package/dist/{Integrations-BXs7ebr_.js → Integrations-BM_vRj0F.js} +3 -3
  9. package/dist/{Layout-B7UzdpMO.js → Layout-C4YVePzi.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CxcGWRnH.js → MenuTab.vue_vue_type_script_setup_true_lang-a72Tflwl.js} +5 -5
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DRC8oo7m.js → NavigationTab.vue_vue_type_script_setup_true_lang-5oGeza_s.js} +5 -5
  12. package/dist/{NoData.vue_vue_type_script_setup_true_lang-COEmI1sC.js → NoData.vue_vue_type_script_setup_true_lang-DYFzIaeX.js} +1 -1
  13. package/dist/{OverviewView-CylqH3pr.js → OverviewView-AKRzXwKb.js} +5 -5
  14. package/dist/{Report-YSloja2n.js → Report-aKG6wWUi.js} +4 -4
  15. package/dist/{ReportEditor-D4uSvRt1.js → ReportEditor-ZRBQHo6K.js} +6 -6
  16. package/dist/{ReportView-Dzd79Cmz.js → ReportView-cWqrG_Nd.js} +8 -8
  17. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-Bx_tLA09.js → SelectComponent.vue_vue_type_script_setup_true_lang-J0guqNmX.js} +1 -1
  18. package/dist/{Setting-BFXBp6DS.js → Setting-BXEPHSGB.js} +5 -5
  19. package/dist/TileEditor-Bqhu78EZ.js +2919 -0
  20. package/dist/{TransitionFade-CdTx6vpZ.js → TransitionFade-CXHZsIPF.js} +6 -6
  21. package/dist/{app-Doxhqiyk.js → app-Fb6OY58U.js} +74 -74
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-Bf22-3_a.js → formatChartData.worker-DAwFx8Qz.js} +31 -2
  24. package/dist/assets/{processTableData.worker-GbyPQNAF.js → processTableData.worker-CGM71S-g.js} +31 -2
  25. package/dist/{vue-i18n-DViZeYne.js → vue-i18n-DLsuRxx8.js} +1 -1
  26. package/package.json +1 -1
  27. package/dist/App-YB3K2Pla.js +0 -270
  28. package/dist/TileEditor-DcuHmPe3.js +0 -2899
@@ -3,7 +3,7 @@ var Cr = (e, t, n) => t in e ? wr(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var Ft = (e, t, n) => Cr(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { defineStore as Gt, storeToRefs as et } from "pinia";
5
5
  import { ref as ue, computed as Ne, readonly as Qn, getCurrentInstance as cA, inject as pr, shallowRef as Br, watch as XA, onMounted as hr, onUnmounted as Er, defineComponent as FA, h as ho, createVNode as Dr, Text as xr, Fragment as Eo } from "vue";
6
- import { d as Z, c as Hr } from "./app-Doxhqiyk.js";
6
+ import { d as Z, c as Hr } from "./app-Fb6OY58U.js";
7
7
  import "@vue/devtools-api";
8
8
  const Xr = "mf-reportquery-store", te = Gt(Xr, () => {
9
9
  const e = ue(""), t = ue(""), n = ue("MY");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-report",
3
- "version": "5.21.45",
3
+ "version": "5.21.46",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,270 +0,0 @@
1
- import { defineComponent as se, resolveComponent as Q, createBlock as ie, openBlock as R, unref as d, isRef as _e, withCtx as U, createElementVNode as M, createVNode as V, toDisplayString as ee, createTextVNode as Oe, onMounted as ue, watch as b, ref as $, computed as te, onBeforeMount as we, onBeforeUnmount as Ee, createElementBlock as j, Fragment as ke } from "vue";
2
- import { detectLocale as B, useCoreStore as z } from "@feedmepos/mf-common";
3
- import { u as Ae, a as $e, b as ne, c as Be, d as Ne, e as Te, f as Fe, s as xe } from "./vue-i18n-DViZeYne.js";
4
- import { storeToRefs as q } from "pinia";
5
- import { u as re, a as Je, b as Ue } from "./BaseDialog.vue_vue_type_script_setup_true_lang-CcZBwZrG.js";
6
- import { u as je, _ as ze } from "./NavigationTab.vue_vue_type_script_setup_true_lang-DRC8oo7m.js";
7
- import { u as oe } from "./message-dialog-UoMWOnil.js";
8
- import { d as u } from "./app-Doxhqiyk.js";
9
- import { useRoute as Qe, useRouter as Ve } from "vue-router";
10
- const Pe = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, We = /* @__PURE__ */ se({
11
- __name: "Dialog",
12
- setup(L) {
13
- const { t: s } = Ae(), f = oe(), { isOpened: c, message: S, title: I } = q(oe());
14
- return (l, g) => {
15
- const C = Q("FmButton"), N = Q("FmDialog");
16
- return R(), ie(N, {
17
- modelValue: d(c),
18
- "onUpdate:modelValue": g[0] || (g[0] = (T) => _e(c) ? c.value = T : null),
19
- overlay: "",
20
- "close-button": !1
21
- }, {
22
- "dialog-header": U(() => [
23
- Oe(ee(d(I)), 1)
24
- ]),
25
- default: U(() => [
26
- M("p", Pe, ee(d(S)), 1)
27
- ]),
28
- "dialog-footer": U(() => [
29
- g[1] || (g[1] = M("div", { class: "grow" }, null, -1)),
30
- V(C, {
31
- label: d(s)("report.common.cancel"),
32
- variant: "tertiary",
33
- onClick: d(f).dismiss
34
- }, null, 8, ["label", "onClick"]),
35
- V(C, {
36
- label: d(s)("report.common.confirm"),
37
- onClick: d(f).confirm
38
- }, null, 8, ["label", "onClick"])
39
- ]),
40
- _: 1
41
- }, 8, ["modelValue"]);
42
- };
43
- }
44
- }), ae = $(B());
45
- function Ge() {
46
- const L = (s) => {
47
- switch (ae.value = s, s) {
48
- case "zh-CN":
49
- u.locale("zh-cn");
50
- break;
51
- default:
52
- u.locale("en");
53
- break;
54
- }
55
- };
56
- return ue(() => {
57
- L(B());
58
- }), b(() => B(), L, { deep: !0, immediate: !0 }), {
59
- currentLocale: ae
60
- };
61
- }
62
- u.locale(B() === "zh-CN" ? "zh-cn" : "en");
63
- const He = ["src"], Ke = ["src"], ut = /* @__PURE__ */ se({
64
- __name: "App",
65
- setup(L) {
66
- const { businessId: s, token: f, country: c } = q($e()), { sessionUser: S, currentBusiness: I, currentCountry: l, registerSidebarComponent: g } = z(), { getRestaurantAndWarehouse: C, getBusinessSetting: N, beginBusinessLoad: T, completeBusinessLoad: ce } = ne(), { getFeatureFlags: de } = Be(), { version: m } = q(re()), { getSettings: le } = Ne(), { promptLoader: fe } = Te(), e = Qe(), P = Ve(), D = Je(), W = je(), i = ne(), me = re(), { suppressReportRouteSync: _ } = q(me), { getReports: pe, getOverviewReport: ge, getReportConfig: G, currentReportId: H } = D, { currentReportId: ye, reports: ve } = q(D), { getSchema: Se } = Ue(), { fetchSchedules: Ie } = W, { init: De } = Fe(), F = $("v5"), O = $(!1), w = $(!0), he = te(() => `https://portal-v1.feedme.cc/b/${s.value}/report/CLOSE_UP?showHeader=false&country=${c.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), Re = te(() => `https://report-v4.feedme.cc?businessId=${s.value}&country=${c.value}&token=${f.value}&reportV3Button=true`);
67
- b(
68
- [() => I.value, () => S.value, () => l.value],
69
- () => {
70
- var n, o;
71
- const t = ((n = I.value) == null ? void 0 : n.id) ?? "";
72
- if (I.value && S.value && l.value) {
73
- xe(l.value), s.value !== t && (s.value = t);
74
- let r = !1;
75
- c.value !== l.value && (r = !0), f.value = ((o = S.value) == null ? void 0 : o.token) ?? "", c.value = l.value ?? "", console.log("[debug 1]: route.query.businessId !== businessId.value || isCountryChanged, replacing router", `route.query.businessId!==businessId.value: ${e.query.businessId !== s.value}`, `isCountryChanged: ${r}`, `isInitialBusinessWatch.value: ${w.value}`), (e.query.businessId !== s.value || r) && !w.value && (console.log("[debug 1 detail]: country.value: ", c.value, "currentCountry.value: ", l.value), console.log("[debug 1 detail]: route.query.businessId: ", e.query.businessId, "businessId.value: ", s.value), P.replace({
76
- name: e.name,
77
- params: e.params,
78
- query: {
79
- ...e.query,
80
- businessId: s.value,
81
- country: l.value,
82
- isAllLocation: r ? "true" : e.query.isAllLocation,
83
- locationIds: r ? void 0 : e.query.locationIds
84
- }
85
- }));
86
- }
87
- },
88
- { immediate: !0 }
89
- );
90
- function K(t) {
91
- if (typeof t.data == "string")
92
- try {
93
- const n = JSON.parse(t.data);
94
- (n == null ? void 0 : n.token) !== "" && (n == null ? void 0 : n.token) !== void 0 && (f.value = n.token);
95
- } catch (n) {
96
- console.error(n);
97
- }
98
- }
99
- function X(t) {
100
- if (typeof t.data == "string")
101
- try {
102
- const n = JSON.parse(t.data);
103
- (n == null ? void 0 : n.v5) === !0 ? m.value = F.value : (n == null ? void 0 : n.v3) === !0 && (m.value = "v3");
104
- } catch (n) {
105
- console.error(n);
106
- }
107
- }
108
- b(m, () => {
109
- ["v3", "v4"].includes(m.value) ? z().hideSidebarToggle(!0) : z().hideSidebarToggle(!1);
110
- }), we(() => {
111
- g(ze);
112
- }), ue(() => {
113
- console.log("5.21.45", !0), window.addEventListener("message", K), window.addEventListener("message", X);
114
- }), Ee(() => {
115
- window.removeEventListener("message", K), window.removeEventListener("message", X), D.$dispose(), W.$dispose();
116
- });
117
- function be(t) {
118
- try {
119
- return decodeURIComponent(t);
120
- } catch {
121
- return t;
122
- }
123
- }
124
- function E(t) {
125
- if (typeof t != "string" || t.length === 0) return;
126
- const n = t.includes("%") ? [t, be(t)] : [t];
127
- for (const o of n)
128
- try {
129
- const r = JSON.parse(o);
130
- if (typeof r == "string")
131
- try {
132
- return JSON.parse(r);
133
- } catch {
134
- return r;
135
- }
136
- return r;
137
- } catch {
138
- }
139
- }
140
- function Y(t) {
141
- if (!t || typeof t != "object") return !1;
142
- const n = t;
143
- return typeof n.hour == "number" && typeof n.minute == "number";
144
- }
145
- function qe() {
146
- const t = e.query.startDate ? u(e.query.startDate).startOf("day").toISOString() : void 0, n = e.query.endDate ? u(e.query.endDate).endOf("day").toISOString() : void 0, o = typeof e.query.timeStart == "string", r = typeof e.query.timeEnd == "string", p = E(e.query.timeStart), h = E(e.query.timeEnd), k = Y(p) ? p : null, A = Y(h) ? h : null, x = e.query.compareStartDate ? u(e.query.compareStartDate).startOf("day").toISOString() : void 0, J = e.query.compareEndDate ? u(e.query.compareEndDate).endOf("day").toISOString() : void 0, Z = e.query.isAllLocation === "true" || e.query.isAllLocation === void 0;
147
- let y = [];
148
- if (Z)
149
- y = i.selectedLocationIds;
150
- else {
151
- const a = E(e.query.locationIds);
152
- y = Array.isArray(a) ? a : [];
153
- }
154
- let v = e.query.reportId || H;
155
- if (ve.value.find((a) => a.id === v) || (v = H), v && v !== D.currentReportId && D.updateCurrentReportId(v), t || n) {
156
- const a = i.dateRange;
157
- (a.startDate !== t || a.endDate !== n) && i.setDateRange({ startDate: t, endDate: n });
158
- }
159
- if (o || r) {
160
- const a = i.timeRange;
161
- (a.start !== k || a.end !== A) && i.setTimeRange({ start: k, end: A });
162
- }
163
- if (x || J) {
164
- const a = i.compareDateRange;
165
- (a.startDate !== x || a.endDate !== J) && i.setCompareDateRange({
166
- startDate: x,
167
- endDate: J
168
- });
169
- }
170
- if (!Z && Array.isArray(y)) {
171
- const a = i.selectedLocationIds;
172
- a.length === y.length && a.every((Le, Ce) => Le === y[Ce]) || i.setSelectedLocationIds(y);
173
- }
174
- return {
175
- // TODO: this returned value can used for getBusinessSetting
176
- reportId: v,
177
- startDate: e.query.startDate,
178
- endDate: e.query.endDate,
179
- timeStart: e.query.timeStart,
180
- timeEnd: e.query.timeEnd,
181
- compareStartDate: e.query.compareStartDate,
182
- compareEndDate: e.query.compareEndDate,
183
- locationIds: typeof e.query.locationIds == "string" ? e.query.locationIds : void 0,
184
- isAllLocation: e.query.isAllLocation
185
- };
186
- }
187
- return b(
188
- () => s.value,
189
- async (t) => {
190
- t !== "" && (O.value = !1, T(t), _.value !== void 0 && (_.value = !0), await fe(async () => {
191
- await De({
192
- apiKey: "6GhcttsJ9Rj9cTevcdrpin",
193
- url: "https://flag.feedme.farm/api/v1/",
194
- enableAnalytics: !1,
195
- cacheFlags: !1
196
- });
197
- const n = await G();
198
- F.value = n.version, m.value = F.value, await Promise.all([
199
- de(),
200
- G(),
201
- ge(),
202
- pe(),
203
- Se(),
204
- Ie(),
205
- C(
206
- (() => {
207
- const o = E(e.query.locationIds);
208
- return Array.isArray(o) ? o : void 0;
209
- })()
210
- ),
211
- le()
212
- ]), await N(), qe(), ce(t);
213
- }), O.value = !0, w.value && (w.value = !1));
214
- },
215
- {
216
- immediate: !0
217
- }
218
- ), b(
219
- () => (O.value, {
220
- reportId: ye.value,
221
- selectedLocationIds: i.selectedLocationIds,
222
- dateRange: i.dateRange,
223
- timeRange: i.timeRange,
224
- compareDateRange: i.compareDateRange
225
- }),
226
- (t) => {
227
- if (!O.value || !t.reportId) return;
228
- if (_.value) {
229
- _.value = !1;
230
- return;
231
- }
232
- const n = t.selectedLocationIds, o = t.dateRange, r = t.timeRange, p = t.compareDateRange, h = {
233
- ...e.query,
234
- reportId: t.reportId,
235
- startDate: o.startDate ? u(o.startDate).startOf("day").toISOString() : void 0,
236
- endDate: o.endDate ? u(o.endDate).endOf("day").toISOString() : void 0,
237
- compareStartDate: p.startDate ? u(p.startDate).startOf("day").toISOString() : void 0,
238
- compareEndDate: p.endDate ? u(p.endDate).endOf("day").toISOString() : void 0,
239
- timeStart: r.start ? JSON.stringify(r.start) : void 0,
240
- timeEnd: r.end ? JSON.stringify(r.end) : void 0,
241
- locationIds: n.length === i.locations.length ? void 0 : n.length > 0 ? JSON.stringify(n) : void 0,
242
- isAllLocation: String(n.length === i.locations.length)
243
- }, k = JSON.stringify(e.query), A = JSON.stringify(h);
244
- k !== A && P.replace({
245
- name: e.name,
246
- params: e.params,
247
- query: h
248
- });
249
- },
250
- { deep: !0 }
251
- ), Ge(), (t, n) => {
252
- const o = Q("router-view");
253
- return R(), j(ke, null, [
254
- V(We),
255
- d(m) === "v3" ? (R(), j("iframe", {
256
- key: 0,
257
- class: "bg-white h-full w-full",
258
- src: he.value
259
- }, null, 8, He)) : d(m) === "v4" ? (R(), j("iframe", {
260
- key: 1,
261
- class: "bg-white h-full w-full",
262
- src: Re.value
263
- }, null, 8, Ke)) : (R(), ie(o, { key: 2 }))
264
- ], 64);
265
- };
266
- }
267
- });
268
- export {
269
- ut as default
270
- };