@civicactions/cmsds-open-data-components 3.7.0-alpha.1 → 3.7.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 +51 -47
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1251,7 +1251,6 @@ var $e873081a6e8f024e$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
1251
1251
|
|
|
1252
1252
|
|
|
1253
1253
|
|
|
1254
|
-
|
|
1255
1254
|
const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl, additionalParams = {})=>{
|
|
1256
1255
|
const [dataset, setDataset] = (0, $hgUW1$useState)({
|
|
1257
1256
|
title: "",
|
|
@@ -3930,6 +3929,42 @@ const $39bc4d98030a5599$var$DataTableStateWrapper = ()=>{
|
|
|
3930
3929
|
var $39bc4d98030a5599$export$2e2bcd8739ae039 = $39bc4d98030a5599$var$DataTableStateWrapper;
|
|
3931
3930
|
|
|
3932
3931
|
|
|
3932
|
+
|
|
3933
|
+
|
|
3934
|
+
|
|
3935
|
+
const $2bd73bb95b0c04ed$var$DatasetDescription = ({ distribution: distribution, dataset: dataset, resource: resource, customDescription: customDescription, dynamicDescription: dynamicDescription, updateAriaLive: updateAriaLive })=>{
|
|
3936
|
+
const [description, setDescription] = (0, $hgUW1$useState)("");
|
|
3937
|
+
if (!distribution && !dataset?.identifier) return null;
|
|
3938
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3939
|
+
if (!dynamicDescription && description !== "") return;
|
|
3940
|
+
let newDescription = "";
|
|
3941
|
+
if (customDescription) newDescription = customDescription(dataset, distribution, resource);
|
|
3942
|
+
else {
|
|
3943
|
+
if (distribution.data && distribution.data.description) newDescription = distribution.data.description;
|
|
3944
|
+
else if (dataset.description) newDescription = dataset.description;
|
|
3945
|
+
}
|
|
3946
|
+
if (description !== newDescription && updateAriaLive) updateAriaLive(newDescription);
|
|
3947
|
+
setDescription(newDescription);
|
|
3948
|
+
}, [
|
|
3949
|
+
resource,
|
|
3950
|
+
distribution,
|
|
3951
|
+
dataset,
|
|
3952
|
+
customDescription,
|
|
3953
|
+
dynamicDescription
|
|
3954
|
+
]);
|
|
3955
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3956
|
+
className: "ds-u-measure--wide ds-u-margin-bottom--7",
|
|
3957
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3958
|
+
className: "ds-u-margin-top--0 dc-c-metadata-description",
|
|
3959
|
+
dangerouslySetInnerHTML: {
|
|
3960
|
+
__html: (0, $hgUW1$dompurify).sanitize(description)
|
|
3961
|
+
}
|
|
3962
|
+
})
|
|
3963
|
+
});
|
|
3964
|
+
};
|
|
3965
|
+
var $2bd73bb95b0c04ed$export$2e2bcd8739ae039 = $2bd73bb95b0c04ed$var$DatasetDescription;
|
|
3966
|
+
|
|
3967
|
+
|
|
3933
3968
|
const $a0f13962e513caa1$export$a7997ae78b143b = /*#__PURE__*/ (0, $hgUW1$createContext)({
|
|
3934
3969
|
id: null
|
|
3935
3970
|
});
|
|
@@ -3950,7 +3985,7 @@ const $a0f13962e513caa1$var$getDataDictionary = (dataDictionaryUrl, additionalPa
|
|
|
3950
3985
|
dataDictionaryLoading: isPending
|
|
3951
3986
|
};
|
|
3952
3987
|
};
|
|
3953
|
-
const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false, disableTableControls: disableTableControls = false })=>{
|
|
3988
|
+
const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false, disableTableControls: disableTableControls = false, customDescription: customDescription, dynamicDescription: dynamicDescription, updateAriaLive: updateAriaLive })=>{
|
|
3954
3989
|
const options = location.search ? {
|
|
3955
3990
|
...(0, $hgUW1$qs).parse(location.search, {
|
|
3956
3991
|
ignoreQueryPrefix: true
|
|
@@ -4066,14 +4101,13 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
4066
4101
|
}),
|
|
4067
4102
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4068
4103
|
className: "ds-l-md-col--9",
|
|
4069
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
})
|
|
4104
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2bd73bb95b0c04ed$export$2e2bcd8739ae039), {
|
|
4105
|
+
distribution: distribution,
|
|
4106
|
+
dataset: dataset,
|
|
4107
|
+
resource: resource,
|
|
4108
|
+
customDescription: customDescription,
|
|
4109
|
+
dynamicDescription: dynamicDescription,
|
|
4110
|
+
updateAriaLive: updateAriaLive
|
|
4077
4111
|
})
|
|
4078
4112
|
})
|
|
4079
4113
|
]
|
|
@@ -6145,40 +6179,8 @@ var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilde
|
|
|
6145
6179
|
|
|
6146
6180
|
|
|
6147
6181
|
|
|
6148
|
-
const $de780c924c98fa31$var$FilteredResourceDescription = ({ distribution: distribution, dataset: dataset, resource: resource, customDescription: customDescription, dynamicDescription: dynamicDescription })=>{
|
|
6149
|
-
const [description, setDescription] = (0, $hgUW1$useState)("");
|
|
6150
|
-
if (!distribution && !dataset) return null;
|
|
6151
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
6152
|
-
if (!dynamicDescription && description !== "") return;
|
|
6153
|
-
if (customDescription) setDescription(customDescription(dataset, distribution, resource));
|
|
6154
|
-
else {
|
|
6155
|
-
if (distribution.data && distribution.data.description) setDescription(distribution.data.description);
|
|
6156
|
-
else if (dataset.description) setDescription(dataset.description);
|
|
6157
|
-
}
|
|
6158
|
-
}, [
|
|
6159
|
-
resource,
|
|
6160
|
-
distribution,
|
|
6161
|
-
dataset,
|
|
6162
|
-
customDescription,
|
|
6163
|
-
dynamicDescription
|
|
6164
|
-
]);
|
|
6165
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6166
|
-
className: "ds-u-measure--wide ds-u-margin-bottom--7",
|
|
6167
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6168
|
-
className: "ds-u-margin-top--0 dc-c-metadata-description",
|
|
6169
|
-
dangerouslySetInnerHTML: {
|
|
6170
|
-
__html: (0, $hgUW1$dompurify).sanitize(description)
|
|
6171
|
-
}
|
|
6172
|
-
})
|
|
6173
|
-
});
|
|
6174
|
-
};
|
|
6175
|
-
var $de780c924c98fa31$export$2e2bcd8739ae039 = $de780c924c98fa31$var$FilteredResourceDescription;
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
6182
|
|
|
6181
|
-
const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, customDescription: customDescription, dynamicDescription: dynamicDescription, rootUrl: rootUrl })=>{
|
|
6183
|
+
const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, customDescription: customDescription, dynamicDescription: dynamicDescription, rootUrl: rootUrl, updateAriaLive: updateAriaLive })=>{
|
|
6182
6184
|
const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState("ds-u-padding-y--1");
|
|
6183
6185
|
let apiDocs = (0, $hgUW1$useRef)();
|
|
6184
6186
|
let distribution = {};
|
|
@@ -6244,12 +6246,13 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
6244
6246
|
}),
|
|
6245
6247
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6246
6248
|
className: "ds-l-md-col--9",
|
|
6247
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $
|
|
6249
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2bd73bb95b0c04ed$export$2e2bcd8739ae039), {
|
|
6248
6250
|
distribution: distribution,
|
|
6249
6251
|
dataset: dataset,
|
|
6250
6252
|
resource: resource,
|
|
6251
6253
|
customDescription: customDescription,
|
|
6252
|
-
dynamicDescription: dynamicDescription
|
|
6254
|
+
dynamicDescription: dynamicDescription,
|
|
6255
|
+
updateAriaLive: updateAriaLive
|
|
6253
6256
|
})
|
|
6254
6257
|
}),
|
|
6255
6258
|
Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -6332,7 +6335,7 @@ var $dd6eb2b30d7ad75d$export$2e2bcd8739ae039 = $dd6eb2b30d7ad75d$var$FilteredRes
|
|
|
6332
6335
|
|
|
6333
6336
|
|
|
6334
6337
|
|
|
6335
|
-
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, customDescription: customDescription, dynamicDescription: dynamicDescription, rootUrl: rootUrl })=>{
|
|
6338
|
+
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, customDescription: customDescription, dynamicDescription: dynamicDescription, rootUrl: rootUrl, updateAriaLive: updateAriaLive })=>{
|
|
6336
6339
|
const [ready, setReady] = (0, $hgUW1$useState)(false);
|
|
6337
6340
|
const [error, setError] = (0, $hgUW1$useState)(false);
|
|
6338
6341
|
const { dataset: dataset } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl, additionalParams);
|
|
@@ -6397,7 +6400,8 @@ const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, loca
|
|
|
6397
6400
|
customTitle: customTitle,
|
|
6398
6401
|
customDescription: customDescription,
|
|
6399
6402
|
dynamicDescription: dynamicDescription,
|
|
6400
|
-
rootUrl: rootUrl
|
|
6403
|
+
rootUrl: rootUrl,
|
|
6404
|
+
updateAriaLive: updateAriaLive
|
|
6401
6405
|
})
|
|
6402
6406
|
})
|
|
6403
6407
|
});
|