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