@feedmepos/mf-report 5.31.3-beta.0 → 5.32.0-beta.0

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 (40) hide show
  1. package/dist/App-o4z-EAO1.js +339 -0
  2. package/dist/{DateRangeSelect-AJd7gYva.js → DateRangeSelect-DO3T_rQs.js} +18 -18
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CIVlgjSX.js → Default.vue_vue_type_script_setup_true_lang-CW_VllVL.js} +1 -1
  4. package/dist/DigestListView-DG-vojKl.js +637 -0
  5. package/dist/DigestReaderView-bRfEYtZA.js +507 -0
  6. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BKHx9p3R.js → DynamicWidget.vue_vue_type_script_setup_true_lang-Bfmd5eMI.js} +173 -173
  7. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-qQi-7kuX.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-vy0FZKv0.js} +154 -154
  8. package/dist/{InsightView-noFPHcRY.js → InsightView-sLKiFc_-.js} +16 -16
  9. package/dist/{Integration-UwZP3vYt.js → Integration-CZn5gvF8.js} +3 -3
  10. package/dist/{Integrations-BMhJuw20.js → Integrations-I0rHAfPo.js} +2 -2
  11. package/dist/{Layout-CofH0rzo.js → Layout-DPEfiH3f.js} +1 -1
  12. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-BsdJx7gt.js → LocationSelect.vue_vue_type_script_setup_true_lang-DFQ943gj.js} +2 -2
  13. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BMJHW2E2.js → MenuTab.vue_vue_type_script_setup_true_lang-BjJcvN_z.js} +9 -9
  14. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-b6hgoVnw.js → NavigationTab.vue_vue_type_script_setup_true_lang-zUF-G98m.js} +6 -6
  15. package/dist/{OverviewView-V-KcUYld.js → OverviewView-CJS82eII.js} +5 -5
  16. package/dist/{Report-Cxfxa7EK.js → Report-DDYgnr3v.js} +30 -30
  17. package/dist/ReportCanvasView-m_qW7QgV.js +966 -0
  18. package/dist/{ReportEditor-syPuiUDA.js → ReportEditor-CrMd2q2a.js} +7 -7
  19. package/dist/{ReportView-Dqc89voW.js → ReportView-CKLzDw5j.js} +6 -6
  20. package/dist/{ReportViewRoute-BE4Olg2t.js → ReportViewRoute-BrLi7iXr.js} +2 -2
  21. package/dist/{Setting-CSZG2_pc.js → Setting-BUmSYXCO.js} +3 -3
  22. package/dist/{Template-DE8y5xA7.js → Template-CljYVpCi.js} +18 -18
  23. package/dist/{TileEditor-DCLCIQqG.js → TileEditor-3fV8xOVc.js} +6 -6
  24. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-BKM30woJ.js → TilePageStack.vue_vue_type_script_setup_true_lang-Biwl30EU.js} +2 -2
  25. package/dist/{TransitionFade-DSKakW7L.js → TransitionFade-BUSdiKFH.js} +5 -5
  26. package/dist/{app-BxEbZEnS.js → app-BXVd3ce-.js} +3354 -2967
  27. package/dist/app.js +4 -4
  28. package/dist/assets/{formatChartData.worker-R9EGYsk6.js → formatChartData.worker-BprlZnJs.js} +80 -58
  29. package/dist/assets/{processTableData.worker-CxpDa0tB.js → processTableData.worker-D5GSFMnH.js} +83 -61
  30. package/dist/{currency-lmnrd1Gz.js → currency-C6h0cwip.js} +1 -1
  31. package/dist/{index-Co3j0l3d.js → index-BoeJLw2U.js} +1279 -1244
  32. package/dist/{report-Dsp2krIZ.js → report-DG-20Pq8.js} +18 -18
  33. package/dist/report-canvas-libs/components-1.js +1126 -71
  34. package/dist/report-canvas-libs/geo-outlines-1.js +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist/useDigestFont-Gf1l5qYq.js +205 -0
  37. package/dist/{ReportCanvasView-DDNkVmlA.js → useReportCanvasPanel-CquUHqIK.js} +2933 -3477
  38. package/dist/{useRestaurantPermission-D8xwhBHn.js → useRestaurantPermission-BNu9cN13.js} +1 -1
  39. package/package.json +1 -1
  40. package/dist/App-j08Hk0tX.js +0 -339
