@devgateway/dvz-ui-react 1.9.1 → 1.9.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.
Files changed (38) 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/filter/index.js +1 -1
  5. package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
  6. package/dist/cjs/embeddable/newsletter/index.js +1 -1
  7. package/dist/cjs/embeddable/sankeychart/index.js +1 -1
  8. package/dist/cjs/embeddable/showcase/index.js +1 -1
  9. package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
  10. package/dist/cjs/embeddable/utils/parseUtils.js +1 -1
  11. package/dist/cjs/index.js +1 -1
  12. package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
  13. package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -1
  14. package/dist/cjs/tracker/index.js +1 -1
  15. package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
  16. package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -1
  17. package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +79 -79
  18. package/dist/esm/embeddable/chart/Line.js +209 -207
  19. package/dist/esm/embeddable/data-paragraph/index.js +119 -119
  20. package/dist/esm/embeddable/filter/index.js +113 -113
  21. package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
  22. package/dist/esm/embeddable/newsletter/index.js +35 -38
  23. package/dist/esm/embeddable/sankeychart/index.js +145 -145
  24. package/dist/esm/embeddable/showcase/index.js +27 -27
  25. package/dist/esm/embeddable/tabbedposts/index.js +40 -39
  26. package/dist/esm/embeddable/utils/parseUtils.js +11 -3
  27. package/dist/esm/index.js +74 -73
  28. package/dist/esm/tracker/InternalTrafficToggle.js +30 -20
  29. package/dist/esm/tracker/InternalTrafficWatermark.js +42 -52
  30. package/dist/esm/tracker/index.js +9 -8
  31. package/dist/esm/tracker/internalTrafficUtils.js +18 -13
  32. package/dist/esm/tracker/useInternalTrafficBypass.js +13 -31
  33. package/dist/types/embeddable/chart/Line.d.ts +2 -0
  34. package/dist/types/tracker/InternalTrafficToggle.d.ts +1 -4
  35. package/dist/types/tracker/InternalTrafficWatermark.d.ts +0 -10
  36. package/dist/types/tracker/internalTrafficUtils.d.ts +1 -14
  37. package/dist/types/tracker/useInternalTrafficBypass.d.ts +4 -10
  38. package/package.json +1 -1
