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