@feedmepos/mf-report 5.5.7-beta.0 → 5.5.8-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.
@@ -1,2332 +0,0 @@
1
- import { defineComponent as W, mergeModels as z, useModel as Y, computed as N, ref as A, resolveComponent as y, createElementBlock as L, openBlock as p, createVNode as d, createElementVNode as x, unref as i, withCtx as C, toDisplayString as I, Fragment as Q, renderList as se, withModifiers as ee, createTextVNode as ne, watch as re, createCommentVNode as T, createBlock as k, renderSlot as Ce, resolveDynamicComponent as _e, normalizeClass as Te, onMounted as Le, normalizeStyle as Be, isRef as Me } from "vue";
2
- import { useRoute as Re, useRouter as je } from "vue-router";
3
- import { h as Ee, d as ce, S as fe, W as Ae, a as qe, T as Pe, _ as He } from "./TransitionFade-C1e0GfbE.js";
4
- import { W as S, a as Je } from "./v4-Dzkr7vpG.js";
5
- import { storeToRefs as Ve } from "pinia";
6
- import { u as Se } from "./message-dialog-UoMWOnil.js";
7
- import { c as he, d as De, p as ze } from "./index-DqqTHE7n.js";
8
- import { useSnackbar as Ge, useBreakpoints as Ne, FmButtonColorThemeVariant as me } from "@feedmepos/ui-library";
9
- import { u as Ue } from "./report-schema-OJAFh4P6.js";
10
- import { _ as ie } from "./BaseDialog.vue_vue_type_script_setup_true_lang-DTNiGKgd.js";
11
- import { _ as H } from "./SelectComponent.vue_vue_type_script_setup_true_lang-BVs1C4af.js";
12
- import { u as le, d as pe } from "./global-loader-BqFQzk46.js";
13
- import { g as de, _ as $e } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-BMVvOG58.js";
14
- import { _ as Oe } from "./NoData.vue_vue_type_script_setup_true_lang-DI4X_DSc.js";
15
- var oe = /* @__PURE__ */ ((s) => (s.DateTime = "DATE_TIME", s.Hour = "HOUR", s.Day = "DAY", s.Week = "WEEK", s.Month = "MONTH", s.TimeOfDay = "TIME_OF_DAY", s.HourOfDay = "HOUR_OF_DAY", s.DayOfWeek = "DAY_OF_WEEK", s.DayOfMonth = "DAY_OF_MONTH", s.MonthOfYear = "MONTH_OF_YEAR", s.Year = "YEAR", s))(oe || {}), ge = /* @__PURE__ */ ((s) => (s.Asc = "ASC", s.Desc = "DESC", s))(ge || {}), Z = /* @__PURE__ */ ((s) => (s.Equal = "EQUAL", s.NotEqual = "NOT_EQUAL", s.GreaterThan = "GREATER_THAN", s.LessThan = "LESS_THAN", s.GreaterThanOrEqual = "GREATER_THAN_OR_EQUAL", s.LessThanOrEqual = "LESS_THAN_OR_EQUAL", s.Between = "BETWEEN", s.Like = "LIKE", s.NotLike = "NOT_LIKE", s.And = "AND", s.Or = "OR", s))(Z || {}), te = /* @__PURE__ */ ((s) => (s.String = "STRING", s.Timestamp = "TIMESTAMP", s.Bool = "BOOL", s.Numeric = "NUMERIC", s))(te || {});
16
- const we = [
17
- {
18
- type: S.Circular,
19
- maxDimension: null,
20
- maxMetric: 1,
21
- hasBreakdownDimension: !1,
22
- canTranspose: !1,
23
- isDrillConfigurable: !1,
24
- hasLabel: !0,
25
- canRollup: !1,
26
- showRollupPosition: !1,
27
- canSearch: !1
28
- },
29
- {
30
- type: S.Table,
31
- maxDimension: null,
32
- maxMetric: null,
33
- hasBreakdownDimension: !1,
34
- canTranspose: !1,
35
- isDrillConfigurable: !0,
36
- hasLabel: !1,
37
- canRollup: !0,
38
- showRollupPosition: !0,
39
- canSearch: !0
40
- },
41
- {
42
- type: S.BarChart,
43
- maxDimension: null,
44
- maxMetric: 1,
45
- hasBreakdownDimension: !0,
46
- canTranspose: !0,
47
- isDrillConfigurable: !1,
48
- hasLabel: !0,
49
- canRollup: !1,
50
- showRollupPosition: !1,
51
- canSearch: !1
52
- },
53
- {
54
- type: S.LineChart,
55
- maxDimension: null,
56
- maxMetric: 1,
57
- hasBreakdownDimension: !0,
58
- canTranspose: !0,
59
- isDrillConfigurable: !1,
60
- hasLabel: !0,
61
- canRollup: !1,
62
- showRollupPosition: !1,
63
- canSearch: !1
64
- },
65
- {
66
- type: S.StackBarChart,
67
- maxDimension: null,
68
- maxMetric: 1,
69
- hasBreakdownDimension: !0,
70
- canTranspose: !0,
71
- isDrillConfigurable: !1,
72
- hasLabel: !0,
73
- canRollup: !1,
74
- showRollupPosition: !1,
75
- canSearch: !1
76
- },
77
- {
78
- type: S.StackLineChart,
79
- maxDimension: null,
80
- maxMetric: 1,
81
- hasBreakdownDimension: !0,
82
- canTranspose: !0,
83
- isDrillConfigurable: !1,
84
- hasLabel: !0,
85
- canRollup: !1,
86
- showRollupPosition: !1,
87
- canSearch: !1
88
- },
89
- {
90
- type: S.Scorecard,
91
- maxDimension: null,
92
- maxMetric: 1,
93
- hasBreakdownDimension: !1,
94
- canTranspose: !1,
95
- isDrillConfigurable: !1,
96
- hasLabel: !1,
97
- canRollup: !1,
98
- showRollupPosition: !1,
99
- canSearch: !1
100
- },
101
- {
102
- type: S.Spacer,
103
- maxDimension: 0,
104
- maxMetric: 0,
105
- hasBreakdownDimension: !1,
106
- canTranspose: !1,
107
- isDrillConfigurable: !1,
108
- hasLabel: !1,
109
- canRollup: !1,
110
- showRollupPosition: !1,
111
- canSearch: !1
112
- }
113
- ], We = { class: "flex flex-col my-2 gap-8" }, Ye = { class: "fm-typo-en-body-lg-600" }, Ke = { class: "text-sm text-fm-color-neutral-gray-400" }, Qe = ["onClick"], Xe = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, Ze = /* @__PURE__ */ W({
114
- __name: "SchemaSection",
115
- props: /* @__PURE__ */ z({
116
- options: {
117
- type: Array,
118
- default: () => []
119
- },
120
- label: {
121
- type: String,
122
- default: "Schema"
123
- }
124
- }, {
125
- modelValue: { required: !0 },
126
- modelModifiers: {}
127
- }),
128
- emits: ["update:modelValue"],
129
- setup(s) {
130
- const { t: u } = le(), a = Y(s, "modelValue"), c = s, { schemas: g } = Ve(Ue()), b = N(
131
- () => g.value.map((V) => ({
132
- labels: [V.label],
133
- value: V.name,
134
- raw: V
135
- }))
136
- ), v = N(() => {
137
- if (a.value.schemaNames.length === 0 || t.value === 0)
138
- return b.value.filter((V) => !V.raw.isJoinOnly);
139
- {
140
- const V = a.value.schemaNames[0], m = g.value.find((o) => o.name === V), F = ((m == null ? void 0 : m.joins) || []).map((o) => o);
141
- return b.value.filter((o) => F.includes(o.raw.name));
142
- }
143
- }), f = A(!1), n = A(""), t = A(), h = Ge();
144
- function D(V) {
145
- var m;
146
- return (m = g.value.find((F) => F.name === V)) == null ? void 0 : m.label;
147
- }
148
- function O(V) {
149
- t.value = V, f.value = !0, V !== void 0 ? n.value = a.value.schemaNames[V] : n.value = "";
150
- }
151
- function R() {
152
- n.value !== "" ? (t.value !== void 0 ? a.value.schemaNames[t.value] = n.value : a.value.schemaNames.push(n.value), f.value = !1) : h.open({ message: u("report.section.schema.nothingSelected"), type: "error" });
153
- }
154
- return (V, m) => {
155
- const F = y("FmForm"), o = y("FmIcon"), l = y("FmField");
156
- return p(), L("div", We, [
157
- d(ie, {
158
- modelValue: f.value,
159
- "onUpdate:modelValue": m[1] || (m[1] = (e) => f.value = e),
160
- title: c.label,
161
- "primary-button-label": i(u)("report.common.confirm"),
162
- "secondary-button-label": i(u)("report.common.cancel"),
163
- onConfirm: R
164
- }, {
165
- content: C(() => [
166
- d(F, { ref: "form" }, {
167
- default: C(() => [
168
- d(H, {
169
- modelValue: n.value,
170
- "onUpdate:modelValue": m[0] || (m[0] = (e) => n.value = e),
171
- label: i(u)("report.section.schema.title"),
172
- items: t.value === 0 ? b.value.map((e) => ({ label: e.labels[0], value: e.value })) : v.value.map((e) => ({
173
- label: e.labels[0],
174
- value: e.value
175
- }))
176
- }, null, 8, ["modelValue", "label", "items"])
177
- ]),
178
- _: 1
179
- }, 512)
180
- ]),
181
- _: 1
182
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
183
- x("div", null, [
184
- x("p", Ye, I(i(u)("report.section.schema.title")), 1),
185
- x("p", Ke, I(i(u)("report.section.schema.description")), 1)
186
- ]),
187
- (p(!0), L(Q, null, se(a.value.schemaNames, (e, r) => (p(), L("div", {
188
- key: r,
189
- class: "flex flex-col gap-2 w-full"
190
- }, [
191
- x("div", {
192
- class: "flex items-center gap-2 border rounded-md border-neutral-300 p-2 h-[40px]",
193
- onClick: (_) => O(r)
194
- }, [
195
- x("p", Xe, I(D(e)), 1),
196
- m[3] || (m[3] = x("div", { class: "grow" }, null, -1)),
197
- d(o, {
198
- name: "close",
199
- onClick: ee(
200
- () => {
201
- a.value.schemaNames = i(Ee)(a.value.schemaNames, r);
202
- },
203
- ["stop"]
204
- )
205
- }, null, 8, ["onClick"])
206
- ], 8, Qe)
207
- ]))), 128)),
208
- d(l, {
209
- class: "text-fm-color-typo-tertiary",
210
- onClick: m[2] || (m[2] = () => {
211
- O();
212
- })
213
- }, {
214
- default: C(() => [
215
- ne(I(i(u)("report.section.schema.add")), 1)
216
- ]),
217
- _: 1
218
- })
219
- ]);
220
- };
221
- }
222
- }), el = {
223
- key: 0,
224
- class: "flex flex-col my-2 gap-8"
225
- }, ll = { class: "fm-typo-en-body-lg-600 text-ellipsis line-clamp-1" }, al = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, ol = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, ve = /* @__PURE__ */ W({
226
- __name: "DimensionSection",
227
- props: /* @__PURE__ */ z({
228
- options: {
229
- type: Array,
230
- default: () => []
231
- },
232
- label: {
233
- type: String,
234
- default: "Dimension"
235
- },
236
- max: {
237
- type: Number,
238
- default: void 0
239
- },
240
- config: {
241
- type: Object,
242
- default: () => {
243
- }
244
- },
245
- hasRowColumn: {
246
- type: Boolean,
247
- default: !1
248
- }
249
- }, {
250
- modelValue: {
251
- required: !1,
252
- default: []
253
- },
254
- modelModifiers: {}
255
- }),
256
- emits: ["update:modelValue"],
257
- setup(s) {
258
- const { t: u } = le(), a = Y(s, "modelValue"), c = s, g = A(!1), b = N(
259
- () => a.value.map((l, e) => ({
260
- index: e,
261
- labels: [l.label || l.name],
262
- value: l
263
- }))
264
- ), v = A(a.value.length > 0 ? 0 : void 0);
265
- function f(l) {
266
- var e, r;
267
- g.value = !0, n.value = l != null && l.value ? JSON.parse(JSON.stringify(l.value)) : void 0, v.value = l == null ? void 0 : l.index, t.value = !!((e = n.value) != null && e.dataFormula || (r = n.value) != null && r.displayFormula);
268
- }
269
- N(() => !!c.max && a.value.length === c.max);
270
- const n = A(void 0), t = A(!1), h = N(
271
- () => c.options.find(
272
- (l) => {
273
- var e, r;
274
- return l.schemaName === ((e = n.value) == null ? void 0 : e.schemaName) && l.name === ((r = n.value) == null ? void 0 : r.name);
275
- }
276
- ) ?? {}
277
- );
278
- re(
279
- () => {
280
- var l;
281
- return (l = n.value) == null ? void 0 : l.option;
282
- },
283
- () => {
284
- !D.value && n.value && (n.value.fillGap = !1);
285
- }
286
- );
287
- const D = N(
288
- () => {
289
- var l, e, r;
290
- return (r = (l = h.value) == null ? void 0 : l.fillGapDimensionOptions) == null ? void 0 : r.includes(((e = n.value) == null ? void 0 : e.option) || "");
291
- }
292
- );
293
- function O(l) {
294
- var e, r;
295
- (l.schemaName !== ((e = n.value) == null ? void 0 : e.schemaName) || l.name !== ((r = n.value) == null ? void 0 : r.name)) && (n.value = {
296
- schemaName: l.schemaName,
297
- name: l.name,
298
- option: l.dimensionOptions[0],
299
- label: l.label,
300
- decimal: l.isNumericType ? 2 : void 0,
301
- hide: !1
302
- }, t.value = !1);
303
- }
304
- function R() {
305
- if (!n.value) {
306
- console.error("new field is undefined");
307
- return;
308
- }
309
- const l = [...b.value.map((e) => e.value)];
310
- v.value !== void 0 ? l[v.value] = n.value : l.push(n.value), a.value = l, g.value = !1;
311
- }
312
- function V(l) {
313
- const r = [...b.value.map((_) => _.value)].filter((_, E) => E !== l);
314
- a.value = r;
315
- }
316
- function m(l) {
317
- n.value && (n.value.decimal = Number(l));
318
- }
319
- const F = N(
320
- () => c.options.map((l) => ({
321
- label: l.labels.join(" "),
322
- value: l
323
- }))
324
- ), o = N(
325
- () => c.label ? c.label : u(`report.section.dimension.${c.label}`)
326
- );
327
- return (l, e) => {
328
- const r = y("FmTextField"), _ = y("FmStepperField"), E = y("FmCheckbox"), P = y("FmTextarea"), X = y("FmForm"), B = y("FmIcon"), j = y("FmButton"), q = y("FmListItem"), G = y("FmList"), J = y("FmField");
329
- return s.max !== 0 ? (p(), L("div", el, [
330
- d(ie, {
331
- modelValue: g.value,
332
- "onUpdate:modelValue": e[12] || (e[12] = (w) => g.value = w),
333
- title: o.value,
334
- "primary-button-label": i(u)("report.common.confirm"),
335
- "secondary-button-label": i(u)("report.common.cancel"),
336
- onConfirm: R
337
- }, {
338
- content: C(() => [
339
- d(X, {
340
- ref: "form",
341
- class: "flex flex-col gap-2 w-[490px]"
342
- }, {
343
- default: C(() => {
344
- var w, $, K, ae, U, xe;
345
- return [
346
- d(H, {
347
- "model-value": h.value,
348
- items: F.value,
349
- placeholder: o.value,
350
- label: o.value,
351
- "onUpdate:modelValue": e[0] || (e[0] = (M) => O(M))
352
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
353
- n.value ? (p(), L(Q, { key: 0 }, [
354
- d(r, {
355
- modelValue: n.value.label,
356
- "onUpdate:modelValue": e[1] || (e[1] = (M) => n.value.label = M),
357
- label: o.value
358
- }, null, 8, ["modelValue", "label"]),
359
- (((w = h.value) == null ? void 0 : w.dimensionOptions) || []).length > 0 ? (p(), k(H, {
360
- key: 0,
361
- modelValue: n.value.option,
362
- "onUpdate:modelValue": e[2] || (e[2] = (M) => n.value.option = M),
363
- items: (($ = h.value) == null ? void 0 : $.dimensionOptions.map((M) => ({
364
- label: M,
365
- value: M
366
- }))) ?? []
367
- }, null, 8, ["modelValue", "items"])) : T("", !0),
368
- (K = h.value) != null && K.isNumericType ? (p(), k(_, {
369
- key: 1,
370
- label: i(u)("report.common.decimal"),
371
- "model-value": ((ae = n.value) == null ? void 0 : ae.decimal) ?? 2,
372
- "onUpdate:modelValue": e[3] || (e[3] = (M) => {
373
- m(M);
374
- })
375
- }, null, 8, ["label", "model-value"])) : T("", !0),
376
- (U = h.value) != null && U.isNumericType ? (p(), k(H, {
377
- key: 2,
378
- modelValue: n.value.timeFormatter,
379
- "onUpdate:modelValue": e[4] || (e[4] = (M) => n.value.timeFormatter = M),
380
- placeholder: i(u)("report.section.dimension.timeFormatter"),
381
- label: i(u)("report.section.dimension.timeFormatter"),
382
- items: h.value.timeFormatters.map((M) => ({ label: M, value: M }))
383
- }, null, 8, ["modelValue", "placeholder", "label", "items"])) : T("", !0),
384
- D.value ? (p(), k(E, {
385
- key: 3,
386
- "model-value": n.value.fillGap ?? !1,
387
- label: i(u)("report.section.dimension.fillGap"),
388
- value: "",
389
- placeholder: "Fill gap",
390
- "onUpdate:modelValue": e[5] || (e[5] = (M) => {
391
- n.value && (n.value.fillGap = M);
392
- })
393
- }, null, 8, ["model-value", "label"])) : T("", !0),
394
- ((xe = h.value) == null ? void 0 : xe.type) === i(te).Timestamp ? (p(), k(E, {
395
- key: 4,
396
- "model-value": n.value.dateComparison ?? !1,
397
- label: i(u)("report.section.dimension.dateComparison"),
398
- value: "",
399
- "onUpdate:modelValue": e[6] || (e[6] = (M) => {
400
- n.value && (n.value.dateComparison = M);
401
- })
402
- }, null, 8, ["model-value", "label"])) : T("", !0),
403
- d(E, {
404
- modelValue: n.value.hide,
405
- "onUpdate:modelValue": e[7] || (e[7] = (M) => n.value.hide = M),
406
- label: i(u)("report.section.dimension.hide"),
407
- value: ""
408
- }, null, 8, ["modelValue", "label"]),
409
- c.hasRowColumn ? (p(), k(E, {
410
- key: 5,
411
- modelValue: n.value.moveToColumn,
412
- "onUpdate:modelValue": e[8] || (e[8] = (M) => n.value.moveToColumn = M),
413
- label: i(u)("report.section.dimension.moveToColumn"),
414
- value: ""
415
- }, null, 8, ["modelValue", "label"])) : T("", !0),
416
- d(E, {
417
- modelValue: t.value,
418
- "onUpdate:modelValue": e[9] || (e[9] = (M) => t.value = M),
419
- label: i(u)("report.section.dimension.advance"),
420
- value: !0
421
- }, null, 8, ["modelValue", "label"]),
422
- t.value ? (p(), k(P, {
423
- key: 6,
424
- modelValue: n.value.dataFormula,
425
- "onUpdate:modelValue": e[10] || (e[10] = (M) => n.value.dataFormula = M),
426
- placeholder: i(u)("report.section.dimension.dataFormula")
427
- }, null, 8, ["modelValue", "placeholder"])) : T("", !0),
428
- t.value ? (p(), k(P, {
429
- key: 7,
430
- modelValue: n.value.displayFormula,
431
- "onUpdate:modelValue": e[11] || (e[11] = (M) => n.value.displayFormula = M),
432
- placeholder: i(u)("report.section.dimension.displayFormula")
433
- }, null, 8, ["modelValue", "placeholder"])) : T("", !0)
434
- ], 64)) : T("", !0)
435
- ];
436
- }),
437
- _: 1
438
- }, 512)
439
- ]),
440
- _: 1
441
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
442
- x("div", null, [
443
- x("p", ll, I(o.value), 1),
444
- x("p", al, I(i(u)("report.section.dimension.description")), 1)
445
- ]),
446
- d(G, null, {
447
- default: C(() => [
448
- d(i(ce), {
449
- list: a.value,
450
- "item-key": "id",
451
- class: "flex flex-col gap-2"
452
- }, {
453
- item: C(({ element: w, index: $ }) => [
454
- d(q, {
455
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
456
- onClick: ee((K) => f(b.value[$]), ["stop"])
457
- }, {
458
- default: C(() => [
459
- d(B, { name: "drag_handle" }),
460
- x("p", ol, I(w.label), 1),
461
- e[14] || (e[14] = x("div", { class: "grow" }, null, -1)),
462
- d(j, {
463
- icon: "close",
464
- size: "md",
465
- variant: "tertiary",
466
- onClick: ee((K) => V($), ["stop"])
467
- }, null, 8, ["onClick"])
468
- ]),
469
- _: 2
470
- }, 1032, ["onClick"])
471
- ]),
472
- _: 1
473
- }, 8, ["list"])
474
- ]),
475
- _: 1
476
- }),
477
- d(J, {
478
- class: "text-fm-color-typo-tertiary",
479
- onClick: e[13] || (e[13] = () => {
480
- f();
481
- })
482
- }, {
483
- default: C(() => [
484
- ne(I(i(u)("report.section.dimension.add")), 1)
485
- ]),
486
- _: 1
487
- })
488
- ])) : T("", !0);
489
- };
490
- }
491
- }), be = {
492
- value: "_metric_name"
493
- };
494
- function tl(s, u, a) {
495
- switch (s) {
496
- case S.BarChart:
497
- case S.StackBarChart:
498
- case S.LineChart:
499
- case S.StackLineChart:
500
- case S.Circular:
501
- return u.length > 1;
502
- default:
503
- return a;
504
- }
505
- }
506
- function nl(s) {
507
- var c;
508
- const { rowIds: u, columnIds: a } = ye(s.widget.config);
509
- return {
510
- ...s,
511
- widget: {
512
- ...s.widget,
513
- config: {
514
- ...s.widget.config,
515
- rowIds: u,
516
- columnIds: a,
517
- isDrillable: tl(
518
- s.widget.type,
519
- s.widget.config.dimensions,
520
- s.widget.config.isDrillable
521
- ),
522
- joinDatasources: (c = s.widget.config.joinDatasources) == null ? void 0 : c.map((g) => {
523
- const { rowIds: b, columnIds: v } = ye(g);
524
- return {
525
- ...g,
526
- rowIds: b,
527
- columnIds: v
528
- };
529
- })
530
- }
531
- }
532
- };
533
- }
534
- function ye(s) {
535
- const u = s.dimensions.filter((v) => v.hide !== !0 && !v.moveToColumn).map((v) => de(v)), a = s.dimensions.filter((v) => v.hide !== !0 && v.moveToColumn == !0).map((v) => de(v)), c = s.metrics.length > 0;
536
- c && s.metrics.find((v) => v.moveToRow == !0) ? u.push(be.value) : c && a.push(be.value);
537
- const g = [], b = [];
538
- for (const v of u)
539
- g.push(v);
540
- for (const v of a)
541
- b.push(v);
542
- return {
543
- rowIds: g,
544
- columnIds: b
545
- };
546
- }
547
- const il = { class: "flex flex-col my-2 gap-8" }, ul = { class: "fm-typo-en-body-lg-600" }, sl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, rl = { class: "fm-typo-en-body-lg-400 overflow-hidden text-ellipsis line-clamp-1" }, ml = /* @__PURE__ */ W({
548
- __name: "MetricSection",
549
- props: /* @__PURE__ */ z({
550
- options: {
551
- type: Array,
552
- default: () => []
553
- },
554
- label: {
555
- type: String,
556
- default: "Metric"
557
- },
558
- max: {
559
- type: Number,
560
- default: void 0
561
- },
562
- config: {
563
- type: Object,
564
- default: () => {
565
- }
566
- },
567
- hasRowColumn: {
568
- type: Boolean,
569
- default: !1
570
- }
571
- }, {
572
- modelValue: { required: !1, default: [] },
573
- modelModifiers: {}
574
- }),
575
- emits: /* @__PURE__ */ z(["config"], ["update:modelValue"]),
576
- setup(s, { emit: u }) {
577
- const { t: a } = le(), c = Y(s, "modelValue"), g = s;
578
- N(() => !!g.max && c.value.length === g.max);
579
- const b = A(!1), v = N(
580
- () => c.value.map((e, r) => ({
581
- index: r,
582
- labels: [e.label || e.name],
583
- value: e
584
- }))
585
- ), f = A(c.value.length > 0 ? 0 : void 0);
586
- function n(e) {
587
- var r, _, E;
588
- b.value = !0, t.value = e != null && e.value ? JSON.parse(JSON.stringify(e.value)) : void 0, f.value = e == null ? void 0 : e.index, h.value = !!((r = t.value) != null && r.dataFormula || (_ = t.value) != null && _.displayFormula), ((E = g.config.rowIds) == null ? void 0 : E.findIndex((P) => P === be.value)) !== -1 && t.value && (t.value.moveToRow = !0);
589
- }
590
- const t = A(void 0), h = A(!1), D = N(
591
- () => g.options.find(
592
- (e) => {
593
- var r, _;
594
- return e.schemaName === ((r = t.value) == null ? void 0 : r.schemaName) && e.name === ((_ = t.value) == null ? void 0 : _.name);
595
- }
596
- ) ?? {}
597
- );
598
- function O(e, r) {
599
- var _;
600
- return (e == null ? void 0 : e.isNumericType) || ((_ = e == null ? void 0 : e.isNumericAggregations) == null ? void 0 : _.includes(r || ""));
601
- }
602
- const R = N(
603
- () => {
604
- var e;
605
- return O(D.value, (e = t.value) == null ? void 0 : e.aggregation);
606
- }
607
- );
608
- re(R, (e) => {
609
- t.value && (e ? t.value.decimal = typeof t.value.decimal != "number" ? 2 : t.value.decimal : t.value.decimal = void 0);
610
- });
611
- function V(e) {
612
- var r, _;
613
- (e.schemaName !== ((r = t.value) == null ? void 0 : r.schemaName) || e.name !== ((_ = t.value) == null ? void 0 : _.name)) && (t.value = {
614
- schemaName: e.schemaName,
615
- name: e.name,
616
- aggregation: e.aggregations[0],
617
- label: e.label,
618
- decimal: O(e, e.aggregations[0]) ? 2 : void 0,
619
- moveToRow: !1,
620
- hide: !1
621
- }, h.value = !1);
622
- }
623
- function m() {
624
- const e = [...v.value.map((r) => r.value)];
625
- t.value && (f.value !== void 0 ? e[f.value] = t.value : e.push(t.value)), c.value = e, b.value = !1;
626
- }
627
- function F(e) {
628
- const r = [...v.value.map((_) => _.value)];
629
- r.splice(e, 1), c.value = r;
630
- }
631
- const o = N(
632
- () => g.options.map((e) => ({
633
- label: e.labels.join(" "),
634
- value: e
635
- }))
636
- ), l = N(
637
- () => g.label ? g.label : a(`report.section.metric.${g.label}`)
638
- );
639
- return (e, r) => {
640
- const _ = y("FmTextField"), E = y("FmStepperField"), P = y("FmCheckbox"), X = y("FmTextarea"), B = y("FmForm"), j = y("FmIcon"), q = y("FmButton"), G = y("FmListItem"), J = y("FmList"), w = y("FmField");
641
- return p(), L("div", il, [
642
- d(ie, {
643
- modelValue: b.value,
644
- "onUpdate:modelValue": r[10] || (r[10] = ($) => b.value = $),
645
- title: l.value,
646
- onConfirm: m
647
- }, {
648
- content: C(() => [
649
- d(B, {
650
- ref: "form",
651
- class: "flex flex-col gap-2 w-[490px]"
652
- }, {
653
- default: C(() => {
654
- var $, K, ae;
655
- return [
656
- d(H, {
657
- "model-value": D.value,
658
- items: o.value,
659
- placeholder: l.value,
660
- label: l.value,
661
- "onUpdate:modelValue": r[0] || (r[0] = (U) => V(U))
662
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
663
- t.value ? (p(), L(Q, { key: 0 }, [
664
- d(_, {
665
- modelValue: t.value.label,
666
- "onUpdate:modelValue": r[1] || (r[1] = (U) => t.value.label = U),
667
- label: l.value
668
- }, null, 8, ["modelValue", "label"]),
669
- ((($ = D.value) == null ? void 0 : $.aggregations) || []).length > 0 ? (p(), k(H, {
670
- key: 0,
671
- modelValue: t.value.aggregation,
672
- "onUpdate:modelValue": r[2] || (r[2] = (U) => t.value.aggregation = U),
673
- label: i(a)("report.section.metric.aggregation"),
674
- items: ((K = D.value) == null ? void 0 : K.aggregations.map((U) => ({
675
- label: U,
676
- value: U
677
- }))) ?? []
678
- }, null, 8, ["modelValue", "label", "items"])) : T("", !0),
679
- R.value ? (p(), k(E, {
680
- key: 1,
681
- label: i(a)("report.common.decimal"),
682
- "model-value": ((ae = t.value) == null ? void 0 : ae.decimal) ?? 2,
683
- "onUpdate:modelValue": r[3] || (r[3] = (U) => {
684
- t.value && (t.value.decimal = U);
685
- })
686
- }, null, 8, ["label", "model-value"])) : T("", !0),
687
- R.value ? (p(), k(H, {
688
- key: 2,
689
- modelValue: t.value.timeFormatter,
690
- "onUpdate:modelValue": r[4] || (r[4] = (U) => t.value.timeFormatter = U),
691
- placeholder: i(a)("report.section.metric.timeFormatter"),
692
- label: i(a)("report.section.metric.timeFormatter"),
693
- items: D.value.timeFormatters.map((U) => ({ label: U, value: U }))
694
- }, null, 8, ["modelValue", "placeholder", "label", "items"])) : T("", !0),
695
- d(P, {
696
- modelValue: t.value.hide,
697
- "onUpdate:modelValue": r[5] || (r[5] = (U) => t.value.hide = U),
698
- label: i(a)("report.section.metric.hide"),
699
- value: ""
700
- }, null, 8, ["modelValue", "label"]),
701
- g.hasRowColumn ? (p(), k(P, {
702
- key: 3,
703
- modelValue: t.value.moveToRow,
704
- "onUpdate:modelValue": r[6] || (r[6] = (U) => t.value.moveToRow = U),
705
- label: i(a)("report.section.metric.moveToRow"),
706
- value: ""
707
- }, null, 8, ["modelValue", "label"])) : T("", !0),
708
- d(P, {
709
- modelValue: h.value,
710
- "onUpdate:modelValue": r[7] || (r[7] = (U) => h.value = U),
711
- label: i(a)("report.section.metric.advance"),
712
- value: !0
713
- }, null, 8, ["modelValue", "label"]),
714
- h.value ? (p(), k(X, {
715
- key: 4,
716
- modelValue: t.value.dataFormula,
717
- "onUpdate:modelValue": r[8] || (r[8] = (U) => t.value.dataFormula = U),
718
- placeholder: i(a)("report.section.metric.dataFormula")
719
- }, null, 8, ["modelValue", "placeholder"])) : T("", !0),
720
- h.value ? (p(), k(X, {
721
- key: 5,
722
- modelValue: t.value.displayFormula,
723
- "onUpdate:modelValue": r[9] || (r[9] = (U) => t.value.displayFormula = U),
724
- placeholder: i(a)("report.section.metric.displayFormula")
725
- }, null, 8, ["modelValue", "placeholder"])) : T("", !0)
726
- ], 64)) : T("", !0)
727
- ];
728
- }),
729
- _: 1
730
- }, 512)
731
- ]),
732
- _: 1
733
- }, 8, ["modelValue", "title"]),
734
- x("div", null, [
735
- x("p", ul, I(l.value), 1),
736
- x("p", sl, I(i(a)("report.section.metric.description")), 1)
737
- ]),
738
- d(J, null, {
739
- default: C(() => [
740
- d(i(ce), {
741
- list: c.value,
742
- "item-key": "id",
743
- class: "flex flex-col gap-2 w-full"
744
- }, {
745
- item: C(({ element: $, index: K }) => [
746
- d(G, {
747
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
748
- onClick: ee((ae) => n(v.value[K]), ["stop"])
749
- }, {
750
- default: C(() => [
751
- d(j, { name: "drag_handle" }),
752
- x("p", rl, I($.label), 1),
753
- r[12] || (r[12] = x("div", { class: "grow" }, null, -1)),
754
- d(q, {
755
- icon: "close",
756
- size: "md",
757
- variant: "tertiary",
758
- onClick: ee((ae) => F(K), ["stop"])
759
- }, null, 8, ["onClick"])
760
- ]),
761
- _: 2
762
- }, 1032, ["onClick"])
763
- ]),
764
- _: 1
765
- }, 8, ["list"])
766
- ]),
767
- _: 1
768
- }),
769
- d(w, {
770
- class: "text-fm-color-typo-tertiary",
771
- onClick: r[11] || (r[11] = () => {
772
- n();
773
- })
774
- }, {
775
- default: C(() => [
776
- ne(I(i(a)("report.section.metric.add")), 1)
777
- ]),
778
- _: 1
779
- })
780
- ]);
781
- };
782
- }
783
- });
784
- var ue = /* @__PURE__ */ ((s) => (s.Select = "Select", s.TextField = "TextField", s.Timestamp = "Timestamp", s))(ue || {});
785
- function dl(s) {
786
- let u = !1, a = 1;
787
- switch (s) {
788
- case Z.Equal:
789
- case Z.NotEqual:
790
- case Z.Like:
791
- case Z.NotLike:
792
- u = !1, a = 1;
793
- break;
794
- case Z.GreaterThan:
795
- case Z.GreaterThanOrEqual:
796
- case Z.LessThan:
797
- case Z.LessThanOrEqual:
798
- u = !0, a = 1;
799
- break;
800
- case Z.Between:
801
- u = !0, a = 2;
802
- break;
803
- }
804
- return {
805
- fixed: u,
806
- count: a
807
- };
808
- }
809
- function cl({
810
- operator: s,
811
- dimensionOption: u,
812
- dataType: a
813
- }) {
814
- const { fixed: c, count: g } = dl(s);
815
- switch (a) {
816
- case te.String:
817
- return {
818
- type: "TextField",
819
- fixed: c,
820
- count: g,
821
- dataType: void 0,
822
- default: ""
823
- };
824
- case te.Numeric:
825
- return {
826
- type: "TextField",
827
- fixed: c,
828
- count: g,
829
- dataType: "number",
830
- default: 0
831
- };
832
- case te.Bool:
833
- return {
834
- type: "Select",
835
- fixed: c,
836
- count: g,
837
- options: [
838
- { label: "Yes", value: !0 },
839
- { label: "No", value: !1 }
840
- ],
841
- default: !0
842
- };
843
- case te.Timestamp:
844
- switch (u) {
845
- case oe.HourOfDay:
846
- case oe.DayOfWeek:
847
- case oe.DayOfMonth:
848
- case oe.MonthOfYear:
849
- return {
850
- type: "TextField",
851
- fixed: c,
852
- count: g,
853
- dataType: "number",
854
- default: "0"
855
- };
856
- case oe.TimeOfDay:
857
- return {
858
- type: "Timestamp",
859
- fixed: c,
860
- count: g,
861
- default: (/* @__PURE__ */ new Date()).toISOString()
862
- };
863
- }
864
- }
865
- return {
866
- type: "TextField",
867
- fixed: c,
868
- count: g,
869
- dataType: void 0,
870
- default: ""
871
- };
872
- }
873
- const pl = { class: "grow" }, vl = {
874
- key: 2,
875
- class: "w-full"
876
- }, fl = { key: 0 }, gl = /* @__PURE__ */ W({
877
- __name: "FilterValueInput",
878
- props: /* @__PURE__ */ z({
879
- config: {
880
- type: Object,
881
- default: () => {
882
- }
883
- }
884
- }, {
885
- modelValue: { required: !0, default: () => [] },
886
- modelModifiers: {}
887
- }),
888
- emits: ["update:modelValue"],
889
- setup(s) {
890
- const u = Y(s, "modelValue"), a = s;
891
- function c(f) {
892
- return (f ? pe(f) : pe()).format("HH:mm");
893
- }
894
- function g({ hour: f, minute: n }) {
895
- return pe().set("hour", f).set("minute", n).toISOString();
896
- }
897
- function b(f, n) {
898
- var h;
899
- const t = [...u.value];
900
- ((h = a.config) == null ? void 0 : h.type) === ue.Timestamp ? t[f] = g({
901
- hour: Number(n.split(":")[0]),
902
- minute: Number(n.split(":")[1])
903
- }) : t[f] = n, u.value = t;
904
- }
905
- function v(f) {
906
- if (f === 0)
907
- u.value = [void 0, ...u.value];
908
- else {
909
- const n = [...u.value];
910
- n.splice(f, 1), u.value = n;
911
- }
912
- }
913
- return (f, n) => {
914
- const t = y("FmSelect"), h = y("FmTextField"), D = y("FmTimePicker"), O = y("FmButton");
915
- return p(!0), L(Q, null, se(new Array(u.value.length !== 0 ? u.value.length : 1), (R, V) => {
916
- var m, F, o, l;
917
- return p(), L("div", {
918
- key: V,
919
- class: "flex flex-row align-center gap-2 w-full"
920
- }, [
921
- x("div", pl, [
922
- ((m = a.config) == null ? void 0 : m.type) === i(ue).Select ? (p(), k(t, {
923
- key: 0,
924
- "model-value": u.value[V],
925
- items: a.config.options,
926
- "onUpdate:modelValue": (e) => b(V, e)
927
- }, null, 8, ["model-value", "items", "onUpdate:modelValue"])) : ((F = a.config) == null ? void 0 : F.type) === i(ue).TextField ? (p(), k(h, {
928
- key: 1,
929
- "model-value": u.value[V],
930
- "onUpdate:modelValue": (e) => b(V, e)
931
- }, null, 8, ["model-value", "onUpdate:modelValue"])) : ((o = a.config) == null ? void 0 : o.type) === i(ue).Timestamp ? (p(), L("div", vl, [
932
- d(D, {
933
- "model-value": c(u.value[V]),
934
- "onUpdate:modelValue": (e) => b(V, e)
935
- }, null, 8, ["model-value", "onUpdate:modelValue"])
936
- ])) : T("", !0)
937
- ]),
938
- ((l = a.config) == null ? void 0 : l.fixed) === !1 ? (p(), L("div", fl, [
939
- d(O, {
940
- icon: V === 0 ? "add" : "remove",
941
- onClick: (e) => v(V)
942
- }, null, 8, ["icon", "onClick"])
943
- ])) : T("", !0)
944
- ]);
945
- }), 128);
946
- };
947
- }
948
- }), bl = { class: "flex flex-col my-2 gap-8" }, yl = { class: "fm-typo-en-body-lg-600" }, Fl = { 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" }, hl = /* @__PURE__ */ W({
949
- __name: "FilterSection",
950
- props: /* @__PURE__ */ z({
951
- options: {
952
- type: Array,
953
- default: () => []
954
- },
955
- label: {
956
- type: String,
957
- default: "Filter"
958
- }
959
- }, {
960
- modelValue: { required: !1, default: () => [] },
961
- modelModifiers: {}
962
- }),
963
- emits: ["update:modelValue"],
964
- setup(s) {
965
- const { t: u } = le(), a = Y(s, "modelValue"), c = s, g = N(() => u(`report.section.filter.${c.label}`)), b = A(!1), v = N(
966
- () => a.value.map((l, e) => {
967
- const r = c.options.find(
968
- (_) => _.schemaName === l.schemaName && _.name === l.name
969
- );
970
- return {
971
- index: e,
972
- labels: (r == null ? void 0 : r.labels) || [l.schemaName, l.name],
973
- value: l
974
- };
975
- })
976
- ), f = A(a.value.length > 0 ? 0 : void 0);
977
- function n(l) {
978
- var e;
979
- b.value = !0, t.value = l != null && l.value ? JSON.parse(JSON.stringify(l.value)) : void 0, f.value = l == null ? void 0 : l.index, h.value = !!((e = t.value) != null && e.dataFormula), R();
980
- }
981
- const t = A(void 0), h = A(!1), D = A(void 0), O = N(
982
- () => c.options.find(
983
- (l) => {
984
- var e, r;
985
- return l.schemaName === ((e = t.value) == null ? void 0 : e.schemaName) && l.name === ((r = t.value) == null ? void 0 : r.name);
986
- }
987
- ) ?? {}
988
- );
989
- re(
990
- () => {
991
- var l;
992
- return (l = t.value) == null ? void 0 : l.option;
993
- },
994
- (l, e) => {
995
- if (e !== void 0 && l !== e && t.value) {
996
- if (R(), !D.value)
997
- return;
998
- t.value = {
999
- ...t.value,
1000
- values: (
1001
- // only overwrite the value when it empty
1002
- t.value.values.map((r) => {
1003
- var _;
1004
- return r === null ? (_ = D.value) == null ? void 0 : _.default : r;
1005
- })
1006
- )
1007
- };
1008
- }
1009
- }
1010
- ), re(
1011
- () => {
1012
- var l;
1013
- return (l = t.value) == null ? void 0 : l.operator;
1014
- },
1015
- (l, e) => {
1016
- if (l !== e && O.value && t.value) {
1017
- if (R(), !D.value)
1018
- return;
1019
- const r = t.value.values.length - D.value.count;
1020
- r > 0 && D.value.fixed ? t.value = {
1021
- ...t.value,
1022
- values: t.value.values.slice(0, D.value.count)
1023
- } : r < 0 && (t.value = {
1024
- ...t.value,
1025
- values: [
1026
- ...t.value.values,
1027
- ...Array(Math.abs(r)).fill(D.value.default)
1028
- ]
1029
- });
1030
- }
1031
- },
1032
- {
1033
- deep: !0
1034
- }
1035
- );
1036
- function R() {
1037
- O.value && t.value && (D.value = cl({
1038
- operator: t.value.operator,
1039
- dataType: O.value.type,
1040
- dimensionOption: t.value.option
1041
- }));
1042
- }
1043
- function V(l) {
1044
- var e, r, _;
1045
- (l.schemaName !== ((e = t.value) == null ? void 0 : e.schemaName) || l.name !== ((r = t.value) == null ? void 0 : r.name)) && (t.value = {
1046
- schemaName: l.schemaName,
1047
- name: l.name,
1048
- operator: l.filterOperators[0],
1049
- option: l.filterDimensionOptions[0],
1050
- values: []
1051
- }, R(), t.value.values = [(_ = D.value) == null ? void 0 : _.default]);
1052
- }
1053
- function m() {
1054
- const l = [...v.value.map((e) => e.value)];
1055
- t.value && (t.value.values = t.value.values.filter(
1056
- (e) => e !== "" && e !== null
1057
- ), f.value !== void 0 ? l[Number(f.value)] = t.value : l.push(t.value), a.value = l), b.value = !1;
1058
- }
1059
- function F(l) {
1060
- const e = [...v.value.map((r) => r.value)];
1061
- e.splice(l, 1), a.value = e, b.value = !1;
1062
- }
1063
- const o = N(
1064
- () => c.options.map((l) => ({
1065
- label: l.labels.join(" "),
1066
- value: l
1067
- }))
1068
- );
1069
- return (l, e) => {
1070
- const r = y("FmCheckbox"), _ = y("FmTextarea"), E = y("FmTextField"), P = y("FmForm"), X = y("FmIcon"), B = y("FmButton"), j = y("FmListItem"), q = y("FmList"), G = y("FmField");
1071
- return p(), L("div", bl, [
1072
- d(ie, {
1073
- modelValue: b.value,
1074
- "onUpdate:modelValue": e[6] || (e[6] = (J) => b.value = J),
1075
- title: g.value,
1076
- "primary-button-label": i(u)("report.common.confirm"),
1077
- "secondary-button-label": i(u)("report.common.cancel"),
1078
- onConfirm: m
1079
- }, {
1080
- content: C(() => [
1081
- d(P, {
1082
- ref: "form",
1083
- class: "flex flex-col gap-2 w-[490px]"
1084
- }, {
1085
- default: C(() => {
1086
- var J, w;
1087
- return [
1088
- d(H, {
1089
- "model-value": O.value,
1090
- items: o.value,
1091
- placeholder: g.value,
1092
- label: g.value,
1093
- "onUpdate:modelValue": e[0] || (e[0] = ($) => V($))
1094
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
1095
- t.value ? (p(), L(Q, { key: 0 }, [
1096
- d(r, {
1097
- modelValue: h.value,
1098
- "onUpdate:modelValue": e[1] || (e[1] = ($) => h.value = $),
1099
- label: i(u)("report.section.filter.advance"),
1100
- value: !0
1101
- }, null, 8, ["modelValue", "label"]),
1102
- h.value ? (p(), k(_, {
1103
- key: 0,
1104
- modelValue: t.value.dataFormula,
1105
- "onUpdate:modelValue": e[2] || (e[2] = ($) => t.value.dataFormula = $),
1106
- placeholder: i(u)("report.section.filter.dataFormula")
1107
- }, null, 8, ["modelValue", "placeholder"])) : T("", !0),
1108
- d(E, {
1109
- modelValue: t.value.option,
1110
- "onUpdate:modelValue": e[3] || (e[3] = ($) => t.value.option = $),
1111
- placeholder: i(u)("report.section.filter.timeFormatter"),
1112
- label: i(u)("report.section.filter.timeFormatter")
1113
- }, null, 8, ["modelValue", "placeholder", "label"]),
1114
- (((J = O.value) == null ? void 0 : J.filterOperators) || []).length > 0 ? (p(), k(H, {
1115
- key: 1,
1116
- modelValue: t.value.operator,
1117
- "onUpdate:modelValue": e[4] || (e[4] = ($) => t.value.operator = $),
1118
- items: ((w = O.value) == null ? void 0 : w.filterOperators.map(($) => ({ label: $, value: $ }))) ?? []
1119
- }, null, 8, ["modelValue", "items"])) : T("", !0),
1120
- D.value ? (p(), k(gl, {
1121
- key: 2,
1122
- modelValue: t.value.values,
1123
- "onUpdate:modelValue": e[5] || (e[5] = ($) => t.value.values = $),
1124
- config: D.value
1125
- }, null, 8, ["modelValue", "config"])) : T("", !0)
1126
- ], 64)) : T("", !0)
1127
- ];
1128
- }),
1129
- _: 1
1130
- }, 512)
1131
- ]),
1132
- _: 1
1133
- }, 8, ["modelValue", "title", "primary-button-label", "secondary-button-label"]),
1134
- x("div", null, [
1135
- x("p", yl, I(g.value), 1),
1136
- x("p", Fl, I(i(u)("report.section.filter.description")), 1)
1137
- ]),
1138
- d(q, null, {
1139
- default: C(() => [
1140
- d(i(ce), {
1141
- list: a.value,
1142
- "item-key": "id",
1143
- class: "flex flex-col gap-2 w-full"
1144
- }, {
1145
- item: C(({ element: J, index: w }) => [
1146
- d(j, {
1147
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1148
- onClick: ee(($) => n(v.value[w]), ["stop"])
1149
- }, {
1150
- default: C(() => [
1151
- d(X, { name: "drag_handle" }),
1152
- x("p", Vl, I(i(he)(J.name)), 1),
1153
- e[8] || (e[8] = x("div", { class: "grow" }, null, -1)),
1154
- d(B, {
1155
- icon: "close",
1156
- size: "md",
1157
- variant: "tertiary",
1158
- onClick: ee(($) => F(w), ["stop"])
1159
- }, null, 8, ["onClick"])
1160
- ]),
1161
- _: 2
1162
- }, 1032, ["onClick"])
1163
- ]),
1164
- _: 1
1165
- }, 8, ["list"])
1166
- ]),
1167
- _: 1
1168
- }),
1169
- d(G, {
1170
- class: "text-fm-color-typo-tertiary",
1171
- onClick: e[7] || (e[7] = () => {
1172
- n();
1173
- })
1174
- }, {
1175
- default: C(() => [
1176
- ne(I(i(u)("report.section.filter.add")), 1)
1177
- ]),
1178
- _: 1
1179
- })
1180
- ]);
1181
- };
1182
- }
1183
- }), wl = { class: "flex flex-col my-2 gap-8" }, xl = { class: "fm-typo-en-body-lg-600" }, kl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Cl = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, _l = /* @__PURE__ */ W({
1184
- __name: "SortSection",
1185
- props: /* @__PURE__ */ z({
1186
- options: {
1187
- type: Array,
1188
- default: () => []
1189
- },
1190
- label: {
1191
- type: String,
1192
- default: "Sort"
1193
- }
1194
- }, {
1195
- modelValue: { required: !1, default: [] },
1196
- modelModifiers: {}
1197
- }),
1198
- emits: ["update:modelValue"],
1199
- setup(s) {
1200
- const { t: u } = le(), a = Y(s, "modelValue"), c = s, g = N(
1201
- () => c.label ? c.label : u(`report.section.sort.${c.label}`)
1202
- ), b = A(!1), v = N(
1203
- () => a.value.map((F, o) => {
1204
- const l = c.options.find(
1205
- (e) => e.schemaName === F.schemaName && e.name === F.name
1206
- );
1207
- return {
1208
- index: o,
1209
- labels: (l == null ? void 0 : l.labels) || [F.schemaName, F.name],
1210
- value: F
1211
- };
1212
- })
1213
- ), f = A(a.value.length > 0 ? 0 : void 0);
1214
- function n(F) {
1215
- var o;
1216
- b.value = !0, t.value = F != null && F.value ? JSON.parse(JSON.stringify(F.value)) : void 0, f.value = F == null ? void 0 : F.index, h.value = !!((o = t.value) != null && o.dataFormula);
1217
- }
1218
- const t = A(void 0), h = A(!1), D = N(
1219
- () => c.options.find(
1220
- (F) => {
1221
- var o, l;
1222
- return F.schemaName === ((o = t.value) == null ? void 0 : o.schemaName) && F.name === ((l = t.value) == null ? void 0 : l.name);
1223
- }
1224
- ) ?? {}
1225
- );
1226
- function O(F) {
1227
- var o, l;
1228
- (F.schemaName !== ((o = t.value) == null ? void 0 : o.schemaName) || F.name !== ((l = t.value) == null ? void 0 : l.name)) && (t.value = {
1229
- schemaName: F.schemaName,
1230
- name: F.name,
1231
- dimensionOption: F.dimensionOptions[0],
1232
- aggregation: null,
1233
- type: ge.Asc
1234
- });
1235
- }
1236
- function R() {
1237
- if (!t.value) {
1238
- console.log("new sort is undefined");
1239
- return;
1240
- }
1241
- const F = [...v.value.map((o) => o.value)];
1242
- f.value !== void 0 ? F[f.value] = t.value : F.push(t.value), a.value = F, b.value = !1;
1243
- }
1244
- function V(F) {
1245
- const o = [...v.value.map((l) => l.value)];
1246
- o.splice(F, 1), a.value = o, b.value = !1;
1247
- }
1248
- const m = N(
1249
- () => c.options.map((F) => ({
1250
- label: F.labels.join(" "),
1251
- value: F
1252
- }))
1253
- );
1254
- return (F, o) => {
1255
- const l = y("FmCheckbox"), e = y("FmTextarea"), r = y("FmForm"), _ = y("FmIcon"), E = y("FmButton"), P = y("FmListItem"), X = y("FmList"), B = y("FmField");
1256
- return p(), L("div", wl, [
1257
- d(ie, {
1258
- modelValue: b.value,
1259
- "onUpdate:modelValue": o[6] || (o[6] = (j) => b.value = j),
1260
- title: g.value,
1261
- onConfirm: R
1262
- }, {
1263
- content: C(() => [
1264
- d(r, {
1265
- ref: "form",
1266
- class: "flex flex-col gap-2 w-[490px]"
1267
- }, {
1268
- default: C(() => {
1269
- var j, q, G, J;
1270
- return [
1271
- d(H, {
1272
- "model-value": D.value,
1273
- items: m.value,
1274
- placeholder: g.value,
1275
- label: g.value,
1276
- "onUpdate:modelValue": o[0] || (o[0] = (w) => O(w))
1277
- }, null, 8, ["model-value", "items", "placeholder", "label"]),
1278
- t.value ? (p(), L(Q, { key: 0 }, [
1279
- (((j = D.value) == null ? void 0 : j.dimensionOptions) || []).length > 0 ? (p(), k(H, {
1280
- key: 0,
1281
- modelValue: t.value.dimensionOption,
1282
- "onUpdate:modelValue": o[1] || (o[1] = (w) => t.value.dimensionOption = w),
1283
- items: ((q = D.value) == null ? void 0 : q.dimensionOptions.map((w) => ({ label: w, value: w }))) ?? [],
1284
- placeholder: i(u)("report.section.sort.format"),
1285
- label: i(u)("report.section.sort.format")
1286
- }, null, 8, ["modelValue", "items", "placeholder", "label"])) : T("", !0),
1287
- (((G = D.value) == null ? void 0 : G.aggregations) || []).length > 0 ? (p(), k(H, {
1288
- key: 1,
1289
- modelValue: t.value.aggregation,
1290
- "onUpdate:modelValue": o[2] || (o[2] = (w) => t.value.aggregation = w),
1291
- items: ((J = D.value) == null ? void 0 : J.aggregations.map((w) => ({ label: w, value: w }))) ?? [],
1292
- label: i(u)("report.section.sort.aggregation"),
1293
- placeholder: i(u)("report.section.sort.aggregation")
1294
- }, null, 8, ["modelValue", "items", "label", "placeholder"])) : T("", !0),
1295
- d(H, {
1296
- modelValue: t.value.type,
1297
- "onUpdate:modelValue": o[3] || (o[3] = (w) => t.value.type = w),
1298
- items: Object.values(i(ge)).map((w) => ({ label: w, value: w })),
1299
- placeholder: i(u)("report.section.sort.order"),
1300
- label: i(u)("report.section.sort.order")
1301
- }, null, 8, ["modelValue", "items", "placeholder", "label"]),
1302
- d(l, {
1303
- modelValue: h.value,
1304
- "onUpdate:modelValue": o[4] || (o[4] = (w) => h.value = w),
1305
- label: i(u)("report.section.sort.advance"),
1306
- value: !0
1307
- }, null, 8, ["modelValue", "label"]),
1308
- h.value ? (p(), k(e, {
1309
- key: 2,
1310
- modelValue: t.value.dataFormula,
1311
- "onUpdate:modelValue": o[5] || (o[5] = (w) => t.value.dataFormula = w),
1312
- placeholder: i(u)("report.section.sort.dataFormula")
1313
- }, null, 8, ["modelValue", "placeholder"])) : T("", !0)
1314
- ], 64)) : T("", !0)
1315
- ];
1316
- }),
1317
- _: 1
1318
- }, 512)
1319
- ]),
1320
- _: 1
1321
- }, 8, ["modelValue", "title"]),
1322
- x("div", null, [
1323
- x("p", xl, I(g.value), 1),
1324
- x("p", kl, I(i(u)("report.section.sort.description")), 1)
1325
- ]),
1326
- d(X, null, {
1327
- default: C(() => [
1328
- d(i(ce), {
1329
- list: a.value,
1330
- "item-key": "id",
1331
- class: "flex flex-col gap-2 w-full"
1332
- }, {
1333
- item: C(({ element: j, index: q }) => [
1334
- d(P, {
1335
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1336
- onClick: ee((G) => n(v.value[q]), ["stop"])
1337
- }, {
1338
- default: C(() => [
1339
- d(_, { name: "drag_handle" }),
1340
- x("p", Cl, I(i(he)(j.name)), 1),
1341
- o[8] || (o[8] = x("div", { class: "grow" }, null, -1)),
1342
- d(E, {
1343
- icon: "close",
1344
- size: "md",
1345
- variant: "tertiary",
1346
- onClick: ee((G) => V(q), ["stop"])
1347
- }, null, 8, ["onClick"])
1348
- ]),
1349
- _: 2
1350
- }, 1032, ["onClick"])
1351
- ]),
1352
- _: 1
1353
- }, 8, ["list"])
1354
- ]),
1355
- _: 1
1356
- }),
1357
- d(B, {
1358
- class: "text-fm-color-typo-tertiary",
1359
- onClick: o[7] || (o[7] = () => {
1360
- n();
1361
- })
1362
- }, {
1363
- default: C(() => [
1364
- ne(I(i(u)("report.section.sort.add")), 1)
1365
- ]),
1366
- _: 1
1367
- })
1368
- ]);
1369
- };
1370
- }
1371
- }), Tl = { class: "fm-typo-en-body-lg-600" }, Sl = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Dl = /* @__PURE__ */ W({
1372
- __name: "LimitSection",
1373
- props: {
1374
- modelValue: { required: !0, default: null },
1375
- modelModifiers: {}
1376
- },
1377
- emits: ["update:modelValue"],
1378
- setup(s) {
1379
- const { t: u } = le(), a = Y(s, "modelValue"), c = De((g) => {
1380
- g !== "" ? a.value = g : a.value = null;
1381
- }, 1e3);
1382
- return (g, b) => {
1383
- const v = y("FmTextField");
1384
- return p(), L(Q, null, [
1385
- x("div", null, [
1386
- x("p", Tl, I(i(u)("report.section.limit.title")), 1),
1387
- x("p", Sl, I(i(u)("report.section.limit.description")), 1)
1388
- ]),
1389
- d(v, {
1390
- "model-value": a.value,
1391
- inputmode: "numeric",
1392
- placeholder: i(u)("report.section.limit.placeholder"),
1393
- "onUpdate:modelValue": b[0] || (b[0] = (f) => i(c)(f))
1394
- }, null, 8, ["model-value", "placeholder"])
1395
- ], 64);
1396
- };
1397
- }
1398
- }), Nl = { class: "flex flex-col my-2 gap-8" }, Ul = { class: "fm-typo-en-body-lg-600" }, $l = { class: "fm-typo-en-body-sm-600 text-fm-color-neutral-gray-400" }, Ol = { class: "fm-typo-en-body-lg-400 text-ellipsis overflow-hidden line-clamp-1" }, Il = /* @__PURE__ */ W({
1399
- __name: "ConditionSection",
1400
- props: /* @__PURE__ */ z({
1401
- joinFieldOptions: {
1402
- type: Array,
1403
- default: () => []
1404
- },
1405
- mainFieldOptions: {
1406
- type: Array,
1407
- default: () => []
1408
- }
1409
- }, {
1410
- modelValue: { required: !0 },
1411
- modelModifiers: {}
1412
- }),
1413
- emits: ["update:modelValue"],
1414
- setup(s) {
1415
- const { t: u } = le(), a = Y(s, "modelValue"), c = s, g = A(!1), b = N(
1416
- () => a.value.map((o, l) => {
1417
- var e, r;
1418
- return {
1419
- index: l,
1420
- labels: [(e = o.joinDimension) == null ? void 0 : e.schemaName, (r = o.joinDimension) == null ? void 0 : r.name],
1421
- value: o
1422
- };
1423
- })
1424
- ), v = A(a.value.length > 0 ? 0 : void 0);
1425
- function f(o) {
1426
- o ? (n.value = o != null && o.value ? JSON.parse(JSON.stringify(o.value)) : void 0, v.value = o == null ? void 0 : o.index) : (n.value = {
1427
- joinDimension: null,
1428
- operator: "",
1429
- mainDimensions: []
1430
- }, v.value = void 0), g.value = !0;
1431
- }
1432
- const n = A(void 0), t = N(
1433
- () => c.joinFieldOptions.find(
1434
- (o) => {
1435
- var l, e;
1436
- return o.schemaName === ((e = (l = n.value) == null ? void 0 : l.joinDimension) == null ? void 0 : e.schemaName) && o.name === n.value.joinDimension.name;
1437
- }
1438
- ) ?? {}
1439
- ), h = N(
1440
- () => {
1441
- var o;
1442
- return (((o = n.value) == null ? void 0 : o.mainDimensions) || []).map(
1443
- (l) => c.mainFieldOptions.find(
1444
- (e) => e.schemaName === (l == null ? void 0 : l.schemaName) && e.name === l.name
1445
- ) ?? {}
1446
- );
1447
- }
1448
- ), D = N(
1449
- () => c.joinFieldOptions.map((o) => ({ label: o.labels.join(" "), value: o }))
1450
- );
1451
- function O(o) {
1452
- var l, e, r, _;
1453
- n.value && (n.value && o.schemaName !== ((e = (l = n.value) == null ? void 0 : l.joinDimension) == null ? void 0 : e.schemaName) || o.name !== ((_ = (r = n.value) == null ? void 0 : r.joinDimension) == null ? void 0 : _.name)) && (n.value = {
1454
- ...n.value,
1455
- joinDimension: {
1456
- schemaName: o.schemaName,
1457
- name: o.name,
1458
- option: o.dimensionOptions[0],
1459
- label: o.label,
1460
- hide: !0
1461
- }
1462
- }, o.joinConditionOperators.includes(n.value.operator) || V(o.joinConditionOperators[0]));
1463
- }
1464
- function R(o, l) {
1465
- var e, r, _, E;
1466
- if (n.value && l >= 0 && (n.value && o.schemaName !== ((r = (e = n.value) == null ? void 0 : e.mainDimensions[l]) == null ? void 0 : r.schemaName) || o.name !== ((E = (_ = n.value) == null ? void 0 : _.mainDimensions[l]) == null ? void 0 : E.name))) {
1467
- const P = [...n.value.mainDimensions];
1468
- P[l] = {
1469
- schemaName: o.schemaName,
1470
- name: o.name,
1471
- option: o.dimensionOptions[0],
1472
- label: o.label,
1473
- hide: !0
1474
- }, n.value = {
1475
- ...n.value,
1476
- mainDimensions: P
1477
- };
1478
- }
1479
- }
1480
- function V(o) {
1481
- if (n.value)
1482
- switch (o) {
1483
- case Z.Between:
1484
- n.value = {
1485
- ...n.value,
1486
- operator: o,
1487
- mainDimensions: [null, null]
1488
- };
1489
- break;
1490
- default:
1491
- n.value = {
1492
- ...n.value,
1493
- operator: o,
1494
- mainDimensions: [null]
1495
- };
1496
- break;
1497
- }
1498
- }
1499
- function m() {
1500
- const o = [...b.value.map((l) => l.value)];
1501
- n.value && (n.value.mainDimensions = n.value.mainDimensions.filter(
1502
- (l) => l !== "" && l != null
1503
- ), v.value !== void 0 ? o[v.value] = n.value : o.push(n.value)), a.value = o, g.value = !1;
1504
- }
1505
- function F(o) {
1506
- const l = [...b.value.map((e) => e.value)];
1507
- l.splice(o, 1), a.value = l;
1508
- }
1509
- return (o, l) => {
1510
- const e = y("FmMenuDivider"), r = y("FmForm"), _ = y("FmButton"), E = y("FmListItem"), P = y("FmList"), X = y("FmField");
1511
- return p(), L("div", Nl, [
1512
- d(ie, {
1513
- modelValue: g.value,
1514
- "onUpdate:modelValue": l[2] || (l[2] = (B) => g.value = B),
1515
- title: i(u)("report.section.condition.condition"),
1516
- onConfirm: m
1517
- }, {
1518
- content: C(() => [
1519
- d(r, {
1520
- ref: "form",
1521
- class: "flex flex-col gap-2 w-[490px]"
1522
- }, {
1523
- default: C(() => {
1524
- var B, j, q, G, J;
1525
- return [
1526
- d(H, {
1527
- label: i(u)("report.section.condition.joinDatasource"),
1528
- "model-value": t.value,
1529
- items: D.value,
1530
- placeholder: i(u)("report.section.condition.joinDimension"),
1531
- "onUpdate:modelValue": l[0] || (l[0] = (w) => O(w))
1532
- }, null, 8, ["label", "model-value", "items", "placeholder"]),
1533
- d(e),
1534
- (B = n.value) != null && B.joinDimension && (((j = t.value) == null ? void 0 : j.dimensionOptions) || []).length > 0 ? (p(), k(H, {
1535
- key: 0,
1536
- modelValue: n.value.joinDimension.option,
1537
- "onUpdate:modelValue": l[1] || (l[1] = (w) => n.value.joinDimension.option = w),
1538
- label: i(u)("report.section.condition.format"),
1539
- items: ((q = t.value) == null ? void 0 : q.dimensionOptions.map((w) => ({
1540
- label: w,
1541
- value: w
1542
- }))) ?? []
1543
- }, null, 8, ["modelValue", "label", "items"])) : T("", !0),
1544
- n.value && (((G = t.value) == null ? void 0 : G.joinConditionOperators) || []).length > 0 ? (p(), k(H, {
1545
- key: 1,
1546
- "model-value": n.value.operator,
1547
- label: i(u)("report.section.condition.operator"),
1548
- items: t.value.joinConditionOperators.map((w) => ({
1549
- label: w,
1550
- value: w
1551
- })) ?? [],
1552
- "onUpdate:modelValue": V
1553
- }, null, 8, ["model-value", "label", "items"])) : T("", !0),
1554
- (p(!0), L(Q, null, se(((J = n.value) == null ? void 0 : J.mainDimensions) || [], (w, $) => {
1555
- var K, ae;
1556
- return p(), L("div", {
1557
- key: $,
1558
- class: "flex flex-col gap-2"
1559
- }, [
1560
- d(H, {
1561
- "model-value": h.value[$],
1562
- label: i(u)("report.section.condition.mainDatasource", { index: $ + 1 }),
1563
- items: c.mainFieldOptions.map((U) => ({
1564
- label: U.labels.join(" "),
1565
- value: U
1566
- })),
1567
- "onUpdate:modelValue": (U) => R(U, $)
1568
- }, null, 8, ["model-value", "label", "items", "onUpdate:modelValue"]),
1569
- w && (((K = h.value[$]) == null ? void 0 : K.dimensionOptions) || []).length > 0 && w ? (p(), k(H, {
1570
- key: 0,
1571
- modelValue: w.option,
1572
- "onUpdate:modelValue": (U) => w.option = U,
1573
- items: (ae = h.value[$]) == null ? void 0 : ae.dimensionOptions.map((U) => ({
1574
- label: U,
1575
- value: U
1576
- }))
1577
- }, null, 8, ["modelValue", "onUpdate:modelValue", "items"])) : T("", !0),
1578
- d(e)
1579
- ]);
1580
- }), 128))
1581
- ];
1582
- }),
1583
- _: 1
1584
- }, 512)
1585
- ]),
1586
- _: 1
1587
- }, 8, ["modelValue", "title"]),
1588
- x("div", null, [
1589
- x("p", Ul, I(i(u)("report.section.condition.condition")), 1),
1590
- x("p", $l, I(i(u)("report.section.condition.description")), 1)
1591
- ]),
1592
- d(P, { class: "flex flex-col gap-2" }, {
1593
- default: C(() => [
1594
- (p(!0), L(Q, null, se(a.value, (B, j) => (p(), k(E, {
1595
- key: j,
1596
- class: "!cursor-grab border rounded-md border-neutral-300 h-[40px] !p-[8px]",
1597
- onClick: (q) => f(b.value[j])
1598
- }, {
1599
- default: C(() => {
1600
- var q, G;
1601
- return [
1602
- x("p", Ol, I(i(ze)(((q = B.joinDimension) == null ? void 0 : q.schemaName) ?? "")) + " " + I((G = B.joinDimension) == null ? void 0 : G.label), 1),
1603
- l[4] || (l[4] = x("div", { class: "grow" }, null, -1)),
1604
- d(_, {
1605
- icon: "close",
1606
- size: "md",
1607
- variant: "tertiary",
1608
- onClick: ee((J) => F(j), ["stop"])
1609
- }, null, 8, ["onClick"])
1610
- ];
1611
- }),
1612
- _: 2
1613
- }, 1032, ["onClick"]))), 128))
1614
- ]),
1615
- _: 1
1616
- }),
1617
- d(X, {
1618
- class: "text-fm-color-typo-tertiary cursor-pointer",
1619
- onClick: l[3] || (l[3] = (B) => f())
1620
- }, {
1621
- default: C(() => [
1622
- ne(I(i(u)("report.section.condition.add")), 1)
1623
- ]),
1624
- _: 1
1625
- })
1626
- ]);
1627
- };
1628
- }
1629
- }), ke = /* @__PURE__ */ W({
1630
- __name: "Datasource",
1631
- props: /* @__PURE__ */ z({
1632
- label: {
1633
- type: String,
1634
- default: "Label"
1635
- },
1636
- config: {
1637
- type: Object,
1638
- default: null
1639
- },
1640
- closeable: {
1641
- type: Boolean,
1642
- default: !1
1643
- },
1644
- mainDatasourceConfig: {
1645
- type: Object,
1646
- default: () => {
1647
- }
1648
- },
1649
- modelValue: {
1650
- type: Object,
1651
- default: () => {
1652
- }
1653
- }
1654
- }, {
1655
- modelValue: { required: !0 },
1656
- modelModifiers: {}
1657
- }),
1658
- emits: /* @__PURE__ */ z(["click-close"], ["update:modelValue"]),
1659
- setup(s, { emit: u }) {
1660
- const a = Y(s, "modelValue");
1661
- re(
1662
- [() => a.value.dimensions, () => a.value.metrics],
1663
- () => {
1664
- const { rowIds: V, columnIds: m } = ye(a.value);
1665
- a.value.rowIds = V, a.value.columnIds = m;
1666
- },
1667
- { deep: !0 }
1668
- );
1669
- const c = s, g = u, { schemas: b } = Ve(Ue()), { t: v } = le(), f = N(() => !c.mainDatasourceConfig), n = N(
1670
- () => [S.BarChart, S.LineChart, S.Scorecard].includes(c.config.type)
1671
- ), t = N(() => {
1672
- const V = [...a.value.dimensions].filter((m) => !m.hide);
1673
- return V.sort(
1674
- (m, F) => (a.value.rowIds || []).indexOf(de(m)) - (a.value.rowIds || []).indexOf(de(F))
1675
- ), V;
1676
- }), h = N(() => c.config.type === S.Scorecard), D = N(
1677
- () => {
1678
- var V;
1679
- return (((V = c.mainDatasourceConfig) == null ? void 0 : V.schemaNames) || []).reduce(
1680
- (m, F) => {
1681
- const o = b.value.find((l) => l.name === F);
1682
- return o && (m = [
1683
- ...m,
1684
- ...o.fields.map((l) => ({
1685
- ...l,
1686
- labels: [o.label, l.label || l.name]
1687
- }))
1688
- ]), m;
1689
- },
1690
- []
1691
- );
1692
- }
1693
- ), O = N(
1694
- () => a.value.schemaNames.reduce((V, m) => {
1695
- const F = b.value.find((o) => o.name === m);
1696
- return F && (V = [
1697
- ...V,
1698
- ...F.fields.map((o) => ({
1699
- ...o,
1700
- labels: [F.label, o.label || o.name]
1701
- }))
1702
- ]), V;
1703
- }, [])
1704
- ), R = N(() => [
1705
- { labels: [v("report.section.datasource.none")], value: null },
1706
- { labels: [v("report.section.datasource.grandTotal")], value: 0 },
1707
- ...[...t.value].slice(0, t.value.length - 1).map((V, m) => ({ labels: [V.label], value: m + 1 }))
1708
- ]);
1709
- return (V, m) => {
1710
- const F = y("FmButton"), o = y("FmSwitch"), l = y("FmSelect");
1711
- return p(), k(fe, null, {
1712
- header: C(() => [
1713
- x("p", null, I(c.label), 1),
1714
- m[18] || (m[18] = x("div", { class: "grow" }, null, -1)),
1715
- c.closeable ? (p(), k(F, {
1716
- key: 0,
1717
- icon: "close",
1718
- variant: "tertiary",
1719
- size: "md",
1720
- onClick: m[0] || (m[0] = ee((e) => g("click-close"), ["stop"]))
1721
- })) : T("", !0)
1722
- ]),
1723
- content: C(() => [
1724
- d(Ze, {
1725
- modelValue: a.value,
1726
- "onUpdate:modelValue": m[1] || (m[1] = (e) => a.value = e),
1727
- label: i(v)("report.section.schema.title")
1728
- }, null, 8, ["modelValue", "label"]),
1729
- d(ve, {
1730
- modelValue: a.value.dimensions,
1731
- "onUpdate:modelValue": m[2] || (m[2] = (e) => a.value.dimensions = e),
1732
- options: O.value,
1733
- config: a.value,
1734
- max: c.config.maxDimension,
1735
- "has-row-column": !0,
1736
- onConfig: m[3] || (m[3] = (e) => {
1737
- a.value = e;
1738
- })
1739
- }, null, 8, ["modelValue", "options", "config", "max"]),
1740
- d(o, {
1741
- "label-placement": "right",
1742
- label: i(v)("report.section.datasource.comparable"),
1743
- "model-value": a.value.isComparable ?? !1,
1744
- "onUpdate:modelValue": m[4] || (m[4] = (e) => {
1745
- a.value.isComparable = e;
1746
- })
1747
- }, null, 8, ["label", "model-value"]),
1748
- n.value ? (p(), k(o, {
1749
- key: 0,
1750
- "label-placement": "right",
1751
- label: i(v)("report.section.datasource.cumulative"),
1752
- "model-value": a.value.isCumulative ?? !1,
1753
- "onUpdate:modelValue": m[5] || (m[5] = (e) => {
1754
- a.value.isCumulative = e;
1755
- })
1756
- }, null, 8, ["label", "model-value"])) : T("", !0),
1757
- c.config.hasLabel ? (p(), k(o, {
1758
- key: 1,
1759
- label: i(v)("report.section.datasource.showLabel"),
1760
- "label-placement": "right",
1761
- "model-value": a.value.showLabel ?? !1,
1762
- "onUpdate:modelValue": m[6] || (m[6] = (e) => {
1763
- a.value.showLabel = e;
1764
- })
1765
- }, null, 8, ["label", "model-value"])) : T("", !0),
1766
- c.config.isDrillConfigurable && f.value ? (p(), k(o, {
1767
- key: 2,
1768
- label: i(v)("report.section.datasource.drill"),
1769
- "label-placement": "right",
1770
- "model-value": a.value.isDrillable ?? !1,
1771
- "onUpdate:modelValue": m[7] || (m[7] = (e) => {
1772
- a.value.isDrillable = e;
1773
- })
1774
- }, null, 8, ["label", "model-value"])) : T("", !0),
1775
- c.config.canRollup && f.value ? (p(), k(l, {
1776
- key: 3,
1777
- modelValue: a.value.rollup,
1778
- "onUpdate:modelValue": m[8] || (m[8] = (e) => a.value.rollup = e),
1779
- label: i(v)("report.section.datasource.subTotal"),
1780
- items: R.value.map((e) => ({ label: e.labels[0], value: e.value }))
1781
- }, null, 8, ["modelValue", "label", "items"])) : T("", !0),
1782
- c.config.canTranspose && f.value ? (p(), k(o, {
1783
- key: 4,
1784
- modelValue: a.value.isTransposed,
1785
- "onUpdate:modelValue": m[9] || (m[9] = (e) => a.value.isTransposed = e),
1786
- label: i(v)("report.section.datasource.transpose"),
1787
- "label-placement": "right"
1788
- }, null, 8, ["modelValue", "label"])) : T("", !0),
1789
- c.config.hasBreakdownDimension ? (p(), k(ve, {
1790
- key: 5,
1791
- "model-value": a.value.breakdownDimension ? [a.value.breakdownDimension] : [],
1792
- label: i(v)("report.section.dimension.breakdownDimension"),
1793
- max: 1,
1794
- options: O.value,
1795
- "onUpdate:modelValue": m[10] || (m[10] = (e) => {
1796
- a.value.breakdownDimension = e[0];
1797
- })
1798
- }, null, 8, ["model-value", "label", "options"])) : T("", !0),
1799
- h.value ? (p(), k(ve, {
1800
- key: 6,
1801
- "model-value": a.value.sparklineDimension ? [a.value.sparklineDimension] : [],
1802
- label: i(v)("report.section.dimension.sparklineDimension"),
1803
- max: 1,
1804
- options: O.value,
1805
- "onUpdate:modelValue": m[11] || (m[11] = (e) => {
1806
- a.value.sparklineDimension = e[0];
1807
- })
1808
- }, null, 8, ["model-value", "label", "options"])) : T("", !0),
1809
- d(ml, {
1810
- modelValue: a.value.metrics,
1811
- "onUpdate:modelValue": m[12] || (m[12] = (e) => a.value.metrics = e),
1812
- options: O.value,
1813
- max: c.config.maxMetric,
1814
- config: a.value,
1815
- "has-row-column": c.config.type === i(S).Table,
1816
- onConfig: m[13] || (m[13] = (e) => {
1817
- a.value = e;
1818
- })
1819
- }, null, 8, ["modelValue", "options", "max", "config", "has-row-column"]),
1820
- d(hl, {
1821
- modelValue: a.value.filters,
1822
- "onUpdate:modelValue": m[14] || (m[14] = (e) => a.value.filters = e),
1823
- options: O.value
1824
- }, null, 8, ["modelValue", "options"]),
1825
- d(_l, {
1826
- modelValue: a.value.sorts,
1827
- "onUpdate:modelValue": m[15] || (m[15] = (e) => a.value.sorts = e),
1828
- options: O.value
1829
- }, null, 8, ["modelValue", "options"]),
1830
- d(Dl, {
1831
- modelValue: a.value.limit,
1832
- "onUpdate:modelValue": m[16] || (m[16] = (e) => a.value.limit = e)
1833
- }, null, 8, ["modelValue"]),
1834
- a.value.conditions ? (p(), k(Il, {
1835
- key: 7,
1836
- modelValue: a.value.conditions,
1837
- "onUpdate:modelValue": m[17] || (m[17] = (e) => a.value.conditions = e),
1838
- "join-field-options": O.value,
1839
- "main-field-options": D.value
1840
- }, null, 8, ["modelValue", "join-field-options", "main-field-options"])) : T("", !0)
1841
- ]),
1842
- _: 1
1843
- });
1844
- };
1845
- }
1846
- }), Ll = { class: "fm-typo-en-title-sm-600" }, Fe = /* @__PURE__ */ W({
1847
- __name: "TileEditorTabHeader",
1848
- props: /* @__PURE__ */ z({
1849
- icon: {
1850
- type: String,
1851
- required: !0
1852
- }
1853
- }, {
1854
- modelValue: { type: Boolean, required: !0, default: !1 },
1855
- modelModifiers: {}
1856
- }),
1857
- emits: ["update:modelValue"],
1858
- setup(s) {
1859
- const { t: u } = le(), a = Y(s, "modelValue"), c = s;
1860
- return (g, b) => {
1861
- const v = y("FmIcon");
1862
- return p(), L("div", {
1863
- class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
1864
- onClick: b[0] || (b[0] = (f) => a.value = !a.value)
1865
- }, [
1866
- x("p", Ll, I(i(u)("report.tile.setting")), 1),
1867
- b[1] || (b[1] = x("div", { class: "grow" }, null, -1)),
1868
- d(v, {
1869
- name: c.icon
1870
- }, null, 8, ["name"])
1871
- ]);
1872
- };
1873
- }
1874
- }), Bl = /* @__PURE__ */ W({
1875
- __name: "TileEditorTabDesktop",
1876
- props: {
1877
- modelValue: { required: !0, default: !1 },
1878
- modelModifiers: {}
1879
- },
1880
- emits: ["update:modelValue"],
1881
- setup(s) {
1882
- const u = Y(s, "modelValue");
1883
- return (a, c) => (p(), L(Q, null, [
1884
- d(Fe, {
1885
- modelValue: u.value,
1886
- "onUpdate:modelValue": c[0] || (c[0] = (g) => u.value = g),
1887
- icon: "keyboard_double_arrow_left"
1888
- }, null, 8, ["modelValue"]),
1889
- Ce(a.$slots, "default")
1890
- ], 64));
1891
- }
1892
- }), Ml = { class: "fixed bottom-0 w-full" }, Rl = /* @__PURE__ */ W({
1893
- __name: "TileEditorTabMobile",
1894
- props: {
1895
- modelValue: { required: !0, default: !1 },
1896
- modelModifiers: {}
1897
- },
1898
- emits: ["update:modelValue"],
1899
- setup(s) {
1900
- const u = Y(s, "modelValue");
1901
- return (a, c) => {
1902
- const g = y("FmTopSheet");
1903
- return p(), L("div", Ml, [
1904
- d(Fe, {
1905
- modelValue: u.value,
1906
- "onUpdate:modelValue": c[0] || (c[0] = (b) => u.value = b),
1907
- icon: "keyboard_double_arrow_up"
1908
- }, null, 8, ["modelValue"]),
1909
- d(g, {
1910
- modelValue: u.value,
1911
- "onUpdate:modelValue": c[2] || (c[2] = (b) => u.value = b),
1912
- "fullscreen-size": "sm"
1913
- }, {
1914
- default: C(() => [
1915
- d(Fe, {
1916
- modelValue: u.value,
1917
- "onUpdate:modelValue": c[1] || (c[1] = (b) => u.value = b),
1918
- icon: "keyboard_double_arrow_down"
1919
- }, null, 8, ["modelValue"]),
1920
- u.value ? Ce(a.$slots, "default", { key: 0 }) : T("", !0)
1921
- ]),
1922
- _: 3
1923
- }, 8, ["modelValue"])
1924
- ]);
1925
- };
1926
- }
1927
- }), jl = { class: "h-[40x]" }, Ie = /* @__PURE__ */ W({
1928
- __name: "TileEditorTab",
1929
- props: /* @__PURE__ */ z({
1930
- hideConfiguration: {
1931
- type: Boolean,
1932
- default: !1
1933
- }
1934
- }, {
1935
- modelValue: {
1936
- required: !0
1937
- },
1938
- modelModifiers: {}
1939
- }),
1940
- emits: /* @__PURE__ */ z(["hideConfiguration"], ["update:modelValue"]),
1941
- setup(s, { emit: u }) {
1942
- const a = Y(s, "modelValue"), { breakpoints: c } = Ne(), g = s, { promptMessage: b } = Se(), v = u, { t: f } = le();
1943
- function n(o) {
1944
- a.value = nl(o);
1945
- }
1946
- function t() {
1947
- const o = [...a.value.widget.config.joinDatasources || []];
1948
- o.push({ ...qe(a.value.widget.type), conditions: [] }), n({
1949
- ...a.value,
1950
- widget: {
1951
- ...a.value.widget,
1952
- config: {
1953
- ...a.value.widget.config,
1954
- joinDatasources: o
1955
- }
1956
- }
1957
- });
1958
- }
1959
- async function h(o) {
1960
- if (!await b({
1961
- title: f("report.tile.datasource.remove"),
1962
- message: f("report.tile.datasource.confirmRemove", { index: o + 1 })
1963
- })) return;
1964
- const e = [...a.value.widget.config.joinDatasources || []];
1965
- e.splice(o, 1), n({
1966
- ...a.value,
1967
- widget: {
1968
- ...a.value.widget,
1969
- config: {
1970
- ...a.value.widget.config,
1971
- joinDatasources: e
1972
- }
1973
- }
1974
- });
1975
- }
1976
- const D = (o, l) => {
1977
- let e = 1, r = 1;
1978
- switch (o) {
1979
- case S.Scorecard:
1980
- e = 1, r = 2;
1981
- break;
1982
- case S.BarChart:
1983
- case S.StackBarChart:
1984
- case S.LineChart:
1985
- case S.StackLineChart:
1986
- e = 4, r = 6;
1987
- break;
1988
- case S.Table:
1989
- e = 4, r = 12;
1990
- break;
1991
- case S.Circular:
1992
- e = 4, r = 4;
1993
- break;
1994
- case S.Spacer:
1995
- e = 0, r = 12;
1996
- break;
1997
- }
1998
- return {
1999
- size: {
2000
- height: e,
2001
- width: r
2002
- },
2003
- widget: {
2004
- ...l.widget,
2005
- type: o
2006
- }
2007
- };
2008
- }, O = N(
2009
- () => we.find((o) => o.type === a.value.widget.type)
2010
- ), R = N(() => a.value.widget.config.joinDatasources), V = N(() => {
2011
- switch (a.value.widget.type) {
2012
- case S.Table:
2013
- case S.BarChart:
2014
- case S.LineChart:
2015
- case S.StackBarChart:
2016
- case S.StackLineChart:
2017
- case S.Circular:
2018
- return 4;
2019
- case S.Scorecard:
2020
- return 2;
2021
- default:
2022
- return 1;
2023
- }
2024
- }), m = N(() => {
2025
- switch (a.value.widget.type) {
2026
- case S.Table:
2027
- case S.BarChart:
2028
- case S.LineChart:
2029
- case S.StackBarChart:
2030
- case S.StackLineChart:
2031
- case S.Circular:
2032
- return 4;
2033
- default:
2034
- return 1;
2035
- }
2036
- }), F = De((o) => {
2037
- a.value.widget.title = o;
2038
- }, 500);
2039
- return (o, l) => {
2040
- const e = y("FmCircularProgress"), r = y("FmTextField"), _ = y("FmTextarea"), E = y("FmStepperField"), P = y("FmButton"), X = y("FmForm");
2041
- return p(), k(_e(i(c).lg || i(c).md ? Bl : Rl), {
2042
- "model-value": g.hideConfiguration,
2043
- "onUpdate:modelValue": l[6] || (l[6] = (B) => v("hideConfiguration", B))
2044
- }, {
2045
- default: C(() => [
2046
- a.value ? (p(), k(X, {
2047
- key: 1,
2048
- ref: "form",
2049
- class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
2050
- }, {
2051
- default: C(() => [
2052
- d(fe, null, {
2053
- header: C(() => [
2054
- x("p", null, I(i(f)("report.tile.widget.details")), 1),
2055
- l[7] || (l[7] = x("div", { class: "grow" }, null, -1))
2056
- ]),
2057
- content: C(() => [
2058
- d(r, {
2059
- "model-value": a.value.widget.title,
2060
- label: i(f)("report.tile.widget.title"),
2061
- placeholder: i(f)("report.tile.widget.titlePlaceholder"),
2062
- "onUpdate:modelValue": i(F)
2063
- }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"]),
2064
- d(_, {
2065
- modelValue: a.value.widget.description,
2066
- "onUpdate:modelValue": l[0] || (l[0] = (B) => a.value.widget.description = B),
2067
- disabled: a.value.widget.title === "",
2068
- label: i(f)("report.tile.widget.description"),
2069
- placeholder: i(f)("report.tile.widget.descriptionPlaceholder"),
2070
- "helper-text": i(f)("report.tile.widget.descriptionHelper")
2071
- }, null, 8, ["modelValue", "disabled", "label", "placeholder", "helper-text"]),
2072
- x("div", {
2073
- class: Te(["flex flex-row", `${i(c).sm || i(c).xs ? "gap-16" : "gap-2"}`])
2074
- }, [
2075
- d(E, {
2076
- modelValue: a.value.size.width,
2077
- "onUpdate:modelValue": l[1] || (l[1] = (B) => a.value.size.width = B),
2078
- label: i(f)("report.tile.widget.width"),
2079
- min: V.value,
2080
- max: 12
2081
- }, null, 8, ["modelValue", "label", "min"]),
2082
- d(E, {
2083
- modelValue: a.value.size.height,
2084
- "onUpdate:modelValue": l[2] || (l[2] = (B) => a.value.size.height = B),
2085
- label: i(f)("report.tile.widget.height"),
2086
- min: m.value,
2087
- max: 12,
2088
- disabled: a.value.widget.type === i(S).Scorecard
2089
- }, null, 8, ["modelValue", "label", "min", "disabled"])
2090
- ], 2)
2091
- ]),
2092
- _: 1
2093
- }),
2094
- d(fe, null, {
2095
- header: C(() => [
2096
- x("p", null, I(i(f)("report.tile.widget.type")), 1),
2097
- l[8] || (l[8] = x("div", { class: "grow" }, null, -1))
2098
- ]),
2099
- content: C(() => [
2100
- d(Ae, {
2101
- "is-list": !0,
2102
- "model-value": a.value.widget.type,
2103
- class: "grid grid-cols-1 gap-2",
2104
- "child-class": "flex flex-row p-[8px] gap-2",
2105
- "exclude-widge-type": [i(S).Spacer],
2106
- "onUpdate:modelValue": l[3] || (l[3] = (B) => a.value = D(B, a.value))
2107
- }, null, 8, ["model-value", "exclude-widge-type"])
2108
- ]),
2109
- _: 1
2110
- }),
2111
- d(ke, {
2112
- modelValue: a.value.widget.config,
2113
- "onUpdate:modelValue": l[4] || (l[4] = (B) => a.value.widget.config = B),
2114
- label: i(f)("report.tile.datasource.main"),
2115
- config: O.value
2116
- }, null, 8, ["modelValue", "label", "config"]),
2117
- R.value ? (p(!0), L(Q, { key: 0 }, se(R.value, (B, j) => (p(), L("div", { key: j }, [
2118
- d(ke, {
2119
- modelValue: R.value[j],
2120
- "onUpdate:modelValue": (q) => R.value[j] = q,
2121
- label: `Join datasource ${j + 1}`,
2122
- config: O.value,
2123
- "main-datasource-config": a.value.widget.config,
2124
- closeable: !0,
2125
- onClickClose: (q) => h(j)
2126
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "config", "main-datasource-config", "onClickClose"])
2127
- ]))), 128)) : T("", !0),
2128
- x("div", jl, [
2129
- d(P, {
2130
- label: i(f)("report.tile.datasource.joinButton"),
2131
- variant: "secondary",
2132
- icon: "add",
2133
- "icon-position": "prepend",
2134
- "border-color": i(me).ColorPrimary,
2135
- "text-color": i(me).ColorPrimary,
2136
- class: "w-full",
2137
- onClick: l[5] || (l[5] = (B) => t())
2138
- }, null, 8, ["label", "border-color", "text-color"])
2139
- ])
2140
- ]),
2141
- _: 1
2142
- }, 512)) : (p(), k(e, { key: 0 }))
2143
- ]),
2144
- _: 1
2145
- }, 8, ["model-value"]);
2146
- };
2147
- }
2148
- }), El = { class: "bg-fm-color-neutral-white flex flex-col h-full w-[400px]" }, Al = { class: "flex bg-fm-color-neutral-white w-[88px]" }, ql = { class: "w-full overflow-y-auto" }, Pl = {
2149
- class: "grid grid-cols-12 w-full p-24",
2150
- style: { backgroundColor: "#F6F8FC" }
2151
- }, Hl = /* @__PURE__ */ W({
2152
- __name: "TileEditorDesktop",
2153
- props: /* @__PURE__ */ z({
2154
- hideConfiguration: { type: Boolean, required: !0, default: !1 },
2155
- index: { type: Number, required: !0, default: 0 }
2156
- }, {
2157
- modelValue: {
2158
- required: !0
2159
- },
2160
- modelModifiers: {}
2161
- }),
2162
- emits: /* @__PURE__ */ z(["hideConfiguration"], ["update:modelValue"]),
2163
- setup(s, { emit: u }) {
2164
- const a = Y(s, "modelValue"), c = s, g = N(
2165
- () => we.find((v) => {
2166
- var f;
2167
- return v.type === ((f = a.value) == null ? void 0 : f.widget.type);
2168
- })
2169
- ), b = u;
2170
- return (v, f) => {
2171
- const n = y("FmCircularProgress"), t = y("FmButton");
2172
- return p(), L("div", null, [
2173
- a.value ? (p(), L(Q, { key: 1 }, [
2174
- d(Pe, {
2175
- "model-value": !s.hideConfiguration
2176
- }, {
2177
- right: C(() => [
2178
- x("div", El, [
2179
- d(Ie, {
2180
- modelValue: a.value,
2181
- "onUpdate:modelValue": f[0] || (f[0] = (h) => a.value = h),
2182
- config: g.value,
2183
- "hide-configuration": s.hideConfiguration,
2184
- onHideConfiguration: f[1] || (f[1] = (h) => {
2185
- b("hideConfiguration", h);
2186
- })
2187
- }, null, 8, ["modelValue", "config", "hide-configuration"])
2188
- ])
2189
- ]),
2190
- left: C(() => [
2191
- x("div", Al, [
2192
- d(t, {
2193
- variant: "secondary",
2194
- icon: "keyboard_double_arrow_right",
2195
- "border-color": i(me).ColorPrimary,
2196
- "text-color": i(me).ColorPrimary,
2197
- class: "m-24 my-16",
2198
- size: "md",
2199
- onClick: f[2] || (f[2] = (h) => b("hideConfiguration", !c.hideConfiguration))
2200
- }, null, 8, ["border-color", "text-color"])
2201
- ])
2202
- ]),
2203
- _: 1
2204
- }, 8, ["model-value"]),
2205
- x("div", ql, [
2206
- x("div", Pl, [
2207
- a.value ? (p(), k($e, {
2208
- key: 0,
2209
- "model-value": a.value,
2210
- index: c.index,
2211
- "hide-export": !0
2212
- }, null, 8, ["model-value", "index"])) : (p(), k(Oe, { key: 1 }))
2213
- ])
2214
- ])
2215
- ], 64)) : (p(), k(n, { key: 0 }))
2216
- ]);
2217
- };
2218
- }
2219
- }), Jl = {
2220
- key: 0,
2221
- class: "flex w-full justify-center items-center"
2222
- }, zl = { class: "w-full grid grid-cols-12 pb-28 pt-5 px-5 h-full" }, Gl = /* @__PURE__ */ W({
2223
- __name: "TileEditorMobile",
2224
- props: /* @__PURE__ */ z({
2225
- hideConfiguration: { type: Boolean, required: !0, default: !1 },
2226
- index: { type: Number, required: !0, default: 0 }
2227
- }, {
2228
- modelValue: {
2229
- required: !0
2230
- },
2231
- modelModifiers: {}
2232
- }),
2233
- emits: /* @__PURE__ */ z(["hideConfiguration"], ["update:modelValue"]),
2234
- setup(s, { emit: u }) {
2235
- const a = Y(s, "modelValue"), c = s, g = N(
2236
- () => we.find((v) => {
2237
- var f;
2238
- return v.type === ((f = a.value) == null ? void 0 : f.widget.type);
2239
- })
2240
- ), b = u;
2241
- return (v, f) => {
2242
- const n = y("FmCircularProgress");
2243
- return p(), L("div", null, [
2244
- a.value ? (p(), L(Q, { key: 1 }, [
2245
- x("div", zl, [
2246
- a.value ? (p(), k($e, {
2247
- key: 0,
2248
- "model-value": a.value,
2249
- index: c.index,
2250
- "hide-export": !0
2251
- }, null, 8, ["model-value", "index"])) : (p(), k(Oe, { key: 1 }))
2252
- ]),
2253
- d(Ie, {
2254
- modelValue: a.value,
2255
- "onUpdate:modelValue": f[0] || (f[0] = (t) => a.value = t),
2256
- config: g.value,
2257
- "hide-configuration": s.hideConfiguration,
2258
- onHideConfiguration: f[1] || (f[1] = (t) => {
2259
- b("hideConfiguration", t);
2260
- })
2261
- }, null, 8, ["modelValue", "config", "hide-configuration"])
2262
- ], 64)) : (p(), L("div", Jl, [
2263
- d(n)
2264
- ]))
2265
- ]);
2266
- };
2267
- }
2268
- }), Wl = {
2269
- key: 0,
2270
- class: "fm-typo-en-title-md-600"
2271
- }, ra = /* @__PURE__ */ W({
2272
- __name: "TileEditor",
2273
- setup(s) {
2274
- const u = Re(), a = je(), c = Je(), { currentSelectWidgetType: g, editingReport: b, editingTile: v, editingIndex: f } = Ve(c), { breakpoints: n } = Ne(), { promptMessage: t } = Se(), { t: h } = le(), D = A(!1);
2275
- async function O() {
2276
- var m;
2277
- if (!b.value) return;
2278
- await t({
2279
- title: h("report.tile.save.title"),
2280
- message: h("report.tile.save.confirm", { title: (m = v.value) == null ? void 0 : m.widget.title })
2281
- }) && (v.value && (b.value.tiles[f.value] = v.value), g.value = void 0, a.back());
2282
- }
2283
- async function R() {
2284
- var m;
2285
- if (!b.value) return;
2286
- await t({
2287
- title: h("report.tile.cancel.title"),
2288
- message: h("report.tile.cancel.confirm", { title: (m = v.value) == null ? void 0 : m.widget.title })
2289
- }) && (g.value = void 0, a.back());
2290
- }
2291
- return Le(() => {
2292
- b.value || a.push({ name: "reports" });
2293
- }), (V, m) => {
2294
- const F = y("FmPageHead");
2295
- return p(), k(He, null, {
2296
- default: C(() => [
2297
- d(F, {
2298
- actions: [
2299
- { label: "Cancel", value: "cancel", isPrimary: !1 },
2300
- { label: "Save", value: "save", isPrimary: !0 }
2301
- ],
2302
- "onClick:action": m[0] || (m[0] = (o) => {
2303
- o === "cancel" && R(), o === "save" && O();
2304
- })
2305
- }, {
2306
- title: C(() => {
2307
- var o;
2308
- return [
2309
- i(n).lg || i(n).md ? (p(), L("p", Wl, I(i(he)(((o = i(v)) == null ? void 0 : o.widget.type) ?? "New report")), 1)) : T("", !0)
2310
- ];
2311
- }),
2312
- _: 1
2313
- }),
2314
- i(v) ? (p(), k(_e(i(n).lg || i(n).md ? Hl : Gl), {
2315
- key: 0,
2316
- modelValue: i(v),
2317
- "onUpdate:modelValue": m[1] || (m[1] = (o) => Me(v) ? v.value = o : null),
2318
- class: Te(`${i(n).lg || i(n).md ? "flex" : ""} w-full`),
2319
- style: Be({ height: `calc( 100% - ${i(n).lg || i(n).md ? 72 : 64}px)` }),
2320
- "hide-configuration": D.value,
2321
- index: Number(i(u).params.tileIndex),
2322
- onHideConfiguration: m[2] || (m[2] = (o) => D.value = o)
2323
- }, null, 40, ["modelValue", "class", "style", "hide-configuration", "index"])) : T("", !0)
2324
- ]),
2325
- _: 1
2326
- });
2327
- };
2328
- }
2329
- });
2330
- export {
2331
- ra as default
2332
- };