@undp/data-viz 1.3.1 → 1.4.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/DataCards.cjs +21 -1
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +622 -12
- package/dist/DataCards.js.map +1 -1
- package/dist/GraphEl-B6SoGRFW.cjs +2 -0
- package/dist/GraphEl-B6SoGRFW.cjs.map +1 -0
- package/dist/{checkIfMultiple-BB7PlCNh.js → GraphEl-Cw2tDUb3.js} +129 -1163
- package/dist/GraphEl-Cw2tDUb3.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.cjs.map +1 -1
- package/dist/GriddedGraphs.d.ts +2 -4
- package/dist/GriddedGraphs.js +9 -8
- package/dist/GriddedGraphs.js.map +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +2 -4
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.cjs.map +1 -1
- package/dist/MultiGraphDashboard.d.ts +16 -12
- package/dist/MultiGraphDashboard.js +2 -2
- package/dist/MultiGraphDashboardFromConfig.d.ts +16 -12
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +2 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +566 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +353 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +2 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +570 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +38 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -0
- package/dist/PerformanceIntensiveScrollStory.cjs +2 -0
- package/dist/PerformanceIntensiveScrollStory.cjs.map +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +493 -0
- package/dist/PerformanceIntensiveScrollStory.js +122 -0
- package/dist/PerformanceIntensiveScrollStory.js.map +1 -0
- package/dist/ScrollStory.cjs.map +1 -1
- package/dist/ScrollStory.d.ts +3 -5
- package/dist/ScrollStory.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.cjs.map +1 -1
- package/dist/SingleGraphDashboard.d.ts +2 -5
- package/dist/SingleGraphDashboard.js +194 -194
- package/dist/SingleGraphDashboard.js.map +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +2 -4
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +2 -0
- package/dist/SingleGraphDashboardGeoHubMaps.cjs.map +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +428 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +185 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +2 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs.map +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +432 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +25 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +2 -0
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +540 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +610 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +2 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs.map +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +543 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +35 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -0
- package/dist/Types.d.ts +38 -11
- package/dist/checkIfMultiple-CYp3vADF.js +912 -0
- package/dist/checkIfMultiple-CYp3vADF.js.map +1 -0
- package/dist/checkIfMultiple-Do4kADNr.cjs +12 -0
- package/dist/checkIfMultiple-Do4kADNr.cjs.map +1 -0
- package/dist/getSchema.cjs.map +1 -1
- package/dist/getSchema.d.ts +7 -5
- package/dist/getSchema.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +330 -163
- package/dist/index.js +150 -136
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.d.ts +5 -5
- package/dist/transformData.js +2 -2
- package/dist/{transformDataForAggregation-DAQJWGNL.js → transformDataForAggregation-CdcwlnNe.js} +2 -2
- package/dist/transformDataForAggregation-CdcwlnNe.js.map +1 -0
- package/dist/{transformDataForAggregation-BUGJnson.cjs → transformDataForAggregation-Du-Hei-W.cjs} +2 -2
- package/dist/transformDataForAggregation-Du-Hei-W.cjs.map +1 -0
- package/dist/{transformDataForGraphFromFile-DdNiOWeC.js → transformDataForGraphFromFile-CA0rw80A.js} +2 -2
- package/dist/{transformDataForGraphFromFile-DdNiOWeC.js.map → transformDataForGraphFromFile-CA0rw80A.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-CrntpaMU.cjs → transformDataForGraphFromFile-D9G3ToQf.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-CrntpaMU.cjs.map → transformDataForGraphFromFile-D9G3ToQf.cjs.map} +1 -1
- package/dist/transformDataForSelect-D8AuvYdf.js +14 -0
- package/dist/transformDataForSelect-D8AuvYdf.js.map +1 -0
- package/dist/transformDataForSelect-YmStusCI.cjs +2 -0
- package/dist/transformDataForSelect-YmStusCI.cjs.map +1 -0
- package/dist/validateSchema.d.ts +2 -4
- package/package.json +37 -2
- package/dist/checkIfMultiple-BB7PlCNh.js.map +0 -1
- package/dist/checkIfMultiple-D5ysrI7G.cjs +0 -12
- package/dist/checkIfMultiple-D5ysrI7G.cjs.map +0 -1
- package/dist/index-D9h2WYDS.cjs +0 -22
- package/dist/index-D9h2WYDS.cjs.map +0 -1
- package/dist/index-OCoyy1wG.js +0 -635
- package/dist/index-OCoyy1wG.js.map +0 -1
- package/dist/transformDataForAggregation-BUGJnson.cjs.map +0 -1
- package/dist/transformDataForAggregation-DAQJWGNL.js.map +0 -1
package/dist/index-OCoyy1wG.js
DELETED
|
@@ -1,635 +0,0 @@
|
|
|
1
|
-
import { a as s, m, b as fe, j as i } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
-
import D, { useState as w, useEffect as z, useMemo as Q } from "react";
|
|
3
|
-
import { i as ge } from "./index-C1rRk_50.js";
|
|
4
|
-
import { f as A } from "./index-UV9hjG_S.js";
|
|
5
|
-
import { s as he } from "./index-DxagiOHo.js";
|
|
6
|
-
import { Z as W, H as Z } from "./DropdownSelect-CDC9lEqU.js";
|
|
7
|
-
import { u as X } from "./Typography-Ctgfl1J5.js";
|
|
8
|
-
import { b as P } from "./x-CnsEH4Ox-DDvAJndW.js";
|
|
9
|
-
import { d as xe, e as be } from "./index-BmCqpO1B.js";
|
|
10
|
-
import { X as ve } from "./Modal-CUU6ZK3U.js";
|
|
11
|
-
import { CsvDownloadButton as Ne } from "./CsvDownloadButton.js";
|
|
12
|
-
import { s as J } from "./string2HTML-CWHGfz_d.js";
|
|
13
|
-
import { GraphFooter as je } from "./GraphFooter.js";
|
|
14
|
-
import { GraphHeader as we } from "./GraphHeader.js";
|
|
15
|
-
import { g as ke } from "./getUniqValue-BtUENB2H.js";
|
|
16
|
-
/**
|
|
17
|
-
* @license lucide-react v0.488.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/
|
|
22
|
-
const Ce = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Se = P("chevron-left", Ce);
|
|
23
|
-
/**
|
|
24
|
-
* @license lucide-react v0.488.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/
|
|
29
|
-
const $e = [
|
|
30
|
-
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
31
|
-
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
32
|
-
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
33
|
-
], De = P("ellipsis", $e);
|
|
34
|
-
/**
|
|
35
|
-
* @license lucide-react v0.488.0 - ISC
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the ISC license.
|
|
38
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
const Ve = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ze = P("chevron-right", Ve);
|
|
41
|
-
function re({ className: a, ...e }) {
|
|
42
|
-
return /* @__PURE__ */ s.jsx(
|
|
43
|
-
"nav",
|
|
44
|
-
{
|
|
45
|
-
...e,
|
|
46
|
-
role: "navigation",
|
|
47
|
-
"aria-label": "pagination",
|
|
48
|
-
className: m("mx-auto flex w-full justify-center", a)
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
re.displayName = "PaginationUnit";
|
|
53
|
-
const te = D.forwardRef(
|
|
54
|
-
({ className: a, ...e }, l) => /* @__PURE__ */ s.jsx(
|
|
55
|
-
"ul",
|
|
56
|
-
{
|
|
57
|
-
...e,
|
|
58
|
-
ref: l,
|
|
59
|
-
className: m("flex flex-row items-center gap-1 list-none", a)
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
);
|
|
63
|
-
te.displayName = "PaginationContent";
|
|
64
|
-
const I = D.forwardRef(
|
|
65
|
-
({ className: a, ...e }, l) => /* @__PURE__ */ s.jsx("li", { ...e, ref: l, className: m("mr-2 last:mr-0", a) })
|
|
66
|
-
);
|
|
67
|
-
I.displayName = "PaginationItem";
|
|
68
|
-
function B({
|
|
69
|
-
className: a,
|
|
70
|
-
children: e,
|
|
71
|
-
...l
|
|
72
|
-
}) {
|
|
73
|
-
return /* @__PURE__ */ s.jsx(
|
|
74
|
-
"button",
|
|
75
|
-
{
|
|
76
|
-
...l,
|
|
77
|
-
type: "button",
|
|
78
|
-
className: m(
|
|
79
|
-
"p-4 text-base text-primary-black dark:text-primary-gray-100 dark:hover:bg-primary-gray-600",
|
|
80
|
-
a
|
|
81
|
-
),
|
|
82
|
-
children: e
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
B.displayName = "PaginationLink";
|
|
87
|
-
function se({ className: a, ...e }) {
|
|
88
|
-
return /* @__PURE__ */ s.jsx(
|
|
89
|
-
B,
|
|
90
|
-
{
|
|
91
|
-
...e,
|
|
92
|
-
"aria-label": "Go to previous page",
|
|
93
|
-
className: m(
|
|
94
|
-
"p-2 bg-primary-gray-300 dark:bg-primary-gray-600 rtl:scale-x-[-1] rounded-full hover:bg-primary-gray-400 dark:hover:bg-primary-gray-550",
|
|
95
|
-
a
|
|
96
|
-
),
|
|
97
|
-
children: /* @__PURE__ */ s.jsx(Se, { className: "h-6 w-6 stroke-primary-gray-700 dark:stroke-primary-gray-100" })
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
se.displayName = "PaginationPrevious";
|
|
102
|
-
function le({ className: a, ...e }) {
|
|
103
|
-
return /* @__PURE__ */ s.jsx(
|
|
104
|
-
B,
|
|
105
|
-
{
|
|
106
|
-
...e,
|
|
107
|
-
"aria-label": "Go to next page",
|
|
108
|
-
className: m(
|
|
109
|
-
"p-2 bg-primary-gray-300 dark:bg-primary-gray-600 rtl:scale-x-[-1] rounded-full hover:bg-primary-gray-400 dark:hover:bg-primary-gray-550",
|
|
110
|
-
a
|
|
111
|
-
),
|
|
112
|
-
children: /* @__PURE__ */ s.jsx(ze, { className: "h-6 w-6 stroke-primary-gray-700 dark:stroke-primary-gray-100" })
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
le.displayName = "PaginationNext";
|
|
117
|
-
function ie({ className: a, ...e }) {
|
|
118
|
-
return /* @__PURE__ */ s.jsxs(
|
|
119
|
-
"span",
|
|
120
|
-
{
|
|
121
|
-
...e,
|
|
122
|
-
"aria-hidden": !0,
|
|
123
|
-
className: m("flex h-9 w-9 items-center justify-center", a),
|
|
124
|
-
children: [
|
|
125
|
-
/* @__PURE__ */ s.jsx(De, { className: "h-4 w-4 text-primary-gray-700 dark:text-primary-gray-100" }),
|
|
126
|
-
/* @__PURE__ */ s.jsx("span", { className: "sr-only", children: "More pages" })
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
ie.displayName = "PaginationEllipsis";
|
|
132
|
-
const Y = (a, e) => {
|
|
133
|
-
const l = [];
|
|
134
|
-
return e <= 7 ? Array.from({ length: e }, (n, c) => c + 1) : (l.push(1), a <= 3 ? l.push(2, 3, 4, "ellipsis") : a >= e - 2 ? l.push("ellipsis", e - 3, e - 2, e - 1) : l.push("ellipsis", a - 1, a, a + 1, "ellipsis"), l.push(e), l);
|
|
135
|
-
};
|
|
136
|
-
function Ie(a) {
|
|
137
|
-
const { defaultPage: e = 1, total: l, pageSize: n, onChange: c, className: p } = a, u = Math.ceil(l / n), [d, o] = w(e), [h, y] = w(
|
|
138
|
-
Y(e, u)
|
|
139
|
-
);
|
|
140
|
-
return z(() => {
|
|
141
|
-
y(Y(d, u));
|
|
142
|
-
}, [d, u]), /* @__PURE__ */ s.jsx(re, { className: m("select-none", p), children: /* @__PURE__ */ s.jsxs(te, { children: [
|
|
143
|
-
/* @__PURE__ */ s.jsx(I, { children: /* @__PURE__ */ s.jsx(
|
|
144
|
-
se,
|
|
145
|
-
{
|
|
146
|
-
onClick: () => {
|
|
147
|
-
d > 1 && (c(d - 1), o(d - 1));
|
|
148
|
-
},
|
|
149
|
-
className: m(
|
|
150
|
-
"cursor-pointer",
|
|
151
|
-
d <= 1 && "cursor-not-allowed pointer-events-none opacity-35"
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
) }),
|
|
155
|
-
h.map((g, v) => /* @__PURE__ */ s.jsx(I, { children: g === "ellipsis" ? /* @__PURE__ */ s.jsx(ie, {}) : /* @__PURE__ */ s.jsx(
|
|
156
|
-
B,
|
|
157
|
-
{
|
|
158
|
-
onClick: () => {
|
|
159
|
-
o(g), c(g);
|
|
160
|
-
},
|
|
161
|
-
className: m(
|
|
162
|
-
"cursor-pointer w-[32px] h-[32px] flex items-center justify-center rounded-full hover:bg-primary-gray-300",
|
|
163
|
-
g === d && "bg-primary-blue-600 hover:bg-primary-blue-700 dark:bg-primary-blue-500 dark:hover:bg-primary-blue-400 hover:text-primary-wite text-primary-white"
|
|
164
|
-
),
|
|
165
|
-
children: g
|
|
166
|
-
}
|
|
167
|
-
) }, v)),
|
|
168
|
-
/* @__PURE__ */ s.jsx(I, { children: /* @__PURE__ */ s.jsx(
|
|
169
|
-
le,
|
|
170
|
-
{
|
|
171
|
-
onClick: () => {
|
|
172
|
-
d < u && (c(d + 1), o(d + 1));
|
|
173
|
-
},
|
|
174
|
-
className: m(
|
|
175
|
-
"cursor-pointer",
|
|
176
|
-
d >= u && "cursor-not-allowed pointer-events-none opacity-35"
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
) })
|
|
180
|
-
] }) });
|
|
181
|
-
}
|
|
182
|
-
const Pe = fe(
|
|
183
|
-
"w-full h-auto bg-primary-white dark:bg-primary-gray-650 text-primary-black dark:text-primary-white text-base transition-colors file:border-0 file:bg-transparent file:font-medium file:text-primary-gray-700 dark:file:text-primary-white focus-visible:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 placeholder:text-primary-gray-550 dark:placeholder:text-primary-gray-400",
|
|
184
|
-
{
|
|
185
|
-
variants: {
|
|
186
|
-
variant: {
|
|
187
|
-
light: "border border-primary-gray-400 dark:border-primary-gray-500",
|
|
188
|
-
normal: "border-2 border-primary-black dark:border-primary-gray-300"
|
|
189
|
-
},
|
|
190
|
-
inputSize: {
|
|
191
|
-
sm: "px-2.5 py-1",
|
|
192
|
-
base: "p-2.5"
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
defaultVariants: {
|
|
196
|
-
inputSize: "base",
|
|
197
|
-
variant: "normal"
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
), ne = D.forwardRef(({ className: a, inputSize: e, variant: l, ...n }, c) => /* @__PURE__ */ s.jsx("input", { ...n, ref: c, className: m(Pe({ inputSize: e, variant: l }), a) }));
|
|
201
|
-
ne.displayName = "Input";
|
|
202
|
-
/**
|
|
203
|
-
* @license lucide-react v0.488.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/
|
|
208
|
-
const Be = [
|
|
209
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
210
|
-
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
211
|
-
], ee = P("search", Be), oe = D.forwardRef(
|
|
212
|
-
({
|
|
213
|
-
className: a,
|
|
214
|
-
inputClassName: e,
|
|
215
|
-
buttonClassName: l,
|
|
216
|
-
onSearch: n,
|
|
217
|
-
searchOnlyOnClick: c,
|
|
218
|
-
buttonVariant: p,
|
|
219
|
-
buttonChildren: u,
|
|
220
|
-
showSearchButton: d,
|
|
221
|
-
inputVariant: o,
|
|
222
|
-
inputSize: h,
|
|
223
|
-
placeholder: y,
|
|
224
|
-
...g
|
|
225
|
-
}, v) => {
|
|
226
|
-
const [x, b] = D.useState(void 0), [N, r] = D.useState(!1);
|
|
227
|
-
return /* @__PURE__ */ s.jsxs("div", { className: m("flex gap-0", a), ref: v, children: [
|
|
228
|
-
/* @__PURE__ */ s.jsxs("div", { className: "relative w-full", children: [
|
|
229
|
-
/* @__PURE__ */ s.jsx(
|
|
230
|
-
ne,
|
|
231
|
-
{
|
|
232
|
-
...g,
|
|
233
|
-
variant: o,
|
|
234
|
-
type: "text",
|
|
235
|
-
className: e,
|
|
236
|
-
onChange: (f) => {
|
|
237
|
-
b(f.target.value), c || n?.(f.target.value);
|
|
238
|
-
},
|
|
239
|
-
inputSize: h,
|
|
240
|
-
onKeyDown: (f) => {
|
|
241
|
-
f.key === "Enter" && n?.(x);
|
|
242
|
-
},
|
|
243
|
-
onFocus: () => r(!0),
|
|
244
|
-
onBlur: () => r(!1)
|
|
245
|
-
}
|
|
246
|
-
),
|
|
247
|
-
!N && (x === "" || !x) && /* @__PURE__ */ s.jsxs("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: [
|
|
248
|
-
u ? null : /* @__PURE__ */ s.jsx(ee, { className: "h-4 w-4 text-primary-gray-500 dark:text-primary-gray-400 mr-2" }),
|
|
249
|
-
/* @__PURE__ */ s.jsx("span", { className: "text-primary-gray-500 dark:text-primary-gray-400", children: y || "Search..." })
|
|
250
|
-
] })
|
|
251
|
-
] }),
|
|
252
|
-
d === !1 ? null : /* @__PURE__ */ s.jsx(
|
|
253
|
-
xe,
|
|
254
|
-
{
|
|
255
|
-
variant: p || "icon",
|
|
256
|
-
className: l,
|
|
257
|
-
padding: h,
|
|
258
|
-
onClick: () => {
|
|
259
|
-
n?.(x);
|
|
260
|
-
},
|
|
261
|
-
children: u || /* @__PURE__ */ s.jsx(ee, { className: "stroke-2" })
|
|
262
|
-
}
|
|
263
|
-
)
|
|
264
|
-
] });
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
oe.displayName = "Search";
|
|
268
|
-
const Oe = (a) => a ? Object.entries(a).map(([l, n]) => Array.isArray(n) ? {
|
|
269
|
-
" ": l,
|
|
270
|
-
value: `"${n.join("; ")}"`
|
|
271
|
-
} : {
|
|
272
|
-
" ": l,
|
|
273
|
-
value: `"${n}"`
|
|
274
|
-
}) : {};
|
|
275
|
-
function Fe(a) {
|
|
276
|
-
const {
|
|
277
|
-
width: e,
|
|
278
|
-
height: l,
|
|
279
|
-
data: n,
|
|
280
|
-
onSeriesMouseClick: c,
|
|
281
|
-
cardTemplate: p,
|
|
282
|
-
cardBackgroundColor: u,
|
|
283
|
-
cardMinWidth: d = 320,
|
|
284
|
-
detailsOnClick: o,
|
|
285
|
-
noOfItemsInAPage: h,
|
|
286
|
-
styles: y,
|
|
287
|
-
classNames: g,
|
|
288
|
-
page: v,
|
|
289
|
-
allowDataDownloadOnDetail: x
|
|
290
|
-
} = a, [b, N] = w(void 0);
|
|
291
|
-
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
292
|
-
/* @__PURE__ */ i.jsx(
|
|
293
|
-
"div",
|
|
294
|
-
{
|
|
295
|
-
className: "undp-scrollbar w-full my-0 mx-auto grid gap-4 undp-viz-data-cards-container",
|
|
296
|
-
style: {
|
|
297
|
-
width: e ? `${e}px` : "100%",
|
|
298
|
-
height: l ? `${l}px` : "auto",
|
|
299
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${d}px, 1fr))`
|
|
300
|
-
},
|
|
301
|
-
children: n.filter(
|
|
302
|
-
(r, f) => h ? f < v * h && f >= (v - 1) * h : !0
|
|
303
|
-
).map((r, f) => /* @__PURE__ */ i.jsx(
|
|
304
|
-
"div",
|
|
305
|
-
{
|
|
306
|
-
style: {
|
|
307
|
-
...y?.dataCards || {},
|
|
308
|
-
...u && { backgroundColor: u }
|
|
309
|
-
},
|
|
310
|
-
className: `w-full flex flex-col ${c || o ? "cursor-pointer" : "cursor-auto"}${u ? "" : "bg-primary-gray-200 dark:bg-primary-gray-600"} ${g?.dataCards || ""}`,
|
|
311
|
-
onClick: () => {
|
|
312
|
-
c?.(r), N(r);
|
|
313
|
-
},
|
|
314
|
-
dangerouslySetInnerHTML: typeof p == "string" ? { __html: J(p, r) } : void 0,
|
|
315
|
-
children: typeof p == "function" ? p(r) : null
|
|
316
|
-
},
|
|
317
|
-
f
|
|
318
|
-
))
|
|
319
|
-
}
|
|
320
|
-
),
|
|
321
|
-
o && b !== void 0 ? /* @__PURE__ */ i.jsxs(
|
|
322
|
-
ve,
|
|
323
|
-
{
|
|
324
|
-
open: b !== void 0,
|
|
325
|
-
onClose: () => {
|
|
326
|
-
N(void 0);
|
|
327
|
-
},
|
|
328
|
-
children: [
|
|
329
|
-
/* @__PURE__ */ i.jsx(
|
|
330
|
-
"div",
|
|
331
|
-
{
|
|
332
|
-
className: "graph-modal-content m-0",
|
|
333
|
-
dangerouslySetInnerHTML: typeof o == "string" ? { __html: J(o, b) } : void 0,
|
|
334
|
-
children: typeof o == "function" ? o(b) : null
|
|
335
|
-
}
|
|
336
|
-
),
|
|
337
|
-
x ? /* @__PURE__ */ i.jsx("div", { className: "flex", children: /* @__PURE__ */ i.jsx(
|
|
338
|
-
Ne,
|
|
339
|
-
{
|
|
340
|
-
csvData: Oe(b),
|
|
341
|
-
headers: [
|
|
342
|
-
{
|
|
343
|
-
label: " ",
|
|
344
|
-
key: " "
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
label: "value",
|
|
348
|
-
key: "value"
|
|
349
|
-
}
|
|
350
|
-
],
|
|
351
|
-
buttonContent: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
352
|
-
typeof x == "string" ? x : null,
|
|
353
|
-
/* @__PURE__ */ i.jsx(be, {})
|
|
354
|
-
] })
|
|
355
|
-
}
|
|
356
|
-
) }) : null
|
|
357
|
-
]
|
|
358
|
-
}
|
|
359
|
-
) : null
|
|
360
|
-
] });
|
|
361
|
-
}
|
|
362
|
-
function ae(a) {
|
|
363
|
-
if (a !== void 0)
|
|
364
|
-
return Array.isArray(a) ? a.map((e) => ({
|
|
365
|
-
value: e,
|
|
366
|
-
label: e
|
|
367
|
-
})) : {
|
|
368
|
-
value: a,
|
|
369
|
-
label: a
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
const Me = (a, e, l) => e.length === 0 ? a : a.filter(
|
|
373
|
-
(n) => e.some((c) => n[c]?.toLowerCase().includes(l.toLowerCase()))
|
|
374
|
-
);
|
|
375
|
-
function Je(a) {
|
|
376
|
-
const {
|
|
377
|
-
width: e,
|
|
378
|
-
height: l,
|
|
379
|
-
graphTitle: n,
|
|
380
|
-
sources: c,
|
|
381
|
-
graphDescription: p,
|
|
382
|
-
footNote: u,
|
|
383
|
-
graphID: d,
|
|
384
|
-
data: o,
|
|
385
|
-
onSeriesMouseClick: h,
|
|
386
|
-
language: y = "en",
|
|
387
|
-
theme: g = "light",
|
|
388
|
-
ariaLabel: v,
|
|
389
|
-
cardTemplate: x,
|
|
390
|
-
cardBackgroundColor: b,
|
|
391
|
-
cardFilters: N,
|
|
392
|
-
cardSortingOptions: r,
|
|
393
|
-
cardSearchColumns: f,
|
|
394
|
-
cardMinWidth: ce = 320,
|
|
395
|
-
backgroundColor: k = !1,
|
|
396
|
-
padding: L,
|
|
397
|
-
detailsOnClick: de,
|
|
398
|
-
allowDataDownloadOnDetail: ue = !1,
|
|
399
|
-
noOfItemsInAPage: O,
|
|
400
|
-
uiMode: F = "normal",
|
|
401
|
-
styles: C,
|
|
402
|
-
classNames: S
|
|
403
|
-
} = a, [M, _] = w(o), [me, H] = w(1), [q, pe] = w(""), G = Q(
|
|
404
|
-
() => (N || []).map((t) => ({
|
|
405
|
-
filter: t.column,
|
|
406
|
-
label: t.label || `Filter by ${t.column}`,
|
|
407
|
-
singleSelect: !0,
|
|
408
|
-
clearable: !0,
|
|
409
|
-
defaultValue: ae(t.defaultValue),
|
|
410
|
-
availableValues: ke(o, t.column).filter((j) => !t.excludeValues?.includes(`${j}`)).map((j) => ({ value: j, label: j })),
|
|
411
|
-
width: t.width
|
|
412
|
-
})),
|
|
413
|
-
[N, o]
|
|
414
|
-
), [E, ye] = w(
|
|
415
|
-
(N || []).map((t) => ({
|
|
416
|
-
filter: t.column,
|
|
417
|
-
value: ae(t.defaultValue)
|
|
418
|
-
}))
|
|
419
|
-
), [V, U] = w(
|
|
420
|
-
r ? !r.defaultValue || r.options.findIndex((t) => t.label === r.defaultValue) === -1 ? r.options[0] : r.options[r.options.findIndex((t) => t.label === r.defaultValue)] : void 0
|
|
421
|
-
), K = Q(
|
|
422
|
-
() => ({
|
|
423
|
-
ignoreCase: !0,
|
|
424
|
-
ignoreAccents: !0,
|
|
425
|
-
trim: !0
|
|
426
|
-
}),
|
|
427
|
-
[]
|
|
428
|
-
);
|
|
429
|
-
return z(() => {
|
|
430
|
-
U(
|
|
431
|
-
r ? !r.defaultValue || r.options.findIndex(
|
|
432
|
-
(t) => t.label === r.defaultValue
|
|
433
|
-
) === -1 ? r.options[0] : r.options[r.options.findIndex(
|
|
434
|
-
(t) => t.label === r.defaultValue
|
|
435
|
-
)] : void 0
|
|
436
|
-
);
|
|
437
|
-
}, [r]), z(() => {
|
|
438
|
-
const t = Me(o, f || [], q).filter(
|
|
439
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
440
|
-
(j) => E.every(
|
|
441
|
-
($) => $.value && A([$.value]).length > 0 ? ge(
|
|
442
|
-
A([j[$.filter]]),
|
|
443
|
-
A([$.value]).map((T) => T.value)
|
|
444
|
-
).length > 0 : !0
|
|
445
|
-
)
|
|
446
|
-
);
|
|
447
|
-
_(V ? he(t, V?.value, V?.type) : t);
|
|
448
|
-
}, [o, f, q, E, V]), z(() => {
|
|
449
|
-
H(1);
|
|
450
|
-
}, [M]), /* @__PURE__ */ i.jsx(
|
|
451
|
-
"div",
|
|
452
|
-
{
|
|
453
|
-
className: `${g || "light"} flex ${e ? "w-fit grow-0" : "w-full grow"}`,
|
|
454
|
-
dir: y === "he" || y === "ar" ? "rtl" : void 0,
|
|
455
|
-
children: /* @__PURE__ */ i.jsx(
|
|
456
|
-
"div",
|
|
457
|
-
{
|
|
458
|
-
className: m(
|
|
459
|
-
`${k ? k === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${y || "en"}`,
|
|
460
|
-
S?.graphContainer
|
|
461
|
-
),
|
|
462
|
-
style: {
|
|
463
|
-
...C?.graphContainer || {},
|
|
464
|
-
...k && k !== !0 ? { backgroundColor: k } : {}
|
|
465
|
-
},
|
|
466
|
-
id: d,
|
|
467
|
-
"aria-label": v || `${n ? `The graph shows ${n}. ` : ""}This is an list of cards. ${p ? ` ${p}` : ""}`,
|
|
468
|
-
children: /* @__PURE__ */ i.jsx(
|
|
469
|
-
"div",
|
|
470
|
-
{
|
|
471
|
-
className: "flex grow",
|
|
472
|
-
style: { padding: k ? L || "1rem" : L || 0 },
|
|
473
|
-
children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col grow gap-3 w-full justify-between", children: [
|
|
474
|
-
n || p ? /* @__PURE__ */ i.jsx(
|
|
475
|
-
we,
|
|
476
|
-
{
|
|
477
|
-
styles: {
|
|
478
|
-
title: C?.title,
|
|
479
|
-
description: C?.description
|
|
480
|
-
},
|
|
481
|
-
classNames: {
|
|
482
|
-
title: S?.title,
|
|
483
|
-
description: S?.description
|
|
484
|
-
},
|
|
485
|
-
graphTitle: n,
|
|
486
|
-
graphDescription: p,
|
|
487
|
-
width: e
|
|
488
|
-
}
|
|
489
|
-
) : null,
|
|
490
|
-
r || G.length > 0 ? /* @__PURE__ */ i.jsxs("div", { className: "flex gap-4 flex-wrap items-start w-full", children: [
|
|
491
|
-
r ? /* @__PURE__ */ i.jsxs(
|
|
492
|
-
"div",
|
|
493
|
-
{
|
|
494
|
-
className: "grow shrink-0 min-w-[240px]",
|
|
495
|
-
style: { width: r.width || "calc(25% - 0.75rem)" },
|
|
496
|
-
children: [
|
|
497
|
-
/* @__PURE__ */ i.jsx(
|
|
498
|
-
X,
|
|
499
|
-
{
|
|
500
|
-
marginBottom: "xs",
|
|
501
|
-
size: "sm",
|
|
502
|
-
className: "text-primary-gray-700 dark:text-primary-gray-100",
|
|
503
|
-
children: "Sort by"
|
|
504
|
-
}
|
|
505
|
-
),
|
|
506
|
-
/* @__PURE__ */ i.jsx(
|
|
507
|
-
W,
|
|
508
|
-
{
|
|
509
|
-
options: r.options,
|
|
510
|
-
isRtl: y === "he" || y === "ar",
|
|
511
|
-
isSearchable: !0,
|
|
512
|
-
filterOption: Z(K),
|
|
513
|
-
onChange: (t) => {
|
|
514
|
-
U(t || void 0);
|
|
515
|
-
},
|
|
516
|
-
variant: F,
|
|
517
|
-
size: "sm",
|
|
518
|
-
defaultValue: !r.defaultValue || r.options.findIndex(
|
|
519
|
-
(t) => t.label === r.defaultValue
|
|
520
|
-
) === -1 ? r.options[0] : r.options[r.options.findIndex(
|
|
521
|
-
(t) => t.label === r.defaultValue
|
|
522
|
-
)]
|
|
523
|
-
}
|
|
524
|
-
)
|
|
525
|
-
]
|
|
526
|
-
}
|
|
527
|
-
) : null,
|
|
528
|
-
G?.map((t, j) => /* @__PURE__ */ i.jsxs(
|
|
529
|
-
"div",
|
|
530
|
-
{
|
|
531
|
-
className: "grow shrink-0 min-w-[240px]",
|
|
532
|
-
style: { width: t.width || "calc(25% - 0.75rem)" },
|
|
533
|
-
children: [
|
|
534
|
-
/* @__PURE__ */ i.jsx(
|
|
535
|
-
X,
|
|
536
|
-
{
|
|
537
|
-
marginBottom: "xs",
|
|
538
|
-
size: "sm",
|
|
539
|
-
className: "text-primary-gray-700 dark:text-primary-gray-100",
|
|
540
|
-
children: t.label
|
|
541
|
-
}
|
|
542
|
-
),
|
|
543
|
-
/* @__PURE__ */ i.jsx(
|
|
544
|
-
W,
|
|
545
|
-
{
|
|
546
|
-
options: t.availableValues,
|
|
547
|
-
isClearable: t.clearable === void 0 ? !0 : t.clearable,
|
|
548
|
-
isRtl: y === "he" || y === "ar",
|
|
549
|
-
isSearchable: !0,
|
|
550
|
-
variant: F,
|
|
551
|
-
size: "sm",
|
|
552
|
-
controlShouldRenderValue: !0,
|
|
553
|
-
filterOption: Z(K),
|
|
554
|
-
onChange: ($) => {
|
|
555
|
-
ye(
|
|
556
|
-
(T) => (
|
|
557
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
558
|
-
T.map((R) => R.filter === t.filter ? { ...R, value: $ } : R)
|
|
559
|
-
)
|
|
560
|
-
);
|
|
561
|
-
},
|
|
562
|
-
defaultValue: t.defaultValue
|
|
563
|
-
}
|
|
564
|
-
)
|
|
565
|
-
]
|
|
566
|
-
},
|
|
567
|
-
j
|
|
568
|
-
))
|
|
569
|
-
] }) : null,
|
|
570
|
-
(f || []).length > 0 ? /* @__PURE__ */ i.jsx("div", { style: { paddingTop: "1px" }, children: /* @__PURE__ */ i.jsx(
|
|
571
|
-
oe,
|
|
572
|
-
{
|
|
573
|
-
placeholder: "Search...",
|
|
574
|
-
onSearch: (t) => {
|
|
575
|
-
pe(t || "");
|
|
576
|
-
},
|
|
577
|
-
buttonVariant: "icon",
|
|
578
|
-
inputVariant: F,
|
|
579
|
-
showSearchButton: !1,
|
|
580
|
-
inputSize: "sm"
|
|
581
|
-
}
|
|
582
|
-
) }) : null,
|
|
583
|
-
/* @__PURE__ */ i.jsx(
|
|
584
|
-
Fe,
|
|
585
|
-
{
|
|
586
|
-
data: M,
|
|
587
|
-
width: e,
|
|
588
|
-
height: l,
|
|
589
|
-
cardTemplate: x,
|
|
590
|
-
cardMinWidth: ce,
|
|
591
|
-
page: me,
|
|
592
|
-
cardBackgroundColor: b,
|
|
593
|
-
styles: C,
|
|
594
|
-
classNames: S,
|
|
595
|
-
noOfItemsInAPage: O,
|
|
596
|
-
detailsOnClick: de,
|
|
597
|
-
onSeriesMouseClick: h,
|
|
598
|
-
allowDataDownloadOnDetail: ue
|
|
599
|
-
}
|
|
600
|
-
),
|
|
601
|
-
O ? /* @__PURE__ */ i.jsx(
|
|
602
|
-
Ie,
|
|
603
|
-
{
|
|
604
|
-
total: M.length,
|
|
605
|
-
defaultPage: 0,
|
|
606
|
-
pageSize: O,
|
|
607
|
-
onChange: H
|
|
608
|
-
}
|
|
609
|
-
) : null,
|
|
610
|
-
c || u ? /* @__PURE__ */ i.jsx(
|
|
611
|
-
je,
|
|
612
|
-
{
|
|
613
|
-
styles: { footnote: C?.footnote, source: C?.source },
|
|
614
|
-
classNames: {
|
|
615
|
-
footnote: S?.footnote,
|
|
616
|
-
source: S?.source
|
|
617
|
-
},
|
|
618
|
-
sources: c,
|
|
619
|
-
footNote: u,
|
|
620
|
-
width: e
|
|
621
|
-
}
|
|
622
|
-
) : null
|
|
623
|
-
] })
|
|
624
|
-
}
|
|
625
|
-
)
|
|
626
|
-
}
|
|
627
|
-
)
|
|
628
|
-
}
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
|
-
export {
|
|
632
|
-
Je as D,
|
|
633
|
-
ae as t
|
|
634
|
-
};
|
|
635
|
-
//# sourceMappingURL=index-OCoyy1wG.js.map
|