@devgateway/dvz-ui-react 1.9.1 → 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.
- package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/data-paragraph/index.js +1 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
- package/dist/cjs/embeddable/newsletter/index.js +1 -1
- package/dist/cjs/embeddable/sankeychart/index.js +1 -1
- package/dist/cjs/embeddable/showcase/index.js +1 -1
- package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
- package/dist/cjs/embeddable/utils/parseUtils.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
- package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -1
- package/dist/cjs/tracker/index.js +1 -1
- package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
- package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -1
- package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +79 -79
- package/dist/esm/embeddable/chart/Line.js +209 -207
- package/dist/esm/embeddable/data-paragraph/index.js +119 -119
- package/dist/esm/embeddable/filter/index.js +113 -113
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
- package/dist/esm/embeddable/newsletter/index.js +19 -19
- package/dist/esm/embeddable/sankeychart/index.js +145 -145
- package/dist/esm/embeddable/showcase/index.js +27 -27
- package/dist/esm/embeddable/tabbedposts/index.js +40 -39
- package/dist/esm/embeddable/utils/parseUtils.js +11 -3
- package/dist/esm/index.js +74 -73
- package/dist/esm/tracker/InternalTrafficToggle.js +30 -20
- package/dist/esm/tracker/InternalTrafficWatermark.js +42 -52
- package/dist/esm/tracker/index.js +9 -8
- package/dist/esm/tracker/internalTrafficUtils.js +18 -13
- package/dist/esm/tracker/useInternalTrafficBypass.js +13 -31
- package/dist/types/embeddable/chart/Line.d.ts +2 -0
- package/dist/types/tracker/InternalTrafficToggle.d.ts +1 -4
- package/dist/types/tracker/InternalTrafficWatermark.d.ts +0 -10
- package/dist/types/tracker/internalTrafficUtils.d.ts +1 -14
- package/dist/types/tracker/useInternalTrafficBypass.d.ts +4 -10
- 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
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { connect as
|
|
6
|
-
import { formatContent as
|
|
7
|
-
const
|
|
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:
|
|
10
|
-
unique:
|
|
9
|
+
editing: u = !1,
|
|
10
|
+
unique: g,
|
|
11
11
|
intl: r,
|
|
12
|
-
childContent:
|
|
13
|
-
"data-csv":
|
|
14
|
-
"data-dvz-proxy-dataset-id":
|
|
12
|
+
childContent: i,
|
|
13
|
+
"data-csv": b = "",
|
|
14
|
+
"data-dvz-proxy-dataset-id": h,
|
|
15
15
|
"data-view-mode": H = "info",
|
|
16
|
-
"data-app":
|
|
17
|
-
"data-measures":
|
|
18
|
-
"data-format":
|
|
19
|
-
"data-group":
|
|
20
|
-
"data-filters":
|
|
21
|
-
"data-number-font-size":
|
|
22
|
-
"data-number-color":
|
|
23
|
-
"data-wait-for-filters":
|
|
24
|
-
"data-no-data-text":
|
|
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,
|
|
27
|
-
let
|
|
26
|
+
} = l, A = r.locale, j = _(null);
|
|
27
|
+
let F = !1, D = "";
|
|
28
28
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
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
|
|
33
|
+
const y = (e) => u ? e : decodeURIComponent(e), s = (e) => {
|
|
34
34
|
try {
|
|
35
|
-
return JSON.parse(
|
|
35
|
+
return JSON.parse(y(e));
|
|
36
36
|
} catch {
|
|
37
|
-
console.error("error parsing value:" +
|
|
37
|
+
console.error("error parsing value:" + e);
|
|
38
38
|
}
|
|
39
39
|
return null;
|
|
40
|
-
}, 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] =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}),
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
|
|
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: `${
|
|
60
|
-
params:
|
|
61
|
-
app:
|
|
62
|
-
group:
|
|
63
|
-
csv:
|
|
64
|
-
editing:
|
|
65
|
-
waitForFilters:
|
|
66
|
-
store: [
|
|
67
|
-
source:
|
|
68
|
-
children: /* @__PURE__ */ S(
|
|
69
|
-
|
|
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:
|
|
71
|
+
locale: A,
|
|
72
72
|
intl: r,
|
|
73
|
-
app:
|
|
74
|
-
format:
|
|
75
|
-
measure:
|
|
76
|
-
numberFontSize:
|
|
77
|
-
numberColor:
|
|
78
|
-
noDataText:
|
|
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
|
-
},
|
|
85
|
-
var
|
|
84
|
+
}, q = (l) => {
|
|
85
|
+
var F, D;
|
|
86
86
|
const {
|
|
87
|
-
app:
|
|
88
|
-
measure:
|
|
87
|
+
app: u,
|
|
88
|
+
measure: g,
|
|
89
89
|
data: r,
|
|
90
|
-
format:
|
|
91
|
-
numberColor:
|
|
92
|
-
numberFontSize:
|
|
90
|
+
format: i,
|
|
91
|
+
numberColor: b,
|
|
92
|
+
numberFontSize: h,
|
|
93
93
|
noDataText: H = "-",
|
|
94
|
-
textTemplate:
|
|
95
|
-
intl:
|
|
94
|
+
textTemplate: w = "",
|
|
95
|
+
intl: m
|
|
96
96
|
} = l;
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
const
|
|
104
|
-
color: decodeURIComponent(
|
|
105
|
-
fontSize:
|
|
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 = (
|
|
110
|
-
if (!
|
|
111
|
-
let
|
|
112
|
-
return
|
|
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:
|
|
115
|
-
const
|
|
116
|
-
...
|
|
117
|
-
measure:
|
|
118
|
-
rawValue:
|
|
119
|
-
value:
|
|
120
|
-
formattedValue:
|
|
121
|
-
}, d =
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
return `${
|
|
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 = (
|
|
128
|
-
const
|
|
129
|
-
return typeof
|
|
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
|
-
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
}),
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
}),
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
return C(
|
|
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
|
|
144
|
-
return
|
|
143
|
+
const I = $(c, s, m, !1), T = I && I.trim().length ? I : d ?? H;
|
|
144
|
+
return A(T);
|
|
145
145
|
})() } });
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
if (!
|
|
149
|
-
const r = l.current || document.body,
|
|
146
|
+
}, W = (l, u, g) => {
|
|
147
|
+
U(() => {
|
|
148
|
+
if (!u) return;
|
|
149
|
+
const r = l.current || document.body, i = () => {
|
|
150
150
|
try {
|
|
151
|
-
const
|
|
152
|
-
window.parent &&
|
|
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
|
-
},
|
|
156
|
-
requestAnimationFrame(
|
|
155
|
+
}, b = new MutationObserver(() => {
|
|
156
|
+
requestAnimationFrame(i);
|
|
157
157
|
});
|
|
158
|
-
return
|
|
159
|
-
}, [l,
|
|
160
|
-
}, B = (l,
|
|
161
|
-
const { "data-app":
|
|
162
|
-
return
|
|
163
|
-
injectedMeasures:
|
|
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 = {},
|
|
165
|
+
}, J = {}, et = Z(B, J)(k);
|
|
166
166
|
export {
|
|
167
|
-
|
|
167
|
+
et as default
|
|
168
168
|
};
|