@feedmepos/mf-report 5.8.2-beta.0 → 5.9.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{App-CVBF-RIq.js → App-CQsY_29Q.js} +17 -18
  2. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-w7lSYFth.js +180 -0
  3. package/dist/{Default.vue_vue_type_script_setup_true_lang-CwNa_c74.js → Default.vue_vue_type_script_setup_true_lang-DeKEY6-a.js} +2 -2
  4. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-Dc0etyos.js +1447 -0
  5. package/dist/{InsightView-D6X9jnLz.js → InsightView-DmM_alRs.js} +7 -8
  6. package/dist/Integration-CAX-hbPd.js +5222 -0
  7. package/dist/Integrations-DRYSVJuG.js +338 -0
  8. package/dist/{Layout-0ZxLP82K.js → Layout-CDCrzjoH.js} +1 -1
  9. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-DNxXgTX4.js +342 -0
  10. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-D1VWyu4i.js → NavigationTab.vue_vue_type_script_setup_true_lang-DpFJ_jYh.js} +1078 -1080
  11. package/dist/NoData.vue_vue_type_script_setup_true_lang-DGTWa4E5.js +38 -0
  12. package/dist/{OverviewView-BFjjTkkR.js → OverviewView-DeGcbroH.js} +5 -5
  13. package/dist/{Report-Cvoqjnpe.js → Report-Do9-H4EW.js} +4 -4
  14. package/dist/ReportEditor-D4bnl00E.js +968 -0
  15. package/dist/{ReportView-6niCdR8K.js → ReportView-Cz6U-DNK.js} +7 -7
  16. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-Dq9vY9mj.js +110 -0
  17. package/dist/{Setting-BidP77Xr.js → Setting-DIAFop5l.js} +26 -23
  18. package/dist/TileEditor-DGhgxgTD.js +3080 -0
  19. package/dist/{TransitionFade-4Zow9tAu.js → TransitionFade-DmQjTWuM.js} +207 -203
  20. package/dist/app.js +59 -19
  21. package/dist/helper-CPPrXQSs.js +75 -0
  22. package/dist/style.css +1 -1
  23. package/dist/{v4-CLzZSDqm.js → v4-ZW3e7y3R.js} +1955 -1844
  24. package/dist/{global-loader-BQlMgPFO.js → vue-i18n-CbAseuRE.js} +2057 -1976
  25. package/package.json +1 -1
  26. package/dist/DateRangeSelect.vue_vue_type_script_setup_true_lang-2O6NpHjE.js +0 -162
  27. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-DW-6QTKl.js +0 -1417
  28. package/dist/Integration-oTDRNhG8.js +0 -4751
  29. package/dist/Integrations-DN2WNYXH.js +0 -334
  30. package/dist/MenuTab.vue_vue_type_script_setup_true_lang-DI3QDb25.js +0 -101
  31. package/dist/NoData.vue_vue_type_script_setup_true_lang-C10GhV_H.js +0 -31
  32. package/dist/ReportEditor-DkdI7ZmZ.js +0 -621
  33. package/dist/SelectComponent.vue_vue_type_script_setup_true_lang-B-9VcGRC.js +0 -104
  34. package/dist/TileEditor-DCNCfcEY.js +0 -3016
  35. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  36. package/dist/index-Dw6wKcLo.js +0 -147
  37. package/dist/report-schema-IaDHay9I.js +0 -31
