@feedmepos/mf-report 5.9.3 → 5.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/dist/{App-BUBHxOQh.js → App-Cak_uBjR.js} +3 -3
  2. package/dist/{Default.vue_vue_type_script_setup_true_lang-CVQN5Crh.js → Default.vue_vue_type_script_setup_true_lang-7R1_-2m_.js} +1 -1
  3. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-WJ74hxyF.js +1482 -0
  4. package/dist/{InsightView-Dqw-PMlu.js → InsightView-ytSP2Vq7.js} +2 -2
  5. package/dist/{Layout-BcetWHd5.js → Layout-CZh-hJDO.js} +1 -1
  6. package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-C19m3RYh.js → MenuTab.vue_vue_type_script_setup_true_lang-D_9fHdMK.js} +2 -2
  7. package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-9GZwxmEH.js → NavigationTab.vue_vue_type_script_setup_true_lang-CT6SKzZ7.js} +1 -1
  8. package/dist/{OverviewView-BhhggKN1.js → OverviewView-CupTN81Q.js} +4 -4
  9. package/dist/{Report-Dkt9T8U9.js → Report-DFGdvYLz.js} +2 -2
  10. package/dist/{ReportEditor-B0gXWxUZ.js → ReportEditor-M6Uh4ji9.js} +375 -371
  11. package/dist/{ReportView-BpOsRNDM.js → ReportView-yrEAhD1n.js} +5 -5
  12. package/dist/{Setting-FC7-HpBf.js → Setting-9DGriOjZ.js} +2 -2
  13. package/dist/{TileEditor-DJaTxCh3.js → TileEditor-DAymbo2P.js} +1070 -1048
  14. package/dist/{TransitionFade-Cvz_8cqj.js → TransitionFade-ruG_Zz9q.js} +2 -2
  15. package/dist/app.js +21 -13
  16. package/dist/assets/formatChartData.worker-Bp7azaza.js +4 -0
  17. package/dist/v4-CTD5AfhN.js +10815 -0
  18. package/package.json +1 -1
  19. package/dist/DynamicWidget.vue_vue_type_script_setup_true_lang-D20xNsl_.js +0 -1447
  20. package/dist/v4-jtBT29ev.js +0 -18676
@@ -1,16 +1,16 @@
1
- import { defineComponent as G, mergeModels as J, useModel as j, ref as W, computed as N, resolveComponent as v, createBlock as x, openBlock as i, withCtx as s, createElementVNode as b, createVNode as a, unref as e, normalizeClass as le, createTextVNode as ue, toDisplayString as P, createElementBlock as V, Fragment as L, renderSlot as Ce, createCommentVNode as Y, watch as de, renderList as Q, resolveDynamicComponent as Be, isRef as ke, normalizeStyle as me, onMounted as Ue } from "vue";
2
- import { W as De, i as We, S as he, d as ye, T as Re, _ as qe } from "./TransitionFade-Cvz_8cqj.js";
3
- import { D as K, c as Ie, C as _e, a as Ve, b as Pe, v as ee } from "./v4-jtBT29ev.js";
4
- import { storeToRefs as ce } from "pinia";
1
+ import { defineComponent as G, mergeModels as J, useModel as j, ref as R, computed as N, resolveComponent as v, createBlock as C, openBlock as i, withCtx as s, createElementVNode as h, createVNode as a, unref as e, normalizeClass as le, createTextVNode as de, toDisplayString as E, createElementBlock as S, Fragment as L, renderSlot as Ce, createCommentVNode as Y, watch as me, renderList as Q, resolveDynamicComponent as Be, isRef as ke, normalizeStyle as ce, onMounted as Ue } from "vue";
2
+ import { W as We, i as De, S as he, d as ye, T as Re, _ as qe } from "./TransitionFade-ruG_Zz9q.js";
3
+ import { D as K, c as Ie, C as we, a as Ve, b as Ee, v as ee } from "./v4-CTD5AfhN.js";
4
+ import { storeToRefs as ae } from "pinia";
5
5
  import { useRouter as Se, useRoute as $e } from "vue-router";
6
- import { useBreakpoints as ae, useSnackbar as Oe, FmButtonColorThemeVariant as X } from "@feedmepos/ui-library";
6
+ import { useBreakpoints as ne, useSnackbar as Oe, FmButtonColorThemeVariant as X } from "@feedmepos/ui-library";
7
7
  import { u as Te } from "./message-dialog-UoMWOnil.js";
8
- import { u as te, j as re, f as Ee } from "./vue-i18n-DX0diAld.js";
9
- import { _ as ie } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-D20xNsl_.js";
10
- import { _ as se } from "./NoData.vue_vue_type_script_setup_true_lang-D-J81GXC.js";
11
- import { r as we } from "./i18n-Cif1I9J2.js";
8
+ import { u as te, j as ie, f as He } from "./vue-i18n-DX0diAld.js";
9
+ import { _ as se } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-WJ74hxyF.js";
10
+ import { _ as ue } from "./NoData.vue_vue_type_script_setup_true_lang-D-J81GXC.js";
11
+ import { r as _e } from "./i18n-Cif1I9J2.js";
12
12
  import { _ as Fe } from "./SelectComponent.vue_vue_type_script_setup_true_lang-CGlkGXWL.js";
