@undp/data-viz 2.5.2 → 2.5.3
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/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +297 -289
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +307 -299
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CopyTextButton.cjs +1 -1
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +281 -279
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +4 -4
- package/dist/CsvDownloadButton.cjs.map +1 -1
- package/dist/CsvDownloadButton.js +268 -266
- package/dist/CsvDownloadButton.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +277 -269
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.cjs.map +1 -1
- package/dist/ExcelDownloadButton.js +21 -19
- package/dist/ExcelDownloadButton.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +299 -291
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.cjs.map +1 -1
- package/dist/ImageDownloadButton.js +19 -17
- package/dist/ImageDownloadButton.js.map +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.cjs.map +1 -1
- package/dist/SVGDownloadButton.js +20 -18
- package/dist/SVGDownloadButton.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SVGDownloadButton.cjs","sources":["../src/Components/Actions/SVGDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\n\r\nimport { svgDownload } from '@/Utils/svgDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function SVGDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={
|
|
1
|
+
{"version":3,"file":"SVGDownloadButton.cjs","sources":["../src/Components/Actions/SVGDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { svgDownload } from '@/Utils/svgDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function SVGDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={cn('undp-viz-download-button', buttonSmall ? 'p-2' : 'py-4 px-6', className)}\r\n onClick={() => {\r\n if (typeof nodeID === 'string') {\r\n if (document.getElementById(nodeID)) {\r\n svgDownload(document.getElementById(nodeID) as HTMLElement, filename);\r\n } else {\r\n console.error('Cannot find the html element');\r\n }\r\n } else {\r\n svgDownload(nodeID as HTMLElement, filename);\r\n }\r\n }}\r\n aria-label='Click to download the graph as svg'\r\n >\r\n {buttonContent || <ImageDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["SVGDownloadButton","props","$","_c","nodeID","filename","t0","buttonContent","buttonType","t1","buttonSmall","className","t2","undefined","t3","t4","cn","t5","document","getElementById","svgDownload","console","error","t6","ImageDown","t7","jsx","Button"],"mappings":"2MAqBO,SAAAA,EAAAC,EAAA,CAAA,MAAAC,EAAAC,EAAAA,uBAAAA,EAAA,EAAA,EACL,CAAAC,OAAAA,EAAAC,SAAAC,EAAAC,cAAAA,EAAAC,WAAAC,EAAAC,YAAAA,EAAAC,UAAAC,CAAAA,EAOIX,EALFI,EAAAC,IAAAO,OAAA,QAAAP,EAEAE,EAAAC,IAAAI,OAAA,WAAAJ,EAEAE,EAAAC,IAAAC,OAAA,GAAAD,EAK4CE,EAAAJ,EAAA,MAAA,YAAiC,IAAAK,EAAAb,EAAA,CAAA,IAAAS,GAAAT,OAAAY,GAAhEC,EAAAC,EAAAA,GAAG,2BAA4BF,EAAmCH,CAAS,EAACT,KAAAS,EAAAT,KAAAY,EAAAZ,KAAAa,GAAAA,EAAAb,EAAA,CAAA,EAAA,IAAAe,EAAAf,EAAA,CAAA,IAAAG,GAAAH,OAAAE,GAC9Ea,EAAAA,IAAA,CACH,OAAOb,GAAW,SAChBc,SAAQC,eAAgBf,CAAM,EAChCgB,EAAAA,YAAYF,SAAQC,eAAgBf,CAAM,EAAkBC,CAAQ,EAEpEgB,QAAOC,MAAO,8BAA8B,EAG9CF,EAAAA,YAAYhB,EAAuBC,CAAQ,CAC5C,EACFH,KAAAG,EAAAH,KAAAE,EAAAF,KAAAe,GAAAA,EAAAf,EAAA,CAAA,EAAA,IAAAqB,EAAArB,OAAAK,GAGAgB,EAAAhB,2BAAkBiB,EAAAA,UAAA,CAAA,CAAS,EAAGtB,KAAAK,EAAAL,KAAAqB,GAAAA,EAAArB,EAAA,CAAA,EAAA,IAAAuB,EAAA,OAAAvB,EAAA,CAAA,IAAAM,GAAAN,EAAA,CAAA,IAAAa,GAAAb,EAAA,EAAA,IAAAe,GAAAf,QAAAqB,GAhBjCE,EAAAC,EAAAA,kBAAAA,IAACC,EAAAA,EAAA,CACUnB,QAAAA,EACE,UAAAO,EACF,QAAAE,EAWE,aAAA,qCAEVM,SAAAA,CAAAA,CACH,EAASrB,KAAAM,EAAAN,KAAAa,EAAAb,MAAAe,EAAAf,MAAAqB,EAAArB,MAAAuB,GAAAA,EAAAvB,EAAA,EAAA,EAjBTuB,CAiBS"}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { I as
|
|
3
|
-
import { s as
|
|
4
|
-
function
|
|
5
|
-
const t =
|
|
1
|
+
import { c as y, m as b, j as u } from "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
|
+
import { I as h, u as w } from "./index-ApTBN0kp.js";
|
|
3
|
+
import { s as g } from "./svgDownload-BAoarWNt.js";
|
|
4
|
+
function D(v) {
|
|
5
|
+
const t = y.c(13), {
|
|
6
6
|
nodeID: e,
|
|
7
|
-
filename:
|
|
8
|
-
buttonContent:
|
|
9
|
-
buttonType:
|
|
10
|
-
buttonSmall:
|
|
11
|
-
className:
|
|
12
|
-
} =
|
|
7
|
+
filename: d,
|
|
8
|
+
buttonContent: i,
|
|
9
|
+
buttonType: p,
|
|
10
|
+
buttonSmall: x,
|
|
11
|
+
className: f
|
|
12
|
+
} = v, l = d === void 0 ? "image" : d, m = p === void 0 ? "tertiary" : p, r = f === void 0 ? "" : f, c = x ? "p-2" : "py-4 px-6";
|
|
13
13
|
let o;
|
|
14
|
-
t[0] !==
|
|
15
|
-
typeof e == "string" ? document.getElementById(e) ? u(document.getElementById(e), s) : console.error("Cannot find the html element") : u(e, s);
|
|
16
|
-
}, t[0] = s, t[1] = e, t[2] = o) : o = t[2];
|
|
14
|
+
t[0] !== r || t[1] !== c ? (o = b("undp-viz-download-button", c, r), t[0] = r, t[1] = c, t[2] = o) : o = t[2];
|
|
17
15
|
let n;
|
|
18
|
-
t[3] !==
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
t[3] !== l || t[4] !== e ? (n = () => {
|
|
17
|
+
typeof e == "string" ? document.getElementById(e) ? g(document.getElementById(e), l) : console.error("Cannot find the html element") : g(e, l);
|
|
18
|
+
}, t[3] = l, t[4] = e, t[5] = n) : n = t[5];
|
|
19
|
+
let s;
|
|
20
|
+
t[6] !== i ? (s = i || /* @__PURE__ */ u.jsx(h, {}), t[6] = i, t[7] = s) : s = t[7];
|
|
21
|
+
let a;
|
|
22
|
+
return t[8] !== m || t[9] !== o || t[10] !== n || t[11] !== s ? (a = /* @__PURE__ */ u.jsx(w, { variant: m, className: o, onClick: n, "aria-label": "Click to download the graph as svg", children: s }), t[8] = m, t[9] = o, t[10] = n, t[11] = s, t[12] = a) : a = t[12], a;
|
|
21
23
|
}
|
|
22
24
|
export {
|
|
23
|
-
|
|
25
|
+
D as SVGDownloadButton
|
|
24
26
|
};
|
|
25
27
|
//# sourceMappingURL=SVGDownloadButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SVGDownloadButton.js","sources":["../src/Components/Actions/SVGDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\n\r\nimport { svgDownload } from '@/Utils/svgDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function SVGDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={
|
|
1
|
+
{"version":3,"file":"SVGDownloadButton.js","sources":["../src/Components/Actions/SVGDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { svgDownload } from '@/Utils/svgDownload';\r\nimport { ImageDown } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n nodeID: string | HTMLElement;\r\n filename?: string;\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function SVGDownloadButton(props: Props) {\r\n const {\r\n nodeID,\r\n filename = 'image',\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={cn('undp-viz-download-button', buttonSmall ? 'p-2' : 'py-4 px-6', className)}\r\n onClick={() => {\r\n if (typeof nodeID === 'string') {\r\n if (document.getElementById(nodeID)) {\r\n svgDownload(document.getElementById(nodeID) as HTMLElement, filename);\r\n } else {\r\n console.error('Cannot find the html element');\r\n }\r\n } else {\r\n svgDownload(nodeID as HTMLElement, filename);\r\n }\r\n }}\r\n aria-label='Click to download the graph as svg'\r\n >\r\n {buttonContent || <ImageDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["SVGDownloadButton","props","$","_c","nodeID","filename","t0","buttonContent","buttonType","t1","buttonSmall","className","t2","undefined","t3","t4","cn","t5","document","getElementById","svgDownload","console","error","t6","ImageDown","t7","jsx","Button"],"mappings":";;;AAqBO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,EA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