@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
|
@@ -1,160 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { connect as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Container as m, Segment as p, Dimmer as C, Loader as N } from "semantic-ui-react";
|
|
1
|
+
import { jsx as o, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import D from "react";
|
|
3
|
+
import { connect as y } from "react-redux";
|
|
4
|
+
import { DataContext as w } from "./DataContext.js";
|
|
5
|
+
import { getData as _, setData as I } from "../reducers/data.js";
|
|
6
|
+
import { Container as u, Segment as p, Dimmer as F, Loader as x } from "semantic-ui-react";
|
|
8
7
|
import A from "../../_virtual/debounce.js";
|
|
9
|
-
class
|
|
10
|
-
constructor() {
|
|
11
|
-
super(), this.state = {
|
|
8
|
+
class O extends D.Component {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
super(t), this.state = {
|
|
12
11
|
showLoading: !1
|
|
13
|
-
}, this.checkLoadingTime = this.checkLoadingTime.bind(this), this.
|
|
12
|
+
}, this.checkLoadingTime = this.checkLoadingTime.bind(this), this._debouncedLoad = A((i) => {
|
|
13
|
+
this.setState({ showLoading: !1 }), this.props.onLoadData(i), this.dataLoaded = !0, this._scheduleLoadingCheck();
|
|
14
|
+
}, 400);
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
20
|
-
}), this.setState({ showLoading: !1 }), this.props.onLoadData(e), this.dataLoaded = !0, this.checkLoadingTime = this.checkLoadingTime.bind(this), setTimeout(this.checkLoadingTime, 0);
|
|
21
|
-
}, t);
|
|
22
|
-
this.debounces.push(a(i));
|
|
16
|
+
// Centralised helper so every recursive checkLoadingTime call is tracked
|
|
17
|
+
// and can be cancelled on unmount, preventing setState on unmounted components.
|
|
18
|
+
_scheduleLoadingCheck() {
|
|
19
|
+
clearTimeout(this._loadingCheckTimeout), this._loadingCheckTimeout = setTimeout(this.checkLoadingTime, 100);
|
|
23
20
|
}
|
|
24
21
|
componentDidMount() {
|
|
25
|
-
const { app: t, source: i, store: a, params: e, csv: h, group:
|
|
26
|
-
t === "csv" ? this.props.onSetData({ app: t, csv: h, store: a, params: e, group:
|
|
27
|
-
app: t,
|
|
28
|
-
source: i,
|
|
29
|
-
store: a,
|
|
30
|
-
params: e,
|
|
31
|
-
group: s,
|
|
32
|
-
waitForFilters: n,
|
|
33
|
-
editing: o,
|
|
34
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
35
|
-
}), this.props.onLoadData({ app: t, source: i, store: a, params: e, group: s }), setTimeout(this.checkLoadingTime, 100)) : console.log("⏳ [DataProvider] Waiting for filters before loading data", {
|
|
36
|
-
app: t,
|
|
37
|
-
source: i,
|
|
38
|
-
store: a,
|
|
39
|
-
params: e,
|
|
40
|
-
group: s,
|
|
41
|
-
waitForFilters: n,
|
|
42
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
43
|
-
})), !o && n && (this.fallbackTimeout = setTimeout(() => {
|
|
44
|
-
this.dataLoaded || (console.warn("⚠️ [DataProvider] Fallback loading triggered - filters took too long", {
|
|
45
|
-
app: t,
|
|
46
|
-
source: i,
|
|
47
|
-
store: a,
|
|
48
|
-
params: e,
|
|
49
|
-
group: s,
|
|
50
|
-
dataLoaded: this.dataLoaded,
|
|
51
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
52
|
-
}), this.setState({ showLoading: !1 }), this.props.onLoadData({ app: t, source: i, store: a, params: e, group: s }), setTimeout(this.checkLoadingTime, 100));
|
|
22
|
+
const { app: t, source: i, store: a, params: e, csv: h, group: l, editing: s, waitForFilters: n = !1 } = this.props;
|
|
23
|
+
t === "csv" ? this.props.onSetData({ app: t, csv: h, store: a, params: e, group: l }) : (this.setState({ showLoading: !1 }), (!n || s) && (this.props.onLoadData({ app: t, source: i, store: a, params: e, group: l }), this._scheduleLoadingCheck())), !s && n && (this.fallbackTimeout = setTimeout(() => {
|
|
24
|
+
this.dataLoaded || (this.setState({ showLoading: !1 }), this.props.onLoadData({ app: t, source: i, store: a, params: e, group: l }), this._scheduleLoadingCheck());
|
|
53
25
|
}, 1e3));
|
|
54
26
|
}
|
|
55
27
|
componentWillUnmount() {
|
|
56
|
-
clearTimeout(this.fallbackTimeout), clearTimeout(this.debounceTimeout), this.
|
|
28
|
+
clearTimeout(this.fallbackTimeout), clearTimeout(this.debounceTimeout), clearTimeout(this._loadingCheckTimeout), this._debouncedLoad.cancel();
|
|
57
29
|
}
|
|
58
30
|
componentDidUpdate(t, i, a) {
|
|
59
31
|
const {
|
|
60
32
|
app: e,
|
|
61
33
|
filters: h,
|
|
62
|
-
apply:
|
|
63
|
-
source:
|
|
34
|
+
apply: l,
|
|
35
|
+
source: s,
|
|
64
36
|
store: n,
|
|
65
|
-
params:
|
|
37
|
+
params: d,
|
|
66
38
|
csv: g,
|
|
67
|
-
group:
|
|
68
|
-
autoApply:
|
|
69
|
-
editing:
|
|
70
|
-
lastInitialFilterChange:
|
|
71
|
-
lastUserFilterChange:
|
|
72
|
-
} = this.props,
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
this.dataLoaded = !0, this.setState({ showLoading: !1 }),
|
|
76
|
-
|
|
77
|
-
source: o,
|
|
78
|
-
store: n,
|
|
79
|
-
params: r,
|
|
80
|
-
group: l,
|
|
81
|
-
filters: h,
|
|
82
|
-
debounceDelay: "100ms",
|
|
83
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
84
|
-
}), this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), setTimeout(this.checkLoadingTime, 100);
|
|
85
|
-
}, 100)) : S ? (console.log("🔧 [DataProvider] User filter change detected", {
|
|
86
|
-
currentFilters: h,
|
|
87
|
-
previousFilters: t.filters,
|
|
88
|
-
currentParams: r,
|
|
89
|
-
previousParams: t.params,
|
|
90
|
-
app: e,
|
|
91
|
-
source: o,
|
|
92
|
-
store: n,
|
|
93
|
-
group: l,
|
|
94
|
-
debounceDelay: "400ms",
|
|
95
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
96
|
-
}), this.setState({ showLoading: !1 }), this.debouncedLoadData(400, { app: e, source: o, store: n, params: r, group: l }), setTimeout(this.checkLoadingTime, 100)) : !u && (JSON.stringify(r) !== JSON.stringify(t.params) || e !== t.app || JSON.stringify(o) !== JSON.stringify(t.source)) ? (this.setState({ showLoading: !1 }), this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), setTimeout(this.checkLoadingTime, 100)) : console.log("ℹ️ [DataProvider] Component updated but no filter changes detected", {
|
|
97
|
-
initialChanged: f,
|
|
98
|
-
userChanged: S,
|
|
99
|
-
waitForFilters: this.props.waitForFilters,
|
|
100
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
101
|
-
}))) : D && (console.log("🔄 [DataProvider] Manual reload triggered (apply button)", {
|
|
102
|
-
app: e,
|
|
103
|
-
source: o,
|
|
104
|
-
store: n,
|
|
105
|
-
params: r,
|
|
106
|
-
group: l,
|
|
107
|
-
apply: s,
|
|
108
|
-
previousApply: t.apply,
|
|
109
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
110
|
-
}), this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), this.setState({ showLoading: !1 }), setTimeout(this.checkLoadingTime, 100));
|
|
39
|
+
group: c,
|
|
40
|
+
autoApply: C,
|
|
41
|
+
editing: m,
|
|
42
|
+
lastInitialFilterChange: T,
|
|
43
|
+
lastUserFilterChange: k
|
|
44
|
+
} = this.props, S = T !== t.lastInitialFilterChange, b = k !== t.lastUserFilterChange;
|
|
45
|
+
let f = !1;
|
|
46
|
+
l != null && l != t.apply && (f = !0), C !== !1 ? (h != t.filters || JSON.stringify(d) != JSON.stringify(t.params) || e != t.app || s !== t.source || g != t.csv) && (e === "csv" ? this.props.onSetData({ app: e, csv: g, store: n, params: d, group: c }) : (this.setState({ showLoading: !0 }), m && this.props.onLoadData({ app: e, source: s, store: n, params: d, group: c }), S && this.props.waitForFilters ? (clearTimeout(this.debounceTimeout), clearTimeout(this.fallbackTimeout), this.debounceTimeout = setTimeout(() => {
|
|
47
|
+
this.dataLoaded = !0, this.setState({ showLoading: !1 }), this.props.onLoadData({ app: e, source: s, store: n, params: d, group: c }), this._scheduleLoadingCheck();
|
|
48
|
+
}, 100)) : b ? (this.setState({ showLoading: !1 }), this._debouncedLoad({ app: e, source: s, store: n, params: d, group: c }), this._scheduleLoadingCheck()) : !m && (JSON.stringify(d) !== JSON.stringify(t.params) || e !== t.app || s !== t.source) && (this.setState({ showLoading: !1 }), this.props.onLoadData({ app: e, source: s, store: n, params: d, group: c }), this._scheduleLoadingCheck()))) : f && (this.props.onLoadData({ app: e, source: s, store: n, params: d, group: c }), this.setState({ showLoading: !1 }), this._scheduleLoadingCheck());
|
|
111
49
|
}
|
|
112
50
|
checkLoadingTime() {
|
|
113
|
-
const {
|
|
114
|
-
|
|
51
|
+
const { loading: t, time: i } = this.props, a = Date.now() - i;
|
|
52
|
+
t && i && a > 1e3 ? this.setState({ showLoading: !0 }) : t && (this._loadingCheckTimeout = setTimeout(this.checkLoadingTime, 100));
|
|
115
53
|
}
|
|
116
54
|
render() {
|
|
117
|
-
const { data: t, style: i, loading: a, time: e, error: h, editing:
|
|
118
|
-
if (a && this.state.showLoading && !
|
|
119
|
-
const
|
|
55
|
+
const { data: t, style: i, loading: a, time: e, error: h, editing: l, isSvg: s } = this.props;
|
|
56
|
+
if (a && this.state.showLoading && !l) {
|
|
57
|
+
const n = {
|
|
120
58
|
width: "100%",
|
|
121
59
|
height: "100%",
|
|
122
60
|
background: "transparent",
|
|
123
61
|
verticalAlign: "middle",
|
|
124
62
|
overflow: "hidden"
|
|
125
|
-
},
|
|
63
|
+
}, d = Object.assign({}, i, {
|
|
126
64
|
height: "90%",
|
|
127
65
|
background: "transparent",
|
|
128
66
|
textAlign: "center",
|
|
129
67
|
margin: "30px"
|
|
130
|
-
}),
|
|
131
|
-
return
|
|
68
|
+
}), g = /* @__PURE__ */ o(p, { basic: !0, padded: !0, style: d, children: /* @__PURE__ */ o(F, { active: !0, inverted: !0, style: { background: "transparent" }, children: /* @__PURE__ */ o(x, { size: "medium", style: { background: "transparent" } }) }) });
|
|
69
|
+
return s ? /* @__PURE__ */ o("foreignObject", { style: n, children: /* @__PURE__ */ o(u, { style: i, className: "loading", children: g }) }) : /* @__PURE__ */ o(u, { style: i, className: "loading", children: g });
|
|
132
70
|
} else return h ? h ? /* @__PURE__ */ L(p, { color: "red", children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
] }) : /* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
] }) }) : /* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ o("h1", { children: "500" }),
|
|
72
|
+
/* @__PURE__ */ o("p", { children: "Wasn't able to load data" })
|
|
73
|
+
] }) : /* @__PURE__ */ o(u, { children: /* @__PURE__ */ L(p, { color: "red", children: [
|
|
74
|
+
/* @__PURE__ */ o("h1", { children: "404" }),
|
|
75
|
+
/* @__PURE__ */ o("p", { children: "Can't find this page" })
|
|
76
|
+
] }) }) : /* @__PURE__ */ o(w.Provider, { value: t, children: this.props.children });
|
|
139
77
|
}
|
|
140
78
|
}
|
|
141
|
-
const
|
|
79
|
+
const v = (r, t) => {
|
|
142
80
|
const { store: i, group: a, app: e } = t;
|
|
143
81
|
return {
|
|
144
|
-
lastUserFilterChange:
|
|
145
|
-
lastInitialFilterChange:
|
|
146
|
-
data:
|
|
147
|
-
filters:
|
|
148
|
-
autoApply:
|
|
149
|
-
apply:
|
|
150
|
-
error:
|
|
151
|
-
loading:
|
|
152
|
-
time:
|
|
82
|
+
lastUserFilterChange: r.getIn(["data", "filters-settings", e, a, "lastUserFilterChange"]),
|
|
83
|
+
lastInitialFilterChange: r.getIn(["data", "filters-settings", e, a, "lastInitialFilterChange"]),
|
|
84
|
+
data: r.getIn(["data", ...i, "data"]),
|
|
85
|
+
filters: r.getIn(["data", "filters", e, a]),
|
|
86
|
+
autoApply: r.getIn(["data", "filters-settings", e, a, "autoApply"]),
|
|
87
|
+
apply: r.getIn(["data", "filters-settings", e, a, "apply"]),
|
|
88
|
+
error: r.getIn(["data", ...i, "error"]),
|
|
89
|
+
loading: r.getIn(["data", ...i, "loading"]),
|
|
90
|
+
time: r.getIn(["data", ...i, "time"])
|
|
153
91
|
};
|
|
154
|
-
},
|
|
155
|
-
onSetData:
|
|
156
|
-
onLoadData:
|
|
157
|
-
},
|
|
92
|
+
}, N = {
|
|
93
|
+
onSetData: I,
|
|
94
|
+
onLoadData: _
|
|
95
|
+
}, $ = y(v, N)(O);
|
|
158
96
|
export {
|
|
159
|
-
|
|
97
|
+
$ as default
|
|
160
98
|
};
|
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* dom-to-image
|
|
3
|
+
* https://github.com/tsayen/dom-to-image
|
|
4
|
+
*
|
|
5
|
+
* The MIT License (MIT)
|
|
6
|
+
*
|
|
7
|
+
* Copyright 2015 Anatolii Saienko (https://github.com/tsayen)
|
|
8
|
+
* Copyright 2012 Paul Bakaus (http://paulbakaus.com/)
|
|
9
|
+
*
|
|
10
|
+
* Modifications copyright (c) 2025 Development Gateway
|
|
11
|
+
* This file has been modified from the original source.
|
|
12
|
+
* Original source: https://github.com/tsayen/dom-to-image
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
15
|
+
* a copy of this software and associated documentation files (the
|
|
16
|
+
* "Software"), to deal in the Software without restriction, including
|
|
17
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
18
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
19
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
20
|
+
* the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be
|
|
23
|
+
* included in all copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
26
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
27
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
28
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
29
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
30
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
31
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
32
|
+
*/
|
|
1
33
|
const d = z(), I = K(), F = Q(), N = Y(), k = {
|
|
2
34
|
// Default is to fail on error, no placeholder
|
|
3
35
|
imagePlaceholder: void 0,
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Container as A, Accordion as
|
|
4
|
-
import { PostProvider as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import I, { useState as y, useEffect as _ } from "react";
|
|
3
|
+
import { Container as A, Accordion as T, Icon as x, Grid as M, Segment as F, Label as P } from "semantic-ui-react";
|
|
4
|
+
import { PostProvider as H, PostConsumer as q, MediaProvider as S, MediaConsumer as L, PostIcon as N, PostContent as E, MediaContext as O, PostTitle as R } from "@devgateway/wp-react-lib";
|
|
5
5
|
import W from "../connected-templates/PostIntro.js";
|
|
6
6
|
import { useWindowDimensionsAndDevice as j } from "../../lib/hooks/window-dimensions.js";
|
|
7
7
|
import { connect as B } from "react-redux";
|
|
8
|
-
const G = ({ post: n, onClick:
|
|
9
|
-
const h = n._embedded ? n._embedded["wp:featuredmedia"] : null, o =
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
const G = ({ post: n, onClick: d, active: s, moreLabel: u, mediaData: l }) => {
|
|
9
|
+
const h = n._embedded ? n._embedded["wp:featuredmedia"] : null, o = l ? l.source_url : h && h.length > 0 ? h[0].source_url : null;
|
|
10
|
+
return /* @__PURE__ */ m("div", { className: "cover", style: { backgroundImage: `url(${o || ""})` }, children: [
|
|
11
11
|
/* @__PURE__ */ t(W, { post: n }),
|
|
12
|
-
s ? /* @__PURE__ */
|
|
12
|
+
s ? /* @__PURE__ */ m(P, { onClick: d, children: [
|
|
13
13
|
/* @__PURE__ */ t(x, { name: "arrow alternate circle left outline", size: "large" }),
|
|
14
14
|
" Back "
|
|
15
|
-
] }) : /* @__PURE__ */
|
|
15
|
+
] }) : /* @__PURE__ */ m(P, { onClick: d, children: [
|
|
16
16
|
/* @__PURE__ */ t(x, { name: "search", size: "large" }),
|
|
17
17
|
" ",
|
|
18
|
-
|
|
18
|
+
u
|
|
19
19
|
] })
|
|
20
20
|
] });
|
|
21
|
-
}, U = ({ post: n }) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
}, U = I.memo(({ post: n }) => {
|
|
22
|
+
const d = I.useMemo(() => {
|
|
23
|
+
const l = new DOMParser().parseFromString(n.content.rendered, "text/html").querySelector("figure");
|
|
24
|
+
return l ? l.outerHTML : null;
|
|
25
|
+
}, [n.content.rendered]);
|
|
26
|
+
return d ? /* @__PURE__ */ t("div", { style: {
|
|
24
27
|
flex: "0 0 40px"
|
|
25
|
-
}, dangerouslySetInnerHTML: { __html:
|
|
26
|
-
}, V = ({ posts: n, width:
|
|
27
|
-
const [o,
|
|
28
|
-
p ? (v(!1),
|
|
28
|
+
}, dangerouslySetInnerHTML: { __html: d } }) : null;
|
|
29
|
+
}), V = ({ posts: n, width: d, height: s, color: u, moreLabel: l, closeLabel: h }) => {
|
|
30
|
+
const [o, f] = y(null), [p, v] = y(!1), [C, b] = y([0, 0]), a = u.split(","), g = (i) => {
|
|
31
|
+
p ? (v(!1), f(i)) : (f(i), v(!0));
|
|
29
32
|
};
|
|
30
|
-
return
|
|
33
|
+
return _(() => {
|
|
31
34
|
o && b([window.scrollX, window.scrollY]), o == null && window.scrollTo(C[0], C[1]);
|
|
32
|
-
}, [o]),
|
|
35
|
+
}, [o]), _(() => {
|
|
33
36
|
window.setTimeout(() => {
|
|
34
37
|
if (window.location.hash) {
|
|
35
38
|
const i = window.location.hash.substr(1), e = document.getElementById(i);
|
|
36
|
-
e && n && n.map((r) => r.slug).indexOf(i) > -1 && (
|
|
39
|
+
e && n && n.map((r) => r.slug).indexOf(i) > -1 && (f(i), e.scrollIntoView({ behavior: "auto", block: "start" }));
|
|
37
40
|
}
|
|
38
41
|
}, 0);
|
|
39
|
-
}, [n]), /* @__PURE__ */ t(A, { fluid: !0, className: "featured tabs", style: { minHeight: `${s}px` }, children: /* @__PURE__ */ t(
|
|
42
|
+
}, [n]), /* @__PURE__ */ t(A, { fluid: !0, className: "featured tabs", style: { minHeight: `${s}px` }, children: /* @__PURE__ */ t(M, { stackable: !0, columns: o != null ? 1 : n == null ? void 0 : n.length, className: "desktop", children: n == null ? void 0 : n.map((i, e) => {
|
|
40
43
|
var r;
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
+
return /* @__PURE__ */ m(I.Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ m(
|
|
46
|
+
M.Column,
|
|
44
47
|
{
|
|
45
48
|
style: o == null ? { display: "block", visibility: "visible", backgroundColor: a[e] } : { display: "none", visibility: "hidden" },
|
|
46
49
|
children: [
|
|
47
50
|
/* @__PURE__ */ t("a", { id: i.slug }),
|
|
48
|
-
/* @__PURE__ */ t(
|
|
51
|
+
/* @__PURE__ */ t(S, { id: i.featured_media, children: /* @__PURE__ */ t(O.Consumer, { children: ({ media: c }) => /* @__PURE__ */ t(G, { post: i, mediaData: c, moreLabel: l, onClick: () => g(i.slug) }) }) })
|
|
49
52
|
]
|
|
50
53
|
}
|
|
51
54
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
55
|
+
/* @__PURE__ */ m(
|
|
56
|
+
M.Column,
|
|
54
57
|
{
|
|
55
58
|
className: "expanded",
|
|
56
59
|
style: o != i.slug ? { display: "none", visibility: "hidden" } : { display: "block", visibility: "visible" },
|
|
57
60
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
((r = i.meta_fields) == null ? void 0 : r.icon) && /* @__PURE__ */ t(
|
|
61
|
+
/* @__PURE__ */ m(F, { style: { backgroundColor: a[e] }, children: [
|
|
62
|
+
((r = i.meta_fields) == null ? void 0 : r.icon) && /* @__PURE__ */ t(S, { id: i.meta_fields ? i.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(N, {}) }) }),
|
|
60
63
|
/* @__PURE__ */ t(R, { as: "h2", post: i, className: "has-standard-36-font-size has-white-color" }),
|
|
61
|
-
/* @__PURE__ */ t(
|
|
64
|
+
/* @__PURE__ */ t(P, { className: "closeIcon", onClick: () => f(null), children: /* @__PURE__ */ t(x, { name: "times circle outline", size: "large" }) })
|
|
62
65
|
] }),
|
|
63
66
|
/* @__PURE__ */ t(
|
|
64
67
|
E,
|
|
@@ -69,7 +72,7 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
69
72
|
style: { maxHeight: `calc(${s}px - 150px)` }
|
|
70
73
|
}
|
|
71
74
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ m(P, { className: "closeIconText", style: { backgroundColor: `${a[e]}` }, onClick: () => f(null), children: [
|
|
73
76
|
/* @__PURE__ */ t(x, { name: "times circle outline", size: "large" }),
|
|
74
77
|
" ",
|
|
75
78
|
h || "Close",
|
|
@@ -80,8 +83,8 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
80
83
|
)
|
|
81
84
|
] }, i.slug);
|
|
82
85
|
}) }) });
|
|
83
|
-
}, Y = ({ posts: n, activeItem:
|
|
84
|
-
const [
|
|
86
|
+
}, Y = ({ posts: n, activeItem: d, setActive: s, color: u }) => {
|
|
87
|
+
const [l, h] = y(n.findIndex((e) => e.slug === d)), [o, f] = y(null), p = u.split(","), v = () => {
|
|
85
88
|
var e;
|
|
86
89
|
return ((e = window.screen.orientation) == null ? void 0 : e.type) || (window.innerWidth > window.innerHeight ? "landscape-primary" : "portrait-primary");
|
|
87
90
|
}, [C, b] = y(v()), a = () => {
|
|
@@ -93,7 +96,7 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
93
96
|
k.querySelector(r) && k.classList.add(c);
|
|
94
97
|
});
|
|
95
98
|
};
|
|
96
|
-
|
|
99
|
+
_(() => {
|
|
97
100
|
if (o) {
|
|
98
101
|
const e = o.getBoundingClientRect().top + window.scrollY;
|
|
99
102
|
window.scrollTo({
|
|
@@ -102,7 +105,7 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
107
|
g(".ui.fluid.container.viz.featured.tabs", ".accordion .accordion-post-ft-title", "has-accordion-title"), g(".ui.fluid.container.viz.featured.tabs", ".accordion .accordion-post-vft-content", "has-accordion-content"), g(".ui.fluid.container.viz.featured.tabs", "blockquote", "has-blockquote"), g(".ui.fluid.container.viz.featured.tabs", ".vt-accordion-post-intro figure", "has-vt-accordion-figure"), g(".ui.fluid.container.viz.featured.tabs", ".content.active.accordion-post-content .wp-block-columns", "has-wp-block-columns");
|
|
105
|
-
}, [o]),
|
|
108
|
+
}, [o]), _(() => (window.screen.orientation && window.screen.orientation.addEventListener(
|
|
106
109
|
"change",
|
|
107
110
|
a
|
|
108
111
|
), window.addEventListener("resize", a), () => {
|
|
@@ -112,23 +115,23 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
112
115
|
);
|
|
113
116
|
}), []);
|
|
114
117
|
const i = (e, r) => {
|
|
115
|
-
const { index: c } = r, w =
|
|
116
|
-
h(w), s(n[c].slug), w !== -1 &&
|
|
118
|
+
const { index: c } = r, w = l === c ? -1 : c;
|
|
119
|
+
h(w), s(n[c].slug), w !== -1 && f(e.currentTarget);
|
|
117
120
|
};
|
|
118
|
-
return /* @__PURE__ */ t(
|
|
121
|
+
return /* @__PURE__ */ t(T, { fluid: !0, styled: !0, children: n.map((e, r) => {
|
|
119
122
|
var w;
|
|
120
123
|
const c = (w = e.meta_fields) != null && w.icon ? e.meta_fields.icon[0] : null;
|
|
121
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ m(I.Fragment, { children: [
|
|
122
125
|
/* @__PURE__ */ t(
|
|
123
|
-
|
|
126
|
+
T.Title,
|
|
124
127
|
{
|
|
125
|
-
active:
|
|
128
|
+
active: l === r,
|
|
126
129
|
index: r,
|
|
127
130
|
onClick: i,
|
|
128
131
|
style: { backgroundColor: p[r] },
|
|
129
|
-
children: /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
c && /* @__PURE__ */ t(
|
|
132
|
+
children: /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
133
|
+
/* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
134
|
+
c && /* @__PURE__ */ t(S, { id: c, children: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(N, { className: "icon" }) }) }),
|
|
132
135
|
!c && /* @__PURE__ */ t(U, { post: e }),
|
|
133
136
|
/* @__PURE__ */ t("p", { className: "accordion-post-ft-title", dangerouslySetInnerHTML: { __html: e.title.rendered }, style: { marginLeft: "10px" } })
|
|
134
137
|
] }),
|
|
@@ -136,19 +139,19 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
136
139
|
] })
|
|
137
140
|
}
|
|
138
141
|
),
|
|
139
|
-
/* @__PURE__ */ t(
|
|
142
|
+
/* @__PURE__ */ t(T.Content, { className: "accordion-post-ft-content", active: l === r, children: /* @__PURE__ */ t(E, { post: e }) })
|
|
140
143
|
] }, e.id);
|
|
141
144
|
}) });
|
|
142
145
|
}, X = (n) => {
|
|
143
|
-
var
|
|
146
|
+
var z;
|
|
144
147
|
let {
|
|
145
|
-
"data-width":
|
|
148
|
+
"data-width": d,
|
|
146
149
|
"data-height": s,
|
|
147
|
-
"data-type":
|
|
148
|
-
"data-taxonomy":
|
|
150
|
+
"data-type": u,
|
|
151
|
+
"data-taxonomy": l,
|
|
149
152
|
"data-categories": h,
|
|
150
153
|
"data-items": o,
|
|
151
|
-
"data-color":
|
|
154
|
+
"data-color": f,
|
|
152
155
|
"data-use-scrolls": p,
|
|
153
156
|
"data-read-more-label": v = "READ More",
|
|
154
157
|
"data-close-label": C = "Close",
|
|
@@ -167,21 +170,21 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
167
170
|
className: `viz featured tabs ${a ? "editing" : ""} ${c ? "scrollable" : ""}`,
|
|
168
171
|
fluid: !0,
|
|
169
172
|
children: /* @__PURE__ */ t(
|
|
170
|
-
|
|
173
|
+
H,
|
|
171
174
|
{
|
|
172
175
|
locale: r,
|
|
173
|
-
type:
|
|
174
|
-
taxonomy:
|
|
176
|
+
type: u,
|
|
177
|
+
taxonomy: l,
|
|
175
178
|
categories: h,
|
|
176
179
|
store: `tabbedposts_${g}_${i}`,
|
|
177
180
|
page: 1,
|
|
178
181
|
perPage: o,
|
|
179
|
-
children: /* @__PURE__ */ t(
|
|
182
|
+
children: /* @__PURE__ */ t(q, { children: $ || D ? /* @__PURE__ */ t(
|
|
180
183
|
Y,
|
|
181
184
|
{
|
|
182
185
|
posts: o,
|
|
183
|
-
activeItem: (
|
|
184
|
-
color:
|
|
186
|
+
activeItem: (z = o == null ? void 0 : o[0]) == null ? void 0 : z.slug,
|
|
187
|
+
color: f,
|
|
185
188
|
setActive: () => {
|
|
186
189
|
}
|
|
187
190
|
}
|
|
@@ -190,8 +193,8 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
190
193
|
{
|
|
191
194
|
moreLabel: v,
|
|
192
195
|
closeLabel: C,
|
|
193
|
-
color:
|
|
194
|
-
width:
|
|
196
|
+
color: f,
|
|
197
|
+
width: d,
|
|
195
198
|
height: s
|
|
196
199
|
}
|
|
197
200
|
) })
|
|
@@ -199,12 +202,12 @@ const G = ({ post: n, onClick: f, active: s, moreLabel: l, mediaData: u }) => {
|
|
|
199
202
|
)
|
|
200
203
|
}
|
|
201
204
|
);
|
|
202
|
-
}, J = (n,
|
|
205
|
+
}, J = (n, d) => {
|
|
203
206
|
const s = n.getIn([
|
|
204
207
|
"data",
|
|
205
208
|
"pageModuleProps"
|
|
206
|
-
]),
|
|
207
|
-
return s && (
|
|
209
|
+
]), u = {};
|
|
210
|
+
return s && (u.pageModuleProps = s), u;
|
|
208
211
|
}, K = {}, re = B(J, K)(X);
|
|
209
212
|
export {
|
|
210
213
|
re as default
|