@feedmepos/mf-report 5.27.19 → 5.27.20-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 (25) hide show
  1. package/dist/App-BwW5ocdR.js +336 -0
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-DU00gMtu.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-CXEnUuuH.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-DqZav9EE.js → Default.vue_vue_type_script_setup_true_lang-VT31bBuh.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-D5-p6Dte.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DDEFaeAF.js} +3 -3
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-BZlXHYzg.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-BHbvneYo.js} +2 -2
  6. package/dist/{InsightView-ctgBO3zj.js → InsightView-D-TR2M5G.js} +4 -4
  7. package/dist/{Integration-Dixvhrgn.js → Integration-BGt5H6Nt.js} +3 -3
  8. package/dist/{Integrations-CwJKOpsF.js → Integrations-CEZDnwi8.js} +2 -2
  9. package/dist/{Layout-CKWucJsN.js → Layout-Cm9xskOw.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-D8zSinU4.js → MenuTab.vue_vue_type_script_setup_true_lang-BIXR6-l4.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-Bwrmuhdd.js → NavigationTab.vue_vue_type_script_setup_true_lang-B-1rsEYE.js} +3 -3
  12. package/dist/{OverviewView-TQdYqfHB.js → OverviewView-C7dP8jWl.js} +4 -4
  13. package/dist/{Report-DjxWgvmf.js → Report-CYWGTMLg.js} +3 -3
  14. package/dist/{ReportEditor-5S-tSoVR.js → ReportEditor-C9DgrCnf.js} +6 -6
  15. package/dist/{ReportView-CvcsnWrI.js → ReportView-D_JZkvya.js} +6 -6
  16. package/dist/{Setting-B_lmRkVq.js → Setting-BfSjc_0C.js} +3 -3
  17. package/dist/{Template-CWsLoonj.js → Template-CCtf8sLA.js} +3 -3
  18. package/dist/{TileEditor-BQ20Db33.js → TileEditor-BeDk288z.js} +5 -5
  19. package/dist/{TileGrid.vue_vue_type_script_setup_true_lang-1ueSfiGk.js → TileGrid.vue_vue_type_script_setup_true_lang-DFbzoHBj.js} +1 -1
  20. package/dist/{TransitionFade-0frvJ_jm.js → TransitionFade-wSGm4knH.js} +4 -4
  21. package/dist/{app-BHYwfe1u.js → app-D9H1foDc.js} +1708 -1689
  22. package/dist/app.js +1 -1
  23. package/dist/{useRestaurantPermission-C3af6MeH.js → useRestaurantPermission-afvn-YcV.js} +1 -1
  24. package/package.json +1 -1
  25. package/dist/App-EYxAVNPq.js +0 -321
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { X as e, i as o, Y as p } from "./app-BHYwfe1u.js";
2
+ import { X as e, i as o, Y as p } from "./app-D9H1foDc.js";
3
3
  export {
4
4
  e as FmApp,
5
5
  o as i18nMessages,
@@ -2,7 +2,7 @@ import { computed as u } from "vue";
2
2
  import { u as c } from "./_plugin-vue_export-helper-onplcgja.js";
3
3
  import { useSnackbar as f } from "@feedmepos/ui-library";
4
4
  import { useCoreStore as d } from "@feedmepos/mf-common";
5
- import { V as l, W as i } from "./app-BHYwfe1u.js";
5
+ import { V as l, W as i } from "./app-D9H1foDc.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.27.19",
3
+ "version": "5.27.20-beta.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,321 +0,0 @@
1
- import { defineComponent as ue, resolveComponent as X, createBlock as le, openBlock as C, unref as l, isRef as Fe, withCtx as G, createElementVNode as ae, createVNode as Y, toDisplayString as re, createTextVNode as Ne, onMounted as me, watch as k, ref as Q, computed as oe, onBeforeMount as $e, onBeforeUnmount as Be, createElementBlock as K, Fragment as xe } from "vue";
2
- import { detectLocale as U, useCoreStore as W } from "@feedmepos/mf-common";
3
- import { d, u as Je, a as se, b as Qe, c as ie, e as Ue, f as ze, s as je, t as H } from "./app-BHYwfe1u.js";
4
- import { storeToRefs as q } from "pinia";
5
- import { u as Ve, a as Pe } from "./_plugin-vue_export-helper-onplcgja.js";
6
- import { u as Ge, a as Ke } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-BZlXHYzg.js";
7
- import { u as We, _ as He } from "./NavigationTab.vue_vue_type_script_setup_true_lang-Bwrmuhdd.js";
8
- import { u as ce } from "./message-dialog-UoMWOnil.js";
9
- import { useRoute as Xe, useRouter as Ye } from "vue-router";
10
- const Ze = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Me = /* @__PURE__ */ ue({
11
- __name: "Dialog",
12
- setup(T) {
13
- const { t: c } = Ve(), g = ce(), { isOpened: S, message: L, title: E } = q(ce());
14
- return (O, _) => {
15
- const F = X("FmButton"), z = X("FmDialog");
16
- return C(), le(z, {
17
- modelValue: l(S),
18
- "onUpdate:modelValue": _[0] || (_[0] = (j) => Fe(S) ? S.value = j : null),
19
- overlay: "",
20
- "close-button": !1,
21
- "z-index": 3e3
22
- }, {
23
- "dialog-header": G(() => [
24
- Ne(re(l(E)), 1)
25
- ]),
26
- default: G(() => [
27
- ae("p", Ze, re(l(L)), 1)
28
- ]),
29
- "dialog-footer": G(() => [
30
- _[1] || (_[1] = ae("div", { class: "grow" }, null, -1)),
31
- Y(F, {
32
- label: l(c)("report.common.cancel"),
33
- variant: "tertiary",
34
- onClick: l(g).dismiss
35
- }, null, 8, ["label", "onClick"]),
36
- Y(F, {
37
- label: l(c)("report.common.confirm"),
38
- onClick: l(g).confirm
39
- }, null, 8, ["label", "onClick"])
40
- ]),
41
- _: 1
42
- }, 8, ["modelValue"]);
43
- };
44
- }
45
- }), de = Q(U());
46
- function et() {
47
- const T = (c) => {
48
- switch (de.value = c, c) {
49
- case "zh-CN":
50
- d.locale("zh-cn");
51
- break;
52
- default:
53
- d.locale("en");
54
- break;
55
- }
56
- };
57
- return me(() => {
58
- T(U());
59
- }), k(() => U(), T, { deep: !0, immediate: !0 }), {
60
- currentLocale: de
61
- };
62
- }
63
- d.locale(U() === "zh-CN" ? "zh-cn" : "en");
64
- const tt = ["src"], nt = ["src"], mt = /* @__PURE__ */ ue({
65
- __name: "App",
66
- setup(T) {
67
- const { businessId: c, token: g, country: S } = q(Je()), { sessionUser: L, currentBusiness: E, currentCountry: O, registerSidebarComponent: _ } = W(), { getRestaurantAndWarehouse: F, getBusinessSetting: z, beginBusinessLoad: j, completeBusinessLoad: fe } = se(), pe = Qe(), { getFeatureFlags: ge } = pe, { version: y } = q(ie()), { getSettings: Se } = Ue(), { promptLoader: ye } = Pe(), n = Xe(), N = Ye(), w = Ge(), Z = We(), o = se(), b = ie(), { suppressReportRouteSync: $ } = q(b), { getReports: ve, getOverviewReport: De, getReportConfig: Ie, currentReportId: M } = w, { currentReportId: he, reports: _e } = q(w), { getSchema: Re } = Ke(), { fetchSchedules: Le } = Z, { init: Ee } = ze(), V = Q("v5"), B = Q(!1), x = Q(!0), Oe = oe(() => `https://portal-v1.feedme.cc/b/${c.value}/report/CLOSE_UP?showHeader=false&country=${S.value.toUpperCase()}&menuOption=business-report&token=${g.value}&v2=true&reportV5Button=true`), we = oe(() => `https://report-v4.feedme.cc?businessId=${c.value}&country=${S.value}&token=${g.value}&reportV3Button=true`);
68
- k(
69
- [() => E.value, () => L.value, () => O.value],
70
- () => {
71
- var e, a;
72
- const t = ((e = E.value) == null ? void 0 : e.id) ?? "";
73
- E.value && L.value && O.value && (je(O.value), c.value !== t && (c.value = t), g.value = ((a = L.value) == null ? void 0 : a.token) ?? "", S.value = O.value ?? "");
74
- },
75
- { immediate: !0 }
76
- );
77
- function ee(t) {
78
- if (typeof t.data == "string")
79
- try {
80
- const e = JSON.parse(t.data);
81
- (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (g.value = e.token);
82
- } catch (e) {
83
- console.error(e);
84
- }
85
- }
86
- function te(t) {
87
- if (typeof t.data == "string")
88
- try {
89
- const e = JSON.parse(t.data);
90
- (e == null ? void 0 : e.v5) === !0 ? y.value = V.value : (e == null ? void 0 : e.v3) === !0 && (y.value = "v3");
91
- } catch (e) {
92
- console.error(e);
93
- }
94
- }
95
- k(y, () => {
96
- ["v3", "v4"].includes(y.value) ? W().hideSidebarToggle(!0) : W().hideSidebarToggle(!1);
97
- }), $e(() => {
98
- _(He);
99
- }), me(() => {
100
- console.log("5.27.19", !0), window.addEventListener("message", ee), window.addEventListener("message", te);
101
- }), Be(() => {
102
- window.removeEventListener("message", ee), window.removeEventListener("message", te), w.$dispose(), Z.$dispose();
103
- });
104
- function be(t) {
105
- try {
106
- return decodeURIComponent(t);
107
- } catch {
108
- return t;
109
- }
110
- }
111
- function J(t) {
112
- if (typeof t != "string" || t.length === 0) return;
113
- const e = t.includes("%") ? [t, be(t)] : [t];
114
- for (const a of e)
115
- try {
116
- const s = JSON.parse(a);
117
- if (typeof s == "string")
118
- try {
119
- return JSON.parse(s);
120
- } catch {
121
- return s;
122
- }
123
- return s;
124
- } catch {
125
- }
126
- }
127
- function ne(t) {
128
- if (!t || typeof t != "object") return !1;
129
- const e = t;
130
- return typeof e.hour == "number" && typeof e.minute == "number";
131
- }
132
- function Ae(t = n.query) {
133
- const e = t, a = e.startDate ? d(e.startDate).startOf("day").toISOString() : void 0, s = e.endDate ? d(e.endDate).endOf("day").toISOString() : void 0, m = typeof e.timeStart == "string", i = typeof e.timeEnd == "string", f = J(e.timeStart), v = J(e.timeEnd), D = ne(f) ? f : null, A = ne(v) ? v : null, R = e.compareStartDate ? d(e.compareStartDate).startOf("day").toISOString() : void 0, p = e.compareEndDate ? d(e.compareEndDate).endOf("day").toISOString() : void 0, I = e.isAllLocation === "true" || e.isAllLocation === void 0;
134
- let h = [];
135
- if (I)
136
- h = o.selectedLocationIds ?? [];
137
- else {
138
- const r = J(e.locationIds);
139
- h = Array.isArray(r) ? r : [];
140
- }
141
- let u = e.reportId || M;
142
- if (_e.value.find((r) => r.id === u) || (u = M), u && u !== w.currentReportId && w.updateCurrentReportId(u), a || s) {
143
- const r = o.dateRange;
144
- (r.startDate !== a || r.endDate !== s) && o.setDateRange({ startDate: a, endDate: s });
145
- }
146
- if (m || i) {
147
- const r = o.timeRange;
148
- (r.start !== D || r.end !== A) && o.setTimeRange({ start: D, end: A });
149
- }
150
- if (R || p) {
151
- const r = o.compareDateRange;
152
- (r.startDate !== R || r.endDate !== p) && o.setCompareDateRange({
153
- startDate: R,
154
- endDate: p
155
- });
156
- }
157
- if (!I) {
158
- const r = o.selectedLocationIds;
159
- r.length === h.length && r.every((P, Te) => P === h[Te]) || o.setSelectedLocationIds(h);
160
- }
161
- return {
162
- // TODO: this returned value can used for getBusinessSetting
163
- reportId: u,
164
- startDate: e.startDate,
165
- endDate: e.endDate,
166
- timeStart: e.timeStart,
167
- timeEnd: e.timeEnd,
168
- compareStartDate: e.compareStartDate,
169
- compareEndDate: e.compareEndDate,
170
- locationIds: typeof e.locationIds == "string" ? e.locationIds : void 0,
171
- isAllLocation: e.isAllLocation
172
- };
173
- }
174
- return k(
175
- () => c.value,
176
- async (t, e) => {
177
- if (t !== "") {
178
- B.value = !1, j(t);
179
- const a = "mf-report-prev-business-id", s = (() => {
180
- try {
181
- return sessionStorage.getItem(a);
182
- } catch {
183
- return null;
184
- }
185
- })(), m = !!s && s !== t;
186
- let i = { ...n.query }, f = !1;
187
- if (!x.value || e !== void 0 || m) {
188
- o.setSelectedLocationIds([]);
189
- const {
190
- locationIds: v,
191
- startDate: D,
192
- endDate: A,
193
- timeStart: R,
194
- timeEnd: p,
195
- compareStartDate: I,
196
- compareEndDate: h,
197
- ...u
198
- } = n.query;
199
- i = {
200
- ...u,
201
- isAllLocation: "true"
202
- }, f = !0, await N.replace({
203
- name: n.name,
204
- params: n.params,
205
- query: i
206
- });
207
- }
208
- $.value !== void 0 && ($.value = !0), await ye(async () => {
209
- await Ee({
210
- apiKey: "6GhcttsJ9Rj9cTevcdrpin",
211
- url: "https://flag.feedme.farm/api/v1/",
212
- enableAnalytics: !1,
213
- cacheFlags: !1
214
- });
215
- const v = await Ie();
216
- V.value = v.version, y.value = V.value, await ge(), n.name === "template" && !b.canAccessTemplate() && await N.replace({
217
- name: "reports",
218
- query: n.query
219
- });
220
- const D = b.canAccess(
221
- H.report_accessOverview
222
- ), A = b.canAccess(
223
- H.report_accessSetting
224
- ), R = b.canAccess(
225
- H.report_accessIntegration
226
- ), p = [
227
- Re(),
228
- Le(),
229
- ve(),
230
- F(
231
- (() => {
232
- const I = J(i.locationIds);
233
- return Array.isArray(I) ? I : void 0;
234
- })()
235
- )
236
- ];
237
- if (D && p.push(De()), R && p.push(Se()), await Promise.all(p), A && await z(), Ae(i), f) {
238
- const {
239
- locationIds: I,
240
- startDate: h,
241
- endDate: u,
242
- timeStart: Ce,
243
- timeEnd: r,
244
- compareStartDate: ke,
245
- compareEndDate: qe,
246
- ...P
247
- } = n.query;
248
- (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({
249
- name: n.name,
250
- params: n.params,
251
- query: {
252
- ...P,
253
- isAllLocation: "true"
254
- }
255
- });
256
- }
257
- fe(t);
258
- try {
259
- sessionStorage.setItem(a, t);
260
- } catch {
261
- }
262
- }), B.value = !0, x.value && (x.value = !1);
263
- }
264
- },
265
- {
266
- immediate: !0
267
- }
268
- ), k(
269
- () => (B.value, {
270
- reportId: he.value,
271
- selectedLocationIds: o.selectedLocationIds,
272
- dateRange: o.dateRange,
273
- timeRange: o.timeRange,
274
- compareDateRange: o.compareDateRange,
275
- timezone: o.timezone
276
- }),
277
- (t) => {
278
- if (!B.value || !t.reportId || x.value) return;
279
- if ($.value) {
280
- $.value = !1;
281
- return;
282
- }
283
- const e = t.selectedLocationIds, a = t.dateRange, s = t.timeRange, m = t.compareDateRange, i = {
284
- ...n.query,
285
- reportId: t.reportId,
286
- startDate: a.startDate ? d(a.startDate).startOf("day").toISOString() : void 0,
287
- endDate: a.endDate ? d(a.endDate).endOf("day").toISOString() : void 0,
288
- compareStartDate: m.startDate ? d(m.startDate).startOf("day").toISOString() : void 0,
289
- compareEndDate: m.endDate ? d(m.endDate).endOf("day").toISOString() : void 0,
290
- timeStart: s.start ? JSON.stringify(s.start) : void 0,
291
- timeEnd: s.end ? JSON.stringify(s.end) : void 0
292
- }, f = e.length === o.locations.length;
293
- i.isAllLocation = String(f), f ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
294
- const v = JSON.stringify(n.query), D = JSON.stringify(i);
295
- v !== D && N.replace({
296
- name: n.name,
297
- params: n.params,
298
- query: i
299
- });
300
- },
301
- { deep: !0 }
302
- ), et(), (t, e) => {
303
- const a = X("router-view");
304
- return C(), K(xe, null, [
305
- Y(Me),
306
- l(y) === "v3" ? (C(), K("iframe", {
307
- key: 0,
308
- class: "bg-white h-full w-full",
309
- src: Oe.value
310
- }, null, 8, tt)) : l(y) === "v4" ? (C(), K("iframe", {
311
- key: 1,
312
- class: "bg-white h-full w-full",
313
- src: we.value
314
- }, null, 8, nt)) : (C(), le(a, { key: 2 }))
315
- ], 64);
316
- };
317
- }
318
- });
319
- export {
320
- mt as default
321
- };