@feedmepos/mf-report 5.19.20 → 5.19.21-beta.1
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-CpPkDCME.js → App-nUveJE2d.js} +31 -31
- package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-BLVm6EP9.js → BaseDialog.vue_vue_type_script_setup_true_lang-BMUdA00d.js} +2096 -1854
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-BeBr4VIF.js +282 -0
- package/dist/{Default.vue_vue_type_script_setup_true_lang-DTHkWGvx.js → Default.vue_vue_type_script_setup_true_lang-B4KGPc-A.js} +2 -2
- package/dist/FilterSelector.vue_vue_type_script_setup_true_lang-TaboGeqe.js +2455 -0
- package/dist/{InsightView-wYbhKrWa.js → InsightView-VRhKOgcg.js} +5 -5
- package/dist/{Integration-GkPCivXG.js → Integration-BovNO2yX.js} +2 -2
- package/dist/{Integrations-BGNXoeWI.js → Integrations-DIXSWGS_.js} +3 -3
- package/dist/{Layout-B7pJLV4_.js → Layout-Djm1HkoE.js} +1 -1
- package/dist/MenuTab.vue_vue_type_script_setup_true_lang-BKLjwl2R.js +107 -0
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-Cl6q8Efn.js → NavigationTab.vue_vue_type_script_setup_true_lang-BRpEu6MW.js} +7331 -7518
- package/dist/{NoData.vue_vue_type_script_setup_true_lang-CUuIeYhQ.js → NoData.vue_vue_type_script_setup_true_lang-CtN7oqXx.js} +1 -1
- package/dist/{OverviewView-DzumtIfB.js → OverviewView-D58xngVs.js} +5 -5
- package/dist/{Report-B_SX8ejx.js → Report-B-YYrr3B.js} +4 -4
- package/dist/ReportEditor-0cP29pgc.js +1070 -0
- package/dist/{ReportView-DPMurcsC.js → ReportView-BgUotxrl.js} +7 -7
- package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-IdXw91_v.js → SelectComponent.vue_vue_type_script_setup_true_lang-BcQEW5MO.js} +1 -1
- package/dist/{Setting-BsikuNba.js → Setting-DgU3IvCo.js} +4 -4
- package/dist/TileEditor-DzDpc7L6.js +2766 -0
- package/dist/TransitionFade-DwcV3_6N.js +2366 -0
- package/dist/app.js +49 -23
- package/dist/assets/formatChartData.worker-Cb40k96i.js +134 -0
- package/dist/assets/processTableData.worker-DS6uNX_h.js +134 -0
- package/dist/{vue-i18n-D33f1SSo.js → vue-i18n-BJW_sJot.js} +405 -400
- package/package.json +1 -1
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-C7mhpRK0.js +0 -185
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DVY4vxAN.js +0 -1669
- package/dist/MenuTab.vue_vue_type_script_setup_true_lang-C7pQMilo.js +0 -352
- package/dist/ReportEditor-D5OHT5As.js +0 -1013
- package/dist/TileEditor-Bzk4U52d.js +0 -2735
- package/dist/TransitionFade-Blz6m84x.js +0 -2499
- package/dist/assets/formatChartData.worker-CO5zKPH5.js +0 -134
- package/dist/assets/processTableData.worker-BAMcED0j.js +0 -134
- package/dist/helper-B2iB0Dbh.js +0 -75
|
@@ -0,0 +1,1070 @@
|
|
|
1
|
+
import { defineComponent as X, mergeModels as K, useModel as Q, ref as I, computed as D, resolveComponent as c, createBlock as k, openBlock as i, withCtx as u, createElementVNode as h, createVNode as o, unref as t, normalizeClass as ie, createTextVNode as _e, toDisplayString as H, createElementBlock as T, Fragment as G, renderSlot as $e, createCommentVNode as A, watch as de, renderList as ee, resolveDynamicComponent as Ie, isRef as Te, normalizeStyle as we, onMounted as Re } from "vue";
|
|
2
|
+
import { W as We, g as qe, _ as Ee, i as Pe, S as xe, d as ke, T as Je, a as ze } from "./TransitionFade-DwcV3_6N.js";
|
|
3
|
+
import { D as j, c as ue, C as ge, a as Oe, b as He, v as re } from "./BaseDialog.vue_vue_type_script_setup_true_lang-BMUdA00d.js";
|
|
4
|
+
import { storeToRefs as me } from "pinia";
|
|
5
|
+
import { useRouter as Ne, useRoute as Me } from "vue-router";
|
|
6
|
+
import { useBreakpoints as pe, useSnackbar as De, FmButtonColorThemeVariant as oe } from "@feedmepos/ui-library";
|
|
7
|
+
import { u as Ue } from "./message-dialog-UoMWOnil.js";
|
|
8
|
+
import { u as se, b as Le, i as be, f as je } from "./vue-i18n-BJW_sJot.js";
|
|
9
|
+
import { a as Ce, _ as he } from "./FilterSelector.vue_vue_type_script_setup_true_lang-TaboGeqe.js";
|
|
10
|
+
import { _ as ye } from "./NoData.vue_vue_type_script_setup_true_lang-CtN7oqXx.js";
|
|
11
|
+
import { r as ce } from "./i18n-Cif1I9J2.js";
|
|
12
|
+
import { _ as Ve } from "./SelectComponent.vue_vue_type_script_setup_true_lang-BcQEW5MO.js";
|
|
13
|
+
const Ge = /* @__PURE__ */ X({
|
|
14
|
+
__name: "WidgetDialog",
|
|
15
|
+
props: /* @__PURE__ */ K({
|
|
16
|
+
isOpen: { type: Boolean }
|
|
17
|
+
}, {
|
|
18
|
+
modelValue: {},
|
|
19
|
+
modelModifiers: {}
|
|
20
|
+
}),
|
|
21
|
+
emits: /* @__PURE__ */ K(["update:isOpen"], ["update:modelValue"]),
|
|
22
|
+
setup(x, { emit: r }) {
|
|
23
|
+
const { t: n } = se(), { breakpoints: a } = pe(), y = Q(x, "modelValue"), m = x, _ = r;
|
|
24
|
+
function p() {
|
|
25
|
+
_("update:isOpen", !1);
|
|
26
|
+
}
|
|
27
|
+
function V() {
|
|
28
|
+
s.value && (y.value = s.value, s.value = void 0, _("update:isOpen", !1));
|
|
29
|
+
}
|
|
30
|
+
const s = I(), U = D(() => !s.value);
|
|
31
|
+
return (q, S) => {
|
|
32
|
+
const B = c("FmButton"), v = c("FmDialog");
|
|
33
|
+
return i(), k(v, {
|
|
34
|
+
"model-value": m.isOpen
|
|
35
|
+
}, {
|
|
36
|
+
"dialog-header": u(() => [
|
|
37
|
+
_e(H(t(n)("report.widget.type")), 1)
|
|
38
|
+
]),
|
|
39
|
+
default: u(() => [
|
|
40
|
+
o(We, {
|
|
41
|
+
modelValue: s.value,
|
|
42
|
+
"onUpdate:modelValue": S[0] || (S[0] = (N) => s.value = N),
|
|
43
|
+
class: ie(`grid ${t(a).lg || t(a).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
|
|
44
|
+
"child-class": "p-[8px] flex flex-col"
|
|
45
|
+
}, null, 8, ["modelValue", "class"])
|
|
46
|
+
]),
|
|
47
|
+
"dialog-footer": u(() => [
|
|
48
|
+
S[1] || (S[1] = h("div", { class: "grow" }, null, -1)),
|
|
49
|
+
o(B, {
|
|
50
|
+
label: t(n)("report.common.cancel"),
|
|
51
|
+
variant: "tertiary",
|
|
52
|
+
onClick: p
|
|
53
|
+
}, null, 8, ["label"]),
|
|
54
|
+
o(B, {
|
|
55
|
+
label: t(n)("report.common.confirm"),
|
|
56
|
+
disabled: U.value,
|
|
57
|
+
onClick: V
|
|
58
|
+
}, null, 8, ["label", "disabled"])
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}, 8, ["model-value"]);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}), Ae = { class: "fm-typo-en-body-lg-600" }, Fe = /* @__PURE__ */ X({
|
|
65
|
+
__name: "ReportEditorTabHeader",
|
|
66
|
+
props: /* @__PURE__ */ K({
|
|
67
|
+
icon: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: !0
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
modelValue: { type: Boolean, required: !0, default: !1 },
|
|
73
|
+
modelModifiers: {}
|
|
74
|
+
}),
|
|
75
|
+
emits: ["update:modelValue"],
|
|
76
|
+
setup(x) {
|
|
77
|
+
const { t: r } = se(), n = Q(x, "modelValue"), a = x;
|
|
78
|
+
return (y, m) => {
|
|
79
|
+
const _ = c("FmIcon");
|
|
80
|
+
return i(), T("div", {
|
|
81
|
+
class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
|
|
82
|
+
onClick: m[0] || (m[0] = (p) => n.value = !n.value)
|
|
83
|
+
}, [
|
|
84
|
+
h("p", Ae, H(t(r)("report.editor.customizeReport")), 1),
|
|
85
|
+
m[1] || (m[1] = h("div", { class: "grow" }, null, -1)),
|
|
86
|
+
o(_, {
|
|
87
|
+
name: a.icon
|
|
88
|
+
}, null, 8, ["name"])
|
|
89
|
+
]);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}), Ke = /* @__PURE__ */ X({
|
|
93
|
+
__name: "ReportEditorTabDesktop",
|
|
94
|
+
props: {
|
|
95
|
+
modelValue: { required: !0, default: !1 },
|
|
96
|
+
modelModifiers: {}
|
|
97
|
+
},
|
|
98
|
+
emits: ["update:modelValue"],
|
|
99
|
+
setup(x) {
|
|
100
|
+
const r = Q(x, "modelValue");
|
|
101
|
+
return (n, a) => (i(), T(G, null, [
|
|
102
|
+
o(Fe, {
|
|
103
|
+
modelValue: r.value,
|
|
104
|
+
"onUpdate:modelValue": a[0] || (a[0] = (y) => r.value = y),
|
|
105
|
+
icon: "keyboard_double_arrow_left"
|
|
106
|
+
}, null, 8, ["modelValue"]),
|
|
107
|
+
$e(n.$slots, "default")
|
|
108
|
+
], 64));
|
|
109
|
+
}
|
|
110
|
+
}), Qe = /* @__PURE__ */ X({
|
|
111
|
+
__name: "ReportEditorTabMobile",
|
|
112
|
+
props: {
|
|
113
|
+
modelValue: { required: !0, default: !1 },
|
|
114
|
+
modelModifiers: {}
|
|
115
|
+
},
|
|
116
|
+
emits: ["update:modelValue"],
|
|
117
|
+
setup(x) {
|
|
118
|
+
const r = Q(x, "modelValue");
|
|
119
|
+
return (n, a) => {
|
|
120
|
+
const y = c("FmTopSheet"), m = c("FmCard");
|
|
121
|
+
return i(), k(m, { class: "fixed bottom-0 w-full" }, {
|
|
122
|
+
default: u(() => [
|
|
123
|
+
o(Fe, {
|
|
124
|
+
modelValue: r.value,
|
|
125
|
+
"onUpdate:modelValue": a[0] || (a[0] = (_) => r.value = _),
|
|
126
|
+
icon: "keyboard_double_arrow_up"
|
|
127
|
+
}, null, 8, ["modelValue"]),
|
|
128
|
+
o(y, {
|
|
129
|
+
modelValue: r.value,
|
|
130
|
+
"onUpdate:modelValue": a[2] || (a[2] = (_) => r.value = _),
|
|
131
|
+
"fullscreen-size": "sm"
|
|
132
|
+
}, {
|
|
133
|
+
default: u(() => [
|
|
134
|
+
o(Fe, {
|
|
135
|
+
modelValue: r.value,
|
|
136
|
+
"onUpdate:modelValue": a[1] || (a[1] = (_) => r.value = _),
|
|
137
|
+
icon: "keyboard_double_arrow_down"
|
|
138
|
+
}, null, 8, ["modelValue"]),
|
|
139
|
+
r.value ? $e(n.$slots, "default", { key: 0 }) : A("", !0)
|
|
140
|
+
]),
|
|
141
|
+
_: 3
|
|
142
|
+
}, 8, ["modelValue"])
|
|
143
|
+
]),
|
|
144
|
+
_: 3
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}), Xe = {
|
|
149
|
+
key: 2,
|
|
150
|
+
class: "flex flex-col gap-2"
|
|
151
|
+
}, Ye = /* @__PURE__ */ X({
|
|
152
|
+
__name: "GlobalFilterDialog",
|
|
153
|
+
props: /* @__PURE__ */ K({
|
|
154
|
+
schemas: {
|
|
155
|
+
type: Array,
|
|
156
|
+
default: () => []
|
|
157
|
+
},
|
|
158
|
+
tiles: {
|
|
159
|
+
type: Array,
|
|
160
|
+
required: !0
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
globalFilter: {
|
|
164
|
+
default: () => null
|
|
165
|
+
},
|
|
166
|
+
globalFilterModifiers: {},
|
|
167
|
+
isOpen: { type: Boolean, default: () => !1, required: !0 },
|
|
168
|
+
isOpenModifiers: {}
|
|
169
|
+
}),
|
|
170
|
+
emits: ["update:globalFilter", "update:isOpen"],
|
|
171
|
+
setup(x) {
|
|
172
|
+
const { t: r, te: n } = se(), a = Q(x, "globalFilter"), y = Q(x, "isOpen"), m = De(), _ = x, p = I(), V = I(), s = I(), U = I(), q = I([]), S = I([]), B = I(""), v = I(!1);
|
|
173
|
+
de(y, (l) => {
|
|
174
|
+
var e, C, d, b, $, W, E;
|
|
175
|
+
l && (p.value = ((e = a.value) == null ? void 0 : e.label) || "", V.value = _.schemas.find(
|
|
176
|
+
(J) => {
|
|
177
|
+
var O;
|
|
178
|
+
return J.name === ((O = a.value) == null ? void 0 : O.schemaName);
|
|
179
|
+
}
|
|
180
|
+
), s.value = (C = Y.value.find(
|
|
181
|
+
(J) => {
|
|
182
|
+
var O;
|
|
183
|
+
return J.value.name === ((O = a.value) == null ? void 0 : O.name);
|
|
184
|
+
}
|
|
185
|
+
)) == null ? void 0 : C.value, U.value = (d = a.value) == null ? void 0 : d.option, q.value = ((b = a.value) == null ? void 0 : b.tileIds) || [], S.value = (($ = a.value) == null ? void 0 : $.filters) || [], v.value = !!((W = a.value) != null && W.dataFormula), B.value = ((E = a.value) == null ? void 0 : E.dataFormula) || "");
|
|
186
|
+
});
|
|
187
|
+
const N = D(
|
|
188
|
+
() => _.schemas.map((l) => ({
|
|
189
|
+
label: l.label || l.name,
|
|
190
|
+
value: l
|
|
191
|
+
}))
|
|
192
|
+
), Y = D(() => {
|
|
193
|
+
var l;
|
|
194
|
+
return (((l = V.value) == null ? void 0 : l.fields) || []).map((e) => ({
|
|
195
|
+
label: e.label,
|
|
196
|
+
value: e
|
|
197
|
+
}));
|
|
198
|
+
}), R = D(() => {
|
|
199
|
+
var l;
|
|
200
|
+
return ((l = s.value) == null ? void 0 : l.type) !== j.Timestamp ? [] : qe(r);
|
|
201
|
+
}), P = D(() => _.tiles.reduce((l, e, C) => {
|
|
202
|
+
var $, W;
|
|
203
|
+
const d = e.widget.config.schemaNames ?? [], b = (e.widget.config.joinDatasources ?? []).flatMap(
|
|
204
|
+
(E) => E.schemaNames ?? []
|
|
205
|
+
);
|
|
206
|
+
return [...d, ...b].includes((($ = V.value) == null ? void 0 : $.name) || "") && l.push({
|
|
207
|
+
label: (W = e == null ? void 0 : e.widget.title) != null && W.trim() ? e.widget.title : `Widget ${C + 1}`,
|
|
208
|
+
value: e.id
|
|
209
|
+
}), l;
|
|
210
|
+
}, [])), L = D(
|
|
211
|
+
() => _.schemas.flatMap(
|
|
212
|
+
(l) => (l.fields ?? []).map((e) => ({
|
|
213
|
+
...e,
|
|
214
|
+
labels: [
|
|
215
|
+
ce(r, n, l.label, "schema"),
|
|
216
|
+
ce(r, n, e.label || e.name, "other")
|
|
217
|
+
]
|
|
218
|
+
}))
|
|
219
|
+
)
|
|
220
|
+
);
|
|
221
|
+
function g(l) {
|
|
222
|
+
var e;
|
|
223
|
+
l.name !== ((e = V.value) == null ? void 0 : e.name) && (V.value = l, s.value = void 0);
|
|
224
|
+
}
|
|
225
|
+
function Z(l) {
|
|
226
|
+
s.value = l, U.value = l.type === j.Timestamp ? ue.DateTime : void 0;
|
|
227
|
+
}
|
|
228
|
+
function le(l, e) {
|
|
229
|
+
switch (l) {
|
|
230
|
+
case j.Timestamp:
|
|
231
|
+
return e === ue.DateTime || e === ue.TimeOfDay ? ge.Between : ge.Equal;
|
|
232
|
+
case j.Bool:
|
|
233
|
+
case j.String:
|
|
234
|
+
case j.Numeric:
|
|
235
|
+
return ge.Equal;
|
|
236
|
+
default:
|
|
237
|
+
throw new Error(`Unsupported data type: ${l}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function te() {
|
|
241
|
+
if (!V.value) {
|
|
242
|
+
m.open({ message: "Invalid schema", type: "error" });
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (!s.value) {
|
|
246
|
+
m.open({ message: "Invalid dimension", type: "error" });
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const l = S.value.filter((e) => e ? !N.value.some((d) => d.value.name === e.schemaName) : !0);
|
|
250
|
+
if (l.length > 0) {
|
|
251
|
+
m.open({
|
|
252
|
+
message: `Invalid filter(s): ${l.filter((e) => !!e).map((e) => e.schemaName).join(
|
|
253
|
+
", "
|
|
254
|
+
)}${l.some((e) => !e) ? ", unknown filter(s)" : ""} - schema not found`,
|
|
255
|
+
type: "error"
|
|
256
|
+
});
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
a.value = {
|
|
260
|
+
schemaName: V.value.name,
|
|
261
|
+
name: s.value.name,
|
|
262
|
+
label: p.value,
|
|
263
|
+
operator: le(
|
|
264
|
+
s.value.type,
|
|
265
|
+
s.value.type === j.Timestamp ? U.value ?? ue.DateTime : null
|
|
266
|
+
),
|
|
267
|
+
option: s.value.type === j.Timestamp ? U.value : null,
|
|
268
|
+
values: [],
|
|
269
|
+
tileIds: [...q.value],
|
|
270
|
+
filters: JSON.parse(JSON.stringify(S.value)),
|
|
271
|
+
dataFormula: v.value ? B.value : void 0
|
|
272
|
+
}, y.value = !1;
|
|
273
|
+
}
|
|
274
|
+
function ae() {
|
|
275
|
+
y.value = !1;
|
|
276
|
+
}
|
|
277
|
+
const F = D(() => {
|
|
278
|
+
var l;
|
|
279
|
+
return [
|
|
280
|
+
(l = V.value) == null ? void 0 : l.name,
|
|
281
|
+
...S.value.map((e) => e.schemaName)
|
|
282
|
+
];
|
|
283
|
+
});
|
|
284
|
+
function M(l) {
|
|
285
|
+
var $, W, E, J;
|
|
286
|
+
const e = _.tiles.find((O) => O.id === l.value), C = ((W = ($ = e == null ? void 0 : e.widget) == null ? void 0 : $.config) == null ? void 0 : W.schemaNames) ?? [], d = (((J = (E = e == null ? void 0 : e.widget) == null ? void 0 : E.config) == null ? void 0 : J.joinDatasources) ?? []).flatMap(
|
|
287
|
+
(O) => O.schemaNames ?? []
|
|
288
|
+
), b = [...C, ...d];
|
|
289
|
+
return F.value.filter((O) => !!O).some((O) => !b.includes(O));
|
|
290
|
+
}
|
|
291
|
+
return (l, e) => {
|
|
292
|
+
const C = c("FmTextField"), d = c("FmSelect"), b = c("FmCheckbox"), $ = c("FmTextarea"), W = c("FmLabel"), E = c("FmIcon"), J = c("FmTooltip"), O = c("FmForm"), ne = c("FmButton"), ve = c("FmDialog");
|
|
293
|
+
return i(), k(ve, {
|
|
294
|
+
modelValue: y.value,
|
|
295
|
+
"onUpdate:modelValue": e[8] || (e[8] = (f) => y.value = f),
|
|
296
|
+
overlay: !0,
|
|
297
|
+
"z-index": 10
|
|
298
|
+
}, {
|
|
299
|
+
"dialog-header": u(() => [
|
|
300
|
+
_e(H(t(r)("report.section.filter.globalFilter")), 1)
|
|
301
|
+
]),
|
|
302
|
+
default: u(() => [
|
|
303
|
+
o(O, {
|
|
304
|
+
ref: "form",
|
|
305
|
+
class: "flex flex-col gap-2 w-[490px]"
|
|
306
|
+
}, {
|
|
307
|
+
default: u(() => {
|
|
308
|
+
var f;
|
|
309
|
+
return [
|
|
310
|
+
o(C, {
|
|
311
|
+
modelValue: p.value,
|
|
312
|
+
"onUpdate:modelValue": e[0] || (e[0] = (w) => p.value = w),
|
|
313
|
+
placeholder: t(r)("report.section.filter.displayName"),
|
|
314
|
+
label: t(r)("report.section.filter.displayName"),
|
|
315
|
+
class: "mb-2"
|
|
316
|
+
}, null, 8, ["modelValue", "placeholder", "label"]),
|
|
317
|
+
o(Ve, {
|
|
318
|
+
"model-value": V.value,
|
|
319
|
+
items: N.value,
|
|
320
|
+
placeholder: t(r)("report.section.schema.title"),
|
|
321
|
+
label: t(r)("report.section.schema.title"),
|
|
322
|
+
"onUpdate:modelValue": e[1] || (e[1] = (w) => g(w))
|
|
323
|
+
}, null, 8, ["model-value", "items", "placeholder", "label"]),
|
|
324
|
+
o(Ve, {
|
|
325
|
+
"model-value": s.value,
|
|
326
|
+
items: Y.value,
|
|
327
|
+
placeholder: t(r)("report.section.dimension.Dimension"),
|
|
328
|
+
label: t(r)("report.section.dimension.Dimension"),
|
|
329
|
+
"onUpdate:modelValue": e[2] || (e[2] = (w) => Z(w))
|
|
330
|
+
}, null, 8, ["model-value", "items", "placeholder", "label"]),
|
|
331
|
+
((f = s.value) == null ? void 0 : f.type) === t(j).Timestamp ? (i(), k(d, {
|
|
332
|
+
key: 0,
|
|
333
|
+
modelValue: U.value,
|
|
334
|
+
"onUpdate:modelValue": e[3] || (e[3] = (w) => U.value = w),
|
|
335
|
+
items: R.value,
|
|
336
|
+
placeholder: t(r)("report.section.filter.timeFormatter"),
|
|
337
|
+
label: t(r)("report.section.filter.timeFormatter")
|
|
338
|
+
}, null, 8, ["modelValue", "items", "placeholder", "label"])) : A("", !0),
|
|
339
|
+
o(b, {
|
|
340
|
+
modelValue: v.value,
|
|
341
|
+
"onUpdate:modelValue": e[4] || (e[4] = (w) => v.value = w),
|
|
342
|
+
label: t(r)("report.section.filter.advance"),
|
|
343
|
+
value: !0
|
|
344
|
+
}, null, 8, ["modelValue", "label"]),
|
|
345
|
+
v.value ? (i(), k($, {
|
|
346
|
+
key: 1,
|
|
347
|
+
modelValue: B.value,
|
|
348
|
+
"onUpdate:modelValue": e[5] || (e[5] = (w) => B.value = w),
|
|
349
|
+
placeholder: t(r)("report.section.filter.dataFormula")
|
|
350
|
+
}, null, 8, ["modelValue", "placeholder"])) : A("", !0),
|
|
351
|
+
o(Ee, {
|
|
352
|
+
modelValue: S.value,
|
|
353
|
+
"onUpdate:modelValue": e[6] || (e[6] = (w) => S.value = w),
|
|
354
|
+
options: L.value
|
|
355
|
+
}, null, 8, ["modelValue", "options"]),
|
|
356
|
+
o(W, { class: "mt-2 fm-typo-en-body-lg-600" }, {
|
|
357
|
+
default: u(() => [
|
|
358
|
+
_e(H(t(r)("report.section.filter.applyWidget")), 1)
|
|
359
|
+
]),
|
|
360
|
+
_: 1
|
|
361
|
+
}),
|
|
362
|
+
x.tiles.length > 0 ? (i(), T("div", Xe, [
|
|
363
|
+
(i(!0), T(G, null, ee(P.value, (w) => (i(), T("div", {
|
|
364
|
+
key: w.value,
|
|
365
|
+
class: "flex items-center"
|
|
366
|
+
}, [
|
|
367
|
+
o(b, {
|
|
368
|
+
modelValue: q.value,
|
|
369
|
+
"onUpdate:modelValue": e[7] || (e[7] = (z) => q.value = z),
|
|
370
|
+
label: w.label,
|
|
371
|
+
value: w.value
|
|
372
|
+
}, null, 8, ["modelValue", "label", "value"]),
|
|
373
|
+
M(w) ? (i(), k(J, {
|
|
374
|
+
key: 0,
|
|
375
|
+
content: t(r)("report.section.filter.missingFilterSchema"),
|
|
376
|
+
"z-index": 99,
|
|
377
|
+
class: "ml-2"
|
|
378
|
+
}, {
|
|
379
|
+
default: u(() => [
|
|
380
|
+
o(E, {
|
|
381
|
+
name: "warning",
|
|
382
|
+
class: "text-fm-color-system-error-300"
|
|
383
|
+
})
|
|
384
|
+
]),
|
|
385
|
+
_: 1
|
|
386
|
+
}, 8, ["content"])) : A("", !0)
|
|
387
|
+
]))), 128))
|
|
388
|
+
])) : (i(), k(W, {
|
|
389
|
+
key: 3,
|
|
390
|
+
class: "fm-typo-en-body-lg-400",
|
|
391
|
+
label: t(r)("report.section.filter.noWidget")
|
|
392
|
+
}, null, 8, ["label"]))
|
|
393
|
+
];
|
|
394
|
+
}),
|
|
395
|
+
_: 1
|
|
396
|
+
}, 512)
|
|
397
|
+
]),
|
|
398
|
+
"dialog-footer": u(() => [
|
|
399
|
+
e[9] || (e[9] = h("div", { class: "grow" }, null, -1)),
|
|
400
|
+
o(ne, {
|
|
401
|
+
label: t(r)("report.common.cancel"),
|
|
402
|
+
variant: "tertiary",
|
|
403
|
+
onClick: ae
|
|
404
|
+
}, null, 8, ["label"]),
|
|
405
|
+
o(ne, {
|
|
406
|
+
label: t(r)("report.common.confirm"),
|
|
407
|
+
onClick: te
|
|
408
|
+
}, null, 8, ["label"])
|
|
409
|
+
]),
|
|
410
|
+
_: 1
|
|
411
|
+
}, 8, ["modelValue"]);
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
}), Ze = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, el = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, ll = { class: "flex items-center gap-1 max-w-[195px] w-[195px]" }, tl = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, ol = { class: "flex flex-col gap-24" }, al = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, Se = /* @__PURE__ */ X({
|
|
415
|
+
__name: "ReportEditorTab",
|
|
416
|
+
props: /* @__PURE__ */ K({
|
|
417
|
+
hideConfiguration: {
|
|
418
|
+
type: Boolean,
|
|
419
|
+
default: !1
|
|
420
|
+
}
|
|
421
|
+
}, {
|
|
422
|
+
modelValue: { required: !0 },
|
|
423
|
+
modelModifiers: {}
|
|
424
|
+
}),
|
|
425
|
+
emits: /* @__PURE__ */ K(["hideConfiguration"], ["update:modelValue"]),
|
|
426
|
+
setup(x, { emit: r }) {
|
|
427
|
+
const n = Q(x, "modelValue"), { breakpoints: a } = pe(), y = x, m = r, _ = Ne(), p = Me(), V = I(), {
|
|
428
|
+
currentSelectWidgetType: s,
|
|
429
|
+
categories: U,
|
|
430
|
+
editingTile: q,
|
|
431
|
+
editingTileIndex: S,
|
|
432
|
+
editingGlobalFilter: B,
|
|
433
|
+
editingGlobalFilterIndex: v
|
|
434
|
+
} = me(Oe()), { schemas: N } = me(He()), { globalFilters: Y } = me(Le()), { promptMessage: R } = Ue(), P = I(!1), L = I(!1), { t: g, te: Z } = se(), le = I(void 0), te = D(() => {
|
|
435
|
+
const l = n.value.tiles.flatMap((e) => {
|
|
436
|
+
var b;
|
|
437
|
+
const C = e.widget.config.schemaNames ?? [], d = ((b = e.widget.config.joinDatasources) == null ? void 0 : b.flatMap(($) => $.schemaNames ?? [])) ?? [];
|
|
438
|
+
return [...C, ...d];
|
|
439
|
+
});
|
|
440
|
+
return [...new Set(l)].reduce((e, C) => {
|
|
441
|
+
const d = N.value.find((b) => b.name === C);
|
|
442
|
+
return d && e.push(d), e;
|
|
443
|
+
}, []);
|
|
444
|
+
});
|
|
445
|
+
de(
|
|
446
|
+
() => s.value,
|
|
447
|
+
() => {
|
|
448
|
+
s.value !== void 0 && (le.value = Pe(s.value), q.value = le.value, S.value = -1, _.push({
|
|
449
|
+
name: "tileEditor",
|
|
450
|
+
query: p.query
|
|
451
|
+
}));
|
|
452
|
+
},
|
|
453
|
+
{ immediate: !0 }
|
|
454
|
+
), de(
|
|
455
|
+
() => n.value.tiles,
|
|
456
|
+
(l) => {
|
|
457
|
+
l.forEach((e) => {
|
|
458
|
+
e.id || (e.id = re());
|
|
459
|
+
});
|
|
460
|
+
},
|
|
461
|
+
{ immediate: !0, deep: !0 }
|
|
462
|
+
);
|
|
463
|
+
const ae = [
|
|
464
|
+
{
|
|
465
|
+
label: g("report.common.edit"),
|
|
466
|
+
selected: !1,
|
|
467
|
+
variant: "tertiary",
|
|
468
|
+
onClick: (l) => {
|
|
469
|
+
S.value = l, q.value = JSON.parse(JSON.stringify(n.value.tiles[l])), _.push({
|
|
470
|
+
name: "tileEditor",
|
|
471
|
+
query: p.query
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
label: g("report.common.duplicate"),
|
|
477
|
+
selected: !1,
|
|
478
|
+
variant: "tertiary",
|
|
479
|
+
onClick: (l) => {
|
|
480
|
+
const e = {
|
|
481
|
+
...JSON.parse(JSON.stringify(n.value.tiles[l])),
|
|
482
|
+
id: re()
|
|
483
|
+
};
|
|
484
|
+
n.value.tiles.push(e);
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
label: g("report.common.remove"),
|
|
489
|
+
selected: !1,
|
|
490
|
+
variant: "destructive",
|
|
491
|
+
onClick: async (l) => {
|
|
492
|
+
if (await R({
|
|
493
|
+
title: g("report.editor.deleteWidget"),
|
|
494
|
+
message: g("report.editor.deleteWidgetConfirm", {
|
|
495
|
+
title: n.value.tiles[l].widget.title
|
|
496
|
+
})
|
|
497
|
+
})) {
|
|
498
|
+
const C = n.value.tiles[l].id;
|
|
499
|
+
n.value.tiles.splice(l, 1), n.value.globalFilters && n.value.globalFilters.forEach((d) => {
|
|
500
|
+
var b;
|
|
501
|
+
d.tileIds = (b = d.tileIds) == null ? void 0 : b.filter(($) => $ !== C);
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
], F = [
|
|
507
|
+
{
|
|
508
|
+
label: g("report.common.edit"),
|
|
509
|
+
selected: !1,
|
|
510
|
+
variant: "tertiary",
|
|
511
|
+
onClick: (l) => {
|
|
512
|
+
var e;
|
|
513
|
+
v.value = l, B.value = JSON.parse(JSON.stringify((e = n.value.globalFilters) == null ? void 0 : e[l])), P.value = !0;
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
label: g("report.common.remove"),
|
|
518
|
+
selected: !1,
|
|
519
|
+
variant: "destructive",
|
|
520
|
+
onClick: async (l) => {
|
|
521
|
+
var d, b;
|
|
522
|
+
const e = (d = n.value.globalFilters) == null ? void 0 : d[l];
|
|
523
|
+
if (!e) return;
|
|
524
|
+
await R({
|
|
525
|
+
title: g("report.editor.deleteWidget"),
|
|
526
|
+
message: g("report.editor.deleteWidgetConfirm", {
|
|
527
|
+
title: be(e)
|
|
528
|
+
})
|
|
529
|
+
}) && ((b = n.value.globalFilters) == null || b.splice(l, 1));
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
], M = D(() => U.value.map((l) => ({
|
|
533
|
+
label: g(`report.category.${l.name}`),
|
|
534
|
+
value: l.id
|
|
535
|
+
})));
|
|
536
|
+
return de(
|
|
537
|
+
() => n.value.globalFilters,
|
|
538
|
+
(l) => {
|
|
539
|
+
Y.value = JSON.parse(JSON.stringify(l || []));
|
|
540
|
+
},
|
|
541
|
+
{ deep: !0, immediate: !0 }
|
|
542
|
+
), (l, e) => {
|
|
543
|
+
const C = c("FmTextField"), d = c("FmSelect"), b = c("FmButton"), $ = c("FmIcon"), W = c("FmTooltip"), E = c("FmMenuItem"), J = c("FmMenu"), O = c("FmListItem"), ne = c("FmList"), ve = c("FmForm");
|
|
544
|
+
return i(), k(Ie(t(a).lg || t(a).md ? Ke : Qe), {
|
|
545
|
+
"model-value": y.hideConfiguration,
|
|
546
|
+
"onUpdate:modelValue": e[8] || (e[8] = (f) => m("hideConfiguration", f))
|
|
547
|
+
}, {
|
|
548
|
+
default: u(() => [
|
|
549
|
+
o(Ye, {
|
|
550
|
+
"is-open": P.value,
|
|
551
|
+
"onUpdate:isOpen": e[0] || (e[0] = (f) => P.value = f),
|
|
552
|
+
"global-filter": t(B),
|
|
553
|
+
tiles: n.value.tiles,
|
|
554
|
+
schemas: te.value,
|
|
555
|
+
"onUpdate:globalFilter": e[1] || (e[1] = (f) => {
|
|
556
|
+
f && (n.value.globalFilters || (n.value.globalFilters = []), typeof t(v) == "number" && t(v) >= 0 ? n.value.globalFilters[t(v)] = f : n.value.globalFilters.push(f));
|
|
557
|
+
})
|
|
558
|
+
}, null, 8, ["is-open", "global-filter", "tiles", "schemas"]),
|
|
559
|
+
o(Ge, {
|
|
560
|
+
modelValue: t(s),
|
|
561
|
+
"onUpdate:modelValue": e[2] || (e[2] = (f) => Te(s) ? s.value = f : null),
|
|
562
|
+
"is-open": L.value,
|
|
563
|
+
"onUpdate:isOpen": e[3] || (e[3] = (f) => L.value = f)
|
|
564
|
+
}, null, 8, ["modelValue", "is-open"]),
|
|
565
|
+
o(ve, {
|
|
566
|
+
ref_key: "form",
|
|
567
|
+
ref: V,
|
|
568
|
+
class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
|
|
569
|
+
}, {
|
|
570
|
+
default: u(() => [
|
|
571
|
+
o(xe, { class: "border-solid" }, {
|
|
572
|
+
header: u(() => [
|
|
573
|
+
h("p", null, H(t(g)("report.editor.reportInfo")), 1),
|
|
574
|
+
e[9] || (e[9] = h("div", { class: "grow" }, null, -1))
|
|
575
|
+
]),
|
|
576
|
+
content: u(() => [
|
|
577
|
+
h("div", Ze, [
|
|
578
|
+
o(C, {
|
|
579
|
+
modelValue: n.value.name,
|
|
580
|
+
"onUpdate:modelValue": e[4] || (e[4] = (f) => n.value.name = f),
|
|
581
|
+
label: t(g)("report.editor.reportTitle"),
|
|
582
|
+
placeholder: t(g)("report.editor.placeholder")
|
|
583
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
584
|
+
o(d, {
|
|
585
|
+
modelValue: n.value.category,
|
|
586
|
+
"onUpdate:modelValue": e[5] || (e[5] = (f) => n.value.category = f),
|
|
587
|
+
label: t(g)("report.common.category"),
|
|
588
|
+
items: M.value
|
|
589
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
590
|
+
])
|
|
591
|
+
]),
|
|
592
|
+
_: 1
|
|
593
|
+
}),
|
|
594
|
+
o(xe, {
|
|
595
|
+
class: "border-solid",
|
|
596
|
+
"is-open": !1
|
|
597
|
+
}, {
|
|
598
|
+
header: u(() => [
|
|
599
|
+
h("p", null, H(t(g)("report.section.filter.globalFilter")), 1),
|
|
600
|
+
e[10] || (e[10] = h("div", { class: "grow" }, null, -1))
|
|
601
|
+
]),
|
|
602
|
+
content: u(() => [
|
|
603
|
+
h("div", el, [
|
|
604
|
+
o(b, {
|
|
605
|
+
label: t(g)("report.section.filter.addGlobalFilter"),
|
|
606
|
+
variant: "secondary",
|
|
607
|
+
icon: "add",
|
|
608
|
+
"icon-position": "prepend",
|
|
609
|
+
"border-color": t(oe).ColorPrimary,
|
|
610
|
+
"text-color": t(oe).ColorPrimary,
|
|
611
|
+
onClick: e[6] || (e[6] = () => {
|
|
612
|
+
v.value = null, B.value = null, P.value = !0;
|
|
613
|
+
})
|
|
614
|
+
}, null, 8, ["label", "border-color", "text-color"]),
|
|
615
|
+
o(ne, null, {
|
|
616
|
+
default: u(() => [
|
|
617
|
+
o(t(ke), {
|
|
618
|
+
list: n.value.globalFilters,
|
|
619
|
+
"item-key": "`${element.schemaName}-${element.name}`",
|
|
620
|
+
class: "flex flex-col gap-2 cursor-grab",
|
|
621
|
+
handle: ".handle"
|
|
622
|
+
}, {
|
|
623
|
+
item: u(({ element: f, index: w }) => [
|
|
624
|
+
o(O, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
|
|
625
|
+
default: u(() => [
|
|
626
|
+
o($, {
|
|
627
|
+
name: "drag_handle",
|
|
628
|
+
class: "handle"
|
|
629
|
+
}),
|
|
630
|
+
h("div", ll, [
|
|
631
|
+
o(W, {
|
|
632
|
+
"z-index": 99,
|
|
633
|
+
content: t(be)(f),
|
|
634
|
+
class: "handle"
|
|
635
|
+
}, {
|
|
636
|
+
default: u(() => [
|
|
637
|
+
h("p", tl, H(t(be)(f)), 1)
|
|
638
|
+
]),
|
|
639
|
+
_: 2
|
|
640
|
+
}, 1032, ["content"]),
|
|
641
|
+
te.value.find(
|
|
642
|
+
(z) => z.name === f.schemaName
|
|
643
|
+
) ? A("", !0) : (i(), k(W, {
|
|
644
|
+
key: 0,
|
|
645
|
+
content: t(g)("report.section.filter.missingSchema"),
|
|
646
|
+
"z-index": 99
|
|
647
|
+
}, {
|
|
648
|
+
default: u(() => [
|
|
649
|
+
o($, {
|
|
650
|
+
name: "warning",
|
|
651
|
+
class: "text-fm-color-system-error-300"
|
|
652
|
+
})
|
|
653
|
+
]),
|
|
654
|
+
_: 1
|
|
655
|
+
}, 8, ["content"]))
|
|
656
|
+
]),
|
|
657
|
+
e[11] || (e[11] = h("div", { class: "grow" }, null, -1)),
|
|
658
|
+
o(J, {
|
|
659
|
+
trigger: "click",
|
|
660
|
+
shift: !0,
|
|
661
|
+
"stop-click-propagation": !0
|
|
662
|
+
}, {
|
|
663
|
+
"menu-button": u(() => [
|
|
664
|
+
o(b, {
|
|
665
|
+
"append-icon": "more_vert",
|
|
666
|
+
variant: "tertiary"
|
|
667
|
+
})
|
|
668
|
+
]),
|
|
669
|
+
default: u(() => [
|
|
670
|
+
(i(), T(G, null, ee(F, (z, fe) => o(E, {
|
|
671
|
+
key: fe,
|
|
672
|
+
onClick: (Be) => z.onClick(w)
|
|
673
|
+
}, {
|
|
674
|
+
label: u(() => [
|
|
675
|
+
h("p", {
|
|
676
|
+
class: ie(
|
|
677
|
+
z.variant === "destructive" ? " text-fm-color-system-error-300" : ""
|
|
678
|
+
)
|
|
679
|
+
}, H(z.label), 3)
|
|
680
|
+
]),
|
|
681
|
+
_: 2
|
|
682
|
+
}, 1032, ["onClick"])), 64))
|
|
683
|
+
]),
|
|
684
|
+
_: 2
|
|
685
|
+
}, 1024)
|
|
686
|
+
]),
|
|
687
|
+
_: 2
|
|
688
|
+
}, 1024)
|
|
689
|
+
]),
|
|
690
|
+
_: 1
|
|
691
|
+
}, 8, ["list"])
|
|
692
|
+
]),
|
|
693
|
+
_: 1
|
|
694
|
+
})
|
|
695
|
+
])
|
|
696
|
+
]),
|
|
697
|
+
_: 1
|
|
698
|
+
}),
|
|
699
|
+
h("div", ol, [
|
|
700
|
+
o(b, {
|
|
701
|
+
label: t(g)("report.editor.addWidget"),
|
|
702
|
+
variant: "secondary",
|
|
703
|
+
icon: "add",
|
|
704
|
+
"icon-position": "prepend",
|
|
705
|
+
"border-color": t(oe).ColorPrimary,
|
|
706
|
+
"text-color": t(oe).ColorPrimary,
|
|
707
|
+
onClick: e[7] || (e[7] = (f) => L.value = !0)
|
|
708
|
+
}, null, 8, ["label", "border-color", "text-color"]),
|
|
709
|
+
o(ne, null, {
|
|
710
|
+
default: u(() => [
|
|
711
|
+
o(t(ke), {
|
|
712
|
+
list: n.value.tiles,
|
|
713
|
+
"item-key": "id",
|
|
714
|
+
class: "flex flex-col gap-2 cursor-grab",
|
|
715
|
+
handle: ".handle"
|
|
716
|
+
}, {
|
|
717
|
+
item: u(({ element: f, index: w }) => [
|
|
718
|
+
o(O, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
|
|
719
|
+
default: u(() => [
|
|
720
|
+
o($, {
|
|
721
|
+
name: "drag_handle",
|
|
722
|
+
class: "handle"
|
|
723
|
+
}),
|
|
724
|
+
o(W, {
|
|
725
|
+
content: f.widget.title ? t(ce)(t(g), t(Z), f.widget.title, "other") : t(g)("report.editor.widget", { index: w + 1 }),
|
|
726
|
+
class: "handle"
|
|
727
|
+
}, {
|
|
728
|
+
default: u(() => [
|
|
729
|
+
h("p", al, H(f.widget.title ? t(ce)(t(g), t(Z), f.widget.title, "other") : t(g)("report.editor.widget", { index: w + 1 })), 1)
|
|
730
|
+
]),
|
|
731
|
+
_: 2
|
|
732
|
+
}, 1032, ["content"]),
|
|
733
|
+
e[12] || (e[12] = h("div", { class: "grow" }, null, -1)),
|
|
734
|
+
o(J, {
|
|
735
|
+
trigger: "click",
|
|
736
|
+
shift: !0,
|
|
737
|
+
"stop-click-propagation": !0
|
|
738
|
+
}, {
|
|
739
|
+
"menu-button": u(() => [
|
|
740
|
+
o(b, {
|
|
741
|
+
"append-icon": "more_vert",
|
|
742
|
+
variant: "tertiary"
|
|
743
|
+
})
|
|
744
|
+
]),
|
|
745
|
+
default: u(() => [
|
|
746
|
+
(i(), T(G, null, ee(ae, (z, fe) => o(E, {
|
|
747
|
+
key: fe,
|
|
748
|
+
onClick: (Be) => z.onClick(w)
|
|
749
|
+
}, {
|
|
750
|
+
label: u(() => [
|
|
751
|
+
h("p", {
|
|
752
|
+
class: ie(
|
|
753
|
+
z.variant === "destructive" ? " text-fm-color-system-error-300" : ""
|
|
754
|
+
)
|
|
755
|
+
}, H(z.label), 3)
|
|
756
|
+
]),
|
|
757
|
+
_: 2
|
|
758
|
+
}, 1032, ["onClick"])), 64))
|
|
759
|
+
]),
|
|
760
|
+
_: 2
|
|
761
|
+
}, 1024)
|
|
762
|
+
]),
|
|
763
|
+
_: 2
|
|
764
|
+
}, 1024)
|
|
765
|
+
]),
|
|
766
|
+
_: 1
|
|
767
|
+
}, 8, ["list"])
|
|
768
|
+
]),
|
|
769
|
+
_: 1
|
|
770
|
+
})
|
|
771
|
+
])
|
|
772
|
+
]),
|
|
773
|
+
_: 1
|
|
774
|
+
}, 512)
|
|
775
|
+
]),
|
|
776
|
+
_: 1
|
|
777
|
+
}, 8, ["model-value"]);
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
}), nl = { class: "h-full w-full overflow-x-hidden" }, rl = { class: "flex flex-col bg-fm-color-neutral-white w-[400px]" }, il = { class: "flex bg-fm-color-neutral-white w-[88px]" }, sl = {
|
|
781
|
+
key: 1,
|
|
782
|
+
class: "w-full overflow-y-auto"
|
|
783
|
+
}, ul = {
|
|
784
|
+
key: 0,
|
|
785
|
+
class: "w-full grid grid-cols-12 gap-[24px] p-24"
|
|
786
|
+
}, dl = { class: "col-span-12 mb-4 flex flex-wrap gap-2 pb-2" }, ml = { key: 2 }, cl = {
|
|
787
|
+
key: 0,
|
|
788
|
+
class: "grid grid-cols-12 gap-[16px]"
|
|
789
|
+
}, pl = { class: "col-span-12 mb-4 flex flex-wrap gap-2 pb-2" }, vl = {
|
|
790
|
+
key: 3,
|
|
791
|
+
class: "h-full w-full flex items-start justify-center bg-fm-color-neutral-white py-24",
|
|
792
|
+
style: { backgroundColor: "#F6F8FC" }
|
|
793
|
+
}, fl = {
|
|
794
|
+
key: 0,
|
|
795
|
+
class: "w-full grid grid-cols-12 gap-[24px] p-24"
|
|
796
|
+
}, gl = /* @__PURE__ */ X({
|
|
797
|
+
__name: "ReportEditorViewport",
|
|
798
|
+
props: /* @__PURE__ */ K({
|
|
799
|
+
hideConfiguration: { type: Boolean, required: !1, default: !1 },
|
|
800
|
+
previewWidth: { type: Number, required: !0 },
|
|
801
|
+
previewHeight: { type: Number, required: !0 },
|
|
802
|
+
previewScale: { type: Number, required: !0 }
|
|
803
|
+
}, {
|
|
804
|
+
modelValue: { required: !0, default: () => {
|
|
805
|
+
} },
|
|
806
|
+
modelModifiers: {}
|
|
807
|
+
}),
|
|
808
|
+
emits: /* @__PURE__ */ K(["hideConfiguration"], ["update:modelValue"]),
|
|
809
|
+
setup(x, { emit: r }) {
|
|
810
|
+
const { breakpoints: n } = pe(), a = Q(x, "modelValue"), y = x, m = D(() => y.previewWidth > 0 && y.previewHeight > 0), _ = D(() => n.value.sm || n.value.xs), p = r;
|
|
811
|
+
return (V, s) => {
|
|
812
|
+
const U = c("FmCircularProgress"), q = c("FmButton"), S = c("FmMenuDivider"), B = c("FmCard");
|
|
813
|
+
return i(), T("div", nl, [
|
|
814
|
+
a.value ? (i(), T(G, { key: 1 }, [
|
|
815
|
+
m.value ? A("", !0) : (i(), k(Je, {
|
|
816
|
+
key: 0,
|
|
817
|
+
"model-value": !y.hideConfiguration
|
|
818
|
+
}, {
|
|
819
|
+
right: u(() => [
|
|
820
|
+
h("div", rl, [
|
|
821
|
+
a.value ? (i(), k(Se, {
|
|
822
|
+
key: 0,
|
|
823
|
+
modelValue: a.value,
|
|
824
|
+
"onUpdate:modelValue": s[0] || (s[0] = (v) => a.value = v),
|
|
825
|
+
"hide-configuration": y.hideConfiguration,
|
|
826
|
+
onHideConfiguration: s[1] || (s[1] = (v) => p("hideConfiguration", v))
|
|
827
|
+
}, null, 8, ["modelValue", "hide-configuration"])) : A("", !0)
|
|
828
|
+
])
|
|
829
|
+
]),
|
|
830
|
+
left: u(() => [
|
|
831
|
+
h("div", il, [
|
|
832
|
+
o(q, {
|
|
833
|
+
variant: "secondary",
|
|
834
|
+
icon: "keyboard_double_arrow_right",
|
|
835
|
+
"border-color": t(oe).ColorPrimary,
|
|
836
|
+
"text-color": t(oe).ColorPrimary,
|
|
837
|
+
class: "m-24 my-16",
|
|
838
|
+
size: "md",
|
|
839
|
+
onClick: s[2] || (s[2] = (v) => p("hideConfiguration", !y.hideConfiguration))
|
|
840
|
+
}, null, 8, ["border-color", "text-color"])
|
|
841
|
+
])
|
|
842
|
+
]),
|
|
843
|
+
_: 1
|
|
844
|
+
}, 8, ["model-value"])),
|
|
845
|
+
o(S, {
|
|
846
|
+
vertical: "",
|
|
847
|
+
style: { margin: "0px" }
|
|
848
|
+
}),
|
|
849
|
+
!_.value && !m.value ? (i(), T("div", sl, [
|
|
850
|
+
a.value.tiles.length > 0 ? (i(), T("div", ul, [
|
|
851
|
+
h("div", dl, [
|
|
852
|
+
o(Ce)
|
|
853
|
+
]),
|
|
854
|
+
(i(!0), T(G, null, ee(a.value.tiles, (v, N) => (i(), k(he, {
|
|
855
|
+
key: `${t(re)()}_${N}`,
|
|
856
|
+
"model-value": v,
|
|
857
|
+
index: N,
|
|
858
|
+
"hide-export": !0
|
|
859
|
+
}, null, 8, ["model-value", "index"]))), 128))
|
|
860
|
+
])) : (i(), k(ye, { key: 1 }))
|
|
861
|
+
])) : _.value && !m.value ? (i(), T("div", ml, [
|
|
862
|
+
o(B, { class: "px-5 pb-28" }, {
|
|
863
|
+
default: u(() => [
|
|
864
|
+
a.value.tiles.length > 0 ? (i(), T("div", cl, [
|
|
865
|
+
h("div", pl, [
|
|
866
|
+
o(Ce)
|
|
867
|
+
]),
|
|
868
|
+
(i(!0), T(G, null, ee(a.value.tiles, (v, N) => (i(), k(he, {
|
|
869
|
+
key: `${t(re)()}_${N}`,
|
|
870
|
+
"model-value": v,
|
|
871
|
+
index: N,
|
|
872
|
+
"hide-export": !0
|
|
873
|
+
}, null, 8, ["model-value", "index"]))), 128))
|
|
874
|
+
])) : (i(), k(ye, { key: 1 }))
|
|
875
|
+
]),
|
|
876
|
+
_: 1
|
|
877
|
+
}),
|
|
878
|
+
a.value ? (i(), k(Se, {
|
|
879
|
+
key: 0,
|
|
880
|
+
modelValue: a.value,
|
|
881
|
+
"onUpdate:modelValue": s[3] || (s[3] = (v) => a.value = v),
|
|
882
|
+
"hide-configuration": y.hideConfiguration,
|
|
883
|
+
onHideConfiguration: s[4] || (s[4] = (v) => {
|
|
884
|
+
p("hideConfiguration", v);
|
|
885
|
+
})
|
|
886
|
+
}, null, 8, ["modelValue", "hide-configuration"])) : A("", !0)
|
|
887
|
+
])) : (i(), T("div", vl, [
|
|
888
|
+
h("div", {
|
|
889
|
+
style: we({
|
|
890
|
+
transformOrigin: "top center",
|
|
891
|
+
transform: `scale(${y.previewScale})`
|
|
892
|
+
})
|
|
893
|
+
}, [
|
|
894
|
+
h("div", {
|
|
895
|
+
class: "overflow-y-auto bg-white rounded-lg",
|
|
896
|
+
style: we({
|
|
897
|
+
width: y.previewWidth + "px",
|
|
898
|
+
height: y.previewHeight + "px"
|
|
899
|
+
})
|
|
900
|
+
}, [
|
|
901
|
+
a.value.tiles.length > 0 ? (i(), T("div", fl, [
|
|
902
|
+
(i(!0), T(G, null, ee(a.value.tiles, (v, N) => (i(), k(he, {
|
|
903
|
+
key: `${t(re)()}_${N}`,
|
|
904
|
+
"model-value": v,
|
|
905
|
+
index: N,
|
|
906
|
+
"hide-export": !0,
|
|
907
|
+
"custom-screen-width": y.previewWidth
|
|
908
|
+
}, null, 8, ["model-value", "index", "custom-screen-width"]))), 128))
|
|
909
|
+
])) : (i(), k(ye, { key: 1 }))
|
|
910
|
+
], 4)
|
|
911
|
+
], 4)
|
|
912
|
+
]))
|
|
913
|
+
], 64)) : (i(), k(U, { key: 0 }))
|
|
914
|
+
]);
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
}), bl = { class: "flex items-center gap-4" }, hl = { class: "flex justify-center items-center gap-2 w-full" }, yl = { class: "flex gap-4" }, Ml = /* @__PURE__ */ X({
|
|
918
|
+
__name: "ReportEditor",
|
|
919
|
+
setup(x) {
|
|
920
|
+
const r = Ne(), n = Me(), a = Oe(), { promptLoader: y } = je(), { t: m } = se(), { currentReport: _, editingReport: p } = me(a), { breakpoints: V } = pe(), s = D(() => {
|
|
921
|
+
var F;
|
|
922
|
+
return !((F = p.value) != null && F.editable);
|
|
923
|
+
}), U = D(() => {
|
|
924
|
+
var F;
|
|
925
|
+
return ((F = p.value) == null ? void 0 : F.name) ?? m("report.editor.newReport");
|
|
926
|
+
}), q = De(), { promptMessage: S } = Ue(), B = I(!1);
|
|
927
|
+
async function v() {
|
|
928
|
+
if (!p.value || p.value.tiles.length === 0) {
|
|
929
|
+
q.open({ message: m("report.messages.noWidget"), type: "error" });
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
const F = s.value ? m("report.common.clone") : m("report.common.save");
|
|
933
|
+
if (await S({
|
|
934
|
+
title: `${m("report.messages.saveReport")}`,
|
|
935
|
+
message: m("report.messages.confirmAction", { action: F, name: U.value })
|
|
936
|
+
}))
|
|
937
|
+
try {
|
|
938
|
+
await y(async () => {
|
|
939
|
+
if (s.value) {
|
|
940
|
+
const l = JSON.parse(JSON.stringify(p.value));
|
|
941
|
+
l.editable = !0, l.id = "", l.name = `${l.name} ${m("report.common.duplicate")}`, await a.createOrUpdateReport(l);
|
|
942
|
+
} else
|
|
943
|
+
p.value && await a.createOrUpdateReport(p.value);
|
|
944
|
+
r.push({
|
|
945
|
+
name: "reportView",
|
|
946
|
+
query: n.query
|
|
947
|
+
});
|
|
948
|
+
});
|
|
949
|
+
} catch (l) {
|
|
950
|
+
console.log(l), q.open({
|
|
951
|
+
message: m("report.messages.failedToAction", { action: F }),
|
|
952
|
+
type: "error"
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
async function N() {
|
|
957
|
+
var M;
|
|
958
|
+
if (!p.value) return;
|
|
959
|
+
await S({
|
|
960
|
+
title: m("report.common.report", 1),
|
|
961
|
+
message: m("report.editor.notSaved", { name: (M = p.value) == null ? void 0 : M.name })
|
|
962
|
+
}) && (p.value = JSON.parse(JSON.stringify(_.value)), r.back());
|
|
963
|
+
}
|
|
964
|
+
Re(() => {
|
|
965
|
+
p.value || r.push({ name: "reports" });
|
|
966
|
+
});
|
|
967
|
+
const Y = [
|
|
968
|
+
{
|
|
969
|
+
label: m("report.common.default"),
|
|
970
|
+
width: void 0,
|
|
971
|
+
height: void 0
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
label: m("report.editor.devices.desktop"),
|
|
975
|
+
width: 1920,
|
|
976
|
+
height: 1080
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
label: m("report.editor.devices.tablet"),
|
|
980
|
+
width: 820,
|
|
981
|
+
height: 1180
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
label: m("report.editor.devices.phone"),
|
|
985
|
+
width: 390,
|
|
986
|
+
height: 859
|
|
987
|
+
}
|
|
988
|
+
], R = I(Y[0]), P = I(!1), L = D(() => P.value ? Math.max(R.value.width || 0, R.value.height || 0) : Math.min(R.value.width || 0, R.value.height || 0)), g = D(() => P.value ? Math.min(R.value.width || 0, R.value.height || 0) : Math.max(R.value.width || 0, R.value.height || 0)), Z = D(() => window.innerHeight - 72 - 56), le = D(() => {
|
|
989
|
+
if (!L.value) return 1;
|
|
990
|
+
let F = (Z.value - 48) / L.value, M = g.value * F;
|
|
991
|
+
return M > window.innerWidth && (F = window.innerWidth / g.value, M = g.value * F), F > 1 ? 1 : F;
|
|
992
|
+
});
|
|
993
|
+
function te(F) {
|
|
994
|
+
R.value = F;
|
|
995
|
+
}
|
|
996
|
+
function ae() {
|
|
997
|
+
P.value = !P.value;
|
|
998
|
+
}
|
|
999
|
+
return (F, M) => {
|
|
1000
|
+
const l = c("FmTooltip"), e = c("FmButton"), C = c("FmPageHead");
|
|
1001
|
+
return i(), k(ze, null, {
|
|
1002
|
+
default: u(() => [
|
|
1003
|
+
o(C, {
|
|
1004
|
+
actions: [
|
|
1005
|
+
{ label: t(m)("report.common.cancel"), value: "cancel", isPrimary: !1 },
|
|
1006
|
+
{ label: "Save Report", value: "save", isPrimary: !0, prependIcon: "download" }
|
|
1007
|
+
],
|
|
1008
|
+
"onClick:action": M[0] || (M[0] = (d) => {
|
|
1009
|
+
d === "cancel" && N(), d === "save" && v();
|
|
1010
|
+
})
|
|
1011
|
+
}, {
|
|
1012
|
+
title: u(() => [
|
|
1013
|
+
h("div", bl, [
|
|
1014
|
+
o(l, {
|
|
1015
|
+
content: U.value,
|
|
1016
|
+
placement: "bottom"
|
|
1017
|
+
}, {
|
|
1018
|
+
default: u(() => [
|
|
1019
|
+
h("p", {
|
|
1020
|
+
class: ie(`${t(V).sm || t(V).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
|
|
1021
|
+
}, H(U.value), 3)
|
|
1022
|
+
]),
|
|
1023
|
+
_: 1
|
|
1024
|
+
}, 8, ["content"]),
|
|
1025
|
+
h("div", hl, [
|
|
1026
|
+
h("div", yl, [
|
|
1027
|
+
(i(), T(G, null, ee(Y, (d) => {
|
|
1028
|
+
var b;
|
|
1029
|
+
return o(e, {
|
|
1030
|
+
key: d.label,
|
|
1031
|
+
label: d.label,
|
|
1032
|
+
variant: ((b = R.value) == null ? void 0 : b.label) === d.label ? "primary" : "secondary",
|
|
1033
|
+
size: "md",
|
|
1034
|
+
onClick: ($) => te(d)
|
|
1035
|
+
}, null, 8, ["label", "variant", "onClick"]);
|
|
1036
|
+
}), 64))
|
|
1037
|
+
]),
|
|
1038
|
+
o(e, {
|
|
1039
|
+
icon: "screen_rotation",
|
|
1040
|
+
variant: "tertiary",
|
|
1041
|
+
size: "md",
|
|
1042
|
+
class: "text-fm-color-typo-primary",
|
|
1043
|
+
onClick: ae
|
|
1044
|
+
})
|
|
1045
|
+
])
|
|
1046
|
+
])
|
|
1047
|
+
]),
|
|
1048
|
+
_: 1
|
|
1049
|
+
}, 8, ["actions"]),
|
|
1050
|
+
t(p) ? (i(), k(gl, {
|
|
1051
|
+
key: 0,
|
|
1052
|
+
modelValue: t(p),
|
|
1053
|
+
"onUpdate:modelValue": M[1] || (M[1] = (d) => Te(p) ? p.value = d : null),
|
|
1054
|
+
style: we({ height: Z.value + "px" }),
|
|
1055
|
+
class: ie(t(V).lg || t(V).md ? "flex" : ""),
|
|
1056
|
+
"hide-configuration": B.value,
|
|
1057
|
+
"preview-width": g.value,
|
|
1058
|
+
"preview-height": L.value,
|
|
1059
|
+
"preview-scale": le.value,
|
|
1060
|
+
onHideConfiguration: M[2] || (M[2] = (d) => B.value = d)
|
|
1061
|
+
}, null, 8, ["modelValue", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : A("", !0)
|
|
1062
|
+
]),
|
|
1063
|
+
_: 1
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
export {
|
|
1069
|
+
Ml as default
|
|
1070
|
+
};
|