@devgateway/dvz-ui-react 1.9.12 → 1.9.13

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.
@@ -18,15 +18,15 @@ const ma = [
18
18
  { label: "Democratic Republic of the Congo", value: "DRC", center: [23.174338, -5.837475], scale: 1250 },
19
19
  { label: "World", value: "World", center: [0, 20.050043], scale: 150 }
20
20
  ], ca = (s) => /* @__PURE__ */ c(ua, { ...s }), ua = (s) => {
21
- var V;
21
+ var O;
22
22
  const {
23
23
  unique: f,
24
24
  editing: u,
25
- "data-filters": W = "{}",
25
+ "data-filters": J = "{}",
26
26
  "data-app": t = "csv",
27
- "data-csv": G = "",
28
- "data-dimension1": J = "",
29
- "data-dimension2": Z = "",
27
+ "data-csv": Z = "",
28
+ "data-dimension1": L = "",
29
+ "data-dimension2": w = "",
30
30
  "data-dimension3": g = "",
31
31
  "data-extra-tooltip-columns": _ = "[]",
32
32
  "data-measures": h = "[]",
@@ -37,25 +37,25 @@ const ma = [
37
37
  "data-national-average-label": q = "National Average",
38
38
  "data-legend-title": Y = "Legend Title",
39
39
  "data-legend-breaks": Q = "[]",
40
- "data-zoom-enabled": L = !1,
41
- "data-show-legend-labels": w = !1,
40
+ "data-zoom-enabled": F = !1,
41
+ "data-show-legend-labels": S = !1,
42
42
  "data-map-file": X,
43
43
  "data-mapping-field": ee = "zone",
44
44
  "data-map-label-field": ae = "admin",
45
- "data-has-multiple-measures": F = "false",
45
+ "data-has-multiple-measures": D = "false",
46
46
  topoJSONField: oe = "collection",
47
47
  "data-map-center": te = "NGA",
48
48
  //country
49
- "data-map-label-show-value": S = "false",
50
- "data-show-tooltip": D = "true",
49
+ "data-map-label-show-value": I = "false",
50
+ "data-show-tooltip": N = "true",
51
51
  "data-measure-selector-label": le = "",
52
52
  "data-value-format": re = "",
53
- "data-show-overall-value": I = "false",
54
- "data-auto-generate-breaks": N = "false",
53
+ "data-show-overall-value": z = "false",
54
+ "data-auto-generate-breaks": T = "false",
55
55
  "data-number-of-breaks": ne = 5,
56
56
  "data-scheme": se = "reds",
57
- "data-show-no-data-label": z = "false",
58
- "data-group": T = "default",
57
+ "data-show-no-data-label": x = "false",
58
+ "data-group": A = "default",
59
59
  "data-map-symbols": ie = "[]",
60
60
  "data-tooltip-theme": de = "map-tooltip-dark",
61
61
  "data-label-font-size": me = 14,
@@ -65,7 +65,7 @@ const ma = [
65
65
  "data-legend-font-weight": fe = "normal",
66
66
  "data-custom-tooltips": ge = "[]",
67
67
  "data-format-style": b = "decimal",
68
- "data-decimals": x = "2",
68
+ "data-decimals": B = "2",
69
69
  "data-currency": he = "",
70
70
  "data-tooltip-font-size": be = 14,
71
71
  "data-show-admin-unit-label": Ce = "showAll",
@@ -75,21 +75,21 @@ const ma = [
75
75
  "data-highlighted-location": we = "",
76
76
  "data-tooltip-format": Fe = `{locationName} %({value},2)
77
77
  {label}: %({value},2)`,
78
- "data-show-no-data-tooltip": A = "false",
78
+ "data-show-no-data-tooltip": U = "false",
79
79
  "data-map-container-bg-color": Se = "#fff",
80
80
  "data-map-position": De = "{}",
81
81
  "data-main-layer-id": Ie = "",
82
82
  "data-enabled-layers": Ne,
83
83
  "data-point-label-color": ze = "#fff",
84
84
  "data-point-label-format": Te = "{locationName} %({value},2)",
85
- "data-show-no-data-legend-item": B = !1,
85
+ "data-show-no-data-legend-item": P = !1,
86
86
  "data-highlighted-loc-label-format": xe = "{locationName} - Score: #({value},2)",
87
87
  "data-enable-summary-view": ga = "false",
88
- "data-map-type": U = "DEFAULT",
88
+ "data-map-type": R = "DEFAULT",
89
89
  "data-default-point-color": Ae = "#FFFF00",
90
90
  "data-aggregation-formula": Be = "COUNT",
91
91
  "data-zoom-level-to-show-points": Ue = 2,
92
- "data-zoom-on-filter": P = "false",
92
+ "data-zoom-on-filter": E = "false",
93
93
  "data-zoom-on-filter-field": Pe = "",
94
94
  "data-no-data-text": Re = "No Data",
95
95
  "data-labels-exclusion-list": Ee = "",
@@ -101,12 +101,12 @@ const ma = [
101
101
  settings: ba
102
102
  } = s;
103
103
  console.log("MapWrapper props", s);
104
- const Oe = (e) => u ? e : decodeURIComponent(e), R = (e) => e == null ? "" : String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, ""), We = (e, a) => {
104
+ const Oe = (e) => u ? e : decodeURIComponent(e), M = (e) => e == null ? "" : String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, ""), We = (e, a) => {
105
105
  if (!e || !a)
106
106
  return;
107
107
  if (Object.prototype.hasOwnProperty.call(e, a))
108
108
  return e[a];
109
- const o = R(a), r = Object.keys(e).find((k) => R(k) === o);
109
+ const o = M(a), r = Object.keys(e).find((W) => M(W) === o);
110
110
  return r ? e[r] : void 0;
111
111
  }, l = (e) => {
112
112
  try {
@@ -123,19 +123,19 @@ const ma = [
123
123
  const a = l(e) || [];
124
124
  let o = {};
125
125
  return a && a.forEach ? a.forEach((r) => {
126
- (Array.isArray(r.value) ? r.value : [r.value]).filter((O) => O != null && O.toString().trim() != "").length > 0 && (o[r.param] = r.value);
126
+ (Array.isArray(r.value) ? r.value : [r.value]).filter((G) => G != null && G.toString().trim() != "").length > 0 && (o[r.param] = r.value);
127
127
  }) : o = a, o;
128
128
  }, Ze = {
129
129
  style: b === "compacted" ? "decimal" : b,
130
130
  notation: b === "compacted" ? "compact" : "standard",
131
131
  currency: he,
132
- minimumFractionDigits: parseInt(x),
133
- maximumFractionDigits: parseInt(x)
132
+ minimumFractionDigits: parseInt(B),
133
+ maximumFractionDigits: parseInt(B)
134
134
  };
135
135
  let C = l(Ne) || [];
136
136
  C = C.map((e) => (e.bgColor = decodeURIComponent(e.bgColor), e.fontColor = decodeURIComponent(e.fontColor), e));
137
- const v = ma.find((e) => e.value === te), E = F == !0 || F == "true";
138
- let i = [J, Z].filter((e) => e !== "none" && e !== null).join("/");
137
+ const v = ma.find((e) => e.value === te), V = D == !0 || D == "true";
138
+ let i = [L, w].filter((e) => e !== "none" && e !== null).join("/");
139
139
  const d = g && g !== "none" ? g : null, _e = v ? v.scale : 2e3, p = {
140
140
  unique: f,
141
141
  editing: u,
@@ -153,20 +153,20 @@ const ma = [
153
153
  nationalAverageLabel: q,
154
154
  legendBreaks: Ge(Q),
155
155
  mapLabelField: ae,
156
- zoomEnabled: L == !0 || L == "true",
157
- showLegendLabels: w == !0 || w == "true",
158
- multipleMeasures: E,
156
+ zoomEnabled: F == !0 || F == "true",
157
+ showLegendLabels: S == !0 || S == "true",
158
+ multipleMeasures: V,
159
159
  app: t,
160
- mapLabelShowValue: S == !0 || S == "true",
161
- showTooltip: D == !0 || D == "true",
162
- showOverallValue: I == !0 || I == "true",
160
+ mapLabelShowValue: I == !0 || I == "true",
161
+ showTooltip: N == !0 || N == "true",
162
+ showOverallValue: z == !0 || z == "true",
163
163
  measureSelectorLabel: le,
164
164
  valueFormat: re,
165
- autoGenerateBreaks: N == !0 || N == "true",
166
- showNoDataLabel: z == !0 || z == "true",
165
+ autoGenerateBreaks: T == !0 || T == "true",
166
+ showNoDataLabel: x == !0 || x == "true",
167
167
  numberOfBreaks: ne,
168
168
  colorScheme: se,
169
- group: T,
169
+ group: A,
170
170
  symbols: l(ie) || [],
171
171
  tooltipTheme: de,
172
172
  labelFontSize: me,
@@ -183,7 +183,7 @@ const ma = [
183
183
  mapFocusBoundaryColor: decodeURIComponent(Le),
184
184
  highlightedLocation: we,
185
185
  tooltipFormat: Fe,
186
- showNoDataTooltip: A == !0 || A == "true",
186
+ showNoDataTooltip: U == !0 || U == "true",
187
187
  fields: i.split("/"),
188
188
  mapContainerBgColor: decodeURIComponent(Se),
189
189
  mapPosition: l(De),
@@ -191,12 +191,12 @@ const ma = [
191
191
  enabledLayers: C,
192
192
  pointLabelColor: decodeURIComponent(ze),
193
193
  pointLabelFormat: Te,
194
- showNoDataLegendItem: B == !0 || B == "true",
194
+ showNoDataLegendItem: P == !0 || P == "true",
195
195
  highlightedLocLabelFormat: xe,
196
- mapType: U,
196
+ mapType: R,
197
197
  defaultPointColor: decodeURIComponent(Ae),
198
198
  zoomLevelToShowPoints: Ue,
199
- zoomOnFilter: P == !0 || P == "true",
199
+ zoomOnFilter: E == !0 || E == "true",
200
200
  zoomOnFilterField: Pe,
201
201
  noDataText: Re,
202
202
  labelsExclusionList: Ee.split(",").map((e) => e.trim()),
@@ -206,15 +206,15 @@ const ma = [
206
206
  };
207
207
  if (p.recentlyToggledLayerId) {
208
208
  const e = p.enabledLayers.find((a) => String(a.id) === String(p.recentlyToggledLayerId));
209
- e && (e != null && e.apiField) && (i = (V = e.apiField) == null ? void 0 : V.toLowerCase());
209
+ e && (e != null && e.apiField) && (i = (O = e.apiField) == null ? void 0 : O.toLowerCase());
210
210
  }
211
- const je = l(Me) || {}, He = t === "csv" ? da : ia, Ke = u ? (l(h) || []).join(",") : h, m = Je(W);
211
+ const je = l(Me) || {}, He = t === "csv" ? da : ia, Ke = u ? (l(h) || []).join(",") : h, m = Je(J);
212
212
  if (d) {
213
213
  const e = We(m, d);
214
214
  e != null && e !== "" && (m[d] = e);
215
215
  }
216
- const $e = (l(_) || []).filter((e) => e && e !== "none"), M = Array.from(new Set([d, ...$e].filter(Boolean)));
217
- M.length > 0 && (m.includeColumns = M.join(",")), n && (m.dvzProxyDatasetId = n);
216
+ const $e = (l(_) || []).filter((e) => e && e !== "none" && e !== L && e !== w), k = Array.from(new Set([d, ...$e].filter(Boolean)));
217
+ k.length > 0 && (m.includeColumns = k.join(",")), n && (m.dvzProxyDatasetId = n);
218
218
  const qe = oa(), Ye = ["data", "categories", t, ...n ? [n] : [], "items"], y = ta((e) => e.getIn(Ye)), Qe = Xe(() => y ? y.toJS() : [], [y]);
219
219
  return ea(() => {
220
220
  t && t !== "csv" && qe(na({ app: t, dvzProxyDatasetId: n }));
@@ -223,8 +223,8 @@ const ma = [
223
223
  {
224
224
  params: m,
225
225
  app: t,
226
- csv: decodeURIComponent(G),
227
- group: T,
226
+ csv: decodeURIComponent(Z),
227
+ group: A,
228
228
  editing: u,
229
229
  store: [t, f, ...i.split("/")],
230
230
  source: i,
@@ -232,8 +232,8 @@ const ma = [
232
232
  He,
233
233
  {
234
234
  measures: Ke,
235
- multipleMeasures: E,
236
- mapType: U,
235
+ multipleMeasures: V,
236
+ mapType: R,
237
237
  aggregationFormula: Be,
238
238
  customMeasureLabels: je,
239
239
  source: i,
@@ -1,17 +1,17 @@
1
1
  import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
2
  import I, { useState as w, useRef as G, useEffect as x } from "react";
3
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";
4
+ import { PostProvider as q, PostConsumer as _, MediaProvider as P, MediaConsumer as A, PostIcon as S, PostLabel as $ } 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 L from "../connected-templates/PostIntro.js";
7
+ import k from "../connected-templates/PostIntro.js";
8
8
  import { useWindowDimensionsAndDevice as U } from "../../lib/hooks/window-dimensions.js";
9
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
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 } }) })
14
+ children: n ? /* @__PURE__ */ e($, { post: l }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: l.title.rendered } }) })
15
15
  },
16
16
  l.id
17
17
  )) : null, J = ({
@@ -38,10 +38,10 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
38
38
  P,
39
39
  {
40
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" }) })
41
+ children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(S, { className: "icon" }) })
42
42
  }
43
43
  ),
44
- l ? /* @__PURE__ */ e(k, { post: a }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
44
+ l ? /* @__PURE__ */ e($, { post: a }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
45
45
  "span",
46
46
  {
47
47
  dangerouslySetInnerHTML: { __html: a.title.rendered }
@@ -54,7 +54,7 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
54
54
  a.id
55
55
  );
56
56
  }) : null;
57
- }, S = ({ posts: t, activeItem: o }) => (x(() => {
57
+ }, L = ({ 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) => {
@@ -70,7 +70,7 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
70
70
  visibility: "visible",
71
71
  position: "relative",
72
72
  width: "auto"
73
- }, /* @__PURE__ */ e(L, { as: b, fluid: !0, post: i, style: n }, i.slug);
73
+ }, /* @__PURE__ */ e(k, { as: b, fluid: !0, post: i, style: n }, i.slug);
74
74
  }) : null), K = ({ posts: t, activeItem: o, setActive: i }) => {
75
75
  const [n, l] = w(
76
76
  t.findIndex((s) => s.slug === o)
@@ -109,7 +109,7 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
109
109
  },
110
110
  children: [
111
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" }) }) }),
112
+ c && /* @__PURE__ */ e(P, { id: c, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(S, { className: "icon" }) }) }),
113
113
  /* @__PURE__ */ e(
114
114
  "span",
115
115
  {
@@ -129,7 +129,7 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
129
129
  {
130
130
  className: "accordion-post-content",
131
131
  active: n === u,
132
- children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(L, { post: s, as: b, fluid: !0 }) })
132
+ children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(k, { post: s, as: b, fluid: !0 }) })
133
133
  }
