@feedmepos/mf-report 5.28.1 → 5.28.2
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-BQcj7ZgK.js → App-BJROTWeN.js} +4 -4
- package/dist/{DateRangeSelect-TQA-9XXm.js → DateRangeSelect-CrVPzmEd.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-2PkkRpW_.js → Default.vue_vue_type_script_setup_true_lang-a0akMlLO.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-BpZh4FDA.js → DynamicWidget.vue_vue_type_script_setup_true_lang-Ca-0UwzY.js} +5 -5
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-Ddimiuh3.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DfiptCL9.js} +567 -563
- package/dist/{InsightView-BG5IeWD1.js → InsightView-DMvh0tri.js} +5 -5
- package/dist/{Integration-DUBg0wiX.js → Integration-DI1aB30T.js} +3 -3
- package/dist/{Integrations-CerT8IlU.js → Integrations-ppg3ET9A.js} +2 -2
- package/dist/{Layout-Rr16bUkn.js → Layout-BZ158Hls.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-BEUDpozo.js → LocationSelect.vue_vue_type_script_setup_true_lang-C2o-GazV.js} +2 -2
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-Ca-Vlwmm.js → MenuTab.vue_vue_type_script_setup_true_lang-DeFc5SjE.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-IJ7NUGbC.js → NavigationTab.vue_vue_type_script_setup_true_lang-cm5XPecf.js} +5 -5
- package/dist/{OverviewView-D5q_5KwX.js → OverviewView-DL_4zW-x.js} +4 -4
- package/dist/{Report-CDk8BkDF.js → Report-iJxhArvZ.js} +3 -3
- package/dist/{ReportCanvasView-BNy6YAj6.js → ReportCanvasView-CZuwVWuu.js} +3 -3
- package/dist/{ReportEditor-JAgqGYhA.js → ReportEditor-CizLybN2.js} +849 -830
- package/dist/ReportView-DjrIAg8b.js +333 -0
- package/dist/{ReportViewRoute-NmDrsao2.js → ReportViewRoute-BWariCQP.js} +2 -2
- package/dist/{Setting-BCBWGuMP.js → Setting-Cw_x8Lza.js} +3 -3
- package/dist/{Template-B0Z7IA2P.js → Template-1qby88RH.js} +3 -3
- package/dist/{TileEditor-CUUIrvVX.js → TileEditor-zSd7mPxr.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-ByOoDTHP.js → TilePageStack.vue_vue_type_script_setup_true_lang-BeKOS3we.js} +2 -2
- package/dist/{TransitionFade-DVVKEBlH.js → TransitionFade-BHHk_v1V.js} +5 -5
- package/dist/{app-CVVEOyIu.js → app-BV4AjDIw.js} +720 -716
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-BeBGCyYW.js → formatChartData.worker-Dx1USoTn.js} +5 -1
- package/dist/assets/{processTableData.worker-frTYV0ok.js → processTableData.worker-clNopMr8.js} +5 -1
- package/dist/{report-35Rm6TvO.js → report-BGYeCpMB.js} +157 -153
- package/dist/style.css +1 -1
- package/dist/{useRestaurantPermission-BAkRCzWY.js → useRestaurantPermission-C1pe2bie.js} +1 -1
- package/package.json +1 -1
- package/dist/ReportView-C3LFd5yk.js +0 -329
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as we, mergeModels as ke, useModel as Te, ref as
|
|
2
|
-
import { W as
|
|
3
|
-
import { C as xe, D as te, b as ze, F as Je, c as
|
|
1
|
+
import { defineComponent as we, mergeModels as ke, useModel as Te, ref as L, computed as g, resolveComponent as C, createBlock as x, openBlock as c, withCtx as _, createElementVNode as v, createVNode as u, unref as t, normalizeClass as Le, createTextVNode as Ae, toDisplayString as U, createElementBlock as R, Fragment as he, renderSlot as gl, createCommentVNode as D, watch as ve, renderList as Ee, onMounted as bl, onUnmounted as Dl, resolveDynamicComponent as Ol, isRef as yl, normalizeStyle as rl } from "vue";
|
|
2
|
+
import { W as Il, g as Ul, _ as Nl, a as Bl, e as De, S as We, d as hl, b as wl, T as Ml, c as Rl } from "./TransitionFade-BHHk_v1V.js";
|
|
3
|
+
import { C as xe, D as te, b as ze, F as Je, c as Oe, u as il, i as Pe, d as pe, M as _l, r as zl, e as el, n as Pl, f as ql, g as El, h as Ll, j as Gl, k as Wl, m as Al, a as Hl, o as ml, p as ll, q as jl, Q as Qe, l as Jl, s as Ql } from "./report-BGYeCpMB.js";
|
|
4
4
|
import { storeToRefs as qe } from "pinia";
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import { useBreakpoints as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
5
|
+
import { useRouter as sl, useRoute as ul } from "vue-router";
|
|
6
|
+
import { useBreakpoints as Ke, useSnackbar as Fl, FmButtonColorThemeVariant as Ce } from "@feedmepos/ui-library";
|
|
7
|
+
import { u as dl } from "./message-dialog-UoMWOnil.js";
|
|
8
|
+
import { u as Kl } from "./global-loader-BuxFfehu.js";
|
|
9
9
|
import { u as Ge } from "./_plugin-vue_export-helper-C6QDExPN.js";
|
|
10
10
|
import { r as He } from "./i18n-DbyciK4x.js";
|
|
11
|
-
import { _ as
|
|
12
|
-
import { a as
|
|
13
|
-
import { d as
|
|
14
|
-
import { g as
|
|
15
|
-
import { useCoreStore as
|
|
16
|
-
import { u as
|
|
17
|
-
import { d as
|
|
18
|
-
const
|
|
11
|
+
import { _ as tl } from "./TilePageStack.vue_vue_type_script_setup_true_lang-BeKOS3we.js";
|
|
12
|
+
import { a as ol, _ as al } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
|
|
13
|
+
import { d as Yl, e as Xl, i as Zl } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-Ca-0UwzY.js";
|
|
14
|
+
import { g as et, d as lt, _ as cl } from "./GlobalFilterSelect.vue_vue_type_script_setup_true_lang-DfiptCL9.js";
|
|
15
|
+
import { useCoreStore as tt } from "@feedmepos/mf-common";
|
|
16
|
+
import { u as ot, a as at } from "./app-BV4AjDIw.js";
|
|
17
|
+
import { d as rt } from "./DateRangeSelect-CrVPzmEd.js";
|
|
18
|
+
const nt = /* @__PURE__ */ we({
|
|
19
19
|
__name: "WidgetDialog",
|
|
20
20
|
props: /* @__PURE__ */ ke({
|
|
21
21
|
isOpen: { type: Boolean }
|
|
@@ -24,41 +24,41 @@ const nl = /* @__PURE__ */ we({
|
|
|
24
24
|
modelModifiers: {}
|
|
25
25
|
}),
|
|
26
26
|
emits: /* @__PURE__ */ ke(["update:isOpen"], ["update:modelValue"]),
|
|
27
|
-
setup(
|
|
28
|
-
const { t: d } = Ge(), { breakpoints: b } =
|
|
29
|
-
function
|
|
30
|
-
|
|
27
|
+
setup(z, { emit: p }) {
|
|
28
|
+
const { t: d } = Ge(), { breakpoints: b } = Ke(), i = Te(z, "modelValue"), h = z, P = p;
|
|
29
|
+
function Q() {
|
|
30
|
+
P("update:isOpen", !1);
|
|
31
31
|
}
|
|
32
32
|
function T() {
|
|
33
|
-
|
|
33
|
+
F.value && (i.value = F.value, F.value = void 0, P("update:isOpen", !1));
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
return (
|
|
35
|
+
const F = L(), O = g(() => !F.value);
|
|
36
|
+
return (X, q) => {
|
|
37
37
|
const a = C("FmButton"), S = C("FmDialog");
|
|
38
38
|
return c(), x(S, {
|
|
39
39
|
"model-value": h.isOpen
|
|
40
40
|
}, {
|
|
41
|
-
"dialog-header":
|
|
42
|
-
Ae(U(
|
|
41
|
+
"dialog-header": _(() => [
|
|
42
|
+
Ae(U(t(d)("report.widget.type")), 1)
|
|
43
43
|
]),
|
|
44
|
-
default:
|
|
45
|
-
u(
|
|
46
|
-
modelValue:
|
|
47
|
-
"onUpdate:modelValue":
|
|
48
|
-
class: Le(`grid ${
|
|
44
|
+
default: _(() => [
|
|
45
|
+
u(Il, {
|
|
46
|
+
modelValue: F.value,
|
|
47
|
+
"onUpdate:modelValue": q[0] || (q[0] = (k) => F.value = k),
|
|
48
|
+
class: Le(`grid ${t(b).lg || t(b).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
|
|
49
49
|
"child-class": "p-[8px] flex flex-col"
|
|
50
50
|
}, null, 8, ["modelValue", "class"])
|
|
51
51
|
]),
|
|
52
|
-
"dialog-footer":
|
|
53
|
-
|
|
52
|
+
"dialog-footer": _(() => [
|
|
53
|
+
q[1] || (q[1] = v("div", { class: "grow" }, null, -1)),
|
|
54
54
|
u(a, {
|
|
55
|
-
label:
|
|
55
|
+
label: t(d)("report.common.cancel"),
|
|
56
56
|
variant: "tertiary",
|
|
57
|
-
onClick:
|
|
57
|
+
onClick: Q
|
|
58
58
|
}, null, 8, ["label"]),
|
|
59
59
|
u(a, {
|
|
60
|
-
label:
|
|
61
|
-
disabled:
|
|
60
|
+
label: t(d)("report.common.confirm"),
|
|
61
|
+
disabled: O.value,
|
|
62
62
|
onClick: T
|
|
63
63
|
}, null, 8, ["label", "disabled"])
|
|
64
64
|
]),
|
|
@@ -66,7 +66,7 @@ const nl = /* @__PURE__ */ we({
|
|
|
66
66
|
}, 8, ["model-value"]);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
}),
|
|
69
|
+
}), it = { class: "fm-typo-en-body-lg-600" }, nl = /* @__PURE__ */ we({
|
|
70
70
|
__name: "ReportEditorTabHeader",
|
|
71
71
|
props: /* @__PURE__ */ ke({
|
|
72
72
|
icon: {
|
|
@@ -78,70 +78,70 @@ const nl = /* @__PURE__ */ we({
|
|
|
78
78
|
modelModifiers: {}
|
|
79
79
|
}),
|
|
80
80
|
emits: ["update:modelValue"],
|
|
81
|
-
setup(
|
|
82
|
-
const { t: p } = Ge(), d = Te(
|
|
81
|
+
setup(z) {
|
|
82
|
+
const { t: p } = Ge(), d = Te(z, "modelValue"), b = z;
|
|
83
83
|
return (i, h) => {
|
|
84
|
-
const
|
|
85
|
-
return c(),
|
|
84
|
+
const P = C("FmIcon");
|
|
85
|
+
return c(), R("div", {
|
|
86
86
|
class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
|
|
87
|
-
onClick: h[0] || (h[0] = (
|
|
87
|
+
onClick: h[0] || (h[0] = (Q) => d.value = !d.value)
|
|
88
88
|
}, [
|
|
89
|
-
v("p",
|
|
89
|
+
v("p", it, U(t(p)("report.editor.customizeReport")), 1),
|
|
90
90
|
h[1] || (h[1] = v("div", { class: "grow" }, null, -1)),
|
|
91
|
-
u(
|
|
91
|
+
u(P, {
|
|
92
92
|
name: b.icon
|
|
93
93
|
}, null, 8, ["name"])
|
|
94
94
|
]);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
}),
|
|
97
|
+
}), st = /* @__PURE__ */ we({
|
|
98
98
|
__name: "ReportEditorTabDesktop",
|
|
99
99
|
props: {
|
|
100
100
|
modelValue: { required: !0, default: !1 },
|
|
101
101
|
modelModifiers: {}
|
|
102
102
|
},
|
|
103
103
|
emits: ["update:modelValue"],
|
|
104
|
-
setup(
|
|
105
|
-
const p = Te(
|
|
106
|
-
return (d, b) => (c(),
|
|
107
|
-
u(
|
|
104
|
+
setup(z) {
|
|
105
|
+
const p = Te(z, "modelValue");
|
|
106
|
+
return (d, b) => (c(), R(he, null, [
|
|
107
|
+
u(nl, {
|
|
108
108
|
modelValue: p.value,
|
|
109
109
|
"onUpdate:modelValue": b[0] || (b[0] = (i) => p.value = i),
|
|
110
110
|
icon: "keyboard_double_arrow_left"
|
|
111
111
|
}, null, 8, ["modelValue"]),
|
|
112
|
-
|
|
112
|
+
gl(d.$slots, "default")
|
|
113
113
|
], 64));
|
|
114
114
|
}
|
|
115
|
-
}),
|
|
115
|
+
}), ut = /* @__PURE__ */ we({
|
|
116
116
|
__name: "ReportEditorTabMobile",
|
|
117
117
|
props: {
|
|
118
118
|
modelValue: { required: !0, default: !1 },
|
|
119
119
|
modelModifiers: {}
|
|
120
120
|
},
|
|
121
121
|
emits: ["update:modelValue"],
|
|
122
|
-
setup(
|
|
123
|
-
const p = Te(
|
|
122
|
+
setup(z) {
|
|
123
|
+
const p = Te(z, "modelValue");
|
|
124
124
|
return (d, b) => {
|
|
125
125
|
const i = C("FmTopSheet"), h = C("FmCard");
|
|
126
126
|
return c(), x(h, { class: "fixed bottom-0 w-full" }, {
|
|
127
|
-
default:
|
|
128
|
-
u(
|
|
127
|
+
default: _(() => [
|
|
128
|
+
u(nl, {
|
|
129
129
|
modelValue: p.value,
|
|
130
|
-
"onUpdate:modelValue": b[0] || (b[0] = (
|
|
130
|
+
"onUpdate:modelValue": b[0] || (b[0] = (P) => p.value = P),
|
|
131
131
|
icon: "keyboard_double_arrow_up"
|
|
132
132
|
}, null, 8, ["modelValue"]),
|
|
133
133
|
u(i, {
|
|
134
134
|
modelValue: p.value,
|
|
135
|
-
"onUpdate:modelValue": b[2] || (b[2] = (
|
|
135
|
+
"onUpdate:modelValue": b[2] || (b[2] = (P) => p.value = P),
|
|
136
136
|
"fullscreen-size": "sm"
|
|
137
137
|
}, {
|
|
138
|
-
default:
|
|
139
|
-
u(
|
|
138
|
+
default: _(() => [
|
|
139
|
+
u(nl, {
|
|
140
140
|
modelValue: p.value,
|
|
141
|
-
"onUpdate:modelValue": b[1] || (b[1] = (
|
|
141
|
+
"onUpdate:modelValue": b[1] || (b[1] = (P) => p.value = P),
|
|
142
142
|
icon: "keyboard_double_arrow_down"
|
|
143
143
|
}, null, 8, ["modelValue"]),
|
|
144
|
-
p.value ?
|
|
144
|
+
p.value ? gl(d.$slots, "default", { key: 0 }) : D("", !0)
|
|
145
145
|
]),
|
|
146
146
|
_: 3
|
|
147
147
|
}, 8, ["modelValue"])
|
|
@@ -150,19 +150,19 @@ const nl = /* @__PURE__ */ we({
|
|
|
150
150
|
});
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
}),
|
|
153
|
+
}), dt = {
|
|
154
154
|
key: 2,
|
|
155
155
|
class: "flex flex-col gap-3 mt-2 border border-neutral-300 p-3"
|
|
156
|
-
},
|
|
156
|
+
}, mt = { class: "grid grid-cols-1 gap-2 rounded-md border border-neutral-300 p-2 sm:grid-cols-[1.3fr_1fr_1fr_auto] sm:items-end" }, ct = {
|
|
157
157
|
key: 0,
|
|
158
158
|
class: "flex justify-end sm:pb-[2px]"
|
|
159
|
-
},
|
|
159
|
+
}, pt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vt = { class: "pl-1" }, ft = {
|
|
160
160
|
key: 0,
|
|
161
161
|
class: "flex justify-end sm:pb-[2px]"
|
|
162
|
-
},
|
|
162
|
+
}, gt = {
|
|
163
163
|
key: 3,
|
|
164
164
|
class: "flex flex-col gap-2"
|
|
165
|
-
},
|
|
165
|
+
}, bt = /* @__PURE__ */ we({
|
|
166
166
|
__name: "GlobalFilterDialog",
|
|
167
167
|
props: /* @__PURE__ */ ke({
|
|
168
168
|
schemas: {
|
|
@@ -182,190 +182,190 @@ const nl = /* @__PURE__ */ we({
|
|
|
182
182
|
isOpenModifiers: {}
|
|
183
183
|
}),
|
|
184
184
|
emits: ["update:globalFilter", "update:isOpen"],
|
|
185
|
-
setup(
|
|
186
|
-
const { t: p, te: d } = Ge(), b = Te(
|
|
187
|
-
function
|
|
185
|
+
setup(z) {
|
|
186
|
+
const { t: p, te: d } = Ge(), b = Te(z, "globalFilter"), i = Te(z, "isOpen"), h = Fl(), P = z, Q = L(""), T = L(), F = L(), O = L(), X = L([]), q = L([]), a = L(!1), S = L([]), k = L([]), j = L(xe.Equal);
|
|
187
|
+
function ae(n) {
|
|
188
188
|
return JSON.parse(JSON.stringify(n));
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function de(n, e) {
|
|
191
191
|
return { hour: n, minute: e };
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function A(n) {
|
|
194
194
|
return n ? `${String(n.hour).padStart(2, "0")}:${String(n.minute).padStart(2, "0")}` : null;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function ie(n) {
|
|
197
197
|
if (!n) return null;
|
|
198
|
-
const [e,
|
|
199
|
-
return Number.isNaN(e) || Number.isNaN(
|
|
198
|
+
const [e, l] = n.split(":").map(Number);
|
|
199
|
+
return Number.isNaN(e) || Number.isNaN(l) ? null : { hour: e, minute: l };
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const w = g(() => F.value ? !(F.value.type === te.Timestamp && O.value === ze.DateTime) : !1), K = g(
|
|
202
202
|
() => {
|
|
203
203
|
var n;
|
|
204
|
-
return ((n =
|
|
204
|
+
return ((n = F.value) == null ? void 0 : n.type) === te.Timestamp && O.value === ze.TimeOfDay;
|
|
205
205
|
}
|
|
206
|
-
),
|
|
206
|
+
), re = g(() => {
|
|
207
207
|
var n;
|
|
208
|
-
return (((n =
|
|
208
|
+
return (((n = F.value) == null ? void 0 : n.filterOperators) ?? []).filter((e) => e !== xe.And && e !== xe.Or).map((e) => ({
|
|
209
209
|
label: p(`report.section.comparisonOperator.${e}`),
|
|
210
210
|
value: e
|
|
211
211
|
}));
|
|
212
212
|
});
|
|
213
|
-
function
|
|
213
|
+
function Z() {
|
|
214
214
|
var e;
|
|
215
|
-
const n = (e =
|
|
216
|
-
return n || (
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
const n = (e = re.value[0]) == null ? void 0 : e.value;
|
|
216
|
+
return n || (F.value ? ye(
|
|
217
|
+
F.value.type,
|
|
218
|
+
O.value ?? null
|
|
219
219
|
) : xe.Equal);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
if (
|
|
223
|
-
return
|
|
224
|
-
operator: n ??
|
|
225
|
-
dataType:
|
|
226
|
-
dimensionOption:
|
|
221
|
+
function ne(n) {
|
|
222
|
+
if (F.value)
|
|
223
|
+
return et({
|
|
224
|
+
operator: n ?? Z(),
|
|
225
|
+
dataType: F.value.type,
|
|
226
|
+
dimensionOption: F.value.type === te.Timestamp ? O.value ?? null : null,
|
|
227
227
|
t: p
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
function se(n, e) {
|
|
231
231
|
if (typeof (e == null ? void 0 : e.default) == "boolean" || n.length > 0 && n.every((y) => typeof y == "boolean")) {
|
|
232
|
-
const y = n.reduce((
|
|
232
|
+
const y = n.reduce((V, $) => (typeof $ == "boolean" && V.push($), V), []);
|
|
233
233
|
if (e)
|
|
234
234
|
for (e.fixed && y.splice(e.count); y.length < e.count; )
|
|
235
235
|
y.push(typeof e.default == "boolean" ? e.default : !1);
|
|
236
236
|
return y;
|
|
237
237
|
}
|
|
238
|
-
const s = n.reduce((y,
|
|
238
|
+
const s = n.reduce((y, V) => (typeof V == "string" && y.push(V), y), []);
|
|
239
239
|
if (e)
|
|
240
240
|
for (e.fixed && s.splice(e.count); s.length < e.count; )
|
|
241
241
|
s.push(typeof e.default == "string" ? e.default : "");
|
|
242
242
|
return s;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const e =
|
|
244
|
+
function me(n = j.value) {
|
|
245
|
+
const e = ne(n), l = se(
|
|
246
246
|
e ? Array(e.count).fill(e.default) : [],
|
|
247
247
|
e
|
|
248
248
|
);
|
|
249
249
|
return {
|
|
250
250
|
label: "",
|
|
251
251
|
operator: n,
|
|
252
|
-
values:
|
|
252
|
+
values: l
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function ue() {
|
|
256
256
|
return {
|
|
257
257
|
name: "",
|
|
258
|
-
startTime:
|
|
259
|
-
endTime:
|
|
258
|
+
startTime: de(0, 0),
|
|
259
|
+
endTime: de(23, 59)
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
if (!(!
|
|
264
|
-
if (
|
|
265
|
-
k.value.length === 0 && (k.value = [
|
|
262
|
+
function N() {
|
|
263
|
+
if (!(!w.value || !a.value)) {
|
|
264
|
+
if (K.value) {
|
|
265
|
+
k.value.length === 0 && (k.value = [ue()]);
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
S.value.length === 0 && (S.value = [
|
|
268
|
+
S.value.length === 0 && (S.value = [me()]);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
var
|
|
273
|
-
const n =
|
|
274
|
-
|
|
271
|
+
function E() {
|
|
272
|
+
var l, s, y;
|
|
273
|
+
const n = ae(((l = b.value) == null ? void 0 : l.customOptions) ?? []), e = ae(((s = b.value) == null ? void 0 : s.customTimeRanges) ?? []);
|
|
274
|
+
j.value = ((y = n[0]) == null ? void 0 : y.operator) ?? Z(), a.value = n.length > 0 || e.length > 0, S.value = n, k.value = e, N();
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
|
|
278
|
-
const s = S.value[
|
|
276
|
+
function H(n) {
|
|
277
|
+
j.value = n, S.value = S.value.map((e, l) => {
|
|
278
|
+
const s = S.value[l];
|
|
279
279
|
if (!s)
|
|
280
|
-
return
|
|
281
|
-
const y =
|
|
280
|
+
return me(n);
|
|
281
|
+
const y = ne(n), V = se(
|
|
282
282
|
Array.isArray(s.values) ? [...s.values] : [],
|
|
283
283
|
y
|
|
284
284
|
);
|
|
285
285
|
return {
|
|
286
286
|
...s,
|
|
287
287
|
operator: n,
|
|
288
|
-
values:
|
|
288
|
+
values: V
|
|
289
289
|
};
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
S.value = [...S.value,
|
|
292
|
+
function ce() {
|
|
293
|
+
S.value = [...S.value, me()];
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
S.value.length <= 1 || (S.value = S.value.filter((e,
|
|
295
|
+
function Se(n) {
|
|
296
|
+
S.value.length <= 1 || (S.value = S.value.filter((e, l) => l !== n));
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
k.value = [...k.value,
|
|
298
|
+
function J() {
|
|
299
|
+
k.value = [...k.value, ue()];
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function ee(n) {
|
|
302
302
|
k.value.length <= 1 || (k.value = k.value.filter(
|
|
303
|
-
(e,
|
|
303
|
+
(e, l) => l !== n
|
|
304
304
|
));
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function _e(n, e, l) {
|
|
307
307
|
const s = k.value[n];
|
|
308
308
|
s && (k.value[n] = {
|
|
309
309
|
...s,
|
|
310
|
-
[e]:
|
|
310
|
+
[e]: ie(l)
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Ie(n) {
|
|
314
314
|
return n.length === 0 || n.some((e) => e === "");
|
|
315
315
|
}
|
|
316
316
|
function Ue() {
|
|
317
317
|
if (!a.value) return !0;
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
318
|
+
if (K.value) {
|
|
319
|
+
const l = k.value.map((y) => y.name.trim()).filter(Boolean);
|
|
320
320
|
return k.value.some(
|
|
321
321
|
(y) => !y.name.trim() || !y.startTime || !y.endTime
|
|
322
322
|
) ? (h.open({
|
|
323
323
|
message: p("report.section.filter.invalidCustomTimeRange"),
|
|
324
324
|
type: "error"
|
|
325
|
-
}), !1) : new Set(
|
|
325
|
+
}), !1) : new Set(l).size !== l.length ? (h.open({
|
|
326
326
|
message: p("report.section.filter.customTimeRangeNamesMustBeUnique"),
|
|
327
327
|
type: "error"
|
|
328
328
|
}), !1) : !0;
|
|
329
329
|
}
|
|
330
|
-
const n = S.value.map((
|
|
330
|
+
const n = S.value.map((l) => l.label.trim()).filter(Boolean);
|
|
331
331
|
return S.value.some(
|
|
332
|
-
(
|
|
332
|
+
(l) => !l.label.trim() || Ie(l.values)
|
|
333
333
|
) ? (h.open({ message: p("report.section.filter.invalidCustomOption"), type: "error" }), !1) : new Set(n).size !== n.length ? (h.open({
|
|
334
334
|
message: p("report.section.filter.customOptionLabelsMustBeUnique"),
|
|
335
335
|
type: "error"
|
|
336
336
|
}), !1) : !0;
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
var e,
|
|
340
|
-
n && (
|
|
338
|
+
ve(i, (n) => {
|
|
339
|
+
var e, l, s, y, V;
|
|
340
|
+
n && (Q.value = ((e = b.value) == null ? void 0 : e.label) || "", T.value = P.schemas.find(
|
|
341
341
|
($) => {
|
|
342
|
-
var
|
|
343
|
-
return $.name === ((
|
|
342
|
+
var M;
|
|
343
|
+
return $.name === ((M = b.value) == null ? void 0 : M.schemaName);
|
|
344
344
|
}
|
|
345
|
-
),
|
|
345
|
+
), F.value = (l = ge.value.find(
|
|
346
346
|
($) => {
|
|
347
|
-
var
|
|
348
|
-
return $.value.name === ((
|
|
347
|
+
var M;
|
|
348
|
+
return $.value.name === ((M = b.value) == null ? void 0 : M.name);
|
|
349
349
|
}
|
|
350
|
-
)) == null ? void 0 :
|
|
351
|
-
}),
|
|
350
|
+
)) == null ? void 0 : l.value, O.value = (s = b.value) == null ? void 0 : s.option, X.value = ((y = b.value) == null ? void 0 : y.tileIds) || [], q.value = ((V = b.value) == null ? void 0 : V.filters) || [], E());
|
|
351
|
+
}), ve(a, (n) => {
|
|
352
352
|
var e;
|
|
353
|
-
n && (
|
|
354
|
-
}),
|
|
353
|
+
n && (j.value = ((e = S.value[0]) == null ? void 0 : e.operator) ?? Z(), N());
|
|
354
|
+
}), ve(w, (n) => {
|
|
355
355
|
if (!n) {
|
|
356
356
|
a.value = !1, S.value = [], k.value = [];
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
|
-
|
|
360
|
-
}),
|
|
361
|
-
|
|
362
|
-
}),
|
|
363
|
-
var
|
|
364
|
-
const e = (
|
|
365
|
-
e && (n.some((s) => s.value ===
|
|
359
|
+
N();
|
|
360
|
+
}), ve(K, () => {
|
|
361
|
+
N();
|
|
362
|
+
}), ve(re, (n) => {
|
|
363
|
+
var l;
|
|
364
|
+
const e = (l = n[0]) == null ? void 0 : l.value;
|
|
365
|
+
e && (n.some((s) => s.value === j.value) || H(e));
|
|
366
366
|
});
|
|
367
367
|
const fe = g(
|
|
368
|
-
() =>
|
|
368
|
+
() => P.schemas.map((n) => ({
|
|
369
369
|
label: n.label || n.name,
|
|
370
370
|
value: n
|
|
371
371
|
}))
|
|
@@ -377,18 +377,18 @@ const nl = /* @__PURE__ */ we({
|
|
|
377
377
|
}));
|
|
378
378
|
}), Ne = g(() => {
|
|
379
379
|
var n;
|
|
380
|
-
return ((n =
|
|
381
|
-
}), Be = g(() =>
|
|
382
|
-
var
|
|
383
|
-
const s = ((
|
|
384
|
-
(
|
|
380
|
+
return ((n = F.value) == null ? void 0 : n.type) !== te.Timestamp ? [] : Ul(p);
|
|
381
|
+
}), Be = g(() => P.tiles.reduce((n, e, l) => {
|
|
382
|
+
var V, $, M, G, I;
|
|
383
|
+
const s = ((V = e.widget) == null ? void 0 : V.config.schemaNames) ?? [], y = ((($ = e.widget) == null ? void 0 : $.config.joinDatasources) ?? []).flatMap(
|
|
384
|
+
(oe) => oe.schemaNames ?? []
|
|
385
385
|
);
|
|
386
|
-
return [...s, ...y].includes(((
|
|
387
|
-
label: (
|
|
386
|
+
return [...s, ...y].includes(((M = T.value) == null ? void 0 : M.name) || "") && n.push({
|
|
387
|
+
label: (I = (G = e.widget) == null ? void 0 : G.title) != null && I.trim() ? e.widget.title : `Widget ${l + 1}`,
|
|
388
388
|
value: e.id
|
|
389
389
|
}), n;
|
|
390
390
|
}, [])), Me = g(
|
|
391
|
-
() =>
|
|
391
|
+
() => P.schemas.flatMap(
|
|
392
392
|
(n) => (n.fields ?? []).map((e) => ({
|
|
393
393
|
...e,
|
|
394
394
|
labels: [
|
|
@@ -400,10 +400,10 @@ const nl = /* @__PURE__ */ we({
|
|
|
400
400
|
);
|
|
401
401
|
function be(n) {
|
|
402
402
|
var e;
|
|
403
|
-
n.name !== ((e = T.value) == null ? void 0 : e.name) && (T.value = n,
|
|
403
|
+
n.name !== ((e = T.value) == null ? void 0 : e.name) && (T.value = n, F.value = void 0, j.value = xe.Equal, a.value = !1, S.value = [], k.value = []);
|
|
404
404
|
}
|
|
405
405
|
function Fe(n) {
|
|
406
|
-
|
|
406
|
+
F.value = n, O.value = n.type === te.Timestamp ? ze.DateTime : void 0, j.value = Z(), a.value = !1, S.value = [], k.value = [];
|
|
407
407
|
}
|
|
408
408
|
function ye(n, e) {
|
|
409
409
|
switch (n) {
|
|
@@ -422,13 +422,13 @@ const nl = /* @__PURE__ */ we({
|
|
|
422
422
|
h.open({ message: p("report.section.filter.invalidSchema"), type: "error" });
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
|
-
if (!
|
|
425
|
+
if (!F.value) {
|
|
426
426
|
h.open({ message: p("report.section.filter.invalidDimension"), type: "error" });
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const n =
|
|
429
|
+
const n = q.value.filter((s) => s ? !fe.value.some((V) => V.value.name === s.schemaName) : !0);
|
|
430
430
|
if (n.length > 0) {
|
|
431
|
-
const s = n.filter((
|
|
431
|
+
const s = n.filter((V) => !!V).map((V) => V.schemaName), y = n.some((V) => !V) ? `, ${p("report.section.filter.unknownFilters")}` : "";
|
|
432
432
|
h.open({
|
|
433
433
|
message: p("report.section.filter.invalidFiltersSchemaNotFound", {
|
|
434
434
|
schemas: s.join(", "),
|
|
@@ -440,188 +440,188 @@ const nl = /* @__PURE__ */ we({
|
|
|
440
440
|
}
|
|
441
441
|
if (!Ue())
|
|
442
442
|
return;
|
|
443
|
-
const e = a.value && !
|
|
443
|
+
const e = a.value && !K.value ? S.value.map((s) => ({
|
|
444
444
|
label: s.label.trim(),
|
|
445
|
-
operator: s.operator ??
|
|
445
|
+
operator: s.operator ?? Z(),
|
|
446
446
|
values: se(
|
|
447
447
|
[...s.values],
|
|
448
|
-
|
|
448
|
+
ne(s.operator)
|
|
449
449
|
)
|
|
450
|
-
})) : void 0,
|
|
450
|
+
})) : void 0, l = a.value && K.value ? k.value.map((s) => ({
|
|
451
451
|
name: s.name.trim(),
|
|
452
452
|
startTime: s.startTime,
|
|
453
453
|
endTime: s.endTime
|
|
454
454
|
})) : void 0;
|
|
455
455
|
b.value = {
|
|
456
456
|
schemaName: T.value.name,
|
|
457
|
-
name:
|
|
458
|
-
label:
|
|
457
|
+
name: F.value.name,
|
|
458
|
+
label: Q.value,
|
|
459
459
|
operator: ye(
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
F.value.type,
|
|
461
|
+
F.value.type === te.Timestamp ? O.value ?? ze.DateTime : null
|
|
462
462
|
),
|
|
463
|
-
option:
|
|
463
|
+
option: F.value.type === te.Timestamp ? O.value : null,
|
|
464
464
|
values: [],
|
|
465
|
-
tileIds: [...
|
|
466
|
-
filters:
|
|
465
|
+
tileIds: [...X.value],
|
|
466
|
+
filters: ae(q.value),
|
|
467
467
|
customOptions: e,
|
|
468
|
-
customTimeRanges:
|
|
468
|
+
customTimeRanges: l
|
|
469
469
|
}, i.value = !1;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function le() {
|
|
472
472
|
i.value = !1;
|
|
473
473
|
}
|
|
474
474
|
const $e = g(() => {
|
|
475
475
|
var n;
|
|
476
476
|
return [
|
|
477
477
|
(n = T.value) == null ? void 0 : n.name,
|
|
478
|
-
...
|
|
478
|
+
...q.value.map((e) => e.schemaName)
|
|
479
479
|
];
|
|
480
480
|
});
|
|
481
481
|
function Re(n) {
|
|
482
482
|
var r;
|
|
483
|
-
const e =
|
|
484
|
-
if (!e || !T.value || !
|
|
485
|
-
const
|
|
483
|
+
const e = P.tiles.find((f) => f.id === n.value);
|
|
484
|
+
if (!e || !T.value || !F.value) return null;
|
|
485
|
+
const l = (r = e == null ? void 0 : e.widget) == null ? void 0 : r.config, s = (l == null ? void 0 : l.schemaNames) ?? [], y = ((l == null ? void 0 : l.joinDatasources) ?? []).flatMap(
|
|
486
486
|
(f) => f.schemaNames ?? []
|
|
487
|
-
),
|
|
487
|
+
), V = [...s, ...y], $ = $e.value.filter((f) => !!f).some((f) => !V.includes(f)), M = F.value.type === te.Timestamp;
|
|
488
488
|
if ($)
|
|
489
489
|
return p(
|
|
490
|
-
|
|
490
|
+
M ? "report.section.filter.missingFilterSchema" : "report.section.filter.missingFilterSchemaOrDimension"
|
|
491
491
|
);
|
|
492
|
-
if (
|
|
493
|
-
const G = ((
|
|
492
|
+
if (M) return null;
|
|
493
|
+
const G = ((l == null ? void 0 : l.dimensions) ?? []).map((f) => ({
|
|
494
494
|
schemaName: f.schemaName,
|
|
495
495
|
name: f.name
|
|
496
|
-
})),
|
|
497
|
-
(f) => (f.dimensions ?? []).map((
|
|
498
|
-
schemaName:
|
|
499
|
-
name:
|
|
496
|
+
})), I = ((l == null ? void 0 : l.joinDatasources) ?? []).flatMap(
|
|
497
|
+
(f) => (f.dimensions ?? []).map((W) => ({
|
|
498
|
+
schemaName: W.schemaName,
|
|
499
|
+
name: W.name
|
|
500
500
|
}))
|
|
501
|
-
),
|
|
502
|
-
return
|
|
501
|
+
), oe = [...G, ...I], Y = T.value.name, m = F.value.name;
|
|
502
|
+
return oe.some(
|
|
503
503
|
(f) => f.schemaName === Y && f.name === m
|
|
504
504
|
) ? null : p("report.section.filter.missingFilterSchemaOrDimension");
|
|
505
505
|
}
|
|
506
506
|
return (n, e) => {
|
|
507
|
-
const
|
|
507
|
+
const l = C("FmTextField"), s = C("FmSelect"), y = C("FmCheckbox"), V = C("FmTimePicker"), $ = C("FmButton"), M = C("FmLabel"), G = C("FmIcon"), I = C("FmTooltip"), oe = C("FmForm"), Y = C("FmDialog");
|
|
508
508
|
return c(), x(Y, {
|
|
509
509
|
modelValue: i.value,
|
|
510
510
|
"onUpdate:modelValue": e[9] || (e[9] = (m) => i.value = m),
|
|
511
511
|
overlay: !0,
|
|
512
512
|
"z-index": 10
|
|
513
513
|
}, {
|
|
514
|
-
"dialog-header":
|
|
515
|
-
Ae(U(
|
|
514
|
+
"dialog-header": _(() => [
|
|
515
|
+
Ae(U(t(p)("report.section.filter.globalFilter")), 1)
|
|
516
516
|
]),
|
|
517
|
-
default:
|
|
518
|
-
u(
|
|
517
|
+
default: _(() => [
|
|
518
|
+
u(oe, {
|
|
519
519
|
ref: "form",
|
|
520
520
|
class: "flex flex-col gap-2 w-[490px]"
|
|
521
521
|
}, {
|
|
522
|
-
default:
|
|
522
|
+
default: _(() => {
|
|
523
523
|
var m;
|
|
524
524
|
return [
|
|
525
|
-
u(
|
|
526
|
-
modelValue:
|
|
527
|
-
"onUpdate:modelValue": e[0] || (e[0] = (o) =>
|
|
528
|
-
placeholder:
|
|
529
|
-
label:
|
|
525
|
+
u(l, {
|
|
526
|
+
modelValue: Q.value,
|
|
527
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => Q.value = o),
|
|
528
|
+
placeholder: t(p)("report.section.filter.displayName"),
|
|
529
|
+
label: t(p)("report.section.filter.displayName"),
|
|
530
530
|
class: "mb-2"
|
|
531
531
|
}, null, 8, ["modelValue", "placeholder", "label"]),
|
|
532
|
-
u(
|
|
532
|
+
u(ol, {
|
|
533
533
|
"model-value": T.value,
|
|
534
534
|
items: fe.value,
|
|
535
|
-
placeholder:
|
|
536
|
-
label:
|
|
535
|
+
placeholder: t(p)("report.section.schema.title"),
|
|
536
|
+
label: t(p)("report.section.schema.title"),
|
|
537
537
|
"onUpdate:modelValue": e[1] || (e[1] = (o) => be(o))
|
|
538
538
|
}, null, 8, ["model-value", "items", "placeholder", "label"]),
|
|
539
|
-
u(
|
|
540
|
-
"model-value":
|
|
539
|
+
u(ol, {
|
|
540
|
+
"model-value": F.value,
|
|
541
541
|
items: ge.value,
|
|
542
|
-
placeholder:
|
|
543
|
-
label:
|
|
542
|
+
placeholder: t(p)("report.section.dimension.title"),
|
|
543
|
+
label: t(p)("report.section.dimension.title"),
|
|
544
544
|
"onUpdate:modelValue": e[2] || (e[2] = (o) => Fe(o))
|
|
545
545
|
}, null, 8, ["model-value", "items", "placeholder", "label"]),
|
|
546
|
-
((m =
|
|
546
|
+
((m = F.value) == null ? void 0 : m.type) === t(te).Timestamp ? (c(), x(s, {
|
|
547
547
|
key: 0,
|
|
548
|
-
modelValue:
|
|
549
|
-
"onUpdate:modelValue": e[3] || (e[3] = (o) =>
|
|
548
|
+
modelValue: O.value,
|
|
549
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => O.value = o),
|
|
550
550
|
items: Ne.value,
|
|
551
|
-
placeholder:
|
|
552
|
-
label:
|
|
553
|
-
}, null, 8, ["modelValue", "items", "placeholder", "label"])) :
|
|
554
|
-
|
|
551
|
+
placeholder: t(p)("report.section.filter.timeFormatter"),
|
|
552
|
+
label: t(p)("report.section.filter.timeFormatter")
|
|
553
|
+
}, null, 8, ["modelValue", "items", "placeholder", "label"])) : D("", !0),
|
|
554
|
+
w.value ? (c(), x(y, {
|
|
555
555
|
key: 1,
|
|
556
556
|
modelValue: a.value,
|
|
557
557
|
"onUpdate:modelValue": e[4] || (e[4] = (o) => a.value = o),
|
|
558
|
-
label:
|
|
558
|
+
label: t(p)("report.section.filter.customOptions"),
|
|
559
559
|
value: !0
|
|
560
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
561
|
-
|
|
562
|
-
|
|
560
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0),
|
|
561
|
+
w.value && a.value ? (c(), R("div", dt, [
|
|
562
|
+
K.value ? (c(!0), R(he, { key: 0 }, Ee(k.value, (o, r) => (c(), R("div", {
|
|
563
563
|
key: `custom-time-range-${r}`,
|
|
564
564
|
class: "flex flex-col gap-2"
|
|
565
565
|
}, [
|
|
566
|
-
v("div",
|
|
567
|
-
u(
|
|
566
|
+
v("div", mt, [
|
|
567
|
+
u(l, {
|
|
568
568
|
modelValue: o.name,
|
|
569
569
|
"onUpdate:modelValue": (f) => o.name = f,
|
|
570
|
-
label:
|
|
570
|
+
label: t(p)("report.section.filter.label")
|
|
571
571
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "label"]),
|
|
572
|
-
u(
|
|
573
|
-
"model-value":
|
|
574
|
-
label:
|
|
575
|
-
"onUpdate:modelValue": (f) =>
|
|
572
|
+
u(V, {
|
|
573
|
+
"model-value": A(o.startTime),
|
|
574
|
+
label: t(p)("report.date.startingTime"),
|
|
575
|
+
"onUpdate:modelValue": (f) => _e(r, "startTime", f)
|
|
576
576
|
}, null, 8, ["model-value", "label", "onUpdate:modelValue"]),
|
|
577
|
-
u(
|
|
578
|
-
"model-value":
|
|
579
|
-
label:
|
|
580
|
-
"onUpdate:modelValue": (f) =>
|
|
577
|
+
u(V, {
|
|
578
|
+
"model-value": A(o.endTime),
|
|
579
|
+
label: t(p)("report.date.endingTime"),
|
|
580
|
+
"onUpdate:modelValue": (f) => _e(r, "endTime", f)
|
|
581
581
|
}, null, 8, ["model-value", "label", "onUpdate:modelValue"]),
|
|
582
|
-
k.value.length > 1 ? (c(),
|
|
582
|
+
k.value.length > 1 ? (c(), R("div", ct, [
|
|
583
583
|
u($, {
|
|
584
584
|
icon: "delete",
|
|
585
585
|
variant: "tertiary",
|
|
586
|
-
onClick: (f) =>
|
|
586
|
+
onClick: (f) => ee(r)
|
|
587
587
|
}, null, 8, ["onClick"])
|
|
588
|
-
])) :
|
|
588
|
+
])) : D("", !0)
|
|
589
589
|
])
|
|
590
|
-
]))), 128)) : (c(),
|
|
591
|
-
v("p",
|
|
592
|
-
|
|
590
|
+
]))), 128)) : (c(), R(he, { key: 1 }, [
|
|
591
|
+
v("p", pt, U(t(p)("report.section.filter.operator")), 1),
|
|
592
|
+
re.value.length > 0 ? (c(), x(ol, {
|
|
593
593
|
key: 0,
|
|
594
|
-
"model-value":
|
|
595
|
-
items:
|
|
596
|
-
placeholder:
|
|
597
|
-
"onUpdate:modelValue": e[5] || (e[5] = (o) =>
|
|
598
|
-
}, null, 8, ["model-value", "items", "placeholder"])) :
|
|
599
|
-
(c(!0),
|
|
594
|
+
"model-value": j.value,
|
|
595
|
+
items: re.value,
|
|
596
|
+
placeholder: t(p)("report.section.filter.operator"),
|
|
597
|
+
"onUpdate:modelValue": e[5] || (e[5] = (o) => H(o))
|
|
598
|
+
}, null, 8, ["model-value", "items", "placeholder"])) : D("", !0),
|
|
599
|
+
(c(!0), R(he, null, Ee(S.value, (o, r) => (c(), R("div", {
|
|
600
600
|
key: `custom-option-${r}`,
|
|
601
601
|
class: "flex flex-col gap-2"
|
|
602
602
|
}, [
|
|
603
603
|
v("div", {
|
|
604
604
|
class: Le(["grid grid-cols-1 gap-2 p-2 sm:items-end text-fm-color-typo-primary fm-typo-en-body-lg-600 border-neutral-300 rounded-md border", "sm:grid-cols-[1fr_1.6fr_auto]"])
|
|
605
605
|
}, [
|
|
606
|
-
v("span",
|
|
607
|
-
u(
|
|
606
|
+
v("span", vt, U(t(p)("report.section.filter.label")), 1),
|
|
607
|
+
u(l, {
|
|
608
608
|
modelValue: o.label,
|
|
609
609
|
"onUpdate:modelValue": (f) => o.label = f
|
|
610
610
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
611
|
-
(c(), x(
|
|
612
|
-
key: `custom-option-value-${r}-${o.operator ?? ""}-${
|
|
611
|
+
(c(), x(Nl, {
|
|
612
|
+
key: `custom-option-value-${r}-${o.operator ?? ""}-${O.value ?? ""}`,
|
|
613
613
|
modelValue: o.values,
|
|
614
614
|
"onUpdate:modelValue": (f) => o.values = f,
|
|
615
|
-
config:
|
|
616
|
-
option:
|
|
615
|
+
config: ne(o.operator),
|
|
616
|
+
option: O.value
|
|
617
617
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "config", "option"])),
|
|
618
|
-
S.value.length > 1 ? (c(),
|
|
618
|
+
S.value.length > 1 ? (c(), R("div", ft, [
|
|
619
619
|
u($, {
|
|
620
620
|
icon: "delete",
|
|
621
621
|
variant: "tertiary",
|
|
622
|
-
onClick: (f) =>
|
|
622
|
+
onClick: (f) => Se(r)
|
|
623
623
|
}, null, 8, ["onClick"])
|
|
624
|
-
])) :
|
|
624
|
+
])) : D("", !0)
|
|
625
625
|
])
|
|
626
626
|
]))), 128))
|
|
627
627
|
], 64)),
|
|
@@ -630,65 +630,65 @@ const nl = /* @__PURE__ */ we({
|
|
|
630
630
|
variant: "primary",
|
|
631
631
|
icon: "add",
|
|
632
632
|
"icon-position": "prepend",
|
|
633
|
-
onClick: e[6] || (e[6] = (o) =>
|
|
633
|
+
onClick: e[6] || (e[6] = (o) => K.value ? J() : ce())
|
|
634
634
|
})
|
|
635
|
-
])) :
|
|
636
|
-
u(
|
|
637
|
-
modelValue:
|
|
638
|
-
"onUpdate:modelValue": e[7] || (e[7] = (o) =>
|
|
635
|
+
])) : D("", !0),
|
|
636
|
+
u(Bl, {
|
|
637
|
+
modelValue: q.value,
|
|
638
|
+
"onUpdate:modelValue": e[7] || (e[7] = (o) => q.value = o),
|
|
639
639
|
options: Me.value
|
|
640
640
|
}, null, 8, ["modelValue", "options"]),
|
|
641
|
-
u(
|
|
642
|
-
default:
|
|
643
|
-
Ae(U(
|
|
641
|
+
u(M, { class: "mt-2 fm-typo-en-body-lg-600" }, {
|
|
642
|
+
default: _(() => [
|
|
643
|
+
Ae(U(t(p)("report.section.filter.applyWidget")), 1)
|
|
644
644
|
]),
|
|
645
645
|
_: 1
|
|
646
646
|
}),
|
|
647
|
-
|
|
648
|
-
(c(!0),
|
|
647
|
+
z.tiles.length > 0 ? (c(), R("div", gt, [
|
|
648
|
+
(c(!0), R(he, null, Ee(Be.value, (o) => (c(), R("div", {
|
|
649
649
|
key: o.value,
|
|
650
650
|
class: "flex items-center"
|
|
651
651
|
}, [
|
|
652
652
|
u(y, {
|
|
653
|
-
modelValue:
|
|
654
|
-
"onUpdate:modelValue": e[8] || (e[8] = (r) =>
|
|
653
|
+
modelValue: X.value,
|
|
654
|
+
"onUpdate:modelValue": e[8] || (e[8] = (r) => X.value = r),
|
|
655
655
|
label: o.label,
|
|
656
656
|
value: o.value
|
|
657
657
|
}, null, 8, ["modelValue", "label", "value"]),
|
|
658
|
-
Re(o) ? (c(), x(
|
|
658
|
+
Re(o) ? (c(), x(I, {
|
|
659
659
|
key: 0,
|
|
660
660
|
content: Re(o) ?? void 0,
|
|
661
661
|
"z-index": 99,
|
|
662
662
|
class: "ml-2"
|
|
663
663
|
}, {
|
|
664
|
-
default:
|
|
664
|
+
default: _(() => [
|
|
665
665
|
u(G, {
|
|
666
666
|
name: "warning",
|
|
667
667
|
class: "text-fm-color-system-error-300"
|
|
668
668
|
})
|
|
669
669
|
]),
|
|
670
670
|
_: 2
|
|
671
|
-
}, 1032, ["content"])) :
|
|
671
|
+
}, 1032, ["content"])) : D("", !0)
|
|
672
672
|
]))), 128))
|
|
673
|
-
])) : (c(), x(
|
|
673
|
+
])) : (c(), x(M, {
|
|
674
674
|
key: 4,
|
|
675
675
|
class: "fm-typo-en-body-lg-400",
|
|
676
|
-
label:
|
|
676
|
+
label: t(p)("report.section.filter.noWidget")
|
|
677
677
|
}, null, 8, ["label"]))
|
|
678
678
|
];
|
|
679
679
|
}),
|
|
680
680
|
_: 1
|
|
681
681
|
}, 512)
|
|
682
682
|
]),
|
|
683
|
-
"dialog-footer":
|
|
683
|
+
"dialog-footer": _(() => [
|
|
684
684
|
e[10] || (e[10] = v("div", { class: "grow" }, null, -1)),
|
|
685
685
|
u($, {
|
|
686
|
-
label:
|
|
686
|
+
label: t(p)("report.common.cancel"),
|
|
687
687
|
variant: "tertiary",
|
|
688
|
-
onClick:
|
|
688
|
+
onClick: le
|
|
689
689
|
}, null, 8, ["label"]),
|
|
690
690
|
u($, {
|
|
691
|
-
label:
|
|
691
|
+
label: t(p)("report.common.confirm"),
|
|
692
692
|
onClick: Ve
|
|
693
693
|
}, null, 8, ["label"])
|
|
694
694
|
]),
|
|
@@ -696,14 +696,14 @@ const nl = /* @__PURE__ */ we({
|
|
|
696
696
|
}, 8, ["modelValue"]);
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
}),
|
|
699
|
+
}), yt = 8.4375, ht = 1024 ** 4, wt = {
|
|
700
700
|
MY: { rate: 4, currency: "MYR", symbol: "RM" },
|
|
701
701
|
TH: { rate: 33, currency: "THB", symbol: "฿" },
|
|
702
702
|
SG: { rate: 1.29, currency: "SGD", symbol: "S$" },
|
|
703
703
|
ID: { rate: 17900, currency: "IDR", symbol: "Rp" }
|
|
704
|
-
},
|
|
705
|
-
function
|
|
706
|
-
const d =
|
|
704
|
+
}, _t = { rate: 1, currency: "USD", symbol: "$" };
|
|
705
|
+
function pl(z, p) {
|
|
706
|
+
const d = z / ht * yt, { rate: b, currency: i, symbol: h } = wt[p] ?? _t;
|
|
707
707
|
return {
|
|
708
708
|
amount: d * b,
|
|
709
709
|
currency: i,
|
|
@@ -711,142 +711,142 @@ function pt(R, p) {
|
|
|
711
711
|
costUsd: d
|
|
712
712
|
};
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return
|
|
714
|
+
function vl(z, p) {
|
|
715
|
+
return z < 0.01 ? `< ${p}0.01` : `${p}${z.toFixed(2)}`;
|
|
716
716
|
}
|
|
717
|
-
const
|
|
717
|
+
const Ft = { class: "flex flex-col gap-16" }, Vt = {
|
|
718
718
|
key: 0,
|
|
719
719
|
class: "flex flex-col gap-8"
|
|
720
|
-
},
|
|
720
|
+
}, xt = { class: "flex items-center gap-4 pb-8 border-b border-neutral-300" }, Ct = ["title"], kt = { class: "fm-typo-en-title-sm-600 pt-8" }, Tt = { class: "mx-16 flex flex-col gap-12 py-4" }, St = { class: "fm-typo-en-body-lg-600" }, $t = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Dt = { class: "flex flex-col gap-12 border-t border-neutral-200 pt-12" }, Ot = { class: "fm-typo-en-body-lg-600" }, It = { class: "grid grid-cols-2 items-end gap-12" }, Ut = { class: "flex flex-col gap-8 min-w-0" }, Nt = { class: "fm-typo-en-body-sm-600 whitespace-nowrap" }, Bt = { class: "flex gap-8" }, Mt = { class: "grid grid-cols-2 items-end gap-12" }, Rt = { class: "flex flex-col gap-8 min-w-0" }, zt = { class: "fm-typo-en-body-sm-600 whitespace-nowrap" }, Pt = { class: "flex gap-8" }, qt = {
|
|
721
721
|
key: 1,
|
|
722
722
|
class: "rounded-md border border-dashed border-neutral-300 p-12 text-center fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
723
|
-
},
|
|
723
|
+
}, Et = ["onClick"], Lt = ["title"], Gt = {
|
|
724
724
|
key: 0,
|
|
725
725
|
class: "text-fm-color-typo-secondary"
|
|
726
|
-
},
|
|
726
|
+
}, Wt = { class: "text-fm-color-system-error-300" }, At = { class: "w-full text-left" }, Ht = /* @__PURE__ */ we({
|
|
727
727
|
__name: "TileDrillPanel",
|
|
728
728
|
props: {
|
|
729
729
|
report: {}
|
|
730
730
|
},
|
|
731
731
|
emits: ["add-widget"],
|
|
732
|
-
setup(
|
|
733
|
-
const d =
|
|
732
|
+
setup(z, { emit: p }) {
|
|
733
|
+
const d = z, b = p, { t: i, te: h } = Ge(), P = [
|
|
734
734
|
{ label: i("report.tile.widget.icon.small"), value: Je.Small },
|
|
735
735
|
{ label: i("report.tile.widget.icon.medium"), value: Je.Medium },
|
|
736
736
|
{ label: i("report.tile.widget.icon.large"), value: Je.Large },
|
|
737
737
|
{ label: i("report.tile.widget.icon.extraLarge"), value: Je.ExtraLarge }
|
|
738
|
-
],
|
|
739
|
-
{ label: i("report.tile.widget.icon.material"), value:
|
|
740
|
-
{ label: i("report.tile.widget.icon.customSvg"), value:
|
|
741
|
-
], T =
|
|
738
|
+
], Q = [
|
|
739
|
+
{ label: i("report.tile.widget.icon.material"), value: Oe.Material },
|
|
740
|
+
{ label: i("report.tile.widget.icon.customSvg"), value: Oe.Custom }
|
|
741
|
+
], T = sl(), F = ul(), { promptMessage: O } = dl(), X = il(), q = g(() => {
|
|
742
742
|
const e = [];
|
|
743
|
-
let
|
|
743
|
+
let l = d.report.tiles;
|
|
744
744
|
for (const s of De.value) {
|
|
745
|
-
const y =
|
|
745
|
+
const y = l.find((V) => V.id === s);
|
|
746
746
|
if (!y) break;
|
|
747
|
-
e.push(y),
|
|
747
|
+
e.push(y), l = y.tiles ?? [];
|
|
748
748
|
}
|
|
749
749
|
return e;
|
|
750
750
|
});
|
|
751
|
-
|
|
752
|
-
e.length !== De.value.length && (De.value = e.map((
|
|
751
|
+
ve(q, (e) => {
|
|
752
|
+
e.length !== De.value.length && (De.value = e.map((l) => l.id));
|
|
753
753
|
});
|
|
754
|
-
const a = g(() =>
|
|
754
|
+
const a = g(() => q.value[q.value.length - 1] ?? null), S = g(() => q.value[q.value.length - 2] ?? null), k = g(
|
|
755
755
|
() => a.value ? a.value.tiles ?? [] : d.report.tiles
|
|
756
|
-
),
|
|
756
|
+
), j = g(() => {
|
|
757
757
|
var e;
|
|
758
758
|
return ((e = a.value) == null ? void 0 : e.id) ?? null;
|
|
759
|
-
}),
|
|
759
|
+
}), ae = g(() => q.value.length === 0), de = g(() => a.value ? Pe(a.value) : !1), A = g(
|
|
760
760
|
() => S.value ? Pe(S.value) : !1
|
|
761
|
-
),
|
|
762
|
-
() =>
|
|
763
|
-
(e,
|
|
761
|
+
), ie = g(() => a.value ? pe(a.value) : !1), w = g(
|
|
762
|
+
() => q.value.reduce(
|
|
763
|
+
(e, l) => Pe(l) ? e : pe(l) ? 1 : e + 1,
|
|
764
764
|
1
|
|
765
765
|
)
|
|
766
|
-
),
|
|
767
|
-
function
|
|
768
|
-
e.widget && !
|
|
766
|
+
), K = g(() => !de.value && w.value < _l), re = g(() => ae.value);
|
|
767
|
+
function Z(e) {
|
|
768
|
+
e.widget && !pe(e) || (De.value = [...De.value, e.id]);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ne() {
|
|
771
771
|
De.value = De.value.slice(0, -1);
|
|
772
772
|
}
|
|
773
773
|
function se(e) {
|
|
774
774
|
if (!e) return "";
|
|
775
|
-
const
|
|
776
|
-
return h(
|
|
775
|
+
const l = `report.widget.types.${e.toLowerCase()}`;
|
|
776
|
+
return h(l) ? i(l) : He(i, h, e, "other");
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function me(e, l) {
|
|
779
779
|
if (e.widget) {
|
|
780
|
-
const s = e.widget.title ? se(e.widget.title) : i("report.editor.widget", { index:
|
|
781
|
-
return
|
|
780
|
+
const s = e.widget.title ? se(e.widget.title) : i("report.editor.widget", { index: l + 1 });
|
|
781
|
+
return pe(e) ? `${s} · ${i("report.editor.page")}` : s;
|
|
782
782
|
}
|
|
783
|
-
return e.tabTitle !== void 0 ? e.tabTitle || i("report.editor.tab", { index:
|
|
783
|
+
return e.tabTitle !== void 0 ? e.tabTitle || i("report.editor.tab", { index: l + 1 }) : e.title ? e.title : Pe(e) ? i("report.editor.tabGroup") : i("report.editor.group");
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return !e.widget &&
|
|
785
|
+
function ue(e, l) {
|
|
786
|
+
return !e.widget && de.value ? e.tabTitle || i("report.editor.tab", { index: l + 1 }) : me(e, l);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
var
|
|
790
|
-
return ((
|
|
788
|
+
function N(e) {
|
|
789
|
+
var l;
|
|
790
|
+
return ((l = e.tiles) == null ? void 0 : l.length) ?? 0;
|
|
791
791
|
}
|
|
792
|
-
const
|
|
793
|
-
() =>
|
|
792
|
+
const E = g(
|
|
793
|
+
() => q.value.map((e, l) => me(e, l)).join(" › ")
|
|
794
794
|
);
|
|
795
|
-
function
|
|
796
|
-
|
|
795
|
+
function H(e, l) {
|
|
796
|
+
wl.value = j.value, X.editingTileIndex = l, X.editingTile = JSON.parse(JSON.stringify(e)), T.push({ name: "tileEditor", query: F.query });
|
|
797
797
|
}
|
|
798
|
-
function
|
|
799
|
-
k.value.splice(
|
|
798
|
+
function ce(e, l) {
|
|
799
|
+
k.value.splice(l + 1, 0, zl(e));
|
|
800
800
|
}
|
|
801
|
-
async function
|
|
802
|
-
var
|
|
803
|
-
if (!await
|
|
801
|
+
async function Se(e, l) {
|
|
802
|
+
var V;
|
|
803
|
+
if (!await O({
|
|
804
804
|
title: i("report.editor.deleteWidget"),
|
|
805
|
-
message: i("report.editor.deleteWidgetConfirm", { title:
|
|
805
|
+
message: i("report.editor.deleteWidgetConfirm", { title: ue(e, l) })
|
|
806
806
|
})) return;
|
|
807
|
-
const y =
|
|
808
|
-
k.value.splice(
|
|
809
|
-
var
|
|
810
|
-
$.tileIds = (
|
|
807
|
+
const y = el(e);
|
|
808
|
+
k.value.splice(l, 1), (V = d.report.globalFilters) == null || V.forEach(($) => {
|
|
809
|
+
var M;
|
|
810
|
+
$.tileIds = (M = $.tileIds) == null ? void 0 : M.filter((G) => !y.includes(G));
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
a.value && (a.value.tiles || (a.value.tiles = []), a.value.tiles.push(
|
|
813
|
+
function J() {
|
|
814
|
+
a.value && (a.value.tiles || (a.value.tiles = []), a.value.tiles.push(Pl(a.value.tiles.length + 1)));
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
816
|
+
function ee(e) {
|
|
817
|
+
ql(e);
|
|
818
818
|
}
|
|
819
|
-
async function
|
|
820
|
-
var
|
|
821
|
-
if (!await
|
|
819
|
+
async function _e(e, l) {
|
|
820
|
+
var V;
|
|
821
|
+
if (!await O({
|
|
822
822
|
title: i("report.editor.removePage"),
|
|
823
|
-
message: i("report.editor.removePageConfirm", { title:
|
|
823
|
+
message: i("report.editor.removePageConfirm", { title: ue(e, l) })
|
|
824
824
|
})) return;
|
|
825
|
-
const y =
|
|
826
|
-
(
|
|
827
|
-
var
|
|
828
|
-
$.tileIds = (
|
|
829
|
-
}),
|
|
825
|
+
const y = el(e).filter(($) => $ !== e.id);
|
|
826
|
+
(V = d.report.globalFilters) == null || V.forEach(($) => {
|
|
827
|
+
var M;
|
|
828
|
+
$.tileIds = (M = $.tileIds) == null ? void 0 : M.filter((G) => !y.includes(G));
|
|
829
|
+
}), El(e);
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
k.value.push(
|
|
831
|
+
function Ie() {
|
|
832
|
+
k.value.push(Ll());
|
|
833
833
|
}
|
|
834
834
|
function Ue() {
|
|
835
|
-
k.value.push(
|
|
835
|
+
k.value.push(Gl());
|
|
836
836
|
}
|
|
837
837
|
function fe(e) {
|
|
838
838
|
var s;
|
|
839
|
-
const
|
|
840
|
-
e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(
|
|
839
|
+
const l = Number((s = e.size) == null ? void 0 : s.width);
|
|
840
|
+
e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(l) || l < 1 ? e.size.width = 1 : l > 12 && (e.size.width = 12);
|
|
841
841
|
}
|
|
842
842
|
function ge(e) {
|
|
843
843
|
var s;
|
|
844
|
-
const
|
|
845
|
-
e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(
|
|
844
|
+
const l = Number((s = e.size) == null ? void 0 : s.height);
|
|
845
|
+
e.size || (e.size = { width: 12, height: 12 }), !Number.isFinite(l) || l < 1 ? e.size.height = 1 : l > 12 && (e.size.height = 12);
|
|
846
846
|
}
|
|
847
|
-
function Ne(e,
|
|
848
|
-
const s = Number(e[
|
|
849
|
-
!Number.isFinite(s) || s < 1 ? e[
|
|
847
|
+
function Ne(e, l) {
|
|
848
|
+
const s = Number(e[l]);
|
|
849
|
+
!Number.isFinite(s) || s < 1 ? e[l] = 1 : s > 24 && (e[l] = 24);
|
|
850
850
|
}
|
|
851
851
|
const Be = g({
|
|
852
852
|
get: () => {
|
|
@@ -866,164 +866,164 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
866
866
|
}
|
|
867
867
|
}), be = g({
|
|
868
868
|
get: () => {
|
|
869
|
-
var e,
|
|
870
|
-
return ((e = a.value) == null ? void 0 : e.tabIconType) ?? ((s = (
|
|
869
|
+
var e, l, s;
|
|
870
|
+
return ((e = a.value) == null ? void 0 : e.tabIconType) ?? ((s = (l = a.value) == null ? void 0 : l.tabIcon) != null && s.trim().startsWith("<svg") ? Oe.Custom : Oe.Material);
|
|
871
871
|
},
|
|
872
872
|
set: (e) => {
|
|
873
873
|
a.value && (a.value.tabIconType = e);
|
|
874
874
|
}
|
|
875
875
|
}), Fe = g({
|
|
876
876
|
get: () => {
|
|
877
|
-
var e,
|
|
878
|
-
return be.value ===
|
|
877
|
+
var e, l;
|
|
878
|
+
return be.value === Oe.Custom ? Yl(((e = a.value) == null ? void 0 : e.tabIcon) ?? "") : ((l = a.value) == null ? void 0 : l.tabIcon) ?? "";
|
|
879
879
|
},
|
|
880
880
|
set: (e) => {
|
|
881
|
-
a.value && (a.value.tabIcon = be.value ===
|
|
881
|
+
a.value && (a.value.tabIcon = be.value === Oe.Custom ? Xl(e) : e.trim());
|
|
882
882
|
}
|
|
883
|
-
}), ye =
|
|
883
|
+
}), ye = L(!1), Ve = L(null), le = L([]);
|
|
884
884
|
function $e(e) {
|
|
885
|
-
const
|
|
885
|
+
const l = [
|
|
886
886
|
{ parentId: null, label: i("report.editor.topLevel"), level: 1 }
|
|
887
|
-
], s = (
|
|
887
|
+
], s = (V, $, M) => {
|
|
888
888
|
let G = 0;
|
|
889
|
-
|
|
890
|
-
var
|
|
891
|
-
if (
|
|
892
|
-
if (
|
|
893
|
-
const Y = `${
|
|
894
|
-
|
|
889
|
+
V.forEach((I) => {
|
|
890
|
+
var oe;
|
|
891
|
+
if (I.widget) {
|
|
892
|
+
if (pe(I)) {
|
|
893
|
+
const Y = `${M}${I.tabTitle || se(I.widget.title)} · ${i("report.editor.page")}`;
|
|
894
|
+
l.push({ parentId: I.id, label: Y, level: 1 }), s(I.tiles ?? [], 1, `${Y} › `);
|
|
895
895
|
}
|
|
896
896
|
return;
|
|
897
897
|
}
|
|
898
|
-
if (Pe(
|
|
899
|
-
const Y = `${
|
|
900
|
-
(
|
|
898
|
+
if (Pe(I)) {
|
|
899
|
+
const Y = `${M}${i("report.editor.tabGroup")}`;
|
|
900
|
+
(oe = I.tiles) == null || oe.forEach((m, o) => {
|
|
901
901
|
const r = `${Y} › ${m.tabTitle || i("report.editor.tab", { index: o + 1 })}`;
|
|
902
|
-
|
|
902
|
+
l.push({ parentId: m.id, label: r, level: $ + 1 }), s(m.tiles ?? [], $ + 1, `${r} › `);
|
|
903
903
|
});
|
|
904
904
|
} else {
|
|
905
905
|
G += 1;
|
|
906
|
-
const Y = `${
|
|
907
|
-
|
|
906
|
+
const Y = `${M}${I.title || `${i("report.editor.group")} ${G}`}`;
|
|
907
|
+
l.push({ parentId: I.id, label: Y, level: $ + 1 }), s(I.tiles ?? [], $ + 1, `${Y} › `);
|
|
908
908
|
}
|
|
909
909
|
});
|
|
910
910
|
};
|
|
911
911
|
s(d.report.tiles, 1, "");
|
|
912
|
-
const y = new Set(
|
|
913
|
-
return
|
|
914
|
-
(
|
|
912
|
+
const y = new Set(el(e));
|
|
913
|
+
return l.filter(
|
|
914
|
+
(V) => V.parentId !== j.value && !(V.parentId && y.has(V.parentId)) && Al(e, V.level)
|
|
915
915
|
);
|
|
916
916
|
}
|
|
917
917
|
function Re(e) {
|
|
918
|
-
Ve.value = e,
|
|
918
|
+
Ve.value = e, le.value = $e(e), ye.value = !0;
|
|
919
919
|
}
|
|
920
920
|
function n(e) {
|
|
921
|
-
const
|
|
922
|
-
if (!
|
|
923
|
-
const s = k.value.indexOf(
|
|
924
|
-
s >= 0 && k.value.splice(s, 1),
|
|
921
|
+
const l = Ve.value;
|
|
922
|
+
if (!l) return;
|
|
923
|
+
const s = k.value.indexOf(l);
|
|
924
|
+
s >= 0 && k.value.splice(s, 1), Wl(d.report.tiles, e.parentId).push(l), ye.value = !1, Ve.value = null;
|
|
925
925
|
}
|
|
926
|
-
return (e,
|
|
927
|
-
const s = C("FmButton"), y = C("FmTextField"),
|
|
928
|
-
return c(),
|
|
929
|
-
|
|
930
|
-
v("div",
|
|
926
|
+
return (e, l) => {
|
|
927
|
+
const s = C("FmButton"), y = C("FmTextField"), V = C("FmSelect"), $ = C("FmTextarea"), M = C("FmStepperField"), G = C("FmIcon"), I = C("FmMenuItem"), oe = C("FmMenu"), Y = C("FmList"), m = C("FmListItem"), o = C("FmDialog");
|
|
928
|
+
return c(), R("div", Ft, [
|
|
929
|
+
ae.value ? D("", !0) : (c(), R("div", Vt, [
|
|
930
|
+
v("div", xt, [
|
|
931
931
|
u(s, {
|
|
932
932
|
icon: "arrow_back",
|
|
933
933
|
variant: "tertiary",
|
|
934
934
|
class: "-ml-8",
|
|
935
|
-
onClick:
|
|
935
|
+
onClick: ne
|
|
936
936
|
}),
|
|
937
937
|
v("p", {
|
|
938
938
|
class: "fm-typo-en-body-md-600 line-clamp-1 overflow-hidden break-all min-w-0 grow text-left",
|
|
939
|
-
title:
|
|
940
|
-
}, U(
|
|
939
|
+
title: E.value
|
|
940
|
+
}, U(E.value), 9, Ct)
|
|
941
941
|
]),
|
|
942
|
-
|
|
942
|
+
ie.value && a.value ? (c(), x(y, {
|
|
943
943
|
key: 0,
|
|
944
944
|
modelValue: a.value.tabTitle,
|
|
945
|
-
"onUpdate:modelValue":
|
|
946
|
-
label:
|
|
947
|
-
placeholder:
|
|
948
|
-
}, null, 8, ["modelValue", "label", "placeholder"])) :
|
|
949
|
-
|
|
945
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => a.value.tabTitle = r),
|
|
946
|
+
label: t(i)("report.editor.pageName"),
|
|
947
|
+
placeholder: t(i)("report.editor.pageName")
|
|
948
|
+
}, null, 8, ["modelValue", "label", "placeholder"])) : D("", !0),
|
|
949
|
+
A.value && a.value ? (c(), x(y, {
|
|
950
950
|
key: 1,
|
|
951
951
|
modelValue: a.value.tabTitle,
|
|
952
|
-
"onUpdate:modelValue":
|
|
953
|
-
label:
|
|
954
|
-
placeholder:
|
|
955
|
-
}, null, 8, ["modelValue", "label", "placeholder"])) :
|
|
956
|
-
|
|
952
|
+
"onUpdate:modelValue": l[1] || (l[1] = (r) => a.value.tabTitle = r),
|
|
953
|
+
label: t(i)("report.editor.tabName"),
|
|
954
|
+
placeholder: t(i)("report.editor.tabName")
|
|
955
|
+
}, null, 8, ["modelValue", "label", "placeholder"])) : D("", !0),
|
|
956
|
+
A.value && a.value ? (c(), x(V, {
|
|
957
957
|
key: 2,
|
|
958
958
|
modelValue: be.value,
|
|
959
|
-
"onUpdate:modelValue":
|
|
960
|
-
label:
|
|
961
|
-
items:
|
|
962
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
963
|
-
|
|
959
|
+
"onUpdate:modelValue": l[2] || (l[2] = (r) => be.value = r),
|
|
960
|
+
label: t(i)("report.tile.widget.icon.type"),
|
|
961
|
+
items: Q
|
|
962
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0),
|
|
963
|
+
A.value && a.value && be.value === t(Oe).Material ? (c(), x(y, {
|
|
964
964
|
key: 3,
|
|
965
965
|
modelValue: Fe.value,
|
|
966
|
-
"onUpdate:modelValue":
|
|
967
|
-
label:
|
|
968
|
-
placeholder:
|
|
969
|
-
}, null, 8, ["modelValue", "label", "placeholder"])) :
|
|
966
|
+
"onUpdate:modelValue": l[3] || (l[3] = (r) => Fe.value = r),
|
|
967
|
+
label: t(i)("report.tile.widget.icon.materialName"),
|
|
968
|
+
placeholder: t(i)("report.tile.widget.icon.materialPlaceholder")
|
|
969
|
+
}, null, 8, ["modelValue", "label", "placeholder"])) : A.value && a.value ? (c(), x($, {
|
|
970
970
|
key: 4,
|
|
971
971
|
modelValue: Fe.value,
|
|
972
|
-
"onUpdate:modelValue":
|
|
973
|
-
label:
|
|
974
|
-
placeholder:
|
|
975
|
-
}, null, 8, ["modelValue", "label", "placeholder"])) :
|
|
976
|
-
|
|
972
|
+
"onUpdate:modelValue": l[4] || (l[4] = (r) => Fe.value = r),
|
|
973
|
+
label: t(i)("report.tile.widget.icon.customSvg"),
|
|
974
|
+
placeholder: t(i)("report.tile.widget.icon.customPlaceholder")
|
|
975
|
+
}, null, 8, ["modelValue", "label", "placeholder"])) : D("", !0),
|
|
976
|
+
A.value && a.value ? (c(), x(V, {
|
|
977
977
|
key: 5,
|
|
978
978
|
modelValue: a.value.tabIconSize,
|
|
979
|
-
"onUpdate:modelValue":
|
|
980
|
-
label:
|
|
981
|
-
items:
|
|
982
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
983
|
-
!
|
|
979
|
+
"onUpdate:modelValue": l[5] || (l[5] = (r) => a.value.tabIconSize = r),
|
|
980
|
+
label: t(i)("report.tile.widget.icon.size"),
|
|
981
|
+
items: P
|
|
982
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0),
|
|
983
|
+
!A.value && !ie.value && a.value ? (c(), x(We, {
|
|
984
984
|
key: 6,
|
|
985
985
|
"is-open": !1
|
|
986
986
|
}, {
|
|
987
|
-
header:
|
|
988
|
-
v("p",
|
|
989
|
-
|
|
987
|
+
header: _(() => [
|
|
988
|
+
v("p", kt, U(t(i)("report.editor.groupDetails")), 1),
|
|
989
|
+
l[24] || (l[24] = v("div", { class: "grow" }, null, -1))
|
|
990
990
|
]),
|
|
991
|
-
content:
|
|
992
|
-
v("div",
|
|
991
|
+
content: _(() => [
|
|
992
|
+
v("div", Tt, [
|
|
993
993
|
u(y, {
|
|
994
994
|
modelValue: a.value.title,
|
|
995
|
-
"onUpdate:modelValue":
|
|
996
|
-
label:
|
|
997
|
-
placeholder:
|
|
995
|
+
"onUpdate:modelValue": l[6] || (l[6] = (r) => a.value.title = r),
|
|
996
|
+
label: t(i)("report.editor.groupTitle"),
|
|
997
|
+
placeholder: t(i)("report.editor.groupTitlePlaceholder")
|
|
998
998
|
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
999
999
|
u($, {
|
|
1000
1000
|
modelValue: a.value.description,
|
|
1001
|
-
"onUpdate:modelValue":
|
|
1002
|
-
placeholder:
|
|
1001
|
+
"onUpdate:modelValue": l[7] || (l[7] = (r) => a.value.description = r),
|
|
1002
|
+
placeholder: t(i)("report.editor.groupDescriptionPlaceholder")
|
|
1003
1003
|
}, {
|
|
1004
|
-
label:
|
|
1005
|
-
v("p",
|
|
1006
|
-
v("p", $
|
|
1004
|
+
label: _(() => [
|
|
1005
|
+
v("p", St, U(t(i)("report.editor.groupDescription")), 1),
|
|
1006
|
+
v("p", $t, " (" + U(t(i)("report.editor.optional")) + ") ", 1)
|
|
1007
1007
|
]),
|
|
1008
1008
|
_: 1
|
|
1009
1009
|
}, 8, ["modelValue", "placeholder"]),
|
|
1010
|
-
v("div",
|
|
1011
|
-
v("p",
|
|
1012
|
-
v("div",
|
|
1013
|
-
u(
|
|
1010
|
+
v("div", Dt, [
|
|
1011
|
+
v("p", Ot, U(t(i)("report.editor.typography")), 1),
|
|
1012
|
+
v("div", It, [
|
|
1013
|
+
u(M, {
|
|
1014
1014
|
modelValue: Be.value,
|
|
1015
|
-
"onUpdate:modelValue":
|
|
1015
|
+
"onUpdate:modelValue": l[8] || (l[8] = (r) => Be.value = r),
|
|
1016
1016
|
modelModifiers: { number: !0 },
|
|
1017
1017
|
class: "w-full",
|
|
1018
|
-
label:
|
|
1018
|
+
label: t(i)("report.editor.titleSize"),
|
|
1019
1019
|
max: 24,
|
|
1020
1020
|
min: 1,
|
|
1021
1021
|
type: "number",
|
|
1022
|
-
onBlur:
|
|
1022
|
+
onBlur: l[9] || (l[9] = (r) => Ne(a.value, "titleFontSize"))
|
|
1023
1023
|
}, null, 8, ["modelValue", "label"]),
|
|
1024
|
-
v("div",
|
|
1025
|
-
v("p",
|
|
1026
|
-
v("div",
|
|
1024
|
+
v("div", Ut, [
|
|
1025
|
+
v("p", Nt, U(t(i)("report.editor.titleFormatting")), 1),
|
|
1026
|
+
v("div", Bt, [
|
|
1027
1027
|
u(s, {
|
|
1028
1028
|
"append-icon": "format_bold",
|
|
1029
1029
|
"model-value": a.value.titleBold ?? !0,
|
|
@@ -1031,8 +1031,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1031
1031
|
"icon-color": a.value.titleBold ?? !0 ? "neutral-gray-400" : "neutral-gray-300",
|
|
1032
1032
|
"bg-color": a.value.titleBold ?? !0 ? "neutral-gray-100" : "neutral-white",
|
|
1033
1033
|
class: "rounded-sm",
|
|
1034
|
-
title:
|
|
1035
|
-
onClick:
|
|
1034
|
+
title: t(i)("report.editor.bold"),
|
|
1035
|
+
onClick: l[10] || (l[10] = (r) => a.value.titleBold = !(a.value.titleBold ?? !0))
|
|
1036
1036
|
}, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
|
|
1037
1037
|
u(s, {
|
|
1038
1038
|
"append-icon": "format_italic",
|
|
@@ -1041,8 +1041,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1041
1041
|
"icon-color": a.value.titleItalic ? "neutral-gray-400" : "neutral-gray-300",
|
|
1042
1042
|
"bg-color": a.value.titleItalic ? "neutral-gray-100" : "neutral-white",
|
|
1043
1043
|
class: "rounded-sm",
|
|
1044
|
-
title:
|
|
1045
|
-
onClick:
|
|
1044
|
+
title: t(i)("report.editor.italic"),
|
|
1045
|
+
onClick: l[11] || (l[11] = (r) => a.value.titleItalic = !a.value.titleItalic)
|
|
1046
1046
|
}, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
|
|
1047
1047
|
u(s, {
|
|
1048
1048
|
"append-icon": "format_underlined",
|
|
@@ -1051,27 +1051,27 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1051
1051
|
"icon-color": a.value.titleUnderline ? "neutral-gray-400" : "neutral-gray-300",
|
|
1052
1052
|
"bg-color": a.value.titleUnderline ? "neutral-gray-100" : "neutral-white",
|
|
1053
1053
|
class: "rounded-sm",
|
|
1054
|
-
title:
|
|
1055
|
-
onClick:
|
|
1054
|
+
title: t(i)("report.editor.underline"),
|
|
1055
|
+
onClick: l[12] || (l[12] = (r) => a.value.titleUnderline = !a.value.titleUnderline)
|
|
1056
1056
|
}, null, 8, ["model-value", "icon-color", "bg-color", "title"])
|
|
1057
1057
|
])
|
|
1058
1058
|
])
|
|
1059
1059
|
]),
|
|
1060
|
-
v("div",
|
|
1061
|
-
u(
|
|
1060
|
+
v("div", Mt, [
|
|
1061
|
+
u(M, {
|
|
1062
1062
|
modelValue: Me.value,
|
|
1063
|
-
"onUpdate:modelValue":
|
|
1063
|
+
"onUpdate:modelValue": l[13] || (l[13] = (r) => Me.value = r),
|
|
1064
1064
|
modelModifiers: { number: !0 },
|
|
1065
1065
|
class: "w-full",
|
|
1066
|
-
label:
|
|
1066
|
+
label: t(i)("report.editor.descriptionSize"),
|
|
1067
1067
|
max: 24,
|
|
1068
1068
|
min: 1,
|
|
1069
1069
|
type: "number",
|
|
1070
|
-
onBlur:
|
|
1070
|
+
onBlur: l[14] || (l[14] = (r) => Ne(a.value, "descriptionFontSize"))
|
|
1071
1071
|
}, null, 8, ["modelValue", "label"]),
|
|
1072
|
-
v("div",
|
|
1073
|
-
v("p",
|
|
1074
|
-
v("div",
|
|
1072
|
+
v("div", Rt, [
|
|
1073
|
+
v("p", zt, U(t(i)("report.editor.descriptionFormatting")), 1),
|
|
1074
|
+
v("div", Pt, [
|
|
1075
1075
|
u(s, {
|
|
1076
1076
|
"append-icon": "format_bold",
|
|
1077
1077
|
"model-value": a.value.descriptionBold ?? !1,
|
|
@@ -1079,8 +1079,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1079
1079
|
"icon-color": a.value.descriptionBold ? "neutral-gray-400" : "neutral-gray-300",
|
|
1080
1080
|
"bg-color": a.value.descriptionBold ? "neutral-gray-100" : "neutral-white",
|
|
1081
1081
|
class: "rounded-sm",
|
|
1082
|
-
title:
|
|
1083
|
-
onClick:
|
|
1082
|
+
title: t(i)("report.editor.bold"),
|
|
1083
|
+
onClick: l[15] || (l[15] = (r) => a.value.descriptionBold = !a.value.descriptionBold)
|
|
1084
1084
|
}, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
|
|
1085
1085
|
u(s, {
|
|
1086
1086
|
"append-icon": "format_italic",
|
|
@@ -1089,8 +1089,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1089
1089
|
"icon-color": a.value.descriptionItalic ? "neutral-gray-400" : "neutral-gray-300",
|
|
1090
1090
|
"bg-color": a.value.descriptionItalic ? "neutral-gray-100" : "neutral-white",
|
|
1091
1091
|
class: "rounded-sm",
|
|
1092
|
-
title:
|
|
1093
|
-
onClick:
|
|
1092
|
+
title: t(i)("report.editor.italic"),
|
|
1093
|
+
onClick: l[16] || (l[16] = (r) => a.value.descriptionItalic = !a.value.descriptionItalic)
|
|
1094
1094
|
}, null, 8, ["model-value", "icon-color", "bg-color", "title"]),
|
|
1095
1095
|
u(s, {
|
|
1096
1096
|
"append-icon": "format_underlined",
|
|
@@ -1099,8 +1099,8 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1099
1099
|
"icon-color": a.value.descriptionUnderline ? "neutral-gray-400" : "neutral-gray-300",
|
|
1100
1100
|
"bg-color": a.value.descriptionUnderline ? "neutral-gray-100" : "neutral-white",
|
|
1101
1101
|
class: "rounded-sm",
|
|
1102
|
-
title:
|
|
1103
|
-
onClick:
|
|
1102
|
+
title: t(i)("report.editor.underline"),
|
|
1103
|
+
onClick: l[17] || (l[17] = (r) => a.value.descriptionUnderline = !a.value.descriptionUnderline)
|
|
1104
1104
|
}, null, 8, ["model-value", "icon-color", "bg-color", "title"])
|
|
1105
1105
|
])
|
|
1106
1106
|
])
|
|
@@ -1109,38 +1109,38 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1109
1109
|
])
|
|
1110
1110
|
]),
|
|
1111
1111
|
_: 1
|
|
1112
|
-
})) :
|
|
1113
|
-
!
|
|
1112
|
+
})) : D("", !0),
|
|
1113
|
+
!A.value && a.value ? (c(), x(y, {
|
|
1114
1114
|
key: 7,
|
|
1115
1115
|
modelValue: a.value.size.width,
|
|
1116
|
-
"onUpdate:modelValue":
|
|
1116
|
+
"onUpdate:modelValue": l[18] || (l[18] = (r) => a.value.size.width = r),
|
|
1117
1117
|
modelModifiers: { number: !0 },
|
|
1118
1118
|
type: "number",
|
|
1119
|
-
label:
|
|
1120
|
-
onBlur:
|
|
1121
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
1122
|
-
!
|
|
1119
|
+
label: t(i)("report.editor.width"),
|
|
1120
|
+
onBlur: l[19] || (l[19] = (r) => fe(a.value))
|
|
1121
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0),
|
|
1122
|
+
!A.value && a.value ? (c(), x(y, {
|
|
1123
1123
|
key: 8,
|
|
1124
1124
|
modelValue: a.value.size.height,
|
|
1125
|
-
"onUpdate:modelValue":
|
|
1125
|
+
"onUpdate:modelValue": l[20] || (l[20] = (r) => a.value.size.height = r),
|
|
1126
1126
|
modelModifiers: { number: !0 },
|
|
1127
1127
|
type: "number",
|
|
1128
|
-
label:
|
|
1129
|
-
onBlur:
|
|
1130
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
1128
|
+
label: t(i)("report.editor.height"),
|
|
1129
|
+
onBlur: l[21] || (l[21] = (r) => ge(a.value))
|
|
1130
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0)
|
|
1131
1131
|
])),
|
|
1132
|
-
k.value.length === 0 ? (c(),
|
|
1133
|
-
default:
|
|
1134
|
-
u(
|
|
1132
|
+
k.value.length === 0 ? (c(), R("div", qt, U(t(i)("report.editor.emptyLevel")), 1)) : (c(), x(Y, { key: 2 }, {
|
|
1133
|
+
default: _(() => [
|
|
1134
|
+
u(t(hl), {
|
|
1135
1135
|
list: k.value,
|
|
1136
1136
|
"item-key": "id",
|
|
1137
1137
|
class: "flex flex-col gap-2 cursor-grab",
|
|
1138
1138
|
handle: ".handle"
|
|
1139
1139
|
}, {
|
|
1140
|
-
item:
|
|
1140
|
+
item: _(({ element: r, index: f }) => [
|
|
1141
1141
|
v("div", {
|
|
1142
|
-
class: Le(["flex items-center gap-8 px-12 py-8 border rounded-md border-neutral-300 hover:bg-fm-color-opacity-sm", r.widget && !
|
|
1143
|
-
onClick: (
|
|
1142
|
+
class: Le(["flex items-center gap-8 px-12 py-8 border rounded-md border-neutral-300 hover:bg-fm-color-opacity-sm", r.widget && !t(pe)(r) ? "cursor-grab" : "cursor-pointer"]),
|
|
1143
|
+
onClick: (W) => Z(r)
|
|
1144
1144
|
}, [
|
|
1145
1145
|
u(G, {
|
|
1146
1146
|
name: "drag_handle",
|
|
@@ -1148,132 +1148,132 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1148
1148
|
}),
|
|
1149
1149
|
v("p", {
|
|
1150
1150
|
class: "flex-1 min-w-0 truncate text-left fm-typo-en-body-lg-400",
|
|
1151
|
-
title:
|
|
1151
|
+
title: ue(r, f)
|
|
1152
1152
|
}, [
|
|
1153
|
-
Ae(U(
|
|
1154
|
-
!r.widget ||
|
|
1155
|
-
], 8,
|
|
1156
|
-
!r.widget ||
|
|
1153
|
+
Ae(U(ue(r, f)) + " ", 1),
|
|
1154
|
+
!r.widget || t(pe)(r) ? (c(), R("span", Gt, " · " + U(N(r)), 1)) : D("", !0)
|
|
1155
|
+
], 8, Lt),
|
|
1156
|
+
!r.widget || t(pe)(r) ? (c(), x(G, {
|
|
1157
1157
|
key: 0,
|
|
1158
1158
|
name: "chevron_right",
|
|
1159
1159
|
class: "shrink-0"
|
|
1160
|
-
})) :
|
|
1161
|
-
u(
|
|
1160
|
+
})) : D("", !0),
|
|
1161
|
+
u(oe, {
|
|
1162
1162
|
trigger: "click",
|
|
1163
1163
|
shift: !0,
|
|
1164
1164
|
"stop-click-propagation": !0,
|
|
1165
1165
|
class: "shrink-0"
|
|
1166
1166
|
}, {
|
|
1167
|
-
"menu-button":
|
|
1167
|
+
"menu-button": _(() => [
|
|
1168
1168
|
u(s, {
|
|
1169
1169
|
"append-icon": "more_vert",
|
|
1170
1170
|
variant: "tertiary"
|
|
1171
1171
|
})
|
|
1172
1172
|
]),
|
|
1173
|
-
default:
|
|
1174
|
-
r.widget ? (c(), x(
|
|
1173
|
+
default: _(() => [
|
|
1174
|
+
r.widget ? (c(), x(I, {
|
|
1175
1175
|
key: 0,
|
|
1176
|
-
label:
|
|
1177
|
-
onClick: (
|
|
1178
|
-
}, null, 8, ["label", "onClick"])) :
|
|
1179
|
-
r.widget && !
|
|
1176
|
+
label: t(i)("report.common.edit"),
|
|
1177
|
+
onClick: (W) => H(r, f)
|
|
1178
|
+
}, null, 8, ["label", "onClick"])) : D("", !0),
|
|
1179
|
+
r.widget && !t(pe)(r) ? (c(), x(I, {
|
|
1180
1180
|
key: 1,
|
|
1181
|
-
label:
|
|
1182
|
-
onClick: (
|
|
1183
|
-
}, null, 8, ["label", "onClick"])) :
|
|
1184
|
-
|
|
1181
|
+
label: t(i)("report.editor.convertToPage"),
|
|
1182
|
+
onClick: (W) => ee(r)
|
|
1183
|
+
}, null, 8, ["label", "onClick"])) : D("", !0),
|
|
1184
|
+
t(pe)(r) ? (c(), x(I, {
|
|
1185
1185
|
key: 2,
|
|
1186
|
-
label:
|
|
1187
|
-
onClick: (
|
|
1188
|
-
}, null, 8, ["label", "onClick"])) :
|
|
1189
|
-
|
|
1186
|
+
label: t(i)("report.editor.removePage"),
|
|
1187
|
+
onClick: (W) => _e(r, f)
|
|
1188
|
+
}, null, 8, ["label", "onClick"])) : D("", !0),
|
|
1189
|
+
t(Pe)(r) ? D("", !0) : (c(), x(I, {
|
|
1190
1190
|
key: 3,
|
|
1191
|
-
label:
|
|
1192
|
-
onClick: (
|
|
1191
|
+
label: t(i)("report.editor.moveTo"),
|
|
1192
|
+
onClick: (W) => Re(r)
|
|
1193
1193
|
}, null, 8, ["label", "onClick"])),
|
|
1194
|
-
u(
|
|
1195
|
-
label:
|
|
1196
|
-
onClick: (
|
|
1194
|
+
u(I, {
|
|
1195
|
+
label: t(i)("report.common.duplicate"),
|
|
1196
|
+
onClick: (W) => ce(r, f)
|
|
1197
1197
|
}, null, 8, ["label", "onClick"]),
|
|
1198
|
-
u(
|
|
1199
|
-
onClick: (
|
|
1198
|
+
u(I, {
|
|
1199
|
+
onClick: (W) => Se(r, f)
|
|
1200
1200
|
}, {
|
|
1201
|
-
label:
|
|
1202
|
-
v("p",
|
|
1201
|
+
label: _(() => [
|
|
1202
|
+
v("p", Wt, U(t(i)("report.common.remove")), 1)
|
|
1203
1203
|
]),
|
|
1204
1204
|
_: 2
|
|
1205
1205
|
}, 1032, ["onClick"])
|
|
1206
1206
|
]),
|
|
1207
1207
|
_: 2
|
|
1208
1208
|
}, 1024)
|
|
1209
|
-
], 10,
|
|
1209
|
+
], 10, Et)
|
|
1210
1210
|
]),
|
|
1211
1211
|
_: 1
|
|
1212
1212
|
}, 8, ["list"])
|
|
1213
1213
|
]),
|
|
1214
1214
|
_: 1
|
|
1215
1215
|
})),
|
|
1216
|
-
|
|
1216
|
+
de.value ? (c(), x(s, {
|
|
1217
1217
|
key: 3,
|
|
1218
|
-
label:
|
|
1218
|
+
label: t(i)("report.editor.addTab"),
|
|
1219
1219
|
variant: "secondary",
|
|
1220
1220
|
icon: "add",
|
|
1221
1221
|
"icon-position": "prepend",
|
|
1222
|
-
"border-color":
|
|
1223
|
-
"text-color":
|
|
1224
|
-
onClick:
|
|
1225
|
-
}, null, 8, ["label", "border-color", "text-color"])) : (c(), x(
|
|
1222
|
+
"border-color": t(Ce).ColorPrimary,
|
|
1223
|
+
"text-color": t(Ce).ColorPrimary,
|
|
1224
|
+
onClick: J
|
|
1225
|
+
}, null, 8, ["label", "border-color", "text-color"])) : (c(), x(oe, {
|
|
1226
1226
|
key: 4,
|
|
1227
1227
|
trigger: "click",
|
|
1228
1228
|
shift: !0
|
|
1229
1229
|
}, {
|
|
1230
|
-
"menu-button":
|
|
1230
|
+
"menu-button": _(() => [
|
|
1231
1231
|
u(s, {
|
|
1232
|
-
label:
|
|
1232
|
+
label: t(i)("report.common.add"),
|
|
1233
1233
|
variant: "secondary",
|
|
1234
1234
|
icon: "add",
|
|
1235
1235
|
"icon-position": "prepend",
|
|
1236
1236
|
class: "w-full",
|
|
1237
|
-
"border-color":
|
|
1238
|
-
"text-color":
|
|
1237
|
+
"border-color": t(Ce).ColorPrimary,
|
|
1238
|
+
"text-color": t(Ce).ColorPrimary
|
|
1239
1239
|
}, null, 8, ["label", "border-color", "text-color"])
|
|
1240
1240
|
]),
|
|
1241
|
-
default:
|
|
1242
|
-
u(
|
|
1243
|
-
label:
|
|
1244
|
-
onClick:
|
|
1241
|
+
default: _(() => [
|
|
1242
|
+
u(I, {
|
|
1243
|
+
label: t(i)("report.editor.addWidget"),
|
|
1244
|
+
onClick: l[22] || (l[22] = (r) => b("add-widget", j.value))
|
|
1245
1245
|
}, null, 8, ["label"]),
|
|
1246
|
-
|
|
1246
|
+
K.value ? (c(), x(I, {
|
|
1247
1247
|
key: 0,
|
|
1248
|
-
label:
|
|
1249
|
-
onClick:
|
|
1250
|
-
}, null, 8, ["label"])) :
|
|
1251
|
-
|
|
1248
|
+
label: t(i)("report.editor.addGroup"),
|
|
1249
|
+
onClick: Ie
|
|
1250
|
+
}, null, 8, ["label"])) : D("", !0),
|
|
1251
|
+
re.value ? (c(), x(I, {
|
|
1252
1252
|
key: 1,
|
|
1253
|
-
label:
|
|
1253
|
+
label: t(i)("report.editor.addTabGroup"),
|
|
1254
1254
|
onClick: Ue
|
|
1255
|
-
}, null, 8, ["label"])) :
|
|
1255
|
+
}, null, 8, ["label"])) : D("", !0)
|
|
1256
1256
|
]),
|
|
1257
1257
|
_: 1
|
|
1258
1258
|
})),
|
|
1259
1259
|
u(o, {
|
|
1260
1260
|
modelValue: ye.value,
|
|
1261
|
-
"onUpdate:modelValue":
|
|
1261
|
+
"onUpdate:modelValue": l[23] || (l[23] = (r) => ye.value = r),
|
|
1262
1262
|
overlay: !0,
|
|
1263
1263
|
"z-index": 10
|
|
1264
1264
|
}, {
|
|
1265
|
-
"dialog-header":
|
|
1266
|
-
Ae(U(
|
|
1265
|
+
"dialog-header": _(() => [
|
|
1266
|
+
Ae(U(t(i)("report.editor.moveTo")), 1)
|
|
1267
1267
|
]),
|
|
1268
|
-
default:
|
|
1268
|
+
default: _(() => [
|
|
1269
1269
|
u(Y, null, {
|
|
1270
|
-
default:
|
|
1271
|
-
(c(!0),
|
|
1270
|
+
default: _(() => [
|
|
1271
|
+
(c(!0), R(he, null, Ee(le.value, (r) => (c(), x(m, {
|
|
1272
1272
|
key: r.parentId ?? "root",
|
|
1273
1273
|
onClick: (f) => n(r)
|
|
1274
1274
|
}, {
|
|
1275
|
-
default:
|
|
1276
|
-
v("p",
|
|
1275
|
+
default: _(() => [
|
|
1276
|
+
v("p", At, U(r.label), 1)
|
|
1277
1277
|
]),
|
|
1278
1278
|
_: 2
|
|
1279
1279
|
}, 1032, ["onClick"]))), 128))
|
|
@@ -1286,67 +1286,72 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1286
1286
|
]);
|
|
1287
1287
|
};
|
|
1288
1288
|
}
|
|
1289
|
-
}),
|
|
1289
|
+
}), jt = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Jt = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Qt = { class: "flex items-center gap-8" }, Kt = {
|
|
1290
1290
|
key: 2,
|
|
1291
1291
|
class: "flex flex-col gap-8 rounded-md border border-fm-color-border px-16 py-12"
|
|
1292
|
-
},
|
|
1292
|
+
}, Yt = { class: "fm-typo-en-body-sm-400" }, Xt = { class: "fm-typo-en-body-sm-400 font-bold" }, Zt = { class: "space-y-1 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, eo = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, lo = { class: "flex items-center gap-1 max-w-[195px] w-[195px]" }, to = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, fl = /* @__PURE__ */ we({
|
|
1293
1293
|
__name: "ReportEditorTab",
|
|
1294
1294
|
props: /* @__PURE__ */ ke({
|
|
1295
1295
|
hideConfiguration: {
|
|
1296
1296
|
type: Boolean,
|
|
1297
1297
|
default: !1
|
|
1298
|
+
},
|
|
1299
|
+
// general report: only the query version and datasource may change
|
|
1300
|
+
readOnly: {
|
|
1301
|
+
type: Boolean,
|
|
1302
|
+
default: !1
|
|
1298
1303
|
}
|
|
1299
1304
|
}, {
|
|
1300
1305
|
modelValue: { required: !0 },
|
|
1301
1306
|
modelModifiers: {}
|
|
1302
1307
|
}),
|
|
1303
1308
|
emits: /* @__PURE__ */ ke(["hideConfiguration"], ["update:modelValue"]),
|
|
1304
|
-
setup(
|
|
1305
|
-
const d = Te(
|
|
1306
|
-
currentSelectWidgetType:
|
|
1307
|
-
categories:
|
|
1308
|
-
editingTile:
|
|
1309
|
-
editingTileIndex:
|
|
1309
|
+
setup(z, { emit: p }) {
|
|
1310
|
+
const d = Te(z, "modelValue"), { breakpoints: b } = Ke(), i = z, h = p, P = sl(), Q = ul(), T = L(), {
|
|
1311
|
+
currentSelectWidgetType: F,
|
|
1312
|
+
categories: O,
|
|
1313
|
+
editingTile: X,
|
|
1314
|
+
editingTileIndex: q,
|
|
1310
1315
|
editingGlobalFilter: a,
|
|
1311
1316
|
editingGlobalFilterIndex: S
|
|
1312
|
-
} = qe(
|
|
1313
|
-
const m =
|
|
1314
|
-
var
|
|
1315
|
-
const r = o.widget.config.schemaNames ?? [], f = ((
|
|
1317
|
+
} = qe(il()), { schemas: k } = qe(Hl()), { globalFilters: j } = qe(ml()), { getGlobalFilterLabel: ae } = ml(), { promptMessage: de } = dl(), A = L(!1), ie = L(!1), { t: w, te: K, locale: re } = Ge(), Z = L(void 0), ne = g(() => {
|
|
1318
|
+
const m = ll(d.value.tiles).flatMap((o) => {
|
|
1319
|
+
var W;
|
|
1320
|
+
const r = o.widget.config.schemaNames ?? [], f = ((W = o.widget.config.joinDatasources) == null ? void 0 : W.flatMap((je) => je.schemaNames ?? [])) ?? [];
|
|
1316
1321
|
return [...r, ...f];
|
|
1317
1322
|
});
|
|
1318
1323
|
return [...new Set(m)].reduce((o, r) => {
|
|
1319
|
-
const f = k.value.find((
|
|
1324
|
+
const f = k.value.find((W) => W.name === r);
|
|
1320
1325
|
return f && o.push(f), o;
|
|
1321
1326
|
}, []);
|
|
1322
|
-
}), se =
|
|
1323
|
-
function
|
|
1324
|
-
se.value = m,
|
|
1327
|
+
}), se = L(null);
|
|
1328
|
+
function me(m) {
|
|
1329
|
+
se.value = m, ie.value = !0;
|
|
1325
1330
|
}
|
|
1326
|
-
|
|
1327
|
-
() =>
|
|
1331
|
+
ve(
|
|
1332
|
+
() => F.value,
|
|
1328
1333
|
() => {
|
|
1329
|
-
|
|
1334
|
+
F.value !== void 0 && (Z.value = Zl(F.value), X.value = Z.value, q.value = -1, wl.value = se.value, P.push({
|
|
1330
1335
|
name: "tileEditor",
|
|
1331
|
-
query:
|
|
1336
|
+
query: Q.query
|
|
1332
1337
|
}));
|
|
1333
1338
|
},
|
|
1334
1339
|
{ immediate: !0 }
|
|
1335
|
-
),
|
|
1340
|
+
), ve(
|
|
1336
1341
|
() => d.value.tiles,
|
|
1337
1342
|
(m) => {
|
|
1338
|
-
|
|
1343
|
+
jl(m);
|
|
1339
1344
|
},
|
|
1340
1345
|
{ immediate: !0, deep: !0 }
|
|
1341
1346
|
);
|
|
1342
|
-
const
|
|
1347
|
+
const ue = [
|
|
1343
1348
|
{
|
|
1344
1349
|
label: "report.common.edit",
|
|
1345
1350
|
selected: !1,
|
|
1346
1351
|
variant: "tertiary",
|
|
1347
1352
|
onClick: (m) => {
|
|
1348
1353
|
var o;
|
|
1349
|
-
S.value = m, a.value = JSON.parse(JSON.stringify((o = d.value.globalFilters) == null ? void 0 : o[m])),
|
|
1354
|
+
S.value = m, a.value = JSON.parse(JSON.stringify((o = d.value.globalFilters) == null ? void 0 : o[m])), A.value = !0;
|
|
1350
1355
|
}
|
|
1351
1356
|
},
|
|
1352
1357
|
{
|
|
@@ -1366,61 +1371,61 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1366
1371
|
selected: !1,
|
|
1367
1372
|
variant: "destructive",
|
|
1368
1373
|
onClick: async (m) => {
|
|
1369
|
-
var f,
|
|
1374
|
+
var f, W;
|
|
1370
1375
|
const o = (f = d.value.globalFilters) == null ? void 0 : f[m];
|
|
1371
1376
|
if (!o) return;
|
|
1372
|
-
await
|
|
1373
|
-
title:
|
|
1374
|
-
message:
|
|
1375
|
-
title:
|
|
1377
|
+
await de({
|
|
1378
|
+
title: w("report.editor.deleteWidget"),
|
|
1379
|
+
message: w("report.editor.deleteWidgetConfirm", {
|
|
1380
|
+
title: ae(o)
|
|
1376
1381
|
})
|
|
1377
|
-
}) && ((
|
|
1382
|
+
}) && ((W = d.value.globalFilters) == null || W.splice(m, 1));
|
|
1378
1383
|
}
|
|
1379
1384
|
}
|
|
1380
|
-
],
|
|
1381
|
-
label:
|
|
1385
|
+
], N = g(() => O.value.map((m) => ({
|
|
1386
|
+
label: w(`report.category.${m.name}`),
|
|
1382
1387
|
value: m.id
|
|
1383
|
-
}))), { sessionUser:
|
|
1388
|
+
}))), { sessionUser: E } = tt(), H = g(
|
|
1384
1389
|
() => {
|
|
1385
1390
|
var m, o, r, f;
|
|
1386
|
-
return ((o = (m =
|
|
1391
|
+
return ((o = (m = E.value) == null ? void 0 : m.role) == null ? void 0 : o.isAdmin) === !0 || ((f = (r = E.value) == null ? void 0 : r.role) == null ? void 0 : f.isStaff) === !0;
|
|
1387
1392
|
}
|
|
1388
|
-
),
|
|
1393
|
+
), ce = g({
|
|
1389
1394
|
get: () => d.value.queryVersion === "v2",
|
|
1390
1395
|
set: (m) => {
|
|
1391
|
-
d.value.queryVersion = m ? "v2" : "v1", m ? d.value.queryDatasource = d.value.queryDatasource ??
|
|
1396
|
+
d.value.queryVersion = m ? "v2" : "v1", m ? d.value.queryDatasource = d.value.queryDatasource ?? Qe.Postgres : d.value.queryDatasource = void 0;
|
|
1392
1397
|
}
|
|
1393
|
-
}),
|
|
1394
|
-
{ label:
|
|
1395
|
-
{ label:
|
|
1396
|
-
],
|
|
1397
|
-
{ label:
|
|
1398
|
-
{ label:
|
|
1399
|
-
{ label:
|
|
1400
|
-
],
|
|
1398
|
+
}), Se = [
|
|
1399
|
+
{ label: w("report.common.postgresql"), value: Qe.Postgres },
|
|
1400
|
+
{ label: w("report.common.bigquery"), value: Qe.BigQuery }
|
|
1401
|
+
], J = [
|
|
1402
|
+
{ label: w("report.common.noBatch"), value: "none" },
|
|
1403
|
+
{ label: w("report.common.days"), value: "days" },
|
|
1404
|
+
{ label: w("report.common.locations"), value: "locations" }
|
|
1405
|
+
], ee = g({
|
|
1401
1406
|
get: () => {
|
|
1402
1407
|
var m, o;
|
|
1403
1408
|
return (m = d.value.batch) != null && m.days ? "days" : (o = d.value.batch) != null && o.locations ? "locations" : "none";
|
|
1404
1409
|
},
|
|
1405
1410
|
set: (m) => {
|
|
1406
1411
|
var o, r;
|
|
1407
|
-
m === "none" ? d.value.batch = void 0 : m === "days" ? d.value.batch = { days: ((o = d.value.batch) == null ? void 0 : o.days) || 1 } : m === "locations" && (d.value.batch = { locations: ((r = d.value.batch) == null ? void 0 : r.locations) || 10 });
|
|
1412
|
+
m === "none" ? d.value.batch = i.readOnly ? null : void 0 : m === "days" ? d.value.batch = { days: ((o = d.value.batch) == null ? void 0 : o.days) || 1 } : m === "locations" && (d.value.batch = { locations: ((r = d.value.batch) == null ? void 0 : r.locations) || 10 });
|
|
1408
1413
|
}
|
|
1409
|
-
}),
|
|
1414
|
+
}), _e = g({
|
|
1410
1415
|
get: () => {
|
|
1411
1416
|
var m, o;
|
|
1412
|
-
if (
|
|
1413
|
-
if (
|
|
1417
|
+
if (ee.value === "days") return ((m = d.value.batch) == null ? void 0 : m.days) ?? 1;
|
|
1418
|
+
if (ee.value === "locations") return ((o = d.value.batch) == null ? void 0 : o.locations) ?? 1;
|
|
1414
1419
|
},
|
|
1415
1420
|
set: (m) => {
|
|
1416
|
-
m && (
|
|
1421
|
+
m && (ee.value === "days" ? d.value.batch = { days: m } : ee.value === "locations" && (d.value.batch = { locations: m }));
|
|
1417
1422
|
}
|
|
1418
|
-
}),
|
|
1419
|
-
get: () => He(
|
|
1423
|
+
}), Ie = g({
|
|
1424
|
+
get: () => He(w, K, d.value.name, "other"),
|
|
1420
1425
|
set: (m) => {
|
|
1421
1426
|
d.value.name = m;
|
|
1422
1427
|
}
|
|
1423
|
-
}), { country: Ue } = qe(
|
|
1428
|
+
}), { country: Ue } = qe(ot()), {
|
|
1424
1429
|
dateRange: fe,
|
|
1425
1430
|
compareDateRange: ge,
|
|
1426
1431
|
timeRange: Ne,
|
|
@@ -1428,9 +1433,9 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1428
1433
|
businessDataVersion: Me,
|
|
1429
1434
|
restaurants: be,
|
|
1430
1435
|
warehouses: Fe
|
|
1431
|
-
} = qe(
|
|
1432
|
-
() => d.value.queryVersion === "v2" && d.value.queryDatasource ===
|
|
1433
|
-
), Ve = g(() => ye.value &&
|
|
1436
|
+
} = qe(at()), ye = g(
|
|
1437
|
+
() => d.value.queryVersion === "v2" && d.value.queryDatasource === Qe.BigQuery
|
|
1438
|
+
), Ve = g(() => ye.value && H.value), le = L(null), $e = L(!1), Re = g(() => {
|
|
1434
1439
|
const m = fe.value.startDate ?? fe.value.endDate;
|
|
1435
1440
|
return m ? {
|
|
1436
1441
|
startDate: m,
|
|
@@ -1450,27 +1455,27 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1450
1455
|
return Math.max(1, Math.ceil(o / m.locations));
|
|
1451
1456
|
}
|
|
1452
1457
|
return 1;
|
|
1453
|
-
}),
|
|
1454
|
-
if (
|
|
1455
|
-
const m =
|
|
1456
|
-
return
|
|
1457
|
-
}), s = g(() =>
|
|
1458
|
+
}), l = g(() => {
|
|
1459
|
+
if (le.value == null || le.value === 0) return null;
|
|
1460
|
+
const m = le.value * e.value;
|
|
1461
|
+
return pl(m, Ue.value);
|
|
1462
|
+
}), s = g(() => le.value == null || le.value === 0 ? null : pl(le.value, Ue.value)), y = g(() => l.value ? vl(l.value.amount, l.value.symbol) : ""), V = g(() => s.value ? vl(s.value.amount, s.value.symbol) : ""), $ = g(() => e.value === 1 ? w("report.common.estimatedCostBatchSingular") : w("report.common.estimatedCostBatchPlural")), M = g(() => $e.value ? "..." : !y.value || !V.value ? "--" : w("report.common.estimatedCostFormula", {
|
|
1458
1463
|
batchCount: e.value,
|
|
1459
1464
|
batchLabel: $.value,
|
|
1460
|
-
baseCost:
|
|
1465
|
+
baseCost: V.value,
|
|
1461
1466
|
totalCost: y.value
|
|
1462
1467
|
}));
|
|
1463
1468
|
let G = [];
|
|
1464
|
-
const
|
|
1469
|
+
const I = rt(async () => {
|
|
1465
1470
|
if (!Ve.value) return;
|
|
1466
|
-
const m =
|
|
1471
|
+
const m = ll(d.value.tiles).filter(
|
|
1467
1472
|
(o) => {
|
|
1468
1473
|
var r;
|
|
1469
1474
|
return ((r = o.widget.config.schemaNames) == null ? void 0 : r.length) > 0;
|
|
1470
1475
|
}
|
|
1471
1476
|
);
|
|
1472
1477
|
if (m.length === 0) {
|
|
1473
|
-
|
|
1478
|
+
le.value = null;
|
|
1474
1479
|
return;
|
|
1475
1480
|
}
|
|
1476
1481
|
$e.value = !0, G.forEach((o) => o.abort()), G = [];
|
|
@@ -1478,7 +1483,7 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1478
1483
|
const o = await Promise.all(
|
|
1479
1484
|
m.map((r) => {
|
|
1480
1485
|
const f = new AbortController();
|
|
1481
|
-
return G.push(f),
|
|
1486
|
+
return G.push(f), lt({
|
|
1482
1487
|
widget: r.widget,
|
|
1483
1488
|
signal: f.signal,
|
|
1484
1489
|
tileId: r.id,
|
|
@@ -1487,14 +1492,14 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1487
1492
|
});
|
|
1488
1493
|
})
|
|
1489
1494
|
);
|
|
1490
|
-
|
|
1495
|
+
le.value = o.reduce((r, f) => r + (f.totalBytesProcessed ?? 0), 0);
|
|
1491
1496
|
} catch (o) {
|
|
1492
|
-
o.code !== "ERR_CANCELED" && (
|
|
1497
|
+
o.code !== "ERR_CANCELED" && (le.value = null);
|
|
1493
1498
|
} finally {
|
|
1494
1499
|
$e.value = !1;
|
|
1495
1500
|
}
|
|
1496
1501
|
}, 1e3);
|
|
1497
|
-
|
|
1502
|
+
ve(
|
|
1498
1503
|
[
|
|
1499
1504
|
() => d.value.tiles,
|
|
1500
1505
|
() => d.value.queryVersion,
|
|
@@ -1507,82 +1512,85 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1507
1512
|
() => Me.value
|
|
1508
1513
|
],
|
|
1509
1514
|
() => {
|
|
1510
|
-
|
|
1515
|
+
I();
|
|
1511
1516
|
},
|
|
1512
1517
|
{ deep: !0 }
|
|
1513
|
-
),
|
|
1514
|
-
|
|
1515
|
-
}),
|
|
1518
|
+
), bl(() => {
|
|
1519
|
+
I();
|
|
1520
|
+
}), Dl(() => {
|
|
1516
1521
|
G.forEach((m) => m.abort());
|
|
1517
1522
|
});
|
|
1518
|
-
function
|
|
1523
|
+
function oe(m) {
|
|
1519
1524
|
var o;
|
|
1520
1525
|
return !((o = m.tileIds) != null && o.length);
|
|
1521
1526
|
}
|
|
1522
1527
|
function Y(m) {
|
|
1523
|
-
return !
|
|
1528
|
+
return !ne.value.find((o) => o.name === m.schemaName);
|
|
1524
1529
|
}
|
|
1525
|
-
return
|
|
1530
|
+
return ve(
|
|
1526
1531
|
() => d.value.globalFilters,
|
|
1527
1532
|
(m) => {
|
|
1528
|
-
|
|
1533
|
+
j.value = JSON.parse(JSON.stringify(m || []));
|
|
1529
1534
|
},
|
|
1530
1535
|
{ deep: !0, immediate: !0 }
|
|
1531
1536
|
), (m, o) => {
|
|
1532
|
-
const r = C("FmTextField"), f = C("FmSelect"),
|
|
1533
|
-
return c(), x(
|
|
1537
|
+
const r = C("FmTextField"), f = C("FmSelect"), W = C("FmSwitch"), je = C("FmButton"), Ye = C("FmIcon"), Xe = C("FmTooltip"), Vl = C("FmMenuItem"), xl = C("FmMenu"), Cl = C("FmListItem"), kl = C("FmList"), Tl = C("FmForm");
|
|
1538
|
+
return c(), x(Ol(t(b).lg || t(b).md ? st : ut), {
|
|
1534
1539
|
"model-value": i.hideConfiguration,
|
|
1535
|
-
"onUpdate:modelValue": o[12] || (o[12] = (
|
|
1540
|
+
"onUpdate:modelValue": o[12] || (o[12] = (B) => h("hideConfiguration", B))
|
|
1536
1541
|
}, {
|
|
1537
|
-
default:
|
|
1538
|
-
u(
|
|
1539
|
-
"is-open":
|
|
1540
|
-
"onUpdate:isOpen": o[0] || (o[0] = (
|
|
1541
|
-
"global-filter":
|
|
1542
|
-
tiles:
|
|
1543
|
-
schemas:
|
|
1544
|
-
"onUpdate:globalFilter": o[1] || (o[1] = (
|
|
1545
|
-
|
|
1542
|
+
default: _(() => [
|
|
1543
|
+
u(bt, {
|
|
1544
|
+
"is-open": A.value,
|
|
1545
|
+
"onUpdate:isOpen": o[0] || (o[0] = (B) => A.value = B),
|
|
1546
|
+
"global-filter": t(a),
|
|
1547
|
+
tiles: t(ll)(d.value.tiles),
|
|
1548
|
+
schemas: ne.value,
|
|
1549
|
+
"onUpdate:globalFilter": o[1] || (o[1] = (B) => {
|
|
1550
|
+
B && (d.value.globalFilters || (d.value.globalFilters = []), typeof t(S) == "number" && t(S) >= 0 ? d.value.globalFilters[t(S)] = B : d.value.globalFilters.push(B));
|
|
1546
1551
|
})
|
|
1547
1552
|
}, null, 8, ["is-open", "global-filter", "tiles", "schemas"]),
|
|
1548
|
-
u(
|
|
1549
|
-
modelValue:
|
|
1550
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
1551
|
-
"is-open":
|
|
1552
|
-
"onUpdate:isOpen": o[3] || (o[3] = (
|
|
1553
|
+
u(nt, {
|
|
1554
|
+
modelValue: t(F),
|
|
1555
|
+
"onUpdate:modelValue": o[2] || (o[2] = (B) => yl(F) ? F.value = B : null),
|
|
1556
|
+
"is-open": ie.value,
|
|
1557
|
+
"onUpdate:isOpen": o[3] || (o[3] = (B) => ie.value = B)
|
|
1553
1558
|
}, null, 8, ["modelValue", "is-open"]),
|
|
1554
|
-
u(
|
|
1559
|
+
u(Tl, {
|
|
1555
1560
|
ref_key: "form",
|
|
1556
1561
|
ref: T,
|
|
1557
1562
|
class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
|
|
1558
1563
|
}, {
|
|
1559
|
-
default:
|
|
1564
|
+
default: _(() => [
|
|
1560
1565
|
u(We, { class: "border-solid" }, {
|
|
1561
|
-
header:
|
|
1562
|
-
v("p", null, U(
|
|
1566
|
+
header: _(() => [
|
|
1567
|
+
v("p", null, U(t(w)("report.editor.reportInfo")), 1),
|
|
1563
1568
|
o[13] || (o[13] = v("div", { class: "grow" }, null, -1))
|
|
1564
1569
|
]),
|
|
1565
|
-
content:
|
|
1566
|
-
v("div",
|
|
1570
|
+
content: _(() => [
|
|
1571
|
+
v("div", jt, [
|
|
1567
1572
|
u(r, {
|
|
1568
|
-
modelValue:
|
|
1569
|
-
"onUpdate:modelValue": o[4] || (o[4] = (
|
|
1570
|
-
label:
|
|
1571
|
-
placeholder:
|
|
1572
|
-
|
|
1573
|
+
modelValue: Ie.value,
|
|
1574
|
+
"onUpdate:modelValue": o[4] || (o[4] = (B) => Ie.value = B),
|
|
1575
|
+
label: t(w)("report.common.name"),
|
|
1576
|
+
placeholder: t(w)("report.common.name"),
|
|
1577
|
+
disabled: i.readOnly
|
|
1578
|
+
}, null, 8, ["modelValue", "label", "placeholder", "disabled"]),
|
|
1573
1579
|
(c(), x(f, {
|
|
1574
|
-
key: `category-${
|
|
1580
|
+
key: `category-${t(re)}`,
|
|
1575
1581
|
modelValue: d.value.category,
|
|
1576
|
-
"onUpdate:modelValue": o[5] || (o[5] = (
|
|
1577
|
-
label:
|
|
1578
|
-
items:
|
|
1579
|
-
|
|
1582
|
+
"onUpdate:modelValue": o[5] || (o[5] = (B) => d.value.category = B),
|
|
1583
|
+
label: t(w)("report.common.category"),
|
|
1584
|
+
items: N.value,
|
|
1585
|
+
disabled: i.readOnly
|
|
1586
|
+
}, null, 8, ["modelValue", "label", "items", "disabled"])),
|
|
1580
1587
|
u(r, {
|
|
1581
1588
|
modelValue: d.value.description,
|
|
1582
|
-
"onUpdate:modelValue": o[6] || (o[6] = (
|
|
1583
|
-
label:
|
|
1584
|
-
placeholder:
|
|
1585
|
-
|
|
1589
|
+
"onUpdate:modelValue": o[6] || (o[6] = (B) => d.value.description = B),
|
|
1590
|
+
label: t(w)("report.common.description"),
|
|
1591
|
+
placeholder: t(w)("report.common.description"),
|
|
1592
|
+
disabled: i.readOnly
|
|
1593
|
+
}, null, 8, ["modelValue", "label", "placeholder", "disabled"])
|
|
1586
1594
|
])
|
|
1587
1595
|
]),
|
|
1588
1596
|
_: 1
|
|
@@ -1591,149 +1599,150 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1591
1599
|
class: "border-solid",
|
|
1592
1600
|
"is-open": !1
|
|
1593
1601
|
}, {
|
|
1594
|
-
header:
|
|
1595
|
-
v("p", null, U(
|
|
1602
|
+
header: _(() => [
|
|
1603
|
+
v("p", null, U(t(w)("report.editor.advancedUsage")), 1),
|
|
1596
1604
|
o[14] || (o[14] = v("div", { class: "grow" }, null, -1))
|
|
1597
1605
|
]),
|
|
1598
|
-
content:
|
|
1599
|
-
v("div",
|
|
1600
|
-
v("div",
|
|
1606
|
+
content: _(() => [
|
|
1607
|
+
v("div", Jt, [
|
|
1608
|
+
v("div", Qt, [
|
|
1601
1609
|
o[15] || (o[15] = v("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, "V2", -1)),
|
|
1602
|
-
u(
|
|
1603
|
-
modelValue:
|
|
1604
|
-
"onUpdate:modelValue": o[7] || (o[7] = (
|
|
1610
|
+
u(W, {
|
|
1611
|
+
modelValue: ce.value,
|
|
1612
|
+
"onUpdate:modelValue": o[7] || (o[7] = (B) => ce.value = B)
|
|
1605
1613
|
}, null, 8, ["modelValue"])
|
|
1606
1614
|
]),
|
|
1607
|
-
|
|
1615
|
+
ce.value && H.value ? (c(), x(f, {
|
|
1608
1616
|
key: 0,
|
|
1609
1617
|
modelValue: d.value.queryDatasource,
|
|
1610
|
-
"onUpdate:modelValue": o[8] || (o[8] = (
|
|
1611
|
-
label:
|
|
1612
|
-
items:
|
|
1613
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
1618
|
+
"onUpdate:modelValue": o[8] || (o[8] = (B) => d.value.queryDatasource = B),
|
|
1619
|
+
label: t(w)("report.common.queryDatasource"),
|
|
1620
|
+
items: Se
|
|
1621
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0),
|
|
1614
1622
|
u(f, {
|
|
1615
|
-
modelValue:
|
|
1616
|
-
"onUpdate:modelValue": o[9] || (o[9] = (
|
|
1617
|
-
label:
|
|
1618
|
-
items:
|
|
1623
|
+
modelValue: ee.value,
|
|
1624
|
+
"onUpdate:modelValue": o[9] || (o[9] = (B) => ee.value = B),
|
|
1625
|
+
label: t(w)("report.common.batch"),
|
|
1626
|
+
items: J
|
|
1619
1627
|
}, null, 8, ["modelValue", "label"]),
|
|
1620
|
-
|
|
1628
|
+
ee.value !== "none" ? (c(), x(r, {
|
|
1621
1629
|
key: 1,
|
|
1622
|
-
modelValue:
|
|
1623
|
-
"onUpdate:modelValue": o[10] || (o[10] = (
|
|
1630
|
+
modelValue: _e.value,
|
|
1631
|
+
"onUpdate:modelValue": o[10] || (o[10] = (B) => _e.value = B),
|
|
1624
1632
|
modelModifiers: { number: !0 },
|
|
1625
|
-
label:
|
|
1633
|
+
label: ee.value === "days" ? t(w)("report.common.days") : t(w)("report.common.locations"),
|
|
1626
1634
|
type: "number"
|
|
1627
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
1628
|
-
Ve.value ? (c(),
|
|
1629
|
-
v("span",
|
|
1630
|
-
v("p",
|
|
1631
|
-
v("div",
|
|
1632
|
-
v("div", null, "* " + U(
|
|
1633
|
-
v("div", null, "* " + U(
|
|
1634
|
-
v("div", null, "* " + U(
|
|
1635
|
+
}, null, 8, ["modelValue", "label"])) : D("", !0),
|
|
1636
|
+
Ve.value ? (c(), R("div", Kt, [
|
|
1637
|
+
v("span", Yt, U(t(w)("report.common.estimatedBqCost")), 1),
|
|
1638
|
+
v("p", Xt, U(M.value), 1),
|
|
1639
|
+
v("div", Zt, [
|
|
1640
|
+
v("div", null, "* " + U(t(w)("report.common.estimatedCostGuidelineBigQuery")), 1),
|
|
1641
|
+
v("div", null, "* " + U(t(w)("report.common.estimatedCostGuidelineDateRange")), 1),
|
|
1642
|
+
v("div", null, "* " + U(t(w)("report.common.estimatedCostGuidelineLocationBatch")), 1)
|
|
1635
1643
|
])
|
|
1636
|
-
])) :
|
|
1644
|
+
])) : D("", !0)
|
|
1637
1645
|
])
|
|
1638
1646
|
]),
|
|
1639
1647
|
_: 1
|
|
1640
1648
|
}),
|
|
1641
|
-
|
|
1649
|
+
i.readOnly ? D("", !0) : (c(), x(We, {
|
|
1650
|
+
key: 0,
|
|
1642
1651
|
class: "border-solid",
|
|
1643
1652
|
"is-open": !1
|
|
1644
1653
|
}, {
|
|
1645
|
-
header:
|
|
1646
|
-
v("p", null, U(
|
|
1654
|
+
header: _(() => [
|
|
1655
|
+
v("p", null, U(t(w)("report.section.filter.globalFilter")), 1),
|
|
1647
1656
|
o[16] || (o[16] = v("div", { class: "grow" }, null, -1))
|
|
1648
1657
|
]),
|
|
1649
|
-
content:
|
|
1658
|
+
content: _(() => [
|
|
1650
1659
|
v("div", eo, [
|
|
1651
1660
|
u(je, {
|
|
1652
|
-
label:
|
|
1661
|
+
label: t(w)("report.section.filter.addGlobalFilter"),
|
|
1653
1662
|
variant: "secondary",
|
|
1654
1663
|
icon: "add",
|
|
1655
1664
|
"icon-position": "prepend",
|
|
1656
|
-
"border-color":
|
|
1657
|
-
"text-color":
|
|
1665
|
+
"border-color": t(Ce).ColorPrimary,
|
|
1666
|
+
"text-color": t(Ce).ColorPrimary,
|
|
1658
1667
|
onClick: o[11] || (o[11] = () => {
|
|
1659
|
-
S.value = null, a.value = null,
|
|
1668
|
+
S.value = null, a.value = null, A.value = !0;
|
|
1660
1669
|
})
|
|
1661
1670
|
}, null, 8, ["label", "border-color", "text-color"]),
|
|
1662
|
-
u(
|
|
1663
|
-
default:
|
|
1664
|
-
u(
|
|
1671
|
+
u(kl, null, {
|
|
1672
|
+
default: _(() => [
|
|
1673
|
+
u(t(hl), {
|
|
1665
1674
|
list: d.value.globalFilters,
|
|
1666
1675
|
"item-key": "`${element.schemaName}-${element.name}`",
|
|
1667
1676
|
class: "flex flex-col gap-2 cursor-grab",
|
|
1668
1677
|
handle: ".handle"
|
|
1669
1678
|
}, {
|
|
1670
|
-
item:
|
|
1671
|
-
u(
|
|
1672
|
-
default:
|
|
1679
|
+
item: _(({ element: B, index: Sl }) => [
|
|
1680
|
+
u(Cl, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
|
|
1681
|
+
default: _(() => [
|
|
1673
1682
|
u(Ye, {
|
|
1674
1683
|
name: "drag_handle",
|
|
1675
1684
|
class: "handle"
|
|
1676
1685
|
}),
|
|
1677
|
-
v("div",
|
|
1686
|
+
v("div", lo, [
|
|
1678
1687
|
u(Xe, {
|
|
1679
1688
|
"z-index": 99,
|
|
1680
|
-
content:
|
|
1689
|
+
content: t(ae)(B),
|
|
1681
1690
|
class: "handle"
|
|
1682
1691
|
}, {
|
|
1683
|
-
default:
|
|
1684
|
-
v("p",
|
|
1692
|
+
default: _(() => [
|
|
1693
|
+
v("p", to, U(t(ae)(B)), 1)
|
|
1685
1694
|
]),
|
|
1686
1695
|
_: 2
|
|
1687
1696
|
}, 1032, ["content"]),
|
|
1688
|
-
Y(
|
|
1697
|
+
Y(B) ? (c(), x(Xe, {
|
|
1689
1698
|
key: 0,
|
|
1690
|
-
content:
|
|
1699
|
+
content: t(w)("report.section.filter.missingSchema"),
|
|
1691
1700
|
"z-index": 99
|
|
1692
1701
|
}, {
|
|
1693
|
-
default:
|
|
1702
|
+
default: _(() => [
|
|
1694
1703
|
u(Ye, {
|
|
1695
1704
|
name: "warning",
|
|
1696
1705
|
class: "text-fm-color-system-error-300"
|
|
1697
1706
|
})
|
|
1698
1707
|
]),
|
|
1699
1708
|
_: 1
|
|
1700
|
-
}, 8, ["content"])) :
|
|
1709
|
+
}, 8, ["content"])) : oe(B) ? (c(), x(Xe, {
|
|
1701
1710
|
key: 1,
|
|
1702
|
-
content:
|
|
1711
|
+
content: t(w)("report.section.filter.missingTileIds"),
|
|
1703
1712
|
"z-index": 99
|
|
1704
1713
|
}, {
|
|
1705
|
-
default:
|
|
1714
|
+
default: _(() => [
|
|
1706
1715
|
u(Ye, {
|
|
1707
1716
|
name: "warning",
|
|
1708
1717
|
class: "text-fm-color-system-warning-300"
|
|
1709
1718
|
})
|
|
1710
1719
|
]),
|
|
1711
1720
|
_: 1
|
|
1712
|
-
}, 8, ["content"])) :
|
|
1721
|
+
}, 8, ["content"])) : D("", !0)
|
|
1713
1722
|
]),
|
|
1714
1723
|
o[17] || (o[17] = v("div", { class: "grow" }, null, -1)),
|
|
1715
|
-
u(
|
|
1724
|
+
u(xl, {
|
|
1716
1725
|
trigger: "click",
|
|
1717
1726
|
shift: !0,
|
|
1718
1727
|
"stop-click-propagation": !0
|
|
1719
1728
|
}, {
|
|
1720
|
-
"menu-button":
|
|
1729
|
+
"menu-button": _(() => [
|
|
1721
1730
|
u(je, {
|
|
1722
1731
|
"append-icon": "more_vert",
|
|
1723
1732
|
variant: "tertiary"
|
|
1724
1733
|
})
|
|
1725
1734
|
]),
|
|
1726
|
-
default:
|
|
1727
|
-
(c(),
|
|
1728
|
-
key: $
|
|
1729
|
-
onClick: (ho) => Ze.onClick(
|
|
1735
|
+
default: _(() => [
|
|
1736
|
+
(c(), R(he, null, Ee(ue, (Ze, $l) => u(Vl, {
|
|
1737
|
+
key: $l,
|
|
1738
|
+
onClick: (ho) => Ze.onClick(Sl)
|
|
1730
1739
|
}, {
|
|
1731
|
-
label:
|
|
1740
|
+
label: _(() => [
|
|
1732
1741
|
v("p", {
|
|
1733
1742
|
class: Le(
|
|
1734
1743
|
Ze.variant === "destructive" ? " text-fm-color-system-error-300" : ""
|
|
1735
1744
|
)
|
|
1736
|
-
}, U(
|
|
1745
|
+
}, U(t(w)(Ze.label)), 3)
|
|
1737
1746
|
]),
|
|
1738
1747
|
_: 2
|
|
1739
1748
|
}, 1032, ["onClick"])), 64))
|
|
@@ -1752,20 +1761,23 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1752
1761
|
])
|
|
1753
1762
|
]),
|
|
1754
1763
|
_: 1
|
|
1755
|
-
}),
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1764
|
+
})),
|
|
1765
|
+
i.readOnly ? D("", !0) : (c(), x(We, {
|
|
1766
|
+
key: 1,
|
|
1767
|
+
class: "border-solid"
|
|
1768
|
+
}, {
|
|
1769
|
+
header: _(() => [
|
|
1770
|
+
v("p", null, U(t(w)("report.editor.widgets")), 1),
|
|
1759
1771
|
o[18] || (o[18] = v("div", { class: "grow" }, null, -1))
|
|
1760
1772
|
]),
|
|
1761
|
-
content:
|
|
1762
|
-
u(
|
|
1773
|
+
content: _(() => [
|
|
1774
|
+
u(Ht, {
|
|
1763
1775
|
report: d.value,
|
|
1764
|
-
onAddWidget:
|
|
1776
|
+
onAddWidget: me
|
|
1765
1777
|
}, null, 8, ["report"])
|
|
1766
1778
|
]),
|
|
1767
1779
|
_: 1
|
|
1768
|
-
})
|
|
1780
|
+
}))
|
|
1769
1781
|
]),
|
|
1770
1782
|
_: 1
|
|
1771
1783
|
}, 512)
|
|
@@ -1791,6 +1803,7 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1791
1803
|
__name: "ReportEditorViewport",
|
|
1792
1804
|
props: /* @__PURE__ */ ke({
|
|
1793
1805
|
hideConfiguration: { type: Boolean, required: !1, default: !1 },
|
|
1806
|
+
readOnly: { type: Boolean, required: !1, default: !1 },
|
|
1794
1807
|
previewWidth: { type: Number, required: !0 },
|
|
1795
1808
|
previewHeight: { type: Number, required: !0 },
|
|
1796
1809
|
previewScale: { type: Number, required: !0 }
|
|
@@ -1800,40 +1813,41 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1800
1813
|
modelModifiers: {}
|
|
1801
1814
|
}),
|
|
1802
1815
|
emits: /* @__PURE__ */ ke(["hideConfiguration"], ["update:modelValue"]),
|
|
1803
|
-
setup(
|
|
1804
|
-
const { breakpoints: d } =
|
|
1805
|
-
var
|
|
1806
|
-
return
|
|
1807
|
-
}), h =
|
|
1808
|
-
return (
|
|
1809
|
-
const
|
|
1810
|
-
return c(),
|
|
1811
|
-
b.value ? (c(),
|
|
1812
|
-
|
|
1816
|
+
setup(z, { emit: p }) {
|
|
1817
|
+
const { breakpoints: d } = Ke(), b = Te(z, "modelValue"), i = g(() => {
|
|
1818
|
+
var F;
|
|
1819
|
+
return Jl((F = b.value) == null ? void 0 : F.tiles);
|
|
1820
|
+
}), h = z, P = g(() => h.previewWidth > 0 && h.previewHeight > 0), Q = g(() => d.value.sm || d.value.xs), T = p;
|
|
1821
|
+
return (F, O) => {
|
|
1822
|
+
const X = C("FmCircularProgress"), q = C("FmButton"), a = C("FmMenuDivider"), S = C("FmCard");
|
|
1823
|
+
return c(), R("div", oo, [
|
|
1824
|
+
b.value ? (c(), R(he, { key: 1 }, [
|
|
1825
|
+
P.value ? D("", !0) : (c(), x(Ml, {
|
|
1813
1826
|
key: 0,
|
|
1814
1827
|
"model-value": !h.hideConfiguration
|
|
1815
1828
|
}, {
|
|
1816
|
-
right:
|
|
1829
|
+
right: _(() => [
|
|
1817
1830
|
v("div", ao, [
|
|
1818
|
-
b.value ? (c(), x(
|
|
1831
|
+
b.value ? (c(), x(fl, {
|
|
1819
1832
|
key: 0,
|
|
1820
1833
|
modelValue: b.value,
|
|
1821
|
-
"onUpdate:modelValue":
|
|
1834
|
+
"onUpdate:modelValue": O[0] || (O[0] = (k) => b.value = k),
|
|
1822
1835
|
"hide-configuration": h.hideConfiguration,
|
|
1823
|
-
|
|
1824
|
-
|
|
1836
|
+
"read-only": h.readOnly,
|
|
1837
|
+
onHideConfiguration: O[1] || (O[1] = (k) => T("hideConfiguration", k))
|
|
1838
|
+
}, null, 8, ["modelValue", "hide-configuration", "read-only"])) : D("", !0)
|
|
1825
1839
|
])
|
|
1826
1840
|
]),
|
|
1827
|
-
left:
|
|
1841
|
+
left: _(() => [
|
|
1828
1842
|
v("div", ro, [
|
|
1829
|
-
u(
|
|
1843
|
+
u(q, {
|
|
1830
1844
|
variant: "secondary",
|
|
1831
1845
|
icon: "keyboard_double_arrow_right",
|
|
1832
|
-
"border-color":
|
|
1833
|
-
"text-color":
|
|
1846
|
+
"border-color": t(Ce).ColorPrimary,
|
|
1847
|
+
"text-color": t(Ce).ColorPrimary,
|
|
1834
1848
|
class: "m-24 my-16",
|
|
1835
1849
|
size: "md",
|
|
1836
|
-
onClick:
|
|
1850
|
+
onClick: O[2] || (O[2] = (k) => T("hideConfiguration", !h.hideConfiguration))
|
|
1837
1851
|
}, null, 8, ["border-color", "text-color"])
|
|
1838
1852
|
])
|
|
1839
1853
|
]),
|
|
@@ -1843,62 +1857,63 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1843
1857
|
vertical: "",
|
|
1844
1858
|
style: { margin: "0px" }
|
|
1845
1859
|
}),
|
|
1846
|
-
!
|
|
1847
|
-
b.value.tiles.length > 0 ? (c(),
|
|
1860
|
+
!Q.value && !P.value ? (c(), R("div", no, [
|
|
1861
|
+
b.value.tiles.length > 0 ? (c(), R("div", io, [
|
|
1848
1862
|
v("div", so, [
|
|
1849
|
-
u(
|
|
1863
|
+
u(cl)
|
|
1850
1864
|
]),
|
|
1851
|
-
u(
|
|
1865
|
+
u(tl, {
|
|
1852
1866
|
tiles: b.value.tiles,
|
|
1853
1867
|
"report-id": b.value.id || "editing",
|
|
1854
1868
|
"leaf-index-by-id": i.value,
|
|
1855
1869
|
"hide-export": !0,
|
|
1856
1870
|
"grid-class": "gap-[24px]"
|
|
1857
1871
|
}, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
|
|
1858
|
-
])) : (c(), x(
|
|
1859
|
-
])) :
|
|
1872
|
+
])) : (c(), x(al, { key: 1 }))
|
|
1873
|
+
])) : Q.value && !P.value ? (c(), R("div", uo, [
|
|
1860
1874
|
u(S, { class: "px-5 pb-28" }, {
|
|
1861
|
-
default:
|
|
1862
|
-
b.value.tiles.length > 0 ? (c(),
|
|
1875
|
+
default: _(() => [
|
|
1876
|
+
b.value.tiles.length > 0 ? (c(), R("div", mo, [
|
|
1863
1877
|
v("div", co, [
|
|
1864
|
-
u(
|
|
1878
|
+
u(cl)
|
|
1865
1879
|
]),
|
|
1866
|
-
u(
|
|
1880
|
+
u(tl, {
|
|
1867
1881
|
tiles: b.value.tiles,
|
|
1868
1882
|
"report-id": b.value.id || "editing",
|
|
1869
1883
|
"leaf-index-by-id": i.value,
|
|
1870
1884
|
"hide-export": !0,
|
|
1871
1885
|
"grid-class": "gap-[16px]"
|
|
1872
1886
|
}, null, 8, ["tiles", "report-id", "leaf-index-by-id"])
|
|
1873
|
-
])) : (c(), x(
|
|
1887
|
+
])) : (c(), x(al, { key: 1 }))
|
|
1874
1888
|
]),
|
|
1875
1889
|
_: 1
|
|
1876
1890
|
}),
|
|
1877
|
-
b.value ? (c(), x(
|
|
1891
|
+
b.value ? (c(), x(fl, {
|
|
1878
1892
|
key: 0,
|
|
1879
1893
|
modelValue: b.value,
|
|
1880
|
-
"onUpdate:modelValue":
|
|
1894
|
+
"onUpdate:modelValue": O[3] || (O[3] = (k) => b.value = k),
|
|
1881
1895
|
"hide-configuration": h.hideConfiguration,
|
|
1882
|
-
|
|
1896
|
+
"read-only": h.readOnly,
|
|
1897
|
+
onHideConfiguration: O[4] || (O[4] = (k) => {
|
|
1883
1898
|
T("hideConfiguration", k);
|
|
1884
1899
|
})
|
|
1885
|
-
}, null, 8, ["modelValue", "hide-configuration"])) :
|
|
1886
|
-
])) : (c(),
|
|
1900
|
+
}, null, 8, ["modelValue", "hide-configuration", "read-only"])) : D("", !0)
|
|
1901
|
+
])) : (c(), R("div", po, [
|
|
1887
1902
|
v("div", {
|
|
1888
|
-
style:
|
|
1903
|
+
style: rl({
|
|
1889
1904
|
transformOrigin: "top center",
|
|
1890
1905
|
transform: `scale(${h.previewScale})`
|
|
1891
1906
|
})
|
|
1892
1907
|
}, [
|
|
1893
1908
|
v("div", {
|
|
1894
1909
|
class: "overflow-y-auto bg-white rounded-lg",
|
|
1895
|
-
style:
|
|
1910
|
+
style: rl({
|
|
1896
1911
|
width: h.previewWidth + "px",
|
|
1897
1912
|
height: h.previewHeight + "px"
|
|
1898
1913
|
})
|
|
1899
1914
|
}, [
|
|
1900
|
-
b.value.tiles.length > 0 ? (c(),
|
|
1901
|
-
u(
|
|
1915
|
+
b.value.tiles.length > 0 ? (c(), R("div", vo, [
|
|
1916
|
+
u(tl, {
|
|
1902
1917
|
tiles: b.value.tiles,
|
|
1903
1918
|
"report-id": b.value.id || "editing",
|
|
1904
1919
|
"leaf-index-by-id": i.value,
|
|
@@ -1906,46 +1921,49 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1906
1921
|
"custom-screen-width": h.previewWidth,
|
|
1907
1922
|
"grid-class": "gap-[24px] p-24"
|
|
1908
1923
|
}, null, 8, ["tiles", "report-id", "leaf-index-by-id", "custom-screen-width"])
|
|
1909
|
-
])) : (c(), x(
|
|
1924
|
+
])) : (c(), x(al, { key: 1 }))
|
|
1910
1925
|
], 4)
|
|
1911
1926
|
], 4)
|
|
1912
1927
|
]))
|
|
1913
|
-
], 64)) : (c(), x(
|
|
1928
|
+
], 64)) : (c(), x(X, { key: 0 }))
|
|
1914
1929
|
]);
|
|
1915
1930
|
};
|
|
1916
1931
|
}
|
|
1917
1932
|
}), go = { class: "flex items-center gap-4" }, bo = { class: "flex justify-center items-center gap-2 w-full" }, yo = { class: "flex gap-4" }, Ro = /* @__PURE__ */ we({
|
|
1918
1933
|
__name: "ReportEditor",
|
|
1919
|
-
setup(
|
|
1920
|
-
const p =
|
|
1921
|
-
var
|
|
1922
|
-
return !((
|
|
1923
|
-
}),
|
|
1924
|
-
var
|
|
1925
|
-
return ((
|
|
1926
|
-
}),
|
|
1934
|
+
setup(z) {
|
|
1935
|
+
const p = sl(), d = ul(), b = il(), { promptLoader: i } = Kl(), { t: h, te: P } = Ge(), { currentReport: Q, editingReport: T } = qe(b), { breakpoints: F } = Ke(), O = g(() => {
|
|
1936
|
+
var N;
|
|
1937
|
+
return !((N = T.value) != null && N.editable);
|
|
1938
|
+
}), X = g(() => {
|
|
1939
|
+
var N, E;
|
|
1940
|
+
return !((N = T.value) != null && N.editable) && !((E = T.value) != null && E.isDefault);
|
|
1941
|
+
}), q = g(() => {
|
|
1942
|
+
var N;
|
|
1943
|
+
return ((N = T.value) == null ? void 0 : N.name) ?? h("report.editor.newReport");
|
|
1944
|
+
}), a = g(() => He(h, P, q.value, "other")), S = Fl(), { promptMessage: k } = dl(), j = L(!1), ae = g(() => [
|
|
1927
1945
|
{ label: h("report.common.cancel"), value: "cancel", isPrimary: !1 },
|
|
1928
1946
|
{ label: h("report.common.save"), value: "save", isPrimary: !0, prependIcon: "download" }
|
|
1929
1947
|
]);
|
|
1930
|
-
async function
|
|
1948
|
+
async function de() {
|
|
1931
1949
|
if (!T.value || T.value.tiles.length === 0) {
|
|
1932
|
-
|
|
1950
|
+
S.open({ message: h("report.messages.noWidget"), type: "error" });
|
|
1933
1951
|
return;
|
|
1934
1952
|
}
|
|
1935
|
-
if (
|
|
1936
|
-
|
|
1953
|
+
if (Ql(T.value.tiles) > _l) {
|
|
1954
|
+
S.open({ message: h("report.messages.tooDeepNesting"), type: "error" });
|
|
1937
1955
|
return;
|
|
1938
1956
|
}
|
|
1939
|
-
const
|
|
1940
|
-
if (await
|
|
1957
|
+
const N = X.value ? h("report.common.clone") : h("report.common.save");
|
|
1958
|
+
if (await k({
|
|
1941
1959
|
title: `${h("report.messages.saveReport")}`,
|
|
1942
|
-
message: h("report.messages.confirmAction", { action:
|
|
1960
|
+
message: h("report.messages.confirmAction", { action: N, name: a.value })
|
|
1943
1961
|
}))
|
|
1944
1962
|
try {
|
|
1945
1963
|
await i(async () => {
|
|
1946
|
-
if (
|
|
1947
|
-
const
|
|
1948
|
-
|
|
1964
|
+
if (X.value) {
|
|
1965
|
+
const H = JSON.parse(JSON.stringify(T.value));
|
|
1966
|
+
H.editable = !0, H.id = "", H.name = `${H.name} ${h("report.common.duplicate")}`, H.isDefault = !1, await b.createOrUpdateReport(H);
|
|
1949
1967
|
} else
|
|
1950
1968
|
T.value && await b.createOrUpdateReport(T.value);
|
|
1951
1969
|
p.push({
|
|
@@ -1953,25 +1971,25 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1953
1971
|
query: d.query
|
|
1954
1972
|
});
|
|
1955
1973
|
});
|
|
1956
|
-
} catch (
|
|
1957
|
-
console.log(
|
|
1958
|
-
message: h("report.messages.failedToAction", { action:
|
|
1974
|
+
} catch (H) {
|
|
1975
|
+
console.log(H), S.open({
|
|
1976
|
+
message: h("report.messages.failedToAction", { action: N }),
|
|
1959
1977
|
type: "error"
|
|
1960
1978
|
});
|
|
1961
1979
|
}
|
|
1962
1980
|
}
|
|
1963
|
-
async function
|
|
1964
|
-
var
|
|
1981
|
+
async function A() {
|
|
1982
|
+
var E;
|
|
1965
1983
|
if (!T.value) return;
|
|
1966
|
-
await
|
|
1984
|
+
await k({
|
|
1967
1985
|
title: h("report.common.report", 1),
|
|
1968
|
-
message: h("report.editor.notSaved", { name: (
|
|
1969
|
-
}) && (T.value = JSON.parse(JSON.stringify(
|
|
1986
|
+
message: h("report.editor.notSaved", { name: (E = T.value) == null ? void 0 : E.name })
|
|
1987
|
+
}) && (T.value = JSON.parse(JSON.stringify(Q.value)), p.back());
|
|
1970
1988
|
}
|
|
1971
|
-
|
|
1989
|
+
bl(() => {
|
|
1972
1990
|
T.value || p.push({ name: "reports" });
|
|
1973
1991
|
});
|
|
1974
|
-
const
|
|
1992
|
+
const ie = [
|
|
1975
1993
|
{
|
|
1976
1994
|
labelKey: "report.common.default",
|
|
1977
1995
|
width: void 0,
|
|
@@ -1992,78 +2010,79 @@ const Fl = { class: "flex flex-col gap-16" }, Vl = {
|
|
|
1992
2010
|
width: 390,
|
|
1993
2011
|
height: 859
|
|
1994
2012
|
}
|
|
1995
|
-
],
|
|
1996
|
-
if (!
|
|
1997
|
-
let
|
|
1998
|
-
return
|
|
2013
|
+
], w = L(ie[0]), K = L(!1), re = g(() => K.value ? Math.max(w.value.width || 0, w.value.height || 0) : Math.min(w.value.width || 0, w.value.height || 0)), Z = g(() => K.value ? Math.min(w.value.width || 0, w.value.height || 0) : Math.max(w.value.width || 0, w.value.height || 0)), ne = g(() => window.innerHeight - 72 - 56), se = g(() => {
|
|
2014
|
+
if (!re.value) return 1;
|
|
2015
|
+
let N = (ne.value - 48) / re.value, E = Z.value * N;
|
|
2016
|
+
return E > window.innerWidth && (N = window.innerWidth / Z.value, E = Z.value * N), N > 1 ? 1 : N;
|
|
1999
2017
|
});
|
|
2000
|
-
function
|
|
2001
|
-
|
|
2018
|
+
function me(N) {
|
|
2019
|
+
w.value = N;
|
|
2002
2020
|
}
|
|
2003
|
-
function
|
|
2004
|
-
|
|
2021
|
+
function ue() {
|
|
2022
|
+
K.value = !K.value;
|
|
2005
2023
|
}
|
|
2006
|
-
return (
|
|
2007
|
-
const
|
|
2008
|
-
return c(), x(
|
|
2009
|
-
default:
|
|
2010
|
-
u(
|
|
2024
|
+
return (N, E) => {
|
|
2025
|
+
const H = C("FmTooltip"), ce = C("FmButton"), Se = C("FmPageHead");
|
|
2026
|
+
return c(), x(Rl, null, {
|
|
2027
|
+
default: _(() => [
|
|
2028
|
+
u(Se, {
|
|
2011
2029
|
"data-editor-header": "true",
|
|
2012
|
-
actions:
|
|
2013
|
-
"onClick:action":
|
|
2014
|
-
J === "cancel" &&
|
|
2030
|
+
actions: ae.value,
|
|
2031
|
+
"onClick:action": E[0] || (E[0] = (J) => {
|
|
2032
|
+
J === "cancel" && A(), J === "save" && de();
|
|
2015
2033
|
})
|
|
2016
2034
|
}, {
|
|
2017
|
-
title:
|
|
2035
|
+
title: _(() => [
|
|
2018
2036
|
v("div", go, [
|
|
2019
|
-
u(
|
|
2020
|
-
content:
|
|
2037
|
+
u(H, {
|
|
2038
|
+
content: a.value,
|
|
2021
2039
|
placement: "bottom"
|
|
2022
2040
|
}, {
|
|
2023
|
-
default:
|
|
2041
|
+
default: _(() => [
|
|
2024
2042
|
v("p", {
|
|
2025
|
-
class: Le(`${
|
|
2026
|
-
}, U(
|
|
2043
|
+
class: Le(`${t(F).sm || t(F).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
|
|
2044
|
+
}, U(a.value), 3)
|
|
2027
2045
|
]),
|
|
2028
2046
|
_: 1
|
|
2029
2047
|
}, 8, ["content"]),
|
|
2030
2048
|
v("div", bo, [
|
|
2031
2049
|
v("div", yo, [
|
|
2032
|
-
(c(),
|
|
2033
|
-
var
|
|
2034
|
-
return u(
|
|
2050
|
+
(c(), R(he, null, Ee(ie, (J) => {
|
|
2051
|
+
var ee;
|
|
2052
|
+
return u(ce, {
|
|
2035
2053
|
key: J.labelKey,
|
|
2036
|
-
label:
|
|
2037
|
-
variant: ((
|
|
2054
|
+
label: t(h)(J.labelKey),
|
|
2055
|
+
variant: ((ee = w.value) == null ? void 0 : ee.labelKey) === J.labelKey ? "primary" : "secondary",
|
|
2038
2056
|
size: "md",
|
|
2039
|
-
onClick: (
|
|
2057
|
+
onClick: (_e) => me(J)
|
|
2040
2058
|
}, null, 8, ["label", "variant", "onClick"]);
|
|
2041
2059
|
}), 64))
|
|
2042
2060
|
]),
|
|
2043
|
-
u(
|
|
2061
|
+
u(ce, {
|
|
2044
2062
|
icon: "screen_rotation",
|
|
2045
2063
|
variant: "tertiary",
|
|
2046
2064
|
size: "md",
|
|
2047
2065
|
class: "text-fm-color-typo-primary",
|
|
2048
|
-
onClick:
|
|
2066
|
+
onClick: ue
|
|
2049
2067
|
})
|
|
2050
2068
|
])
|
|
2051
2069
|
])
|
|
2052
2070
|
]),
|
|
2053
2071
|
_: 1
|
|
2054
2072
|
}, 8, ["actions"]),
|
|
2055
|
-
|
|
2073
|
+
t(T) ? (c(), x(fo, {
|
|
2056
2074
|
key: 0,
|
|
2057
|
-
modelValue:
|
|
2058
|
-
"onUpdate:modelValue":
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
"
|
|
2062
|
-
"
|
|
2063
|
-
"preview-
|
|
2064
|
-
"preview-
|
|
2065
|
-
|
|
2066
|
-
|
|
2075
|
+
modelValue: t(T),
|
|
2076
|
+
"onUpdate:modelValue": E[1] || (E[1] = (J) => yl(T) ? T.value = J : null),
|
|
2077
|
+
"read-only": O.value,
|
|
2078
|
+
style: rl({ height: ne.value + "px" }),
|
|
2079
|
+
class: Le(t(F).lg || t(F).md ? "flex" : ""),
|
|
2080
|
+
"hide-configuration": j.value,
|
|
2081
|
+
"preview-width": Z.value,
|
|
2082
|
+
"preview-height": re.value,
|
|
2083
|
+
"preview-scale": se.value,
|
|
2084
|
+
onHideConfiguration: E[2] || (E[2] = (J) => j.value = J)
|
|
2085
|
+
}, null, 8, ["modelValue", "read-only", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : D("", !0)
|
|
2067
2086
|
]),
|
|
2068
2087
|
_: 1
|
|
2069
2088
|
});
|