@devgateway/dvz-ui-react 1.9.10 → 1.9.12
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/map/index.js +2 -2
- package/dist/cjs/embeddable/map/map.js +4 -4
- package/dist/cjs/embeddable/map/mapHelpers.js +1 -1
- package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/embeddable/map/index.js +65 -65
- package/dist/esm/embeddable/map/map.js +436 -453
- package/dist/esm/embeddable/map/mapHelpers.js +88 -104
- package/dist/esm/embeddable/tabbedposts/index.js +77 -77
- package/dist/esm/styles.css +1 -1
- package/dist/types/embeddable/map/mapHelpers.d.ts +0 -2
- package/package.json +2 -2
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
import * as L from "topojson-client";
|
|
2
2
|
import x from "geostats";
|
|
3
3
|
import y from "../../utils/deviceType.js";
|
|
4
|
-
const
|
|
5
|
-
mobile: 4,
|
|
6
|
-
tablet: 4,
|
|
7
|
-
midTablet: 2,
|
|
8
|
-
laptop: 2,
|
|
9
|
-
desktop: 2,
|
|
10
|
-
wide: 2
|
|
11
|
-
}, I = {
|
|
4
|
+
const A = "_Color_", I = "location", j = "showAll", w = "ifUnitHasData", C = 10, _ = {
|
|
12
5
|
mobile: 330,
|
|
13
6
|
tablet: 250,
|
|
14
7
|
midTablet: 250,
|
|
15
8
|
laptop: 200,
|
|
16
9
|
desktop: 100,
|
|
17
10
|
wide: 100
|
|
18
|
-
},
|
|
19
|
-
mobile: 250,
|
|
20
|
-
tablet: 250,
|
|
21
|
-
midTablet: 250,
|
|
22
|
-
laptop: 0,
|
|
23
|
-
desktop: 0,
|
|
24
|
-
wide: 0
|
|
25
|
-
}, C = {
|
|
11
|
+
}, O = {
|
|
26
12
|
greens: [
|
|
27
13
|
"#ccffdd",
|
|
28
14
|
"#b3ffcc",
|
|
@@ -96,148 +82,146 @@ const w = "_Color_", M = "location", k = "showAll", A = "ifUnitHasData", j = 10,
|
|
|
96
82
|
"#0055ff"
|
|
97
83
|
]
|
|
98
84
|
};
|
|
99
|
-
function v(e,
|
|
100
|
-
var
|
|
101
|
-
if (!(e != null && e.length)) return
|
|
102
|
-
const
|
|
103
|
-
if (!
|
|
104
|
-
const a = c &&
|
|
105
|
-
return (a == null ? void 0 : a.trim()) ||
|
|
85
|
+
function v(e, t, l) {
|
|
86
|
+
var r;
|
|
87
|
+
if (!(e != null && e.length)) return t;
|
|
88
|
+
const f = ((r = e[0]) == null ? void 0 : r.items) ?? [], n = (i) => (i == null ? void 0 : i.trim().toLowerCase()) ?? "", s = n(t), c = n(l).toUpperCase(), o = f.find((i) => n(i.value) === s || n(i.code) === s) ?? null;
|
|
89
|
+
if (!o) return t;
|
|
90
|
+
const a = c && o.labels && o.labels[c] ? o.labels[c] : o.value;
|
|
91
|
+
return (a == null ? void 0 : a.trim()) || o.value.trim();
|
|
106
92
|
}
|
|
107
93
|
function D(e) {
|
|
108
|
-
let
|
|
109
|
-
return
|
|
94
|
+
let t = e;
|
|
95
|
+
return t || (t = ["mobile", "tablet", "midTablet"].includes(y())), t ? "active zoom-enabled" : "active";
|
|
110
96
|
}
|
|
111
|
-
function
|
|
112
|
-
const { autoGenerateBreaks: l, numberOfBreaks:
|
|
97
|
+
function M(e, t) {
|
|
98
|
+
const { autoGenerateBreaks: l, numberOfBreaks: f, colorScheme: n } = t, s = [];
|
|
113
99
|
if (l && e && e.length > 0) {
|
|
114
|
-
const c = e.filter((
|
|
115
|
-
c.forEach((
|
|
116
|
-
if (
|
|
117
|
-
const i =
|
|
118
|
-
|
|
100
|
+
const c = e.filter((r) => r.properties && r.properties.value != null).map((r) => r.properties.value.toFixed(2)), o = [];
|
|
101
|
+
c.forEach((r) => {
|
|
102
|
+
if (r > 0) {
|
|
103
|
+
const i = r * 0.99, u = r * 1.01;
|
|
104
|
+
o.indexOf(i) === -1 && o.push(i), o.indexOf(u) === -1 && o.push(u);
|
|
119
105
|
}
|
|
120
106
|
});
|
|
121
|
-
const a =
|
|
122
|
-
if (
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const i =
|
|
126
|
-
return
|
|
107
|
+
const a = O[n];
|
|
108
|
+
if (o.length > 0) {
|
|
109
|
+
const r = new x(o);
|
|
110
|
+
r.setPrecision(2);
|
|
111
|
+
const i = o.length > 1 ? o.length - 1 : o.length;
|
|
112
|
+
return r.getJenks(Math.min(f, i)), r.ranges.forEach((u, p) => {
|
|
127
113
|
const b = {};
|
|
128
|
-
b.min = parseFloat(
|
|
114
|
+
b.min = parseFloat(u.substr(0, u.indexOf("-") - 1)) + (p > 0 ? 0.01 : 0), b.max = parseFloat(u.substr(u.indexOf("-") + 2, u.length)), b.color = a[p], s.push(b);
|
|
129
115
|
}), s;
|
|
130
116
|
}
|
|
131
117
|
}
|
|
132
118
|
return s;
|
|
133
119
|
}
|
|
134
|
-
function
|
|
135
|
-
const { mapNoDataColor:
|
|
120
|
+
function T(e, t, l) {
|
|
121
|
+
const { mapNoDataColor: f, mainLayerId: n, enabledLayers: s, selectedMeasure: c } = l;
|
|
136
122
|
if (e.properties && e.properties.variables && c && e.properties.value != null) {
|
|
137
|
-
const a =
|
|
138
|
-
if (
|
|
123
|
+
const a = A + c, r = e.properties.variables[a.trim()];
|
|
124
|
+
if (r) return r;
|
|
139
125
|
}
|
|
140
126
|
if (e.properties.value != null && (n && e.properties.layerId === n || !n)) {
|
|
141
|
-
const a =
|
|
142
|
-
return a && a.color ? a.color :
|
|
127
|
+
const a = t.find((r) => r.min != null && r.max != null ? e.properties.value >= r.min && e.properties.value <= r.max : r.min != null ? e.properties.value >= r.min : r.max != null ? e.properties.value <= r.max : !1);
|
|
128
|
+
return a && a.color ? a.color : f;
|
|
143
129
|
}
|
|
144
|
-
const
|
|
145
|
-
return
|
|
130
|
+
const o = s.filter((a) => a.id === e.properties.layerId)[0];
|
|
131
|
+
return o && o.bgColor && o.bgColor != "undefined" ? o.bgColor : f;
|
|
146
132
|
}
|
|
147
|
-
function
|
|
148
|
-
if (e.properties[
|
|
149
|
-
const
|
|
150
|
-
return
|
|
133
|
+
function E(e, t) {
|
|
134
|
+
if (e.properties[t]) {
|
|
135
|
+
const f = e.properties[t].length;
|
|
136
|
+
return f < 10 ? 80 : f * 8;
|
|
151
137
|
}
|
|
152
138
|
return 0;
|
|
153
139
|
}
|
|
154
|
-
function
|
|
140
|
+
function H(e) {
|
|
155
141
|
return e ? 30 : 25;
|
|
156
142
|
}
|
|
157
|
-
function
|
|
143
|
+
function k(e, t) {
|
|
158
144
|
if (e && e.objects) {
|
|
159
145
|
const l = Object.keys(e.objects);
|
|
160
|
-
for (const
|
|
161
|
-
const n = l[
|
|
146
|
+
for (const f in l) {
|
|
147
|
+
const n = l[f];
|
|
162
148
|
if (e.objects[n].type == "GeometryCollection")
|
|
163
149
|
return n;
|
|
164
150
|
}
|
|
165
151
|
}
|
|
166
|
-
return
|
|
152
|
+
return t;
|
|
167
153
|
}
|
|
168
|
-
function
|
|
169
|
-
const l =
|
|
154
|
+
function S(e, t) {
|
|
155
|
+
const l = k(e, t);
|
|
170
156
|
return e && e.objects && e.objects[l] ? L.feature(e, e.objects[l]).features : e && e.features ? e.features : [];
|
|
171
157
|
}
|
|
172
|
-
function
|
|
158
|
+
function R(e, t, l) {
|
|
173
159
|
if (e.properties.displayLayerLabels && e.properties.layerLocale) {
|
|
174
|
-
const
|
|
160
|
+
const f = e.properties.layerMappingField || t, n = e.properties[f];
|
|
175
161
|
return v(l, n, e.properties.layerLocale);
|
|
176
162
|
}
|
|
177
|
-
return e.properties[
|
|
163
|
+
return e.properties[t];
|
|
178
164
|
}
|
|
179
|
-
function
|
|
165
|
+
function U(e, t, l, f) {
|
|
180
166
|
const {
|
|
181
167
|
mapLabelField: n,
|
|
182
168
|
mapLabelShowValue: s,
|
|
183
169
|
intl: c,
|
|
184
|
-
valueFormat:
|
|
170
|
+
valueFormat: o,
|
|
185
171
|
showNoDataLabel: a,
|
|
186
|
-
showAdminUnitLabel:
|
|
172
|
+
showAdminUnitLabel: r,
|
|
187
173
|
noDataText: i,
|
|
188
|
-
selectedMeasure:
|
|
189
|
-
} =
|
|
190
|
-
let
|
|
191
|
-
if (
|
|
192
|
-
const b = e.properties.displayLayerLabels && e.properties.layerMappingField ? e.properties.layerMappingField : n,
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
174
|
+
selectedMeasure: u
|
|
175
|
+
} = t;
|
|
176
|
+
let p = "";
|
|
177
|
+
if (r == j || r == w && e.properties.hasDataRow || e.properties.displayLayerLabels) {
|
|
178
|
+
const b = e.properties.displayLayerLabels && e.properties.layerMappingField ? e.properties.layerMappingField : n, g = e.properties[b], d = e.properties.layerLocale || (c == null ? void 0 : c.locale);
|
|
179
|
+
p = v(l, g, d);
|
|
180
|
+
const h = e.properties.abbrev;
|
|
181
|
+
if (p && p.length > C && h && (p = h), s)
|
|
196
182
|
if (e.properties.value != null) {
|
|
197
183
|
const m = e.properties.variables || {};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
{ value: e.properties.value, measure:
|
|
184
|
+
p += "<br><span class='map-label-value'>" + f(
|
|
185
|
+
o,
|
|
186
|
+
{ value: e.properties.value, measure: u, ...m },
|
|
201
187
|
c
|
|
202
188
|
) + "</span>";
|
|
203
|
-
} else a == !0 && e.properties.value == null && e.properties.hasDataRow && (
|
|
189
|
+
} else a == !0 && e.properties.value == null && e.properties.hasDataRow && (p += "<br><span class='map-label-value'>" + i + "</span>");
|
|
204
190
|
}
|
|
205
|
-
return
|
|
191
|
+
return p;
|
|
206
192
|
}
|
|
207
|
-
function
|
|
208
|
-
const
|
|
193
|
+
function W(e) {
|
|
194
|
+
const t = {};
|
|
209
195
|
return e && Object.keys(e).forEach((l) => {
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
}),
|
|
196
|
+
const f = e[l];
|
|
197
|
+
f && (t[l] = Array.isArray(f) ? f.join(" ,") : f);
|
|
198
|
+
}), t;
|
|
213
199
|
}
|
|
214
|
-
function
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
const n =
|
|
200
|
+
function z(e, t, l) {
|
|
201
|
+
const f = e ? e.value : null;
|
|
202
|
+
if (f != null) {
|
|
203
|
+
const n = t.find((s) => s.min != null && s.max != null ? f >= s.min && f <= s.max : s.min != null ? f >= s.min : s.max != null ? f <= s.max : !1);
|
|
218
204
|
return n && n.color ? n.color : l;
|
|
219
205
|
}
|
|
220
206
|
return l;
|
|
221
207
|
}
|
|
222
208
|
export {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
209
|
+
A as COLOR_VARIABLE,
|
|
210
|
+
I as LOCATION,
|
|
211
|
+
C as MAX_LABEL_LEN,
|
|
212
|
+
j as SHOW_ALL,
|
|
213
|
+
w as SHOW_IF_HAS_DATA,
|
|
228
214
|
D as classColor,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
R as getLabelBoxHeight,
|
|
240
|
-
S as getLabelBoxWidth,
|
|
215
|
+
U as createLabel,
|
|
216
|
+
_ as deviceMapHeight,
|
|
217
|
+
S as extractFeatures,
|
|
218
|
+
T as fillColor,
|
|
219
|
+
M as generateBreaks,
|
|
220
|
+
k as getCollectionField,
|
|
221
|
+
W as getFilters,
|
|
222
|
+
z as getHighlightedLocationColor,
|
|
223
|
+
H as getLabelBoxHeight,
|
|
224
|
+
E as getLabelBoxWidth,
|
|
241
225
|
v as getTranslatedItemLabel,
|
|
242
|
-
|
|
226
|
+
R as getTranslatedLocationName
|
|
243
227
|
};
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Container as
|
|
4
|
-
import { PostProvider as
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import I, { useState as w, useRef as G, useEffect as x } from "react";
|
|
3
|
+
import { Container as b, Accordion as y, Icon as V, Menu as T, Grid as v, Label as M, Button as W } from "semantic-ui-react";
|
|
4
|
+
import { PostProvider as q, PostConsumer as _, MediaProvider as P, MediaConsumer as A, PostIcon as $, PostLabel as k } from "@devgateway/wp-react-lib";
|
|
5
5
|
import { injectIntl as E } from "react-intl";
|
|
6
6
|
import { connect as O } from "react-redux";
|
|
7
|
-
import
|
|
7
|
+
import L from "../connected-templates/PostIntro.js";
|
|
8
8
|
import { useWindowDimensionsAndDevice as U } from "../../lib/hooks/window-dimensions.js";
|
|
9
|
-
const Y = ({ posts: t, activeItem:
|
|
9
|
+
const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.map((l) => /* @__PURE__ */ e(
|
|
10
10
|
T.Item,
|
|
11
11
|
{
|
|
12
12
|
onClick: () => i(l.slug),
|
|
13
|
-
className: l.slug ===
|
|
14
|
-
children: n ? /* @__PURE__ */ e(
|
|
13
|
+
className: l.slug === o ? "active" : "",
|
|
14
|
+
children: n ? /* @__PURE__ */ e(k, { post: l }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: l.title.rendered } }) })
|
|
15
15
|
},
|
|
16
16
|
l.id
|
|
17
17
|
)) : null, J = ({
|
|
18
18
|
posts: t,
|
|
19
|
-
activeItem:
|
|
19
|
+
activeItem: o,
|
|
20
20
|
setActive: i,
|
|
21
21
|
showIcons: n,
|
|
22
22
|
showLabels: l
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
return t ? t.map((
|
|
24
|
+
const r = t.length;
|
|
25
|
+
return t ? t.map((a) => {
|
|
26
26
|
var d, m;
|
|
27
|
-
return (d =
|
|
28
|
-
|
|
27
|
+
return (d = a._embedded) != null && d["wp:featuredmedia"] && a._embedded["wp:featuredmedia"][0].source_url, /* @__PURE__ */ e(
|
|
28
|
+
v.Column,
|
|
29
29
|
{
|
|
30
|
-
className: (
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
-
|
|
30
|
+
className: (a.slug === o ? "active" : "") + (n ? " has-icon" : ""),
|
|
31
|
+
children: /* @__PURE__ */ f(
|
|
32
|
+
W,
|
|
33
33
|
{
|
|
34
|
-
onClick: () => i(
|
|
35
|
-
className: `nav ${
|
|
34
|
+
onClick: () => i(a.slug),
|
|
35
|
+
className: `nav ${r === 1 ? "one" : ""}`,
|
|
36
36
|
children: [
|
|
37
37
|
n && /* @__PURE__ */ e(
|
|
38
38
|
P,
|
|
39
39
|
{
|
|
40
|
-
id: (m =
|
|
41
|
-
children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
40
|
+
id: (m = a.meta_fields) != null && m.icon ? a.meta_fields.icon[0] : null,
|
|
41
|
+
children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e($, { className: "icon" }) })
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
|
-
l ? /* @__PURE__ */ e(
|
|
44
|
+
l ? /* @__PURE__ */ e(k, { post: a }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
|
45
45
|
"span",
|
|
46
46
|
{
|
|
47
|
-
dangerouslySetInnerHTML: { __html:
|
|
47
|
+
dangerouslySetInnerHTML: { __html: a.title.rendered }
|
|
48
48
|
}
|
|
49
49
|
) })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
)
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
a.id
|
|
55
55
|
);
|
|
56
56
|
}) : null;
|
|
57
|
-
},
|
|
57
|
+
}, S = ({ posts: t, activeItem: o }) => (x(() => {
|
|
58
58
|
const i = document.querySelector(".ui.container.content-tab");
|
|
59
59
|
i && (i.scrollTop = 0);
|
|
60
|
-
}, [
|
|
60
|
+
}, [o]), t ? t.map((i) => {
|
|
61
61
|
let n = {};
|
|
62
|
-
return i.slug !==
|
|
62
|
+
return i.slug !== o ? n = {
|
|
63
63
|
position: "absolute",
|
|
64
64
|
left: "-3000px",
|
|
65
65
|
width: "auto",
|
|
@@ -70,35 +70,35 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
70
70
|
visibility: "visible",
|
|
71
71
|
position: "relative",
|
|
72
72
|
width: "auto"
|
|
73
|
-
}, /* @__PURE__ */ e(
|
|
74
|
-
}) : null), K = ({ posts: t, activeItem:
|
|
75
|
-
const [n, l] =
|
|
76
|
-
t.findIndex((s) => s.slug ===
|
|
77
|
-
), [
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
const s =
|
|
73
|
+
}, /* @__PURE__ */ e(L, { as: b, fluid: !0, post: i, style: n }, i.slug);
|
|
74
|
+
}) : null), K = ({ posts: t, activeItem: o, setActive: i }) => {
|
|
75
|
+
const [n, l] = w(
|
|
76
|
+
t.findIndex((s) => s.slug === o)
|
|
77
|
+
), [r, a] = w(null), d = G(null);
|
|
78
|
+
x(() => {
|
|
79
|
+
if (r) {
|
|
80
|
+
const s = r.getBoundingClientRect().top + window.scrollY;
|
|
81
81
|
window.scrollTo({
|
|
82
82
|
top: s,
|
|
83
83
|
behavior: "smooth"
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
}, [
|
|
86
|
+
}, [r]);
|
|
87
87
|
const m = (s, u) => {
|
|
88
|
-
const { index:
|
|
89
|
-
l(h), i(t[
|
|
88
|
+
const { index: c } = u, h = n === c ? -1 : c;
|
|
89
|
+
l(h), i(t[c].slug), h !== -1 && a(s.currentTarget);
|
|
90
90
|
};
|
|
91
|
-
return /* @__PURE__ */ e(
|
|
91
|
+
return /* @__PURE__ */ e(y, { fluid: !0, styled: !0, children: t.map((s, u) => {
|
|
92
92
|
var h;
|
|
93
|
-
const
|
|
94
|
-
return /* @__PURE__ */
|
|
93
|
+
const c = (h = s.meta_fields) != null && h.icon ? s.meta_fields.icon[0] : null;
|
|
94
|
+
return /* @__PURE__ */ f(I.Fragment, { children: [
|
|
95
95
|
/* @__PURE__ */ e(
|
|
96
|
-
|
|
96
|
+
y.Title,
|
|
97
97
|
{
|
|
98
98
|
active: n === u,
|
|
99
99
|
index: u,
|
|
100
100
|
onClick: m,
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ f(
|
|
102
102
|
"div",
|
|
103
103
|
{
|
|
104
104
|
style: {
|
|
@@ -108,94 +108,94 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
108
108
|
width: "100%"
|
|
109
109
|
},
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
|
|
111
|
+
/* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
112
|
+
c && /* @__PURE__ */ e(P, { id: c, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e($, { className: "icon" }) }) }),
|
|
113
113
|
/* @__PURE__ */ e(
|
|
114
114
|
"span",
|
|
115
115
|
{
|
|
116
116
|
dangerouslySetInnerHTML: { __html: s.title.rendered },
|
|
117
|
-
style: { marginLeft:
|
|
117
|
+
style: { marginLeft: c ? "10px" : "0" }
|
|
118
118
|
}
|
|
119
119
|
)
|
|
120
120
|
] }),
|
|
121
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(V, { name: "chevron down" })
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
124
|
)
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
127
|
/* @__PURE__ */ e(
|
|
128
|
-
|
|
128
|
+
y.Content,
|
|
129
129
|
{
|
|
130
130
|
className: "accordion-post-content",
|
|
131
131
|
active: n === u,
|
|
132
|
-
children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(
|
|
132
|
+
children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(L, { post: s, as: b, fluid: !0 }) })
|
|
133
133
|
}
|
|
134
134
|
)
|
|
135
135
|
] }, s.id);
|
|
136
136
|
}) });
|
|
137
|
-
}, Q = ({ posts: t, showLabels:
|
|
138
|
-
const [n, l] =
|
|
139
|
-
return
|
|
137
|
+
}, Q = ({ posts: t, showLabels: o, height: i }) => {
|
|
138
|
+
const [n, l] = w(t ? t[0].slug : null);
|
|
139
|
+
return x(() => {
|
|
140
140
|
setTimeout(() => {
|
|
141
141
|
if (window.location.hash) {
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const r = window.location.hash.substr(1), a = document.getElementById(r);
|
|
143
|
+
a && t.map((d) => d.slug).indexOf(r) > -1 && (l(r), a.scrollIntoView({ behavior: "auto", block: "start" }));
|
|
144
144
|
}
|
|
145
145
|
}, 0);
|
|
146
|
-
}, [t]), /* @__PURE__ */
|
|
147
|
-
t.map((
|
|
148
|
-
/* @__PURE__ */ e(T, { className: "tabbed posts", text: !0, children: /* @__PURE__ */ e(Y, { showLabels:
|
|
149
|
-
/* @__PURE__ */ e(
|
|
146
|
+
}, [t]), /* @__PURE__ */ f(I.Fragment, { children: [
|
|
147
|
+
t.map((r) => /* @__PURE__ */ e("anchor", { id: r.slug }, r.slug)),
|
|
148
|
+
/* @__PURE__ */ e(T, { className: "tabbed posts", text: !0, children: /* @__PURE__ */ e(Y, { showLabels: o, posts: t, setActive: l, activeItem: n }) }),
|
|
149
|
+
/* @__PURE__ */ e(b, { className: "content-tab", style: { height: `${i}px` }, children: /* @__PURE__ */ e(S, { posts: t, activeItem: n }) })
|
|
150
150
|
] });
|
|
151
|
-
}, X = ({ posts: t, showLabels:
|
|
152
|
-
const [l,
|
|
153
|
-
return /* @__PURE__ */ e(
|
|
154
|
-
/* @__PURE__ */ e(J, { showIcons: i, showLabels:
|
|
155
|
-
/* @__PURE__ */ e(
|
|
151
|
+
}, X = ({ posts: t, showLabels: o, showIcons: i, height: n }) => {
|
|
152
|
+
const [l, r] = w(t ? t[0].slug : null);
|
|
153
|
+
return /* @__PURE__ */ e(I.Fragment, { children: /* @__PURE__ */ f(v, { stackable: !0, className: "tabbed posts", columns: t.length, style: { height: n + "px" }, children: [
|
|
154
|
+
/* @__PURE__ */ e(J, { showIcons: i, showLabels: o, posts: t, activeItem: l, setActive: r }),
|
|
155
|
+
/* @__PURE__ */ e(v.Row, { style: { height: `${n}px` }, children: /* @__PURE__ */ e(v.Column, { width: 16, className: "content", children: /* @__PURE__ */ e(b, { className: "content-tab", style: { height: `${n}px` }, children: /* @__PURE__ */ e(S, { className: "content-tab", posts: t, activeItem: l }) }) }) })
|
|
156
156
|
] }) });
|
|
157
157
|
}, Z = (t) => {
|
|
158
|
-
var
|
|
158
|
+
var N;
|
|
159
159
|
let {
|
|
160
|
-
"data-type":
|
|
160
|
+
"data-type": o,
|
|
161
161
|
"data-taxonomy": i,
|
|
162
162
|
"data-categories": n,
|
|
163
163
|
"data-items": l,
|
|
164
|
-
"data-theme":
|
|
165
|
-
"data-show-icons":
|
|
164
|
+
"data-theme": r = "light",
|
|
165
|
+
"data-show-icons": a,
|
|
166
166
|
"data-use-scrolls": d,
|
|
167
167
|
"data-show-labels": m,
|
|
168
168
|
"data-height": s,
|
|
169
169
|
"data-preview-mode": u = "Desktop",
|
|
170
|
-
pageModuleProps:
|
|
170
|
+
pageModuleProps: c,
|
|
171
171
|
parent: h,
|
|
172
|
-
editing:
|
|
172
|
+
editing: g,
|
|
173
173
|
unique: j
|
|
174
174
|
} = t;
|
|
175
|
-
|
|
176
|
-
const D = t.intl.locale, R = Array.isArray(n) ? n.join(",") : n,
|
|
177
|
-
return /* @__PURE__ */ e(
|
|
178
|
-
|
|
175
|
+
c != null && c.previewMode && (c != null && c.editing) && (u = c.previewMode, g = c.editing);
|
|
176
|
+
const D = t.intl.locale, R = Array.isArray(n) ? n.join(",") : n, p = d === "true", C = p ? s : void 0, { width: H } = U(), z = H <= 1024, B = u !== "Desktop" && g, F = z && !g;
|
|
177
|
+
return g && !o ? /* @__PURE__ */ e(b, { className: `viz tabbed posts ${g ? "editing" : ""} ${p ? "scrollable" : ""}`, fluid: !0 }) : /* @__PURE__ */ e(b, { className: `viz tabbed posts ${g ? "editing" : ""} ${p ? "scrollable" : ""}`, fluid: !0, children: /* @__PURE__ */ e(
|
|
178
|
+
q,
|
|
179
179
|
{
|
|
180
180
|
locale: D,
|
|
181
|
-
type:
|
|
181
|
+
type: o,
|
|
182
182
|
taxonomy: i,
|
|
183
183
|
categories: R,
|
|
184
184
|
store: `tabbedposts_${h}_${j}`,
|
|
185
185
|
page: 1,
|
|
186
186
|
perPage: l,
|
|
187
|
-
children: /* @__PURE__ */ e(
|
|
188
|
-
} }) :
|
|
187
|
+
children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(_, { children: F || B ? /* @__PURE__ */ e(K, { posts: l, activeItem: (N = l[0]) == null ? void 0 : N.slug, setActive: () => {
|
|
188
|
+
} }) : r === "light" ? /* @__PURE__ */ e(Q, { height: C, showLabels: m === "true" }) : /* @__PURE__ */ e(
|
|
189
189
|
X,
|
|
190
190
|
{
|
|
191
191
|
height: C,
|
|
192
192
|
showLabels: m === "true",
|
|
193
|
-
showIcons:
|
|
193
|
+
showIcons: a === "true"
|
|
194
194
|
}
|
|
195
195
|
) }) })
|
|
196
196
|
}
|
|
197
197
|
) });
|
|
198
|
-
}, ee = (t,
|
|
198
|
+
}, ee = (t, o) => {
|
|
199
199
|
const i = t.getIn([
|
|
200
200
|
"data",
|
|
201
201
|
"pageModuleProps"
|