@civicactions/cmsds-open-data-components 3.1.3-alpha.2 → 3.1.3-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 +17 -22
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1273,7 +1273,7 @@ const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl, additi
|
|
|
1273
1273
|
const additionalParamsString = Object.keys(additionalParams).length ? `&${(0, $hgUW1$qs).stringify(additionalParams)}` : "";
|
|
1274
1274
|
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
1275
1275
|
queryKey: [
|
|
1276
|
-
"metastore" + id
|
|
1276
|
+
"metastore" + id + additionalParamsString
|
|
1277
1277
|
],
|
|
1278
1278
|
queryFn: ()=>{
|
|
1279
1279
|
return fetch(`${rootUrl}/metastore/schemas/dataset/items/${id}?show-reference-ids${additionalParamsString}`).then((res)=>res.json()).then((res)=>{
|
|
@@ -2713,9 +2713,8 @@ const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
|
|
|
2713
2713
|
var $0958733ee130fc44$export$2e2bcd8739ae039 = $0958733ee130fc44$var$ResourceInformation;
|
|
2714
2714
|
|
|
2715
2715
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
function getFormatType(dist) {
|
|
2716
|
+
function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
|
|
2717
|
+
if (dist && dist.data) {
|
|
2719
2718
|
if (dist.data.format) return dist.data.format.toLowerCase();
|
|
2720
2719
|
if (dist.data.mediaType) {
|
|
2721
2720
|
const mediaType = dist.data.mediaType.split("/");
|
|
@@ -2727,8 +2726,13 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource
|
|
|
2727
2726
|
if (mimeType.length && mimeType[1]) return mimeType[1].toLowerCase();
|
|
2728
2727
|
}
|
|
2729
2728
|
}
|
|
2730
|
-
return "";
|
|
2731
2729
|
}
|
|
2730
|
+
return "";
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource: resource, title: title })=>{
|
|
2732
2736
|
const sm = (0, $hgUW1$useMediaQuery)({
|
|
2733
2737
|
minWidth: 0,
|
|
2734
2738
|
maxWidth: 767
|
|
@@ -2743,7 +2747,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource
|
|
|
2743
2747
|
distributions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
2744
2748
|
className: "ds-c-list ds-c-list--bare dc-c-resource-full-width",
|
|
2745
2749
|
children: distributions.map((dist)=>{
|
|
2746
|
-
const fileFormat =
|
|
2750
|
+
const fileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(dist);
|
|
2747
2751
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
2748
2752
|
className: `ds-u-display--flex ds-u-flex-wrap--wrap ${fileFormat !== "csv" && "ds-u-margin-bottom--2"}`,
|
|
2749
2753
|
children: [
|
|
@@ -3002,6 +3006,7 @@ var $6012b86ffcaf3f71$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
3002
3006
|
|
|
3003
3007
|
|
|
3004
3008
|
|
|
3009
|
+
|
|
3005
3010
|
const $a0f13962e513caa1$var$getSiteWideDataDictionary = (rootUrl, dataDictionaryUrl)=>{
|
|
3006
3011
|
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
3007
3012
|
queryKey: [
|
|
@@ -3046,20 +3051,9 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3046
3051
|
const datasetDictionary = siteWideDataDictionary && resource && resource.schema[distribution.identifier] ? siteWideDataDictionary.data.fields.filter((field)=>{
|
|
3047
3052
|
return Object.keys(resource.schema[distribution.identifier].fields).indexOf(field.name) !== -1;
|
|
3048
3053
|
}) : null;
|
|
3049
|
-
const getlocalFileFormat = ()=>{
|
|
3050
|
-
let localFileFormat = "";
|
|
3051
|
-
if (distribution.identifier) {
|
|
3052
|
-
if (distribution.data.format) localFileFormat = distribution.data.format.toUpperCase();
|
|
3053
|
-
else if (distribution.data.mediaType) {
|
|
3054
|
-
const mediaType = distribution.data.mediaType.split("/");
|
|
3055
|
-
if (mediaType.length && mediaType[1]) localFileFormat = mediaType[1].toUpperCase();
|
|
3056
|
-
}
|
|
3057
|
-
}
|
|
3058
|
-
return localFileFormat;
|
|
3059
|
-
};
|
|
3060
3054
|
(0, $hgUW1$useEffect)(()=>{
|
|
3061
|
-
const localFileFormat =
|
|
3062
|
-
if (localFileFormat === "
|
|
3055
|
+
const localFileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution);
|
|
3056
|
+
if (localFileFormat === "csv") resource.setResource(distribution.identifier);
|
|
3063
3057
|
}, [
|
|
3064
3058
|
distribution
|
|
3065
3059
|
]);
|
|
@@ -3104,7 +3098,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3104
3098
|
// The below code manages the selected tab in the Design System tab group manually to ensure we can still use the
|
|
3105
3099
|
// Data Table tab as the default since it no longer exists on initial render (By default, Overview will appear as default)
|
|
3106
3100
|
const getDefaultTab = ()=>{
|
|
3107
|
-
return
|
|
3101
|
+
return (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ? "data-table" : "overview";
|
|
3108
3102
|
};
|
|
3109
3103
|
const [selectedTab, setSelectedTab] = (0, $hgUW1$useState)(window.location.hash.substring(1) ? window.location.hash.substring(1) : getDefaultTab());
|
|
3110
3104
|
(0, $hgUW1$useEffect)(()=>{
|
|
@@ -3165,7 +3159,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
|
|
|
3165
3159
|
},
|
|
3166
3160
|
selectedId: selectedTab,
|
|
3167
3161
|
children: [
|
|
3168
|
-
|
|
3162
|
+
(0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3169
3163
|
id: "data-table",
|
|
3170
3164
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3171
3165
|
className: "ds-u-color--primary",
|
|
@@ -5596,5 +5590,6 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
|
|
|
5596
5590
|
|
|
5597
5591
|
|
|
5598
5592
|
|
|
5599
|
-
|
|
5593
|
+
|
|
5594
|
+
export {$f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $a5a6a06d249c33b8$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults};
|
|
5600
5595
|
//# sourceMappingURL=main.js.map
|