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