@civicactions/cmsds-open-data-components 2.0.5 → 2.1.0-alpha.2

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/main.js CHANGED
@@ -1670,25 +1670,44 @@ var $17193a17e26a72da$export$2e2bcd8739ae039 = $17193a17e26a72da$var$DatasetTags
1670
1670
 
1671
1671
 
1672
1672
 
1673
- const $f341c2fd9bc53390$var$DatasetDownloads = ({ downloadURL: downloadURL , type: type })=>{
1673
+ const $f341c2fd9bc53390$var$DatasetDownloads = ({ dataDictionaryURL: dataDictionaryURL , dataDictionaryType: dataDictionaryType , distributions: distributions })=>{
1674
+ function trimDataDictionaryType() {
1675
+ let splitDataDictionaryType = dataDictionaryType.split("/");
1676
+ let type = splitDataDictionaryType.length > 1 ? splitDataDictionaryType[1] : splitDataDictionaryType[0];
1677
+ return type.toUpperCase();
1678
+ }
1674
1679
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
1675
- className: "ds-u-margin-bottom--3 ds-u-padding--2 ds-u-border ds-u-border--1",
1680
+ className: "ds-u-margin-bottom--3 ds-u-padding--2 ds-u-border ds-u-border--1 dc-c-dataset-downloads",
1676
1681
  children: [
1677
1682
  /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
1678
1683
  className: "ds-u-color--primary ds-u-font-size--h3 ds-u-margin-top--0 ds-u-margin-bottom--2 ds-u-padding-bottom--2 ds-u-border ds-u-border-bottom--1",
1679
1684
  children: "Downloads"
1680
1685
  }),
1681
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
1682
- className: "ds-u-margin-bottom--1 ds-u-color--gray",
1683
- children: "Resource"
1684
- }),
1685
- /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
1686
- href: downloadURL,
1687
- className: "ds-u-word-break",
1686
+ (distributions.length || dataDictionaryURL && dataDictionaryType) && /*#__PURE__*/ (0, $hgUW1$jsxs)("ul", {
1687
+ className: "ds-c-list ds-c-list--bare",
1688
1688
  children: [
1689
- "Download this resource (",
1690
- type,
1691
- ")"
1689
+ distributions.map((dist)=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
1690
+ className: "ds-u-padding-bottom--1",
1691
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
1692
+ href: dist.data.downloadURL,
1693
+ className: "ds-u-word-break",
1694
+ children: [
1695
+ dist.data.format.toUpperCase(),
1696
+ " ",
1697
+ "Resource File"
1698
+ ]
1699
+ }, dist.identifier)
1700
+ })),
1701
+ dataDictionaryURL && dataDictionaryType && /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
1702
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
1703
+ href: dataDictionaryURL,
1704
+ children: [
1705
+ "Data Dictionary (",
1706
+ trimDataDictionaryType(),
1707
+ ")"
1708
+ ]
1709
+ })
1710
+ })
1692
1711
  ]
1693
1712
  })
1694
1713
  ]
@@ -2101,8 +2120,9 @@ const $766b8e351dd607f5$var$DatasetBody = ({ rootUrl: rootUrl , id: id , dataset
2101
2120
  className: "ds-l-md-col--3 ds-l-sm-col--12",
2102
2121
  children: [
2103
2122
  Object.keys(distribution).length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $f341c2fd9bc53390$export$2e2bcd8739ae039), {
2104
- downloadURL: distribution.data.downloadURL,
2105
- type: fileFormat
2123
+ dataDictionaryURL: dataset.describedBy,
2124
+ dataDictionaryType: dataset.describedByType,
2125
+ distributions: dataset.distribution
2106
2126
  }) : "",
2107
2127
  dataset.keyword && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $17193a17e26a72da$export$2e2bcd8739ae039), {
2108
2128
  keywords: dataset.keyword