@feedmepos/mf-report 5.10.9-beta.0 → 5.11.0-beta.0

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