@@ -1,621 +0,0 @@
1
- import { defineComponent as N, mergeModels as q, useModel as E, ref as W, computed as S, resolveComponent as u, createBlock as b, openBlock as l, withCtx as c, createElementVNode as h, createVNode as r, unref as e, normalizeClass as K, createTextVNode as _e, toDisplayString as P, createElementBlock as C, Fragment as O, renderSlot as ue, createCommentVNode as H, watch as he, resolveDynamicComponent as ye, isRef as de, renderList as z, normalizeStyle as ne, onMounted as we } from "vue";
2
- import { W as be, i as xe, S as Ce, d as ke, T as Ve, _ as Fe } from "./TransitionFade-4Zow9tAu.js";
3
- import { a as me, v as oe } from "./v4-CLzZSDqm.js";
4
- import { storeToRefs as ce } from "pinia";
5
- import { useRouter as pe, useRoute as ve } from "vue-router";
6
- import { useBreakpoints as X, FmButtonColorThemeVariant as Q, useSnackbar as $e } from "@feedmepos/ui-library";
7
- import { u as fe } from "./message-dialog-UoMWOnil.js";
8
- import { u as Y, f as Se } from "./global-loader-BQlMgPFO.js";
9
- import { _ as le } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-DW-6QTKl.js";
10
- import { _ as re } from "./NoData.vue_vue_type_script_setup_true_lang-C10GhV_H.js";
11
- import { r as ie } from "./i18n-Cif1I9J2.js";
12
- const Me = /* @__PURE__ */ N({
13
- __name: "WidgetDialog",
14
- props: /* @__PURE__ */ q({
15
- isOpen: { type: Boolean }
16
- }, {
17
- modelValue: {},
18
- modelModifiers: {}
19
- }),
20
- emits: /* @__PURE__ */ q(["isOpen"], ["update:modelValue"]),
21
- setup(y, { emit: d }) {
22
- const { t: a } = Y(), { breakpoints: t } = X(), p = E(y, "modelValue"), o = y, g = d;
23
- function i() {
24
- g("isOpen", !1);
25
- }
26
- function M() {
27
- s.value && (p.value = s.value, s.value = void 0, g("isOpen", !1));
28
- }
29
- const s = W(), T = S(() => !s.value);
30
- return (B, F) => {
31
- const R = u("FmButton"), m = u("FmDialog");
32
- return l(), b(m, {
33
- "model-value": o.isOpen
34
- }, {
35
- "dialog-header": c(() => [
36
- _e(P(e(a)("report.widget.type")), 1)
37
- ]),
38
- default: c(() => [
39
- r(be, {
40
- modelValue: s.value,
41
- "onUpdate:modelValue": F[0] || (F[0] = (n) => s.value = n),
42
- class: K(`grid ${e(t).lg || e(t).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
43
- "child-class": "p-[8px] flex flex-col"
44
- }, null, 8, ["modelValue", "class"])
45
- ]),
46
- "dialog-footer": c(() => [
47
- F[1] || (F[1] = h("div", { class: "grow" }, null, -1)),
48
- r(R, {
49
- label: e(a)("report.common.cancel"),
50
- variant: "tertiary",
51
- onClick: i
52
- }, null, 8, ["label"]),
53
- r(R, {
54
- label: e(a)("report.common.confirm"),
55
- disabled: T.value,
56
- onClick: M
57
- }, null, 8, ["label", "disabled"])
58
- ]),
59
- _: 1
60
- }, 8, ["model-value"]);
61
- };
62
- }
63
- }), Te = { class: "fm-typo-en-body-lg-600" }, ae = /* @__PURE__ */ N({
64
- __name: "ReportEditorTabHeader",
65
- props: /* @__PURE__ */ q({
66
- icon: {
67
- type: String,
68
- required: !0
69
- }
70
- }, {
71
- modelValue: { type: Boolean, required: !0, default: !1 },
72
- modelModifiers: {}
73
- }),
74
- emits: ["update:modelValue"],
75
- setup(y) {
76
- const { t: d } = Y(), a = E(y, "modelValue"), t = y;
77
- return (p, o) => {
78
- const g = u("FmIcon");
79
- return l(), C("div", {
80
- class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
81
- onClick: o[0] || (o[0] = (i) => a.value = !a.value)
82
- }, [
83
- h("p", Te, P(e(d)("report.editor.customizeReport")), 1),
84
- o[1] || (o[1] = h("div", { class: "grow" }, null, -1)),
85
- r(g, {
86
- name: t.icon
87
- }, null, 8, ["name"])
88
- ]);
89
- };
90
- }
91
- }), Re = /* @__PURE__ */ N({
92
- __name: "ReportEditorTabDesktop",
93
- props: {
94
- modelValue: { required: !0, default: !1 },
95
- modelModifiers: {}
96
- },
97
- emits: ["update:modelValue"],
98
- setup(y) {
99
- const d = E(y, "modelValue");
100
- return (a, t) => (l(), C(O, null, [
101
- r(ae, {
102
- modelValue: d.value,
103
- "onUpdate:modelValue": t[0] || (t[0] = (p) => d.value = p),
104
- icon: "keyboard_double_arrow_left"
105
- }, null, 8, ["modelValue"]),
106
- ue(a.$slots, "default")
107
- ], 64));
108
- }
109
- }), Be = /* @__PURE__ */ N({
110
- __name: "ReportEditorTabMobile",
111
- props: {
112
- modelValue: { required: !0, default: !1 },
113
- modelModifiers: {}
114
- },
115
- emits: ["update:modelValue"],
116
- setup(y) {
117
- const d = E(y, "modelValue");
118
- return (a, t) => {
119
- const p = u("FmTopSheet"), o = u("FmCard");
120
- return l(), b(o, { class: "fixed bottom-0 w-full" }, {
121
- default: c(() => [
122
- r(ae, {
123
- modelValue: d.value,
124
- "onUpdate:modelValue": t[0] || (t[0] = (g) => d.value = g),
125
- icon: "keyboard_double_arrow_up"
126
- }, null, 8, ["modelValue"]),
127
- r(p, {
128
- modelValue: d.value,
129
- "onUpdate:modelValue": t[2] || (t[2] = (g) => d.value = g),
130
- "fullscreen-size": "sm"
131
- }, {
132
- default: c(() => [
133
- r(ae, {
134
- modelValue: d.value,
135
- "onUpdate:modelValue": t[1] || (t[1] = (g) => d.value = g),
136
- icon: "keyboard_double_arrow_down"
137
- }, null, 8, ["modelValue"]),
138
- d.value ? ue(a.$slots, "default", { key: 0 }) : H("", !0)
139
- ]),
140
- _: 3
141
- }, 8, ["modelValue"])
142
- ]),
143
- _: 3
144
- });
145
- };
146
- }
147
- }), Oe = { class: "flex flex-col gap-24 top-0 bg-fm-color-neutral-white z-10" }, We = { class: "flex flex-col gap-24" }, qe = { class: "line-clamp-2 overflow-hidden max-w-[195px] w-[195px]" }, se = /* @__PURE__ */ N({
148
- __name: "ReportEditorTab",
149
- props: /* @__PURE__ */ q({
150
- hideConfiguration: {
151
- type: Boolean,
152
- default: !1
153
- }
154
- }, {
155
- modelValue: { required: !0 },
156
- modelModifiers: {}
157
- }),
158
- emits: /* @__PURE__ */ q(["hideConfiguration"], ["update:modelValue"]),
159
- setup(y, { emit: d }) {
160
- const a = E(y, "modelValue"), { breakpoints: t } = X(), p = y, o = d, g = pe(), i = ve(), M = W(), { currentSelectWidgetType: s, categories: T, editingTile: B, editingIndex: F } = ce(me()), { promptMessage: R } = fe(), m = W(!1), { t: n, te: D } = Y(), k = W(void 0);
161
- he(
162
- () => s.value,
163
- () => {
164
- s.value !== void 0 && (k.value = xe(s.value), B.value = k.value, F.value = -1, g.push({
165
- name: "tileEditor",
166
- query: i.query
167
- }));
168
- },
169
- { immediate: !0 }
170
- );
171
- const U = [
172
- {
173
- label: n("report.common.edit"),
174
- selected: !1,
175
- variant: "tertiary",
176
- onClick: (w) => {
177
- F.value = w, B.value = JSON.parse(JSON.stringify(a.value.tiles[w])), g.push({
178
- name: "tileEditor",
179
- query: i.query
180
- });
181
- }
182
- },
183
- {
184
- label: n("report.common.duplicate"),
185
- selected: !1,
186
- variant: "tertiary",
187
- onClick: (w) => {
188
- a.value.tiles.push(JSON.parse(JSON.stringify(a.value.tiles[w])));
189
- }
190
- },
191
- {
192
- label: n("report.common.remove"),
193
- selected: !1,
194
- variant: "destructive",
195
- onClick: async (w) => {
196
- await R({
197
- title: n("report.editor.deleteWidget"),
198
- message: n("report.editor.deleteWidgetConfirm", {
199
- title: a.value.tiles[w].widget.title
200
- })
201
- }) && (a.value.tiles = a.value.tiles.filter((J, L) => L !== w));
202
- }
203
- }
204
- ], I = S(() => T.value.map((w) => ({
205
- label: n(`report.category.${w.name}`),
206
- value: w.id
207
- })));
208
- return (w, v) => {
209
- const J = u("FmTextField"), L = u("FmSelect"), j = u("FmButton"), f = u("FmIcon"), x = u("FmTooltip"), $ = u("FmMenuItem"), Z = u("FmMenu"), A = u("FmListItem"), ee = u("FmList"), V = u("FmForm");
210
- return l(), b(ye(e(t).lg || e(t).md ? Re : Be), {
211
- "model-value": p.hideConfiguration,
212
- "onUpdate:modelValue": v[5] || (v[5] = (_) => o("hideConfiguration", _))
213
- }, {
214
- default: c(() => [
215
- r(Me, {
216
- modelValue: e(s),
217
- "onUpdate:modelValue": v[0] || (v[0] = (_) => de(s) ? s.value = _ : null),
218
- "is-open": m.value,
219
- onIsOpen: v[1] || (v[1] = (_) => m.value = _)
220
- }, null, 8, ["modelValue", "is-open"]),
221
- r(V, {
222
- ref_key: "form",
223
- ref: M,
224
- class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
225
- }, {
226
- default: c(() => [
227
- r(Ce, { class: "border-solid" }, {
228
- header: c(() => [
229
- h("p", null, P(e(n)("report.editor.reportInfo")), 1),
230
- v[6] || (v[6] = h("div", { class: "grow" }, null, -1))
231
- ]),
232
- content: c(() => [
233
- h("div", Oe, [
234
- r(J, {
235
- modelValue: a.value.name,
236
- "onUpdate:modelValue": v[2] || (v[2] = (_) => a.value.name = _),
237
- label: e(n)("report.editor.reportTitle"),
238
- placeholder: e(n)("report.editor.placeholder")
239
- }, null, 8, ["modelValue", "label", "placeholder"]),
240
- r(L, {
241
- modelValue: a.value.category,
242
- "onUpdate:modelValue": v[3] || (v[3] = (_) => a.value.category = _),
243
- label: e(n)("report.common.category"),
244
- items: I.value
245
- }, null, 8, ["modelValue", "label", "items"])
246
- ])
247
- ]),
248
- _: 1
249
- }),
250
- h("div", We, [
251
- r(j, {
252
- label: e(n)("report.editor.addWidget"),
253
- variant: "secondary",
254
- icon: "add",
255
- "icon-position": "prepend",
256
- "border-color": e(Q).ColorPrimary,
257
- "text-color": e(Q).ColorPrimary,
258
- onClick: v[4] || (v[4] = (_) => m.value = !0)
259
- }, null, 8, ["label", "border-color", "text-color"]),
260
- r(ee, null, {
261
- default: c(() => [
262
- r(e(ke), {
263
- list: a.value.tiles,
264
- "item-key": "id",
265
- class: "flex flex-col gap-2 cursor-grab",
266
- handle: ".handle"
267
- }, {
268
- item: c(({ element: _, index: G }) => [
269
- r(A, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
270
- default: c(() => [
271
- r(f, {
272
- name: "drag_handle",
273
- class: "handle"
274
- }),
275
- r(x, {
276
- content: _.widget.title ? e(ie)(e(n), e(D), _.widget.title, "other") : e(n)("report.editor.widget", { index: G + 1 }),
277
- class: "handle"
278
- }, {
279
- default: c(() => [
280
- h("p", qe, P(_.widget.title ? e(ie)(e(n), e(D), _.widget.title, "other") : e(n)("report.editor.widget", { index: G + 1 })), 1)
281
- ]),
282
- _: 2
283
- }, 1032, ["content"]),
284
- v[7] || (v[7] = h("div", { class: "grow" }, null, -1)),
285
- r(Z, {
286
- trigger: "click",
287
- shift: !0,
288
- "stop-click-propagation": !0
289
- }, {
290
- "menu-button": c(() => [
291
- r(j, {
292
- "append-icon": "more_vert",
293
- variant: "tertiary"
294
- })
295
- ]),
296
- default: c(() => [
297
- (l(), C(O, null, z(U, (te, ge) => r($, {
298
- key: ge,
299
- onClick: (Ke) => te.onClick(G)
300
- }, {
301
- label: c(() => [
302
- h("p", {
303
- class: K(
304
- te.variant === "destructive" ? " text-fm-color-system-error-300" : ""
305
- )
306
- }, P(te.label), 3)
307
- ]),
308
- _: 2
309
- }, 1032, ["onClick"])), 64))
310
- ]),
311
- _: 2
312
- }, 1024)
313
- ]),
314
- _: 2
315
- }, 1024)
316
- ]),
317
- _: 1
318
- }, 8, ["list"])
319
- ]),
320
- _: 1
321
- })
322
- ])
323
- ]),
324
- _: 1
325
- }, 512)
326
- ]),
327
- _: 1
328
- }, 8, ["model-value"]);
329
- };
330
- }
331
- }), Ne = { class: "h-full w-full overflow-x-hidden" }, Ue = { class: "flex flex-col bg-fm-color-neutral-white w-[400px]" }, Pe = { class: "flex bg-fm-color-neutral-white w-[88px]" }, He = {
332
- key: 1,
333
- class: "w-full overflow-y-auto"
334
- }, Ee = {
335
- key: 0,
336
- class: "w-full grid grid-cols-12 gap-[24px] p-24"
337
- }, De = { key: 2 }, Ie = {
338
- key: 0,
339
- class: "grid grid-cols-12 gap-[16px]"
340
- }, Le = {
341
- key: 3,
342
- class: "h-full w-full flex items-start justify-center bg-fm-color-neutral-white py-24",
343
- style: { backgroundColor: "#F6F8FC" }
344
- }, ze = {
345
- key: 0,
346
- class: "w-full grid grid-cols-12 gap-[24px] p-24"
347
- }, Je = /* @__PURE__ */ N({
348
- __name: "ReportEditorViewport",
349
- props: /* @__PURE__ */ q({
350
- hideConfiguration: { type: Boolean, required: !1, default: !1 },
351
- previewWidth: { type: Number, required: !0 },
352
- previewHeight: { type: Number, required: !0 },
353
- previewScale: { type: Number, required: !0 }
354
- }, {
355
- modelValue: { required: !0, default: () => {
356
- } },
357
- modelModifiers: {}
358
- }),
359
- emits: /* @__PURE__ */ q(["hideConfiguration"], ["update:modelValue"]),
360
- setup(y, { emit: d }) {
361
- const { breakpoints: a } = X(), t = E(y, "modelValue"), p = y, o = S(() => p.previewWidth > 0 && p.previewHeight > 0), g = S(() => a.value.sm || a.value.xs), i = d;
362
- return (M, s) => {
363
- const T = u("FmCircularProgress"), B = u("FmButton"), F = u("FmMenuDivider"), R = u("FmCard");
364
- return l(), C("div", Ne, [
365
- t.value ? (l(), C(O, { key: 1 }, [
366
- o.value ? H("", !0) : (l(), b(Ve, {
367
- key: 0,
368
- "model-value": !p.hideConfiguration
369
- }, {
370
- right: c(() => [
371
- h("div", Ue, [
372
- t.value ? (l(), b(se, {
373
- key: 0,
374
- modelValue: t.value,
375
- "onUpdate:modelValue": s[0] || (s[0] = (m) => t.value = m),
376
- "hide-configuration": p.hideConfiguration,
377
- onHideConfiguration: s[1] || (s[1] = (m) => i("hideConfiguration", m))
378
- }, null, 8, ["modelValue", "hide-configuration"])) : H("", !0)
379
- ])
380
- ]),
381
- left: c(() => [
382
- h("div", Pe, [
383
- r(B, {
384
- variant: "secondary",
385
- icon: "keyboard_double_arrow_right",
386
- "border-color": e(Q).ColorPrimary,
387
- "text-color": e(Q).ColorPrimary,
388
- class: "m-24 my-16",
389
- size: "md",
390
- onClick: s[2] || (s[2] = (m) => i("hideConfiguration", !p.hideConfiguration))
391
- }, null, 8, ["border-color", "text-color"])
392
- ])
393
- ]),
394
- _: 1
395
- }, 8, ["model-value"])),
396
- r(F, {
397
- vertical: "",
398
- style: { margin: "0px" }
399
- }),
400
- !g.value && !o.value ? (l(), C("div", He, [
401
- t.value.tiles.length > 0 ? (l(), C("div", Ee, [
402
- (l(!0), C(O, null, z(t.value.tiles, (m, n) => (l(), b(le, {
403
- key: `${e(oe)()}_${n}`,
404
- "model-value": m,
405
- index: n,
406
- "hide-export": !0
407
- }, null, 8, ["model-value", "index"]))), 128))
408
- ])) : (l(), b(re, { key: 1 }))
409
- ])) : g.value && !o.value ? (l(), C("div", De, [
410
- r(R, { class: "px-5 pb-28" }, {
411
- default: c(() => [
412
- t.value.tiles.length > 0 ? (l(), C("div", Ie, [
413
- (l(!0), C(O, null, z(t.value.tiles, (m, n) => (l(), b(le, {
414
- key: `${e(oe)()}_${n}`,
415
- "model-value": m,
416
- index: n,
417
- "hide-export": !0
418
- }, null, 8, ["model-value", "index"]))), 128))
419
- ])) : (l(), b(re, { key: 1 }))
420
- ]),
421
- _: 1
422
- }),
423
- t.value ? (l(), b(se, {
424
- key: 0,
425
- modelValue: t.value,
426
- "onUpdate:modelValue": s[3] || (s[3] = (m) => t.value = m),
427
- "hide-configuration": p.hideConfiguration,
428
- onHideConfiguration: s[4] || (s[4] = (m) => {
429
- i("hideConfiguration", m);
430
- })
431
- }, null, 8, ["modelValue", "hide-configuration"])) : H("", !0)
432
- ])) : (l(), C("div", Le, [
433
- h("div", {
434
- style: ne({
435
- transformOrigin: "top center",
436
- transform: `scale(${p.previewScale})`
437
- })
438
- }, [
439
- h("div", {
440
- class: "overflow-y-auto bg-white rounded-lg",
441
- style: ne({
442
- width: p.previewWidth + "px",
443
- height: p.previewHeight + "px"
444
- })
445
- }, [
446
- t.value.tiles.length > 0 ? (l(), C("div", ze, [
447
- (l(!0), C(O, null, z(t.value.tiles, (m, n) => (l(), b(le, {
448
- key: `${e(oe)()}_${n}`,
449
- "model-value": m,
450
- index: n,
451
- "hide-export": !0,
452
- "custom-screen-width": p.previewWidth
453
- }, null, 8, ["model-value", "index", "custom-screen-width"]))), 128))
454
- ])) : (l(), b(re, { key: 1 }))
455
- ], 4)
456
- ], 4)
457
- ]))
458
- ], 64)) : (l(), b(T, { key: 0 }))
459
- ]);
460
- };
461
- }
462
- }), je = { class: "flex items-center gap-4" }, Ae = { class: "flex justify-center items-center gap-2 w-full" }, Ge = { class: "flex gap-4" }, it = /* @__PURE__ */ N({
463
- __name: "ReportEditor",
464
- setup(y) {
465
- const d = pe(), a = ve(), t = me(), { promptLoader: p } = Se(), { t: o } = Y(), { currentReport: g, editingReport: i } = ce(t), { breakpoints: M } = X(), s = S(() => {
466
- var f;
467
- return !((f = i.value) != null && f.editable);
468
- }), T = S(() => {
469
- var f;
470
- return ((f = i.value) == null ? void 0 : f.name) ?? o("report.editor.newReport");
471
- }), B = $e(), { promptMessage: F } = fe(), R = W(!1);
472
- async function m() {
473
- if (!i.value || i.value.tiles.length === 0) {
474
- B.open({ message: o("report.messages.noWidget"), type: "error" });
475
- return;
476
- }
477
- const f = s.value ? o("report.common.clone") : o("report.common.save");
478
- if (await F({
479
- title: `${o("report.messages.saveReport")}`,
480
- message: o("report.messages.confirmAction", { action: f, name: T.value })
481
- }))
482
- try {
483
- await p(async () => {
484
- if (s.value) {
485
- const $ = JSON.parse(JSON.stringify(i.value));
486
- $.editable = !0, $.id = "", $.name = `${$.name} ${o("report.common.duplicate")}`, await t.createOrUpdateReport($);
487
- } else
488
- i.value && await t.createOrUpdateReport(i.value);
489
- d.push({
490
- name: "reportView",
491
- query: a.query
492
- });
493
- });
494
- } catch ($) {
495
- console.log($), B.open({
496
- message: o("report.messages.failedToAction", { action: f }),
497
- type: "error"
498
- });
499
- }
500
- }
501
- async function n() {
502
- var x;
503
- if (!i.value) return;
504
- await F({
505
- title: o("report.common.report", 1),
506
- message: o("report.editor.notSaved", { name: (x = i.value) == null ? void 0 : x.name })
507
- }) && (i.value = JSON.parse(JSON.stringify(g.value)), d.back());
508
- }
509
- we(() => {
510
- i.value || d.push({ name: "reports" });
511
- });
512
- const D = [
513
- {
514
- label: o("report.common.default"),
515
- width: void 0,
516
- height: void 0
517
- },
518
- {
519
- label: o("report.editor.devices.desktop"),
520
- width: 1920,
521
- height: 1080
522
- },
523
- {
524
- label: o("report.editor.devices.tablet"),
525
- width: 820,
526
- height: 1180
527
- },
528
- {
529
- label: o("report.editor.devices.phone"),
530
- width: 390,
531
- height: 859
532
- }
533
- ], k = W(D[0]), U = W(!1), I = S(() => U.value ? Math.max(k.value.width || 0, k.value.height || 0) : Math.min(k.value.width || 0, k.value.height || 0)), w = S(() => U.value ? Math.min(k.value.width || 0, k.value.height || 0) : Math.max(k.value.width || 0, k.value.height || 0)), v = S(() => window.innerHeight - 72 - 56), J = S(() => {
534
- if (!I.value) return 1;
535
- let f = (v.value - 48) / I.value, x = w.value * f;
536
- return x > window.innerWidth && (f = window.innerWidth / w.value, x = w.value * f), f > 1 ? 1 : f;
537
- });
538
- function L(f) {
539
- k.value = f;
540
- }
541
- function j() {
542
- U.value = !U.value;
543
- }
544
- return (f, x) => {
545
- const $ = u("FmTooltip"), Z = u("FmChip"), A = u("FmButton"), ee = u("FmPageHead");
546
- return l(), b(Fe, null, {
547
- default: c(() => [
548
- r(ee, {
549
- actions: [
550
- { label: e(o)("report.common.cancel"), value: "cancel", isPrimary: !1 },
551
- { label: "Save Report", value: "save", isPrimary: !0, prependIcon: "download" }
552
- ],
553
- "onClick:action": x[0] || (x[0] = (V) => {
554
- V === "cancel" && n(), V === "save" && m();
555
- })
556
- }, {
557
- title: c(() => [
558
- h("div", je, [
559
- r($, {
560
- content: T.value,
561
- placement: "bottom"
562
- }, {
563
- default: c(() => [
564
- h("p", {
565
- class: K(`${e(M).sm || e(M).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 max-w-[250px]`)
566
- }, P(T.value), 3)
567
- ]),
568
- _: 1
569
- }, 8, ["content"]),
570
- !e(i) || e(i).tiles.length <= 0 ? (l(), b(Z, {
571
- key: 0,
572
- label: e(o)("report.editor.draft"),
573
- icon: "hexagon",
574
- selectable: !1
575
- }, null, 8, ["label"])) : H("", !0),
576
- h("div", Ae, [
577
- h("div", Ge, [
578
- (l(), C(O, null, z(D, (V) => {
579
- var _;
580
- return r(A, {
581
- key: V.label,
582
- label: V.label,
583
- variant: ((_ = k.value) == null ? void 0 : _.label) === V.label ? "primary" : "secondary",
584
- size: "md",
585
- onClick: (G) => L(V)
586
- }, null, 8, ["label", "variant", "onClick"]);
587
- }), 64))
588
- ]),
589
- r(A, {
590
- icon: "screen_rotation",
591
- variant: "tertiary",
592
- size: "md",
593
- class: "text-fm-color-typo-primary",
594
- onClick: j
595
- })
596
- ])
597
- ])
598
- ]),
599
- _: 1
600
- }, 8, ["actions"]),
601
- e(i) ? (l(), b(Je, {
602
- key: 0,
603
- modelValue: e(i),
604
- "onUpdate:modelValue": x[1] || (x[1] = (V) => de(i) ? i.value = V : null),
605
- style: ne({ height: v.value + "px" }),
606
- class: K(e(M).lg || e(M).md ? "flex" : ""),
607
- "hide-configuration": R.value,
608
- "preview-width": w.value,
609
- "preview-height": I.value,
610
- "preview-scale": J.value,
611
- onHideConfiguration: x[2] || (x[2] = (V) => R.value = V)
612
- }, null, 8, ["modelValue", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : H("", !0)
613
- ]),
614
- _: 1
615
- });
616
- };
617
- }
618
- });
619
- export {
620
- it as default
621
- };