@feedmepos/mf-report 5.22.7 → 5.22.8

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