@civicactions/cmsds-open-data-components 3.1.3-alpha.1 → 3.1.3-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.css +0 -18
- package/dist/main.css.map +1 -1
- package/dist/main.js +279 -272
- 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: [
|
|
@@ -2738,9 +2713,8 @@ const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
|
|
|
2738
2713
|
var $0958733ee130fc44$export$2e2bcd8739ae039 = $0958733ee130fc44$var$ResourceInformation;
|
|
2739
2714
|
|
|
2740
2715
|
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
function getFormatType(dist) {
|
|
2716
|
+
function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
|
|
2717
|
+
if (dist && dist.data) {
|
|
2744
2718
|
if (dist.data.format) return dist.data.format.toLowerCase();
|
|
2745
2719
|
if (dist.data.mediaType) {
|
|
2746
2720
|
const mediaType = dist.data.mediaType.split("/");
|
|
@@ -2752,8 +2726,13 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2752
2726
|
if (mimeType.length && mimeType[1]) return mimeType[1].toLowerCase();
|
|
2753
2727
|
}
|
|
2754
2728
|
}
|
|
2755
|
-
return "";
|
|
2756
2729
|
}
|
|
2730
|
+
return "";
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource: resource, title: title })=>{
|
|
2757
2736
|
const sm = (0, $hgUW1$useMediaQuery)({
|
|
2758
2737
|
minWidth: 0,
|
|
2759
2738
|
maxWidth: 767
|
|
@@ -2765,12 +2744,12 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2765
2744
|
className: "ds-l-col--12 ds-u-padding-left--0 ds-text-heading--2xl",
|
|
2766
2745
|
children: "Resources"
|
|
2767
2746
|
}),
|
|
2768
|
-
distributions.length
|
|
2747
|
+
distributions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
2769
2748
|
className: "ds-c-list ds-c-list--bare dc-c-resource-full-width",
|
|
2770
2749
|
children: distributions.map((dist)=>{
|
|
2771
|
-
const fileFormat =
|
|
2750
|
+
const fileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(dist);
|
|
2772
2751
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
2773
|
-
className:
|
|
2752
|
+
className: `ds-u-display--flex ds-u-flex-wrap--wrap ${fileFormat !== "csv" && "ds-u-margin-bottom--2"}`,
|
|
2774
2753
|
children: [
|
|
2775
2754
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2776
2755
|
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 +2757,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2778
2757
|
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2779
2758
|
className: "fa ds-u-color--primary ds-u-padding-right--1 fa-file-" + (fileFormat == "xlsx" ? "excel" : fileFormat)
|
|
2780
2759
|
}),
|
|
2781
|
-
title + " (" + fileFormat.toUpperCase() + ")"
|
|
2760
|
+
dist.data.title ? dist.data.title : title + " (" + fileFormat.toUpperCase() + ")"
|
|
2782
2761
|
]
|
|
2783
2762
|
}),
|
|
2784
2763
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -2799,12 +2778,17 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2799
2778
|
]
|
|
2800
2779
|
})
|
|
2801
2780
|
}),
|
|
2802
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
2781
|
+
dist.data.description && /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
2782
|
+
children: dist.data.description
|
|
2783
|
+
}),
|
|
2784
|
+
fileFormat === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $0958733ee130fc44$export$2e2bcd8739ae039), {
|
|
2803
2785
|
resource: resource
|
|
2804
2786
|
})
|
|
2805
2787
|
]
|
|
2806
2788
|
}, dist.identifier);
|
|
2807
2789
|
})
|
|
2790
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2791
|
+
className: "ds-u-margin-top--2"
|
|
2808
2792
|
})
|
|
2809
2793
|
]
|
|
2810
2794
|
});
|
|
@@ -2812,7 +2796,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions , resourc
|
|
|
2812
2796
|
var $7357cc0f79f9c514$export$2e2bcd8739ae039 = $7357cc0f79f9c514$var$Resource;
|
|
2813
2797
|
|
|
2814
2798
|
|
|
2815
|
-
const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset
|
|
2799
|
+
const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset, resource: resource, distributions: distributions, metadataMapping: metadataMapping })=>{
|
|
2816
2800
|
const md = (0, $hgUW1$useMediaQuery)({
|
|
2817
2801
|
minWidth: 0,
|
|
2818
2802
|
maxWidth: 768
|
|
@@ -2868,7 +2852,7 @@ var $364dc44850cd8f7f$export$2e2bcd8739ae039 = $364dc44850cd8f7f$var$DatasetOver
|
|
|
2868
2852
|
|
|
2869
2853
|
|
|
2870
2854
|
|
|
2871
|
-
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint
|
|
2855
|
+
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
2872
2856
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2873
2857
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
|
|
2874
2858
|
url: endpoint
|
|
@@ -2878,7 +2862,7 @@ const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
|
2878
2862
|
var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
|
|
2879
2863
|
|
|
2880
2864
|
|
|
2881
|
-
const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id
|
|
2865
|
+
const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id, rootUrl: rootUrl, apiUrl: apiUrl, additionalParams: additionalParams })=>{
|
|
2882
2866
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
2883
2867
|
children: [
|
|
2884
2868
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -2933,7 +2917,7 @@ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
|
|
|
2933
2917
|
|
|
2934
2918
|
|
|
2935
2919
|
|
|
2936
|
-
const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionary: datasetDictionary
|
|
2920
|
+
const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionary: datasetDictionary, title: title, pageSize: pageSize = 20 })=>{
|
|
2937
2921
|
const [pagination, setPagination] = (0, $hgUW1$useState)({
|
|
2938
2922
|
pageIndex: 1,
|
|
2939
2923
|
pageSize: pageSize
|
|
@@ -3021,8 +3005,10 @@ var $6012b86ffcaf3f71$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
3021
3005
|
|
|
3022
3006
|
|
|
3023
3007
|
|
|
3008
|
+
|
|
3009
|
+
|
|
3024
3010
|
const $a0f13962e513caa1$var$getSiteWideDataDictionary = (rootUrl, dataDictionaryUrl)=>{
|
|
3025
|
-
const { data: data
|
|
3011
|
+
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
3026
3012
|
queryKey: [
|
|
3027
3013
|
"dictionary"
|
|
3028
3014
|
],
|
|
@@ -3032,10 +3018,10 @@ const $a0f13962e513caa1$var$getSiteWideDataDictionary = (rootUrl, dataDictionary
|
|
|
3032
3018
|
});
|
|
3033
3019
|
return {
|
|
3034
3020
|
siteWideDataDictionary: data,
|
|
3035
|
-
dataDictionaryLoading:
|
|
3021
|
+
dataDictionaryLoading: isPending
|
|
3036
3022
|
};
|
|
3037
3023
|
};
|
|
3038
|
-
const $a0f13962e513caa1$var$Dataset = ({ id: id
|
|
3024
|
+
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
3025
|
const options = location.search ? {
|
|
3040
3026
|
...(0, $hgUW1$qs).parse(location.search, {
|
|
3041
3027
|
ignoreQueryPrefix: true
|
|
@@ -3043,7 +3029,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3043
3029
|
} : {
|
|
3044
3030
|
conditions: []
|
|
3045
3031
|
};
|
|
3046
|
-
const { dataset: dataset
|
|
3032
|
+
const { dataset: dataset, isPending: isPending } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl, additionalParams);
|
|
3047
3033
|
const title = dataset.title ? dataset.title : "";
|
|
3048
3034
|
const metadataMapping = {
|
|
3049
3035
|
...(0, $6da0396069e23175$export$bc27cf7ecf44639d),
|
|
@@ -3057,7 +3043,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3057
3043
|
limit: defaultPageSize,
|
|
3058
3044
|
manual: true
|
|
3059
3045
|
}, additionalParams);
|
|
3060
|
-
const { siteWideDataDictionary: siteWideDataDictionary
|
|
3046
|
+
const { siteWideDataDictionary: siteWideDataDictionary } = dataDictionaryUrl ? $a0f13962e513caa1$var$getSiteWideDataDictionary(rootUrl, dataDictionaryUrl) : {
|
|
3061
3047
|
siteWideDataDictionary: null
|
|
3062
3048
|
};
|
|
3063
3049
|
// compare schema fields with siteWideDataDictionary to display commonalities for now
|
|
@@ -3066,18 +3052,8 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3066
3052
|
return Object.keys(resource.schema[distribution.identifier].fields).indexOf(field.name) !== -1;
|
|
3067
3053
|
}) : null;
|
|
3068
3054
|
(0, $hgUW1$useEffect)(()=>{
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
if (distribution.data.format) localFileFormat = distribution.data.format.toUpperCase();
|
|
3072
|
-
else if (distribution.data.mediaType) {
|
|
3073
|
-
const mediaType = distribution.data.mediaType.split("/");
|
|
3074
|
-
if (mediaType.length && mediaType[1]) localFileFormat = mediaType[1].toUpperCase();
|
|
3075
|
-
}
|
|
3076
|
-
if (localFileFormat === "CSV") {
|
|
3077
|
-
resource.setResource(distribution.identifier);
|
|
3078
|
-
resource.setManual(false);
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3055
|
+
const localFileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution);
|
|
3056
|
+
if (localFileFormat === "csv") resource.setResource(distribution.identifier);
|
|
3081
3057
|
}, [
|
|
3082
3058
|
distribution
|
|
3083
3059
|
]);
|
|
@@ -3119,6 +3095,17 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3119
3095
|
})
|
|
3120
3096
|
]
|
|
3121
3097
|
});
|
|
3098
|
+
// The below code manages the selected tab in the Design System tab group manually to ensure we can still use the
|
|
3099
|
+
// Data Table tab as the default since it no longer exists on initial render (By default, Overview will appear as default)
|
|
3100
|
+
const getDefaultTab = ()=>{
|
|
3101
|
+
return (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ? "data-table" : "overview";
|
|
3102
|
+
};
|
|
3103
|
+
const [selectedTab, setSelectedTab] = (0, $hgUW1$useState)(window.location.hash.substring(1) ? window.location.hash.substring(1) : getDefaultTab());
|
|
3104
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3105
|
+
setSelectedTab(getDefaultTab());
|
|
3106
|
+
}, [
|
|
3107
|
+
distribution
|
|
3108
|
+
]);
|
|
3122
3109
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
3123
3110
|
children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
|
|
3124
3111
|
content: notFoundContent,
|
|
@@ -3126,36 +3113,53 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3126
3113
|
}) : /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3127
3114
|
className: "ds-l-container",
|
|
3128
3115
|
children: [
|
|
3129
|
-
/*#__PURE__*/ (0, $hgUW1$
|
|
3116
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3130
3117
|
className: "ds-l-row",
|
|
3131
|
-
children:
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("h1", {
|
|
3135
|
-
className: "ds-
|
|
3118
|
+
children: [
|
|
3119
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3120
|
+
className: "ds-l-md-col--9",
|
|
3121
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("h1", {
|
|
3122
|
+
className: "ds-h1 title-underline",
|
|
3136
3123
|
children: title
|
|
3137
|
-
})
|
|
3138
|
-
|
|
3124
|
+
})
|
|
3125
|
+
}),
|
|
3126
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3127
|
+
className: "ds-l-md-col--12 ds-u-color--gray ds-u-margin-y--1 ds-u-text-align--right",
|
|
3128
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
|
|
3129
|
+
className: "ds-u-margin--0",
|
|
3130
|
+
children: [
|
|
3131
|
+
"Updated ",
|
|
3132
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
3133
|
+
date: dataset.modified
|
|
3134
|
+
})
|
|
3135
|
+
]
|
|
3136
|
+
})
|
|
3137
|
+
}),
|
|
3138
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3139
|
+
className: "ds-l-md-col--9",
|
|
3140
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3139
3141
|
className: "ds-u-measure--wide ds-u-margin-bottom--7",
|
|
3140
3142
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
3141
|
-
className: "dc-c-metadata-description",
|
|
3143
|
+
className: "dc-c-metadata-description ds-u-margin--0",
|
|
3142
3144
|
dangerouslySetInnerHTML: {
|
|
3143
3145
|
__html: (0, $hgUW1$dompurify).sanitize(dataset.description)
|
|
3144
3146
|
}
|
|
3145
3147
|
})
|
|
3146
3148
|
})
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
+
})
|
|
3150
|
+
]
|
|
3149
3151
|
}),
|
|
3150
3152
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3151
3153
|
className: "ds-l-row",
|
|
3152
3154
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3153
3155
|
className: "ds-l-md-col--12 dc-dataset",
|
|
3154
|
-
children:
|
|
3155
|
-
onChange:
|
|
3156
|
-
|
|
3156
|
+
children: !isPending && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tabs), {
|
|
3157
|
+
onChange: (selectedId, prevSelectedId)=>{
|
|
3158
|
+
setSelectedTab(selectedId);
|
|
3159
|
+
},
|
|
3160
|
+
selectedId: selectedTab,
|
|
3157
3161
|
children: [
|
|
3158
|
-
distribution
|
|
3162
|
+
(0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3159
3163
|
id: "data-table",
|
|
3160
3164
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3161
3165
|
className: "ds-u-color--primary",
|
|
@@ -3194,7 +3198,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3194
3198
|
metadataMapping: metadataMapping
|
|
3195
3199
|
})
|
|
3196
3200
|
}),
|
|
3197
|
-
datasetDictionary && datasetDictionary.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3201
|
+
distribution && distribution.data && datasetDictionary && datasetDictionary.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3198
3202
|
id: "data-dictionary",
|
|
3199
3203
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3200
3204
|
className: "ds-u-color--primary",
|
|
@@ -3211,7 +3215,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id , rootUrl: rootUrl , additionalP
|
|
|
3211
3215
|
title: "Data Dictionary"
|
|
3212
3216
|
})
|
|
3213
3217
|
}) : null,
|
|
3214
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3218
|
+
distribution && distribution.data && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
3215
3219
|
id: "api",
|
|
3216
3220
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3217
3221
|
className: "ds-u-color--primary",
|
|
@@ -3259,7 +3263,7 @@ var $a0f13962e513caa1$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
3259
3263
|
|
|
3260
3264
|
|
|
3261
3265
|
|
|
3262
|
-
const $e5bfafc6d4e6f207$var$SearchModal = ({ searchFunc: searchFunc
|
|
3266
|
+
const $e5bfafc6d4e6f207$var$SearchModal = ({ searchFunc: searchFunc, appNodeId: appNodeId, headingText: headingText, searchModalText: searchModalText, buttonSize: buttonSize, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton })=>{
|
|
3263
3267
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
3264
3268
|
const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)("");
|
|
3265
3269
|
const [modalSearch, setModalSearch] = (0, $hgUW1$useState)(false);
|
|
@@ -3346,8 +3350,8 @@ var $52466563e0d69ea8$exports = {};
|
|
|
3346
3350
|
$52466563e0d69ea8$exports = new URL("CMSGovLogo-O.90ce815c.png", import.meta.url).toString();
|
|
3347
3351
|
|
|
3348
3352
|
|
|
3349
|
-
const $2db98b8f69058a30$var$DesktopHeader = ({ siteName: siteName
|
|
3350
|
-
const { url: url
|
|
3353
|
+
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 })=>{
|
|
3354
|
+
const { url: url, tagline: tagline, logo: logo, urlTitle: urlTitle, logoAltText: logoAltText } = org;
|
|
3351
3355
|
const headerClassString = headerClasses ?? "dc-c-header ds-base";
|
|
3352
3356
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("header", {
|
|
3353
3357
|
className: headerClassString,
|
|
@@ -3468,8 +3472,8 @@ $972485213997ff8b$exports = new URL("CMSgov@2x-white-O.78cd05d3.png", import.met
|
|
|
3468
3472
|
|
|
3469
3473
|
|
|
3470
3474
|
let $caaccb8ea608e518$var$mobileHeaderMenuClassName = "dc-c-mobile-header--menu";
|
|
3471
|
-
const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName
|
|
3472
|
-
const { url: url
|
|
3475
|
+
const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName, links: links, org: org, searchModalText: searchModalText, customSearch: customSearch = false, includeTopNav: includeTopNav, inversedModalButton: inversedModalButton, inversedSearchButton: inversedSearchButton, includeSearch: includeSearch })=>{
|
|
3476
|
+
const { url: url, logo: logo, urlTitle: urlTitle, logoAltText: logoAltText, inverseLogo: inverseLogo } = org;
|
|
3473
3477
|
const [menuOpen, setMenuOpen] = (0, $hgUW1$useState)(false);
|
|
3474
3478
|
const mobile = (0, $hgUW1$useMediaQuery)({
|
|
3475
3479
|
minWidth: 0,
|
|
@@ -3508,21 +3512,15 @@ const $caaccb8ea608e518$var$MobileHeader = ({ siteName: siteName , links: links
|
|
|
3508
3512
|
// Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
|
|
3509
3513
|
if (event.target.closest(".dc-c-search-dialog")) setMenuOpen(false);
|
|
3510
3514
|
}
|
|
3511
|
-
function handleSearchEnter(event) {
|
|
3512
|
-
// Close upon user hitting enter on search.
|
|
3513
|
-
if (event.keyCode === 13) setMenuOpen(false);
|
|
3514
|
-
}
|
|
3515
3515
|
function handleMenuClose(event) {
|
|
3516
3516
|
// Close upon user hitting escape
|
|
3517
3517
|
if (event.keyCode === 27 && menuOpen) setMenuOpen(false);
|
|
3518
3518
|
}
|
|
3519
3519
|
document.addEventListener("mousedown", handleClick);
|
|
3520
|
-
document.addEventListener("keyup", handleSearchEnter);
|
|
3521
3520
|
document.addEventListener("keyup", handleMenuClose);
|
|
3522
3521
|
handleFocusIn();
|
|
3523
3522
|
menu.current.addEventListener("keydown", (evt)=>trapFocus(evt, menu.current));
|
|
3524
3523
|
return ()=>{
|
|
3525
|
-
document.removeEventListener("keyup", handleSearchEnter);
|
|
3526
3524
|
document.removeEventListener("keyup", handleMenuClose);
|
|
3527
3525
|
document.removeEventListener("mousedown", handleClick);
|
|
3528
3526
|
if (menu.current) menu.current.removeEventListener("keydown", trapFocus);
|
|
@@ -3688,7 +3686,7 @@ var $caaccb8ea608e518$export$2e2bcd8739ae039 = $caaccb8ea608e518$var$MobileHeade
|
|
|
3688
3686
|
|
|
3689
3687
|
|
|
3690
3688
|
|
|
3691
|
-
const $a5a6a06d249c33b8$var$Header = ({ mobileMaxWidth: mobileMaxWidth
|
|
3689
|
+
const $a5a6a06d249c33b8$var$Header = ({ mobileMaxWidth: mobileMaxWidth, desktopMinWidth: desktopMinWidth, siteName: siteName, links: links, org: org, includeTopNav: includeTopNav })=>{
|
|
3692
3690
|
const mobile = (0, $hgUW1$useMediaQuery)({
|
|
3693
3691
|
minWidth: 0,
|
|
3694
3692
|
maxWidth: mobileMaxWidth
|
|
@@ -3730,7 +3728,7 @@ var $a5a6a06d249c33b8$export$2e2bcd8739ae039 = $a5a6a06d249c33b8$var$Header;
|
|
|
3730
3728
|
|
|
3731
3729
|
|
|
3732
3730
|
|
|
3733
|
-
const $a6df0aa147323304$var$Footer = ({ links: links
|
|
3731
|
+
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
3732
|
const xs = (0, $hgUW1$useMediaQuery)({
|
|
3735
3733
|
minWidth: 0,
|
|
3736
3734
|
maxWidth: 544
|
|
@@ -3742,7 +3740,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links , showEmail: showEmail , em
|
|
|
3742
3740
|
const md = (0, $hgUW1$useMediaQuery)({
|
|
3743
3741
|
minWidth: 768
|
|
3744
3742
|
});
|
|
3745
|
-
const { footerOpenDataToolLinks: footerOpenDataToolLinks
|
|
3743
|
+
const { footerOpenDataToolLinks: footerOpenDataToolLinks, footerAdditionalResourcesLinks: footerAdditionalResourcesLinks, footerUtilityLinks: footerUtilityLinks } = links;
|
|
3746
3744
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("footer", {
|
|
3747
3745
|
className: "dc-c-footer",
|
|
3748
3746
|
children: [
|
|
@@ -4203,7 +4201,7 @@ var $a6df0aa147323304$export$2e2bcd8739ae039 = $a6df0aa147323304$var$Footer;
|
|
|
4203
4201
|
|
|
4204
4202
|
|
|
4205
4203
|
const $5655284dbbb89508$var$DocumentationTable = (props)=>{
|
|
4206
|
-
const { data: data
|
|
4204
|
+
const { data: data } = props;
|
|
4207
4205
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
4208
4206
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
|
|
4209
4207
|
stackable: true,
|
|
@@ -4319,7 +4317,7 @@ const $c7bf75f7e8a68780$export$7850f4d545d994c6 = [
|
|
|
4319
4317
|
|
|
4320
4318
|
|
|
4321
4319
|
const $669d2782ec2e2250$var$SpecsAndLimits = (props)=>{
|
|
4322
|
-
const { documentationList: documentationList
|
|
4320
|
+
const { documentationList: documentationList, children: children } = props;
|
|
4323
4321
|
const defaultContent = /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4324
4322
|
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
4323
|
});
|
|
@@ -4484,7 +4482,7 @@ var $efc410f5f7ac5ef3$export$2e2bcd8739ae039 = $efc410f5f7ac5ef3$var$useSearchAP
|
|
|
4484
4482
|
|
|
4485
4483
|
|
|
4486
4484
|
|
|
4487
|
-
const $59a079354baa335c$var$Hero = ({ title: title
|
|
4485
|
+
const $59a079354baa335c$var$Hero = ({ title: title, description: description, searchUrl: searchUrl, searchKey: searchKey, textfieldLabel: textfieldLabel, searchButtonText: searchButtonText })=>{
|
|
4488
4486
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
4489
4487
|
const [searchValue, setSearchValue] = (0, $hgUW1$react).useState("");
|
|
4490
4488
|
function submitHero(e) {
|
|
@@ -4580,7 +4578,7 @@ var $59a079354baa335c$export$2e2bcd8739ae039 = $59a079354baa335c$var$Hero;
|
|
|
4580
4578
|
|
|
4581
4579
|
|
|
4582
4580
|
|
|
4583
|
-
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding
|
|
4581
|
+
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding, tablePadding: tablePadding })=>{
|
|
4584
4582
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4585
4583
|
className: "ds-u-display--flex",
|
|
4586
4584
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
@@ -4630,7 +4628,7 @@ var $e71aee394fdad8bd$export$2e2bcd8739ae039 = $e71aee394fdad8bd$var$ManageColum
|
|
|
4630
4628
|
|
|
4631
4629
|
|
|
4632
4630
|
const $7848c69a021266f7$var$DataTableRowChanger = (props)=>{
|
|
4633
|
-
const { limit: limit
|
|
4631
|
+
const { limit: limit, rowOptions: rowOptions, setLimit: setLimit } = props;
|
|
4634
4632
|
const rowOptionsFormatted = rowOptions.map((row)=>({
|
|
4635
4633
|
label: row.toString(),
|
|
4636
4634
|
value: row.toString()
|
|
@@ -4752,17 +4750,17 @@ var $ec9e1550b0b034d0$export$2e2bcd8739ae039 = $ec9e1550b0b034d0$var$SettingsIco
|
|
|
4752
4750
|
|
|
4753
4751
|
|
|
4754
4752
|
|
|
4755
|
-
const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding
|
|
4753
|
+
const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding, id: id, distribution: distribution, includeFiltered: includeFiltered, includeDensity: includeDensity, includeDownload: includeDownload, resource: resource, tablePadding: tablePadding, downloadUrl: downloadUrl })=>{
|
|
4756
4754
|
const md = (0, $hgUW1$useMediaQuery)({
|
|
4757
4755
|
minWidth: 0,
|
|
4758
4756
|
maxWidth: 768
|
|
4759
4757
|
});
|
|
4760
|
-
const { limit: limit
|
|
4758
|
+
const { limit: limit, offset: offset, count: count, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
4761
4759
|
const intCount = count ? parseInt(count) : 0;
|
|
4762
4760
|
const [referenceElement, setReferenceElement] = (0, $hgUW1$useState)(null);
|
|
4763
4761
|
const [popperElement, setPopperElement] = (0, $hgUW1$useState)(null);
|
|
4764
4762
|
const [arrowElement, setArrowElement] = (0, $hgUW1$useState)(null);
|
|
4765
|
-
const { styles: styles
|
|
4763
|
+
const { styles: styles, attributes: attributes } = (0, $hgUW1$usePopper)(referenceElement, popperElement, {
|
|
4766
4764
|
modifiers: [
|
|
4767
4765
|
{
|
|
4768
4766
|
name: "arrow",
|
|
@@ -4808,7 +4806,6 @@ const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding
|
|
|
4808
4806
|
size: "small",
|
|
4809
4807
|
className: "ds-u-text-align--left ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1",
|
|
4810
4808
|
href: downloadUrl,
|
|
4811
|
-
"aria-label": "Download filtered data (CSV)",
|
|
4812
4809
|
children: [
|
|
4813
4810
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e973bc477cdc2dc7$export$2e2bcd8739ae039), {}),
|
|
4814
4811
|
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
@@ -4922,7 +4919,7 @@ function $626282d9a03c51d5$export$1147582dfae658c6(columns, schema) {
|
|
|
4922
4919
|
accessor: column
|
|
4923
4920
|
}));
|
|
4924
4921
|
}
|
|
4925
|
-
function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header
|
|
4922
|
+
function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header, accessor: accessor, setFilter: setFilter, filterValue: filterValue } }) {
|
|
4926
4923
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
|
|
4927
4924
|
label: `Filter by ${Header}`,
|
|
4928
4925
|
onChange: (e)=>{
|
|
@@ -4933,7 +4930,7 @@ function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header ,
|
|
|
4933
4930
|
value: filterValue || ""
|
|
4934
4931
|
});
|
|
4935
4932
|
}
|
|
4936
|
-
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding
|
|
4933
|
+
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
4934
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4938
4935
|
id: "resource-preview",
|
|
4939
4936
|
className: "ds-u-overflow--auto ds-u-border-x--1 ds-u-border-bottom--1",
|
|
@@ -4990,8 +4987,8 @@ var $626282d9a03c51d5$export$2e2bcd8739ae039 = $626282d9a03c51d5$var$ResourcePre
|
|
|
4990
4987
|
|
|
4991
4988
|
|
|
4992
4989
|
|
|
4993
|
-
const $072291d44ce1834a$var$ResourceFooter = ({ resource: resource
|
|
4994
|
-
const { limit: limit
|
|
4990
|
+
const $072291d44ce1834a$var$ResourceFooter = ({ resource: resource })=>{
|
|
4991
|
+
const { limit: limit, values: values, offset: offset, count: count, setOffset: setOffset } = resource;
|
|
4995
4992
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4996
4993
|
children: values.length > 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
|
|
4997
4994
|
id: "test-default",
|
|
@@ -5015,7 +5012,7 @@ var $072291d44ce1834a$export$2e2bcd8739ae039 = $072291d44ce1834a$var$ResourceFoo
|
|
|
5015
5012
|
|
|
5016
5013
|
|
|
5017
5014
|
|
|
5018
|
-
const $ec3e23baa005dc03$var$Breadcrumb = ({ currentPage: currentPage
|
|
5015
|
+
const $ec3e23baa005dc03$var$Breadcrumb = ({ currentPage: currentPage, pageTrail: pageTrail = [] })=>{
|
|
5019
5016
|
const pageTrailContent = pageTrail.map((page)=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
5020
5017
|
class: "dc-c-breadcrumb__list-item",
|
|
5021
5018
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
|
|
@@ -5093,7 +5090,7 @@ function $374c4669b044ddf8$var$getStartDate(condition, schema, id) {
|
|
|
5093
5090
|
}
|
|
5094
5091
|
return new Date();
|
|
5095
5092
|
}
|
|
5096
|
-
const $374c4669b044ddf8$var$QueryRow = ({ id: id
|
|
5093
|
+
const $374c4669b044ddf8$var$QueryRow = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema })=>{
|
|
5097
5094
|
const sm = (0, $hgUW1$useMediaQuery)({
|
|
5098
5095
|
minWidth: 0,
|
|
5099
5096
|
maxWidth: 544
|
|
@@ -5218,8 +5215,8 @@ function $3b6ca952e79f0695$var$updateQueryForDatastore(condition) {
|
|
|
5218
5215
|
if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
|
|
5219
5216
|
return cond;
|
|
5220
5217
|
}
|
|
5221
|
-
const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource
|
|
5222
|
-
const { conditions: conditions
|
|
5218
|
+
const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams, customColumns: customColumns })=>{
|
|
5219
|
+
const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
|
|
5223
5220
|
const fields = Object.keys(schema[id].fields);
|
|
5224
5221
|
const hasConditions = conditions.length > 0;
|
|
5225
5222
|
const [queryCount, setQueryCount] = (0, $hgUW1$useState)(0);
|
|
@@ -5348,7 +5345,8 @@ var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilde
|
|
|
5348
5345
|
|
|
5349
5346
|
|
|
5350
5347
|
|
|
5351
|
-
|
|
5348
|
+
|
|
5349
|
+
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
5350
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
5353
5351
|
const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState("ds-u-padding-y--1");
|
|
5354
5352
|
let apiDocs = (0, $hgUW1$useRef)();
|
|
@@ -5371,10 +5369,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id , dataset: dataset
|
|
|
5371
5369
|
manual: true
|
|
5372
5370
|
}, additionalParams);
|
|
5373
5371
|
(0, $hgUW1$useEffect)(()=>{
|
|
5374
|
-
if (distribution.identifier)
|
|
5375
|
-
resource.setResource(distribution.identifier);
|
|
5376
|
-
resource.setManual(false);
|
|
5377
|
-
}
|
|
5372
|
+
if (distribution.identifier) resource.setResource(distribution.identifier);
|
|
5378
5373
|
}, [
|
|
5379
5374
|
distribution
|
|
5380
5375
|
]);
|
|
@@ -5400,6 +5395,18 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id , dataset: dataset
|
|
|
5400
5395
|
className: "ds-title",
|
|
5401
5396
|
children: customTitle ? customTitle : pageTitle
|
|
5402
5397
|
}),
|
|
5398
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5399
|
+
className: "ds-l-row",
|
|
5400
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
5401
|
+
className: "ds-l-col--12 ds-u-color--gray ds-u-margin-y--1 ds-u-text-align--right",
|
|
5402
|
+
children: [
|
|
5403
|
+
"Updated ",
|
|
5404
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
5405
|
+
date: dataset.modified
|
|
5406
|
+
})
|
|
5407
|
+
]
|
|
5408
|
+
})
|
|
5409
|
+
}),
|
|
5403
5410
|
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
5404
5411
|
className: "ds-u-margin-top--0 dc-c-metadata-description",
|
|
5405
5412
|
dangerouslySetInnerHTML: {
|
|
@@ -5469,10 +5476,10 @@ var $dd6eb2b30d7ad75d$export$2e2bcd8739ae039 = $dd6eb2b30d7ad75d$var$FilteredRes
|
|
|
5469
5476
|
|
|
5470
5477
|
|
|
5471
5478
|
|
|
5472
|
-
const $f61ecf9f84951a61$var$FilteredResource = ({ id: id
|
|
5479
|
+
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
5480
|
const [ready, setReady] = (0, $hgUW1$useState)(false);
|
|
5474
5481
|
const [error, setError] = (0, $hgUW1$useState)(false);
|
|
5475
|
-
const { dataset: dataset
|
|
5482
|
+
const { dataset: dataset } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl, additionalParams);
|
|
5476
5483
|
const distIndex = dist_id === "data" ? 0 : dist_id;
|
|
5477
5484
|
(0, $hgUW1$useEffect)(()=>{
|
|
5478
5485
|
if (dataset.error) setError(true);
|
|
@@ -5568,7 +5575,7 @@ var $eb7821d186b1a389$export$2e2bcd8739ae039 = $eb7821d186b1a389$var$useAddLogin
|
|
|
5568
5575
|
|
|
5569
5576
|
|
|
5570
5577
|
const $90fb213ab8eeb2e7$var$useScrollToTop = ()=>{
|
|
5571
|
-
const { pathname: pathname
|
|
5578
|
+
const { pathname: pathname } = (0, $hgUW1$useLocation)();
|
|
5572
5579
|
(0, $hgUW1$useEffect)(()=>{
|
|
5573
5580
|
window.scrollTo(0, 0);
|
|
5574
5581
|
}, [
|