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