@feedmepos/mf-report 5.11.2 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/dist/{App-D2LkbbiZ.js → App-DwuW8zUX.js} +3 -3
  2. package/dist/{Default.vue_vue_type_script_setup_true_lang-K4iokW6j.js → Default.vue_vue_type_script_setup_true_lang-DwqjvaFk.js} +1 -1
  3. package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-YLYE8W5f.js → DynamicWidget.vue_vue_type_script_setup_true_lang-EBVDgb_-.js} +1 -1
  4. package/dist/{InsightView-DTcknJtZ.js → InsightView-B-ucnMqx.js} +2 -2
  5. package/dist/{Layout-lndubAWv.js → Layout-Dd8UMqWh.js} +1 -1
  6. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-CDOVhCDV.js → MenuTab.vue_vue_type_script_setup_true_lang-DKoZ_qKe.js} +2 -2
  7. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-6zh1MvyE.js → NavigationTab.vue_vue_type_script_setup_true_lang-BkZmOyj6.js} +560 -556
  8. package/dist/{OverviewView-DypcGSm2.js → OverviewView-fZ064EjC.js} +4 -4
  9. package/dist/{Report-KZtIua_Z.js → Report-BCQvcNyE.js} +2 -2
  10. package/dist/{ReportEditor-z2DUlGRW.js → ReportEditor-NAPs19Fu.js} +3 -3
  11. package/dist/{ReportView-D4c6Ufy1.js → ReportView-DbD_wg7H.js} +5 -5
  12. package/dist/{Setting-BqDiKKaX.js → Setting-CZNRgVs2.js} +2 -2
  13. package/dist/TileEditor-C6Xs--mw.js +3252 -0
  14. package/dist/{TransitionFade-D-GlYElq.js → TransitionFade-BFqs60q_.js} +2 -2
  15. package/dist/app.js +32 -16
  16. package/dist/assets/formatChartData.worker-qsKmK9pO.js +4 -0
  17. package/dist/{v4-D1ICEWtF.js → v4-YwtleMoY.js} +1122 -1109
  18. package/package.json +1 -1
  19. package/dist/TileEditor-BUYcVXey.js +0 -3221
  20. package/dist/assets/formatChartData.worker-Bp7azaza.js +0 -4
@@ -1,3221 +0,0 @@
1
- import { defineComponent as W, mergeModels as J, useModel as Z, computed as T, ref as H, resolveComponent as w, createElementBlock as M, openBlock as V, createVNode as d, createElementVNode as k, unref as t, withCtx as I, toDisplayString as j, Fragment as Q, renderList as ce, withModifiers as ae, createTextVNode as fe, watch as ie, createCommentVNode as O, createBlock as $, onMounted as Ue, onUnmounted as Ye, renderSlot as Be, onBeforeUnmount as Ee, resolveDynamicComponent as Le, normalizeClass as Me, withDirectives as ue, vShow as re, normalizeStyle as Je, isRef as Ge } from "vue";
2
- import { useRoute as Ke, useRouter as Qe } from "vue-router";
3
- import { h as Ze, d as xe, S as Se, W as el, a as ll, T as ol, _ as tl } from "./TransitionFade-D-GlYElq.js";
4
- import { W as P, b as je, D as be, c as te, C as ne, S as Oe, a as al } from "./v4-D1ICEWtF.js";
5
- import { storeToRefs as ve } from "pinia";
6
- import { u as Re } from "./message-dialog-UoMWOnil.js";
7
- import { u as G, d as me, i as $e, p as nl, b as il } from "./vue-i18n-B1WI_h8l.js";
8
- import { useSnackbar as ze, useBreakpoints as Pe, FmButtonColorThemeVariant as he } from "@feedmepos/ui-library";
9
- import { _ as ge } from "./BaseDialog.vue_vue_type_script_setup_true_lang-DTNiGKgd.js";
10
- import { _ as K } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CJBY5CtV.js";
11
- import { r as le } from "./i18n-Cif1I9J2.js";
12
- import { g as Ve, u as Fe, L as de, a as Ce, _ as Ae } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-YLYE8W5f.js";
13
- import { a as ye } from "./helper-DgCafQmS.js";
14
- import { _ as qe } from "./NoData.vue_vue_type_script_setup_true_lang-Gln3UbEF.js";
15
- const ke = [
16
- {
17
- type: P.Circular,
18
- maxDimension: null,
19
- maxMetric: 1,
20
- hasBreakdownDimension: !1,
21
- canTranspose: !1,
22
- isDrillConfigurable: !1,
23
- hasChart: !0,
24
- hasTable: !1,
25
- hasLabel: !0,
26
- hasLegend: !0,
27
- hasXy: !1,
28
- canRollup: !1,
29
- showRollupPosition: !1,
30
- canSearch: !1
31
- },
32
- {
33
- type: P.Table,
34
- maxDimension: null,
35
- maxMetric: null,
36
- hasBreakdownDimension: !1,
37
- canTranspose: !1,
38
- isDrillConfigurable: !0,
39
- hasChart: !1,
40
- hasTable: !0,
41
- hasLabel: !1,
42
- hasLegend: !1,
43
- hasXy: !1,
44
- canRollup: !0,
45
- showRollupPosition: !0,
46
- canSearch: !0
47
- },
48
- {
49
- type: P.BarChart,
50
- maxDimension: null,
51
- maxMetric: 1,
52
- hasBreakdownDimension: !0,
53
- canTranspose: !0,
54
- isDrillConfigurable: !1,
55
- hasChart: !0,
56
- hasTable: !1,
57
- hasLabel: !0,
58
- hasLegend: !0,
59
- hasXy: !0,
60
- canRollup: !1,
61
- showRollupPosition: !1,
62
- canSearch: !1
63
- },
64
- {
65
- type: P.LineChart,
66
- maxDimension: null,
67
- maxMetric: 1,
68
- hasBreakdownDimension: !0,
69
- canTranspose: !0,
70
- isDrillConfigurable: !1,
71
- hasChart: !0,
72
- hasTable: !1,
73
- hasLabel: !0,
74
- hasLegend: !0,
75
- hasXy: !0,
76
- canRollup: !1,
77
- showRollupPosition: !1,
78
- canSearch: !1
79
- },
80
- {
81
- type: P.StackBarChart,
82
- maxDimension: null,
83
- maxMetric: 1,
84
- hasBreakdownDimension: !0,
85
- canTranspose: !0,
86
- isDrillConfigurable: !1,
87
- hasChart: !0,
88
- hasTable: !1,
89
- hasLabel: !0,
90
- hasLegend: !0,
91
- hasXy: !0,
92
- canRollup: !1,
93
- showRollupPosition: !1,
94
- canSearch: !1
95
- },
96
- {
97
- type: P.StackLineChart,
98
- maxDimension: null,
99
- maxMetric: 1,
100
- hasBreakdownDimension: !0,
101
- canTranspose: !0,
102
- isDrillConfigurable: !1,
103
- hasChart: !0,
104
- hasTable: !1,
105
- hasLabel: !0,
106
- hasLegend: !0,
107
- hasXy: !0,
108
- canRollup: !1,
109
- showRollupPosition: !1,
110
- canSearch: !1
111
- },
112
- {
113
- type: P.Scorecard,
114
- maxDimension: null,
115
- maxMetric: 1,
116
- hasBreakdownDimension: !1,
117
- canTranspose: !1,
118
- isDrillConfigurable: !1,
119
- hasChart: !1,
120
- hasTable: !1,
121
- hasLabel: !1,
122
- hasLegend: !1,
123
- hasXy: !1,
124
- canRollup: !1,
125
- showRollupPosition: !1,
126
- canSearch: !1
127
- },
128
- {
129
- type: P.Spacer,
130
- maxDimension: 0,
131
- maxMetric: 0,
132
- hasBreakdownDimension: !1,
133
- canTranspose: !1,
134
- isDrillConfigurable: !1,
135
- hasChart: !1,
136
- hasTable: !1,
137
- hasLabel: !1,
138
- hasLegend: !1,
139
- hasXy: !1,
140
- canRollup: !1,
141
- showRollupPosition: !1,
142
- canSearch: !1
143
- }
144
- ], sl = { class: "flex flex-col my-2 gap-8" }, ul = { class: "fm-typo-en-body-lg-600" }, rl = { class: "text-sm text-fm-color-neutral-gray-400" }, dl = ["onClick"], ml = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, cl = /* @__PURE__ */ W({
145
- __name: "SchemaSection",
146
- props: /* @__PURE__ */ J({
147
- options: {
148
- type: Array,
149
- default: () => []
150
- },
151
- label: {
152
- type: String,
153
- default: "Schema"
154
- }
155
- }, {
156
- modelValue: { required: !0 },
157
- modelModifiers: {}
158
- }),
159
- emits: ["update:modelValue"],
160
- setup(F) {
161
- const { t: u, te: e } = G(), i = Z(F, "modelValue"), a = F, { schemas: v } = ve(je()), p = T(
162
- () => v.value.map((f) => ({
163
- label: f.label,
164
- value: f.name,
165
- raw: f
166
- }))
167
- ), C = T(() => {
168
- if (i.value.schemaNames.length === 0 || l.value === 0)
169
- return p.value.filter((f) => !f.raw.isJoinOnly);
170
- {
171
- const f = i.value.schemaNames[0], h = v.value.find((s) => s.name === f), r = ((h == null ? void 0 : h.joins) || []).map((s) => s);
172
- return p.value.filter((s) => r.includes(s.raw.name));
173
- }
174
- }), m = H(!1), n = H(""), l = H(), g = ze();
175
- function S(f) {
176
- var h;
177
- return le(
178
- u,
179
- e,
180
- (h = v.value.find((r) => r.name === f)) == null ? void 0 : h.label,
181
- "schema"
182
- );
183
- }
184
- function U(f) {
185
- l.value = f, m.value = !0, f !== void 0 ? n.value = i.value.schemaNames[f] : n.value = "";
186
- }
187
- function L() {
188
- n.value !== "" ? (l.value !== void 0 ? i.value.schemaNames[l.value] = n.value : i.value.schemaNames.push(n.value), m.value = !1) : g.open({ message: u("report.section.schema.nothingSelected"), type: "error" });
189
- }
190
- return (f, h) => {
191
- const r = w("FmForm"), s = w("FmIcon"), y = w("FmField");
192
- return V(), M("div", sl, [
193
- d(ge, {
194
- modelValue: m.value,
195
- "onUpdate:modelValue": h[1] || (h[1] = (o) => m.value = o),
196
- title: a.label,
197
- "primary-button-label": t(u)("report.common.confirm"),
198
- "secondary-button-label": t(u)("report.common.cancel"),
199
- onConfirm: L
200
- }, {
201
- content: I(() => [
202
- d(r, { ref: "form" }, {
203
- default: I(() => [
204
- d(K, {
205
- modelValue: n.value,
206
- "onUpdate:modelValue": h[0] || (h[0] = (o) => n.value = o),
207
- label: t(u)("report.section.schema.title"),
208
- items: l.value === 0 ? p.value.map((o) => ({
209
- label: t(le)(t(u), t(e), o.label, "schema"),
210
- value: o.value
211
- })) : C.value.map((o) => ({
212
- label: t(le)(t(u), t(e), o.label, "schema"),
213
- value: o.value
214
- }))
215
- }, null, 8, ["modelValue", "label", "items"])
216
- ]),
217
- _: 1
218
- }, 512)
219
- ]),
220
- _: 1
221
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
222
- k("div", null, [
223
- k("p", ul, j(t(u)("report.section.schema.title")), 1),
224
- k("p", rl, j(t(u)("report.section.schema.description")), 1)
225
- ]),
226
- (V(!0), M(Q, null, ce(i.value.schemaNames, (o, c) => (V(), M("div", {
227
- key: c,
228
- class: "flex flex-col gap-2 w-full"
229
- }, [
230
- k("div", {
231
- class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
232
- onClick: (b) => U(c)
233
- }, [
234
- k("p", ml, j(S(o)), 1),
235
- h[3] || (h[3] = k("div", { class: "grow" }, null, -1)),
236
- d(s, {
237
- name: "close",
238
- onClick: ae(
239
- () => {
240
- i.value.schemaNames = t(Ze)(i.value.schemaNames, c);
241
- },
242
- ["stop"]
243
- )
244
- }, null, 8, ["onClick"])
245
- ], 8, dl)
246
- ]))), 128)),
247
- d(y, {
248
- class: "text-fm-color-typo-tertiary",
249
- onClick: h[2] || (h[2] = () => {
250
- U();
251
- })
252
- }, {
253
- default: I(() => [
254
- fe(j(t(u)("report.section.schema.add")), 1)
255
- ]),
256
- _: 1
257
- })
258
- ]);
259
- };
260
- }
261
- }), pl = {
262
- key: 0,
263
- class: "flex flex-col my-2 gap-8"
264
- }, vl = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, fl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, gl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, _e = /* @__PURE__ */ W({
265
- __name: "DimensionSection",
266
- props: /* @__PURE__ */ J({
267
- options: {
268
- type: Array,
269
- default: () => []
270
- },
271
- label: {
272
- type: String,
273
- default: "Dimension"
274
- },
275
- max: {
276
- type: Number,
277
- default: void 0
278
- },
279
- config: {
280
- type: Object,
281
- default: () => {
282
- }
283
- },
284
- hasRowColumn: {
285
- type: Boolean,
286
- default: !1
287
- }
288
- }, {
289
- modelValue: {
290
- required: !1,
291
- default: []
292
- },
293
- modelModifiers: {}
294
- }),
295
- emits: ["update:modelValue"],
296
- setup(F) {
297
- const { t: u, te: e } = G(), i = Z(F, "modelValue"), a = F, v = H(!1), p = T(
298
- () => i.value.map((y, o) => ({
299
- index: o,
300
- labels: [y.label || y.name],
301
- value: y
302
- }))
303
- ), C = H(i.value.length > 0 ? 0 : void 0);
304
- function m(y) {
305
- var o, c, b;
306
- v.value = !0, n.value = y != null && y.value ? JSON.parse(
307
- JSON.stringify({
308
- ...y.value,
309
- label: le(u, e, (o = y.value) == null ? void 0 : o.label, "other")
310
- })
311
- ) : void 0, C.value = y == null ? void 0 : y.index, l.value = !!((c = n.value) != null && c.dataFormula || (b = n.value) != null && b.displayFormula);
312
- }
313
- const n = H(void 0), l = H(!1), g = T(
314
- () => a.options.find(
315
- (y) => {
316
- var o, c;
317
- return y.schemaName === ((o = n.value) == null ? void 0 : o.schemaName) && y.name === ((c = n.value) == null ? void 0 : c.name);
318
- }
319
- ) ?? {}
320
- );
321
- ie(
322
- () => {
323
- var y;
324
- return (y = n.value) == null ? void 0 : y.option;
325
- },
326
- () => {
327
- !S.value && n.value && (n.value.fillGap = !1);
328
- }
329
- );
330
- const S = T(
331
- () => {
332
- var y, o, c;
333
- return (c = (y = g.value) == null ? void 0 : y.fillGapDimensionOptions) == null ? void 0 : c.includes(((o = n.value) == null ? void 0 : o.option) || "");
334
- }
335
- );
336
- function U(y) {
337
- var o, c;
338
- (y.schemaName !== ((o = n.value) == null ? void 0 : o.schemaName) || y.name !== ((c = n.value) == null ? void 0 : c.name)) && (n.value = {
339
- schemaName: y.schemaName,
340
- name: y.name,
341
- option: y.dimensionOptions[0],
342
- label: le(u, e, y.label, "other"),
343
- decimal: y.isNumericType ? 2 : void 0,
344
- hide: !1
345
- }, l.value = !1);
346
- }
347
- function L() {
348
- if (!n.value) {
349
- console.error("new field is undefined");
350
- return;
351
- }
352
- const y = [...p.value.map((o) => o.value)];
353
- C.value !== void 0 ? y[C.value] = n.value : y.push(n.value), i.value = y, v.value = !1;
354
- }
355
- function f(y) {
356
- const c = [...p.value.map((b) => b.value)].filter((b, R) => R !== y);
357
- i.value = c;
358
- }
359
- function h(y) {
360
- n.value && (n.value.decimal = Number(y));
361
- }
362
- const r = T(
363
- () => a.options.map((y) => ({
364
- label: y.labels.join(" "),
365
- value: y
366
- }))
367
- ), s = T(
368
- () => a.label ? a.label : u(`report.section.dimension.${a.label}`)
369
- );
370
- return (y, o) => {
371
- const c = w("FmTextField"), b = w("FmStepperField"), R = w("FmCheckbox"), x = w("FmTextarea"), _ = w("FmForm"), N = w("FmIcon"), q = w("FmButton"), X = w("FmListItem"), ee = w("FmList"), D = w("FmField");
372
- return F.max !== 0 ? (V(), M("div", pl, [
373
- d(ge, {
374
- modelValue: v.value,
375
- "onUpdate:modelValue": o[12] || (o[12] = (A) => v.value = A),
376
- title: s.value,
377
- "primary-button-label": t(u)("report.common.confirm"),
378
- "secondary-button-label": t(u)("report.common.cancel"),
379
- onConfirm: L
380
- }, {
381
- content: I(() => [
382
- d(_, {
383
- ref: "form",
384
- class: "flex flex-col gap-2 w-[490px]"
385
- }, {
386
- default: I(() => {
387
- var A, Y, oe, E, z, se;
388
- return [
389
- d(K, {
390
- "model-value": g.value,
391
- items: r.value,
392
- placeholder: s.value,
393
- label: s.value,
394
- "onUpdate:modelValue": o[0] || (o[0] = (B) => U(B))
395
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
396
- n.value ? (V(), M(Q, { key: 0 }, [
397
- d(c, {
398
- modelValue: n.value.label,
399
- "onUpdate:modelValue": o[1] || (o[1] = (B) => n.value.label = B),
400
- label: t(u)("report.section.dimension.label")
401
- }, null, 8, ["modelValue", "label"]),
402
- (((A = g.value) == null ? void 0 : A.dimensionOptions) || []).length > 0 ? (V(), $(K, {
403
- key: 0,
404
- modelValue: n.value.option,
405
- "onUpdate:modelValue": o[2] || (o[2] = (B) => n.value.option = B),
406
- items: ((Y = g.value) == null ? void 0 : Y.dimensionOptions.map((B) => ({
407
- label: t(le)(t(u), t(e), B, "field"),
408
- value: B
409
- }))) ?? []
410
- }, null, 8, ["modelValue", "items"])) : O("", !0),
411
- (oe = g.value) != null && oe.isNumericType ? (V(), $(b, {
412
- key: 1,
413
- label: t(u)("report.common.decimal"),
414
- "model-value": ((E = n.value) == null ? void 0 : E.decimal) ?? 2,
415
- "onUpdate:modelValue": o[3] || (o[3] = (B) => {
416
- h(B);
417
- })
418
- }, null, 8, ["label", "model-value"])) : O("", !0),
419
- (z = g.value) != null && z.isNumericType ? (V(), $(K, {
420
- key: 2,
421
- modelValue: n.value.timeFormatter,
422
- "onUpdate:modelValue": o[4] || (o[4] = (B) => n.value.timeFormatter = B),
423
- placeholder: t(u)("report.section.dimension.timeFormatter"),
424
- label: t(u)("report.section.dimension.timeFormatter"),
425
- items: g.value.timeFormatters.map((B) => ({ label: B, value: B }))
426
- }, null, 8, ["modelValue", "placeholder", "label", "items"])) : O("", !0),
427
- S.value ? (V(), $(R, {
428
- key: 3,
429
- "model-value": n.value.fillGap ?? !1,
430
- label: t(u)("report.section.dimension.fillGap"),
431
- value: "",
432
- placeholder: "Fill gap",
433
- "onUpdate:modelValue": o[5] || (o[5] = (B) => {
434
- n.value && (n.value.fillGap = B);
435
- })
436
- }, null, 8, ["model-value", "label"])) : O("", !0),
437
- ((se = g.value) == null ? void 0 : se.type) === t(be).Timestamp ? (V(), $(R, {
438
- key: 4,
439
- "model-value": n.value.dateComparison ?? !1,
440
- label: t(u)("report.section.dimension.dateComparison"),
441
- value: "",
442
- "onUpdate:modelValue": o[6] || (o[6] = (B) => {
443
- n.value && (n.value.dateComparison = B);
444
- })
445
- }, null, 8, ["model-value", "label"])) : O("", !0),
446
- d(R, {
447
- modelValue: n.value.hide,
448
- "onUpdate:modelValue": o[7] || (o[7] = (B) => n.value.hide = B),
449
- label: t(u)("report.section.dimension.hide"),
450
- value: ""
451
- }, null, 8, ["modelValue", "label"]),
452
- a.hasRowColumn ? (V(), $(R, {
453
- key: 5,
454
- modelValue: n.value.moveToColumn,
455
- "onUpdate:modelValue": o[8] || (o[8] = (B) => n.value.moveToColumn = B),
456
- label: t(u)("report.section.dimension.moveToColumn"),
457
- value: ""
458
- }, null, 8, ["modelValue", "label"])) : O("", !0),
459
- d(R, {
460
- modelValue: l.value,
461
- "onUpdate:modelValue": o[9] || (o[9] = (B) => l.value = B),
462
- label: t(u)("report.section.dimension.advance"),
463
- value: !0
464
- }, null, 8, ["modelValue", "label"]),
465
- l.value ? (V(), $(x, {
466
- key: 6,
467
- modelValue: n.value.dataFormula,
468
- "onUpdate:modelValue": o[10] || (o[10] = (B) => n.value.dataFormula = B),
469
- placeholder: t(u)("report.section.dimension.dataFormula")
470
- }, null, 8, ["modelValue", "placeholder"])) : O("", !0),
471
- l.value ? (V(), $(x, {
472
- key: 7,
473
- modelValue: n.value.displayFormula,
474
- "onUpdate:modelValue": o[11] || (o[11] = (B) => n.value.displayFormula = B),
475
- placeholder: t(u)("report.section.dimension.displayFormula")
476
- }, null, 8, ["modelValue", "placeholder"])) : O("", !0)
477
- ], 64)) : O("", !0)
478
- ];
479
- }),
480
- _: 1
481
- }, 512)
482
- ]),
483
- _: 1
484
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
485
- k("div", null, [
486
- k("p", vl, j(s.value), 1),
487
- k("p", fl, j(t(u)("report.section.dimension.description")), 1)
488
- ]),
489
- d(ee, null, {
490
- default: I(() => [
491
- d(t(xe), {
492
- list: i.value,
493
- "item-key": "id",
494
- class: "flex flex-col gap-2"
495
- }, {
496
- item: I(({ element: A, index: Y }) => [
497
- d(X, {
498
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
499
- onClick: ae((oe) => m(p.value[Y]), ["stop"])
500
- }, {
501
- default: I(() => [
502
- d(N, { name: "drag_handle" }),
503
- k("p", gl, j(t(le)(t(u), t(e), A.label, "other")), 1),
504
- o[14] || (o[14] = k("div", { class: "grow" }, null, -1)),
505
- d(q, {
506
- icon: "close",
507
- size: "md",
508
- variant: "tertiary",
509
- onClick: ae((oe) => f(Y), ["stop"])
510
- }, null, 8, ["onClick"])
511
- ]),
512
- _: 2
513
- }, 1032, ["onClick"])
514
- ]),
515
- _: 1
516
- }, 8, ["list"])
517
- ]),
518
- _: 1
519
- }),
520
- d(D, {
521
- class: "text-fm-color-typo-tertiary",
522
- onClick: o[13] || (o[13] = () => {
523
- m();
524
- })
525
- }, {
526
- default: I(() => [
527
- fe(j(t(u)("report.section.dimension.add")), 1)
528
- ]),
529
- _: 1
530
- })
531
- ])) : O("", !0);
532
- };
533
- }
534
- }), Te = {
535
- value: "_metric_name"
536
- };
537
- function bl(F, u, e) {
538
- switch (F) {
539
- case P.BarChart:
540
- case P.StackBarChart:
541
- case P.LineChart:
542
- case P.StackLineChart:
543
- case P.Circular:
544
- return u.length > 1;
545
- default:
546
- return e;
547
- }
548
- }
549
- function yl(F) {
550
- var i;
551
- const { rowIds: u, columnIds: e } = we(F.widget.config);
552
- return {
553
- ...F,
554
- widget: {
555
- ...F.widget,
556
- config: {
557
- ...F.widget.config,
558
- rowIds: u,
559
- columnIds: e,
560
- isDrillable: bl(
561
- F.widget.type,
562
- F.widget.config.dimensions,
563
- F.widget.config.isDrillable
564
- ),
565
- joinDatasources: (i = F.widget.config.joinDatasources) == null ? void 0 : i.map((a) => {
566
- const { rowIds: v, columnIds: p } = we(a);
567
- return {
568
- ...a,
569
- rowIds: v,
570
- columnIds: p
571
- };
572
- })
573
- }
574
- }
575
- };
576
- }
577
- function we(F) {
578
- const u = F.dimensions.filter((p) => p.hide !== !0 && !p.moveToColumn).map((p) => Ve(p)), e = F.dimensions.filter((p) => p.hide !== !0 && p.moveToColumn == !0).map((p) => Ve(p)), i = F.metrics.length > 0;
579
- i && F.metrics.find((p) => p.moveToRow == !0) ? u.push(Te.value) : i && e.push(Te.value);
580
- const a = [], v = [];
581
- for (const p of u)
582
- a.push(p);
583
- for (const p of e)
584
- v.push(p);
585
- return {
586
- rowIds: a,
587
- columnIds: v
588
- };
589
- }
590
- const hl = { class: "flex flex-col my-2 gap-8" }, Vl = { class: "fm-typo-en-body-lg-600" }, Fl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, wl = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, xl = /* @__PURE__ */ W({
591
- __name: "MetricSection",
592
- props: /* @__PURE__ */ J({
593
- options: {
594
- type: Array,
595
- default: () => []
596
- },
597
- label: {
598
- type: String,
599
- default: "Metric"
600
- },
601
- max: {
602
- type: Number,
603
- default: void 0
604
- },
605
- config: {
606
- type: Object,
607
- default: () => {
608
- }
609
- },
610
- hasRowColumn: {
611
- type: Boolean,
612
- default: !1
613
- }
614
- }, {
615
- modelValue: { required: !1, default: [] },
616
- modelModifiers: {}
617
- }),
618
- emits: /* @__PURE__ */ J(["config"], ["update:modelValue"]),
619
- setup(F, { emit: u }) {
620
- const { t: e, te: i } = G(), a = Z(F, "modelValue"), v = F;
621
- T(() => !!v.max && a.value.length === v.max);
622
- const p = H(!1), C = T(
623
- () => a.value.map((o, c) => ({
624
- index: c,
625
- labels: [o.label || o.name],
626
- value: o
627
- }))
628
- ), m = H(a.value.length > 0 ? 0 : void 0);
629
- function n(o) {
630
- var c, b, R;
631
- p.value = !0, l.value = o != null && o.value ? JSON.parse(
632
- JSON.stringify({
633
- ...o.value,
634
- label: le(e, i, o.value.label, "other")
635
- })
636
- ) : void 0, m.value = o == null ? void 0 : o.index, g.value = !!((c = l.value) != null && c.dataFormula || (b = l.value) != null && b.displayFormula), ((R = v.config.rowIds) == null ? void 0 : R.findIndex((x) => x === Te.value)) !== -1 && l.value && (l.value.moveToRow = !0);
637
- }
638
- const l = H(void 0), g = H(!1), S = T(
639
- () => v.options.find(
640
- (o) => {
641
- var c, b;
642
- return o.schemaName === ((c = l.value) == null ? void 0 : c.schemaName) && o.name === ((b = l.value) == null ? void 0 : b.name);
643
- }
644
- ) ?? {}
645
- );
646
- function U(o, c) {
647
- var b;
648
- return (o == null ? void 0 : o.isNumericType) || ((b = o == null ? void 0 : o.isNumericAggregations) == null ? void 0 : b.includes(c || ""));
649
- }
650
- const L = T(
651
- () => {
652
- var o;
653
- return U(S.value, (o = l.value) == null ? void 0 : o.aggregation);
654
- }
655
- );
656
- ie(L, (o) => {
657
- l.value && (o ? l.value.decimal = typeof l.value.decimal != "number" ? 2 : l.value.decimal : l.value.decimal = void 0);
658
- });
659
- function f(o) {
660
- var c, b;
661
- (o.schemaName !== ((c = l.value) == null ? void 0 : c.schemaName) || o.name !== ((b = l.value) == null ? void 0 : b.name)) && (l.value = {
662
- schemaName: o.schemaName,
663
- name: o.name,
664
- aggregation: o.aggregations[0],
665
- label: le(e, i, o.label, "other"),
666
- decimal: U(o, o.aggregations[0]) ? 2 : void 0,
667
- moveToRow: !1,
668
- hide: !1
669
- }, g.value = !1);
670
- }
671
- function h() {
672
- const o = [...C.value.map((c) => c.value)];
673
- l.value && (m.value !== void 0 ? o[m.value] = l.value : o.push(l.value)), a.value = o, p.value = !1;
674
- }
675
- function r(o) {
676
- const c = [...C.value.map((b) => b.value)];
677
- c.splice(o, 1), a.value = c;
678
- }
679
- const s = T(
680
- () => v.options.map((o) => ({
681
- label: o.labels.join(" "),
682
- value: o
683
- }))
684
- ), y = T(
685
- () => v.label ? v.label : e(`report.section.metric.${v.label}`)
686
- );
687
- return (o, c) => {
688
- const b = w("FmTextField"), R = w("FmStepperField"), x = w("FmCheckbox"), _ = w("FmTextarea"), N = w("FmForm"), q = w("FmIcon"), X = w("FmButton"), ee = w("FmListItem"), D = w("FmList"), A = w("FmField");
689
- return V(), M("div", hl, [
690
- d(ge, {
691
- modelValue: p.value,
692
- "onUpdate:modelValue": c[10] || (c[10] = (Y) => p.value = Y),
693
- title: y.value,
694
- onConfirm: h
695
- }, {
696
- content: I(() => [
697
- d(N, {
698
- ref: "form",
699
- class: "flex flex-col gap-2 w-[490px]"
700
- }, {
701
- default: I(() => {
702
- var Y, oe, E;
703
- return [
704
- d(K, {
705
- "model-value": S.value,
706
- items: s.value,
707
- placeholder: y.value,
708
- label: y.value,
709
- "onUpdate:modelValue": c[0] || (c[0] = (z) => f(z))
710
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
711
- l.value ? (V(), M(Q, { key: 0 }, [
712
- d(b, {
713
- modelValue: l.value.label,
714
- "onUpdate:modelValue": c[1] || (c[1] = (z) => l.value.label = z),
715
- label: t(e)("report.section.metric.label")
716
- }, null, 8, ["modelValue", "label"]),
717
- (((Y = S.value) == null ? void 0 : Y.aggregations) || []).length > 0 ? (V(), $(K, {
718
- key: 0,
719
- modelValue: l.value.aggregation,
720
- "onUpdate:modelValue": c[2] || (c[2] = (z) => l.value.aggregation = z),
721
- label: t(e)("report.section.metric.aggregation"),
722
- items: ((oe = S.value) == null ? void 0 : oe.aggregations.map((z) => ({
723
- label: t(le)(t(e), t(i), z, "field"),
724
- value: z
725
- }))) ?? []
726
- }, null, 8, ["modelValue", "label", "items"])) : O("", !0),
727
- L.value ? (V(), $(R, {
728
- key: 1,
729
- label: t(e)("report.common.decimal"),
730
- "model-value": ((E = l.value) == null ? void 0 : E.decimal) ?? 2,
731
- "onUpdate:modelValue": c[3] || (c[3] = (z) => {
732
- l.value && (l.value.decimal = z);
733
- })
734
- }, null, 8, ["label", "model-value"])) : O("", !0),
735
- L.value ? (V(), $(K, {
736
- key: 2,
737
- modelValue: l.value.timeFormatter,
738
- "onUpdate:modelValue": c[4] || (c[4] = (z) => l.value.timeFormatter = z),
739
- placeholder: t(e)("report.section.metric.timeFormatter"),
740
- label: t(e)("report.section.metric.timeFormatter"),
741
- items: S.value.timeFormatters.map((z) => ({ label: z, value: z }))
742
- }, null, 8, ["modelValue", "placeholder", "label", "items"])) : O("", !0),
743
- d(x, {
744
- modelValue: l.value.hide,
745
- "onUpdate:modelValue": c[5] || (c[5] = (z) => l.value.hide = z),
746
- label: t(e)("report.section.metric.hide"),
747
- value: ""
748
- }, null, 8, ["modelValue", "label"]),
749
- v.hasRowColumn ? (V(), $(x, {
750
- key: 3,
751
- modelValue: l.value.moveToRow,
752
- "onUpdate:modelValue": c[6] || (c[6] = (z) => l.value.moveToRow = z),
753
- label: t(e)("report.section.metric.moveToRow"),
754
- value: ""
755
- }, null, 8, ["modelValue", "label"])) : O("", !0),
756
- d(x, {
757
- modelValue: g.value,
758
- "onUpdate:modelValue": c[7] || (c[7] = (z) => g.value = z),
759
- label: t(e)("report.section.metric.advance"),
760
- value: !0
761
- }, null, 8, ["modelValue", "label"]),
762
- g.value ? (V(), $(_, {
763
- key: 4,
764
- modelValue: l.value.dataFormula,
765
- "onUpdate:modelValue": c[8] || (c[8] = (z) => l.value.dataFormula = z),
766
- placeholder: t(e)("report.section.metric.dataFormula")
767
- }, null, 8, ["modelValue", "placeholder"])) : O("", !0),
768
- g.value ? (V(), $(_, {
769
- key: 5,
770
- modelValue: l.value.displayFormula,
771
- "onUpdate:modelValue": c[9] || (c[9] = (z) => l.value.displayFormula = z),
772
- placeholder: t(e)("report.section.metric.displayFormula")
773
- }, null, 8, ["modelValue", "placeholder"])) : O("", !0)
774
- ], 64)) : O("", !0)
775
- ];
776
- }),
777
- _: 1
778
- }, 512)
779
- ]),
780
- _: 1
781
- }, 8, ["modelValue", "title"]),
782
- k("div", null, [
783
- k("p", Vl, j(y.value), 1),
784
- k("p", Fl, j(t(e)("report.section.metric.description")), 1)
785
- ]),
786
- d(D, null, {
787
- default: I(() => [
788
- d(t(xe), {
789
- list: a.value,
790
- "item-key": "id",
791
- class: "flex flex-col gap-2 w-full"
792
- }, {
793
- item: I(({ element: Y, index: oe }) => [
794
- d(ee, {
795
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
796
- onClick: ae((E) => n(C.value[oe]), ["stop"])
797
- }, {
798
- default: I(() => [
799
- d(q, { name: "drag_handle" }),
800
- k("p", wl, j(t(le)(t(e), t(i), Y.label, "other")), 1),
801
- c[12] || (c[12] = k("div", { class: "grow" }, null, -1)),
802
- d(X, {
803
- icon: "close",
804
- size: "md",
805
- variant: "tertiary",
806
- onClick: ae((E) => r(oe), ["stop"])
807
- }, null, 8, ["onClick"])
808
- ]),
809
- _: 2
810
- }, 1032, ["onClick"])
811
- ]),
812
- _: 1
813
- }, 8, ["list"])
814
- ]),
815
- _: 1
816
- }),
817
- d(A, {
818
- class: "text-fm-color-typo-tertiary",
819
- onClick: c[11] || (c[11] = () => {
820
- n();
821
- })
822
- }, {
823
- default: I(() => [
824
- fe(j(t(e)("report.section.metric.add")), 1)
825
- ]),
826
- _: 1
827
- })
828
- ]);
829
- };
830
- }
831
- });
832
- var pe = /* @__PURE__ */ ((F) => (F.Select = "Select", F.TextField = "TextField", F.Timestamp = "Timestamp", F))(pe || {});
833
- function kl(F) {
834
- let u = !1, e = 1;
835
- switch (F) {
836
- case ne.Equal:
837
- case ne.NotEqual:
838
- case ne.Like:
839
- case ne.NotLike:
840
- u = !1, e = 1;
841
- break;
842
- case ne.GreaterThan:
843
- case ne.GreaterThanOrEqual:
844
- case ne.LessThan:
845
- case ne.LessThanOrEqual:
846
- u = !0, e = 1;
847
- break;
848
- case ne.Between:
849
- u = !0, e = 2;
850
- break;
851
- }
852
- return {
853
- fixed: u,
854
- count: e
855
- };
856
- }
857
- function Cl({
858
- operator: F,
859
- dimensionOption: u,
860
- dataType: e,
861
- t: i
862
- }) {
863
- const { fixed: a, count: v } = kl(F);
864
- switch (e) {
865
- case be.String:
866
- return {
867
- type: "TextField",
868
- fixed: a,
869
- count: v,
870
- dataType: void 0,
871
- default: ""
872
- };
873
- case be.Numeric:
874
- return {
875
- type: "TextField",
876
- fixed: a,
877
- count: v,
878
- dataType: "number",
879
- default: 0
880
- };
881
- case be.Bool:
882
- return {
883
- type: "Select",
884
- fixed: a,
885
- count: v,
886
- options: [
887
- { label: i("report.common.yes"), value: !0 },
888
- { label: i("report.common.no"), value: !1 }
889
- ],
890
- default: !0
891
- };
892
- case be.Timestamp:
893
- switch (u) {
894
- case te.HourOfDay:
895
- return {
896
- type: "TextField",
897
- fixed: a,
898
- count: v,
899
- dataType: "number",
900
- default: "0"
901
- };
902
- case te.DayOfWeek:
903
- return {
904
- type: "Select",
905
- fixed: a,
906
- count: v,
907
- options: [
908
- { label: i("report.days.sunday"), value: "1" },
909
- { label: i("report.days.monday"), value: "2" },
910
- { label: i("report.days.tuesday"), value: "3" },
911
- { label: i("report.days.wednesday"), value: "4" },
912
- { label: i("report.days.thursday"), value: "5" },
913
- { label: i("report.days.friday"), value: "6" },
914
- { label: i("report.days.saturday"), value: "7" }
915
- ],
916
- default: "1"
917
- };
918
- case te.DayOfMonth:
919
- return {
920
- type: "TextField",
921
- fixed: a,
922
- count: v,
923
- dataType: "number",
924
- default: "1"
925
- };
926
- case te.MonthOfYear:
927
- return {
928
- type: "Select",
929
- fixed: a,
930
- count: v,
931
- options: [
932
- { label: i("report.months.january"), value: "1" },
933
- { label: i("report.months.february"), value: "2" },
934
- { label: i("report.months.march"), value: "3" },
935
- { label: i("report.months.april"), value: "4" },
936
- { label: i("report.months.may"), value: "5" },
937
- { label: i("report.months.june"), value: "6" },
938
- { label: i("report.months.july"), value: "7" },
939
- { label: i("report.months.august"), value: "8" },
940
- { label: i("report.months.september"), value: "9" },
941
- { label: i("report.months.october"), value: "10" },
942
- { label: i("report.months.november"), value: "11" },
943
- { label: i("report.months.december"), value: "12" }
944
- ],
945
- default: "1"
946
- };
947
- case te.TimeOfDay:
948
- return {
949
- type: "Timestamp",
950
- fixed: a,
951
- count: v,
952
- default: (/* @__PURE__ */ new Date()).toISOString()
953
- };
954
- }
955
- }
956
- return {
957
- type: "TextField",
958
- fixed: a,
959
- count: v,
960
- dataType: void 0,
961
- default: ""
962
- };
963
- }
964
- function He(F) {
965
- switch (F) {
966
- case te.HourOfDay:
967
- return 0;
968
- case te.DayOfMonth:
969
- return 1;
970
- default:
971
- return;
972
- }
973
- }
974
- function We(F) {
975
- switch (F) {
976
- case te.HourOfDay:
977
- return 23;
978
- case te.DayOfMonth:
979
- return 31;
980
- default:
981
- return;
982
- }
983
- }
984
- const _l = { class: "grow" }, Sl = {
985
- key: 2,
986
- class: "w-full"
987
- }, Tl = { key: 0 }, Dl = /* @__PURE__ */ W({
988
- __name: "FilterValueInput",
989
- props: /* @__PURE__ */ J({
990
- config: {
991
- type: Object,
992
- default: () => {
993
- }
994
- },
995
- option: {
996
- type: [String, null],
997
- default: () => {
998
- }
999
- }
1000
- }, {
1001
- modelValue: { required: !0, default: () => [] },
1002
- modelModifiers: {}
1003
- }),
1004
- emits: ["update:modelValue"],
1005
- setup(F) {
1006
- const u = Z(F, "modelValue"), e = F, i = H([]);
1007
- function a(m) {
1008
- return (m ? me(m) : me()).format("HH:mm");
1009
- }
1010
- function v({ hour: m, minute: n }) {
1011
- return me().set("hour", m).set("minute", n).toISOString();
1012
- }
1013
- function p(m, n) {
1014
- var U, L;
1015
- const l = He(e.option), g = We(e.option);
1016
- ((U = e.config) == null ? void 0 : U.type) === pe.TextField && (l !== void 0 && n < l || g !== void 0 && n > g) && (i.value[m] = `Value must be between ${l} and ${g}`);
1017
- const S = [...u.value];
1018
- ((L = e.config) == null ? void 0 : L.type) === pe.Timestamp ? S[m] = v({
1019
- hour: Number(n.split(":")[0]),
1020
- minute: Number(n.split(":")[1])
1021
- }) : S[m] = n, u.value = S;
1022
- }
1023
- function C(m) {
1024
- var n;
1025
- if (m === 0)
1026
- u.value = [(n = e.config) == null ? void 0 : n.default, ...u.value];
1027
- else {
1028
- const l = [...u.value];
1029
- l.splice(m, 1), u.value = l;
1030
- }
1031
- }
1032
- return (m, n) => {
1033
- const l = w("FmSelect"), g = w("FmTextField"), S = w("FmTimePicker"), U = w("FmButton");
1034
- return V(!0), M(Q, null, ce(new Array(u.value.length !== 0 ? u.value.length : 1), (L, f) => {
1035
- var h, r, s, y, o;
1036
- return V(), M("div", {
1037
- key: f,
1038
- class: "flex flex-row align-center gap-2 w-full"
1039
- }, [
1040
- k("div", _l, [
1041
- ((h = e.config) == null ? void 0 : h.type) === t(pe).Select ? (V(), $(l, {
1042
- key: 0,
1043
- "model-value": u.value[f],
1044
- items: e.config.options,
1045
- "onUpdate:modelValue": (c) => p(f, c)
1046
- }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : ((r = e.config) == null ? void 0 : r.type) === t(pe).TextField ? (V(), $(g, {
1047
- key: 1,
1048
- "model-value": u.value[f],
1049
- type: ((s = e.config) == null ? void 0 : s.dataType) === "number" ? "number" : "text",
1050
- "helper-text": i.value[f] || void 0,
1051
- "helper-state": "error",
1052
- "onUpdate:modelValue": (c) => p(f, c)
1053
- }, null, 8, ["model-value", "type", "helper-text", "onUpdate:modelValue"])) : ((y = e.config) == null ? void 0 : y.type) === t(pe).Timestamp ? (V(), M("div", Sl, [
1054
- d(S, {
1055
- "model-value": a(u.value[f]),
1056
- "onUpdate:modelValue": (c) => p(f, c)
1057
- }, null, 8, ["model-value", "onUpdate:modelValue"])
1058
- ])) : O("", !0)
1059
- ]),
1060
- ((o = e.config) == null ? void 0 : o.fixed) === !1 ? (V(), M("div", Tl, [
1061
- d(U, {
1062
- icon: f === 0 ? "add" : "remove",
1063
- onClick: (c) => C(f)
1064
- }, null, 8, ["icon", "onClick"])
1065
- ])) : O("", !0)
1066
- ]);
1067
- }), 128);
1068
- };
1069
- }
1070
- }), Ul = { class: "flex flex-col my-2 gap-8" }, $l = { class: "fm-typo-en-body-lg-600" }, Ol = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Nl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Il = /* @__PURE__ */ W({
1071
- __name: "FilterSection",
1072
- props: /* @__PURE__ */ J({
1073
- options: {
1074
- type: Array,
1075
- default: () => []
1076
- },
1077
- label: {
1078
- type: String,
1079
- default: "Filter"
1080
- }
1081
- }, {
1082
- modelValue: { required: !1, default: () => [] },
1083
- modelModifiers: {}
1084
- }),
1085
- emits: ["update:modelValue"],
1086
- setup(F) {
1087
- const { t: u } = G(), e = Z(F, "modelValue"), i = F, a = T(() => u(`report.section.filter.${i.label}`)), v = H(!1), p = ze(), C = T(
1088
- () => e.value.map((x, _) => {
1089
- const N = i.options.find(
1090
- (q) => q.schemaName === x.schemaName && q.name === x.name
1091
- );
1092
- return {
1093
- index: _,
1094
- labels: (N == null ? void 0 : N.labels) || [x.schemaName, x.name],
1095
- value: x
1096
- };
1097
- })
1098
- ), m = H(e.value.length > 0 ? 0 : void 0);
1099
- function n(x) {
1100
- var _;
1101
- v.value = !0, L.value = [], l.value = x != null && x.value ? JSON.parse(JSON.stringify(x.value)) : void 0, m.value = x == null ? void 0 : x.index, g.value = !!((_ = l.value) != null && _.dataFormula), r();
1102
- }
1103
- const l = H(void 0), g = H(!1), S = H(void 0), U = T(
1104
- () => i.options.find(
1105
- (x) => {
1106
- var _, N;
1107
- return x.schemaName === ((_ = l.value) == null ? void 0 : _.schemaName) && x.name === ((N = l.value) == null ? void 0 : N.name);
1108
- }
1109
- ) ?? {}
1110
- ), L = H([]);
1111
- function f(x) {
1112
- var _;
1113
- return (_ = L.value.find((N) => N.option === x)) == null ? void 0 : _.value;
1114
- }
1115
- const h = ye(
1116
- (x, _) => {
1117
- const N = L.value.find((q) => q.option === x);
1118
- N ? N.value = _ : L.value.push({ option: x, value: _ });
1119
- },
1120
- 300
1121
- );
1122
- ie(
1123
- [() => {
1124
- var x;
1125
- return (x = l.value) == null ? void 0 : x.option;
1126
- }, () => {
1127
- var x;
1128
- return (x = l.value) == null ? void 0 : x.values;
1129
- }],
1130
- ([x, _]) => {
1131
- x !== void 0 && Array.isArray(_) && h(x, _);
1132
- },
1133
- { deep: !0 }
1134
- ), ie(
1135
- () => {
1136
- var x;
1137
- return (x = l.value) == null ? void 0 : x.option;
1138
- },
1139
- (x, _) => {
1140
- if (_ !== void 0 && x !== _ && l.value) {
1141
- if (r(), !S.value) return;
1142
- const N = f(x);
1143
- l.value = {
1144
- ...l.value,
1145
- values: Array.isArray(N) ? N : [S.value.default]
1146
- };
1147
- }
1148
- }
1149
- ), ie(
1150
- () => {
1151
- var x;
1152
- return (x = l.value) == null ? void 0 : x.operator;
1153
- },
1154
- (x, _) => {
1155
- if (x !== _ && U.value && l.value) {
1156
- if (r(), !S.value) return;
1157
- const N = l.value.values.length - S.value.count;
1158
- N > 0 && S.value.fixed ? l.value = {
1159
- ...l.value,
1160
- values: l.value.values.slice(0, S.value.count)
1161
- } : N < 0 && (l.value = {
1162
- ...l.value,
1163
- values: [
1164
- ...l.value.values,
1165
- ...Array(Math.abs(N)).fill(S.value.default)
1166
- ]
1167
- });
1168
- }
1169
- },
1170
- {
1171
- deep: !0
1172
- }
1173
- );
1174
- function r() {
1175
- U.value && l.value && (S.value = Cl({
1176
- operator: l.value.operator,
1177
- dataType: U.value.type,
1178
- dimensionOption: l.value.option,
1179
- t: u
1180
- }));
1181
- }
1182
- function s(x) {
1183
- var _, N, q;
1184
- (x.schemaName !== ((_ = l.value) == null ? void 0 : _.schemaName) || x.name !== ((N = l.value) == null ? void 0 : N.name)) && (l.value = {
1185
- schemaName: x.schemaName,
1186
- name: x.name,
1187
- operator: x.filterOperators[0],
1188
- option: x.filterDimensionOptions[0],
1189
- values: []
1190
- }, r(), l.value.values = [(q = S.value) == null ? void 0 : q.default]);
1191
- }
1192
- function y() {
1193
- var _, N, q;
1194
- const x = [...C.value.map((X) => X.value)];
1195
- if (l.value) {
1196
- const X = He((_ = l.value) == null ? void 0 : _.option), ee = We((N = l.value) == null ? void 0 : N.option), D = (q = l.value.values) == null ? void 0 : q.map(
1197
- (A, Y) => A == null || A === "" || !R(A, X, ee) ? Y : null
1198
- ).filter((A) => A !== null);
1199
- if (!l.value.values || D.length > 0) {
1200
- p.open({ message: "One or more values are invalid", type: "error" });
1201
- return;
1202
- }
1203
- l.value.values = l.value.values.filter(
1204
- (A) => A !== "" && A !== null
1205
- ), m.value !== void 0 ? x[Number(m.value)] = l.value : x.push(l.value), e.value = x;
1206
- }
1207
- v.value = !1;
1208
- }
1209
- function o(x) {
1210
- const _ = [...C.value.map((N) => N.value)];
1211
- _.splice(x, 1), e.value = _, v.value = !1;
1212
- }
1213
- const c = T(
1214
- () => i.options.map((x) => ({
1215
- label: x.labels.join(" "),
1216
- value: x
1217
- }))
1218
- ), b = T(() => [
1219
- { label: u("report.section.filter.hourOfDay"), value: te.HourOfDay },
1220
- { label: u("report.section.filter.dayOfMonth"), value: te.DayOfMonth },
1221
- { label: u("report.section.filter.dayOfWeek"), value: te.DayOfWeek },
1222
- { label: u("report.section.filter.monthOfYear"), value: te.MonthOfYear },
1223
- { label: u("report.section.filter.timeOfDay"), value: te.TimeOfDay }
1224
- ]);
1225
- function R(x, _, N) {
1226
- return !(_ !== void 0 && x < _ || N !== void 0 && x > N);
1227
- }
1228
- return (x, _) => {
1229
- const N = w("FmCheckbox"), q = w("FmTextarea"), X = w("FmSelect"), ee = w("FmForm"), D = w("FmIcon"), A = w("FmButton"), Y = w("FmListItem"), oe = w("FmList"), E = w("FmField");
1230
- return V(), M("div", Ul, [
1231
- d(ge, {
1232
- modelValue: v.value,
1233
- "onUpdate:modelValue": _[6] || (_[6] = (z) => v.value = z),
1234
- title: a.value,
1235
- "primary-button-label": t(u)("report.common.confirm"),
1236
- "secondary-button-label": t(u)("report.common.cancel"),
1237
- onConfirm: y
1238
- }, {
1239
- content: I(() => [
1240
- d(ee, {
1241
- ref: "form",
1242
- class: "flex flex-col gap-2 w-[490px]"
1243
- }, {
1244
- default: I(() => {
1245
- var z, se;
1246
- return [
1247
- d(K, {
1248
- "model-value": U.value,
1249
- items: c.value,
1250
- placeholder: a.value,
1251
- label: a.value,
1252
- "onUpdate:modelValue": _[0] || (_[0] = (B) => s(B))
1253
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
1254
- l.value ? (V(), M(Q, { key: 0 }, [
1255
- d(N, {
1256
- modelValue: g.value,
1257
- "onUpdate:modelValue": _[1] || (_[1] = (B) => g.value = B),
1258
- label: t(u)("report.section.filter.advance"),
1259
- value: !0
1260
- }, null, 8, ["modelValue", "label"]),
1261
- g.value ? (V(), $(q, {
1262
- key: 0,
1263
- modelValue: l.value.dataFormula,
1264
- "onUpdate:modelValue": _[2] || (_[2] = (B) => l.value.dataFormula = B),
1265
- placeholder: t(u)("report.section.filter.dataFormula")
1266
- }, null, 8, ["modelValue", "placeholder"])) : O("", !0),
1267
- d(X, {
1268
- modelValue: l.value.option,
1269
- "onUpdate:modelValue": _[3] || (_[3] = (B) => l.value.option = B),
1270
- items: b.value,
1271
- placeholder: t(u)("report.section.filter.timeFormatter"),
1272
- label: t(u)("report.section.filter.timeFormatter")
1273
- }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1274
- (((z = U.value) == null ? void 0 : z.filterOperators) || []).length > 0 ? (V(), $(K, {
1275
- key: 1,
1276
- modelValue: l.value.operator,
1277
- "onUpdate:modelValue": _[4] || (_[4] = (B) => l.value.operator = B),
1278
- items: (((se = U.value) == null ? void 0 : se.filterOperators) ?? []).map((B) => ({
1279
- label: t(u)("report.section.comparisonOperator." + B),
1280
- value: B
1281
- }))
1282
- }, null, 8, ["modelValue", "items"])) : O("", !0),
1283
- S.value ? (V(), $(Dl, {
1284
- key: l.value.option ?? "",
1285
- modelValue: l.value.values,
1286
- "onUpdate:modelValue": _[5] || (_[5] = (B) => l.value.values = B),
1287
- config: S.value,
1288
- option: l.value.option
1289
- }, null, 8, ["modelValue", "config", "option"])) : O("", !0)
1290
- ], 64)) : O("", !0)
1291
- ];
1292
- }),
1293
- _: 1
1294
- }, 512)
1295
- ]),
1296
- _: 1
1297
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
1298
- k("div", null, [
1299
- k("p", $l, j(a.value), 1),
1300
- k("p", Ol, j(t(u)("report.section.filter.description")), 1)
1301
- ]),
1302
- d(oe, null, {
1303
- default: I(() => [
1304
- d(t(xe), {
1305
- list: e.value,
1306
- "item-key": "id",
1307
- class: "flex flex-col gap-2 w-full"
1308
- }, {
1309
- item: I(({ element: z, index: se }) => [
1310
- d(Y, {
1311
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1312
- onClick: ae((B) => n(C.value[se]), ["stop"])
1313
- }, {
1314
- default: I(() => [
1315
- d(D, { name: "drag_handle" }),
1316
- k("p", Nl, j(t($e)(z.name)), 1),
1317
- _[8] || (_[8] = k("div", { class: "grow" }, null, -1)),
1318
- d(A, {
1319
- icon: "close",
1320
- size: "md",
1321
- variant: "tertiary",
1322
- onClick: ae((B) => o(se), ["stop"])
1323
- }, null, 8, ["onClick"])
1324
- ]),
1325
- _: 2
1326
- }, 1032, ["onClick"])
1327
- ]),
1328
- _: 1
1329
- }, 8, ["list"])
1330
- ]),
1331
- _: 1
1332
- }),
1333
- d(E, {
1334
- class: "text-fm-color-typo-tertiary",
1335
- onClick: _[7] || (_[7] = () => {
1336
- n();
1337
- })
1338
- }, {
1339
- default: I(() => [
1340
- fe(j(t(u)("report.section.filter.add")), 1)
1341
- ]),
1342
- _: 1
1343
- })
1344
- ]);
1345
- };
1346
- }
1347
- }), Bl = { class: "flex flex-col my-2 gap-8" }, Ll = { class: "fm-typo-en-body-lg-600" }, Ml = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, jl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Rl = /* @__PURE__ */ W({
1348
- __name: "SortSection",
1349
- props: /* @__PURE__ */ J({
1350
- options: {
1351
- type: Array,
1352
- default: () => []
1353
- },
1354
- label: {
1355
- type: String,
1356
- default: "Sort"
1357
- }
1358
- }, {
1359
- modelValue: { required: !1, default: [] },
1360
- modelModifiers: {}
1361
- }),
1362
- emits: ["update:modelValue"],
1363
- setup(F) {
1364
- const { t: u } = G(), e = Z(F, "modelValue"), i = F, a = T(
1365
- () => i.label ? i.label : u(`report.section.sort.${i.label}`)
1366
- ), v = H(!1), p = T(
1367
- () => e.value.map((h, r) => {
1368
- const s = i.options.find(
1369
- (y) => y.schemaName === h.schemaName && y.name === h.name
1370
- );
1371
- return {
1372
- index: r,
1373
- labels: (s == null ? void 0 : s.labels) || [h.schemaName, h.name],
1374
- value: h
1375
- };
1376
- })
1377
- ), C = H(e.value.length > 0 ? 0 : void 0);
1378
- function m(h) {
1379
- var r;
1380
- v.value = !0, n.value = h != null && h.value ? JSON.parse(JSON.stringify(h.value)) : void 0, C.value = h == null ? void 0 : h.index, l.value = !!((r = n.value) != null && r.dataFormula);
1381
- }
1382
- const n = H(void 0), l = H(!1), g = T(
1383
- () => i.options.find(
1384
- (h) => {
1385
- var r, s;
1386
- return h.schemaName === ((r = n.value) == null ? void 0 : r.schemaName) && h.name === ((s = n.value) == null ? void 0 : s.name);
1387
- }
1388
- ) ?? {}
1389
- );
1390
- function S(h) {
1391
- var r, s;
1392
- (h.schemaName !== ((r = n.value) == null ? void 0 : r.schemaName) || h.name !== ((s = n.value) == null ? void 0 : s.name)) && (n.value = {
1393
- schemaName: h.schemaName,
1394
- name: h.name,
1395
- dimensionOption: h.dimensionOptions[0],
1396
- aggregation: null,
1397
- type: Oe.Asc
1398
- });
1399
- }
1400
- function U() {
1401
- if (!n.value) {
1402
- console.log("new sort is undefined");
1403
- return;
1404
- }
1405
- const h = [...p.value.map((r) => r.value)];
1406
- C.value !== void 0 ? h[C.value] = n.value : h.push(n.value), e.value = h, v.value = !1;
1407
- }
1408
- function L(h) {
1409
- const r = [...p.value.map((s) => s.value)];
1410
- r.splice(h, 1), e.value = r, v.value = !1;
1411
- }
1412
- const f = T(
1413
- () => i.options.map((h) => ({
1414
- label: h.labels.join(" "),
1415
- value: h
1416
- }))
1417
- );
1418
- return (h, r) => {
1419
- const s = w("FmCheckbox"), y = w("FmTextarea"), o = w("FmForm"), c = w("FmIcon"), b = w("FmButton"), R = w("FmListItem"), x = w("FmList"), _ = w("FmField");
1420
- return V(), M("div", Bl, [
1421
- d(ge, {
1422
- modelValue: v.value,
1423
- "onUpdate:modelValue": r[6] || (r[6] = (N) => v.value = N),
1424
- title: a.value,
1425
- onConfirm: U
1426
- }, {
1427
- content: I(() => [
1428
- d(o, {
1429
- ref: "form",
1430
- class: "flex flex-col gap-2 w-[490px]"
1431
- }, {
1432
- default: I(() => {
1433
- var N, q, X, ee;
1434
- return [
1435
- d(K, {
1436
- "model-value": g.value,
1437
- items: f.value,
1438
- placeholder: a.value,
1439
- label: a.value,
1440
- "onUpdate:modelValue": r[0] || (r[0] = (D) => S(D))
1441
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
1442
- n.value ? (V(), M(Q, { key: 0 }, [
1443
- (((N = g.value) == null ? void 0 : N.dimensionOptions) || []).length > 0 ? (V(), $(K, {
1444
- key: 0,
1445
- modelValue: n.value.dimensionOption,
1446
- "onUpdate:modelValue": r[1] || (r[1] = (D) => n.value.dimensionOption = D),
1447
- items: ((q = g.value) == null ? void 0 : q.dimensionOptions.map((D) => ({ label: D, value: D }))) ?? [],
1448
- placeholder: t(u)("report.section.sort.format"),
1449
- label: t(u)("report.section.sort.format")
1450
- }, null, 8, ["modelValue", "items", "placeholder", "label"])) : O("", !0),
1451
- (((X = g.value) == null ? void 0 : X.aggregations) || []).length > 0 ? (V(), $(K, {
1452
- key: 1,
1453
- modelValue: n.value.aggregation,
1454
- "onUpdate:modelValue": r[2] || (r[2] = (D) => n.value.aggregation = D),
1455
- items: ((ee = g.value) == null ? void 0 : ee.aggregations.map((D) => ({ label: D, value: D }))) ?? [],
1456
- label: t(u)("report.section.sort.aggregation"),
1457
- placeholder: t(u)("report.section.sort.aggregation")
1458
- }, null, 8, ["modelValue", "items", "label", "placeholder"])) : O("", !0),
1459
- d(K, {
1460
- modelValue: n.value.type,
1461
- "onUpdate:modelValue": r[3] || (r[3] = (D) => n.value.type = D),
1462
- items: Object.values(t(Oe)).map((D) => ({ label: D, value: D })),
1463
- placeholder: t(u)("report.section.sort.order"),
1464
- label: t(u)("report.section.sort.order")
1465
- }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1466
- d(s, {
1467
- modelValue: l.value,
1468
- "onUpdate:modelValue": r[4] || (r[4] = (D) => l.value = D),
1469
- label: t(u)("report.section.sort.advance"),
1470
- value: !0
1471
- }, null, 8, ["modelValue", "label"]),
1472
- l.value ? (V(), $(y, {
1473
- key: 2,
1474
- modelValue: n.value.dataFormula,
1475
- "onUpdate:modelValue": r[5] || (r[5] = (D) => n.value.dataFormula = D),
1476
- placeholder: t(u)("report.section.sort.dataFormula")
1477
- }, null, 8, ["modelValue", "placeholder"])) : O("", !0)
1478
- ], 64)) : O("", !0)
1479
- ];
1480
- }),
1481
- _: 1
1482
- }, 512)
1483
- ]),
1484
- _: 1
1485
- }, 8, ["modelValue", "title"]),
1486
- k("div", null, [
1487
- k("p", Ll, j(a.value), 1),
1488
- k("p", Ml, j(t(u)("report.section.sort.description")), 1)
1489
- ]),
1490
- d(x, null, {
1491
- default: I(() => [
1492
- d(t(xe), {
1493
- list: e.value,
1494
- "item-key": "id",
1495
- class: "flex flex-col gap-2 w-full"
1496
- }, {
1497
- item: I(({ element: N, index: q }) => [
1498
- d(R, {
1499
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1500
- onClick: ae((X) => m(p.value[q]), ["stop"])
1501
- }, {
1502
- default: I(() => [
1503
- d(c, { name: "drag_handle" }),
1504
- k("p", jl, j(t($e)(N.name)), 1),
1505
- r[8] || (r[8] = k("div", { class: "grow" }, null, -1)),
1506
- d(b, {
1507
- icon: "close",
1508
- size: "md",
1509
- variant: "tertiary",
1510
- onClick: ae((X) => L(q), ["stop"])
1511
- }, null, 8, ["onClick"])
1512
- ]),
1513
- _: 2
1514
- }, 1032, ["onClick"])
1515
- ]),
1516
- _: 1
1517
- }, 8, ["list"])
1518
- ]),
1519
- _: 1
1520
- }),
1521
- d(_, {
1522
- class: "text-fm-color-typo-tertiary",
1523
- onClick: r[7] || (r[7] = () => {
1524
- m();
1525
- })
1526
- }, {
1527
- default: I(() => [
1528
- fe(j(t(u)("report.section.sort.add")), 1)
1529
- ]),
1530
- _: 1
1531
- })
1532
- ]);
1533
- };
1534
- }
1535
- }), zl = { class: "fm-typo-en-body-lg-600" }, Pl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Al = /* @__PURE__ */ W({
1536
- __name: "LimitSection",
1537
- props: {
1538
- modelValue: { required: !0, default: null },
1539
- modelModifiers: {}
1540
- },
1541
- emits: ["update:modelValue"],
1542
- setup(F) {
1543
- const { t: u } = G(), e = Z(F, "modelValue"), i = ye((a) => {
1544
- a !== "" ? e.value = a : e.value = null;
1545
- }, 1e3);
1546
- return (a, v) => {
1547
- const p = w("FmTextField");
1548
- return V(), M(Q, null, [
1549
- k("div", null, [
1550
- k("p", zl, j(t(u)("report.section.limit.title")), 1),
1551
- k("p", Pl, j(t(u)("report.section.limit.description")), 1)
1552
- ]),
1553
- d(p, {
1554
- "model-value": e.value,
1555
- inputmode: "numeric",
1556
- placeholder: t(u)("report.section.limit.placeholder"),
1557
- "onUpdate:modelValue": v[0] || (v[0] = (C) => t(i)(C))
1558
- }, null, 8, ["model-value", "placeholder"])
1559
- ], 64);
1560
- };
1561
- }
1562
- }), ql = { class: "flex flex-col my-2 gap-8" }, Hl = { class: "fm-typo-en-body-lg-600" }, Wl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Xl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Yl = /* @__PURE__ */ W({
1563
- __name: "ConditionSection",
1564
- props: /* @__PURE__ */ J({
1565
- joinFieldOptions: {
1566
- type: Array,
1567
- default: () => []
1568
- },
1569
- mainFieldOptions: {
1570
- type: Array,
1571
- default: () => []
1572
- }
1573
- }, {
1574
- modelValue: { required: !0 },
1575
- modelModifiers: {}
1576
- }),
1577
- emits: ["update:modelValue"],
1578
- setup(F) {
1579
- const { t: u } = G(), e = Z(F, "modelValue"), i = F, a = H(!1), v = T(
1580
- () => e.value.map((r, s) => {
1581
- var y, o;
1582
- return {
1583
- index: s,
1584
- labels: [(y = r.joinDimension) == null ? void 0 : y.schemaName, (o = r.joinDimension) == null ? void 0 : o.name],
1585
- value: r
1586
- };
1587
- })
1588
- ), p = H(e.value.length > 0 ? 0 : void 0);
1589
- function C(r) {
1590
- r ? (m.value = r != null && r.value ? JSON.parse(JSON.stringify(r.value)) : void 0, p.value = r == null ? void 0 : r.index) : (m.value = {
1591
- joinDimension: null,
1592
- operator: "",
1593
- mainDimensions: []
1594
- }, p.value = void 0), a.value = !0;
1595
- }
1596
- const m = H(void 0), n = T(
1597
- () => i.joinFieldOptions.find(
1598
- (r) => {
1599
- var s, y;
1600
- return r.schemaName === ((y = (s = m.value) == null ? void 0 : s.joinDimension) == null ? void 0 : y.schemaName) && r.name === m.value.joinDimension.name;
1601
- }
1602
- ) ?? {}
1603
- ), l = T(
1604
- () => {
1605
- var r;
1606
- return (((r = m.value) == null ? void 0 : r.mainDimensions) || []).map(
1607
- (s) => i.mainFieldOptions.find(
1608
- (y) => y.schemaName === (s == null ? void 0 : s.schemaName) && y.name === s.name
1609
- ) ?? {}
1610
- );
1611
- }
1612
- ), g = T(
1613
- () => i.joinFieldOptions.map((r) => ({ label: r.labels.join(" "), value: r }))
1614
- );
1615
- function S(r) {
1616
- var s, y, o, c;
1617
- m.value && (m.value && r.schemaName !== ((y = (s = m.value) == null ? void 0 : s.joinDimension) == null ? void 0 : y.schemaName) || r.name !== ((c = (o = m.value) == null ? void 0 : o.joinDimension) == null ? void 0 : c.name)) && (m.value = {
1618
- ...m.value,
1619
- joinDimension: {
1620
- schemaName: r.schemaName,
1621
- name: r.name,
1622
- option: r.dimensionOptions[0],
1623
- label: r.label,
1624
- hide: !0
1625
- }
1626
- }, r.joinConditionOperators.includes(m.value.operator) || L(r.joinConditionOperators[0]));
1627
- }
1628
- function U(r, s) {
1629
- var y, o, c, b;
1630
- if (m.value && s >= 0 && (m.value && r.schemaName !== ((o = (y = m.value) == null ? void 0 : y.mainDimensions[s]) == null ? void 0 : o.schemaName) || r.name !== ((b = (c = m.value) == null ? void 0 : c.mainDimensions[s]) == null ? void 0 : b.name))) {
1631
- const R = [...m.value.mainDimensions];
1632
- R[s] = {
1633
- schemaName: r.schemaName,
1634
- name: r.name,
1635
- option: r.dimensionOptions[0],
1636
- label: r.label,
1637
- hide: !0
1638
- }, m.value = {
1639
- ...m.value,
1640
- mainDimensions: R
1641
- };
1642
- }
1643
- }
1644
- function L(r) {
1645
- if (m.value)
1646
- switch (r) {
1647
- case ne.Between:
1648
- m.value = {
1649
- ...m.value,
1650
- operator: r,
1651
- mainDimensions: [null, null]
1652
- };
1653
- break;
1654
- default:
1655
- m.value = {
1656
- ...m.value,
1657
- operator: r,
1658
- mainDimensions: [null]
1659
- };
1660
- break;
1661
- }
1662
- }
1663
- function f() {
1664
- const r = [...v.value.map((s) => s.value)];
1665
- m.value && (m.value.mainDimensions = m.value.mainDimensions.filter(
1666
- (s) => s !== "" && s != null
1667
- ), p.value !== void 0 ? r[p.value] = m.value : r.push(m.value)), e.value = r, a.value = !1;
1668
- }
1669
- function h(r) {
1670
- const s = [...v.value.map((y) => y.value)];
1671
- s.splice(r, 1), e.value = s;
1672
- }
1673
- return (r, s) => {
1674
- const y = w("FmMenuDivider"), o = w("FmForm"), c = w("FmButton"), b = w("FmListItem"), R = w("FmList"), x = w("FmField");
1675
- return V(), M("div", ql, [
1676
- d(ge, {
1677
- modelValue: a.value,
1678
- "onUpdate:modelValue": s[2] || (s[2] = (_) => a.value = _),
1679
- title: t(u)("report.section.condition.condition"),
1680
- onConfirm: f
1681
- }, {
1682
- content: I(() => [
1683
- d(o, {
1684
- ref: "form",
1685
- class: "flex flex-col gap-2 w-[490px]"
1686
- }, {
1687
- default: I(() => {
1688
- var _, N, q, X, ee;
1689
- return [
1690
- d(K, {
1691
- label: t(u)("report.section.condition.joinDatasource"),
1692
- "model-value": n.value,
1693
- items: g.value,
1694
- placeholder: t(u)("report.section.condition.joinDimension"),
1695
- "onUpdate:modelValue": s[0] || (s[0] = (D) => S(D))
1696
- }, null, 8, ["label", "model-value", "items", "placeholder"]),
1697
- d(y),
1698
- (_ = m.value) != null && _.joinDimension && (((N = n.value) == null ? void 0 : N.dimensionOptions) || []).length > 0 ? (V(), $(K, {
1699
- key: 0,
1700
- modelValue: m.value.joinDimension.option,
1701
- "onUpdate:modelValue": s[1] || (s[1] = (D) => m.value.joinDimension.option = D),
1702
- label: t(u)("report.section.condition.format"),
1703
- items: ((q = n.value) == null ? void 0 : q.dimensionOptions.map((D) => ({
1704
- label: D,
1705
- value: D
1706
- }))) ?? []
1707
- }, null, 8, ["modelValue", "label", "items"])) : O("", !0),
1708
- m.value && (((X = n.value) == null ? void 0 : X.joinConditionOperators) || []).length > 0 ? (V(), $(K, {
1709
- key: 1,
1710
- "model-value": m.value.operator,
1711
- label: t(u)("report.section.condition.operator"),
1712
- items: n.value.joinConditionOperators.map((D) => ({
1713
- label: D,
1714
- value: D
1715
- })) ?? [],
1716
- "onUpdate:modelValue": L
1717
- }, null, 8, ["model-value", "label", "items"])) : O("", !0),
1718
- (V(!0), M(Q, null, ce(((ee = m.value) == null ? void 0 : ee.mainDimensions) || [], (D, A) => {
1719
- var Y, oe;
1720
- return V(), M("div", {
1721
- key: A,
1722
- class: "flex flex-col gap-2"
1723
- }, [
1724
- d(K, {
1725
- "model-value": l.value[A],
1726
- label: t(u)("report.section.condition.mainDatasource", { index: A + 1 }),
1727
- items: i.mainFieldOptions.map((E) => ({
1728
- label: E.labels.join(" "),
1729
- value: E
1730
- })),
1731
- "onUpdate:modelValue": (E) => U(E, A)
1732
- }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1733
- D && (((Y = l.value[A]) == null ? void 0 : Y.dimensionOptions) || []).length > 0 && D ? (V(), $(K, {
1734
- key: 0,
1735
- modelValue: D.option,
1736
- "onUpdate:modelValue": (E) => D.option = E,
1737
- items: (oe = l.value[A]) == null ? void 0 : oe.dimensionOptions.map((E) => ({
1738
- label: E,
1739
- value: E
1740
- }))
1741
- }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : O("", !0),
1742
- d(y)
1743
- ]);
1744
- }), 128))
1745
- ];
1746
- }),
1747
- _: 1
1748
- }, 512)
1749
- ]),
1750
- _: 1
1751
- }, 8, ["modelValue", "title"]),
1752
- k("div", null, [
1753
- k("p", Hl, j(t(u)("report.section.condition.condition")), 1),
1754
- k("p", Wl, j(t(u)("report.section.condition.description")), 1)
1755
- ]),
1756
- d(R, { class: "flex flex-col gap-2" }, {
1757
- default: I(() => [
1758
- (V(!0), M(Q, null, ce(e.value, (_, N) => (V(), $(b, {
1759
- key: N,
1760
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1761
- onClick: (q) => C(v.value[N])
1762
- }, {
1763
- default: I(() => {
1764
- var q, X;
1765
- return [
1766
- k("p", Xl, j(t(nl)(((q = _.joinDimension) == null ? void 0 : q.schemaName) ?? "")) + " " + j((X = _.joinDimension) == null ? void 0 : X.label), 1),
1767
- s[4] || (s[4] = k("div", { class: "grow" }, null, -1)),
1768
- d(c, {
1769
- icon: "close",
1770
- size: "md",
1771
- variant: "tertiary",
1772
- onClick: ae((ee) => h(N), ["stop"])
1773
- }, null, 8, ["onClick"])
1774
- ];
1775
- }),
1776
- _: 2
1777
- }, 1032, ["onClick"]))), 128))
1778
- ]),
1779
- _: 1
1780
- }),
1781
- d(x, {
1782
- class: "text-fm-color-typo-tertiary cursor-pointer",
1783
- onClick: s[3] || (s[3] = (_) => C())
1784
- }, {
1785
- default: I(() => [
1786
- fe(j(t(u)("report.section.condition.add")), 1)
1787
- ]),
1788
- _: 1
1789
- })
1790
- ]);
1791
- };
1792
- }
1793
- }), El = /* @__PURE__ */ W({
1794
- __name: "TableResizeSection",
1795
- props: {
1796
- model: {}
1797
- },
1798
- setup(F) {
1799
- const { t: u, te: e } = G(), i = F, { isEditing: a, colWidths: v, rowHeight: p } = ve(Fe()), { enableCellResizing: C, cancelResizingChanges: m } = Fe();
1800
- return Ue(() => {
1801
- i.model.rowHeight !== void 0 && (p.value = i.model.rowHeight), i.model.colWidths && (v.value = [...i.model.colWidths]);
1802
- }), (n, l) => {
1803
- const g = w("FmButton");
1804
- return V(), M(Q, null, [
1805
- d(g, {
1806
- label: t(u)("report.section.datasource.resizeTable"),
1807
- onClick: t(C)
1808
- }, null, 8, ["label", "onClick"]),
1809
- t(a) ? (V(), $(g, {
1810
- key: 0,
1811
- label: t(u)("report.common.cancel"),
1812
- onClick: t(m)
1813
- }, null, 8, ["label", "onClick"])) : O("", !0)
1814
- ], 64);
1815
- };
1816
- }
1817
- }), Ne = /* @__PURE__ */ W({
1818
- __name: "Datasource",
1819
- props: /* @__PURE__ */ J({
1820
- label: {
1821
- type: String,
1822
- default: "Label"
1823
- },
1824
- config: {
1825
- type: Object,
1826
- default: null
1827
- },
1828
- closeable: {
1829
- type: Boolean,
1830
- default: !1
1831
- },
1832
- mainDatasourceConfig: {
1833
- type: Object,
1834
- default: () => {
1835
- }
1836
- },
1837
- modelValue: {
1838
- type: Object,
1839
- default: () => {
1840
- }
1841
- }
1842
- }, {
1843
- modelValue: { required: !0 },
1844
- modelModifiers: {}
1845
- }),
1846
- emits: /* @__PURE__ */ J(["click-close"], ["update:modelValue"]),
1847
- setup(F, { emit: u }) {
1848
- const { disableEditMode: e, resetStore: i } = Fe(), a = Z(F, "modelValue");
1849
- ie(
1850
- [() => a.value.dimensions, () => a.value.metrics],
1851
- () => {
1852
- const { rowIds: r, columnIds: s } = we(a.value);
1853
- a.value.rowIds = r, a.value.columnIds = s;
1854
- },
1855
- { deep: !0 }
1856
- );
1857
- const v = F, p = u, { schemas: C } = ve(je());
1858
- Ye(() => {
1859
- e(), i();
1860
- });
1861
- const { t: m, te: n } = G(), l = T(() => !v.mainDatasourceConfig), g = T(
1862
- () => [P.BarChart, P.LineChart, P.Scorecard].includes(v.config.type)
1863
- ), S = T(() => {
1864
- const r = [...a.value.dimensions].filter((s) => !s.hide);
1865
- return r.sort(
1866
- (s, y) => (a.value.rowIds || []).indexOf(Ve(s)) - (a.value.rowIds || []).indexOf(Ve(y))
1867
- ), r;
1868
- }), U = T(() => v.config.type === P.Scorecard), L = T(
1869
- () => {
1870
- var r;
1871
- return (((r = v.mainDatasourceConfig) == null ? void 0 : r.schemaNames) || []).reduce(
1872
- (s, y) => {
1873
- const o = C.value.find((c) => c.name === y);
1874
- return o && (s = [
1875
- ...s,
1876
- ...o.fields.map((c) => ({
1877
- ...c,
1878
- labels: [
1879
- le(m, n, o.label, "schema"),
1880
- le(m, n, c.label || c.name, "other")
1881
- ]
1882
- }))
1883
- ]), s;
1884
- },
1885
- []
1886
- );
1887
- }
1888
- ), f = T(
1889
- () => a.value.schemaNames.reduce((r, s) => {
1890
- const y = C.value.find((o) => o.name === s);
1891
- return y && (r = [
1892
- ...r,
1893
- ...y.fields.map((o) => ({
1894
- ...o,
1895
- labels: [
1896
- le(m, n, y.label, "schema"),
1897
- le(m, n, o.label || o.name, "other")
1898
- ]
1899
- }))
1900
- ]), r;
1901
- }, [])
1902
- ), h = T(() => [
1903
- { label: m("report.section.datasource.none"), value: null },
1904
- { label: m("report.section.datasource.grandTotal"), value: 0 },
1905
- ...[...S.value].slice(0, S.value.length - 1).map((r, s) => ({
1906
- label: le(m, n, r.label, "other"),
1907
- value: s + 1
1908
- }))
1909
- ]);
1910
- return (r, s) => {
1911
- const y = w("FmButton"), o = w("FmSwitch"), c = w("FmSelect");
1912
- return V(), $(Se, null, {
1913
- header: I(() => [
1914
- k("p", null, j(v.label), 1),
1915
- s[18] || (s[18] = k("div", { class: "grow" }, null, -1)),
1916
- v.closeable ? (V(), $(y, {
1917
- key: 0,
1918
- icon: "close",
1919
- variant: "tertiary",
1920
- size: "md",
1921
- onClick: s[0] || (s[0] = ae((b) => p("click-close"), ["stop"]))
1922
- })) : O("", !0)
1923
- ]),
1924
- content: I(() => [
1925
- d(cl, {
1926
- modelValue: a.value,
1927
- "onUpdate:modelValue": s[1] || (s[1] = (b) => a.value = b),
1928
- label: t(m)("report.section.schema.title")
1929
- }, null, 8, ["modelValue", "label"]),
1930
- d(_e, {
1931
- modelValue: a.value.dimensions,
1932
- "onUpdate:modelValue": s[2] || (s[2] = (b) => a.value.dimensions = b),
1933
- options: f.value,
1934
- config: a.value,
1935
- max: v.config.maxDimension,
1936
- "has-row-column": !0,
1937
- onConfig: s[3] || (s[3] = (b) => {
1938
- a.value = b;
1939
- })
1940
- }, null, 8, ["modelValue", "options", "config", "max"]),
1941
- d(o, {
1942
- "label-placement": "right",
1943
- label: t(m)("report.section.datasource.comparable"),
1944
- "model-value": a.value.isComparable ?? !1,
1945
- "onUpdate:modelValue": s[4] || (s[4] = (b) => {
1946
- a.value.isComparable = b;
1947
- })
1948
- }, null, 8, ["label", "model-value"]),
1949
- g.value ? (V(), $(o, {
1950
- key: 0,
1951
- "label-placement": "right",
1952
- label: t(m)("report.section.datasource.cumulative"),
1953
- "model-value": a.value.isCumulative ?? !1,
1954
- "onUpdate:modelValue": s[5] || (s[5] = (b) => {
1955
- a.value.isCumulative = b;
1956
- })
1957
- }, null, 8, ["label", "model-value"])) : O("", !0),
1958
- v.config.isDrillConfigurable && l.value ? (V(), $(o, {
1959
- key: 1,
1960
- label: t(m)("report.section.datasource.drill"),
1961
- "label-placement": "right",
1962
- "model-value": a.value.isDrillable ?? !1,
1963
- "onUpdate:modelValue": s[6] || (s[6] = (b) => {
1964
- a.value.isDrillable = b;
1965
- })
1966
- }, null, 8, ["label", "model-value"])) : O("", !0),
1967
- v.config.canRollup && l.value ? (V(), $(c, {
1968
- key: 2,
1969
- modelValue: a.value.rollup,
1970
- "onUpdate:modelValue": s[7] || (s[7] = (b) => a.value.rollup = b),
1971
- label: t(m)("report.section.datasource.subTotal"),
1972
- items: h.value
1973
- }, null, 8, ["modelValue", "label", "items"])) : O("", !0),
1974
- v.config.canTranspose && l.value ? (V(), $(o, {
1975
- key: 3,
1976
- modelValue: a.value.isTransposed,
1977
- "onUpdate:modelValue": s[8] || (s[8] = (b) => a.value.isTransposed = b),
1978
- label: t(m)("report.section.datasource.transpose"),
1979
- "label-placement": "right"
1980
- }, null, 8, ["modelValue", "label"])) : O("", !0),
1981
- v.config.hasTable ? (V(), $(El, {
1982
- key: 4,
1983
- model: a.value,
1984
- "onUpdate:model": s[9] || (s[9] = (b) => a.value = b)
1985
- }, null, 8, ["model"])) : O("", !0),
1986
- v.config.hasBreakdownDimension ? (V(), $(_e, {
1987
- key: 5,
1988
- "model-value": a.value.breakdownDimension ? [a.value.breakdownDimension] : [],
1989
- label: t(m)("report.section.dimension.breakdownDimension"),
1990
- max: 1,
1991
- options: f.value,
1992
- "onUpdate:modelValue": s[10] || (s[10] = (b) => {
1993
- a.value.breakdownDimension = b[0];
1994
- })
1995
- }, null, 8, ["model-value", "label", "options"])) : O("", !0),
1996
- U.value ? (V(), $(_e, {
1997
- key: 6,
1998
- "model-value": a.value.sparklineDimension ? [a.value.sparklineDimension] : [],
1999
- label: t(m)("report.section.dimension.sparklineDimension"),
2000
- max: 1,
2001
- options: f.value,
2002
- "onUpdate:modelValue": s[11] || (s[11] = (b) => {
2003
- a.value.sparklineDimension = b[0];
2004
- })
2005
- }, null, 8, ["model-value", "label", "options"])) : O("", !0),
2006
- d(xl, {
2007
- modelValue: a.value.metrics,
2008
- "onUpdate:modelValue": s[12] || (s[12] = (b) => a.value.metrics = b),
2009
- options: f.value,
2010
- max: v.config.maxMetric,
2011
- config: a.value,
2012
- "has-row-column": v.config.type === t(P).Table,
2013
- onConfig: s[13] || (s[13] = (b) => {
2014
- a.value = b;
2015
- })
2016
- }, null, 8, ["modelValue", "options", "max", "config", "has-row-column"]),
2017
- d(Il, {
2018
- modelValue: a.value.filters,
2019
- "onUpdate:modelValue": s[14] || (s[14] = (b) => a.value.filters = b),
2020
- options: f.value
2021
- }, null, 8, ["modelValue", "options"]),
2022
- d(Rl, {
2023
- modelValue: a.value.sorts,
2024
- "onUpdate:modelValue": s[15] || (s[15] = (b) => a.value.sorts = b),
2025
- options: f.value
2026
- }, null, 8, ["modelValue", "options"]),
2027
- d(Al, {
2028
- modelValue: a.value.limit,
2029
- "onUpdate:modelValue": s[16] || (s[16] = (b) => a.value.limit = b)
2030
- }, null, 8, ["modelValue"]),
2031
- a.value.conditions ? (V(), $(Yl, {
2032
- key: 7,
2033
- modelValue: a.value.conditions,
2034
- "onUpdate:modelValue": s[17] || (s[17] = (b) => a.value.conditions = b),
2035
- "join-field-options": f.value,
2036
- "main-field-options": L.value
2037
- }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : O("", !0)
2038
- ]),
2039
- _: 1
2040
- });
2041
- };
2042
- }
2043
- }), Jl = { class: "fm-typo-en-title-sm-600" }, De = /* @__PURE__ */ W({
2044
- __name: "TileEditorTabHeader",
2045
- props: /* @__PURE__ */ J({
2046
- icon: {
2047
- type: String,
2048
- required: !0
2049
- }
2050
- }, {
2051
- modelValue: { type: Boolean, required: !0, default: !1 },
2052
- modelModifiers: {}
2053
- }),
2054
- emits: ["update:modelValue"],
2055
- setup(F) {
2056
- const { t: u } = G(), e = Z(F, "modelValue"), i = F;
2057
- return (a, v) => {
2058
- const p = w("FmIcon");
2059
- return V(), M("div", {
2060
- class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
2061
- onClick: v[0] || (v[0] = (C) => e.value = !e.value)
2062
- }, [
2063
- k("p", Jl, j(t(u)("report.tile.setting")), 1),
2064
- v[1] || (v[1] = k("div", { class: "grow" }, null, -1)),
2065
- d(p, {
2066
- name: i.icon
2067
- }, null, 8, ["name"])
2068
- ]);
2069
- };
2070
- }
2071
- }), Gl = /* @__PURE__ */ W({
2072
- __name: "TileEditorTabDesktop",
2073
- props: {
2074
- modelValue: { required: !0, default: !1 },
2075
- modelModifiers: {}
2076
- },
2077
- emits: ["update:modelValue"],
2078
- setup(F) {
2079
- const u = Z(F, "modelValue");
2080
- return (e, i) => (V(), M(Q, null, [
2081
- d(De, {
2082
- modelValue: u.value,
2083
- "onUpdate:modelValue": i[0] || (i[0] = (a) => u.value = a),
2084
- icon: "keyboard_double_arrow_left"
2085
- }, null, 8, ["modelValue"]),
2086
- Be(e.$slots, "default")
2087
- ], 64));
2088
- }
2089
- }), Kl = { class: "fixed bottom-0 w-full" }, Ql = /* @__PURE__ */ W({
2090
- __name: "TileEditorTabMobile",
2091
- props: {
2092
- modelValue: { required: !0, default: !1 },
2093
- modelModifiers: {}
2094
- },
2095
- emits: ["update:modelValue"],
2096
- setup(F) {
2097
- const u = Z(F, "modelValue");
2098
- return (e, i) => {
2099
- const a = w("FmTopSheet");
2100
- return V(), M("div", Kl, [
2101
- d(De, {
2102
- modelValue: u.value,
2103
- "onUpdate:modelValue": i[0] || (i[0] = (v) => u.value = v),
2104
- icon: "keyboard_double_arrow_up"
2105
- }, null, 8, ["modelValue"]),
2106
- d(a, {
2107
- modelValue: u.value,
2108
- "onUpdate:modelValue": i[2] || (i[2] = (v) => u.value = v),
2109
- "fullscreen-size": "sm"
2110
- }, {
2111
- default: I(() => [
2112
- d(De, {
2113
- modelValue: u.value,
2114
- "onUpdate:modelValue": i[1] || (i[1] = (v) => u.value = v),
2115
- icon: "keyboard_double_arrow_down"
2116
- }, null, 8, ["modelValue"]),
2117
- u.value ? Be(e.$slots, "default", { key: 0 }) : O("", !0)
2118
- ]),
2119
- _: 3
2120
- }, 8, ["modelValue"])
2121
- ]);
2122
- };
2123
- }
2124
- }), Zl = { class: "flex gap-16" }, eo = { class: "flex flex-col gap-8 max-w-[120px]" }, lo = { class: "fm-typo-en-body-lg-600" }, oo = { class: "flex flex-col gap-16" }, to = { class: "flex flex-row gap-8" }, ao = /* @__PURE__ */ W({
2125
- __name: "TitleSection",
2126
- props: {
2127
- model: {}
2128
- },
2129
- emits: ["update:model"],
2130
- setup(F, { emit: u }) {
2131
- const e = F, i = u, { t: a } = G(), v = T({
2132
- get: () => e.model.showTitle ?? !1,
2133
- set: (l) => i("update:model", { ...e.model, showTitle: l })
2134
- }), p = T({
2135
- get: () => e.model.titleFontSize ?? 14,
2136
- set: (l) => i("update:model", { ...e.model, titleFontSize: Math.min(Number(l), 24) })
2137
- }), C = T({
2138
- get: () => e.model.titleBold ?? !1,
2139
- set: (l) => i("update:model", { ...e.model, titleBold: l })
2140
- }), m = T({
2141
- get: () => e.model.titleItalic ?? !1,
2142
- set: (l) => i("update:model", { ...e.model, titleItalic: l })
2143
- }), n = T({
2144
- get: () => e.model.titleUnderline ?? !1,
2145
- set: (l) => i("update:model", { ...e.model, titleUnderline: l })
2146
- });
2147
- return (l, g) => {
2148
- const S = w("FmStepperField"), U = w("FmButton"), L = w("FmSwitch");
2149
- return V(), M(Q, null, [
2150
- k("div", null, [
2151
- k("div", Zl, [
2152
- k("div", eo, [
2153
- k("p", lo, j(t(a)("report.section.datasource.title.titleFontSize")), 1),
2154
- d(S, {
2155
- modelValue: p.value,
2156
- "onUpdate:modelValue": g[0] || (g[0] = (f) => p.value = f),
2157
- max: 24,
2158
- min: 1,
2159
- type: "number"
2160
- }, null, 8, ["modelValue"])
2161
- ]),
2162
- k("div", oo, [
2163
- g[5] || (g[5] = k("p", { class: "fm-typo-en-body-lg-600" }, "Text style and format", -1)),
2164
- k("div", to, [
2165
- d(U, {
2166
- "append-icon": "format_bold",
2167
- "model-value": l.model.titleBold ?? !1,
2168
- variant: "tertiary",
2169
- "icon-color": l.model.titleBold ? "neutral-gray-400" : "neutral-gray-300",
2170
- "bg-color": l.model.titleBold ? "neutral-gray-100" : "neutral-white",
2171
- class: "rounded-sm",
2172
- onClick: g[1] || (g[1] = (f) => C.value = !C.value)
2173
- }, null, 8, ["model-value", "icon-color", "bg-color"]),
2174
- d(U, {
2175
- "append-icon": "format_italic",
2176
- "model-value": l.model.titleItalic ?? !1,
2177
- "icon-color": l.model.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
2178
- "bg-color": l.model.titleItalic ? "neutral-gray-100" : "neutral-white",
2179
- class: "rounded-sm",
2180
- onClick: g[2] || (g[2] = (f) => m.value = !m.value)
2181
- }, null, 8, ["model-value", "icon-color", "bg-color"]),
2182
- d(U, {
2183
- "append-icon": "format_underlined",
2184
- "model-value": l.model.titleUnderline ?? !1,
2185
- "icon-color": l.model.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
2186
- "bg-color": l.model.titleUnderline ? "neutral-gray-100" : "neutral-white",
2187
- class: "rounded-sm",
2188
- onClick: g[3] || (g[3] = (f) => n.value = !n.value)
2189
- }, null, 8, ["model-value", "icon-color", "bg-color"])
2190
- ])
2191
- ])
2192
- ])
2193
- ]),
2194
- d(L, {
2195
- modelValue: v.value,
2196
- "onUpdate:modelValue": g[4] || (g[4] = (f) => v.value = f),
2197
- label: t(a)("report.section.datasource.title.showTitle"),
2198
- "label-placement": "right"
2199
- }, null, 8, ["modelValue", "label"])
2200
- ], 64);
2201
- };
2202
- }
2203
- }), no = { class: "flex gap-16 justify-center items-center" }, io = { class: "fm-typo-en-title-sm-600" }, so = { class: "fm-typo-en-body-lg-600" }, uo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ro = { class: "h-[40x]" }, Ie = "YYYY-MM-DD", Xe = /* @__PURE__ */ W({
2204
- __name: "TileEditorTab",
2205
- props: /* @__PURE__ */ J({
2206
- hideConfiguration: {
2207
- type: Boolean,
2208
- default: !1
2209
- }
2210
- }, {
2211
- modelValue: {
2212
- required: !0
2213
- },
2214
- modelModifiers: {}
2215
- }),
2216
- emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
2217
- setup(F, { emit: u }) {
2218
- var y, o;
2219
- const e = il(), { dateRange: i } = ve(e), a = {
2220
- startDate: i.value.startDate,
2221
- endDate: i.value.endDate
2222
- }, v = H({
2223
- startDate: (y = me(i.value.startDate)) == null ? void 0 : y.local().format(Ie),
2224
- endDate: (o = me(i.value.endDate)) == null ? void 0 : o.local().format(Ie)
2225
- });
2226
- ie(
2227
- v,
2228
- ({ startDate: c, endDate: b }) => {
2229
- i.value = {
2230
- startDate: me(c).toISOString(),
2231
- endDate: me(b).toISOString()
2232
- };
2233
- },
2234
- { deep: !0, immediate: !0 }
2235
- ), Ee(() => {
2236
- i.value = { ...a };
2237
- });
2238
- const p = Z(F, "modelValue"), { breakpoints: C } = Pe(), m = F, { promptMessage: n } = Re(), l = u, { t: g } = G();
2239
- function S(c) {
2240
- p.value = yl(c);
2241
- }
2242
- function U() {
2243
- const c = [...p.value.widget.config.joinDatasources || []];
2244
- c.push({ ...ll(p.value.widget.type), conditions: [] }), S({
2245
- ...p.value,
2246
- widget: {
2247
- ...p.value.widget,
2248
- config: {
2249
- ...p.value.widget.config,
2250
- joinDatasources: c
2251
- }
2252
- }
2253
- });
2254
- }
2255
- async function L(c) {
2256
- if (!await n({
2257
- title: g("report.tile.datasource.remove"),
2258
- message: g("report.tile.datasource.confirmRemove", { index: c + 1 })
2259
- })) return;
2260
- const R = [...p.value.widget.config.joinDatasources || []];
2261
- R.splice(c, 1), S({
2262
- ...p.value,
2263
- widget: {
2264
- ...p.value.widget,
2265
- config: {
2266
- ...p.value.widget.config,
2267
- joinDatasources: R
2268
- }
2269
- }
2270
- });
2271
- }
2272
- const f = (c, b) => {
2273
- let R = 1, x = 1;
2274
- switch (c) {
2275
- case P.Scorecard:
2276
- R = 1, x = 2;
2277
- break;
2278
- case P.BarChart:
2279
- case P.StackBarChart:
2280
- case P.LineChart:
2281
- case P.StackLineChart:
2282
- R = 4, x = 6;
2283
- break;
2284
- case P.Table:
2285
- R = 4, x = 12;
2286
- break;
2287
- case P.Circular:
2288
- R = 4, x = 4;
2289
- break;
2290
- case P.Spacer:
2291
- R = 0, x = 12;
2292
- break;
2293
- }
2294
- return {
2295
- size: {
2296
- height: R,
2297
- width: x
2298
- },
2299
- widget: {
2300
- ...b.widget,
2301
- type: c
2302
- }
2303
- };
2304
- }, h = T(
2305
- () => ke.find((c) => c.type === p.value.widget.type)
2306
- ), r = T(() => p.value.widget.config.joinDatasources), s = ye((c) => {
2307
- p.value.widget.title = c;
2308
- }, 500);
2309
- return ie(
2310
- () => p.value.size.height,
2311
- (c) => {
2312
- c < 1 && (p.value.size.height = 1), c > 12 && (p.value.size.height = 12);
2313
- }
2314
- ), ie(
2315
- () => p.value.size.width,
2316
- (c) => {
2317
- c < 1 && (p.value.size.width = 1), c > 12 && (p.value.size.width = 12);
2318
- }
2319
- ), (c, b) => {
2320
- const R = w("FmCircularProgress"), x = w("FmSimpleDateRangePicker"), _ = w("FmTextField"), N = w("FmTextarea"), q = w("FmStepperField"), X = w("FmButton"), ee = w("FmForm");
2321
- return V(), $(Le(t(C).lg || t(C).md ? Gl : Ql), {
2322
- "model-value": m.hideConfiguration,
2323
- "onUpdate:modelValue": b[8] || (b[8] = (D) => l("hideConfiguration", D))
2324
- }, {
2325
- default: I(() => [
2326
- p.value ? (V(), $(ee, {
2327
- key: 1,
2328
- ref: "form",
2329
- class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2330
- }, {
2331
- default: I(() => [
2332
- k("div", no, [
2333
- d(x, {
2334
- modelValue: v.value,
2335
- "onUpdate:modelValue": b[0] || (b[0] = (D) => v.value = D)
2336
- }, null, 8, ["modelValue"])
2337
- ]),
2338
- d(Se, null, {
2339
- header: I(() => [
2340
- k("p", io, j(t(g)("report.tile.widget.details")), 1),
2341
- b[9] || (b[9] = k("div", { class: "grow" }, null, -1))
2342
- ]),
2343
- content: I(() => [
2344
- d(_, {
2345
- "model-value": p.value.widget.title,
2346
- label: t(g)("report.tile.widget.title"),
2347
- placeholder: t(g)("report.tile.widget.titlePlaceholder"),
2348
- "onUpdate:modelValue": t(s)
2349
- }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2350
- d(N, {
2351
- modelValue: p.value.widget.description,
2352
- "onUpdate:modelValue": b[1] || (b[1] = (D) => p.value.widget.description = D),
2353
- disabled: p.value.widget.title === "",
2354
- placeholder: t(g)("report.tile.widget.descriptionPlaceholder"),
2355
- "helper-text": t(g)("report.tile.widget.descriptionHelper")
2356
- }, {
2357
- label: I(() => [
2358
- k("p", so, j(t(g)("report.tile.widget.widgetDescription")), 1),
2359
- k("p", uo, " (" + j(t(g)("report.tile.widget.optional")) + ") ", 1)
2360
- ]),
2361
- _: 1
2362
- }, 8, ["modelValue", "disabled", "placeholder", "helper-text"]),
2363
- d(ao, {
2364
- model: p.value.widget.config,
2365
- "onUpdate:model": b[2] || (b[2] = (D) => p.value.widget.config = D)
2366
- }, null, 8, ["model"]),
2367
- k("div", {
2368
- class: Me(["flex flex-row", `${t(C).sm || t(C).xs ? "gap-16" : "gap-2"}`])
2369
- }, [
2370
- d(q, {
2371
- modelValue: p.value.size.width,
2372
- "onUpdate:modelValue": b[3] || (b[3] = (D) => p.value.size.width = D),
2373
- label: t(g)("report.tile.widget.width"),
2374
- min: 1,
2375
- max: 12
2376
- }, null, 8, ["modelValue", "label"]),
2377
- d(q, {
2378
- modelValue: p.value.size.height,
2379
- "onUpdate:modelValue": b[4] || (b[4] = (D) => p.value.size.height = D),
2380
- label: t(g)("report.tile.widget.height"),
2381
- min: 1,
2382
- max: 12,
2383
- disabled: p.value.widget.type === t(P).Scorecard
2384
- }, null, 8, ["modelValue", "label", "disabled"])
2385
- ], 2)
2386
- ]),
2387
- _: 1
2388
- }),
2389
- d(Se, null, {
2390
- header: I(() => [
2391
- k("p", null, j(t(g)("report.tile.widget.type")), 1),
2392
- b[10] || (b[10] = k("div", { class: "grow" }, null, -1))
2393
- ]),
2394
- content: I(() => [
2395
- d(el, {
2396
- "is-list": !0,
2397
- "model-value": p.value.widget.type,
2398
- class: "grid grid-cols-1 gap-2",
2399
- "child-class": "flex flex-row p-[8px] gap-2",
2400
- "exclude-widge-type": [t(P).Spacer],
2401
- "onUpdate:modelValue": b[5] || (b[5] = (D) => p.value = f(D, p.value))
2402
- }, null, 8, ["model-value", "exclude-widge-type"])
2403
- ]),
2404
- _: 1
2405
- }),
2406
- d(Ne, {
2407
- modelValue: p.value.widget.config,
2408
- "onUpdate:modelValue": b[6] || (b[6] = (D) => p.value.widget.config = D),
2409
- label: t(g)("report.tile.datasource.main"),
2410
- config: h.value
2411
- }, null, 8, ["modelValue", "label", "config"]),
2412
- r.value ? (V(!0), M(Q, { key: 0 }, ce(r.value, (D, A) => (V(), M("div", { key: A }, [
2413
- d(Ne, {
2414
- modelValue: r.value[A],
2415
- "onUpdate:modelValue": (Y) => r.value[A] = Y,
2416
- label: t(g)("report.tile.datasource.join", { index: A + 1 }),
2417
- config: h.value,
2418
- "main-datasource-config": p.value.widget.config,
2419
- closeable: !0,
2420
- onClickClose: (Y) => L(A)
2421
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2422
- ]))), 128)) : O("", !0),
2423
- k("div", ro, [
2424
- d(X, {
2425
- label: t(g)("report.tile.datasource.joinButton"),
2426
- variant: "secondary",
2427
- icon: "add",
2428
- "icon-position": "prepend",
2429
- "border-color": t(he).ColorPrimary,
2430
- "text-color": t(he).ColorPrimary,
2431
- class: "w-full",
2432
- onClick: b[7] || (b[7] = (D) => U())
2433
- }, null, 8, ["label", "border-color", "text-color"])
2434
- ])
2435
- ]),
2436
- _: 1
2437
- }, 512)) : (V(), $(R, { key: 0 }))
2438
- ]),
2439
- _: 1
2440
- }, 8, ["model-value"]);
2441
- };
2442
- }
2443
- }), mo = { class: "flex flex-col gap-8" }, co = { class: "pl-32 flex flex-col gap-8" }, po = { class: "fm-typo-en-body-lg-600" }, vo = { class: "flex flex-row gap-8" }, fo = { class: "fm-typo-en-body-lg-600" }, go = { class: "flex flex-row gap-8" }, bo = /* @__PURE__ */ W({
2444
- __name: "LabelSection",
2445
- props: {
2446
- model: {}
2447
- },
2448
- emits: ["update:model"],
2449
- setup(F, { emit: u }) {
2450
- const e = F, i = u, { t: a } = G(), v = T({
2451
- get: () => e.model.showLabel ?? !1,
2452
- set: (U) => {
2453
- i("update:model", { ...e.model, showLabel: U });
2454
- }
2455
- }), p = T({
2456
- get: () => e.model.labelRotation ?? 0,
2457
- set: (U) => i("update:model", { ...e.model, labelRotation: U })
2458
- }), C = T({
2459
- get: () => e.model.labelOffset ?? 0,
2460
- set: (U) => i("update:model", { ...e.model, labelOffset: U })
2461
- }), m = T({
2462
- get: () => e.model.labelFontSize ?? 12,
2463
- set: (U) => i("update:model", { ...e.model, labelFontSize: U })
2464
- }), n = (U) => {
2465
- i("update:model", {
2466
- ...e.model,
2467
- labelAlign: e.model.labelAlign === U ? void 0 : U
2468
- });
2469
- }, l = (U) => {
2470
- i("update:model", {
2471
- ...e.model,
2472
- labelAnchor: e.model.labelAnchor === U ? void 0 : U
2473
- });
2474
- }, g = [
2475
- { icon: "align_horizontal_left", value: de.left, tooltip: "alignLeft" },
2476
- { icon: "align_justify_center", value: de.center, tooltip: "alignCenter" },
2477
- { icon: "align_horizontal_right", value: de.right, tooltip: "alignRight" },
2478
- { icon: "align_justify_flex_start", value: de.start, tooltip: "alignStart" },
2479
- { icon: "align_justify_flex_end", value: de.end, tooltip: "alignEnd" },
2480
- { icon: "align_flex_start", value: de.top, tooltip: "alignTop" },
2481
- { icon: "align_flex_end", value: de.bottom, tooltip: "alignBottom" }
2482
- ], S = [
2483
- { icon: "format_align_left", value: Ce.start, tooltip: "anchorStart" },
2484
- { icon: "format_align_center", value: Ce.center, tooltip: "anchorCenter" },
2485
- { icon: "format_align_right", value: Ce.end, tooltip: "anchorEnd" }
2486
- ];
2487
- return (U, L) => {
2488
- const f = w("FmCheckbox"), h = w("FmButton"), r = w("FmTooltip"), s = w("FmTextField"), y = w("FmStepperField");
2489
- return V(), M("div", mo, [
2490
- d(f, {
2491
- modelValue: v.value,
2492
- "onUpdate:modelValue": L[0] || (L[0] = (o) => v.value = o),
2493
- value: !1,
2494
- label: t(a)("report.section.datasource.label.showLabel"),
2495
- "label-placement": "right",
2496
- class: "fm-typo-en-body-lg-400"
2497
- }, null, 8, ["modelValue", "label"]),
2498
- ue(k("div", co, [
2499
- k("p", po, j(t(a)("report.section.datasource.alignment.textAlignment")), 1),
2500
- k("div", vo, [
2501
- (V(), M(Q, null, ce(g, ({ icon: o, value: c, tooltip: b }) => d(r, {
2502
- key: c,
2503
- variant: "plain",
2504
- placement: "top",
2505
- content: t(a)(`report.section.datasource.alignment.alignOptions.${b}`),
2506
- "z-index": 50
2507
- }, {
2508
- default: I(() => [
2509
- d(h, {
2510
- "append-icon": o,
2511
- variant: "tertiary",
2512
- "icon-color": U.model.labelAlign === c ? "neutral-gray-400" : "neutral-gray-300",
2513
- "bg-color": U.model.labelAlign === c ? "neutral-gray-100" : "neutral-white",
2514
- class: "rounded-sm",
2515
- onClick: (R) => n(c)
2516
- }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2517
- ]),
2518
- _: 2
2519
- }, 1032, ["content"])), 64))
2520
- ]),
2521
- k("p", fo, j(t(a)("report.section.datasource.alignment.anchor")), 1),
2522
- k("div", go, [
2523
- (V(), M(Q, null, ce(S, ({ icon: o, value: c, tooltip: b }) => d(r, {
2524
- key: c,
2525
- variant: "plain",
2526
- placement: "top",
2527
- content: t(a)(`report.section.datasource.alignment.anchorOptions.${b}`),
2528
- "z-index": 50
2529
- }, {
2530
- default: I(() => [
2531
- d(h, {
2532
- "append-icon": o,
2533
- variant: "tertiary",
2534
- "icon-color": U.model.labelAnchor === c ? "neutral-gray-400" : "neutral-gray-300",
2535
- "bg-color": U.model.labelAnchor === c ? "neutral-gray-100" : "neutral-white",
2536
- class: "rounded-sm",
2537
- onClick: (R) => l(c)
2538
- }, null, 8, ["append-icon", "icon-color", "bg-color", "onClick"])
2539
- ]),
2540
- _: 2
2541
- }, 1032, ["content"])), 64))
2542
- ]),
2543
- d(s, {
2544
- modelValue: p.value,
2545
- "onUpdate:modelValue": L[1] || (L[1] = (o) => p.value = o),
2546
- label: t(a)("report.section.datasource.alignment.rotation"),
2547
- type: "number",
2548
- min: -180,
2549
- max: 180,
2550
- step: 1
2551
- }, null, 8, ["modelValue", "label"]),
2552
- d(s, {
2553
- modelValue: C.value,
2554
- "onUpdate:modelValue": L[2] || (L[2] = (o) => C.value = o),
2555
- label: t(a)("report.section.datasource.alignment.offset"),
2556
- type: "number"
2557
- }, null, 8, ["modelValue", "label"]),
2558
- d(y, {
2559
- modelValue: m.value,
2560
- "onUpdate:modelValue": L[3] || (L[3] = (o) => m.value = o),
2561
- label: t(a)("report.section.datasource.fontSize"),
2562
- type: "number",
2563
- min: 1
2564
- }, null, 8, ["modelValue", "label"])
2565
- ], 512), [
2566
- [re, v.value]
2567
- ])
2568
- ]);
2569
- };
2570
- }
2571
- }), yo = { class: "flex flex-col gap-8" }, ho = { class: "pl-32 flex flex-col gap-8" }, Vo = { class: "pl-32 flex flex-col gap-8" }, Fo = { class: "pl-32 flex flex-col gap-8" }, wo = { class: "pl-32 flex flex-col gap-8" }, xo = { class: "pl-32 flex flex-col gap-8" }, ko = { class: "pl-32 flex flex-col gap-8" }, Co = /* @__PURE__ */ W({
2572
- __name: "XySection",
2573
- props: {
2574
- model: {}
2575
- },
2576
- emits: ["update:model"],
2577
- setup(F, { emit: u }) {
2578
- const e = F, i = u, { t: a } = G(), v = T({
2579
- get: () => e.model.showX ?? !0,
2580
- set: (f) => {
2581
- i("update:model", { ...e.model, showX: f });
2582
- }
2583
- }), p = T({
2584
- get: () => e.model.showXGrid ?? !1,
2585
- set: (f) => {
2586
- i("update:model", { ...e.model, showXGrid: f });
2587
- }
2588
- }), C = T({
2589
- get: () => e.model.showXTick ?? !0,
2590
- set: (f) => {
2591
- i("update:model", { ...e.model, showXTick: f });
2592
- }
2593
- }), m = T({
2594
- get: () => e.model.showY ?? !0,
2595
- set: (f) => {
2596
- i("update:model", { ...e.model, showY: f });
2597
- }
2598
- }), n = T({
2599
- get: () => e.model.showYGrid ?? !0,
2600
- set: (f) => {
2601
- i("update:model", { ...e.model, showYGrid: f });
2602
- }
2603
- }), l = T({
2604
- get: () => e.model.showYTick ?? !0,
2605
- set: (f) => {
2606
- i("update:model", { ...e.model, showYTick: f });
2607
- }
2608
- }), g = T({
2609
- get: () => e.model.showXTitle ?? !1,
2610
- set: (f) => {
2611
- i("update:model", { ...e.model, showXTitle: f });
2612
- }
2613
- }), S = T({
2614
- get: () => e.model.showYTitle ?? !1,
2615
- set: (f) => {
2616
- i("update:model", { ...e.model, showYTitle: f });
2617
- }
2618
- }), U = ye((f) => {
2619
- i("update:model", { ...e.model, xTitle: f });
2620
- }, 500), L = ye((f) => {
2621
- i("update:model", { ...e.model, yTitle: f });
2622
- }, 500);
2623
- return Ue(() => {
2624
- var f, h, r, s;
2625
- !e.model.xTitle && ((h = (f = e.model.metrics) == null ? void 0 : f[0]) != null && h.label) && U(e.model.metrics[0].label), !e.model.yTitle && ((s = (r = e.model.dimensions) == null ? void 0 : r[0]) != null && s.label) && L(e.model.dimensions[0].label);
2626
- }), (f, h) => {
2627
- const r = w("FmCheckbox"), s = w("FmStepperField"), y = w("FmTextField");
2628
- return V(), M("div", yo, [
2629
- d(r, {
2630
- modelValue: v.value,
2631
- "onUpdate:modelValue": h[0] || (h[0] = (o) => v.value = o),
2632
- label: t(a)("report.section.datasource.axis.showX"),
2633
- "label-placement": "right",
2634
- value: !0
2635
- }, null, 8, ["modelValue", "label"]),
2636
- ue(k("div", ho, [
2637
- d(r, {
2638
- modelValue: p.value,
2639
- "onUpdate:modelValue": h[1] || (h[1] = (o) => p.value = o),
2640
- label: t(a)("report.section.datasource.axis.showGrid"),
2641
- "label-placement": "right",
2642
- value: !1
2643
- }, null, 8, ["modelValue", "label"]),
2644
- d(r, {
2645
- modelValue: C.value,
2646
- "onUpdate:modelValue": h[2] || (h[2] = (o) => C.value = o),
2647
- label: t(a)("report.section.datasource.axis.showTick"),
2648
- "label-placement": "right",
2649
- value: !0
2650
- }, null, 8, ["modelValue", "label"]),
2651
- ue(k("div", Vo, [
2652
- d(s, {
2653
- label: t(a)("report.section.datasource.fontSize"),
2654
- type: "number",
2655
- "model-value": f.model.xTickFontSize ?? 12,
2656
- min: 1,
2657
- "onUpdate:modelValue": h[3] || (h[3] = (o) => {
2658
- i("update:model", { ...f.model, xTickFontSize: Number(o) });
2659
- })
2660
- }, null, 8, ["label", "model-value"])
2661
- ], 512), [
2662
- [re, f.model.showXTick ?? !0]
2663
- ]),
2664
- d(r, {
2665
- modelValue: g.value,
2666
- "onUpdate:modelValue": h[4] || (h[4] = (o) => g.value = o),
2667
- label: t(a)("report.section.datasource.axis.showTitle"),
2668
- "label-placement": "right",
2669
- value: !0
2670
- }, null, 8, ["modelValue", "label"]),
2671
- ue(k("div", Fo, [
2672
- d(y, {
2673
- "model-value": f.model.xTitle,
2674
- label: t(a)("report.common.title"),
2675
- placeholder: t(a)("report.tile.widget.titlePlaceholder"),
2676
- "onUpdate:modelValue": t(U)
2677
- }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2678
- d(s, {
2679
- label: t(a)("report.section.datasource.fontSize"),
2680
- type: "number",
2681
- "model-value": f.model.xTitleFontSize ?? 12,
2682
- min: 1,
2683
- "onUpdate:modelValue": h[5] || (h[5] = (o) => {
2684
- i("update:model", { ...f.model, xTitleFontSize: Number(o) });
2685
- })
2686
- }, null, 8, ["label", "model-value"])
2687
- ], 512), [
2688
- [re, g.value]
2689
- ])
2690
- ], 512), [
2691
- [re, f.model.showX ?? !0]
2692
- ]),
2693
- d(r, {
2694
- modelValue: m.value,
2695
- "onUpdate:modelValue": h[6] || (h[6] = (o) => m.value = o),
2696
- label: t(a)("report.section.datasource.axis.showY"),
2697
- "label-placement": "right",
2698
- value: !0
2699
- }, null, 8, ["modelValue", "label"]),
2700
- ue(k("div", wo, [
2701
- d(r, {
2702
- modelValue: n.value,
2703
- "onUpdate:modelValue": h[7] || (h[7] = (o) => n.value = o),
2704
- label: t(a)("report.section.datasource.axis.showGrid"),
2705
- "label-placement": "right",
2706
- value: !1
2707
- }, null, 8, ["modelValue", "label"]),
2708
- d(r, {
2709
- modelValue: l.value,
2710
- "onUpdate:modelValue": h[8] || (h[8] = (o) => l.value = o),
2711
- label: t(a)("report.section.datasource.axis.showTick"),
2712
- "label-placement": "right",
2713
- value: !0
2714
- }, null, 8, ["modelValue", "label"]),
2715
- ue(k("div", xo, [
2716
- d(s, {
2717
- label: t(a)("report.section.datasource.fontSize"),
2718
- type: "number",
2719
- "model-value": f.model.yTickFontSize ?? 12,
2720
- min: 1,
2721
- "onUpdate:modelValue": h[9] || (h[9] = (o) => {
2722
- i("update:model", { ...f.model, yTickFontSize: Number(o) });
2723
- })
2724
- }, null, 8, ["label", "model-value"])
2725
- ], 512), [
2726
- [re, f.model.showYTick ?? !0]
2727
- ]),
2728
- d(r, {
2729
- modelValue: S.value,
2730
- "onUpdate:modelValue": h[10] || (h[10] = (o) => S.value = o),
2731
- label: t(a)("report.section.datasource.axis.showTitle"),
2732
- "label-placement": "right",
2733
- value: !0
2734
- }, null, 8, ["modelValue", "label"]),
2735
- ue(k("div", ko, [
2736
- d(y, {
2737
- "model-value": f.model.yTitle,
2738
- label: t(a)("report.common.title"),
2739
- placeholder: t(a)("report.tile.widget.titlePlaceholder"),
2740
- "onUpdate:modelValue": t(L)
2741
- }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2742
- d(s, {
2743
- label: t(a)("report.section.datasource.fontSize"),
2744
- type: "number",
2745
- "model-value": f.model.yTitleFontSize ?? 12,
2746
- min: 1,
2747
- "onUpdate:modelValue": h[11] || (h[11] = (o) => {
2748
- i("update:model", { ...f.model, yTitleFontSize: Number(o) });
2749
- })
2750
- }, null, 8, ["label", "model-value"])
2751
- ], 512), [
2752
- [re, S.value]
2753
- ])
2754
- ], 512), [
2755
- [re, f.model.showY ?? !0]
2756
- ])
2757
- ]);
2758
- };
2759
- }
2760
- }), _o = { class: "flex flex-col gap-8" }, So = { class: "pl-32 flex flex-col gap-8" }, To = /* @__PURE__ */ W({
2761
- __name: "LegendSection",
2762
- props: {
2763
- model: {},
2764
- isCircularWidget: { type: Boolean }
2765
- },
2766
- emits: ["update:model"],
2767
- setup(F, { emit: u }) {
2768
- const e = F, i = u, { t: a } = G(), v = [
2769
- { label: a("report.section.datasource.position.top"), value: "top" },
2770
- { label: a("report.section.datasource.position.bottom"), value: "bottom" },
2771
- { label: a("report.section.datasource.position.left"), value: "left" },
2772
- { label: a("report.section.datasource.position.right"), value: "right" }
2773
- ], p = T({
2774
- get: () => e.model.showLegend !== void 0 ? e.model.showLegend : e.isCircularWidget === !0,
2775
- set: (l) => {
2776
- i("update:model", { ...e.model, showLegend: l });
2777
- }
2778
- }), C = T({
2779
- get: () => e.model.usePointStyle ?? !0,
2780
- set: (l) => {
2781
- i("update:model", { ...e.model, usePointStyle: l });
2782
- }
2783
- }), m = T({
2784
- get: () => e.model.legendMaxHeight ?? 54,
2785
- set: (l) => {
2786
- i("update:model", { ...e.model, legendMaxHeight: l });
2787
- }
2788
- }), n = T({
2789
- get: () => e.model.legendMaxWidth ?? 54,
2790
- set: (l) => {
2791
- i("update:model", { ...e.model, legendMaxWidth: l });
2792
- }
2793
- });
2794
- return (l, g) => {
2795
- const S = w("FmCheckbox"), U = w("FmSelect"), L = w("FmStepperField");
2796
- return V(), M("div", _o, [
2797
- d(S, {
2798
- modelValue: p.value,
2799
- "onUpdate:modelValue": g[0] || (g[0] = (f) => p.value = f),
2800
- class: "fm-typo-en-body-lg-400",
2801
- value: !1,
2802
- label: t(a)("report.section.datasource.legend.showLegend")
2803
- }, null, 8, ["modelValue", "label"]),
2804
- ue(k("div", So, [
2805
- d(U, {
2806
- label: t(a)("report.section.datasource.position.showPosition"),
2807
- items: v,
2808
- "model-value": l.model.legendPosition ?? "top",
2809
- "onUpdate:modelValue": g[1] || (g[1] = (f) => i("update:model", { ...l.model, legendPosition: f }))
2810
- }, null, 8, ["label", "model-value"]),
2811
- d(S, {
2812
- modelValue: C.value,
2813
- "onUpdate:modelValue": g[2] || (g[2] = (f) => C.value = f),
2814
- label: t(a)("report.section.datasource.legend.usePointStyle"),
2815
- value: !1
2816
- }, null, 8, ["modelValue", "label"]),
2817
- l.model.legendPosition === "top" || l.model.legendPosition === "bottom" || !l.model.legendPosition ? (V(), $(L, {
2818
- key: 0,
2819
- label: t(a)("report.section.datasource.legend.maxHeight"),
2820
- "model-value": m.value,
2821
- "onUpdate:modelValue": g[3] || (g[3] = (f) => i("update:model", { ...l.model, legendMaxHeight: f }))
2822
- }, null, 8, ["label", "model-value"])) : O("", !0),
2823
- l.model.legendPosition === "left" || l.model.legendPosition === "right" ? (V(), $(L, {
2824
- key: 1,
2825
- label: t(a)("report.section.datasource.legend.maxWidth"),
2826
- "model-value": n.value,
2827
- "onUpdate:modelValue": g[4] || (g[4] = (f) => i("update:model", { ...l.model, legendMaxWidth: f }))
2828
- }, null, 8, ["label", "model-value"])) : O("", !0)
2829
- ], 512), [
2830
- [re, p.value]
2831
- ])
2832
- ]);
2833
- };
2834
- }
2835
- }), Do = { class: "flex flex-row gap-16" }, Uo = /* @__PURE__ */ W({
2836
- __name: "ChartSizeSection",
2837
- props: {
2838
- model: {}
2839
- },
2840
- emits: ["update:model"],
2841
- setup(F, { emit: u }) {
2842
- const e = F, i = u, { t: a } = G(), v = T({
2843
- get: () => e.model.chartHeight ?? null,
2844
- set: (C) => {
2845
- i("update:model", { ...e.model, chartHeight: C ?? void 0 });
2846
- }
2847
- }), p = T({
2848
- get: () => e.model.chartWidth ?? null,
2849
- set: (C) => {
2850
- i("update:model", { ...e.model, chartWidth: C ?? void 0 });
2851
- }
2852
- });
2853
- return (C, m) => {
2854
- const n = w("FmStepperField");
2855
- return V(), M("div", Do, [
2856
- d(n, {
2857
- modelValue: v.value,
2858
- "onUpdate:modelValue": m[0] || (m[0] = (l) => v.value = l),
2859
- type: "number",
2860
- label: t(a)("report.section.datasource.chartHeight"),
2861
- suffix: "px",
2862
- min: 1,
2863
- placeholder: "Auto"
2864
- }, null, 8, ["modelValue", "label"]),
2865
- d(n, {
2866
- modelValue: p.value,
2867
- "onUpdate:modelValue": m[1] || (m[1] = (l) => p.value = l),
2868
- type: "number",
2869
- label: t(a)("report.section.datasource.chartWidth"),
2870
- suffix: "px",
2871
- min: 1,
2872
- placeholder: "Auto"
2873
- }, null, 8, ["modelValue", "label"])
2874
- ]);
2875
- };
2876
- }
2877
- }), $o = { class: "flex flex-col gap-16" }, Oo = { class: "flex flex-col gap-8" }, No = { class: "flex flex-col gap-8" }, Io = /* @__PURE__ */ W({
2878
- __name: "StyleDatasource",
2879
- props: /* @__PURE__ */ J({
2880
- label: {
2881
- type: String,
2882
- default: "Label"
2883
- },
2884
- config: {
2885
- type: Object,
2886
- default: null
2887
- },
2888
- closeable: {
2889
- type: Boolean,
2890
- default: !1
2891
- },
2892
- mainDatasourceConfig: {
2893
- type: Object,
2894
- default: () => {
2895
- }
2896
- },
2897
- modelValue: {
2898
- type: Object,
2899
- default: () => {
2900
- }
2901
- }
2902
- }, {
2903
- modelValue: { required: !0 },
2904
- modelModifiers: {}
2905
- }),
2906
- emits: /* @__PURE__ */ J(["click-close"], ["update:modelValue"]),
2907
- setup(F, { emit: u }) {
2908
- const e = Z(F, "modelValue");
2909
- ie(
2910
- [() => e.value.dimensions, () => e.value.metrics],
2911
- () => {
2912
- const { rowIds: m, columnIds: n } = we(e.value);
2913
- e.value.rowIds = m, e.value.columnIds = n;
2914
- },
2915
- { deep: !0 }
2916
- );
2917
- const i = F, a = u, { t: v, te: p } = G(), C = T(() => i.config.type === P.Circular);
2918
- return (m, n) => {
2919
- const l = w("FmButton");
2920
- return V(), M(Q, null, [
2921
- n[6] || (n[6] = k("div", { class: "grow" }, null, -1)),
2922
- i.closeable ? (V(), $(l, {
2923
- key: 0,
2924
- icon: "close",
2925
- variant: "tertiary",
2926
- size: "md",
2927
- onClick: n[0] || (n[0] = ae((g) => a("click-close"), ["stop"]))
2928
- })) : O("", !0),
2929
- k("div", $o, [
2930
- i.config.hasChart ? (V(), $(Uo, {
2931
- key: 0,
2932
- model: e.value,
2933
- "onUpdate:model": n[1] || (n[1] = (g) => e.value = g)
2934
- }, null, 8, ["model"])) : O("", !0),
2935
- k("div", Oo, [
2936
- n[5] || (n[5] = k("p", { class: "fm-typo-en-body-lg-600" }, "Configuration", -1)),
2937
- k("div", No, [
2938
- i.config.hasLabel ? (V(), $(bo, {
2939
- key: 0,
2940
- model: e.value,
2941
- "onUpdate:model": n[2] || (n[2] = (g) => e.value = g)
2942
- }, null, 8, ["model"])) : O("", !0),
2943
- i.config.hasLegend ? (V(), $(To, {
2944
- key: 1,
2945
- model: e.value,
2946
- "is-circular-widget": C.value,
2947
- "onUpdate:model": n[3] || (n[3] = (g) => e.value = g)
2948
- }, null, 8, ["model", "is-circular-widget"])) : O("", !0),
2949
- i.config.hasXy ? (V(), $(Co, {
2950
- key: 2,
2951
- model: e.value,
2952
- "onUpdate:model": n[4] || (n[4] = (g) => e.value = g)
2953
- }, null, 8, ["model"])) : O("", !0)
2954
- ])
2955
- ])
2956
- ])
2957
- ], 64);
2958
- };
2959
- }
2960
- }), Bo = { class: "fixed bottom-6 right-6" }, Lo = { class: "flex items-center gap-8" }, Mo = /* @__PURE__ */ W({
2961
- __name: "StyleEditorTab",
2962
- props: {
2963
- modelValue: {
2964
- required: !0
2965
- },
2966
- modelModifiers: {}
2967
- },
2968
- emits: ["update:modelValue"],
2969
- setup(F) {
2970
- const { t: u } = G(), e = Z(F, "modelValue"), i = T(
2971
- () => ke.find((v) => v.type === e.value.widget.type)
2972
- ), a = H(!1);
2973
- return (v, p) => {
2974
- const C = w("FmCircularProgress"), m = w("FmButton"), n = w("FmSideSheet");
2975
- return V(), $(n, {
2976
- modelValue: a.value,
2977
- "onUpdate:modelValue": p[2] || (p[2] = (l) => a.value = l),
2978
- "close-button": !1,
2979
- "no-overlay": "",
2980
- "dismiss-away": !0
2981
- }, {
2982
- "side-sheet-button": I(() => [
2983
- k("div", Bo, [
2984
- d(m, {
2985
- label: "Style setting",
2986
- icon: "edit",
2987
- variant: "secondary",
2988
- size: "md"
2989
- })
2990
- ])
2991
- ]),
2992
- "side-sheet-header": I(() => [
2993
- k("div", Lo, [
2994
- d(m, {
2995
- "prepend-icon": "arrow_back",
2996
- variant: "tertiary",
2997
- class: "fm-icon--rounded fm-icon--md text-fm-color-black",
2998
- onClick: p[0] || (p[0] = (l) => a.value = !1)
2999
- }),
3000
- p[3] || (p[3] = k("p", { class: "fm-typo-en-title-sm-600" }, "Report style settings", -1))
3001
- ])
3002
- ]),
3003
- default: I(() => [
3004
- e.value ? O("", !0) : (V(), $(C, { key: 0 })),
3005
- d(Io, {
3006
- modelValue: e.value.widget.config,
3007
- "onUpdate:modelValue": p[1] || (p[1] = (l) => e.value.widget.config = l),
3008
- config: i.value
3009
- }, null, 8, ["modelValue", "config"])
3010
- ]),
3011
- _: 1
3012
- }, 8, ["modelValue"]);
3013
- };
3014
- }
3015
- }), jo = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[510px]" }, Ro = { class: "flex bg-fm-color-neutral-white w-[88px]" }, zo = { class: "w-full overflow-y-auto" }, Po = {
3016
- class: "grid grid-cols-12 w-full p-24",
3017
- style: { backgroundColor: "#F6F8FC" }
3018
- }, Ao = /* @__PURE__ */ W({
3019
- __name: "TileEditorDesktop",
3020
- props: /* @__PURE__ */ J({
3021
- hideConfiguration: { type: Boolean, required: !0, default: !1 },
3022
- index: { type: Number, required: !0, default: 0 }
3023
- }, {
3024
- modelValue: {
3025
- required: !0
3026
- },
3027
- modelModifiers: {}
3028
- }),
3029
- emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
3030
- setup(F, { emit: u }) {
3031
- const e = Z(F, "modelValue"), i = F, a = T(
3032
- () => ke.find((m) => {
3033
- var n;
3034
- return m.type === ((n = e.value) == null ? void 0 : n.widget.type);
3035
- })
3036
- ), v = u, p = [
3037
- P.BarChart,
3038
- P.StackBarChart,
3039
- P.LineChart,
3040
- P.StackLineChart,
3041
- P.Circular
3042
- ], C = T(() => p.includes(e.value.widget.type));
3043
- return (m, n) => {
3044
- const l = w("FmCircularProgress"), g = w("FmButton");
3045
- return V(), M("div", null, [
3046
- e.value ? (V(), M(Q, { key: 1 }, [
3047
- d(ol, {
3048
- "model-value": !F.hideConfiguration
3049
- }, {
3050
- right: I(() => [
3051
- k("div", jo, [
3052
- d(Xe, {
3053
- modelValue: e.value,
3054
- "onUpdate:modelValue": n[0] || (n[0] = (S) => e.value = S),
3055
- config: a.value,
3056
- "hide-configuration": F.hideConfiguration,
3057
- onHideConfiguration: n[1] || (n[1] = (S) => {
3058
- v("hideConfiguration", S);
3059
- })
3060
- }, null, 8, ["modelValue", "config", "hide-configuration"])
3061
- ])
3062
- ]),
3063
- left: I(() => [
3064
- k("div", Ro, [
3065
- d(g, {
3066
- variant: "secondary",
3067
- icon: "keyboard_double_arrow_right",
3068
- "border-color": t(he).ColorPrimary,
3069
- "text-color": t(he).ColorPrimary,
3070
- class: "m-24 my-16",
3071
- size: "md",
3072
- onClick: n[2] || (n[2] = (S) => v("hideConfiguration", !i.hideConfiguration))
3073
- }, null, 8, ["border-color", "text-color"])
3074
- ])
3075
- ]),
3076
- _: 1
3077
- }, 8, ["model-value"]),
3078
- k("div", zo, [
3079
- k("div", Po, [
3080
- e.value ? (V(), $(Ae, {
3081
- key: 0,
3082
- "model-value": e.value,
3083
- index: i.index,
3084
- "hide-export": !0
3085
- }, null, 8, ["model-value", "index"])) : (V(), $(qe, { key: 1 }))
3086
- ])
3087
- ]),
3088
- C.value ? (V(), $(Mo, {
3089
- key: 0,
3090
- modelValue: e.value,
3091
- "onUpdate:modelValue": n[3] || (n[3] = (S) => e.value = S),
3092
- "hide-configuration": F.hideConfiguration,
3093
- onHideConfiguration: n[4] || (n[4] = (S) => {
3094
- v("hideConfiguration", S);
3095
- })
3096
- }, null, 8, ["modelValue", "hide-configuration"])) : O("", !0)
3097
- ], 64)) : (V(), $(l, { key: 0 }))
3098
- ]);
3099
- };
3100
- }
3101
- }), qo = {
3102
- key: 0,
3103
- class: "flex w-full justify-center items-center"
3104
- }, Ho = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, Wo = /* @__PURE__ */ W({
3105
- __name: "TileEditorMobile",
3106
- props: /* @__PURE__ */ J({
3107
- hideConfiguration: { type: Boolean, required: !0, default: !1 },
3108
- index: { type: Number, required: !0, default: 0 }
3109
- }, {
3110
- modelValue: {
3111
- required: !0
3112
- },
3113
- modelModifiers: {}
3114
- }),
3115
- emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
3116
- setup(F, { emit: u }) {
3117
- const e = Z(F, "modelValue"), i = F, a = T(
3118
- () => ke.find((p) => {
3119
- var C;
3120
- return p.type === ((C = e.value) == null ? void 0 : C.widget.type);
3121
- })
3122
- ), v = u;
3123
- return (p, C) => {
3124
- const m = w("FmCircularProgress");
3125
- return V(), M("div", null, [
3126
- e.value ? (V(), M(Q, { key: 1 }, [
3127
- k("div", Ho, [
3128
- e.value ? (V(), $(Ae, {
3129
- key: 0,
3130
- "model-value": e.value,
3131
- index: i.index,
3132
- "hide-export": !0
3133
- }, null, 8, ["model-value", "index"])) : (V(), $(qe, { key: 1 }))
3134
- ]),
3135
- d(Xe, {
3136
- modelValue: e.value,
3137
- "onUpdate:modelValue": C[0] || (C[0] = (n) => e.value = n),
3138
- config: a.value,
3139
- "hide-configuration": F.hideConfiguration,
3140
- onHideConfiguration: C[1] || (C[1] = (n) => {
3141
- v("hideConfiguration", n);
3142
- })
3143
- }, null, 8, ["modelValue", "config", "hide-configuration"])
3144
- ], 64)) : (V(), M("div", qo, [
3145
- d(m)
3146
- ]))
3147
- ]);
3148
- };
3149
- }
3150
- }), Xo = {
3151
- key: 0,
3152
- class: "fm-typo-en-title-md-600"
3153
- }, st = /* @__PURE__ */ W({
3154
- __name: "TileEditor",
3155
- setup(F) {
3156
- const { rowHeight: u, colWidths: e } = ve(Fe()), i = Ke(), a = Qe(), v = al(), { currentSelectWidgetType: p, editingReport: C, editingTile: m, editingTileIndex: n } = ve(v), { breakpoints: l } = Pe(), { promptMessage: g } = Re(), { t: S } = G(), U = H(!1);
3157
- function L() {
3158
- p.value = void 0, m.value = void 0, n.value = -1, a.back();
3159
- }
3160
- async function f() {
3161
- var s;
3162
- if (!C.value) return;
3163
- await g({
3164
- title: S("report.tile.save.title"),
3165
- message: S("report.tile.save.confirm", { title: (s = m.value) == null ? void 0 : s.widget.title })
3166
- }) && m.value && (m.value.widget.config = {
3167
- ...m.value.widget.config,
3168
- rowHeight: u.value,
3169
- colWidths: [...e.value]
3170
- }, n.value === -1 ? C.value.tiles.push(m.value) : C.value.tiles[n.value] = m.value, L());
3171
- }
3172
- async function h() {
3173
- var s;
3174
- if (!C.value) return;
3175
- await g({
3176
- title: S("report.tile.cancel.title"),
3177
- message: S("report.tile.cancel.confirm", { title: (s = m.value) == null ? void 0 : s.widget.title })
3178
- }) && L();
3179
- }
3180
- return Ue(() => {
3181
- C.value || a.push({ name: "reports" });
3182
- }), (r, s) => {
3183
- const y = w("FmPageHead");
3184
- return V(), $(tl, null, {
3185
- default: I(() => [
3186
- d(y, {
3187
- actions: [
3188
- { label: "Cancel", value: "cancel", isPrimary: !1 },
3189
- { label: "Save", value: "save", isPrimary: !0 }
3190
- ],
3191
- "onClick:action": s[0] || (s[0] = (o) => {
3192
- o === "cancel" && h(), o === "save" && f();
3193
- })
3194
- }, {
3195
- title: I(() => {
3196
- var o;
3197
- return [
3198
- t(l).lg || t(l).md ? (V(), M("p", Xo, j(t($e)(((o = t(m)) == null ? void 0 : o.widget.type) ?? "New report")), 1)) : O("", !0)
3199
- ];
3200
- }),
3201
- _: 1
3202
- }),
3203
- t(m) ? (V(), $(Le(t(l).lg || t(l).md ? Ao : Wo), {
3204
- key: 0,
3205
- modelValue: t(m),
3206
- "onUpdate:modelValue": s[1] || (s[1] = (o) => Ge(m) ? m.value = o : null),
3207
- class: Me(`${t(l).lg || t(l).md ? "flex" : ""} w-full`),
3208
- style: Je({ height: `calc( 100% - ${t(l).lg || t(l).md ? 72 : 64}px)` }),
3209
- "hide-configuration": U.value,
3210
- index: Number(t(i).params.tileIndex),
3211
- onHideConfiguration: s[2] || (s[2] = (o) => U.value = o)
3212
- }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : O("", !0)
3213
- ]),
3214
- _: 1
3215
- });
3216
- };
3217
- }
3218
- });
3219
- export {
3220
- st as default
3221
- };