@civicactions/cmsds-open-data-components 3.1.8-alpha.3 → 3.1.8-alpha.4

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
@@ -1304,7 +1304,7 @@ var $b4aa9c66f2e86959$export$2e2bcd8739ae039 = $b4aa9c66f2e86959$var$useMetastor
1304
1304
 
1305
1305
 
1306
1306
 
1307
- const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, additionalParams = {}, enabledParam = true)=>{
1307
+ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, additionalParams = {})=>{
1308
1308
  const keys = options.keys ? options.keys : true;
1309
1309
  const { prepareColumns: prepareColumns } = options;
1310
1310
  const [values, setValues] = (0, $hgUW1$useState)([]);
@@ -1315,6 +1315,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
1315
1315
  const [columns, setColumns] = (0, $hgUW1$useState)([]);
1316
1316
  const [offset, setOffset] = (0, $hgUW1$useState)(options.offset ? options.offset : 0);
1317
1317
  const [conditions, setConditions] = (0, $hgUW1$useState)(options.conditions ? options.conditions : undefined);
1318
+ const requireConditions = options.requireConditions;
1318
1319
  const [sort, setSort] = (0, $hgUW1$useState)(options.sort ? options.sort : undefined);
1319
1320
  const [groupings, setGroupings] = (0, $hgUW1$useState)(options.groupings ? options.groupings : undefined);
1320
1321
  const [schema, setSchema] = (0, $hgUW1$useState)({});
@@ -1331,7 +1332,11 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
1331
1332
  ...additionalParams
1332
1333
  };
1333
1334
  const additionalParamsString = Object.keys(params).length ? `&${(0, $hgUW1$qs).stringify(params)}` : "";
1334
- const enabled = id && enabledParam ? true : false;
1335
+ let enabled = false;
1336
+ if (id) {
1337
+ if (!requireConditions) enabled = true;
1338
+ if (conditions && conditions.length) enabled = true;
1339
+ }
1335
1340
  const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
1336
1341
  queryKey: [
1337
1342
  "datastore" + id + additionalParamsString
@@ -3225,8 +3230,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
3225
3230
  if (distributions.length) distribution = distributions[0];
3226
3231
  const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)("", rootUrl, {
3227
3232
  ...options,
3228
- limit: defaultPageSize,
3229
- manual: true
3233
+ limit: defaultPageSize
3230
3234
  }, additionalParams);
3231
3235
  const siteWideDataDictionary = dataDictionaryUrl ? $a0f13962e513caa1$var$getDataDictionary(rootUrl + dataDictionaryUrl, additionalParams).dataDictionary : null;
3232
3236
  // compare schema fields with siteWideDataDictionary to display commonalities for now
@@ -5572,8 +5576,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
5572
5576
  let conditions = options.conditions.length ? options.conditions : [];
5573
5577
  const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)("", rootUrl, {
5574
5578
  ...options,
5575
- limit: 25,
5576
- manual: true
5579
+ limit: 25
5577
5580
  }, additionalParams);
5578
5581
  (0, $hgUW1$useEffect)(()=>{
5579
5582
  if (distribution.identifier) resource.setResource(distribution.identifier);