@feedmepos/mf-report 5.10.2 → 5.10.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.
@@ -93,7 +93,7 @@ const ge = ["src"], he = ["src"], $e = /* @__PURE__ */ O({
93
93
  }), Z(() => {
94
94
  l(me);
95
95
  }), T(() => {
96
- console.log("5.10.2", !0), window.addEventListener("message", F), window.addEventListener("message", B);
96
+ console.log("5.10.3", !0), window.addEventListener("message", F), window.addEventListener("message", B);
97
97
  });
98
98
  const L = ie(), R = de();
99
99
  M(() => {
@@ -1,4 +1,4 @@
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";
1
+ import { defineComponent as G, mergeModels as J, useModel as j, ref as R, computed as N, resolveComponent as v, createBlock as k, 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
2
  import { W as We, i as De, S as he, d as ye, T as Re, _ as qe } from "./TransitionFade-DqkdfAWv.js";
3
3
  import { D as K, c as Ie, C as we, a as Ve, b as Ee, v as ee } from "./v4-BUVVByJY.js";
4
4
  import { storeToRefs as ae } from "pinia";
@@ -24,13 +24,13 @@ const Pe = /* @__PURE__ */ G({
24
24
  function u() {
25
25
  _("update:isOpen", !1);
26
26
  }
27
- function k() {
27
+ function V() {
28
28
  c.value && (w.value = c.value, c.value = void 0, _("update:isOpen", !1));
29
29
  }
30
30
  const c = R(), q = N(() => !c.value);
31
31
  return (I, T) => {
32
32
  const B = v("FmButton"), b = v("FmDialog");
33
- return i(), C(b, {
33
+ return i(), k(b, {
34
34
  "model-value": m.isOpen
35
35
  }, {
36
36
  "dialog-header": s(() => [
@@ -54,7 +54,7 @@ const Pe = /* @__PURE__ */ G({
54
54
  a(B, {
55
55
  label: e(n)("report.common.confirm"),
56
56
  disabled: q.value,
57
- onClick: k
57
+ onClick: V
58
58
  }, null, 8, ["label", "disabled"])
59
59
  ]),
60
60
  _: 1
@@ -118,7 +118,7 @@ const Pe = /* @__PURE__ */ G({
118
118
  const d = j(x, "modelValue");
119
119
  return (n, r) => {
120
120
  const w = v("FmTopSheet"), m = v("FmCard");
121
- return i(), C(m, { class: "fixed bottom-0 w-full" }, {
121
+ return i(), k(m, { class: "fixed bottom-0 w-full" }, {
122
122
  default: s(() => [
123
123
  a(pe, {
124
124
  modelValue: d.value,
@@ -169,51 +169,51 @@ const Pe = /* @__PURE__ */ G({
169
169
  }),
170
170
  emits: ["update:globalFilter", "update:isOpen"],
171
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([]);
172
+ const { t: d } = te(), n = j(x, "globalFilter"), r = j(x, "isOpen"), w = Oe(), m = x, _ = R(), u = R(), V = R(), c = R([]);
173
173
  me(r, (p) => {
174
- var l, V, U;
174
+ var l, C, U;
175
175
  p && (_.value = ((l = n.value) == null ? void 0 : l.label) || "", u.value = m.schemas.find(
176
176
  (W) => {
177
177
  var M;
178
178
  return W.name === ((M = n.value) == null ? void 0 : M.schemaName);
179
179
  }
180
- ), k.value = (V = I.value.find(
180
+ ), V.value = (C = I.value.find(
181
181
  (W) => {
182
182
  var M;
183
183
  return W.value.name === ((M = n.value) == null ? void 0 : M.name);
184
184
  }
185
- )) == null ? void 0 : V.value, c.value = ((U = n.value) == null ? void 0 : U.tileIds) || []);
185
+ )) == null ? void 0 : C.value, c.value = ((U = n.value) == null ? void 0 : U.tileIds) || []);
186
186
  });
187
187
  const q = N(
188
188
  () => m.schemas.map((p) => ({
189
- label: p.label,
189
+ label: p.label || p.name,
190
190
  value: p
191
191
  }))
192
192
  ), I = N(() => {
193
193
  var p;
194
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
195
+ (l, C) => ([K.Bool, K.String, K.Timestamp].includes(C.type) && l.push({
196
+ label: C.label || C.name,
197
+ value: C
198
198
  }), l),
199
199
  []
200
200
  );
201
- }), T = N(() => m.tiles.reduce((p, l, V) => {
201
+ }), T = N(() => m.tiles.reduce((p, l, C) => {
202
202
  var M, P;
203
203
  const U = l.widget.config.schemaNames ?? [], W = (l.widget.config.joinDatasources ?? []).flatMap(
204
204
  (F) => F.schemaNames ?? []
205
205
  );
206
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}`,
207
+ label: (P = l == null ? void 0 : l.widget.title) != null && P.trim() ? l.widget.title : `Widget ${C + 1}`,
208
208
  value: l.id
209
209
  }), p;
210
210
  }, []));
211
211
  function B(p) {
212
212
  var l;
213
- p.name !== ((l = u.value) == null ? void 0 : l.name) && (u.value = p, k.value = void 0);
213
+ p.name !== ((l = u.value) == null ? void 0 : l.name) && (u.value = p, V.value = void 0);
214
214
  }
215
215
  function b(p) {
216
- k.value = p;
216
+ V.value = p;
217
217
  }
218
218
  function O(p) {
219
219
  switch (p) {
@@ -231,12 +231,12 @@ const Pe = /* @__PURE__ */ G({
231
231
  w.open({ message: "Invalid schema", type: "error" });
232
232
  return;
233
233
  }
234
- k.value || w.open({ message: "Invalid dimension", type: "error" }), n.value = {
234
+ V.value || w.open({ message: "Invalid dimension", type: "error" }), n.value = {
235
235
  schemaName: u.value.name,
236
- name: k.value.name,
236
+ name: V.value.name,
237
237
  label: _.value || name,
238
- operator: O(k.value.type),
239
- option: k.value.type === K.Timestamp ? Ie.DateTime : null,
238
+ operator: O(V.value.type),
239
+ option: V.value.type === K.Timestamp ? Ie.DateTime : null,
240
240
  tileIds: [...c.value],
241
241
  filters: []
242
242
  }, r.value = !1;
@@ -245,8 +245,8 @@ const Pe = /* @__PURE__ */ G({
245
245
  r.value = !1;
246
246
  }
247
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, {
248
+ const C = v("FmTextField"), U = v("FmLabel"), W = v("FmCheckbox"), M = v("FmForm"), P = v("FmButton"), F = v("FmDialog");
249
+ return i(), k(F, {
250
250
  modelValue: r.value,
251
251
  "onUpdate:modelValue": l[4] || (l[4] = (o) => r.value = o),
252
252
  overlay: !0,
@@ -261,7 +261,7 @@ const Pe = /* @__PURE__ */ G({
261
261
  class: "flex flex-col gap-2 w-[490px]"
262
262
  }, {
263
263
  default: s(() => [
264
- a(V, {
264
+ a(C, {
265
265
  modelValue: _.value,
266
266
  "onUpdate:modelValue": l[0] || (l[0] = (o) => _.value = o),
267
267
  placeholder: e(d)("report.section.filter.displayName"),
@@ -276,7 +276,7 @@ const Pe = /* @__PURE__ */ G({
276
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": k.value,
279
+ "model-value": V.value,
280
280
  items: I.value,
281
281
  placeholder: e(d)("report.section.dimension.Dimension"),
282
282
  label: e(d)("report.section.dimension.Dimension"),
@@ -289,14 +289,14 @@ const Pe = /* @__PURE__ */ G({
289
289
  _: 1
290
290
  }),
291
291
  x.tiles.length > 0 ? (i(), S("div", je, [
292
- (i(!0), S(L, null, Q(T.value, (o) => (i(), C(W, {
292
+ (i(!0), S(L, null, Q(T.value, (o) => (i(), k(W, {
293
293
  key: o.value,
294
294
  modelValue: c.value,
295
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(), C(U, {
299
+ ])) : (i(), k(U, {
300
300
  key: 1,
301
301
  class: "fm-typo-en-body-lg-400",
302
302
  label: e(d)("report.section.filter.noWidget")
@@ -334,14 +334,14 @@ const Pe = /* @__PURE__ */ G({
334
334
  }),
335
335
  emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
336
336
  setup(x, { emit: d }) {
337
- const n = j(x, "modelValue"), { breakpoints: r } = ne(), w = x, m = d, _ = Se(), u = $e(), k = R(), {
337
+ const n = j(x, "modelValue"), { breakpoints: r } = ne(), w = x, m = d, _ = Se(), u = $e(), V = R(), {
338
338
  currentSelectWidgetType: c,
339
339
  categories: q,
340
340
  editingTile: I,
341
341
  editingTileIndex: T,
342
342
  editingGlobalFilter: B,
343
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(() => {
344
+ } = ae(Ve()), { schemas: O } = ae(Ee()), { promptMessage: A } = Te(), $ = R(!1), p = R(!1), { t: l, te: C } = te(), U = R(void 0), W = N(() => {
345
345
  const o = n.value.tiles.flatMap((t) => {
346
346
  var g;
347
347
  const D = t.widget.config.schemaNames ?? [], f = ((g = t.widget.config.joinDatasources) == null ? void 0 : g.flatMap((H) => H.schemaNames ?? [])) ?? [];
@@ -445,7 +445,7 @@ const Pe = /* @__PURE__ */ G({
445
445
  })));
446
446
  return (o, t) => {
447
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), {
448
+ return i(), k(Be(e(r).lg || e(r).md ? Le : Je), {
449
449
  "model-value": w.hideConfiguration,
450
450
  "onUpdate:modelValue": t[8] || (t[8] = (y) => m("hideConfiguration", y))
451
451
  }, {
@@ -468,7 +468,7 @@ const Pe = /* @__PURE__ */ G({
468
468
  }, null, 8, ["modelValue", "is-open"]),
469
469
  a(Me, {
470
470
  ref_key: "form",
471
- ref: k,
471
+ ref: V,
472
472
  class: "px-6 py-16 flex flex-col gap-24 overflow-y-auto overflow-x-hidden"
473
473
  }, {
474
474
  default: s(() => [
@@ -544,7 +544,7 @@ const Pe = /* @__PURE__ */ G({
544
544
  }, 1032, ["content"]),
545
545
  W.value.find(
546
546
  (z) => z.name === y.schemaName
547
- ) ? Y("", !0) : (i(), C(oe, {
547
+ ) ? Y("", !0) : (i(), k(oe, {
548
548
  key: 0,
549
549
  content: "Missing schema",
550
550
  "z-index": 99
@@ -626,11 +626,11 @@ const Pe = /* @__PURE__ */ G({
626
626
  class: "handle"
627
627
  }),
628
628
  a(oe, {
629
- content: y.widget.title ? e(_e)(e(l), e(V), y.widget.title, "other") : e(l)("report.editor.widget", { index: Z + 1 }),
629
+ content: y.widget.title ? e(_e)(e(l), e(C), y.widget.title, "other") : e(l)("report.editor.widget", { index: Z + 1 }),
630
630
  class: "handle"
631
631
  }, {
632
632
  default: s(() => [
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)
633
+ h("p", Ze, E(y.widget.title ? e(_e)(e(l), e(C), y.widget.title, "other") : e(l)("report.editor.widget", { index: Z + 1 })), 1)
634
634
  ]),
635
635
  _: 2
636
636
  }, 1032, ["content"]),
@@ -712,17 +712,17 @@ const Pe = /* @__PURE__ */ G({
712
712
  emits: /* @__PURE__ */ J(["hideConfiguration"], ["update:modelValue"]),
713
713
  setup(x, { emit: d }) {
714
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) => {
715
+ return (V, c) => {
716
716
  const q = v("FmCircularProgress"), I = v("FmButton"), T = v("FmMenuDivider"), B = v("FmCard");
717
717
  return i(), S("div", el, [
718
718
  r.value ? (i(), S(L, { key: 1 }, [
719
- m.value ? Y("", !0) : (i(), C(Re, {
719
+ m.value ? Y("", !0) : (i(), k(Re, {
720
720
  key: 0,
721
721
  "model-value": !w.hideConfiguration
722
722
  }, {
723
723
  right: s(() => [
724
724
  h("div", ll, [
725
- r.value ? (i(), C(xe, {
725
+ r.value ? (i(), k(xe, {
726
726
  key: 0,
727
727
  modelValue: r.value,
728
728
  "onUpdate:modelValue": c[0] || (c[0] = (b) => r.value = b),
@@ -752,28 +752,28 @@ const Pe = /* @__PURE__ */ G({
752
752
  }),
753
753
  !_.value && !m.value ? (i(), S("div", ol, [
754
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, {
755
+ (i(!0), S(L, null, Q(r.value.tiles, (b, O) => (i(), k(se, {
756
756
  key: `${e(ee)()}_${O}`,
757
757
  "model-value": b,
758
758
  index: O,
759
759
  "hide-export": !0
760
760
  }, null, 8, ["model-value", "index"]))), 128))
761
- ])) : (i(), C(ue, { key: 1 }))
761
+ ])) : (i(), k(ue, { key: 1 }))
762
762
  ])) : _.value && !m.value ? (i(), S("div", nl, [
763
763
  a(B, { class: "px-5 pb-28" }, {
764
764
  default: s(() => [
765
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, {
766
+ (i(!0), S(L, null, Q(r.value.tiles, (b, O) => (i(), k(se, {
767
767
  key: `${e(ee)()}_${O}`,
768
768
  "model-value": b,
769
769
  index: O,
770
770
  "hide-export": !0
771
771
  }, null, 8, ["model-value", "index"]))), 128))
772
- ])) : (i(), C(ue, { key: 1 }))
772
+ ])) : (i(), k(ue, { key: 1 }))
773
773
  ]),
774
774
  _: 1
775
775
  }),
776
- r.value ? (i(), C(xe, {
776
+ r.value ? (i(), k(xe, {
777
777
  key: 0,
778
778
  modelValue: r.value,
779
779
  "onUpdate:modelValue": c[3] || (c[3] = (b) => r.value = b),
@@ -797,25 +797,25 @@ const Pe = /* @__PURE__ */ G({
797
797
  })
798
798
  }, [
799
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, {
800
+ (i(!0), S(L, null, Q(r.value.tiles, (b, O) => (i(), k(se, {
801
801
  key: `${e(ee)()}_${O}`,
802
802
  "model-value": b,
803
803
  index: O,
804
804
  "hide-export": !0,
805
805
  "custom-screen-width": w.previewWidth
806
806
  }, null, 8, ["model-value", "index", "custom-screen-width"]))), 128))
807
- ])) : (i(), C(ue, { key: 1 }))
807
+ ])) : (i(), k(ue, { key: 1 }))
808
808
  ], 4)
809
809
  ], 4)
810
810
  ]))
811
- ], 64)) : (i(), C(q, { key: 0 }))
811
+ ], 64)) : (i(), k(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
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(() => {
818
+ const d = Se(), n = $e(), r = Ve(), { promptLoader: w } = He(), { t: m } = te(), { currentReport: _, editingReport: u } = ae(r), { breakpoints: V } = ne(), c = N(() => {
819
819
  var F;
820
820
  return !((F = u.value) != null && F.editable);
821
821
  }), q = N(() => {
@@ -887,10 +887,10 @@ const Pe = /* @__PURE__ */ G({
887
887
  width: 390,
888
888
  height: 859
889
889
  }
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(() => {
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)), C = 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
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;
892
+ let F = (U.value - 48) / l.value, o = C.value * F;
893
+ return o > window.innerWidth && (F = window.innerWidth / C.value, o = C.value * F), F > 1 ? 1 : F;
894
894
  });
895
895
  function M(F) {
896
896
  $.value = F;
@@ -900,7 +900,7 @@ const Pe = /* @__PURE__ */ G({
900
900
  }
901
901
  return (F, o) => {
902
902
  const t = v("FmTooltip"), D = v("FmButton"), f = v("FmPageHead");
903
- return i(), C(qe, null, {
903
+ return i(), k(qe, null, {
904
904
  default: s(() => [
905
905
  a(f, {
906
906
  actions: [
@@ -919,7 +919,7 @@ const Pe = /* @__PURE__ */ G({
919
919
  }, {
920
920
  default: s(() => [
921
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]`)
922
+ class: le(`${e(V).sm || e(V).xs ? "hidden" : ""} text-ellipsis overflow-hidden text-nowrap fm-typo-en-title-md-600 w-[250px]`)
923
923
  }, E(q.value), 3)
924
924
  ]),
925
925
  _: 1
@@ -949,14 +949,14 @@ const Pe = /* @__PURE__ */ G({
949
949
  ]),
950
950
  _: 1
951
951
  }, 8, ["actions"]),
952
- e(u) ? (i(), C(ul, {
952
+ e(u) ? (i(), k(ul, {
953
953
  key: 0,
954
954
  modelValue: e(u),
955
955
  "onUpdate:modelValue": o[1] || (o[1] = (g) => ke(u) ? u.value = g : null),
956
956
  style: ce({ height: U.value + "px" }),
957
- class: le(e(k).lg || e(k).md ? "flex" : ""),
957
+ class: le(e(V).lg || e(V).md ? "flex" : ""),
958
958
  "hide-configuration": B.value,
959
- "preview-width": V.value,
959
+ "preview-width": C.value,
960
960
  "preview-height": l.value,
961
961
  "preview-scale": W.value,
962
962
  onHideConfiguration: o[2] || (o[2] = (g) => B.value = g)
package/dist/app.js CHANGED
@@ -4533,7 +4533,7 @@ const a = {
4533
4533
  {
4534
4534
  path: "/report-editor",
4535
4535
  name: "reportEditor",
4536
- component: () => import("./ReportEditor-B8OHmx-E.js")
4536
+ component: () => import("./ReportEditor-CqFvmqfu.js")
4537
4537
  },
4538
4538
  {
4539
4539
  path: "/report-editor/tile-editor",
@@ -4581,7 +4581,7 @@ const u = {
4581
4581
  "zh-CN": m,
4582
4582
  "th-TH": c,
4583
4583
  "zh-Hant": p
4584
- }, h = e(() => import("./App-Bh6L2Pph.js"));
4584
+ }, h = e(() => import("./App-B_0zunhK.js"));
4585
4585
  export {
4586
4586
  h as FmApp,
4587
4587
  u as i18nMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-report",
3
- "version": "5.10.2",
3
+ "version": "5.10.3",
4
4
  "files": [
5
5
  "dist"
6
6
  ],