@feedmepos/mf-report 5.27.44 → 5.27.45-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 (28) hide show
  1. package/dist/App-BDN_oCWD.js +334 -0
  2. package/dist/{DateRangeSelect-CGnROjSA.js → DateRangeSelect-Cg1VmOTP.js} +1 -1
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-B0E17Ovn.js → Default.vue_vue_type_script_setup_true_lang-CqEWKcEI.js} +1 -1
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-DeajLQvr.js → DynamicWidget.vue_vue_type_script_setup_true_lang-yPSAIoY4.js} +808 -807
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CqKnPfjr.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-TDuMyvpD.js} +2234 -2227
  6. package/dist/{InsightView-DLi1JKj-.js → InsightView-DwcchpMl.js} +4 -4
  7. package/dist/{Integration-DcpEli4G.js → Integration-CCTAv2GE.js} +3 -3
  8. package/dist/{Integrations-FqE3NGWW.js → Integrations-H6r5l4n8.js} +2 -2
  9. package/dist/{Layout-B3w9ncrY.js → Layout-CHHE19a9.js} +1 -1
  10. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DEZ9szG8.js → MenuTab.vue_vue_type_script_setup_true_lang-Bp0NNmvl.js} +4 -4
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-hq2_fG5m.js → NavigationTab.vue_vue_type_script_setup_true_lang-PJl70Kps.js} +3 -3
  12. package/dist/{OverviewView-C2q5HVfG.js → OverviewView-BCopzhD8.js} +4 -4
  13. package/dist/{Report-CpD-PQMF.js → Report-vzjmZsgz.js} +34 -34
  14. package/dist/{ReportEditor-DY8bRLmi.js → ReportEditor-RFtyQYz9.js} +6 -6
  15. package/dist/{ReportView-kvAnnQQX.js → ReportView-Dw7Pyrof.js} +6 -6
  16. package/dist/Setting-CVCBXpgH.js +368 -0
  17. package/dist/{Template-C-whg_Qs.js → Template-D55ImnjL.js} +3 -3
  18. package/dist/{TileEditor-MvSW8uIv.js → TileEditor-UeAySh58.js} +5 -5
  19. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-cNbphYz8.js → TilePageStack.vue_vue_type_script_setup_true_lang-B-1x9lDM.js} +2 -2
  20. package/dist/{TransitionFade-DqK-1YJF.js → TransitionFade-D9bY1-O3.js} +4 -4
  21. package/dist/{app-Dpk_iYcH.js → app-be5FSDOt.js} +9264 -9269
  22. package/dist/app.js +1 -1
  23. package/dist/assets/{formatChartData.worker-NxArcyZE.js → formatChartData.worker-C93JSHxi.js} +5 -5
  24. package/dist/assets/{processTableData.worker-typkqQfh.js → processTableData.worker-BsZijJg_.js} +5 -5
  25. package/dist/{useRestaurantPermission-B5HIst3o.js → useRestaurantPermission-DSmmokEm.js} +1 -1
  26. package/package.json +2 -1
  27. package/dist/App-B-0VHXM1.js +0 -336
  28. package/dist/Setting-DIfsQKq7.js +0 -366
@@ -2,7 +2,7 @@ import { computed as u } from "vue";
2
2
  import { u as c } from "./_plugin-vue_export-helper-kkiiQoKl.js";
3
3
  import { useSnackbar as f } from "@feedmepos/ui-library";
4
4
  import { useCoreStore as d } from "@feedmepos/mf-common";
5
- import { Z as l, _ as i } from "./app-Dpk_iYcH.js";
5
+ import { Z as l, _ as i } from "./app-be5FSDOt.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.44",
3
+ "version": "5.27.45-beta.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -86,6 +86,7 @@
86
86
  "test:e2e:visual:linux": "bash scripts/run-visual-tests-linux.sh",
87
87
  "test:e2e:visual:update": "bash scripts/run-visual-tests-linux.sh --update-snapshots",
88
88
  "harness:dev": "vite --config tests/harness/vite.config.ts",
89
+ "gallery": "node scripts/build-screenshot-gallery.mjs",
89
90
  "capture:sanitize": "node scripts/sanitize-network-capture.mjs",
90
91
  "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
91
92
  "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
