@feedmepos/mf-report 5.4.15-beta.1 → 5.4.15-beta.3

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 (45) hide show
  1. package/dist/App-DufL3Y8h.js +152 -0
  2. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DLDk5l4R.js +162 -0
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-Bxuyjrkr.js → Default.vue_vue_type_script_setup_true_lang-DVLxkOOQ.js} +2 -2
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-C29g9w6o.js +999 -0
  5. package/dist/{InsightView-D78TK2E8.js → InsightView-tyeJBlRm.js} +1051 -1049
  6. package/dist/Integration-ILSIf-OL.js +3695 -0
  7. package/dist/Integrations-DwgNrM3U.js +334 -0
  8. package/dist/{Layout-DERpCrQk.js → Layout-Bw1oh6Q-.js} +1 -1
  9. package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-DurYBXa5.js → LocationSelect.vue_vue_type_script_setup_true_lang-BFj4d-UF.js} +1861 -1859
  10. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-DzZeasAK.js +277 -0
  11. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-C8yzWDXs.js → NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js} +5526 -5482
  12. package/dist/NoData.vue_vue_type_script_setup_true_lang-BtQobm-7.js +31 -0
  13. package/dist/OverviewView-Dl8oOobn.js +61 -0
  14. package/dist/Report-BqD8KVZ8.js +424 -0
  15. package/dist/ReportEditor-DkzFUgbO.js +532 -0
  16. package/dist/ReportView-DpWZHV0o.js +169 -0
  17. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-C3VG1mi_.js +104 -0
  18. package/dist/Setting-CYrg_50p.js +320 -0
  19. package/dist/TileEditor-CDrzLbqc.js +2320 -0
  20. package/dist/{TransitionFade-BLDfpF7R.js → TransitionFade-D19wC3tb.js} +225 -220
  21. package/dist/app.js +915 -27
  22. package/dist/{global-loader-CMC9fgBi.js → global-loader-C3JC7z-H.js} +4966 -2240
  23. package/dist/index-9IDzTnHw.js +147 -0
  24. package/dist/{report-schema-G0x3CoJb.js → report-schema-1zQJbLyB.js} +4 -4
  25. package/dist/style.css +1 -1
  26. package/dist/timeFormat-CjNvJMgk.js +9 -0
  27. package/dist/{v4-DF7wffYN.js → v4-D29FkHfi.js} +2666 -1927
  28. package/package.json +1 -1
  29. package/dist/App-mcSgbcVY.js +0 -133
  30. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DPuhMR6i.js +0 -160
  31. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-B6IzlHmr.js +0 -996
  32. package/dist/HeaderTab.vue_vue_type_script_setup_true_lang-B5VBDNwX.js +0 -19
  33. package/dist/Integration-Cm6_YEEE.js +0 -3554
  34. package/dist/Integrations-WWnSho0Q.js +0 -334
  35. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-h87kWy1E.js +0 -261
  36. package/dist/NoData.vue_vue_type_script_setup_true_lang-DlBNFLa3.js +0 -30
  37. package/dist/OverviewView-D7zAR7_7.js +0 -60
  38. package/dist/Report-BnX5amn0.js +0 -409
  39. package/dist/ReportEditor-DW7uWg_a.js +0 -530
  40. package/dist/ReportView-xSaJA5F6.js +0 -166
  41. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-DBI9op0g.js +0 -103
  42. package/dist/Setting-D8JspXTN.js +0 -326
  43. package/dist/TileEditor-DQ8C5I_M.js +0 -2301
  44. package/dist/index-SmIkb24L.js +0 -143
  45. package/dist/timeFormat-BF-F4Rnt.js +0 -9
