@devgateway/dvz-ui-react 1.8.8 → 1.9.0

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.
Files changed (50) hide show
  1. package/dist/cjs/common.css +1 -1
  2. package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -1
  3. package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -0
  4. package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -1
  5. package/dist/cjs/embeddable/big-number-trend/useBigNumberTrendData.js +1 -0
  6. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  7. package/dist/cjs/embeddable/chart/Messages.js +2 -2
  8. package/dist/cjs/embeddable/chart/data/Line.js +1 -1
  9. package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
  10. package/dist/cjs/embeddable/chart/index.js +1 -1
  11. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  12. package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
  13. package/dist/cjs/embeddable/data/DataConsumer.js +1 -1
  14. package/dist/cjs/embeddable/data/DataProvider.js +1 -1
  15. package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
  16. package/dist/cjs/embeddable/map/index.js +2 -2
  17. package/dist/cjs/embeddable/reducers/data.js +1 -1
  18. package/dist/cjs/index.js +1 -1
  19. package/dist/cjs/layout/FlexWrapDetector.js +1 -1
  20. package/dist/cjs/styles.css +1 -1
  21. package/dist/esm/common.css +1 -1
  22. package/dist/esm/embeddable/big-number-trend/Alternative.js +62 -211
  23. package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +125 -0
  24. package/dist/esm/embeddable/big-number-trend/Classic.js +51 -181
  25. package/dist/esm/embeddable/big-number-trend/index.js +8 -8
  26. package/dist/esm/embeddable/big-number-trend/useBigNumberTrendData.js +49 -0
  27. package/dist/esm/embeddable/chart/Bar.js +464 -471
  28. package/dist/esm/embeddable/chart/Messages.js +18 -15
  29. package/dist/esm/embeddable/chart/data/Line.js +1 -4
  30. package/dist/esm/embeddable/chart/data/Utils.js +0 -1
  31. package/dist/esm/embeddable/chart/index.js +363 -359
  32. package/dist/esm/embeddable/d3Map/index.js +129 -125
  33. package/dist/esm/embeddable/data/CategoriesProvider.js +31 -38
  34. package/dist/esm/embeddable/data/DataConsumer.js +12 -8
  35. package/dist/esm/embeddable/data/DataProvider.js +62 -124
  36. package/dist/esm/embeddable/featuredtabs/index.js +64 -61
  37. package/dist/esm/embeddable/map/index.js +42 -42
  38. package/dist/esm/embeddable/reducers/data.js +46 -44
  39. package/dist/esm/index.js +74 -73
  40. package/dist/esm/layout/FlexWrapDetector.js +10 -10
  41. package/dist/esm/styles.css +1 -1
  42. package/dist/types/embeddable/big-number-trend/Alternative.d.ts +2 -4
  43. package/dist/types/embeddable/big-number-trend/BigNumberTrendContainer.d.ts +5 -0
  44. package/dist/types/embeddable/big-number-trend/Classic.d.ts +2 -4
  45. package/dist/types/embeddable/big-number-trend/useBigNumberTrendData.d.ts +21 -0
  46. package/dist/types/embeddable/chart/Bar.d.ts +1 -2
  47. package/dist/types/embeddable/data/DataConsumer.d.ts +5 -2
  48. package/dist/types/embeddable/data/DataProvider.d.ts +18 -3
  49. package/dist/types/layout/FlexWrapDetector.d.ts +2 -1
  50. package/package.json +2 -2