134
134
  )
135
135
  ] }, s.id);
@@ -146,13 +146,13 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
146
146
  }, [t]), /* @__PURE__ */ f(I.Fragment, { children: [
147
147
  t.map((r) => /* @__PURE__ */ e("anchor", { id: r.slug }, r.slug)),
148
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 }) })
149
+ /* @__PURE__ */ e(b, { className: "content-tab", style: { height: `${i}px` }, children: /* @__PURE__ */ e(L, { posts: t, activeItem: n }) })
150
150
  ] });
151
151
  }, X = ({ posts: t, showLabels: o, showIcons: i, height: n }) => {
152
152
  const [l, r] = w(t ? t[0].slug : null);
153
153
  return /* @__PURE__ */ e(I.Fragment, { children: /* @__PURE__ */ f(v, { stackable: !0, className: "tabbed posts", columns: t.length, style: { height: n + "px" }, children: [
154
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 }) }) }) })
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(L, { className: "content-tab", posts: t, activeItem: l }) }) }) })
156
156
  ] }) });
157
157
  }, Z = (t) => {
158
158
  var N;
@@ -173,7 +173,7 @@ const Y = ({ posts: t, activeItem: o, setActive: i, showLabels: n }) => t ? t.ma
173
173
  unique: j
174
174
  } = t;
175
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;
176
+ const D = t.intl.locale, R = Array.isArray(n) ? n.join(",").toString() : n, p = d === "true", C = p ? s : void 0, { width: H } = U(), z = H <= 1024, B = u !== "Desktop" && g, F = z && !g;
177
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
178
  q,
179
179
  {
@@ -1 +1,5 @@
1
+ export const COLOR_VARIABLE: "_Color_";
2
+ export function extractVariables(item: any): {};
3
+ export function extractVariablesDeep(item: any): {};
4
+ export function resolveOverrideColor(meta: any, measure: any): any;
1
5
  export function loadJSON(url: any): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devgateway/dvz-ui-react",
3
- "version": "1.9.12",
3
+ "version": "1.9.13",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",