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