@devgateway/dvz-ui-react 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -1
  2. package/dist/cjs/embeddable/chart/Line.js +1 -1
  3. package/dist/cjs/embeddable/data-paragraph/index.js +1 -1
  4. package/dist/cjs/embeddable/download/dom-to-image.js +32 -1
  5. package/dist/cjs/embeddable/filter/index.js +1 -1
  6. package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
  7. package/dist/cjs/embeddable/map/index.js +2 -2
  8. package/dist/cjs/embeddable/newsletter/index.js +1 -1
  9. package/dist/cjs/embeddable/pagemodules/FloatingNavigator.js +1 -1
  10. package/dist/cjs/embeddable/pagemodules/index.js +1 -1
  11. package/dist/cjs/embeddable/sankeychart/index.js +1 -1
  12. package/dist/cjs/embeddable/showcase/index.js +1 -1
  13. package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
  14. package/dist/cjs/embeddable/utils/parseUtils.js +1 -1
  15. package/dist/cjs/index.js +1 -1
  16. package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
  17. package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -1
  18. package/dist/cjs/tracker/index.js +1 -1
  19. package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
  20. package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -1
  21. package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +79 -79
  22. package/dist/esm/embeddable/chart/Line.js +209 -207
  23. package/dist/esm/embeddable/data-paragraph/index.js +119 -119
  24. package/dist/esm/embeddable/download/dom-to-image.js +32 -0
  25. package/dist/esm/embeddable/filter/index.js +113 -113
  26. package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
  27. package/dist/esm/embeddable/map/index.js +32 -32
  28. package/dist/esm/embeddable/newsletter/index.js +19 -19
  29. package/dist/esm/embeddable/pagemodules/FloatingNavigator.js +14 -15
  30. package/dist/esm/embeddable/pagemodules/index.js +44 -45
  31. package/dist/esm/embeddable/sankeychart/index.js +145 -145
  32. package/dist/esm/embeddable/showcase/index.js +27 -27
  33. package/dist/esm/embeddable/tabbedposts/index.js +40 -39
  34. package/dist/esm/embeddable/utils/parseUtils.js +11 -3
  35. package/dist/esm/index.js +74 -73
  36. package/dist/esm/tracker/InternalTrafficToggle.js +30 -20
  37. package/dist/esm/tracker/InternalTrafficWatermark.js +42 -52
  38. package/dist/esm/tracker/index.js +9 -8
  39. package/dist/esm/tracker/internalTrafficUtils.js +18 -13
  40. package/dist/esm/tracker/useInternalTrafficBypass.js +13 -31
  41. package/dist/types/embeddable/chart/Line.d.ts +2 -0
  42. package/dist/types/tracker/InternalTrafficToggle.d.ts +1 -4
  43. package/dist/types/tracker/InternalTrafficWatermark.d.ts +0 -10
  44. package/dist/types/tracker/internalTrafficUtils.d.ts +1 -14
  45. package/dist/types/tracker/useInternalTrafficBypass.d.ts +4 -10
  46. package/package.json +1 -1
@@ -1,43 +1,43 @@
1
1
  import { jsx as S } from "react/jsx-runtime";