@@ -1,336 +0,0 @@
1
- import { defineComponent as me, resolveComponent as Y, createBlock as pe, openBlock as C, unref as u, isRef as Ne, withCtx as W, createElementVNode as oe, createVNode as Z, toDisplayString as se, createTextVNode as $e, onMounted as fe, watch as k, ref as U, computed as ie, onBeforeMount as xe, onBeforeUnmount as Je, createElementBlock as H, Fragment as Qe } from "vue";
2
- import { detectLocale as j, useCoreStore as V } from "@feedmepos/mf-common";
3
- import { d as T, u as Ue, a as ce, b as je, c as de, e as Pe, f as Ge, g as X } from "./app-Dpk_iYcH.js";
4
- import { storeToRefs as q } from "pinia";
5
- import { u as Ke, a as We } from "./_plugin-vue_export-helper-kkiiQoKl.js";
6
- import { u as He, a as Ve } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CqKnPfjr.js";
7
- import { u as Xe, _ as Ye } from "./NavigationTab.vue_vue_type_script_setup_true_lang-hq2_fG5m.js";
8
- import { u as ue } from "./message-dialog-UoMWOnil.js";
9
- import { useRoute as Ze, useRouter as Me } from "vue-router";
10
- const et = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, tt = /* @__PURE__ */ me({
11
- __name: "Dialog",
12
- setup(O) {
13
- const { t: c } = Ke(), g = ue(), { isOpened: y, message: R, title: L } = q(ue());
14
- return (z, _) => {
15
- const B = Y("FmButton"), P = Y("FmDialog");
16
- return C(), pe(P, {
17
- modelValue: u(y),
18
- "onUpdate:modelValue": _[0] || (_[0] = (G) => Ne(y) ? y.value = G : null),
19
- overlay: "",
20
- "close-button": !1,
21
- "z-index": 3e3
22
- }, {
23
- "dialog-header": W(() => [
24
- $e(se(u(L)), 1)
25
- ]),
26
- default: W(() => [
27
- oe("p", et, se(u(R)), 1)
28
- ]),
29
- "dialog-footer": W(() => [
30
- _[1] || (_[1] = oe("div", { class: "grow" }, null, -1)),
31
- Z(B, {
32
- label: u(c)("report.common.cancel"),
33
- variant: "tertiary",
34
- onClick: u(g).dismiss
35
- }, null, 8, ["label", "onClick"]),
36
- Z(B, {
37
- label: u(c)("report.common.confirm"),
38
- onClick: u(g).confirm
39
- }, null, 8, ["label", "onClick"])
40
- ]),
41
- _: 1
42
- }, 8, ["modelValue"]);
43
- };
44
- }
45
- }), le = U(j());
46
- function nt() {
47
- const O = (c) => {
48
- switch (le.value = c, c) {
49
- case "zh-CN":
50
- T.locale("zh-cn");
51
- break;
52
- default:
53
- T.locale("en");
54
- break;
55
- }
56
- };
57
- return fe(() => {
58
- O(j());
59
- }), k(() => j(), O, { deep: !0, immediate: !0 }), {
60
- currentLocale: le
61
- };
62
- }
63
- T.locale(j() === "zh-CN" ? "zh-cn" : "en");
64
- const rt = ["src"], at = ["src"], ft = /* @__PURE__ */ me({
65
- __name: "App",
66
- setup(O) {
67
- const { businessId: c, token: g, country: y } = q(Ue()), { sessionUser: R, currentBusiness: L, currentCountry: z, registerSidebarComponent: _ } = V(), {
68
- getRestaurantAndWarehouse: B,
69
- getBusinessSetting: P,
70
- beginBusinessLoad: G,
71
- completeBusinessLoad: ge,
72
- resetTimezoneContext: ye
73
- } = ce(), ve = je(), { getFeatureFlags: Se } = ve, { version: v } = q(de()), { getSettings: De } = Pe(), { promptLoader: he } = We(), n = Ze(), F = Me(), E = He(), M = Xe(), o = ce(), b = de(), { suppressReportRouteSync: N } = q(b), { getReports: Ie, getOverviewReport: _e, getReportConfig: Re, currentReportId: ee } = E, { currentReportId: Le, reports: Ee } = q(E), { getSchema: be } = Ve(), { fetchSchedules: we } = M, { init: Ae } = Ge(), K = U("v5"), $ = U(!1), x = U(!0), Ce = ie(() => `https://portal-v1.feedme.cc/b/${c.value}/report/CLOSE_UP?showHeader=false&country=${y.value.toUpperCase()}&menuOption=business-report&token=${g.value}&v2=true&reportV5Button=true`), ke = ie(() => `https://report-v4.feedme.cc?businessId=${c.value}&country=${y.value}&token=${g.value}&reportV3Button=true`);
74
- k(
75
- [() => L.value, () => R.value, () => z.value],
76
- () => {
77
- var e, r;
78
- const t = ((e = L.value) == null ? void 0 : e.id) ?? "";
79
- L.value && R.value && z.value && (c.value !== t && (c.value = t), g.value = ((r = R.value) == null ? void 0 : r.token) ?? "", y.value = z.value ?? "");
80
- },
81
- { immediate: !0 }
82
- );
83
- function te(t) {
84
- if (typeof t.data == "string")
85
- try {
86
- const e = JSON.parse(t.data);
87
- (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (g.value = e.token);
88
- } catch (e) {
89
- console.error(e);
90
- }
91
- }
92
- function ne(t) {
93
- if (typeof t.data == "string")
94
- try {
95
- const e = JSON.parse(t.data);
96
- (e == null ? void 0 : e.v5) === !0 ? v.value = K.value : (e == null ? void 0 : e.v3) === !0 && (v.value = "v3");
97
- } catch (e) {
98
- console.error(e);
99
- }
100
- }
101
- k(v, () => {
102
- ["v3", "v4"].includes(v.value) ? V().hideSidebarToggle(!0) : V().hideSidebarToggle(!1);
103
- }), xe(() => {
104
- _(Ye);
105
- }), fe(() => {
106
- console.log("5.27.44", !0), window.addEventListener("message", te), window.addEventListener("message", ne);
107
- }), Je(() => {
108
- window.removeEventListener("message", te), window.removeEventListener("message", ne), E.$dispose(), M.$dispose();
109
- });
110
- function qe(t) {
111
- try {
112
- return decodeURIComponent(t);
113
- } catch {
114
- return t;
115
- }
116
- }
117
- function J(t) {
118
- if (typeof t != "string" || t.length === 0) return;
119
- const e = t.includes("%") ? [t, qe(t)] : [t];
120
- for (const r of e)
121
- try {
122
- const a = JSON.parse(r);
123
- if (typeof a == "string")
124
- try {
125
- return JSON.parse(a);
126
- } catch {
127
- return a;
128
- }
129
- return a;
130
- } catch {
131
- }
132
- }
133
- function re(t) {
134
- if (!t || typeof t != "object") return !1;
135
- const e = t;
136
- return typeof e.hour == "number" && typeof e.minute == "number";
137
- }
138
- function l(t, e, r) {
139
- if (typeof t != "string" || t.length === 0) return;
140
- const a = t.includes("T") ? T(t).tz(r) : T.tz(t, r);
141
- return (e === "start" ? a.startOf("day") : a.endOf("day")).utc().toISOString();
142
- }
143
- function Te(t = n.query) {
144
- const e = t, r = o.timezone, a = l(e.startDate, "start", r), d = l(e.endDate, "end", r), i = typeof e.timeStart == "string", S = typeof e.timeEnd == "string", D = J(e.timeStart), h = J(e.timeEnd), w = re(D) ? D : null, A = re(h) ? h : null, m = l(e.compareStartDate, "start", r), p = l(e.compareEndDate, "end", r), Q = e.isAllLocation === "true" || e.isAllLocation === void 0;
145
- let f = [];
146
- if (Q)
147
- f = o.selectedLocationIds ?? [];
148
- else {
149
- const s = J(e.locationIds);
150
- f = Array.isArray(s) ? s : [];
151
- }
152
- let I = e.reportId || ee;
153
- if (Ee.value.find((s) => s.id === I) || (I = ee), I && I !== E.currentReportId && E.updateCurrentReportId(I), a || d) {
154
- const s = o.dateRange;
155
- (s.startDate !== a || s.endDate !== d) && o.setDateRange({ startDate: a, endDate: d });
156
- }
157
- if (i || S) {
158
- const s = o.timeRange;
159
- (s.start !== w || s.end !== A) && o.setTimeRange({ start: w, end: A });
160
- }
161
- if (m || p) {
162
- const s = o.compareDateRange;
163
- (s.startDate !== m || s.endDate !== p) && o.setCompareDateRange({
164
- startDate: m,
165
- endDate: p
166
- });
167
- }
168
- if (!Q) {
169
- const s = o.selectedLocationIds;
170
- s.length === f.length && s.every((Be, Fe) => Be === f[Fe]) || o.setSelectedLocationIds(f);
171
- }
172
- return {
173
- // TODO: this returned value can used for getBusinessSetting
174
- reportId: I,
175
- startDate: e.startDate,
176
- endDate: e.endDate,
177
- timeStart: e.timeStart,
178
- timeEnd: e.timeEnd,
179
- compareStartDate: e.compareStartDate,
180
- compareEndDate: e.compareEndDate,
181
- locationIds: typeof e.locationIds == "string" ? e.locationIds : void 0,
182
- isAllLocation: e.isAllLocation
183
- };
184
- }
185
- return k(
186
- () => c.value,
187
- async (t, e) => {
188
- if (t !== "") {
189
- $.value = !1, G(t);
190
- const r = "mf-report-prev-business-id", a = (() => {
191
- try {
192
- return sessionStorage.getItem(r);
193
- } catch {
194
- return null;
195
- }
196
- })(), d = !!a && a !== t;
197
- let i = { ...n.query }, S = !1;
198
- if (!x.value || e !== void 0 || d) {
199
- ye(), o.setSelectedLocationIds([]);
200
- const {
201
- locationIds: D,
202
- startDate: h,
203
- endDate: w,
204
- timeStart: A,
205
- timeEnd: m,
206
- compareStartDate: p,
207
- compareEndDate: Q,
208
- ...f
209
- } = n.query;
210
- i = {
211
- ...f,
212
- isAllLocation: "true"
213
- }, S = !0, await F.replace({
214
- name: n.name,
215
- params: n.params,
216
- query: i
217
- });
218
- }
219
- N.value !== void 0 && (N.value = !0), await he(async () => {
220
- await Ae({
221
- apiKey: "6GhcttsJ9Rj9cTevcdrpin",
222
- url: "https://flag.feedme.farm/api/v1/",
223
- enableAnalytics: !1,
224
- cacheFlags: !1
225
- });
226
- const D = await Re();
227
- K.value = D.version, v.value = K.value, await Se(), n.name === "template" && !b.canAccessTemplate() && await F.replace({
228
- name: "reports",
229
- query: n.query
230
- });
231
- const h = b.canAccess(
232
- X.report_accessOverview
233
- ), w = b.canAccess(
234
- X.report_accessSetting
235
- ), A = b.canAccess(
236
- X.report_accessIntegration
237
- ), m = [
238
- be(),
239
- we(),
240
- Ie(),
241
- B(
242
- (() => {
243
- const p = J(i.locationIds);
244
- return Array.isArray(p) ? p : void 0;
245
- })()
246
- )
247
- ];
248
- if (h && m.push(_e()), A && m.push(De()), await Promise.all(m), w && await P(), Te(i), S) {
249
- const {
250
- locationIds: p,
251
- startDate: Q,
252
- endDate: f,
253
- timeStart: I,
254
- timeEnd: Oe,
255
- compareStartDate: s,
256
- compareEndDate: ze,
257
- ...ae
258
- } = n.query;
259
- (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 F.replace({
260
- name: n.name,
261
- params: n.params,
262
- query: {
263
- ...ae,
264
- isAllLocation: "true"
265
- }
266
- });
267
- }
268
- ge(t);
269
- try {
270
- sessionStorage.setItem(r, t);
271
- } catch {
272
- }
273
- }), $.value = !0, x.value && (x.value = !1);
274
- }
275
- },
276
- {
277
- immediate: !0
278
- }
279
- ), k(
280
- () => ($.value, {
281
- reportId: Le.value,
282
- selectedLocationIds: o.selectedLocationIds,
283
- dateRange: o.dateRange,
284
- timeRange: o.timeRange,
285
- compareDateRange: o.compareDateRange,
286
- timezone: o.timezone
287
- }),
288
- (t) => {
289
- if (!$.value || !t.reportId || x.value) return;
290
- if (N.value) {
291
- N.value = !1;
292
- return;
293
- }
294
- const e = t.selectedLocationIds, r = t.dateRange, a = t.timeRange, d = t.compareDateRange, i = {
295
- ...n.query,
296
- reportId: t.reportId,
297
- startDate: l(r.startDate, "start", t.timezone),
298
- endDate: l(r.endDate, "end", t.timezone),
299
- compareStartDate: l(
300
- d.startDate,
301
- "start",
302
- t.timezone
303
- ),
304
- compareEndDate: l(d.endDate, "end", t.timezone),
305
- timeStart: a.start ? JSON.stringify(a.start) : void 0,
306
- timeEnd: a.end ? JSON.stringify(a.end) : void 0
307
- }, S = e.length === o.locations.length;
308
- i.isAllLocation = String(S), S ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
309
- const D = JSON.stringify(n.query), h = JSON.stringify(i);
310
- D !== h && F.replace({
311
- name: n.name,
312
- params: n.params,
313
- query: i
314
- });
315
- },
316
- { deep: !0 }
317
- ), nt(), (t, e) => {
318
- const r = Y("router-view");
319
- return C(), H(Qe, null, [
320
- Z(tt),
321
- u(v) === "v3" ? (C(), H("iframe", {
322
- key: 0,
323
- class: "bg-white h-full w-full",
324
- src: Ce.value
325
- }, null, 8, rt)) : u(v) === "v4" ? (C(), H("iframe", {
326
- key: 1,
327
- class: "bg-white h-full w-full",
328
- src: ke.value
329
- }, null, 8, at)) : (C(), pe(r, { key: 2 }))
330
- ], 64);
331
- };
332
- }
333
- });
334
- export {
335
- ft as default
336
- };