@feedmepos/mf-report 5.27.33 → 5.27.34

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