@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.
- 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/download/dom-to-image.js +32 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/newsletter/index.js +1 -1
- package/dist/cjs/embeddable/pagemodules/FloatingNavigator.js +1 -1
- package/dist/cjs/embeddable/pagemodules/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/download/dom-to-image.js +32 -0
- package/dist/esm/embeddable/filter/index.js +113 -113
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
- package/dist/esm/embeddable/map/index.js +32 -32
- package/dist/esm/embeddable/newsletter/index.js +19 -19
- package/dist/esm/embeddable/pagemodules/FloatingNavigator.js +14 -15
- package/dist/esm/embeddable/pagemodules/index.js +44 -45
- 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,159 +1,159 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Container as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { PostContent as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { connect as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
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:
|
|
14
|
+
parent: x,
|
|
15
15
|
editing: u = !1,
|
|
16
16
|
unique: C,
|
|
17
17
|
childContent: o,
|
|
18
|
-
categories:
|
|
18
|
+
categories: L,
|
|
19
19
|
injectedMeasures: r,
|
|
20
20
|
"data-csv": i = "",
|
|
21
|
-
"data-no-data-message":
|
|
22
|
-
"data-view-mode":
|
|
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":
|
|
27
|
-
"data-dimension3":
|
|
28
|
-
"data-scheme":
|
|
26
|
+
"data-dimension2": d,
|
|
27
|
+
"data-dimension3": t,
|
|
28
|
+
"data-scheme": y = "nivo",
|
|
29
29
|
"data-margin-left": f,
|
|
30
|
-
"data-margin-top":
|
|
31
|
-
"data-margin-right":
|
|
32
|
-
"data-margin-bottom":
|
|
33
|
-
"data-show-legends":
|
|
34
|
-
"data-legend-position":
|
|
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":
|
|
37
|
-
"data-format":
|
|
38
|
-
"data-tooltip-html":
|
|
39
|
-
"data-layout":
|
|
40
|
-
"data-group":
|
|
41
|
-
"data-filters":
|
|
42
|
-
"data-no-data-message":
|
|
43
|
-
"data-legend-label":
|
|
44
|
-
"data-tooltip-enabled":
|
|
45
|
-
"data-use-label-background":
|
|
46
|
-
"data-use-check-box-background":
|
|
47
|
-
"data-legend-label-color":
|
|
48
|
-
"data-tooltip-enable-markdown":
|
|
49
|
-
"data-reverse-legend":
|
|
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":
|
|
52
|
-
"data-node-opacity":
|
|
53
|
-
"data-node-hover-opacity":
|
|
54
|
-
"data-node-inner-padding":
|
|
55
|
-
"data-node-spacing":
|
|
56
|
-
"data-node-hover-others-opacity":
|
|
57
|
-
"data-node-border-width":
|
|
58
|
-
"data-node-border-radius":
|
|
59
|
-
"data-link-opacity":
|
|
60
|
-
"data-link-hover-opacity":
|
|
61
|
-
"data-link-hover-others-opacity":
|
|
62
|
-
"data-link-contract":
|
|
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":
|
|
66
|
-
"data-label-padding":
|
|
65
|
+
"data-label-position": be,
|
|
66
|
+
"data-label-padding": ye,
|
|
67
67
|
"data-use-custom-label-color": q,
|
|
68
|
-
"data-label-text-color":
|
|
69
|
-
"data-label-orientation":
|
|
70
|
-
"data-manual-colors":
|
|
71
|
-
} = h, A = h.intl.locale,
|
|
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(
|
|
73
|
+
return JSON.parse(O(l));
|
|
74
74
|
} catch {
|
|
75
75
|
console.error("error parsing value:" + l);
|
|
76
76
|
}
|
|
77
77
|
return null;
|
|
78
|
-
},
|
|
79
|
-
style:
|
|
80
|
-
notation:
|
|
81
|
-
currency:
|
|
82
|
-
minimumFractionDigits: parseInt(
|
|
83
|
-
maximumFractionDigits: parseInt(
|
|
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
|
-
}, [
|
|
90
|
-
scheme:
|
|
91
|
-
}, M = u ? n - 80 : n - 40,
|
|
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:
|
|
95
|
-
legendLabel:
|
|
93
|
+
layout: te,
|
|
94
|
+
showLegends: H == !0 || H == "true",
|
|
95
|
+
legendLabel: oe,
|
|
96
96
|
marginLeft: parseInt(f),
|
|
97
|
-
marginTop: parseInt(
|
|
98
|
-
marginRight: parseInt(
|
|
99
|
-
marginBottom: parseInt(
|
|
97
|
+
marginTop: parseInt(v),
|
|
98
|
+
marginRight: parseInt(Y),
|
|
99
|
+
marginBottom: parseInt(Z),
|
|
100
100
|
height: `${M}px`,
|
|
101
|
-
legendPosition:
|
|
102
|
-
legends:
|
|
103
|
-
tooltip:
|
|
104
|
-
colors:
|
|
105
|
-
format:
|
|
106
|
-
categories:
|
|
107
|
-
legendLabelColor: decodeURIComponent(
|
|
108
|
-
tooltipEnabled:
|
|
109
|
-
tooltipEnableMarkdown:
|
|
110
|
-
reverseLegend:
|
|
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:
|
|
113
|
-
nodeOpacity:
|
|
114
|
-
nodeHoverOpacity:
|
|
115
|
-
nodeInnerPadding:
|
|
116
|
-
nodeSpacing:
|
|
117
|
-
nodeHoverOthersOpacity:
|
|
118
|
-
nodeBorderWidth:
|
|
119
|
-
nodeBorderRadius: parseInt(
|
|
120
|
-
linkOpacity:
|
|
121
|
-
linkHoverOpacity:
|
|
122
|
-
linkContract:
|
|
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:
|
|
124
|
+
linkHoverOthersOpacity: he,
|
|
125
125
|
enableLabels: V == !0 || V == "true",
|
|
126
|
-
labelPosition:
|
|
127
|
-
labelPadding:
|
|
126
|
+
labelPosition: be,
|
|
127
|
+
labelPadding: ye,
|
|
128
128
|
useCustomLabelColor: q == !0 || q == "true",
|
|
129
|
-
labelTextColor:
|
|
130
|
-
labelOrientation:
|
|
131
|
-
useLabelBackground:
|
|
132
|
-
useCheckBoxBackground:
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
l.value != null && l.value.filter((
|
|
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
|
|
137
|
+
let E = !1;
|
|
138
138
|
const g = [];
|
|
139
|
-
return e != "none" && g.push(e),
|
|
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
|
-
|
|
141
|
+
we,
|
|
142
142
|
{
|
|
143
143
|
style: { height: `${M}px` },
|
|
144
|
-
params:
|
|
144
|
+
params: K,
|
|
145
145
|
app: p,
|
|
146
|
-
group:
|
|
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__ */
|
|
152
|
-
|
|
153
|
-
!
|
|
154
|
-
/* @__PURE__ */ c(
|
|
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
|
-
|
|
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:
|
|
164
|
+
measure: P[0] || null,
|
|
165
165
|
children: /* @__PURE__ */ c(
|
|
166
|
-
|
|
166
|
+
je,
|
|
167
167
|
{
|
|
168
168
|
app: p,
|
|
169
169
|
locale: A,
|
|
170
|
-
manualColors:
|
|
170
|
+
manualColors: xe(),
|
|
171
171
|
colorBy: "id",
|
|
172
|
-
scheme:
|
|
172
|
+
scheme: y,
|
|
173
173
|
barColor: J.barColor,
|
|
174
|
-
children: /* @__PURE__ */ c(
|
|
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 &&
|
|
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
|
-
},
|
|
187
|
-
const { children:
|
|
188
|
-
let o = { nodes: [], links: [] },
|
|
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 = (
|
|
195
|
-
const { data:
|
|
196
|
-
return a
|
|
197
|
-
}, i = (
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
const f = n.find((
|
|
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 +
|
|
203
|
+
f.value = f.value + t[e];
|
|
204
204
|
else {
|
|
205
|
-
const
|
|
206
|
-
n.push({ source: m, target:
|
|
205
|
+
const v = { ...t, ...y, ...d };
|
|
206
|
+
n.push({ source: m, target: t.value, value: t[e], data: v });
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
|
|
209
|
+
t.children && t.children.length > 0 && i(t.children, a, n, t.value, e, y);
|
|
210
210
|
});
|
|
211
211
|
};
|
|
212
|
-
o = r(h),
|
|
212
|
+
o = r(h), L = {
|
|
213
213
|
indexBy: "",
|
|
214
|
-
keys: o.nodes.map((
|
|
214
|
+
keys: o.nodes.map((s) => s.id),
|
|
215
215
|
data: o
|
|
216
216
|
};
|
|
217
217
|
} else {
|
|
218
|
-
const r =
|
|
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((
|
|
221
|
-
m.push({ source:
|
|
220
|
+
i.forEach((d) => {
|
|
221
|
+
m.push({ source: d, target: e[s], value: e[d] });
|
|
222
222
|
});
|
|
223
|
-
}),
|
|
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
|
|
230
|
-
},
|
|
231
|
-
const { "data-app": u, "data-group": 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
|
-
},
|
|
235
|
+
}, $e = {}, tt = He(We, $e)(Ne);
|
|
236
236
|
export {
|
|
237
|
-
|
|
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
|
|
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] =
|
|
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:
|
|
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
|
|
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", { ...
|
|
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(),
|
|
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] =
|
|
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,
|
|
77
|
-
l(
|
|
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
|
-
},
|
|
87
|
-
const [l, u] =
|
|
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] =
|
|
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:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
196
|
+
y,
|
|
197
197
|
{
|
|
198
198
|
inputRef: (t) => n(t),
|
|
199
|
-
placeholder:
|
|
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:
|
|
219
|
+
children: S
|
|
220
220
|
}
|
|
221
221
|
)
|
|
222
222
|
] }),
|