@devgateway/dvz-ui-react 1.6.0 → 1.6.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/common.css +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/Pie.js +1 -1
- package/dist/cjs/embeddable/filtered-posts/index.js +1 -1
- package/dist/cjs/layout/Header.js +2 -2
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/common.css +1 -1
- package/dist/esm/embeddable/chart/Bar.js +401 -359
- package/dist/esm/embeddable/chart/Line.js +126 -122
- package/dist/esm/embeddable/chart/Pie.js +101 -100
- package/dist/esm/embeddable/filtered-posts/index.js +85 -83
- package/dist/esm/layout/Header.js +1 -1
- package/dist/esm/styles.css +1 -1
- package/package.json +2 -2
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as l, useEffect as
|
|
3
|
-
import { injectIntl as
|
|
4
|
-
import { ResponsivePie as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as r, jsxs as p, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as M } from "react";
|
|
3
|
+
import { injectIntl as pe } from "react-intl";
|
|
4
|
+
import { ResponsivePie as ue } from "@nivo/pie";
|
|
5
|
+
import fe, { formatContent as ge } from "./Tooltip.js";
|
|
6
6
|
import "@nivo/colors";
|
|
7
7
|
import "d3";
|
|
8
|
-
import { v4 as
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { v4 as he } from "uuid";
|
|
9
|
+
import be from "../../layout/FlexWrapDetector.js";
|
|
10
|
+
import Le from "../../utils/deviceType.js";
|
|
11
|
+
const $ = Le() === "mobile", xe = ({
|
|
12
|
+
legends: ke,
|
|
12
13
|
marginLeft: j,
|
|
13
14
|
marginTop: x,
|
|
14
15
|
marginRight: w,
|
|
15
16
|
marginBottom: k,
|
|
16
17
|
options: u,
|
|
17
|
-
intl:
|
|
18
|
-
format:
|
|
19
|
-
colors:
|
|
20
|
-
groupMode:
|
|
18
|
+
intl: f,
|
|
19
|
+
format: g,
|
|
20
|
+
colors: ve,
|
|
21
|
+
groupMode: Ce,
|
|
21
22
|
tooltipEnabled: B,
|
|
22
23
|
height: I,
|
|
23
24
|
showLegends: v,
|
|
24
|
-
legendPosition:
|
|
25
|
-
tickRotation:
|
|
26
|
-
tickColor:
|
|
27
|
-
tooltip:
|
|
28
|
-
startAngle:
|
|
29
|
-
endAngle:
|
|
25
|
+
legendPosition: a,
|
|
26
|
+
tickRotation: ye,
|
|
27
|
+
tickColor: Ne,
|
|
28
|
+
tooltip: s,
|
|
29
|
+
startAngle: z,
|
|
30
|
+
endAngle: O,
|
|
30
31
|
legendLabel: C,
|
|
31
32
|
legendCheckBack: y,
|
|
32
|
-
legendLabelBack:
|
|
33
|
-
legendLabelColor:
|
|
34
|
-
centerLabel:
|
|
35
|
-
showArcLabels:
|
|
36
|
-
showArcLinkLabels:
|
|
37
|
-
slicePadding:
|
|
33
|
+
legendLabelBack: V,
|
|
34
|
+
legendLabelColor: R,
|
|
35
|
+
centerLabel: H,
|
|
36
|
+
showArcLabels: E,
|
|
37
|
+
showArcLinkLabels: X,
|
|
38
|
+
slicePadding: Y,
|
|
38
39
|
colorGenerator: N,
|
|
39
|
-
centerLabelFontWeight:
|
|
40
|
-
centerLabelFontSize:
|
|
41
|
-
centerLabelXOffset:
|
|
42
|
-
centerLabelYOffset:
|
|
43
|
-
tooltipEnableMarkdown:
|
|
44
|
-
reverseLegend:
|
|
45
|
-
showPercentage:
|
|
40
|
+
centerLabelFontWeight: q,
|
|
41
|
+
centerLabelFontSize: J,
|
|
42
|
+
centerLabelXOffset: K,
|
|
43
|
+
centerLabelYOffset: Q,
|
|
44
|
+
tooltipEnableMarkdown: U,
|
|
45
|
+
reverseLegend: Z,
|
|
46
|
+
showPercentage: _
|
|
46
47
|
}) => {
|
|
47
|
-
const [c,
|
|
48
|
+
const [c, G] = l([]), [P, ee] = l(s), [o, te] = l(u), [S, re] = l(50), [T, ae] = l(x), [Se, A] = l(0), [D, ne] = l(k), d = o.data.sort((e, t) => e.position && t.position ? e.position - t.position : 0).map((e, t) => ({
|
|
48
49
|
color: N.getColor(e.id, e),
|
|
49
50
|
id: e.id,
|
|
50
51
|
label: e.label
|
|
51
52
|
}));
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
M(() => {
|
|
54
|
+
ee(s), te({
|
|
54
55
|
...u,
|
|
55
|
-
id:
|
|
56
|
+
id: he()
|
|
56
57
|
});
|
|
57
|
-
}, [
|
|
58
|
+
}, [s, u]), M(() => {
|
|
58
59
|
(() => {
|
|
59
60
|
const n = 5 * Math.max(d.length - 5, 0);
|
|
60
|
-
|
|
61
|
+
re(n);
|
|
61
62
|
})();
|
|
62
63
|
}, [d]);
|
|
63
|
-
const
|
|
64
|
+
const oe = {
|
|
64
65
|
bottom: `-${S}px`
|
|
65
|
-
},
|
|
66
|
+
}, le = {
|
|
66
67
|
bottom: `-${S}px`,
|
|
67
68
|
gap: "0px"
|
|
68
|
-
},
|
|
69
|
+
}, ie = (e) => {
|
|
69
70
|
const t = c.slice();
|
|
70
71
|
if (t.indexOf(e) > -1) {
|
|
71
72
|
const n = t.indexOf(e);
|
|
72
73
|
t.splice(n, 1);
|
|
73
74
|
} else
|
|
74
75
|
t.push(e);
|
|
75
|
-
|
|
76
|
+
G(t);
|
|
76
77
|
}, se = (e) => c ? e.filter((t) => c.indexOf(t.id) === -1) : e;
|
|
77
78
|
if (!o || !o.data)
|
|
78
79
|
return null;
|
|
79
|
-
const
|
|
80
|
-
top:
|
|
80
|
+
const ce = {
|
|
81
|
+
top: T,
|
|
81
82
|
right: w,
|
|
82
|
-
bottom:
|
|
83
|
+
bottom: D,
|
|
83
84
|
left: j
|
|
84
|
-
},
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
}, W = () => /* @__PURE__ */ r(L, { children: v && C && /* @__PURE__ */ r("div", { className: "legend item", children: /* @__PURE__ */ r("label", { className: "legend-title", children: C }) }) }), F = () => (Z && d.reverse(), /* @__PURE__ */ r(L, { children: v && d.map((e) => /* @__PURE__ */ p("div", { className: "legend item", onClick: () => ie(e.id), children: [
|
|
86
|
+
/* @__PURE__ */ r(
|
|
86
87
|
"input",
|
|
87
88
|
{
|
|
88
89
|
className: "ignore",
|
|
@@ -90,7 +91,7 @@ const be = ({
|
|
|
90
91
|
checked: c.length == 0 || !c.includes(e.id)
|
|
91
92
|
}
|
|
92
93
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ r(
|
|
94
95
|
"span",
|
|
95
96
|
{
|
|
96
97
|
className: y ? "checkmark-with-bg" : "checkmark",
|
|
@@ -99,80 +100,80 @@ const be = ({
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ r(
|
|
103
104
|
"label",
|
|
104
105
|
{
|
|
105
106
|
style: {
|
|
106
|
-
backgroundColor:
|
|
107
|
-
color:
|
|
107
|
+
backgroundColor: V == !0 ? e.color : "transparent",
|
|
108
|
+
color: R
|
|
108
109
|
},
|
|
109
110
|
children: e.label
|
|
110
111
|
}
|
|
111
112
|
)
|
|
112
|
-
] })) })),
|
|
113
|
-
const { centerX: t, centerY: n } = e,
|
|
113
|
+
] })) })), de = (e) => {
|
|
114
|
+
const { centerX: t, centerY: n } = e, i = H.split(/[\r\n]/g);
|
|
114
115
|
let m = 0;
|
|
115
116
|
return e.dataWithArc && (m = e.dataWithArc.reduce(
|
|
116
|
-
function(
|
|
117
|
-
return
|
|
117
|
+
function(h, b) {
|
|
118
|
+
return h + b.value;
|
|
118
119
|
},
|
|
119
120
|
0
|
|
120
|
-
)), /* @__PURE__ */
|
|
121
|
+
)), /* @__PURE__ */ r(
|
|
121
122
|
"text",
|
|
122
123
|
{
|
|
123
124
|
x: t,
|
|
124
125
|
y: n,
|
|
125
126
|
textAnchor: "start",
|
|
126
127
|
dominantBaseline: "central",
|
|
127
|
-
children:
|
|
128
|
+
children: i.map((h, b) => /* @__PURE__ */ r(
|
|
128
129
|
"tspan",
|
|
129
130
|
{
|
|
130
|
-
x: t + parseInt(
|
|
131
|
-
y: n + parseInt(
|
|
131
|
+
x: t + parseInt(K),
|
|
132
|
+
y: n + parseInt(Q) + b * 20,
|
|
132
133
|
style: {
|
|
133
|
-
fontSize:
|
|
134
|
-
fontWeight:
|
|
134
|
+
fontSize: J + "px",
|
|
135
|
+
fontWeight: q,
|
|
135
136
|
fill: "#000"
|
|
136
137
|
},
|
|
137
|
-
children:
|
|
138
|
+
children: ge(h, { totalValue: m }, f)
|
|
138
139
|
}
|
|
139
140
|
))
|
|
140
141
|
}
|
|
141
142
|
);
|
|
142
|
-
},
|
|
143
|
+
}, me = (e, t) => {
|
|
143
144
|
if (t) {
|
|
144
|
-
const n = e.reduce((
|
|
145
|
-
return e.map((
|
|
146
|
-
...
|
|
147
|
-
value:
|
|
145
|
+
const n = e.reduce((i, m) => i + m.value, 0);
|
|
146
|
+
return e.map((i) => ({
|
|
147
|
+
...i,
|
|
148
|
+
value: i.value / n * 100
|
|
148
149
|
}));
|
|
149
150
|
}
|
|
150
151
|
return e;
|
|
151
152
|
};
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
153
|
+
return /* @__PURE__ */ r("div", { style: { height: I }, className: "pie-chart", children: o && o.data && o.data.length > 0 && /* @__PURE__ */ p(L, { children: [
|
|
154
|
+
/* @__PURE__ */ r(
|
|
155
|
+
ue,
|
|
155
156
|
{
|
|
156
|
-
data: se(
|
|
157
|
-
margin:
|
|
158
|
-
startAngle:
|
|
159
|
-
endAngle:
|
|
157
|
+
data: se(me(o.data, _)),
|
|
158
|
+
margin: ce,
|
|
159
|
+
startAngle: z,
|
|
160
|
+
endAngle: O,
|
|
160
161
|
sortByValue: !0,
|
|
161
162
|
innerRadius: 0.7,
|
|
162
|
-
padAngle:
|
|
163
|
+
padAngle: Y,
|
|
163
164
|
cornerRadius: 3,
|
|
164
165
|
colors: (e) => N.getColor(e.id, e.data),
|
|
165
166
|
borderWidth: 1,
|
|
166
167
|
borderColor: { from: "color", modifiers: [["brighter", "2"]] },
|
|
167
|
-
enableArcLabels:
|
|
168
|
-
enableArcLinkLabels:
|
|
168
|
+
enableArcLabels: E,
|
|
169
|
+
enableArcLinkLabels: X,
|
|
169
170
|
arcLabelsTextColor: "#333333",
|
|
170
171
|
arcLinkLabelsSkipAngle: 5,
|
|
171
172
|
arcLabelsSkipAngle: 15,
|
|
172
173
|
sliceLabelsSkipAngle: 20,
|
|
173
|
-
arcLabel: (e) =>
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
arcLabel: (e) => f.formatNumber(
|
|
175
|
+
g.style === "percent" ? e.value / 100 : e.value,
|
|
176
|
+
g
|
|
176
177
|
),
|
|
177
178
|
radialLabelsSkipAngle: 20,
|
|
178
179
|
radialLabelsTextColor: "#333333",
|
|
@@ -187,7 +188,7 @@ const be = ({
|
|
|
187
188
|
"arcs",
|
|
188
189
|
"arcLabels",
|
|
189
190
|
"legends",
|
|
190
|
-
|
|
191
|
+
de
|
|
191
192
|
],
|
|
192
193
|
animate: !0,
|
|
193
194
|
motionStiffness: 90,
|
|
@@ -199,32 +200,32 @@ const be = ({
|
|
|
199
200
|
const t = e.datum.arc.angleDeg / 360 * 100;
|
|
200
201
|
e.datum.data.variables.valuePercent = t, e.datum.data.variables.category = e.datum.id;
|
|
201
202
|
}
|
|
202
|
-
return B &&
|
|
203
|
-
|
|
203
|
+
return B && s && s.trim().length > 0 ? /* @__PURE__ */ r(
|
|
204
|
+
fe,
|
|
204
205
|
{
|
|
205
|
-
intl:
|
|
206
|
-
format:
|
|
206
|
+
intl: f,
|
|
207
|
+
format: g,
|
|
207
208
|
d: e,
|
|
208
|
-
tooltip:
|
|
209
|
-
tooltipEnableMarkdown:
|
|
209
|
+
tooltip: P,
|
|
210
|
+
tooltipEnableMarkdown: U
|
|
210
211
|
}
|
|
211
212
|
) : null;
|
|
212
213
|
}
|
|
213
214
|
},
|
|
214
215
|
o.id
|
|
215
216
|
),
|
|
216
|
-
(
|
|
217
|
+
(a === "top" || a === "bottom") && /* @__PURE__ */ r(
|
|
217
218
|
"div",
|
|
218
219
|
{
|
|
219
|
-
className: `legends container has-standard-12-font-size ${
|
|
220
|
-
style:
|
|
220
|
+
className: `legends container has-standard-12-font-size ${a}`,
|
|
221
|
+
style: a === "top" ? { marginTop: $ && `${T}px` } : a === "bottom" ? { marginBottom: `${D}px` } : {},
|
|
221
222
|
children: /* @__PURE__ */ p("div", { className: "legend-sections", children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
|
|
223
|
+
/* @__PURE__ */ r("div", { className: "title-section", children: W() }),
|
|
224
|
+
/* @__PURE__ */ r(
|
|
225
|
+
be,
|
|
225
226
|
{
|
|
226
227
|
onWrapChange: (e) => {
|
|
227
|
-
|
|
228
|
+
a === "top" && $ ? (ae(x + e / 2 * 40), A(e)) : (ne(k + e / 2 * 25), A(e));
|
|
228
229
|
},
|
|
229
230
|
className: "legends container has-standard-12-font-size items-section",
|
|
230
231
|
children: F()
|
|
@@ -233,19 +234,19 @@ const be = ({
|
|
|
233
234
|
] })
|
|
234
235
|
}
|
|
235
236
|
),
|
|
236
|
-
(
|
|
237
|
+
(a === "right" || a === "left") && /* @__PURE__ */ p(
|
|
237
238
|
"div",
|
|
238
239
|
{
|
|
239
|
-
className: `legends container has-standard-12-font-size ${
|
|
240
|
-
style:
|
|
240
|
+
className: `legends container has-standard-12-font-size ${a}`,
|
|
241
|
+
style: a === "right" ? oe : le,
|
|
241
242
|
children: [
|
|
242
|
-
|
|
243
|
+
W(),
|
|
243
244
|
F()
|
|
244
245
|
]
|
|
245
246
|
}
|
|
246
247
|
)
|
|
247
248
|
] }) });
|
|
248
|
-
},
|
|
249
|
+
}, Ie = pe(xe);
|
|
249
250
|
export {
|
|
250
|
-
|
|
251
|
+
Ie as default
|
|
251
252
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import K, { useState as
|
|
3
|
-
import { Container as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import K, { useState as Y, useEffect as Q } from "react";
|
|
3
|
+
import { Container as j, Loader as X, Grid as B, GridRow as Z } from "semantic-ui-react";
|
|
4
4
|
import $ from "../connected-templates/PostIntro.js";
|
|
5
5
|
import { injectIntl as tt } from "react-intl";
|
|
6
|
-
import { getStartDateAndEndDateFromYear as
|
|
6
|
+
import { getStartDateAndEndDateFromYear as R } from "./utils.js";
|
|
7
7
|
import et from "./NoData.js";
|
|
8
8
|
import { useDispatch as ot, useSelector as rt } from "react-redux";
|
|
9
9
|
import { getCustomPosts as nt } from "../reducers/data-api.js";
|
|
10
|
-
import { useParams as
|
|
11
|
-
import { toNumber as
|
|
12
|
-
const lt = (
|
|
13
|
-
const { posts:
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
|
|
10
|
+
import { useParams as at } from "react-router";
|
|
11
|
+
import { toNumber as st, toBoolean as it } from "../../utils/data.js";
|
|
12
|
+
const lt = (T) => {
|
|
13
|
+
const { posts: u, numberOfColumns: E, sortFirstBy: c, countryCategory: l, postWidth: h, postHeight: D } = T, f = [];
|
|
14
|
+
if (l && c && c !== "none") {
|
|
15
|
+
const m = u.filter((y) => y[l].includes(Number(c))), N = u.filter((y) => !y[l].includes(Number(c)));
|
|
16
|
+
f.push(...m), f.push(...N);
|
|
17
17
|
} else
|
|
18
|
-
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
f.push(...u);
|
|
19
|
+
return /* @__PURE__ */ i(B, { className: "filtered-posts", columns: E, children: /* @__PURE__ */ i(Z, { children: f.map((m) => /* @__PURE__ */ i(B.Column, { children: /* @__PURE__ */ i("div", { className: "filtered-posts-column", style: { width: h, height: D, overflow: "hidden" }, children: /* @__PURE__ */ i(
|
|
20
20
|
$,
|
|
21
21
|
{
|
|
22
22
|
style: {
|
|
@@ -26,139 +26,141 @@ const lt = (b) => {
|
|
|
26
26
|
margin: 0,
|
|
27
27
|
padding: 0
|
|
28
28
|
},
|
|
29
|
-
as:
|
|
29
|
+
as: j,
|
|
30
30
|
fluid: !0,
|
|
31
|
-
post:
|
|
31
|
+
post: m
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
) }) },
|
|
35
|
-
}, ut = (
|
|
33
|
+
m.id
|
|
34
|
+
) }) }, m.id)) }) });
|
|
35
|
+
}, ut = (T) => {
|
|
36
36
|
const {
|
|
37
|
-
"data-group":
|
|
38
|
-
"data-number-of-columns":
|
|
39
|
-
"data-type":
|
|
40
|
-
"data-taxonomy":
|
|
41
|
-
"data-categories":
|
|
42
|
-
"data-height":
|
|
43
|
-
"data-post-width":
|
|
44
|
-
"data-post-height":
|
|
45
|
-
"data-number-of-items-per-page":
|
|
46
|
-
"data-enable-sorting":
|
|
47
|
-
"data-sort-first-by":
|
|
48
|
-
"data-sorting-taxonomy":
|
|
37
|
+
"data-group": u,
|
|
38
|
+
"data-number-of-columns": E,
|
|
39
|
+
"data-type": c,
|
|
40
|
+
"data-taxonomy": l,
|
|
41
|
+
"data-categories": h,
|
|
42
|
+
"data-height": D,
|
|
43
|
+
"data-post-width": f,
|
|
44
|
+
"data-post-height": m,
|
|
45
|
+
"data-number-of-items-per-page": N,
|
|
46
|
+
"data-enable-sorting": y,
|
|
47
|
+
"data-sort-first-by": v,
|
|
48
|
+
"data-sorting-taxonomy": w,
|
|
49
49
|
editing: z
|
|
50
|
-
} =
|
|
50
|
+
} = T, M = ot(), { locale: H } = at(), [A, b] = Y(!1), I = rt((t) => t).getIn(["data", "posts", u]), [P, x] = Y([]), O = it(y) && v !== "none" ? st(v) : null, g = I ?? {
|
|
51
51
|
yearFilter: null,
|
|
52
52
|
categoryFilter: null,
|
|
53
53
|
countryFilter: null,
|
|
54
54
|
page: 1,
|
|
55
55
|
countryTaxonomy: null,
|
|
56
56
|
categoryTaxonomy: null
|
|
57
|
-
},
|
|
57
|
+
}, F = (t) => {
|
|
58
58
|
if (t == null)
|
|
59
59
|
return { values: [], isExplicitNone: !1 };
|
|
60
|
-
const e = Array.isArray(t) ? t : [t],
|
|
60
|
+
const e = Array.isArray(t) ? t : [t], a = e.some(
|
|
61
61
|
(o) => Number(o) === Number.MIN_SAFE_INTEGER
|
|
62
62
|
);
|
|
63
63
|
return {
|
|
64
64
|
values: e.map((o) => Number(o)).filter((o) => Number.isFinite(o) && o !== Number.MIN_SAFE_INTEGER),
|
|
65
|
-
isExplicitNone:
|
|
65
|
+
isExplicitNone: a
|
|
66
66
|
};
|
|
67
|
-
},
|
|
67
|
+
}, W = (t) => {
|
|
68
68
|
if (!t || t.length === 0)
|
|
69
69
|
return null;
|
|
70
|
-
const e = Array.from(new Set(t)).sort((
|
|
70
|
+
const e = Array.from(new Set(t)).sort((S, C) => S - C);
|
|
71
71
|
if (e.length === 0)
|
|
72
72
|
return null;
|
|
73
|
-
const
|
|
73
|
+
const a = e[0], r = e[e.length - 1], o = R(a), n = R(r);
|
|
74
74
|
return !(o != null && o.startDate) || !(n != null && n.endDate) ? null : {
|
|
75
75
|
startDate: o.startDate,
|
|
76
76
|
endDate: n.endDate
|
|
77
77
|
};
|
|
78
|
-
},
|
|
79
|
-
const t =
|
|
78
|
+
}, J = () => {
|
|
79
|
+
const t = F(g.yearFilter), e = t.isExplicitNone ? null : W(t.values), a = g.countryFilter ?? null, r = g.categoryFilter ?? null, o = g.categoryTaxonomy || (l && l !== "none" ? l : null), n = g.countryTaxonomy || null;
|
|
80
80
|
return {
|
|
81
81
|
before: (e == null ? void 0 : e.endDate) || null,
|
|
82
82
|
after: (e == null ? void 0 : e.startDate) || null,
|
|
83
83
|
categoryFilter: r,
|
|
84
84
|
categoryTaxonomy: o,
|
|
85
|
-
countryFilter:
|
|
85
|
+
countryFilter: a,
|
|
86
86
|
countryTaxonomy: n
|
|
87
87
|
};
|
|
88
|
-
},
|
|
88
|
+
}, _ = (t) => z ? t : decodeURIComponent(t), L = (t) => {
|
|
89
89
|
try {
|
|
90
|
-
return JSON.parse(
|
|
90
|
+
return JSON.parse(_(t));
|
|
91
91
|
} catch (e) {
|
|
92
|
-
return console.warn("JSON parsing failed for value:", t, "- treating as plain string. Error:", e),
|
|
92
|
+
return console.warn("JSON parsing failed for value:", t, "- treating as plain string. Error:", e), _(t);
|
|
93
93
|
}
|
|
94
|
-
},
|
|
95
|
-
const t =
|
|
94
|
+
}, q = () => {
|
|
95
|
+
const t = L(h);
|
|
96
96
|
return t ? typeof t == "string" ? t.split(",").map(Number) : typeof t == "number" ? [t] : t : [];
|
|
97
|
-
},
|
|
98
|
-
if (
|
|
97
|
+
}, U = (t, e, a) => {
|
|
98
|
+
if (a) return null;
|
|
99
99
|
if (t.length === 0) return e.length > 0 ? e : null;
|
|
100
100
|
if (e.length === 0) return t;
|
|
101
101
|
const r = new Set(t), o = e.filter((n) => r.has(n));
|
|
102
102
|
return o.length > 0 ? o : null;
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
const t =
|
|
103
|
+
}, k = async () => {
|
|
104
|
+
b(!0);
|
|
105
|
+
const t = J(), e = F(q()).values, a = F(t.categoryFilter), r = U(
|
|
106
106
|
e,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
), o =
|
|
110
|
-
if (
|
|
111
|
-
|
|
107
|
+
a.values,
|
|
108
|
+
a.isExplicitNone
|
|
109
|
+
), o = F(t.countryFilter);
|
|
110
|
+
if (a.isExplicitNone) {
|
|
111
|
+
x([]), b(!1);
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
if (o.isExplicitNone) {
|
|
115
|
-
|
|
115
|
+
x([]), b(!1);
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
const n = /* @__PURE__ */ new Map();
|
|
119
119
|
t.categoryTaxonomy && r && r.length > 0 && n.set(t.categoryTaxonomy, r), t.countryTaxonomy && o.values.length > 0 && n.set(t.countryTaxonomy, o.values);
|
|
120
|
-
const
|
|
120
|
+
const S = r ? r.join(",") : void 0, C = {
|
|
121
121
|
after: t.after,
|
|
122
122
|
before: t.before,
|
|
123
|
-
perPage: Number(
|
|
123
|
+
perPage: Number(N || 10),
|
|
124
124
|
page: g.page || 1,
|
|
125
|
-
locale:
|
|
126
|
-
postType:
|
|
125
|
+
locale: H || "en",
|
|
126
|
+
postType: c,
|
|
127
127
|
taxonomy: t.categoryTaxonomy || void 0,
|
|
128
|
-
category:
|
|
128
|
+
category: S || void 0,
|
|
129
129
|
taxonomyFilters: n,
|
|
130
130
|
ordering: "date",
|
|
131
131
|
orderingDirection: "desc"
|
|
132
132
|
};
|
|
133
|
-
await nt(
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
await nt(C).then((s) => {
|
|
134
|
+
if (s) {
|
|
135
|
+
let p = null, d = null;
|
|
136
|
+
if (s && typeof s == "object" && "data" in s ? (p = s.data, d = s.meta) : (Array.isArray(s), p = s), x(Array.isArray(p) ? p : []), d) {
|
|
137
|
+
const G = d["x-wp-totalpages"] ? d["x-wp-totalpages"] : 1, V = d["x-wp-total"] ? d["x-wp-total"] : 0;
|
|
138
|
+
G && V && M({
|
|
139
|
+
type: "SET_POSTS_PAGINATION",
|
|
140
|
+
group: u,
|
|
141
|
+
totalPages: Number(G),
|
|
142
|
+
totalItems: Number(V)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
} else
|
|
146
|
+
x([]);
|
|
145
147
|
}).finally(() => {
|
|
146
|
-
|
|
148
|
+
b(!1);
|
|
147
149
|
});
|
|
148
150
|
};
|
|
149
151
|
return Q(() => {
|
|
150
|
-
(async () => await
|
|
151
|
-
}, [
|
|
152
|
+
(async () => await k())();
|
|
153
|
+
}, [I, c, l, N, h, O, w]), /* @__PURE__ */ i(j, { fluid: !0, children: A ? /* @__PURE__ */ i(X, { active: !0, inline: "centered" }) : !A && P && P.length > 0 ? /* @__PURE__ */ i(
|
|
152
154
|
lt,
|
|
153
155
|
{
|
|
154
|
-
posts:
|
|
155
|
-
postWidth: Number(
|
|
156
|
-
postHeight: Number(
|
|
157
|
-
numberOfColumns: Number(
|
|
158
|
-
sortFirstBy:
|
|
159
|
-
countryCategory:
|
|
156
|
+
posts: P,
|
|
157
|
+
postWidth: Number(f),
|
|
158
|
+
postHeight: Number(m),
|
|
159
|
+
numberOfColumns: Number(E),
|
|
160
|
+
sortFirstBy: O,
|
|
161
|
+
countryCategory: w
|
|
160
162
|
}
|
|
161
|
-
) : /* @__PURE__ */
|
|
163
|
+
) : /* @__PURE__ */ i(et, { noDataMsg: "No posts found", group: u }) });
|
|
162
164
|
}, Tt = tt(K.memo(ut));
|
|
163
165
|
export {
|
|
164
166
|
Tt as default
|