@feedmepos/mf-report 5.7.0 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-CGGMgL6P.js → App-BuPfdYFT.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-hKnI3mk3.js → DynamicWidget.vue_vue_type_script_setup_true_lang-Nk_mV6TX.js} +460 -441
- package/dist/{OverviewView-D4r6dkxr.js → OverviewView-De1U7FMY.js} +1 -1
- package/dist/{ReportEditor-hW1DlFFQ.js → ReportEditor-9JfaoQnu.js} +2 -2
- package/dist/{ReportView-DsNZ1IER.js → ReportView-DhM6dHM7.js} +1 -1
- package/dist/{TileEditor--TdVK92o.js → TileEditor-njxrJOwv.js} +2 -2
- package/dist/{TransitionFade-Cykddenx.js → TransitionFade-OVG1ERGf.js} +1 -1
- package/dist/app.js +5 -5
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { computed as h, defineComponent as
|
|
2
|
-
import { W as
|
|
3
|
-
import { u as Re, b as
|
|
4
|
-
import { d as
|
|
1
|
+
import { computed as h, defineComponent as G, useModel as j, ref as y, resolveComponent as F, createElementBlock as z, openBlock as _, Fragment as U, renderSlot as Z, createVNode as H, normalizeStyle as Y, unref as r, createElementVNode as A, toDisplayString as ne, withCtx as V, createBlock as M, createCommentVNode as Q, normalizeClass as me, watch as le, nextTick as je, h as Je, renderList as et, mergeModels as xt, onMounted as kt, onUnmounted as Rt, resolveDynamicComponent as Lt, withDirectives as Ft, vShow as Et } from "vue";
|
|
2
|
+
import { W as v, v as he, R as Tt, g as Wt, d as zt, q as Dt } from "./v4-CJZMeb87.js";
|
|
3
|
+
import { u as Re, b as tt, a as Le } from "./global-loader-CbmVhJAK.js";
|
|
4
|
+
import { d as Ke } from "./index-BWqDfeY6.js";
|
|
5
5
|
import { storeToRefs as we, defineStore as At } from "pinia";
|
|
6
6
|
import { _ as Ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
import { r as ae } from "./i18n-Cif1I9J2.js";
|
|
8
|
-
import { _ as
|
|
8
|
+
import { _ as Qe } from "./NoData.vue_vue_type_script_setup_true_lang-CdFXBqlX.js";
|
|
9
9
|
import { useBreakpoints as $t, useSnackbar as Pt } from "@feedmepos/ui-library";
|
|
10
|
-
var be = /* @__PURE__ */ ((e) => (e.line = "LINE", e.bar = "BAR", e))(be || {}), O = /* @__PURE__ */ ((e) => (e.top = "TOP", e.bottom = "BOTTOM", e))(O || {}), Ce = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e))(Ce || {}), Se = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(Se || {}),
|
|
11
|
-
|
|
10
|
+
var be = /* @__PURE__ */ ((e) => (e.line = "LINE", e.bar = "BAR", e))(be || {}), O = /* @__PURE__ */ ((e) => (e.top = "TOP", e.bottom = "BOTTOM", e))(O || {}), Ce = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e))(Ce || {}), Se = /* @__PURE__ */ ((e) => (e.start = "start", e.center = "center", e.end = "end", e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(Se || {}), _e = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e))(_e || {}), xe = /* @__PURE__ */ ((e) => (e.right = "right", e.left = "left", e))(xe || {}), ke = /* @__PURE__ */ ((e) => (e.top = "top", e.bottom = "bottom", e.right = "right", e.left = "left", e.chartArea = "chartArea", e))(ke || {});
|
|
11
|
+
v.Circular, v.Table, v.BarChart, v.LineChart, v.StackBarChart, v.StackLineChart, v.Scorecard, v.Spacer;
|
|
12
12
|
const Bt = [
|
|
13
13
|
{
|
|
14
|
-
type:
|
|
14
|
+
type: v.Circular,
|
|
15
15
|
showLabel: !1,
|
|
16
16
|
// TODO: temporarily removed show label as it has no function
|
|
17
17
|
showDrillDimension: !0,
|
|
@@ -19,14 +19,14 @@ const Bt = [
|
|
|
19
19
|
showSearchBar: !1
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
type:
|
|
22
|
+
type: v.Table,
|
|
23
23
|
showLabel: !1,
|
|
24
24
|
showDrillDimension: !0,
|
|
25
25
|
showRollup: !0,
|
|
26
26
|
showSearchBar: !0
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
type:
|
|
29
|
+
type: v.BarChart,
|
|
30
30
|
showLabel: !1,
|
|
31
31
|
// TODO: temporarily removed show label as it has no function
|
|
32
32
|
showDrillDimension: !0,
|
|
@@ -34,7 +34,7 @@ const Bt = [
|
|
|
34
34
|
showSearchBar: !1
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
type:
|
|
37
|
+
type: v.LineChart,
|
|
38
38
|
showLabel: !1,
|
|
39
39
|
// TODO: temporarily removed show label as it has no function
|
|
40
40
|
showDrillDimension: !0,
|
|
@@ -42,7 +42,7 @@ const Bt = [
|
|
|
42
42
|
showSearchBar: !1
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
type:
|
|
45
|
+
type: v.StackBarChart,
|
|
46
46
|
showLabel: !1,
|
|
47
47
|
// TODO: temporarily removed show label as it has no function
|
|
48
48
|
showDrillDimension: !0,
|
|
@@ -50,7 +50,7 @@ const Bt = [
|
|
|
50
50
|
showSearchBar: !1
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
type:
|
|
53
|
+
type: v.StackLineChart,
|
|
54
54
|
showLabel: !1,
|
|
55
55
|
// TODO: temporarily removed show label as it has no function
|
|
56
56
|
showDrillDimension: !0,
|
|
@@ -58,14 +58,14 @@ const Bt = [
|
|
|
58
58
|
showSearchBar: !1
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
type:
|
|
61
|
+
type: v.Scorecard,
|
|
62
62
|
showLabel: !1,
|
|
63
63
|
showDrillDimension: !1,
|
|
64
64
|
showRollup: !1,
|
|
65
65
|
showSearchBar: !1
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
|
-
type:
|
|
68
|
+
type: v.Spacer,
|
|
69
69
|
showLabel: !1,
|
|
70
70
|
showDrillDimension: !1,
|
|
71
71
|
showRollup: !1,
|
|
@@ -78,22 +78,22 @@ function ye(e) {
|
|
|
78
78
|
}
|
|
79
79
|
function Mt(e, t) {
|
|
80
80
|
switch (e) {
|
|
81
|
-
case
|
|
82
|
-
case
|
|
83
|
-
case
|
|
84
|
-
case
|
|
81
|
+
case v.BarChart:
|
|
82
|
+
case v.LineChart:
|
|
83
|
+
case v.StackBarChart:
|
|
84
|
+
case v.StackLineChart:
|
|
85
85
|
return Array.isArray(t == null ? void 0 : t.datasets) && Array.isArray(t == null ? void 0 : t.xAxis) && t.datasets.length > 0 && t.xAxis.length > 0;
|
|
86
|
-
case
|
|
86
|
+
case v.Table:
|
|
87
87
|
return Array.isArray(t == null ? void 0 : t.rows) && Array.isArray(t == null ? void 0 : t.columns) && t.rows.length > 0 && t.columns.length > 0;
|
|
88
|
-
case
|
|
88
|
+
case v.Circular:
|
|
89
89
|
return Array.isArray(t == null ? void 0 : t.datasets) && t.datasets.length > 0;
|
|
90
|
-
case
|
|
90
|
+
case v.Scorecard:
|
|
91
91
|
return !0;
|
|
92
|
-
case
|
|
92
|
+
case v.Spacer:
|
|
93
93
|
return !0;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const Ze = [
|
|
97
97
|
"54, 162, 235",
|
|
98
98
|
//8CE6D7
|
|
99
99
|
"0, 123, 167",
|
|
@@ -118,21 +118,21 @@ const Qe = [
|
|
|
118
118
|
function re({
|
|
119
119
|
index: e,
|
|
120
120
|
isCompare: t,
|
|
121
|
-
opacity:
|
|
121
|
+
opacity: o
|
|
122
122
|
}) {
|
|
123
|
-
let a = typeof
|
|
124
|
-
return t && (a = a * 0.6), `rgba(${
|
|
123
|
+
let a = typeof o == "number" ? o : 1;
|
|
124
|
+
return t && (a = a * 0.6), `rgba(${Ze[e % Ze.length]}, ${a})`;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function at(e, t, o) {
|
|
127
127
|
if (e === "" || t === "")
|
|
128
128
|
return null;
|
|
129
|
-
let a = (
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
if (isNaN(
|
|
129
|
+
let a = (c) => c == null ? void 0 : c.replace(/,/g, "");
|
|
130
|
+
o === "ID" && (a = (c) => c == null ? void 0 : c.replace(/\./g, "").replace(/,/g, "."));
|
|
131
|
+
const n = Number(a(e)), i = Number(a(t));
|
|
132
|
+
if (isNaN(n) || isNaN(i))
|
|
133
133
|
return null;
|
|
134
134
|
let d = 0;
|
|
135
|
-
|
|
135
|
+
i === 0 ? n === 0 ? d = 0 : d = 1 : d = (n - i) / i;
|
|
136
136
|
const u = Vt(d);
|
|
137
137
|
return {
|
|
138
138
|
value: isNaN(d) ? "" : `${(d * 100).toFixed(0)}%`,
|
|
@@ -164,7 +164,7 @@ function ie(e) {
|
|
|
164
164
|
font: {
|
|
165
165
|
size: e.labelFontSize
|
|
166
166
|
}
|
|
167
|
-
})),
|
|
167
|
+
})), o = h(() => ({
|
|
168
168
|
display: e.showX,
|
|
169
169
|
position: e.xPosition,
|
|
170
170
|
grid: {
|
|
@@ -188,14 +188,14 @@ function ie(e) {
|
|
|
188
188
|
size: e.yTickFontSize
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
})),
|
|
191
|
+
})), n = h(() => ({
|
|
192
192
|
display: e.showLegend,
|
|
193
193
|
position: e.legendPosition,
|
|
194
194
|
usePointStyle: e.usePointStyle
|
|
195
|
-
})),
|
|
196
|
-
return { datalabels: t, xCfg:
|
|
195
|
+
})), i = h(() => e.isTransposed), d = h(() => e.chartWidth), u = h(() => e.chartHeight);
|
|
196
|
+
return { datalabels: t, xCfg: o, yCfg: a, isTransposed: i, legend: n, chartWidth: d, chartHeight: u };
|
|
197
197
|
}
|
|
198
|
-
const qt = /* @__PURE__ */
|
|
198
|
+
const qt = /* @__PURE__ */ G({
|
|
199
199
|
__name: "WidgetBarchart",
|
|
200
200
|
props: {
|
|
201
201
|
modelValue: { required: !0 },
|
|
@@ -203,35 +203,35 @@ const qt = /* @__PURE__ */ U({
|
|
|
203
203
|
},
|
|
204
204
|
emits: ["update:modelValue"],
|
|
205
205
|
setup(e) {
|
|
206
|
-
const t =
|
|
207
|
-
var
|
|
208
|
-
return ((
|
|
206
|
+
const t = j(e, "modelValue"), o = h(() => {
|
|
207
|
+
var f;
|
|
208
|
+
return ((f = t.value.data) == null ? void 0 : f.xAxis) ?? [];
|
|
209
209
|
}), a = h(() => {
|
|
210
|
-
var
|
|
211
|
-
return ((
|
|
212
|
-
}),
|
|
210
|
+
var f;
|
|
211
|
+
return ((f = t.value.data) == null ? void 0 : f.datasets) ?? [];
|
|
212
|
+
}), n = y(null), { datalabels: i, xCfg: d, yCfg: u, isTransposed: c, legend: w, chartWidth: C, chartHeight: m } = ie(
|
|
213
213
|
t.value
|
|
214
|
-
),
|
|
215
|
-
...a.value.map((
|
|
216
|
-
label:
|
|
217
|
-
data:
|
|
218
|
-
dash: !!
|
|
219
|
-
backgroundColor: re({ index:
|
|
214
|
+
), g = h(() => a.value.length > 0 ? [
|
|
215
|
+
...a.value.map((f, k) => ({
|
|
216
|
+
label: f.name,
|
|
217
|
+
data: f.values,
|
|
218
|
+
dash: !!f.isCompare,
|
|
219
|
+
backgroundColor: re({ index: k, isCompare: f.isCompare })
|
|
220
220
|
}))
|
|
221
221
|
] : []);
|
|
222
|
-
return (
|
|
223
|
-
const
|
|
224
|
-
return
|
|
225
|
-
Z(
|
|
226
|
-
H(
|
|
222
|
+
return (f, k) => {
|
|
223
|
+
const E = F("FmBarChart");
|
|
224
|
+
return _(), z(U, null, [
|
|
225
|
+
Z(f.$slots, "menu"),
|
|
226
|
+
H(E, {
|
|
227
227
|
ref_key: "chartRef",
|
|
228
|
-
ref:
|
|
228
|
+
ref: n,
|
|
229
229
|
class: "bar-chart",
|
|
230
|
-
datasets:
|
|
231
|
-
"x-axis": { categories:
|
|
230
|
+
datasets: g.value,
|
|
231
|
+
"x-axis": { categories: o.value },
|
|
232
232
|
"x-cfg": r(d),
|
|
233
233
|
"y-cfg": r(u),
|
|
234
|
-
transpose: r(
|
|
234
|
+
transpose: r(c),
|
|
235
235
|
legend: {
|
|
236
236
|
display: r(w).display ?? !1,
|
|
237
237
|
position: r(w).position,
|
|
@@ -239,7 +239,7 @@ const qt = /* @__PURE__ */ U({
|
|
|
239
239
|
usePointStyle: r(w).usePointStyle ?? !0
|
|
240
240
|
}
|
|
241
241
|
},
|
|
242
|
-
datalabels: r(
|
|
242
|
+
datalabels: r(i),
|
|
243
243
|
"maintain-aspect-ratio": !1,
|
|
244
244
|
style: Y({
|
|
245
245
|
"--chart-width": r(C) !== void 0 ? r(C) + "px" : "100%",
|
|
@@ -249,7 +249,7 @@ const qt = /* @__PURE__ */ U({
|
|
|
249
249
|
], 64);
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
}), Nt = /* @__PURE__ */
|
|
252
|
+
}), Nt = /* @__PURE__ */ G({
|
|
253
253
|
__name: "WidgetCircular",
|
|
254
254
|
props: {
|
|
255
255
|
modelValue: { required: !0 },
|
|
@@ -257,19 +257,19 @@ const qt = /* @__PURE__ */ U({
|
|
|
257
257
|
},
|
|
258
258
|
emits: ["update:modelValue"],
|
|
259
259
|
setup(e) {
|
|
260
|
-
const t =
|
|
260
|
+
const t = j(e, "modelValue"), { datalabels: o, legend: a, chartWidth: n, chartHeight: i } = ie(t.value), d = h(() => {
|
|
261
261
|
let u = [];
|
|
262
262
|
return t.value.data.datasets && t.value.data.metrics && t.value.data.datasets.length > 0 && t.value.data.metrics.length > 0 && (u = [
|
|
263
263
|
{
|
|
264
264
|
label: t.value.data.metrics[0],
|
|
265
|
-
data: t.value.data.datasets.map((
|
|
266
|
-
backgroundColor: t.value.data.datasets.map((
|
|
265
|
+
data: t.value.data.datasets.map((c) => c.value),
|
|
266
|
+
backgroundColor: t.value.data.datasets.map((c, w) => re({ index: w }))
|
|
267
267
|
}
|
|
268
268
|
]), u;
|
|
269
269
|
});
|
|
270
|
-
return (u,
|
|
270
|
+
return (u, c) => {
|
|
271
271
|
const w = F("FmPieChart");
|
|
272
|
-
return
|
|
272
|
+
return _(), z(U, null, [
|
|
273
273
|
Z(u.$slots, "menu"),
|
|
274
274
|
H(w, {
|
|
275
275
|
class: "circular",
|
|
@@ -285,17 +285,17 @@ const qt = /* @__PURE__ */ U({
|
|
|
285
285
|
usePointStyle: r(a).usePointStyle ?? !0
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
|
-
datalabels: r(
|
|
288
|
+
datalabels: r(o),
|
|
289
289
|
"maintain-aspect-ratio": !1,
|
|
290
290
|
style: Y({
|
|
291
|
-
"--chart-width": r(
|
|
292
|
-
"--chart-height": r(
|
|
291
|
+
"--chart-width": r(n) !== void 0 ? r(n) + "px" : "100%",
|
|
292
|
+
"--chart-height": r(i) !== void 0 ? r(i) + "px" : "calc(100% - 36px)"
|
|
293
293
|
})
|
|
294
294
|
}, null, 8, ["datasets", "metrics", "legend", "datalabels", "style"])
|
|
295
295
|
], 64);
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
}), It = { class: "flex flex-col gap-1" }, Ot = { class: "fm-typo-en-title-sm-600" }, Xt = { class: "flex gap-2" },
|
|
298
|
+
}), It = { class: "flex flex-col gap-1" }, Ot = { class: "fm-typo-en-title-sm-600" }, Xt = { class: "flex gap-2" }, Ut = { key: 0 }, Yt = { key: 1 }, Gt = /* @__PURE__ */ G({
|
|
299
299
|
__name: "WidgetScorecard",
|
|
300
300
|
props: {
|
|
301
301
|
modelValue: { required: !0 },
|
|
@@ -303,14 +303,14 @@ const qt = /* @__PURE__ */ U({
|
|
|
303
303
|
},
|
|
304
304
|
emits: ["update:modelValue"],
|
|
305
305
|
setup(e) {
|
|
306
|
-
const t =
|
|
306
|
+
const t = j(e, "modelValue"), { t: o } = Re(), { compareDateRange: a, defaultDateSetting: n } = we(tt()), { country: i } = Le(), d = h(() => {
|
|
307
307
|
var m;
|
|
308
308
|
return ((m = t.value.data) == null ? void 0 : m.value) || "";
|
|
309
309
|
}), u = h(() => {
|
|
310
310
|
const { data: m } = t.value;
|
|
311
|
-
return m != null && m.comparison ?
|
|
311
|
+
return m != null && m.comparison ? at(d.value, m.comparison, i) : null;
|
|
312
312
|
});
|
|
313
|
-
function
|
|
313
|
+
function c(m) {
|
|
314
314
|
switch (m) {
|
|
315
315
|
case be.bar:
|
|
316
316
|
return "bar";
|
|
@@ -329,28 +329,28 @@ const qt = /* @__PURE__ */ U({
|
|
|
329
329
|
fill: !0,
|
|
330
330
|
color: "#36a2eb"
|
|
331
331
|
})));
|
|
332
|
-
return (m,
|
|
333
|
-
var
|
|
334
|
-
const
|
|
335
|
-
return
|
|
332
|
+
return (m, g) => {
|
|
333
|
+
var P;
|
|
334
|
+
const f = F("FmIcon"), k = F("FmChip"), E = F("FmTooltip"), q = F("FmLineChart");
|
|
335
|
+
return _(), z("div", It, [
|
|
336
336
|
Z(m.$slots, "menu"),
|
|
337
337
|
A("p", Ot, ne(d.value), 1),
|
|
338
338
|
A("div", Xt, [
|
|
339
|
-
H(
|
|
340
|
-
content: `vs. ${(
|
|
339
|
+
H(E, {
|
|
340
|
+
content: `vs. ${(P = r(n).defaultCompareType) == null ? void 0 : P.split("_").join(" ")}`,
|
|
341
341
|
placement: "right",
|
|
342
342
|
"hide-arrow": "",
|
|
343
343
|
variant: "plain"
|
|
344
344
|
}, {
|
|
345
345
|
default: V(() => [
|
|
346
|
-
u.value ? (
|
|
346
|
+
u.value ? (_(), M(k, {
|
|
347
347
|
key: 0,
|
|
348
348
|
icon: u.value.icon.name,
|
|
349
349
|
class: me(`bg-${u.value.icon.tailwind}`),
|
|
350
350
|
compact: ""
|
|
351
351
|
}, {
|
|
352
352
|
default: V(() => [
|
|
353
|
-
H(
|
|
353
|
+
H(f, {
|
|
354
354
|
name: u.value.icon.name,
|
|
355
355
|
color: u.value.icon.color
|
|
356
356
|
}, null, 8, ["name", "color"]),
|
|
@@ -361,16 +361,16 @@ const qt = /* @__PURE__ */ U({
|
|
|
361
361
|
]),
|
|
362
362
|
_: 1
|
|
363
363
|
}, 8, ["icon", "class"])) : Q("", !0),
|
|
364
|
-
r(a).endDate !== null && r(a).startDate !== null && u.value === null ? (
|
|
364
|
+
r(a).endDate !== null && r(a).startDate !== null && u.value === null ? (_(), M(k, {
|
|
365
365
|
key: 1,
|
|
366
366
|
compact: ""
|
|
367
367
|
}, {
|
|
368
368
|
default: V(() => [
|
|
369
|
-
H(
|
|
369
|
+
H(f, {
|
|
370
370
|
name: "arrow_upward",
|
|
371
371
|
color: "#C7C7CC"
|
|
372
372
|
}),
|
|
373
|
-
|
|
373
|
+
g[0] || (g[0] = A("p", { class: "fm-typo-en-body-md-600 text-fm-color-typo-disabled" }, "N/A", -1))
|
|
374
374
|
]),
|
|
375
375
|
_: 1
|
|
376
376
|
})) : Q("", !0)
|
|
@@ -378,8 +378,8 @@ const qt = /* @__PURE__ */ U({
|
|
|
378
378
|
_: 1
|
|
379
379
|
}, 8, ["content"])
|
|
380
380
|
]),
|
|
381
|
-
w.value ? (
|
|
382
|
-
|
|
381
|
+
w.value ? (_(), z("div", Ut, [
|
|
382
|
+
c(w.value.type) === "line" ? (_(), M(q, {
|
|
383
383
|
key: 0,
|
|
384
384
|
class: "sparkline",
|
|
385
385
|
datasets: C.value,
|
|
@@ -392,7 +392,7 @@ const qt = /* @__PURE__ */ U({
|
|
|
392
392
|
"x-cfg": { display: !1 },
|
|
393
393
|
"maintain-aspect-ratio": !1
|
|
394
394
|
}, null, 8, ["datasets", "x-axis"])) : Q("", !0)
|
|
395
|
-
])) : (
|
|
395
|
+
])) : (_(), z("div", Yt, g[1] || (g[1] = [
|
|
396
396
|
A("div", { class: "sparkline" }, [
|
|
397
397
|
A("div", { class: "flex flex-col gap-8" }, [
|
|
398
398
|
A("div"),
|
|
@@ -406,8 +406,8 @@ const qt = /* @__PURE__ */ U({
|
|
|
406
406
|
}
|
|
407
407
|
}), jt = {};
|
|
408
408
|
function Jt(e, t) {
|
|
409
|
-
const
|
|
410
|
-
return
|
|
409
|
+
const o = F("FmMenuDivider");
|
|
410
|
+
return _(), M(o);
|
|
411
411
|
}
|
|
412
412
|
const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimension", Zt = At(Qt, {
|
|
413
413
|
state: () => ({
|
|
@@ -419,56 +419,56 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
419
419
|
updateRowHeight(e, t) {
|
|
420
420
|
this.rowHeight = e, this.setRowHeights(e, t);
|
|
421
421
|
},
|
|
422
|
-
updateColWidth(e, t,
|
|
423
|
-
this.colWidths[e] = t, this.setColWidths(e, t,
|
|
422
|
+
updateColWidth(e, t, o, a) {
|
|
423
|
+
this.colWidths[e] = t, this.setColWidths(e, t, o, a);
|
|
424
424
|
},
|
|
425
425
|
setRowHeights(e, t) {
|
|
426
|
-
const
|
|
427
|
-
[...
|
|
428
|
-
const d =
|
|
426
|
+
const o = (t == null ? void 0 : t.querySelectorAll("thead tr")) ?? [], a = (t == null ? void 0 : t.querySelectorAll("tbody tr")) ?? [];
|
|
427
|
+
[...o, ...a].forEach((i) => {
|
|
428
|
+
const d = i;
|
|
429
429
|
d && (d.style.height = `${e}px`);
|
|
430
430
|
});
|
|
431
431
|
},
|
|
432
|
-
setColWidths(e, t,
|
|
433
|
-
const
|
|
432
|
+
setColWidths(e, t, o, a = !1) {
|
|
433
|
+
const n = (o == null ? void 0 : o.querySelectorAll("th")) ?? [];
|
|
434
434
|
if (e === void 0) return;
|
|
435
|
-
const
|
|
436
|
-
if (!
|
|
435
|
+
const i = n[e], d = a ? this.colWidths[e] : t;
|
|
436
|
+
if (!i || d === void 0) return;
|
|
437
437
|
const u = () => {
|
|
438
|
-
|
|
438
|
+
i.style.width = `${d}px`;
|
|
439
439
|
};
|
|
440
440
|
a ? requestAnimationFrame(u) : u();
|
|
441
441
|
},
|
|
442
442
|
enableEditMode() {
|
|
443
|
-
const e = document.querySelectorAll("th"), t = document.querySelectorAll("td"),
|
|
444
|
-
|
|
443
|
+
const e = document.querySelectorAll("th"), t = document.querySelectorAll("td"), o = document.querySelector("table");
|
|
444
|
+
o == null || o.classList.add("table-fixed"), e.forEach((a) => a.classList.add("toggleEditResize")), t.forEach((a) => a.classList.add("toggleEditResize")), this.isEditing = !0;
|
|
445
445
|
},
|
|
446
446
|
disableEditMode() {
|
|
447
|
-
const e = document.querySelectorAll("th"), t = document.querySelectorAll("td"),
|
|
448
|
-
e.forEach((
|
|
447
|
+
const e = document.querySelectorAll("th"), t = document.querySelectorAll("td"), o = document.querySelectorAll(".col-resize-handle"), a = document.querySelectorAll(".row-resize-handle");
|
|
448
|
+
e.forEach((n) => n.classList.remove("toggleEditResize")), t.forEach((n) => n.classList.remove("toggleEditResize")), o.forEach((n) => n.remove()), a.forEach((n) => n.remove()), this.isEditing = !1;
|
|
449
449
|
},
|
|
450
450
|
resetStore() {
|
|
451
451
|
this.rowHeight = 0, this.colWidths = [];
|
|
452
452
|
},
|
|
453
453
|
highlightCol(e, t) {
|
|
454
454
|
if (t) {
|
|
455
|
-
const
|
|
456
|
-
[...
|
|
457
|
-
|
|
455
|
+
const o = document.querySelectorAll(`thead th:nth-child(${e + 1})`), a = document.querySelectorAll(`tbody td:nth-child(${e + 1})`);
|
|
456
|
+
[...o, ...a].forEach((n) => {
|
|
457
|
+
n.classList.add("highlight-hover-col");
|
|
458
458
|
});
|
|
459
459
|
} else
|
|
460
460
|
document.querySelectorAll(
|
|
461
461
|
`thead th:nth-child(${e + 1}), tbody td:nth-child(${e + 1})`
|
|
462
|
-
).forEach((
|
|
462
|
+
).forEach((o) => o.classList.add("highlight-col"));
|
|
463
463
|
},
|
|
464
464
|
highlightRows(e) {
|
|
465
|
-
const t = document.querySelectorAll("thead tr"),
|
|
466
|
-
for (const
|
|
467
|
-
e ?
|
|
465
|
+
const t = document.querySelectorAll("thead tr"), o = document.querySelectorAll("tbody tr"), a = [...t, ...o];
|
|
466
|
+
for (const n of a)
|
|
467
|
+
e ? n.classList.add("highlight-hover-row") : n.classList.add("highlight-row");
|
|
468
468
|
},
|
|
469
469
|
removeRowHighlight(e) {
|
|
470
|
-
const t = e ? ".highlight-hover-row" : ".highlight-row",
|
|
471
|
-
for (const a of
|
|
470
|
+
const t = e ? ".highlight-hover-row" : ".highlight-row", o = document.querySelectorAll(t);
|
|
471
|
+
for (const a of o)
|
|
472
472
|
a.classList.remove(t.slice(1));
|
|
473
473
|
},
|
|
474
474
|
removeColHighlight(e) {
|
|
@@ -477,62 +477,62 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
477
477
|
}) : document.querySelectorAll(".highlight-col").forEach((t) => t.classList.remove("highlight-col"));
|
|
478
478
|
},
|
|
479
479
|
resizeCol(e, t) {
|
|
480
|
-
const
|
|
481
|
-
if (!
|
|
482
|
-
const w =
|
|
483
|
-
if (!
|
|
484
|
-
|
|
485
|
-
const
|
|
480
|
+
const o = /* @__PURE__ */ new Map(), a = e.clientX, n = e.target.closest("table"), i = n == null ? void 0 : n.querySelectorAll("th")[t], d = i == null ? void 0 : i.getBoundingClientRect().width, u = o.get(t) ? this.colWidths[t.toString()] || 60 : (o.set(t, !0), d || this.colWidths[t.toString()] || 60), c = i == null ? void 0 : i.querySelector("p");
|
|
481
|
+
if (!c) return;
|
|
482
|
+
const w = c.textContent || "", C = window.getComputedStyle(c), m = `${C.fontWeight} ${C.fontSize} ${C.fontFamily}`, f = document.createElement("canvas").getContext("2d");
|
|
483
|
+
if (!f) return;
|
|
484
|
+
f.font = m;
|
|
485
|
+
const k = f.measureText(w), E = window.getComputedStyle(i), q = parseFloat(E.paddingLeft || "0"), P = parseFloat(E.paddingRight || "0"), X = k.width + q + P;
|
|
486
486
|
this.highlightCol(t, !1);
|
|
487
|
-
const
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
this.updateColWidth(t,
|
|
491
|
-
let
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}),
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
498
|
-
|
|
487
|
+
const l = (S) => {
|
|
488
|
+
const b = S.clientX - a, x = Math.max(X, u + b);
|
|
489
|
+
if (n) {
|
|
490
|
+
this.updateColWidth(t, x, n, !0);
|
|
491
|
+
let R = 0;
|
|
492
|
+
n.querySelectorAll("th").forEach((D, $) => {
|
|
493
|
+
R += $ === t ? x : this.colWidths[$] || D.getBoundingClientRect().width;
|
|
494
|
+
}), n.classList.remove("w-full"), n.style.width = `${R}px`;
|
|
495
|
+
const T = n == null ? void 0 : n.parentElement;
|
|
496
|
+
if (T) {
|
|
497
|
+
const D = T.scrollWidth, $ = T.scrollLeft;
|
|
498
|
+
T.offsetWidth + $ >= D - 100 && (T.scrollLeft = D);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
},
|
|
502
|
-
((
|
|
503
|
-
const
|
|
504
|
-
this.colWidths[
|
|
505
|
-
}), this.removeColHighlight(!1), document.removeEventListener("mousemove",
|
|
501
|
+
}, p = () => {
|
|
502
|
+
((n == null ? void 0 : n.querySelectorAll("th")) ?? []).forEach((b, x) => {
|
|
503
|
+
const R = b.getBoundingClientRect().width;
|
|
504
|
+
this.colWidths[x] = R;
|
|
505
|
+
}), this.removeColHighlight(!1), document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", p);
|
|
506
506
|
};
|
|
507
|
-
document.addEventListener("mousemove",
|
|
507
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", p);
|
|
508
508
|
},
|
|
509
509
|
resizeRow(e) {
|
|
510
|
-
const t = e.clientY,
|
|
510
|
+
const t = e.clientY, o = e.target.closest("table"), a = this.rowHeight || 48;
|
|
511
511
|
this.highlightRows(!1);
|
|
512
|
-
const
|
|
512
|
+
const n = (d) => {
|
|
513
513
|
const u = Math.max(30, a + (d.clientY - t));
|
|
514
|
-
|
|
515
|
-
},
|
|
516
|
-
this.removeRowHighlight(!1), document.removeEventListener("mousemove",
|
|
514
|
+
o && this.updateRowHeight(u, o);
|
|
515
|
+
}, i = () => {
|
|
516
|
+
this.removeRowHighlight(!1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", i);
|
|
517
517
|
};
|
|
518
|
-
document.addEventListener("mousemove",
|
|
518
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", i);
|
|
519
519
|
},
|
|
520
520
|
enableCellResizing() {
|
|
521
|
-
const e = document.querySelector("thead"), t = document.querySelectorAll("thead tr"),
|
|
521
|
+
const e = document.querySelector("thead"), t = document.querySelectorAll("thead tr"), o = document.querySelectorAll("tbody tr"), a = [...t, ...o];
|
|
522
522
|
e && e.classList.remove("sticky");
|
|
523
|
-
const
|
|
523
|
+
const n = (i, d) => {
|
|
524
524
|
const u = document.createElement("div");
|
|
525
|
-
return u.className = `${
|
|
526
|
-
|
|
527
|
-
})) : (u.addEventListener("mouseenter", () => this.highlightRows(!0)), u.addEventListener("mouseleave", () => this.removeRowHighlight(!0)), u.addEventListener("mousedown", (
|
|
528
|
-
|
|
525
|
+
return u.className = `${i}-resize-handle`, i === "col" ? (u.addEventListener("mouseenter", () => this.highlightCol(d, !0)), u.addEventListener("mouseleave", () => this.removeColHighlight(!0)), u.addEventListener("mousedown", (c) => {
|
|
526
|
+
c.stopPropagation(), this.resizeCol(c, d);
|
|
527
|
+
})) : (u.addEventListener("mouseenter", () => this.highlightRows(!0)), u.addEventListener("mouseleave", () => this.removeRowHighlight(!0)), u.addEventListener("mousedown", (c) => {
|
|
528
|
+
c.stopPropagation(), this.resizeRow(c);
|
|
529
529
|
})), u;
|
|
530
530
|
};
|
|
531
|
-
a.forEach((
|
|
532
|
-
const d =
|
|
533
|
-
|
|
534
|
-
const C =
|
|
535
|
-
|
|
531
|
+
a.forEach((i) => {
|
|
532
|
+
const d = i.closest("thead") !== null;
|
|
533
|
+
i.querySelectorAll(d ? "th" : "td").forEach((c, w) => {
|
|
534
|
+
const C = n("col", w), m = n("row", w);
|
|
535
|
+
c.appendChild(C), c.appendChild(m);
|
|
536
536
|
});
|
|
537
537
|
}), this.enableEditMode();
|
|
538
538
|
},
|
|
@@ -543,7 +543,7 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
543
543
|
}), ea = { class: "my-4" }, ta = {
|
|
544
544
|
class: "border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm",
|
|
545
545
|
style: { backgroundColor: "#f9f9f9" }
|
|
546
|
-
}, aa = { class: "font-bold" }, la = { class: "text-fm-color-neutral-gray-300" }, oa = /* @__PURE__ */
|
|
546
|
+
}, aa = { class: "font-bold" }, la = { class: "text-fm-color-neutral-gray-300" }, oa = /* @__PURE__ */ G({
|
|
547
547
|
__name: "WidgetTable",
|
|
548
548
|
props: {
|
|
549
549
|
modelValue: { required: !0 },
|
|
@@ -551,159 +551,174 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
551
551
|
},
|
|
552
552
|
emits: ["update:modelValue"],
|
|
553
553
|
setup(e) {
|
|
554
|
-
const { t, te:
|
|
555
|
-
var
|
|
556
|
-
return ((
|
|
557
|
-
}),
|
|
558
|
-
var
|
|
559
|
-
return ((
|
|
554
|
+
const { t, te: o } = Re(), a = j(e, "modelValue"), { country: n } = Le(), i = Zt(), d = y(null), u = h(() => {
|
|
555
|
+
var l;
|
|
556
|
+
return ((l = a.value.data) == null ? void 0 : l.columns) || [{ label: "", key: "" }];
|
|
557
|
+
}), c = h(() => {
|
|
558
|
+
var l;
|
|
559
|
+
return ((l = a.value.data) == null ? void 0 : l.rows) || [];
|
|
560
560
|
}), w = h(() => a.value.filterText), C = h(() => {
|
|
561
|
-
var
|
|
562
|
-
if (!(w.value && w.value.trim().length > 0 || !((
|
|
561
|
+
var l, p;
|
|
562
|
+
if (!(w.value && w.value.trim().length > 0 || !((l = c.value[0]) != null && l.isRollup) && !((p = c.value[c.value.length - 1]) != null && p.isRollup))) {
|
|
563
563
|
if (a.value.rollupPosition === O.top || a.value.rollupPosition === void 0)
|
|
564
564
|
return O.top;
|
|
565
565
|
if (a.value.rollupPosition === O.bottom)
|
|
566
566
|
return O.bottom;
|
|
567
567
|
}
|
|
568
568
|
}), m = h(() => {
|
|
569
|
-
const b = C.value !== void 0 ? 1 : 0,
|
|
570
|
-
return Math.floor((
|
|
571
|
-
}),
|
|
572
|
-
var
|
|
573
|
-
let
|
|
569
|
+
const b = C.value !== void 0 ? 1 : 0, x = (d.value ? d.value.$el.offsetHeight : 0) - 48;
|
|
570
|
+
return Math.floor((x - 34.5 - 32) / 48) - b;
|
|
571
|
+
}), g = h(() => {
|
|
572
|
+
var p, S;
|
|
573
|
+
let l = [];
|
|
574
574
|
switch (C.value) {
|
|
575
575
|
case O.top:
|
|
576
|
-
|
|
576
|
+
l = [...((p = c.value[0]) == null ? void 0 : p.cells) || []].map((b, x) => {
|
|
577
577
|
var R;
|
|
578
578
|
return {
|
|
579
579
|
main: b,
|
|
580
|
-
comparison: (R =
|
|
581
|
-
rowType: u.value[
|
|
580
|
+
comparison: (R = c.value[0]) == null ? void 0 : R.comparisonCells[x],
|
|
581
|
+
rowType: u.value[x].type
|
|
582
582
|
};
|
|
583
583
|
});
|
|
584
584
|
break;
|
|
585
585
|
case O.bottom:
|
|
586
|
-
|
|
586
|
+
l = [...((S = c.value[c.value.length - 1]) == null ? void 0 : S.cells) || []].map((b, x) => {
|
|
587
587
|
var R;
|
|
588
588
|
return {
|
|
589
589
|
main: b,
|
|
590
|
-
comparison: (R =
|
|
591
|
-
rowType: u.value[
|
|
590
|
+
comparison: (R = c.value[0]) == null ? void 0 : R.comparisonCells[x],
|
|
591
|
+
rowType: u.value[x].type
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
|
-
return
|
|
596
|
+
return l.length > 0 && l[0].main === "" && (l[0].main = "Grand total"), l;
|
|
597
597
|
});
|
|
598
|
-
function
|
|
599
|
-
const
|
|
598
|
+
function f(l) {
|
|
599
|
+
const p = {};
|
|
600
600
|
for (let S = 0; S < u.value.length; S++)
|
|
601
601
|
if (u.value[S].key !== "") {
|
|
602
|
-
const b =
|
|
603
|
-
|
|
604
|
-
main:
|
|
602
|
+
const b = l.comparisonCells[S];
|
|
603
|
+
p[u.value[S].key] = {
|
|
604
|
+
main: l.cells[S],
|
|
605
605
|
comparison: b
|
|
606
|
-
},
|
|
606
|
+
}, p.isRollup = l.isRollup;
|
|
607
607
|
}
|
|
608
|
-
return
|
|
608
|
+
return p;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return [...new Array(
|
|
610
|
+
function k(l) {
|
|
611
|
+
return [...new Array(l < 0 ? 0 : l)].map(() => {
|
|
612
612
|
var S;
|
|
613
|
-
const
|
|
613
|
+
const p = {};
|
|
614
614
|
if ((S = a.value.data) != null && S.columns)
|
|
615
615
|
for (let b = 0; b < a.value.data.columns.length; b++)
|
|
616
|
-
|
|
617
|
-
return
|
|
616
|
+
p[a.value.data.columns[b].key] = void 0;
|
|
617
|
+
return p;
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
let
|
|
622
|
-
return
|
|
623
|
-
main:
|
|
620
|
+
function E(l) {
|
|
621
|
+
let p = (l == null ? void 0 : l.main) || "";
|
|
622
|
+
return p.includes("#") && !p.startsWith("#") && (p = p.split("#")[0]), !l || l.main === "" || l.comparison === "" ? {
|
|
623
|
+
main: p
|
|
624
624
|
} : {
|
|
625
|
-
main:
|
|
626
|
-
comparison:
|
|
627
|
-
difference:
|
|
625
|
+
main: p,
|
|
626
|
+
comparison: l == null ? void 0 : l.comparison,
|
|
627
|
+
difference: at(l.main, l.comparison, n)
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
630
|
const q = h(() => {
|
|
631
|
-
var
|
|
632
|
-
let
|
|
631
|
+
var x, R, B;
|
|
632
|
+
let l = ((x = a.value.data) == null ? void 0 : x.rows) || [];
|
|
633
633
|
switch (C.value) {
|
|
634
634
|
case O.bottom:
|
|
635
|
-
|
|
635
|
+
l = (R = l[l.length - 1]) != null && R.isRollup ? l.slice(0, -1) : l;
|
|
636
636
|
break;
|
|
637
637
|
case O.top:
|
|
638
|
-
|
|
638
|
+
l = (B = l[0]) != null && B.isRollup ? l.slice(1, l.length) : l;
|
|
639
639
|
break;
|
|
640
640
|
}
|
|
641
|
-
const
|
|
642
|
-
(
|
|
643
|
-
var
|
|
644
|
-
return ((
|
|
641
|
+
const p = l.filter((T) => !(w.value !== "" && (T.isRollup === !0 || !T.cells.some(
|
|
642
|
+
(D) => {
|
|
643
|
+
var $;
|
|
644
|
+
return ((D == null ? void 0 : D.toLowerCase()) || "").includes(($ = w.value) == null ? void 0 : $.toLowerCase());
|
|
645
645
|
}
|
|
646
|
-
)))).map((
|
|
646
|
+
)))).map((T) => f(T)), S = p.length % m.value;
|
|
647
647
|
let b = 0;
|
|
648
|
-
return S > 0 ? b = Math.abs(S - m.value) :
|
|
649
|
-
}),
|
|
650
|
-
var
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
648
|
+
return S > 0 ? b = Math.abs(S - m.value) : p.length === 0 && (b = m.value), p.push(...k(b)), p;
|
|
649
|
+
}), P = h(() => {
|
|
650
|
+
var l, p;
|
|
651
|
+
return !!((l = a.value.colWidths) != null && l.length) || !!((p = i.colWidths) != null && p.length);
|
|
652
|
+
});
|
|
653
|
+
le(
|
|
654
|
+
P,
|
|
655
|
+
async (l) => {
|
|
656
|
+
l && i.isEditing && (await je(), i.enableCellResizing());
|
|
657
|
+
},
|
|
658
|
+
{ immediate: !0 }
|
|
659
|
+
);
|
|
660
|
+
const X = h(() => {
|
|
661
|
+
var p;
|
|
662
|
+
let l = [];
|
|
663
|
+
return (p = a.value.data) != null && p.columns && (l = [...a.value.data.columns.map((b) => {
|
|
664
|
+
const x = ae(t, o, b.label, "other");
|
|
654
665
|
return {
|
|
655
666
|
accessorKey: b.key,
|
|
656
|
-
header: () =>
|
|
667
|
+
header: () => Je(
|
|
657
668
|
"p",
|
|
658
669
|
{
|
|
659
670
|
class: `w-full ${b.type === "NUMERIC" ? "text-right" : ""} whitespace-nowrap`
|
|
660
671
|
},
|
|
661
|
-
|
|
672
|
+
x
|
|
662
673
|
),
|
|
663
674
|
cell: (R) => {
|
|
664
|
-
var
|
|
665
|
-
const
|
|
666
|
-
return
|
|
675
|
+
var D, $;
|
|
676
|
+
const B = E(R.getValue()), T = ($ = (D = R == null ? void 0 : R.row) == null ? void 0 : D.original) == null ? void 0 : $.isRollup;
|
|
677
|
+
return Je(
|
|
667
678
|
"div",
|
|
668
679
|
{
|
|
669
|
-
class:
|
|
680
|
+
class: [
|
|
681
|
+
T ? "fm-typo-en-body-md-600 text-fm-color-typo-secondary" : "fm-typo-en-body-md-400",
|
|
682
|
+
b.type === "NUMERIC" ? "text-right" : "",
|
|
683
|
+
P.value ? "whitespace-normal break-words line-clamp-6" : "whitespace-nowrap"
|
|
684
|
+
].join(" ")
|
|
670
685
|
},
|
|
671
|
-
[
|
|
686
|
+
[B.main]
|
|
672
687
|
);
|
|
673
688
|
},
|
|
674
689
|
enableSorting: !1
|
|
675
690
|
};
|
|
676
|
-
})]),
|
|
691
|
+
})]), l;
|
|
677
692
|
});
|
|
678
|
-
return
|
|
679
|
-
[() =>
|
|
693
|
+
return le(
|
|
694
|
+
[() => X.value],
|
|
680
695
|
async () => {
|
|
681
|
-
var R,
|
|
682
|
-
await
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
687
|
-
const S = !!((
|
|
688
|
-
|
|
689
|
-
const b =
|
|
690
|
-
typeof b == "number" &&
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
|
|
696
|
+
var R, B;
|
|
697
|
+
await je();
|
|
698
|
+
const l = (R = d.value) == null ? void 0 : R.$el;
|
|
699
|
+
if (!l) return;
|
|
700
|
+
const p = l.querySelector("table");
|
|
701
|
+
if (!p) return;
|
|
702
|
+
const S = !!((B = a.value.colWidths) != null && B.length);
|
|
703
|
+
p.classList.add(S ? "table-fixed" : "table-auto"), i.isEditing && i.enableCellResizing();
|
|
704
|
+
const b = i.rowHeight || a.value.rowHeight;
|
|
705
|
+
typeof b == "number" && i.setRowHeights(b, l);
|
|
706
|
+
const x = a.value.colWidths ?? i.colWidths;
|
|
707
|
+
x == null || x.forEach((T, D) => {
|
|
708
|
+
i.setColWidths(D, T, l);
|
|
694
709
|
});
|
|
695
710
|
},
|
|
696
711
|
{ immediate: !0 }
|
|
697
|
-
), (
|
|
712
|
+
), (l, p) => {
|
|
698
713
|
const S = F("FmTable");
|
|
699
|
-
return
|
|
714
|
+
return _(), z(U, null, [
|
|
700
715
|
A("div", ea, [
|
|
701
|
-
Z(
|
|
716
|
+
Z(l.$slots, "menu")
|
|
702
717
|
]),
|
|
703
718
|
H(S, {
|
|
704
719
|
ref_key: "table",
|
|
705
720
|
ref: d,
|
|
706
|
-
"column-defs":
|
|
721
|
+
"column-defs": X.value,
|
|
707
722
|
"row-data": q.value,
|
|
708
723
|
"search-value": w.value,
|
|
709
724
|
"page-size": m.value,
|
|
@@ -714,12 +729,16 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
714
729
|
"pin-top": V(() => [
|
|
715
730
|
A("tbody", null, [
|
|
716
731
|
A("tr", ta, [
|
|
717
|
-
(
|
|
718
|
-
key: `${r(he)()}_${
|
|
732
|
+
(_(!0), z(U, null, et(g.value, (b, x) => (_(), z("td", {
|
|
733
|
+
key: `${r(he)()}_${x}`,
|
|
719
734
|
class: "h-[48px] text-fm-color-typo-primary px-16"
|
|
720
735
|
}, [
|
|
721
736
|
A("span", {
|
|
722
|
-
class: me(
|
|
737
|
+
class: me([
|
|
738
|
+
"items-center text-fm-color-typo-secondary gap-2",
|
|
739
|
+
b.rowType === "NUMERIC" ? "text-right" : "",
|
|
740
|
+
P.value ? "whitespace-normal break-words line-clamp-6" : "whitespace-nowrap"
|
|
741
|
+
])
|
|
723
742
|
}, [
|
|
724
743
|
A("p", aa, ne(b.main), 1),
|
|
725
744
|
A("p", la, ne(b.comparison ? `(${b.comparison})` : ""), 1)
|
|
@@ -733,7 +752,7 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
733
752
|
], 64);
|
|
734
753
|
};
|
|
735
754
|
}
|
|
736
|
-
}), sa = /* @__PURE__ */
|
|
755
|
+
}), sa = /* @__PURE__ */ G({
|
|
737
756
|
__name: "WidgetStackBarChart",
|
|
738
757
|
props: {
|
|
739
758
|
modelValue: { required: !0 },
|
|
@@ -741,38 +760,38 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
741
760
|
},
|
|
742
761
|
emits: ["update:modelValue"],
|
|
743
762
|
setup(e) {
|
|
744
|
-
const t =
|
|
745
|
-
var
|
|
746
|
-
return ((
|
|
763
|
+
const t = j(e, "modelValue"), o = h(() => {
|
|
764
|
+
var k;
|
|
765
|
+
return ((k = t.value.data) == null ? void 0 : k.xAxis) || [];
|
|
747
766
|
}), a = h(() => {
|
|
748
|
-
var
|
|
749
|
-
return ((
|
|
750
|
-
}),
|
|
767
|
+
var f;
|
|
768
|
+
return ((f = t.value.data) == null ? void 0 : f.datasets) ?? [];
|
|
769
|
+
}), n = y(null), { datalabels: i, xCfg: d, yCfg: u, isTransposed: c, legend: w, chartWidth: C, chartHeight: m } = ie(
|
|
751
770
|
t.value
|
|
752
|
-
),
|
|
753
|
-
...a.value.map((
|
|
754
|
-
let
|
|
771
|
+
), g = h(() => a.value.length > 0 ? [
|
|
772
|
+
...a.value.map((f, k) => {
|
|
773
|
+
let E = f.values;
|
|
755
774
|
return {
|
|
756
|
-
label:
|
|
757
|
-
data:
|
|
758
|
-
dash: !!
|
|
759
|
-
backgroundColor: re({ index:
|
|
775
|
+
label: f.name,
|
|
776
|
+
data: E,
|
|
777
|
+
dash: !!f.isCompare,
|
|
778
|
+
backgroundColor: re({ index: k, isCompare: f.isCompare })
|
|
760
779
|
};
|
|
761
780
|
})
|
|
762
781
|
] : []);
|
|
763
|
-
return (
|
|
764
|
-
const
|
|
765
|
-
return
|
|
766
|
-
Z(
|
|
767
|
-
H(
|
|
782
|
+
return (f, k) => {
|
|
783
|
+
const E = F("FmBarChart");
|
|
784
|
+
return _(), z(U, null, [
|
|
785
|
+
Z(f.$slots, "menu"),
|
|
786
|
+
H(E, {
|
|
768
787
|
ref_key: "chartRef",
|
|
769
|
-
ref:
|
|
788
|
+
ref: n,
|
|
770
789
|
class: "bar-chart",
|
|
771
|
-
datasets:
|
|
772
|
-
"x-axis": { categories:
|
|
790
|
+
datasets: g.value,
|
|
791
|
+
"x-axis": { categories: o.value },
|
|
773
792
|
"x-cfg": r(d),
|
|
774
793
|
"y-cfg": r(u),
|
|
775
|
-
transpose: r(
|
|
794
|
+
transpose: r(c),
|
|
776
795
|
stacked: !0,
|
|
777
796
|
legend: {
|
|
778
797
|
display: r(w).display ?? !1,
|
|
@@ -782,7 +801,7 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
782
801
|
usePointStyle: r(w).usePointStyle ?? !0
|
|
783
802
|
}
|
|
784
803
|
},
|
|
785
|
-
datalabels: r(
|
|
804
|
+
datalabels: r(i),
|
|
786
805
|
"maintain-aspect-ratio": !1,
|
|
787
806
|
style: Y({
|
|
788
807
|
"--chart-width": r(C) !== void 0 ? r(C) + "px" : "100%",
|
|
@@ -792,7 +811,7 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
792
811
|
], 64);
|
|
793
812
|
};
|
|
794
813
|
}
|
|
795
|
-
}), na = /* @__PURE__ */
|
|
814
|
+
}), na = /* @__PURE__ */ G({
|
|
796
815
|
__name: "WidgetStackLineChart",
|
|
797
816
|
props: {
|
|
798
817
|
modelValue: { required: !0 },
|
|
@@ -800,47 +819,47 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
800
819
|
},
|
|
801
820
|
emits: ["update:modelValue"],
|
|
802
821
|
setup(e) {
|
|
803
|
-
const t =
|
|
804
|
-
var
|
|
805
|
-
return ((
|
|
822
|
+
const t = j(e, "modelValue"), o = h(() => {
|
|
823
|
+
var g;
|
|
824
|
+
return ((g = t.value.data) == null ? void 0 : g.xAxis) ?? [];
|
|
806
825
|
}), a = h(() => {
|
|
807
|
-
var
|
|
808
|
-
return ((
|
|
809
|
-
}), { datalabels:
|
|
826
|
+
var g;
|
|
827
|
+
return ((g = t.value.data) == null ? void 0 : g.datasets) ?? [];
|
|
828
|
+
}), { datalabels: n, xCfg: i, yCfg: d, isTransposed: u, legend: c, chartWidth: w, chartHeight: C } = ie(
|
|
810
829
|
t.value
|
|
811
830
|
), m = h(() => a.value.length > 0 ? [
|
|
812
|
-
...a.value.map((
|
|
813
|
-
let
|
|
831
|
+
...a.value.map((g, f) => {
|
|
832
|
+
let k = g.values;
|
|
814
833
|
return {
|
|
815
|
-
label:
|
|
816
|
-
data:
|
|
817
|
-
dash:
|
|
834
|
+
label: g.name,
|
|
835
|
+
data: k,
|
|
836
|
+
dash: g.isCompare,
|
|
818
837
|
fill: !1,
|
|
819
|
-
color: re({ index:
|
|
838
|
+
color: re({ index: f, isCompare: g.isCompare })
|
|
820
839
|
};
|
|
821
840
|
})
|
|
822
841
|
] : []);
|
|
823
|
-
return (
|
|
824
|
-
const
|
|
825
|
-
return
|
|
826
|
-
Z(
|
|
827
|
-
H(
|
|
842
|
+
return (g, f) => {
|
|
843
|
+
const k = F("FmLineChart");
|
|
844
|
+
return _(), z(U, null, [
|
|
845
|
+
Z(g.$slots, "menu"),
|
|
846
|
+
H(k, {
|
|
828
847
|
class: "line-chart",
|
|
829
848
|
datasets: m.value,
|
|
830
|
-
"x-axis": { categories:
|
|
831
|
-
"x-cfg": r(
|
|
849
|
+
"x-axis": { categories: o.value },
|
|
850
|
+
"x-cfg": r(i),
|
|
832
851
|
"y-cfg": r(d),
|
|
833
852
|
transpose: r(u),
|
|
834
853
|
legend: {
|
|
835
|
-
display: r(
|
|
836
|
-
position: r(
|
|
854
|
+
display: r(c).display ?? !1,
|
|
855
|
+
position: r(c).position,
|
|
837
856
|
maxHeight: 54,
|
|
838
857
|
labels: {
|
|
839
|
-
usePointStyle: r(
|
|
858
|
+
usePointStyle: r(c).usePointStyle ?? !0
|
|
840
859
|
}
|
|
841
860
|
},
|
|
842
861
|
stacked: !0,
|
|
843
|
-
datalabels: r(
|
|
862
|
+
datalabels: r(n),
|
|
844
863
|
"maintain-aspect-ratio": !1,
|
|
845
864
|
style: Y({
|
|
846
865
|
"--chart-width": r(w) !== void 0 ? r(w) + "px" : "97%",
|
|
@@ -850,7 +869,7 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
850
869
|
], 64);
|
|
851
870
|
};
|
|
852
871
|
}
|
|
853
|
-
}),
|
|
872
|
+
}), oe = [
|
|
854
873
|
"col-span-1",
|
|
855
874
|
"col-span-2",
|
|
856
875
|
"col-span-3",
|
|
@@ -865,15 +884,15 @@ const Kt = /* @__PURE__ */ Ht(jt, [["render", Jt]]), Qt = "mf-reporttable-dimens
|
|
|
865
884
|
"col-span-12"
|
|
866
885
|
];
|
|
867
886
|
function ra(e) {
|
|
868
|
-
return e < 12 ?
|
|
887
|
+
return e < 12 ? oe[e - 1] : oe[11];
|
|
869
888
|
}
|
|
870
889
|
function ia(e) {
|
|
871
|
-
return e < 12 ?
|
|
890
|
+
return e < 12 ? oe[Math.min(11, e * 2 - 1)] : oe[11];
|
|
872
891
|
}
|
|
873
892
|
function ca(e) {
|
|
874
|
-
return e < 12 ?
|
|
893
|
+
return e < 12 ? oe[Math.min(11, e * 3 - 1)] : oe[11];
|
|
875
894
|
}
|
|
876
|
-
const ua = /* @__PURE__ */
|
|
895
|
+
const ua = /* @__PURE__ */ G({
|
|
877
896
|
__name: "WidgetLinechart",
|
|
878
897
|
props: {
|
|
879
898
|
modelValue: { required: !0 },
|
|
@@ -881,44 +900,44 @@ const ua = /* @__PURE__ */ U({
|
|
|
881
900
|
},
|
|
882
901
|
emits: ["update:modelValue"],
|
|
883
902
|
setup(e) {
|
|
884
|
-
const t =
|
|
885
|
-
var
|
|
886
|
-
return ((
|
|
903
|
+
const t = j(e, "modelValue"), o = h(() => {
|
|
904
|
+
var g;
|
|
905
|
+
return ((g = t.value.data) == null ? void 0 : g.xAxis) ?? [];
|
|
887
906
|
}), a = h(() => {
|
|
888
|
-
var
|
|
889
|
-
return ((
|
|
890
|
-
}), { datalabels:
|
|
907
|
+
var g;
|
|
908
|
+
return ((g = t.value.data) == null ? void 0 : g.datasets) ?? [];
|
|
909
|
+
}), { datalabels: n, xCfg: i, yCfg: d, isTransposed: u, legend: c, chartWidth: w, chartHeight: C } = ie(
|
|
891
910
|
t.value
|
|
892
911
|
), m = h(() => a.value.length > 0 ? [
|
|
893
|
-
...a.value.map((
|
|
894
|
-
label:
|
|
895
|
-
data:
|
|
896
|
-
dash: !!
|
|
912
|
+
...a.value.map((g, f) => ({
|
|
913
|
+
label: g.name,
|
|
914
|
+
data: g.values,
|
|
915
|
+
dash: !!g.isCompare,
|
|
897
916
|
fill: !1,
|
|
898
|
-
color: re({ index:
|
|
917
|
+
color: re({ index: f, isCompare: g.isCompare })
|
|
899
918
|
}))
|
|
900
919
|
] : []);
|
|
901
|
-
return (
|
|
902
|
-
const
|
|
903
|
-
return
|
|
904
|
-
Z(
|
|
905
|
-
H(
|
|
920
|
+
return (g, f) => {
|
|
921
|
+
const k = F("FmLineChart");
|
|
922
|
+
return _(), z(U, null, [
|
|
923
|
+
Z(g.$slots, "menu"),
|
|
924
|
+
H(k, {
|
|
906
925
|
class: "line-chart",
|
|
907
926
|
datasets: m.value,
|
|
908
|
-
"x-axis": { categories:
|
|
909
|
-
"x-cfg": r(
|
|
927
|
+
"x-axis": { categories: o.value },
|
|
928
|
+
"x-cfg": r(i),
|
|
910
929
|
"y-cfg": r(d),
|
|
911
930
|
transpose: r(u),
|
|
912
931
|
legend: {
|
|
913
|
-
display: r(
|
|
914
|
-
position: r(
|
|
932
|
+
display: r(c).display ?? !1,
|
|
933
|
+
position: r(c).position,
|
|
915
934
|
position: "bottom",
|
|
916
935
|
maxHeight: 54,
|
|
917
936
|
labels: {
|
|
918
|
-
usePointStyle: r(
|
|
937
|
+
usePointStyle: r(c).usePointStyle ?? !0
|
|
919
938
|
}
|
|
920
939
|
},
|
|
921
|
-
datalabels: r(
|
|
940
|
+
datalabels: r(n),
|
|
922
941
|
"maintain-aspect-ratio": !1,
|
|
923
942
|
style: Y({
|
|
924
943
|
"--chart-width": r(w) !== void 0 ? r(w) + "px" : "97%",
|
|
@@ -934,9 +953,9 @@ const ua = /* @__PURE__ */ U({
|
|
|
934
953
|
}, ha = {
|
|
935
954
|
key: 2,
|
|
936
955
|
class: "flex"
|
|
937
|
-
}, Sa = /* @__PURE__ */
|
|
956
|
+
}, Sa = /* @__PURE__ */ G({
|
|
938
957
|
__name: "DynamicWidget",
|
|
939
|
-
props: /* @__PURE__ */
|
|
958
|
+
props: /* @__PURE__ */ xt({
|
|
940
959
|
index: {
|
|
941
960
|
type: Number,
|
|
942
961
|
default: 0
|
|
@@ -952,81 +971,81 @@ const ua = /* @__PURE__ */ U({
|
|
|
952
971
|
}),
|
|
953
972
|
emits: ["update:modelValue"],
|
|
954
973
|
setup(e) {
|
|
955
|
-
const t =
|
|
974
|
+
const t = y(!0), o = j(e, "modelValue"), a = o.value.widget.config, { t: n, te: i } = Re(), d = e, u = y(null), c = y(a.rollup), w = y(he()), C = y(a.drillDimension), m = h(() => {
|
|
956
975
|
if (J.value.length > 0) {
|
|
957
|
-
const
|
|
976
|
+
const s = J.value.findIndex(
|
|
958
977
|
(L) => L.value === C.value
|
|
959
978
|
);
|
|
960
|
-
return
|
|
979
|
+
return s >= 0 ? s : 0;
|
|
961
980
|
} else
|
|
962
981
|
return -1;
|
|
963
|
-
}),
|
|
982
|
+
}), g = h(() => m.value !== 0), f = h(
|
|
964
983
|
() => m.value != J.value.length - 1
|
|
965
|
-
),
|
|
966
|
-
() => Bt.find((
|
|
967
|
-
), ee =
|
|
968
|
-
var
|
|
969
|
-
qe.value =
|
|
970
|
-
}),
|
|
984
|
+
), k = y(a.showTitle ?? !0), E = y(a.titleFontSize ?? 14), q = y(a.titleBold ?? !1), P = y(a.titleItalic ?? !1), X = y(a.titleUnderline ?? !1), l = y(a.chartWidth ?? void 0), p = y(a.chartHeight ?? void 0), S = y(a.showLabel ?? !1), b = y(a.labelAlign ?? Se.center), x = y(a.labelAnchor ?? Ce.center), R = y(a.labelRotation ?? 0), B = y(a.labelOffset ?? 0), T = y(a.labelFontSize ?? 12), D = h(() => a.showSearchBar), $ = y(a.showX ?? !0), pe = y(a.xPosition ?? _e.bottom), Fe = y(a.showXGrid ?? !1), Ee = y(a.showXTick ?? !0), Te = y(a.xTickFontSize ?? 12), We = y(a.showY ?? !0), ze = y(a.yPosition ?? xe.left), De = y(a.showYGrid ?? !1), Ae = y(a.showYTick ?? !0), He = y(a.yTickFontSize ?? 12), $e = y(a.showLegend ?? void 0), Pe = y(a.legendPosition ?? ke.top), Be = y(a.usePointStyle ?? !0), Me = y(a.rowHeight ?? 0), Ve = y(a.colWidths ?? []), fe = y(""), { breakpoints: N } = $t(), qe = y(), lt = h(() => N.value.lg || N.value.md ? ra(o.value.size.width) : N.value.sm ? ia(o.value.size.width) : ca(o.value.size.width)), ce = h(
|
|
985
|
+
() => Bt.find((s) => s.type === o.value.widget.type)
|
|
986
|
+
), ee = Ke(() => {
|
|
987
|
+
var s;
|
|
988
|
+
qe.value = dt((s = u.value) == null ? void 0 : s.$el.offsetWidth), w.value = he();
|
|
989
|
+
}), ot = h(() => {
|
|
971
990
|
if (Mt(W.value.type, te.value))
|
|
972
|
-
switch (
|
|
973
|
-
case
|
|
991
|
+
switch (o.value.widget.type) {
|
|
992
|
+
case v.BarChart:
|
|
974
993
|
return qt;
|
|
975
|
-
case
|
|
994
|
+
case v.StackBarChart:
|
|
976
995
|
return sa;
|
|
977
|
-
case
|
|
996
|
+
case v.LineChart:
|
|
978
997
|
return ua;
|
|
979
|
-
case
|
|
998
|
+
case v.StackLineChart:
|
|
980
999
|
return na;
|
|
981
|
-
case
|
|
1000
|
+
case v.Circular:
|
|
982
1001
|
return Nt;
|
|
983
|
-
case
|
|
1002
|
+
case v.Scorecard:
|
|
984
1003
|
return Gt;
|
|
985
|
-
case
|
|
1004
|
+
case v.Spacer:
|
|
986
1005
|
return Kt;
|
|
987
|
-
case
|
|
1006
|
+
case v.Table:
|
|
988
1007
|
return oa;
|
|
989
1008
|
default:
|
|
990
|
-
return
|
|
1009
|
+
return Qe;
|
|
991
1010
|
}
|
|
992
1011
|
else
|
|
993
|
-
return
|
|
994
|
-
}), te =
|
|
995
|
-
const
|
|
1012
|
+
return Qe;
|
|
1013
|
+
}), te = y(null), { selectedLocationIds: ve, dateRange: st, compareDateRange: nt, timeRange: rt } = we(tt()), { businessId: it } = we(Le()), W = h(() => {
|
|
1014
|
+
const s = JSON.parse(JSON.stringify(o.value.widget));
|
|
996
1015
|
return {
|
|
997
|
-
...
|
|
1016
|
+
...s,
|
|
998
1017
|
config: {
|
|
999
|
-
...
|
|
1000
|
-
rollup:
|
|
1018
|
+
...s.config,
|
|
1019
|
+
rollup: c.value,
|
|
1001
1020
|
drillDimension: C.value,
|
|
1002
1021
|
showGrandTotal: !1
|
|
1003
1022
|
}
|
|
1004
1023
|
};
|
|
1005
1024
|
});
|
|
1006
|
-
function
|
|
1025
|
+
function ct() {
|
|
1007
1026
|
return {
|
|
1008
1027
|
data: te.value,
|
|
1009
|
-
showTitle:
|
|
1010
|
-
titleFontSize:
|
|
1028
|
+
showTitle: k.value,
|
|
1029
|
+
titleFontSize: E.value,
|
|
1011
1030
|
titleBold: q.value,
|
|
1012
|
-
titleItalic:
|
|
1013
|
-
titleUnderline:
|
|
1014
|
-
chartHeight:
|
|
1015
|
-
chartWidth:
|
|
1016
|
-
showLabel:
|
|
1017
|
-
labelAnchor:
|
|
1018
|
-
labelAlign:
|
|
1019
|
-
labelRotation:
|
|
1020
|
-
labelOffset:
|
|
1021
|
-
labelFontSize:
|
|
1022
|
-
showX:
|
|
1031
|
+
titleItalic: P.value,
|
|
1032
|
+
titleUnderline: X.value,
|
|
1033
|
+
chartHeight: p.value,
|
|
1034
|
+
chartWidth: l.value,
|
|
1035
|
+
showLabel: S.value,
|
|
1036
|
+
labelAnchor: x.value,
|
|
1037
|
+
labelAlign: b.value,
|
|
1038
|
+
labelRotation: R.value,
|
|
1039
|
+
labelOffset: B.value,
|
|
1040
|
+
labelFontSize: T.value,
|
|
1041
|
+
showX: $.value,
|
|
1023
1042
|
xPosition: pe.value,
|
|
1024
1043
|
showXGrid: Fe.value,
|
|
1025
|
-
showXTick:
|
|
1026
|
-
xTickFontSize:
|
|
1044
|
+
showXTick: Ee.value,
|
|
1045
|
+
xTickFontSize: Te.value,
|
|
1027
1046
|
showY: We.value,
|
|
1028
|
-
yPosition:
|
|
1029
|
-
showYGrid:
|
|
1047
|
+
yPosition: ze.value,
|
|
1048
|
+
showYGrid: De.value,
|
|
1030
1049
|
showYTick: Ae.value,
|
|
1031
1050
|
yTickFontSize: He.value,
|
|
1032
1051
|
isTransposed: W.value.config.isTransposed,
|
|
@@ -1035,7 +1054,7 @@ const ua = /* @__PURE__ */ U({
|
|
|
1035
1054
|
usePointStyle: Be.value
|
|
1036
1055
|
};
|
|
1037
1056
|
}
|
|
1038
|
-
function
|
|
1057
|
+
function ut() {
|
|
1039
1058
|
return {
|
|
1040
1059
|
data: te.value,
|
|
1041
1060
|
filterText: fe.value,
|
|
@@ -1046,66 +1065,66 @@ const ua = /* @__PURE__ */ U({
|
|
|
1046
1065
|
}
|
|
1047
1066
|
const Ne = h(() => {
|
|
1048
1067
|
switch (W.value.type) {
|
|
1049
|
-
case
|
|
1068
|
+
case v.Table:
|
|
1069
|
+
return ut();
|
|
1070
|
+
case v.BarChart:
|
|
1071
|
+
case v.LineChart:
|
|
1072
|
+
case v.StackBarChart:
|
|
1073
|
+
case v.StackLineChart:
|
|
1074
|
+
case v.Circular:
|
|
1050
1075
|
return ct();
|
|
1051
|
-
case f.BarChart:
|
|
1052
|
-
case f.LineChart:
|
|
1053
|
-
case f.StackBarChart:
|
|
1054
|
-
case f.StackLineChart:
|
|
1055
|
-
case f.Circular:
|
|
1056
|
-
return it();
|
|
1057
1076
|
default:
|
|
1058
1077
|
return { data: te.value };
|
|
1059
1078
|
}
|
|
1060
1079
|
}), Ie = h(() => {
|
|
1061
|
-
const { config:
|
|
1062
|
-
if (
|
|
1063
|
-
const L = [...
|
|
1080
|
+
const { config: s } = o.value.widget;
|
|
1081
|
+
if (s.rollup != null) {
|
|
1082
|
+
const L = [...s.dimensions].filter((K) => !K.hide);
|
|
1064
1083
|
return L.sort(
|
|
1065
|
-
(K,
|
|
1084
|
+
(K, se) => (s.rowIds || []).indexOf(ye(K)) - (s.rowIds || []).indexOf(ye(se))
|
|
1066
1085
|
), [
|
|
1067
|
-
{ label: ae(
|
|
1068
|
-
{ label: ae(
|
|
1069
|
-
...[...L].slice(0, L.length - 1).map((K,
|
|
1070
|
-
label: ae(
|
|
1071
|
-
value:
|
|
1086
|
+
{ label: ae(n, i, "None", "other"), value: null },
|
|
1087
|
+
{ label: ae(n, i, "Grand Total", "other"), value: 0 },
|
|
1088
|
+
...[...L].slice(0, L.length - 1).map((K, se) => ({
|
|
1089
|
+
label: ae(n, i, K.label, "other"),
|
|
1090
|
+
value: se + 1
|
|
1072
1091
|
}))
|
|
1073
1092
|
];
|
|
1074
1093
|
}
|
|
1075
1094
|
return [];
|
|
1076
1095
|
}), J = h(() => {
|
|
1077
|
-
const { config:
|
|
1078
|
-
return
|
|
1079
|
-
label: ae(
|
|
1096
|
+
const { config: s } = W.value;
|
|
1097
|
+
return s.isDrillable ? s.dimensions.map((L) => ({
|
|
1098
|
+
label: ae(n, i, L.label, "other"),
|
|
1080
1099
|
value: ye(L)
|
|
1081
1100
|
})) : [];
|
|
1082
1101
|
});
|
|
1083
|
-
|
|
1084
|
-
() =>
|
|
1085
|
-
(
|
|
1086
|
-
|
|
1102
|
+
le(
|
|
1103
|
+
() => o.value.widget.config,
|
|
1104
|
+
(s) => {
|
|
1105
|
+
c.value = s.rollup, k.value = s.showTitle ?? !0, E.value = s.titleFontSize ?? 14, q.value = s.titleBold ?? !1, P.value = s.titleItalic ?? !1, X.value = s.titleUnderline ?? !1, p.value = s.chartHeight ?? void 0, l.value = s.chartWidth ?? void 0, S.value = s.showLabel ?? !1, b.value = s.labelAlign ?? Se.center, x.value = s.labelAnchor ?? Ce.center, R.value = s.labelRotation ?? 0, B.value = s.labelOffset ?? 0, T.value = s.labelFontSize ?? 12, $.value = s.showX ?? !0, pe.value = s.xPosition ?? _e.bottom, Fe.value = s.showXGrid ?? !1, Ee.value = s.showXTick ?? !0, Te.value = s.xTickFontSize ?? 12, We.value = s.showY ?? !0, ze.value = s.yPosition ?? xe.left, De.value = s.showYGrid ?? !1, Ae.value = s.showYTick ?? !0, He.value = s.yTickFontSize ?? 12, $e.value = s.showLegend ?? void 0, Pe.value = s.legendPosition ?? ke.top, Be.value = s.usePointStyle ?? !0, Me.value = s.rowHeight ?? 0, Ve.value = s.colWidths ?? [];
|
|
1087
1106
|
},
|
|
1088
1107
|
{ deep: !0 }
|
|
1089
|
-
),
|
|
1090
|
-
|
|
1091
|
-
}),
|
|
1108
|
+
), le([() => c.value], () => {
|
|
1109
|
+
c.value !== null && (o.value.widget.config.rollup = c.value);
|
|
1110
|
+
}), le(
|
|
1092
1111
|
[
|
|
1093
1112
|
() => W.value,
|
|
1094
|
-
() => ot.value,
|
|
1095
|
-
() => nt.value,
|
|
1096
1113
|
() => st.value,
|
|
1114
|
+
() => rt.value,
|
|
1115
|
+
() => nt.value,
|
|
1097
1116
|
() => ve.value,
|
|
1098
|
-
() =>
|
|
1117
|
+
() => it.value
|
|
1099
1118
|
],
|
|
1100
1119
|
() => {
|
|
1101
|
-
var
|
|
1102
|
-
ve.value && ((
|
|
1120
|
+
var s;
|
|
1121
|
+
ve.value && ((s = ve.value) == null ? void 0 : s.length) > 0 && Xe();
|
|
1103
1122
|
},
|
|
1104
1123
|
{
|
|
1105
1124
|
deep: !0
|
|
1106
1125
|
}
|
|
1107
|
-
),
|
|
1108
|
-
[() =>
|
|
1126
|
+
), le(
|
|
1127
|
+
[() => o.value.size],
|
|
1109
1128
|
() => {
|
|
1110
1129
|
ee();
|
|
1111
1130
|
},
|
|
@@ -1117,7 +1136,7 @@ const ua = /* @__PURE__ */ U({
|
|
|
1117
1136
|
});
|
|
1118
1137
|
const Oe = Pt();
|
|
1119
1138
|
let ue;
|
|
1120
|
-
const Xe =
|
|
1139
|
+
const Xe = Ke(async function() {
|
|
1121
1140
|
if (W.value.config.schemaNames.length <= 0 && !(W.value.config.dimensions.length <= 0 || W.value.config.metrics.length <= 0)) {
|
|
1122
1141
|
Oe.open({
|
|
1123
1142
|
message: "schema must not be empty and dimension or metrics must have at least 1 column",
|
|
@@ -1128,59 +1147,59 @@ const ua = /* @__PURE__ */ U({
|
|
|
1128
1147
|
try {
|
|
1129
1148
|
t.value = !0, ue && ue.abort(), ue = new AbortController();
|
|
1130
1149
|
const L = ue.signal;
|
|
1131
|
-
te.value = await
|
|
1150
|
+
te.value = await Dt(W.value, L), w.value = he(), t.value = !1;
|
|
1132
1151
|
} catch (L) {
|
|
1133
1152
|
te.value = null, L.code !== "ERR_CANCELED" && (Oe.open({ message: `Invalid chart ${W.value.type}`, type: "error" }), console.log(L), t.value = !1);
|
|
1134
1153
|
}
|
|
1135
1154
|
});
|
|
1136
|
-
function
|
|
1137
|
-
switch (
|
|
1155
|
+
function dt(s) {
|
|
1156
|
+
switch (o.value.widget.type) {
|
|
1138
1157
|
case "SPACER":
|
|
1139
1158
|
return;
|
|
1140
1159
|
case "SCORECARD":
|
|
1141
1160
|
return;
|
|
1142
1161
|
case "TABLE":
|
|
1143
|
-
return `${
|
|
1162
|
+
return `${o.value.size.height * 100 + (D.value ? 72 : 0) + 96.5}px`;
|
|
1144
1163
|
}
|
|
1145
|
-
return `${Math.max(
|
|
1146
|
-
}
|
|
1147
|
-
function dt() {
|
|
1148
|
-
const o = m.value - 1;
|
|
1149
|
-
o >= 0 && (C.value = J.value[o].value);
|
|
1164
|
+
return `${Math.max(s / o.value.size.width, 90) * o.value.size.height}px`;
|
|
1150
1165
|
}
|
|
1151
1166
|
function ht() {
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1167
|
+
const s = m.value - 1;
|
|
1168
|
+
s >= 0 && (C.value = J.value[s].value);
|
|
1154
1169
|
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
value
|
|
1170
|
+
function mt() {
|
|
1171
|
+
const s = m.value + 1;
|
|
1172
|
+
s >= 0 && s < J.value.length && (C.value = J.value[s].value);
|
|
1173
|
+
}
|
|
1174
|
+
const pt = Object.values(Tt).map((s) => ({
|
|
1175
|
+
label: Wt(s),
|
|
1176
|
+
value: s,
|
|
1158
1177
|
onClick: async () => {
|
|
1159
|
-
await
|
|
1178
|
+
await zt(s, d.index);
|
|
1160
1179
|
}
|
|
1161
|
-
})),
|
|
1162
|
-
return (
|
|
1163
|
-
const K = F("FmTooltip"),
|
|
1164
|
-
return
|
|
1180
|
+
})), ft = W.value.type === v.Spacer ? "flat" : "outlined", vt = W.value.type === v.Spacer ? "p-0" : "p-16";
|
|
1181
|
+
return (s, L) => {
|
|
1182
|
+
const K = F("FmTooltip"), se = F("FmSearch"), gt = F("FmCheckbox"), ge = F("FmButton"), yt = F("FmSelect"), wt = F("FmMenuItem"), bt = F("FmMenu"), Ct = F("FmForm"), St = F("FmCircularProgress"), _t = F("FmCard");
|
|
1183
|
+
return _(), M(_t, {
|
|
1165
1184
|
ref_key: "tileCard",
|
|
1166
1185
|
ref: u,
|
|
1167
|
-
class: me(`${
|
|
1168
|
-
variant: r(
|
|
1186
|
+
class: me(`${lt.value} ${r(vt)}`),
|
|
1187
|
+
variant: r(ft)
|
|
1169
1188
|
}, {
|
|
1170
1189
|
default: V(() => [
|
|
1171
|
-
t.value ? (
|
|
1190
|
+
t.value ? (_(), M(St, { key: 1 })) : (_(), z("div", {
|
|
1172
1191
|
key: 0,
|
|
1173
1192
|
style: Y({ height: qe.value })
|
|
1174
1193
|
}, [
|
|
1175
|
-
(
|
|
1194
|
+
(_(), M(Lt(ot.value), {
|
|
1176
1195
|
key: w.value,
|
|
1177
1196
|
modelValue: Ne.value,
|
|
1178
1197
|
"onUpdate:modelValue": L[3] || (L[3] = (de) => Ne.value = de)
|
|
1179
1198
|
}, {
|
|
1180
1199
|
menu: V(() => [
|
|
1181
|
-
H(
|
|
1200
|
+
H(Ct, { class: "flex items-center gap-2" }, {
|
|
1182
1201
|
default: V(() => {
|
|
1183
|
-
var de,
|
|
1202
|
+
var de, Ue, Ye, Ge;
|
|
1184
1203
|
return [
|
|
1185
1204
|
H(K, {
|
|
1186
1205
|
variant: "plain",
|
|
@@ -1190,58 +1209,58 @@ const ua = /* @__PURE__ */ U({
|
|
|
1190
1209
|
disabled: !W.value.description
|
|
1191
1210
|
}, {
|
|
1192
1211
|
default: V(() => [
|
|
1193
|
-
|
|
1212
|
+
k.value !== !1 ? (_(), z("p", {
|
|
1194
1213
|
key: 0,
|
|
1195
1214
|
style: Y({
|
|
1196
|
-
fontSize:
|
|
1215
|
+
fontSize: E.value + "px",
|
|
1197
1216
|
fontWeight: q.value ? "bold" : "normal",
|
|
1198
|
-
fontStyle:
|
|
1199
|
-
textDecoration:
|
|
1217
|
+
fontStyle: P.value ? "italic" : "normal",
|
|
1218
|
+
textDecoration: X.value ? "underline" : "none"
|
|
1200
1219
|
}),
|
|
1201
1220
|
class: me(["text-fm-color-typo-secondary line-clamp-1", [
|
|
1202
|
-
|
|
1221
|
+
E.value <= 18 ? "fm-typo-en-body-md-400" : "",
|
|
1203
1222
|
W.value.description ? "border-b-2 border-dashed border-gray-300" : ""
|
|
1204
1223
|
]])
|
|
1205
|
-
}, ne(r(ae)(r(
|
|
1224
|
+
}, ne(r(ae)(r(n), r(i), W.value.title, "other")), 7)) : Q("", !0)
|
|
1206
1225
|
]),
|
|
1207
1226
|
_: 1
|
|
1208
1227
|
}, 8, ["content", "disabled"]),
|
|
1209
|
-
(de = ce.value) != null && de.showSearchBar ? (
|
|
1228
|
+
(de = ce.value) != null && de.showSearchBar ? (_(), M(se, {
|
|
1210
1229
|
key: 0,
|
|
1211
1230
|
modelValue: fe.value,
|
|
1212
1231
|
"onUpdate:modelValue": L[0] || (L[0] = (I) => fe.value = I),
|
|
1213
1232
|
class: "grow"
|
|
1214
|
-
}, null, 8, ["modelValue"])) : (
|
|
1215
|
-
Ft(H(
|
|
1216
|
-
modelValue:
|
|
1217
|
-
"onUpdate:modelValue": L[1] || (L[1] = (I) =>
|
|
1233
|
+
}, null, 8, ["modelValue"])) : (_(), z("div", da)),
|
|
1234
|
+
Ft(H(gt, {
|
|
1235
|
+
modelValue: S.value,
|
|
1236
|
+
"onUpdate:modelValue": L[1] || (L[1] = (I) => S.value = I),
|
|
1218
1237
|
label: "Label",
|
|
1219
1238
|
value: !1
|
|
1220
1239
|
}, null, 8, ["modelValue"]), [
|
|
1221
|
-
[
|
|
1240
|
+
[Et, (Ue = ce.value) == null ? void 0 : Ue.showLabel]
|
|
1222
1241
|
]),
|
|
1223
|
-
(
|
|
1242
|
+
(Ye = ce.value) != null && Ye.showDrillDimension && J.value.length > 0 ? (_(), z("div", ha, [
|
|
1224
1243
|
H(ge, {
|
|
1225
1244
|
icon: "arrow_upward",
|
|
1226
1245
|
variant: "tertiary",
|
|
1227
|
-
disabled: !
|
|
1228
|
-
onClick:
|
|
1246
|
+
disabled: !g.value,
|
|
1247
|
+
onClick: ht
|
|
1229
1248
|
}, null, 8, ["disabled"]),
|
|
1230
1249
|
H(ge, {
|
|
1231
1250
|
icon: "arrow_downward",
|
|
1232
1251
|
variant: "tertiary",
|
|
1233
|
-
disabled: !
|
|
1234
|
-
onClick:
|
|
1252
|
+
disabled: !f.value,
|
|
1253
|
+
onClick: mt
|
|
1235
1254
|
}, null, 8, ["disabled"])
|
|
1236
1255
|
])) : Q("", !0),
|
|
1237
|
-
(Ge = ce.value) != null && Ge.showRollup && Ie.value.length > 0 ? (
|
|
1256
|
+
(Ge = ce.value) != null && Ge.showRollup && Ie.value.length > 0 ? (_(), M(yt, {
|
|
1238
1257
|
key: 3,
|
|
1239
|
-
modelValue:
|
|
1240
|
-
"onUpdate:modelValue": L[2] || (L[2] = (I) =>
|
|
1258
|
+
modelValue: c.value,
|
|
1259
|
+
"onUpdate:modelValue": L[2] || (L[2] = (I) => c.value = I),
|
|
1241
1260
|
class: "w-[150px]",
|
|
1242
1261
|
items: Ie.value
|
|
1243
1262
|
}, null, 8, ["modelValue", "items"])) : Q("", !0),
|
|
1244
|
-
d.hideExport ? Q("", !0) : (
|
|
1263
|
+
d.hideExport ? Q("", !0) : (_(), M(bt, {
|
|
1245
1264
|
key: 4,
|
|
1246
1265
|
shift: !0
|
|
1247
1266
|
}, {
|
|
@@ -1252,7 +1271,7 @@ const ua = /* @__PURE__ */ U({
|
|
|
1252
1271
|
})
|
|
1253
1272
|
]),
|
|
1254
1273
|
default: V(() => [
|
|
1255
|
-
(
|
|
1274
|
+
(_(!0), z(U, null, et(r(pt), (I) => (_(), M(wt, {
|
|
1256
1275
|
key: I.value,
|
|
1257
1276
|
label: I.label,
|
|
1258
1277
|
onClick: I.onClick
|