@@ -1,160 +1,98 @@
1
- import { jsx as d, jsxs as L } from "react/jsx-runtime";
2
- import w from "react";
3
- import { connect as I } from "react-redux";
4
- import { injectIntl as k } from "react-intl";
5
- import { DataContext as F } from "./DataContext.js";
6
- import { getData as O, setData as v } from "../reducers/data.js";
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 J extends w.Component {
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.debounces = [];
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
- debouncedLoadData(t, i) {
16
- const a = A((e) => {
17
- console.log(`🔄 [DataProvider] Debounced load triggered (${t}ms delay)`, {
18
- args: e,
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: s, editing: o, waitForFilters: n = !1 } = this.props;
26
- t === "csv" ? this.props.onSetData({ app: t, csv: h, store: a, params: e, group: s }) : (this.setState({ showLoading: !1 }), !n || o ? (console.log("📥 [DataProvider] Initial data load triggered", {
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.debounces.forEach((t) => t ? t.cancel() : null);
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: s,
63
- source: o,
34
+ apply: l,
35
+ source: s,
64
36
  store: n,
65
- params: r,
37
+ params: d,
66
38
  csv: g,
67
- group: l,
68
- autoApply: T,
69
- editing: u,
70
- lastInitialFilterChange: b,
71
- lastUserFilterChange: y
72
- } = this.props, f = b !== t.lastInitialFilterChange, S = y !== t.lastUserFilterChange;
73
- let D = !1;
74
- s != null && s != t.apply && (D = !0), T !== !1 ? (h != t.filters || JSON.stringify(r) != JSON.stringify(t.params) || e != t.app || JSON.stringify(t.source) != JSON.stringify(o) || g != t.csv) && (e === "csv" ? this.props.onSetData({ app: e, csv: g, store: n, params: r, group: l }) : (this.setState({ showLoading: !0 }), u && this.props.onLoadData({ app: e, source: o, store: n, params: r, group: l }), f && this.props.waitForFilters ? (clearTimeout(this.debounceTimeout), clearTimeout(this.fallbackTimeout), this.debounceTimeout = setTimeout(() => {
75
- this.dataLoaded = !0, this.setState({ showLoading: !1 }), console.log("🔄 [DataProvider] Loading data after initial filter setup", {
76
- app: e,
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 { data: t, loading: i, time: a, error: e, verbose: h = !0 } = this.props, s = Date.now() - a;
114
- i && a && s > 1e3 ? this.setState({ showLoading: !0 }) : i && setTimeout(this.checkLoadingTime, 100);
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: s, isSvg: o, verbose: n = !0 } = this.props;
118
- if (a && this.state.showLoading && !s) {
119
- const r = {
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
- }, g = Object.assign({}, i, {
63
+ }, d = Object.assign({}, i, {
126
64
  height: "90%",
127
65
  background: "transparent",
128
66
  textAlign: "center",
129
67
  margin: "30px"
130
- }), l = /* @__PURE__ */ d(p, { basic: !0, padded: !0, style: g, children: /* @__PURE__ */ d(C, { active: !0, inverted: !0, style: { background: "transparent" }, children: /* @__PURE__ */ d(N, { size: "medium", style: { background: "transparent" } }) }) });
131
- return o ? /* @__PURE__ */ d("foreignObject", { style: r, children: /* @__PURE__ */ d(m, { style: i, className: "loading", children: l }) }) : /* @__PURE__ */ d(m, { style: i, className: "loading", children: l });
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__ */ d("h1", { children: "500" }),
134
- /* @__PURE__ */ d("p", { children: "Wasn't able to load data" })
135
- ] }) : /* @__PURE__ */ d(m, { children: /* @__PURE__ */ L(p, { color: "red", children: [
136
- /* @__PURE__ */ d("h1", { children: "404" }),
137
- /* @__PURE__ */ d("p", { children: "Can't find this page" })
138
- ] }) }) : /* @__PURE__ */ d(F.Provider, { value: t, children: this.props.children });
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 x = (c, t) => {
79
+ const v = (r, t) => {
142
80
  const { store: i, group: a, app: e } = t;
143
81
  return {
144
- lastUserFilterChange: c.getIn(["data", "filters-settings", e, a, "lastUserFilterChange"]),
145
- lastInitialFilterChange: c.getIn(["data", "filters-settings", e, a, "lastInitialFilterChange"]),
146
- data: c.getIn(["data", ...i, "data"]),
147
- filters: c.getIn(["data", "filters", e, a]),
148
- autoApply: c.getIn(["data", "filters-settings", e, a, "autoApply"]),
149
- apply: c.getIn(["data", "filters-settings", e, a, "apply"]),
150
- error: c.getIn(["data", ...i, "error"]),
151
- loading: c.getIn(["data", ...i, "loading"]),
152
- time: c.getIn(["data", ...i, "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
- }, U = {
155
- onSetData: v,
156
- onLoadData: O
157
- }, q = I(x, U)(k(J));
92
+ }, N = {
93
+ onSetData: I,
94
+ onLoadData: _
95
+ }, $ = y(v, N)(O);
158
96
  export {
159
- q as default
97
+ $ as default
160
98
  };
@@ -1,64 +1,67 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
- import z, { useState as y, useEffect as I } from "react";
3
- import { Container as A, Accordion as P, Icon as x, Grid as T, Segment as F, Label as _ } from "semantic-ui-react";
4
- import { PostProvider as q, PostConsumer as H, MediaProvider as M, MediaConsumer as L, PostIcon as N, PostContent as E, MediaContext as O, PostTitle as R } from "@devgateway/wp-react-lib";
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: f, active: s, moreLabel: l, mediaData: u }) => {
9
- const h = n._embedded ? n._embedded["wp:featuredmedia"] : null, o = u ? u.source_url : h && h.length > 0 ? h[0].source_url : null;
10
- return /* @__PURE__ */ d("div", { className: "cover", style: { backgroundImage: `url(${o || ""})` }, children: [
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__ */ d(_, { onClick: f, children: [
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__ */ d(_, { onClick: f, children: [
15
+ ] }) : /* @__PURE__ */ m(P, { onClick: d, children: [
16
16
  /* @__PURE__ */ t(x, { name: "search", size: "large" }),
17
17
  " ",
18
- l
18
+ u
19
19
  ] })
20
20
  ] });
21
- }, U = ({ post: n }) => {
22
- const l = new DOMParser().parseFromString(n.content.rendered, "text/html").querySelector("figure");
23
- return l ? /* @__PURE__ */ t("div", { style: {
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: l.outerHTML } }) : null;
26
- }, V = ({ posts: n, width: f, height: s, color: l, moreLabel: u, closeLabel: h }) => {
27
- const [o, m] = y(null), [p, v] = y(!1), [C, b] = y([0, 0]), a = l.split(","), g = (i) => {
28
- p ? (v(!1), m(i)) : (m(i), v(!0));
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 I(() => {
33
+ return _(() => {
31
34
  o && b([window.scrollX, window.scrollY]), o == null && window.scrollTo(C[0], C[1]);
32
- }, [o]), I(() => {
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 && (m(i), e.scrollIntoView({ behavior: "auto", block: "start" }));
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(T, { stackable: !0, columns: o != null ? 1 : n == null ? void 0 : n.length, className: "desktop", children: n == null ? void 0 : n.map((i, e) => {
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__ */ d(z.Fragment, { children: [
42
- /* @__PURE__ */ d(
43
- T.Column,
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(M, { id: i.featured_media, children: /* @__PURE__ */ t(O.Consumer, { children: ({ media: c }) => /* @__PURE__ */ t(G, { post: i, mediaData: c, moreLabel: u, onClick: () => g(i.slug) }) }) })
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__ */ d(
53
- T.Column,
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__ */ d(F, { style: { backgroundColor: a[e] }, children: [
59
- ((r = i.meta_fields) == null ? void 0 : r.icon) && /* @__PURE__ */ t(M, { id: i.meta_fields ? i.meta_fields.icon[0] : null, children: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(N, {}) }) }),
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(_, { className: "closeIcon", onClick: () => m(null), children: /* @__PURE__ */ t(x, { name: "times circle outline", size: "large" }) })
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__ */ d(_, { className: "closeIconText", style: { backgroundColor: `${a[e]}` }, onClick: () => m(null), children: [
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: f, setActive: s, color: l }) => {
84
- const [u, h] = y(n.findIndex((e) => e.slug === f)), [o, m] = y(null), p = l.split(","), v = () => {
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
- I(() => {
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]), I(() => (window.screen.orientation && window.screen.orientation.addEventListener(
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 = u === c ? -1 : c;
116
- h(w), s(n[c].slug), w !== -1 && m(e.currentTarget);
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(P, { fluid: !0, styled: !0, children: n.map((e, r) => {
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__ */ d(z.Fragment, { children: [
124
+ return /* @__PURE__ */ m(I.Fragment, { children: [
122
125
  /* @__PURE__ */ t(
123
- P.Title,
126
+ T.Title,
124
127
  {
125
- active: u === r,
128
+ active: l === r,
126
129
  index: r,
127
130
  onClick: i,
128
131
  style: { backgroundColor: p[r] },
129
- children: /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
130
- /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "center" }, children: [
131
- c && /* @__PURE__ */ t(M, { id: c, children: /* @__PURE__ */ t(L, { children: /* @__PURE__ */ t(N, { className: "icon" }) }) }),
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(P.Content, { className: "accordion-post-ft-content", active: u === r, children: /* @__PURE__ */ t(E, { post: e }) })
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 S;
146
+ var z;
144
147
  let {
145
- "data-width": f,
148
+ "data-width": d,
146
149
  "data-height": s,
147
- "data-type": l,
148
- "data-taxonomy": u,
150
+ "data-type": u,
151
+ "data-taxonomy": l,
149
152
  "data-categories": h,
150
153
  "data-items": o,
151
- "data-color": m,
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
- q,
173
+ H,
171
174
  {
172
175
  locale: r,
173
- type: l,
174
- taxonomy: u,
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(H, { children: $ || D ? /* @__PURE__ */ t(
182
+ children: /* @__PURE__ */ t(q, { children: $ || D ? /* @__PURE__ */ t(
180
183
  Y,
181
184
  {
182
185
  posts: o,
183
- activeItem: (S = o == null ? void 0 : o[0]) == null ? void 0 : S.slug,
184
- color: m,
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: m,
194
- width: f,
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, f) => {
205
+ }, J = (n, d) => {
203
206
  const s = n.getIn([
204
207
  "data",
205
208
  "pageModuleProps"
206
- ]), l = {};
207
- return s && (l.pageModuleProps = s), l;
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