2
- import { useRef as _, useState as P, useEffect as R } from "react";
3
- import L from "../data/DataProvider.js";
4
- import E from "../data/DataConsumer.js";
5
- import { connect as O } from "react-redux";
6
- import { formatContent as Z } from "../chart/Tooltip.js";
7
- const $ = (l) => {
2
+ import { useRef as _, useState as R, useEffect as U } from "react";
3
+ import E from "../data/DataProvider.js";
4
+ import O from "../data/DataConsumer.js";
5
+ import { connect as Z } from "react-redux";
6
+ import { formatContent as $ } from "../chart/Tooltip.js";
7
+ const k = (l) => {
8
8
  const {
9
- editing: m = !1,
10
- unique: p,
9
+ editing: u = !1,
10
+ unique: g,
11
11
  intl: r,
12
- childContent: s,
13
- "data-csv": h = "",
14
- "data-dvz-proxy-dataset-id": f,
12
+ childContent: i,
13
+ "data-csv": b = "",
14
+ "data-dvz-proxy-dataset-id": h,
15
15
  "data-view-mode": H = "info",
16
- "data-app": b,
17
- "data-measures": x = "{}",
18
- "data-format": w = "{}",
19
- "data-group": u,
20
- "data-filters": y = "[]",
21
- "data-number-font-size": n = 20,
22
- "data-number-color": j = "#000000",
23
- "data-wait-for-filters": T = "false",
24
- "data-no-data-text": M = "-",
16
+ "data-app": w,
17
+ "data-measures": m = "{}",
18
+ "data-format": v = "{}",
19
+ "data-group": p,
20
+ "data-filters": x = "[]",
21
+ "data-number-font-size": o = 20,
22
+ "data-number-color": L = "#000000",
23
+ "data-wait-for-filters": M = "false",
24
+ "data-no-data-text": V = "-",
25
25
  "data-text-template": z = ""
26
- } = l, V = r.locale, A = _(null);
27
- let v = !1, F = "";
26
+ } = l, A = r.locale, j = _(null);
27
+ let F = !1, D = "";
28
28
  try {
29
- const t = new URLSearchParams(window.location.search);
30
- v = t.get("autoHeight") === "1" || t.get("autoHeight") === "true", F = t.get("frameId") || "";
29
+ const e = new URLSearchParams(window.location.search);
30
+ F = e.get("autoHeight") === "1" || e.get("autoHeight") === "true", D = e.get("frameId") || "";
31
31
  } catch {
32
32
  }
33
- const g = (t) => m ? t : decodeURIComponent(t), o = (t) => {
33
+ const y = (e) => u ? e : decodeURIComponent(e), s = (e) => {
34
34
  try {
35
- return JSON.parse(g(t));
35
+ return JSON.parse(y(e));
36
36
  } catch {
37
- console.error("error parsing value:" + t);
37
+ console.error("error parsing value:" + e);
38
38
  }
39
39
  return null;
40
- }, d = o(w), i = d ? {
40
+ }, d = s(v), c = d ? {
41
41
  style: d.style === "compacted" ? "decimal" : d.style,
42
42
  notation: d.style === "compacted" ? "compact" : "standard",
43
43
  currency: d.currency,
@@ -48,121 +48,121 @@ const $ = (l) => {
48
48
  currency: "USD",
49
49
  minimumFractionDigits: 2,
50
50
  maximumFractionDigits: 2
51
- }, [C, N] = P(H), D = Math.max(24, (n || 14) * 1.2), I = {}, c = o(y) || {};
52
- c && c.forEach && c.forEach((t) => {
53
- t.value != null && t.value.filter((e) => e != null && e.toString().trim() != "").length > 0 && (I[t.param] = t.value);
54
- }), f && (I.dvzProxyDatasetId = f);
55
- const a = [];
56
- return q(A, v, F), /* @__PURE__ */ S("span", { ref: A, children: /* @__PURE__ */ S(
57
- L,
51
+ }, [C, N] = R(H), I = Math.max(24, (o || 14) * 1.2), T = s(m), f = T !== null ? T : typeof m == "string" && m && !m.trim().startsWith("{") && !m.trim().startsWith("[") ? [m] : [], t = {}, a = s(x) || {};
52
+ a && a.forEach && a.forEach((e) => {
53
+ e.value != null && e.value.filter((P) => P != null && P.toString().trim() != "").length > 0 && (t[e.param] = e.value);
54
+ }), h && (t.dvzProxyDatasetId = h);
55
+ const n = [];
56
+ return W(j, F, D), /* @__PURE__ */ S("span", { ref: j, children: /* @__PURE__ */ S(
57
+ E,
58
58
  {
59
- style: { minHeight: `${D}px` },
60
- params: I,
61
- app: b,
62
- group: u,
63
- csv: h,
64
- editing: m,
65
- waitForFilters: T === "true",
66
- store: [b, p, ...a],
67
- source: a.join("/"),
68
- children: /* @__PURE__ */ S(E, { children: /* @__PURE__ */ S(
69
- k,
59
+ style: { minHeight: `${I}px` },
60
+ params: t,
61
+ app: w,
62
+ group: p,
63
+ csv: b,
64
+ editing: u,
65
+ waitForFilters: M === "true",
66
+ store: [w, g, ...n],
67
+ source: n.join("/"),
68
+ children: /* @__PURE__ */ S(O, { children: /* @__PURE__ */ S(
69
+ q,
70
70
  {
71
- locale: V,
71
+ locale: A,
72
72
  intl: r,
73
- app: b,
74
- format: i,
75
- measure: o(x)[0] || null,
76
- numberFontSize: n,
77
- numberColor: j,
78
- noDataText: M,
73
+ app: w,
74
+ format: c,
75
+ measure: f[0] || null,
76
+ numberFontSize: o,
77
+ numberColor: L,
78
+ noDataText: V,
79
79
  textTemplate: z
80
80
  }
81
81
  ) })
82
82
  }
83
83
  ) });
84
- }, k = (l) => {
85
- var v, F;
84
+ }, q = (l) => {
85
+ var F, D;
86
86
  const {
87
- app: m,
88
- measure: p,
87
+ app: u,
88
+ measure: g,
89
89
  data: r,
90
- format: s,
91
- numberColor: h,
92
- numberFontSize: f,
90
+ format: i,
91
+ numberColor: b,
92
+ numberFontSize: h,
93
93
  noDataText: H = "-",
94
- textTemplate: b = "",
95
- intl: x
94
+ textTemplate: w = "",
95
+ intl: m
96
96
  } = l;
97
- let w = p, u = r;
98
- m === "csv" && ((v = r == null ? void 0 : r.meta) != null && v.fields) && ((F = r == null ? void 0 : r.data) != null && F.length) && (w = r.meta.fields[0], u = r.data[0]);
99
- const y = (u == null ? void 0 : u[w]) ?? null, n = y ? (s == null ? void 0 : s.style) === "percent" ? y / 100 : y : null, [j, T] = P(n);
100
- R(() => {
101
- n != null && T(n);
102
- }, [n]);
103
- const M = {
104
- color: decodeURIComponent(h),
105
- fontSize: f + "px",
97
+ let v = g, p = r;
98
+ u === "csv" && ((F = r == null ? void 0 : r.meta) != null && F.fields) && ((D = r == null ? void 0 : r.data) != null && D.length) && (v = r.meta.fields[0], p = r.data[0]);
99
+ const x = (p == null ? void 0 : p[v]) ?? null, o = x ? (i == null ? void 0 : i.style) === "percent" ? x / 100 : x : null, [L, M] = R(o);
100
+ U(() => {
101
+ o != null && M(o);
102
+ }, [o]);
103
+ const V = {
104
+ color: decodeURIComponent(b),
105
+ fontSize: h + "px",
106
106
  textAlign: "center",
107
107
  whiteSpace: "normal",
108
108
  wordBreak: "break-word"
109
- }, z = (g) => x.formatNumber(g, { ...s }), V = (g) => {
110
- if (!g) return "";
111
- let o = String(g);
112
- return o = o.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""), o = o.replace(/\son\w+=(?:"[^"]*"|'[^']*')/gi, ""), o;
109
+ }, z = (y) => m.formatNumber(y, { ...i }), A = (y) => {
110
+ if (!y) return "";
111
+ let s = String(y);
112
+ return s = s.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""), s = s.replace(/\son\w+=(?:"[^"]*"|'[^']*')/gi, ""), s;
113
113
  };
114
- return /* @__PURE__ */ S("span", { style: M, dangerouslySetInnerHTML: { __html: (() => {
115
- const o = {
116
- ...u && typeof u == "object" ? u : {},
117
- measure: w || "",
118
- rawValue: y,
119
- value: n,
120
- formattedValue: n != null ? z(n) : H
121
- }, d = n !== null ? z(n) : null;
122
- let i = decodeURIComponent(b) || "";
123
- i = i.replace(/(\%|\#C|\#)\(\s*([^)]*?)\s*\)/g, (c, a, t) => {
124
- const e = t.replace(/\s+/g, "");
125
- return `${a}(${e})`;
114
+ return /* @__PURE__ */ S("span", { style: V, dangerouslySetInnerHTML: { __html: (() => {
115
+ const s = {
116
+ ...p && typeof p == "object" ? p : {},
117
+ measure: v || "",
118
+ rawValue: x,
119
+ value: o,
120
+ formattedValue: o != null ? z(o) : H
121
+ }, d = o !== null ? z(o) : null;
122
+ let c = decodeURIComponent(w) || "";
123
+ c = c.replace(/(\%|\#C|\#)\(\s*([^)]*?)\s*\)/g, (f, t, a) => {
124
+ const n = a.replace(/\s+/g, "");
125
+ return `${t}(${n})`;
126
126
  });
127
- const C = (c, a, t) => x.formatNumber(c, { maximumFractionDigits: a ?? 2, ...t }), N = (c) => {
128
- const a = o[c];
129
- return typeof a == "string" ? Number(a) : a;
127
+ const C = (f, t, a) => m.formatNumber(f, { maximumFractionDigits: t ?? 2, ...a }), N = (f) => {
128
+ const t = s[f];
129
+ return typeof t == "string" ? Number(t) : t;
130
130
  };
131
- i = i.replace(/#C\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (c, a, t) => {
132
- const e = N(a);
133
- return e == null || isNaN(e) ? "" : C(e, t ? parseInt(t) : 2, { notation: "compact" });
134
- }), i = i.replace(/#\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (c, a, t) => {
135
- const e = N(a);
136
- return e == null || isNaN(e) ? "" : C(e, t ? parseInt(t) : 2, { style: "decimal" });
137
- }), i = i.replace(/%\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (c, a, t) => {
138
- const e = N(a);
139
- if (e == null || isNaN(e)) return "";
140
- const U = e / 100;
141
- return C(U, t ? parseInt(t) : 2, { style: "percent" });
131
+ c = c.replace(/#C\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (f, t, a) => {
132
+ const n = N(t);
133
+ return n == null || isNaN(n) ? "" : C(n, a ? parseInt(a) : 2, { notation: "compact" });
134
+ }), c = c.replace(/#\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (f, t, a) => {
135
+ const n = N(t);
136
+ return n == null || isNaN(n) ? "" : C(n, a ? parseInt(a) : 2, { style: "decimal" });
137
+ }), c = c.replace(/%\(\{([a-zA-Z0-9_]+)\}(?:,([0-9]+))?\)/g, (f, t, a) => {
138
+ const n = N(t);
139
+ if (n == null || isNaN(n)) return "";
140
+ const e = n / 100;
141
+ return C(e, a ? parseInt(a) : 2, { style: "percent" });
142
142
  });
143
- const D = Z(i, o, x, !1), I = D && D.trim().length ? D : d ?? H;
144
- return V(I);
143
+ const I = $(c, s, m, !1), T = I && I.trim().length ? I : d ?? H;
144
+ return A(T);
145
145
  })() } });
146
- }, q = (l, m, p) => {
147
- R(() => {
148
- if (!m) return;
149
- const r = l.current || document.body, s = () => {
146
+ }, W = (l, u, g) => {
147
+ U(() => {
148
+ if (!u) return;
149
+ const r = l.current || document.body, i = () => {
150
150
  try {
151
- const f = (l.current ? l.current.scrollHeight : document.body.scrollHeight) || 0;
152
- window.parent && f && window.parent.postMessage({ type: "dvz-embed-height", id: p, height: f }, "*");
151
+ const h = (l.current ? l.current.scrollHeight : document.body.scrollHeight) || 0;
152
+ window.parent && h && window.parent.postMessage({ type: "dvz-embed-height", id: g, height: h }, "*");
153
153
  } catch {
154
154
  }
155
- }, h = new MutationObserver(() => {
156
- requestAnimationFrame(s);
155
+ }, b = new MutationObserver(() => {
156
+ requestAnimationFrame(i);
157
157
  });
158
- return h.observe(r, { childList: !0, subtree: !0, characterData: !0 }), setTimeout(s, 0), () => h.disconnect();
159
- }, [l, m, p]);
160
- }, B = (l, m) => {
161
- const { "data-app": p, "data-group": r } = m, s = l.getIn(["data", "measures", p, r]);
162
- return s ? {
163
- injectedMeasures: s
158
+ return b.observe(r, { childList: !0, subtree: !0, characterData: !0 }), setTimeout(i, 0), () => b.disconnect();
159
+ }, [l, u, g]);
160
+ }, B = (l, u) => {
161
+ const { "data-app": g, "data-group": r } = u, i = l.getIn(["data", "measures", g, r]);
162
+ return i ? {
163
+ injectedMeasures: i
164
164
  } : {};
165
- }, J = {}, tt = O(B, J)($);
165
+ }, J = {}, et = Z(B, J)(k);
166
166
  export {
167
- tt as default
167
+ et as default
168
168
  };
@@ -1,3 +1,35 @@
1
+ /*!
2
+ * dom-to-image
3
+ * https://github.com/tsayen/dom-to-image
4
+ *
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright 2015 Anatolii Saienko (https://github.com/tsayen)
8
+ * Copyright 2012 Paul Bakaus (http://paulbakaus.com/)
9
+ *
10
+ * Modifications copyright (c) 2025 Development Gateway
11
+ * This file has been modified from the original source.
12
+ * Original source: https://github.com/tsayen/dom-to-image
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining
15
+ * a copy of this software and associated documentation files (the
16
+ * "Software"), to deal in the Software without restriction, including
17
+ * without limitation the rights to use, copy, modify, merge, publish,
18
+ * distribute, sublicense, and/or sell copies of the Software, and to
19
+ * permit persons to whom the Software is furnished to do so, subject to
20
+ * the following conditions:
21
+ *
22
+ * The above copyright notice and this permission notice shall be
23
+ * included in all copies or substantial portions of the Software.
24
+ *
25
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+ */
1
33
  const d = z(), I = K(), F = Q(), N = Y(), k = {
2
34
  // Default is to fail on error, no placeholder
3
35
  imagePlaceholder: void 0,