@civicactions/cmsds-open-data-components 3.1.0-alpha.4 → 3.1.0-alpha.5

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
@@ -1322,7 +1322,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
1322
1322
  const [id, setResource] = (0, $hgUW1$useState)(resourceId);
1323
1323
  const [rootUrl, setRootUrl] = (0, $hgUW1$useState)(rootAPIUrl);
1324
1324
  const [limit, setLimit] = (0, $hgUW1$useState)(options.limit ? options.limit : 20);
1325
- const [count, setCount] = (0, $hgUW1$useState)(0);
1325
+ const [count, setCount] = (0, $hgUW1$useState)(null);
1326
1326
  const [columns, setColumns] = (0, $hgUW1$useState)([]);
1327
1327
  const [offset, setOffset] = (0, $hgUW1$useState)(options.offset ? options.offset : 0);
1328
1328
  const [loading, setLoading] = (0, $hgUW1$useState)(false);
@@ -1366,7 +1366,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
1366
1366
  else if (requireConditions) {
1367
1367
  if (conditions && conditions.length) fetchData();
1368
1368
  else {
1369
- setCount(0);
1369
+ setCount(null);
1370
1370
  setValues([]);
1371
1371
  }
1372
1372
  }
@@ -2584,7 +2584,7 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ id: id , distribution: distributio
2584
2584
  className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-u-md-justify-content--between ds-u-margin-top--2 ds-u-align-items--center",
2585
2585
  children: [
2586
2586
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
2587
- totalPages: Math.ceil(resource.count / pageSize),
2587
+ totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
2588
2588
  currentPage: page,
2589
2589
  onPageChange: (evt, page)=>{
2590
2590
  evt.preventDefault();
@@ -2709,7 +2709,7 @@ const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
2709
2709
  }),
2710
2710
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2711
2711
  className: "ds-u-font-weight--bold",
2712
- children: count.toLocaleString()
2712
+ children: count ? count.toLocaleString() : ""
2713
2713
  })
2714
2714
  ]
2715
2715
  }),