@feedmepos/mf-report 5.5.22 → 5.6.0-beta.2
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-CcxH4El5.js → App-DQxH_gFz.js} +42 -42
- package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-Bi_BES93.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-BD2DnN09.js} +2 -2
- package/dist/Default.vue_vue_type_script_setup_true_lang-D5g1LcIE.js +41 -0
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-CUdTbfoY.js +1284 -0
- package/dist/{InsightView-e1g-hx0o.js → InsightView-C0pUphgU.js} +6 -6
- package/dist/{Integration-BmVUAWAm.js → Integration-BVxULmIG.js} +10 -10
- package/dist/{Integrations-BiJVCGrp.js → Integrations-DS6q4VX4.js} +3 -3
- package/dist/{Layout-CArNGBSb.js → Layout-dF_aZ7xo.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-C-cKu5vV.js → MenuTab.vue_vue_type_script_setup_true_lang-aMIxHe4A.js} +3 -3
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-H76ViFsO.js → NavigationTab.vue_vue_type_script_setup_true_lang-CiVEIY-y.js} +5 -5
- package/dist/{NoData.vue_vue_type_script_setup_true_lang-CdFXBqlX.js → NoData.vue_vue_type_script_setup_true_lang-EVDtMqna.js} +1 -1
- package/dist/{OverviewView-DnO6aeea.js → OverviewView-DrqaX9tl.js} +5 -5
- package/dist/{Report-j_2Nytel.js → Report-Y7DJRdpf.js} +4 -4
- package/dist/{ReportEditor-BHX0_U00.js → ReportEditor-2eJzr-IM.js} +192 -192
- package/dist/{ReportView-v-lmXnvH.js → ReportView-BYWN3fLP.js} +7 -7
- package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-N2Lg1Vpt.js → SelectComponent.vue_vue_type_script_setup_true_lang-Cpjinmn4.js} +1 -1
- package/dist/{Setting-FmDb8VZl.js → Setting-BrhhAVcG.js} +4 -4
- package/dist/TileEditor-CdTw5--h.js +3017 -0
- package/dist/{TransitionFade-C9NidmbR.js → TransitionFade-Beq61IIZ.js} +4 -4
- package/dist/app.js +87 -31
- package/dist/{global-loader-CbmVhJAK.js → global-loader-DqYGIXIo.js} +1 -1
- package/dist/{index-BWqDfeY6.js → index-BChph3k1.js} +1 -1
- package/dist/{report-schema-BnzKoFjx.js → report-schema-CbMyeD7Q.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{v4-C5fRBp_c.js → v4-DVU_9OHv.js} +145 -136
- package/package.json +2 -2
- package/dist/Default.vue_vue_type_script_setup_true_lang-C25HSYeu.js +0 -41
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-CEyrg6sv.js +0 -1134
- package/dist/TileEditor-CxbsbV0j.js +0 -2691
|
@@ -1,1134 +0,0 @@
|
|
|
1
|
-
import { computed as s, defineComponent as G, useModel as U, ref as p, resolveComponent as F, createElementBlock as L, openBlock as w, Fragment as E, renderSlot as K, createVNode as z, normalizeStyle as O, unref as o, createElementVNode as P, toDisplayString as le, withCtx as $, createBlock as V, createCommentVNode as J, normalizeClass as de, h as Xe, renderList as Je, mergeModels as xt, watch as ue, onMounted as Ct, onUnmounted as _t, resolveDynamicComponent as St, withDirectives as kt, vShow as Ft } from "vue";
|
|
2
|
-
import { W as r, v as ce, R as Tt, g as Dt, d as Rt, q as Lt } from "./v4-C5fRBp_c.js";
|
|
3
|
-
import { u as _e, b as Ke, a as Se } from "./global-loader-CbmVhJAK.js";
|
|
4
|
-
import { d as Ye } from "./index-BWqDfeY6.js";
|
|
5
|
-
import { storeToRefs as ve } from "pinia";
|
|
6
|
-
import { _ as Pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
-
import { r as ee } from "./i18n-Cif1I9J2.js";
|
|
8
|
-
import { _ as qe } from "./NoData.vue_vue_type_script_setup_true_lang-CdFXBqlX.js";
|
|
9
|
-
import { useBreakpoints as zt, useSnackbar as Bt } from "@feedmepos/ui-library";
|
|
10
|
-
var ge = /* @__PURE__ */ ((e) => (e.line = "LINE", e.bar = "BAR", e))(ge || {}), H = /* @__PURE__ */ ((e) => (e.top = "TOP", e.bottom = "BOTTOM", e))(H || {}), ye = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e))(ye || {}), be = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(be || {}), we = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e))(we || {}), xe = /* @__PURE__ */ ((e) => (e.right = "right", e.left = "left", e))(xe || {}), Ce = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.right = "right", e.left = "left", e.chartArea = "chartArea", e))(Ce || {});
|
|
11
|
-
r.Circular, r.Table, r.BarChart, r.LineChart, r.StackBarChart, r.StackLineChart, r.Scorecard, r.Spacer;
|
|
12
|
-
const Vt = [
|
|
13
|
-
{
|
|
14
|
-
type: r.Circular,
|
|
15
|
-
showLabel: !1,
|
|
16
|
-
// TODO: temporarily removed show label as it has no function
|
|
17
|
-
showDrillDimension: !0,
|
|
18
|
-
showRollup: !1,
|
|
19
|
-
showSearchBar: !1
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
type: r.Table,
|
|
23
|
-
showLabel: !1,
|
|
24
|
-
showDrillDimension: !0,
|
|
25
|
-
showRollup: !0,
|
|
26
|
-
showSearchBar: !0
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
type: r.BarChart,
|
|
30
|
-
showLabel: !1,
|
|
31
|
-
// TODO: temporarily removed show label as it has no function
|
|
32
|
-
showDrillDimension: !0,
|
|
33
|
-
showRollup: !1,
|
|
34
|
-
showSearchBar: !1
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
type: r.LineChart,
|
|
38
|
-
showLabel: !1,
|
|
39
|
-
// TODO: temporarily removed show label as it has no function
|
|
40
|
-
showDrillDimension: !0,
|
|
41
|
-
showRollup: !0,
|
|
42
|
-
showSearchBar: !1
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: r.StackBarChart,
|
|
46
|
-
showLabel: !1,
|
|
47
|
-
// TODO: temporarily removed show label as it has no function
|
|
48
|
-
showDrillDimension: !0,
|
|
49
|
-
showRollup: !0,
|
|
50
|
-
showSearchBar: !1
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: r.StackLineChart,
|
|
54
|
-
showLabel: !1,
|
|
55
|
-
// TODO: temporarily removed show label as it has no function
|
|
56
|
-
showDrillDimension: !0,
|
|
57
|
-
showRollup: !0,
|
|
58
|
-
showSearchBar: !1
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: r.Scorecard,
|
|
62
|
-
showLabel: !1,
|
|
63
|
-
showDrillDimension: !1,
|
|
64
|
-
showRollup: !1,
|
|
65
|
-
showSearchBar: !1
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
type: r.Spacer,
|
|
69
|
-
showLabel: !1,
|
|
70
|
-
showDrillDimension: !1,
|
|
71
|
-
showRollup: !1,
|
|
72
|
-
showSearchBar: !1
|
|
73
|
-
}
|
|
74
|
-
];
|
|
75
|
-
function fe(e) {
|
|
76
|
-
const a = [e.schemaName, e.name];
|
|
77
|
-
return "option" in e && e.option && a.push(e.option), "aggregation" in e && e.aggregation && a.push(e.aggregation), a.push(e.label.replace(/[^a-zA-Z0-9]/g, "")), a.join("_").toLowerCase();
|
|
78
|
-
}
|
|
79
|
-
function $t(e, a) {
|
|
80
|
-
switch (e) {
|
|
81
|
-
case r.BarChart:
|
|
82
|
-
case r.LineChart:
|
|
83
|
-
case r.StackBarChart:
|
|
84
|
-
case r.StackLineChart:
|
|
85
|
-
return Array.isArray(a == null ? void 0 : a.datasets) && Array.isArray(a == null ? void 0 : a.xAxis) && a.datasets.length > 0 && a.xAxis.length > 0;
|
|
86
|
-
case r.Table:
|
|
87
|
-
return Array.isArray(a == null ? void 0 : a.rows) && Array.isArray(a == null ? void 0 : a.columns) && a.rows.length > 0 && a.columns.length > 0;
|
|
88
|
-
case r.Circular:
|
|
89
|
-
return Array.isArray(a == null ? void 0 : a.datasets) && a.datasets.length > 0;
|
|
90
|
-
case r.Scorecard:
|
|
91
|
-
return !0;
|
|
92
|
-
case r.Spacer:
|
|
93
|
-
return !0;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const je = [
|
|
97
|
-
"54, 162, 235",
|
|
98
|
-
//8CE6D7
|
|
99
|
-
"0, 123, 167",
|
|
100
|
-
//007BA7
|
|
101
|
-
"255, 93, 83",
|
|
102
|
-
//FF5D53
|
|
103
|
-
"115, 200, 230",
|
|
104
|
-
//73C8E6
|
|
105
|
-
"252, 162, 62",
|
|
106
|
-
//FCA23E
|
|
107
|
-
"240, 155, 190",
|
|
108
|
-
//F09BBE
|
|
109
|
-
"255, 210, 50",
|
|
110
|
-
//FFD232
|
|
111
|
-
"80, 190, 155",
|
|
112
|
-
//50BE9B
|
|
113
|
-
"131, 88, 212",
|
|
114
|
-
//8358D4
|
|
115
|
-
"155, 80, 70"
|
|
116
|
-
//9B5046
|
|
117
|
-
];
|
|
118
|
-
function oe({
|
|
119
|
-
index: e,
|
|
120
|
-
isCompare: a,
|
|
121
|
-
opacity: c
|
|
122
|
-
}) {
|
|
123
|
-
let t = typeof c == "number" ? c : 1;
|
|
124
|
-
return a && (t = t * 0.6), `rgba(${je[e % je.length]}, ${t})`;
|
|
125
|
-
}
|
|
126
|
-
function Qe(e, a, c) {
|
|
127
|
-
if (e === "" || a === "")
|
|
128
|
-
return null;
|
|
129
|
-
let t = (i) => i == null ? void 0 : i.replace(/,/g, "");
|
|
130
|
-
c === "ID" && (t = (i) => i == null ? void 0 : i.replace(/\./g, "").replace(/,/g, "."));
|
|
131
|
-
const x = Number(t(e)), y = Number(t(a));
|
|
132
|
-
if (isNaN(x) || isNaN(y))
|
|
133
|
-
return null;
|
|
134
|
-
let v = 0;
|
|
135
|
-
y === 0 ? x === 0 ? v = 0 : v = 1 : v = (x - y) / y;
|
|
136
|
-
const d = At(v);
|
|
137
|
-
return {
|
|
138
|
-
value: isNaN(v) ? "" : `${(v * 100).toFixed(0)}%`,
|
|
139
|
-
icon: d
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function At(e) {
|
|
143
|
-
return e > 0 ? {
|
|
144
|
-
name: "moving",
|
|
145
|
-
color: "#1F7735",
|
|
146
|
-
tailwind: "fm-color-system-success-100"
|
|
147
|
-
} : e < 0 ? {
|
|
148
|
-
name: "trending_down",
|
|
149
|
-
color: "#99231D",
|
|
150
|
-
tailwind: "fm-color-system-error-100"
|
|
151
|
-
} : {
|
|
152
|
-
name: "equal",
|
|
153
|
-
color: "#C7C7CC",
|
|
154
|
-
tailwind: "fm-color-neutral-gray-100"
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function ne(e) {
|
|
158
|
-
const a = s(() => ({
|
|
159
|
-
display: e.showLabel,
|
|
160
|
-
align: e.labelAlign,
|
|
161
|
-
anchor: e.labelAnchor,
|
|
162
|
-
rotation: e.labelRotation,
|
|
163
|
-
offset: e.labelOffset,
|
|
164
|
-
font: {
|
|
165
|
-
size: e.labelFontSize
|
|
166
|
-
}
|
|
167
|
-
})), c = s(() => ({
|
|
168
|
-
display: e.showX,
|
|
169
|
-
position: e.xPosition,
|
|
170
|
-
grid: {
|
|
171
|
-
display: e.showXGrid
|
|
172
|
-
},
|
|
173
|
-
ticks: {
|
|
174
|
-
display: e.showXTick,
|
|
175
|
-
font: {
|
|
176
|
-
size: e.xTickFontSize
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
})), t = s(() => ({
|
|
180
|
-
display: e.showY,
|
|
181
|
-
position: e.yPosition,
|
|
182
|
-
grid: {
|
|
183
|
-
display: e.showYGrid
|
|
184
|
-
},
|
|
185
|
-
ticks: {
|
|
186
|
-
display: e.showYTick,
|
|
187
|
-
font: {
|
|
188
|
-
size: e.yTickFontSize
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
})), x = s(() => ({
|
|
192
|
-
display: e.showLegend,
|
|
193
|
-
position: e.legendPosition,
|
|
194
|
-
usePointStyle: e.usePointStyle
|
|
195
|
-
})), y = s(() => e.isTransposed), v = s(() => e.chartWidth), d = s(() => e.chartHeight);
|
|
196
|
-
return { datalabels: a, xCfg: c, yCfg: t, isTransposed: y, legend: x, chartWidth: v, chartHeight: d };
|
|
197
|
-
}
|
|
198
|
-
const Wt = /* @__PURE__ */ G({
|
|
199
|
-
__name: "WidgetBarchart",
|
|
200
|
-
props: {
|
|
201
|
-
modelValue: { required: !0 },
|
|
202
|
-
modelModifiers: {}
|
|
203
|
-
},
|
|
204
|
-
emits: ["update:modelValue"],
|
|
205
|
-
setup(e) {
|
|
206
|
-
const a = U(e, "modelValue"), c = s(() => {
|
|
207
|
-
var m;
|
|
208
|
-
return ((m = a.value.data) == null ? void 0 : m.xAxis) ?? [];
|
|
209
|
-
}), t = s(() => {
|
|
210
|
-
var m;
|
|
211
|
-
return ((m = a.value.data) == null ? void 0 : m.datasets) ?? [];
|
|
212
|
-
}), x = p(null), { datalabels: y, xCfg: v, yCfg: d, isTransposed: i, legend: g, chartWidth: C, chartHeight: h } = ne(
|
|
213
|
-
a.value
|
|
214
|
-
), u = s(() => t.value.length > 0 ? [
|
|
215
|
-
...t.value.map((m, _) => ({
|
|
216
|
-
label: m.name,
|
|
217
|
-
data: m.values,
|
|
218
|
-
dash: !!m.isCompare,
|
|
219
|
-
backgroundColor: oe({ index: _, isCompare: m.isCompare })
|
|
220
|
-
}))
|
|
221
|
-
] : []);
|
|
222
|
-
return (m, _) => {
|
|
223
|
-
const B = F("FmBarChart");
|
|
224
|
-
return w(), L(E, null, [
|
|
225
|
-
K(m.$slots, "menu"),
|
|
226
|
-
z(B, {
|
|
227
|
-
ref_key: "chartRef",
|
|
228
|
-
ref: x,
|
|
229
|
-
class: "bar-chart",
|
|
230
|
-
datasets: u.value,
|
|
231
|
-
"x-axis": { categories: c.value },
|
|
232
|
-
"x-cfg": o(v),
|
|
233
|
-
"y-cfg": o(d),
|
|
234
|
-
transpose: o(i),
|
|
235
|
-
legend: {
|
|
236
|
-
display: o(g).display ?? !1,
|
|
237
|
-
position: o(g).position,
|
|
238
|
-
labels: {
|
|
239
|
-
usePointStyle: o(g).usePointStyle ?? !0
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
datalabels: o(y),
|
|
243
|
-
"maintain-aspect-ratio": !1,
|
|
244
|
-
style: O({
|
|
245
|
-
"--chart-width": o(C) !== void 0 ? o(C) + "px" : "100%",
|
|
246
|
-
"--chart-height": o(h) !== void 0 ? o(h) + "px" : "calc(100% - 36px)"
|
|
247
|
-
})
|
|
248
|
-
}, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "legend", "datalabels", "style"])
|
|
249
|
-
], 64);
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
}), It = /* @__PURE__ */ G({
|
|
253
|
-
__name: "WidgetCircular",
|
|
254
|
-
props: {
|
|
255
|
-
modelValue: { required: !0 },
|
|
256
|
-
modelModifiers: {}
|
|
257
|
-
},
|
|
258
|
-
emits: ["update:modelValue"],
|
|
259
|
-
setup(e) {
|
|
260
|
-
const a = U(e, "modelValue"), { datalabels: c, legend: t, chartWidth: x, chartHeight: y } = ne(a.value), v = s(() => {
|
|
261
|
-
let d = [];
|
|
262
|
-
return a.value.data.datasets && a.value.data.metrics && a.value.data.datasets.length > 0 && a.value.data.metrics.length > 0 && (d = [
|
|
263
|
-
{
|
|
264
|
-
label: a.value.data.metrics[0],
|
|
265
|
-
data: a.value.data.datasets.map((i) => i.value),
|
|
266
|
-
backgroundColor: a.value.data.datasets.map((i, g) => oe({ index: g }))
|
|
267
|
-
}
|
|
268
|
-
]), d;
|
|
269
|
-
});
|
|
270
|
-
return (d, i) => {
|
|
271
|
-
const g = F("FmPieChart");
|
|
272
|
-
return w(), L(E, null, [
|
|
273
|
-
K(d.$slots, "menu"),
|
|
274
|
-
z(g, {
|
|
275
|
-
class: "circular",
|
|
276
|
-
percentage: "70%",
|
|
277
|
-
datasets: v.value,
|
|
278
|
-
metrics: a.value.data.datasets.map((C) => C.name),
|
|
279
|
-
variant: "doughnut",
|
|
280
|
-
legend: {
|
|
281
|
-
display: o(t).display ?? !0,
|
|
282
|
-
position: o(t).position ?? "top",
|
|
283
|
-
maxHeight: o(t).display === !0 ? void 0 : 54,
|
|
284
|
-
labels: {
|
|
285
|
-
usePointStyle: o(t).usePointStyle ?? !0
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
datalabels: o(c),
|
|
289
|
-
"maintain-aspect-ratio": !1,
|
|
290
|
-
style: O({
|
|
291
|
-
"--chart-width": o(x) !== void 0 ? o(x) + "px" : "100%",
|
|
292
|
-
"--chart-height": o(y) !== void 0 ? o(y) + "px" : "calc(100% - 36px)"
|
|
293
|
-
})
|
|
294
|
-
}, null, 8, ["datasets", "metrics", "legend", "datalabels", "style"])
|
|
295
|
-
], 64);
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
}), Mt = { class: "flex flex-col gap-1" }, Ht = { class: "fm-typo-en-title-sm-600" }, Nt = { class: "flex gap-2" }, Et = { key: 0 }, Ot = { key: 1 }, Gt = /* @__PURE__ */ G({
|
|
299
|
-
__name: "WidgetScorecard",
|
|
300
|
-
props: {
|
|
301
|
-
modelValue: { required: !0 },
|
|
302
|
-
modelModifiers: {}
|
|
303
|
-
},
|
|
304
|
-
emits: ["update:modelValue"],
|
|
305
|
-
setup(e) {
|
|
306
|
-
const a = U(e, "modelValue"), { t: c } = _e(), { compareDateRange: t, defaultDateSetting: x } = ve(Ke()), { country: y } = Se(), v = s(() => {
|
|
307
|
-
var h;
|
|
308
|
-
return ((h = a.value.data) == null ? void 0 : h.value) || "";
|
|
309
|
-
}), d = s(() => {
|
|
310
|
-
const { data: h } = a.value;
|
|
311
|
-
return h != null && h.comparison ? Qe(v.value, h.comparison, y) : null;
|
|
312
|
-
});
|
|
313
|
-
function i(h) {
|
|
314
|
-
switch (h) {
|
|
315
|
-
case ge.bar:
|
|
316
|
-
return "bar";
|
|
317
|
-
case ge.line:
|
|
318
|
-
return "line";
|
|
319
|
-
default:
|
|
320
|
-
return "line";
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
const g = s(() => {
|
|
324
|
-
var h;
|
|
325
|
-
return (h = a.value.data) == null ? void 0 : h.sparkline;
|
|
326
|
-
}), C = s(() => g.value.datasets.map((h) => ({
|
|
327
|
-
label: h.name,
|
|
328
|
-
data: h.values,
|
|
329
|
-
fill: !0,
|
|
330
|
-
color: "#36a2eb"
|
|
331
|
-
})));
|
|
332
|
-
return (h, u) => {
|
|
333
|
-
var n;
|
|
334
|
-
const m = F("FmIcon"), _ = F("FmChip"), B = F("FmTooltip"), X = F("FmLineChart");
|
|
335
|
-
return w(), L("div", Mt, [
|
|
336
|
-
K(h.$slots, "menu"),
|
|
337
|
-
P("p", Ht, le(v.value), 1),
|
|
338
|
-
P("div", Nt, [
|
|
339
|
-
z(B, {
|
|
340
|
-
content: `vs. ${(n = o(x).defaultCompareType) == null ? void 0 : n.split("_").join(" ")}`,
|
|
341
|
-
placement: "right",
|
|
342
|
-
"hide-arrow": "",
|
|
343
|
-
variant: "plain"
|
|
344
|
-
}, {
|
|
345
|
-
default: $(() => [
|
|
346
|
-
d.value ? (w(), V(_, {
|
|
347
|
-
key: 0,
|
|
348
|
-
icon: d.value.icon.name,
|
|
349
|
-
class: de(`bg-${d.value.icon.tailwind}`),
|
|
350
|
-
compact: ""
|
|
351
|
-
}, {
|
|
352
|
-
default: $(() => [
|
|
353
|
-
z(m, {
|
|
354
|
-
name: d.value.icon.name,
|
|
355
|
-
color: d.value.icon.color
|
|
356
|
-
}, null, 8, ["name", "color"]),
|
|
357
|
-
P("p", {
|
|
358
|
-
class: "fm-typo-en-body-md-600",
|
|
359
|
-
style: O({ color: d.value.icon.color })
|
|
360
|
-
}, le(d.value.value), 5)
|
|
361
|
-
]),
|
|
362
|
-
_: 1
|
|
363
|
-
}, 8, ["icon", "class"])) : J("", !0),
|
|
364
|
-
o(t).endDate !== null && o(t).startDate !== null && d.value === null ? (w(), V(_, {
|
|
365
|
-
key: 1,
|
|
366
|
-
compact: ""
|
|
367
|
-
}, {
|
|
368
|
-
default: $(() => [
|
|
369
|
-
z(m, {
|
|
370
|
-
name: "arrow_upward",
|
|
371
|
-
color: "#C7C7CC"
|
|
372
|
-
}),
|
|
373
|
-
u[0] || (u[0] = P("p", { class: "fm-typo-en-body-md-600 text-fm-color-typo-disabled" }, "N/A", -1))
|
|
374
|
-
]),
|
|
375
|
-
_: 1
|
|
376
|
-
})) : J("", !0)
|
|
377
|
-
]),
|
|
378
|
-
_: 1
|
|
379
|
-
}, 8, ["content"])
|
|
380
|
-
]),
|
|
381
|
-
g.value ? (w(), L("div", Et, [
|
|
382
|
-
i(g.value.type) === "line" ? (w(), V(X, {
|
|
383
|
-
key: 0,
|
|
384
|
-
class: "sparkline",
|
|
385
|
-
datasets: C.value,
|
|
386
|
-
legend: {
|
|
387
|
-
display: !1
|
|
388
|
-
},
|
|
389
|
-
datalabels: { display: !1 },
|
|
390
|
-
"x-axis": { categories: g.value.dimensions },
|
|
391
|
-
"y-cfg": { display: !1 },
|
|
392
|
-
"x-cfg": { display: !1 },
|
|
393
|
-
"maintain-aspect-ratio": !1
|
|
394
|
-
}, null, 8, ["datasets", "x-axis"])) : J("", !0)
|
|
395
|
-
])) : (w(), L("div", Ot, u[1] || (u[1] = [
|
|
396
|
-
P("div", { class: "sparkline" }, [
|
|
397
|
-
P("div", { class: "flex flex-col gap-8" }, [
|
|
398
|
-
P("div"),
|
|
399
|
-
P("div")
|
|
400
|
-
]),
|
|
401
|
-
P("div", { class: "grow" })
|
|
402
|
-
], -1)
|
|
403
|
-
])))
|
|
404
|
-
]);
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
}), Ut = {};
|
|
408
|
-
function Xt(e, a) {
|
|
409
|
-
const c = F("FmMenuDivider");
|
|
410
|
-
return w(), V(c);
|
|
411
|
-
}
|
|
412
|
-
const Yt = /* @__PURE__ */ Pt(Ut, [["render", Xt]]), qt = { class: "my-4" }, jt = {
|
|
413
|
-
class: "border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",
|
|
414
|
-
style: { backgroundColor: "#f9f9f9" }
|
|
415
|
-
}, Jt = { class: "font-bold" }, Kt = { class: "text-fm-color-neutral-gray-300" }, Qt = /* @__PURE__ */ G({
|
|
416
|
-
__name: "WidgetTable",
|
|
417
|
-
props: {
|
|
418
|
-
modelValue: { required: !0 },
|
|
419
|
-
modelModifiers: {}
|
|
420
|
-
},
|
|
421
|
-
emits: ["update:modelValue"],
|
|
422
|
-
setup(e) {
|
|
423
|
-
const { t: a, te: c } = _e(), t = U(e, "modelValue"), { country: x } = Se(), y = p(null), v = s(() => {
|
|
424
|
-
var n;
|
|
425
|
-
return ((n = t.value.data) == null ? void 0 : n.columns) || [{ label: "", key: "" }];
|
|
426
|
-
}), d = s(() => {
|
|
427
|
-
var n;
|
|
428
|
-
return ((n = t.value.data) == null ? void 0 : n.rows) || [];
|
|
429
|
-
}), i = s(() => t.value.filterText), g = s(() => {
|
|
430
|
-
var n, f;
|
|
431
|
-
if (!(i.value && i.value.trim().length > 0 || !((n = d.value[0]) != null && n.isRollup) && !((f = d.value[d.value.length - 1]) != null && f.isRollup))) {
|
|
432
|
-
if (t.value.rollupPosition === H.top || t.value.rollupPosition === void 0)
|
|
433
|
-
return H.top;
|
|
434
|
-
if (t.value.rollupPosition === H.bottom)
|
|
435
|
-
return H.bottom;
|
|
436
|
-
}
|
|
437
|
-
}), C = s(() => {
|
|
438
|
-
const b = g.value !== void 0 ? 1 : 0, T = (y.value ? y.value.$el.offsetHeight : 0) - 48;
|
|
439
|
-
return Math.floor((T - 34.5 - 32) / 48) - b;
|
|
440
|
-
}), h = s(() => {
|
|
441
|
-
var f, k;
|
|
442
|
-
let n = [];
|
|
443
|
-
switch (g.value) {
|
|
444
|
-
case H.top:
|
|
445
|
-
n = [...((f = d.value[0]) == null ? void 0 : f.cells) || []].map((b, T) => {
|
|
446
|
-
var R;
|
|
447
|
-
return {
|
|
448
|
-
main: b,
|
|
449
|
-
comparison: (R = d.value[0]) == null ? void 0 : R.comparisonCells[T],
|
|
450
|
-
rowType: v.value[T].type
|
|
451
|
-
};
|
|
452
|
-
});
|
|
453
|
-
break;
|
|
454
|
-
case H.bottom:
|
|
455
|
-
n = [...((k = d.value[d.value.length - 1]) == null ? void 0 : k.cells) || []].map((b, T) => {
|
|
456
|
-
var R;
|
|
457
|
-
return {
|
|
458
|
-
main: b,
|
|
459
|
-
comparison: (R = d.value[0]) == null ? void 0 : R.comparisonCells[T],
|
|
460
|
-
rowType: v.value[T].type
|
|
461
|
-
};
|
|
462
|
-
});
|
|
463
|
-
break;
|
|
464
|
-
}
|
|
465
|
-
return n.length > 0 && n[0].main === "" && (n[0].main = "Grand total"), n;
|
|
466
|
-
});
|
|
467
|
-
function u(n) {
|
|
468
|
-
const f = {};
|
|
469
|
-
for (let k = 0; k < v.value.length; k++)
|
|
470
|
-
if (v.value[k].key !== "") {
|
|
471
|
-
const b = n.comparisonCells[k];
|
|
472
|
-
f[v.value[k].key] = {
|
|
473
|
-
main: n.cells[k],
|
|
474
|
-
comparison: b
|
|
475
|
-
}, f.isRollup = n.isRollup;
|
|
476
|
-
}
|
|
477
|
-
return f;
|
|
478
|
-
}
|
|
479
|
-
function m(n) {
|
|
480
|
-
return [...new Array(n < 0 ? 0 : n)].map(() => {
|
|
481
|
-
var k;
|
|
482
|
-
const f = {};
|
|
483
|
-
if ((k = t.value.data) != null && k.columns)
|
|
484
|
-
for (let b = 0; b < t.value.data.columns.length; b++)
|
|
485
|
-
f[t.value.data.columns[b].key] = void 0;
|
|
486
|
-
return f;
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
function _(n) {
|
|
490
|
-
let f = (n == null ? void 0 : n.main) || "";
|
|
491
|
-
return f.includes("#") && !f.startsWith("#") && (f = f.split("#")[0]), !n || n.main === "" || n.comparison === "" ? {
|
|
492
|
-
main: f
|
|
493
|
-
} : {
|
|
494
|
-
main: f,
|
|
495
|
-
comparison: n == null ? void 0 : n.comparison,
|
|
496
|
-
difference: Qe(n.main, n.comparison, x)
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
const B = s(() => {
|
|
500
|
-
var T, R, Y;
|
|
501
|
-
let n = ((T = t.value.data) == null ? void 0 : T.rows) || [];
|
|
502
|
-
switch (g.value) {
|
|
503
|
-
case H.bottom:
|
|
504
|
-
n = (R = n[n.length - 1]) != null && R.isRollup ? n.slice(0, -1) : n;
|
|
505
|
-
break;
|
|
506
|
-
case H.top:
|
|
507
|
-
n = (Y = n[0]) != null && Y.isRollup ? n.slice(1, n.length) : n;
|
|
508
|
-
break;
|
|
509
|
-
}
|
|
510
|
-
const f = n.filter((A) => !(i.value !== "" && (A.isRollup === !0 || !A.cells.some(
|
|
511
|
-
(W) => {
|
|
512
|
-
var N;
|
|
513
|
-
return ((W == null ? void 0 : W.toLowerCase()) || "").includes((N = i.value) == null ? void 0 : N.toLowerCase());
|
|
514
|
-
}
|
|
515
|
-
)))).map((A) => u(A)), k = f.length % C.value;
|
|
516
|
-
let b = 0;
|
|
517
|
-
return k > 0 ? b = Math.abs(k - C.value) : f.length === 0 && (b = C.value), f.push(...m(b)), f;
|
|
518
|
-
}), X = s(() => {
|
|
519
|
-
var f;
|
|
520
|
-
let n = [];
|
|
521
|
-
return (f = t.value.data) != null && f.columns && (n = [...t.value.data.columns.map((b) => {
|
|
522
|
-
const T = ee(a, c, b.label, "other");
|
|
523
|
-
return {
|
|
524
|
-
accessorKey: b.key,
|
|
525
|
-
header: () => Xe(
|
|
526
|
-
"p",
|
|
527
|
-
{
|
|
528
|
-
class: `min-w-[110px] w-full text-nowrap ${b.type === "NUMERIC" ? "text-right" : ""}`
|
|
529
|
-
},
|
|
530
|
-
T
|
|
531
|
-
),
|
|
532
|
-
cell: (R) => {
|
|
533
|
-
var W, N;
|
|
534
|
-
const Y = _(R.getValue()), A = (N = (W = R == null ? void 0 : R.row) == null ? void 0 : W.original) == null ? void 0 : N.isRollup;
|
|
535
|
-
return Xe(
|
|
536
|
-
"div",
|
|
537
|
-
{
|
|
538
|
-
class: `${A ? "fm-typo-en-body-md-600 text-fm-color-typo-secondary" : "fm-typo-en-body-md-400"} ${b.type === "NUMERIC" ? "text-right" : ""} text-nowrap whitespace-pre`
|
|
539
|
-
},
|
|
540
|
-
[Y.main]
|
|
541
|
-
);
|
|
542
|
-
},
|
|
543
|
-
meta: () => ({
|
|
544
|
-
cellClass: "subtotal-row"
|
|
545
|
-
}),
|
|
546
|
-
enableSorting: !1
|
|
547
|
-
};
|
|
548
|
-
})]), n;
|
|
549
|
-
});
|
|
550
|
-
return (n, f) => {
|
|
551
|
-
const k = F("FmTable");
|
|
552
|
-
return w(), L(E, null, [
|
|
553
|
-
P("div", qt, [
|
|
554
|
-
K(n.$slots, "menu")
|
|
555
|
-
]),
|
|
556
|
-
z(k, {
|
|
557
|
-
ref_key: "table",
|
|
558
|
-
ref: y,
|
|
559
|
-
"column-defs": X.value,
|
|
560
|
-
"row-data": B.value,
|
|
561
|
-
"search-value": i.value,
|
|
562
|
-
"page-size": C.value,
|
|
563
|
-
"shrink-at": !1,
|
|
564
|
-
"force-mobile-footer": !0,
|
|
565
|
-
class: "scrollbar-hide-table"
|
|
566
|
-
}, {
|
|
567
|
-
"pin-top": $(() => [
|
|
568
|
-
P("tbody", null, [
|
|
569
|
-
P("tr", jt, [
|
|
570
|
-
(w(!0), L(E, null, Je(h.value, (b, T) => (w(), L("td", {
|
|
571
|
-
key: `${o(ce)()}_${T}`,
|
|
572
|
-
class: "h-[48px] text-fm-color-typo-primary px-16"
|
|
573
|
-
}, [
|
|
574
|
-
P("span", {
|
|
575
|
-
class: de(`items-center text-fm-color-typo-secondary gap-2 line-clamp-2 text-ellipsis ${b.rowType === "NUMERIC" ? "text-right" : ""}`)
|
|
576
|
-
}, [
|
|
577
|
-
P("p", Jt, le(b.main), 1),
|
|
578
|
-
P("p", Kt, le(b.comparison ? `(${b.comparison})` : ""), 1)
|
|
579
|
-
], 2)
|
|
580
|
-
]))), 128))
|
|
581
|
-
])
|
|
582
|
-
])
|
|
583
|
-
]),
|
|
584
|
-
_: 1
|
|
585
|
-
}, 8, ["column-defs", "row-data", "search-value", "page-size"])
|
|
586
|
-
], 64);
|
|
587
|
-
};
|
|
588
|
-
}
|
|
589
|
-
}), Zt = /* @__PURE__ */ G({
|
|
590
|
-
__name: "WidgetStackBarChart",
|
|
591
|
-
props: {
|
|
592
|
-
modelValue: { required: !0 },
|
|
593
|
-
modelModifiers: {}
|
|
594
|
-
},
|
|
595
|
-
emits: ["update:modelValue"],
|
|
596
|
-
setup(e) {
|
|
597
|
-
const a = U(e, "modelValue"), c = s(() => {
|
|
598
|
-
var _;
|
|
599
|
-
return ((_ = a.value.data) == null ? void 0 : _.xAxis) || [];
|
|
600
|
-
}), t = s(() => {
|
|
601
|
-
var m;
|
|
602
|
-
return ((m = a.value.data) == null ? void 0 : m.datasets) ?? [];
|
|
603
|
-
}), x = p(null), { datalabels: y, xCfg: v, yCfg: d, isTransposed: i, legend: g, chartWidth: C, chartHeight: h } = ne(
|
|
604
|
-
a.value
|
|
605
|
-
), u = s(() => t.value.length > 0 ? [
|
|
606
|
-
...t.value.map((m, _) => {
|
|
607
|
-
let B = m.values;
|
|
608
|
-
return {
|
|
609
|
-
label: m.name,
|
|
610
|
-
data: B,
|
|
611
|
-
dash: !!m.isCompare,
|
|
612
|
-
backgroundColor: oe({ index: _, isCompare: m.isCompare })
|
|
613
|
-
};
|
|
614
|
-
})
|
|
615
|
-
] : []);
|
|
616
|
-
return (m, _) => {
|
|
617
|
-
const B = F("FmBarChart");
|
|
618
|
-
return w(), L(E, null, [
|
|
619
|
-
K(m.$slots, "menu"),
|
|
620
|
-
z(B, {
|
|
621
|
-
ref_key: "chartRef",
|
|
622
|
-
ref: x,
|
|
623
|
-
class: "bar-chart",
|
|
624
|
-
datasets: u.value,
|
|
625
|
-
"x-axis": { categories: c.value },
|
|
626
|
-
"x-cfg": o(v),
|
|
627
|
-
"y-cfg": o(d),
|
|
628
|
-
transpose: o(i),
|
|
629
|
-
stacked: !0,
|
|
630
|
-
legend: {
|
|
631
|
-
display: o(g).display ?? !1,
|
|
632
|
-
position: o(g).position,
|
|
633
|
-
maxHeight: 54,
|
|
634
|
-
labels: {
|
|
635
|
-
usePointStyle: o(g).usePointStyle ?? !0
|
|
636
|
-
}
|
|
637
|
-
},
|
|
638
|
-
datalabels: o(y),
|
|
639
|
-
"maintain-aspect-ratio": !1,
|
|
640
|
-
style: O({
|
|
641
|
-
"--chart-width": o(C) !== void 0 ? o(C) + "px" : "100%",
|
|
642
|
-
"--chart-height": o(h) !== void 0 ? o(h) + "px" : "calc(100% - 36px)"
|
|
643
|
-
})
|
|
644
|
-
}, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "legend", "datalabels", "style"])
|
|
645
|
-
], 64);
|
|
646
|
-
};
|
|
647
|
-
}
|
|
648
|
-
}), ea = /* @__PURE__ */ G({
|
|
649
|
-
__name: "WidgetStackLineChart",
|
|
650
|
-
props: {
|
|
651
|
-
modelValue: { required: !0 },
|
|
652
|
-
modelModifiers: {}
|
|
653
|
-
},
|
|
654
|
-
emits: ["update:modelValue"],
|
|
655
|
-
setup(e) {
|
|
656
|
-
const a = U(e, "modelValue"), c = s(() => {
|
|
657
|
-
var u;
|
|
658
|
-
return ((u = a.value.data) == null ? void 0 : u.xAxis) ?? [];
|
|
659
|
-
}), t = s(() => {
|
|
660
|
-
var u;
|
|
661
|
-
return ((u = a.value.data) == null ? void 0 : u.datasets) ?? [];
|
|
662
|
-
}), { datalabels: x, xCfg: y, yCfg: v, isTransposed: d, legend: i, chartWidth: g, chartHeight: C } = ne(
|
|
663
|
-
a.value
|
|
664
|
-
), h = s(() => t.value.length > 0 ? [
|
|
665
|
-
...t.value.map((u, m) => {
|
|
666
|
-
let _ = u.values;
|
|
667
|
-
return {
|
|
668
|
-
label: u.name,
|
|
669
|
-
data: _,
|
|
670
|
-
dash: u.isCompare,
|
|
671
|
-
fill: !1,
|
|
672
|
-
color: oe({ index: m, isCompare: u.isCompare })
|
|
673
|
-
};
|
|
674
|
-
})
|
|
675
|
-
] : []);
|
|
676
|
-
return (u, m) => {
|
|
677
|
-
const _ = F("FmLineChart");
|
|
678
|
-
return w(), L(E, null, [
|
|
679
|
-
K(u.$slots, "menu"),
|
|
680
|
-
z(_, {
|
|
681
|
-
class: "line-chart",
|
|
682
|
-
datasets: h.value,
|
|
683
|
-
"x-axis": { categories: c.value },
|
|
684
|
-
"x-cfg": o(y),
|
|
685
|
-
"y-cfg": o(v),
|
|
686
|
-
transpose: o(d),
|
|
687
|
-
legend: {
|
|
688
|
-
display: o(i).display ?? !1,
|
|
689
|
-
position: o(i).position,
|
|
690
|
-
maxHeight: 54,
|
|
691
|
-
labels: {
|
|
692
|
-
usePointStyle: o(i).usePointStyle ?? !0
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
stacked: !0,
|
|
696
|
-
datalabels: o(x),
|
|
697
|
-
"maintain-aspect-ratio": !1,
|
|
698
|
-
style: O({
|
|
699
|
-
"--chart-width": o(g) !== void 0 ? o(g) + "px" : "97%",
|
|
700
|
-
"--chart-height": o(C) !== void 0 ? o(C) + "px" : "calc(100% - 36px)"
|
|
701
|
-
})
|
|
702
|
-
}, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "legend", "datalabels", "style"])
|
|
703
|
-
], 64);
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
}), te = [
|
|
707
|
-
"col-span-1",
|
|
708
|
-
"col-span-2",
|
|
709
|
-
"col-span-3",
|
|
710
|
-
"col-span-4",
|
|
711
|
-
"col-span-5",
|
|
712
|
-
"col-span-6",
|
|
713
|
-
"col-span-7",
|
|
714
|
-
"col-span-8",
|
|
715
|
-
"col-span-9",
|
|
716
|
-
"col-span-10",
|
|
717
|
-
"col-span-11",
|
|
718
|
-
"col-span-12"
|
|
719
|
-
];
|
|
720
|
-
function ta(e) {
|
|
721
|
-
return e < 12 ? te[e - 1] : te[11];
|
|
722
|
-
}
|
|
723
|
-
function aa(e) {
|
|
724
|
-
return e < 12 ? te[Math.min(11, e * 2 - 1)] : te[11];
|
|
725
|
-
}
|
|
726
|
-
function la(e) {
|
|
727
|
-
return e < 12 ? te[Math.min(11, e * 3 - 1)] : te[11];
|
|
728
|
-
}
|
|
729
|
-
const oa = /* @__PURE__ */ G({
|
|
730
|
-
__name: "WidgetLinechart",
|
|
731
|
-
props: {
|
|
732
|
-
modelValue: { required: !0 },
|
|
733
|
-
modelModifiers: {}
|
|
734
|
-
},
|
|
735
|
-
emits: ["update:modelValue"],
|
|
736
|
-
setup(e) {
|
|
737
|
-
const a = U(e, "modelValue"), c = s(() => {
|
|
738
|
-
var u;
|
|
739
|
-
return ((u = a.value.data) == null ? void 0 : u.xAxis) ?? [];
|
|
740
|
-
}), t = s(() => {
|
|
741
|
-
var u;
|
|
742
|
-
return ((u = a.value.data) == null ? void 0 : u.datasets) ?? [];
|
|
743
|
-
}), { datalabels: x, xCfg: y, yCfg: v, isTransposed: d, legend: i, chartWidth: g, chartHeight: C } = ne(
|
|
744
|
-
a.value
|
|
745
|
-
), h = s(() => t.value.length > 0 ? [
|
|
746
|
-
...t.value.map((u, m) => ({
|
|
747
|
-
label: u.name,
|
|
748
|
-
data: u.values,
|
|
749
|
-
dash: !!u.isCompare,
|
|
750
|
-
fill: !1,
|
|
751
|
-
color: oe({ index: m, isCompare: u.isCompare })
|
|
752
|
-
}))
|
|
753
|
-
] : []);
|
|
754
|
-
return (u, m) => {
|
|
755
|
-
const _ = F("FmLineChart");
|
|
756
|
-
return w(), L(E, null, [
|
|
757
|
-
K(u.$slots, "menu"),
|
|
758
|
-
z(_, {
|
|
759
|
-
class: "line-chart",
|
|
760
|
-
datasets: h.value,
|
|
761
|
-
"x-axis": { categories: c.value },
|
|
762
|
-
"x-cfg": o(y),
|
|
763
|
-
"y-cfg": o(v),
|
|
764
|
-
transpose: o(d),
|
|
765
|
-
legend: {
|
|
766
|
-
display: o(i).display ?? !1,
|
|
767
|
-
position: o(i).position,
|
|
768
|
-
position: "bottom",
|
|
769
|
-
maxHeight: 54,
|
|
770
|
-
labels: {
|
|
771
|
-
usePointStyle: o(i).usePointStyle ?? !0
|
|
772
|
-
}
|
|
773
|
-
},
|
|
774
|
-
datalabels: o(x),
|
|
775
|
-
"maintain-aspect-ratio": !1,
|
|
776
|
-
style: O({
|
|
777
|
-
"--chart-width": o(g) !== void 0 ? o(g) + "px" : "97%",
|
|
778
|
-
"--chart-height": o(C) !== void 0 ? o(C) + "px" : "calc(100% - 36px)"
|
|
779
|
-
})
|
|
780
|
-
}, null, 8, ["datasets", "x-axis", "x-cfg", "y-cfg", "transpose", "legend", "datalabels", "style"])
|
|
781
|
-
], 64);
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
}), na = {
|
|
785
|
-
key: 1,
|
|
786
|
-
class: "grow"
|
|
787
|
-
}, sa = {
|
|
788
|
-
key: 2,
|
|
789
|
-
class: "flex"
|
|
790
|
-
}, va = /* @__PURE__ */ G({
|
|
791
|
-
__name: "DynamicWidget",
|
|
792
|
-
props: /* @__PURE__ */ xt({
|
|
793
|
-
index: {
|
|
794
|
-
type: Number,
|
|
795
|
-
default: 0
|
|
796
|
-
},
|
|
797
|
-
hideExport: {
|
|
798
|
-
type: Boolean,
|
|
799
|
-
default: !1
|
|
800
|
-
}
|
|
801
|
-
}, {
|
|
802
|
-
modelValue: { required: !0, default: () => {
|
|
803
|
-
} },
|
|
804
|
-
modelModifiers: {}
|
|
805
|
-
}),
|
|
806
|
-
emits: ["update:modelValue"],
|
|
807
|
-
setup(e) {
|
|
808
|
-
const a = p(!0), c = U(e, "modelValue"), t = c.value.widget.config, { t: x, te: y } = _e(), v = e, d = p(null), i = p(t.rollup), g = p(ce()), C = p(t.drillDimension), h = s(() => {
|
|
809
|
-
if (q.value.length > 0) {
|
|
810
|
-
const l = q.value.findIndex(
|
|
811
|
-
(S) => S.value === C.value
|
|
812
|
-
);
|
|
813
|
-
return l >= 0 ? l : 0;
|
|
814
|
-
} else
|
|
815
|
-
return -1;
|
|
816
|
-
}), u = s(() => h.value !== 0), m = s(
|
|
817
|
-
() => h.value != q.value.length - 1
|
|
818
|
-
), _ = p(t.showTitle ?? !0), B = p(t.titleFontSize ?? 14), X = p(t.titleBold ?? !1), n = p(t.titleItalic ?? !1), f = p(t.titleUnderline ?? !1), k = p(t.chartWidth ?? void 0), b = p(t.chartHeight ?? void 0), T = p(t.showLabel ?? !1), R = p(t.labelAlign ?? be.center), Y = p(t.labelAnchor ?? ye.center), A = p(t.labelRotation ?? 0), W = p(t.labelOffset ?? 0), N = p(t.labelFontSize ?? 12), Ze = s(() => t.showSearchBar), ke = p(t.showX ?? !0), Fe = p(t.xPosition ?? we.bottom), Te = p(t.showXGrid ?? !1), De = p(t.showXTick ?? !0), Re = p(t.xTickFontSize ?? 12), Le = p(t.showY ?? !0), Pe = p(t.yPosition ?? xe.left), ze = p(t.showYGrid ?? !1), Be = p(t.showYTick ?? !0), Ve = p(t.yTickFontSize ?? 12), $e = p(t.showLegend ?? void 0), Ae = p(t.legendPosition ?? Ce.top), We = p(t.usePointStyle ?? !0), pe = p(""), { breakpoints: I } = zt(), Ie = p(), et = s(() => I.value.lg || I.value.md ? ta(c.value.size.width) : I.value.sm ? aa(c.value.size.width) : la(c.value.size.width)), se = s(
|
|
819
|
-
() => Vt.find((l) => l.type === c.value.widget.type)
|
|
820
|
-
), Q = Ye(() => {
|
|
821
|
-
var l;
|
|
822
|
-
Ie.value = it((l = d.value) == null ? void 0 : l.$el.offsetWidth), g.value = ce();
|
|
823
|
-
}), tt = s(() => {
|
|
824
|
-
if ($t(D.value.type, Z.value))
|
|
825
|
-
switch (c.value.widget.type) {
|
|
826
|
-
case r.BarChart:
|
|
827
|
-
return Wt;
|
|
828
|
-
case r.StackBarChart:
|
|
829
|
-
return Zt;
|
|
830
|
-
case r.LineChart:
|
|
831
|
-
return oa;
|
|
832
|
-
case r.StackLineChart:
|
|
833
|
-
return ea;
|
|
834
|
-
case r.Circular:
|
|
835
|
-
return It;
|
|
836
|
-
case r.Scorecard:
|
|
837
|
-
return Gt;
|
|
838
|
-
case r.Spacer:
|
|
839
|
-
return Yt;
|
|
840
|
-
case r.Table:
|
|
841
|
-
return Qt;
|
|
842
|
-
default:
|
|
843
|
-
return qe;
|
|
844
|
-
}
|
|
845
|
-
else
|
|
846
|
-
return qe;
|
|
847
|
-
}), Z = p(null), { selectedLocationIds: me, dateRange: at, compareDateRange: lt, timeRange: ot } = ve(Ke()), { businessId: nt } = ve(Se()), D = s(() => {
|
|
848
|
-
const l = JSON.parse(JSON.stringify(c.value.widget));
|
|
849
|
-
return {
|
|
850
|
-
...l,
|
|
851
|
-
config: {
|
|
852
|
-
...l.config,
|
|
853
|
-
rollup: i.value,
|
|
854
|
-
drillDimension: C.value,
|
|
855
|
-
showGrandTotal: !1
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
});
|
|
859
|
-
function st() {
|
|
860
|
-
return {
|
|
861
|
-
data: Z.value,
|
|
862
|
-
showTitle: _.value,
|
|
863
|
-
titleFontSize: B.value,
|
|
864
|
-
titleBold: X.value,
|
|
865
|
-
titleItalic: n.value,
|
|
866
|
-
titleUnderline: f.value,
|
|
867
|
-
chartHeight: b.value,
|
|
868
|
-
chartWidth: k.value,
|
|
869
|
-
showLabel: T.value,
|
|
870
|
-
labelAnchor: Y.value,
|
|
871
|
-
labelAlign: R.value,
|
|
872
|
-
labelRotation: A.value,
|
|
873
|
-
labelOffset: W.value,
|
|
874
|
-
labelFontSize: N.value,
|
|
875
|
-
showX: ke.value,
|
|
876
|
-
xPosition: Fe.value,
|
|
877
|
-
showXGrid: Te.value,
|
|
878
|
-
showXTick: De.value,
|
|
879
|
-
xTickFontSize: Re.value,
|
|
880
|
-
showY: Le.value,
|
|
881
|
-
yPosition: Pe.value,
|
|
882
|
-
showYGrid: ze.value,
|
|
883
|
-
showYTick: Be.value,
|
|
884
|
-
yTickFontSize: Ve.value,
|
|
885
|
-
isTransposed: D.value.config.isTransposed,
|
|
886
|
-
showLegend: $e.value,
|
|
887
|
-
legendPosition: Ae.value,
|
|
888
|
-
usePointStyle: We.value
|
|
889
|
-
};
|
|
890
|
-
}
|
|
891
|
-
function rt() {
|
|
892
|
-
return {
|
|
893
|
-
data: Z.value,
|
|
894
|
-
filterText: pe.value,
|
|
895
|
-
rollupPosition: D.value.config.rollupPosition
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
const Me = s(() => {
|
|
899
|
-
switch (D.value.type) {
|
|
900
|
-
case r.Table:
|
|
901
|
-
return rt();
|
|
902
|
-
case r.BarChart:
|
|
903
|
-
case r.LineChart:
|
|
904
|
-
case r.StackBarChart:
|
|
905
|
-
case r.StackLineChart:
|
|
906
|
-
case r.Circular:
|
|
907
|
-
return st();
|
|
908
|
-
default:
|
|
909
|
-
return { data: Z.value };
|
|
910
|
-
}
|
|
911
|
-
}), He = s(() => {
|
|
912
|
-
const { config: l } = c.value.widget;
|
|
913
|
-
if (l.rollup != null) {
|
|
914
|
-
const S = [...l.dimensions].filter((j) => !j.hide);
|
|
915
|
-
return S.sort(
|
|
916
|
-
(j, ae) => (l.rowIds || []).indexOf(fe(j)) - (l.rowIds || []).indexOf(fe(ae))
|
|
917
|
-
), [
|
|
918
|
-
{ label: ee(x, y, "None", "other"), value: null },
|
|
919
|
-
{ label: ee(x, y, "Grand Total", "other"), value: 0 },
|
|
920
|
-
...[...S].slice(0, S.length - 1).map((j, ae) => ({
|
|
921
|
-
label: ee(x, y, j.label, "other"),
|
|
922
|
-
value: ae + 1
|
|
923
|
-
}))
|
|
924
|
-
];
|
|
925
|
-
}
|
|
926
|
-
return [];
|
|
927
|
-
}), q = s(() => {
|
|
928
|
-
const { config: l } = D.value;
|
|
929
|
-
return l.isDrillable ? l.dimensions.map((S) => ({
|
|
930
|
-
label: ee(x, y, S.label, "other"),
|
|
931
|
-
value: fe(S)
|
|
932
|
-
})) : [];
|
|
933
|
-
});
|
|
934
|
-
ue(
|
|
935
|
-
() => c.value.widget.config,
|
|
936
|
-
(l) => {
|
|
937
|
-
i.value = l.rollup, _.value = l.showTitle ?? !0, B.value = l.titleFontSize ?? 14, X.value = l.titleBold ?? !1, n.value = l.titleItalic ?? !1, f.value = l.titleUnderline ?? !1, b.value = l.chartHeight ?? void 0, k.value = l.chartWidth ?? void 0, T.value = l.showLabel ?? !1, R.value = l.labelAlign ?? be.center, Y.value = l.labelAnchor ?? ye.center, A.value = l.labelRotation ?? 0, W.value = l.labelOffset ?? 0, N.value = l.labelFontSize ?? 12, ke.value = l.showX ?? !0, Fe.value = l.xPosition ?? we.bottom, Te.value = l.showXGrid ?? !1, De.value = l.showXTick ?? !0, Re.value = l.xTickFontSize ?? 12, Le.value = l.showY ?? !0, Pe.value = l.yPosition ?? xe.left, ze.value = l.showYGrid ?? !1, Be.value = l.showYTick ?? !0, Ve.value = l.yTickFontSize ?? 12, $e.value = l.showLegend ?? void 0, Ae.value = l.legendPosition ?? Ce.top, We.value = l.usePointStyle ?? !0;
|
|
938
|
-
},
|
|
939
|
-
{ deep: !0 }
|
|
940
|
-
), ue([() => i.value], () => {
|
|
941
|
-
i.value !== null && (c.value.widget.config.rollup = i.value);
|
|
942
|
-
}), ue(
|
|
943
|
-
[
|
|
944
|
-
() => D.value,
|
|
945
|
-
() => at.value,
|
|
946
|
-
() => ot.value,
|
|
947
|
-
() => lt.value,
|
|
948
|
-
() => me.value,
|
|
949
|
-
() => nt.value
|
|
950
|
-
],
|
|
951
|
-
() => {
|
|
952
|
-
var l;
|
|
953
|
-
me.value && ((l = me.value) == null ? void 0 : l.length) > 0 && Ee();
|
|
954
|
-
},
|
|
955
|
-
{
|
|
956
|
-
deep: !0
|
|
957
|
-
}
|
|
958
|
-
), ue(
|
|
959
|
-
[() => c.value.size],
|
|
960
|
-
() => {
|
|
961
|
-
Q();
|
|
962
|
-
},
|
|
963
|
-
{ deep: !0 }
|
|
964
|
-
), Ct(() => {
|
|
965
|
-
Q(), I.value.sm || I.value.md || I.value.xs ? (console.log("Ignoring resize event due to keyboard"), addEventListener("change", Q)) : addEventListener("resize", Q), Ee();
|
|
966
|
-
}), _t(() => {
|
|
967
|
-
I.value.sm || I.value.md || I.value.xs ? (console.log("Ignoring resize event due to keyboard"), removeEventListener("change", Q)) : removeEventListener("resize", Q);
|
|
968
|
-
});
|
|
969
|
-
const Ne = Bt();
|
|
970
|
-
let re;
|
|
971
|
-
const Ee = Ye(async function() {
|
|
972
|
-
if (D.value.config.schemaNames.length <= 0 && !(D.value.config.dimensions.length <= 0 || D.value.config.metrics.length <= 0)) {
|
|
973
|
-
Ne.open({
|
|
974
|
-
message: "schema must not be empty and dimension or metrics must have at least 1 column",
|
|
975
|
-
type: "info"
|
|
976
|
-
}), a.value = !1;
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
try {
|
|
980
|
-
a.value = !0, re && re.abort(), re = new AbortController();
|
|
981
|
-
const S = re.signal;
|
|
982
|
-
Z.value = await Lt(D.value, S), g.value = ce(), a.value = !1;
|
|
983
|
-
} catch (S) {
|
|
984
|
-
Z.value = null, S.code !== "ERR_CANCELED" && (Ne.open({ message: `Invalid chart ${D.value.type}`, type: "error" }), console.log(S), a.value = !1);
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
function it(l) {
|
|
988
|
-
switch (c.value.widget.type) {
|
|
989
|
-
case "SPACER":
|
|
990
|
-
return;
|
|
991
|
-
case "SCORECARD":
|
|
992
|
-
return;
|
|
993
|
-
case "TABLE":
|
|
994
|
-
return `${c.value.size.height * 100 + (Ze.value ? 72 : 0) + 96.5}px`;
|
|
995
|
-
}
|
|
996
|
-
return `${Math.max(l / c.value.size.width, 90) * c.value.size.height}px`;
|
|
997
|
-
}
|
|
998
|
-
function ut() {
|
|
999
|
-
const l = h.value - 1;
|
|
1000
|
-
l >= 0 && (C.value = q.value[l].value);
|
|
1001
|
-
}
|
|
1002
|
-
function ct() {
|
|
1003
|
-
const l = h.value + 1;
|
|
1004
|
-
l >= 0 && l < q.value.length && (C.value = q.value[l].value);
|
|
1005
|
-
}
|
|
1006
|
-
const dt = Object.values(Tt).map((l) => ({
|
|
1007
|
-
label: Dt(l),
|
|
1008
|
-
value: l,
|
|
1009
|
-
onClick: async () => {
|
|
1010
|
-
await Rt(l, v.index);
|
|
1011
|
-
}
|
|
1012
|
-
})), pt = D.value.type === r.Spacer ? "flat" : "outlined", mt = D.value.type === r.Spacer ? "p-0" : "p-16";
|
|
1013
|
-
return (l, S) => {
|
|
1014
|
-
const j = F("FmTooltip"), ae = F("FmSearch"), ht = F("FmCheckbox"), he = F("FmButton"), ft = F("FmSelect"), vt = F("FmMenuItem"), gt = F("FmMenu"), yt = F("FmForm"), bt = F("FmCircularProgress"), wt = F("FmCard");
|
|
1015
|
-
return w(), V(wt, {
|
|
1016
|
-
ref_key: "tileCard",
|
|
1017
|
-
ref: d,
|
|
1018
|
-
class: de(`${et.value} ${o(mt)}`),
|
|
1019
|
-
variant: o(pt)
|
|
1020
|
-
}, {
|
|
1021
|
-
default: $(() => [
|
|
1022
|
-
a.value ? (w(), V(bt, { key: 1 })) : (w(), L("div", {
|
|
1023
|
-
key: 0,
|
|
1024
|
-
style: O({ height: Ie.value })
|
|
1025
|
-
}, [
|
|
1026
|
-
(w(), V(St(tt.value), {
|
|
1027
|
-
key: g.value,
|
|
1028
|
-
modelValue: Me.value,
|
|
1029
|
-
"onUpdate:modelValue": S[3] || (S[3] = (ie) => Me.value = ie)
|
|
1030
|
-
}, {
|
|
1031
|
-
menu: $(() => [
|
|
1032
|
-
z(yt, { class: "flex items-center gap-2" }, {
|
|
1033
|
-
default: $(() => {
|
|
1034
|
-
var ie, Oe, Ge, Ue;
|
|
1035
|
-
return [
|
|
1036
|
-
z(j, {
|
|
1037
|
-
variant: "plain",
|
|
1038
|
-
placement: "right",
|
|
1039
|
-
content: D.value.description,
|
|
1040
|
-
"hide-arrow": !0,
|
|
1041
|
-
disabled: !D.value.description
|
|
1042
|
-
}, {
|
|
1043
|
-
default: $(() => [
|
|
1044
|
-
_.value !== !1 ? (w(), L("p", {
|
|
1045
|
-
key: 0,
|
|
1046
|
-
style: O({
|
|
1047
|
-
fontSize: B.value + "px",
|
|
1048
|
-
fontWeight: X.value ? "bold" : "normal",
|
|
1049
|
-
fontStyle: n.value ? "italic" : "normal",
|
|
1050
|
-
textDecoration: f.value ? "underline" : "none"
|
|
1051
|
-
}),
|
|
1052
|
-
class: de(["text-fm-color-typo-secondary line-clamp-1", [
|
|
1053
|
-
B.value <= 18 ? "fm-typo-en-body-md-400" : "",
|
|
1054
|
-
D.value.description ? "border-b-2 border-dashed border-gray-300" : ""
|
|
1055
|
-
]])
|
|
1056
|
-
}, le(o(ee)(o(x), o(y), D.value.title, "other")), 7)) : J("", !0)
|
|
1057
|
-
]),
|
|
1058
|
-
_: 1
|
|
1059
|
-
}, 8, ["content", "disabled"]),
|
|
1060
|
-
(ie = se.value) != null && ie.showSearchBar ? (w(), V(ae, {
|
|
1061
|
-
key: 0,
|
|
1062
|
-
modelValue: pe.value,
|
|
1063
|
-
"onUpdate:modelValue": S[0] || (S[0] = (M) => pe.value = M),
|
|
1064
|
-
class: "grow"
|
|
1065
|
-
}, null, 8, ["modelValue"])) : (w(), L("div", na)),
|
|
1066
|
-
kt(z(ht, {
|
|
1067
|
-
modelValue: T.value,
|
|
1068
|
-
"onUpdate:modelValue": S[1] || (S[1] = (M) => T.value = M),
|
|
1069
|
-
label: "Label",
|
|
1070
|
-
value: !1
|
|
1071
|
-
}, null, 8, ["modelValue"]), [
|
|
1072
|
-
[Ft, (Oe = se.value) == null ? void 0 : Oe.showLabel]
|
|
1073
|
-
]),
|
|
1074
|
-
(Ge = se.value) != null && Ge.showDrillDimension && q.value.length > 0 ? (w(), L("div", sa, [
|
|
1075
|
-
z(he, {
|
|
1076
|
-
icon: "arrow_upward",
|
|
1077
|
-
variant: "tertiary",
|
|
1078
|
-
disabled: !u.value,
|
|
1079
|
-
onClick: ut
|
|
1080
|
-
}, null, 8, ["disabled"]),
|
|
1081
|
-
z(he, {
|
|
1082
|
-
icon: "arrow_downward",
|
|
1083
|
-
variant: "tertiary",
|
|
1084
|
-
disabled: !m.value,
|
|
1085
|
-
onClick: ct
|
|
1086
|
-
}, null, 8, ["disabled"])
|
|
1087
|
-
])) : J("", !0),
|
|
1088
|
-
(Ue = se.value) != null && Ue.showRollup && He.value.length > 0 ? (w(), V(ft, {
|
|
1089
|
-
key: 3,
|
|
1090
|
-
modelValue: i.value,
|
|
1091
|
-
"onUpdate:modelValue": S[2] || (S[2] = (M) => i.value = M),
|
|
1092
|
-
class: "w-[150px]",
|
|
1093
|
-
items: He.value
|
|
1094
|
-
}, null, 8, ["modelValue", "items"])) : J("", !0),
|
|
1095
|
-
v.hideExport ? J("", !0) : (w(), V(gt, {
|
|
1096
|
-
key: 4,
|
|
1097
|
-
shift: !0
|
|
1098
|
-
}, {
|
|
1099
|
-
"menu-button": $(() => [
|
|
1100
|
-
z(he, {
|
|
1101
|
-
icon: "more_vert",
|
|
1102
|
-
variant: "tertiary"
|
|
1103
|
-
})
|
|
1104
|
-
]),
|
|
1105
|
-
default: $(() => [
|
|
1106
|
-
(w(!0), L(E, null, Je(o(dt), (M) => (w(), V(vt, {
|
|
1107
|
-
key: M.value,
|
|
1108
|
-
label: M.label,
|
|
1109
|
-
onClick: M.onClick
|
|
1110
|
-
}, null, 8, ["label", "onClick"]))), 128))
|
|
1111
|
-
]),
|
|
1112
|
-
_: 1
|
|
1113
|
-
}))
|
|
1114
|
-
];
|
|
1115
|
-
}),
|
|
1116
|
-
_: 1
|
|
1117
|
-
})
|
|
1118
|
-
]),
|
|
1119
|
-
_: 1
|
|
1120
|
-
}, 8, ["modelValue"]))
|
|
1121
|
-
], 4))
|
|
1122
|
-
]),
|
|
1123
|
-
_: 1
|
|
1124
|
-
}, 8, ["class", "variant"]);
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
});
|
|
1128
|
-
export {
|
|
1129
|
-
be as L,
|
|
1130
|
-
H as R,
|
|
1131
|
-
va as _,
|
|
1132
|
-
ye as a,
|
|
1133
|
-
fe as g
|
|
1134
|
-
};
|