@feedmepos/mf-report 5.27.54 → 5.28.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 (37) hide show
  1. package/dist/{App-C6xpf-Q0.js → App-D_Cnt2_w.js} +69 -68
  2. package/dist/DateRangeSelect-B6QocR7V.js +437 -0
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-BwPZXC_d.js → Default.vue_vue_type_script_setup_true_lang-CjkYcdoD.js} +12 -11
  4. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BpgXiPBY.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DYxl_gjE.js} +182 -181
  5. package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CVShUWJC.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-5p7KJx1m.js} +5090 -5716
  6. package/dist/{InsightView-BYW66Wrv.js → InsightView-oBqB-x6Y.js} +17 -15
  7. package/dist/{Integration-DQPJBE-0.js → Integration-D83_ENwH.js} +27 -25
  8. package/dist/{Integrations-BW4H9lUS.js → Integrations-Dd-jSloN.js} +8 -7
  9. package/dist/{Layout-CMlh08aB.js → Layout-PVmjJ6ga.js} +1 -1
  10. package/dist/LocationSelect.vue_vue_type_script_setup_true_lang-PQKRv81p.js +8055 -0
  11. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BUvD1_b0.js → MenuTab.vue_vue_type_script_setup_true_lang-Cnwj0lIB.js} +11 -10
  12. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-TpeQ_Wm1.js → NavigationTab.vue_vue_type_script_setup_true_lang-B2IXNXS_.js} +9636 -17677
  13. package/dist/{OverviewView-BtGpQkBY.js → OverviewView-CAL_PAkw.js} +5 -5
  14. package/dist/{Report-CJ9myNLK.js → Report-C4tRHS9j.js} +27 -25
  15. package/dist/ReportCanvasView-BB90EGgP.js +448 -0
  16. package/dist/{ReportEditor-DtnTBbY1.js → ReportEditor-BHlH0__b.js} +30 -28
  17. package/dist/{ReportView-Ci8nFyI9.js → ReportView-C37-Wgwc.js} +14 -13
  18. package/dist/ReportViewRoute-C1haW0-x.js +18 -0
  19. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-Ckn2p74A.js → SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js} +1 -1
  20. package/dist/{Setting-QSiMSAQk.js → Setting-c66iFXKP.js} +5 -5
  21. package/dist/{Template-CAPlAQO9.js → Template-B05_6Klr.js} +10 -9
  22. package/dist/{TileEditor-e7ZCWMU9.js → TileEditor-C-HBoB-E.js} +19 -17
  23. package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-B4g3YPzM.js → TilePageStack.vue_vue_type_script_setup_true_lang-DWdOrA-P.js} +3 -3
  24. package/dist/{TransitionFade-DqIazHHG.js → TransitionFade-oszzTdeW.js} +36 -33
  25. package/dist/{_plugin-vue_export-helper-kkiiQoKl.js → _plugin-vue_export-helper-C6QDExPN.js} +276 -291
  26. package/dist/{app-BAgs-zHf.js → app-CSF-ZDAa.js} +670 -567
  27. package/dist/app.js +1 -1
  28. package/dist/global-loader-BuxFfehu.js +19 -0
  29. package/dist/index-CtZE4sab.js +82 -0
  30. package/dist/report-BKfrG5Ry.js +635 -0
  31. package/dist/report-canvas-frame.html +888 -0
  32. package/dist/report-canvas-libs/chart.js-4.js +14 -0
  33. package/dist/report-canvas-libs/fm-ui-1.js +904 -0
  34. package/dist/style.css +1 -1
  35. package/dist/{useRestaurantPermission-ChYMJfXG.js → useRestaurantPermission-BgWDPmEl.js} +4 -4
  36. package/package.json +1 -1
  37. package/dist/DateRangeSelect-DYVOvSCA.js +0 -517
