@feedmepos/mf-report 5.7.6 → 5.8.0-beta.1

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-DJp01-Og.js +150 -0
  2. package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-Bi_BES93.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-g6ESEkM9.js} +2 -2
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-RIJC16Ui.js → Default.vue_vue_type_script_setup_true_lang-CRvS7Ex3.js} +10 -10
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-BVc7b2H4.js +1417 -0
  5. package/dist/{InsightView-DIhPKYKe.js → InsightView-Ba_em7GM.js} +6 -6
  6. package/dist/{Integration-D61lmDoO.js → Integration-7h1cJFLg.js} +3 -3
  7. package/dist/{Integrations-BiJVCGrp.js → Integrations-Dm7n-0iv.js} +3 -3
  8. package/dist/{Layout-DH7q-7AG.js → Layout-_u9uU4T9.js} +1 -1
  9. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-nPHvtT2O.js → MenuTab.vue_vue_type_script_setup_true_lang-Bn3KCbjG.js} +3 -3
  10. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-CPTKq_OA.js → NavigationTab.vue_vue_type_script_setup_true_lang-DuOqx76g.js} +7074 -7041
  11. package/dist/{NoData.vue_vue_type_script_setup_true_lang-CdFXBqlX.js → NoData.vue_vue_type_script_setup_true_lang-CAbykN6l.js} +1 -1
  12. package/dist/{OverviewView-Cp0quKsj.js → OverviewView-B_RWwK33.js} +5 -5
  13. package/dist/{Report-DSO3L0cw.js → Report-D6UGn8fH.js} +4 -4
  14. package/dist/ReportEditor-HDMGjShp.js +621 -0
  15. package/dist/{ReportView-CRKPSw3H.js → ReportView-CzhcGBn8.js} +7 -7
  16. package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-N2Lg1Vpt.js → SelectComponent.vue_vue_type_script_setup_true_lang-BEkJzB27.js} +1 -1
  17. package/dist/{Setting-Dd1O-wia.js → Setting-Bvzzqokm.js} +4 -4
  18. package/dist/{TileEditor-BLsGvreq.js → TileEditor-BNx2KgYJ.js} +8 -8
  19. package/dist/{TransitionFade-C7yNEw8X.js → TransitionFade-BR2i09Vy.js} +4 -4
  20. package/dist/app.js +29 -14
  21. package/dist/{global-loader-CbmVhJAK.js → global-loader-DKYDQRZx.js} +1175 -1204
  22. package/dist/{index-BWqDfeY6.js → index--mBthMxH.js} +1 -1
  23. package/dist/{report-schema-BnzKoFjx.js → report-schema-DDo0Dgd1.js} +1 -1
  24. package/dist/{v4-Cbq0RSpY.js → v4-CfR4tJai.js} +287 -281
  25. package/package.json +1 -1
  26. package/dist/App-BrW5SiDe.js +0 -152
  27. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DokEr03U.js +0 -1390
  28. package/dist/ReportEditor-DPWD6PV0.js +0 -527
