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