@feedmepos/mf-report 5.26.4 → 5.26.5-beta.0

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