@@ -0,0 +1,150 @@
1
+ import { defineComponent as O, resolveComponent as b, createBlock as I, openBlock as c, unref as r, isRef as X, withCtx as S, createElementVNode as R, createVNode as k, toDisplayString as V, createTextVNode as Y, onMounted as T, watch as f, ref as z, computed as D, onBeforeMount as Z, onBeforeUnmount as M, createElementBlock as w, Fragment as ee } from "vue";
2
+ import { detectLocale as p, useCoreStore as y } from "@feedmepos/mf-common";
3
+ import { u as te, d as C, a as oe, b as re, c as ae, e as ne, f as se, g as le } from "./global-loader-DKYDQRZx.js";
4
+ import { storeToRefs as $ } from "pinia";
5
+ import { u as ue, a as ie } from "./v4-CfR4tJai.js";
6
+ import { u as ce } from "./report-schema-DDo0Dgd1.js";
7
+ import { _ as me, u as de } from "./NavigationTab.vue_vue_type_script_setup_true_lang-DuOqx76g.js";
8
+ import { u as U } from "./message-dialog-UoMWOnil.js";
9
+ const ve = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, fe = /* @__PURE__ */ O({
10
+ __name: "Dialog",
11
+ setup(m) {
12
+ const { t } = te(), a = U(), { isOpened: n, message: u, title: i } = $(U());
13
+ return (d, l) => {
14
+ const v = b("FmButton"), g = b("FmDialog");
15
+ return c(), I(g, {
16
+ modelValue: r(n),
17
+ "onUpdate:modelValue": l[0] || (l[0] = (h) => X(n) ? n.value = h : null),
18
+ overlay: "",
19
+ "close-button": !1
20
+ }, {
21
+ "dialog-header": S(() => [
22
+ Y(V(r(i)), 1)
23
+ ]),
24
+ default: S(() => [
25
+ R("p", ve, V(r(u)), 1)
26
+ ]),
27
+ "dialog-footer": S(() => [
28
+ l[1] || (l[1] = R("div", { class: "grow" }, null, -1)),
29
+ k(v, {
30
+ label: r(t)("report.common.cancel"),
31
+ variant: "tertiary",
32
+ onClick: r(a).dismiss
33
+ }, null, 8, ["label", "onClick"]),
34
+ k(v, {
35
+ label: r(t)("report.common.confirm"),
36
+ onClick: r(a).confirm
37
+ }, null, 8, ["label", "onClick"])
38
+ ]),
39
+ _: 1
40
+ }, 8, ["modelValue"]);
41
+ };
42
+ }
43
+ }), x = z(p());
44
+ function pe() {
45
+ const m = (t) => {
46
+ switch (x.value = t, t) {
47
+ case "zh-CN":
48
+ C.locale("zh-cn");
49
+ break;
50
+ default:
51
+ C.locale("en");
52
+ break;
53
+ }
54
+ };
55
+ return T(() => {
56
+ m(p());
57
+ }), f(() => p(), m, { deep: !0, immediate: !0 }), {
58
+ currentLocale: x
59
+ };
60
+ }
61
+ C.locale(p() === "zh-CN" ? "zh-cn" : "en");
62
+ const ge = ["src"], he = ["src"], Fe = /* @__PURE__ */ O({
63
+ __name: "App",
64
+ setup(m) {
65
+ const { businessId: t, token: a, country: n } = $(oe()), { sessionUser: u, currentBusiness: i, currentCountry: d, registerSidebarComponent: l } = y(), { getRestaurantAndWarehouse: v, getBusinessSetting: g } = re(), { getFeatureFlags: h } = ae(), { version: s } = $(ue()), { getSettings: j } = ne(), { promptLoader: A } = se(), J = D(() => `https://portal-v1.feedmedev.cc/b/${t.value}/report/CLOSE_UP?showHeader=false&country=${n.value.toUpperCase()}&menuOption=business-report&token=${a.value}&v2=true&reportV5Button=true`), W = D(() => `https://report-v4.feedmedev.cc?businessId=${t.value}&country=${n.value}&token=${a.value}&reportV3Button=true`);
66
+ f(
67
+ [() => i.value, () => u.value, () => d.value],
68
+ () => {
69
+ var o, e;
70
+ i.value && u.value && d.value && (t.value = ((o = i.value) == null ? void 0 : o.id) ?? "", a.value = ((e = u.value) == null ? void 0 : e.token) ?? "", n.value = d.value ?? "");
71
+ },
72
+ { immediate: !0 }
73
+ );
74
+ function F(o) {
75
+ if (typeof o.data == "string")
76
+ try {
77
+ const e = JSON.parse(o.data);
78
+ (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (a.value = e.token);
79
+ } catch (e) {
80
+ console.error(e);
81
+ }
82
+ }
83
+ function B(o) {
84
+ if (typeof o.data == "string")
85
+ try {
86
+ const e = JSON.parse(o.data);
87
+ (e == null ? void 0 : e.v5) === !0 ? s.value = _.value : (e == null ? void 0 : e.v3) === !0 && (s.value = "v3");
88
+ } catch (e) {
89
+ console.error(e);
90
+ }
91
+ }
92
+ f(s, () => {
93
+ ["v3", "v4"].includes(s.value) ? y().hideSidebarToggle(!0) : y().hideSidebarToggle(!1);
94
+ }), Z(() => {
95
+ l(me);
96
+ }), T(() => {
97
+ console.log("5.8.0-beta.1", !0), window.addEventListener("message", F), window.addEventListener("message", B);
98
+ });
99
+ const E = ie(), L = de();
100
+ M(() => {
101
+ window.removeEventListener("message", F), window.removeEventListener("message", B), E.$dispose(), L.$dispose();
102
+ });
103
+ const { getReports: G, getOverviewReport: K, getReportConfig: N } = E, { getSchema: P } = ce(), { fetchSchedules: q } = L, { init: H } = le(), _ = z("v5");
104
+ return f(
105
+ () => t.value,
106
+ () => {
107
+ t.value !== "" && A(async () => {
108
+ await H({
109
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
110
+ url: "https://flag.feedme.farm/api/v1/",
111
+ enableAnalytics: !1,
112
+ cacheFlags: !1
113
+ });
114
+ const o = await N();
115
+ _.value = o.version, s.value = _.value, await Promise.all([
116
+ h(),
117
+ N(),
118
+ K(),
119
+ G(),
120
+ P(),
121
+ q(),
122
+ g(),
123
+ v(),
124
+ j()
125
+ ]);
126
+ });
127
+ },
128
+ {
129
+ immediate: !0
130
+ }
131
+ ), pe(), (o, e) => {
132
+ const Q = b("router-view");
133
+ return c(), w(ee, null, [
134
+ k(fe),
135
+ r(s) === "v3" ? (c(), w("iframe", {
136
+ key: 0,
137
+ class: "bg-white h-full w-full",
138
+ src: J.value
139
+ }, null, 8, ge)) : r(s) === "v4" ? (c(), w("iframe", {
140
+ key: 1,
141
+ class: "bg-white h-full w-full",
142
+ src: W.value
143
+ }, null, 8, he)) : (c(), I(Q, { key: 2 }))
144
+ ], 64);
145
+ };
146
+ }
147
+ });
148
+ export {
149
+ Fe as default
150
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as F, resolveComponent as g, createBlock as p, openBlock as u, withCtx as v, createCommentVNode as y, createElementVNode as w, toDisplayString as M, renderSlot as P, mergeModels as T, useModel as f, ref as C, watch as I, createElementBlock as x, createVNode as D, unref as c } from "vue";
2
- import { d as n, G as O, C as B } from "./global-loader-CbmVhJAK.js";
3
- import { b as V } from "./index-BWqDfeY6.js";
2
+ import { d as n, G as O, C as B } from "./global-loader-DKYDQRZx.js";
3
+ import { b as V } from "./index--mBthMxH.js";
4
4
  import { detectLocale as $ } from "@feedmepos/mf-common";
5
5
  const Y = { class: "fm-typo-en-body-md-600 text-ellipsis overflow-hidden whitespace-nowrap" }, j = { class: "fm-typo-en-body-md-600 text-ellipsis overflow-hidden whitespace-nowrap" }, k = /* @__PURE__ */ F({
6
6
  __name: "FilterChip",
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as u, computed as f, resolveComponent as p, createElementBlock as s, openBlock as t, normalizeStyle as n, normalizeClass as d, unref as e, createBlock as y, createCommentVNode as _, createVNode as h, createElementVNode as k, toDisplayString as g, renderSlot as x } from "vue";
2
- import { _ as b } from "./NavigationTab.vue_vue_type_script_setup_true_lang-CPTKq_OA.js";
3
- import { useBreakpoints as v } from "@feedmepos/ui-library";
4
- import { storeToRefs as q } from "pinia";
5
- import { u as C, f as w } from "./global-loader-CbmVhJAK.js";
2
+ import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-DuOqx76g.js";
3
+ import { useBreakpoints as b } from "@feedmepos/ui-library";
4
+ import { storeToRefs as C } from "pinia";
5
+ import { u as q, f as w } from "./global-loader-DKYDQRZx.js";
6
6
  import { useRoute as B } from "vue-router";
7
7
  const $ = {
8
8
  key: 1,
@@ -10,18 +10,18 @@ const $ = {
10
10
  }, N = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, P = /* @__PURE__ */ u({
11
11
  __name: "Default",
12
12
  setup(S) {
13
- const { t: l } = C(), { breakpoints: r } = v(), { isLoading: c } = q(w()), o = B(), a = f(() => !o.query.token && !o.query.busines);
14
- return (i, z) => {
15
- const m = p("FmCircularProgress");
13
+ const { t: l } = q(), { breakpoints: r } = b(), { isLoading: c } = C(w()), o = B(), a = f(() => !o.query.token);
14
+ return (m, z) => {
15
+ const i = p("FmCircularProgress");
16
16
  return t(), s("div", {
17
17
  class: d(`${e(r).lg || e(r).md ? "flex w-full" : ""} bg-fm-color-neutral-white`),
18
18
  style: n({
19
19
  height: `calc(100vh - ${e(o).query.token && e(o).query.businessId ? "0" : "64"}px)`
20
20
  })
21
21
  }, [
22
- a.value ? _("", !0) : (t(), y(b, { key: 0 })),
22
+ a.value ? _("", !0) : (t(), y(v, { key: 0 })),
23
23
  e(c) ? (t(), s("div", $, [
24
- h(m, { size: "xl" }),
24
+ h(i, { size: "xl" }),
25
25
  k("span", N, g(e(l)("report.common.isLoading")), 1)
26
26
  ])) : (t(), s("div", {
27
27
  key: 2,
@@ -30,7 +30,7 @@ const $ = {
30
30
  height: `calc(100%-${e(o).query.token && e(o).query.businessId ? "56" : "0"}px)`
31
31
  })
32
32
  }, [
33
- x(i.$slots, "default")
33
+ x(m.$slots, "default")
34
34
  ], 4))
35
35
  ], 6);
36
36
  };