@feedmepos/mf-report 5.4.15-beta.1 → 5.4.15-beta.3
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-DufL3Y8h.js +152 -0
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DLDk5l4R.js +162 -0
- package/dist/{Default.vue_vue_type_script_setup_true_lang-Bxuyjrkr.js → Default.vue_vue_type_script_setup_true_lang-DVLxkOOQ.js} +2 -2
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-C29g9w6o.js +999 -0
- package/dist/{InsightView-D78TK2E8.js → InsightView-tyeJBlRm.js} +1051 -1049
- package/dist/Integration-ILSIf-OL.js +3695 -0
- package/dist/Integrations-DwgNrM3U.js +334 -0
- package/dist/{Layout-DERpCrQk.js → Layout-Bw1oh6Q-.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-DurYBXa5.js → LocationSelect.vue_vue_type_script_setup_true_lang-BFj4d-UF.js} +1861 -1859
- package/dist/MenuTab.vue_vue_type_script_setup_true_lang-DzZeasAK.js +277 -0
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-C8yzWDXs.js → NavigationTab.vue_vue_type_script_setup_true_lang-_eC_tMk_.js} +5526 -5482
- package/dist/NoData.vue_vue_type_script_setup_true_lang-BtQobm-7.js +31 -0
- package/dist/OverviewView-Dl8oOobn.js +61 -0
- package/dist/Report-BqD8KVZ8.js +424 -0
- package/dist/ReportEditor-DkzFUgbO.js +532 -0
- package/dist/ReportView-DpWZHV0o.js +169 -0
- package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-C3VG1mi_.js +104 -0
- package/dist/Setting-CYrg_50p.js +320 -0
- package/dist/TileEditor-CDrzLbqc.js +2320 -0
- package/dist/{TransitionFade-BLDfpF7R.js → TransitionFade-D19wC3tb.js} +225 -220
- package/dist/app.js +915 -27
- package/dist/{global-loader-CMC9fgBi.js → global-loader-C3JC7z-H.js} +4966 -2240
- package/dist/index-9IDzTnHw.js +147 -0
- package/dist/{report-schema-G0x3CoJb.js → report-schema-1zQJbLyB.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/timeFormat-CjNvJMgk.js +9 -0
- package/dist/{v4-DF7wffYN.js → v4-D29FkHfi.js} +2666 -1927
- package/package.json +1 -1
- package/dist/App-mcSgbcVY.js +0 -133
- package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-DPuhMR6i.js +0 -160
- package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-B6IzlHmr.js +0 -996
- package/dist/HeaderTab.vue_vue_type_script_setup_true_lang-B5VBDNwX.js +0 -19
- package/dist/Integration-Cm6_YEEE.js +0 -3554
- package/dist/Integrations-WWnSho0Q.js +0 -334
- package/dist/MenuTab.vue_vue_type_script_setup_true_lang-h87kWy1E.js +0 -261
- package/dist/NoData.vue_vue_type_script_setup_true_lang-DlBNFLa3.js +0 -30
- package/dist/OverviewView-D7zAR7_7.js +0 -60
- package/dist/Report-BnX5amn0.js +0 -409
- package/dist/ReportEditor-DW7uWg_a.js +0 -530
- package/dist/ReportView-xSaJA5F6.js +0 -166
- package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-DBI9op0g.js +0 -103
- package/dist/Setting-D8JspXTN.js +0 -326
- package/dist/TileEditor-DQ8C5I_M.js +0 -2301
- package/dist/index-SmIkb24L.js +0 -143
- package/dist/timeFormat-BF-F4Rnt.js +0 -9
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { defineComponent as S, mergeModels as $, useModel as M, ref as N, computed as P, resolveComponent as c, createBlock as b, openBlock as s, withCtx as m, createElementVNode as C, createVNode as a, unref as o, normalizeClass as E, createTextVNode as fe, toDisplayString as O, createElementBlock as x, Fragment as q, renderSlot as j, createCommentVNode as U, watch as ve, resolveDynamicComponent as K, isRef as Q, renderList as H, onMounted as ge, normalizeStyle as _e } from "vue";
|
|
2
|
+
import { W as ye, i as Ce, S as be, d as Ve, T as ke, _ as Fe } from "./TransitionFade-D19wC3tb.js";
|
|
3
|
+
import { a as X, v as Y } from "./v4-D29FkHfi.js";
|
|
4
|
+
import { storeToRefs as Z } from "pinia";
|
|
5
|
+
import { useRouter as ee, useRoute as oe } from "vue-router";
|
|
6
|
+
import { useBreakpoints as A, FmButtonColorThemeVariant as W, useSnackbar as xe } from "@feedmepos/ui-library";
|
|
7
|
+
import { u as te } from "./message-dialog-UoMWOnil.js";
|
|
8
|
+
import { _ as le } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-C29g9w6o.js";
|
|
9
|
+
import { _ as re } from "./NoData.vue_vue_type_script_setup_true_lang-BtQobm-7.js";
|
|
10
|
+
import { u as I, f as he } from "./global-loader-C3JC7z-H.js";
|
|
11
|
+
const we = /* @__PURE__ */ S({
|
|
12
|
+
__name: "WidgetDialog",
|
|
13
|
+
props: /* @__PURE__ */ $({
|
|
14
|
+
isOpen: { type: Boolean }
|
|
15
|
+
}, {
|
|
16
|
+
modelValue: {},
|
|
17
|
+
modelModifiers: {}
|
|
18
|
+
}),
|
|
19
|
+
emits: /* @__PURE__ */ $(["isOpen"], ["update:modelValue"]),
|
|
20
|
+
setup(p, { emit: u }) {
|
|
21
|
+
const { t: e } = I(), { breakpoints: l } = A(), g = M(p, "modelValue"), i = p, r = u;
|
|
22
|
+
function n() {
|
|
23
|
+
r("isOpen", !1);
|
|
24
|
+
}
|
|
25
|
+
function v() {
|
|
26
|
+
t.value && (g.value = t.value, t.value = void 0, r("isOpen", !1));
|
|
27
|
+
}
|
|
28
|
+
const t = N(), V = P(() => !t.value);
|
|
29
|
+
return (B, h) => {
|
|
30
|
+
const R = c("FmButton"), T = c("FmDialog");
|
|
31
|
+
return s(), b(T, {
|
|
32
|
+
"model-value": i.isOpen
|
|
33
|
+
}, {
|
|
34
|
+
"dialog-header": m(() => [
|
|
35
|
+
fe(O(o(e)("report.widget.type")), 1)
|
|
36
|
+
]),
|
|
37
|
+
default: m(() => [
|
|
38
|
+
a(ye, {
|
|
39
|
+
modelValue: t.value,
|
|
40
|
+
"onUpdate:modelValue": h[0] || (h[0] = (_) => t.value = _),
|
|
41
|
+
class: E(`grid ${o(l).lg || o(l).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
|
|
42
|
+
"child-class": "p-[8px] flex flex-col"
|
|
43
|
+
}, null, 8, ["modelValue", "class"])
|
|
44
|
+
]),
|
|
45
|
+
"dialog-footer": m(() => [
|
|
46
|
+
h[1] || (h[1] = C("div", { class: "grow" }, null, -1)),
|
|
47
|
+
a(R, {
|
|
48
|
+
label: o(e)("report.common.cancel"),
|
|
49
|
+
variant: "tertiary",
|
|
50
|
+
onClick: n
|
|
51
|
+
}, null, 8, ["label"]),
|
|
52
|
+
a(R, {
|
|
53
|
+
label: o(e)("report.common.confirm"),
|
|
54
|
+
disabled: V.value,
|
|
55
|
+
onClick: v
|
|
56
|
+
}, null, 8, ["label", "disabled"])
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
}, 8, ["model-value"]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}), $e = { class: "fm-typo-en-body-lg-600" }, z = /* @__PURE__ */ S({
|
|
63
|
+
__name: "ReportEditorTabHeader",
|
|
64
|
+
props: /* @__PURE__ */ $({
|
|
65
|
+
icon: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: !0
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
modelValue: { type: Boolean, required: !0, default: !1 },
|
|
71
|
+
modelModifiers: {}
|
|
72
|
+
}),
|
|
73
|
+
emits: ["update:modelValue"],
|
|
74
|
+
setup(p) {
|
|
75
|
+
const { t: u } = I(), e = M(p, "modelValue"), l = p;
|
|
76
|
+
return (g, i) => {
|
|
77
|
+
const r = c("FmIcon");
|
|
78
|
+
return s(), x("div", {
|
|
79
|
+
class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
|
|
80
|
+
onClick: i[0] || (i[0] = (n) => e.value = !e.value)
|
|
81
|
+
}, [
|
|
82
|
+
C("p", $e, O(o(u)("report.editor.customizeReport")), 1),
|
|
83
|
+
i[1] || (i[1] = C("div", { class: "grow" }, null, -1)),
|
|
84
|
+
a(r, {
|
|
85
|
+
name: l.icon
|
|
86
|
+
}, null, 8, ["name"])
|
|
87
|
+
]);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}), Se = /* @__PURE__ */ S({
|
|
91
|
+
__name: "ReportEditorTabDesktop",
|
|
92
|
+
props: {
|
|
93
|
+
modelValue: { required: !0, default: !1 },
|
|
94
|
+
modelModifiers: {}
|
|
95
|
+
},
|
|
96
|
+
emits: ["update:modelValue"],
|
|
97
|
+
setup(p) {
|
|
98
|
+
const u = M(p, "modelValue");
|
|
99
|
+
return (e, l) => (s(), x(q, null, [
|
|
100
|
+
a(z, {
|
|
101
|
+
modelValue: u.value,
|
|
102
|
+
"onUpdate:modelValue": l[0] || (l[0] = (g) => u.value = g),
|
|
103
|
+
icon: "keyboard_double_arrow_left"
|
|
104
|
+
}, null, 8, ["modelValue"]),
|
|
105
|
+
j(e.$slots, "default")
|
|
106
|
+
], 64));
|
|
107
|
+
}
|
|
108
|
+
}), Re = /* @__PURE__ */ S({
|
|
109
|
+
__name: "ReportEditorTabMobile",
|
|
110
|
+
props: {
|
|
111
|
+
modelValue: { required: !0, default: !1 },
|
|
112
|
+
modelModifiers: {}
|
|
113
|
+
},
|
|
114
|
+
emits: ["update:modelValue"],
|
|
115
|
+
setup(p) {
|
|
116
|
+
const u = M(p, "modelValue");
|
|
117
|
+
return (e, l) => {
|
|
118
|
+
const g = c("FmTopSheet"), i = c("FmCard");
|
|
119
|
+
return s(), b(i, { class: "fixed bottom-0 w-full" }, {
|
|
120
|
+
default: m(() => [
|
|
121
|
+
a(z, {
|
|
122
|
+
modelValue: u.value,
|
|
123
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => u.value = r),
|
|
124
|
+
icon: "keyboard_double_arrow_up"
|
|
125
|
+
}, null, 8, ["modelValue"]),
|
|
126
|
+
a(g, {
|
|
127
|
+
modelValue: u.value,
|
|
128
|
+
"onUpdate:modelValue": l[2] || (l[2] = (r) => u.value = r),
|
|
129
|
+
"fullscreen-size": "sm"
|
|
130
|
+
}, {
|
|
131
|
+
default: m(() => [
|
|
132
|
+
a(z, {
|
|
133
|
+
modelValue: u.value,
|
|
134
|
+
"onUpdate:modelValue": l[1] || (l[1] = (r) => u.value = r),
|
|
135
|
+
icon: "keyboard_double_arrow_down"
|
|
136
|
+
}, null, 8, ["modelValue"]),
|
|
137
|
+
u.value ? j(e.$slots, "default", { key: 0 }) : U("", !0)
|
|
138
|
+
]),
|
|
139
|
+
_: 3
|
|
140
|
+
}, 8, ["modelValue"])
|
|
141
|
+
]),
|
|
142
|
+
_: 3
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}), Te = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, Me = { class: "flex flex-col gap-24" }, Be = { class: "line-clamp-2 overflow-hidden" }, ne = /* @__PURE__ */ S({
|
|
147
|
+
__name: "ReportEditorTab",
|
|
148
|
+
props: /* @__PURE__ */ $({
|
|
149
|
+
hideConfiguration: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: !1
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
modelValue: { required: !0 },
|
|
155
|
+
modelModifiers: {}
|
|
156
|
+
}),
|
|
157
|
+
emits: /* @__PURE__ */ $(["hideConfiguration"], ["update:modelValue"]),
|
|
158
|
+
setup(p, { emit: u }) {
|
|
159
|
+
const e = M(p, "modelValue"), { breakpoints: l } = A(), g = p, i = u, r = ee(), n = oe(), v = N(), { currentSelectWidgetType: t, categories: V, editingTile: B, editingIndex: h } = Z(X()), { promptMessage: R } = te(), T = N(!1), { t: _ } = I();
|
|
160
|
+
ve(
|
|
161
|
+
() => t.value,
|
|
162
|
+
() => {
|
|
163
|
+
t.value !== void 0 && (e.value.tiles.push(Ce(t.value)), h.value = e.value.tiles.length - 1, B.value = e.value.tiles[e.value.tiles.length - 1], r.push({
|
|
164
|
+
name: "tileEditor",
|
|
165
|
+
query: n.query
|
|
166
|
+
}));
|
|
167
|
+
},
|
|
168
|
+
{ immediate: !0 }
|
|
169
|
+
);
|
|
170
|
+
const k = [
|
|
171
|
+
{
|
|
172
|
+
label: _("report.common.edit"),
|
|
173
|
+
selected: !1,
|
|
174
|
+
variant: "tertiary",
|
|
175
|
+
onClick: (d) => {
|
|
176
|
+
h.value = d, B.value = JSON.parse(JSON.stringify(e.value.tiles[d])), r.push({
|
|
177
|
+
name: "tileEditor",
|
|
178
|
+
query: n.query
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: _("report.common.duplicate"),
|
|
184
|
+
selected: !1,
|
|
185
|
+
variant: "tertiary",
|
|
186
|
+
onClick: (d) => {
|
|
187
|
+
e.value.tiles.push(JSON.parse(JSON.stringify(e.value.tiles[d])));
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
label: _("report.common.remove"),
|
|
192
|
+
selected: !1,
|
|
193
|
+
variant: "destructive",
|
|
194
|
+
onClick: async (d) => {
|
|
195
|
+
await R({
|
|
196
|
+
title: _("report.editor.deleteWidget"),
|
|
197
|
+
message: _("report.editor.deleteWidgetConfirm", {
|
|
198
|
+
title: e.value.tiles[d].widget.title
|
|
199
|
+
})
|
|
200
|
+
}) && (e.value.tiles = e.value.tiles.filter((w, D) => D !== d));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
], F = P(() => V.value.map((d) => ({
|
|
204
|
+
label: _(`report.category.${d.name}`),
|
|
205
|
+
value: d.id
|
|
206
|
+
})));
|
|
207
|
+
return (d, f) => {
|
|
208
|
+
const w = c("FmTextField"), D = c("FmSelect"), G = c("FmButton"), ae = c("FmIcon"), ie = c("FmTooltip"), se = c("FmMenuItem"), ue = c("FmMenu"), de = c("FmListItem"), me = c("FmList"), ce = c("FmForm");
|
|
209
|
+
return s(), b(K(o(l).lg || o(l).md ? Se : Re), {
|
|
210
|
+
"model-value": g.hideConfiguration,
|
|
211
|
+
"onUpdate:modelValue": f[5] || (f[5] = (y) => i("hideConfiguration", y))
|
|
212
|
+
}, {
|
|
213
|
+
default: m(() => [
|
|
214
|
+
a(we, {
|
|
215
|
+
modelValue: o(t),
|
|
216
|
+
"onUpdate:modelValue": f[0] || (f[0] = (y) => Q(t) ? t.value = y : null),
|
|
217
|
+
"is-open": T.value,
|
|
218
|
+
onIsOpen: f[1] || (f[1] = (y) => T.value = y)
|
|
219
|
+
}, null, 8, ["modelValue", "is-open"]),
|
|
220
|
+
a(ce, {
|
|
221
|
+
ref_key: "form",
|
|
222
|
+
ref: v,
|
|
223
|
+
class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
|
|
224
|
+
}, {
|
|
225
|
+
default: m(() => [
|
|
226
|
+
a(be, { class: "border-solid" }, {
|
|
227
|
+
header: m(() => [
|
|
228
|
+
C("p", null, O(o(_)("report.editor.reportInfo")), 1),
|
|
229
|
+
f[6] || (f[6] = C("div", { class: "grow" }, null, -1))
|
|
230
|
+
]),
|
|
231
|
+
content: m(() => [
|
|
232
|
+
C("div", Te, [
|
|
233
|
+
a(w, {
|
|
234
|
+
modelValue: e.value.name,
|
|
235
|
+
"onUpdate:modelValue": f[2] || (f[2] = (y) => e.value.name = y),
|
|
236
|
+
label: o(_)("report.editor.reportTitle"),
|
|
237
|
+
placeholder: o(_)("report.editor.placeholder")
|
|
238
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
239
|
+
a(D, {
|
|
240
|
+
modelValue: e.value.category,
|
|
241
|
+
"onUpdate:modelValue": f[3] || (f[3] = (y) => e.value.category = y),
|
|
242
|
+
label: o(_)("report.common.category"),
|
|
243
|
+
items: F.value
|
|
244
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
}),
|
|
249
|
+
C("div", Me, [
|
|
250
|
+
a(G, {
|
|
251
|
+
label: o(_)("report.editor.addWidget"),
|
|
252
|
+
variant: "secondary",
|
|
253
|
+
icon: "add",
|
|
254
|
+
"icon-position": "prepend",
|
|
255
|
+
"border-color": o(W).ColorPrimary,
|
|
256
|
+
"text-color": o(W).ColorPrimary,
|
|
257
|
+
onClick: f[4] || (f[4] = (y) => T.value = !0)
|
|
258
|
+
}, null, 8, ["label", "border-color", "text-color"]),
|
|
259
|
+
a(me, null, {
|
|
260
|
+
default: m(() => [
|
|
261
|
+
a(o(Ve), {
|
|
262
|
+
list: e.value.tiles,
|
|
263
|
+
"item-key": "id",
|
|
264
|
+
class: "flex flex-col gap-2 cursor-grab",
|
|
265
|
+
handle: ".handle"
|
|
266
|
+
}, {
|
|
267
|
+
item: m(({ element: y, index: J }) => [
|
|
268
|
+
a(de, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
|
|
269
|
+
default: m(() => [
|
|
270
|
+
a(ae, {
|
|
271
|
+
name: "drag_handle",
|
|
272
|
+
class: "handle"
|
|
273
|
+
}),
|
|
274
|
+
a(ie, {
|
|
275
|
+
content: y.widget.title.length <= 0 ? `Widget ${J}` : y.widget.title,
|
|
276
|
+
class: "handle"
|
|
277
|
+
}, {
|
|
278
|
+
default: m(() => [
|
|
279
|
+
C("p", Be, O(y.widget.title.length <= 0 ? `Widget ${J}` : y.widget.title), 1)
|
|
280
|
+
]),
|
|
281
|
+
_: 2
|
|
282
|
+
}, 1032, ["content"]),
|
|
283
|
+
f[7] || (f[7] = C("div", { class: "grow" }, null, -1)),
|
|
284
|
+
a(ue, {
|
|
285
|
+
trigger: "click",
|
|
286
|
+
shift: !0,
|
|
287
|
+
"stop-click-propagation": !0
|
|
288
|
+
}, {
|
|
289
|
+
"menu-button": m(() => [
|
|
290
|
+
a(G, {
|
|
291
|
+
"append-icon": "more_vert",
|
|
292
|
+
variant: "tertiary"
|
|
293
|
+
})
|
|
294
|
+
]),
|
|
295
|
+
default: m(() => [
|
|
296
|
+
(s(), x(q, null, H(k, (L, pe) => a(se, {
|
|
297
|
+
key: pe,
|
|
298
|
+
onClick: (Ie) => L.onClick(J)
|
|
299
|
+
}, {
|
|
300
|
+
label: m(() => [
|
|
301
|
+
C("p", {
|
|
302
|
+
class: E(
|
|
303
|
+
L.variant === "destructive" ? " text-fm-color-system-error-300" : ""
|
|
304
|
+
)
|
|
305
|
+
}, O(L.label), 3)
|
|
306
|
+
]),
|
|
307
|
+
_: 2
|
|
308
|
+
}, 1032, ["onClick"])), 64))
|
|
309
|
+
]),
|
|
310
|
+
_: 2
|
|
311
|
+
}, 1024)
|
|
312
|
+
]),
|
|
313
|
+
_: 2
|
|
314
|
+
}, 1024)
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["list"])
|
|
318
|
+
]),
|
|
319
|
+
_: 1
|
|
320
|
+
})
|
|
321
|
+
])
|
|
322
|
+
]),
|
|
323
|
+
_: 1
|
|
324
|
+
}, 512)
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
}, 8, ["model-value"]);
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}), Oe = { class: "flex flex-col bg-fm-color-neutral-white w-[400px]" }, qe = { class: "flex bg-fm-color-neutral-white w-[88px]" }, Ue = { class: "w-full overflow-y-auto" }, Ne = {
|
|
331
|
+
key: 0,
|
|
332
|
+
class: "w-full grid grid-cols-12 gap-[24px] p-24",
|
|
333
|
+
style: { backgroundColor: "#F6F8FC" }
|
|
334
|
+
}, Pe = /* @__PURE__ */ S({
|
|
335
|
+
__name: "ReportEditorDesktop",
|
|
336
|
+
props: /* @__PURE__ */ $({
|
|
337
|
+
hideConfiguration: { type: Boolean, required: !0, default: !1 }
|
|
338
|
+
}, {
|
|
339
|
+
modelValue: { required: !0, default: () => {
|
|
340
|
+
} },
|
|
341
|
+
modelModifiers: {}
|
|
342
|
+
}),
|
|
343
|
+
emits: /* @__PURE__ */ $(["hideConfiguration"], ["update:modelValue"]),
|
|
344
|
+
setup(p, { emit: u }) {
|
|
345
|
+
const e = M(p, "modelValue"), l = p, g = u;
|
|
346
|
+
return (i, r) => {
|
|
347
|
+
const n = c("FmCircularProgress"), v = c("FmButton");
|
|
348
|
+
return s(), x("div", null, [
|
|
349
|
+
e.value ? (s(), x(q, { key: 1 }, [
|
|
350
|
+
a(ke, {
|
|
351
|
+
"model-value": !l.hideConfiguration
|
|
352
|
+
}, {
|
|
353
|
+
right: m(() => [
|
|
354
|
+
C("div", Oe, [
|
|
355
|
+
e.value ? (s(), b(ne, {
|
|
356
|
+
key: 0,
|
|
357
|
+
modelValue: e.value,
|
|
358
|
+
"onUpdate:modelValue": r[0] || (r[0] = (t) => e.value = t),
|
|
359
|
+
"hide-configuration": l.hideConfiguration,
|
|
360
|
+
onHideConfiguration: r[1] || (r[1] = (t) => {
|
|
361
|
+
g("hideConfiguration", t);
|
|
362
|
+
})
|
|
363
|
+
}, null, 8, ["modelValue", "hide-configuration"])) : U("", !0)
|
|
364
|
+
])
|
|
365
|
+
]),
|
|
366
|
+
left: m(() => [
|
|
367
|
+
C("div", qe, [
|
|
368
|
+
a(v, {
|
|
369
|
+
variant: "secondary",
|
|
370
|
+
icon: "keyboard_double_arrow_right",
|
|
371
|
+
"border-color": o(W).ColorPrimary,
|
|
372
|
+
"text-color": o(W).ColorPrimary,
|
|
373
|
+
class: "m-24 my-16",
|
|
374
|
+
size: "md",
|
|
375
|
+
onClick: r[2] || (r[2] = (t) => g("hideConfiguration", !l.hideConfiguration))
|
|
376
|
+
}, null, 8, ["border-color", "text-color"])
|
|
377
|
+
])
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
}, 8, ["model-value"]),
|
|
381
|
+
C("div", Ue, [
|
|
382
|
+
e.value.tiles.length > 0 ? (s(), x("div", Ne, [
|
|
383
|
+
(s(!0), x(q, null, H(e.value.tiles, (t, V) => (s(), b(le, {
|
|
384
|
+
key: `${o(Y)()}_${V}`,
|
|
385
|
+
"model-value": t,
|
|
386
|
+
index: V,
|
|
387
|
+
"hide-export": !0
|
|
388
|
+
}, null, 8, ["model-value", "index"]))), 128))
|
|
389
|
+
])) : (s(), b(re, { key: 1 }))
|
|
390
|
+
])
|
|
391
|
+
], 64)) : (s(), b(n, { key: 0 }))
|
|
392
|
+
]);
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}), Ee = {
|
|
396
|
+
key: 0,
|
|
397
|
+
class: "grid grid-cols-12 gap-[16px]"
|
|
398
|
+
}, We = /* @__PURE__ */ S({
|
|
399
|
+
__name: "ReportEditorMobile",
|
|
400
|
+
props: /* @__PURE__ */ $({
|
|
401
|
+
hideConfiguration: { type: Boolean, required: !0, default: !1 }
|
|
402
|
+
}, {
|
|
403
|
+
modelValue: { required: !0, default: () => {
|
|
404
|
+
} },
|
|
405
|
+
modelModifiers: {}
|
|
406
|
+
}),
|
|
407
|
+
emits: /* @__PURE__ */ $(["hideConfiguration"], ["update:modelValue"]),
|
|
408
|
+
setup(p, { emit: u }) {
|
|
409
|
+
const e = M(p, "modelValue"), l = p, g = u;
|
|
410
|
+
return (i, r) => {
|
|
411
|
+
const n = c("FmCircularProgress"), v = c("FmCard");
|
|
412
|
+
return s(), x("div", null, [
|
|
413
|
+
e.value ? (s(), x(q, { key: 1 }, [
|
|
414
|
+
a(v, { class: "px-5 pb-28" }, {
|
|
415
|
+
default: m(() => [
|
|
416
|
+
e.value.tiles.length > 0 ? (s(), x("div", Ee, [
|
|
417
|
+
(s(!0), x(q, null, H(e.value.tiles, (t, V) => (s(), b(le, {
|
|
418
|
+
key: `${o(Y)()}_${V}`,
|
|
419
|
+
"model-value": t,
|
|
420
|
+
index: V,
|
|
421
|
+
"hide-export": !0
|
|
422
|
+
}, null, 8, ["model-value", "index"]))), 128))
|
|
423
|
+
])) : (s(), b(re, { key: 1 }))
|
|
424
|
+
]),
|
|
425
|
+
_: 1
|
|
426
|
+
}),
|
|
427
|
+
e.value ? (s(), b(ne, {
|
|
428
|
+
key: 0,
|
|
429
|
+
modelValue: e.value,
|
|
430
|
+
"onUpdate:modelValue": r[0] || (r[0] = (t) => e.value = t),
|
|
431
|
+
"hide-configuration": l.hideConfiguration,
|
|
432
|
+
onHideConfiguration: r[1] || (r[1] = (t) => {
|
|
433
|
+
g("hideConfiguration", t);
|
|
434
|
+
})
|
|
435
|
+
}, null, 8, ["modelValue", "hide-configuration"])) : U("", !0)
|
|
436
|
+
], 64)) : (s(), b(n, { key: 0 }))
|
|
437
|
+
]);
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
}), Xe = /* @__PURE__ */ S({
|
|
441
|
+
__name: "ReportEditor",
|
|
442
|
+
setup(p) {
|
|
443
|
+
const u = ee(), e = oe(), l = X(), { promptLoader: g } = he(), { t: i } = I(), { currentReport: r, editingReport: n } = Z(l), { breakpoints: v } = A(), t = P(() => {
|
|
444
|
+
var k;
|
|
445
|
+
return !((k = n.value) != null && k.editable);
|
|
446
|
+
}), V = P(() => {
|
|
447
|
+
var k;
|
|
448
|
+
return ((k = n.value) == null ? void 0 : k.name) ?? i("report.editor.newReport");
|
|
449
|
+
}), B = xe(), { promptMessage: h } = te(), R = N(!1);
|
|
450
|
+
async function T() {
|
|
451
|
+
if (!n.value || n.value.tiles.length === 0) {
|
|
452
|
+
B.open({ message: i("report.messages.noWidget"), type: "error" });
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const k = t.value ? i("report.common.clone") : i("report.common.save");
|
|
456
|
+
if (await h({
|
|
457
|
+
title: `${i("report.messages.saveReport")}`,
|
|
458
|
+
message: i("report.messages.confirmAction", { action: k, name: V.value })
|
|
459
|
+
}))
|
|
460
|
+
try {
|
|
461
|
+
await g(async () => {
|
|
462
|
+
if (t.value) {
|
|
463
|
+
const d = JSON.parse(JSON.stringify(n.value));
|
|
464
|
+
d.editable = !0, d.id = "", d.name = `${d.name} ${i("report.common.duplicate")}`, await l.createOrUpdateReport(d);
|
|
465
|
+
} else
|
|
466
|
+
n.value && await l.createOrUpdateReport(n.value);
|
|
467
|
+
u.push({
|
|
468
|
+
name: "reportView",
|
|
469
|
+
query: e.query
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
} catch (d) {
|
|
473
|
+
console.log(d), B.open({
|
|
474
|
+
message: i("report.messages.failedToAction", { action: k }),
|
|
475
|
+
type: "error"
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
async function _() {
|
|
480
|
+
var F;
|
|
481
|
+
if (!n.value) return;
|
|
482
|
+
await h({
|
|
483
|
+
title: i("report.common.report", 1),
|
|
484
|
+
message: i("report.editor.notSaved", { name: (F = n.value) == null ? void 0 : F.name })
|
|
485
|
+
}) && (n.value = JSON.parse(JSON.stringify(r.value)), u.back());
|
|
486
|
+
}
|
|
487
|
+
return ge(() => {
|
|
488
|
+
n.value || u.push({ name: "reports" });
|
|
489
|
+
}), (k, F) => {
|
|
490
|
+
const d = c("FmChip"), f = c("FmPageHead");
|
|
491
|
+
return s(), b(Fe, null, {
|
|
492
|
+
default: m(() => [
|
|
493
|
+
a(f, {
|
|
494
|
+
actions: [
|
|
495
|
+
{ label: o(i)("report.common.cancel"), value: "cancel", isPrimary: !1 },
|
|
496
|
+
{ label: "Save Report", value: "save", isPrimary: !0, prependIcon: "download" }
|
|
497
|
+
],
|
|
498
|
+
"onClick:action": F[0] || (F[0] = (w) => {
|
|
499
|
+
w === "cancel" && _(), w === "save" && T();
|
|
500
|
+
})
|
|
501
|
+
}, {
|
|
502
|
+
title: m(() => [
|
|
503
|
+
C("p", {
|
|
504
|
+
class: E(`${o(v).sm || o(v).xs ? "hidden" : ""} fm-typo-en-title-md-600`)
|
|
505
|
+
}, O(V.value), 3),
|
|
506
|
+
!o(n) || o(n).tiles.length <= 0 ? (s(), b(d, {
|
|
507
|
+
key: 0,
|
|
508
|
+
label: o(i)("report.common.draft"),
|
|
509
|
+
icon: "hexagon",
|
|
510
|
+
selectable: !1
|
|
511
|
+
}, null, 8, ["label"])) : U("", !0)
|
|
512
|
+
]),
|
|
513
|
+
_: 1
|
|
514
|
+
}, 8, ["actions"]),
|
|
515
|
+
o(n) ? (s(), b(K(o(v).lg || o(v).md ? Pe : We), {
|
|
516
|
+
key: 0,
|
|
517
|
+
modelValue: o(n),
|
|
518
|
+
"onUpdate:modelValue": F[1] || (F[1] = (w) => Q(n) ? n.value = w : null),
|
|
519
|
+
class: E(`${o(v).lg || o(v).md ? "flex" : ""} w-full`),
|
|
520
|
+
style: _e({ height: `calc( 100% - ${o(v).lg || o(v).md ? 72 : 64}px)` }),
|
|
521
|
+
"hide-configuration": R.value,
|
|
522
|
+
onHideConfiguration: F[2] || (F[2] = (w) => R.value = w)
|
|
523
|
+
}, null, 40, ["modelValue", "class", "style", "hide-configuration"])) : U("", !0)
|
|
524
|
+
]),
|
|
525
|
+
_: 1
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
export {
|
|
531
|
+
Xe as default
|
|
532
|
+
};
|