@@ -1,33 +1,34 @@
1
- import { defineComponent as me, resolveComponent as X, createBlock as pe, openBlock as A, unref as u, isRef as Fe, withCtx as W, createElementVNode as ae, createVNode as Y, toDisplayString as oe, createTextVNode as Ne, onMounted as fe, watch as C, ref as U, computed as se, onBeforeMount as $e, onBeforeUnmount as xe, createElementBlock as H, Fragment as Je } from "vue";
2
- import { detectLocale as j, useCoreStore as V } from "@feedmepos/mf-common";
3
- import { d as q, u as Qe, a as ie, b as Ue, c as ce, e as je, f as Pe, g as de } from "./app-BAgs-zHf.js";
1
+ import { defineComponent as me, resolveComponent as V, createBlock as pe, openBlock as A, unref as u, isRef as Be, withCtx as G, createElementVNode as oe, createVNode as Y, toDisplayString as ae, createTextVNode as Fe, onMounted as fe, watch as C, ref as U, computed as se, onBeforeMount as $e, onBeforeUnmount as xe, createElementBlock as H, Fragment as Je } from "vue";
2
+ import { detectLocale as j, useCoreStore as X } from "@feedmepos/mf-common";
3
+ import { d as q, u as Qe, a as ie, b as Ue, c as ce, e as je, f as We, g as de } from "./app-CSF-ZDAa.js";
4
4
  import { storeToRefs as k } from "pinia";
