@civicactions/cmsds-open-data-components 3.1.4 → 3.1.6

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
@@ -2806,7 +2806,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource
2806
2806
  }),
2807
2807
  dist.data.description && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2808
2808
  className: "ds-u-measure--wide ds-u-margin-bottom--7",
2809
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2809
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2810
2810
  className: "dc-c-metadata-description ds-u-margin--0",
2811
2811
  dangerouslySetInnerHTML: {
2812
2812
  __html: (0, $hgUW1$dompurify).sanitize(dist.data.description)
@@ -3281,9 +3281,11 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
3281
3281
  };
3282
3282
  const [selectedTab, setSelectedTab] = (0, $hgUW1$useState)(window.location.hash.substring(1) ? window.location.hash.substring(1) : getDefaultTab());
3283
3283
  (0, $hgUW1$useEffect)(()=>{
3284
- setSelectedTab(getDefaultTab());
3284
+ if (!window.location.hash.substring(1)) setSelectedTab(getDefaultTab());
3285
+ else if (window.location.hash.substring(1) != selectedTab) setSelectedTab(window.location.hash.substring(1));
3285
3286
  }, [
3286
- distribution
3287
+ distribution,
3288
+ window.location.hash
3287
3289
  ]);
3288
3290
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
3289
3291
  children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
@@ -3318,7 +3320,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
3318
3320
  className: "ds-l-md-col--9",
3319
3321
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3320
3322
  className: "ds-u-measure--wide ds-u-margin-bottom--7",
3321
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3323
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3322
3324
  className: "dc-c-metadata-description ds-u-margin--0",
3323
3325
  dangerouslySetInnerHTML: {
3324
3326
  __html: (0, $hgUW1$dompurify).sanitize(dataset.description)
@@ -5261,7 +5263,6 @@ var $ec3e23baa005dc03$export$2e2bcd8739ae039 = $ec3e23baa005dc03$var$Breadcrumb;
5261
5263
 
5262
5264
 
5263
5265
 
5264
-
5265
5266
 
5266
5267
 
5267
5268
  function $374c4669b044ddf8$var$getStartDate(condition, schema, id) {
@@ -5527,7 +5528,28 @@ var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilde
5527
5528
 
5528
5529
 
5529
5530
 
5530
- const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, apiDocPage: apiDocPage, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
5531
+
5532
+
5533
+ const $de780c924c98fa31$var$FilteredResourceDescription = ({ distribution: distribution, dataset: dataset })=>{
5534
+ if (!distribution && !dataset) return null;
5535
+ let description = "";
5536
+ if (distribution.data && distribution.data.description) description = distribution.data.description;
5537
+ else if (dataset.description) description = dataset.description;
5538
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5539
+ className: "ds-u-measure--wide ds-u-margin-bottom--7",
5540
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5541
+ className: "ds-u-margin-top--0 dc-c-metadata-description",
5542
+ dangerouslySetInnerHTML: {
5543
+ __html: (0, $hgUW1$dompurify).sanitize(description)
5544
+ }
5545
+ })
5546
+ });
5547
+ };
5548
+ var $de780c924c98fa31$export$2e2bcd8739ae039 = $de780c924c98fa31$var$FilteredResourceDescription;
5549
+
5550
+
5551
+
5552
+ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
5531
5553
  const navigate = (0, $hgUW1$useNavigate)();
5532
5554
  const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState("ds-u-padding-y--1");
5533
5555
  let apiDocs = (0, $hgUW1$useRef)();
@@ -5593,14 +5615,9 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
5593
5615
  }),
5594
5616
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5595
5617
  className: "ds-l-md-col--9",
5596
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5597
- className: "ds-u-measure--wide ds-u-margin-bottom--7",
5598
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
5599
- className: "ds-u-margin-top--0 dc-c-metadata-description",
5600
- dangerouslySetInnerHTML: {
5601
- __html: (0, $hgUW1$dompurify).sanitize(distribution.data.description)
5602
- }
5603
- })
5618
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $de780c924c98fa31$export$2e2bcd8739ae039), {
5619
+ distribution: distribution,
5620
+ dataset: dataset
5604
5621
  })
5605
5622
  }),
5606
5623
  resource.columns && Object.keys(resource.schema).length && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3b6ca952e79f0695$export$2e2bcd8739ae039), {
@@ -5666,6 +5683,7 @@ var $dd6eb2b30d7ad75d$export$2e2bcd8739ae039 = $dd6eb2b30d7ad75d$var$FilteredRes
5666
5683
 
5667
5684
 
5668
5685
 
5686
+
5669
5687
  const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, location: location, apiDocPage: apiDocPage, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
5670
5688
  const [ready, setReady] = (0, $hgUW1$useState)(false);
5671
5689
  const [error, setError] = (0, $hgUW1$useState)(false);
@@ -5734,7 +5752,7 @@ const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, loca
5734
5752
  })
5735
5753
  });
5736
5754
  };
5737
- var $f61ecf9f84951a61$export$2e2bcd8739ae039 = $f61ecf9f84951a61$var$FilteredResource;
5755
+ var $f61ecf9f84951a61$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($f61ecf9f84951a61$var$FilteredResource);
5738
5756
 
5739
5757
 
5740
5758