@devgateway/dvz-ui-react 1.9.8 → 1.9.9

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const z=require("react"),Q=M=>{const{data:o,measures:S,customMeasureLabels:g,children:B,source:O,extraDimension:d,allDimensions:D}=M;console.log("MapDataFrame props:",M);const x=(O||"").split("/").filter(Boolean),h=x.length>0?x[0]:null,f={locationsData:[],nationalData:{},measureLabelMap:{}};o.metadata&&o.metadata.measures&&Array.isArray(o.metadata.measures),o.children&&o.children[0]&&o.children[0].children;const p=o.metadata||{},P=["value","count","type","children","label","measure"],E=D&&D.length>0?D:p.types||[],y={};E.forEach(e=>{const n=e.category||e.type;n&&(y[n]=e.items||[])});const F=(e,n)=>{const t=y[e];if(!t)return null;const r=n!=null?String(n):n;return t.find(a=>{const l=a.value!=null?String(a.value):a.value,i=a.id!=null?String(a.id):a.id,s=a.code!=null?String(a.code):a.code;return l===r||i===r||s===r})||null},u=(e,n)=>{const t=F(e,n);return t?t.value??t.label??t.id??t.code??n:n},j=(e={})=>{const n={};return Object.keys(e).forEach(t=>{const r=e[t];r!=null&&(Array.isArray(r)?n[t]=r.map(a=>u(t,a)).join(" ,"):n[t]=u(t,r))}),n},I=e=>{const n=y[e]||[];return n.length===1?u(e,n[0].value??n[0].id??n[0].code):null},c=e=>e!=null&&e!=="",L=e=>{if(e)return c(e.value)?e.value:c(e.id)?e.id:e.code},b=e=>e==null?"":String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),v=(e,n)=>{if(!e)return;const t=b(n),r=e[n];if(r!=null&&r!=="")return r;const a=Object.keys(e);for(let l=0;l<a.length;l++){const i=a[l];if(b(i)===t){const s=e[i];if(s!=null&&s!=="")return s}}},K=(e,n)=>{const t=[h,"country",e.type].filter(Boolean),r=[v(n,"country"),v(e,"country"),h?v(n,h):void 0,h?v(e,h):void 0,e.label,e.value].filter(a=>c(a));for(let a=0;a<t.length;a++){const l=t[a],i=y[l]||[];if(i.length)for(let s=0;s<r.length;s++){const _=r[s],G=b(_),w=i.findIndex(H=>{const J=L(H);return b(J)===G});if(w>=0)return w}}return-1},N=(e,n,t)=>{const r=K(n,t);if(r<0)return;const a=y[e]||[];if(!a.length||r>=a.length)return;const l=L(a[r]);if(c(l))return u(e,l)},q=(e,n,t)=>{const r=v(t,e);if(c(r))return r;if(c(A[e]))return A[e];const a=v(n,e);if(c(a))return a;const l=N(e,n,t);if(c(l))return l;const i=I(e);if(c(i))return i;const s=n.value;return F(e,s)?u(e,s):""},V=o.appliedFilters||{};let R=null;if(d){const e=V[d]?V[d][0]:void 0;R=u(d,e)}const A=j(V),$=e=>{const n={};return Object.keys(e).forEach(t=>{P.includes(t)||(n[t]=e[t])}),e.type&&e.value!==void 0&&(n[e.type]=u(e.type,e.value)),n},C=e=>{let n=$(e);return e.children&&Array.isArray(e.children)&&e.children.forEach(t=>{n={...n,...C(t)}}),n},T=(e,n)=>{if(!(!e.children||!Array.isArray(e.children)))return e.children.map(t=>({...t,label:t.value,value:t[n],variables:C(t),children:T(t,n)}))};p.measures&&p.measures.forEach(e=>{g&&g[e.value]&&g[e.value].hasCustomLabel&&g[e.value].customLabel?f.measureLabelMap[e.value]=g[e.value].customLabel:f.measureLabelMap[e.value]=e.label});const m=S.split(",");return o&&o.children&&(o.children.forEach(e=>{m.forEach(n=>{const t={...C(e),...A};E.forEach(a=>{const l=a.category||a.type;l&&(t[l]=q(l,e,t))});const r={...e,label:e.value,value:e[n],measure:n,variables:t};r.variables.selectedDataFrameTooltipValue=e[n],d&&(r.variables[d]=R),r.children=T(e,n),f.locationsData.push(r)})}),f.measures=m.length>1?m:null,f.nationalData.value=o[S]||o[m[0]]),z.Children.map(B,e=>z.cloneElement(e,{transformedData:{...f,types:p.types?p.types:[]}}))};exports.default=Q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const K=require("react"),ee=x=>{var P,j;const{data:l,measures:D,customMeasureLabels:h,children:W,source:B,extraDimension:A,allDimensions:C}=x;console.log("MapDataFrame props:",x);const T=(B||"").split("/").filter(Boolean),y=T.length>0?T[0]:null,i={locationsData:[],nationalData:{},measureLabelMap:{}};l.metadata&&l.metadata.measures&&Array.isArray(l.metadata.measures),l.children&&l.children[0]&&l.children[0].children;const L=l.metadata||{},q=["value","count","type","children","label","measure"],O=C&&C.length>0?C:L.types||[],b={};O.forEach(e=>{const n=e.category||e.type;n&&(b[n]=e.items||[])});const w=(e,n)=>{const a=b[e];if(!a)return null;const t=n!=null?String(n):n;return a.find(r=>{const o=r.value!=null?String(r.value):r.value,c=r.id!=null?String(r.id):r.id,s=r.code!=null?String(r.code):r.code;return o===t||c===t||s===t})||null},f=(e,n)=>{const a=w(e,n);return a?a.value??a.label??a.id??a.code??n:n},J=(e={})=>{const n={};return Object.keys(e).forEach(a=>{const t=e[a];t!=null&&(Array.isArray(t)?n[a]=t.map(r=>f(a,r)).join(" ,"):n[a]=f(a,t))}),n},$=e=>{const n=b[e]||[];return n.length===1?f(e,n[0].value??n[0].id??n[0].code):null},d=e=>e!=null&&e!=="",R=e=>{if(e)return d(e.value)?e.value:d(e.id)?e.id:e.code},V=e=>e==null?"":String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),v=(e,n)=>{if(!e)return;const a=V(n),t=e[n];if(t!=null&&t!=="")return t;const r=Object.keys(e);for(let o=0;o<r.length;o++){const c=r[o];if(V(c)===a){const s=e[c];if(s!=null&&s!=="")return s}}},G=(e,n)=>{const a=[y,"country",e.type].filter(Boolean),t=[v(n,"country"),v(e,"country"),y?v(n,y):void 0,y?v(e,y):void 0,e.label,e.value].filter(r=>d(r));for(let r=0;r<a.length;r++){const o=a[r],c=b[o]||[];if(c.length)for(let s=0;s<t.length;s++){const g=t[s],U=V(g),N=c.findIndex(k=>{const m=R(k);return V(m)===U});if(N>=0)return N}}return-1},H=(e,n,a)=>{const t=G(n,a);if(t<0)return;const r=b[e]||[];if(!r.length||t>=r.length)return;const o=R(r[t]);if(d(o))return f(e,o)},Q=(e,n,a)=>{const t=v(a,e);if(d(t))return t;if(d(S[e]))return S[e];const r=v(n,e);if(d(r))return r;const o=H(e,n,a);if(d(o))return o;const c=$(e);if(d(c))return c;const s=n.value;return w(e,s)?f(e,s):""},E=l.appliedFilters||{};if(A){const e=E[A]?E[A][0]:void 0;f(A,e)}const S=J(E),X=e=>{const n={};return Object.keys(e).forEach(a=>{q.includes(a)||(n[a]=e[a])}),e.type&&e.value!==void 0&&(n[e.type]=f(e.type,e.value)),n},F=e=>{let n=X(e);return e.children&&Array.isArray(e.children)&&e.children.forEach(a=>{n={...n,...F(a)}}),n},_=(e,n)=>{if(!(!e.children||!Array.isArray(e.children)))return e.children.map(a=>({...a,label:a.value,value:a[n],variables:F(a),children:_(a,n)}))};L.measures&&L.measures.forEach(e=>{h&&h[e.value]&&h[e.value].hasCustomLabel&&h[e.value].customLabel?i.measureLabelMap[e.value]=h[e.value].customLabel:i.measureLabelMap[e.value]=e.label});const z=(((P=l==null?void 0:l.metadata)==null?void 0:P.measures)||[]).map(e=>e==null?void 0:e.value).filter(Boolean),u=(()=>{if(Array.isArray(D))return D.map(e=>(""+e).trim()).filter(Boolean);if(typeof D=="string"){const e=D.trim();if(!e||e==="[]")return z;if(e.startsWith("[")&&e.endsWith("]"))try{const n=JSON.parse(e);if(Array.isArray(n))return n.map(a=>(""+a).trim()).filter(Boolean)}catch{}return e.split(",").map(n=>n.trim()).filter(Boolean)}return z})(),M=((j=l==null?void 0:l.metadata)==null?void 0:j.types)||[],Y=(B||"").split("/")[0],Z=M.find(e=>e.dimension===Y)||M[0],I=(e,n)=>{var o;if(typeof(e==null?void 0:e.value)=="string")return e.value;const t=M.find(c=>c.dimension===(e==null?void 0:e.type))||Z,r=(o=t==null?void 0:t.items)==null?void 0:o[n];return(r==null?void 0:r.value)||(r==null?void 0:r.code)||(e==null?void 0:e.label)||(e==null?void 0:e.value)},p=(e,n)=>{if(e&&Object.prototype.hasOwnProperty.call(e,n))return e[n];if(n==="value")return e==null?void 0:e.value};if(l&&l.children){l.children.forEach((n,a)=>{const t=I(n,a);u.forEach(r=>{const o={...F(n),...S};O.forEach(s=>{const g=s.category||s.type;g&&(o[g]=Q(g,n,o))});const c={...n,label:t,value:p(n,r),measure:r,variables:o};c.variables.selectedDataFrameTooltipValue=p(n,r),n.children&&(c.children=[],n.children.forEach(s=>{c.children.push({...s,label:s.value,value:p(s,r)})})),c.children=_(n,r),i.locationsData.push(c)})}),i.measures=u.length>1?u:null;const e=u.length>0?u[0]:null;i.nationalData.value=e?p(l,e):null}else if(l&&u.length>0){const e=typeof l.value=="string"&&l.value||l.label||l.type||"total";u.forEach(n=>{const a=p(l,n);a!==void 0&&i.locationsData.push({label:e,value:a,measure:n})}),i.measures=u.length>1?u:null,i.nationalData.value=p(l,u[0])}return K.Children.map(W,e=>K.cloneElement(e,{transformedData:{...i,types:M}}))};exports.default=ee;
@@ -1,165 +1,211 @@
1
- import T from "react";
2
- const U = (x) => {
3
- const { data: o, measures: M, customMeasureLabels: g, children: O, source: _, extraDimension: d, allDimensions: D } = x;
4
- console.log("MapDataFrame props:", x);
5
- const E = (_ || "").split("/").filter(Boolean), p = E.length > 0 ? E[0] : null, f = {
1
+ import K from "react";
2
+ const ae = (S) => {
3
+ var P, _;
4
+ const { data: l, measures: D, customMeasureLabels: h, children: W, source: B, extraDimension: A, allDimensions: C } = S;
5
+ console.log("MapDataFrame props:", S);
6
+ const T = (B || "").split("/").filter(Boolean), y = T.length > 0 ? T[0] : null, u = {
6
7
  locationsData: [],
7
8
  nationalData: {},
8
9
  measureLabelMap: {}
9
10
  };
10
- o.metadata && o.metadata.measures && Array.isArray(o.metadata.measures), o.children && o.children[0] && o.children[0].children;
11
- const h = o.metadata || {}, I = ["value", "count", "type", "children", "label", "measure"], F = D && D.length > 0 ? D : h.types || [], y = {};
12
- F.forEach((e) => {
11
+ l.metadata && l.metadata.measures && Array.isArray(l.metadata.measures), l.children && l.children[0] && l.children[0].children;
12
+ const L = l.metadata || {}, J = ["value", "count", "type", "children", "label", "measure"], O = C && C.length > 0 ? C : L.types || [], b = {};
13
+ O.forEach((e) => {
13
14
  const n = e.category || e.type;
14
- n && (y[n] = e.items || []);
15
+ n && (b[n] = e.items || []);
15
16
  });
16
- const L = (e, n) => {
17
- const a = y[e];
17
+ const w = (e, n) => {
18
+ const a = b[e];
18
19
  if (!a)
19
20
  return null;
20
- const r = n != null ? String(n) : n;
21
- return a.find((t) => {
22
- const l = t.value != null ? String(t.value) : t.value, i = t.id != null ? String(t.id) : t.id, s = t.code != null ? String(t.code) : t.code;
23
- return l === r || i === r || s === r;
21
+ const t = n != null ? String(n) : n;
22
+ return a.find((r) => {
23
+ const o = r.value != null ? String(r.value) : r.value, c = r.id != null ? String(r.id) : r.id, s = r.code != null ? String(r.code) : r.code;
24
+ return o === t || c === t || s === t;
24
25
  }) || null;
25
- }, u = (e, n) => {
26
- const a = L(e, n);
26
+ }, f = (e, n) => {
27
+ const a = w(e, n);
27
28
  return a ? a.value ?? a.label ?? a.id ?? a.code ?? n : n;
28
- }, K = (e = {}) => {
29
+ }, $ = (e = {}) => {
29
30
  const n = {};
30
31
  return Object.keys(e).forEach((a) => {
31
- const r = e[a];
32
- r != null && (Array.isArray(r) ? n[a] = r.map((t) => u(a, t)).join(" ,") : n[a] = u(a, r));
32
+ const t = e[a];
33
+ t != null && (Array.isArray(t) ? n[a] = t.map((r) => f(a, r)).join(" ,") : n[a] = f(a, t));
33
34
  }), n;
34
- }, N = (e) => {
35
- const n = y[e] || [];
36
- return n.length === 1 ? u(e, n[0].value ?? n[0].id ?? n[0].code) : null;
37
- }, c = (e) => e != null && e !== "", S = (e) => {
35
+ }, q = (e) => {
36
+ const n = b[e] || [];
37
+ return n.length === 1 ? f(e, n[0].value ?? n[0].id ?? n[0].code) : null;
38
+ }, d = (e) => e != null && e !== "", R = (e) => {
38
39
  if (e)
39
- return c(e.value) ? e.value : c(e.id) ? e.id : e.code;
40
- }, b = (e) => e == null ? "" : String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, ""), v = (e, n) => {
40
+ return d(e.value) ? e.value : d(e.id) ? e.id : e.code;
41
+ }, V = (e) => e == null ? "" : String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, ""), p = (e, n) => {
41
42
  if (!e)
42
43
  return;
43
- const a = b(n), r = e[n];
44
- if (r != null && r !== "")
45
- return r;
46
- const t = Object.keys(e);
47
- for (let l = 0; l < t.length; l++) {
48
- const i = t[l];
49
- if (b(i) === a) {
50
- const s = e[i];
44
+ const a = V(n), t = e[n];
45
+ if (t != null && t !== "")
46
+ return t;
47
+ const r = Object.keys(e);
48
+ for (let o = 0; o < r.length; o++) {
49
+ const c = r[o];
50
+ if (V(c) === a) {
51
+ const s = e[c];
51
52
  if (s != null && s !== "")
52
53
  return s;
53
54
  }
54
55
  }
55
- }, P = (e, n) => {
56
+ }, G = (e, n) => {
56
57
  const a = [
57
- p,
58
+ y,
58
59
  "country",
59
60
  e.type
60
- ].filter(Boolean), r = [
61
- v(n, "country"),
62
- v(e, "country"),
63
- p ? v(n, p) : void 0,
64
- p ? v(e, p) : void 0,
61
+ ].filter(Boolean), t = [
62
+ p(n, "country"),
63
+ p(e, "country"),
64
+ y ? p(n, y) : void 0,
65
+ y ? p(e, y) : void 0,
65
66
  e.label,
66
67
  e.value
67
- ].filter((t) => c(t));
68
- for (let t = 0; t < a.length; t++) {
69
- const l = a[t], i = y[l] || [];
70
- if (i.length)
71
- for (let s = 0; s < r.length; s++) {
72
- const z = r[s], G = b(z), B = i.findIndex((H) => {
73
- const J = S(H);
74
- return b(J) === G;
68
+ ].filter((r) => d(r));
69
+ for (let r = 0; r < a.length; r++) {
70
+ const o = a[r], c = b[o] || [];
71
+ if (c.length)
72
+ for (let s = 0; s < t.length; s++) {
73
+ const g = t[s], U = V(g), j = c.findIndex((k) => {
74
+ const m = R(k);
75
+ return V(m) === U;
75
76
  });
76
- if (B >= 0)
77
- return B;
77
+ if (j >= 0)
78
+ return j;
78
79
  }
79
80
  }
80
81
  return -1;
81
- }, j = (e, n, a) => {
82
- const r = P(n, a);
83
- if (r < 0)
82
+ }, H = (e, n, a) => {
83
+ const t = G(n, a);
84
+ if (t < 0)
84
85
  return;
85
- const t = y[e] || [];
86
- if (!t.length || r >= t.length)
86
+ const r = b[e] || [];
87
+ if (!r.length || t >= r.length)
87
88
  return;
88
- const l = S(t[r]);
89
- if (c(l))
90
- return u(e, l);
91
- }, $ = (e, n, a) => {
92
- const r = v(a, e);
93
- if (c(r))
94
- return r;
95
- if (c(A[e]))
96
- return A[e];
97
- const t = v(n, e);
98
- if (c(t))
89
+ const o = R(r[t]);
90
+ if (d(o))
91
+ return f(e, o);
92
+ }, Q = (e, n, a) => {
93
+ const t = p(a, e);
94
+ if (d(t))
99
95
  return t;
100
- const l = j(e, n, a);
101
- if (c(l))
102
- return l;
103
- const i = N(e);
104
- if (c(i))
105
- return i;
96
+ if (d(x[e]))
97
+ return x[e];
98
+ const r = p(n, e);
99
+ if (d(r))
100
+ return r;
101
+ const o = H(e, n, a);
102
+ if (d(o))
103
+ return o;
104
+ const c = q(e);
105
+ if (d(c))
106
+ return c;
106
107
  const s = n.value;
107
- return L(e, s) ? u(e, s) : "";
108
- }, V = o.appliedFilters || {};
109
- let R = null;
110
- if (d) {
111
- const e = V[d] ? V[d][0] : void 0;
112
- R = u(d, e);
108
+ return w(e, s) ? f(e, s) : "";
109
+ }, E = l.appliedFilters || {};
110
+ if (A) {
111
+ const e = E[A] ? E[A][0] : void 0;
112
+ f(A, e);
113
113
  }
114
- const A = K(V), q = (e) => {
114
+ const x = $(E), X = (e) => {
115
115
  const n = {};
116
116
  return Object.keys(e).forEach((a) => {
117
- I.includes(a) || (n[a] = e[a]);
118
- }), e.type && e.value !== void 0 && (n[e.type] = u(e.type, e.value)), n;
119
- }, C = (e) => {
120
- let n = q(e);
117
+ J.includes(a) || (n[a] = e[a]);
118
+ }), e.type && e.value !== void 0 && (n[e.type] = f(e.type, e.value)), n;
119
+ }, F = (e) => {
120
+ let n = X(e);
121
121
  return e.children && Array.isArray(e.children) && e.children.forEach((a) => {
122
- n = { ...n, ...C(a) };
122
+ n = { ...n, ...F(a) };
123
123
  }), n;
124
- }, w = (e, n) => {
124
+ }, z = (e, n) => {
125
125
  if (!(!e.children || !Array.isArray(e.children)))
126
126
  return e.children.map((a) => ({
127
127
  ...a,
128
128
  label: a.value,
129
129
  value: a[n],
130
- variables: C(a),
131
- children: w(a, n)
130
+ variables: F(a),
131
+ children: z(a, n)
132
132
  }));
133
133
  };
134
- h.measures && h.measures.forEach((e) => {
135
- g && g[e.value] && g[e.value].hasCustomLabel && g[e.value].customLabel ? f.measureLabelMap[e.value] = g[e.value].customLabel : f.measureLabelMap[e.value] = e.label;
134
+ L.measures && L.measures.forEach((e) => {
135
+ h && h[e.value] && h[e.value].hasCustomLabel && h[e.value].customLabel ? u.measureLabelMap[e.value] = h[e.value].customLabel : u.measureLabelMap[e.value] = e.label;
136
136
  });
137
- const m = M.split(",");
138
- return o && o.children && (o.children.forEach((e) => {
139
- m.forEach((n) => {
140
- const a = {
141
- ...C(e),
142
- // Dynamic fields for both formats, including nested dimensions
143
- ...A
144
- };
145
- F.forEach((t) => {
146
- const l = t.category || t.type;
147
- l && (a[l] = $(l, e, a));
137
+ const N = (((P = l == null ? void 0 : l.metadata) == null ? void 0 : P.measures) || []).map((e) => e == null ? void 0 : e.value).filter(Boolean), i = (() => {
138
+ if (Array.isArray(D))
139
+ return D.map((e) => ("" + e).trim()).filter(Boolean);
140
+ if (typeof D == "string") {
141
+ const e = D.trim();
142
+ if (!e || e === "[]")
143
+ return N;
144
+ if (e.startsWith("[") && e.endsWith("]"))
145
+ try {
146
+ const n = JSON.parse(e);
147
+ if (Array.isArray(n))
148
+ return n.map((a) => ("" + a).trim()).filter(Boolean);
149
+ } catch {
150
+ }
151
+ return e.split(",").map((n) => n.trim()).filter(Boolean);
152
+ }
153
+ return N;
154
+ })(), M = ((_ = l == null ? void 0 : l.metadata) == null ? void 0 : _.types) || [], Y = (B || "").split("/")[0], Z = M.find((e) => e.dimension === Y) || M[0], I = (e, n) => {
155
+ var o;
156
+ if (typeof (e == null ? void 0 : e.value) == "string")
157
+ return e.value;
158
+ const t = M.find((c) => c.dimension === (e == null ? void 0 : e.type)) || Z, r = (o = t == null ? void 0 : t.items) == null ? void 0 : o[n];
159
+ return (r == null ? void 0 : r.value) || (r == null ? void 0 : r.code) || (e == null ? void 0 : e.label) || (e == null ? void 0 : e.value);
160
+ }, v = (e, n) => {
161
+ if (e && Object.prototype.hasOwnProperty.call(e, n))
162
+ return e[n];
163
+ if (n === "value")
164
+ return e == null ? void 0 : e.value;
165
+ };
166
+ if (l && l.children) {
167
+ l.children.forEach((n, a) => {
168
+ const t = I(n, a);
169
+ i.forEach((r) => {
170
+ const o = {
171
+ ...F(n),
172
+ // Dynamic fields for both formats, including nested dimensions
173
+ ...x
174
+ };
175
+ O.forEach((s) => {
176
+ const g = s.category || s.type;
177
+ g && (o[g] = Q(g, n, o));
178
+ });
179
+ const c = {
180
+ ...n,
181
+ label: t,
182
+ value: v(n, r),
183
+ measure: r,
184
+ variables: o
185
+ };
186
+ c.variables.selectedDataFrameTooltipValue = v(n, r), n.children && (c.children = [], n.children.forEach((s) => {
187
+ c.children.push({ ...s, label: s.value, value: v(s, r) });
188
+ })), c.children = z(n, r), u.locationsData.push(c);
148
189
  });
149
- const r = {
150
- ...e,
151
- label: e.value,
152
- value: e[n],
153
- measure: n,
154
- variables: a
155
- };
156
- r.variables.selectedDataFrameTooltipValue = e[n], d && (r.variables[d] = R), r.children = w(e, n), f.locationsData.push(r);
157
- });
158
- }), f.measures = m.length > 1 ? m : null, f.nationalData.value = o[M] || o[m[0]]), T.Children.map(O, (e) => T.cloneElement(e, { transformedData: {
159
- ...f,
160
- types: h.types ? h.types : []
190
+ }), u.measures = i.length > 1 ? i : null;
191
+ const e = i.length > 0 ? i[0] : null;
192
+ u.nationalData.value = e ? v(l, e) : null;
193
+ } else if (l && i.length > 0) {
194
+ const e = typeof l.value == "string" && l.value || l.label || l.type || "total";
195
+ i.forEach((n) => {
196
+ const a = v(l, n);
197
+ a !== void 0 && u.locationsData.push({
198
+ label: e,
199
+ value: a,
200
+ measure: n
201
+ });
202
+ }), u.measures = i.length > 1 ? i : null, u.nationalData.value = v(l, i[0]);
203
+ }
204
+ return K.Children.map(W, (e) => K.cloneElement(e, { transformedData: {
205
+ ...u,
206
+ types: M
161
207
  } }));
162
208
  };
163
209
  export {
164
- U as default
210
+ ae as default
165
211
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devgateway/dvz-ui-react",
3
- "version": "1.9.8",
3
+ "version": "1.9.9",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",