@devgateway/dvz-ui-react 1.4.0 → 1.5.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/index.js +1 -1
- package/dist/cjs/embeddable/body/index.js +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ColorProvider.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ManualColors.js +1 -1
- package/dist/cjs/embeddable/chart/colors/SystemColors.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
- package/dist/cjs/embeddable/data/DataContext.js +1 -1
- package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/filtered-posts/NoData.js +11 -0
- package/dist/cjs/embeddable/filtered-posts/index.js +1 -0
- package/dist/cjs/embeddable/index.js +1 -1
- package/dist/cjs/embeddable/inlinelist/index.js +1 -1
- package/dist/cjs/embeddable/map/MapDataFrame.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/map/map.js +4 -4
- package/dist/cjs/embeddable/posts-filter/PostsFilterDropdown.js +1 -0
- package/dist/cjs/embeddable/posts-filter/index.js +1 -0
- package/dist/cjs/embeddable/posts-filters-reset-button/index.js +1 -0
- package/dist/cjs/embeddable/posts-pagination/index.js +1 -0
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/showcase/index.js +1 -1
- package/dist/cjs/embeddable/time-line/mobile.js +1 -1
- package/dist/cjs/embeddable/vertical-featuredtabs/index.js +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/ClassicHeader.js +1 -1
- package/dist/cjs/layout/CustomSemanticSearch.js +1 -1
- package/dist/cjs/layout/Header.js +3 -3
- package/dist/cjs/layout/Layout.js +1 -1
- package/dist/cjs/layout/SearchControl.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/translations/am.json.js +1 -0
- package/dist/cjs/utils/data.js +1 -1
- package/dist/esm/common.css +1 -1
- package/dist/esm/embeddable/big-number-trend/index.js +36 -36
- package/dist/esm/embeddable/body/index.js +141 -95
- package/dist/esm/embeddable/chart/Bar.js +390 -382
- package/dist/esm/embeddable/chart/Line.js +101 -102
- package/dist/esm/embeddable/chart/colors/ColorProvider.js +42 -39
- package/dist/esm/embeddable/chart/colors/ManualColors.js +40 -29
- package/dist/esm/embeddable/chart/colors/SystemColors.js +28 -17
- package/dist/esm/embeddable/chart/data/Bar.js +112 -114
- package/dist/esm/embeddable/chart/data/Line.js +126 -126
- package/dist/esm/embeddable/chart/data/Utils.js +32 -26
- package/dist/esm/embeddable/d3Map/BaseLayer.js +3 -8
- package/dist/esm/embeddable/d3Map/DataLayer.js +2 -9
- package/dist/esm/embeddable/d3Map/FlowLayer.js +12 -15
- package/dist/esm/embeddable/data/DataContext.js +1 -0
- package/dist/esm/embeddable/featuredtabs/index.js +128 -124
- package/dist/esm/embeddable/filter/index.js +207 -206
- package/dist/esm/embeddable/filtered-posts/NoData.js +31 -0
- package/dist/esm/embeddable/filtered-posts/index.js +123 -0
- package/dist/esm/embeddable/index.js +34 -31
- package/dist/esm/embeddable/inlinelist/index.js +82 -70
- package/dist/esm/embeddable/map/MapDataFrame.js +17 -14
- package/dist/esm/embeddable/map/index.js +180 -169
- package/dist/esm/embeddable/map/map.js +520 -437
- package/dist/esm/embeddable/posts-filter/PostsFilterDropdown.js +190 -0
- package/dist/esm/embeddable/posts-filter/index.js +215 -0
- package/dist/esm/embeddable/posts-filters-reset-button/index.js +33 -0
- package/dist/esm/embeddable/posts-pagination/index.js +69 -0
- package/dist/esm/embeddable/reducers/data-api.js +40 -25
- package/dist/esm/embeddable/reducers/data.js +180 -99
- package/dist/esm/embeddable/showcase/index.js +1 -1
- package/dist/esm/embeddable/time-line/mobile.js +158 -182
- package/dist/esm/embeddable/vertical-featuredtabs/index.js +177 -168
- package/dist/esm/index.js +69 -25
- package/dist/esm/layout/ClassicHeader.js +62 -62
- package/dist/esm/layout/CustomSemanticSearch.js +40 -102
- package/dist/esm/layout/Header.js +152 -144
- package/dist/esm/layout/Layout.js +4 -3
- package/dist/esm/layout/SearchControl.js +130 -113
- package/dist/esm/styles.css +1 -1
- package/dist/esm/translations/am.json.js +46 -0
- package/dist/esm/utils/data.js +4 -9
- package/dist/types/dvz-ui/src/countries.d.ts +7 -0
- package/dist/types/dvz-ui/src/embeddable/chart/colors/ManualColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/chart/colors/SystemColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/data/DataContext.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/featuredtabs/index.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/NoData.d.ts +7 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/index.d.ts +21 -0
- package/dist/types/dvz-ui/src/embeddable/inlinelist/index.d.ts +2 -0
- package/dist/types/dvz-ui/src/embeddable/map/MapDataFrame.d.ts +1 -6
- package/dist/types/dvz-ui/src/embeddable/map/map.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/PostsFilterDropdown.d.ts +21 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/index.d.ts +25 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filters-reset-button/index.d.ts +3 -0
- package/dist/types/dvz-ui/src/embeddable/posts-pagination/index.d.ts +10 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/data-api.d.ts +11 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/post-reducer.d.ts +158 -0
- package/dist/types/dvz-ui/src/embeddable/time-line/mobile.d.ts +1 -2
- package/dist/types/dvz-ui/src/embeddable/vertical-featuredtabs/index.d.ts +1 -0
- package/dist/types/dvz-ui/src/index.d.ts +3 -0
- package/dist/types/dvz-ui/src/layout/Header.d.ts +2 -2
- package/dist/types/dvz-ui/src/translations/am.json.d.ts +39 -0
- package/package.json +7 -5
- package/dist/cjs/embeddable/posts-with-filters/DropDownFilter.js +0 -1
- package/dist/cjs/embeddable/posts-with-filters/Post.js +0 -1
- package/dist/cjs/embeddable/posts-with-filters/index.js +0 -1
- package/dist/esm/embeddable/posts-with-filters/DropDownFilter.js +0 -25
- package/dist/esm/embeddable/posts-with-filters/Post.js +0 -51
- package/dist/esm/embeddable/posts-with-filters/index.js +0 -206
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/DropDownFilter.d.ts +0 -4
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/Post.d.ts +0 -5
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/index.d.ts +0 -21
- /package/dist/cjs/{utils/countries.js → countries.js} +0 -0
- /package/dist/cjs/embeddable/{posts-with-filters → filtered-posts}/utils.js +0 -0
- /package/dist/esm/{utils/countries.js → countries.js} +0 -0
- /package/dist/esm/embeddable/{posts-with-filters → filtered-posts}/utils.js +0 -0
- /package/dist/types/dvz-ui/src/embeddable/{posts-with-filters → filtered-posts}/utils.d.ts +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as c, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { Segment as r, Header as s } from "semantic-ui-react";
|
|
3
|
+
const d = (a) => {
|
|
4
|
+
const { noDataMsg: e, editing: n } = a;
|
|
5
|
+
return /* @__PURE__ */ c(r, { placeholder: !0, className: "chartNoDataMessage", children: /* @__PURE__ */ t(s, { icon: !0, children: [
|
|
6
|
+
/* @__PURE__ */ c(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
className: "noDataSVG",
|
|
11
|
+
viewBox: "0 0 512 512",
|
|
12
|
+
children: /* @__PURE__ */ c("path", { d: `M403.7,96.3c-41-41-95.6-63.6-153.7-63.6c-58,0-112.6,22.6-153.7,63.6c-41,41-63.6,95.6-63.6,153.7
|
|
13
|
+
c0,58,22.6,112.6,63.6,153.7c41,41,95.6,63.6,153.7,63.6c58,0,112.6-22.6,153.7-63.6c41-41,63.7-95.6,63.7-153.7
|
|
14
|
+
C467.3,192,444.7,137.4,403.7,96.3z M57.7,250C57.7,144,144,57.7,250,57.7c37.2,0,72,10.6,101.5,29l-63,77.1c-2.8-3.5-6-6.8-9.5-10
|
|
15
|
+
c-18.2-16.7-39.9-24.5-65.1-23.5c-25.2,1.1-46.2,10.7-62.9,28.9c-16.7,18.2-24.5,39.9-23.5,65.1c1.1,25.2,10.7,46.2,28.9,62.9
|
|
16
|
+
c6.2,5.7,12.8,10.3,19.8,14l-66,80.8C77.7,347.6,57.7,301.1,57.7,250z M280.2,217.8c0.7,17.3-4.7,32.3-16.3,45
|
|
17
|
+
c-10.9,11.9-24.3,18.5-40.2,19.9l56.3-68.9C280.1,215.2,280.2,216.5,280.2,217.8z M194.6,278.8c-6.9-2.7-13.3-6.8-19.2-12.2
|
|
18
|
+
c-12.7-11.6-19.4-26.1-20.1-43.5c-0.7-17.3,4.7-32.4,16.3-45c11.6-12.7,26.1-19.4,43.5-20.1c17.3-0.7,32.3,4.7,45,16.3
|
|
19
|
+
c4,3.7,7.3,7.6,10.1,11.8L194.6,278.8z M250,442.3c-46,0-88.2-16.2-121.3-43.2l73.1-89.5c6.4,1,13,1.4,19.9,1.1
|
|
20
|
+
c10.2-0.4,19.7-2.5,28.6-6.1c8.9-3.6,16.7-8.4,23.4-14.2l81,74.4c2.6,2.4,6,3.6,9.3,3.6c3.7,0,7.4-1.5,10.1-4.5
|
|
21
|
+
c5.1-5.6,4.8-14.3-0.8-19.4l-81-74.4c5.3-7.2,9.3-15.3,12.2-24.5c2.8-9.2,4.1-18.8,3.6-29c-0.5-10.7-2.5-20.6-6-29.8l69.8-85.5
|
|
22
|
+
c43,35.3,70.5,88.8,70.5,148.7C442.3,356,356,442.3,250,442.3z` })
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
n && /* @__PURE__ */ c("div", { className: "WPnoDataMsg", children: "Not enough parameters to render the chart" }),
|
|
26
|
+
/* @__PURE__ */ c("div", { className: "WPnoDataMsg", children: e })
|
|
27
|
+
] }) });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
d as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import R, { useState as S, useEffect as W } from "react";
|
|
3
|
+
import { Container as A, Loader as j, Grid as I, GridRow as L } from "semantic-ui-react";
|
|
4
|
+
import M from "../connected-templates/PostIntro.js";
|
|
5
|
+
import { injectIntl as V } from "react-intl";
|
|
6
|
+
import { getStartDateAndEndDateFromYear as k } from "./utils.js";
|
|
7
|
+
import Y from "./NoData.js";
|
|
8
|
+
import { useDispatch as q, useSelector as z } from "react-redux";
|
|
9
|
+
import { getCustomPosts as J } from "../reducers/data-api.js";
|
|
10
|
+
import { useParams as K } from "react-router";
|
|
11
|
+
import { toNumber as Q, toBoolean as U } from "../../utils/data.js";
|
|
12
|
+
const X = (d) => {
|
|
13
|
+
const { posts: i, numberOfColumns: g, sortFirstBy: n, countryCategory: e, postWidth: b, postHeight: x } = d, l = [];
|
|
14
|
+
if (e && n) {
|
|
15
|
+
const a = i.filter((c) => c[e].includes(Number(n))), m = i.filter((c) => !c[e].includes(Number(n)));
|
|
16
|
+
l.push(...a, ...m);
|
|
17
|
+
} else
|
|
18
|
+
l.push(...i);
|
|
19
|
+
return /* @__PURE__ */ o(I, { columns: g, children: /* @__PURE__ */ o(L, { children: l.map((a) => /* @__PURE__ */ o(I.Column, { children: /* @__PURE__ */ o("div", { style: { width: b, height: x, overflow: "hidden" }, children: /* @__PURE__ */ o(
|
|
20
|
+
M,
|
|
21
|
+
{
|
|
22
|
+
style: {
|
|
23
|
+
width: "100%",
|
|
24
|
+
height: "100%",
|
|
25
|
+
overflow: "hidden",
|
|
26
|
+
margin: 0,
|
|
27
|
+
padding: 0
|
|
28
|
+
},
|
|
29
|
+
as: A,
|
|
30
|
+
fluid: !0,
|
|
31
|
+
post: a
|
|
32
|
+
},
|
|
33
|
+
a.id
|
|
34
|
+
) }) }, a.id)) }) });
|
|
35
|
+
}, Z = (d) => {
|
|
36
|
+
const {
|
|
37
|
+
"data-group": i,
|
|
38
|
+
"data-number-of-columns": g,
|
|
39
|
+
"data-type": n,
|
|
40
|
+
"data-taxonomy": e,
|
|
41
|
+
"data-categories": b,
|
|
42
|
+
"data-height": x,
|
|
43
|
+
"data-post-width": l,
|
|
44
|
+
"data-post-height": a,
|
|
45
|
+
"data-number-of-items-per-page": m,
|
|
46
|
+
"data-enable-sorting": c,
|
|
47
|
+
"data-sort-first-by": F,
|
|
48
|
+
"data-sorting-taxonomy": D
|
|
49
|
+
} = d, v = q(), { locale: O } = K(), [P, p] = S(!1), B = z((t) => t), [f, T] = S([]), G = U(c), N = B.getIn(["data", "posts", i]), _ = G && F !== "none" ? Q(F) : null, s = N ?? {
|
|
50
|
+
yearFilter: null,
|
|
51
|
+
categoryFilter: null,
|
|
52
|
+
countryFilter: null,
|
|
53
|
+
page: 1,
|
|
54
|
+
countryTaxonomy: null,
|
|
55
|
+
categoryTaxonomy: null
|
|
56
|
+
}, E = () => {
|
|
57
|
+
const t = s.yearFilter ? k(Number(s.yearFilter)) : null, u = s.countryFilter ?? null, y = s.categoryFilter ?? null, h = s.categoryTaxonomy || (e && e !== "none" ? e : null), r = s.countryTaxonomy || null;
|
|
58
|
+
return {
|
|
59
|
+
before: (t == null ? void 0 : t.endDate) || null,
|
|
60
|
+
after: (t == null ? void 0 : t.startDate) || null,
|
|
61
|
+
categoryFilter: y,
|
|
62
|
+
categoryTaxonomy: h,
|
|
63
|
+
countryFilter: u,
|
|
64
|
+
countryTaxonomy: r
|
|
65
|
+
};
|
|
66
|
+
}, H = async () => {
|
|
67
|
+
const t = E();
|
|
68
|
+
if (!n) {
|
|
69
|
+
console.warn("FilteredPosts: missing post type. Configure 'type' in block settings."), T([]), p(!1);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
p(!0);
|
|
73
|
+
const u = /* @__PURE__ */ new Map();
|
|
74
|
+
t.categoryTaxonomy && t.categoryFilter != null && u.set(
|
|
75
|
+
t.categoryTaxonomy,
|
|
76
|
+
Array.isArray(t.categoryFilter) ? t.categoryFilter : [t.categoryFilter]
|
|
77
|
+
), t.countryTaxonomy && t.countryFilter != null && u.set(
|
|
78
|
+
t.countryTaxonomy,
|
|
79
|
+
Array.isArray(t.countryFilter) ? t.countryFilter : [t.countryFilter]
|
|
80
|
+
), await J({
|
|
81
|
+
after: t.after,
|
|
82
|
+
before: t.before,
|
|
83
|
+
perPage: Number(m || 10),
|
|
84
|
+
page: s.page || 1,
|
|
85
|
+
locale: O || "en",
|
|
86
|
+
postType: n,
|
|
87
|
+
// explicit undefineds for legacy params to satisfy types
|
|
88
|
+
taxonomy: void 0,
|
|
89
|
+
category: void 0,
|
|
90
|
+
taxonomyFilters: u
|
|
91
|
+
}).then((y) => {
|
|
92
|
+
if (y) {
|
|
93
|
+
const { data: h, meta: r } = y;
|
|
94
|
+
T(h);
|
|
95
|
+
const w = r && r["x-wp-totalpages"] ? r["x-wp-totalpages"] : 1, C = r && r["x-wp-total"] ? r["x-wp-total"] : 0;
|
|
96
|
+
w && C && v({
|
|
97
|
+
type: "SET_POSTS_PAGINATION",
|
|
98
|
+
group: i,
|
|
99
|
+
totalPages: Number(w),
|
|
100
|
+
totalItems: Number(C)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}).finally(() => {
|
|
104
|
+
p(!1);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
return W(() => {
|
|
108
|
+
H();
|
|
109
|
+
}, [N, n, e, m]), /* @__PURE__ */ o(A, { fluid: !0, children: P ? /* @__PURE__ */ o(j, { active: !0, inline: "centered" }) : !P && f && f.length > 0 ? /* @__PURE__ */ o(
|
|
110
|
+
X,
|
|
111
|
+
{
|
|
112
|
+
posts: f,
|
|
113
|
+
postWidth: Number(l),
|
|
114
|
+
postHeight: Number(a),
|
|
115
|
+
numberOfColumns: Number(g),
|
|
116
|
+
sortFirstBy: _,
|
|
117
|
+
countryCategory: D
|
|
118
|
+
}
|
|
119
|
+
) : /* @__PURE__ */ o(Y, { noDataMsg: "No posts found" }) });
|
|
120
|
+
}, ut = V(R.memo(Z));
|
|
121
|
+
export {
|
|
122
|
+
ut as default
|
|
123
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i, { lazy as t } from "react";
|
|
2
2
|
import c from "./reducers/data.js";
|
|
3
3
|
import p from "./reducers/embeddable.js";
|
|
4
|
-
import { injectIntl as
|
|
5
|
-
const l =
|
|
4
|
+
import { injectIntl as a } from "react-intl";
|
|
5
|
+
const l = t(() => import("./pagegallery/index.js")), d = t(() => import("./download/index.js")), u = t(() => import("./postscarousel/index.js")), b = t(() => import("./chart/index.js")), C = t(() => import("./filter/index.js")), g = t(() => import("./showcase/index.js")), f = t(() => import("./newsletter/index.js")), w = t(() => import("./tabbedposts/index.js")), P = t(() => import("./pagemodules/index.js")), y = t(() => import("./featuredtabs/index.js")), L = t(() => import("./vertical-featuredtabs/index.js")), F = t(() => import("./inlinelist/index.js")), h = t(() => import("./agree-and-download/index.js")), T = t(() => import("./downloadPDF/index.js")), N = t(() => import("./map/index.js")), R = t(() => import("./filter-reset-button/index.js")), D = t(() => import("./filters-apply-button/index.js")), M = t(() => import("./tooltip/index.js")), k = t(() => import("./references/ReferencesList.js")), B = t(() => import("./references/Reference.js")), j = t(() => import("./time-line/index.js")), A = t(() => import("./new-time-line/index.js")), I = t(() => import("./measures/index.js")), O = t(() => import("./menu/index.js")), S = t(() => import("./child-page-menu/index.js")), v = t(() => import("./d3Map/index.js")), x = t(() => import("./parallax/index.js")), z = t(() => import("./wrapped/index.js")), G = t(() => import("./sankeychart/index.js")), E = t(() => import("./datalabel/index.js")), V = t(() => import("./body/index.js")), W = t(() => import("./superset-chart/index.js")), q = t(() => import("./superset-dashboard/index.js")), H = t(() => import("./big-number/index.js")), J = t(() => import("./big-number-trend/index.js")), K = t(() => import("./posts-filter/index.js")), Q = t(() => import("./filtered-posts/index.js")), U = t(() => import("./posts-filters-reset-button/index.js")), X = t(() => import("./posts-pagination/index.js")), m = {
|
|
6
6
|
pageGallery: l,
|
|
7
7
|
postsCarousel: u,
|
|
8
8
|
chart: b,
|
|
@@ -10,17 +10,17 @@ const l = e(() => import("./pagegallery/index.js")), d = e(() => import("./downl
|
|
|
10
10
|
showCaseForm: g,
|
|
11
11
|
newsLetter: f,
|
|
12
12
|
tabbedPosts: w,
|
|
13
|
-
pageModules:
|
|
14
|
-
featuredTabs:
|
|
15
|
-
verticalTabs:
|
|
13
|
+
pageModules: P,
|
|
14
|
+
featuredTabs: y,
|
|
15
|
+
verticalTabs: L,
|
|
16
16
|
inlineList: F,
|
|
17
17
|
download: d,
|
|
18
18
|
downloadPdf: T,
|
|
19
19
|
map: N,
|
|
20
|
-
dataFiltersReset:
|
|
21
|
-
dataFiltersApply:
|
|
22
|
-
tooltip:
|
|
23
|
-
references:
|
|
20
|
+
dataFiltersReset: R,
|
|
21
|
+
dataFiltersApply: D,
|
|
22
|
+
tooltip: M,
|
|
23
|
+
references: k,
|
|
24
24
|
reference: B,
|
|
25
25
|
timeLine: j,
|
|
26
26
|
newTimeLine: A,
|
|
@@ -29,49 +29,52 @@ const l = e(() => import("./pagegallery/index.js")), d = e(() => import("./downl
|
|
|
29
29
|
childPagesMenu: S,
|
|
30
30
|
newMap: v,
|
|
31
31
|
parallaxContainer: x,
|
|
32
|
-
wrapped:
|
|
33
|
-
sankeyChart:
|
|
34
|
-
dataLabel:
|
|
35
|
-
body:
|
|
36
|
-
supersetChart:
|
|
32
|
+
wrapped: z,
|
|
33
|
+
sankeyChart: G,
|
|
34
|
+
dataLabel: E,
|
|
35
|
+
body: V,
|
|
36
|
+
supersetChart: W,
|
|
37
37
|
supersetDashboard: q,
|
|
38
|
-
agreeAndDownload:
|
|
38
|
+
agreeAndDownload: h,
|
|
39
39
|
bigNumber: H,
|
|
40
40
|
bigNumberTrend: J,
|
|
41
|
-
|
|
41
|
+
postsFilter: K,
|
|
42
|
+
filteredPosts: Q,
|
|
43
|
+
postsFiltersReset: U,
|
|
44
|
+
postsPagination: X,
|
|
42
45
|
redirect: () => null
|
|
43
46
|
}, s = {
|
|
44
47
|
components: {},
|
|
45
48
|
reducers: {},
|
|
46
49
|
registerCustomEmbeddables: (r) => {
|
|
47
|
-
for (const [o,
|
|
48
|
-
s.components[o] =
|
|
50
|
+
for (const [o, e] of Object.entries(r))
|
|
51
|
+
s.components[o] = e;
|
|
49
52
|
},
|
|
50
53
|
getComponentByNameIgnoreCase: (r) => {
|
|
51
|
-
const o = Object.keys(s.components).find((
|
|
54
|
+
const o = Object.keys(s.components).find((e) => e.toLowerCase() === r.toLowerCase());
|
|
52
55
|
if (o) {
|
|
53
|
-
const
|
|
54
|
-
return
|
|
56
|
+
const e = s.components[o];
|
|
57
|
+
return i.memo(a(e));
|
|
55
58
|
}
|
|
56
59
|
return null;
|
|
57
60
|
},
|
|
58
61
|
registerCustomReducers: (r) => {
|
|
59
|
-
for (const [o,
|
|
60
|
-
s.reducers[o] =
|
|
62
|
+
for (const [o, e] of Object.entries(r))
|
|
63
|
+
s.reducers[o] = e;
|
|
61
64
|
},
|
|
62
65
|
getReducers: () => s.reducers
|
|
63
|
-
},
|
|
66
|
+
}, tt = (r) => {
|
|
64
67
|
const o = Object.keys(m).find((n) => n.toLowerCase() === r.toLowerCase());
|
|
65
68
|
if (o) {
|
|
66
69
|
const n = m[o];
|
|
67
|
-
return
|
|
70
|
+
return i.memo(a(n));
|
|
68
71
|
}
|
|
69
|
-
const
|
|
70
|
-
return
|
|
71
|
-
},
|
|
72
|
+
const e = s.getComponentByNameIgnoreCase(r);
|
|
73
|
+
return e ? i.memo(a(e)) : null;
|
|
74
|
+
}, et = { data: c, embeddable: p, ...s.getReducers() };
|
|
72
75
|
export {
|
|
73
76
|
m as components,
|
|
74
77
|
s as customizer,
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
tt as getComponentByNameIgnoreCase,
|
|
79
|
+
et as reducers
|
|
77
80
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Container as
|
|
4
|
-
import { PostProvider as
|
|
5
|
-
import
|
|
6
|
-
import { useParams as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
const { posts: c, showIcons:
|
|
10
|
-
|
|
1
|
+
import { jsx as o, jsxs as i, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import v, { useState as I, useEffect as x } from "react";
|
|
3
|
+
import { Container as u, Grid as T, Label as M } from "semantic-ui-react";
|
|
4
|
+
import { PostProvider as _, PostConsumer as S, MediaProvider as B, MediaConsumer as H, PostIcon as N, utils as j } from "@devgateway/wp-react-lib";
|
|
5
|
+
import E from "../connected-templates/PostIntro.js";
|
|
6
|
+
import { useParams as V } from "react-router";
|
|
7
|
+
import k from "../connected-templates/PostContent.js";
|
|
8
|
+
const q = (f) => {
|
|
9
|
+
const { posts: c, showIcons: w, showContentToggle: s, contentToggleHPosition: y, locale: C, readMoreLabel: d, readLessLabel: P } = f, [n, b] = I({}), l = v.createRef(), a = (t, e = "Read More") => t && t.trim() !== "" ? t : e;
|
|
10
|
+
x(() => {
|
|
11
11
|
window.setTimeout(
|
|
12
12
|
() => {
|
|
13
13
|
if (window.location.hash) {
|
|
@@ -18,92 +18,104 @@ const E = (m) => {
|
|
|
18
18
|
0
|
|
19
19
|
);
|
|
20
20
|
}, [c]);
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
}, children:
|
|
29
|
-
},
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
},
|
|
33
|
-
const
|
|
34
|
-
return
|
|
21
|
+
const h = (t) => {
|
|
22
|
+
const e = t.content ? t.content.rendered.split("<!--more-->") : [];
|
|
23
|
+
return e.length > 1 ? e[1] : e[0];
|
|
24
|
+
}, m = (t) => {
|
|
25
|
+
const e = n[t] || !1, r = e ? a(P, "Read less") : a(d, "Read more");
|
|
26
|
+
return /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("div", { style: { position: "relative", left: y + "%" }, children: /* @__PURE__ */ o("a", { className: "link", onClick: () => {
|
|
27
|
+
l.current && e && (l.current.scrollIntoView({ behavior: "smooth", block: "start" }), l.current.scrollTop = 0), b({ ...n, [t]: !e });
|
|
28
|
+
}, children: r }) }) });
|
|
29
|
+
}, g = (t) => {
|
|
30
|
+
const e = t.content ? t.content.rendered.split("<!--more-->") : [], r = e.length > 1 ? e[0] : null;
|
|
31
|
+
return r ? r.trim() : null;
|
|
32
|
+
}, p = (t) => {
|
|
33
|
+
const e = t.content ? t.content.rendered.split("<!--more-->") : [];
|
|
34
|
+
return e.length > 1 && e[1].trim().length > 0;
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
36
|
+
return /* @__PURE__ */ o(u, { fluid: !0, className: "inline list", children: c && c.map((t) => /* @__PURE__ */ i(T, { children: [
|
|
37
|
+
w && /* @__PURE__ */ i(T.Column, { textAlign: "center", width: 1, children: [
|
|
38
|
+
/* @__PURE__ */ o("a", { id: t.slug }),
|
|
39
|
+
/* @__PURE__ */ o(
|
|
40
|
+
B,
|
|
41
41
|
{
|
|
42
42
|
id: t.meta_fields && t.meta_fields.icon ? t.meta_fields.icon[0] : null,
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ o(H, { children: /* @__PURE__ */ o(N, { as: M }) })
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
] }),
|
|
47
|
-
/* @__PURE__ */ i(
|
|
48
|
-
|
|
49
|
-
!
|
|
50
|
-
|
|
47
|
+
/* @__PURE__ */ i(T.Column, { width: w ? 15 : 16, children: [
|
|
48
|
+
g(t) && /* @__PURE__ */ o(E, { as: u, fluid: !0, post: t, ref: l }),
|
|
49
|
+
!g(t) && /* @__PURE__ */ o(
|
|
50
|
+
k,
|
|
51
51
|
{
|
|
52
|
-
post: { content: { rendered:
|
|
52
|
+
post: { content: { rendered: h(t) } },
|
|
53
53
|
style: { clear: "both", display: "block" }
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
!n[t.slug] &&
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
56
|
+
p(t) && /* @__PURE__ */ i(u, { children: [
|
|
57
|
+
s && /* @__PURE__ */ i(R, { children: [
|
|
58
|
+
!n[t.slug] && m(t.slug),
|
|
59
|
+
/* @__PURE__ */ o(
|
|
60
|
+
k,
|
|
61
61
|
{
|
|
62
|
-
post: { content: { rendered:
|
|
62
|
+
post: { content: { rendered: h(t) } },
|
|
63
63
|
style: {
|
|
64
64
|
clear: "both",
|
|
65
65
|
display: n[t.slug] ? "block" : "none"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
n[t.slug] &&
|
|
69
|
+
n[t.slug] && m(t.slug)
|
|
70
70
|
] }),
|
|
71
|
-
!
|
|
71
|
+
!s && /* @__PURE__ */ o("a", { href: j.replaceLink(t.link, C), className: "link", children: a(d) })
|
|
72
72
|
] })
|
|
73
73
|
] })
|
|
74
74
|
] })) });
|
|
75
|
-
},
|
|
76
|
-
const [c,
|
|
77
|
-
"data-width":
|
|
78
|
-
"data-height":
|
|
79
|
-
"data-type":
|
|
80
|
-
"data-taxonomy":
|
|
81
|
-
"data-categories":
|
|
82
|
-
"data-items":
|
|
83
|
-
"data-color":
|
|
84
|
-
"data-show-post-icons":
|
|
85
|
-
"data-show-content-toggle":
|
|
86
|
-
"data-content-toggle-h-position":
|
|
75
|
+
}, K = (f) => {
|
|
76
|
+
const [c, w] = I(Math.random() * 99998 + 1), { locale: s } = V(), {
|
|
77
|
+
"data-width": y,
|
|
78
|
+
"data-height": C,
|
|
79
|
+
"data-type": d,
|
|
80
|
+
"data-taxonomy": P,
|
|
81
|
+
"data-categories": n,
|
|
82
|
+
"data-items": b,
|
|
83
|
+
"data-color": l,
|
|
84
|
+
"data-show-post-icons": a,
|
|
85
|
+
"data-show-content-toggle": h,
|
|
86
|
+
"data-content-toggle-h-position": m,
|
|
87
87
|
//horizontal position
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
"data-read-more-label": g,
|
|
89
|
+
"data-read-less-label": p,
|
|
90
|
+
parent: t,
|
|
91
|
+
editing: e,
|
|
92
|
+
component: r,
|
|
93
|
+
unique: L
|
|
94
|
+
} = f;
|
|
95
|
+
return /* @__PURE__ */ o(u, { fluid: !0, children: /* @__PURE__ */ o(
|
|
96
|
+
_,
|
|
95
97
|
{
|
|
96
|
-
type:
|
|
97
|
-
locale:
|
|
98
|
-
taxonomy:
|
|
99
|
-
categories:
|
|
100
|
-
store: "inline_list_" +
|
|
98
|
+
type: d,
|
|
99
|
+
locale: s,
|
|
100
|
+
taxonomy: P,
|
|
101
|
+
categories: n,
|
|
102
|
+
store: "inline_list_" + t + "_" + L,
|
|
101
103
|
page: 1,
|
|
102
|
-
perPage:
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
+
perPage: b,
|
|
105
|
+
children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(
|
|
106
|
+
q,
|
|
107
|
+
{
|
|
108
|
+
locale: s ?? "en",
|
|
109
|
+
showIcons: a === "true",
|
|
110
|
+
showContentToggle: h === "true",
|
|
111
|
+
contentToggleHPosition: parseInt(m || "50", 10),
|
|
112
|
+
readMoreLabel: g,
|
|
113
|
+
readLessLabel: p
|
|
114
|
+
}
|
|
115
|
+
) })
|
|
104
116
|
}
|
|
105
117
|
) });
|
|
106
118
|
};
|
|
107
119
|
export {
|
|
108
|
-
|
|
120
|
+
K as default
|
|
109
121
|
};
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const l = {
|
|
1
|
+
import c from "react";
|
|
2
|
+
const i = (d) => {
|
|
3
|
+
const { data: e, measures: o, customMeasureLabels: t, children: h, source: m } = d, l = {
|
|
4
4
|
locationsData: [],
|
|
5
5
|
nationalData: {},
|
|
6
6
|
measureLabelMap: {}
|
|
7
7
|
};
|
|
8
8
|
e.metadata && e.metadata.measures && e.metadata.measures.forEach((a) => {
|
|
9
|
-
|
|
9
|
+
t && t[a.value] && t[a.value].hasCustomLabel && t[a.value].customLabel ? l.measureLabelMap[a.value] = t[a.value].customLabel : l.measureLabelMap[a.value] = a.label;
|
|
10
10
|
});
|
|
11
|
-
const
|
|
11
|
+
const s = o.split(",");
|
|
12
12
|
return e && e.children && (e.children.forEach((a) => {
|
|
13
|
-
|
|
14
|
-
const
|
|
13
|
+
s.forEach((r) => {
|
|
14
|
+
const u = {
|
|
15
15
|
...a,
|
|
16
16
|
label: a.value,
|
|
17
|
-
value: a[
|
|
18
|
-
measure:
|
|
17
|
+
value: a[r],
|
|
18
|
+
measure: r
|
|
19
19
|
};
|
|
20
|
-
a.children && (
|
|
21
|
-
|
|
22
|
-
})), l.locationsData.push(
|
|
20
|
+
a.children && (u.children = [], a.children.forEach((n) => {
|
|
21
|
+
u.children.push({ ...n, label: n.value, value: n[r] });
|
|
22
|
+
})), l.locationsData.push(u);
|
|
23
23
|
});
|
|
24
|
-
}), l.measures =
|
|
24
|
+
}), l.measures = s.length > 1 ? s : null, l.nationalData.value = e[o]), c.Children.map(h, (a) => c.cloneElement(a, { transformedData: {
|
|
25
|
+
...l,
|
|
26
|
+
types: e.metadata ? e.metadata.types : []
|
|
27
|
+
} }));
|
|
25
28
|
};
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
i as default
|
|
28
31
|
};
|