@devgateway/dvz-ui-react 1.8.8 → 1.9.1
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/common.css +1 -1
- package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/useBigNumberTrendData.js +1 -0
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Messages.js +2 -2
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/chart/index.js +1 -1
- package/dist/cjs/embeddable/d3Map/index.js +1 -1
- package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
- package/dist/cjs/embeddable/data/DataConsumer.js +1 -1
- package/dist/cjs/embeddable/data/DataProvider.js +1 -1
- package/dist/cjs/embeddable/download/dom-to-image.js +32 -1
- package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/pagemodules/FloatingNavigator.js +1 -1
- package/dist/cjs/embeddable/pagemodules/index.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/FlexWrapDetector.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/common.css +1 -1
- package/dist/esm/embeddable/big-number-trend/Alternative.js +62 -211
- package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +125 -0
- package/dist/esm/embeddable/big-number-trend/Classic.js +51 -181
- package/dist/esm/embeddable/big-number-trend/index.js +8 -8
- package/dist/esm/embeddable/big-number-trend/useBigNumberTrendData.js +49 -0
- package/dist/esm/embeddable/chart/Bar.js +464 -471
- package/dist/esm/embeddable/chart/Messages.js +18 -15
- package/dist/esm/embeddable/chart/data/Line.js +1 -4
- package/dist/esm/embeddable/chart/data/Utils.js +0 -1
- package/dist/esm/embeddable/chart/index.js +363 -359
- package/dist/esm/embeddable/d3Map/index.js +129 -125
- package/dist/esm/embeddable/data/CategoriesProvider.js +31 -38
- package/dist/esm/embeddable/data/DataConsumer.js +12 -8
- package/dist/esm/embeddable/data/DataProvider.js +62 -124
- package/dist/esm/embeddable/download/dom-to-image.js +32 -0
- package/dist/esm/embeddable/featuredtabs/index.js +64 -61
- package/dist/esm/embeddable/map/index.js +47 -47
- package/dist/esm/embeddable/pagemodules/FloatingNavigator.js +14 -15
- package/dist/esm/embeddable/pagemodules/index.js +44 -45
- package/dist/esm/embeddable/reducers/data.js +46 -44
- package/dist/esm/index.js +74 -73
- package/dist/esm/layout/FlexWrapDetector.js +10 -10
- package/dist/esm/styles.css +1 -1
- package/dist/types/embeddable/big-number-trend/Alternative.d.ts +2 -4
- package/dist/types/embeddable/big-number-trend/BigNumberTrendContainer.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Classic.d.ts +2 -4
- package/dist/types/embeddable/big-number-trend/useBigNumberTrendData.d.ts +21 -0
- package/dist/types/embeddable/chart/Bar.d.ts +1 -2
- package/dist/types/embeddable/data/DataConsumer.d.ts +5 -2
- package/dist/types/embeddable/data/DataProvider.d.ts +18 -3
- package/dist/types/layout/FlexWrapDetector.d.ts +2 -1
- package/package.json +2 -2
|
@@ -17,37 +17,37 @@ const Ja = [
|
|
|
17
17
|
{ label: "Democratic Republic of the Congo", value: "DRC", center: [23.174338, -5.837475], scale: 1250 },
|
|
18
18
|
{ label: "World", value: "World", center: [0, 20.050043], scale: 150 }
|
|
19
19
|
], Ka = (n) => /* @__PURE__ */ r(qa, { ...n }), qa = (n) => {
|
|
20
|
-
var
|
|
20
|
+
var B;
|
|
21
21
|
const {
|
|
22
22
|
unique: c,
|
|
23
23
|
editing: s,
|
|
24
|
-
"data-filters":
|
|
24
|
+
"data-filters": E = "{}",
|
|
25
25
|
"data-app": i = "csv",
|
|
26
26
|
"data-csv": k = "",
|
|
27
|
-
"data-dimension1":
|
|
28
|
-
"data-dimension2":
|
|
29
|
-
"data-measures": u =
|
|
27
|
+
"data-dimension1": M = "",
|
|
28
|
+
"data-dimension2": P = "",
|
|
29
|
+
"data-measures": u = "[]",
|
|
30
30
|
"data-height": O = 600,
|
|
31
31
|
width: V = 960,
|
|
32
|
-
"data-data-source-text": W = "
|
|
32
|
+
"data-data-source-text": W = "",
|
|
33
33
|
"data-data-source-label": G = "Source",
|
|
34
|
-
"data-national-average-label": j = "National
|
|
35
|
-
"data-legend-title": Z = "
|
|
34
|
+
"data-national-average-label": j = "National Average",
|
|
35
|
+
"data-legend-title": Z = "Legend Title",
|
|
36
36
|
"data-legend-breaks": H = "[]",
|
|
37
|
-
"data-zoom-enabled":
|
|
37
|
+
"data-zoom-enabled": b = !1,
|
|
38
38
|
"data-show-legend-labels": h = !1,
|
|
39
39
|
"data-map-file": J,
|
|
40
40
|
"data-mapping-field": K = "zone",
|
|
41
41
|
"data-map-label-field": q = "admin",
|
|
42
|
-
"data-has-multiple-measures":
|
|
42
|
+
"data-has-multiple-measures": C = "false",
|
|
43
43
|
topoJSONField: Y = "collection",
|
|
44
44
|
"data-map-center": $ = "NGA",
|
|
45
45
|
//country
|
|
46
46
|
"data-map-label-show-value": y = "false",
|
|
47
|
-
"data-show-tooltip":
|
|
47
|
+
"data-show-tooltip": F = "true",
|
|
48
48
|
"data-measure-selector-label": Q = "",
|
|
49
49
|
"data-value-format": X = "",
|
|
50
|
-
"data-show-overall-value":
|
|
50
|
+
"data-show-overall-value": v = "false",
|
|
51
51
|
"data-auto-generate-breaks": L = "false",
|
|
52
52
|
"data-number-of-breaks": _ = 5,
|
|
53
53
|
"data-scheme": aa = "reds",
|
|
@@ -69,15 +69,15 @@ const Ja = [
|
|
|
69
69
|
"data-map-no-data-color": ua = "#f8f8f8",
|
|
70
70
|
"data-map-boundary-color": pa = "#000",
|
|
71
71
|
"data-map-focus-boundary-color": fa = "#000",
|
|
72
|
-
"data-highlighted-location":
|
|
73
|
-
"data-tooltip-format":
|
|
72
|
+
"data-highlighted-location": ga = "",
|
|
73
|
+
"data-tooltip-format": ba = `{locationName} %({value},2)
|
|
74
74
|
{label}: %({value},2)`,
|
|
75
75
|
"data-show-no-data-tooltip": I = "false",
|
|
76
76
|
"data-map-container-bg-color": ha = "#fff",
|
|
77
|
-
"data-map-position":
|
|
77
|
+
"data-map-position": Ca = "{}",
|
|
78
78
|
"data-main-layer-id": ya = "",
|
|
79
|
-
"data-enabled-layers":
|
|
80
|
-
"data-point-label-color":
|
|
79
|
+
"data-enabled-layers": Fa,
|
|
80
|
+
"data-point-label-color": va = "#fff",
|
|
81
81
|
"data-point-label-format": La = "{locationName} %({value},2)",
|
|
82
82
|
"data-show-no-data-legend-item": N = !1,
|
|
83
83
|
"data-highlighted-loc-label-format": wa = "{locationName} - Score: #({value},2)",
|
|
@@ -91,27 +91,27 @@ const Ja = [
|
|
|
91
91
|
"data-no-data-text": za = "No Data",
|
|
92
92
|
"data-labels-exclusion-list": Ta = "",
|
|
93
93
|
"data-custom-measure-labels": xa = "{}",
|
|
94
|
-
"data-show-shading-layer-labels":
|
|
94
|
+
"data-show-shading-layer-labels": Ua = "ifUnitHasData",
|
|
95
95
|
"data-dvz-proxy-dataset-id": f,
|
|
96
|
-
"data-recently-toggled-layer-id":
|
|
96
|
+
"data-recently-toggled-layer-id": Aa = null,
|
|
97
97
|
intl: Xa,
|
|
98
98
|
settings: _a
|
|
99
|
-
} = n,
|
|
99
|
+
} = n, Ba = (a) => s ? a : decodeURIComponent(a), o = (a) => {
|
|
100
100
|
try {
|
|
101
101
|
if (a)
|
|
102
|
-
return JSON.parse(
|
|
102
|
+
return JSON.parse(Ba(a));
|
|
103
103
|
} catch {
|
|
104
104
|
console.error("error parsing value:" + a);
|
|
105
105
|
}
|
|
106
106
|
return null;
|
|
107
|
-
},
|
|
107
|
+
}, Ra = (a) => {
|
|
108
108
|
let t = o(a) || [];
|
|
109
109
|
return t = t.map((e) => (e.min && (e.min = parseFloat(e.min)), e.max && (e.max = parseFloat(e.max)), e.color = decodeURIComponent(e.color), e)), t;
|
|
110
|
-
},
|
|
110
|
+
}, Ea = (a) => {
|
|
111
111
|
const t = o(a) || [];
|
|
112
112
|
let e = {};
|
|
113
113
|
return t && t.forEach ? t.forEach((m) => {
|
|
114
|
-
m.value != null && m.value.filter((
|
|
114
|
+
m.value != null && m.value.filter((R) => R != null && R.toString().trim() != "").length > 0 && (e[m.param] = m.value);
|
|
115
115
|
}) : e = t, e;
|
|
116
116
|
}, ka = {
|
|
117
117
|
style: p === "compacted" ? "decimal" : p,
|
|
@@ -120,10 +120,10 @@ const Ja = [
|
|
|
120
120
|
minimumFractionDigits: parseInt(D),
|
|
121
121
|
maximumFractionDigits: parseInt(D)
|
|
122
122
|
};
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
const x = Ja.find((a) => a.value === $),
|
|
126
|
-
let l = [
|
|
123
|
+
let g = o(Fa) || [];
|
|
124
|
+
g = g.map((a) => (a.bgColor = decodeURIComponent(a.bgColor), a.fontColor = decodeURIComponent(a.fontColor), a));
|
|
125
|
+
const x = Ja.find((a) => a.value === $), U = C == !0 || C == "true";
|
|
126
|
+
let l = [M, P].filter((a) => a != "none" && a != null).join("/");
|
|
127
127
|
const d = {
|
|
128
128
|
unique: c,
|
|
129
129
|
editing: s,
|
|
@@ -139,15 +139,15 @@ const Ja = [
|
|
|
139
139
|
dataSourceText: W,
|
|
140
140
|
dataSourceLabel: G,
|
|
141
141
|
nationalAverageLabel: j,
|
|
142
|
-
legendBreaks:
|
|
142
|
+
legendBreaks: Ra(H),
|
|
143
143
|
mapLabelField: q,
|
|
144
|
-
zoomEnabled:
|
|
144
|
+
zoomEnabled: b == !0 || b == "true",
|
|
145
145
|
showLegendLabels: h == !0 || h == "true",
|
|
146
|
-
multipleMeasures:
|
|
146
|
+
multipleMeasures: U,
|
|
147
147
|
app: i,
|
|
148
148
|
mapLabelShowValue: y == !0 || y == "true",
|
|
149
|
-
showTooltip:
|
|
150
|
-
showOverallValue:
|
|
149
|
+
showTooltip: F == !0 || F == "true",
|
|
150
|
+
showOverallValue: v == !0 || v == "true",
|
|
151
151
|
measureSelectorLabel: Q,
|
|
152
152
|
valueFormat: X,
|
|
153
153
|
autoGenerateBreaks: L == !0 || L == "true",
|
|
@@ -169,15 +169,15 @@ const Ja = [
|
|
|
169
169
|
mapNoDataColor: decodeURIComponent(ua),
|
|
170
170
|
mapBoundaryColor: decodeURIComponent(pa),
|
|
171
171
|
mapFocusBoundaryColor: decodeURIComponent(fa),
|
|
172
|
-
highlightedLocation:
|
|
173
|
-
tooltipFormat:
|
|
172
|
+
highlightedLocation: ga,
|
|
173
|
+
tooltipFormat: ba,
|
|
174
174
|
showNoDataTooltip: I == !0 || I == "true",
|
|
175
175
|
fields: l.split("/"),
|
|
176
176
|
mapContainerBgColor: decodeURIComponent(ha),
|
|
177
|
-
mapPosition: o(
|
|
177
|
+
mapPosition: o(Ca),
|
|
178
178
|
mainLayerId: ya,
|
|
179
|
-
enabledLayers:
|
|
180
|
-
pointLabelColor: decodeURIComponent(
|
|
179
|
+
enabledLayers: g,
|
|
180
|
+
pointLabelColor: decodeURIComponent(va),
|
|
181
181
|
pointLabelFormat: La,
|
|
182
182
|
showNoDataLegendItem: N == !0 || N == "true",
|
|
183
183
|
highlightedLocLabelFormat: wa,
|
|
@@ -188,19 +188,19 @@ const Ja = [
|
|
|
188
188
|
zoomOnFilterField: Na,
|
|
189
189
|
noDataText: za,
|
|
190
190
|
labelsExclusionList: Ta.split(",").map((a) => a.trim()),
|
|
191
|
-
showShadingLayerLabels:
|
|
191
|
+
showShadingLayerLabels: Ua,
|
|
192
192
|
dvzProxyDatasetId: f,
|
|
193
|
-
recentlyToggledLayerId:
|
|
193
|
+
recentlyToggledLayerId: Aa
|
|
194
194
|
};
|
|
195
195
|
if (d.recentlyToggledLayerId) {
|
|
196
196
|
const a = d.enabledLayers.find((t) => String(t.id) === String(d.recentlyToggledLayerId));
|
|
197
|
-
a && (a != null && a.apiField) && (l = (
|
|
197
|
+
a && (a != null && a.apiField) && (l = (B = a.apiField) == null ? void 0 : B.toLowerCase());
|
|
198
198
|
}
|
|
199
|
-
const
|
|
200
|
-
return f && (
|
|
199
|
+
const Ma = o(xa) || {}, Pa = i === "csv" ? Ha : Za, Oa = s ? (o(u) || []).join(",") : u, A = Ea(E);
|
|
200
|
+
return f && (A.dvzProxyDatasetId = f), /* @__PURE__ */ r(
|
|
201
201
|
Wa,
|
|
202
202
|
{
|
|
203
|
-
params:
|
|
203
|
+
params: A,
|
|
204
204
|
app: i,
|
|
205
205
|
csv: decodeURIComponent(k),
|
|
206
206
|
group: S,
|
|
@@ -208,13 +208,13 @@ const Ja = [
|
|
|
208
208
|
store: [i, c, ...l.split("/")],
|
|
209
209
|
source: l,
|
|
210
210
|
children: /* @__PURE__ */ r(Ga, { children: /* @__PURE__ */ r(
|
|
211
|
-
|
|
211
|
+
Pa,
|
|
212
212
|
{
|
|
213
213
|
measures: Oa,
|
|
214
|
-
multipleMeasures:
|
|
214
|
+
multipleMeasures: U,
|
|
215
215
|
mapType: z,
|
|
216
216
|
aggregationFormula: Da,
|
|
217
|
-
customMeasureLabels:
|
|
217
|
+
customMeasureLabels: Ma,
|
|
218
218
|
source: l,
|
|
219
219
|
children: /* @__PURE__ */ r(ja, { ...d })
|
|
220
220
|
}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Menu as
|
|
4
|
-
|
|
3
|
+
import { Menu as c, Image as a, Label as m } from "semantic-ui-react";
|
|
4
|
+
import { decode as d } from "html-entities";
|
|
5
|
+
function f(t) {
|
|
5
6
|
const r = () => 10, o = t ? document.getElementById(t) : null;
|
|
6
7
|
if (o) {
|
|
7
|
-
const
|
|
8
|
+
const i = o.getBoundingClientRect().top + window.pageYOffset;
|
|
8
9
|
window.scroll({
|
|
9
|
-
top:
|
|
10
|
+
top: i - r(),
|
|
10
11
|
behavior: "smooth"
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
const
|
|
15
|
-
return t ? t.toString()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ n(i.Item, { header: !0, children: c }),
|
|
22
|
-
o.map((e) => /* @__PURE__ */ l(i.Item, { active: e.active, onClick: () => d(e.id), children: [
|
|
15
|
+
const s = function(t) {
|
|
16
|
+
return t ? d(t.toString()) : "";
|
|
17
|
+
}, b = (t) => {
|
|
18
|
+
const { contextRef: r, sections: o = [], navTitle: i, toTopLabel: p } = t;
|
|
19
|
+
return /* @__PURE__ */ n("div", { className: "left navigator", children: /* @__PURE__ */ l(c, { vertical: !0, children: [
|
|
20
|
+
/* @__PURE__ */ n(c.Item, { header: !0, children: i }),
|
|
21
|
+
o.map((e) => /* @__PURE__ */ l(c.Item, { active: e.active, onClick: () => f(e.id), children: [
|
|
23
22
|
e.iconComponent ? e.iconComponent : /* @__PURE__ */ n(a, { src: e.icon }),
|
|
24
|
-
/* @__PURE__ */ n(m, { basic: !0, children:
|
|
23
|
+
/* @__PURE__ */ n(m, { basic: !0, children: s(e.label) })
|
|
25
24
|
] }, e.label))
|
|
26
25
|
] }) });
|
|
27
26
|
};
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
b as default
|
|
30
29
|
};
|
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { Menu as g, Image as x, Container as b } from "semantic-ui-react";
|
|
3
3
|
import { InView as M } from "react-intersection-observer";
|
|
4
|
-
import T, { useEffect as N, useState as
|
|
4
|
+
import T, { useEffect as N, useState as I, useCallback as S } from "react";
|
|
5
5
|
import { PageProvider as w, PageConsumer as k, MediaProvider as _, MediaConsumer as p, PostContent as y } from "@devgateway/wp-react-lib";
|
|
6
6
|
import { injectIntl as H } from "react-intl";
|
|
7
7
|
import { connect as L } from "react-redux";
|
|
8
8
|
import { setPageModuleProps as $ } from "../reducers/data.js";
|
|
9
9
|
import j from "./FloatingNavigator.js";
|
|
10
|
+
import { decode as E } from "html-entities";
|
|
10
11
|
const P = function(e) {
|
|
11
|
-
return e ? e.toString()
|
|
12
|
-
|
|
13
|
-
}) : "";
|
|
14
|
-
}, E = ({ title: e, subtitle: n, icon: r, media: o }) => /* @__PURE__ */ f(g, { className: "header title", text: !0, children: [
|
|
12
|
+
return e ? E(e.toString()) : "";
|
|
13
|
+
}, O = ({ title: e, subtitle: o, icon: r, media: n }) => /* @__PURE__ */ f(g, { className: "header title", text: !0, children: [
|
|
15
14
|
/* @__PURE__ */ t(g.Item, { children: /* @__PURE__ */ t(
|
|
16
15
|
x,
|
|
17
16
|
{
|
|
18
|
-
src:
|
|
19
|
-
alt:
|
|
17
|
+
src: n && n.guid ? n.guid.rendered : r,
|
|
18
|
+
alt: n && n.alt_text ? n.alt_text : ""
|
|
20
19
|
}
|
|
21
20
|
) }),
|
|
22
21
|
/* @__PURE__ */ t(g.Header, { children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ f("h2", { className: "page-module-title", children: [
|
|
23
22
|
e,
|
|
24
|
-
/* @__PURE__ */ t("span", { style: { display: "block" }, className: "page-module-subtitle", children:
|
|
23
|
+
/* @__PURE__ */ t("span", { style: { display: "block" }, className: "page-module-subtitle", children: o })
|
|
25
24
|
] }) }) })
|
|
26
|
-
] }),
|
|
27
|
-
var
|
|
28
|
-
return /* @__PURE__ */ t("img", { src: (
|
|
29
|
-
},
|
|
25
|
+
] }), R = (e) => {
|
|
26
|
+
var o;
|
|
27
|
+
return /* @__PURE__ */ t("img", { src: (o = e.media) != null && o.guid ? e.media.guid.rendered : null, alt: "" });
|
|
28
|
+
}, q = ({ page: e, locale: o }) => {
|
|
30
29
|
var r;
|
|
31
30
|
return /* @__PURE__ */ f(b, { fluid: !0, className: `section ${e.slug}`, id: e.id, children: [
|
|
32
31
|
/* @__PURE__ */ t("div", { id: `${e.slug}` }),
|
|
33
|
-
/* @__PURE__ */ t(_, { id: (r = e.meta_fields) != null && r.icon ? e.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(
|
|
32
|
+
/* @__PURE__ */ t(_, { id: (r = e.meta_fields) != null && r.icon ? e.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(O, { title: P(e.title.rendered), subtitle: P(e.meta_fields.subtitle) }) }) }),
|
|
34
33
|
e && /* @__PURE__ */ t(y, { as: b, fluid: !0, post: e })
|
|
35
34
|
] });
|
|
36
|
-
},
|
|
37
|
-
const [
|
|
35
|
+
}, D = ({ pages: e, locale: o, editing: r, navTitle: n, toTopLabel: l }) => {
|
|
36
|
+
const [c, d] = I([]), s = S((i, {
|
|
38
37
|
direction: a = "down",
|
|
39
38
|
onScreen: h
|
|
40
39
|
}) => {
|
|
@@ -42,87 +41,87 @@ const P = function(e) {
|
|
|
42
41
|
}, []), m = e ? e.sort((i, a) => i.menu_order - a.menu_order) : [], v = m.map((i) => {
|
|
43
42
|
var a;
|
|
44
43
|
return {
|
|
45
|
-
active:
|
|
44
|
+
active: c.includes(i.id),
|
|
46
45
|
id: i.id,
|
|
47
|
-
label: i.meta_fields.label ? i.meta_fields.label : i.title.rendered,
|
|
48
|
-
iconComponent: /* @__PURE__ */ t(_, { id: (a = i.meta_fields) != null && a.icon ? i.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(
|
|
46
|
+
label: P(i.meta_fields.label ? i.meta_fields.label : i.title.rendered),
|
|
47
|
+
iconComponent: /* @__PURE__ */ t(_, { id: (a = i.meta_fields) != null && a.icon ? i.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(R, {}) }) })
|
|
49
48
|
};
|
|
50
49
|
});
|
|
51
50
|
return /* @__PURE__ */ f(T.Fragment, { children: [
|
|
52
|
-
!r && /* @__PURE__ */ t(j, { navTitle:
|
|
51
|
+
!r && /* @__PURE__ */ t(j, { navTitle: n, toTopLabel: l, sections: v }),
|
|
53
52
|
/* @__PURE__ */ t("div", { className: "pages", children: m.map((i) => /* @__PURE__ */ t(
|
|
54
53
|
M,
|
|
55
54
|
{
|
|
56
55
|
as: "div",
|
|
57
|
-
onChange: (a, h) =>
|
|
56
|
+
onChange: (a, h) => s(i.id, {
|
|
58
57
|
onScreen: a,
|
|
59
58
|
direction: h.boundingClientRect.top < 0 ? "up" : "down"
|
|
60
59
|
}),
|
|
61
60
|
children: /* @__PURE__ */ t(
|
|
62
|
-
|
|
61
|
+
q,
|
|
63
62
|
{
|
|
64
|
-
locale:
|
|
63
|
+
locale: o,
|
|
65
64
|
page: i,
|
|
66
|
-
onVisibilityUpdate:
|
|
65
|
+
onVisibilityUpdate: s
|
|
67
66
|
}
|
|
68
67
|
)
|
|
69
68
|
},
|
|
70
69
|
i.id
|
|
71
70
|
)) })
|
|
72
71
|
] });
|
|
73
|
-
},
|
|
72
|
+
}, V = (e) => {
|
|
74
73
|
const {
|
|
75
|
-
navTitle:
|
|
74
|
+
navTitle: o,
|
|
76
75
|
toTopLabel: r,
|
|
77
|
-
editing:
|
|
76
|
+
editing: n,
|
|
78
77
|
parent: l,
|
|
79
|
-
unique:
|
|
78
|
+
unique: c,
|
|
80
79
|
locale: d,
|
|
81
|
-
onLoadPageModule:
|
|
80
|
+
onLoadPageModule: s
|
|
82
81
|
} = e;
|
|
83
82
|
return N(() => {
|
|
84
|
-
|
|
83
|
+
s({ data: e });
|
|
85
84
|
}, [e]), /* @__PURE__ */ t(b, { className: "viz dashboard green", fluid: !0, children: e.parent && /* @__PURE__ */ t(
|
|
86
85
|
w,
|
|
87
86
|
{
|
|
88
87
|
locale: d,
|
|
89
88
|
parent: e.parent,
|
|
90
|
-
store: `modules_${l}_${
|
|
89
|
+
store: `modules_${l}_${c}`,
|
|
91
90
|
perPage: 100,
|
|
92
91
|
children: /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
|
|
93
|
-
|
|
92
|
+
D,
|
|
94
93
|
{
|
|
95
94
|
toTopLabel: r,
|
|
96
|
-
navTitle:
|
|
97
|
-
editing:
|
|
95
|
+
navTitle: o,
|
|
96
|
+
editing: n === "true",
|
|
98
97
|
locale: d
|
|
99
98
|
}
|
|
100
99
|
) })
|
|
101
100
|
}
|
|
102
101
|
) });
|
|
103
|
-
},
|
|
102
|
+
}, z = (e, o) => {
|
|
104
103
|
let {
|
|
105
104
|
"data-nav-label": r = "Sections",
|
|
106
|
-
"data-to-top-label":
|
|
105
|
+
"data-to-top-label": n = "TO THE TOP",
|
|
107
106
|
"data-preview-mode": l = "Desktop",
|
|
108
|
-
editing:
|
|
107
|
+
editing: c,
|
|
109
108
|
parent: d,
|
|
110
|
-
unique:
|
|
109
|
+
unique: s,
|
|
111
110
|
intl: { locale: m }
|
|
112
|
-
} =
|
|
111
|
+
} = o;
|
|
113
112
|
return l === "undefined" && (l = "Desktop"), {
|
|
114
113
|
navTitle: r,
|
|
115
|
-
toTopLabel:
|
|
114
|
+
toTopLabel: n,
|
|
116
115
|
previewMode: l,
|
|
117
|
-
editing:
|
|
116
|
+
editing: c,
|
|
118
117
|
parent: d,
|
|
119
|
-
unique:
|
|
118
|
+
unique: s,
|
|
120
119
|
locale: m
|
|
121
120
|
};
|
|
122
|
-
},
|
|
121
|
+
}, A = {
|
|
123
122
|
onLoadPageModule: $
|
|
124
|
-
},
|
|
123
|
+
}, Z = L(z, A)(H(V));
|
|
125
124
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
O as SectionHeader,
|
|
126
|
+
Z as default
|
|
128
127
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { getData as
|
|
1
|
+
import { getData as V, getCategory as j, getCategories as J } from "./data-api.js";
|
|
2
2
|
import * as A from "immutable";
|
|
3
3
|
import H from "papaparse";
|
|
4
|
-
const y = "LOAD_DATA", d = "LOAD_DATA_DONE",
|
|
4
|
+
const y = "LOAD_DATA", d = "LOAD_DATA_DONE", R = "LOAD_DATA_ERROR", O = "LOAD_CATEGORIES", D = "LOAD_CATEGORIES_DONE", F = "LOAD_CATEGORIES_ERROR", L = "SET_PAGE_MODULE_PROPS", h = "RELOAD_CHILD_FILTER_ITEMS", N = "SET_FILTER", Y = "SET_FILTERS", P = "SET_INITIAL_FILTER", C = "SET_APPLY", w = "CLEAN_FILTER", M = "UNSET_FILTER", $ = A.Map({ mode: "info" }), v = "SET_MEASURES", U = "CLEAN_MEASURES", B = "SET_POSTS_PAGINATION", K = "SET_POSTS_FILTER", G = "SET_INITIAL_POSTS_FILTER", X = ({ app: r, group: a }) => (s, e) => {
|
|
5
5
|
s({ type: U, app: r, group: a });
|
|
6
6
|
}, Z = ({ app: r, group: a, mGroup: s }) => (e, t) => {
|
|
7
7
|
const o = Object.keys(s.measures).filter((l) => s.measures[l].selected), n = { ...s };
|
|
8
8
|
n[r] = { measures: {} }, o.forEach((l) => {
|
|
9
9
|
n[r].measures[l] = { ...s.measures[l] };
|
|
10
10
|
}), n[r].format = s.format, e({ type: v, app: r, group: a, measure: n });
|
|
11
|
-
}, k = ({ app: r, type: a, group: s, param: e, autoApply: t, params: o, parentParam: n, parentType: l, parentSelectedItems: i, uniqueStorage:
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
}, k = ({ app: r, type: a, group: s, param: e, autoApply: t, params: o, parentParam: n, parentType: l, parentSelectedItems: i, uniqueStorage: E, dvzProxyDatasetId: u }) => (I, p) => {
|
|
12
|
+
const g = { ...o };
|
|
13
|
+
g[n] = i, j({ app: r, params: g, type: a }).then(
|
|
14
14
|
(f) => {
|
|
15
|
-
|
|
15
|
+
I({
|
|
16
16
|
type: h,
|
|
17
17
|
filterType: a,
|
|
18
18
|
parentType: l,
|
|
@@ -20,8 +20,8 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
20
20
|
app: r,
|
|
21
21
|
group: s,
|
|
22
22
|
data: f,
|
|
23
|
-
uniqueStorage:
|
|
24
|
-
dvzProxyDatasetId:
|
|
23
|
+
uniqueStorage: E,
|
|
24
|
+
dvzProxyDatasetId: u,
|
|
25
25
|
autoApply: t
|
|
26
26
|
});
|
|
27
27
|
}
|
|
@@ -39,14 +39,14 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
39
39
|
t({ type: P, app: r, group: a, param: s, value: e });
|
|
40
40
|
}, ae = (r) => (a, s) => {
|
|
41
41
|
const { app: e, params: t, dvzProxyDatasetId: o, uniqueStorage: n } = r;
|
|
42
|
-
a({ type:
|
|
43
|
-
type:
|
|
42
|
+
a({ type: O, params: t, app: e, uniqueStorage: n, dvzProxyDatasetId: o }), J({ app: e, params: t }).then((l) => (l.appliedFilters = t, a({
|
|
43
|
+
type: D,
|
|
44
44
|
app: e,
|
|
45
45
|
data: l,
|
|
46
46
|
uniqueStorage: n,
|
|
47
47
|
dvzProxyDatasetId: o
|
|
48
48
|
}))).catch((l) => a({
|
|
49
|
-
type:
|
|
49
|
+
type: F,
|
|
50
50
|
app: e,
|
|
51
51
|
uniqueStorage: n,
|
|
52
52
|
error: l,
|
|
@@ -55,37 +55,39 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
55
55
|
}, oe = ({ app: r, group: a, csv: s, store: e, params: t }) => (o, n) => {
|
|
56
56
|
const l = n().get("data").getIn(["filters", r, a]);
|
|
57
57
|
l ? t = { ...t, ...l.toJS() } : t = t || {};
|
|
58
|
-
const i = H.parse(s, { header: !0, dynamicTyping: !0 }),
|
|
59
|
-
let
|
|
60
|
-
return Object.keys(t).forEach((
|
|
61
|
-
const f = t[
|
|
62
|
-
if (g
|
|
63
|
-
const
|
|
64
|
-
|
|
58
|
+
const i = H.parse(s, { header: !0, dynamicTyping: !0 }), E = i.data.filter((I) => {
|
|
59
|
+
let p = !1;
|
|
60
|
+
return Object.keys(t).forEach((g) => {
|
|
61
|
+
const f = t[g];
|
|
62
|
+
if (I[g]) {
|
|
63
|
+
const _ = I[g].toString().trim().toLowerCase();
|
|
64
|
+
p = f.filter((S) => S && S.toString().trim().toLowerCase() == _).length == 0;
|
|
65
65
|
}
|
|
66
|
-
}), !
|
|
67
|
-
}),
|
|
68
|
-
o({ type: d, app: r, group: a, store: e, data: { count:
|
|
66
|
+
}), !p;
|
|
67
|
+
}), u = { ...i, data: E, appliedFilters: t };
|
|
68
|
+
o({ type: d, app: r, group: a, store: e, data: { count: u.data.length, itemsSize: u.data.length, ...u } });
|
|
69
69
|
}, le = (r) => (a, s) => {
|
|
70
70
|
const { app: e, group: t, source: o, store: n, params: l, parent: i } = r;
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
let E = s().get("data").getIn(["filters", e, t]), u = { ...l };
|
|
72
|
+
if (E) {
|
|
73
|
+
const I = E.toJS();
|
|
74
|
+
u = { ...I, ...l }, l && Object.keys(l).forEach((p) => {
|
|
75
|
+
if (I[p] !== void 0) {
|
|
76
|
+
const g = Array.isArray(l[p]) ? l[p] : [l[p]], f = Array.isArray(I[p]) ? I[p] : [I[p]];
|
|
77
|
+
g.some((S) => f.includes(S)) || (u[p] = [Number.MIN_SAFE_INTEGER]);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
a({ type: y, app: e, group: t, params: u, store: n }), V({ app: e, source: o, params: u }).then((I) => (I.appliedFilters = u, a({ type: d, app: e, group: t, store: n, data: I, params: u }))).catch((I) => a({ type: R, app: e, group: t, store: n, error: I }));
|
|
80
82
|
}, ie = ({ data: r }) => (a, s) => {
|
|
81
|
-
a({ type:
|
|
83
|
+
a({ type: L, data: r });
|
|
82
84
|
}, pe = (r = $, a) => {
|
|
83
85
|
switch (a.type) {
|
|
84
86
|
case y: {
|
|
85
87
|
const { store: s, app: e, group: t, params: o } = a, n = Date.now();
|
|
86
88
|
return r.deleteIn([...s, "error"]).setIn([...s, "loading"], !0).setIn([...s, "time"], n).setIn([...s, "presetFilter"], o);
|
|
87
89
|
}
|
|
88
|
-
case
|
|
90
|
+
case R: {
|
|
89
91
|
const { error: s, store: e, app: t, group: o } = a;
|
|
90
92
|
return r.setIn([...e, "loading"], !1).setIn([...e, "error"], s).setIn(["filters-settings", t, o, "apply"], null);
|
|
91
93
|
}
|
|
@@ -93,19 +95,19 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
93
95
|
const { data: s, app: e, group: t, store: o } = a;
|
|
94
96
|
return r.setIn([...o, "loading"], !1).deleteIn([...o, "error"]).setIn([...o, "data"], s).setIn(["filters-settings", e, t, "apply"], null);
|
|
95
97
|
}
|
|
96
|
-
case
|
|
98
|
+
case L: {
|
|
97
99
|
const { data: s } = a;
|
|
98
100
|
return r.setIn(["pageModuleProps"], s);
|
|
99
101
|
}
|
|
100
|
-
case
|
|
102
|
+
case O: {
|
|
101
103
|
const { data: s, app: e, uniqueStorage: t, dvzProxyDatasetId: o } = a, n = ["categories", e];
|
|
102
104
|
return t && n.push(t), o && n.push(o), r.setIn([...n, "loading"], !0).deleteIn([...n, "error"]);
|
|
103
105
|
}
|
|
104
|
-
case
|
|
106
|
+
case D: {
|
|
105
107
|
const { data: s, app: e, uniqueStorage: t, dvzProxyDatasetId: o } = a, n = ["categories", e];
|
|
106
108
|
return o && n.push(o), t && n.push(t), r.setIn([...n, "loading"], !1).setIn([...n, "items"], A.fromJS(s));
|
|
107
109
|
}
|
|
108
|
-
case
|
|
110
|
+
case F: {
|
|
109
111
|
const { data: s, app: e, uniqueStorage: t, dvzProxyDatasetId: o } = a, n = ["categories", e];
|
|
110
112
|
return t && n.push(t), o && n.push(o), r.setIn([...n, "loading"], !1).setIn([...n, "error"], s);
|
|
111
113
|
}
|
|
@@ -122,10 +124,10 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
122
124
|
return r.setIn(["filters-settings", e, t, "autoApply"], n).setIn(["filters", e, t, param], value.length === 0 ? [Number.MIN_SAFE_INTEGER] : value).setIn(["filters-settings", e, t, "apply"], null).setIn(["filters-settings", e, t, "lastUserFilterChange"], s);
|
|
123
125
|
}
|
|
124
126
|
case h: {
|
|
125
|
-
const { data: s, app: e, group: t, param: o, uniqueStorage: n, dvzProxyDatasetId: l, filterType: i, parentType:
|
|
126
|
-
l &&
|
|
127
|
-
const
|
|
128
|
-
return r.setIn([...
|
|
127
|
+
const { data: s, app: e, group: t, param: o, uniqueStorage: n, dvzProxyDatasetId: l, filterType: i, parentType: E, autoApply: u } = a, I = Date.now(), p = ["categories", e];
|
|
128
|
+
l && p.push(l), n && p.push(n);
|
|
129
|
+
const g = s.filter((c) => c.type == i), _ = r.getIn([...p, "items"]).filter((c) => c.get("type") == i).get(0).get("items").map((c) => c.value), b = r.getIn([...p, "items"]).filter((c) => c.get("type") != i).push(A.Map(g[0])), x = r.getIn(["filters", e, t, o]), m = s[0].items.map((c) => c.value), z = x.filter((c) => m.indexOf(c) > -1), q = m.filter((c) => _.indexOf(c) == -1), T = Array.from(/* @__PURE__ */ new Set([...z, ...q]));
|
|
130
|
+
return r.setIn([...p, "items"], b).setIn(["filters", e, t, o], Array.from(T)).setIn(["filters-settings", e, t, "autoApply"], u).setIn(["filters", e, t, o], T.length === 0 ? [Number.MIN_SAFE_INTEGER] : T).setIn(["filters-settings", e, t, "apply"], null).setIn(["filters-settings", e, t, "lastUserFilterChange"], I);
|
|
129
131
|
}
|
|
130
132
|
case P: {
|
|
131
133
|
const s = Date.now(), { app: e, group: t, param: o, value: n } = a;
|
|
@@ -136,8 +138,8 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
136
138
|
return r.deleteIn(["filters", e, t, o]).setIn(["filters-settings", e, t, "lastUserFilterChange"], s).setIn(["filters-settings", e, t, "parent"], n || null);
|
|
137
139
|
}
|
|
138
140
|
case w: {
|
|
139
|
-
const { app:
|
|
140
|
-
return r.setIn(["filters",
|
|
141
|
+
const s = Date.now(), { app: e, group: t } = a, o = r.getIn(["filters", "initial", e, t]);
|
|
142
|
+
return r.setIn(["filters", e, t], o).setIn(["filters-settings", e, t, "lastUserFilterChange"], s);
|
|
141
143
|
}
|
|
142
144
|
case v: {
|
|
143
145
|
const { app: s, group: e, measure: t } = a;
|
|
@@ -155,7 +157,7 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
155
157
|
const { type: s, group: e, ...t } = a;
|
|
156
158
|
return r.setIn(["posts", e], t);
|
|
157
159
|
}
|
|
158
|
-
case
|
|
160
|
+
case G: {
|
|
159
161
|
const { type: s, group: e, ...t } = a;
|
|
160
162
|
if (t.reset) {
|
|
161
163
|
const { reset: l, ...i } = t;
|
|
@@ -172,7 +174,7 @@ const y = "LOAD_DATA", d = "LOAD_DATA_DONE", O = "LOAD_DATA_ERROR", R = "LOAD_CA
|
|
|
172
174
|
}
|
|
173
175
|
}, Ie = ({ group: r, dispatch: a, initialFilters: s }) => {
|
|
174
176
|
a({
|
|
175
|
-
type:
|
|
177
|
+
type: G,
|
|
176
178
|
group: r,
|
|
177
179
|
...s,
|
|
178
180
|
reset: !0,
|