@@ -0,0 +1,152 @@
1
+ import { defineComponent as O, resolveComponent as C, createBlock as T, openBlock as m, unref as r, isRef as Y, withCtx as w, createElementVNode as q, createVNode as $, toDisplayString as D, createTextVNode as Z, onMounted as z, watch as p, ref as j, computed as I, onBeforeMount as M, onBeforeUnmount as ee, createElementBlock as b, Fragment as te } from "vue";
2
+ import { detectLocale as g, useCoreStore as k } from "@feedmepos/mf-common";
3
+ import { u as oe, d as F, a as re, b as ne, c as ae, e as se, f as le, g as ue } from "./global-loader-C3JC7z-H.js";
4
+ import { storeToRefs as B } from "pinia";
5
+ import { u as ie, a as ce } from "./v4-D29FkHfi.js";
6
+ import { u as me } from "./report-schema-1zQJbLyB.js";
7
+ import { _ as de, u as ve } from "./NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js";
8
+ import { u as U } from "./message-dialog-UoMWOnil.js";
9
+ import { useRoute as fe } from "vue-router";
10
+ const pe = { class: "fm-typo-en-body-md-400 text-ellipsis overflow-hidden" }, ge = /* @__PURE__ */ O({
11
+ __name: "Dialog",
12
+ setup(d) {
13
+ const { t } = oe(), n = U(), { isOpened: a, message: i, title: c } = B(U());
14
+ return (y, u) => {
15
+ const v = C("FmButton"), h = C("FmDialog");
16
+ return m(), T(h, {
17
+ modelValue: r(a),
18
+ "onUpdate:modelValue": u[0] || (u[0] = (_) => Y(a) ? a.value = _ : null),
19
+ overlay: "",
20
+ "close-button": !1
21
+ }, {
22
+ "dialog-header": w(() => [
23
+ Z(D(r(c)), 1)
24
+ ]),
25
+ default: w(() => [
26
+ q("p", pe, D(r(i)), 1)
27
+ ]),
28
+ "dialog-footer": w(() => [
29
+ u[1] || (u[1] = q("div", { class: "grow" }, null, -1)),
30
+ $(v, {
31
+ label: r(t)("report.common.cancel"),
32
+ variant: "tertiary",
33
+ onClick: r(n).dismiss
34
+ }, null, 8, ["label", "onClick"]),
35
+ $(v, {
36
+ label: r(t)("report.common.confirm"),
37
+ onClick: r(n).confirm
38
+ }, null, 8, ["label", "onClick"])
39
+ ]),
40
+ _: 1
41
+ }, 8, ["modelValue"]);
42
+ };
43
+ }
44
+ }), x = j(g());
45
+ function ye() {
46
+ const d = (t) => {
47
+ switch (x.value = t, t) {
48
+ case "zh-CN":
49
+ F.locale("zh-cn");
50
+ break;
51
+ default:
52
+ F.locale("en");
53
+ break;
54
+ }
55
+ };
56
+ return z(() => {
57
+ d(g());
58
+ }), p(() => g(), d, { deep: !0, immediate: !0 }), {
59
+ currentLocale: x
60
+ };
61
+ }
62
+ F.locale(g() === "zh-CN" ? "zh-cn" : "en");
63
+ const he = ["src"], _e = ["src"], Le = /* @__PURE__ */ O({
64
+ __name: "App",
65
+ setup(d) {
66
+ const { businessId: t, token: n, country: a } = B(re()), { sessionUser: i, currentBusiness: c, currentCountry: y, registerSidebarComponent: u } = k(), { getRestaurantAndWarehouse: v, getBusinessSetting: h } = ne(), { getFeatureFlags: _ } = ae(), { version: s } = B(ie()), { getSettings: A } = se(), l = fe(), { promptLoader: J } = le(), W = I(() => `https://portal-v1.feedmedev.cc/b/${t.value}/report/CLOSE_UP?showHeader=false&country=${a.value.toUpperCase()}&menuOption=business-report&token=${n.value}&v2=true&reportV5Button=true`), G = I(() => `https://report-v4.feedmedev.cc?businessId=${t.value}&country=${a.value}&token=${n.value}&reportV3Button=true`);
67
+ p(
68
+ // if route query pass in the detail we switch accordingly
69
+ [() => l.query, () => c.value, () => i.value],
70
+ () => {
71
+ var o, e, f;
72
+ l.query.token && l.query.businessId && l.query.country ? (t.value = l.query.businessId, n.value = l.query.token, a.value = l.query.country) : ((o = c.value) != null && o.id && (t.value = c.value.id), (e = i.value) != null && e.token && (n.value = (f = i.value) == null ? void 0 : f.token), y.value && (a.value = y.value));
73
+ },
74
+ { immediate: !0 }
75
+ );
76
+ function E(o) {
77
+ if (typeof o.data == "string")
78
+ try {
79
+ const e = JSON.parse(o.data);
80
+ (e == null ? void 0 : e.token) !== "" && (e == null ? void 0 : e.token) !== void 0 && (n.value = e.token);
81
+ } catch (e) {
82
+ console.error(e);
83
+ }
84
+ }
85
+ function L(o) {
86
+ if (typeof o.data == "string")
87
+ try {
88
+ const e = JSON.parse(o.data);
89
+ (e == null ? void 0 : e.v5) === !0 ? s.value = S.value : (e == null ? void 0 : e.v3) === !0 && (s.value = "v3");
90
+ } catch (e) {
91
+ console.error(e);
92
+ }
93
+ }
94
+ p(s, () => {
95
+ ["v3", "v4"].includes(s.value) ? k().hideSidebarToggle(!0) : k().hideSidebarToggle(!1);
96
+ }), M(() => {
97
+ u(de);
98
+ }), z(() => {
99
+ console.log("5.4.15-beta.3", !0), window.addEventListener("message", E), window.addEventListener("message", L);
100
+ });
101
+ const R = ce(), N = ve();
102
+ ee(() => {
103
+ window.removeEventListener("message", E), window.removeEventListener("message", L), R.$dispose(), N.$dispose();
104
+ });
105
+ const { getReports: K, getOverviewReport: P, getReportConfig: V } = R, { getSchema: H } = me(), { fetchSchedules: Q } = N, { init: X } = ue(), S = j("v5");
106
+ return p(
107
+ () => t.value,
108
+ () => {
109
+ t.value !== "" && J(async () => {
110
+ await X({
111
+ apiKey: "MaGoXrEWuEJNpWgKTqseee",
112
+ url: "https://flag.feedme.farm/api/v1/",
113
+ enableAnalytics: !1,
114
+ cacheFlags: !1
115
+ });
116
+ const o = await V();
117
+ S.value = o.version, s.value = S.value, await Promise.all([
118
+ _(),
119
+ V(),
120
+ P(),
121
+ K(),
122
+ H(),
123
+ Q(),
124
+ h(),
125
+ v(),
126
+ A()
127
+ ]);
128
+ });
129
+ },
130
+ {
131
+ immediate: !0
132
+ }
133
+ ), ye(), (o, e) => {
134
+ const f = C("router-view");
135
+ return m(), b(te, null, [
136
+ $(ge),
137
+ r(s) === "v3" ? (m(), b("iframe", {
138
+ key: 0,
139
+ class: "bg-white h-full w-full",
140
+ src: W.value
141
+ }, null, 8, he)) : r(s) === "v4" ? (m(), b("iframe", {
142
+ key: 1,
143
+ class: "bg-white h-full w-full",
144
+ src: G.value
145
+ }, null, 8, _e)) : (m(), T(f, { key: 2 }))
146
+ ], 64);
147
+ };
148
+ }
149
+ });
150
+ export {
151
+ Le as default
152
+ };
@@ -0,0 +1,162 @@
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-C3JC7z-H.js";
3
+ import { b as V } from "./index-9IDzTnHw.js";
4
+ import { detectLocale as $ } from "@feedmepos/mf-common";
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
+ __name: "FilterChip",
7
+ props: {
8
+ label: {
9
+ type: String,
10
+ default: ""
11
+ },
12
+ leftIcon: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ rightIcon: {
17
+ type: String,
18
+ default: ""
19
+ }
20
+ },
21
+ setup(a) {
22
+ const r = a;
23
+ return (d, l) => {
24
+ const e = g("FmIcon"), t = g("FmChip");
25
+ return u(), p(t, { class: "bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400 max-w-fit" }, {
26
+ default: v(() => [
27
+ a.leftIcon ? (u(), p(e, {
28
+ key: 0,
29
+ name: r.leftIcon,
30
+ size: "sm",
31
+ outline: ""
32
+ }, null, 8, ["name"])) : y("", !0),
33
+ w("p", Y, M(r.label), 1),
34
+ a.rightIcon ? (u(), p(e, {
35
+ key: 1,
36
+ name: a.rightIcon,
37
+ size: "sm",
38
+ outline: ""
39
+ }, null, 8, ["name"])) : y("", !0),
40
+ w("div", j, [
41
+ P(d.$slots, "default")
42
+ ])
43
+ ]),
44
+ _: 3
45
+ });
46
+ };
47
+ }
48
+ }), N = { class: "flex gap-2 items-center" }, i = "YYYY-MM-DD", G = /* @__PURE__ */ F({
49
+ __name: "DateRangeSelect",
50
+ props: /* @__PURE__ */ T({
51
+ compare: {
52
+ type: Boolean,
53
+ default: !1
54
+ },
55
+ datePredefinedRanges: {
56
+ type: Array,
57
+ default: () => O
58
+ }
59
+ }, {
60
+ compareType: {
61
+ type: String,
62
+ default: B.PrecedingPeriod
63
+ },
64
+ compareTypeModifiers: {},
65
+ dateRange: {
66
+ type: Object,
67
+ default: () => ({
68
+ startDate: void 0,
69
+ endDate: void 0
70
+ })
71
+ },
72
+ dateRangeModifiers: {},
73
+ compareDateRange: {
74
+ type: Object,
75
+ default: () => ({
76
+ startDate: void 0,
77
+ endDate: void 0
78
+ })
79
+ },
80
+ compareDateRangeModifiers: {}
81
+ }),
82
+ emits: ["update:compareType", "update:dateRange", "update:compareDateRange"],
83
+ setup(a) {
84
+ var S, R, b;
85
+ const r = f(a, "compareType"), d = f(a, "dateRange"), l = f(a, "compareDateRange"), e = C({
86
+ startDate: (S = n(d.value.startDate)) == null ? void 0 : S.local().format(i),
87
+ endDate: (R = n(d.value.endDate)) == null ? void 0 : R.local().format(i)
88
+ }), t = C({
89
+ startDate: l.value.startDate ? (b = n(l.value.startDate)) == null ? void 0 : b.local().format(i) : void 0,
90
+ endDate: l.value.endDate ? n(l.value.endDate).local().format(i) : void 0
91
+ });
92
+ I(
93
+ [() => e.value],
94
+ () => {
95
+ e.value.endDate || (e.value.endDate = e.value.startDate), d.value = {
96
+ startDate: n(e.value.startDate).toISOString(),
97
+ endDate: n(e.value.endDate).toISOString()
98
+ };
99
+ },
100
+ { deep: !0 }
101
+ ), I([() => t.value], () => {
102
+ l.value = {
103
+ startDate: t.value.startDate ? n(t.value.startDate).toISOString() : void 0,
104
+ endDate: t.value.endDate ? n(t.value.endDate).toISOString() : void 0
105
+ };
106
+ });
107
+ function _(m) {
108
+ r.value = m;
109
+ }
110
+ return (m, s) => {
111
+ const h = g("FmSimpleDateRangePicker");
112
+ return u(), x("div", N, [
113
+ D(h, {
114
+ modelValue: e.value,
115
+ "onUpdate:modelValue": s[0] || (s[0] = (o) => e.value = o),
116
+ "show-predefined-range": "",
117
+ "predefined-range": a.datePredefinedRanges.map((o) => ({
118
+ ...o,
119
+ label: m.$t(`report.date.${o.label}`)
120
+ })),
121
+ class: "w-2/6"
122
+ }, {
123
+ "trigger-button": v(() => [
124
+ D(k, {
125
+ "left-icon": "calendar_month",
126
+ label: `${c(V)({
127
+ startDate: e.value.startDate ?? "",
128
+ endDate: e.value.endDate ?? "",
129
+ locale: c($)()
130
+ })}`
131
+ }, null, 8, ["label"])
132
+ ]),
133
+ _: 1
134
+ }, 8, ["modelValue", "predefined-range"]),
135
+ a.compare ? (u(), p(h, {
136
+ key: 0,
137
+ modelValue: t.value,
138
+ "onUpdate:modelValue": s[1] || (s[1] = (o) => t.value = o),
139
+ "show-predefined-range": "",
140
+ "compare-target": e.value,
141
+ "default-compare-type": r.value,
142
+ onSelectComparison: _
143
+ }, {
144
+ "trigger-button": v(() => [
145
+ D(k, {
146
+ label: `${m.$t("report.common.compare")}: ${c(V)({
147
+ startDate: t.value.startDate ?? null,
148
+ endDate: t.value.endDate ?? null,
149
+ locale: c($)()
150
+ })}`
151
+ }, null, 8, ["label"])
152
+ ]),
153
+ _: 1
154
+ }, 8, ["modelValue", "compare-target", "default-compare-type"])) : y("", !0)
155
+ ]);
156
+ };
157
+ }
158
+ });
159
+ export {
160
+ G as _,
161
+ k as a
162
+ };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as u, computed as f, resolveComponent as p, createElementBlock as s, openBlock as r, normalizeStyle as n, normalizeClass as d, unref as e, createBlock as y, createCommentVNode as _, createVNode as k, createElementVNode as x, renderSlot as g } from "vue";
2
- import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-C8yzWDXs.js";
2
+ import { _ as v } from "./NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js";
3
3
  import { useBreakpoints as h } from "@feedmepos/ui-library";
4
4
  import { storeToRefs as b } from "pinia";
5
- import { d as w } from "./global-loader-CMC9fgBi.js";
5
+ import { f as w } from "./global-loader-C3JC7z-H.js";
6
6
  import { useRoute as q } from "vue-router";
7
7
  const C = {
8
8
  key: 1,