@feedmepos/mf-report 5.21.65 → 5.22.0-beta.0

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