@@ -2,7 +2,7 @@ import { computed as u } from "vue";
2
2
  import { u as c } from "./_plugin-vue_export-helper-C6QDExPN.js";
3
3
  import { useSnackbar as f } from "@feedmepos/ui-library";
4
4
  import { useCoreStore as d } from "@feedmepos/mf-common";
5
- import { X as l, Y as i } from "./app-BxEbZEnS.js";
5
+ import { a2 as l, a3 as i } from "./app-BXVd3ce-.js";
6
6
  function g(t) {
7
7
  return Array.isArray(t) ? t : [];
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-report",
3
- "version": "5.31.3-beta.0",
3
+ "version": "5.32.0-beta.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,339 +0,0 @@
1
- import { defineComponent as me, resolveComponent as X, createBlock as pe, openBlock as A, unref as u, isRef as Oe, withCtx as P, createElementVNode as re, createVNode as Z, toDisplayString as ae, createTextVNode as $e, onMounted as fe, watch as C, ref as Q, computed as se, onBeforeMount as xe, onBeforeUnmount as Je, createElementBlock as G, Fragment as Qe } from "vue";
2
- import { detectLocale as U, useCoreStore as H } from "@feedmepos/mf-common";
3
- import { d as V, u as Ue, a as ie, b as je, c as ce, e as We, f as Ke, g as de, t as Pe, z as Ge, h as He } from "./app-BxEbZEnS.js";
4
- import { storeToRefs as k } from "pinia";
5
- import { u as Xe } from "./global-loader-BuxFfehu.js";
6
- import { u as Ze, a as Ve } from "./report-Dsp2krIZ.js";
7
- import { u as Ye, _ as Me } from "./NavigationTab.vue_vue_type_script_setup_true_lang-b6hgoVnw.js";
8
- import { u as ue } from "./message-dialog-UoMWOnil.js";
9
- import { u as et } from "./_plugin-vue_export-helper-C6QDExPN.js";
10
- import { useRoute as tt, useRouter as nt } from "vue-router";
11
- const ot = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, rt = /* @__PURE__ */ me({
12
- __name: "Dialog",
13
- setup(q) {
14
- const { t: c } = et(), f = ue(), { isOpened: g, message: E, title: L } = k(ue());
15
- return (T, _) => {
16
- const z = X("FmButton"), j = X("FmDialog");
17
- return A(), pe(j, {
18
- modelValue: u(g),
19
- "onUpdate:modelValue": _[0] || (_[0] = (W) => Oe(g) ? g.value = W : null),
20
- overlay: "",
21
- "close-button": !1,
22
- "z-index": 3e3
23
- }, {
24
- "dialog-header": P(() => [
25
- $e(ae(u(L)), 1)
26
- ]),
27
- default: P(() => [
28
- re("p", ot, ae(u(E)), 1)
29
- ]),
30
- "dialog-footer": P(() => [
31
- _[1] || (_[1] = re("div", { class: "grow" }, null, -1)),
32
- Z(z, {
33
- label: u(c)("report.common.cancel"),
34
- variant: "tertiary",
35
- onClick: u(f).dismiss
36
- }, null, 8, ["label", "onClick"]),
37
- Z(z, {
38
- label: u(c)("report.common.confirm"),
39
- onClick: u(f).confirm
40
- }, null, 8, ["label", "onClick"])
41
- ]),
42
- _: 1
43
- }, 8, ["modelValue"]);
44
- };
45
- }
46
- }), le = Q(U());
47
- function at() {
48
- const q = (c) => {
49
- switch (le.value = c, c) {
50
- case "zh-CN":
51
- V.locale("zh-cn");
52
- break;
53
- default:
54
- V.locale("en");
55
- break;
56
- }
57
- };
58
- return fe(() => {
59
- q(U());
60
- }), C(() => U(), q, { deep: !0, immediate: !0 }), {
61
- currentLocale: le
62
- };
63
- }
64
- V.locale(U() === "zh-CN" ? "zh-cn" : "en");
65
- const st = ["src"], it = ["src"], St = /* @__PURE__ */ me({
66
- __name: "App",
67
- setup(q) {
68
- const { businessId: c, token: f, country: g } = k(Ue()), { sessionUser: E, currentBusiness: L, currentCountry: T, registerSidebarComponent: _ } = H(), {
69
- getRestaurantAndWarehouse: z,
70
- getBusinessSetting: j,
71
- beginBusinessLoad: W,
72
- completeBusinessLoad: ge,
73
- resetTimezoneContext: ye
74
- } = ie(), ve = je(), { getFeatureFlags: Se } = ve, { version: y } = k(ce()), { getSettings: De } = We(), { promptLoader: he } = Xe(), n = tt(), N = nt(), b = Ze(), Y = Ye(), a = ie(), B = ce(), { suppressReportRouteSync: F } = k(B), { getReports: Ie, getOverviewReport: _e, getReportConfig: Re, currentReportId: M } = b, { currentReportId: Ee, reports: Le } = k(b), { getSchema: be } = Ve(), { fetchSchedules: we } = Y, { init: Ae } = Ke(), K = Q("v5"), O = Q(!1), $ = Q(!0), Ce = se(() => `https://portal-v1.feedmedev.cc/b/${c.value}/report/CLOSE_UP?showHeader=false&country=${g.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), ke = se(() => `https://report-v4.feedmedev.cc?businessId=${c.value}&country=${g.value}&token=${f.value}&reportV3Button=true`);
75
- C(
76
- [() => L.value, () => E.value, () => T.value],
77
- () => {
78
- var e, o;
79
- const t = ((e = L.value) == null ? void 0 : e.id) ?? "";
80
- L.value && E.value && T.value && (c.value !== t && (c.value = t), f.value = ((o = E.value) == null ? void 0 : o.token) ?? "", g.value = T.value ?? "");
81
- },
82
- { immediate: !0 }
83
- );
84
- function ee(t) {
85
- if (typeof t.data == "string")
86
- try {
87
- const e = JSON.parse(t.data);
88
- (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (f.value = e.token);
89
- } catch (e) {
90
- console.error(e);
91
- }
92
- }
93
- function te(t) {
94
- if (typeof t.data == "string")
95
- try {
96
- const e = JSON.parse(t.data);
97
- (e == null ? void 0 : e.v5) === !0 ? y.value = K.value : (e == null ? void 0 : e.v3) === !0 && (y.value = "v3");
98
- } catch (e) {
99
- console.error(e);
100
- }
101
- }
102
- C(y, () => {
103
- ["v3", "v4"].includes(y.value) ? H().hideSidebarToggle(!0) : H().hideSidebarToggle(!1);
104
- }), xe(() => {
105
- _(Me);
106
- }), fe(() => {
107
- console.log("5.31.3-beta.0", !0), window.addEventListener("message", ee), window.addEventListener("message", te);
108
- }), Je(() => {
109
- window.removeEventListener("message", ee), window.removeEventListener("message", te), b.$dispose(), Y.$dispose();
110
- });
111
- function qe(t) {
112
- try {
113
- return decodeURIComponent(t);
114
- } catch {
115
- return t;
116
- }
117
- }
118
- function x(t) {
119
- if (typeof t != "string" || t.length === 0) return;
120
- const e = t.includes("%") ? [t, qe(t)] : [t];
121
- for (const o of e)
122
- try {
123
- const r = JSON.parse(o);
124
- if (typeof r == "string")
125
- try {
126
- return JSON.parse(r);
127
- } catch {
128
- return r;
129
- }
130
- return r;
131
- } catch {
132
- }
133
- }
134
- function ne(t) {
135
- if (!t || typeof t != "object") return !1;
136
- const e = t;
137
- return typeof e.hour == "number" && typeof e.minute == "number";
138
- }
139
- function l(t, e, o) {
140
- if (typeof t != "string" || t.length === 0) return;
141
- const r = Pe(t, o);
142
- return e === "start" ? Ge(r, o) : He(r, o);
143
- }
144
- function Te(t = n.query) {
145
- const e = t, o = a.timezone, r = l(e.startDate, "start", o), m = l(e.endDate, "end", o), i = typeof e.timeStart == "string", v = typeof e.timeEnd == "string", S = x(e.timeStart), D = x(e.timeEnd), w = ne(S) ? S : null, h = ne(D) ? D : null, R = l(e.compareStartDate, "start", o), d = l(e.compareEndDate, "end", o), J = e.isAllLocation === "true" || e.isAllLocation === void 0;
146
- let p = [];
147
- if (J)
148
- p = a.selectedLocationIds ?? [];
149
- else {
150
- const s = x(e.locationIds);
151
- p = Array.isArray(s) ? s : [];
152
- }
153
- let I = e.reportId || M;
154
- if (Le.value.find((s) => s.id === I) || (I = M), I && I !== b.currentReportId && b.updateCurrentReportId(I), r || m) {
155
- const s = a.dateRange;
156
- (s.startDate !== r || s.endDate !== m) && a.setDateRange({ startDate: r, endDate: m });
157
- }
158
- if (i || v) {
159
- const s = a.timeRange;
160
- (s.start !== w || s.end !== h) && a.setTimeRange({ start: w, end: h });
161
- }
162
- if (R || d) {
163
- const s = a.compareDateRange;
164
- (s.startDate !== R || s.endDate !== d) && a.setCompareDateRange({
165
- startDate: R,
166
- endDate: d
167
- });
168
- }
169
- if (!J) {
170
- const s = a.selectedLocationIds;
171
- s.length === p.length && s.every((Be, Fe) => Be === p[Fe]) || a.setSelectedLocationIds(p);
172
- }
173
- return {
174
- // TODO: this returned value can used for getBusinessSetting
175
- reportId: I,
176
- startDate: e.startDate,
177
- endDate: e.endDate,
178
- timeStart: e.timeStart,
179
- timeEnd: e.timeEnd,
180
- compareStartDate: e.compareStartDate,
181
- compareEndDate: e.compareEndDate,
182
- locationIds: typeof e.locationIds == "string" ? e.locationIds : void 0,
183
- isAllLocation: e.isAllLocation
184
- };
185
- }
186
- return C(
187
- () => c.value,
188
- async (t, e) => {
189
- if (t !== "") {
190
- O.value = !1, W(t);
191
- const o = "mf-report-prev-business-id", r = (() => {
192
- try {
193
- return sessionStorage.getItem(o);
194
- } catch {
195
- return null;
196
- }
197
- })(), m = !!r && r !== t;
198
- let i = { ...n.query }, v = !1;
199
- if (!$.value || e !== void 0 || m) {
200
- ye(), a.setSelectedLocationIds([]);
201
- const {
202
- locationIds: S,
203
- startDate: D,
204
- endDate: w,
205
- timeStart: h,
206
- timeEnd: R,
207
- compareStartDate: d,
208
- compareEndDate: J,
209
- ...p
210
- } = n.query;
211
- i = {
212
- ...p,
213
- isAllLocation: "true"
214
- }, v = !0, await N.replace({
215
- name: n.name,
216
- params: n.params,
217
- query: i
218
- });
219
- }
220
- F.value !== void 0 && (F.value = !0), await he(async () => {
221
- await Ae({
222
- apiKey: "MaGoXrEWuEJNpWgKTqseee",
223
- url: "https://flag.feedme.farm/api/v1/",
224
- enableAnalytics: !1,
225
- cacheFlags: !1
226
- });
227
- const S = await Re();
228
- K.value = S.version, y.value = K.value, await Se(), n.name === "template" && !B.canAccessTemplate() && await N.replace({
229
- name: "reports",
230
- query: n.query
231
- });
232
- const D = B.canAccess(
233
- de.report_accessOverview
234
- ), w = B.canAccess(
235
- de.report_accessIntegration
236
- ), h = [
237
- be(),
238
- we(),
239
- Ie(),
240
- z(
241
- (() => {
242
- const d = x(i.locationIds);
243
- return Array.isArray(d) ? d : void 0;
244
- })()
245
- )
246
- ];
247
- D && h.push(_e()), w && h.push(De());
248
- const R = await Promise.allSettled(h);
249
- for (const d of R)
250
- d.status === "rejected" && console.log(d.reason);
251
- if (await j(), Te(i), v) {
252
- const {
253
- locationIds: d,
254
- startDate: J,
255
- endDate: p,
256
- timeStart: I,
257
- timeEnd: ze,
258
- compareStartDate: s,
259
- compareEndDate: Ne,
260
- ...oe
261
- } = n.query;
262
- (n.query.locationIds !== void 0 || n.query.startDate !== void 0 || n.query.endDate !== void 0 || n.query.timeStart !== void 0 || n.query.timeEnd !== void 0 || n.query.compareStartDate !== void 0 || n.query.compareEndDate !== void 0 || n.query.isAllLocation !== "true") && await N.replace({
263
- name: n.name,
264
- params: n.params,
265
- query: {
266
- ...oe,
267
- isAllLocation: "true"
268
- }
269
- });
270
- }
271
- ge(t);
272
- try {
273
- sessionStorage.setItem(o, t);
274
- } catch {
275
- }
276
- }), O.value = !0, $.value && ($.value = !1);
277
- }
278
- },
279
- {
280
- immediate: !0
281
- }
282
- ), C(
283
- () => (O.value, {
284
- reportId: Ee.value,
285
- selectedLocationIds: a.selectedLocationIds,
286
- dateRange: a.dateRange,
287
- timeRange: a.timeRange,
288
- compareDateRange: a.compareDateRange,
289
- timezone: a.timezone
290
- }),
291
- (t) => {
292
- if (!O.value || !t.reportId || $.value) return;
293
- if (F.value) {
294
- F.value = !1;
295
- return;
296
- }
297
- const e = t.selectedLocationIds, o = t.dateRange, r = t.timeRange, m = t.compareDateRange, i = {
298
- ...n.query,
299
- reportId: t.reportId,
300
- startDate: l(o.startDate, "start", t.timezone),
301
- endDate: l(o.endDate, "end", t.timezone),
302
- compareStartDate: l(
303
- m.startDate,
304
- "start",
305
- t.timezone
306
- ),
307
- compareEndDate: l(m.endDate, "end", t.timezone),
308
- timeStart: r.start ? JSON.stringify(r.start) : void 0,
309
- timeEnd: r.end ? JSON.stringify(r.end) : void 0
310
- }, v = e.length === a.locations.length;
311
- i.isAllLocation = String(v), v ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
312
- const S = JSON.stringify(n.query), D = JSON.stringify(i);
313
- S !== D && N.replace({
314
- name: n.name,
315
- params: n.params,
316
- query: i
317
- });
318
- },
319
- { deep: !0 }
320
- ), at(), (t, e) => {
321
- const o = X("router-view");
322
- return A(), G(Qe, null, [
323
- Z(rt),
324
- u(y) === "v3" ? (A(), G("iframe", {
325
- key: 0,
326
- class: "bg-white h-full w-full",
327
- src: Ce.value
328
- }, null, 8, st)) : u(y) === "v4" ? (A(), G("iframe", {
329
- key: 1,
330
- class: "bg-white h-full w-full",
331
- src: ke.value
332
- }, null, 8, it)) : (A(), pe(o, { key: 2 }))
333
- ], 64);
334
- };
335
- }
336
- });
337
- export {
338
- St as default
339
- };