5
- import { u as Ge, a as Ke } from "./_plugin-vue_export-helper-kkiiQoKl.js";
6
- import { u as We, a as He } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CVShUWJC.js";
7
- import { u as Ve, _ as Xe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-TpeQ_Wm1.js";
5
+ import { u as Ke } from "./global-loader-BuxFfehu.js";
6
+ import { u as Pe, a as Ge } from "./report-BKfrG5Ry.js";
7
+ import { u as He, _ as Xe } from "./NavigationTab.vue_vue_type_script_setup_true_lang-B2IXNXS_.js";
8
8
  import { u as ue } from "./message-dialog-UoMWOnil.js";
9
+ import { u as Ve } from "./_plugin-vue_export-helper-C6QDExPN.js";
9
10
  import { useRoute as Ye, useRouter as Ze } from "vue-router";
10
11
  const Me = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, et = /* @__PURE__ */ me({
11
12
  __name: "Dialog",
12
13
  setup(T) {
13
- const { t: c } = Ge(), f = ue(), { isOpened: g, message: R, title: L } = k(ue());
14
+ const { t: c } = Ve(), f = ue(), { isOpened: g, message: R, title: L } = k(ue());
14
15
  return (O, _) => {
15
- const z = X("FmButton"), P = X("FmDialog");
16
- return A(), pe(P, {
16
+ const z = V("FmButton"), W = V("FmDialog");
17
+ return A(), pe(W, {
17
18
  modelValue: u(g),
18
- "onUpdate:modelValue": _[0] || (_[0] = (G) => Fe(g) ? g.value = G : null),
19
+ "onUpdate:modelValue": _[0] || (_[0] = (K) => Be(g) ? g.value = K : null),
19
20
  overlay: "",
20
21
  "close-button": !1,
21
22
  "z-index": 3e3
22
23
  }, {
23
- "dialog-header": W(() => [
24
- Ne(oe(u(L)), 1)
24
+ "dialog-header": G(() => [
25
+ Fe(ae(u(L)), 1)
25
26
  ]),
26
- default: W(() => [
27
- ae("p", Me, oe(u(R)), 1)
27
+ default: G(() => [
28
+ oe("p", Me, ae(u(R)), 1)
28
29
  ]),
29
- "dialog-footer": W(() => [
30
- _[1] || (_[1] = ae("div", { class: "grow" }, null, -1)),
30
+ "dialog-footer": G(() => [
31
+ _[1] || (_[1] = oe("div", { class: "grow" }, null, -1)),
31
32
  Y(z, {
32
33
  label: u(c)("report.common.cancel"),
33
34
  variant: "tertiary",
@@ -61,16 +62,16 @@ function tt() {
61
62
  };
62
63
  }
63
64
  q.locale(j() === "zh-CN" ? "zh-cn" : "en");
64
- const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
65
+ const nt = ["src"], rt = ["src"], gt = /* @__PURE__ */ me({
65
66
  __name: "App",
66
67
  setup(T) {
67
- const { businessId: c, token: f, country: g } = k(Qe()), { sessionUser: R, currentBusiness: L, currentCountry: O, registerSidebarComponent: _ } = V(), {
68
+ const { businessId: c, token: f, country: g } = k(Qe()), { sessionUser: R, currentBusiness: L, currentCountry: O, registerSidebarComponent: _ } = X(), {
68
69
  getRestaurantAndWarehouse: z,
69
- getBusinessSetting: P,
70
- beginBusinessLoad: G,
70
+ getBusinessSetting: W,
71
+ beginBusinessLoad: K,
71
72
  completeBusinessLoad: ge,
72
73
  resetTimezoneContext: ye
73
- } = ie(), ve = Ue(), { getFeatureFlags: Se } = ve, { version: y } = k(ce()), { getSettings: De } = je(), { promptLoader: he } = Ke(), n = Ye(), B = Ze(), E = We(), Z = Ve(), o = ie(), F = ce(), { suppressReportRouteSync: N } = k(F), { getReports: Ie, getOverviewReport: _e, getReportConfig: Re, currentReportId: M } = E, { currentReportId: Le, reports: Ee } = k(E), { getSchema: be } = He(), { fetchSchedules: we } = Z, { init: Ae } = Pe(), K = U("v5"), $ = U(!1), x = U(!0), Ce = se(() => `https://portal-v1.feedme.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.feedme.cc?businessId=${c.value}&country=${g.value}&token=${f.value}&reportV3Button=true`);
74
+ } = ie(), ve = Ue(), { getFeatureFlags: Se } = ve, { version: y } = k(ce()), { getSettings: De } = je(), { promptLoader: he } = Ke(), n = Ye(), N = Ze(), E = Pe(), Z = He(), a = ie(), B = ce(), { suppressReportRouteSync: F } = k(B), { getReports: Ie, getOverviewReport: _e, getReportConfig: Re, currentReportId: M } = E, { currentReportId: Le, reports: Ee } = k(E), { getSchema: be } = Ge(), { fetchSchedules: we } = Z, { init: Ae } = We(), P = U("v5"), $ = U(!1), x = U(!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`);
74
75
  C(
75
76
  [() => L.value, () => R.value, () => O.value],
76
77
  () => {
@@ -93,17 +94,17 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
93
94
  if (typeof t.data == "string")
94
95
  try {
95
96
  const e = JSON.parse(t.data);
96
- (e == null ? void 0 : e.v5) === !0 ? y.value = K.value : (e == null ? void 0 : e.v3) === !0 && (y.value = "v3");
97
+ (e == null ? void 0 : e.v5) === !0 ? y.value = P.value : (e == null ? void 0 : e.v3) === !0 && (y.value = "v3");
97
98
  } catch (e) {
98
99
  console.error(e);
99
100
  }
100
101
  }
101
102
  C(y, () => {
102
- ["v3", "v4"].includes(y.value) ? V().hideSidebarToggle(!0) : V().hideSidebarToggle(!1);
103
+ ["v3", "v4"].includes(y.value) ? X().hideSidebarToggle(!0) : X().hideSidebarToggle(!1);
103
104
  }), $e(() => {
104
105
  _(Xe);
105
106
  }), fe(() => {
106
- console.log("5.27.54", !0), window.addEventListener("message", ee), window.addEventListener("message", te);
107
+ console.log("5.28.0-beta.0", !0), window.addEventListener("message", ee), window.addEventListener("message", te);
107
108
  }), xe(() => {
108
109
  window.removeEventListener("message", ee), window.removeEventListener("message", te), E.$dispose(), Z.$dispose();
109
110
  });
@@ -119,14 +120,14 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
119
120
  const e = t.includes("%") ? [t, qe(t)] : [t];
120
121
  for (const r of e)
121
122
  try {
122
- const a = JSON.parse(r);
123
- if (typeof a == "string")
123
+ const o = JSON.parse(r);
124
+ if (typeof o == "string")
124
125
  try {
125
- return JSON.parse(a);
126
+ return JSON.parse(o);
126
127
  } catch {
127
- return a;
128
+ return o;
128
129
  }
129
- return a;
130
+ return o;
130
131
  } catch {
131
132
  }
132
133
  }
@@ -137,37 +138,37 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
137
138
  }
138
139
  function l(t, e, r) {
139
140
  if (typeof t != "string" || t.length === 0) return;
140
- const a = t.includes("T") ? q(t).tz(r) : q.tz(t, r);
141
- return (e === "start" ? a.startOf("day") : a.endOf("day")).utc().toISOString();
141
+ const o = t.includes("T") ? q(t).tz(r) : q.tz(t, r);
142
+ return (e === "start" ? o.startOf("day") : o.endOf("day")).utc().toISOString();
142
143
  }
143
144
  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", v = typeof e.timeEnd == "string", S = J(e.timeStart), D = J(e.timeEnd), b = ne(S) ? S : null, h = ne(D) ? D : null, m = l(e.compareStartDate, "start", r), w = l(e.compareEndDate, "end", r), Q = e.isAllLocation === "true" || e.isAllLocation === void 0;
145
+ const e = t, r = a.timezone, o = l(e.startDate, "start", r), d = l(e.endDate, "end", r), i = typeof e.timeStart == "string", v = typeof e.timeEnd == "string", S = J(e.timeStart), D = J(e.timeEnd), b = ne(S) ? S : null, h = ne(D) ? D : null, m = l(e.compareStartDate, "start", r), w = l(e.compareEndDate, "end", r), Q = e.isAllLocation === "true" || e.isAllLocation === void 0;
145
146
  let p = [];
146
147
  if (Q)
147
- p = o.selectedLocationIds ?? [];
148
+ p = a.selectedLocationIds ?? [];
148
149
  else {
149
150
  const s = J(e.locationIds);
150
151
  p = Array.isArray(s) ? s : [];
151
152
  }
152
153
  let I = e.reportId || M;
153
- if (Ee.value.find((s) => s.id === I) || (I = M), 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 });
154
+ if (Ee.value.find((s) => s.id === I) || (I = M), I && I !== E.currentReportId && E.updateCurrentReportId(I), o || d) {
155
+ const s = a.dateRange;
156
+ (s.startDate !== o || s.endDate !== d) && a.setDateRange({ startDate: o, endDate: d });
156
157
  }
157
158
  if (i || v) {
158
- const s = o.timeRange;
159
- (s.start !== b || s.end !== h) && o.setTimeRange({ start: b, end: h });
159
+ const s = a.timeRange;
160
+ (s.start !== b || s.end !== h) && a.setTimeRange({ start: b, end: h });
160
161
  }
161
162
  if (m || w) {
162
- const s = o.compareDateRange;
163
- (s.startDate !== m || s.endDate !== w) && o.setCompareDateRange({
163
+ const s = a.compareDateRange;
164
+ (s.startDate !== m || s.endDate !== w) && a.setCompareDateRange({
164
165
  startDate: m,
165
166
  endDate: w
166
167
  });
167
168
  }
168
169
  if (!Q) {
169
- const s = o.selectedLocationIds;
170
- s.length === p.length && s.every((ze, Be) => ze === p[Be]) || o.setSelectedLocationIds(p);
170
+ const s = a.selectedLocationIds;
171
+ s.length === p.length && s.every((ze, Ne) => ze === p[Ne]) || a.setSelectedLocationIds(p);
171
172
  }
172
173
  return {
173
174
  // TODO: this returned value can used for getBusinessSetting
@@ -186,17 +187,17 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
186
187
  () => c.value,
187
188
  async (t, e) => {
188
189
  if (t !== "") {
189
- $.value = !1, G(t);
190
- const r = "mf-report-prev-business-id", a = (() => {
190
+ $.value = !1, K(t);
191
+ const r = "mf-report-prev-business-id", o = (() => {
191
192
  try {
192
193
  return sessionStorage.getItem(r);
193
194
  } catch {
194
195
  return null;
195
196
  }
196
- })(), d = !!a && a !== t;
197
+ })(), d = !!o && o !== t;
197
198
  let i = { ...n.query }, v = !1;
198
199
  if (!x.value || e !== void 0 || d) {
199
- ye(), o.setSelectedLocationIds([]);
200
+ ye(), a.setSelectedLocationIds([]);
200
201
  const {
201
202
  locationIds: S,
202
203
  startDate: D,
@@ -210,27 +211,27 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
210
211
  i = {
211
212
  ...p,
212
213
  isAllLocation: "true"
213
- }, v = !0, await B.replace({
214
+ }, v = !0, await N.replace({
214
215
  name: n.name,
215
216
  params: n.params,
216
217
  query: i
217
218
  });
218
219
  }
219
- N.value !== void 0 && (N.value = !0), await he(async () => {
220
+ F.value !== void 0 && (F.value = !0), await he(async () => {
220
221
  await Ae({
221
- apiKey: "6GhcttsJ9Rj9cTevcdrpin",
222
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
222
223
  url: "https://flag.feedme.farm/api/v1/",
223
224
  enableAnalytics: !1,
224
225
  cacheFlags: !1
225
226
  });
226
227
  const S = await Re();
227
- K.value = S.version, y.value = K.value, await Se(), n.name === "template" && !F.canAccessTemplate() && await B.replace({
228
+ P.value = S.version, y.value = P.value, await Se(), n.name === "template" && !B.canAccessTemplate() && await N.replace({
228
229
  name: "reports",
229
230
  query: n.query
230
231
  });
231
- const D = F.canAccess(
232
+ const D = B.canAccess(
232
233
  de.report_accessOverview
233
- ), b = F.canAccess(
234
+ ), b = B.canAccess(
234
235
  de.report_accessIntegration
235
236
  ), h = [
236
237
  be(),
@@ -243,7 +244,7 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
243
244
  })()
244
245
  )
245
246
  ];
246
- if (D && h.push(_e()), b && h.push(De()), await Promise.all(h), await P(), Te(i), v) {
247
+ if (D && h.push(_e()), b && h.push(De()), await Promise.all(h), await W(), Te(i), v) {
247
248
  const {
248
249
  locationIds: m,
249
250
  startDate: w,
@@ -254,7 +255,7 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
254
255
  compareEndDate: s,
255
256
  ...re
256
257
  } = n.query;
257
- (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 B.replace({
258
+ (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({
258
259
  name: n.name,
259
260
  params: n.params,
260
261
  query: {
@@ -277,19 +278,19 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
277
278
  ), C(
278
279
  () => ($.value, {
279
280
  reportId: Le.value,
280
- selectedLocationIds: o.selectedLocationIds,
281
- dateRange: o.dateRange,
282
- timeRange: o.timeRange,
283
- compareDateRange: o.compareDateRange,
284
- timezone: o.timezone
281
+ selectedLocationIds: a.selectedLocationIds,
282
+ dateRange: a.dateRange,
283
+ timeRange: a.timeRange,
284
+ compareDateRange: a.compareDateRange,
285
+ timezone: a.timezone
285
286
  }),
286
287
  (t) => {
287
288
  if (!$.value || !t.reportId || x.value) return;
288
- if (N.value) {
289
- N.value = !1;
289
+ if (F.value) {
290
+ F.value = !1;
290
291
  return;
291
292
  }
292
- const e = t.selectedLocationIds, r = t.dateRange, a = t.timeRange, d = t.compareDateRange, i = {
293
+ const e = t.selectedLocationIds, r = t.dateRange, o = t.timeRange, d = t.compareDateRange, i = {
293
294
  ...n.query,
294
295
  reportId: t.reportId,
295
296
  startDate: l(r.startDate, "start", t.timezone),
@@ -300,12 +301,12 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
300
301
  t.timezone
301
302
  ),
302
303
  compareEndDate: l(d.endDate, "end", t.timezone),
303
- timeStart: a.start ? JSON.stringify(a.start) : void 0,
304
- timeEnd: a.end ? JSON.stringify(a.end) : void 0
305
- }, v = e.length === o.locations.length;
304
+ timeStart: o.start ? JSON.stringify(o.start) : void 0,
305
+ timeEnd: o.end ? JSON.stringify(o.end) : void 0
306
+ }, v = e.length === a.locations.length;
306
307
  i.isAllLocation = String(v), v ? delete i.locationIds : e.length > 0 ? i.locationIds = JSON.stringify(e) : delete i.locationIds;
307
308
  const S = JSON.stringify(n.query), D = JSON.stringify(i);
308
- S !== D && B.replace({
309
+ S !== D && N.replace({
309
310
  name: n.name,
310
311
  params: n.params,
311
312
  query: i
@@ -313,7 +314,7 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
313
314
  },
314
315
  { deep: !0 }
315
316
  ), tt(), (t, e) => {
316
- const r = X("router-view");
317
+ const r = V("router-view");
317
318
  return A(), H(Je, null, [
318
319
  Y(et),
319
320
  u(y) === "v3" ? (A(), H("iframe", {
@@ -330,5 +331,5 @@ const nt = ["src"], rt = ["src"], ft = /* @__PURE__ */ me({
330
331
  }
331
332
  });
332
333
  export {
333
- ft as default
334
+ gt as default
334
335
  };