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