@@ -1,51 +1,48 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import "react";
3
- import { Input as f, Button as v, Message as c } from "semantic-ui-react";
4
- import { connect as x } from "react-redux";
5
- import { setEmail as S, newsletterSubscription as C } from "../reducers/embeddable.js";
6
- const I = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, P = (e) => {
7
- const a = () => {
8
- const { email: s, list: i, tag: b } = e;
9
- e.onSubmit({ email: s, list: i, tag: b });
10
- }, {
11
- status: l,
12
- editing: o,
13
- list: k,
14
- placeholder: d = "enter your email address",
15
- successmessage: u = "Thanks",
16
- failuremessage: g = "Something didn't go well",
17
- label: p = "Send",
18
- tag: y,
19
- email: r,
20
- onChange: h
21
- } = e;
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import S from "react";
3
+ import { Input as x, Button as C, Message as o } from "semantic-ui-react";
4
+ import { connect as I } from "react-redux";
5
+ import { setEmail as R, newsletterSubscription as E } from "../reducers/embeddable.js";
6
+ const l = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, P = (t) => {
7
+ const {
8
+ status: a,
9
+ editing: i,
10
+ "data-list": m,
11
+ "data-placeholder": c = "enter your email address",
12
+ "data-success-message": d = "Thanks",
13
+ "data-failure-message": u = "Something didn't go well",
14
+ "data-label": p = "Send",
15
+ "data-tag": g
16
+ } = t, [s, f] = S.useState(""), h = () => {
17
+ l.test(s) && t.onSubmit({ email: s, list: m, tag: g });
18
+ };
22
19
  let n = "";
23
- (l === "OK" || o) && (n = /* @__PURE__ */ t(c, { success: !0, children: /* @__PURE__ */ t("p", { children: u }) })), (l === "ERROR" || o) && (n = /* @__PURE__ */ t(c, { negative: !0, children: /* @__PURE__ */ t("p", { children: g }) }));
24
- const w = I.test(r);
25
- return /* @__PURE__ */ m("div", { className: "viz newsLetter", children: [
26
- /* @__PURE__ */ m("div", { className: "viz newsLetter form", children: [
27
- /* @__PURE__ */ t(
28
- f,
20
+ (a === "OK" || i) && (n = /* @__PURE__ */ e(o, { success: !0, children: /* @__PURE__ */ e("p", { children: d }) })), (a === "ERROR" || i) && (n = /* @__PURE__ */ e(o, { negative: !0, children: /* @__PURE__ */ e("p", { children: u }) }));
21
+ const w = l.test(s);
22
+ return /* @__PURE__ */ r("div", { className: "viz newsLetter", children: [
23
+ /* @__PURE__ */ r("div", { className: "viz newsLetter form", children: [
24
+ /* @__PURE__ */ e(
25
+ x,
29
26
  {
30
27
  icon: "envelope",
31
28
  name: "email",
32
- value: r,
33
- onChange: (s, i) => h(i.value),
29
+ value: s,
30
+ onChange: (b, v) => f(v.value),
34
31
  iconPosition: "left",
35
- placeholder: d
32
+ placeholder: c
36
33
  }
37
34
  ),
38
- /* @__PURE__ */ t(v, { disabled: !w, primary: !0, onClick: (s) => a(), children: p })
35
+ /* @__PURE__ */ e(C, { disabled: !w, primary: !0, onClick: (b) => h(), children: p })
39
36
  ] }),
40
37
  n
41
38
  ] });
42
- }, R = (e, a) => ({
43
- status: e.getIn(["embeddable", "newsletter", "status"]),
44
- email: e.getIn(["embeddable", "newsletter", "email"])
45
- }), j = {
46
- onSubmit: C,
47
- onChange: S
48
- }, T = x(R, j)(P);
39
+ }, j = (t, a) => ({
40
+ status: t.getIn(["embeddable", "newsletter", "status"]),
41
+ email: t.getIn(["embeddable", "newsletter", "email"])
42
+ }), k = {
43
+ onSubmit: E,
44
+ onChange: R
45
+ }, T = I(j, k)(P);
49
46
  export {
50
47
  T as default
51
48
  };
@@ -1,159 +1,159 @@
1
- import { jsx as c, jsxs as F } from "react/jsx-runtime";
2
- import z, { useRef as Pe, useState as Ee } from "react";
3
- import { Container as R } from "semantic-ui-react";
4
- import Ie from "../data/DataProvider.js";
5
- import Oe from "../data/DataConsumer.js";
6
- import { PostContent as we } from "@devgateway/wp-react-lib";
7
- import Fe from "../common/colors/ColorProvider.js";
8
- import K from "../common/Messages.js";
9
- import { connect as Re } from "react-redux";
10
- import je from "./Sankey.js";
11
- import He from "papaparse";
12
- const Se = (h) => {
1
+ import { jsx as c, jsxs as R } from "react/jsx-runtime";
2
+ import Q, { useRef as Ie, useState as Oe } from "react";
3
+ import { Container as j } from "semantic-ui-react";
4
+ import we from "../data/DataProvider.js";
5
+ import Fe from "../data/DataConsumer.js";
6
+ import { PostContent as Re } from "@devgateway/wp-react-lib";
7
+ import je from "../common/colors/ColorProvider.js";
8
+ import X from "../common/Messages.js";
9
+ import { connect as He } from "react-redux";
10
+ import Se from "./Sankey.js";
11
+ import Te from "papaparse";
12
+ const Ne = (h) => {
13
13
  const {
14
- parent: B,
14
+ parent: x,
15
15
  editing: u = !1,
16
16
  unique: C,
17
17
  childContent: o,
18
- categories: x,
18
+ categories: L,
19
19
  injectedMeasures: r,
20
20
  "data-csv": i = "",
21
- "data-no-data-message": d = "No data matches your selection",
22
- "data-view-mode": t = "info",
21
+ "data-no-data-message": s = "No data matches your selection",
22
+ "data-view-mode": a = "info",
23
23
  "data-height": n,
24
24
  "data-source": m,
25
25
  "data-dimension1": e,
26
- "data-dimension2": s,
27
- "data-dimension3": a,
28
- "data-scheme": v = "nivo",
26
+ "data-dimension2": d,
27
+ "data-dimension3": t,
28
+ "data-scheme": y = "nivo",
29
29
  "data-margin-left": f,
30
- "data-margin-top": k,
31
- "data-margin-right": Q,
32
- "data-margin-bottom": X,
33
- "data-show-legends": j,
34
- "data-legend-position": Y,
30
+ "data-margin-top": v,
31
+ "data-margin-right": Y,
32
+ "data-margin-bottom": Z,
33
+ "data-show-legends": H,
34
+ "data-legend-position": _,
35
35
  "data-app": p,
36
- "data-measures": L = {},
37
- "data-format": Z = "{}",
38
- "data-tooltip-html": E,
39
- "data-layout": _,
40
- "data-group": H,
41
- "data-filters": ee = [],
42
- "data-no-data-message": $e,
43
- "data-legend-label": ae,
44
- "data-tooltip-enabled": S,
45
- "data-use-label-background": T,
46
- "data-use-check-box-background": N,
47
- "data-legend-label-color": te,
48
- "data-tooltip-enable-markdown": D,
49
- "data-reverse-legend": U,
36
+ "data-measures": k = {},
37
+ "data-format": ee = "{}",
38
+ "data-tooltip-html": I,
39
+ "data-layout": te,
40
+ "data-group": S,
41
+ "data-filters": ae = [],
42
+ "data-no-data-message": Ge,
43
+ "data-legend-label": oe,
44
+ "data-tooltip-enabled": T,
45
+ "data-use-label-background": N,
46
+ "data-use-check-box-background": U,
47
+ "data-legend-label-color": ne,
48
+ "data-tooltip-enable-markdown": B,
49
+ "data-reverse-legend": W,
50
50
  "data-sort": $,
51
- "data-node-thickness": oe,
52
- "data-node-opacity": ne,
53
- "data-node-hover-opacity": re,
54
- "data-node-inner-padding": ie,
55
- "data-node-spacing": de,
56
- "data-node-hover-others-opacity": se,
57
- "data-node-border-width": le,
58
- "data-node-border-radius": ce,
59
- "data-link-opacity": ue,
60
- "data-link-hover-opacity": me,
61
- "data-link-hover-others-opacity": pe,
62
- "data-link-contract": ge,
51
+ "data-node-thickness": re,
52
+ "data-node-opacity": ie,
53
+ "data-node-hover-opacity": se,
54
+ "data-node-inner-padding": de,
55
+ "data-node-spacing": le,
56
+ "data-node-hover-others-opacity": ce,
57
+ "data-node-border-width": ue,
58
+ "data-node-border-radius": me,
59
+ "data-link-opacity": pe,
60
+ "data-link-hover-opacity": ge,
61
+ "data-link-hover-others-opacity": he,
62
+ "data-link-contract": fe,
63
63
  "data-enable-link-gradient": G,
64
64
  "data-enable-labels": V,
65
- "data-label-position": he,
66
- "data-label-padding": fe,
65
+ "data-label-position": be,
66
+ "data-label-padding": ye,
67
67
  "data-use-custom-label-color": q,
68
- "data-label-text-color": be,
69
- "data-label-orientation": ye,
70
- "data-manual-colors": ve = "{}"
71
- } = h, A = h.intl.locale, ke = Pe(null), I = (l) => u ? l : decodeURIComponent(l), b = (l) => {
68
+ "data-label-text-color": ve,
69
+ "data-label-orientation": ke,
70
+ "data-manual-colors": Ce = "{}"
71
+ } = h, A = h.intl.locale, Le = Ie(null), O = (l) => u ? l : decodeURIComponent(l), D = (l) => {
72
72
  try {
73
- return JSON.parse(I(l));
73
+ return JSON.parse(O(l));
74
74
  } catch {
75
75
  console.error("error parsing value:" + l);
76
76
  }
77
77
  return null;
78
- }, Ce = () => b(ve)[p], y = b(Z), xe = y ? {
79
- style: y.style === "compacted" ? "decimal" : y.style,
80
- notation: y.style === "compacted" ? "compact" : "standard",
81
- currency: y.currency,
82
- minimumFractionDigits: parseInt(y.minimumFractionDigits),
83
- maximumFractionDigits: parseInt(y.maximumFractionDigits)
78
+ }, xe = () => D(Ce)[p], b = D(ee), Be = b ? {
79
+ style: b.style === "compacted" ? "decimal" : b.style,
80
+ notation: b.style === "compacted" ? "compact" : "standard",
81
+ currency: b.currency,
82
+ minimumFractionDigits: parseInt(b.minimumFractionDigits),
83
+ maximumFractionDigits: parseInt(b.maximumFractionDigits)
84
84
  } : {
85
85
  notation: "standard",
86
86
  currency: "USD",
87
87
  minimumFractionDigits: 2,
88
88
  maximumFractionDigits: 2
89
- }, [Le, Ge] = Ee(t), Be = u ? t : Le, De = {
90
- scheme: v
91
- }, M = u ? n - 80 : n - 40, Me = {}, J = {
89
+ }, [De, Ve] = Oe(a), Me = u ? a : De, Pe = {
90
+ scheme: y
91
+ }, M = u ? n - 80 : n - 40, Ee = {}, J = {
92
92
  app: p,
93
- layout: _,
94
- showLegends: j == !0 || j == "true",
95
- legendLabel: ae,
93
+ layout: te,
94
+ showLegends: H == !0 || H == "true",
95
+ legendLabel: oe,
96
96
  marginLeft: parseInt(f),
97
- marginTop: parseInt(k),
98
- marginRight: parseInt(Q),
99
- marginBottom: parseInt(X),
97
+ marginTop: parseInt(v),
98
+ marginRight: parseInt(Y),
99
+ marginBottom: parseInt(Z),
100
100
  height: `${M}px`,
101
- legendPosition: Y,
102
- legends: Me,
103
- tooltip: E ? D === !0 || D === "true" ? I(E) : I(E).replace(/\r\n/g, "<hr/>").replace(/[\r\n]/g, "<hr/>") : "",
104
- colors: De,
105
- format: xe,
106
- categories: x,
107
- legendLabelColor: decodeURIComponent(te),
108
- tooltipEnabled: S == !0 || S == "true",
109
- tooltipEnableMarkdown: D == !0 || D == "true",
110
- reverseLegend: U == !0 || U == "true",
101
+ legendPosition: _,
102
+ legends: Ee,
103
+ tooltip: I ? B === !0 || B === "true" ? O(I) : O(I).replace(/\r\n/g, "<hr/>").replace(/[\r\n]/g, "<hr/>") : "",
104
+ colors: Pe,
105
+ format: Be,
106
+ categories: L,
107
+ legendLabelColor: decodeURIComponent(ne),
108
+ tooltipEnabled: T == !0 || T == "true",
109
+ tooltipEnableMarkdown: B == !0 || B == "true",
110
+ reverseLegend: W == !0 || W == "true",
111
111
  sort: $,
112
- nodeThickness: oe,
113
- nodeOpacity: ne,
114
- nodeHoverOpacity: re,
115
- nodeInnerPadding: ie,
116
- nodeSpacing: de,
117
- nodeHoverOthersOpacity: se,
118
- nodeBorderWidth: le,
119
- nodeBorderRadius: parseInt(ce),
120
- linkOpacity: ue,
121
- linkHoverOpacity: me,
122
- linkContract: ge,
112
+ nodeThickness: re,
113
+ nodeOpacity: ie,
114
+ nodeHoverOpacity: se,
115
+ nodeInnerPadding: de,
116
+ nodeSpacing: le,
117
+ nodeHoverOthersOpacity: ce,
118
+ nodeBorderWidth: ue,
119
+ nodeBorderRadius: parseInt(me),
120
+ linkOpacity: pe,
121
+ linkHoverOpacity: ge,
122
+ linkContract: fe,
123
123
  enableLinkGradient: G == !0 || G == "true",
124
- linkHoverOthersOpacity: pe,
124
+ linkHoverOthersOpacity: he,
125
125
  enableLabels: V == !0 || V == "true",
126
- labelPosition: he,
127
- labelPadding: fe,
126
+ labelPosition: be,
127
+ labelPadding: ye,
128
128
  useCustomLabelColor: q == !0 || q == "true",
129
- labelTextColor: be,
130
- labelOrientation: ye,
131
- useLabelBackground: T == !0 || T == "true",
132
- useCheckBoxBackground: N == !0 || N == "true"
133
- }, W = {}, O = b(ee) || {};
134
- O && O.forEach && O.forEach((l) => {
135
- l.value != null && l.value.filter((w) => w != null && w.toString().trim() != "").length > 0 && (W[l.param] = l.value);
129
+ labelTextColor: ve,
130
+ labelOrientation: ke,
131
+ useLabelBackground: N == !0 || N == "true",
132
+ useCheckBoxBackground: U == !0 || U == "true"
133
+ }, z = D(k), P = z !== null ? z : typeof k == "string" && k && !k.trim().startsWith("{") && !k.trim().startsWith("[") ? [k] : [], K = {}, w = D(ae) || {};
134
+ w && w.forEach && w.forEach((l) => {
135
+ l.value != null && l.value.filter((F) => F != null && F.toString().trim() != "").length > 0 && (K[l.param] = l.value);
136
136
  });
137
- let P = !1;
137
+ let E = !1;
138
138
  const g = [];
139
- return e != "none" && g.push(e), s != "none" && g.push(s), a != "none" && g.push(a), p != "csv" ? (!g.length || !L || !b(L) || !b(L)[0]) && (P = !0) : i.length == 0 && (P = !0), /* @__PURE__ */ c("div", { ref: ke, children: /* @__PURE__ */ F(R, { className: "chart container", style: { minHeight: n + "px" }, fluid: !0, children: [
139
+ return e != "none" && g.push(e), d != "none" && g.push(d), t != "none" && g.push(t), p != "csv" ? (!g.length || !P.length || !P[0]) && (E = !0) : i.length == 0 && (E = !0), /* @__PURE__ */ c("div", { ref: Le, children: /* @__PURE__ */ R(j, { className: "chart container", style: { minHeight: n + "px" }, fluid: !0, children: [
140
140
  /* @__PURE__ */ c(
141
- Ie,
141
+ we,
142
142
  {
143
143
  style: { height: `${M}px` },
144
- params: W,
144
+ params: K,
145
145
  app: p,
146
- group: H,
146
+ group: S,
147
147
  csv: i,
148
148
  editing: u,
149
149
  store: [p, C, ...g],
150
150
  source: g.join("/"),
151
- children: /* @__PURE__ */ F(R, { style: { height: `${M}px` }, className: "body", fluid: !0, children: [
152
- P && /* @__PURE__ */ c(K, { editing: u }),
153
- !P && /* @__PURE__ */ F(Oe, { children: [
154
- /* @__PURE__ */ c(K, { app: p, group: H, noDataMsg: d, children: " " }),
151
+ children: /* @__PURE__ */ R(j, { style: { height: `${M}px` }, className: "body", fluid: !0, children: [
152
+ E && /* @__PURE__ */ c(X, { editing: u }),
153
+ !E && /* @__PURE__ */ R(Fe, { children: [
154
+ /* @__PURE__ */ c(X, { app: p, group: S, noDataMsg: s, children: " " }),
155
155
  /* @__PURE__ */ c(
156
- Te,
156
+ Ue,
157
157
  {
158
158
  locale: A,
159
159
  colorBy: "id",
@@ -161,17 +161,17 @@ const Se = (h) => {
161
161
  sort: $,
162
162
  csv: i,
163
163
  app: p,
164
- measure: b(L)[0] || null,
164
+ measure: P[0] || null,
165
165
  children: /* @__PURE__ */ c(
166
- Fe,
166
+ je,
167
167
  {
168
168
  app: p,
169
169
  locale: A,
170
- manualColors: Ce(),
170
+ manualColors: xe(),
171
171
  colorBy: "id",
172
- scheme: v,
172
+ scheme: y,
173
173
  barColor: J.barColor,
174
- children: /* @__PURE__ */ c(je, { ...J, dimensions: g, measure: b(L)[0] || null })
174
+ children: /* @__PURE__ */ c(Se, { ...J, dimensions: g, measure: P[0] || null })
175
175
  }
176
176
  )
177
177
  }
@@ -181,58 +181,58 @@ const Se = (h) => {
181
181
  }
182
182
  ),
183
183
  /* @__PURE__ */ c("br", {}),
184
- o && Be == "info" && /* @__PURE__ */ c(R, { fluid: !0, style: { height: M + "px" }, className: "body", children: /* @__PURE__ */ c(we, { post: { content: { rendered: o } } }) })
184
+ o && Me == "info" && /* @__PURE__ */ c(j, { fluid: !0, style: { height: M + "px" }, className: "body", children: /* @__PURE__ */ c(Re, { post: { content: { rendered: o } } }) })
185
185
  ] }) });
186
- }, Te = (h) => {
187
- const { children: B, csv: u, app: C } = h;
188
- let o = { nodes: [], links: [] }, x = {
186
+ }, Ue = (h) => {
187
+ const { children: x, csv: u, app: C } = h;
188
+ let o = { nodes: [], links: [] }, L = {
189
189
  indexBy: "",
190
190
  keys: o.nodes.map((r) => r.id),
191
191
  data: o
192
192
  };
193
193
  if (C != "csv") {
194
- const r = (d) => {
195
- const { data: t, dimensions: n, measure: m } = d, e = [], s = [], a = {};
196
- return a[t.type] = t.value, i(t.children, e, s, null, m, a), { nodes: e, links: s };
197
- }, i = (d = [], t, n, m, e, s) => {
198
- d.forEach((a) => {
199
- const v = {};
200
- if (v[a.type] = a.value, t.find((f) => f.id === a.value) || t.push({ id: a.value }), m) {
201
- const f = n.find((k) => k.source === m && k.target === a.value);
194
+ const r = (s) => {
195
+ const { data: a, dimensions: n, measure: m } = s, e = [], d = [], t = {};
196
+ return t[a.type] = a.value, i(a.children, e, d, null, m, t), { nodes: e, links: d };
197
+ }, i = (s = [], a, n, m, e, d) => {
198
+ s.forEach((t) => {
199
+ const y = {};
200
+ if (y[t.type] = t.value, a.find((f) => f.id === t.value) || a.push({ id: t.value }), m) {
201
+ const f = n.find((v) => v.source === m && v.target === t.value);
202
202
  if (f)
203
- f.value = f.value + a[e];
203
+ f.value = f.value + t[e];
204
204
  else {
205
- const k = { ...a, ...v, ...s };
206
- n.push({ source: m, target: a.value, value: a[e], data: k });
205
+ const v = { ...t, ...y, ...d };
206
+ n.push({ source: m, target: t.value, value: t[e], data: v });
207
207
  }
208
208
  }
209
- a.children && a.children.length > 0 && i(a.children, t, n, a.value, e, v);
209
+ t.children && t.children.length > 0 && i(t.children, a, n, t.value, e, y);
210
210
  });
211
211
  };
212
- o = r(h), x = {
212
+ o = r(h), L = {
213
213
  indexBy: "",
214
- keys: o.nodes.map((d) => d.id),
214
+ keys: o.nodes.map((s) => s.id),
215
215
  data: o
216
216
  };
217
217
  } else {
218
- const r = He.parse(u, { header: !0, dynamicTyping: !0 }), i = r.meta.fields, d = i.shift(), t = r.data.map((e) => e[d]), n = [...i.map((e) => ({ id: e })), ...t.map((e) => ({ id: e }))], m = [];
218
+ const r = Te.parse(u, { header: !0, dynamicTyping: !0 }), i = r.meta.fields, s = i.shift(), a = r.data.map((e) => e[s]), n = [...i.map((e) => ({ id: e })), ...a.map((e) => ({ id: e }))], m = [];
219
219
  r.data.forEach((e) => {
220
- i.forEach((s) => {
221
- m.push({ source: s, target: e[d], value: e[s] });
220
+ i.forEach((d) => {
221
+ m.push({ source: d, target: e[s], value: e[d] });
222
222
  });
223
- }), x = {
223
+ }), L = {
224
224
  indexBy: "",
225
225
  keys: n.map((e) => e.id),
226
226
  data: { nodes: n, links: m }
227
227
  };
228
228
  }
229
- return z.Children.map(B, (r) => z.cloneElement(r, { options: x }));
230
- }, Ne = (h, B) => {
231
- const { "data-app": u, "data-group": C } = B, o = h.getIn(["data", "measures", u, C]);
229
+ return Q.Children.map(x, (r) => Q.cloneElement(r, { options: L }));
230
+ }, We = (h, x) => {
231
+ const { "data-app": u, "data-group": C } = x, o = h.getIn(["data", "measures", u, C]);
232
232
  return o ? {
233
233
  injectedMeasures: o
234
234
  } : {};
235
- }, Ue = {}, _e = Re(Ne, Ue)(Se);
235
+ }, $e = {}, tt = He(We, $e)(Ne);
236
236
  export {
237
- _e as default
237
+ tt as default
238
238
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as h, Fragment as q } from "react/jsx-runtime";
2
- import A, { useState as x, useRef as D, useEffect as V, useImperativeHandle as j, useCallback as I } from "react";
2
+ import A, { useState as b, useRef as D, useEffect as V, useImperativeHandle as j, useCallback as I } from "react";
3
3
  import { Container as N, Grid as i, Form as P, TextArea as L, Button as k, Message as O, Input as M, Label as U, Icon as B } from "semantic-ui-react";
4
4
  import { COUNTRY_OPTIONS as $ } from "../../countries.js";
5
5
  import { reset as G, sendShowCaseForm as H } from "../reducers/embeddable.js";
@@ -13,14 +13,14 @@ const J = $.map((o) => ({
13
13
  }));
14
14
  A.createRef();
15
15
  function Q({ onSelectionChange: o, showValidation: f, inputRef: g, name: a }) {
16
- const [r, c] = x([]), [n, s] = x([]), l = I((m) => {
16
+ const [r, c] = b([]), [n, s] = b([]), l = I((m) => {
17
17
  c([...r, ...m]), s([]);
18
18
  }, [r]), u = I((m) => {
19
19
  s([...m]);
20
20
  }, [r]), {
21
21
  acceptedFiles: v,
22
22
  getRootProps: w,
23
- getInputProps: b,
23
+ getInputProps: x,
24
24
  open: E
25
25
  } = Y({ accept: "application/pdf,.pdf,.doc,.docx,.xls,.xlsx,.csv,.txt,.rtf,.html,.zip,.mp3,.wma,.mpg,.flv,.avi,.jpg,.jpeg,.png,.gif", maxFiles: 5, multiple: !0, onDrop: l, onDropRejected: u });
26
26
  j(g, () => ({
@@ -31,7 +31,7 @@ function Q({ onSelectionChange: o, showValidation: f, inputRef: g, name: a }) {
31
31
  hasErrors: () => r.length == 0,
32
32
  value: () => r
33
33
  }));
34
- const y = (m) => {
34
+ const S = (m) => {
35
35
  const d = [...r];
36
36
  d.splice(m, 1), c(d);
37
37
  }, z = r.length === 0;
@@ -39,7 +39,7 @@ function Q({ onSelectionChange: o, showValidation: f, inputRef: g, name: a }) {
39
39
  n && n[0] && n[0].errors && /* @__PURE__ */ e(N, { fluid: !0, className: `upload files ${z ? "error" : ""}`, children: /* @__PURE__ */ e("div", { className: "error-messages", children: /* @__PURE__ */ e("ul", { style: {}, children: n[0].errors.map((m, d) => /* @__PURE__ */ e("li", { children: "File type not allowed. File type must be - application/-pdf,.pdf,.doc,.docx,.xls,.xlsx,.csv,.txt,.rtf,.html,.zip,.mp3,.wma,.mpg,.flv,.avi,.jpg,.jpeg,.png,.gif " }, d)) }) }) }),
40
40
  /* @__PURE__ */ h(N, { fluid: !0, className: "upload files", children: [
41
41
  /* @__PURE__ */ h("div", { ...w({ className: "dropzone" }), children: [
42
- /* @__PURE__ */ e("input", { ...b() }),
42
+ /* @__PURE__ */ e("input", { ...x() }),
43
43
  /* @__PURE__ */ h("p", { children: [
44
44
  "Drag 'n' drop files here, or click select button to select files. The maximum file size allowed is ",
45
45
  _.maxUploadFileSize,
@@ -48,7 +48,7 @@ function Q({ onSelectionChange: o, showValidation: f, inputRef: g, name: a }) {
48
48
  r.length > 0 ? /* @__PURE__ */ e("ul", { children: r.map((m, d) => /* @__PURE__ */ h("li", { children: [
49
49
  /* @__PURE__ */ e(U, { color: "green", icon: "file", children: m.name }),
50
50
  /* @__PURE__ */ e(B, { color: "red", name: "remove", size: "large", onClick: (C) => {
51
- C.stopPropagation(), y(d);
51
+ C.stopPropagation(), S(d);
52
52
  } })
53
53
  ] }, d)) }) : null
54
54
  ] }),
@@ -57,7 +57,7 @@ function Q({ onSelectionChange: o, showValidation: f, inputRef: g, name: a }) {
57
57
  ] });
58
58
  }
59
59
  const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r, icon: c, inputRef: n }) => {
60
- const [s, l] = x(null), [u, v] = x(!0);
60
+ const [s, l] = b(null), [u, v] = b(!0);
61
61
  return V(() => {
62
62
  a && s == null ? v(!0) : v(!1);
63
63
  }, [s]), j(n, () => ({
@@ -73,8 +73,8 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
73
73
  value: s,
74
74
  error: u && r,
75
75
  name: g,
76
- onChange: (w, b) => {
77
- l(b.value);
76
+ onChange: (w, x) => {
77
+ l(x.value);
78
78
  },
79
79
  multiple: !1,
80
80
  search: !0,
@@ -83,8 +83,8 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
83
83
  placeholder: f
84
84
  }
85
85
  );
86
- }, S = ({ placeholder: o, name: f, icon: g, required: a, pattern: r, as: c, inputRef: n, showValidation: s }) => {
87
- const [l, u] = x(""), [v, w] = x(!0);
86
+ }, y = ({ placeholder: o, name: f, icon: g, required: a, pattern: r, as: c, inputRef: n, showValidation: s }) => {
87
+ const [l, u] = b(""), [v, w] = b(!0);
88
88
  return V(() => {
89
89
  a && l.trim() == "" || r && !r.test(l) ? w(!0) : w(!1);
90
90
  }, [l]), j(n, () => ({
@@ -107,7 +107,7 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
107
107
  }
108
108
  );
109
109
  }, X = (o) => {
110
- const [f, g] = x({});
110
+ const [f, g] = b({});
111
111
  D();
112
112
  const a = D({}), r = (t) => {
113
113
  const R = Object.keys(a.current).map((p) => a.current[p]), T = R.map((p) => p.hasErrors()).reduce((p, F) => p || F);
@@ -127,20 +127,20 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
127
127
  t && (a.current[t.name] = t);
128
128
  }, {
129
129
  status: s,
130
- organization: l = "Organization",
131
- name: u = "Name",
132
- email: v = "Email",
133
- country: w = "Country",
134
- message: b = "Message",
135
- resetlabel: E = "Reset",
136
- submitlabel: y = "Submit",
137
- successmessage: z = "Thanks for submitting your data",
138
- failuremessage: m = "Something didn't go well, please try again later",
130
+ "data-organization": l = "Organization",
131
+ "data-name": u = "Name",
132
+ "data-email": v = "Email",
133
+ "data-country": w = "Country",
134
+ "data-message": x = "Message",
135
+ "data-reset-label": E = "Reset",
136
+ "data-submit-label": S = "Submit",
137
+ "data-success-message": z = "Thanks for submitting your data",
138
+ "data-failure-message": m = "Something didn't go well, please try again later",
139
139
  editing: d
140
140
  } = o, { showValidation: C, token: te, reset: re } = f;
141
141
  return /* @__PURE__ */ e(N, { fluid: !0, className: "viz showcase", children: /* @__PURE__ */ h(i, { columns: 1, className: C ? "validated" : "", children: [
142
142
  /* @__PURE__ */ e(i.Column, { children: /* @__PURE__ */ e(
143
- S,
143
+ y,
144
144
  {
145
145
  inputRef: (t) => n(t),
146
146
  showValidation: C,
@@ -151,7 +151,7 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
151
151
  }
152
152
  ) }),
153
153
  /* @__PURE__ */ e(i.Column, { children: /* @__PURE__ */ e(
154
- S,
154
+ y,
155
155
  {
156
156
  inputRef: (t) => n(t),
157
157
  showValidation: C,
@@ -162,7 +162,7 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
162
162
  }
163
163
  ) }),
164
164
  /* @__PURE__ */ e(i.Column, { children: /* @__PURE__ */ e(
165
- S,
165
+ y,
166
166
  {
167
167
  inputRef: (t) => n(t),
168
168
  showValidation: C,
@@ -193,10 +193,10 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
193
193
  }
194
194
  ) }),
195
195
  /* @__PURE__ */ e(i.Column, { children: /* @__PURE__ */ e(
196
- S,
196
+ y,
197
197
  {
198
198
  inputRef: (t) => n(t),
199
- placeholder: b,
199
+ placeholder: x,
200
200
  name: "message",
201
201
  as: L
202
202
  }
@@ -216,7 +216,7 @@ const W = ({ options: o, placeholder: f, name: g, required: a, showValidation: r
216
216
  {
217
217
  secondary: !0,
218
218
  onClick: (t) => r(),
219
- children: y
219
+ children: S
220
220
  }
221
221
  )
222
222
  ] }),