@civicactions/cmsds-open-data-components 3.6.1-alpha.1 → 3.6.2-alpha.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.
Binary file
Binary file
Binary file
package/dist/main.js CHANGED
@@ -1453,7 +1453,16 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
1453
1453
  if (existingFacet > -1) newFacets.keyword.splice(existingFacet, 1);
1454
1454
  else newFacets.keyword.push(value);
1455
1455
  }
1456
+ const urlString = (0, $hgUW1$qs).stringify({
1457
+ theme: newFacets.theme,
1458
+ keyword: newFacets.keyword
1459
+ }, {
1460
+ encodeValuesOnly: true,
1461
+ addQueryPrefix: true
1462
+ });
1456
1463
  setSelectedFacets(newFacets);
1464
+ const url = new URL(window.location.href);
1465
+ window.history.pushState({}, "", `${url.origin}${url.pathname}${urlString}`);
1457
1466
  }
1458
1467
  const pageSize = defaultPageSize;
1459
1468
  (0, $hgUW1$useEffect)(()=>{
@@ -1491,6 +1500,8 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
1491
1500
  setFilterText(defaultFulltext);
1492
1501
  setSelectedFacets(defaultSelectedFacets);
1493
1502
  setPage(defaultPage);
1503
+ const url = new URL(window.location.href);
1504
+ window.history.pushState({}, "", `${url.origin}${url.pathname}`);
1494
1505
  }
1495
1506
  function buildSearchParams(includePage) {
1496
1507
  let newParams = {};
@@ -4146,7 +4157,7 @@ function $ee4ad47aa483e5b5$var$updateQueryForDatastore(condition) {
4146
4157
  if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
4147
4158
  return cond;
4148
4159
  }
4149
- const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, customColumns: customColumns, isModal: isModal = false })=>{
4160
+ const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, customColumns: customColumns, isModal: isModal = false, setPage: setPage, setOffset: setOffset })=>{
4150
4161
  const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
4151
4162
  const fields = Object.keys(schema[id].fields);
4152
4163
  const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
@@ -4223,6 +4234,8 @@ const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, custom
4223
4234
  return $ee4ad47aa483e5b5$var$updateQueryForDatastore(cond);
4224
4235
  });
4225
4236
  setConditions(submitConditions);
4237
+ setPage(1);
4238
+ setOffset(0);
4226
4239
  setConditionsChanged(false);
4227
4240
  updateBrowserURL(submitConditions);
4228
4241
  };
@@ -4335,7 +4348,9 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, closeFul
4335
4348
  resource: resource,
4336
4349
  id: distribution.identifier,
4337
4350
  customColumns: customColumnHeaders,
4338
- isModal: isModal
4351
+ isModal: isModal,
4352
+ setPage: setPage,
4353
+ setOffset: setOffset
4339
4354
  }),
4340
4355
  dataDictionaryBanner && !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4341
4356
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
@@ -4731,7 +4746,7 @@ const $b9af6ce5e2c06331$var$Header = (props)=>{
4731
4746
  }
4732
4747
  function handleClick(event) {
4733
4748
  // Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
4734
- if (menu.current && !menu.current.contains(event.target)) {
4749
+ if (mobileMenuOpen && menu.current && !menu.current.contains(event.target)) {
4735
4750
  setMobileMenuOpen(false);
4736
4751
  closeMobileMenu();
4737
4752
  }
@@ -4962,7 +4977,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
4962
4977
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4963
4978
  children: [
4964
4979
  /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
4965
- href: "http://www.hhs.gov/",
4980
+ href: "https://www.hhs.gov/",
4966
4981
  target: "_blank",
4967
4982
  title: "U.S. Department of Health & Human Services",
4968
4983
  children: [
@@ -4980,7 +4995,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
4980
4995
  /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
4981
4996
  className: "ds-u-margin-left--4",
4982
4997
  target: "_blank",
4983
- href: "http://www.cms.gov/",
4998
+ href: "https://www.cms.gov/",
4984
4999
  title: "CMS.gov Centers for Medicare & Medicaid Services",
4985
5000
  children: [
4986
5001
  /*#__PURE__*/ (0, $hgUW1$jsx)("img", {
@@ -6178,7 +6193,7 @@ function $3b6ca952e79f0695$var$updateQueryForDatastore(condition) {
6178
6193
  if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
6179
6194
  return cond;
6180
6195
  }
6181
- const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, customColumns: customColumns })=>{
6196
+ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, customColumns: customColumns, setOffset: setOffset })=>{
6182
6197
  const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
6183
6198
  const fields = Object.keys(schema[id].fields);
6184
6199
  const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
@@ -6227,6 +6242,7 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, custom
6227
6242
  setConditions(submitConditions);
6228
6243
  setTitleConditions(queryConditions.map((oc)=>Object.assign({}, oc)));
6229
6244
  setConditionsChanged(false);
6245
+ setOffset(0);
6230
6246
  const url = new URL(window.location);
6231
6247
  const urlString = (0, $hgUW1$qs).stringify({
6232
6248
  conditions: submitConditions
@@ -6384,7 +6400,8 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
6384
6400
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3b6ca952e79f0695$export$2e2bcd8739ae039), {
6385
6401
  resource: resource,
6386
6402
  id: distribution.identifier,
6387
- customColumns: customColumns
6403
+ customColumns: customColumns,
6404
+ setOffset: resource.setOffset
6388
6405
  })
6389
6406
  }),
6390
6407
  Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {