@feedmepos/mf-report 5.21.27-beta.3 → 5.21.27-beta.5

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as ee, resolveComponent as B, createBlock as te, openBlock as O, unref as c, isRef as Ie, withCtx as $, createElementVNode as H, createVNode as T, toDisplayString as X, createTextVNode as Re, onMounted as ne, watch as D, ref as _, computed as x, onBeforeMount as Oe, onBeforeUnmount as Le, createElementBlock as A, Fragment as _e } from "vue";
1
+ import { defineComponent as ee, resolveComponent as B, createBlock as te, openBlock as O, unref as l, isRef as Ie, withCtx as F, createElementVNode as H, createVNode as T, toDisplayString as X, createTextVNode as Re, onMounted as ne, watch as D, ref as _, computed as $, onBeforeMount as Oe, onBeforeUnmount as Le, createElementBlock as A, Fragment as _e } from "vue";
2
2
  import { detectLocale as b, useCoreStore as J } from "@feedmepos/mf-common";
3
- import { u as qe, d as l, a as be, b as Y, c as we, e as ke, f as Ce, s as Ee, g as Ne } from "./vue-i18n-BdbYuMnB.js";
3
+ import { u as qe, d as c, a as be, b as Y, c as we, e as ke, f as Ce, s as Ee, g as Ne } from "./vue-i18n-BdbYuMnB.js";
4
4
  import { storeToRefs as q } from "pinia";
5
- import { u as Fe, a as $e, b as xe } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BHDUNZTW.js";
5
+ import { u as xe, a as Fe, b as $e } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BHDUNZTW.js";
6
6
  import { u as Ae, _ as Je } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CW6iYOsZ.js";
7
7
  import { u as Z } from "./message-dialog-UoMWOnil.js";
8
8
  import { useRoute as Be, useRouter as Te } from "vue-router";
@@ -13,27 +13,27 @@ const Ve = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, Ue
13
13
  return (C, v) => {
14
14
  const h = B("FmButton"), E = B("FmDialog");
15
15
  return O(), te(E, {
16
- modelValue: c(d),
16
+ modelValue: l(d),
17
17
  "onUpdate:modelValue": v[0] || (v[0] = (N) => Ie(d) ? d.value = N : null),
18
18
  overlay: "",
19
19
  "close-button": !1
20
20
  }, {
21
- "dialog-header": $(() => [
22
- Re(X(c(k)), 1)
21
+ "dialog-header": F(() => [
22
+ Re(X(l(k)), 1)
23
23
  ]),
24
- default: $(() => [
25
- H("p", Ve, X(c(w)), 1)
24
+ default: F(() => [
25
+ H("p", Ve, X(l(w)), 1)
26
26
  ]),
27
- "dialog-footer": $(() => [
27
+ "dialog-footer": F(() => [
28
28
  v[1] || (v[1] = H("div", { class: "grow" }, null, -1)),
29
29
  T(h, {
30
- label: c(s)("report.common.cancel"),
30
+ label: l(s)("report.common.cancel"),
31
31
  variant: "tertiary",
32
- onClick: c(f).dismiss
32
+ onClick: l(f).dismiss
33
33
  }, null, 8, ["label", "onClick"]),
34
34
  T(h, {
35
- label: c(s)("report.common.confirm"),
36
- onClick: c(f).confirm
35
+ label: l(s)("report.common.confirm"),
36
+ onClick: l(f).confirm
37
37
  }, null, 8, ["label", "onClick"])
38
38
  ]),
39
39
  _: 1
@@ -45,10 +45,10 @@ function ze() {
45
45
  const L = (s) => {
46
46
  switch (M.value = s, s) {
47
47
  case "zh-CN":
48
- l.locale("zh-cn");
48
+ c.locale("zh-cn");
49
49
  break;
50
50
  default:
51
- l.locale("en");
51
+ c.locale("en");
52
52
  break;
53
53
  }
54
54
  };
@@ -58,11 +58,11 @@ function ze() {
58
58
  currentLocale: M
59
59
  };
60
60
  }
61
- l.locale(b() === "zh-CN" ? "zh-cn" : "en");
61
+ c.locale(b() === "zh-CN" ? "zh-cn" : "en");
62
62
  const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
63
63
  __name: "App",
64
64
  setup(L) {
65
- const { businessId: s, token: f, country: d } = q(be()), { sessionUser: w, currentBusiness: k, currentCountry: C, registerSidebarComponent: v } = J(), { getRestaurantAndWarehouse: h, getBusinessSetting: E, beginBusinessLoad: N, completeBusinessLoad: ae } = Y(), { getFeatureFlags: oe } = we(), { version: m } = q(Fe()), { getSettings: re } = ke(), { promptLoader: se } = Ce(), n = Be(), ie = Te(), I = $e(), V = Ae(), r = Y(), p = _(!1);
65
+ const { businessId: s, token: f, country: d } = q(be()), { sessionUser: w, currentBusiness: k, currentCountry: C, registerSidebarComponent: v } = J(), { getRestaurantAndWarehouse: h, getBusinessSetting: E, beginBusinessLoad: N, completeBusinessLoad: ae } = Y(), { getFeatureFlags: oe } = we(), { version: m } = q(xe()), { getSettings: re } = ke(), { promptLoader: se } = Ce(), n = Be(), ie = Te(), I = Fe(), V = Ae(), r = Y(), p = _(!1);
66
66
  function U(e) {
67
67
  const t = {};
68
68
  for (const [a, o] of Object.entries(e))
@@ -75,14 +75,10 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
75
75
  return JSON.stringify(a);
76
76
  }
77
77
  async function ue(e) {
78
- const t = U(n.query), a = U(e);
79
- z(t) !== z(a) && await ie.replace({
80
- name: n.name,
81
- params: n.params,
82
- query: a
83
- });
78
+ const t = U(n.query), a = { ...n.query, ...e }, o = U(a);
79
+ z(t) !== z(o) && await ie.replace({ query: o });
84
80
  }
85
- const le = x(() => `https://portal-v1.feedmedev.cc/b/${s.value}/report/CLOSE_UP?showHeader=false&country=${d.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), ce = x(() => `https://report-v4.feedmedev.cc?businessId=${s.value}&country=${d.value}&token=${f.value}&reportV3Button=true`);
81
+ const ce = $(() => `https://portal-v1.feedmedev.cc/b/${s.value}/report/CLOSE_UP?showHeader=false&country=${d.value.toUpperCase()}&menuOption=business-report&token=${f.value}&v2=true&reportV5Button=true`), le = $(() => `https://report-v4.feedmedev.cc?businessId=${s.value}&country=${d.value}&token=${f.value}&reportV3Button=true`);
86
82
  D(
87
83
  [() => {
88
84
  var e;
@@ -114,7 +110,7 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
114
110
  if (typeof e.data == "string")
115
111
  try {
116
112
  const t = JSON.parse(e.data);
117
- (t == null ? void 0 : t.v5) === !0 ? m.value = F.value : (t == null ? void 0 : t.v3) === !0 && (m.value = "v3");
113
+ (t == null ? void 0 : t.v5) === !0 ? m.value = x.value : (t == null ? void 0 : t.v3) === !0 && (m.value = "v3");
118
114
  } catch (t) {
119
115
  console.error(t);
120
116
  }
@@ -124,13 +120,13 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
124
120
  }), Oe(() => {
125
121
  v(Je);
126
122
  }), ne(() => {
127
- console.log("5.21.27-beta.3", !0), window.addEventListener("message", Q), window.addEventListener("message", j);
123
+ console.log("5.21.27-beta.5", !0), window.addEventListener("message", Q), window.addEventListener("message", j);
128
124
  }), Le(() => {
129
125
  window.removeEventListener("message", Q), window.removeEventListener("message", j), I.$dispose(), V.$dispose();
130
126
  });
131
- const { getReports: de, getOverviewReport: fe, getReportConfig: W, currentReportId: G } = I, { currentReportId: K, reports: me } = q(I), { getSchema: pe } = xe(), { fetchSchedules: ge } = V, { init: ve } = Ne(), F = _("v5"), R = _(!1);
127
+ const { getReports: de, getOverviewReport: fe, getReportConfig: W, currentReportId: G } = I, { currentReportId: K, reports: me } = q(I), { getSchema: pe } = $e(), { fetchSchedules: ge } = V, { init: ve } = Ne(), x = _("v5"), R = _(!1);
132
128
  function ye() {
133
- const e = n.query.startDate ? l(n.query.startDate).startOf("day").toISOString() : void 0, t = n.query.endDate ? l(n.query.endDate).endOf("day").toISOString() : void 0, a = n.query.timeStart ? JSON.parse(n.query.timeStart) : void 0, o = n.query.timeEnd ? JSON.parse(n.query.timeEnd) : void 0, u = n.query.compareStartDate ? l(n.query.compareStartDate).startOf("day").toISOString() : void 0, g = n.query.compareEndDate ? l(n.query.compareEndDate).endOf("day").toISOString() : void 0, P = n.query.isAllLocation === "true";
129
+ const e = n.query.startDate ? c(n.query.startDate).startOf("day").toISOString() : void 0, t = n.query.endDate ? c(n.query.endDate).endOf("day").toISOString() : void 0, a = n.query.timeStart ? JSON.parse(n.query.timeStart) : void 0, o = n.query.timeEnd ? JSON.parse(n.query.timeEnd) : void 0, u = n.query.compareStartDate ? c(n.query.compareStartDate).startOf("day").toISOString() : void 0, g = n.query.compareEndDate ? c(n.query.compareEndDate).endOf("day").toISOString() : void 0, P = n.query.isAllLocation === "true";
134
130
  let y = [];
135
131
  P ? y = r.selectedLocationIds : y = n.query.locationIds ? JSON.parse(n.query.locationIds) : void 0;
136
132
  let S = n.query.reportId || G;
@@ -177,7 +173,7 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
177
173
  cacheFlags: !1
178
174
  });
179
175
  const o = await W();
180
- F.value = o.version, m.value = F.value;
176
+ x.value = o.version, m.value = x.value;
181
177
  const u = !p.value && n.query.locationIds ? JSON.parse(n.query.locationIds) : null;
182
178
  await Promise.all([
183
179
  oe(),
@@ -195,9 +191,9 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
195
191
  immediate: !0
196
192
  }
197
193
  );
198
- const Se = x(() => {
199
- const e = { ...n.query };
200
- if (s.value && (e.businessId = s.value), p.value)
194
+ const Se = $(() => {
195
+ const e = {};
196
+ if (e.businessId = s.value || void 0, p.value)
201
197
  e.locationIds = void 0, e.isAllLocation = "true";
202
198
  else if (R.value) {
203
199
  const u = r.selectedLocationIds, g = r.locations.length;
@@ -205,7 +201,7 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
205
201
  }
206
202
  if (!R.value || !K.value) return e;
207
203
  const t = r.dateRange, a = r.timeRange, o = r.compareDateRange;
208
- return e.reportId = K.value, e.startDate = t.startDate ? l(t.startDate).startOf("day").toISOString() : void 0, e.endDate = t.endDate ? l(t.endDate).endOf("day").toISOString() : void 0, e.compareStartDate = o.startDate ? l(o.startDate).startOf("day").toISOString() : void 0, e.compareEndDate = o.endDate ? l(o.endDate).endOf("day").toISOString() : void 0, e.timeStart = a.start ? JSON.stringify(a.start) : void 0, e.timeEnd = a.end ? JSON.stringify(a.end) : void 0, e;
204
+ return e.reportId = K.value, e.startDate = t.startDate ? c(t.startDate).startOf("day").toISOString() : void 0, e.endDate = t.endDate ? c(t.endDate).endOf("day").toISOString() : void 0, e.compareStartDate = o.startDate ? c(o.startDate).startOf("day").toISOString() : void 0, e.compareEndDate = o.endDate ? c(o.endDate).endOf("day").toISOString() : void 0, e.timeStart = a.start ? JSON.stringify(a.start) : void 0, e.timeEnd = a.end ? JSON.stringify(a.end) : void 0, e;
209
205
  });
210
206
  return D(
211
207
  Se,
@@ -217,14 +213,14 @@ const Qe = ["src"], je = ["src"], nt = /* @__PURE__ */ ee({
217
213
  const a = B("router-view");
218
214
  return O(), A(_e, null, [
219
215
  T(Ue),
220
- c(m) === "v3" ? (O(), A("iframe", {
216
+ l(m) === "v3" ? (O(), A("iframe", {
221
217
  key: 0,
222
218
  class: "bg-white h-full w-full",
223
- src: le.value
224
- }, null, 8, Qe)) : c(m) === "v4" ? (O(), A("iframe", {
219
+ src: ce.value
220
+ }, null, 8, Qe)) : l(m) === "v4" ? (O(), A("iframe", {
225
221
  key: 1,
226
222
  class: "bg-white h-full w-full",
227
- src: ce.value
223
+ src: le.value
228
224
  }, null, 8, je)) : (O(), te(a, { key: 2 }))
229
225
  ], 64);
230
226
  };
package/dist/app.js CHANGED
@@ -5710,7 +5710,7 @@ const u = {
5710
5710
  "zh-CN": n,
5711
5711
  "th-TH": c,
5712
5712
  "zh-Hant": p
5713
- }, h = e(() => import("./App-C36BShvl.js"));
5713
+ }, h = e(() => import("./App-CH90Vg7V.js"));
5714
5714
  export {
5715
5715
  h as FmApp,
5716
5716
  u as i18nMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-report",
3
- "version": "5.21.27-beta.3",
3
+ "version": "5.21.27-beta.5",
4
4
  "files": [
5
5
  "dist"
6
6
  ],