@civicactions/cmsds-open-data-components 3.1.3-alpha.1 → 3.1.3-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.css +0 -18
- package/dist/main.css.map +1 -1
- package/dist/main.js +275 -262
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
2
|
import {jsxs as $hgUW1$jsxs, jsx as $hgUW1$jsx, Fragment as $hgUW1$Fragment} from "react/jsx-runtime";
|
|
3
3
|
import $hgUW1$react, {useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect} from "react";
|
|
4
|
-
import {Button as $hgUW1$Button, Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Dialog as $hgUW1$Dialog, Choice as $hgUW1$Choice, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Tooltip as $hgUW1$Tooltip, Badge as $hgUW1$Badge, Table as $hgUW1$Table, TableBody as $hgUW1$TableBody, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableHead as $hgUW1$TableHead} from "@cmsgov/design-system";
|
|
4
|
+
import {Button as $hgUW1$Button, Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Dialog as $hgUW1$Dialog, AddIcon as $hgUW1$AddIcon, RemoveIcon as $hgUW1$RemoveIcon, Choice as $hgUW1$Choice, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Tooltip as $hgUW1$Tooltip, Badge as $hgUW1$Badge, Table as $hgUW1$Table, TableBody as $hgUW1$TableBody, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableHead as $hgUW1$TableHead} from "@cmsgov/design-system";
|
|
5
5
|
import $hgUW1$proptypes from "prop-types";
|
|
6
6
|
import {NavLink as $hgUW1$NavLink, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams, Link as $hgUW1$Link, useNavigate as $hgUW1$useNavigate} from "react-router-dom";
|
|
7
7
|
import $hgUW1$qs from "qs";
|
|
@@ -17,6 +17,7 @@ import $hgUW1$reactdatepicker from "react-datepicker";
|
|
|
17
17
|
import "react-datepicker/dist/react-datepicker.css";
|
|
18
18
|
import {usePopper as $hgUW1$usePopper} from "react-popper";
|
|
19
19
|
|
|
20
|
+
|
|
20
21
|
function $parcel$interopDefault(a) {
|
|
21
22
|
return a && a.__esModule ? a.default : a;
|
|
22
23
|
}
|
|
@@ -31,12 +32,12 @@ function $parcel$interopDefault(a) {
|
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
const $24918217e48ac525$var$NavLink = ({ link: link
|
|
35
|
+
const $24918217e48ac525$var$NavLink = ({ link: link, className: className, wrapLabel: wrapLabel, clickHandler: clickHandler })=>{
|
|
35
36
|
const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
36
37
|
children: link.label
|
|
37
38
|
}) : link.label;
|
|
38
39
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
|
|
39
|
-
className: ({ isActive: isActive
|
|
40
|
+
className: ({ isActive: isActive })=>isActive ? `dc-c-active-link ${className}` : `${className}`,
|
|
40
41
|
to: link.url,
|
|
41
42
|
onClick: clickHandler ? clickHandler : undefined,
|
|
42
43
|
children: innerHtml
|
|
@@ -61,7 +62,7 @@ $24918217e48ac525$var$NavLink.propTypes = {
|
|
|
61
62
|
var $24918217e48ac525$export$2e2bcd8739ae039 = $24918217e48ac525$var$NavLink;
|
|
62
63
|
|
|
63
64
|
|
|
64
|
-
const $4f153ca537d853e5$var$SubMenu = ({ link: link
|
|
65
|
+
const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, wrapLabel: wrapLabel })=>{
|
|
65
66
|
const [isExpanded, setIsExapanded] = (0, $hgUW1$useState)(false);
|
|
66
67
|
const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
67
68
|
children: link.label
|
|
@@ -117,7 +118,7 @@ var $4f153ca537d853e5$export$2e2bcd8739ae039 = $4f153ca537d853e5$var$SubMenu;
|
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
|
|
120
|
-
const $f57121650539d8c5$var$NavBar = ({ links: links
|
|
121
|
+
const $f57121650539d8c5$var$NavBar = ({ links: links, menuName: menuName, menuId: menuId, menuClasses: menuClasses, linkClasses: linkClasses, wrapLabel: wrapLabel, clickHandler: clickHandler })=>{
|
|
121
122
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("nav", {
|
|
122
123
|
className: `dc-c-${menuId}-menu`,
|
|
123
124
|
"aria-labelledby": `dc-c-${menuId}-menu--heading`,
|
|
@@ -162,7 +163,7 @@ var $f57121650539d8c5$export$2e2bcd8739ae039 = $f57121650539d8c5$var$NavBar;
|
|
|
162
163
|
|
|
163
164
|
|
|
164
165
|
|
|
165
|
-
const $c96c4b9ef7203c1f$var$APIPage = ({ hideAuth: hideAuth
|
|
166
|
+
const $c96c4b9ef7203c1f$var$APIPage = ({ hideAuth: hideAuth, additionalParams: additionalParams, rootUrl: rootUrl })=>{
|
|
166
167
|
const hasACA = additionalParams && additionalParams.ACA ? true : false;
|
|
167
168
|
let params = {
|
|
168
169
|
authentication: hideAuth ? false : undefined,
|
|
@@ -190,7 +191,7 @@ var $c96c4b9ef7203c1f$export$2e2bcd8739ae039 = $c96c4b9ef7203c1f$var$APIPage;
|
|
|
190
191
|
|
|
191
192
|
|
|
192
193
|
|
|
193
|
-
const $026cb986f9fea2b1$var$PageNotFound = ({ siteUrl: siteUrl
|
|
194
|
+
const $026cb986f9fea2b1$var$PageNotFound = ({ siteUrl: siteUrl, content: content })=>{
|
|
194
195
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("section", {
|
|
195
196
|
className: "ds-l-container ds-u-padding-top--3",
|
|
196
197
|
children: content ? content : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
@@ -269,7 +270,7 @@ var $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 = $61ff88fb3f6ee2c8$var$withQueryPr
|
|
|
269
270
|
|
|
270
271
|
const $b61856b23f5f58a2$var$LargeFileDialog = (props)=>{
|
|
271
272
|
const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
|
|
272
|
-
const { downloadUrl: downloadUrl
|
|
273
|
+
const { downloadUrl: downloadUrl } = props;
|
|
273
274
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
274
275
|
children: [
|
|
275
276
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
@@ -498,7 +499,7 @@ var $b38839fd67928f42$export$2e2bcd8739ae039 = $b38839fd67928f42$var$SearchItemI
|
|
|
498
499
|
|
|
499
500
|
|
|
500
501
|
|
|
501
|
-
const $bd76a91923d7e8a7$var$TransformedDate = ({ date: date
|
|
502
|
+
const $bd76a91923d7e8a7$var$TransformedDate = ({ date: date, options: options })=>{
|
|
502
503
|
const rawDate = new Date(date);
|
|
503
504
|
let modifiedDate = "";
|
|
504
505
|
if (rawDate) modifiedDate = rawDate.toLocaleDateString("en-US", options);
|
|
@@ -518,16 +519,29 @@ var $bd76a91923d7e8a7$export$2e2bcd8739ae039 = $bd76a91923d7e8a7$var$Transformed
|
|
|
518
519
|
|
|
519
520
|
|
|
520
521
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
522
|
+
function $52c6454cae137465$var$prepDescription(description) {
|
|
523
|
+
if (!description) return;
|
|
524
|
+
if (description.length > 1 && description.substring(0, 1) === "<") {
|
|
525
|
+
const elementTagStart = description.indexOf("<");
|
|
526
|
+
const elementTagEnd = description.indexOf(">");
|
|
527
|
+
const elementTagInner = description.substring(elementTagStart + 1, elementTagEnd);
|
|
528
|
+
const elementTagLength = elementTagInner.length;
|
|
529
|
+
const isolatedDescriptionStart = description.indexOf(`<${elementTagInner}>`) + (elementTagLength + 2);
|
|
530
|
+
const isolatedDescriptionEnd = description.indexOf(`</${elementTagInner}>`);
|
|
531
|
+
const isolatedDescription = description.substring(isolatedDescriptionStart, isolatedDescriptionEnd);
|
|
532
|
+
return (0, $hgUW1$dompurify).sanitize(isolatedDescription, {
|
|
533
|
+
ALLOWED_TAGS: []
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
return (0, $hgUW1$dompurify).sanitize(description, {
|
|
537
|
+
ALLOWED_TAGS: []
|
|
525
538
|
});
|
|
539
|
+
}
|
|
526
540
|
const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
527
541
|
const desktop = (0, $hgUW1$useMediaQuery)({
|
|
528
542
|
minWidth: 1024
|
|
529
543
|
});
|
|
530
|
-
const { title: title
|
|
544
|
+
const { title: title, modified: modified, description: description, theme: theme, identifier: identifier, downloadUrl: downloadUrl, largeFile: largeFile = false, paginationEnabled: paginationEnabled } = props;
|
|
531
545
|
let linkContainerClasses = "ds-l-col--12 ds-u-margin-bottom--2";
|
|
532
546
|
let linkClasses = "ds-c-button ds-u-display--block ds-u-text-align--left";
|
|
533
547
|
if (desktop) {
|
|
@@ -537,10 +551,8 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
537
551
|
const truncatedDescription = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$reacttexttruncate), {
|
|
538
552
|
line: 3,
|
|
539
553
|
element: "p",
|
|
540
|
-
truncateText: "
|
|
541
|
-
|
|
542
|
-
text: description,
|
|
543
|
-
textTruncateChild: ""
|
|
554
|
+
truncateText: "\u2026",
|
|
555
|
+
text: $52c6454cae137465$var$prepDescription(description)
|
|
544
556
|
});
|
|
545
557
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
546
558
|
className: "dc-c-search-list-item ds-u-padding-top--3",
|
|
@@ -551,6 +563,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
551
563
|
className: "ds-l-row ds-u-align-items--start",
|
|
552
564
|
children: [
|
|
553
565
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
566
|
+
id: `dataset-${identifier}-updated-date`,
|
|
554
567
|
className: `ds-l-col--12 ds-u-text-align--right ${paginationEnabled ? "ds-u-padding-top--2" : "ds-u-padding-top--0"}`,
|
|
555
568
|
children: [
|
|
556
569
|
"Updated ",
|
|
@@ -562,6 +575,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
562
575
|
/*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
|
|
563
576
|
className: "ds-l-col--12 ds-text-heading--2xl",
|
|
564
577
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
|
|
578
|
+
"aria-describedby": `dataset-${identifier}-updated-date`,
|
|
565
579
|
to: `/dataset/${identifier}`,
|
|
566
580
|
children: title
|
|
567
581
|
})
|
|
@@ -651,7 +665,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
651
665
|
})
|
|
652
666
|
]
|
|
653
667
|
})
|
|
654
|
-
}
|
|
668
|
+
});
|
|
655
669
|
};
|
|
656
670
|
var $52c6454cae137465$export$2e2bcd8739ae039 = $52c6454cae137465$var$DatasetSearchListItem;
|
|
657
671
|
|
|
@@ -661,10 +675,16 @@ var $52c6454cae137465$export$2e2bcd8739ae039 = $52c6454cae137465$var$DatasetSear
|
|
|
661
675
|
|
|
662
676
|
|
|
663
677
|
const $e011250e8a3bd5e5$var$SearchFacets = (props)=>{
|
|
664
|
-
const { facets: facets
|
|
678
|
+
const { facets: facets, title: title, onClickFunction: onClickFunction, selectedFacets: selectedFacets = [] } = props;
|
|
665
679
|
const filteredFacets = facets.filter((f)=>{
|
|
666
680
|
return Number(f.total) > 0 || selectedFacets.findIndex((i)=>i === f.name) !== -1;
|
|
667
681
|
});
|
|
682
|
+
const hiddenAddIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AddIcon), {
|
|
683
|
+
ariaHidden: true
|
|
684
|
+
});
|
|
685
|
+
const hiddenCloseIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$RemoveIcon), {
|
|
686
|
+
ariaHidden: true
|
|
687
|
+
});
|
|
668
688
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
669
689
|
className: "dkan-dataset-search--facet-container ds-u-margin-bottom--4",
|
|
670
690
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
|
|
@@ -672,6 +692,8 @@ const $e011250e8a3bd5e5$var$SearchFacets = (props)=>{
|
|
|
672
692
|
contentClassName: "ds-u-padding-left--1 ds-u-padding-right--0",
|
|
673
693
|
heading: title,
|
|
674
694
|
defaultOpen: true,
|
|
695
|
+
openIconComponent: hiddenAddIcon,
|
|
696
|
+
closeIconComponent: hiddenCloseIcon,
|
|
675
697
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
676
698
|
children: filteredFacets.length ? filteredFacets.map((f)=>{
|
|
677
699
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
@@ -721,7 +743,7 @@ var $3b2d31a9c6cd2284$export$2e2bcd8739ae039 = $3b2d31a9c6cd2284$var$LargeFileIn
|
|
|
721
743
|
|
|
722
744
|
|
|
723
745
|
const $0a551147dc92a718$var$SearchButton = (props)=>{
|
|
724
|
-
const { text: text
|
|
746
|
+
const { text: text, altMobileStyle: altMobileStyle } = props;
|
|
725
747
|
const sm = (0, $hgUW1$useMediaQuery)({
|
|
726
748
|
minWidth: 0,
|
|
727
749
|
maxWidth: 768
|
|
@@ -765,7 +787,7 @@ var $0a551147dc92a718$export$2e2bcd8739ae039 = $0a551147dc92a718$var$SearchButto
|
|
|
765
787
|
|
|
766
788
|
|
|
767
789
|
const $5723016a5461c1ca$var$PageHeader = (props)=>{
|
|
768
|
-
const { headerText: headerText
|
|
790
|
+
const { headerText: headerText } = props;
|
|
769
791
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
770
792
|
className: "ds-l-container",
|
|
771
793
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -827,7 +849,7 @@ function $eff7d34c30f5a0fc$export$60ec7cc1d341a524(searchParams, defaultSortOpti
|
|
|
827
849
|
};
|
|
828
850
|
}
|
|
829
851
|
async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, additionalParams) {
|
|
830
|
-
const { fulltext: fulltext
|
|
852
|
+
const { fulltext: fulltext, selectedFacets: selectedFacets, sort: sort, sortOrder: sortOrder, page: page, pageSize: pageSize } = options;
|
|
831
853
|
let params = {
|
|
832
854
|
fulltext: fulltext ? fulltext : undefined,
|
|
833
855
|
...selectedFacets,
|
|
@@ -846,7 +868,7 @@ async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, addit
|
|
|
846
868
|
|
|
847
869
|
|
|
848
870
|
const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
849
|
-
const { rootUrl: rootUrl
|
|
871
|
+
const { rootUrl: rootUrl, surveyLink: surveyLink, additionalParams: additionalParams, enableSort: enableSort, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort, pageTitle: pageTitle, filterTitle: filterTitle, showLargeFileWarning: showLargeFileWarning, largeFileThemes: largeFileThemes, introText: introText, showDownloadIcon: showDownloadIcon, altMobileSearchButton: altMobileSearchButton } = props;
|
|
850
872
|
const sortOptions = [
|
|
851
873
|
{
|
|
852
874
|
label: "Newest",
|
|
@@ -988,7 +1010,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
988
1010
|
["page-size"]: pageSize !== 10 ? pageSize : undefined,
|
|
989
1011
|
...additionalParams
|
|
990
1012
|
};
|
|
991
|
-
const { data: data
|
|
1013
|
+
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
992
1014
|
queryKey: [
|
|
993
1015
|
"datasets",
|
|
994
1016
|
params
|
|
@@ -1088,7 +1110,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
1088
1110
|
}),
|
|
1089
1111
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
1090
1112
|
className: "ds-l-col--12 ds-l-sm-col--8",
|
|
1091
|
-
children:
|
|
1113
|
+
children: isPending ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
1092
1114
|
className: "ds-u-valign--middle",
|
|
1093
1115
|
"aria-valuetext": "Dataset Search loading",
|
|
1094
1116
|
role: "status"
|
|
@@ -1157,7 +1179,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
1157
1179
|
downloadUrl: showDownloadIcon ? getDownloadUrl(item) : null,
|
|
1158
1180
|
largeFile: showLargeFile,
|
|
1159
1181
|
paginationEnabled: enablePagination
|
|
1160
|
-
});
|
|
1182
|
+
}, item.identifier);
|
|
1161
1183
|
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
1162
1184
|
variation: "error",
|
|
1163
1185
|
heading: "Could not connect to the API."
|
|
@@ -1243,28 +1265,30 @@ const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl, additi
|
|
|
1243
1265
|
distribution: [],
|
|
1244
1266
|
error: "",
|
|
1245
1267
|
description: "",
|
|
1246
|
-
identifier: ""
|
|
1268
|
+
identifier: "",
|
|
1269
|
+
modified: ""
|
|
1247
1270
|
});
|
|
1248
1271
|
const [id, setId] = (0, $hgUW1$useState)(datasetId);
|
|
1249
1272
|
const [rootUrl, setRootUrl] = (0, $hgUW1$useState)(rootAPIUrl);
|
|
1250
1273
|
const additionalParamsString = Object.keys(additionalParams).length ? `&${(0, $hgUW1$qs).stringify(additionalParams)}` : "";
|
|
1251
|
-
(0, $hgUW1$
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
}));
|
|
1274
|
+
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
1275
|
+
queryKey: [
|
|
1276
|
+
"metastore" + id
|
|
1277
|
+
],
|
|
1278
|
+
queryFn: ()=>{
|
|
1279
|
+
return fetch(`${rootUrl}/metastore/schemas/dataset/items/${id}?show-reference-ids${additionalParamsString}`).then((res)=>res.json()).then((res)=>{
|
|
1280
|
+
return res;
|
|
1281
|
+
});
|
|
1260
1282
|
}
|
|
1261
|
-
|
|
1283
|
+
});
|
|
1284
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
1285
|
+
if (data && data != dataset) setDataset(data);
|
|
1262
1286
|
}, [
|
|
1263
|
-
|
|
1264
|
-
rootUrl
|
|
1287
|
+
data
|
|
1265
1288
|
]);
|
|
1266
1289
|
return {
|
|
1267
1290
|
dataset: dataset,
|
|
1291
|
+
isPending: isPending,
|
|
1268
1292
|
setId: setId,
|
|
1269
1293
|
setRootUrl: setRootUrl
|
|
1270
1294
|
};
|
|
@@ -1277,47 +1301,9 @@ var $b4aa9c66f2e86959$export$2e2bcd8739ae039 = $b4aa9c66f2e86959$var$useMetastor
|
|
|
1277
1301
|
|
|
1278
1302
|
|
|
1279
1303
|
|
|
1280
|
-
async function $0e7628cf73c71646$export$55f990b5477765d6(id, rootUrl, options, additionalParams) {
|
|
1281
|
-
const { keys: keys , limit: limit , offset: offset , conditions: conditions , sort: sort , groupings: groupings , prepareColumns: prepareColumns , properties: properties , setValues: setValues , setCount: setCount , setColumns: setColumns , setLoading: setLoading , setSchema: setSchema } = options;
|
|
1282
|
-
if (!id) // TODO: Throw error
|
|
1283
|
-
return false;
|
|
1284
|
-
if (typeof setLoading === "function") setLoading(true);
|
|
1285
|
-
return await (0, $hgUW1$axios)({
|
|
1286
|
-
method: "GET",
|
|
1287
|
-
url: `${rootUrl}/datastore/query/${id}`,
|
|
1288
|
-
params: {
|
|
1289
|
-
keys: keys,
|
|
1290
|
-
limit: limit,
|
|
1291
|
-
offset: offset,
|
|
1292
|
-
conditions: conditions,
|
|
1293
|
-
sorts: sort,
|
|
1294
|
-
properties: properties,
|
|
1295
|
-
groupings: groupings,
|
|
1296
|
-
...additionalParams
|
|
1297
|
-
},
|
|
1298
|
-
//paramsSerializer: {
|
|
1299
|
-
// serialize: qs.stringify
|
|
1300
|
-
//},
|
|
1301
|
-
paramsSerializer: (params)=>{
|
|
1302
|
-
return (0, $hgUW1$qs).stringify(params);
|
|
1303
|
-
}
|
|
1304
|
-
}).then((res)=>{
|
|
1305
|
-
const { data: data } = res;
|
|
1306
|
-
const propertyKeys = data.schema[id] && data.schema[id].fields ? Object.keys(data.schema[id].fields) : [];
|
|
1307
|
-
setValues(data.results), setCount(data.count);
|
|
1308
|
-
if (propertyKeys.length) setColumns(prepareColumns ? prepareColumns(propertyKeys) : propertyKeys);
|
|
1309
|
-
setSchema(data.schema);
|
|
1310
|
-
if (typeof setLoading === "function") setLoading(false);
|
|
1311
|
-
return data;
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
1304
|
const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, additionalParams = {})=>{
|
|
1317
1305
|
const keys = options.keys ? options.keys : true;
|
|
1318
|
-
const { prepareColumns: prepareColumns
|
|
1319
|
-
const [manual, setManual] = (0, $hgUW1$useState)(options.manual ? options.manual : false);
|
|
1320
|
-
const [requireConditions, setRequireConditions] = (0, $hgUW1$useState)(options.requireConditions ? options.requireConditions : false);
|
|
1306
|
+
const { prepareColumns: prepareColumns } = options;
|
|
1321
1307
|
const [values, setValues] = (0, $hgUW1$useState)([]);
|
|
1322
1308
|
const [id, setResource] = (0, $hgUW1$useState)(resourceId);
|
|
1323
1309
|
const [rootUrl, setRootUrl] = (0, $hgUW1$useState)(rootAPIUrl);
|
|
@@ -1325,63 +1311,43 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
1325
1311
|
const [count, setCount] = (0, $hgUW1$useState)(null);
|
|
1326
1312
|
const [columns, setColumns] = (0, $hgUW1$useState)([]);
|
|
1327
1313
|
const [offset, setOffset] = (0, $hgUW1$useState)(options.offset ? options.offset : 0);
|
|
1328
|
-
const [loading, setLoading] = (0, $hgUW1$useState)(false);
|
|
1329
1314
|
const [conditions, setConditions] = (0, $hgUW1$useState)(options.conditions ? options.conditions : undefined);
|
|
1330
1315
|
const [sort, setSort] = (0, $hgUW1$useState)(options.sort ? options.sort : undefined);
|
|
1331
1316
|
const [groupings, setGroupings] = (0, $hgUW1$useState)(options.groupings ? options.groupings : undefined);
|
|
1332
1317
|
const [schema, setSchema] = (0, $hgUW1$useState)({});
|
|
1333
1318
|
// const [joins, setJoins] = useState()
|
|
1334
1319
|
const [properties, setProperties] = (0, $hgUW1$useState)(options.properties ? options.properties : undefined);
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1320
|
+
let params = {
|
|
1321
|
+
keys: keys,
|
|
1322
|
+
limit: limit,
|
|
1323
|
+
offset: offset,
|
|
1324
|
+
conditions: conditions,
|
|
1325
|
+
sorts: sort,
|
|
1326
|
+
properties: properties,
|
|
1327
|
+
groupings: groupings,
|
|
1328
|
+
...additionalParams
|
|
1329
|
+
};
|
|
1330
|
+
const additionalParamsString = Object.keys(params).length ? `&${(0, $hgUW1$qs).stringify(params)}` : "";
|
|
1331
|
+
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
1332
|
+
queryKey: [
|
|
1333
|
+
"datastore" + id + additionalParamsString
|
|
1334
|
+
],
|
|
1335
|
+
queryFn: ()=>{
|
|
1336
|
+
return fetch(`${rootUrl}/datastore/query/${id}?${additionalParamsString}`).then((res)=>res.json());
|
|
1337
|
+
}
|
|
1340
1338
|
});
|
|
1341
|
-
const prevLimit = prevLimitRef.current;
|
|
1342
|
-
const prevOffset = prevOffsetRef.current;
|
|
1343
|
-
function fetchData() {
|
|
1344
|
-
let newOffset = prevLimit === limit ? prevOffset !== offset ? offset : 0 : 0;
|
|
1345
|
-
setOffset(newOffset);
|
|
1346
|
-
(0, $0e7628cf73c71646$export$55f990b5477765d6)(id, rootUrl, {
|
|
1347
|
-
keys: keys,
|
|
1348
|
-
limit: limit,
|
|
1349
|
-
offset: newOffset,
|
|
1350
|
-
conditions: conditions,
|
|
1351
|
-
sort: sort,
|
|
1352
|
-
groupings: groupings,
|
|
1353
|
-
prepareColumns: prepareColumns,
|
|
1354
|
-
properties: properties,
|
|
1355
|
-
setValues: setValues,
|
|
1356
|
-
setCount: setCount,
|
|
1357
|
-
setColumns: setColumns,
|
|
1358
|
-
setLoading: setLoading,
|
|
1359
|
-
setSchema: setSchema,
|
|
1360
|
-
setProperties: setProperties
|
|
1361
|
-
}, additionalParams);
|
|
1362
|
-
}
|
|
1363
1339
|
(0, $hgUW1$useEffect)(()=>{
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
setCount(null);
|
|
1370
|
-
setValues([]);
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1340
|
+
if (data) {
|
|
1341
|
+
const propertyKeys = data.schema[id] && data.schema[id].fields ? Object.keys(data.schema[id].fields) : [];
|
|
1342
|
+
setValues(data.results), setCount(data.count);
|
|
1343
|
+
if (propertyKeys.length) setColumns(prepareColumns ? prepareColumns(propertyKeys) : propertyKeys);
|
|
1344
|
+
setSchema(data.schema);
|
|
1373
1345
|
}
|
|
1374
1346
|
}, [
|
|
1375
|
-
|
|
1376
|
-
rootUrl,
|
|
1377
|
-
offset,
|
|
1378
|
-
conditions,
|
|
1379
|
-
sort,
|
|
1380
|
-
limit,
|
|
1381
|
-
requireConditions
|
|
1347
|
+
data
|
|
1382
1348
|
]);
|
|
1383
1349
|
return {
|
|
1384
|
-
loading:
|
|
1350
|
+
loading: isPending,
|
|
1385
1351
|
values: values,
|
|
1386
1352
|
count: count,
|
|
1387
1353
|
columns: columns,
|
|
@@ -1397,10 +1363,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
1397
1363
|
setLimit: setLimit,
|
|
1398
1364
|
setOffset: setOffset,
|
|
1399
1365
|
setConditions: setConditions,
|
|
1400
|
-
setSort: setSort
|
|
1401
|
-
setManual: setManual,
|
|
1402
|
-
setRequireConditions: setRequireConditions,
|
|
1403
|
-
fetchData: fetchData
|
|
1366
|
+
setSort: setSort
|
|
1404
1367
|
};
|
|
1405
1368
|
};
|
|
1406
1369
|
var $1d3d480a9cfaabe0$export$2e2bcd8739ae039 = $1d3d480a9cfaabe0$var$useDatastore;
|
|
@@ -1650,7 +1613,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
1650
1613
|
|
|
1651
1614
|
|
|
1652
1615
|
|
|
1653
|
-
const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table
|
|
1616
|
+
const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement, setAriaLiveFeedback: setAriaLiveFeedback })=>{
|
|
1654
1617
|
const [columnResizing, setColumnResizing] = (0, $hgUW1$useState)("");
|
|
1655
1618
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
|
|
1656
1619
|
className: "dc-thead--truncated dc-thead--resizeable",
|
|
@@ -1743,7 +1706,7 @@ var $96d341d082bffec5$export$2e2bcd8739ae039 = $96d341d082bffec5$var$TruncatedRe
|
|
|
1743
1706
|
|
|
1744
1707
|
|
|
1745
1708
|
|
|
1746
|
-
const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table
|
|
1709
|
+
const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table, sortElement: sortElement })=>{
|
|
1747
1710
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
|
|
1748
1711
|
className: "dc-thead--fixed-size",
|
|
1749
1712
|
children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
@@ -1775,7 +1738,7 @@ var $23763e27eda0e8d7$export$2e2bcd8739ae039 = $23763e27eda0e8d7$var$FixedSizeTH
|
|
|
1775
1738
|
|
|
1776
1739
|
|
|
1777
1740
|
|
|
1778
|
-
const $d98f94c79ddf4e0e$var$DataTable = ({ data: data
|
|
1741
|
+
const $d98f94c79ddf4e0e$var$DataTable = ({ data: data, columns: columns, setSort: setSort, sortTransform: sortTransform, tablePadding: tablePadding, canResize: canResize, loading: loading = false })=>{
|
|
1779
1742
|
const [sorting, setSorting] = (0, $hgUW1$react).useState([]);
|
|
1780
1743
|
const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
|
|
1781
1744
|
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
@@ -2026,7 +1989,7 @@ function $7264a673914aa746$export$2b9377795161999(type) {
|
|
|
2026
1989
|
|
|
2027
1990
|
|
|
2028
1991
|
|
|
2029
|
-
const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows
|
|
1992
|
+
const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className })=>{
|
|
2030
1993
|
const numTotalRows = totalRows;
|
|
2031
1994
|
if (numTotalRows === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
2032
1995
|
className: className,
|
|
@@ -2075,8 +2038,8 @@ var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePa
|
|
|
2075
2038
|
|
|
2076
2039
|
|
|
2077
2040
|
|
|
2078
|
-
const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource
|
|
2079
|
-
const { limit: limit
|
|
2041
|
+
const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource, downloadURL: downloadURL, jsonUrl: jsonUrl })=>{
|
|
2042
|
+
const { limit: limit, offset: offset, count: count } = resource;
|
|
2080
2043
|
const intCount = count ? count : 0;
|
|
2081
2044
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2082
2045
|
className: "ds-l-row ds-u-align-items--center ds-u-margin-bottom--2",
|
|
@@ -2084,7 +2047,7 @@ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource , downloadUR
|
|
|
2084
2047
|
className: "ds-l-col--12 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between ds-u-align-items--center",
|
|
2085
2048
|
children: [
|
|
2086
2049
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2087
|
-
className: "ds-l-col--12 ds-l-lg-col--
|
|
2050
|
+
className: "ds-l-col--12 ds-l-lg-col--4",
|
|
2088
2051
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
2089
2052
|
totalRows: intCount,
|
|
2090
2053
|
limit: limit,
|
|
@@ -2092,10 +2055,10 @@ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource , downloadUR
|
|
|
2092
2055
|
})
|
|
2093
2056
|
}),
|
|
2094
2057
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2095
|
-
className: "dc-c-resource-header--buttons ds-l-col--12 ds-l-lg-col--
|
|
2058
|
+
className: "dc-c-resource-header--buttons ds-l-col--12 ds-l-lg-col--8 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-u-margin-bottom--2 ds-u-md-margin-bottom--0 ds-u-padding-x--0",
|
|
2096
2059
|
children: [
|
|
2097
2060
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2098
|
-
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-
|
|
2061
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-bottom--2 ds-u-md-margin-bottom--0",
|
|
2099
2062
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
|
|
2100
2063
|
onOpen: ()=>{
|
|
2101
2064
|
navigator.clipboard.writeText(window.location.href);
|
|
@@ -2117,18 +2080,17 @@ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource , downloadUR
|
|
|
2117
2080
|
})
|
|
2118
2081
|
}),
|
|
2119
2082
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2120
|
-
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0",
|
|
2083
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-sm-margin-left--2",
|
|
2121
2084
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2122
2085
|
className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
|
|
2123
2086
|
href: downloadURL,
|
|
2124
|
-
"aria-label": "Download filtered data (CSV)",
|
|
2125
2087
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2126
2088
|
className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
|
|
2127
2089
|
children: [
|
|
2128
2090
|
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2129
2091
|
className: "fas fa-file-csv"
|
|
2130
2092
|
}),
|
|
2131
|
-
"
|
|
2093
|
+
" Download filtered data (CSV)"
|
|
2132
2094
|
]
|
|
2133
2095
|
})
|
|
2134
2096
|
})
|
|
@@ -2169,10 +2131,17 @@ var $6380a4a580b24362$export$2e2bcd8739ae039 = $6380a4a580b24362$var$DataTableHe
|
|
|
2169
2131
|
|
|
2170
2132
|
|
|
2171
2133
|
|
|
2172
|
-
const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions
|
|
2173
|
-
const { fields: fields
|
|
2174
|
-
|
|
2175
|
-
children: "
|
|
2134
|
+
const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions, schema: schema, customColumns: customColumns })=>{
|
|
2135
|
+
const { fields: fields } = schema;
|
|
2136
|
+
const prependedMessage = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
2137
|
+
children: "Data filters: "
|
|
2138
|
+
});
|
|
2139
|
+
if (!conditions || !conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
|
|
2140
|
+
className: "ds-u-margin-y--0",
|
|
2141
|
+
children: [
|
|
2142
|
+
prependedMessage,
|
|
2143
|
+
" none"
|
|
2144
|
+
]
|
|
2176
2145
|
});
|
|
2177
2146
|
function formatValue(text, property) {
|
|
2178
2147
|
if (customColumns && customColumns.length > 0) {
|
|
@@ -2184,42 +2153,48 @@ const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions , schema: sch
|
|
|
2184
2153
|
return text;
|
|
2185
2154
|
} else return text;
|
|
2186
2155
|
}
|
|
2187
|
-
return /*#__PURE__*/ (0, $hgUW1$
|
|
2156
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2188
2157
|
className: "dc-querybuilder-title",
|
|
2189
|
-
children:
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2158
|
+
children: [
|
|
2159
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
2160
|
+
className: "ds-u-margin-y--0",
|
|
2161
|
+
children: prependedMessage
|
|
2162
|
+
}),
|
|
2163
|
+
conditions.map((c)=>{
|
|
2164
|
+
const field = fields[c.property];
|
|
2165
|
+
const description = field && field.description ? field.description : c.property;
|
|
2166
|
+
const operator = (0, $7264a673914aa746$export$5f89a5ae87bc48e1).find((op)=>op.value === c.operator);
|
|
2167
|
+
const cleanedText = (0, $7264a673914aa746$export$6b5e57d20078142b)(c.value);
|
|
2168
|
+
const formattedText = formatValue(cleanedText, c.property);
|
|
2169
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2170
|
+
className: "ds-u-fill--background ds-u-padding--1 ds-u-margin-y--1 ds-u-display--inline-block ds-u-font-weight--semibold",
|
|
2171
|
+
children: [
|
|
2172
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2173
|
+
className: "ds-u-font-weight--bold",
|
|
2174
|
+
children: description
|
|
2175
|
+
}),
|
|
2176
|
+
" ",
|
|
2177
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2178
|
+
className: "ds-u-font-weight--normal",
|
|
2179
|
+
children: operator.label.toUpperCase()
|
|
2180
|
+
}),
|
|
2181
|
+
" ",
|
|
2182
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2183
|
+
className: "ds-u-color--success",
|
|
2184
|
+
children: formattedText
|
|
2185
|
+
})
|
|
2186
|
+
]
|
|
2187
|
+
});
|
|
2188
|
+
}).reduce((prev, curr)=>[
|
|
2189
|
+
prev,
|
|
2190
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Badge), {
|
|
2191
|
+
className: "ds-u-margin-x--1",
|
|
2192
|
+
variation: "info",
|
|
2193
|
+
children: "AND"
|
|
2206
2194
|
}),
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
children: formattedText
|
|
2211
|
-
})
|
|
2212
|
-
]
|
|
2213
|
-
});
|
|
2214
|
-
}).reduce((prev, curr)=>[
|
|
2215
|
-
prev,
|
|
2216
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Badge), {
|
|
2217
|
-
className: "ds-u-margin-x--1",
|
|
2218
|
-
variation: "info",
|
|
2219
|
-
children: "AND"
|
|
2220
|
-
}),
|
|
2221
|
-
curr
|
|
2222
|
-
])
|
|
2195
|
+
curr
|
|
2196
|
+
])
|
|
2197
|
+
]
|
|
2223
2198
|
});
|
|
2224
2199
|
};
|
|
2225
2200
|
var $bef7bff2823feea2$export$2e2bcd8739ae039 = $bef7bff2823feea2$var$QueryTitle;
|
|
@@ -2238,7 +2213,7 @@ function $6369abf590ca298f$var$getStartDate(condition, schema, id) {
|
|
|
2238
2213
|
}
|
|
2239
2214
|
return new Date();
|
|
2240
2215
|
}
|
|
2241
|
-
const $6369abf590ca298f$var$QueryRow = ({ id: id
|
|
2216
|
+
const $6369abf590ca298f$var$QueryRow = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema })=>{
|
|
2242
2217
|
const [operator, setOperator] = (0, $hgUW1$useState)(condition.operator);
|
|
2243
2218
|
const [property, setProperty] = (0, $hgUW1$useState)(condition.property);
|
|
2244
2219
|
const [value, setValue] = (0, $hgUW1$useState)(condition.value);
|
|
@@ -2370,8 +2345,8 @@ function $ee4ad47aa483e5b5$var$updateQueryForDatastore(condition) {
|
|
|
2370
2345
|
return cond;
|
|
2371
2346
|
}
|
|
2372
2347
|
const $ee4ad47aa483e5b5$var$QueryBuilder = (props)=>{
|
|
2373
|
-
const { resource: resource
|
|
2374
|
-
const { conditions: conditions
|
|
2348
|
+
const { resource: resource, id: id, includeSearchParams: includeSearchParams, customColumns: customColumns } = props;
|
|
2349
|
+
const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
|
|
2375
2350
|
const fields = Object.keys(schema[id].fields);
|
|
2376
2351
|
const [conditionsCleared, setConditionsCleared] = (0, $hgUW1$useState)(false);
|
|
2377
2352
|
const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
|
|
@@ -2539,7 +2514,7 @@ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
|
|
|
2539
2514
|
accessor: column
|
|
2540
2515
|
}));
|
|
2541
2516
|
}
|
|
2542
|
-
const $a35cf16d1488f54e$var$DatasetTable = ({ id: id
|
|
2517
|
+
const $a35cf16d1488f54e$var$DatasetTable = ({ id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], jsonUrl: jsonUrl })=>{
|
|
2543
2518
|
const defaultPage = 1;
|
|
2544
2519
|
const defaultPageSize = 10;
|
|
2545
2520
|
const [page, setPage] = (0, $hgUW1$useState)(defaultPage);
|
|
@@ -2551,7 +2526,7 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ id: id , distribution: distributio
|
|
|
2551
2526
|
50,
|
|
2552
2527
|
100
|
|
2553
2528
|
];
|
|
2554
|
-
const { limit: limit
|
|
2529
|
+
const { limit: limit, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
2555
2530
|
const pageSize = limit ? limit : defaultPageSize;
|
|
2556
2531
|
const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
|
|
2557
2532
|
conditions: resource.conditions
|
|
@@ -2638,7 +2613,7 @@ function $5644ebd2c3dbfd7b$export$eea3a12df15499ca(metadataMapping, datasetInfo)
|
|
|
2638
2613
|
});
|
|
2639
2614
|
return rows;
|
|
2640
2615
|
}
|
|
2641
|
-
const $5644ebd2c3dbfd7b$var$DatasetAdditionalInformation = ({ datasetInfo: datasetInfo
|
|
2616
|
+
const $5644ebd2c3dbfd7b$var$DatasetAdditionalInformation = ({ datasetInfo: datasetInfo, id: id, metadataMapping: metadataMapping })=>{
|
|
2642
2617
|
const rows = $5644ebd2c3dbfd7b$export$eea3a12df15499ca(metadataMapping, datasetInfo);
|
|
2643
2618
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2644
2619
|
className: "dc-c-additional-info-table ds-u-margin-bottom--6",
|
|
@@ -2690,8 +2665,8 @@ var $5644ebd2c3dbfd7b$export$2e2bcd8739ae039 = $5644ebd2c3dbfd7b$var$DatasetAddi
|
|
|
2690
2665
|
|
|
2691
2666
|
|
|
2692
2667
|
|
|
2693
|
-
const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource
|
|
2694
|
-
const { count: count
|
|
2668
|
+
const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
|
|
2669
|
+
const { count: count, columns: columns } = resource;
|
|
2695
2670
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2696
2671
|
className: "dc-c-resource-info-table ds-l-col--12 ds-u-padding-left--0 ds-u-margin-y--2",
|
|
2697
2672
|
children: [
|
|
@@ -2739,7 +2714,7 @@ var $0958733ee130fc44$export$2e2bcd8739ae039 = $0958733ee130fc44$var$ResourceInf
|
|
|
2739
2714
|
|
|
2740
2715
|
|
|
2741
2716
|
|
|
2742
|
-
const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions
|
|
2717
|
+
const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource: resource, title: title })=>{
|
|
2743
2718
|
function getFormatType(dist) {
|
|
2744
2719
|
if (dist.data.format) return dist.data.format.toLowerCase();
|
|
2745
2720
|
if (dist.data.mediaType) {
|
|
@@ -2765,12 +2740,12 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2765
2740
|
className: "ds-l-col--12 ds-u-padding-left--0 ds-text-heading--2xl",
|
|
2766
2741
|
children: "Resources"
|
|
2767
2742
|
}),
|
|
2768
|
-
distributions.length
|
|
2743
|
+
distributions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
2769
2744
|
className: "ds-c-list ds-c-list--bare dc-c-resource-full-width",
|
|
2770
2745
|
children: distributions.map((dist)=>{
|
|
2771
2746
|
const fileFormat = getFormatType(dist);
|
|
2772
2747
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
2773
|
-
className:
|
|
2748
|
+
className: `ds-u-display--flex ds-u-flex-wrap--wrap ${fileFormat !== "csv" && "ds-u-margin-bottom--2"}`,
|
|
2774
2749
|
children: [
|
|
2775
2750
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2776
2751
|
className: "ds-u-font-weight--bold ds-u-font-size--lg ds-l-col--12 ds-l-md-col--6 ds-u-padding-left--0",
|
|
@@ -2778,7 +2753,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2778
2753
|
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2779
2754
|
className: "fa ds-u-color--primary ds-u-padding-right--1 fa-file-" + (fileFormat == "xlsx" ? "excel" : fileFormat)
|
|
2780
2755
|
}),
|
|
2781
|
-
title + " (" + fileFormat.toUpperCase() + ")"
|
|
2756
|
+
dist.data.title ? dist.data.title : title + " (" + fileFormat.toUpperCase() + ")"
|
|
2782
2757
|
]
|
|
2783
2758
|
}),
|
|
2784
2759
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -2799,12 +2774,17 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2799
2774
|
]
|
|
2800
2775
|
})
|
|
2801
2776
|
}),
|
|
2802
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
2777
|
+
dist.data.description && /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
2778
|
+
children: dist.data.description
|
|
2779
|
+
}),
|
|
2780
|
+
fileFormat === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $0958733ee130fc44$export$2e2bcd8739ae039), {
|
|
2803
2781
|
resource: resource
|
|
2804
2782
|
})
|
|
2805
2783
|
]
|
|
2806
2784
|
}, dist.identifier);
|
|
2807
2785
|
})
|
|
2786
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2787
|
+
className: "ds-u-margin-top--2"
|
|
2808
2788
|
})
|
|
2809
2789
|
]
|
|
2810
2790
|
});
|
|
@@ -2812,7 +2792,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2812
2792
|
var $7357cc0f79f9c514$export$2e2bcd8739ae039 = $7357cc0f79f9c514$var$Resource;
|
|
2813
2793
|
|
|
2814
2794
|
|
|
2815
|
-
const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset
|
|
2795
|
+
const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset, resource: resource, distributions: distributions, metadataMapping: metadataMapping })=>{
|
|
2816
2796
|
const md = (0, $hgUW1$useMediaQuery)({
|
|
2817
2797
|
minWidth: 0,
|
|
2818
2798
|
maxWidth: 768
|
|
@@ -2868,7 +2848,7 @@ var $364dc44850cd8f7f$export$2e2bcd8739ae039 = $364dc44850cd8f7f$var$DatasetOver
|
|
|
2868
2848
|
|
|
2869
2849
|
|
|
2870
2850
|
|
|
2871
|
-
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint
|
|
2851
|
+
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
2872
2852
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2873
2853
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
|
|
2874
2854
|
url: endpoint
|
|
@@ -2878,7 +2858,7 @@ const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
|
2878
2858
|
var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
|
|
2879
2859
|
|
|
2880
2860
|
|
|
2881
|
-
const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id
|
|
2861
|
+
const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id, rootUrl: rootUrl, apiUrl: apiUrl, additionalParams: additionalParams })=>{
|
|
2882
2862
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
2883
2863
|
children: [
|
|
2884
2864
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -2933,7 +2913,7 @@ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
|
|
|
2933
2913
|
|
|
2934
2914
|
|
|
2935
2915
|
|
|
2936
|
-
const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionary: datasetDictionary
|
|
2916
|
+
const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionary: datasetDictionary, title: title, pageSize: pageSize = 20 })=>{
|
|
2937
2917
|
const [pagination, setPagination] = (0, $hgUW1$useState)({
|
|
2938
2918
|
pageIndex: 1,
|
|
2939
2919
|
pageSize: pageSize
|
|
@@ -3021,8 +3001,9 @@ var $6012b86ffcaf3f71$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
3021
3001
|
|
|
3022
3002
|
|
|
3023
3003
|
|
|
3004
|
+
|
|
3024
3005
|
const $a0f13962e513caa1$var$getSiteWideDataDictionary = (rootUrl, dataDictionaryUrl)=>{
|
|
3025
|
-
const { data: data
|
|
3006
|
+
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
3026
3007
|
queryKey: [
|
|
3027
3008
|
"dictionary"
|
|
3028
3009
|
],
|
|
@@ -3032,10 +3013,10 @@ const $a0f13962e513caa1$var$getSiteWideDataDictionary = (rootUrl, dataDictionary
|
|
|
3032
3013
|
});
|
|
3033
3014
|
return {
|
|
3034
3015
|
siteWideDataDictionary: data,
|
|
3035
|
-
dataDictionaryLoading:
|
|
3016
|
+
dataDictionaryLoading: isPending
|
|
3036
3017
|
};
|
|
3037
3018
|
};
|
|
3038
|
-
const $a0f13962e513caa1$var$Dataset = ({ id: id
|
|
3019
|
+
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 })=>{
|
|
3039
3020
|
const options = location.search ? {
|
|
3040
3021
|
...(0, $hgUW1$qs).parse(location.search, {
|
|
3041
3022
|
ignoreQueryPrefix: true
|
|
@@ -3043,7 +3024,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3043
3024
|
} : {
|
|
3044
3025
|
conditions: []
|
|
3045
3026
|
};
|
|
3046
|
-
const { dataset: dataset
|
|
3027
|
+
const { dataset: dataset, isPending: isPending } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl, additionalParams);
|
|
3047
3028
|
const title = dataset.title ? dataset.title : "";
|
|
3048
3029
|
const metadataMapping = {
|
|
3049
3030
|
...(0, $6da0396069e23175$export$bc27cf7ecf44639d),
|
|
@@ -3057,7 +3038,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3057
3038
|
limit: defaultPageSize,
|
|
3058
3039
|
manual: true
|
|
3059
3040
|
}, additionalParams);
|
|
3060
|
-
const { siteWideDataDictionary: siteWideDataDictionary
|
|
3041
|
+
const { siteWideDataDictionary: siteWideDataDictionary } = dataDictionaryUrl ? $a0f13962e513caa1$var$getSiteWideDataDictionary(rootUrl, dataDictionaryUrl) : {
|
|
3061
3042
|
siteWideDataDictionary: null
|
|
3062
3043
|
};
|
|
3063
3044
|
// compare schema fields with siteWideDataDictionary to display commonalities for now
|
|
@@ -3065,19 +3046,20 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3065
3046
|
const datasetDictionary = siteWideDataDictionary && resource && resource.schema[distribution.identifier] ? siteWideDataDictionary.data.fields.filter((field)=>{
|
|
3066
3047
|
return Object.keys(resource.schema[distribution.identifier].fields).indexOf(field.name) !== -1;
|
|
3067
3048
|
}) : null;
|
|
3068
|
-
|
|
3049
|
+
const getlocalFileFormat = ()=>{
|
|
3050
|
+
let localFileFormat = "";
|
|
3069
3051
|
if (distribution.identifier) {
|
|
3070
|
-
let localFileFormat = "";
|
|
3071
3052
|
if (distribution.data.format) localFileFormat = distribution.data.format.toUpperCase();
|
|
3072
3053
|
else if (distribution.data.mediaType) {
|
|
3073
3054
|
const mediaType = distribution.data.mediaType.split("/");
|
|
3074
3055
|
if (mediaType.length && mediaType[1]) localFileFormat = mediaType[1].toUpperCase();
|
|
3075
3056
|
}
|
|
3076
|
-
if (localFileFormat === "CSV") {
|
|
3077
|
-
resource.setResource(distribution.identifier);
|
|
3078
|
-
resource.setManual(false);
|
|
3079
|
-
}
|
|
3080
3057
|
}
|
|
3058
|
+
return localFileFormat;
|
|
3059
|
+
};
|
|
3060
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3061
|
+
const localFileFormat = getlocalFileFormat();
|
|
3062
|
+
if (localFileFormat === "CSV") resource.setResource(distribution.identifier);
|
|
3081
3063
|
}, [
|
|
3082
3064
|
distribution
|
|
3083
3065
|
]);
|
|
@@ -3119,6 +3101,17 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3119
3101
|
})
|
|
3120
3102
|
]
|
|
3121
3103
|
});
|
|
3104
|
+
// The below code manages the selected tab in the Design System tab group manually to ensure we can still use the
|
|
3105
|
+
// Data Table tab as the default since it no longer exists on initial render (By default, Overview will appear as default)
|
|
3106
|
+
const getDefaultTab = ()=>{
|
|
3107
|
+
return distribution && distribution.data && getlocalFileFormat() === "CSV" ? "data-table" : "overview";
|
|
3108
|
+
};
|
|
3109
|
+
const [selectedTab, setSelectedTab] = (0, $hgUW1$useState)(window.location.hash.substring(1) ? window.location.hash.substring(1) : getDefaultTab());
|
|
3110
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3111
|
+
setSelectedTab(getDefaultTab());
|
|
3112
|
+
}, [
|
|
3113
|
+
distribution
|
|
3114
|
+
]);
|
|
3122
3115
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
3123
3116
|
children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
|
|
3124
3117
|
content: notFoundContent,
|
|
@@ -3126,36 +3119,53 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3126
3119
|
}) : /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3127
3120
|
className: "ds-l-container",
|
|
3128
3121
|
children: [
|
|
3129
|
-
/*#__PURE__*/ (0, $hgUW1$
|
|
3122
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3130
3123
|
className: "ds-l-row",
|
|
3131
|
-
children:
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("h1", {
|
|
3135
|
-
className: "ds-
|
|
3124
|
+
children: [
|
|
3125
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3126
|
+
className: "ds-l-md-col--9",
|
|
3127
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("h1", {
|
|
3128
|
+
className: "ds-h1 title-underline",
|
|
3136
3129
|
children: title
|
|
3137
|
-
})
|
|
3138
|
-
|
|
3130
|
+
})
|
|
3131
|
+
}),
|
|
3132
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3133
|
+
className: "ds-l-md-col--12 ds-u-color--gray ds-u-margin-y--1 ds-u-text-align--right",
|
|
3134
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
|
|
3135
|
+
className: "ds-u-margin--0",
|
|
3136
|
+
children: [
|
|
3137
|
+
"Updated ",
|
|
3138
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
3139
|
+
date: dataset.modified
|
|
3140
|
+
})
|
|
3141
|
+
]
|
|
3142
|
+
})
|
|
3143
|
+
}),
|
|
3144
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3145
|
+
className: "ds-l-md-col--9",
|
|
3146
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3139
3147
|
className: "ds-u-measure--wide ds-u-margin-bottom--7",
|
|
3140
3148
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
3141
|
-
className: "dc-c-metadata-description",
|
|
3149
|
+
className: "dc-c-metadata-description ds-u-margin--0",
|
|
3142
3150
|
dangerouslySetInnerHTML: {
|
|
3143
3151
|
__html: (0, $hgUW1$dompurify).sanitize(dataset.description)
|
|
3144
3152
|
}
|
|
3145
3153
|
})
|
|
3146
3154
|
})
|
|
3147
|
-
|
|
3148
|
-
|
|
3155
|
+
})
|
|
3156
|
+
]
|
|
3149
3157
|
}),
|
|
3150
3158
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3151
3159
|
className: "ds-l-row",
|
|
3152
3160
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3153
3161
|
className: "ds-l-md-col--12 dc-dataset",
|
|
3154
|
-
children:
|
|
3155
|
-
onChange:
|
|
3156
|
-
|
|
3162
|
+
children: !isPending && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tabs), {
|
|
3163
|
+
onChange: (selectedId, prevSelectedId)=>{
|
|
3164
|
+
setSelectedTab(selectedId);
|
|
3165
|
+
},
|
|
3166
|
+
selectedId: selectedTab,
|
|
3157
3167
|
children: [
|
|
3158
|
-
distribution.data
|
|
3168
|
+
distribution && distribution.data && getlocalFileFormat() === "CSV" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3159
3169
|
id: "data-table",
|
|
3160
3170
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3161
3171
|
className: "ds-u-color--primary",
|
|
@@ -3194,7 +3204,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3194
3204
|
metadataMapping: metadataMapping
|
|
3195
3205
|
})
|
|
3196
3206
|
}),
|
|
3197
|
-
datasetDictionary && datasetDictionary.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3207
|
+
distribution && distribution.data && datasetDictionary && datasetDictionary.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3198
3208
|
id: "data-dictionary",
|
|
3199
3209
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3200
3210
|
className: "ds-u-color--primary",
|
|
@@ -3211,7 +3221,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3211
3221
|
title: "Data Dictionary"
|
|
3212
3222
|
})
|
|
3213
3223
|
}) : null,
|
|
3214
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3224
|
+
distribution && distribution.data && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3215
3225
|
id: "api",
|
|
3216
3226
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3217
3227
|
className: "ds-u-color--primary",
|
|
@@ -3259,7 +3269,7 @@ var $a0f13962e513caa1$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
3259
3269
|
|
|
3260
3270
|
|
|
3261
3271
|
|
|
3262
|
-
const $e5bfafc6d4e6f207$var$SearchModal = ({ searchFunc: searchFunc
|
|
3272
|
+
const $e5bfafc6d4e6f207$var$SearchModal = ({ searchFunc: searchFunc, appNodeId: appNodeId, headingText: headingText, searchModalText: searchModalText, buttonSize: buttonSize, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton })=>{
|
|
3263
3273
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
3264
3274
|
const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)("");
|
|
3265
3275
|
const [modalSearch, setModalSearch] = (0, $hgUW1$useState)(false);
|
|
@@ -3346,8 +3356,8 @@ var $52466563e0d69ea8$exports = {};
|
|
|
3346
3356
|
$52466563e0d69ea8$exports = new URL("CMSGovLogo-O.90ce815c.png", import.meta.url).toString();
|
|
3347
3357
|
|
|
3348
3358
|
|
|
3349
|
-
const $2db98b8f69058a30$var$DesktopHeader = ({ siteName: siteName
|
|
3350
|
-
const { url: url
|
|
3359
|
+
const $2db98b8f69058a30$var$DesktopHeader = ({ siteName: siteName, headerClasses: headerClasses, linkClasses: linkClasses, links: links, org: org, searchModalText: searchModalText, customSearch: customSearch, includeTopNav: includeTopNav, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton, includeSearch: includeSearch })=>{
|
|
3360
|
+
const { url: url, tagline: tagline, logo: logo, urlTitle: urlTitle, logoAltText: logoAltText } = org;
|
|
3351
3361
|
const headerClassString = headerClasses ?? "dc-c-header ds-base";
|
|
3352
3362
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("header", {
|
|
3353
3363
|
className: headerClassString,
|
|
@@ -3468,8 +3478,8 @@ $972485213997ff8b$exports = new URL("CMSgov@2x-white-O.78cd05d3.png", import.met
|
|
|
3468
3478
|
|
|
3469
3479
|
|
|
3470
3480
|
let $caaccb8ea608e518$var$mobileHeaderMenuClassName = "dc-c-mobile-header--menu";
|
|
3471
|
-
const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName
|
|
3472
|
-
const { url: url
|
|
3481
|
+
const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName, links: links, org: org, searchModalText: searchModalText, customSearch: customSearch = false, includeTopNav: includeTopNav, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton, includeSearch: includeSearch })=>{
|
|
3482
|
+
const { url: url, logo: logo, urlTitle: urlTitle, logoAltText: logoAltText, inverseLogo: inverseLogo } = org;
|
|
3473
3483
|
const [menuOpen, setMenuOpen] = (0, $hgUW1$useState)(false);
|
|
3474
3484
|
const mobile = (0, $hgUW1$useMediaQuery)({
|
|
3475
3485
|
minWidth: 0,
|
|
@@ -3508,21 +3518,15 @@ const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName , links: links
|
|
|
3508
3518
|
// Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
|
|
3509
3519
|
if (event.target.closest(".dc-c-search-dialog")) setMenuOpen(false);
|
|
3510
3520
|
}
|
|
3511
|
-
function handleSearchEnter(event) {
|
|
3512
|
-
// Close upon user hitting enter on search.
|
|
3513
|
-
if (event.keyCode === 13) setMenuOpen(false);
|
|
3514
|
-
}
|
|
3515
3521
|
function handleMenuClose(event) {
|
|
3516
3522
|
// Close upon user hitting escape
|
|
3517
3523
|
if (event.keyCode === 27 && menuOpen) setMenuOpen(false);
|
|
3518
3524
|
}
|
|
3519
3525
|
document.addEventListener("mousedown", handleClick);
|
|
3520
|
-
document.addEventListener("keyup", handleSearchEnter);
|
|
3521
3526
|
document.addEventListener("keyup", handleMenuClose);
|
|
3522
3527
|
handleFocusIn();
|
|
3523
3528
|
menu.current.addEventListener("keydown", (evt)=>trapFocus(evt, menu.current));
|
|
3524
3529
|
return ()=>{
|
|
3525
|
-
document.removeEventListener("keyup", handleSearchEnter);
|
|
3526
3530
|
document.removeEventListener("keyup", handleMenuClose);
|
|
3527
3531
|
document.removeEventListener("mousedown", handleClick);
|
|
3528
3532
|
if (menu.current) menu.current.removeEventListener("keydown", trapFocus);
|
|
@@ -3688,7 +3692,7 @@ var $caaccb8ea608e518$export$2e2bcd8739ae039 = $caaccb8ea608e518$var$MobileHeade
|
|
|
3688
3692
|
|
|
3689
3693
|
|
|
3690
3694
|
|
|
3691
|
-
const $a5a6a06d249c33b8$var$Header = ({ mobileMaxWidth: mobileMaxWidth
|
|
3695
|
+
const $a5a6a06d249c33b8$var$Header = ({ mobileMaxWidth: mobileMaxWidth, desktopMinWidth: desktopMinWidth, siteName: siteName, links: links, org: org, includeTopNav: includeTopNav })=>{
|
|
3692
3696
|
const mobile = (0, $hgUW1$useMediaQuery)({
|
|
3693
3697
|
minWidth: 0,
|
|
3694
3698
|
maxWidth: mobileMaxWidth
|
|
@@ -3730,7 +3734,7 @@ var $a5a6a06d249c33b8$export$2e2bcd8739ae039 = $a5a6a06d249c33b8$var$Header;
|
|
|
3730
3734
|
|
|
3731
3735
|
|
|
3732
3736
|
|
|
3733
|
-
const $a6df0aa147323304$var$Footer = ({ links: links
|
|
3737
|
+
const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail, emailTitle: emailTitle, emailBody: emailBody, emailLink: emailLink, emailButton: emailButton, socialMediaLinks: socialMediaLinks, hhsLogo: hhsLogo, cmsLogo: cmsLogo, trademarkContent: trademarkContent })=>{
|
|
3734
3738
|
const xs = (0, $hgUW1$useMediaQuery)({
|
|
3735
3739
|
minWidth: 0,
|
|
3736
3740
|
maxWidth: 544
|
|
@@ -3742,7 +3746,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links , showEmail: showEmail , em
|
|
|
3742
3746
|
const md = (0, $hgUW1$useMediaQuery)({
|
|
3743
3747
|
minWidth: 768
|
|
3744
3748
|
});
|
|
3745
|
-
const { footerOpenDataToolLinks: footerOpenDataToolLinks
|
|
3749
|
+
const { footerOpenDataToolLinks: footerOpenDataToolLinks, footerAdditionalResourcesLinks: footerAdditionalResourcesLinks, footerUtilityLinks: footerUtilityLinks } = links;
|
|
3746
3750
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("footer", {
|
|
3747
3751
|
className: "dc-c-footer",
|
|
3748
3752
|
children: [
|
|
@@ -4203,7 +4207,7 @@ var $a6df0aa147323304$export$2e2bcd8739ae039 = $a6df0aa147323304$var$Footer;
|
|
|
4203
4207
|
|
|
4204
4208
|
|
|
4205
4209
|
const $5655284dbbb89508$var$DocumentationTable = (props)=>{
|
|
4206
|
-
const { data: data
|
|
4210
|
+
const { data: data } = props;
|
|
4207
4211
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
4208
4212
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
|
|
4209
4213
|
stackable: true,
|
|
@@ -4319,7 +4323,7 @@ const $c7bf75f7e8a68780$export$7850f4d545d994c6 = [
|
|
|
4319
4323
|
|
|
4320
4324
|
|
|
4321
4325
|
const $669d2782ec2e2250$var$SpecsAndLimits = (props)=>{
|
|
4322
|
-
const { documentationList: documentationList
|
|
4326
|
+
const { documentationList: documentationList, children: children } = props;
|
|
4323
4327
|
const defaultContent = /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4324
4328
|
children: "Some datasets are extremely large and may be difficult to download and/or cause computer performance issues. The Centers for Medicare and Medicaid Services (CMS) recommends using WinZip, WinRAR, or 7-Zip for file decompression."
|
|
4325
4329
|
});
|
|
@@ -4484,7 +4488,7 @@ var $efc410f5f7ac5ef3$export$2e2bcd8739ae039 = $efc410f5f7ac5ef3$var$useSearchAP
|
|
|
4484
4488
|
|
|
4485
4489
|
|
|
4486
4490
|
|
|
4487
|
-
const $59a079354baa335c$var$Hero = ({ title: title
|
|
4491
|
+
const $59a079354baa335c$var$Hero = ({ title: title, description: description, searchUrl: searchUrl, searchKey: searchKey, textfieldLabel: textfieldLabel, searchButtonText: searchButtonText })=>{
|
|
4488
4492
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
4489
4493
|
const [searchValue, setSearchValue] = (0, $hgUW1$react).useState("");
|
|
4490
4494
|
function submitHero(e) {
|
|
@@ -4580,7 +4584,7 @@ var $59a079354baa335c$export$2e2bcd8739ae039 = $59a079354baa335c$var$Hero;
|
|
|
4580
4584
|
|
|
4581
4585
|
|
|
4582
4586
|
|
|
4583
|
-
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding
|
|
4587
|
+
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding, tablePadding: tablePadding })=>{
|
|
4584
4588
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4585
4589
|
className: "ds-u-display--flex",
|
|
4586
4590
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
@@ -4630,7 +4634,7 @@ var $e71aee394fdad8bd$export$2e2bcd8739ae039 = $e71aee394fdad8bd$var$ManageColum
|
|
|
4630
4634
|
|
|
4631
4635
|
|
|
4632
4636
|
const $7848c69a021266f7$var$DataTableRowChanger = (props)=>{
|
|
4633
|
-
const { limit: limit
|
|
4637
|
+
const { limit: limit, rowOptions: rowOptions, setLimit: setLimit } = props;
|
|
4634
4638
|
const rowOptionsFormatted = rowOptions.map((row)=>({
|
|
4635
4639
|
label: row.toString(),
|
|
4636
4640
|
value: row.toString()
|
|
@@ -4752,17 +4756,17 @@ var $ec9e1550b0b034d0$export$2e2bcd8739ae039 = $ec9e1550b0b034d0$var$SettingsIco
|
|
|
4752
4756
|
|
|
4753
4757
|
|
|
4754
4758
|
|
|
4755
|
-
const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding
|
|
4759
|
+
const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding, id: id, distribution: distribution, includeFiltered: includeFiltered, includeDensity: includeDensity, includeDownload: includeDownload, resource: resource, tablePadding: tablePadding, downloadUrl: downloadUrl })=>{
|
|
4756
4760
|
const md = (0, $hgUW1$useMediaQuery)({
|
|
4757
4761
|
minWidth: 0,
|
|
4758
4762
|
maxWidth: 768
|
|
4759
4763
|
});
|
|
4760
|
-
const { limit: limit
|
|
4764
|
+
const { limit: limit, offset: offset, count: count, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
4761
4765
|
const intCount = count ? parseInt(count) : 0;
|
|
4762
4766
|
const [referenceElement, setReferenceElement] = (0, $hgUW1$useState)(null);
|
|
4763
4767
|
const [popperElement, setPopperElement] = (0, $hgUW1$useState)(null);
|
|
4764
4768
|
const [arrowElement, setArrowElement] = (0, $hgUW1$useState)(null);
|
|
4765
|
-
const { styles: styles
|
|
4769
|
+
const { styles: styles, attributes: attributes } = (0, $hgUW1$usePopper)(referenceElement, popperElement, {
|
|
4766
4770
|
modifiers: [
|
|
4767
4771
|
{
|
|
4768
4772
|
name: "arrow",
|
|
@@ -4808,7 +4812,6 @@ const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding
|
|
|
4808
4812
|
size: "small",
|
|
4809
4813
|
className: "ds-u-text-align--left ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1",
|
|
4810
4814
|
href: downloadUrl,
|
|
4811
|
-
"aria-label": "Download filtered data (CSV)",
|
|
4812
4815
|
children: [
|
|
4813
4816
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e973bc477cdc2dc7$export$2e2bcd8739ae039), {}),
|
|
4814
4817
|
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
@@ -4922,7 +4925,7 @@ function $626282d9a03c51d5$export$1147582dfae658c6(columns, schema) {
|
|
|
4922
4925
|
accessor: column
|
|
4923
4926
|
}));
|
|
4924
4927
|
}
|
|
4925
|
-
function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header
|
|
4928
|
+
function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header, accessor: accessor, setFilter: setFilter, filterValue: filterValue } }) {
|
|
4926
4929
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
|
|
4927
4930
|
label: `Filter by ${Header}`,
|
|
4928
4931
|
onChange: (e)=>{
|
|
@@ -4933,7 +4936,7 @@ function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header ,
|
|
|
4933
4936
|
value: filterValue || ""
|
|
4934
4937
|
});
|
|
4935
4938
|
}
|
|
4936
|
-
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding
|
|
4939
|
+
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, options: options, resource: resource, defaultSort: defaultSort, customColumns: customColumns, truncateCellHeader: truncateCellHeader, columnSettings: columnSettings, columnWidths: columnWidths, customClasses: customClasses, canResize: canResize })=>{
|
|
4937
4940
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4938
4941
|
id: "resource-preview",
|
|
4939
4942
|
className: "ds-u-overflow--auto ds-u-border-x--1 ds-u-border-bottom--1",
|
|
@@ -4990,8 +4993,8 @@ var $626282d9a03c51d5$export$2e2bcd8739ae039 = $626282d9a03c51d5$var$ResourcePre
|
|
|
4990
4993
|
|
|
4991
4994
|
|
|
4992
4995
|
|
|
4993
|
-
const $072291d44ce1834a$var$ResourceFooter = ({ resource: resource
|
|
4994
|
-
const { limit: limit
|
|
4996
|
+
const $072291d44ce1834a$var$ResourceFooter = ({ resource: resource })=>{
|
|
4997
|
+
const { limit: limit, values: values, offset: offset, count: count, setOffset: setOffset } = resource;
|
|
4995
4998
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4996
4999
|
children: values.length > 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
|
|
4997
5000
|
id: "test-default",
|
|
@@ -5015,7 +5018,7 @@ var $072291d44ce1834a$export$2e2bcd8739ae039 = $072291d44ce1834a$var$ResourceFoo
|
|
|
5015
5018
|
|
|
5016
5019
|
|
|
5017
5020
|
|
|
5018
|
-
const $ec3e23baa005dc03$var$Breadcrumb = ({ currentPage: currentPage
|
|
5021
|
+
const $ec3e23baa005dc03$var$Breadcrumb = ({ currentPage: currentPage, pageTrail: pageTrail = [] })=>{
|
|
5019
5022
|
const pageTrailContent = pageTrail.map((page)=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
5020
5023
|
class: "dc-c-breadcrumb__list-item",
|
|
5021
5024
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
|
|
@@ -5093,7 +5096,7 @@ function $374c4669b044ddf8$var$getStartDate(condition, schema, id) {
|
|
|
5093
5096
|
}
|
|
5094
5097
|
return new Date();
|
|
5095
5098
|
}
|
|
5096
|
-
const $374c4669b044ddf8$var$QueryRow = ({ id: id
|
|
5099
|
+
const $374c4669b044ddf8$var$QueryRow = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema })=>{
|
|
5097
5100
|
const sm = (0, $hgUW1$useMediaQuery)({
|
|
5098
5101
|
minWidth: 0,
|
|
5099
5102
|
maxWidth: 544
|
|
@@ -5218,8 +5221,8 @@ function $3b6ca952e79f0695$var$updateQueryForDatastore(condition) {
|
|
|
5218
5221
|
if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
|
|
5219
5222
|
return cond;
|
|
5220
5223
|
}
|
|
5221
|
-
const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource
|
|
5222
|
-
const { conditions: conditions
|
|
5224
|
+
const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams, customColumns: customColumns })=>{
|
|
5225
|
+
const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
|
|
5223
5226
|
const fields = Object.keys(schema[id].fields);
|
|
5224
5227
|
const hasConditions = conditions.length > 0;
|
|
5225
5228
|
const [queryCount, setQueryCount] = (0, $hgUW1$useState)(0);
|
|
@@ -5348,7 +5351,8 @@ var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilde
|
|
|
5348
5351
|
|
|
5349
5352
|
|
|
5350
5353
|
|
|
5351
|
-
|
|
5354
|
+
|
|
5355
|
+
const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, apiDocPage: apiDocPage, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
|
|
5352
5356
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
5353
5357
|
const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState("ds-u-padding-y--1");
|
|
5354
5358
|
let apiDocs = (0, $hgUW1$useRef)();
|
|
@@ -5371,10 +5375,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id , dataset: dataset
|
|
|
5371
5375
|
manual: true
|
|
5372
5376
|
}, additionalParams);
|
|
5373
5377
|
(0, $hgUW1$useEffect)(()=>{
|
|
5374
|
-
if (distribution.identifier)
|
|
5375
|
-
resource.setResource(distribution.identifier);
|
|
5376
|
-
resource.setManual(false);
|
|
5377
|
-
}
|
|
5378
|
+
if (distribution.identifier) resource.setResource(distribution.identifier);
|
|
5378
5379
|
}, [
|
|
5379
5380
|
distribution
|
|
5380
5381
|
]);
|
|
@@ -5400,6 +5401,18 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id , dataset: dataset
|
|
|
5400
5401
|
className: "ds-title",
|
|
5401
5402
|
children: customTitle ? customTitle : pageTitle
|
|
5402
5403
|
}),
|
|
5404
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5405
|
+
className: "ds-l-row",
|
|
5406
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
5407
|
+
className: "ds-l-col--12 ds-u-color--gray ds-u-margin-y--1 ds-u-text-align--right",
|
|
5408
|
+
children: [
|
|
5409
|
+
"Updated ",
|
|
5410
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
5411
|
+
date: dataset.modified
|
|
5412
|
+
})
|
|
5413
|
+
]
|
|
5414
|
+
})
|
|
5415
|
+
}),
|
|
5403
5416
|
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
5404
5417
|
className: "ds-u-margin-top--0 dc-c-metadata-description",
|
|
5405
5418
|
dangerouslySetInnerHTML: {
|
|
@@ -5469,10 +5482,10 @@ var $dd6eb2b30d7ad75d$export$2e2bcd8739ae039 = $dd6eb2b30d7ad75d$var$FilteredRes
|
|
|
5469
5482
|
|
|
5470
5483
|
|
|
5471
5484
|
|
|
5472
|
-
const $f61ecf9f84951a61$var$FilteredResource = ({ id: id
|
|
5485
|
+
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, rootUrl: rootUrl })=>{
|
|
5473
5486
|
const [ready, setReady] = (0, $hgUW1$useState)(false);
|
|
5474
5487
|
const [error, setError] = (0, $hgUW1$useState)(false);
|
|
5475
|
-
const { dataset: dataset
|
|
5488
|
+
const { dataset: dataset } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl, additionalParams);
|
|
5476
5489
|
const distIndex = dist_id === "data" ? 0 : dist_id;
|
|
5477
5490
|
(0, $hgUW1$useEffect)(()=>{
|
|
5478
5491
|
if (dataset.error) setError(true);
|
|
@@ -5568,7 +5581,7 @@ var $eb7821d186b1a389$export$2e2bcd8739ae039 = $eb7821d186b1a389$var$useAddLogin
|
|
|
5568
5581
|
|
|
5569
5582
|
|
|
5570
5583
|
const $90fb213ab8eeb2e7$var$useScrollToTop = ()=>{
|
|
5571
|
-
const { pathname: pathname
|
|
5584
|
+
const { pathname: pathname } = (0, $hgUW1$useLocation)();
|
|
5572
5585
|
(0, $hgUW1$useEffect)(()=>{
|
|
5573
5586
|
window.scrollTo(0, 0);
|
|
5574
5587
|
}, [
|