13
- const ze = /* @__PURE__ */ G({
13
+ const Pe = /* @__PURE__ */ G({
14
14
  __name: "WidgetDialog",
15
15
  props: /* @__PURE__ */ J({
16
16
  isOpen: { type: Boolean }
@@ -19,49 +19,49 @@ const ze = /* @__PURE__ */ G({
19
19
  modelModifiers: {}
20
20
  }),
21
21
  emits: /* @__PURE__ */ J(["update:isOpen"], ["update:modelValue"]),
22
- setup(F, { emit: u }) {
23
- const { t: n } = te(), { breakpoints: r } = ae(), y = j(F, "modelValue"), d = F, w = u;
24
- function m() {
25
- w("update:isOpen", !1);
22
+ setup(x, { emit: d }) {
23
+ const { t: n } = te(), { breakpoints: r } = ne(), w = j(x, "modelValue"), m = x, _ = d;
24
+ function u() {
25
+ _("update:isOpen", !1);
26
26
  }
27
- function C() {
28
- c.value && (y.value = c.value, c.value = void 0, w("update:isOpen", !1));
27
+ function k() {
28
+ c.value && (w.value = c.value, c.value = void 0, _("update:isOpen", !1));
29
29
  }
30
- const c = W(), R = N(() => !c.value);
31
- return (q, O) => {
32
- const B = v("FmButton"), g = v("FmDialog");
33
- return i(), x(g, {
34
- "model-value": d.isOpen
30
+ const c = R(), q = N(() => !c.value);
31
+ return (I, T) => {
32
+ const B = v("FmButton"), b = v("FmDialog");
33
+ return i(), C(b, {
34
+ "model-value": m.isOpen
35
35
  }, {
36
36
  "dialog-header": s(() => [
37
- ue(P(e(n)("report.widget.type")), 1)
37
+ de(E(e(n)("report.widget.type")), 1)
38
38
  ]),
39
39
  default: s(() => [
40
- a(De, {
40
+ a(We, {
41
41
  modelValue: c.value,
42
- "onUpdate:modelValue": O[0] || (O[0] = ($) => c.value = $),
42
+ "onUpdate:modelValue": T[0] || (T[0] = (O) => c.value = O),
43
43
  class: le(`grid ${e(r).lg || e(r).md ? "grid-cols-3 gap-3" : "grid-cols-2 gap-3"}`),
44
44
  "child-class": "p-[8px] flex flex-col"
45
45
  }, null, 8, ["modelValue", "class"])
46
46
  ]),
47
47
  "dialog-footer": s(() => [
48
- O[1] || (O[1] = b("div", { class: "grow" }, null, -1)),
48
+ T[1] || (T[1] = h("div", { class: "grow" }, null, -1)),
49
49
  a(B, {
50
50
  label: e(n)("report.common.cancel"),
51
51
  variant: "tertiary",
52
- onClick: m
52
+ onClick: u
53
53
  }, null, 8, ["label"]),
54
54
  a(B, {
55
55
  label: e(n)("report.common.confirm"),
56
- disabled: R.value,
57
- onClick: C
56
+ disabled: q.value,
57
+ onClick: k
58
58
  }, null, 8, ["label", "disabled"])
59
59
  ]),
60
60
  _: 1
61
61
  }, 8, ["model-value"]);
62
62
  };
63
63
  }
64
- }), He = { class: "fm-typo-en-body-lg-600" }, pe = /* @__PURE__ */ G({
64
+ }), ze = { class: "fm-typo-en-body-lg-600" }, pe = /* @__PURE__ */ G({
65
65
  __name: "ReportEditorTabHeader",
66
66
  props: /* @__PURE__ */ J({
67
67
  icon: {
@@ -73,17 +73,17 @@ const ze = /* @__PURE__ */ G({
73
73
  modelModifiers: {}
74
74
  }),
75
75
  emits: ["update:modelValue"],
76
- setup(F) {
77
- const { t: u } = te(), n = j(F, "modelValue"), r = F;
78
- return (y, d) => {
79
- const w = v("FmIcon");
80
- return i(), V("div", {
76
+ setup(x) {
77
+ const { t: d } = te(), n = j(x, "modelValue"), r = x;
78
+ return (w, m) => {
79
+ const _ = v("FmIcon");
80
+ return i(), S("div", {
81
81
  class: "px-6 py-16 flex items-center gap-2 bg-fm-color-neutral-white border cursor-pointer",
82
- onClick: d[0] || (d[0] = (m) => n.value = !n.value)
82
+ onClick: m[0] || (m[0] = (u) => n.value = !n.value)
83
83
  }, [
84
- b("p", He, P(e(u)("report.editor.customizeReport")), 1),
85
- d[1] || (d[1] = b("div", { class: "grow" }, null, -1)),
86
- a(w, {
84
+ h("p", ze, E(e(d)("report.editor.customizeReport")), 1),
85
+ m[1] || (m[1] = h("div", { class: "grow" }, null, -1)),
86
+ a(_, {
87
87
  name: r.icon
88
88
  }, null, 8, ["name"])
89
89
  ]);
@@ -96,12 +96,12 @@ const ze = /* @__PURE__ */ G({
96
96
  modelModifiers: {}
97
97
  },
98
98
  emits: ["update:modelValue"],
99
- setup(F) {
100
- const u = j(F, "modelValue");
101
- return (n, r) => (i(), V(L, null, [
99
+ setup(x) {
100
+ const d = j(x, "modelValue");
101
+ return (n, r) => (i(), S(L, null, [
102
102
  a(pe, {
103
- modelValue: u.value,
104
- "onUpdate:modelValue": r[0] || (r[0] = (y) => u.value = y),
103
+ modelValue: d.value,
104
+ "onUpdate:modelValue": r[0] || (r[0] = (w) => d.value = w),
105
105
  icon: "keyboard_double_arrow_left"
106
106
  }, null, 8, ["modelValue"]),
107
107
  Ce(n.$slots, "default")
@@ -114,29 +114,29 @@ const ze = /* @__PURE__ */ G({
114
114
  modelModifiers: {}
115
115
  },
116
116
  emits: ["update:modelValue"],
117
- setup(F) {
118
- const u = j(F, "modelValue");
117
+ setup(x) {
118
+ const d = j(x, "modelValue");
119
119
  return (n, r) => {
120
- const y = v("FmTopSheet"), d = v("FmCard");
121
- return i(), x(d, { class: "fixed bottom-0 w-full" }, {
120
+ const w = v("FmTopSheet"), m = v("FmCard");
121
+ return i(), C(m, { class: "fixed bottom-0 w-full" }, {
122
122
  default: s(() => [
123
123
  a(pe, {
124
- modelValue: u.value,
125
- "onUpdate:modelValue": r[0] || (r[0] = (w) => u.value = w),
124
+ modelValue: d.value,
125
+ "onUpdate:modelValue": r[0] || (r[0] = (_) => d.value = _),
126
126
  icon: "keyboard_double_arrow_up"
127
127
  }, null, 8, ["modelValue"]),
128
- a(y, {
129
- modelValue: u.value,
130
- "onUpdate:modelValue": r[2] || (r[2] = (w) => u.value = w),
128
+ a(w, {
129
+ modelValue: d.value,
130
+ "onUpdate:modelValue": r[2] || (r[2] = (_) => d.value = _),
131
131
  "fullscreen-size": "sm"
132
132
  }, {
133
133
  default: s(() => [
134
134
  a(pe, {
135
- modelValue: u.value,
136
- "onUpdate:modelValue": r[1] || (r[1] = (w) => u.value = w),
135
+ modelValue: d.value,
136
+ "onUpdate:modelValue": r[1] || (r[1] = (_) => d.value = _),
137
137
  icon: "keyboard_double_arrow_down"
138
138
  }, null, 8, ["modelValue"]),
139
- u.value ? Ce(n.$slots, "default", { key: 0 }) : Y("", !0)
139
+ d.value ? Ce(n.$slots, "default", { key: 0 }) : Y("", !0)
140
140
  ]),
141
141
  _: 3
142
142
  }, 8, ["modelValue"])
@@ -168,152 +168,152 @@ const ze = /* @__PURE__ */ G({
168
168
  isOpenModifiers: {}
169
169
  }),
170
170
  emits: ["update:globalFilter", "update:isOpen"],
171
- setup(F) {
172
- const { t: u } = te(), n = j(F, "globalFilter"), r = j(F, "isOpen"), y = Oe(), d = F, w = W(), m = W(), C = W(), c = W([]);
173
- de(r, (p) => {
174
- var t, k, U;
175
- p && (w.value = ((t = n.value) == null ? void 0 : t.label) || "", m.value = d.schemas.find(
176
- (D) => {
177
- var T;
178
- return D.name === ((T = n.value) == null ? void 0 : T.schemaName);
171
+ setup(x) {
172
+ const { t: d } = te(), n = j(x, "globalFilter"), r = j(x, "isOpen"), w = Oe(), m = x, _ = R(), u = R(), k = R(), c = R([]);
173
+ me(r, (p) => {
174
+ var l, V, U;
175
+ p && (_.value = ((l = n.value) == null ? void 0 : l.label) || "", u.value = m.schemas.find(
176
+ (W) => {
177
+ var M;
178
+ return W.name === ((M = n.value) == null ? void 0 : M.schemaName);
179
179
  }
180
- ), C.value = (k = q.value.find(
181
- (D) => {
182
- var T;
183
- return D.value.name === ((T = n.value) == null ? void 0 : T.name);
180
+ ), k.value = (V = I.value.find(
181
+ (W) => {
182
+ var M;
183
+ return W.value.name === ((M = n.value) == null ? void 0 : M.name);
184
184
  }
185
- )) == null ? void 0 : k.value, c.value = ((U = n.value) == null ? void 0 : U.tileIds) || []);
185
+ )) == null ? void 0 : V.value, c.value = ((U = n.value) == null ? void 0 : U.tileIds) || []);
186
186
  });
187
- const R = N(
188
- () => d.schemas.map((p) => ({
187
+ const q = N(
188
+ () => m.schemas.map((p) => ({
189
189
  label: p.label,
190
190
  value: p
191
191
  }))
192
- ), q = N(() => {
192
+ ), I = N(() => {
193
193
  var p;
194
- return (((p = m.value) == null ? void 0 : p.fields) || []).reduce(
195
- (t, k) => ([K.Bool, K.String, K.Timestamp].includes(k.type) && t.push({
196
- label: k.label,
197
- value: k
198
- }), t),
194
+ return (((p = u.value) == null ? void 0 : p.fields) || []).reduce(
195
+ (l, V) => ([K.Bool, K.String, K.Timestamp].includes(V.type) && l.push({
196
+ label: V.label,
197
+ value: V
198
+ }), l),
199
199
  []
200
200
  );
201
- }), O = N(() => d.tiles.reduce((p, t, k) => {
202
- var T, z;
203
- const U = t.widget.config.schemaNames ?? [], D = (t.widget.config.joinDatasources ?? []).flatMap(
204
- (_) => _.schemaNames ?? []
201
+ }), T = N(() => m.tiles.reduce((p, l, V) => {
202
+ var M, P;
203
+ const U = l.widget.config.schemaNames ?? [], W = (l.widget.config.joinDatasources ?? []).flatMap(
204
+ (F) => F.schemaNames ?? []
205
205
  );
206
- return [...U, ...D].includes(((T = m.value) == null ? void 0 : T.name) || "") && p.push({
207
- label: (z = t == null ? void 0 : t.widget.title) != null && z.trim() ? t.widget.title : `Widget ${k + 1}`,
208
- value: t.id
206
+ return [...U, ...W].includes(((M = u.value) == null ? void 0 : M.name) || "") && p.push({
207
+ label: (P = l == null ? void 0 : l.widget.title) != null && P.trim() ? l.widget.title : `Widget ${V + 1}`,
208
+ value: l.id
209
209
  }), p;
210
210
  }, []));
211
211
  function B(p) {
212
- var t;
213
- p.name !== ((t = m.value) == null ? void 0 : t.name) && (m.value = p, C.value = void 0);
212
+ var l;
213
+ p.name !== ((l = u.value) == null ? void 0 : l.name) && (u.value = p, k.value = void 0);
214
214
  }
215
- function g(p) {
216
- C.value = p;
215
+ function b(p) {
216
+ k.value = p;
217
217
  }
218
- function $(p) {
218
+ function O(p) {
219
219
  switch (p) {
220
220
  case K.Timestamp:
221
- return _e.Between;
221
+ return we.Between;
222
222
  case K.Bool:
223
223
  case K.String:
224
- return _e.Equal;
224
+ return we.Equal;
225
225
  default:
226
226
  throw new Error(`Unsupported data type: ${p}`);
227
227
  }
228
228
  }
229
229
  function A() {
230
- if (!m.value) {
231
- y.open({ message: "Invalid schema", type: "error" });
230
+ if (!u.value) {
231
+ w.open({ message: "Invalid schema", type: "error" });
232
232
  return;
233
233
  }
234
- C.value || y.open({ message: "Invalid dimension", type: "error" }), n.value = {
235
- schemaName: m.value.name,
236
- name: C.value.name,
237
- label: w.value || name,
238
- operator: $(C.value.type),
239
- option: C.value.type === K.Timestamp ? Ie.DateTime : null,
234
+ k.value || w.open({ message: "Invalid dimension", type: "error" }), n.value = {
235
+ schemaName: u.value.name,
236
+ name: k.value.name,
237
+ label: _.value || name,
238
+ operator: O(k.value.type),
239
+ option: k.value.type === K.Timestamp ? Ie.DateTime : null,
240
240
  tileIds: [...c.value],
241
241
  filters: []
242
242
  }, r.value = !1;
243
243
  }
244
- function S() {
244
+ function $() {
245
245
  r.value = !1;
246
246
  }
247
- return (p, t) => {
248
- const k = v("FmTextField"), U = v("FmLabel"), D = v("FmCheckbox"), T = v("FmForm"), z = v("FmButton"), _ = v("FmDialog");
249
- return i(), x(_, {
247
+ return (p, l) => {
248
+ const V = v("FmTextField"), U = v("FmLabel"), W = v("FmCheckbox"), M = v("FmForm"), P = v("FmButton"), F = v("FmDialog");
249
+ return i(), C(F, {
250
250
  modelValue: r.value,
251
- "onUpdate:modelValue": t[4] || (t[4] = (o) => r.value = o),
251
+ "onUpdate:modelValue": l[4] || (l[4] = (o) => r.value = o),
252
252
  overlay: !0,
253
253
  "z-index": 10
254
254
  }, {
255
255
  "dialog-header": s(() => [
256
- ue(P(e(u)("report.section.filter.globalFilter")), 1)
256
+ de(E(e(d)("report.section.filter.globalFilter")), 1)
257
257
  ]),
258
258
  default: s(() => [
259
- a(T, {
259
+ a(M, {
260
260
  ref: "form",
261
261
  class: "flex flex-col gap-2 w-[490px]"
262
262
  }, {
263
263
  default: s(() => [
264
- a(k, {
265
- modelValue: w.value,
266
- "onUpdate:modelValue": t[0] || (t[0] = (o) => w.value = o),
267
- placeholder: e(u)("report.section.filter.displayName"),
268
- label: e(u)("report.section.filter.displayName"),
264
+ a(V, {
265
+ modelValue: _.value,
266
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => _.value = o),
267
+ placeholder: e(d)("report.section.filter.displayName"),
268
+ label: e(d)("report.section.filter.displayName"),
269
269
  class: "mb-2"
270
270
  }, null, 8, ["modelValue", "placeholder", "label"]),
271
271
  a(Fe, {
272
- "model-value": m.value,
273
- items: R.value,
274
- placeholder: e(u)("report.section.schema.title"),
275
- label: e(u)("report.section.schema.title"),
276
- "onUpdate:modelValue": t[1] || (t[1] = (o) => B(o))
272
+ "model-value": u.value,
273
+ items: q.value,
274
+ placeholder: e(d)("report.section.schema.title"),
275
+ label: e(d)("report.section.schema.title"),
276
+ "onUpdate:modelValue": l[1] || (l[1] = (o) => B(o))
277
277
  }, null, 8, ["model-value", "items", "placeholder", "label"]),
278
278
  a(Fe, {
279
- "model-value": C.value,
280
- items: q.value,
281
- placeholder: e(u)("report.section.dimension.Dimension"),
282
- label: e(u)("report.section.dimension.Dimension"),
283
- "onUpdate:modelValue": t[2] || (t[2] = (o) => g(o))
279
+ "model-value": k.value,
280
+ items: I.value,
281
+ placeholder: e(d)("report.section.dimension.Dimension"),
282
+ label: e(d)("report.section.dimension.Dimension"),
283
+ "onUpdate:modelValue": l[2] || (l[2] = (o) => b(o))
284
284
  }, null, 8, ["model-value", "items", "placeholder", "label"]),
285
285
  a(U, { class: "mt-2 fm-typo-en-body-lg-600" }, {
286
286
  default: s(() => [
287
- ue(P(e(u)("report.section.filter.applyWidget")), 1)
287
+ de(E(e(d)("report.section.filter.applyWidget")), 1)
288
288
  ]),
289
289
  _: 1
290
290
  }),
291
- F.tiles.length > 0 ? (i(), V("div", je, [
292
- (i(!0), V(L, null, Q(O.value, (o) => (i(), x(D, {
291
+ x.tiles.length > 0 ? (i(), S("div", je, [
292
+ (i(!0), S(L, null, Q(T.value, (o) => (i(), C(W, {
293
293
  key: o.value,
294
294
  modelValue: c.value,
295
- "onUpdate:modelValue": t[3] || (t[3] = (l) => c.value = l),
295
+ "onUpdate:modelValue": l[3] || (l[3] = (t) => c.value = t),
296
296
  label: o.label,
297
297
  value: o.value
298
298
  }, null, 8, ["modelValue", "label", "value"]))), 128))
299
- ])) : (i(), x(U, {
299
+ ])) : (i(), C(U, {
300
300
  key: 1,
301
301
  class: "fm-typo-en-body-lg-400",
302
- label: e(u)("report.section.filter.noWidget")
302
+ label: e(d)("report.section.filter.noWidget")
303
303
  }, null, 8, ["label"]))
304
304
  ]),
305
305
  _: 1
306
306
  }, 512)
307
307
  ]),
308
308
  "dialog-footer": s(() => [
309
- t[5] || (t[5] = b("div", { class: "grow" }, null, -1)),
310
- a(z, {
311
- label: e(u)("report.common.cancel"),
309
+ l[5] || (l[5] = h("div", { class: "grow" }, null, -1)),
310
+ a(P, {
311
+ label: e(d)("report.common.cancel"),
312
312
  variant: "tertiary",
313
- onClick: S
313
+ onClick: $
314
314
  }, null, 8, ["label"]),
315
- a(z, {
316
- label: e(u)("report.common.confirm"),
315
+ a(P, {
316
+ label: e(d)("report.common.confirm"),
317
317
  onClick: A
318
318
  }, null, 8, ["label"])
319
319
  ]),
@@ -333,163 +333,163 @@ const ze = /* @__PURE__ */ G({
333
333
  modelModifiers: {}
334
334
  }),
335
335
  emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
336
- setup(F, { emit: u }) {
337
- const n = j(F, "modelValue"), { breakpoints: r } = ae(), y = F, d = u, w = Se(), m = $e(), C = W(), {
336
+ setup(x, { emit: d }) {
337
+ const n = j(x, "modelValue"), { breakpoints: r } = ne(), w = x, m = d, _ = Se(), u = $e(), k = R(), {
338
338
  currentSelectWidgetType: c,
339
- categories: R,
340
- editingTile: q,
341
- editingTileIndex: O,
339
+ categories: q,
340
+ editingTile: I,
341
+ editingTileIndex: T,
342
342
  editingGlobalFilter: B,
343
- editingGlobalFilterIndex: g
344
- } = ce(Ve()), { schemas: $ } = ce(Pe()), { promptMessage: A } = Te(), S = W(!1), p = W(!1), { t, te: k } = te(), U = W(void 0), D = N(() => {
345
- const o = n.value.tiles.flatMap((l) => {
346
- var f;
347
- const I = l.widget.config.schemaNames ?? [], M = ((f = l.widget.config.joinDatasources) == null ? void 0 : f.flatMap((E) => E.schemaNames ?? [])) ?? [];
348
- return [...I, ...M];
343
+ editingGlobalFilterIndex: b
344
+ } = ae(Ve()), { schemas: O } = ae(Ee()), { promptMessage: A } = Te(), $ = R(!1), p = R(!1), { t: l, te: V } = te(), U = R(void 0), W = N(() => {
345
+ const o = n.value.tiles.flatMap((t) => {
346
+ var g;
347
+ const D = t.widget.config.schemaNames ?? [], f = ((g = t.widget.config.joinDatasources) == null ? void 0 : g.flatMap((H) => H.schemaNames ?? [])) ?? [];
348
+ return [...D, ...f];
349
349
  });
350
- return [...new Set(o)].reduce((l, I) => {
351
- const M = $.value.find((f) => f.name === I);
352
- return M && l.push(M), l;
350
+ return [...new Set(o)].reduce((t, D) => {
351
+ const f = O.value.find((g) => g.name === D);
352
+ return f && t.push(f), t;
353
353
  }, []);
354
354
  });
355
- de(
355
+ me(
356
356
  () => c.value,
357
357
  () => {
358
- c.value !== void 0 && (U.value = We(c.value), q.value = U.value, O.value = -1, w.push({
358
+ c.value !== void 0 && (U.value = De(c.value), I.value = U.value, T.value = -1, _.push({
359
359
  name: "tileEditor",
360
- query: m.query
360
+ query: u.query
361
361
  }));
362
362
  },
363
363
  { immediate: !0 }
364
- ), de(
364
+ ), me(
365
365
  () => n.value.tiles,
366
366
  (o) => {
367
- o.forEach((l) => {
368
- l.id || (l.id = ee());
367
+ o.forEach((t) => {
368
+ t.id || (t.id = ee());
369
369
  });
370
370
  },
371
371
  { immediate: !0, deep: !0 }
372
372
  );
373
- const T = [
373
+ const M = [
374
374
  {
375
- label: t("report.common.edit"),
375
+ label: l("report.common.edit"),
376
376
  selected: !1,
377
377
  variant: "tertiary",
378
378
  onClick: (o) => {
379
- O.value = o, q.value = JSON.parse(JSON.stringify(n.value.tiles[o])), w.push({
379
+ T.value = o, I.value = JSON.parse(JSON.stringify(n.value.tiles[o])), _.push({
380
380
  name: "tileEditor",
381
- query: m.query
381
+ query: u.query
382
382
  });
383
383
  }
384
384
  },
385
385
  {
386
- label: t("report.common.duplicate"),
386
+ label: l("report.common.duplicate"),
387
387
  selected: !1,
388
388
  variant: "tertiary",
389
389
  onClick: (o) => {
390
- const l = {
390
+ const t = {
391
391
  ...JSON.parse(JSON.stringify(n.value.tiles[o])),
392
392
  id: ee()
393
393
  };
394
- n.value.tiles.push(l);
394
+ n.value.tiles.push(t);
395
395
  }
396
396
  },
397
397
  {
398
- label: t("report.common.remove"),
398
+ label: l("report.common.remove"),
399
399
  selected: !1,
400
400
  variant: "destructive",
401
401
  onClick: async (o) => {
402
402
  if (await A({
403
- title: t("report.editor.deleteWidget"),
404
- message: t("report.editor.deleteWidgetConfirm", {
403
+ title: l("report.editor.deleteWidget"),
404
+ message: l("report.editor.deleteWidgetConfirm", {
405
405
  title: n.value.tiles[o].widget.title
406
406
  })
407
407
  })) {
408
- const I = n.value.tiles[o].id;
409
- n.value.tiles.splice(o, 1), n.value.globalFilters && n.value.globalFilters.forEach((M) => {
410
- var f;
411
- M.tileIds = (f = M.tileIds) == null ? void 0 : f.filter((E) => E !== I);
408
+ const D = n.value.tiles[o].id;
409
+ n.value.tiles.splice(o, 1), n.value.globalFilters && n.value.globalFilters.forEach((f) => {
410
+ var g;
411
+ f.tileIds = (g = f.tileIds) == null ? void 0 : g.filter((H) => H !== D);
412
412
  });
413
413
  }
414
414
  }
415
415
  }
416
- ], z = [
416
+ ], P = [
417
417
  {
418
- label: t("report.common.edit"),
418
+ label: l("report.common.edit"),
419
419
  selected: !1,
420
420
  variant: "tertiary",
421
421
  onClick: (o) => {
422
- var l;
423
- g.value = o, B.value = JSON.parse(JSON.stringify((l = n.value.globalFilters) == null ? void 0 : l[o])), S.value = !0;
422
+ var t;
423
+ b.value = o, B.value = JSON.parse(JSON.stringify((t = n.value.globalFilters) == null ? void 0 : t[o])), $.value = !0;
424
424
  }
425
425
  },
426
426
  {
427
- label: t("report.common.remove"),
427
+ label: l("report.common.remove"),
428
428
  selected: !1,
429
429
  variant: "destructive",
430
430
  onClick: async (o) => {
431
- var M, f;
432
- const l = (M = n.value.globalFilters) == null ? void 0 : M[o];
433
- if (!l) return;
431
+ var f, g;
432
+ const t = (f = n.value.globalFilters) == null ? void 0 : f[o];
433
+ if (!t) return;
434
434
  await A({
435
- title: t("report.editor.deleteWidget"),
436
- message: t("report.editor.deleteWidgetConfirm", {
437
- title: re(l)
435
+ title: l("report.editor.deleteWidget"),
436
+ message: l("report.editor.deleteWidgetConfirm", {
437
+ title: ie(t)
438
438
  })
439
- }) && ((f = n.value.globalFilters) == null || f.splice(o, 1));
439
+ }) && ((g = n.value.globalFilters) == null || g.splice(o, 1));
440
440
  }
441
441
  }
442
- ], _ = N(() => R.value.map((o) => ({
443
- label: t(`report.category.${o.name}`),
442
+ ], F = N(() => q.value.map((o) => ({
443
+ label: l(`report.category.${o.name}`),
444
444
  value: o.id
445
445
  })));
446
- return (o, l) => {
447
- const I = v("FmTextField"), M = v("FmSelect"), f = v("FmButton"), E = v("FmIcon"), oe = v("FmTooltip"), ve = v("FmMenuItem"), fe = v("FmMenu"), ge = v("FmListItem"), be = v("FmList"), Me = v("FmForm");
448
- return i(), x(Be(e(r).lg || e(r).md ? Le : Je), {
449
- "model-value": y.hideConfiguration,
450
- "onUpdate:modelValue": l[8] || (l[8] = (h) => d("hideConfiguration", h))
446
+ return (o, t) => {
447
+ const D = v("FmTextField"), f = v("FmSelect"), g = v("FmButton"), H = v("FmIcon"), oe = v("FmTooltip"), ve = v("FmMenuItem"), fe = v("FmMenu"), ge = v("FmListItem"), be = v("FmList"), Me = v("FmForm");
448
+ return i(), C(Be(e(r).lg || e(r).md ? Le : Je), {
449
+ "model-value": w.hideConfiguration,
450
+ "onUpdate:modelValue": t[8] || (t[8] = (y) => m("hideConfiguration", y))
451
451
  }, {
452
452
  default: s(() => [
453
453
  a(Ge, {
454
- "is-open": S.value,
455
- "onUpdate:isOpen": l[0] || (l[0] = (h) => S.value = h),
454
+ "is-open": $.value,
455
+ "onUpdate:isOpen": t[0] || (t[0] = (y) => $.value = y),
456
456
  "global-filter": e(B),
457
457
  tiles: n.value.tiles,
458
- schemas: D.value,
459
- "onUpdate:globalFilter": l[1] || (l[1] = (h) => {
460
- h && (n.value.globalFilters || (n.value.globalFilters = []), typeof e(g) == "number" && e(g) >= 0 ? n.value.globalFilters[e(g)] = h : n.value.globalFilters.push(h));
458
+ schemas: W.value,
459
+ "onUpdate:globalFilter": t[1] || (t[1] = (y) => {
460
+ y && (n.value.globalFilters || (n.value.globalFilters = []), typeof e(b) == "number" && e(b) >= 0 ? n.value.globalFilters[e(b)] = y : n.value.globalFilters.push(y));
461
461
  })
462
462
  }, null, 8, ["is-open", "global-filter", "tiles", "schemas"]),
463
- a(ze, {
463
+ a(Pe, {
464
464
  modelValue: e(c),
465
- "onUpdate:modelValue": l[2] || (l[2] = (h) => ke(c) ? c.value = h : null),
465
+ "onUpdate:modelValue": t[2] || (t[2] = (y) => ke(c) ? c.value = y : null),
466
466
  "is-open": p.value,
467
- "onUpdate:isOpen": l[3] || (l[3] = (h) => p.value = h)
467
+ "onUpdate:isOpen": t[3] || (t[3] = (y) => p.value = y)
468
468
  }, null, 8, ["modelValue", "is-open"]),
469
469
  a(Me, {
470
470
  ref_key: "form",
471
- ref: C,
471
+ ref: k,
472
472
  class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
473
473
  }, {
474
474
  default: s(() => [
475
475
  a(he, { class: "border-solid" }, {
476
476
  header: s(() => [
477
- b("p", null, P(e(t)("report.editor.reportInfo")), 1),
478
- l[9] || (l[9] = b("div", { class: "grow" }, null, -1))
477
+ h("p", null, E(e(l)("report.editor.reportInfo")), 1),
478
+ t[9] || (t[9] = h("div", { class: "grow" }, null, -1))
479
479
  ]),
480
480
  content: s(() => [
481
- b("div", Ae, [
482
- a(I, {
481
+ h("div", Ae, [
482
+ a(D, {
483
483
  modelValue: n.value.name,
484
- "onUpdate:modelValue": l[4] || (l[4] = (h) => n.value.name = h),
485
- label: e(t)("report.editor.reportTitle"),
486
- placeholder: e(t)("report.editor.placeholder")
484
+ "onUpdate:modelValue": t[4] || (t[4] = (y) => n.value.name = y),
485
+ label: e(l)("report.editor.reportTitle"),
486
+ placeholder: e(l)("report.editor.placeholder")
487
487
  }, null, 8, ["modelValue", "label", "placeholder"]),
488
- a(M, {
488
+ a(f, {
489
489
  modelValue: n.value.category,
490
- "onUpdate:modelValue": l[5] || (l[5] = (h) => n.value.category = h),
491
- label: e(t)("report.common.category"),
492
- items: _.value
490
+ "onUpdate:modelValue": t[5] || (t[5] = (y) => n.value.category = y),
491
+ label: e(l)("report.common.category"),
492
+ items: F.value
493
493
  }, null, 8, ["modelValue", "label", "items"])
494
494
  ])
495
495
  ]),
@@ -500,20 +500,20 @@ const ze = /* @__PURE__ */ G({
500
500
  "is-open": !1
501
501
  }, {
502
502
  header: s(() => [
503
- b("p", null, P(e(t)("report.section.filter.globalFilter")), 1),
504
- l[10] || (l[10] = b("div", { class: "grow" }, null, -1))
503
+ h("p", null, E(e(l)("report.section.filter.globalFilter")), 1),
504
+ t[10] || (t[10] = h("div", { class: "grow" }, null, -1))
505
505
  ]),
506
506
  content: s(() => [
507
- b("div", Ke, [
508
- a(f, {
509
- label: e(t)("report.section.filter.addGlobalFilter"),
507
+ h("div", Ke, [
508
+ a(g, {
509
+ label: e(l)("report.section.filter.addGlobalFilter"),
510
510
  variant: "secondary",
511
511
  icon: "add",
512
512
  "icon-position": "prepend",
513
513
  "border-color": e(X).ColorPrimary,
514
514
  "text-color": e(X).ColorPrimary,
515
- onClick: l[6] || (l[6] = () => {
516
- g.value = null, B.value = null, S.value = !0;
515
+ onClick: t[6] || (t[6] = () => {
516
+ b.value = null, B.value = null, $.value = !0;
517
517
  })
518
518
  }, null, 8, ["label", "border-color", "text-color"]),
519
519
  a(be, null, {
@@ -524,33 +524,33 @@ const ze = /* @__PURE__ */ G({
524
524
  class: "flex flex-col gap-2 cursor-grab",
525
525
  handle: ".handle"
526
526
  }, {
527
- item: s(({ element: h, index: Z }) => [
527
+ item: s(({ element: y, index: Z }) => [
528
528
  a(ge, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
529
529
  default: s(() => [
530
- a(E, {
530
+ a(H, {
531
531
  name: "drag_handle",
532
532
  class: "handle"
533
533
  }),
534
- b("div", Qe, [
534
+ h("div", Qe, [
535
535
  a(oe, {
536
536
  "z-index": 99,
537
- content: e(re)(h),
537
+ content: e(ie)(y),
538
538
  class: "handle"
539
539
  }, {
540
540
  default: s(() => [
541
- b("p", Xe, P(e(re)(h)), 1)
541
+ h("p", Xe, E(e(ie)(y)), 1)
542
542
  ]),
543
543
  _: 2
544
544
  }, 1032, ["content"]),
545
- D.value.find(
546
- (H) => H.name === h.schemaName
547
- ) ? Y("", !0) : (i(), x(oe, {
545
+ W.value.find(
546
+ (z) => z.name === y.schemaName
547
+ ) ? Y("", !0) : (i(), C(oe, {
548
548
  key: 0,
549
549
  content: "Missing schema",
550
550
  "z-index": 99
551
551
  }, {
552
552
  default: s(() => [
553
- a(E, {
553
+ a(H, {
554
554
  name: "warning",
555
555
  class: "text-fm-color-system-error-300"
556
556
  })
@@ -558,29 +558,29 @@ const ze = /* @__PURE__ */ G({
558
558
  _: 1
559
559
  }))
560
560
  ]),
561
- l[11] || (l[11] = b("div", { class: "grow" }, null, -1)),
561
+ t[11] || (t[11] = h("div", { class: "grow" }, null, -1)),
562
562
  a(fe, {
563
563
  trigger: "click",
564
564
  shift: !0,
565
565
  "stop-click-propagation": !0
566
566
  }, {
567
567
  "menu-button": s(() => [
568
- a(f, {
568
+ a(g, {
569
569
  "append-icon": "more_vert",
570
570
  variant: "tertiary"
571
571
  })
572
572
  ]),
573
573
  default: s(() => [
574
- (i(), V(L, null, Q(z, (H, ne) => a(ve, {
575
- key: ne,
576
- onClick: (Ne) => H.onClick(Z)
574
+ (i(), S(L, null, Q(P, (z, re) => a(ve, {
575
+ key: re,
576
+ onClick: (Ne) => z.onClick(Z)
577
577
  }, {
578
578
  label: s(() => [
579
- b("p", {
579
+ h("p", {
580
580
  class: le(
581
- H.variant === "destructive" ? " text-fm-color-system-error-300" : ""
581
+ z.variant === "destructive" ? " text-fm-color-system-error-300" : ""
582
582
  )
583
- }, P(H.label), 3)
583
+ }, E(z.label), 3)
584
584
  ]),
585
585
  _: 2
586
586
  }, 1032, ["onClick"])), 64))
@@ -600,15 +600,15 @@ const ze = /* @__PURE__ */ G({
600
600
  ]),
601
601
  _: 1
602
602
  }),
603
- b("div", Ye, [
604
- a(f, {
605
- label: e(t)("report.editor.addWidget"),
603
+ h("div", Ye, [
604
+ a(g, {
605
+ label: e(l)("report.editor.addWidget"),
606
606
  variant: "secondary",
607
607
  icon: "add",
608
608
  "icon-position": "prepend",
609
609
  "border-color": e(X).ColorPrimary,
610
610
  "text-color": e(X).ColorPrimary,
611
- onClick: l[7] || (l[7] = (h) => p.value = !0)
611
+ onClick: t[7] || (t[7] = (y) => p.value = !0)
612
612
  }, null, 8, ["label", "border-color", "text-color"]),
613
613
  a(be, null, {
614
614
  default: s(() => [
@@ -618,45 +618,45 @@ const ze = /* @__PURE__ */ G({
618
618
  class: "flex flex-col gap-2 cursor-grab",
619
619
  handle: ".handle"
620
620
  }, {
621
- item: s(({ element: h, index: Z }) => [
621
+ item: s(({ element: y, index: Z }) => [
622
622
  a(ge, { class: "!cursor-grab border rounded-md border-neutral-300" }, {
623
623
  default: s(() => [
624
- a(E, {
624
+ a(H, {
625
625
  name: "drag_handle",
626
626
  class: "handle"
627
627
  }),
628
628
  a(oe, {
629
- content: h.widget.title ? e(we)(e(t), e(k), h.widget.title, "other") : e(t)("report.editor.widget", { index: Z + 1 }),
629
+ content: y.widget.title ? e(_e)(e(l), e(V), y.widget.title, "other") : e(l)("report.editor.widget", { index: Z + 1 }),
630
630
  class: "handle"
631
631
  }, {
632
632
  default: s(() => [
633
- b("p", Ze, P(h.widget.title ? e(we)(e(t), e(k), h.widget.title, "other") : e(t)("report.editor.widget", { index: Z + 1 })), 1)
633
+ h("p", Ze, E(y.widget.title ? e(_e)(e(l), e(V), y.widget.title, "other") : e(l)("report.editor.widget", { index: Z + 1 })), 1)
634
634
  ]),
635
635
  _: 2
636
636
  }, 1032, ["content"]),
637
- l[12] || (l[12] = b("div", { class: "grow" }, null, -1)),
637
+ t[12] || (t[12] = h("div", { class: "grow" }, null, -1)),
638
638
  a(fe, {
639
639
  trigger: "click",
640
640
  shift: !0,
641
641
  "stop-click-propagation": !0
642
642
  }, {
643
643
  "menu-button": s(() => [
644
- a(f, {
644
+ a(g, {
645
645
  "append-icon": "more_vert",
646
646
  variant: "tertiary"
647
647
  })
648
648
  ]),
649
649
  default: s(() => [
650
- (i(), V(L, null, Q(T, (H, ne) => a(ve, {
651
- key: ne,
652
- onClick: (Ne) => H.onClick(Z)
650
+ (i(), S(L, null, Q(M, (z, re) => a(ve, {
651
+ key: re,
652
+ onClick: (Ne) => z.onClick(Z)
653
653
  }, {
654
654
  label: s(() => [
655
- b("p", {
655
+ h("p", {
656
656
  class: le(
657
- H.variant === "destructive" ? " text-fm-color-system-error-300" : ""
657
+ z.variant === "destructive" ? " text-fm-color-system-error-300" : ""
658
658
  )
659
- }, P(H.label), 3)
659
+ }, E(z.label), 3)
660
660
  ]),
661
661
  _: 2
662
662
  }, 1032, ["onClick"])), 64))
@@ -710,252 +710,256 @@ const ze = /* @__PURE__ */ G({
710
710
  modelModifiers: {}
711
711
  }),
712
712
  emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
713
- setup(F, { emit: u }) {
714
- const { breakpoints: n } = ae(), r = j(F, "modelValue"), y = F, d = N(() => y.previewWidth > 0 && y.previewHeight > 0), w = N(() => n.value.sm || n.value.xs), m = u;
715
- return (C, c) => {
716
- const R = v("FmCircularProgress"), q = v("FmButton"), O = v("FmMenuDivider"), B = v("FmCard");
717
- return i(), V("div", el, [
718
- r.value ? (i(), V(L, { key: 1 }, [
719
- d.value ? Y("", !0) : (i(), x(Re, {
713
+ setup(x, { emit: d }) {
714
+ const { breakpoints: n } = ne(), r = j(x, "modelValue"), w = x, m = N(() => w.previewWidth > 0 && w.previewHeight > 0), _ = N(() => n.value.sm || n.value.xs), u = d;
715
+ return (k, c) => {
716
+ const q = v("FmCircularProgress"), I = v("FmButton"), T = v("FmMenuDivider"), B = v("FmCard");
717
+ return i(), S("div", el, [
718
+ r.value ? (i(), S(L, { key: 1 }, [
719
+ m.value ? Y("", !0) : (i(), C(Re, {
720
720
  key: 0,
721
- "model-value": !y.hideConfiguration
721
+ "model-value": !w.hideConfiguration
722
722
  }, {
723
723
  right: s(() => [
724
- b("div", ll, [
725
- r.value ? (i(), x(xe, {
724
+ h("div", ll, [
725
+ r.value ? (i(), C(xe, {
726
726
  key: 0,
727
727
  modelValue: r.value,
728
- "onUpdate:modelValue": c[0] || (c[0] = (g) => r.value = g),
729
- "hide-configuration": y.hideConfiguration,
730
- onHideConfiguration: c[1] || (c[1] = (g) => m("hideConfiguration", g))
728
+ "onUpdate:modelValue": c[0] || (c[0] = (b) => r.value = b),
729
+ "hide-configuration": w.hideConfiguration,
730
+ onHideConfiguration: c[1] || (c[1] = (b) => u("hideConfiguration", b))
731
731
  }, null, 8, ["modelValue", "hide-configuration"])) : Y("", !0)
732
732
  ])
733
733
  ]),
734
734
  left: s(() => [
735
- b("div", tl, [
736
- a(q, {
735
+ h("div", tl, [
736
+ a(I, {
737
737
  variant: "secondary",
738
738
  icon: "keyboard_double_arrow_right",
739
739
  "border-color": e(X).ColorPrimary,
740
740
  "text-color": e(X).ColorPrimary,
741
741
  class: "m-24 my-16",
742
742
  size: "md",
743
- onClick: c[2] || (c[2] = (g) => m("hideConfiguration", !y.hideConfiguration))
743
+ onClick: c[2] || (c[2] = (b) => u("hideConfiguration", !w.hideConfiguration))
744
744
  }, null, 8, ["border-color", "text-color"])
745
745
  ])
746
746
  ]),
747
747
  _: 1
748
748
  }, 8, ["model-value"])),
749
- a(O, {
749
+ a(T, {
750
750
  vertical: "",
751
751
  style: { margin: "0px" }
752
752
  }),
753
- !w.value && !d.value ? (i(), V("div", ol, [
754
- r.value.tiles.length > 0 ? (i(), V("div", al, [
755
- (i(!0), V(L, null, Q(r.value.tiles, (g, $) => (i(), x(ie, {
756
- key: `${e(ee)()}_${$}`,
757
- "model-value": g,
758
- index: $,
753
+ !_.value && !m.value ? (i(), S("div", ol, [
754
+ r.value.tiles.length > 0 ? (i(), S("div", al, [
755
+ (i(!0), S(L, null, Q(r.value.tiles, (b, O) => (i(), C(se, {
756
+ key: `${e(ee)()}_${O}`,
757
+ "model-value": b,
758
+ index: O,
759
759
  "hide-export": !0
760
760
  }, null, 8, ["model-value", "index"]))), 128))
761
- ])) : (i(), x(se, { key: 1 }))
762
- ])) : w.value && !d.value ? (i(), V("div", nl, [
761
+ ])) : (i(), C(ue, { key: 1 }))
762
+ ])) : _.value && !m.value ? (i(), S("div", nl, [
763
763
  a(B, { class: "px-5 pb-28" }, {
764
764
  default: s(() => [
765
- r.value.tiles.length > 0 ? (i(), V("div", rl, [
766
- (i(!0), V(L, null, Q(r.value.tiles, (g, $) => (i(), x(ie, {
767
- key: `${e(ee)()}_${$}`,
768
- "model-value": g,
769
- index: $,
765
+ r.value.tiles.length > 0 ? (i(), S("div", rl, [
766
+ (i(!0), S(L, null, Q(r.value.tiles, (b, O) => (i(), C(se, {
767
+ key: `${e(ee)()}_${O}`,
768
+ "model-value": b,
769
+ index: O,
770
770
  "hide-export": !0
771
771
  }, null, 8, ["model-value", "index"]))), 128))
772
- ])) : (i(), x(se, { key: 1 }))
772
+ ])) : (i(), C(ue, { key: 1 }))
773
773
  ]),
774
774
  _: 1
775
775
  }),
776
- r.value ? (i(), x(xe, {
776
+ r.value ? (i(), C(xe, {
777
777
  key: 0,
778
778
  modelValue: r.value,
779
- "onUpdate:modelValue": c[3] || (c[3] = (g) => r.value = g),
780
- "hide-configuration": y.hideConfiguration,
781
- onHideConfiguration: c[4] || (c[4] = (g) => {
782
- m("hideConfiguration", g);
779
+ "onUpdate:modelValue": c[3] || (c[3] = (b) => r.value = b),
780
+ "hide-configuration": w.hideConfiguration,
781
+ onHideConfiguration: c[4] || (c[4] = (b) => {
782
+ u("hideConfiguration", b);
783
783
  })
784
784
  }, null, 8, ["modelValue", "hide-configuration"])) : Y("", !0)
785
- ])) : (i(), V("div", il, [
786
- b("div", {
787
- style: me({
785
+ ])) : (i(), S("div", il, [
786
+ h("div", {
787
+ style: ce({
788
788
  transformOrigin: "top center",
789
- transform: `scale(${y.previewScale})`
789
+ transform: `scale(${w.previewScale})`
790
790
  })
791
791
  }, [
792
- b("div", {
792
+ h("div", {
793
793
  class: "overflow-y-auto bg-white rounded-lg",
794
- style: me({
795
- width: y.previewWidth + "px",
796
- height: y.previewHeight + "px"
794
+ style: ce({
795
+ width: w.previewWidth + "px",
796
+ height: w.previewHeight + "px"
797
797
  })
798
798
  }, [
799
- r.value.tiles.length > 0 ? (i(), V("div", sl, [
800
- (i(!0), V(L, null, Q(r.value.tiles, (g, $) => (i(), x(ie, {
801
- key: `${e(ee)()}_${$}`,
802
- "model-value": g,
803
- index: $,
799
+ r.value.tiles.length > 0 ? (i(), S("div", sl, [
800
+ (i(!0), S(L, null, Q(r.value.tiles, (b, O) => (i(), C(se, {
801
+ key: `${e(ee)()}_${O}`,
802
+ "model-value": b,
803
+ index: O,
804
804
  "hide-export": !0,
805
- "custom-screen-width": y.previewWidth
805
+ "custom-screen-width": w.previewWidth
806
806
  }, null, 8, ["model-value", "index", "custom-screen-width"]))), 128))
807
- ])) : (i(), x(se, { key: 1 }))
807
+ ])) : (i(), C(ue, { key: 1 }))
808
808
  ], 4)
809
809
  ], 4)
810
810
  ]))
811
- ], 64)) : (i(), x(R, { key: 0 }))
811
+ ], 64)) : (i(), C(q, { key: 0 }))
812
812
  ]);
813
813
  };
814
814
  }
815
815
  }), dl = { class: "flex items-center gap-4" }, ml = { class: "flex justify-center items-center gap-2 w-full" }, cl = { class: "flex gap-4" }, kl = /* @__PURE__ */ G({
816
816
  __name: "ReportEditor",
817
- setup(F) {
818
- const u = Se(), n = $e(), r = Ve(), { promptLoader: y } = Ee(), { t: d } = te(), { currentReport: w, editingReport: m } = ce(r), { breakpoints: C } = ae(), c = N(() => {
819
- var _;
820
- return !((_ = m.value) != null && _.editable);
821
- }), R = N(() => {
822
- var _;
823
- return ((_ = m.value) == null ? void 0 : _.name) ?? d("report.editor.newReport");
824
- }), q = Oe(), { promptMessage: O } = Te(), B = W(!1);
825
- async function g() {
826
- if (!m.value || m.value.tiles.length === 0) {
827
- q.open({ message: d("report.messages.noWidget"), type: "error" });
817
+ setup(x) {
818
+ const d = Se(), n = $e(), r = Ve(), { promptLoader: w } = He(), { t: m } = te(), { currentReport: _, editingReport: u } = ae(r), { breakpoints: k } = ne(), c = N(() => {
819
+ var F;
820
+ return !((F = u.value) != null && F.editable);
821
+ }), q = N(() => {
822
+ var F;
823
+ return ((F = u.value) == null ? void 0 : F.name) ?? m("report.editor.newReport");
824
+ }), I = Oe(), { promptMessage: T } = Te(), B = R(!1);
825
+ async function b() {
826
+ if (!u.value || u.value.tiles.length === 0) {
827
+ I.open({ message: m("report.messages.noWidget"), type: "error" });
828
828
  return;
829
829
  }
830
- const _ = c.value ? d("report.common.clone") : d("report.common.save");
831
- if (await O({
832
- title: `${d("report.messages.saveReport")}`,
833
- message: d("report.messages.confirmAction", { action: _, name: R.value })
830
+ const { defaultChartWidth: F, defaultChartHeight: o } = ae(r);
831
+ u.value.tiles.forEach((f) => {
832
+ f.widget.config.chartWidth == null && (f.widget.config.chartWidth = F.value), f.widget.config.chartHeight == null && (f.widget.config.chartHeight = o.value);
833
+ });
834
+ const t = c.value ? m("report.common.clone") : m("report.common.save");
835
+ if (await T({
836
+ title: `${m("report.messages.saveReport")}`,
837
+ message: m("report.messages.confirmAction", { action: t, name: q.value })
834
838
  }))
835
839
  try {
836
- await y(async () => {
840
+ await w(async () => {
837
841
  if (c.value) {
838
- const l = JSON.parse(JSON.stringify(m.value));
839
- l.editable = !0, l.id = "", l.name = `${l.name} ${d("report.common.duplicate")}`, await r.createOrUpdateReport(l);
842
+ const f = JSON.parse(JSON.stringify(u.value));
843
+ f.editable = !0, f.id = "", f.name = `${f.name} ${m("report.common.duplicate")}`, await r.createOrUpdateReport(f);
840
844
  } else
841
- m.value && await r.createOrUpdateReport(m.value);
842
- u.push({
845
+ u.value && await r.createOrUpdateReport(u.value);
846
+ d.push({
843
847
  name: "reportView",
844
848
  query: n.query
845
849
  });
846
850
  });
847
- } catch (l) {
848
- console.log(l), q.open({
849
- message: d("report.messages.failedToAction", { action: _ }),
851
+ } catch (f) {
852
+ console.log(f), I.open({
853
+ message: m("report.messages.failedToAction", { action: t }),
850
854
  type: "error"
851
855
  });
852
856
  }
853
857
  }
854
- async function $() {
858
+ async function O() {
855
859
  var o;
856
- if (!m.value) return;
857
- await O({
858
- title: d("report.common.report", 1),
859
- message: d("report.editor.notSaved", { name: (o = m.value) == null ? void 0 : o.name })
860
- }) && (m.value = JSON.parse(JSON.stringify(w.value)), u.back());
860
+ if (!u.value) return;
861
+ await T({
862
+ title: m("report.common.report", 1),
863
+ message: m("report.editor.notSaved", { name: (o = u.value) == null ? void 0 : o.name })
864
+ }) && (u.value = JSON.parse(JSON.stringify(_.value)), d.back());
861
865
  }
862
866
  Ue(() => {
863
- m.value || u.push({ name: "reports" });
867
+ u.value || d.push({ name: "reports" });
864
868
  });
865
869
  const A = [
866
870
  {
867
- label: d("report.common.default"),
871
+ label: m("report.common.default"),
868
872
  width: void 0,
869
873
  height: void 0
870
874
  },
871
875
  {
872
- label: d("report.editor.devices.desktop"),
876
+ label: m("report.editor.devices.desktop"),
873
877
  width: 1920,
874
878
  height: 1080
875
879
  },
876
880
  {
877
- label: d("report.editor.devices.tablet"),
881
+ label: m("report.editor.devices.tablet"),
878
882
  width: 820,
879
883
  height: 1180
880
884
  },
881
885
  {
882
- label: d("report.editor.devices.phone"),
886
+ label: m("report.editor.devices.phone"),
883
887
  width: 390,
884
888
  height: 859
885
889
  }
886
- ], S = W(A[0]), p = W(!1), t = N(() => p.value ? Math.max(S.value.width || 0, S.value.height || 0) : Math.min(S.value.width || 0, S.value.height || 0)), k = N(() => p.value ? Math.min(S.value.width || 0, S.value.height || 0) : Math.max(S.value.width || 0, S.value.height || 0)), U = N(() => window.innerHeight - 72 - 56), D = N(() => {
887
- if (!t.value) return 1;
888
- let _ = (U.value - 48) / t.value, o = k.value * _;
889
- return o > window.innerWidth && (_ = window.innerWidth / k.value, o = k.value * _), _ > 1 ? 1 : _;
890
+ ], $ = R(A[0]), p = R(!1), l = N(() => p.value ? Math.max($.value.width || 0, $.value.height || 0) : Math.min($.value.width || 0, $.value.height || 0)), V = N(() => p.value ? Math.min($.value.width || 0, $.value.height || 0) : Math.max($.value.width || 0, $.value.height || 0)), U = N(() => window.innerHeight - 72 - 56), W = N(() => {
891
+ if (!l.value) return 1;
892
+ let F = (U.value - 48) / l.value, o = V.value * F;
893
+ return o > window.innerWidth && (F = window.innerWidth / V.value, o = V.value * F), F > 1 ? 1 : F;
890
894
  });
891
- function T(_) {
892
- S.value = _;
895
+ function M(F) {
896
+ $.value = F;
893
897
  }
894
- function z() {
898
+ function P() {
895
899
  p.value = !p.value;
896
900
  }
897
- return (_, o) => {
898
- const l = v("FmTooltip"), I = v("FmButton"), M = v("FmPageHead");
899
- return i(), x(qe, null, {
901
+ return (F, o) => {
902
+ const t = v("FmTooltip"), D = v("FmButton"), f = v("FmPageHead");
903
+ return i(), C(qe, null, {
900
904
  default: s(() => [
901
- a(M, {
905
+ a(f, {
902
906
  actions: [
903
- { label: e(d)("report.common.cancel"), value: "cancel", isPrimary: !1 },
907
+ { label: e(m)("report.common.cancel"), value: "cancel", isPrimary: !1 },
904
908
  { label: "Save Report", value: "save", isPrimary: !0, prependIcon: "download" }
905
909
  ],
906
- "onClick:action": o[0] || (o[0] = (f) => {
907
- f === "cancel" && $(), f === "save" && g();
910
+ "onClick:action": o[0] || (o[0] = (g) => {
911
+ g === "cancel" && O(), g === "save" && b();
908
912
  })
909
913
  }, {
910
914
  title: s(() => [
911
- b("div", dl, [
912
- a(l, {
913
- content: R.value,
915
+ h("div", dl, [
916
+ a(t, {
917
+ content: q.value,
914
918
  placement: "bottom"
915
919
  }, {
916
920
  default: s(() => [
917
- b("p", {
918
- class: le(`${e(C).sm || e(C).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
919
- }, P(R.value), 3)
921
+ h("p", {
922
+ class: le(`${e(k).sm || e(k).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
923
+ }, E(q.value), 3)
920
924
  ]),
921
925
  _: 1
922
926
  }, 8, ["content"]),
923
- b("div", ml, [
924
- b("div", cl, [
925
- (i(), V(L, null, Q(A, (f) => {
926
- var E;
927
- return a(I, {
928
- key: f.label,
929
- label: f.label,
930
- variant: ((E = S.value) == null ? void 0 : E.label) === f.label ? "primary" : "secondary",
927
+ h("div", ml, [
928
+ h("div", cl, [
929
+ (i(), S(L, null, Q(A, (g) => {
930
+ var H;
931
+ return a(D, {
932
+ key: g.label,
933
+ label: g.label,
934
+ variant: ((H = $.value) == null ? void 0 : H.label) === g.label ? "primary" : "secondary",
931
935
  size: "md",
932
- onClick: (oe) => T(f)
936
+ onClick: (oe) => M(g)
933
937
  }, null, 8, ["label", "variant", "onClick"]);
934
938
  }), 64))
935
939
  ]),
936
- a(I, {
940
+ a(D, {
937
941
  icon: "screen_rotation",
938
942
  variant: "tertiary",
939
943
  size: "md",
940
944
  class: "text-fm-color-typo-primary",
941
- onClick: z
945
+ onClick: P
942
946
  })
943
947
  ])
944
948
  ])
945
949
  ]),
946
950
  _: 1
947
951
  }, 8, ["actions"]),
948
- e(m) ? (i(), x(ul, {
952
+ e(u) ? (i(), C(ul, {
949
953
  key: 0,
950
- modelValue: e(m),
951
- "onUpdate:modelValue": o[1] || (o[1] = (f) => ke(m) ? m.value = f : null),
952
- style: me({ height: U.value + "px" }),
953
- class: le(e(C).lg || e(C).md ? "flex" : ""),
954
+ modelValue: e(u),
955
+ "onUpdate:modelValue": o[1] || (o[1] = (g) => ke(u) ? u.value = g : null),
956
+ style: ce({ height: U.value + "px" }),
957
+ class: le(e(k).lg || e(k).md ? "flex" : ""),
954
958
  "hide-configuration": B.value,
955
- "preview-width": k.value,
956
- "preview-height": t.value,
957
- "preview-scale": D.value,
958
- onHideConfiguration: o[2] || (o[2] = (f) => B.value = f)
959
+ "preview-width": V.value,
960
+ "preview-height": l.value,
961
+ "preview-scale": W.value,
962
+ onHideConfiguration: o[2] || (o[2] = (g) => B.value = g)
959
963
  }, null, 8, ["modelValue", "style", "class", "hide-configuration", "preview-width", "preview-height", "preview-scale"])) : Y("", !0)
960
964
  ]),
961
965
  _: 1