@feedmepos/mf-report 5.24.6 → 5.25.0-beta.0

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