@feedmepos/mf-report 5.21.56 → 5.21.57

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