@feedmepos/mf-report 5.27.35 → 5.27.36
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.
- package/dist/{App-4_GHdc0c.js → App-CHT3iF-7.js} +4 -4
- package/dist/{DateRangeSelect-Cvxqh6KE.js → DateRangeSelect-D2772bgT.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-FvTBswXI.js → Default.vue_vue_type_script_setup_true_lang-CArSG8Z_.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-PhthswCX.js → DynamicWidget.vue_vue_type_script_setup_true_lang-RABMoQ3F.js} +949 -879
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CoI3PFYF.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DzZP-ANz.js} +3886 -3841
- package/dist/InsightView-KYbGpFKj.js +689 -0
- package/dist/{Integration-BmtzVBU8.js → Integration-CocbSCYz.js} +3 -3
- package/dist/{Integrations-FKTHYjkY.js → Integrations-DaKi0pnt.js} +2 -2
- package/dist/{Layout-Dn9c-gMi.js → Layout-p1hYeFa3.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-H1iroFEV.js → MenuTab.vue_vue_type_script_setup_true_lang-DG-9RjS_.js} +49 -46
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-cPTLcF06.js → NavigationTab.vue_vue_type_script_setup_true_lang-By2GxyK2.js} +3 -3
- package/dist/{OverviewView-DQs-PWBo.js → OverviewView-CfmhSHLj.js} +4 -4
- package/dist/{Report-gLUTNmHm.js → Report-tUyaWEtI.js} +3 -3
- package/dist/ReportEditor-BUXYZXMs.js +2032 -0
- package/dist/ReportView-BwrLb4jX.js +331 -0
- package/dist/{Setting-zldr38s7.js → Setting-DApgIt2e.js} +11 -11
- package/dist/{Template-nAGq9Il6.js → Template-Cte2kk4J.js} +3 -3
- package/dist/TileEditor-DPUludYa.js +4154 -0
- package/dist/TileGrid.vue_vue_type_script_setup_true_lang-CC-xGpBd.js +257 -0
- package/dist/{TransitionFade-Cq7jxuTO.js → TransitionFade-DszPGM-J.js} +4 -4
- package/dist/{app-L5Gs2RN0.js → app-CwM9HM2R.js} +3577 -3371
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-GhwszhPe.js → formatChartData.worker-Ci7ZpIYk.js} +6 -6
- package/dist/assets/{processTableData.worker-C4hgpe0l.js → processTableData.worker-C2Ubh_e0.js} +6 -6
- package/dist/style.css +1 -1
- package/dist/{useRestaurantPermission-D9GFgNLW.js → useRestaurantPermission-BQ0MKNOz.js} +1 -1
- package/package.json +2 -2
- package/dist/InsightView-D8Jpwge7.js +0 -664
- package/dist/ReportEditor-kp63cCQT.js +0 -1831
- package/dist/ReportView-0m23WbFa.js +0 -311
- package/dist/TileEditor-CcwBUuaS.js +0 -4093
- package/dist/TileGrid.vue_vue_type_script_setup_true_lang-707n8i-y.js +0 -154
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import { ref as I, defineComponent as S, watch as P, computed as $, onMounted as de, createElementBlock as r, openBlock as o, createElementVNode as s, renderSlot as J, toDisplayString as C, resolveDirective as K, createCommentVNode as D, Fragment as z, renderList as N, createBlock as R, withDirectives as T, resolveDynamicComponent as U, unref as m, withCtx as B, createVNode as p, normalizeClass as W, resolveComponent as M, useModel as ce, createTextVNode as ue, isRef as j, nextTick as fe } from "vue";
|
|
2
|
+
import { _ as me } from "./Default.vue_vue_type_script_setup_true_lang-CArSG8Z_.js";
|
|
3
|
+
import { c as H, D as ge } from "./DateRangeSelect-D2772bgT.js";
|
|
4
|
+
import { d as E, u as Q, F as ee, q as te, a as pe, h as ve, g as X, i as he, j as ye, k as we } from "./app-CwM9HM2R.js";
|
|
5
|
+
import { storeToRefs as ae } from "pinia";
|
|
6
|
+
import { C as le, r as xe } from "./chart-DDDh8zNk.js";
|
|
7
|
+
import { components as Y, useSnackbar as be } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as se } from "./_plugin-vue_export-helper-onplcgja.js";
|
|
9
|
+
import { _ as Ce } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CGbb3b5G.js";
|
|
10
|
+
import { a as ke, G as _e } from "./NavigationTab.vue_vue_type_script_setup_true_lang-By2GxyK2.js";
|
|
11
|
+
import { useCoreStore as $e } from "@feedmepos/mf-common";
|
|
12
|
+
function Ae({ start: e, end: t }) {
|
|
13
|
+
return `${E(t).format("DD MMM")}, ${E(t).format("YYYY")}`;
|
|
14
|
+
}
|
|
15
|
+
I(!0);
|
|
16
|
+
const De = async (e) => {
|
|
17
|
+
const { businessId: t } = ae(Q());
|
|
18
|
+
if (t) {
|
|
19
|
+
const a = {
|
|
20
|
+
fetchType: ee.Post,
|
|
21
|
+
url: `${t.value}/insights`,
|
|
22
|
+
data: {
|
|
23
|
+
...e,
|
|
24
|
+
isAnomaly: !0
|
|
25
|
+
// isAnomaly: anomaly.value
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return te.fetch(a);
|
|
29
|
+
} else
|
|
30
|
+
return Promise.reject(new Error("Business Id is not defined"));
|
|
31
|
+
}, Fe = async (e) => {
|
|
32
|
+
const { businessId: t } = Q(), a = {
|
|
33
|
+
fetchType: ee.Post,
|
|
34
|
+
url: `${t}/insights/feedbacks`,
|
|
35
|
+
data: e
|
|
36
|
+
};
|
|
37
|
+
return te.fetch(a);
|
|
38
|
+
};
|
|
39
|
+
le.register(...xe);
|
|
40
|
+
const Re = { class: "flex flex-col h-full overflow-hidden" }, Ie = { class: "flex flex-col gap-8" }, Be = { class: "fm-color-typo-primary fm-typo-en-body-lg-400" }, Ve = { class: "fm-color-typo-secondary fm-typo-en-body-md-400" }, Se = { class: "grow" }, Pe = /* @__PURE__ */ S({
|
|
41
|
+
__name: "LineChart",
|
|
42
|
+
props: {
|
|
43
|
+
name: { default: void 0 },
|
|
44
|
+
paragraph: { default: void 0 },
|
|
45
|
+
datasets: {},
|
|
46
|
+
xAxis: {},
|
|
47
|
+
transpose: { type: Boolean, default: !1 },
|
|
48
|
+
stacked: { type: Boolean },
|
|
49
|
+
maintainAspectRatio: { type: Boolean },
|
|
50
|
+
hideXAxis: { type: Boolean, default: void 0 },
|
|
51
|
+
hideYAxis: { type: Boolean, default: void 0 },
|
|
52
|
+
legend: { default: void 0 }
|
|
53
|
+
},
|
|
54
|
+
setup(e) {
|
|
55
|
+
const t = e, a = I(null);
|
|
56
|
+
let l = null;
|
|
57
|
+
P(
|
|
58
|
+
[
|
|
59
|
+
() => t.transpose,
|
|
60
|
+
() => t.maintainAspectRatio,
|
|
61
|
+
() => t.hideXAxis,
|
|
62
|
+
() => t.hideYAxis,
|
|
63
|
+
() => t.legend
|
|
64
|
+
],
|
|
65
|
+
() => {
|
|
66
|
+
l && l.config.options && (l.destroy(), d());
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
const n = $(() => t.transpose ? "y" : "x"), w = $(() => ({
|
|
70
|
+
labels: t.xAxis.categories,
|
|
71
|
+
datasets: t.datasets.map((i) => ({
|
|
72
|
+
...i,
|
|
73
|
+
borderDash: i.dash ? [5, 5] : void 0,
|
|
74
|
+
tension: i.tension || 0.1
|
|
75
|
+
}))
|
|
76
|
+
}));
|
|
77
|
+
P(
|
|
78
|
+
w,
|
|
79
|
+
() => {
|
|
80
|
+
l && (l.data = w.value, l.update());
|
|
81
|
+
},
|
|
82
|
+
{ deep: !0 }
|
|
83
|
+
);
|
|
84
|
+
function d() {
|
|
85
|
+
a.value && (l = new le(a.value, {
|
|
86
|
+
type: "line",
|
|
87
|
+
data: w.value,
|
|
88
|
+
options: {
|
|
89
|
+
plugins: {
|
|
90
|
+
legend: t.legend || {
|
|
91
|
+
display: !0,
|
|
92
|
+
position: "bottom",
|
|
93
|
+
maxHeight: 60,
|
|
94
|
+
labels: {
|
|
95
|
+
usePointStyle: !0,
|
|
96
|
+
pointStyle: "line"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
maintainAspectRatio: t.maintainAspectRatio,
|
|
101
|
+
responsive: !0,
|
|
102
|
+
indexAxis: n.value,
|
|
103
|
+
scales: {
|
|
104
|
+
x: {
|
|
105
|
+
display: !t.hideXAxis,
|
|
106
|
+
stacked: t.stacked,
|
|
107
|
+
grid: {
|
|
108
|
+
display: !1
|
|
109
|
+
},
|
|
110
|
+
beginAtZero: !0
|
|
111
|
+
},
|
|
112
|
+
y: {
|
|
113
|
+
display: !t.hideYAxis,
|
|
114
|
+
stacked: t.stacked,
|
|
115
|
+
grid: {
|
|
116
|
+
display: !0
|
|
117
|
+
},
|
|
118
|
+
position: "right",
|
|
119
|
+
beginAtZero: !0
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
elements: {
|
|
123
|
+
line: {
|
|
124
|
+
borderWidth: 1.5
|
|
125
|
+
},
|
|
126
|
+
point: {
|
|
127
|
+
radius: 0,
|
|
128
|
+
hitRadius: 30,
|
|
129
|
+
hoverRadius: 6,
|
|
130
|
+
hoverBackgroundColor: "#FFFFFF",
|
|
131
|
+
hoverBorderWidth: 3
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
return de(() => {
|
|
138
|
+
d();
|
|
139
|
+
}), (i, k) => (o(), r("div", Re, [
|
|
140
|
+
s("div", Ie, [
|
|
141
|
+
J(i.$slots, "title"),
|
|
142
|
+
s("div", Be, C(i.name), 1),
|
|
143
|
+
s("div", Ve, C(i.paragraph), 1)
|
|
144
|
+
]),
|
|
145
|
+
s("div", Se, [
|
|
146
|
+
s("canvas", {
|
|
147
|
+
ref_key: "canvas",
|
|
148
|
+
ref: a
|
|
149
|
+
}, null, 512)
|
|
150
|
+
])
|
|
151
|
+
]));
|
|
152
|
+
}
|
|
153
|
+
}), Me = ["width", "height"], Le = ["fill"], Te = ["fill"], We = ["stroke"], je = ["stroke"], oe = /* @__PURE__ */ S({
|
|
154
|
+
__name: "SparkIcon",
|
|
155
|
+
props: {
|
|
156
|
+
size: {
|
|
157
|
+
type: Number,
|
|
158
|
+
default: 24
|
|
159
|
+
},
|
|
160
|
+
color: {
|
|
161
|
+
type: String,
|
|
162
|
+
default: "#6B6B6B"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
setup(e) {
|
|
166
|
+
const t = e, a = $(() => `${t.size}px`);
|
|
167
|
+
return (l, n) => (o(), r("svg", {
|
|
168
|
+
width: a.value,
|
|
169
|
+
height: a.value,
|
|
170
|
+
viewBox: "0 0 24 24",
|
|
171
|
+
fill: "none",
|
|
172
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
173
|
+
}, [
|
|
174
|
+
s("path", {
|
|
175
|
+
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
176
|
+
fill: t.color
|
|
177
|
+
}, null, 8, Le),
|
|
178
|
+
s("path", {
|
|
179
|
+
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
180
|
+
fill: t.color
|
|
181
|
+
}, null, 8, Te),
|
|
182
|
+
s("path", {
|
|
183
|
+
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
184
|
+
stroke: t.color,
|
|
185
|
+
"stroke-width": "1.5",
|
|
186
|
+
"stroke-linecap": "round",
|
|
187
|
+
"stroke-linejoin": "round"
|
|
188
|
+
}, null, 8, We),
|
|
189
|
+
s("path", {
|
|
190
|
+
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
191
|
+
stroke: t.color,
|
|
192
|
+
"stroke-width": "1.5",
|
|
193
|
+
"stroke-linecap": "round",
|
|
194
|
+
"stroke-linejoin": "round"
|
|
195
|
+
}, null, 8, je)
|
|
196
|
+
], 8, Me));
|
|
197
|
+
}
|
|
198
|
+
}), ze = { class: "flex flex-col gap-16" }, Ne = { class: "fm-typo-en-title-sm-600" }, Ee = { class: "flex justify-center items-center" }, Ue = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ye = {
|
|
199
|
+
key: 0,
|
|
200
|
+
class: "rounded-lg p-2"
|
|
201
|
+
}, Ze = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary text-wrap" }, qe = { key: 0 }, He = {
|
|
202
|
+
key: 0,
|
|
203
|
+
class: "flex justify-center w-full gap-8"
|
|
204
|
+
}, Xe = ["onClick"], G = /* @__PURE__ */ S({
|
|
205
|
+
__name: "CarouselCard",
|
|
206
|
+
props: {
|
|
207
|
+
title: {
|
|
208
|
+
type: String,
|
|
209
|
+
default: ""
|
|
210
|
+
},
|
|
211
|
+
items: {
|
|
212
|
+
type: Array,
|
|
213
|
+
default: () => []
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
setup(e) {
|
|
217
|
+
const t = I(0), a = I(), l = e;
|
|
218
|
+
function n(d) {
|
|
219
|
+
var i;
|
|
220
|
+
if (a.value) {
|
|
221
|
+
const k = (((i = a.value) == null ? void 0 : i.scrollWidth) ?? 1) / l.items.length;
|
|
222
|
+
a.value.scrollLeft = k * d;
|
|
223
|
+
}
|
|
224
|
+
t.value = d;
|
|
225
|
+
}
|
|
226
|
+
P(
|
|
227
|
+
() => a.value,
|
|
228
|
+
() => {
|
|
229
|
+
var d;
|
|
230
|
+
if (a.value) {
|
|
231
|
+
const i = ((((d = a.value) == null ? void 0 : d.scrollWidth) ?? 1) - 400) / l.items.length;
|
|
232
|
+
a.value.addEventListener("scroll", () => {
|
|
233
|
+
var g;
|
|
234
|
+
const k = Math.floor((((g = a.value) == null ? void 0 : g.scrollLeft) ?? 1) / i);
|
|
235
|
+
t.value = k;
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
const { FmTooltip: w } = Y;
|
|
241
|
+
return (d, i) => {
|
|
242
|
+
const k = K("wave");
|
|
243
|
+
return o(), r("div", ze, [
|
|
244
|
+
s("p", Ne, C(l.title), 1),
|
|
245
|
+
s("div", {
|
|
246
|
+
ref_key: "scroll",
|
|
247
|
+
ref: a,
|
|
248
|
+
class: "flex gap-8 overflow-x-scroll snap-x snap-mandatory w-full scrollbar-hide"
|
|
249
|
+
}, [
|
|
250
|
+
(o(!0), r(z, null, N(l.items, (g, c) => (o(), r("div", {
|
|
251
|
+
key: `reason_${c}`,
|
|
252
|
+
class: "min-w-[368px] border rounded-lg p-16 snap-always snap-center flex gap-8 flex-col"
|
|
253
|
+
}, [
|
|
254
|
+
s("div", Ee, [
|
|
255
|
+
(o(), R(U(g.defination ? m(w) : "div"), {
|
|
256
|
+
content: g.defination,
|
|
257
|
+
"z-index": 100
|
|
258
|
+
}, {
|
|
259
|
+
default: B(() => [
|
|
260
|
+
s("p", Ue, C(g.header), 1)
|
|
261
|
+
]),
|
|
262
|
+
_: 2
|
|
263
|
+
}, 1032, ["content"])),
|
|
264
|
+
i[0] || (i[0] = s("div", { class: "grow" }, null, -1)),
|
|
265
|
+
g.header === "Introduce Kid-Friendly Menu Items" ? T((o(), r("button", Ye, [
|
|
266
|
+
p(oe, { size: 22 })
|
|
267
|
+
])), [
|
|
268
|
+
[k, !0]
|
|
269
|
+
]) : D("", !0)
|
|
270
|
+
]),
|
|
271
|
+
s("p", Ze, C(g.subLabel), 1)
|
|
272
|
+
]))), 128)),
|
|
273
|
+
l.items.length === 0 ? (o(), r("div", qe, [
|
|
274
|
+
s("p", null, "No " + C(l.title.toLowerCase()) + " at the moment", 1)
|
|
275
|
+
])) : D("", !0)
|
|
276
|
+
], 512),
|
|
277
|
+
e.items.length > 1 ? (o(), r("div", He, [
|
|
278
|
+
(o(!0), r(z, null, N(e.items, (g, c) => (o(), r("span", {
|
|
279
|
+
key: `carousel_${c}`,
|
|
280
|
+
class: W([
|
|
281
|
+
"w-[11px] h-[11px] rounded-lg cursor-pointer",
|
|
282
|
+
c === t.value ? " bg-fm-color-neutral-gray-300" : "bg-fm-color-neutral-gray-100"
|
|
283
|
+
]),
|
|
284
|
+
onClick: (_) => n(c)
|
|
285
|
+
}, null, 10, Xe))), 128))
|
|
286
|
+
])) : D("", !0)
|
|
287
|
+
]);
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}), Ge = { class: "flex flex-col flex-grow gap-16" }, Oe = { class: "flex flex-row items-center gap-2" }, Je = { class: "flex flex-row items-center justify-center gap-1" }, Ke = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Qe = { class: "flex flex-col fm-typo-en-body-lg-600" }, et = { class: "flex flex-col" }, tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt = {
|
|
291
|
+
key: 0,
|
|
292
|
+
style: { height: "240px" }
|
|
293
|
+
}, st = {
|
|
294
|
+
key: 1,
|
|
295
|
+
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
296
|
+
}, ot = {
|
|
297
|
+
key: 0,
|
|
298
|
+
class: "flex flex-col gap-40"
|
|
299
|
+
}, nt = {
|
|
300
|
+
key: 1,
|
|
301
|
+
class: "flex flex-row items-center justify-between"
|
|
302
|
+
}, it = { class: "fm-typo-en-body-lg-600" }, rt = { class: "flex flex-row items-center gap-8" }, O = /* @__PURE__ */ S({
|
|
303
|
+
__name: "InsightCard",
|
|
304
|
+
props: {
|
|
305
|
+
widget: {
|
|
306
|
+
type: Object,
|
|
307
|
+
default: () => null
|
|
308
|
+
},
|
|
309
|
+
detail: {
|
|
310
|
+
type: Boolean,
|
|
311
|
+
default: !1
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
emits: ["click-feedback"],
|
|
315
|
+
setup(e, { emit: t }) {
|
|
316
|
+
const { t: a } = se(), l = $(() => e.widget.data.isAnomaly > 0 ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : e.widget.data.isAnomaly < 0 ? "bg-fm-color-system-error-100 text-fm-color-typo-error" : ""), n = t;
|
|
317
|
+
function w(u) {
|
|
318
|
+
u === e.widget.feedback.reaction ? n("click-feedback", null) : n("click-feedback", u);
|
|
319
|
+
}
|
|
320
|
+
const d = $(() => {
|
|
321
|
+
const u = "rgb(66, 133, 244)";
|
|
322
|
+
let f = u;
|
|
323
|
+
return e.widget.data.isAnomaly > 0 ? f = "#1F7735" : e.widget.data.isAnomaly < 0 && (f = "#99231D"), [
|
|
324
|
+
{
|
|
325
|
+
label: "Anomaly",
|
|
326
|
+
data: e.widget.data.actualValues.map(
|
|
327
|
+
(h, x) => x >= e.widget.data.actualValues.length - 2 ? h : null
|
|
328
|
+
),
|
|
329
|
+
fill: !1,
|
|
330
|
+
borderColor: f,
|
|
331
|
+
borderWidth: 2,
|
|
332
|
+
pointRadius: function(h) {
|
|
333
|
+
return h.dataIndex === e.widget.data.actualValues.length - 1 ? 5 : 0;
|
|
334
|
+
},
|
|
335
|
+
pointStyle: "circle",
|
|
336
|
+
pointBackgroundColor: f
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
label: "Actual",
|
|
340
|
+
data: e.widget.data.actualValues.map(
|
|
341
|
+
(h, x) => x !== e.widget.data.actualValues.length - 1 ? h : null
|
|
342
|
+
),
|
|
343
|
+
fill: !1,
|
|
344
|
+
borderColor: u,
|
|
345
|
+
borderWidth: 2
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
label: "Expected",
|
|
349
|
+
data: e.widget.data.forecastValues,
|
|
350
|
+
fill: !1,
|
|
351
|
+
borderColor: "white",
|
|
352
|
+
borderWidth: 2
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
label: "Upper",
|
|
356
|
+
data: e.widget.data.upperBoundValues,
|
|
357
|
+
fill: 4,
|
|
358
|
+
backgroundColor: "rgba(66, 133, 244, 0.3)",
|
|
359
|
+
borderColor: "white"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
label: "Lower",
|
|
363
|
+
legend: !1,
|
|
364
|
+
data: e.widget.data.lowerBoundValues,
|
|
365
|
+
color: "",
|
|
366
|
+
fill: !1,
|
|
367
|
+
borderColor: "white"
|
|
368
|
+
}
|
|
369
|
+
];
|
|
370
|
+
}), i = $(
|
|
371
|
+
() => e.widget.data.labels.map((u) => {
|
|
372
|
+
const f = E(u), A = [f.format("DD MMM")], h = f.format("d");
|
|
373
|
+
return (h === "6" || h === "0") && A.push(f.format("ddd")), A;
|
|
374
|
+
})
|
|
375
|
+
), k = {
|
|
376
|
+
display: !0,
|
|
377
|
+
position: "bottom",
|
|
378
|
+
maxHeight: 54,
|
|
379
|
+
onClick: (u) => u.stopPropagation(),
|
|
380
|
+
labels: {
|
|
381
|
+
usePointStyle: !0,
|
|
382
|
+
filter: function(u, f) {
|
|
383
|
+
return !["Upper", "Lower", "Actual"].includes(
|
|
384
|
+
f.datasets[u.datasetIndex].label
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}, g = $(() => ({ categories: i.value }));
|
|
389
|
+
$(() => H(e.widget.category));
|
|
390
|
+
const c = $(() => "The total money earned from all customer purchases, including sales, service charges, rounding, and delivery fees, minus any discounts. Revenue = gross sales - discounts + SST + service charge + rounding + delivery fee"), { FmTooltip: _ } = Y;
|
|
391
|
+
return (u, f) => {
|
|
392
|
+
var L, V;
|
|
393
|
+
const A = M("FmChip"), h = M("FmIcon"), x = K("wave");
|
|
394
|
+
return o(), r("div", {
|
|
395
|
+
class: W(["flex flex-col gap-40 overflow-y-scroll relative scrollbar-hide", e.detail ? "max-w-[515px]" : "max-w-[368px]"])
|
|
396
|
+
}, [
|
|
397
|
+
T((o(), r("div", {
|
|
398
|
+
variant: "outlined",
|
|
399
|
+
class: W(["flex flex-col p-16 gap-16 relative border rounded-lg", e.detail ? "" : "cursor-pointer"])
|
|
400
|
+
}, [
|
|
401
|
+
s("div", Ge, [
|
|
402
|
+
s("div", Oe, [
|
|
403
|
+
s("div", Je, [
|
|
404
|
+
p(oe, { size: 22 }),
|
|
405
|
+
s("div", Ke, C(m(a)("report.view.insight.title")), 1)
|
|
406
|
+
]),
|
|
407
|
+
p(A, {
|
|
408
|
+
compact: "",
|
|
409
|
+
label: m(a)(`report.category.${m(H)(e.widget.category)}`),
|
|
410
|
+
class: "bg-fm-color-system-info-100 text-fm-color-typo-info"
|
|
411
|
+
}, null, 8, ["label"]),
|
|
412
|
+
p(A, {
|
|
413
|
+
class: W(l.value),
|
|
414
|
+
compact: "",
|
|
415
|
+
label: e.widget.data.isAnomaly !== 0 ? m(a)("report.view.insight.status.abnormal") : m(a)("report.view.insight.status.normal")
|
|
416
|
+
}, null, 8, ["class", "label"])
|
|
417
|
+
]),
|
|
418
|
+
(o(), R(U(e.detail ? m(_) : "div"), {
|
|
419
|
+
content: c.value,
|
|
420
|
+
"z-index": 100
|
|
421
|
+
}, {
|
|
422
|
+
default: B(() => [
|
|
423
|
+
s("div", Qe, C(e.widget.title), 1)
|
|
424
|
+
]),
|
|
425
|
+
_: 1
|
|
426
|
+
}, 8, ["content"])),
|
|
427
|
+
s("div", et, [
|
|
428
|
+
s("div", tt, C(e.widget.restaurantName), 1),
|
|
429
|
+
s("div", at, C(m(Ae)(e.widget.dateRange)), 1)
|
|
430
|
+
])
|
|
431
|
+
]),
|
|
432
|
+
e.detail ? (o(), r("div", lt, [
|
|
433
|
+
p(Pe, {
|
|
434
|
+
datasets: d.value,
|
|
435
|
+
"x-axis": g.value,
|
|
436
|
+
legend: k,
|
|
437
|
+
"maintain-aspect-ratio": !1
|
|
438
|
+
}, null, 8, ["datasets", "x-axis"])
|
|
439
|
+
])) : D("", !0),
|
|
440
|
+
e.detail ? (o(), r("div", st, C(e.widget.description), 1)) : D("", !0)
|
|
441
|
+
], 2)), [
|
|
442
|
+
[x, !e.detail]
|
|
443
|
+
]),
|
|
444
|
+
e.detail && e.widget.data.isAnomaly < 0 ? (o(), r("div", ot, [
|
|
445
|
+
p(G, {
|
|
446
|
+
title: m(a)("report.view.insight.reason"),
|
|
447
|
+
items: (L = e.widget.data.recommendations) == null ? void 0 : L.map((b) => ({
|
|
448
|
+
header: b.label,
|
|
449
|
+
subLabel: b.reason.replace(b.metric, b.label),
|
|
450
|
+
defination: b.definition
|
|
451
|
+
}))
|
|
452
|
+
}, null, 8, ["title", "items"]),
|
|
453
|
+
p(G, {
|
|
454
|
+
title: m(a)("report.view.insight.recommendation"),
|
|
455
|
+
items: (V = e.widget.data.recommendations) == null ? void 0 : V.map((b) => ({
|
|
456
|
+
header: b.label,
|
|
457
|
+
subLabel: b.recommendation,
|
|
458
|
+
defination: b.definition
|
|
459
|
+
}))
|
|
460
|
+
}, null, 8, ["title", "items"])
|
|
461
|
+
])) : D("", !0),
|
|
462
|
+
e.detail ? (o(), r("div", nt, [
|
|
463
|
+
s("div", it, C(m(a)("report.view.insight.feedback.question")), 1),
|
|
464
|
+
s("div", rt, [
|
|
465
|
+
T(p(h, {
|
|
466
|
+
class: "cursor-pointer p-4 icon-btn",
|
|
467
|
+
name: "thumb_up",
|
|
468
|
+
size: "md",
|
|
469
|
+
outline: e.widget.feedback.reaction !== !0,
|
|
470
|
+
onClick: f[0] || (f[0] = () => w(!0))
|
|
471
|
+
}, null, 8, ["outline"]), [
|
|
472
|
+
[x, !0]
|
|
473
|
+
]),
|
|
474
|
+
T(p(h, {
|
|
475
|
+
class: "cursor-pointer p-4 icon-btn",
|
|
476
|
+
name: "thumb_down",
|
|
477
|
+
size: "md",
|
|
478
|
+
outline: e.widget.feedback.reaction !== !1,
|
|
479
|
+
onClick: f[1] || (f[1] = () => w(!1))
|
|
480
|
+
}, null, 8, ["outline"]), [
|
|
481
|
+
[x, !0]
|
|
482
|
+
])
|
|
483
|
+
])
|
|
484
|
+
])) : D("", !0)
|
|
485
|
+
], 2);
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
}), dt = { class: "flex w-full justify-between items-center" }, ct = /* @__PURE__ */ S({
|
|
489
|
+
__name: "SidePanel",
|
|
490
|
+
props: {
|
|
491
|
+
modelValue: { type: Boolean, required: !0 },
|
|
492
|
+
modelModifiers: {}
|
|
493
|
+
},
|
|
494
|
+
emits: ["update:modelValue"],
|
|
495
|
+
setup(e) {
|
|
496
|
+
const t = ce(e, "modelValue"), { FmSideSheet: a } = Y;
|
|
497
|
+
return (l, n) => {
|
|
498
|
+
const w = M("FmButton");
|
|
499
|
+
return o(), R(U(m(a)), {
|
|
500
|
+
modelValue: t.value,
|
|
501
|
+
"onUpdate:modelValue": n[1] || (n[1] = (d) => t.value = d),
|
|
502
|
+
"fullscreen-size": "sm",
|
|
503
|
+
"dismiss-away": !0,
|
|
504
|
+
"max-width": 512
|
|
505
|
+
}, {
|
|
506
|
+
"side-sheet-header": B(() => n[2] || (n[2] = [
|
|
507
|
+
ue("Insight")
|
|
508
|
+
])),
|
|
509
|
+
"top-sheet-header": B(() => [
|
|
510
|
+
s("div", dt, [
|
|
511
|
+
n[3] || (n[3] = s("p", null, "Insight", -1)),
|
|
512
|
+
p(w, {
|
|
513
|
+
icon: "close",
|
|
514
|
+
variant: "tertiary",
|
|
515
|
+
onClick: n[0] || (n[0] = (d) => t.value = !1)
|
|
516
|
+
})
|
|
517
|
+
])
|
|
518
|
+
]),
|
|
519
|
+
default: B(() => [
|
|
520
|
+
J(l.$slots, "default")
|
|
521
|
+
]),
|
|
522
|
+
_: 3
|
|
523
|
+
}, 8, ["modelValue"]);
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
}), ut = { class: "flex flex-col h-full" }, ft = { class: "flex flex-row px-24 justify-between items-center" }, mt = { class: "flex flex-row items-center gap-2" }, gt = {
|
|
527
|
+
key: 0,
|
|
528
|
+
class: "h-full w-full flex items-center justify-center"
|
|
529
|
+
}, pt = {
|
|
530
|
+
key: 1,
|
|
531
|
+
class: "flex-1 overflow-auto"
|
|
532
|
+
}, vt = {
|
|
533
|
+
key: 0,
|
|
534
|
+
class: "flex flex-row flex-wrap gap-24 px-24 py-16"
|
|
535
|
+
}, Ft = /* @__PURE__ */ S({
|
|
536
|
+
__name: "InsightView",
|
|
537
|
+
setup(e) {
|
|
538
|
+
const { t } = se(), a = $e(), {
|
|
539
|
+
dateRange: l,
|
|
540
|
+
compareDateRange: n,
|
|
541
|
+
locations: w,
|
|
542
|
+
selectedLocationIds: d,
|
|
543
|
+
selectedRestaurantIds: i,
|
|
544
|
+
business: k,
|
|
545
|
+
timezone: g
|
|
546
|
+
} = ae(pe()), c = I([]), _ = I(null), u = I(!1), f = be(), { canReadPageDateRange: A, getPageAccessWindow: h } = ve(), x = $(
|
|
547
|
+
() => h(X.report_accessInsight, g.value)
|
|
548
|
+
), L = $(
|
|
549
|
+
() => he(ye(), x.value)
|
|
550
|
+
);
|
|
551
|
+
P(
|
|
552
|
+
[x, l, g],
|
|
553
|
+
() => {
|
|
554
|
+
const y = we(
|
|
555
|
+
l.value,
|
|
556
|
+
x.value,
|
|
557
|
+
g.value
|
|
558
|
+
);
|
|
559
|
+
y && (y.startDate !== l.value.startDate || y.endDate !== l.value.endDate) && (l.value = y);
|
|
560
|
+
},
|
|
561
|
+
{ immediate: !0 }
|
|
562
|
+
), P(
|
|
563
|
+
k,
|
|
564
|
+
() => {
|
|
565
|
+
k.value && V();
|
|
566
|
+
},
|
|
567
|
+
{ immediate: !0 }
|
|
568
|
+
);
|
|
569
|
+
async function V() {
|
|
570
|
+
try {
|
|
571
|
+
u.value = !0, i.value.length === 0 ? c.value = [] : A(
|
|
572
|
+
X.report_accessInsight,
|
|
573
|
+
l.value,
|
|
574
|
+
g.value
|
|
575
|
+
) ? c.value = await De({
|
|
576
|
+
start: l.value.startDate,
|
|
577
|
+
end: l.value.endDate,
|
|
578
|
+
restaurantIds: i.value
|
|
579
|
+
}) : c.value = [];
|
|
580
|
+
} catch (y) {
|
|
581
|
+
f.open({ message: y, type: "error" }), c.value = [];
|
|
582
|
+
} finally {
|
|
583
|
+
u.value = !1;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
function b(y) {
|
|
587
|
+
if (y !== null) {
|
|
588
|
+
try {
|
|
589
|
+
a.pushDataLayer(
|
|
590
|
+
{
|
|
591
|
+
event: _e.report_insight_click_insight_card,
|
|
592
|
+
insight: JSON.stringify(c.value[y])
|
|
593
|
+
},
|
|
594
|
+
"insight"
|
|
595
|
+
);
|
|
596
|
+
} catch (v) {
|
|
597
|
+
console.warn(v);
|
|
598
|
+
}
|
|
599
|
+
_.value = null;
|
|
600
|
+
}
|
|
601
|
+
fe(() => {
|
|
602
|
+
_.value = y;
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
async function ne(y) {
|
|
606
|
+
if (_.value !== null)
|
|
607
|
+
try {
|
|
608
|
+
u.value = !0;
|
|
609
|
+
const v = await Fe({
|
|
610
|
+
...c.value[_.value].feedback,
|
|
611
|
+
reaction: y
|
|
612
|
+
});
|
|
613
|
+
c.value[_.value].feedback = v;
|
|
614
|
+
} catch (v) {
|
|
615
|
+
f.open({ message: v, type: "error" });
|
|
616
|
+
} finally {
|
|
617
|
+
u.value = !1;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return (y, v) => {
|
|
621
|
+
const ie = M("FmPageHead"), re = M("FmCircularProgress");
|
|
622
|
+
return o(), R(me, null, {
|
|
623
|
+
default: B(() => {
|
|
624
|
+
var Z;
|
|
625
|
+
return [
|
|
626
|
+
p(ie, {
|
|
627
|
+
title: m(t)("report.view.insight.title")
|
|
628
|
+
}, null, 8, ["title"]),
|
|
629
|
+
s("div", ut, [
|
|
630
|
+
s("div", ft, [
|
|
631
|
+
s("div", mt, [
|
|
632
|
+
p(ke, {
|
|
633
|
+
modelValue: m(d),
|
|
634
|
+
"onUpdate:modelValue": [
|
|
635
|
+
v[0] || (v[0] = (F) => j(d) ? d.value = F : null),
|
|
636
|
+
V
|
|
637
|
+
],
|
|
638
|
+
options: m(w)
|
|
639
|
+
}, null, 8, ["modelValue", "options"]),
|
|
640
|
+
p(ge, {
|
|
641
|
+
"date-range": m(l),
|
|
642
|
+
"onUpdate:dateRange": [
|
|
643
|
+
v[1] || (v[1] = (F) => j(l) ? l.value = F : null),
|
|
644
|
+
V
|
|
645
|
+
],
|
|
646
|
+
"compare-date-range": m(n),
|
|
647
|
+
"onUpdate:compareDateRange": v[2] || (v[2] = (F) => j(n) ? n.value = F : null),
|
|
648
|
+
"date-predefined-ranges": L.value,
|
|
649
|
+
"min-date": (Z = x.value) == null ? void 0 : Z.minDate,
|
|
650
|
+
compare: !1
|
|
651
|
+
}, null, 8, ["date-range", "compare-date-range", "date-predefined-ranges", "min-date"])
|
|
652
|
+
])
|
|
653
|
+
]),
|
|
654
|
+
u.value ? (o(), r("div", gt, [
|
|
655
|
+
p(re, { size: "xl" })
|
|
656
|
+
])) : (o(), r("div", pt, [
|
|
657
|
+
c.value.length > 0 ? (o(), r("div", vt, [
|
|
658
|
+
(o(!0), r(z, null, N(c.value, (F, q) => (o(), R(O, {
|
|
659
|
+
key: q,
|
|
660
|
+
widget: F,
|
|
661
|
+
onClick: () => b(q)
|
|
662
|
+
}, null, 8, ["widget", "onClick"]))), 128))
|
|
663
|
+
])) : (o(), R(Ce, { key: 1 }))
|
|
664
|
+
])),
|
|
665
|
+
p(ct, {
|
|
666
|
+
"model-value": _.value !== null,
|
|
667
|
+
onBack: v[3] || (v[3] = () => b(null))
|
|
668
|
+
}, {
|
|
669
|
+
default: B(() => [
|
|
670
|
+
_.value !== null ? (o(), R(O, {
|
|
671
|
+
key: 0,
|
|
672
|
+
widget: c.value[_.value],
|
|
673
|
+
detail: "",
|
|
674
|
+
onClickFeedback: ne
|
|
675
|
+
}, null, 8, ["widget"])) : D("", !0)
|
|
676
|
+
]),
|
|
677
|
+
_: 1
|
|
678
|
+
}, 8, ["model-value"])
|
|
679
|
+
])
|
|
680
|
+
];
|
|
681
|
+
}),
|
|
682
|
+
_: 1
|
|
683
|
+
});
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
export {
|
|
688
|
+
Ft as default
|
|
689
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as ce, mergeModels as we, useModel as fe, computed as W, resolveComponent as I, createElementBlock as R, openBlock as w, createElementVNode as t, createCommentVNode as z, normalizeClass as et, Fragment as $e, renderList as ze, createBlock as ee, normalizeStyle as at, createVNode as l, withCtx as Ce, renderSlot as Vt, toDisplayString as S, unref as n, h as b, createTextVNode as $t, ref as ae, onUnmounted as He, watch as _e, isRef as Ee, resolveDynamicComponent as Be, mergeProps as st, withKeys as ot, withModifiers as dt, nextTick as kt, onMounted as pt } from "vue";
|
|
2
2
|
import { useRouter as Se, useRoute as It } from "vue-router";
|
|
3
|
-
import { B as he, E as nt, d as Ne, G as Tt, e as Le, a as De, H as be, J as Nt, p as Kt, y as pe, A as Ge, K as Ye, L as Oe, M as Qe, N as rt, O as Ft, P as Mt, Q as Ut, R as Rt, S as it, b as ut, T as Pt, U as Lt, t as jt, I as je, V as Ot, W as Et, X as Bt } from "./app-
|
|
3
|
+
import { B as he, E as nt, d as Ne, G as Tt, e as Le, a as De, H as be, J as Nt, p as Kt, y as pe, A as Ge, K as Ye, L as Oe, M as Qe, N as rt, O as Ft, P as Mt, Q as Ut, R as Rt, S as it, b as ut, T as Pt, U as Lt, t as jt, I as je, V as Ot, W as Et, X as Bt } from "./app-CwM9HM2R.js";
|
|
4
4
|
import { u as ve, a as We, _ as Yt } from "./_plugin-vue_export-helper-onplcgja.js";
|
|
5
5
|
import { u as Xe } from "./message-dialog-UoMWOnil.js";
|
|
6
6
|
import { useSnackbar as Ae } from "@feedmepos/ui-library";
|
|
7
|
-
import { s as St, D as Je } from "./DateRangeSelect-
|
|
8
|
-
import { u as qe, h as ke } from "./useRestaurantPermission-
|
|
7
|
+
import { s as St, D as Je } from "./DateRangeSelect-D2772bgT.js";
|
|
8
|
+
import { u as qe, h as ke } from "./useRestaurantPermission-BQ0MKNOz.js";
|
|
9
9
|
import { storeToRefs as Ze } from "pinia";
|
|
10
10
|
const qt = { class: "flex flex-row items-center w-[100%] gap-[4px] justify-between" }, zt = { class: "w-[100%] overflow-hidden" }, Ht = { class: "inline-flex max-w-full items-center gap-2 align-top" }, Gt = { class: "text-nowrap min-w-0 overflow-hidden text-ellipsis font-semibold" }, Qt = {
|
|
11
11
|
key: 0,
|