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