@feedmepos/mf-report 5.21.44 → 5.21.46

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