@civicactions/cmsds-open-data-components 4.0.12-alpha.3 → 4.0.12-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +11 -11
- package/dist/main.css.map +1 -1
- package/dist/main.js +731 -744
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +45 -44
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -4
- package/scripts/generate-usage-report.cjs +0 -0
package/dist/main.js
CHANGED
|
@@ -41,7 +41,7 @@ function $e49d4387bed21287$export$2e2bcd8739ae039() {
|
|
|
41
41
|
/*#__PURE__*/ (0, $hgUW1$jsx)("strong", {
|
|
42
42
|
children: "offset"
|
|
43
43
|
}),
|
|
44
|
-
|
|
44
|
+
' ',
|
|
45
45
|
"parameters to iterate through result sets that are larger than the row limit when running queries against the datastore API."
|
|
46
46
|
]
|
|
47
47
|
})
|
|
@@ -72,7 +72,7 @@ var $3c72c298c3a7f21f$export$2e2bcd8739ae039 = $3c72c298c3a7f21f$var$HeaderTagli
|
|
|
72
72
|
const $1555e1cb3eb7b3e3$var$HeaderNavIconLink = (props)=>{
|
|
73
73
|
const { url: url, urlTitle: urlTitle, logoFilePath: logoFilePath, logoAltText: logoAltText, backArrow: backArrow } = props;
|
|
74
74
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
75
|
-
className: `dkan-c-header-nav-icon-link ${backArrow ?
|
|
75
|
+
className: `dkan-c-header-nav-icon-link ${backArrow ? 'show-back-arrow' : ''} ds-u-valign--middle `,
|
|
76
76
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
|
|
77
77
|
href: url,
|
|
78
78
|
title: urlTitle,
|
|
@@ -232,7 +232,7 @@ const $046ded0064bd0a3d$var$FAQAccordion = (props)=>{
|
|
|
232
232
|
type: "button",
|
|
233
233
|
variation: "ghost",
|
|
234
234
|
onClick: ()=>toggleAll(),
|
|
235
|
-
children: `${expanded ?
|
|
235
|
+
children: `${expanded ? 'Collapse' : 'Expand'} all FAQs`
|
|
236
236
|
}),
|
|
237
237
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
|
|
238
238
|
children: faqItems.map((faq)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
|
|
@@ -333,8 +333,8 @@ const $844981eac9b63865$export$eccc29c8d0ff408 = (0, $hgUW1$createContext)({
|
|
|
333
333
|
|
|
334
334
|
|
|
335
335
|
const $10bc3aae21fc1572$var$DatasetListSubmenu = ({ rootUrl: rootUrl, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 4, defaultSort: defaultSort = {
|
|
336
|
-
defaultSort:
|
|
337
|
-
defaultOrder:
|
|
336
|
+
defaultSort: 'modified',
|
|
337
|
+
defaultOrder: 'desc'
|
|
338
338
|
}, subLinkClasses: subLinkClasses })=>{
|
|
339
339
|
const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
|
|
340
340
|
const [currentResultNumbers, setCurrentResultNumbers] = (0, $hgUW1$useState)({
|
|
@@ -354,8 +354,8 @@ const $10bc3aae21fc1572$var$DatasetListSubmenu = ({ rootUrl: rootUrl, enablePagi
|
|
|
354
354
|
]);
|
|
355
355
|
let params = {
|
|
356
356
|
sort: defaultSort.defaultSort,
|
|
357
|
-
[
|
|
358
|
-
[
|
|
357
|
+
['sort-order']: defaultSort.defaultOrder,
|
|
358
|
+
['page-size']: defaultPageSize
|
|
359
359
|
};
|
|
360
360
|
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
361
361
|
queryKey: [
|
|
@@ -364,7 +364,7 @@ const $10bc3aae21fc1572$var$DatasetListSubmenu = ({ rootUrl: rootUrl, enablePagi
|
|
|
364
364
|
],
|
|
365
365
|
queryFn: ()=>{
|
|
366
366
|
return (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
|
|
367
|
-
arrayFormat:
|
|
367
|
+
arrayFormat: 'comma',
|
|
368
368
|
encode: false
|
|
369
369
|
})}`);
|
|
370
370
|
}
|
|
@@ -507,11 +507,11 @@ const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, s
|
|
|
507
507
|
function handleFocusOut(event) {
|
|
508
508
|
if (currentMenu && !currentMenu.contains(event.relatedTarget)) setIsExpanded(false);
|
|
509
509
|
}
|
|
510
|
-
document.addEventListener(
|
|
511
|
-
currentMenu?.addEventListener(
|
|
510
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
511
|
+
currentMenu?.addEventListener('focusout', handleFocusOut);
|
|
512
512
|
return ()=>{
|
|
513
|
-
document.removeEventListener(
|
|
514
|
-
if (currentMenu) currentMenu.removeEventListener(
|
|
513
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
514
|
+
if (currentMenu) currentMenu.removeEventListener('focusout', handleFocusOut);
|
|
515
515
|
};
|
|
516
516
|
}, [
|
|
517
517
|
isExpanded
|
|
@@ -533,7 +533,7 @@ const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, s
|
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
536
|
-
className: `dkan-c-nav-submenu has-submenu${isExpanded ?
|
|
536
|
+
className: `dkan-c-nav-submenu has-submenu${isExpanded ? ' open' : ''}`,
|
|
537
537
|
ref: menu,
|
|
538
538
|
children: [
|
|
539
539
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
|
|
@@ -569,12 +569,12 @@ var $4f153ca537d853e5$export$2e2bcd8739ae039 = $4f153ca537d853e5$var$SubMenu;
|
|
|
569
569
|
const $fea9297ba4dd394c$var$HeaderSearch = (props)=>{
|
|
570
570
|
const { headingText: headingText = "Dataset Search" } = props;
|
|
571
571
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
572
|
-
const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)(
|
|
572
|
+
const [modalSearchTerm, setModalSearchTerm] = (0, $hgUW1$useState)('');
|
|
573
573
|
const [modalSearch, setModalSearch] = (0, $hgUW1$useState)(false);
|
|
574
574
|
function searchForDataset(e) {
|
|
575
575
|
e.preventDefault();
|
|
576
576
|
if (window) {
|
|
577
|
-
if (window.location.pathname !==
|
|
577
|
+
if (window.location.pathname !== '/datasets') navigate(`/datasets?fulltext=${modalSearchTerm}`);
|
|
578
578
|
else {
|
|
579
579
|
window.location.search = `fulltext=${modalSearchTerm}`;
|
|
580
580
|
setModalSearch(false);
|
|
@@ -642,9 +642,9 @@ const $b939b31651e82908$var$HeaderNav = (props)=>{
|
|
|
642
642
|
const headerContext = (0, $hgUW1$react).useContext((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039));
|
|
643
643
|
const { links: links, topNavLinks: topNavLinks, wrapperClasses: wrapperClasses, searchInMobile: searchInMobile } = props;
|
|
644
644
|
const navMenuOpenClass = `dkan-c-nav-menu--${headerContext.mobileMenuOpen ? "open" : "close"}`;
|
|
645
|
-
const isMobileClass = `dkan-c-nav-menu--${headerContext.isMobile ?
|
|
646
|
-
const linkClasses =
|
|
647
|
-
const listClasses =
|
|
645
|
+
const isMobileClass = `dkan-c-nav-menu--${headerContext.isMobile ? 'mobile' : 'desktop'}`;
|
|
646
|
+
const linkClasses = 'dkan-c-header--link ds-c-button ds-c-button--ghost';
|
|
647
|
+
const listClasses = 'dkan-c-header--link-list ';
|
|
648
648
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
649
649
|
className: `dkan-c-nav-menu ${wrapperClasses} ${navMenuOpenClass} ${isMobileClass}`,
|
|
650
650
|
ref: headerContext.menuRef,
|
|
@@ -814,8 +814,8 @@ const $953b286f7778640e$var$SidebarNavigation = (props)=>{
|
|
|
814
814
|
const { title: title, links: links, mobileMax: mobileMax } = props;
|
|
815
815
|
const active = (0, $hgUW1$useLocation)().pathname;
|
|
816
816
|
const [menuOpen, setMenuOpen] = (0, $hgUW1$useState)(false);
|
|
817
|
-
const styleClasses =
|
|
818
|
-
const mobileClass = `dkan-c-sidebar-nav--${mobileMax ?
|
|
817
|
+
const styleClasses = 'dkan-c--sidebar-nav-wrapper ds-u-border--1 ds-u-border--color-gray-lightest ds-u-padding--2';
|
|
818
|
+
const mobileClass = `dkan-c-sidebar-nav--${mobileMax ? 'mobile' : 'desktop'}`;
|
|
819
819
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
820
820
|
className: `dkan-c-sidebar-nav ${mobileClass}`,
|
|
821
821
|
children: [
|
|
@@ -829,7 +829,7 @@ const $953b286f7778640e$var$SidebarNavigation = (props)=>{
|
|
|
829
829
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
|
|
830
830
|
"aria-haspopup": "true",
|
|
831
831
|
variation: "ghost",
|
|
832
|
-
"aria-expanded": `${menuOpen ?
|
|
832
|
+
"aria-expanded": `${menuOpen ? 'true' : 'false'}`,
|
|
833
833
|
onDark: true,
|
|
834
834
|
onClick: ()=>setMenuOpen(!menuOpen),
|
|
835
835
|
children: [
|
|
@@ -838,7 +838,7 @@ const $953b286f7778640e$var$SidebarNavigation = (props)=>{
|
|
|
838
838
|
children: "Toggle menu"
|
|
839
839
|
}),
|
|
840
840
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ArrowIcon), {
|
|
841
|
-
direction: menuOpen ?
|
|
841
|
+
direction: menuOpen ? 'up' : 'down'
|
|
842
842
|
})
|
|
843
843
|
]
|
|
844
844
|
})
|
|
@@ -847,7 +847,7 @@ const $953b286f7778640e$var$SidebarNavigation = (props)=>{
|
|
|
847
847
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
848
848
|
className: ``,
|
|
849
849
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("nav", {
|
|
850
|
-
className: `${styleClasses} dkan-c-sidebar-nav-menu dkan-c-sidebar-nav-menu--${menuOpen ?
|
|
850
|
+
className: `${styleClasses} dkan-c-sidebar-nav-menu dkan-c-sidebar-nav-menu--${menuOpen ? 'open' : 'close'}`,
|
|
851
851
|
children: [
|
|
852
852
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
853
853
|
className: "ds-u-padding--2 ds-u-border-bottom--1 ds-u-border--color-gray-lightest",
|
|
@@ -859,7 +859,7 @@ const $953b286f7778640e$var$SidebarNavigation = (props)=>{
|
|
|
859
859
|
/*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
860
860
|
className: "ds-u-padding-bottom--2",
|
|
861
861
|
children: links.map(({ url: url, label: label })=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
862
|
-
className: `ds-u-padding--1 ds-u-padding-top--2 ds-u-border-bottom--1 ds-u-border--color-gray-lightest ${active === url ?
|
|
862
|
+
className: `ds-u-padding--1 ds-u-padding-top--2 ds-u-border-bottom--1 ds-u-border--color-gray-lightest ${active === url ? 'active' : ''}`,
|
|
863
863
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
864
864
|
className: "ds-u-display--flex ds-u-padding-y--1",
|
|
865
865
|
children: [
|
|
@@ -894,12 +894,12 @@ const $b0968edc60d7d3a4$var$SidebarPage = (props)=>{
|
|
|
894
894
|
query: `(max-width: ${mobileMaxWidth}px)`
|
|
895
895
|
});
|
|
896
896
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
897
|
-
className: `${mobileMax ? "a" :
|
|
897
|
+
className: `${mobileMax ? "a" : 'ds-l-container'}`,
|
|
898
898
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
899
|
-
className: `${mobileMax ? "a" :
|
|
899
|
+
className: `${mobileMax ? "a" : 'ds-l-row'}`,
|
|
900
900
|
children: [
|
|
901
901
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
902
|
-
className: `${mobileMax ?
|
|
902
|
+
className: `${mobileMax ? 'a' : "ds-l-col--4"}`,
|
|
903
903
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $953b286f7778640e$export$2e2bcd8739ae039), {
|
|
904
904
|
links: links,
|
|
905
905
|
title: menuTitle,
|
|
@@ -922,9 +922,9 @@ var $b0968edc60d7d3a4$export$2e2bcd8739ae039 = $b0968edc60d7d3a4$var$SidebarPage
|
|
|
922
922
|
|
|
923
923
|
|
|
924
924
|
|
|
925
|
-
const $59a079354baa335c$var$Hero = ({ title: title, description: description, searchUrl: searchUrl =
|
|
925
|
+
const $59a079354baa335c$var$Hero = ({ title: title, description: description, searchUrl: searchUrl = 'datasets', searchKey: searchKey = 'fulltext', textfieldLabel: textfieldLabel = 'Search for a dataset', searchButtonText: searchButtonText = 'Search' })=>{
|
|
926
926
|
const navigate = (0, $hgUW1$useNavigate)();
|
|
927
|
-
const [searchValue, setSearchValue] = (0, $hgUW1$react).useState(
|
|
927
|
+
const [searchValue, setSearchValue] = (0, $hgUW1$react).useState('');
|
|
928
928
|
function submitHero(e) {
|
|
929
929
|
e.preventDefault();
|
|
930
930
|
navigate(`/${searchUrl}?${searchKey}=${searchValue}`);
|
|
@@ -951,24 +951,24 @@ const $59a079354baa335c$var$Hero = ({ title: title, description: description, se
|
|
|
951
951
|
onSubmit: (e)=>submitHero(e),
|
|
952
952
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
953
953
|
style: {
|
|
954
|
-
position:
|
|
954
|
+
position: 'relative'
|
|
955
955
|
},
|
|
956
956
|
className: "ds-l-row ds-u-align-items--stretch ds-u-margin-y--4 ds-u-flex-wrap--nowrap",
|
|
957
957
|
children: [
|
|
958
958
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
959
959
|
className: "ds-u-padding--0 ds-u-margin-right--1",
|
|
960
960
|
style: {
|
|
961
|
-
flex:
|
|
962
|
-
maxWidth:
|
|
961
|
+
flex: '1 1 100%',
|
|
962
|
+
maxWidth: '100%'
|
|
963
963
|
},
|
|
964
964
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
|
|
965
965
|
label: textfieldLabel,
|
|
966
966
|
labelClassName: "ds-u-visibility--screen-reader",
|
|
967
967
|
name: "search_text_input",
|
|
968
968
|
style: {
|
|
969
|
-
maxWidth:
|
|
970
|
-
height:
|
|
971
|
-
margin:
|
|
969
|
+
maxWidth: 'none',
|
|
970
|
+
height: '61px',
|
|
971
|
+
margin: '0 20px 0 0'
|
|
972
972
|
},
|
|
973
973
|
onChange: (e)=>setSearchValue(e.target.value)
|
|
974
974
|
})
|
|
@@ -1006,14 +1006,14 @@ var $59a079354baa335c$export$2e2bcd8739ae039 = $59a079354baa335c$var$Hero;
|
|
|
1006
1006
|
|
|
1007
1007
|
|
|
1008
1008
|
const $bd76a91923d7e8a7$var$TransformedDate = ({ date: date, options: options = {
|
|
1009
|
-
year:
|
|
1010
|
-
month:
|
|
1011
|
-
day:
|
|
1012
|
-
timeZone:
|
|
1009
|
+
year: 'numeric',
|
|
1010
|
+
month: 'long',
|
|
1011
|
+
day: 'numeric',
|
|
1012
|
+
timeZone: 'UTC'
|
|
1013
1013
|
} })=>{
|
|
1014
1014
|
const rawDate = new Date(date);
|
|
1015
|
-
let modifiedDate =
|
|
1016
|
-
if (rawDate) modifiedDate = rawDate.toLocaleDateString(
|
|
1015
|
+
let modifiedDate = '';
|
|
1016
|
+
if (rawDate) modifiedDate = rawDate.toLocaleDateString('en-US', options);
|
|
1017
1017
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
1018
1018
|
children: modifiedDate
|
|
1019
1019
|
});
|
|
@@ -1027,25 +1027,25 @@ const $c068004d499082cc$var$DatasetListItem = (props)=>{
|
|
|
1027
1027
|
minWidth: 1024
|
|
1028
1028
|
});
|
|
1029
1029
|
const { title: title, modified: modified, identifier: identifier, paginationEnabled: paginationEnabled, dataDictionaryLinks: dataDictionaryLinks } = props;
|
|
1030
|
-
let linkContainerClasses =
|
|
1031
|
-
if (dataDictionaryLinks) linkContainerClasses +=
|
|
1032
|
-
else linkContainerClasses +=
|
|
1033
|
-
let linkClasses =
|
|
1030
|
+
let linkContainerClasses = 'ds-u-margin-bottom--2';
|
|
1031
|
+
if (dataDictionaryLinks) linkContainerClasses += ' ds-l-col--6 ds-u-padding-right--0';
|
|
1032
|
+
else linkContainerClasses += ' ds-l-col--auto ds-u-padding-left--0';
|
|
1033
|
+
let linkClasses = 'ds-u-display--block ds-u-text-align--left';
|
|
1034
1034
|
if (desktop) {
|
|
1035
|
-
linkContainerClasses =
|
|
1036
|
-
linkClasses +=
|
|
1035
|
+
linkContainerClasses = 'ds-u-padding-x--0';
|
|
1036
|
+
linkClasses += ' ds-l-col--4 ds-l-md-col--auto';
|
|
1037
1037
|
}
|
|
1038
1038
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
1039
1039
|
className: "dc-c-list-item ds-u-padding-top--4",
|
|
1040
1040
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
1041
|
-
className: `dc-c-searchlist-item ${paginationEnabled ?
|
|
1041
|
+
className: `dc-c-searchlist-item ${paginationEnabled ? 'ds-u-border-top--1' : 'ds-u-border-bottom--1 ds-u-padding-bottom--3'}`,
|
|
1042
1042
|
children: [
|
|
1043
1043
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
1044
1044
|
className: "ds-l-row ds-u-align-items--start",
|
|
1045
1045
|
children: [
|
|
1046
1046
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
1047
1047
|
id: `dataset-${identifier}-updated-date`,
|
|
1048
|
-
className: `ds-l-col--12 ds-u-text-align--left ds-text-heading--sm ${paginationEnabled ?
|
|
1048
|
+
className: `ds-l-col--12 ds-u-text-align--left ds-text-heading--sm ${paginationEnabled ? 'ds-u-padding-top--3' : 'ds-u-padding-top--0'}`,
|
|
1049
1049
|
children: [
|
|
1050
1050
|
"Updated ",
|
|
1051
1051
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
@@ -1103,7 +1103,7 @@ var $c068004d499082cc$export$2e2bcd8739ae039 = $c068004d499082cc$var$DatasetList
|
|
|
1103
1103
|
|
|
1104
1104
|
const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
|
|
1105
1105
|
switch(props.id){
|
|
1106
|
-
case
|
|
1106
|
+
case 'overview':
|
|
1107
1107
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
1108
1108
|
width: "16px",
|
|
1109
1109
|
height: "16px",
|
|
@@ -1146,7 +1146,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
|
|
|
1146
1146
|
})
|
|
1147
1147
|
]
|
|
1148
1148
|
});
|
|
1149
|
-
case
|
|
1149
|
+
case 'data-table':
|
|
1150
1150
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
1151
1151
|
width: "16px",
|
|
1152
1152
|
height: "12px",
|
|
@@ -1179,7 +1179,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
|
|
|
1179
1179
|
})
|
|
1180
1180
|
]
|
|
1181
1181
|
});
|
|
1182
|
-
case
|
|
1182
|
+
case 'api':
|
|
1183
1183
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
1184
1184
|
width: "16px",
|
|
1185
1185
|
height: "13px",
|
|
@@ -1212,7 +1212,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
|
|
|
1212
1212
|
})
|
|
1213
1213
|
]
|
|
1214
1214
|
});
|
|
1215
|
-
case
|
|
1215
|
+
case 'download':
|
|
1216
1216
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
1217
1217
|
width: "16px",
|
|
1218
1218
|
height: "16px",
|
|
@@ -1242,7 +1242,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
|
|
|
1242
1242
|
})
|
|
1243
1243
|
]
|
|
1244
1244
|
});
|
|
1245
|
-
case
|
|
1245
|
+
case 'data-dictionary':
|
|
1246
1246
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
1247
1247
|
width: "14px",
|
|
1248
1248
|
height: "16px",
|
|
@@ -1345,13 +1345,13 @@ var $b61856b23f5f58a2$export$2e2bcd8739ae039 = $b61856b23f5f58a2$var$LargeFileDi
|
|
|
1345
1345
|
|
|
1346
1346
|
|
|
1347
1347
|
function $1a2bf34e2a8f6b80$export$59a943b34a82e690(textString, textLength = 240) {
|
|
1348
|
-
if (!textString) return
|
|
1348
|
+
if (!textString) return '';
|
|
1349
1349
|
let cleanedText = textString;
|
|
1350
|
-
if (cleanedText.split(
|
|
1351
|
-
if (cleanedText.split(
|
|
1350
|
+
if (cleanedText.split('</p>').length > 1) cleanedText = cleanedText.split('</p>')[0];
|
|
1351
|
+
if (cleanedText.split('<br/>').length > 1) cleanedText = cleanedText.split('<br/>')[0];
|
|
1352
1352
|
cleanedText = (0, $hgUW1$lodashtruncate)(cleanedText, {
|
|
1353
|
-
|
|
1354
|
-
|
|
1353
|
+
'length': textLength,
|
|
1354
|
+
'separator': ' '
|
|
1355
1355
|
});
|
|
1356
1356
|
return (0, $hgUW1$dompurify).sanitize(cleanedText, {
|
|
1357
1357
|
ALLOWED_TAGS: []
|
|
@@ -1369,9 +1369,9 @@ function $1a2bf34e2a8f6b80$export$59a943b34a82e690(textString, textLength = 240)
|
|
|
1369
1369
|
const $17711e94d2ce0ee4$var$DatasetDateItem = (props)=>{
|
|
1370
1370
|
const { type: type, date: date, boldLabel: boldLabel = false, displayTooltips: displayTooltips = true } = props;
|
|
1371
1371
|
const dateText = {
|
|
1372
|
-
modified:
|
|
1373
|
-
released:
|
|
1374
|
-
refresh:
|
|
1372
|
+
modified: 'Last Modified',
|
|
1373
|
+
released: 'Released',
|
|
1374
|
+
refresh: 'Planned Update'
|
|
1375
1375
|
};
|
|
1376
1376
|
const tooltipContent = {
|
|
1377
1377
|
modified: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
@@ -1408,7 +1408,7 @@ const $17711e94d2ce0ee4$var$DatasetDateItem = (props)=>{
|
|
|
1408
1408
|
})
|
|
1409
1409
|
};
|
|
1410
1410
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
1411
|
-
className: `dataset-date-item${boldLabel ?
|
|
1411
|
+
className: `dataset-date-item${boldLabel ? ' bold-label' : ''}`,
|
|
1412
1412
|
children: [
|
|
1413
1413
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
1414
1414
|
className: "dataset-data-item-label",
|
|
@@ -1478,7 +1478,7 @@ function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
|
|
|
1478
1478
|
if (dist && dist.data) {
|
|
1479
1479
|
if (dist.data.format) return dist.data.format.toLowerCase();
|
|
1480
1480
|
if (dist.data.mediaType) {
|
|
1481
|
-
const mediaType = dist.data.mediaType.split(
|
|
1481
|
+
const mediaType = dist.data.mediaType.split('/');
|
|
1482
1482
|
if (mediaType.length && mediaType[1]) return mediaType[1].toLowerCase();
|
|
1483
1483
|
}
|
|
1484
1484
|
if (dist.data["%Ref:downloadURL"].length && dist.data["%Ref:downloadURL"][0].data) {
|
|
@@ -1488,7 +1488,7 @@ function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
|
|
|
1488
1488
|
}
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
|
-
return
|
|
1491
|
+
return '';
|
|
1492
1492
|
}
|
|
1493
1493
|
|
|
1494
1494
|
|
|
@@ -1498,20 +1498,20 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1498
1498
|
});
|
|
1499
1499
|
const { title: title, modified: modified, description: description, downloadUrl: downloadUrl, largeFile: largeFile = false, paginationEnabled: paginationEnabled, dataDictionaryLinks: dataDictionaryLinks, identifier: identifier, refresh: refresh, released: released, showDateDetails: showDateDetails = false, showTopics: showTopics = false, theme: theme, topicSlugs: topicSlugs, distribution: distribution } = props;
|
|
1500
1500
|
const location = (0, $hgUW1$useLocation)();
|
|
1501
|
-
let linkContainerClasses =
|
|
1502
|
-
if (dataDictionaryLinks) linkContainerClasses +=
|
|
1503
|
-
else linkContainerClasses +=
|
|
1504
|
-
let linkClasses =
|
|
1501
|
+
let linkContainerClasses = 'ds-u-margin-bottom--2';
|
|
1502
|
+
if (dataDictionaryLinks) linkContainerClasses += ' ds-l-col--6 ds-u-padding-right--0';
|
|
1503
|
+
else linkContainerClasses += ' ds-l-col--auto ds-u-padding-left--0';
|
|
1504
|
+
let linkClasses = 'ds-u-display--block ds-u-text-align--left';
|
|
1505
1505
|
if (desktop) {
|
|
1506
|
-
linkContainerClasses =
|
|
1507
|
-
linkClasses +=
|
|
1506
|
+
linkContainerClasses = 'ds-u-padding-x--0';
|
|
1507
|
+
linkClasses += ' ds-l-col--4 ds-l-md-col--auto';
|
|
1508
1508
|
}
|
|
1509
1509
|
let themes;
|
|
1510
1510
|
if (theme && showTopics) themes = /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
1511
1511
|
className: "theme-list item-theme",
|
|
1512
1512
|
children: theme.map((topic, index)=>{
|
|
1513
|
-
const title = topic ||
|
|
1514
|
-
const prefix =
|
|
1513
|
+
const title = topic || 'Unknown Topic';
|
|
1514
|
+
const prefix = 'topics';
|
|
1515
1515
|
// Use the provided slug or fallback to a simple slug generation
|
|
1516
1516
|
const slug = topicSlugs?.[title];
|
|
1517
1517
|
const link = `/${prefix}/${slug}`;
|
|
@@ -1522,7 +1522,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1522
1522
|
state: {
|
|
1523
1523
|
fromUrl: location.pathname,
|
|
1524
1524
|
fromTitle: false,
|
|
1525
|
-
fromSearchList: location.pathname.includes(
|
|
1525
|
+
fromSearchList: location.pathname.includes('search')
|
|
1526
1526
|
},
|
|
1527
1527
|
children: title
|
|
1528
1528
|
})
|
|
@@ -1564,7 +1564,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1564
1564
|
};
|
|
1565
1565
|
const dataDictionaryExists = ()=>{
|
|
1566
1566
|
if (distribution && "data" in distribution) {
|
|
1567
|
-
if ("describedBy" in distribution.data && "describedByType" in distribution.data) return distribution.data.describedByType ===
|
|
1567
|
+
if ("describedBy" in distribution.data && "describedByType" in distribution.data) return distribution.data.describedByType === 'application/vnd.tableschema+json';
|
|
1568
1568
|
}
|
|
1569
1569
|
return false;
|
|
1570
1570
|
};
|
|
@@ -1598,7 +1598,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1598
1598
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
1599
1599
|
className: "dc-c-search-list-item ds-u-padding-top--3",
|
|
1600
1600
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
1601
|
-
className: `dc-c-searchlist-item ${paginationEnabled ?
|
|
1601
|
+
className: `dc-c-searchlist-item ${paginationEnabled ? 'ds-u-border-top--1' : 'ds-u-border-bottom--1 ds-u-padding-bottom--3'}`,
|
|
1602
1602
|
children: [
|
|
1603
1603
|
themes,
|
|
1604
1604
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -1606,7 +1606,7 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1606
1606
|
children: [
|
|
1607
1607
|
!showDateDetails && /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
1608
1608
|
id: `dataset-${identifier}-updated-date`,
|
|
1609
|
-
className: `ds-l-col--12 ds-u-text-align--right ${paginationEnabled ?
|
|
1609
|
+
className: `ds-l-col--12 ds-u-text-align--right ${paginationEnabled ? 'ds-u-padding-top--2' : 'ds-u-padding-top--0'}`,
|
|
1610
1610
|
children: [
|
|
1611
1611
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
1612
1612
|
children: "Updated:"
|
|
@@ -1635,13 +1635,13 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1635
1635
|
(0, $1a2bf34e2a8f6b80$export$59a943b34a82e690)(description),
|
|
1636
1636
|
description.length > 240 ? /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
1637
1637
|
children: [
|
|
1638
|
-
|
|
1638
|
+
' ',
|
|
1639
1639
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
|
|
1640
1640
|
to: `/dataset/${identifier}`,
|
|
1641
1641
|
children: "See more"
|
|
1642
1642
|
})
|
|
1643
1643
|
]
|
|
1644
|
-
}) :
|
|
1644
|
+
}) : ''
|
|
1645
1645
|
]
|
|
1646
1646
|
})
|
|
1647
1647
|
}),
|
|
@@ -1669,14 +1669,14 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1669
1669
|
"Download"
|
|
1670
1670
|
]
|
|
1671
1671
|
})
|
|
1672
|
-
}) :
|
|
1672
|
+
}) : '',
|
|
1673
1673
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("ul", {
|
|
1674
|
-
className: `ds-l-row ds-u-padding--0 ds-u-flex-direction--row ds-u-justify-content--between ds-u-md-justify-content--start ds-u-margin-top--3 ds-u-margin-x--0 ${!dataDictionaryLinks ?
|
|
1674
|
+
className: `ds-l-row ds-u-padding--0 ds-u-flex-direction--row ds-u-justify-content--between ds-u-md-justify-content--start ds-u-margin-top--3 ds-u-margin-x--0 ${!dataDictionaryLinks ? 'ds-u-justify-content--center ds-u-md-justify-content--start' : ''}`,
|
|
1675
1675
|
children: [
|
|
1676
1676
|
/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
1677
1677
|
className: linkContainerClasses,
|
|
1678
1678
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
1679
|
-
className: `${linkClasses}${(0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ?
|
|
1679
|
+
className: `${linkClasses}${(0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ? '' : ' dkan-disabled-link-wrapper'}`,
|
|
1680
1680
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)(DataTableLink, {})
|
|
1681
1681
|
})
|
|
1682
1682
|
}),
|
|
@@ -1698,10 +1698,10 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
|
|
|
1698
1698
|
dataDictionaryLinks ? /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
1699
1699
|
className: linkContainerClasses,
|
|
1700
1700
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
1701
|
-
className: `${linkClasses}${dataDictionaryExists() ?
|
|
1701
|
+
className: `${linkClasses}${dataDictionaryExists() ? '' : ' dkan-disabled-link-wrapper'}`,
|
|
1702
1702
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)(DataDictionaryLink, {})
|
|
1703
1703
|
})
|
|
1704
|
-
}) :
|
|
1704
|
+
}) : '',
|
|
1705
1705
|
/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
1706
1706
|
className: linkContainerClasses,
|
|
1707
1707
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
@@ -1797,7 +1797,7 @@ var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocument
|
|
|
1797
1797
|
|
|
1798
1798
|
|
|
1799
1799
|
|
|
1800
|
-
const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className =
|
|
1800
|
+
const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className = 'data-table-results' })=>{
|
|
1801
1801
|
const numTotalRows = totalRows;
|
|
1802
1802
|
if (numTotalRows === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
1803
1803
|
className: className,
|
|
@@ -1815,18 +1815,18 @@ const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limi
|
|
|
1815
1815
|
className: className,
|
|
1816
1816
|
children: [
|
|
1817
1817
|
"Displaying",
|
|
1818
|
-
|
|
1818
|
+
' ',
|
|
1819
1819
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
1820
1820
|
className: "ds-u-font-weight--bold",
|
|
1821
1821
|
children: `${startTotal().toLocaleString()} - ${ofTotal().toLocaleString()}`
|
|
1822
1822
|
}),
|
|
1823
|
-
|
|
1823
|
+
' ',
|
|
1824
1824
|
"of ",
|
|
1825
1825
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
1826
1826
|
className: "ds-u-font-weight--bold",
|
|
1827
1827
|
children: `${numTotalRows.toLocaleString()}`
|
|
1828
1828
|
}),
|
|
1829
|
-
|
|
1829
|
+
' ',
|
|
1830
1830
|
"rows"
|
|
1831
1831
|
]
|
|
1832
1832
|
});
|
|
@@ -1852,16 +1852,16 @@ const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePaddi
|
|
|
1852
1852
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
1853
1853
|
options: [
|
|
1854
1854
|
{
|
|
1855
|
-
label:
|
|
1856
|
-
value:
|
|
1855
|
+
label: 'Tight',
|
|
1856
|
+
value: 'ds-u-padding-y--0'
|
|
1857
1857
|
},
|
|
1858
1858
|
{
|
|
1859
|
-
label:
|
|
1860
|
-
value:
|
|
1859
|
+
label: 'Normal',
|
|
1860
|
+
value: 'ds-u-padding-y--1'
|
|
1861
1861
|
},
|
|
1862
1862
|
{
|
|
1863
|
-
label:
|
|
1864
|
-
value:
|
|
1863
|
+
label: 'Expanded',
|
|
1864
|
+
value: 'ds-u-padding-y--2'
|
|
1865
1865
|
}
|
|
1866
1866
|
],
|
|
1867
1867
|
label: "Display density:",
|
|
@@ -2104,7 +2104,7 @@ function $aa4450dcbeef3ac0$export$385a5aba38cc3325(sortArray) {
|
|
|
2104
2104
|
sortArray.forEach((s)=>{
|
|
2105
2105
|
return newQuery.push({
|
|
2106
2106
|
property: s.id,
|
|
2107
|
-
order: s.desc ?
|
|
2107
|
+
order: s.desc ? 'desc' : 'asc'
|
|
2108
2108
|
});
|
|
2109
2109
|
});
|
|
2110
2110
|
return newQuery;
|
|
@@ -2142,46 +2142,46 @@ function $7264a673914aa746$export$e284ae5d89467c8f(date) {
|
|
|
2142
2142
|
}
|
|
2143
2143
|
function $7264a673914aa746$export$6b5e57d20078142b(value, operator) {
|
|
2144
2144
|
let newValue = value;
|
|
2145
|
-
if (Array.isArray(newValue)) newValue = newValue.join(
|
|
2145
|
+
if (Array.isArray(newValue)) newValue = newValue.join(',');
|
|
2146
2146
|
// return newValue.replace(/(^\%+|\%+$)/gm, '');
|
|
2147
2147
|
return newValue;
|
|
2148
2148
|
}
|
|
2149
2149
|
const $7264a673914aa746$export$5f89a5ae87bc48e1 = [
|
|
2150
2150
|
{
|
|
2151
|
-
label:
|
|
2152
|
-
value:
|
|
2151
|
+
label: 'Is',
|
|
2152
|
+
value: '='
|
|
2153
2153
|
},
|
|
2154
2154
|
{
|
|
2155
|
-
label:
|
|
2156
|
-
value:
|
|
2155
|
+
label: 'Starts With',
|
|
2156
|
+
value: 'starts with'
|
|
2157
2157
|
},
|
|
2158
2158
|
{
|
|
2159
|
-
label:
|
|
2160
|
-
value:
|
|
2159
|
+
label: 'Contains',
|
|
2160
|
+
value: 'contains'
|
|
2161
2161
|
},
|
|
2162
2162
|
{
|
|
2163
|
-
label:
|
|
2164
|
-
value:
|
|
2163
|
+
label: 'Is Not',
|
|
2164
|
+
value: '<>'
|
|
2165
2165
|
},
|
|
2166
2166
|
{
|
|
2167
|
-
label:
|
|
2168
|
-
value:
|
|
2167
|
+
label: 'Or',
|
|
2168
|
+
value: 'in'
|
|
2169
2169
|
},
|
|
2170
2170
|
{
|
|
2171
|
-
label:
|
|
2172
|
-
value:
|
|
2171
|
+
label: 'Is',
|
|
2172
|
+
value: '='
|
|
2173
2173
|
},
|
|
2174
2174
|
{
|
|
2175
|
-
label:
|
|
2176
|
-
value:
|
|
2175
|
+
label: 'Is Not',
|
|
2176
|
+
value: '<>'
|
|
2177
2177
|
},
|
|
2178
2178
|
{
|
|
2179
|
-
label:
|
|
2180
|
-
value:
|
|
2179
|
+
label: 'Greater Than',
|
|
2180
|
+
value: '>'
|
|
2181
2181
|
},
|
|
2182
2182
|
{
|
|
2183
|
-
label:
|
|
2184
|
-
value:
|
|
2183
|
+
label: 'Less Than',
|
|
2184
|
+
value: '<'
|
|
2185
2185
|
}
|
|
2186
2186
|
];
|
|
2187
2187
|
function $7264a673914aa746$export$d243819c3ad678fb(operatorValue) {
|
|
@@ -2190,59 +2190,59 @@ function $7264a673914aa746$export$d243819c3ad678fb(operatorValue) {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
function $7264a673914aa746$export$2b9377795161999(type) {
|
|
2192
2192
|
switch(type){
|
|
2193
|
-
case
|
|
2194
|
-
case
|
|
2193
|
+
case 'text':
|
|
2194
|
+
case 'string':
|
|
2195
2195
|
return [
|
|
2196
2196
|
{
|
|
2197
|
-
label:
|
|
2198
|
-
value:
|
|
2197
|
+
label: 'Is',
|
|
2198
|
+
value: '='
|
|
2199
2199
|
},
|
|
2200
2200
|
{
|
|
2201
|
-
label:
|
|
2202
|
-
value:
|
|
2201
|
+
label: 'Starts With',
|
|
2202
|
+
value: 'starts with'
|
|
2203
2203
|
},
|
|
2204
2204
|
{
|
|
2205
|
-
label:
|
|
2206
|
-
value:
|
|
2205
|
+
label: 'Contains',
|
|
2206
|
+
value: 'contains'
|
|
2207
2207
|
},
|
|
2208
2208
|
{
|
|
2209
|
-
label:
|
|
2210
|
-
value:
|
|
2209
|
+
label: 'Is Not',
|
|
2210
|
+
value: '<>'
|
|
2211
2211
|
},
|
|
2212
2212
|
{
|
|
2213
|
-
label:
|
|
2214
|
-
value:
|
|
2213
|
+
label: 'Or',
|
|
2214
|
+
value: 'in'
|
|
2215
2215
|
}
|
|
2216
2216
|
];
|
|
2217
|
-
case
|
|
2217
|
+
case 'date':
|
|
2218
2218
|
return [
|
|
2219
2219
|
{
|
|
2220
|
-
label:
|
|
2221
|
-
value:
|
|
2220
|
+
label: 'Is',
|
|
2221
|
+
value: '='
|
|
2222
2222
|
},
|
|
2223
2223
|
{
|
|
2224
|
-
label:
|
|
2225
|
-
value:
|
|
2224
|
+
label: 'Is Not',
|
|
2225
|
+
value: '<>'
|
|
2226
2226
|
},
|
|
2227
2227
|
{
|
|
2228
|
-
label:
|
|
2229
|
-
value:
|
|
2228
|
+
label: 'Greater Than',
|
|
2229
|
+
value: '>'
|
|
2230
2230
|
},
|
|
2231
2231
|
{
|
|
2232
|
-
label:
|
|
2233
|
-
value:
|
|
2232
|
+
label: 'Less Than',
|
|
2233
|
+
value: '<'
|
|
2234
2234
|
}
|
|
2235
2235
|
];
|
|
2236
2236
|
default:
|
|
2237
2237
|
// These 2 should be safe for all data types
|
|
2238
2238
|
return [
|
|
2239
2239
|
{
|
|
2240
|
-
label:
|
|
2241
|
-
value:
|
|
2240
|
+
label: 'Is',
|
|
2241
|
+
value: '='
|
|
2242
2242
|
},
|
|
2243
2243
|
{
|
|
2244
|
-
label:
|
|
2245
|
-
value:
|
|
2244
|
+
label: 'Is Not',
|
|
2245
|
+
value: '<>'
|
|
2246
2246
|
}
|
|
2247
2247
|
];
|
|
2248
2248
|
}
|
|
@@ -2258,8 +2258,8 @@ function $7264a673914aa746$export$2b9377795161999(type) {
|
|
|
2258
2258
|
|
|
2259
2259
|
|
|
2260
2260
|
|
|
2261
|
-
const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: header, sortElement: sortElement,
|
|
2262
|
-
const [columnResizing, setColumnResizing] = (0, $hgUW1$useState)(
|
|
2261
|
+
const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: header, sortElement: sortElement, id: id })=>{
|
|
2262
|
+
const [columnResizing, setColumnResizing] = (0, $hgUW1$useState)('');
|
|
2263
2263
|
// Fix for JSX in Data Dictionary Title header cell
|
|
2264
2264
|
const ariaLabel = header.id === "titleResizable" ? "Title" : header.column.columnDef.header;
|
|
2265
2265
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("th", {
|
|
@@ -2268,9 +2268,9 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2268
2268
|
width: header.getSize()
|
|
2269
2269
|
},
|
|
2270
2270
|
id: id,
|
|
2271
|
-
title: typeof header.column.columnDef.header === "string" ? header.column.columnDef.header :
|
|
2271
|
+
title: typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : '',
|
|
2272
2272
|
className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
|
|
2273
|
-
"aria-sort": header.column.getIsSorted() ===
|
|
2273
|
+
"aria-sort": header.column.getIsSorted() === 'asc' ? 'ascending' : header.column.getIsSorted() === 'desc' ? 'descending' : 'none',
|
|
2274
2274
|
children: [
|
|
2275
2275
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2276
2276
|
className: "ds-u-display--flex",
|
|
@@ -2282,7 +2282,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2282
2282
|
}),
|
|
2283
2283
|
sortElement && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
2284
2284
|
onClick: header.column.getToggleSortingHandler(),
|
|
2285
|
-
className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` :
|
|
2285
|
+
className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : '',
|
|
2286
2286
|
"aria-label": `${ariaLabel} sort order`
|
|
2287
2287
|
})
|
|
2288
2288
|
]
|
|
@@ -2290,53 +2290,43 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2290
2290
|
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
2291
2291
|
onMouseDown: header.getResizeHandler(),
|
|
2292
2292
|
onTouchStart: header.getResizeHandler(),
|
|
2293
|
-
className: `dc-c-resize-handle ds-u-focus-visible ${header.column.getIsResizing() || header.column.id == columnResizing ?
|
|
2293
|
+
className: `dc-c-resize-handle ds-u-focus-visible ${header.column.getIsResizing() || header.column.id == columnResizing ? 'isResizing' : ''}`,
|
|
2294
2294
|
"aria-label": `Resize ${ariaLabel} column`,
|
|
2295
2295
|
onKeyDown: (e)=>{
|
|
2296
2296
|
const columnSizingObject = table.getState().columnSizing;
|
|
2297
2297
|
switch(e.key){
|
|
2298
|
-
case
|
|
2299
|
-
case
|
|
2298
|
+
case 'Enter':
|
|
2299
|
+
case ' ':
|
|
2300
2300
|
e.preventDefault();
|
|
2301
2301
|
e.stopPropagation();
|
|
2302
|
-
if (columnResizing)
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
} else {
|
|
2307
|
-
// start resizing
|
|
2308
|
-
setColumnResizing(header.column.id);
|
|
2309
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} grabbed.`);
|
|
2310
|
-
}
|
|
2302
|
+
if (columnResizing) // end resizing
|
|
2303
|
+
setColumnResizing('');
|
|
2304
|
+
else // start resizing
|
|
2305
|
+
setColumnResizing(header.column.id);
|
|
2311
2306
|
break;
|
|
2312
|
-
case
|
|
2313
|
-
if (columnResizing)
|
|
2314
|
-
setColumnResizing("");
|
|
2315
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} dropped.`);
|
|
2316
|
-
}
|
|
2307
|
+
case 'Escape':
|
|
2308
|
+
if (columnResizing) setColumnResizing('');
|
|
2317
2309
|
break;
|
|
2318
|
-
case
|
|
2310
|
+
case 'ArrowRight':
|
|
2319
2311
|
e.preventDefault();
|
|
2320
2312
|
e.stopPropagation();
|
|
2321
2313
|
if (columnResizing) {
|
|
2322
2314
|
columnSizingObject[header.column.id] = header.getSize() + 10;
|
|
2323
2315
|
table.setColumnSizing(columnSizingObject);
|
|
2324
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
|
|
2325
2316
|
}
|
|
2326
2317
|
break;
|
|
2327
|
-
case
|
|
2318
|
+
case 'ArrowLeft':
|
|
2328
2319
|
e.preventDefault();
|
|
2329
2320
|
e.stopPropagation();
|
|
2330
2321
|
if (columnResizing) {
|
|
2331
2322
|
columnSizingObject[header.column.id] = header.getSize() - 10;
|
|
2332
2323
|
table.setColumnSizing(columnSizingObject);
|
|
2333
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
|
|
2334
2324
|
}
|
|
2335
2325
|
break;
|
|
2336
2326
|
}
|
|
2337
2327
|
},
|
|
2338
2328
|
onBlur: ()=>{
|
|
2339
|
-
setColumnResizing(
|
|
2329
|
+
setColumnResizing('');
|
|
2340
2330
|
}
|
|
2341
2331
|
})
|
|
2342
2332
|
]
|
|
@@ -2345,7 +2335,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2345
2335
|
var $64a351d3fd8413c3$export$2e2bcd8739ae039 = $64a351d3fd8413c3$var$HeaderResizeElement;
|
|
2346
2336
|
|
|
2347
2337
|
|
|
2348
|
-
const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement = null
|
|
2338
|
+
const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement = null })=>{
|
|
2349
2339
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
|
|
2350
2340
|
className: "dc-thead--truncated dc-thead--resizeable",
|
|
2351
2341
|
children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
@@ -2353,8 +2343,7 @@ const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElem
|
|
|
2353
2343
|
children: headerGroup.headers.map((header)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
|
|
2354
2344
|
table: table,
|
|
2355
2345
|
header: header,
|
|
2356
|
-
sortElement: sortElement
|
|
2357
|
-
setAriaLiveFeedback: setAriaLiveFeedback
|
|
2346
|
+
sortElement: sortElement
|
|
2358
2347
|
}, header.id + "_dataTableResize"))
|
|
2359
2348
|
}, headerGroup.id))
|
|
2360
2349
|
});
|
|
@@ -2377,7 +2366,7 @@ const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table, sortElement: sortE
|
|
|
2377
2366
|
},
|
|
2378
2367
|
title: header.column.columnDef.header,
|
|
2379
2368
|
className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
|
|
2380
|
-
"aria-sort": header.column.getIsSorted() ===
|
|
2369
|
+
"aria-sort": header.column.getIsSorted() === 'asc' ? 'ascending' : header.column.getIsSorted() === 'desc' ? 'descending' : 'none',
|
|
2381
2370
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2382
2371
|
onClick: header.column.getToggleSortingHandler(),
|
|
2383
2372
|
className: "ds-u-display--flex",
|
|
@@ -2386,7 +2375,7 @@ const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table, sortElement: sortE
|
|
|
2386
2375
|
children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
|
|
2387
2376
|
}),
|
|
2388
2377
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2389
|
-
className: header.column.getCanSort() ? `cursor-pointer select-none ${sortElement(header.column.getIsSorted())}` :
|
|
2378
|
+
className: header.column.getCanSort() ? `cursor-pointer select-none ${sortElement(header.column.getIsSorted())}` : ''
|
|
2390
2379
|
})
|
|
2391
2380
|
]
|
|
2392
2381
|
})
|
|
@@ -2417,7 +2406,7 @@ const $ee0d4d4f34048447$var$DataTableActionsContextDefaults = {
|
|
|
2417
2406
|
setColumnVisibility: ()=>{},
|
|
2418
2407
|
page: 1,
|
|
2419
2408
|
setPage: ()=>{},
|
|
2420
|
-
tableDensity:
|
|
2409
|
+
tableDensity: 'normal',
|
|
2421
2410
|
setTableDensity: ()=>{}
|
|
2422
2411
|
};
|
|
2423
2412
|
const $ee0d4d4f34048447$export$f814ea079e65d8fe = /*#__PURE__*/ (0, $hgUW1$createContext)($ee0d4d4f34048447$var$DataTableActionsContextDefaults);
|
|
@@ -2436,7 +2425,7 @@ const $ee0d4d4f34048447$var$DataTableActionsProvider = ({ children: children })=
|
|
|
2436
2425
|
if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
|
|
2437
2426
|
else return {};
|
|
2438
2427
|
});
|
|
2439
|
-
const [tableDensity, setTableDensity] = (0, $hgUW1$useState)(
|
|
2428
|
+
const [tableDensity, setTableDensity] = (0, $hgUW1$useState)('normal');
|
|
2440
2429
|
const providerValue = {
|
|
2441
2430
|
columnOrder: columnOrder,
|
|
2442
2431
|
setColumnOrder: setColumnOrder,
|
|
@@ -2483,9 +2472,9 @@ const $5fe94aeb50e0798b$var$Card = ({ id: id, visible: visible, updateVisibility
|
|
|
2483
2472
|
transition: transition,
|
|
2484
2473
|
opacity: isDragging ? 0.7 : 1,
|
|
2485
2474
|
zIndex: isDragging ? 1 : 0,
|
|
2486
|
-
position:
|
|
2487
|
-
background:
|
|
2488
|
-
touchAction:
|
|
2475
|
+
position: 'relative',
|
|
2476
|
+
background: 'white',
|
|
2477
|
+
touchAction: 'none'
|
|
2489
2478
|
};
|
|
2490
2479
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
2491
2480
|
className: "ds-u-display--flex ds-u-justify-content--between ds-u-border-bottom--1",
|
|
@@ -2501,7 +2490,7 @@ const $5fe94aeb50e0798b$var$Card = ({ id: id, visible: visible, updateVisibility
|
|
|
2501
2490
|
// this code forces the repaint without user interaction
|
|
2502
2491
|
const target = e.target;
|
|
2503
2492
|
if (isDragging && target.tagName.toLowerCase() === "label") setTimeout(()=>{
|
|
2504
|
-
target.parentNode.querySelector(
|
|
2493
|
+
target.parentNode.querySelector('input').checked = visible;
|
|
2505
2494
|
}, 1);
|
|
2506
2495
|
},
|
|
2507
2496
|
children: [
|
|
@@ -2518,7 +2507,7 @@ const $5fe94aeb50e0798b$var$Card = ({ id: id, visible: visible, updateVisibility
|
|
|
2518
2507
|
}
|
|
2519
2508
|
}),
|
|
2520
2509
|
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
2521
|
-
className: `ds-l-col--2 dkan-manage-columns-reorder-button ${isDragging &&
|
|
2510
|
+
className: `ds-l-col--2 dkan-manage-columns-reorder-button ${isDragging && 'grabbed'}`,
|
|
2522
2511
|
"aria-label": `Reorder ${id} column`,
|
|
2523
2512
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2524
2513
|
className: "fa fa-sort"
|
|
@@ -2536,7 +2525,7 @@ class $5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor extends (0, $hgUW1$Key
|
|
|
2536
2525
|
// Custom function to exclude checkbox from keyboard dragging
|
|
2537
2526
|
static activators = [
|
|
2538
2527
|
{
|
|
2539
|
-
eventName:
|
|
2528
|
+
eventName: 'onKeyDown',
|
|
2540
2529
|
handler: ({ nativeEvent: event })=>{
|
|
2541
2530
|
// prevent scrolling the list
|
|
2542
2531
|
const isCheckbox = [
|
|
@@ -2559,7 +2548,7 @@ class $5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor extends (0, $hgUW1$Poin
|
|
|
2559
2548
|
// Custom function to stop accidental checkbox clicks on pointer activation
|
|
2560
2549
|
static activators = [
|
|
2561
2550
|
{
|
|
2562
|
-
eventName:
|
|
2551
|
+
eventName: 'onPointerDown',
|
|
2563
2552
|
handler: ({ nativeEvent: event })=>{
|
|
2564
2553
|
if (event.target.tagName.toLowerCase() === "input") return false;
|
|
2565
2554
|
if (event.target.tagName.toLowerCase() === "label") event.target.blur();
|
|
@@ -2657,13 +2646,13 @@ const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, default
|
|
|
2657
2646
|
className: "dkan-dataset-toolbar-button-label",
|
|
2658
2647
|
children: "Manage Columns"
|
|
2659
2648
|
}),
|
|
2660
|
-
hiddenColumns ? ` (${hiddenColumns})` :
|
|
2649
|
+
hiddenColumns ? ` (${hiddenColumns})` : ''
|
|
2661
2650
|
]
|
|
2662
2651
|
})
|
|
2663
2652
|
]
|
|
2664
2653
|
}),
|
|
2665
2654
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2666
|
-
className: `ds-c-dialog-wrap${modalOpen ?
|
|
2655
|
+
className: `ds-c-dialog-wrap${modalOpen ? ' open' : ''}`,
|
|
2667
2656
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
|
|
2668
2657
|
heading: "Manage columns",
|
|
2669
2658
|
isOpen: modalOpen,
|
|
@@ -2836,12 +2825,12 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopy
|
|
|
2836
2825
|
if (Object.keys(resource).length && columns.length && resource.schema && Object.keys(distribution).length) return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
2837
2826
|
children: [
|
|
2838
2827
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2839
|
-
className: isModal ?
|
|
2828
|
+
className: isModal ? 'dkan-datatable-fullscreen-mode' : '',
|
|
2840
2829
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
|
|
2841
2830
|
canResize: true,
|
|
2842
2831
|
columns: columns,
|
|
2843
2832
|
sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
|
|
2844
|
-
tablePadding: tableDensity ===
|
|
2833
|
+
tablePadding: tableDensity === 'normal' ? 'ds-u-padding-y--2' : tableDensity === 'compact' ? 'ds-u-padding-y--1' : 'ds-u-padding-y--3',
|
|
2845
2834
|
loading: resource.loading,
|
|
2846
2835
|
isModal: isModal,
|
|
2847
2836
|
downloadURL: downloadURL,
|
|
@@ -2856,14 +2845,14 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopy
|
|
|
2856
2845
|
}),
|
|
2857
2846
|
!resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2858
2847
|
className: [
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
isModal &&
|
|
2866
|
-
].filter(Boolean).join(
|
|
2848
|
+
'ds-u-display--flex',
|
|
2849
|
+
'ds-u-flex-wrap--wrap',
|
|
2850
|
+
'ds-u-justify-content--end',
|
|
2851
|
+
'ds-u-md-justify-content--between',
|
|
2852
|
+
'ds-u-margin-top--2',
|
|
2853
|
+
'ds-u-align-items--center',
|
|
2854
|
+
isModal && 'ds-u-margin-bottom--2'
|
|
2855
|
+
].filter(Boolean).join(' '),
|
|
2867
2856
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
|
|
2868
2857
|
totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
|
|
2869
2858
|
currentPage: Number(page),
|
|
@@ -2902,7 +2891,7 @@ const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal })=>{
|
|
|
2902
2891
|
},
|
|
2903
2892
|
children: [
|
|
2904
2893
|
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2905
|
-
className: `far ${modalOpen ?
|
|
2894
|
+
className: `far ${modalOpen ? 'fa-compress' : 'fa-expand'} ds-u-margin-right--1`
|
|
2906
2895
|
}),
|
|
2907
2896
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2908
2897
|
className: "dkan-dataset-toolbar-button-label",
|
|
@@ -2911,7 +2900,7 @@ const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal })=>{
|
|
|
2911
2900
|
]
|
|
2912
2901
|
}),
|
|
2913
2902
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2914
|
-
className: `ds-c-dialog-wrap${modalOpen ?
|
|
2903
|
+
className: `ds-c-dialog-wrap${modalOpen ? ' open' : ''}`,
|
|
2915
2904
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
|
|
2916
2905
|
heading: "Dataset Explorer",
|
|
2917
2906
|
isOpen: modalOpen,
|
|
@@ -2946,13 +2935,13 @@ var $16bd41951b91f02d$export$2e2bcd8739ae039 = $16bd41951b91f02d$var$FullScreenD
|
|
|
2946
2935
|
|
|
2947
2936
|
|
|
2948
2937
|
function $eadd6431fddf4b6c$var$getStartDate(condition, schema, id) {
|
|
2949
|
-
if (schema[id].fields[condition.property].mysql_type ===
|
|
2938
|
+
if (schema[id].fields[condition.property].mysql_type === 'date') {
|
|
2950
2939
|
const newDate = new Date(condition.value.toString());
|
|
2951
2940
|
if (newDate instanceof Date && !isNaN(newDate.getTime())) return newDate;
|
|
2952
2941
|
}
|
|
2953
2942
|
return new Date();
|
|
2954
2943
|
}
|
|
2955
|
-
const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema, className: className =
|
|
2944
|
+
const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema, className: className = '' })=>{
|
|
2956
2945
|
const [operator, setOperator] = (0, $hgUW1$useState)(condition.operator);
|
|
2957
2946
|
const [property, setProperty] = (0, $hgUW1$useState)(condition.property);
|
|
2958
2947
|
const [value, setValue] = (0, $hgUW1$useState)(condition.value);
|
|
@@ -2962,9 +2951,9 @@ const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index:
|
|
|
2962
2951
|
});
|
|
2963
2952
|
(0, $hgUW1$useEffect)(()=>{
|
|
2964
2953
|
if (property !== condition.property) {
|
|
2965
|
-
if (property) update(index,
|
|
2966
|
-
else update(index,
|
|
2967
|
-
if (schema[id].fields[condition.property].mysql_type ===
|
|
2954
|
+
if (property) update(index, 'property', property);
|
|
2955
|
+
else update(index, 'property', '');
|
|
2956
|
+
if (schema[id].fields[condition.property].mysql_type === 'date') {
|
|
2968
2957
|
if (!value) setValue(startDate.toJSON().slice(0, 10));
|
|
2969
2958
|
}
|
|
2970
2959
|
}
|
|
@@ -2978,22 +2967,22 @@ const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index:
|
|
|
2978
2967
|
]);
|
|
2979
2968
|
(0, $hgUW1$useEffect)(()=>{
|
|
2980
2969
|
if (operator !== condition.operator) {
|
|
2981
|
-
if (operator) update(index,
|
|
2982
|
-
else update(index,
|
|
2970
|
+
if (operator) update(index, 'operator', operator);
|
|
2971
|
+
else update(index, 'operator', '');
|
|
2983
2972
|
}
|
|
2984
2973
|
}, [
|
|
2985
2974
|
operator
|
|
2986
2975
|
]);
|
|
2987
2976
|
(0, $hgUW1$useEffect)(()=>{
|
|
2988
2977
|
if (value !== condition.value) {
|
|
2989
|
-
if (value) update(index,
|
|
2990
|
-
else update(index,
|
|
2978
|
+
if (value) update(index, 'value', value);
|
|
2979
|
+
else update(index, 'value', '');
|
|
2991
2980
|
}
|
|
2992
2981
|
}, [
|
|
2993
2982
|
value
|
|
2994
2983
|
]);
|
|
2995
2984
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("fieldset", {
|
|
2996
|
-
className: `dkan-filter-dataset-control ds-u-padding-x--2 ds-u-md-padding-x--3 ds-u-padding-y--1 ds-u-margin-top--05${className !==
|
|
2985
|
+
className: `dkan-filter-dataset-control ds-u-padding-x--2 ds-u-md-padding-x--3 ds-u-padding-y--1 ds-u-margin-top--05${className !== '' ? ` ${className}` : ''}`,
|
|
2997
2986
|
children: [
|
|
2998
2987
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
2999
2988
|
options: propertyOptions,
|
|
@@ -3011,7 +3000,7 @@ const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index:
|
|
|
3011
3000
|
name: `${condition.key}_operator`,
|
|
3012
3001
|
onChange: (e)=>setOperator(e.target.value)
|
|
3013
3002
|
}),
|
|
3014
|
-
schema[id].fields[property].mysql_type ===
|
|
3003
|
+
schema[id].fields[property].mysql_type === 'date' ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3015
3004
|
children: [
|
|
3016
3005
|
/*#__PURE__*/ (0, $hgUW1$jsx)("label", {
|
|
3017
3006
|
className: "ds-c-label",
|
|
@@ -3064,15 +3053,15 @@ var $eadd6431fddf4b6c$export$2e2bcd8739ae039 = $eadd6431fddf4b6c$var$FilterItem;
|
|
|
3064
3053
|
|
|
3065
3054
|
|
|
3066
3055
|
|
|
3067
|
-
const $2eec38d4d0dbf714$var$ClearFiltersButton = ({ disabled: disabled = false, clearFiltersFn: clearFiltersFn, disableDefaultClasses: disableDefaultClasses = false, className: className =
|
|
3056
|
+
const $2eec38d4d0dbf714$var$ClearFiltersButton = ({ disabled: disabled = false, clearFiltersFn: clearFiltersFn, disableDefaultClasses: disableDefaultClasses = false, className: className = '' })=>{
|
|
3068
3057
|
const small = (0, $hgUW1$useMediaQuery)({
|
|
3069
3058
|
minWidth: 0,
|
|
3070
3059
|
maxWidth: 544
|
|
3071
3060
|
});
|
|
3072
3061
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3073
3062
|
disabled: disabled,
|
|
3074
|
-
className: `dkan-clear-dataset-filters-button ${disableDefaultClasses ?
|
|
3075
|
-
variation: small ?
|
|
3063
|
+
className: `dkan-clear-dataset-filters-button ${disableDefaultClasses ? '' : ' ds-u-float--right ds-l-md-col--6 ds-l-col--5'}${className !== '' ? ` ${className}` : ''}`,
|
|
3064
|
+
variation: small ? 'ghost' : undefined,
|
|
3076
3065
|
onClick: ()=>clearFiltersFn(),
|
|
3077
3066
|
children: "Reset"
|
|
3078
3067
|
});
|
|
@@ -3084,19 +3073,19 @@ var $2eec38d4d0dbf714$export$2e2bcd8739ae039 = $2eec38d4d0dbf714$var$ClearFilter
|
|
|
3084
3073
|
function $6f4318b1e14124e5$var$updateQueryForDatastore(condition) {
|
|
3085
3074
|
let cond = condition;
|
|
3086
3075
|
delete cond.key;
|
|
3087
|
-
if (cond.operator ===
|
|
3076
|
+
if (cond.operator === '=' || cond.operator === '<>') {
|
|
3088
3077
|
if (Array.isArray(cond.value)) cond.value = cond.value.join();
|
|
3089
|
-
cond.value = cond.value.replace(/(^\%+|\%+$)/gm,
|
|
3078
|
+
cond.value = cond.value.replace(/(^\%+|\%+$)/gm, '');
|
|
3090
3079
|
}
|
|
3091
|
-
if (cond.operator.toLowerCase() ===
|
|
3080
|
+
if (cond.operator.toLowerCase() === 'like') {
|
|
3092
3081
|
if (Array.isArray(cond.value)) cond.value = cond.value.join();
|
|
3093
|
-
const cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm,
|
|
3082
|
+
const cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm, '');
|
|
3094
3083
|
cond.value = `%${cleanedValue}%`;
|
|
3095
3084
|
}
|
|
3096
|
-
if (cond.operator.toLowerCase() ===
|
|
3097
|
-
if (!Array.isArray(cond.value)) cond.value = cond.value.split(
|
|
3085
|
+
if (cond.operator.toLowerCase() === 'in') {
|
|
3086
|
+
if (!Array.isArray(cond.value)) cond.value = cond.value.split(',');
|
|
3098
3087
|
}
|
|
3099
|
-
if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm,
|
|
3088
|
+
if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ''));
|
|
3100
3089
|
return cond;
|
|
3101
3090
|
}
|
|
3102
3091
|
const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
@@ -3122,7 +3111,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
|
3122
3111
|
} else setQueryConditions([
|
|
3123
3112
|
{
|
|
3124
3113
|
property: fields[0],
|
|
3125
|
-
value:
|
|
3114
|
+
value: '',
|
|
3126
3115
|
operator: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[fields[0]].mysql_type)[0].value,
|
|
3127
3116
|
key: Date.now().toString()
|
|
3128
3117
|
}
|
|
@@ -3139,7 +3128,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
|
3139
3128
|
...queryConditions,
|
|
3140
3129
|
{
|
|
3141
3130
|
property: fields[0],
|
|
3142
|
-
value:
|
|
3131
|
+
value: '',
|
|
3143
3132
|
operator: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[fields[0]].mysql_type)[0].value,
|
|
3144
3133
|
key: Date.now().toString()
|
|
3145
3134
|
}
|
|
@@ -3170,7 +3159,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
|
3170
3159
|
encodeValuesOnly: true,
|
|
3171
3160
|
addQueryPrefix: true
|
|
3172
3161
|
});
|
|
3173
|
-
window.history.pushState({},
|
|
3162
|
+
window.history.pushState({}, '', `${url.origin}${url.pathname}${urlString}`);
|
|
3174
3163
|
};
|
|
3175
3164
|
const submitConditions = ()=>{
|
|
3176
3165
|
// only update the data conditions when "Apply filters" is pressed
|
|
@@ -3244,7 +3233,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
|
3244
3233
|
children: [
|
|
3245
3234
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
3246
3235
|
className: "dkan-dataset-toolbar-button-label",
|
|
3247
|
-
children: conditions.length > 0 ? `Edit Filters` :
|
|
3236
|
+
children: conditions.length > 0 ? `Edit Filters` : 'Filter Dataset'
|
|
3248
3237
|
}),
|
|
3249
3238
|
conditions.length > 0 && ` (${conditions.length})`
|
|
3250
3239
|
]
|
|
@@ -3252,7 +3241,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
|
3252
3241
|
]
|
|
3253
3242
|
}),
|
|
3254
3243
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3255
|
-
className: `ds-c-dialog-wrap${modalOpen ?
|
|
3244
|
+
className: `ds-c-dialog-wrap${modalOpen ? ' open' : ''}`,
|
|
3256
3245
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
|
|
3257
3246
|
heading: "Filter Dataset",
|
|
3258
3247
|
isOpen: modalOpen,
|
|
@@ -3278,7 +3267,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
|
|
|
3278
3267
|
className: "dkan-apply-dataset-filters-button ds-u-float--right ds-l-md-col--auto ds-l-col--auto",
|
|
3279
3268
|
onClick: submitConditions,
|
|
3280
3269
|
variation: "solid",
|
|
3281
|
-
children: `Apply ${conditionsReadyToSubmit(queryConditions).length ||
|
|
3270
|
+
children: `Apply ${conditionsReadyToSubmit(queryConditions).length || ''} filter${conditionsReadyToSubmit(queryConditions).length === 1 ? '' : 's'}`
|
|
3282
3271
|
})
|
|
3283
3272
|
]
|
|
3284
3273
|
})
|
|
@@ -3417,9 +3406,9 @@ const $dae856e97a09bcd6$var$DisplaySettings = ()=>{
|
|
|
3417
3406
|
className: "ds-u-display--flex ds-u-align-items--start",
|
|
3418
3407
|
children: [
|
|
3419
3408
|
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
3420
|
-
onClick: ()=>setTableDensity(
|
|
3409
|
+
onClick: ()=>setTableDensity('expanded'),
|
|
3421
3410
|
"aria-label": "Row height, Expanded",
|
|
3422
|
-
className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity ===
|
|
3411
|
+
className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity === 'expanded' ? 'active ds-u-fill--primary-lightest' : ''}`,
|
|
3423
3412
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3424
3413
|
className: "ds-u-display--block",
|
|
3425
3414
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
|
|
@@ -3438,9 +3427,9 @@ const $dae856e97a09bcd6$var$DisplaySettings = ()=>{
|
|
|
3438
3427
|
})
|
|
3439
3428
|
}),
|
|
3440
3429
|
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
3441
|
-
onClick: ()=>setTableDensity(
|
|
3430
|
+
onClick: ()=>setTableDensity('normal'),
|
|
3442
3431
|
"aria-label": "Row height, Normal",
|
|
3443
|
-
className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity ===
|
|
3432
|
+
className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity === 'normal' ? 'active ds-u-fill--primary-lightest' : ''}`,
|
|
3444
3433
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3445
3434
|
className: "ds-u-display--block",
|
|
3446
3435
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
|
|
@@ -3459,9 +3448,9 @@ const $dae856e97a09bcd6$var$DisplaySettings = ()=>{
|
|
|
3459
3448
|
})
|
|
3460
3449
|
}),
|
|
3461
3450
|
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
3462
|
-
onClick: ()=>setTableDensity(
|
|
3451
|
+
onClick: ()=>setTableDensity('compact'),
|
|
3463
3452
|
"aria-label": "Row height, Compact",
|
|
3464
|
-
className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity ===
|
|
3453
|
+
className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity === 'compact' ? 'active ds-u-fill--primary-lightest ' : ''}`,
|
|
3465
3454
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3466
3455
|
className: "ds-u-display--block",
|
|
3467
3456
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
|
|
@@ -3546,7 +3535,7 @@ const $85f8ff1ff89899c7$var$updateBrowserURL = (newConditions)=>{
|
|
|
3546
3535
|
encodeValuesOnly: true,
|
|
3547
3536
|
addQueryPrefix: true
|
|
3548
3537
|
});
|
|
3549
|
-
window.history.pushState({},
|
|
3538
|
+
window.history.pushState({}, '', `${url.origin}${url.pathname}${urlString}`);
|
|
3550
3539
|
};
|
|
3551
3540
|
const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, isModal: isModal, datasetTableControls: datasetTableControls, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility })=>{
|
|
3552
3541
|
const { limit: limit, offset: offset, count: count, conditions: conditions, setConditions: setConditions } = resource;
|
|
@@ -3632,7 +3621,7 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
3632
3621
|
}, index)) : null,
|
|
3633
3622
|
hiddenColumns > 0 ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c5b172e8d1a8197c$export$2e2bcd8739ae039), {
|
|
3634
3623
|
iconClass: "fa fa-columns",
|
|
3635
|
-
text: `${hiddenColumns} Column${hiddenColumns === 1 ?
|
|
3624
|
+
text: `${hiddenColumns} Column${hiddenColumns === 1 ? '' : 's'} Hidden`,
|
|
3636
3625
|
onClick: ()=>{
|
|
3637
3626
|
resetColumnVisibility();
|
|
3638
3627
|
}
|
|
@@ -3667,7 +3656,6 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3667
3656
|
const { conditions: conditions } = resource;
|
|
3668
3657
|
const data = resource.values;
|
|
3669
3658
|
const [sorting, setSorting] = (0, $hgUW1$useState)([]);
|
|
3670
|
-
const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
|
|
3671
3659
|
const dataTableWrapperElement = (0, $hgUW1$useRef)(null);
|
|
3672
3660
|
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
3673
3661
|
const table_columns = columns.map((col)=>{
|
|
@@ -3686,9 +3674,9 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3686
3674
|
columnOrder
|
|
3687
3675
|
]);
|
|
3688
3676
|
const sortElement = (isSorted, onClickFn)=>{
|
|
3689
|
-
if (isSorted ===
|
|
3690
|
-
if (isSorted ===
|
|
3691
|
-
return
|
|
3677
|
+
if (isSorted === 'asc') return 'dc-c-sort--asc';
|
|
3678
|
+
if (isSorted === 'desc') return 'dc-c-sort--desc';
|
|
3679
|
+
return 'dc-c-sort--default';
|
|
3692
3680
|
};
|
|
3693
3681
|
const filters = [];
|
|
3694
3682
|
const table = (0, $hgUW1$useReactTable)({
|
|
@@ -3700,7 +3688,7 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3700
3688
|
columnVisibility: columnVisibility,
|
|
3701
3689
|
sorting: sorting
|
|
3702
3690
|
},
|
|
3703
|
-
columnResizeMode:
|
|
3691
|
+
columnResizeMode: 'onChange',
|
|
3704
3692
|
onSortingChange: setSorting,
|
|
3705
3693
|
onColumnOrderChange: setColumnOrder,
|
|
3706
3694
|
onColumnVisibilityChange: setColumnVisibility,
|
|
@@ -3717,7 +3705,7 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3717
3705
|
const defaultColumnOrder = (0, $hgUW1$useMemo)(()=>table_columns.map((column)=>column.accessorKey), []);
|
|
3718
3706
|
const tableWrapperWidth = ()=>{
|
|
3719
3707
|
if (dataTableWrapperElement.current) return dataTableWrapperElement.current.offsetWidth;
|
|
3720
|
-
return
|
|
3708
|
+
return 'auto';
|
|
3721
3709
|
};
|
|
3722
3710
|
(0, $hgUW1$useEffect)(()=>{
|
|
3723
3711
|
setHighlightRow(null);
|
|
@@ -3863,57 +3851,48 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3863
3851
|
})
|
|
3864
3852
|
]
|
|
3865
3853
|
}),
|
|
3866
|
-
/*#__PURE__*/ (0, $hgUW1$
|
|
3854
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3867
3855
|
className: "dc-c-datatable-wrapper ds-u-border-x--1 ds-u-border-bottom--1",
|
|
3868
3856
|
tabIndex: 0,
|
|
3869
3857
|
ref: dataTableWrapperElement,
|
|
3870
|
-
children:
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
})
|
|
3905
|
-
}, row.id);
|
|
3906
|
-
})
|
|
3858
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("table", {
|
|
3859
|
+
style: {
|
|
3860
|
+
width: canResize ? table.getCenterTotalSize() : "100%",
|
|
3861
|
+
minWidth: tableWrapperWidth()
|
|
3862
|
+
},
|
|
3863
|
+
className: "dc-c-datatable",
|
|
3864
|
+
children: [
|
|
3865
|
+
canResize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $96d341d082bffec5$export$2e2bcd8739ae039), {
|
|
3866
|
+
table: table,
|
|
3867
|
+
sortElement: sortElement
|
|
3868
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $23763e27eda0e8d7$export$2e2bcd8739ae039), {
|
|
3869
|
+
table: table,
|
|
3870
|
+
sortElement: sortElement
|
|
3871
|
+
}),
|
|
3872
|
+
loading ? /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {}) : /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {
|
|
3873
|
+
children: table.getRowModel().rows.map((row, index)=>{
|
|
3874
|
+
const even = (index + 1) % 2 === 0;
|
|
3875
|
+
const highlight = highlightRow === row.id;
|
|
3876
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
3877
|
+
className: `${highlight ? "dc-c-datatable--highlight-row" : even && "dc-c-datatable--even-row"}`,
|
|
3878
|
+
onClick: ()=>setHighlightRow(row.id),
|
|
3879
|
+
children: row.getVisibleCells().map((cell)=>{
|
|
3880
|
+
let classList = "dc-truncate ds-u-padding-x--1";
|
|
3881
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("td", {
|
|
3882
|
+
key: cell.id,
|
|
3883
|
+
style: {
|
|
3884
|
+
maxWidth: cell.column.getSize()
|
|
3885
|
+
},
|
|
3886
|
+
className: `${classList} ${tablePadding}`,
|
|
3887
|
+
title: cell.getValue(),
|
|
3888
|
+
children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
3889
|
+
});
|
|
3890
|
+
})
|
|
3891
|
+
}, row.id);
|
|
3907
3892
|
})
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
className: "sr-only",
|
|
3912
|
-
"aria-live": "assertive",
|
|
3913
|
-
"aria-atomic": "true",
|
|
3914
|
-
children: ariaLiveFeedback
|
|
3915
|
-
})
|
|
3916
|
-
]
|
|
3893
|
+
})
|
|
3894
|
+
]
|
|
3895
|
+
})
|
|
3917
3896
|
}),
|
|
3918
3897
|
loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
3919
3898
|
"aria-valuetext": "Dataset loading",
|
|
@@ -3947,7 +3926,7 @@ function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header, a
|
|
|
3947
3926
|
},
|
|
3948
3927
|
labelClassName: "ds-u-visibility--screen-reader",
|
|
3949
3928
|
name: accessor,
|
|
3950
|
-
value: filterValue ||
|
|
3929
|
+
value: filterValue || ''
|
|
3951
3930
|
});
|
|
3952
3931
|
}
|
|
3953
3932
|
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, canResize: canResize = true })=>{
|
|
@@ -4023,7 +4002,7 @@ const $ec3e23baa005dc03$var$Breadcrumb = ({ currentPage: currentPage, pageTrail:
|
|
|
4023
4002
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4024
4003
|
children: currentPage
|
|
4025
4004
|
})
|
|
4026
|
-
}) :
|
|
4005
|
+
}) : ''
|
|
4027
4006
|
]
|
|
4028
4007
|
})
|
|
4029
4008
|
});
|
|
@@ -4080,11 +4059,11 @@ var $10acbeaa4d8f6040$export$2e2bcd8739ae039 = $10acbeaa4d8f6040$var$ChevronRigh
|
|
|
4080
4059
|
|
|
4081
4060
|
|
|
4082
4061
|
|
|
4083
|
-
const $bdb071ea3a6d3466$var$SearchInput = ({ placeholder: placeholder =
|
|
4062
|
+
const $bdb071ea3a6d3466$var$SearchInput = ({ placeholder: placeholder = 'Search the Data', showMagnifyingGlass: showMagnifyingGlass, showSearchButton: showSearchButton, onDark: onDark, onChange: onChange, onSubmit: onSubmit, onKeyDown: onKeyDown, defaultValue: defaultValue = '' })=>/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4084
4063
|
className: "search-input-container",
|
|
4085
4064
|
children: [
|
|
4086
4065
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
|
|
4087
|
-
className: `${showMagnifyingGlass ?
|
|
4066
|
+
className: `${showMagnifyingGlass ? 'left-padding' : ''} ${showSearchButton ? 'right-padding' : ''}`,
|
|
4088
4067
|
label: placeholder,
|
|
4089
4068
|
labelClassName: "ds-u-visibility--screen-reader",
|
|
4090
4069
|
placeholder: placeholder,
|
|
@@ -4099,7 +4078,7 @@ const $bdb071ea3a6d3466$var$SearchInput = ({ placeholder: placeholder = "Search
|
|
|
4099
4078
|
}),
|
|
4100
4079
|
showSearchButton && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
|
|
4101
4080
|
variation: "solid",
|
|
4102
|
-
className: onDark &&
|
|
4081
|
+
className: onDark && 'on-dark',
|
|
4103
4082
|
onClick: onSubmit,
|
|
4104
4083
|
children: [
|
|
4105
4084
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
@@ -4218,7 +4197,7 @@ const $c96c4b9ef7203c1f$var$APIPage = ({ hideAuth: hideAuth = true, rootUrl: roo
|
|
|
4218
4197
|
url: `${rootUrl}${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
|
|
4219
4198
|
addQueryPrefix: true
|
|
4220
4199
|
})}`,
|
|
4221
|
-
docExpansion:
|
|
4200
|
+
docExpansion: 'list',
|
|
4222
4201
|
defaultModelsExpandDepth: -1,
|
|
4223
4202
|
plugins: [
|
|
4224
4203
|
(0, $hgUW1$SpanOpenAPIVersion),
|
|
@@ -4326,7 +4305,7 @@ const $0a551147dc92a718$var$SearchButton = (props)=>{
|
|
|
4326
4305
|
size: "big",
|
|
4327
4306
|
type: "submit",
|
|
4328
4307
|
style: {
|
|
4329
|
-
width:
|
|
4308
|
+
width: '70px'
|
|
4330
4309
|
},
|
|
4331
4310
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4332
4311
|
className: "fas fa-search small-text"
|
|
@@ -4343,7 +4322,7 @@ const $0a551147dc92a718$var$SearchButton = (props)=>{
|
|
|
4343
4322
|
className: "full-text ds-u-display--none ds-u-sm-display--inline-block ds-u-display--flex ds-u-align-items--center",
|
|
4344
4323
|
children: [
|
|
4345
4324
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4346
|
-
children: text ? text :
|
|
4325
|
+
children: text ? text : 'Search'
|
|
4347
4326
|
}),
|
|
4348
4327
|
` `,
|
|
4349
4328
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
@@ -4428,12 +4407,12 @@ async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, ACA)
|
|
|
4428
4407
|
fulltext: fulltext ? fulltext : undefined,
|
|
4429
4408
|
...selectedFacets,
|
|
4430
4409
|
sort: sort ? sort : undefined,
|
|
4431
|
-
[
|
|
4410
|
+
['sort-order']: sortOrder ? sortOrder : undefined,
|
|
4432
4411
|
page: page !== 1 ? page : undefined,
|
|
4433
|
-
[
|
|
4412
|
+
['page-size']: pageSize !== 10 ? pageSize : undefined
|
|
4434
4413
|
};
|
|
4435
4414
|
return await (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
|
|
4436
|
-
arrayFormat:
|
|
4415
|
+
arrayFormat: 'comma',
|
|
4437
4416
|
encode: false
|
|
4438
4417
|
})}`);
|
|
4439
4418
|
}
|
|
@@ -4444,26 +4423,26 @@ async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, ACA)
|
|
|
4444
4423
|
|
|
4445
4424
|
const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
4446
4425
|
const { rootUrl: rootUrl, enableSort: enableSort = true, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort = {
|
|
4447
|
-
defaultSort:
|
|
4448
|
-
defaultOrder:
|
|
4449
|
-
}, pageTitle: pageTitle =
|
|
4426
|
+
defaultSort: 'modified',
|
|
4427
|
+
defaultOrder: 'desc'
|
|
4428
|
+
}, pageTitle: pageTitle = 'Dataset Explorer', filterTitle: filterTitle = 'Tags', showLargeFileWarning: showLargeFileWarning = false, largeFileThemes: largeFileThemes, introText: introText = '', showDownloadIcon: showDownloadIcon = false, altMobileSearchButton: altMobileSearchButton, dataDictionaryLinks: dataDictionaryLinks = false } = props;
|
|
4450
4429
|
const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
|
|
4451
4430
|
const sortOptions = [
|
|
4452
4431
|
{
|
|
4453
|
-
label:
|
|
4454
|
-
value:
|
|
4432
|
+
label: 'Newest',
|
|
4433
|
+
value: 'newest'
|
|
4455
4434
|
},
|
|
4456
4435
|
{
|
|
4457
|
-
label:
|
|
4458
|
-
value:
|
|
4436
|
+
label: 'Oldest',
|
|
4437
|
+
value: 'oldest'
|
|
4459
4438
|
},
|
|
4460
4439
|
{
|
|
4461
|
-
label:
|
|
4462
|
-
value:
|
|
4440
|
+
label: 'Title A-Z',
|
|
4441
|
+
value: 'titleAZ'
|
|
4463
4442
|
},
|
|
4464
4443
|
{
|
|
4465
|
-
label:
|
|
4466
|
-
value:
|
|
4444
|
+
label: 'Title Z-A',
|
|
4445
|
+
value: 'titleZA'
|
|
4467
4446
|
}
|
|
4468
4447
|
];
|
|
4469
4448
|
const defaultSortBy = "";
|
|
@@ -4482,7 +4461,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4482
4461
|
endingNumber: 0
|
|
4483
4462
|
});
|
|
4484
4463
|
const [noResults, setNoResults] = (0, $hgUW1$useState)(false);
|
|
4485
|
-
const [announcementText, setAnnouncementText] = (0, $hgUW1$useState)(
|
|
4464
|
+
const [announcementText, setAnnouncementText] = (0, $hgUW1$useState)('');
|
|
4486
4465
|
let [searchParams, setSearchParams] = (0, $hgUW1$useSearchParams)();
|
|
4487
4466
|
const [fulltext, setFullText] = (0, $hgUW1$useState)(transformedParams.fulltext);
|
|
4488
4467
|
const [filterText, setFilterText] = (0, $hgUW1$useState)(transformedParams.fulltext);
|
|
@@ -4491,7 +4470,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4491
4470
|
const [sort, setSort] = (0, $hgUW1$useState)(transformedParams.sort ? transformedParams.sort : defaultSort ? defaultSort.defaultSort : defaultSortBy);
|
|
4492
4471
|
const [sortOrder, setSortOrder] = (0, $hgUW1$useState)(transformedParams.sortOrder ? transformedParams.sortOrder : defaultSort ? defaultSort.defaultOrder : defaultSortOrder);
|
|
4493
4472
|
const [sortDisplay, setSortDisplay] = (0, $hgUW1$useState)(()=>{
|
|
4494
|
-
return sort ===
|
|
4473
|
+
return sort === 'modified' ? sortOrder === 'desc' ? 'newest' : 'oldest' : sortOrder === 'desc' ? 'titleZA' : 'titleAZ';
|
|
4495
4474
|
});
|
|
4496
4475
|
const [selectedFacets, setSelectedFacets] = (0, $hgUW1$useState)(transformedParams.selectedFacets ? transformedParams.selectedFacets : {
|
|
4497
4476
|
theme: [],
|
|
@@ -4500,21 +4479,21 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4500
4479
|
const setSortOptions = (value)=>{
|
|
4501
4480
|
setSortDisplay(value);
|
|
4502
4481
|
switch(value){
|
|
4503
|
-
case
|
|
4504
|
-
setSort(
|
|
4505
|
-
setSortOrder(
|
|
4482
|
+
case 'newest':
|
|
4483
|
+
setSort('modified');
|
|
4484
|
+
setSortOrder('desc');
|
|
4506
4485
|
break;
|
|
4507
|
-
case
|
|
4508
|
-
setSort(
|
|
4509
|
-
setSortOrder(
|
|
4486
|
+
case 'oldest':
|
|
4487
|
+
setSort('modified');
|
|
4488
|
+
setSortOrder('asc');
|
|
4510
4489
|
break;
|
|
4511
|
-
case
|
|
4512
|
-
setSort(
|
|
4513
|
-
setSortOrder(
|
|
4490
|
+
case 'titleAZ':
|
|
4491
|
+
setSort('title');
|
|
4492
|
+
setSortOrder('asc');
|
|
4514
4493
|
break;
|
|
4515
|
-
case
|
|
4516
|
-
setSort(
|
|
4517
|
-
setSortOrder(
|
|
4494
|
+
case 'titleZA':
|
|
4495
|
+
setSort('title');
|
|
4496
|
+
setSortOrder('desc');
|
|
4518
4497
|
break;
|
|
4519
4498
|
}
|
|
4520
4499
|
};
|
|
@@ -4522,12 +4501,12 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4522
4501
|
const newFacets = {
|
|
4523
4502
|
...selectedFacets
|
|
4524
4503
|
};
|
|
4525
|
-
if (key ===
|
|
4504
|
+
if (key === 'theme') {
|
|
4526
4505
|
const existingFacet = newFacets.theme.findIndex((s)=>s === value);
|
|
4527
4506
|
if (existingFacet > -1) newFacets.theme.splice(existingFacet, 1);
|
|
4528
4507
|
else newFacets.theme.push(value);
|
|
4529
4508
|
}
|
|
4530
|
-
if (key ===
|
|
4509
|
+
if (key === 'keyword') {
|
|
4531
4510
|
const existingFacet = newFacets.keyword.findIndex((s)=>s === value);
|
|
4532
4511
|
if (existingFacet > -1) newFacets.keyword.splice(existingFacet, 1);
|
|
4533
4512
|
else newFacets.keyword.push(value);
|
|
@@ -4541,59 +4520,23 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4541
4520
|
});
|
|
4542
4521
|
setSelectedFacets(newFacets);
|
|
4543
4522
|
const url = new URL(window.location.href);
|
|
4544
|
-
window.history.pushState({},
|
|
4523
|
+
window.history.pushState({}, '', `${url.origin}${url.pathname}${urlString}`);
|
|
4545
4524
|
}
|
|
4546
4525
|
const pageSize = defaultPageSize;
|
|
4547
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4548
|
-
const baseNumber = Number(totalItems) > 0 ? 1 : 0;
|
|
4549
|
-
const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
|
|
4550
|
-
const endingNumber = Number(pageSize) * Number(page);
|
|
4551
|
-
setCurrentResultNumbers({
|
|
4552
|
-
total: Number(totalItems),
|
|
4553
|
-
startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
|
|
4554
|
-
endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
|
|
4555
|
-
});
|
|
4556
|
-
setTimeout(()=>{
|
|
4557
|
-
setAnnouncementText(`Showing ${startingNumber} to ${endingNumber} of ${totalItems} datasets`);
|
|
4558
|
-
}, 100);
|
|
4559
|
-
if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
|
|
4560
|
-
else setNoResults(false);
|
|
4561
|
-
}, [
|
|
4562
|
-
totalItems,
|
|
4563
|
-
pageSize,
|
|
4564
|
-
page
|
|
4565
|
-
]);
|
|
4566
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4567
|
-
if (page !== 1 && (transformedParams.fulltext !== fulltext || transformedParams.selectedFacets !== selectedFacets)) setPage(1);
|
|
4568
|
-
}, [
|
|
4569
|
-
fulltext,
|
|
4570
|
-
selectedFacets
|
|
4571
|
-
]);
|
|
4572
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4573
|
-
if (totalItems !== null && totalItems !== undefined && totalItems > 0) {
|
|
4574
|
-
var params = buildSearchParams(true);
|
|
4575
|
-
if (params !== location.search) setSearchParams(params);
|
|
4576
|
-
}
|
|
4577
|
-
}, [
|
|
4578
|
-
page,
|
|
4579
|
-
sort,
|
|
4580
|
-
sortOrder,
|
|
4581
|
-
totalItems
|
|
4582
|
-
]);
|
|
4583
4526
|
function resetFilters() {
|
|
4584
4527
|
setFullText(defaultFulltext);
|
|
4585
4528
|
setFilterText(defaultFulltext);
|
|
4586
4529
|
setSelectedFacets(defaultSelectedFacets);
|
|
4587
4530
|
setPage(defaultPage);
|
|
4588
4531
|
const url = new URL(window.location.href);
|
|
4589
|
-
window.history.pushState({},
|
|
4532
|
+
window.history.pushState({}, '', `${url.origin}${url.pathname}`);
|
|
4590
4533
|
}
|
|
4591
4534
|
function buildSearchParams(includePage) {
|
|
4592
4535
|
let newParams = {};
|
|
4593
4536
|
if (Number(page) !== 1 && includePage) newParams.page = page;
|
|
4594
4537
|
if (sort !== defaultSort.defaultSort) newParams.sort = sort;
|
|
4595
4538
|
if (sortOrder !== defaultSort.defaultOrder) newParams.sortOrder = sortOrder;
|
|
4596
|
-
if (fulltext !==
|
|
4539
|
+
if (fulltext !== '') newParams.fulltext = fulltext;
|
|
4597
4540
|
if (Object.keys(selectedFacets).length) Object.keys(selectedFacets).forEach((key)=>{
|
|
4598
4541
|
newParams[key] = selectedFacets[key];
|
|
4599
4542
|
});
|
|
@@ -4606,9 +4549,9 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4606
4549
|
fulltext: fulltext ? fulltext : undefined,
|
|
4607
4550
|
...selectedFacets,
|
|
4608
4551
|
sort: sort ? sort : undefined,
|
|
4609
|
-
[
|
|
4552
|
+
['sort-order']: sortOrder ? sortOrder : undefined,
|
|
4610
4553
|
page: page !== 1 ? page : undefined,
|
|
4611
|
-
[
|
|
4554
|
+
['page-size']: pageSize !== 10 ? pageSize : undefined
|
|
4612
4555
|
};
|
|
4613
4556
|
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
4614
4557
|
queryKey: [
|
|
@@ -4617,7 +4560,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4617
4560
|
],
|
|
4618
4561
|
queryFn: ()=>{
|
|
4619
4562
|
return (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
|
|
4620
|
-
arrayFormat:
|
|
4563
|
+
arrayFormat: 'comma',
|
|
4621
4564
|
encode: false
|
|
4622
4565
|
})}`);
|
|
4623
4566
|
}
|
|
@@ -4627,6 +4570,50 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4627
4570
|
theme: null,
|
|
4628
4571
|
keyword: null
|
|
4629
4572
|
};
|
|
4573
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4574
|
+
const baseNumber = Number(totalItems) > 0 ? 1 : 0;
|
|
4575
|
+
const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
|
|
4576
|
+
const endingNumber = Number(pageSize) * Number(page);
|
|
4577
|
+
setCurrentResultNumbers({
|
|
4578
|
+
total: Number(totalItems),
|
|
4579
|
+
startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
|
|
4580
|
+
endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
|
|
4581
|
+
});
|
|
4582
|
+
if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
|
|
4583
|
+
else setNoResults(false);
|
|
4584
|
+
}, [
|
|
4585
|
+
totalItems,
|
|
4586
|
+
pageSize,
|
|
4587
|
+
page
|
|
4588
|
+
]);
|
|
4589
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4590
|
+
if (page !== 1 && (transformedParams.fulltext !== fulltext || transformedParams.selectedFacets !== selectedFacets)) setPage(1);
|
|
4591
|
+
}, [
|
|
4592
|
+
fulltext,
|
|
4593
|
+
selectedFacets
|
|
4594
|
+
]);
|
|
4595
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4596
|
+
if (totalItems !== null && totalItems !== undefined && totalItems > 0) {
|
|
4597
|
+
var params = buildSearchParams(true);
|
|
4598
|
+
if (params !== location.search) setSearchParams(params);
|
|
4599
|
+
}
|
|
4600
|
+
}, [
|
|
4601
|
+
page,
|
|
4602
|
+
sort,
|
|
4603
|
+
sortOrder,
|
|
4604
|
+
totalItems
|
|
4605
|
+
]);
|
|
4606
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4607
|
+
// No results found
|
|
4608
|
+
if (noResults) setAnnouncementText('No results found.');
|
|
4609
|
+
else if (!isPending && (!data || !data.data.results)) setAnnouncementText('Could not connect to the API.');
|
|
4610
|
+
else setAnnouncementText(`Showing ${currentResultNumbers.startingNumber} to ${currentResultNumbers.endingNumber} of ${currentResultNumbers.total} datasets`);
|
|
4611
|
+
}, [
|
|
4612
|
+
data,
|
|
4613
|
+
isPending,
|
|
4614
|
+
noResults,
|
|
4615
|
+
currentResultNumbers
|
|
4616
|
+
]);
|
|
4630
4617
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4631
4618
|
children: [
|
|
4632
4619
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $5723016a5461c1ca$export$2e2bcd8739ae039), {
|
|
@@ -4635,6 +4622,15 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4635
4622
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("section", {
|
|
4636
4623
|
className: "ds-l-container",
|
|
4637
4624
|
children: [
|
|
4625
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4626
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4627
|
+
className: "ds-u-visibility--screen-reader",
|
|
4628
|
+
"aria-live": "assertive",
|
|
4629
|
+
"aria-atomic": "true",
|
|
4630
|
+
"data-testid": "currentResults",
|
|
4631
|
+
children: announcementText
|
|
4632
|
+
})
|
|
4633
|
+
}),
|
|
4638
4634
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4639
4635
|
className: "ds-l-row",
|
|
4640
4636
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -4668,7 +4664,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4668
4664
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
|
|
4669
4665
|
fieldClassName: "ds-u-margin--0",
|
|
4670
4666
|
value: filterText,
|
|
4671
|
-
className: `ds-u-padding-right--2 ${altMobileSearchButton ?
|
|
4667
|
+
className: `ds-u-padding-right--2 ${altMobileSearchButton ? 'ds-l-col--12 ds-l-md-col--10 --alt-style' : 'ds-l-col--10'}`,
|
|
4672
4668
|
label: "Search datasets",
|
|
4673
4669
|
labelClassName: "ds-u-visibility--screen-reader",
|
|
4674
4670
|
placeholder: "Search datasets",
|
|
@@ -4719,34 +4715,23 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4719
4715
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4720
4716
|
className: "ds-u-display--flex ds-u-justify-content--between ds-u-align-items--end ds-u-flex-wrap--reverse ds-u-sm-flex-wrap--wrap",
|
|
4721
4717
|
children: [
|
|
4722
|
-
enablePagination && /*#__PURE__*/ (0, $hgUW1$
|
|
4718
|
+
enablePagination && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4723
4719
|
className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--8 ds-u-sm-padding-left--0",
|
|
4724
|
-
children:
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
" datasets"
|
|
4738
|
-
]
|
|
4739
|
-
})
|
|
4740
|
-
}),
|
|
4741
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4742
|
-
className: "ds-u-visibility--screen-reader",
|
|
4743
|
-
role: "status",
|
|
4744
|
-
"aria-live": "assertive",
|
|
4745
|
-
"aria-atomic": "true",
|
|
4746
|
-
"data-testid": "currentResults",
|
|
4747
|
-
children: announcementText
|
|
4720
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4721
|
+
className: "ds-u-margin-y--0",
|
|
4722
|
+
children: currentResultNumbers && data && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4723
|
+
children: [
|
|
4724
|
+
"Showing ",
|
|
4725
|
+
currentResultNumbers.startingNumber,
|
|
4726
|
+
" -",
|
|
4727
|
+
' ',
|
|
4728
|
+
currentResultNumbers.endingNumber,
|
|
4729
|
+
" of ",
|
|
4730
|
+
data.data.total,
|
|
4731
|
+
" datasets"
|
|
4732
|
+
]
|
|
4748
4733
|
})
|
|
4749
|
-
|
|
4734
|
+
})
|
|
4750
4735
|
}),
|
|
4751
4736
|
enableSort && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4752
4737
|
className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--4 ds-u-sm-padding-right--0",
|
|
@@ -4767,6 +4752,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4767
4752
|
children: [
|
|
4768
4753
|
noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
4769
4754
|
variation: "error",
|
|
4755
|
+
role: "region",
|
|
4770
4756
|
heading: "No results found."
|
|
4771
4757
|
}),
|
|
4772
4758
|
data && data.data.results ? Object.keys(data.data.results).map((key)=>{
|
|
@@ -4794,6 +4780,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4794
4780
|
}, item.identifier);
|
|
4795
4781
|
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
4796
4782
|
variation: "error",
|
|
4783
|
+
role: "region",
|
|
4797
4784
|
heading: "Could not connect to the API."
|
|
4798
4785
|
})
|
|
4799
4786
|
]
|
|
@@ -4808,7 +4795,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4808
4795
|
},
|
|
4809
4796
|
renderHref: (page)=>{
|
|
4810
4797
|
const searchParams = buildSearchParams(false);
|
|
4811
|
-
const includeAnd = searchParams ?
|
|
4798
|
+
const includeAnd = searchParams ? '&' : '';
|
|
4812
4799
|
return `/datasets?page=${page}${includeAnd}${searchParams}`;
|
|
4813
4800
|
}
|
|
4814
4801
|
})
|
|
@@ -4842,26 +4829,26 @@ var $e873081a6e8f024e$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
4842
4829
|
|
|
4843
4830
|
|
|
4844
4831
|
const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enableSort = true, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort = {
|
|
4845
|
-
defaultSort:
|
|
4846
|
-
defaultOrder:
|
|
4847
|
-
}, pageTitle: pageTitle =
|
|
4832
|
+
defaultSort: 'modified',
|
|
4833
|
+
defaultOrder: 'desc'
|
|
4834
|
+
}, pageTitle: pageTitle = 'What\'s New ', showLargeFileWarning: showLargeFileWarning = false, introText: introText = '', dataDictionaryLinks: dataDictionaryLinks = false })=>{
|
|
4848
4835
|
const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
|
|
4849
4836
|
const sortOptions = [
|
|
4850
4837
|
{
|
|
4851
|
-
label:
|
|
4852
|
-
value:
|
|
4838
|
+
label: 'Newest',
|
|
4839
|
+
value: 'newest'
|
|
4853
4840
|
},
|
|
4854
4841
|
{
|
|
4855
|
-
label:
|
|
4856
|
-
value:
|
|
4842
|
+
label: 'Oldest',
|
|
4843
|
+
value: 'oldest'
|
|
4857
4844
|
},
|
|
4858
4845
|
{
|
|
4859
|
-
label:
|
|
4860
|
-
value:
|
|
4846
|
+
label: 'Title A-Z',
|
|
4847
|
+
value: 'titleAZ'
|
|
4861
4848
|
},
|
|
4862
4849
|
{
|
|
4863
|
-
label:
|
|
4864
|
-
value:
|
|
4850
|
+
label: 'Title Z-A',
|
|
4851
|
+
value: 'titleZA'
|
|
4865
4852
|
}
|
|
4866
4853
|
];
|
|
4867
4854
|
const defaultSortBy = "";
|
|
@@ -4875,42 +4862,71 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4875
4862
|
endingNumber: 0
|
|
4876
4863
|
});
|
|
4877
4864
|
const [noResults, setNoResults] = (0, $hgUW1$useState)(false);
|
|
4878
|
-
const [announcementText, setAnnouncementText] = (0, $hgUW1$useState)(
|
|
4865
|
+
const [announcementText, setAnnouncementText] = (0, $hgUW1$useState)('');
|
|
4879
4866
|
let [searchParams, setSearchParams] = (0, $hgUW1$useSearchParams)();
|
|
4880
4867
|
const [totalItems, setTotalItems] = (0, $hgUW1$useState)(0);
|
|
4881
4868
|
const [page, setPage] = (0, $hgUW1$useState)(transformedParams.page ? transformedParams.page : defaultPage);
|
|
4882
4869
|
const [sort, setSort] = (0, $hgUW1$useState)(transformedParams.sort ? transformedParams.sort : defaultSort ? defaultSort.defaultSort : defaultSortBy);
|
|
4883
4870
|
const [sortOrder, setSortOrder] = (0, $hgUW1$useState)(transformedParams.sortOrder ? transformedParams.sortOrder : defaultSort ? defaultSort.defaultOrder : defaultSortOrder);
|
|
4884
4871
|
const [sortDisplay, setSortDisplay] = (0, $hgUW1$useState)(()=>{
|
|
4885
|
-
return sort ===
|
|
4872
|
+
return sort === 'modified' ? sortOrder === 'desc' ? 'newest' : 'oldest' : sortOrder === 'desc' ? 'titleZA' : 'titleAZ';
|
|
4886
4873
|
});
|
|
4887
4874
|
const setSortOptions = (value)=>{
|
|
4888
4875
|
setSortDisplay(value);
|
|
4889
4876
|
switch(value){
|
|
4890
|
-
case
|
|
4891
|
-
setSort(
|
|
4892
|
-
setSortOrder(
|
|
4877
|
+
case 'newest':
|
|
4878
|
+
setSort('modified');
|
|
4879
|
+
setSortOrder('desc');
|
|
4893
4880
|
break;
|
|
4894
|
-
case
|
|
4895
|
-
setSort(
|
|
4896
|
-
setSortOrder(
|
|
4881
|
+
case 'oldest':
|
|
4882
|
+
setSort('modified');
|
|
4883
|
+
setSortOrder('asc');
|
|
4897
4884
|
break;
|
|
4898
|
-
case
|
|
4899
|
-
setSort(
|
|
4900
|
-
setSortOrder(
|
|
4885
|
+
case 'titleAZ':
|
|
4886
|
+
setSort('title');
|
|
4887
|
+
setSortOrder('asc');
|
|
4901
4888
|
break;
|
|
4902
|
-
case
|
|
4903
|
-
setSort(
|
|
4904
|
-
setSortOrder(
|
|
4889
|
+
case 'titleZA':
|
|
4890
|
+
setSort('title');
|
|
4891
|
+
setSortOrder('desc');
|
|
4905
4892
|
break;
|
|
4906
4893
|
}
|
|
4907
4894
|
};
|
|
4908
4895
|
const pageSize = defaultPageSize;
|
|
4896
|
+
function buildSearchParams(includePage) {
|
|
4897
|
+
let newParams = {};
|
|
4898
|
+
if (Number(page) !== 1 && includePage) newParams.page = page;
|
|
4899
|
+
if (sort !== defaultSort.defaultSort) newParams.sort = sort;
|
|
4900
|
+
if (sortOrder !== defaultSort.defaultOrder) newParams.sortOrder = sortOrder;
|
|
4901
|
+
return (0, $hgUW1$qs).stringify(newParams, {
|
|
4902
|
+
addQueryPrefix: includePage,
|
|
4903
|
+
encode: true
|
|
4904
|
+
});
|
|
4905
|
+
}
|
|
4906
|
+
let params = {
|
|
4907
|
+
sort: sort ? sort : undefined,
|
|
4908
|
+
['sort-order']: sortOrder ? sortOrder : undefined,
|
|
4909
|
+
page: page !== 1 ? page : undefined,
|
|
4910
|
+
['page-size']: pageSize !== 10 ? pageSize : undefined
|
|
4911
|
+
};
|
|
4912
|
+
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
4913
|
+
queryKey: [
|
|
4914
|
+
"datasets",
|
|
4915
|
+
params
|
|
4916
|
+
],
|
|
4917
|
+
queryFn: ()=>{
|
|
4918
|
+
return (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
|
|
4919
|
+
arrayFormat: 'comma',
|
|
4920
|
+
encode: false
|
|
4921
|
+
})}`);
|
|
4922
|
+
}
|
|
4923
|
+
});
|
|
4924
|
+
if (data && data.data.total && totalItems != data.data.total) setTotalItems(data.data.total);
|
|
4909
4925
|
(0, $hgUW1$useEffect)(()=>{
|
|
4910
4926
|
// Update browser URL with current search params
|
|
4911
4927
|
const params = buildSearchParams(true);
|
|
4912
4928
|
const url = new URL(window.location.href);
|
|
4913
|
-
window.history.pushState({},
|
|
4929
|
+
window.history.pushState({}, '', `${url.origin}${url.pathname}${params}`);
|
|
4914
4930
|
const baseNumber = Number(totalItems) > 0 ? 1 : 0;
|
|
4915
4931
|
const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
|
|
4916
4932
|
const endingNumber = Number(pageSize) * Number(page);
|
|
@@ -4919,9 +4935,6 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4919
4935
|
startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
|
|
4920
4936
|
endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
|
|
4921
4937
|
});
|
|
4922
|
-
setTimeout(()=>{
|
|
4923
|
-
setAnnouncementText(`Showing ${startingNumber} to ${endingNumber} of ${totalItems} datasets`);
|
|
4924
|
-
}, 100);
|
|
4925
4938
|
if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
|
|
4926
4939
|
else setNoResults(false);
|
|
4927
4940
|
}, [
|
|
@@ -4937,35 +4950,17 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4937
4950
|
sort,
|
|
4938
4951
|
sortOrder
|
|
4939
4952
|
]);
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
if (
|
|
4943
|
-
if (
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
sort: sort ? sort : undefined,
|
|
4952
|
-
["sort-order"]: sortOrder ? sortOrder : undefined,
|
|
4953
|
-
page: page !== 1 ? page : undefined,
|
|
4954
|
-
["page-size"]: pageSize !== 10 ? pageSize : undefined
|
|
4955
|
-
};
|
|
4956
|
-
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
4957
|
-
queryKey: [
|
|
4958
|
-
"datasets",
|
|
4959
|
-
params
|
|
4960
|
-
],
|
|
4961
|
-
queryFn: ()=>{
|
|
4962
|
-
return (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
|
|
4963
|
-
arrayFormat: "comma",
|
|
4964
|
-
encode: false
|
|
4965
|
-
})}`);
|
|
4966
|
-
}
|
|
4967
|
-
});
|
|
4968
|
-
if (data && data.data.total && totalItems != data.data.total) setTotalItems(data.data.total);
|
|
4953
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4954
|
+
// No results found
|
|
4955
|
+
if (noResults) setAnnouncementText('No results found.');
|
|
4956
|
+
else if (!isPending && (!data || !data.data.results)) setAnnouncementText('Could not connect to the API.');
|
|
4957
|
+
else setAnnouncementText(`Showing ${currentResultNumbers.startingNumber} to ${currentResultNumbers.endingNumber} of ${currentResultNumbers.total} datasets`);
|
|
4958
|
+
}, [
|
|
4959
|
+
data,
|
|
4960
|
+
isPending,
|
|
4961
|
+
noResults,
|
|
4962
|
+
currentResultNumbers
|
|
4963
|
+
]);
|
|
4969
4964
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4970
4965
|
children: [
|
|
4971
4966
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $5723016a5461c1ca$export$2e2bcd8739ae039), {
|
|
@@ -4974,6 +4969,15 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4974
4969
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("section", {
|
|
4975
4970
|
className: "ds-l-container",
|
|
4976
4971
|
children: [
|
|
4972
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4973
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4974
|
+
className: "ds-u-visibility--screen-reader",
|
|
4975
|
+
"aria-live": "assertive",
|
|
4976
|
+
"aria-atomic": "true",
|
|
4977
|
+
"data-testid": "currentResults",
|
|
4978
|
+
children: announcementText
|
|
4979
|
+
})
|
|
4980
|
+
}),
|
|
4977
4981
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4978
4982
|
className: "ds-l-row",
|
|
4979
4983
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -5014,33 +5018,22 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5014
5018
|
className: "ds-u-margin-bottom--3",
|
|
5015
5019
|
children: introText ? introText : null
|
|
5016
5020
|
}),
|
|
5017
|
-
enablePagination && /*#__PURE__*/ (0, $hgUW1$
|
|
5018
|
-
children:
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
" datasets"
|
|
5032
|
-
]
|
|
5033
|
-
})
|
|
5034
|
-
}),
|
|
5035
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
5036
|
-
className: "ds-u-visibility--screen-reader",
|
|
5037
|
-
role: "status",
|
|
5038
|
-
"aria-live": "assertive",
|
|
5039
|
-
"aria-atomic": "true",
|
|
5040
|
-
"data-testid": "currentResults",
|
|
5041
|
-
children: announcementText
|
|
5021
|
+
enablePagination && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5022
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
5023
|
+
className: "ds-u-margin-y--0",
|
|
5024
|
+
children: currentResultNumbers && data && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
5025
|
+
children: [
|
|
5026
|
+
"Showing ",
|
|
5027
|
+
currentResultNumbers.startingNumber,
|
|
5028
|
+
" -",
|
|
5029
|
+
' ',
|
|
5030
|
+
currentResultNumbers.endingNumber,
|
|
5031
|
+
" of ",
|
|
5032
|
+
data.data.total,
|
|
5033
|
+
" datasets"
|
|
5034
|
+
]
|
|
5042
5035
|
})
|
|
5043
|
-
|
|
5036
|
+
})
|
|
5044
5037
|
})
|
|
5045
5038
|
]
|
|
5046
5039
|
}),
|
|
@@ -5063,6 +5056,7 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5063
5056
|
children: [
|
|
5064
5057
|
noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
5065
5058
|
variation: "error",
|
|
5059
|
+
role: "region",
|
|
5066
5060
|
heading: "No results found."
|
|
5067
5061
|
}),
|
|
5068
5062
|
data && data.data.results ? Object.keys(data.data.results).map((key)=>{
|
|
@@ -5077,6 +5071,7 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5077
5071
|
}, item.identifier);
|
|
5078
5072
|
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
5079
5073
|
variation: "error",
|
|
5074
|
+
role: "region",
|
|
5080
5075
|
heading: "Could not connect to the API."
|
|
5081
5076
|
})
|
|
5082
5077
|
]
|
|
@@ -5091,7 +5086,7 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5091
5086
|
},
|
|
5092
5087
|
renderHref: (page)=>{
|
|
5093
5088
|
const searchParams = buildSearchParams(false);
|
|
5094
|
-
const includeAnd = searchParams ?
|
|
5089
|
+
const includeAnd = searchParams ? '&' : '';
|
|
5095
5090
|
return `/datasets?page=${page}${includeAnd}${searchParams}`;
|
|
5096
5091
|
}
|
|
5097
5092
|
})
|
|
@@ -5123,12 +5118,12 @@ var $550bcc185f420ff5$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
|
|
|
5123
5118
|
|
|
5124
5119
|
const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl)=>{
|
|
5125
5120
|
const [dataset, setDataset] = (0, $hgUW1$useState)({
|
|
5126
|
-
title:
|
|
5121
|
+
title: '',
|
|
5127
5122
|
distribution: [],
|
|
5128
|
-
error:
|
|
5129
|
-
description:
|
|
5130
|
-
identifier:
|
|
5131
|
-
modified:
|
|
5123
|
+
error: '',
|
|
5124
|
+
description: '',
|
|
5125
|
+
identifier: '',
|
|
5126
|
+
modified: ''
|
|
5132
5127
|
});
|
|
5133
5128
|
const [id, setId] = (0, $hgUW1$useState)(datasetId);
|
|
5134
5129
|
const [rootUrl, setRootUrl] = (0, $hgUW1$useState)(rootAPIUrl);
|
|
@@ -5138,7 +5133,7 @@ const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl)=>{
|
|
|
5138
5133
|
"metastore" + id
|
|
5139
5134
|
],
|
|
5140
5135
|
queryFn: ()=>{
|
|
5141
|
-
return (0, $hgUW1$axios).get(`${rootUrl}/metastore/schemas/dataset/items/${id}?show-reference-ids${ACA ?
|
|
5136
|
+
return (0, $hgUW1$axios).get(`${rootUrl}/metastore/schemas/dataset/items/${id}?show-reference-ids${ACA ? '&' : ''}${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)({}, ACA))}`).then((res)=>res.data).catch((error)=>{
|
|
5142
5137
|
return {
|
|
5143
5138
|
title: dataset.title,
|
|
5144
5139
|
distribution: dataset.distribution,
|
|
@@ -5194,7 +5189,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
5194
5189
|
// const [joins, setJoins] = useState()
|
|
5195
5190
|
const [properties, setProperties] = (0, $hgUW1$useState)(options.properties ? options.properties : undefined);
|
|
5196
5191
|
// Check drupalSettings for datastore_query_api
|
|
5197
|
-
const useDatasetAPI = typeof window !==
|
|
5192
|
+
const useDatasetAPI = typeof window !== 'undefined' && window.drupalSettings?.datastore_query_api === true;
|
|
5198
5193
|
const datasetID = additionalParams.datasetID;
|
|
5199
5194
|
// Remove datasetID from params to avoid sending it to the API
|
|
5200
5195
|
const { datasetID: _, ...restAdditionalParams } = additionalParams;
|
|
@@ -5209,7 +5204,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
5209
5204
|
...restAdditionalParams
|
|
5210
5205
|
};
|
|
5211
5206
|
params = (0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA);
|
|
5212
|
-
const paramsString = Object.keys(params).length ? `${(0, $hgUW1$qs).stringify(params)}` :
|
|
5207
|
+
const paramsString = Object.keys(params).length ? `${(0, $hgUW1$qs).stringify(params)}` : '';
|
|
5213
5208
|
let enabled = false;
|
|
5214
5209
|
if (id) {
|
|
5215
5210
|
if (!requireConditions) enabled = true;
|
|
@@ -5291,65 +5286,65 @@ var $1d3d480a9cfaabe0$export$2e2bcd8739ae039 = $1d3d480a9cfaabe0$var$useDatastor
|
|
|
5291
5286
|
|
|
5292
5287
|
|
|
5293
5288
|
const $28f16f59778efa64$export$82b1b1d517e5388a = {
|
|
5294
|
-
|
|
5295
|
-
name:
|
|
5289
|
+
'R/P10Y': {
|
|
5290
|
+
name: 'Decennial'
|
|
5296
5291
|
},
|
|
5297
|
-
|
|
5298
|
-
name:
|
|
5292
|
+
'R/P4Y': {
|
|
5293
|
+
name: 'Quadrennial'
|
|
5299
5294
|
},
|
|
5300
|
-
|
|
5301
|
-
name:
|
|
5295
|
+
'R/P1Y': {
|
|
5296
|
+
name: 'Annual'
|
|
5302
5297
|
},
|
|
5303
|
-
|
|
5304
|
-
name:
|
|
5298
|
+
'R/P2M': {
|
|
5299
|
+
name: 'Bimonthly'
|
|
5305
5300
|
},
|
|
5306
|
-
|
|
5307
|
-
name:
|
|
5301
|
+
'R/P3.5D': {
|
|
5302
|
+
name: 'Semiweekly'
|
|
5308
5303
|
},
|
|
5309
|
-
|
|
5310
|
-
name:
|
|
5304
|
+
'R/P1D': {
|
|
5305
|
+
name: 'Daily'
|
|
5311
5306
|
},
|
|
5312
|
-
|
|
5313
|
-
name:
|
|
5307
|
+
'R/P2W': {
|
|
5308
|
+
name: 'Biweekly'
|
|
5314
5309
|
},
|
|
5315
|
-
|
|
5316
|
-
name:
|
|
5310
|
+
'R/P6M': {
|
|
5311
|
+
name: 'Semiannual'
|
|
5317
5312
|
},
|
|
5318
|
-
|
|
5319
|
-
name:
|
|
5313
|
+
'R/P2Y': {
|
|
5314
|
+
name: 'Biennial'
|
|
5320
5315
|
},
|
|
5321
|
-
|
|
5322
|
-
name:
|
|
5316
|
+
'R/P3Y': {
|
|
5317
|
+
name: 'Triennial'
|
|
5323
5318
|
},
|
|
5324
|
-
|
|
5325
|
-
name:
|
|
5319
|
+
'R/P0.33W': {
|
|
5320
|
+
name: 'Three times a week'
|
|
5326
5321
|
},
|
|
5327
|
-
|
|
5328
|
-
name:
|
|
5322
|
+
'R/P0.33M': {
|
|
5323
|
+
name: 'Three times a month'
|
|
5329
5324
|
},
|
|
5330
|
-
|
|
5331
|
-
name:
|
|
5325
|
+
'R/PT1S': {
|
|
5326
|
+
name: 'Continuously updated'
|
|
5332
5327
|
},
|
|
5333
|
-
|
|
5334
|
-
name:
|
|
5328
|
+
'R/P1M': {
|
|
5329
|
+
name: 'Monthly'
|
|
5335
5330
|
},
|
|
5336
|
-
|
|
5337
|
-
name:
|
|
5331
|
+
'R/P3M': {
|
|
5332
|
+
name: 'Quarterly'
|
|
5338
5333
|
},
|
|
5339
|
-
|
|
5340
|
-
name:
|
|
5334
|
+
'R/P0.5M': {
|
|
5335
|
+
name: 'Semimonthly'
|
|
5341
5336
|
},
|
|
5342
|
-
|
|
5343
|
-
name:
|
|
5337
|
+
'R/P4M': {
|
|
5338
|
+
name: 'Three times a year'
|
|
5344
5339
|
},
|
|
5345
|
-
|
|
5346
|
-
name:
|
|
5340
|
+
'R/P1W': {
|
|
5341
|
+
name: 'Weekly'
|
|
5347
5342
|
},
|
|
5348
|
-
|
|
5349
|
-
name:
|
|
5343
|
+
'R/PT1H': {
|
|
5344
|
+
name: 'Hourly'
|
|
5350
5345
|
},
|
|
5351
5346
|
irregular: {
|
|
5352
|
-
name:
|
|
5347
|
+
name: 'Irregular'
|
|
5353
5348
|
}
|
|
5354
5349
|
};
|
|
5355
5350
|
|
|
@@ -5358,7 +5353,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5358
5353
|
modified: (data)=>{
|
|
5359
5354
|
return [
|
|
5360
5355
|
{
|
|
5361
|
-
label:
|
|
5356
|
+
label: 'Modified',
|
|
5362
5357
|
value: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
5363
5358
|
date: data
|
|
5364
5359
|
})
|
|
@@ -5368,7 +5363,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5368
5363
|
issued: (data)=>{
|
|
5369
5364
|
return [
|
|
5370
5365
|
{
|
|
5371
|
-
label:
|
|
5366
|
+
label: 'Issued',
|
|
5372
5367
|
value: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $bd76a91923d7e8a7$export$2e2bcd8739ae039), {
|
|
5373
5368
|
date: data
|
|
5374
5369
|
})
|
|
@@ -5378,7 +5373,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5378
5373
|
accrualPeriodicity: (data)=>{
|
|
5379
5374
|
return [
|
|
5380
5375
|
{
|
|
5381
|
-
label:
|
|
5376
|
+
label: 'Frequency',
|
|
5382
5377
|
value: (0, $28f16f59778efa64$export$82b1b1d517e5388a)[data].name
|
|
5383
5378
|
}
|
|
5384
5379
|
];
|
|
@@ -5386,7 +5381,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5386
5381
|
publisher: (data)=>{
|
|
5387
5382
|
if (data.data && data.data.name) return [
|
|
5388
5383
|
{
|
|
5389
|
-
label:
|
|
5384
|
+
label: 'Publisher',
|
|
5390
5385
|
value: data.data.name
|
|
5391
5386
|
}
|
|
5392
5387
|
];
|
|
@@ -5395,7 +5390,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5395
5390
|
identifier: (data)=>{
|
|
5396
5391
|
return [
|
|
5397
5392
|
{
|
|
5398
|
-
label:
|
|
5393
|
+
label: 'Identifier',
|
|
5399
5394
|
value: data
|
|
5400
5395
|
}
|
|
5401
5396
|
];
|
|
@@ -5403,11 +5398,11 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5403
5398
|
contactPoint: (data)=>{
|
|
5404
5399
|
let rows = [];
|
|
5405
5400
|
if (data.fn) rows.push({
|
|
5406
|
-
label:
|
|
5401
|
+
label: 'Contact',
|
|
5407
5402
|
value: data.fn
|
|
5408
5403
|
});
|
|
5409
5404
|
if (data.hasEmail) rows.push({
|
|
5410
|
-
label:
|
|
5405
|
+
label: 'Contact Email',
|
|
5411
5406
|
value: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
|
|
5412
5407
|
href: data.hasEmail.includes("mailto:") ? data.hasEmail : `mailto:${data.hasEmail}`,
|
|
5413
5408
|
children: data.hasEmail.replace("mailto:", "")
|
|
@@ -5418,7 +5413,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5418
5413
|
bureauCode: (data)=>{
|
|
5419
5414
|
if (data.length) return [
|
|
5420
5415
|
{
|
|
5421
|
-
label:
|
|
5416
|
+
label: 'Bureau Code',
|
|
5422
5417
|
value: data[0]
|
|
5423
5418
|
}
|
|
5424
5419
|
];
|
|
@@ -5426,7 +5421,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5426
5421
|
programCode: (data)=>{
|
|
5427
5422
|
if (data.length) return [
|
|
5428
5423
|
{
|
|
5429
|
-
label:
|
|
5424
|
+
label: 'Program Code',
|
|
5430
5425
|
value: data[0]
|
|
5431
5426
|
}
|
|
5432
5427
|
];
|
|
@@ -5434,13 +5429,13 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5434
5429
|
theme: (data)=>{
|
|
5435
5430
|
return [
|
|
5436
5431
|
{
|
|
5437
|
-
label:
|
|
5432
|
+
label: 'Category',
|
|
5438
5433
|
value: data.map((theme)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
|
|
5439
5434
|
to: `/datasets?theme[]=${theme.data}`,
|
|
5440
5435
|
children: theme.data
|
|
5441
5436
|
}, theme.data)).reduce((prev, curr)=>[
|
|
5442
5437
|
prev,
|
|
5443
|
-
|
|
5438
|
+
', ',
|
|
5444
5439
|
curr
|
|
5445
5440
|
])
|
|
5446
5441
|
}
|
|
@@ -5449,13 +5444,13 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5449
5444
|
keyword: (data)=>{
|
|
5450
5445
|
return [
|
|
5451
5446
|
{
|
|
5452
|
-
label:
|
|
5447
|
+
label: 'Tags',
|
|
5453
5448
|
value: data.map((keyword)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
|
|
5454
5449
|
to: `/datasets?keyword[]=${keyword.data}`,
|
|
5455
5450
|
children: keyword.data
|
|
5456
5451
|
}, keyword.data)).reduce((prev, curr)=>[
|
|
5457
5452
|
prev,
|
|
5458
|
-
|
|
5453
|
+
', ',
|
|
5459
5454
|
curr
|
|
5460
5455
|
])
|
|
5461
5456
|
}
|
|
@@ -5464,7 +5459,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5464
5459
|
license: (data)=>{
|
|
5465
5460
|
return [
|
|
5466
5461
|
{
|
|
5467
|
-
label:
|
|
5462
|
+
label: 'License',
|
|
5468
5463
|
value: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
|
|
5469
5464
|
href: data,
|
|
5470
5465
|
children: data
|
|
@@ -5475,7 +5470,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5475
5470
|
accessLevel: (data)=>{
|
|
5476
5471
|
return [
|
|
5477
5472
|
{
|
|
5478
|
-
label:
|
|
5473
|
+
label: 'Public Access Level',
|
|
5479
5474
|
value: data
|
|
5480
5475
|
}
|
|
5481
5476
|
];
|
|
@@ -5483,7 +5478,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5483
5478
|
temporal: (data)=>{
|
|
5484
5479
|
return [
|
|
5485
5480
|
{
|
|
5486
|
-
label:
|
|
5481
|
+
label: 'Temporal Coverage',
|
|
5487
5482
|
value: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
5488
5483
|
className: "dc-c-word-break--all",
|
|
5489
5484
|
children: data
|
|
@@ -5494,7 +5489,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5494
5489
|
spatial: (data)=>{
|
|
5495
5490
|
return [
|
|
5496
5491
|
{
|
|
5497
|
-
label:
|
|
5492
|
+
label: 'Spacial/Geographical Coverage',
|
|
5498
5493
|
value: data
|
|
5499
5494
|
}
|
|
5500
5495
|
];
|
|
@@ -5502,7 +5497,7 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
|
|
|
5502
5497
|
references: (data)=>{
|
|
5503
5498
|
return [
|
|
5504
5499
|
{
|
|
5505
|
-
label:
|
|
5500
|
+
label: 'Related Documents',
|
|
5506
5501
|
value: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
5507
5502
|
className: "ds-u-margin--0 ds-u-padding-y--0 ds-u-padding-left--2 ds-u-padding-right--0",
|
|
5508
5503
|
children: data.map((item)=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
@@ -5540,7 +5535,7 @@ const $0958733ee130fc44$var$ResourceInformation = ({ distribution: distribution,
|
|
|
5540
5535
|
const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
|
|
5541
5536
|
const { data: resource } = (0, $hgUW1$useQuery)({
|
|
5542
5537
|
queryKey: [
|
|
5543
|
-
|
|
5538
|
+
'resource-information',
|
|
5544
5539
|
distribution.identifier
|
|
5545
5540
|
],
|
|
5546
5541
|
queryFn: ()=>(0, $hgUW1$axios).get(`${rootUrl}/datastore/query/${distribution.identifier}?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)({
|
|
@@ -5567,7 +5562,7 @@ const $0958733ee130fc44$var$ResourceInformation = ({ distribution: distribution,
|
|
|
5567
5562
|
}),
|
|
5568
5563
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5569
5564
|
className: "ds-u-font-weight--bold",
|
|
5570
|
-
children: resource?.count ? Number(resource.count).toLocaleString() :
|
|
5565
|
+
children: resource?.count ? Number(resource.count).toLocaleString() : ''
|
|
5571
5566
|
})
|
|
5572
5567
|
]
|
|
5573
5568
|
}),
|
|
@@ -5635,8 +5630,8 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource
|
|
|
5635
5630
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
|
|
5636
5631
|
href: dist.data.downloadURL,
|
|
5637
5632
|
style: {
|
|
5638
|
-
order: sm ?
|
|
5639
|
-
width: sm ?
|
|
5633
|
+
order: sm ? '1' : '0',
|
|
5634
|
+
width: sm ? '100%' : 'auto'
|
|
5640
5635
|
},
|
|
5641
5636
|
"aria-label": `Download ${dist.data.title || title} ${fileFormat}`,
|
|
5642
5637
|
className: "ds-c-button",
|
|
@@ -5649,7 +5644,7 @@ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource
|
|
|
5649
5644
|
})
|
|
5650
5645
|
}),
|
|
5651
5646
|
dist.data.description && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5652
|
-
className:
|
|
5647
|
+
className: 'ds-u-measure--wide ds-u-margin-bottom--7',
|
|
5653
5648
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5654
5649
|
className: "dc-c-metadata-description ds-u-margin--0",
|
|
5655
5650
|
dangerouslySetInnerHTML: {
|
|
@@ -5723,7 +5718,7 @@ const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset, resource: res
|
|
|
5723
5718
|
const tooltip = tooltips.find((item)=>item.label === r.label.toLowerCase());
|
|
5724
5719
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
|
|
5725
5720
|
children: [
|
|
5726
|
-
md ?
|
|
5721
|
+
md ? '' : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableCell), {
|
|
5727
5722
|
component: "th",
|
|
5728
5723
|
className: "ds-u-font-weight--bold",
|
|
5729
5724
|
children: [
|
|
@@ -5735,8 +5730,8 @@ const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset, resource: res
|
|
|
5735
5730
|
ariaLabel: r.label,
|
|
5736
5731
|
// @ts-ignore
|
|
5737
5732
|
style: {
|
|
5738
|
-
border:
|
|
5739
|
-
background:
|
|
5733
|
+
border: 'none',
|
|
5734
|
+
background: 'none'
|
|
5740
5735
|
},
|
|
5741
5736
|
maxWidth: "400px",
|
|
5742
5737
|
placement: "auto",
|
|
@@ -5795,10 +5790,10 @@ const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id, rootUrl: rootUrl, apiUrl: ap
|
|
|
5795
5790
|
href: apiUrl,
|
|
5796
5791
|
children: [
|
|
5797
5792
|
"View API",
|
|
5798
|
-
|
|
5793
|
+
' ',
|
|
5799
5794
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
5800
5795
|
style: {
|
|
5801
|
-
whiteSpace:
|
|
5796
|
+
whiteSpace: 'nowrap'
|
|
5802
5797
|
},
|
|
5803
5798
|
children: [
|
|
5804
5799
|
"specification ",
|
|
@@ -5839,20 +5834,19 @@ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
|
|
|
5839
5834
|
|
|
5840
5835
|
const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns, tableData: tableData, pageSize: pageSize, columnFilters: columnFilters })=>{
|
|
5841
5836
|
const [sorting, setSorting] = (0, $hgUW1$useState)([]);
|
|
5842
|
-
const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
|
|
5843
5837
|
const mobile = (0, $hgUW1$useMediaQuery)({
|
|
5844
5838
|
minWidth: 0,
|
|
5845
5839
|
maxWidth: 544
|
|
5846
5840
|
});
|
|
5847
5841
|
const sortElement = (isSorted)=>{
|
|
5848
|
-
if (isSorted ===
|
|
5849
|
-
if (isSorted ===
|
|
5850
|
-
return
|
|
5842
|
+
if (isSorted === 'asc') return 'dc-c-sort--asc';
|
|
5843
|
+
if (isSorted === 'desc') return 'dc-c-sort--desc';
|
|
5844
|
+
return 'dc-c-sort--default';
|
|
5851
5845
|
};
|
|
5852
5846
|
const table = (0, $hgUW1$useReactTable)({
|
|
5853
5847
|
data: tableData,
|
|
5854
5848
|
columns: tableColumns,
|
|
5855
|
-
columnResizeMode:
|
|
5849
|
+
columnResizeMode: 'onChange',
|
|
5856
5850
|
getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
|
|
5857
5851
|
getFilteredRowModel: (0, $hgUW1$getFilteredRowModel)(),
|
|
5858
5852
|
getPaginationRowModel: (0, $hgUW1$getPaginationRowModel)(),
|
|
@@ -5871,49 +5865,49 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5871
5865
|
});
|
|
5872
5866
|
const sortOptions = [
|
|
5873
5867
|
{
|
|
5874
|
-
value:
|
|
5875
|
-
label:
|
|
5868
|
+
value: 'default',
|
|
5869
|
+
label: 'No Sort'
|
|
5876
5870
|
},
|
|
5877
5871
|
{
|
|
5878
|
-
value:
|
|
5879
|
-
label:
|
|
5872
|
+
value: 'titleasc',
|
|
5873
|
+
label: 'Title A-Z'
|
|
5880
5874
|
},
|
|
5881
5875
|
{
|
|
5882
|
-
value:
|
|
5883
|
-
label:
|
|
5876
|
+
value: 'titledesc',
|
|
5877
|
+
label: 'Title Z-A'
|
|
5884
5878
|
},
|
|
5885
5879
|
{
|
|
5886
|
-
value:
|
|
5887
|
-
label:
|
|
5880
|
+
value: 'typeasc',
|
|
5881
|
+
label: 'Type A-Z'
|
|
5888
5882
|
},
|
|
5889
5883
|
{
|
|
5890
|
-
value:
|
|
5891
|
-
label:
|
|
5884
|
+
value: 'typedesc',
|
|
5885
|
+
label: 'Type Z-A'
|
|
5892
5886
|
}
|
|
5893
5887
|
];
|
|
5894
5888
|
const sortStatesLookup = {
|
|
5895
5889
|
default: [],
|
|
5896
5890
|
titleasc: [
|
|
5897
5891
|
{
|
|
5898
|
-
id:
|
|
5892
|
+
id: 'titleResizable',
|
|
5899
5893
|
desc: false
|
|
5900
5894
|
}
|
|
5901
5895
|
],
|
|
5902
5896
|
titledesc: [
|
|
5903
5897
|
{
|
|
5904
|
-
id:
|
|
5898
|
+
id: 'titleResizable',
|
|
5905
5899
|
desc: true
|
|
5906
5900
|
}
|
|
5907
5901
|
],
|
|
5908
5902
|
typeasc: [
|
|
5909
5903
|
{
|
|
5910
|
-
id:
|
|
5904
|
+
id: 'type',
|
|
5911
5905
|
desc: false
|
|
5912
5906
|
}
|
|
5913
5907
|
],
|
|
5914
5908
|
typedesc: [
|
|
5915
5909
|
{
|
|
5916
|
-
id:
|
|
5910
|
+
id: 'type',
|
|
5917
5911
|
desc: true
|
|
5918
5912
|
}
|
|
5919
5913
|
]
|
|
@@ -5941,7 +5935,7 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5941
5935
|
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
|
|
5942
5936
|
className: "dc-c-datatable",
|
|
5943
5937
|
style: {
|
|
5944
|
-
width:
|
|
5938
|
+
width: '100%'
|
|
5945
5939
|
},
|
|
5946
5940
|
stackable: true,
|
|
5947
5941
|
children: [
|
|
@@ -5952,18 +5946,17 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5952
5946
|
return header.id === "titleResizable" ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
|
|
5953
5947
|
table: table,
|
|
5954
5948
|
header: header,
|
|
5955
|
-
setAriaLiveFeedback: setAriaLiveFeedback,
|
|
5956
5949
|
sortElement: sortElement,
|
|
5957
|
-
id:
|
|
5950
|
+
id: 'dataDictionary_' + header.id
|
|
5958
5951
|
}, header.id + "_resize") : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableCell), {
|
|
5959
5952
|
key: header.id,
|
|
5960
5953
|
className: `ds-u-border-y--2 ds-u-border--dark ds-u-border-x--0`,
|
|
5961
|
-
id:
|
|
5954
|
+
id: 'dataDictionary_' + header.id,
|
|
5962
5955
|
children: [
|
|
5963
5956
|
(0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext()),
|
|
5964
|
-
header.id ===
|
|
5957
|
+
header.id === 'type' && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
5965
5958
|
onClick: header.column.getToggleSortingHandler(),
|
|
5966
|
-
className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` :
|
|
5959
|
+
className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : '',
|
|
5967
5960
|
"aria-label": `${header.column.columnDef.header} sort order`
|
|
5968
5961
|
})
|
|
5969
5962
|
]
|
|
@@ -5978,12 +5971,12 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5978
5971
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
5979
5972
|
key: cell.id,
|
|
5980
5973
|
style: {
|
|
5981
|
-
maxWidth: mobile ?
|
|
5982
|
-
whiteSpace: cell.column.id === "description" ?
|
|
5974
|
+
maxWidth: mobile ? '100%' : cell.column.getSize(),
|
|
5975
|
+
whiteSpace: cell.column.id === "description" ? 'pre-wrap' : 'normal'
|
|
5983
5976
|
},
|
|
5984
|
-
className: `${cell.column.id ===
|
|
5985
|
-
headers:
|
|
5986
|
-
stackedTitle: cell.column.id ===
|
|
5977
|
+
className: `${cell.column.id === 'titleResizable' ? 'ds-u-word-break' : ''}`,
|
|
5978
|
+
headers: 'dataDictionary_' + cell.column.id,
|
|
5979
|
+
stackedTitle: cell.column.id === 'titleResizable' ? 'Title' : cell.column.columnDef.header,
|
|
5987
5980
|
children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
5988
5981
|
});
|
|
5989
5982
|
})
|
|
@@ -5992,12 +5985,6 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5992
5985
|
})
|
|
5993
5986
|
]
|
|
5994
5987
|
}),
|
|
5995
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5996
|
-
className: "sr-only",
|
|
5997
|
-
"aria-live": "assertive",
|
|
5998
|
-
"aria-atomic": "true",
|
|
5999
|
-
children: ariaLiveFeedback
|
|
6000
|
-
}),
|
|
6001
5988
|
table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
6002
5989
|
variation: "warn",
|
|
6003
5990
|
children: "No results found for the current filters"
|
|
@@ -6012,7 +5999,7 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
6012
5999
|
table.setPageIndex(page - 1);
|
|
6013
6000
|
},
|
|
6014
6001
|
renderHref: (page)=>`/page=${page}`
|
|
6015
|
-
}) :
|
|
6002
|
+
}) : ''
|
|
6016
6003
|
]
|
|
6017
6004
|
});
|
|
6018
6005
|
};
|
|
@@ -6022,17 +6009,17 @@ var $6765a74df807d015$export$2e2bcd8739ae039 = $6765a74df807d015$var$DataDiction
|
|
|
6022
6009
|
const $a24829b27758fe6c$var$SitewideDataDictionaryTable = ({ datasetDictionary: datasetDictionary, pageSize: pageSize })=>{
|
|
6023
6010
|
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
6024
6011
|
const tableColumns = [
|
|
6025
|
-
columnHelper.accessor(
|
|
6026
|
-
header:
|
|
6012
|
+
columnHelper.accessor('name', {
|
|
6013
|
+
header: 'Name'
|
|
6027
6014
|
}),
|
|
6028
|
-
columnHelper.accessor(
|
|
6029
|
-
header:
|
|
6015
|
+
columnHelper.accessor('title', {
|
|
6016
|
+
header: 'Title'
|
|
6030
6017
|
}),
|
|
6031
|
-
columnHelper.accessor(
|
|
6032
|
-
header:
|
|
6018
|
+
columnHelper.accessor('type', {
|
|
6019
|
+
header: 'Type'
|
|
6033
6020
|
}),
|
|
6034
|
-
columnHelper.accessor(
|
|
6035
|
-
header:
|
|
6021
|
+
columnHelper.accessor('format', {
|
|
6022
|
+
header: 'Format'
|
|
6036
6023
|
})
|
|
6037
6024
|
];
|
|
6038
6025
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6765a74df807d015$export$2e2bcd8739ae039), {
|
|
@@ -6076,7 +6063,7 @@ const $a6e312940f7003ef$var$DatasetDictionaryTable = ({ datasetDictionary: datas
|
|
|
6076
6063
|
});
|
|
6077
6064
|
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
6078
6065
|
const tableColumns = [
|
|
6079
|
-
columnHelper.accessor(
|
|
6066
|
+
columnHelper.accessor('titleResizable', {
|
|
6080
6067
|
header: ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
6081
6068
|
className: "dc-c-tooltip-width-override",
|
|
6082
6069
|
children: [
|
|
@@ -6085,8 +6072,8 @@ const $a6e312940f7003ef$var$DatasetDictionaryTable = ({ datasetDictionary: datas
|
|
|
6085
6072
|
title: "Title represents the column headers of the data file",
|
|
6086
6073
|
// @ts-ignore
|
|
6087
6074
|
style: {
|
|
6088
|
-
border:
|
|
6089
|
-
background:
|
|
6075
|
+
border: 'none',
|
|
6076
|
+
background: 'none'
|
|
6090
6077
|
},
|
|
6091
6078
|
maxWidth: "400px",
|
|
6092
6079
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TooltipIcon), {})
|
|
@@ -6096,48 +6083,48 @@ const $a6e312940f7003ef$var$DatasetDictionaryTable = ({ datasetDictionary: datas
|
|
|
6096
6083
|
size: 300,
|
|
6097
6084
|
minSize: 132
|
|
6098
6085
|
}),
|
|
6099
|
-
columnHelper.accessor(
|
|
6100
|
-
header:
|
|
6086
|
+
columnHelper.accessor('description', {
|
|
6087
|
+
header: 'Description',
|
|
6101
6088
|
minSize: 600
|
|
6102
6089
|
}),
|
|
6103
|
-
columnHelper.accessor(
|
|
6104
|
-
header:
|
|
6090
|
+
columnHelper.accessor('type', {
|
|
6091
|
+
header: 'Type',
|
|
6105
6092
|
size: 150,
|
|
6106
6093
|
enableResizing: false
|
|
6107
6094
|
})
|
|
6108
6095
|
];
|
|
6109
6096
|
const typeOptions = [
|
|
6110
6097
|
{
|
|
6111
|
-
value:
|
|
6112
|
-
label:
|
|
6098
|
+
value: 'all',
|
|
6099
|
+
label: 'All Types'
|
|
6113
6100
|
},
|
|
6114
6101
|
{
|
|
6115
|
-
value:
|
|
6116
|
-
label:
|
|
6102
|
+
value: 'string',
|
|
6103
|
+
label: 'String'
|
|
6117
6104
|
},
|
|
6118
6105
|
{
|
|
6119
|
-
value:
|
|
6120
|
-
label:
|
|
6106
|
+
value: 'date',
|
|
6107
|
+
label: 'Date'
|
|
6121
6108
|
},
|
|
6122
6109
|
{
|
|
6123
|
-
value:
|
|
6124
|
-
label:
|
|
6110
|
+
value: 'datetime',
|
|
6111
|
+
label: 'Datetime'
|
|
6125
6112
|
},
|
|
6126
6113
|
{
|
|
6127
|
-
value:
|
|
6128
|
-
label:
|
|
6114
|
+
value: 'year',
|
|
6115
|
+
label: 'Year'
|
|
6129
6116
|
},
|
|
6130
6117
|
{
|
|
6131
|
-
value:
|
|
6132
|
-
label:
|
|
6118
|
+
value: 'integer',
|
|
6119
|
+
label: 'Integer'
|
|
6133
6120
|
},
|
|
6134
6121
|
{
|
|
6135
|
-
value:
|
|
6136
|
-
label:
|
|
6122
|
+
value: 'number',
|
|
6123
|
+
label: 'Number'
|
|
6137
6124
|
},
|
|
6138
6125
|
{
|
|
6139
|
-
value:
|
|
6140
|
-
label:
|
|
6126
|
+
value: 'boolean',
|
|
6127
|
+
label: 'Boolean'
|
|
6141
6128
|
}
|
|
6142
6129
|
];
|
|
6143
6130
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
@@ -6244,7 +6231,7 @@ const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionaryEndpoint: datas
|
|
|
6244
6231
|
href: datasetDictionaryEndpoint + "/csv",
|
|
6245
6232
|
className: "ds-c-button",
|
|
6246
6233
|
style: {
|
|
6247
|
-
width:
|
|
6234
|
+
width: '100%'
|
|
6248
6235
|
},
|
|
6249
6236
|
children: [
|
|
6250
6237
|
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
@@ -6301,7 +6288,7 @@ const $2bd73bb95b0c04ed$var$DatasetDescription = ({ distribution: distribution,
|
|
|
6301
6288
|
const [description, setDescription] = (0, $hgUW1$useState)("");
|
|
6302
6289
|
if (!distribution && !dataset?.identifier) return null;
|
|
6303
6290
|
(0, $hgUW1$useEffect)(()=>{
|
|
6304
|
-
let newDescription =
|
|
6291
|
+
let newDescription = '';
|
|
6305
6292
|
if (customDescription) newDescription = customDescription(dataset, distribution, resource);
|
|
6306
6293
|
else {
|
|
6307
6294
|
if (distribution.data && distribution.data.description) newDescription = distribution.data.description;
|
|
@@ -6316,7 +6303,7 @@ const $2bd73bb95b0c04ed$var$DatasetDescription = ({ distribution: distribution,
|
|
|
6316
6303
|
customDescription
|
|
6317
6304
|
]);
|
|
6318
6305
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6319
|
-
className:
|
|
6306
|
+
className: 'ds-u-measure--wide ds-u-margin-bottom--7',
|
|
6320
6307
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6321
6308
|
className: "ds-u-margin-top--0 dc-c-metadata-description",
|
|
6322
6309
|
children: typeof description === "string" ? /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -6340,7 +6327,7 @@ const $a0f13962e513caa1$var$getDataDictionary = (dataDictionaryUrl)=>{
|
|
|
6340
6327
|
],
|
|
6341
6328
|
queryFn: ()=>{
|
|
6342
6329
|
return fetch(`${dataDictionaryUrl}?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)({}, ACA), {
|
|
6343
|
-
arrayFormat:
|
|
6330
|
+
arrayFormat: 'comma',
|
|
6344
6331
|
encode: false
|
|
6345
6332
|
})}`).then((res)=>res.json());
|
|
6346
6333
|
}
|
|
@@ -6359,7 +6346,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6359
6346
|
conditions: []
|
|
6360
6347
|
};
|
|
6361
6348
|
const { dataset: dataset, isPending: isPending } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl);
|
|
6362
|
-
const title = dataset.title ? dataset.title :
|
|
6349
|
+
const title = dataset.title ? dataset.title : '';
|
|
6363
6350
|
const metadataMapping = {
|
|
6364
6351
|
...(0, $6da0396069e23175$export$bc27cf7ecf44639d),
|
|
6365
6352
|
...customMetadataMapping
|
|
@@ -6367,7 +6354,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6367
6354
|
let distribution = {};
|
|
6368
6355
|
let distributions = dataset.distribution ? dataset.distribution : [];
|
|
6369
6356
|
if (distributions.length) distribution = distributions[0];
|
|
6370
|
-
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)(
|
|
6357
|
+
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)('', rootUrl, {
|
|
6371
6358
|
...options,
|
|
6372
6359
|
limit: defaultPageSize
|
|
6373
6360
|
}, {
|
|
@@ -6381,7 +6368,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6381
6368
|
}) : null;
|
|
6382
6369
|
(0, $hgUW1$useEffect)(()=>{
|
|
6383
6370
|
const localFileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution);
|
|
6384
|
-
if (localFileFormat ===
|
|
6371
|
+
if (localFileFormat === 'csv') resource.setResource(distribution.identifier);
|
|
6385
6372
|
}, [
|
|
6386
6373
|
distribution
|
|
6387
6374
|
]);
|
|
@@ -6436,26 +6423,26 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6436
6423
|
distribution,
|
|
6437
6424
|
window.location.hash
|
|
6438
6425
|
]);
|
|
6439
|
-
const displayDataDictionaryTab = distribution.data && distribution.data.describedBy && distribution.data.describedByType ===
|
|
6426
|
+
const displayDataDictionaryTab = distribution.data && distribution.data.describedBy && distribution.data.describedByType === 'application/vnd.tableschema+json' || datasetSitewideDictionary && datasetSitewideDictionary.length > 0;
|
|
6440
6427
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
6441
6428
|
children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
|
|
6442
6429
|
content: notFoundContent,
|
|
6443
6430
|
siteUrl: rootUrl
|
|
6444
6431
|
}) : /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
6445
|
-
className:
|
|
6432
|
+
className: 'ds-l-container',
|
|
6446
6433
|
children: [
|
|
6447
6434
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
6448
|
-
className:
|
|
6435
|
+
className: 'ds-l-row',
|
|
6449
6436
|
children: [
|
|
6450
6437
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6451
|
-
className:
|
|
6438
|
+
className: 'ds-l-md-col--9',
|
|
6452
6439
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("h1", {
|
|
6453
6440
|
className: "ds-text-heading--3xl",
|
|
6454
6441
|
children: title
|
|
6455
6442
|
})
|
|
6456
6443
|
}),
|
|
6457
6444
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6458
|
-
className:
|
|
6445
|
+
className: 'ds-l-md-col--12 ds-u-margin-y--1 ds-u-text-align--right',
|
|
6459
6446
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
|
|
6460
6447
|
className: "ds-u-margin--0",
|
|
6461
6448
|
children: [
|
|
@@ -6467,7 +6454,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6467
6454
|
})
|
|
6468
6455
|
}),
|
|
6469
6456
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6470
|
-
className:
|
|
6457
|
+
className: 'ds-l-md-col--9',
|
|
6471
6458
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2bd73bb95b0c04ed$export$2e2bcd8739ae039), {
|
|
6472
6459
|
distribution: distribution,
|
|
6473
6460
|
dataset: dataset,
|
|
@@ -6479,9 +6466,9 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6479
6466
|
]
|
|
6480
6467
|
}),
|
|
6481
6468
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6482
|
-
className:
|
|
6469
|
+
className: 'ds-l-row',
|
|
6483
6470
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6484
|
-
className:
|
|
6471
|
+
className: 'ds-l-md-col--12 dc-dataset',
|
|
6485
6472
|
children: !isPending && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tabs), {
|
|
6486
6473
|
onChange: (selectedId, prevSelectedId)=>{
|
|
6487
6474
|
setSelectedTab(selectedId);
|
|
@@ -6489,7 +6476,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6489
6476
|
selectedId: selectedTab,
|
|
6490
6477
|
children: [
|
|
6491
6478
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
6492
|
-
id:
|
|
6479
|
+
id: 'data-table',
|
|
6493
6480
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
6494
6481
|
className: "ds-u-color--primary",
|
|
6495
6482
|
children: [
|
|
@@ -6499,7 +6486,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6499
6486
|
"Data Table"
|
|
6500
6487
|
]
|
|
6501
6488
|
}),
|
|
6502
|
-
className: borderlessTabs ?
|
|
6489
|
+
className: borderlessTabs ? 'ds-u-border--0 ds-u-padding-x--0' : '',
|
|
6503
6490
|
children: (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {
|
|
6504
6491
|
value: {
|
|
6505
6492
|
id: id,
|
|
@@ -6516,7 +6503,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6516
6503
|
})
|
|
6517
6504
|
}),
|
|
6518
6505
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
6519
|
-
id:
|
|
6506
|
+
id: 'overview',
|
|
6520
6507
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
6521
6508
|
className: "ds-u-color--primary",
|
|
6522
6509
|
children: [
|
|
@@ -6526,7 +6513,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6526
6513
|
"Overview"
|
|
6527
6514
|
]
|
|
6528
6515
|
}),
|
|
6529
|
-
className: borderlessTabs ?
|
|
6516
|
+
className: borderlessTabs ? 'ds-u-border--0 ds-u-padding-x--0' : '',
|
|
6530
6517
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $364dc44850cd8f7f$export$2e2bcd8739ae039), {
|
|
6531
6518
|
resource: resource,
|
|
6532
6519
|
dataset: dataset,
|
|
@@ -6536,7 +6523,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6536
6523
|
})
|
|
6537
6524
|
}),
|
|
6538
6525
|
!hideDataDictionary && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
6539
|
-
id:
|
|
6526
|
+
id: 'data-dictionary',
|
|
6540
6527
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
6541
6528
|
className: "ds-u-color--primary",
|
|
6542
6529
|
children: [
|
|
@@ -6546,7 +6533,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6546
6533
|
"Data Dictionary"
|
|
6547
6534
|
]
|
|
6548
6535
|
}),
|
|
6549
|
-
className: borderlessTabs ?
|
|
6536
|
+
className: borderlessTabs ? 'ds-u-border--0 ds-u-padding-x--0' : '',
|
|
6550
6537
|
children: displayDataDictionaryTab ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6012b86ffcaf3f71$export$2e2bcd8739ae039), {
|
|
6551
6538
|
datasetSitewideDictionary: datasetSitewideDictionary,
|
|
6552
6539
|
datasetDictionaryEndpoint: distribution.data.describedBy,
|
|
@@ -6557,7 +6544,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6557
6544
|
})
|
|
6558
6545
|
}),
|
|
6559
6546
|
distribution && distribution.data && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
|
|
6560
|
-
id:
|
|
6547
|
+
id: 'api',
|
|
6561
6548
|
tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
6562
6549
|
className: "ds-u-color--primary",
|
|
6563
6550
|
children: [
|
|
@@ -6567,7 +6554,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6567
6554
|
"API"
|
|
6568
6555
|
]
|
|
6569
6556
|
}),
|
|
6570
|
-
className: borderlessTabs ?
|
|
6557
|
+
className: borderlessTabs ? 'ds-u-border--0 ds-u-padding-x--0' : '',
|
|
6571
6558
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $cf6eaefd6b928de3$export$2e2bcd8739ae039), {
|
|
6572
6559
|
id: id,
|
|
6573
6560
|
rootUrl: rootUrl,
|
|
@@ -6604,13 +6591,13 @@ const $b9af6ce5e2c06331$var$Header = (props)=>{
|
|
|
6604
6591
|
});
|
|
6605
6592
|
const menu = (0, $hgUW1$useRef)(null);
|
|
6606
6593
|
function closeMobileMenu() {
|
|
6607
|
-
const mobileMenuButtonElement = document.querySelector(
|
|
6594
|
+
const mobileMenuButtonElement = document.querySelector('.dkan-c-mobile-menu-button');
|
|
6608
6595
|
if (!mobileMenuButtonElement) return;
|
|
6609
6596
|
mobileMenuButtonElement.focus();
|
|
6610
6597
|
}
|
|
6611
6598
|
// Close mobile menu with escape.
|
|
6612
6599
|
function handleMenuClose(event) {
|
|
6613
|
-
if (event.key ===
|
|
6600
|
+
if (event.key === 'Escape' && mobileMenuOpen) setMobileMenuOpen(false);
|
|
6614
6601
|
}
|
|
6615
6602
|
function handleClick(event) {
|
|
6616
6603
|
// Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
|
|
@@ -6645,7 +6632,7 @@ const $b9af6ce5e2c06331$var$Header = (props)=>{
|
|
|
6645
6632
|
const focusableEls = getFocusableElements(menu.current).selectors.visible;
|
|
6646
6633
|
const firstEl = focusableEls[0];
|
|
6647
6634
|
const lastEl = focusableEls[focusableEls.length - 1];
|
|
6648
|
-
if (event.key ===
|
|
6635
|
+
if (event.key === 'Tab') {
|
|
6649
6636
|
if (event.shiftKey && document.activeElement === firstEl) {
|
|
6650
6637
|
lastEl?.focus();
|
|
6651
6638
|
event.preventDefault();
|
|
@@ -6657,15 +6644,15 @@ const $b9af6ce5e2c06331$var$Header = (props)=>{
|
|
|
6657
6644
|
}
|
|
6658
6645
|
};
|
|
6659
6646
|
(0, $hgUW1$useEffect)(()=>{
|
|
6660
|
-
document.addEventListener(
|
|
6661
|
-
document.addEventListener(
|
|
6647
|
+
document.addEventListener('keyup', handleMenuClose);
|
|
6648
|
+
document.addEventListener('mousedown', handleClick);
|
|
6662
6649
|
if (mobileMenuOpen) handleFocusIn();
|
|
6663
6650
|
else closeMobileMenu();
|
|
6664
|
-
if (menu.current) menu.current.addEventListener(
|
|
6651
|
+
if (menu.current) menu.current.addEventListener('keydown', (evt)=>trapFocus(evt));
|
|
6665
6652
|
return ()=>{
|
|
6666
|
-
document.removeEventListener(
|
|
6667
|
-
document.addEventListener(
|
|
6668
|
-
if (menu.current) menu.current.removeEventListener(
|
|
6653
|
+
document.removeEventListener('keyup', handleMenuClose);
|
|
6654
|
+
document.addEventListener('mousedown', handleClick);
|
|
6655
|
+
if (menu.current) menu.current.removeEventListener('keydown', trapFocus);
|
|
6669
6656
|
};
|
|
6670
6657
|
}, [
|
|
6671
6658
|
mobileMenuOpen
|
|
@@ -6680,7 +6667,7 @@ const $b9af6ce5e2c06331$var$Header = (props)=>{
|
|
|
6680
6667
|
},
|
|
6681
6668
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("header", {
|
|
6682
6669
|
"aria-label": "Site header",
|
|
6683
|
-
className: `dkan-c-header dkan-c-header--${mobileMax ?
|
|
6670
|
+
className: `dkan-c-header dkan-c-header--${mobileMax ? 'mobile' : 'desktop'}`,
|
|
6684
6671
|
children: [
|
|
6685
6672
|
topNav && topNav,
|
|
6686
6673
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -6719,7 +6706,7 @@ const $24918217e48ac525$var$NavLink = ({ link: link, className: className = null
|
|
|
6719
6706
|
onClick: clickHandler ? clickHandler : undefined,
|
|
6720
6707
|
children: [
|
|
6721
6708
|
innerHtml,
|
|
6722
|
-
link?.target ===
|
|
6709
|
+
link?.target === '_blank' && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ExternalLinkIcon), {
|
|
6723
6710
|
className: "ds-u-margin-left--05 ds-c-external-link-icon"
|
|
6724
6711
|
})
|
|
6725
6712
|
]
|
|
@@ -6729,7 +6716,7 @@ const $24918217e48ac525$var$NavLink = ({ link: link, className: className = null
|
|
|
6729
6716
|
var $24918217e48ac525$export$2e2bcd8739ae039 = $24918217e48ac525$var$NavLink;
|
|
6730
6717
|
|
|
6731
6718
|
|
|
6732
|
-
const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = true, emailTitle: emailTitle =
|
|
6719
|
+
const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = true, emailTitle: emailTitle = 'Get Email Updates', emailBody: emailBody = 'Sign up to get the latest information from CMS by choosing the topics and frequency of emails that are best for you.', emailLink: emailLink = '', emailButton: emailButton = 'Sign up for email updates', socialMediaLinks: socialMediaLinks = null, hhsLogo: hhsLogo, cmsLogo: cmsLogo, trademarkContent: trademarkContent = /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
6733
6720
|
children: [
|
|
6734
6721
|
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
6735
6722
|
children: "A federal government website managed and paid for by the U.S. Centers for Medicare & Medicaid Services."
|
|
@@ -6817,14 +6804,14 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
6817
6804
|
/*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
6818
6805
|
className: "ds-u-font-size--sm",
|
|
6819
6806
|
children: footerAdditionalResourcesLinks.filter((link)=>{
|
|
6820
|
-
const noOnClick = Object.keys(link).findIndex((l)=>l ===
|
|
6807
|
+
const noOnClick = Object.keys(link).findIndex((l)=>l === 'onClick');
|
|
6821
6808
|
if (noOnClick === -1 || link.onClick && link.dataTag) return link;
|
|
6822
6809
|
}).map((link)=>{
|
|
6823
6810
|
if (link.onClick && link.dataTag) return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
6824
6811
|
className: "ds-u-margin-bottom--1",
|
|
6825
6812
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
|
|
6826
6813
|
href: link.url,
|
|
6827
|
-
[
|
|
6814
|
+
['data-' + link.dataTag.name]: link.dataTag.value,
|
|
6828
6815
|
onClick: link.onClick,
|
|
6829
6816
|
children: link.label
|
|
6830
6817
|
})
|
|
@@ -6924,7 +6911,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
6924
6911
|
children: [
|
|
6925
6912
|
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
6926
6913
|
id: "svg-inline--fa-title-iRCARP7h6Kp3",
|
|
6927
|
-
children: socialMediaLinks.facebook.title ? socialMediaLinks.facebook.title :
|
|
6914
|
+
children: socialMediaLinks.facebook.title ? socialMediaLinks.facebook.title : 'CMS Facebook'
|
|
6928
6915
|
}),
|
|
6929
6916
|
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
6930
6917
|
transform: "translate(160 256)",
|
|
@@ -6977,7 +6964,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
6977
6964
|
children: [
|
|
6978
6965
|
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
6979
6966
|
id: "svg-inline--fa-title-4z03ITiPPTVF",
|
|
6980
|
-
children: socialMediaLinks.twitter.title ? socialMediaLinks.twitter.title :
|
|
6967
|
+
children: socialMediaLinks.twitter.title ? socialMediaLinks.twitter.title : 'CMS Twitter'
|
|
6981
6968
|
}),
|
|
6982
6969
|
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
6983
6970
|
transform: "translate(256 256)",
|
|
@@ -7030,7 +7017,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
7030
7017
|
children: [
|
|
7031
7018
|
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
7032
7019
|
id: "svg-inline--fa-title-Nm2qsuSKvuRZ",
|
|
7033
|
-
children: socialMediaLinks.linkedin.title ? socialMediaLinks.linkedin.title :
|
|
7020
|
+
children: socialMediaLinks.linkedin.title ? socialMediaLinks.linkedin.title : 'CMS LinkedIn'
|
|
7034
7021
|
}),
|
|
7035
7022
|
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
7036
7023
|
transform: "translate(224 256)",
|
|
@@ -7082,7 +7069,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
7082
7069
|
children: [
|
|
7083
7070
|
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
7084
7071
|
id: "svg-inline--fa-title-youtube",
|
|
7085
|
-
children: socialMediaLinks.youtube.title ? socialMediaLinks.youtube.title :
|
|
7072
|
+
children: socialMediaLinks.youtube.title ? socialMediaLinks.youtube.title : 'CMS youtube'
|
|
7086
7073
|
}),
|
|
7087
7074
|
/*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
7088
7075
|
fill: "currentColor",
|
|
@@ -7117,7 +7104,7 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
7117
7104
|
className: "ds-u-margin-right--2",
|
|
7118
7105
|
children: [
|
|
7119
7106
|
link.label,
|
|
7120
|
-
link?.target ===
|
|
7107
|
+
link?.target === '_blank' && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ExternalLinkIcon), {
|
|
7121
7108
|
className: "ds-u-margin-left--05 ds-c-external-link-icon"
|
|
7122
7109
|
})
|
|
7123
7110
|
]
|
|
@@ -7187,26 +7174,26 @@ const $5655284dbbb89508$var$DocumentationTable = (props)=>{
|
|
|
7187
7174
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
7188
7175
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
|
|
7189
7176
|
stackable: true,
|
|
7190
|
-
className:
|
|
7177
|
+
className: 'ds-c-table',
|
|
7191
7178
|
children: [
|
|
7192
7179
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableHead), {
|
|
7193
7180
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
|
|
7194
7181
|
children: [
|
|
7195
7182
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
7196
|
-
id:
|
|
7197
|
-
headers:
|
|
7183
|
+
id: 'application',
|
|
7184
|
+
headers: 'Application',
|
|
7198
7185
|
children: "Application"
|
|
7199
|
-
},
|
|
7186
|
+
}, 'Application'),
|
|
7200
7187
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
7201
|
-
id:
|
|
7202
|
-
headers:
|
|
7188
|
+
id: 'notes',
|
|
7189
|
+
headers: 'Notes',
|
|
7203
7190
|
children: "Notes"
|
|
7204
|
-
},
|
|
7191
|
+
}, 'Notes'),
|
|
7205
7192
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
7206
|
-
id:
|
|
7207
|
-
headers:
|
|
7193
|
+
id: 'links',
|
|
7194
|
+
headers: 'Links',
|
|
7208
7195
|
children: "Links"
|
|
7209
|
-
},
|
|
7196
|
+
}, 'Links')
|
|
7210
7197
|
]
|
|
7211
7198
|
})
|
|
7212
7199
|
}),
|
|
@@ -7216,19 +7203,19 @@ const $5655284dbbb89508$var$DocumentationTable = (props)=>{
|
|
|
7216
7203
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
7217
7204
|
id: d.id,
|
|
7218
7205
|
stackedTitle: "Application",
|
|
7219
|
-
headers:
|
|
7206
|
+
headers: 'Application',
|
|
7220
7207
|
children: d.application
|
|
7221
7208
|
}, d.id),
|
|
7222
7209
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
7223
7210
|
id: d.id,
|
|
7224
7211
|
stackedTitle: "Notes",
|
|
7225
|
-
headers:
|
|
7212
|
+
headers: 'Notes',
|
|
7226
7213
|
children: d.notes
|
|
7227
7214
|
}, `${d.id}-notes`),
|
|
7228
7215
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
|
|
7229
7216
|
id: d.id,
|
|
7230
7217
|
stackedTitle: "Links",
|
|
7231
|
-
headers:
|
|
7218
|
+
headers: 'Links',
|
|
7232
7219
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
|
|
7233
7220
|
className: "dkan-newtab",
|
|
7234
7221
|
href: d.link,
|
|
@@ -7256,44 +7243,44 @@ var $5655284dbbb89508$export$2e2bcd8739ae039 = $5655284dbbb89508$var$Documentati
|
|
|
7256
7243
|
|
|
7257
7244
|
const $c7bf75f7e8a68780$export$7850f4d545d994c6 = [
|
|
7258
7245
|
{
|
|
7259
|
-
id:
|
|
7260
|
-
application:
|
|
7261
|
-
notes:
|
|
7262
|
-
link:
|
|
7263
|
-
linkText:
|
|
7264
|
-
screenReaderOnlyText:
|
|
7246
|
+
id: 'excel',
|
|
7247
|
+
application: 'Microsoft Excel',
|
|
7248
|
+
notes: 'Official size limitations for Microsoft Excel',
|
|
7249
|
+
link: 'https://support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3?redirectSourcePath=%252fen-us%252farticle%252fExcel-specifications-and-limits-ca36e2dc-1f09-4620-b726-67c00b05040f',
|
|
7250
|
+
linkText: 'Excel Specifications and Limits',
|
|
7251
|
+
screenReaderOnlyText: 'on microsoft.com'
|
|
7265
7252
|
},
|
|
7266
7253
|
{
|
|
7267
|
-
id:
|
|
7268
|
-
application:
|
|
7269
|
-
notes:
|
|
7270
|
-
link:
|
|
7271
|
-
linkText:
|
|
7272
|
-
screenReaderOnlyText:
|
|
7254
|
+
id: 'access',
|
|
7255
|
+
application: 'Microsoft Access',
|
|
7256
|
+
notes: 'Official size limitations for Microsoft Access',
|
|
7257
|
+
link: 'https://support.microsoft.com/en-us/office/access-specifications-0cf3c66f-9cf2-4e32-9568-98c1025bb47c?ui=en-us&rs=en-us&ad=us',
|
|
7258
|
+
linkText: 'Access 2016 Specifications',
|
|
7259
|
+
screenReaderOnlyText: 'on microsoft.com'
|
|
7273
7260
|
},
|
|
7274
7261
|
{
|
|
7275
|
-
id:
|
|
7276
|
-
application:
|
|
7277
|
-
notes:
|
|
7278
|
-
link:
|
|
7279
|
-
linkText:
|
|
7280
|
-
screenReaderOnlyText:
|
|
7262
|
+
id: 'oracle-sql-developer',
|
|
7263
|
+
application: 'Oracle SQL Developer',
|
|
7264
|
+
notes: 'Oracle SQL Developer tool',
|
|
7265
|
+
link: 'https://www.oracle.com/database/sqldeveloper/',
|
|
7266
|
+
linkText: 'Oracle SQL Developer Overview',
|
|
7267
|
+
screenReaderOnlyText: 'on oracle.com'
|
|
7281
7268
|
},
|
|
7282
7269
|
{
|
|
7283
|
-
id:
|
|
7284
|
-
application:
|
|
7285
|
-
notes:
|
|
7286
|
-
link:
|
|
7287
|
-
linkText:
|
|
7288
|
-
screenReaderOnlyText:
|
|
7270
|
+
id: 'oracle-database',
|
|
7271
|
+
application: 'Oracle Database',
|
|
7272
|
+
notes: 'Oracle Database official size limitations',
|
|
7273
|
+
link: 'https://docs.oracle.com/cd/B28359_01/server.111/b28320/limits002.htm#i287915',
|
|
7274
|
+
linkText: 'Oracle Physical Database Limits',
|
|
7275
|
+
screenReaderOnlyText: 'on oracle.com'
|
|
7289
7276
|
},
|
|
7290
7277
|
{
|
|
7291
|
-
id:
|
|
7292
|
-
application:
|
|
7293
|
-
notes:
|
|
7294
|
-
link:
|
|
7295
|
-
linkText:
|
|
7296
|
-
screenReaderOnlyText:
|
|
7278
|
+
id: 'oracle-sql-client-tools',
|
|
7279
|
+
application: 'Oracle SQL Client Tools',
|
|
7280
|
+
notes: 'Oracle SQL Client Tools',
|
|
7281
|
+
link: 'https://www.oracle.com/database/technologies/oracle-database-software-downloads.html',
|
|
7282
|
+
linkText: 'Oracle SQL Client',
|
|
7283
|
+
screenReaderOnlyText: 'on oracle.com'
|
|
7297
7284
|
}
|
|
7298
7285
|
];
|
|
7299
7286
|
|
|
@@ -7321,7 +7308,7 @@ const $669d2782ec2e2250$var$SpecsAndLimits = (props)=>{
|
|
|
7321
7308
|
}),
|
|
7322
7309
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
7323
7310
|
heading: "Notice",
|
|
7324
|
-
className:
|
|
7311
|
+
className: 'ds-u-margin-top--6',
|
|
7325
7312
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
7326
7313
|
className: "ds-c-alert__text",
|
|
7327
7314
|
children: "Be aware of the file size and row limitations of the software you are attempting to import the files into. For information on limitations, look at the software's official documentation."
|
|
@@ -7330,16 +7317,16 @@ const $669d2782ec2e2250$var$SpecsAndLimits = (props)=>{
|
|
|
7330
7317
|
]
|
|
7331
7318
|
}),
|
|
7332
7319
|
/*#__PURE__*/ (0, $hgUW1$jsx)("section", {
|
|
7333
|
-
className:
|
|
7320
|
+
className: 'ds-u-margin-top--4 ds-l-row',
|
|
7334
7321
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
7335
|
-
className:
|
|
7322
|
+
className: 'ds-l-col--12',
|
|
7336
7323
|
children: [
|
|
7337
7324
|
/*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
|
|
7338
7325
|
className: "ds-text-heading--2xl ds-text-heading--2xl",
|
|
7339
7326
|
children: "Documentation by Application"
|
|
7340
7327
|
}),
|
|
7341
7328
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7342
|
-
className:
|
|
7329
|
+
className: 'ds-u-margin-top--4',
|
|
7343
7330
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5655284dbbb89508$export$2e2bcd8739ae039), {
|
|
7344
7331
|
data: documentationList
|
|
7345
7332
|
})
|
|
@@ -7367,7 +7354,7 @@ function $8b67b7ee3fcfb629$export$2e2bcd8739ae039({ id: id, rootUrl: rootUrl, cu
|
|
|
7367
7354
|
const options = {
|
|
7368
7355
|
conditions: query ? JSON.parse(query).map(({ column: column, operator: operator, ...rest })=>({
|
|
7369
7356
|
property: column,
|
|
7370
|
-
operator: operator ===
|
|
7357
|
+
operator: operator === 'is' ? '=' : operator === 'is not' ? '<>' : operator === 'or' ? 'in' : operator,
|
|
7371
7358
|
...rest
|
|
7372
7359
|
})) : []
|
|
7373
7360
|
};
|
|
@@ -7375,13 +7362,13 @@ function $8b67b7ee3fcfb629$export$2e2bcd8739ae039({ id: id, rootUrl: rootUrl, cu
|
|
|
7375
7362
|
let distribution = {};
|
|
7376
7363
|
let distributions = dataset.distribution ? dataset.distribution : [];
|
|
7377
7364
|
if (distributions.length) distribution = distributions[distributionIndex];
|
|
7378
|
-
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)(
|
|
7365
|
+
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)('', rootUrl, {
|
|
7379
7366
|
...options,
|
|
7380
7367
|
limit: defaultPageSize
|
|
7381
7368
|
});
|
|
7382
7369
|
(0, $hgUW1$useEffect)(()=>{
|
|
7383
7370
|
const localFileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution);
|
|
7384
|
-
if (localFileFormat ===
|
|
7371
|
+
if (localFileFormat === 'csv') resource.setResource(distribution.identifier);
|
|
7385
7372
|
}, [
|
|
7386
7373
|
distribution
|
|
7387
7374
|
]);
|
|
@@ -7431,7 +7418,7 @@ function $8b67b7ee3fcfb629$export$2e2bcd8739ae039({ id: id, rootUrl: rootUrl, cu
|
|
|
7431
7418
|
|
|
7432
7419
|
|
|
7433
7420
|
function $374c4669b044ddf8$var$getStartDate(condition, schema, id) {
|
|
7434
|
-
if (schema[id].fields[condition.property].mysql_type ===
|
|
7421
|
+
if (schema[id].fields[condition.property].mysql_type === 'date') {
|
|
7435
7422
|
const newDate = new Date(condition.value);
|
|
7436
7423
|
if (newDate instanceof Date && !isNaN(newDate)) return newDate;
|
|
7437
7424
|
}
|
|
@@ -7448,9 +7435,9 @@ const $374c4669b044ddf8$var$QueryRow = ({ id: id, condition: condition, index: i
|
|
|
7448
7435
|
const [startDate, setStartDate] = (0, $hgUW1$react).useState($374c4669b044ddf8$var$getStartDate(condition, schema, id));
|
|
7449
7436
|
(0, $hgUW1$useEffect)(()=>{
|
|
7450
7437
|
if (property !== condition.property) {
|
|
7451
|
-
if (property) update(index,
|
|
7452
|
-
else update(index,
|
|
7453
|
-
if (schema[id].fields[condition.property].mysql_type ===
|
|
7438
|
+
if (property) update(index, 'property', property);
|
|
7439
|
+
else update(index, 'property', '');
|
|
7440
|
+
if (schema[id].fields[condition.property].mysql_type === 'date') {
|
|
7454
7441
|
if (!value) setValue(startDate.toJSON().slice(0, 10));
|
|
7455
7442
|
}
|
|
7456
7443
|
}
|
|
@@ -7464,16 +7451,16 @@ const $374c4669b044ddf8$var$QueryRow = ({ id: id, condition: condition, index: i
|
|
|
7464
7451
|
]);
|
|
7465
7452
|
(0, $hgUW1$useEffect)(()=>{
|
|
7466
7453
|
if (operator !== condition.operator) {
|
|
7467
|
-
if (operator) update(index,
|
|
7468
|
-
else update(index,
|
|
7454
|
+
if (operator) update(index, 'operator', operator);
|
|
7455
|
+
else update(index, 'operator', '');
|
|
7469
7456
|
}
|
|
7470
7457
|
}, [
|
|
7471
7458
|
operator
|
|
7472
7459
|
]);
|
|
7473
7460
|
(0, $hgUW1$useEffect)(()=>{
|
|
7474
7461
|
if (value !== condition.value) {
|
|
7475
|
-
if (value) update(index,
|
|
7476
|
-
else update(index,
|
|
7462
|
+
if (value) update(index, 'value', value);
|
|
7463
|
+
else update(index, 'value', '');
|
|
7477
7464
|
}
|
|
7478
7465
|
}, [
|
|
7479
7466
|
value
|
|
@@ -7497,7 +7484,7 @@ const $374c4669b044ddf8$var$QueryRow = ({ id: id, condition: condition, index: i
|
|
|
7497
7484
|
onChange: (e)=>setOperator(e.target.value),
|
|
7498
7485
|
className: "ds-l-sm-col--3 ds-l-md-col--2 ds-l-col--12 ds-u-padding--0 ds-u-md-padding-right--2 ds-u-margin-bottom--0 ds-u-md-margin-bottom--2"
|
|
7499
7486
|
}),
|
|
7500
|
-
schema[id].fields[property].mysql_type ===
|
|
7487
|
+
schema[id].fields[property].mysql_type === 'date' ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
7501
7488
|
className: "ds-l-md-col--5 ds-l-lg-col--4 ds-l-sm-col--8 ds-l-col--12 ds-u-padding--0 ds-u-sm-padding-right--2 ds-u-md-padding-right--0 ds-u-lg-padding-right--2 ds-u-margin-bottom--2",
|
|
7502
7489
|
children: [
|
|
7503
7490
|
/*#__PURE__*/ (0, $hgUW1$jsx)("label", {
|
|
@@ -7587,12 +7574,12 @@ const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions, schema: sche
|
|
|
7587
7574
|
className: "ds-u-font-weight--bold",
|
|
7588
7575
|
children: description
|
|
7589
7576
|
}),
|
|
7590
|
-
|
|
7577
|
+
' ',
|
|
7591
7578
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
7592
7579
|
className: "ds-u-font-weight--normal",
|
|
7593
7580
|
children: operator.label.toUpperCase()
|
|
7594
7581
|
}),
|
|
7595
|
-
|
|
7582
|
+
' ',
|
|
7596
7583
|
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
7597
7584
|
className: "ds-u-color--success",
|
|
7598
7585
|
children: formattedText
|
|
@@ -7619,19 +7606,19 @@ var $bef7bff2823feea2$export$2e2bcd8739ae039 = $bef7bff2823feea2$var$QueryTitle;
|
|
|
7619
7606
|
function $3b6ca952e79f0695$var$updateQueryForDatastore(condition) {
|
|
7620
7607
|
let cond = condition;
|
|
7621
7608
|
delete cond.key;
|
|
7622
|
-
if (cond.operator ===
|
|
7609
|
+
if (cond.operator === '=' || cond.operator === '<>') {
|
|
7623
7610
|
if (Array.isArray(cond.value)) cond.value = cond.value.join();
|
|
7624
|
-
cond.value = cond.value.replace(/(^\%+|\%+$)/gm,
|
|
7611
|
+
cond.value = cond.value.replace(/(^\%+|\%+$)/gm, '');
|
|
7625
7612
|
}
|
|
7626
|
-
if (cond.operator.toLowerCase() ===
|
|
7613
|
+
if (cond.operator.toLowerCase() === 'like') {
|
|
7627
7614
|
if (Array.isArray(cond.value)) cond.value = cond.value.join();
|
|
7628
|
-
const cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm,
|
|
7615
|
+
const cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm, '');
|
|
7629
7616
|
cond.value = `%${cleanedValue}%`;
|
|
7630
7617
|
}
|
|
7631
|
-
if (cond.operator.toLowerCase() ===
|
|
7632
|
-
if (!Array.isArray(cond.value)) cond.value = cond.value.split(
|
|
7618
|
+
if (cond.operator.toLowerCase() === 'in') {
|
|
7619
|
+
if (!Array.isArray(cond.value)) cond.value = cond.value.split(',');
|
|
7633
7620
|
}
|
|
7634
|
-
if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm,
|
|
7621
|
+
if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ''));
|
|
7635
7622
|
return cond;
|
|
7636
7623
|
}
|
|
7637
7624
|
const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, customColumns: customColumns, setOffset: setOffset })=>{
|
|
@@ -7651,7 +7638,7 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, custom
|
|
|
7651
7638
|
...queryConditions,
|
|
7652
7639
|
{
|
|
7653
7640
|
property: fields[0],
|
|
7654
|
-
value:
|
|
7641
|
+
value: '',
|
|
7655
7642
|
operator: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[fields[0]].mysql_type)[0].value,
|
|
7656
7643
|
key: Date.now()
|
|
7657
7644
|
}
|
|
@@ -7691,7 +7678,7 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, custom
|
|
|
7691
7678
|
encodeValuesOnly: true,
|
|
7692
7679
|
addQueryPrefix: true
|
|
7693
7680
|
});
|
|
7694
|
-
window.history.pushState({},
|
|
7681
|
+
window.history.pushState({}, '', `${url.origin}${url.pathname}${urlString}`);
|
|
7695
7682
|
};
|
|
7696
7683
|
const updateCondition = (index, key, value)=>{
|
|
7697
7684
|
let newConditions = [
|
|
@@ -7764,7 +7751,7 @@ var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilde
|
|
|
7764
7751
|
|
|
7765
7752
|
|
|
7766
7753
|
const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, customDescription: customDescription, rootUrl: rootUrl, updateAriaLive: updateAriaLive })=>{
|
|
7767
|
-
const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState(
|
|
7754
|
+
const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState('ds-u-padding-y--1');
|
|
7768
7755
|
let apiDocs = (0, $hgUW1$useRef)();
|
|
7769
7756
|
let distribution = {};
|
|
7770
7757
|
let distribution_array = dataset.distribution ? dataset.distribution : [];
|
|
@@ -7776,7 +7763,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7776
7763
|
} : {
|
|
7777
7764
|
conditions: []
|
|
7778
7765
|
};
|
|
7779
|
-
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)(
|
|
7766
|
+
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)('', rootUrl, {
|
|
7780
7767
|
...options,
|
|
7781
7768
|
limit: 25
|
|
7782
7769
|
}, {
|
|
@@ -7792,7 +7779,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7792
7779
|
}, {
|
|
7793
7780
|
encode: true
|
|
7794
7781
|
})}&format=csv`;
|
|
7795
|
-
const pageTitle = distribution.data.title && distribution.data.title.toLowerCase() !==
|
|
7782
|
+
const pageTitle = distribution.data.title && distribution.data.title.toLowerCase() !== 'csv' ? distribution.data.title : dataset.title;
|
|
7796
7783
|
const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
|
|
7797
7784
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("section", {
|
|
7798
7785
|
className: "ds-l-container ds-u-padding-bottom--3 ds-u-margin-bottom--2",
|
|
@@ -7801,7 +7788,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7801
7788
|
children: Object.keys(distribution).length && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
7802
7789
|
children: [
|
|
7803
7790
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7804
|
-
className:
|
|
7791
|
+
className: 'ds-l-md-col--9',
|
|
7805
7792
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Link), {
|
|
7806
7793
|
to: `/dataset/${id}`,
|
|
7807
7794
|
className: "ds-u-padding-y--4 ds-u-display--block",
|
|
@@ -7812,14 +7799,14 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7812
7799
|
})
|
|
7813
7800
|
}),
|
|
7814
7801
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7815
|
-
className:
|
|
7802
|
+
className: 'ds-l-md-col--9',
|
|
7816
7803
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("h1", {
|
|
7817
7804
|
className: "ds-text-heading--3xl",
|
|
7818
7805
|
children: customTitle ? customTitle : pageTitle
|
|
7819
7806
|
})
|
|
7820
7807
|
}),
|
|
7821
7808
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7822
|
-
className:
|
|
7809
|
+
className: 'ds-l-md-col--12 ds-u-margin-y--1 ds-u-text-align--right',
|
|
7823
7810
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
|
|
7824
7811
|
className: "ds-u-margin--0",
|
|
7825
7812
|
children: [
|
|
@@ -7831,7 +7818,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7831
7818
|
})
|
|
7832
7819
|
}),
|
|
7833
7820
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7834
|
-
className:
|
|
7821
|
+
className: 'ds-l-md-col--9',
|
|
7835
7822
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2bd73bb95b0c04ed$export$2e2bcd8739ae039), {
|
|
7836
7823
|
distribution: distribution,
|
|
7837
7824
|
dataset: dataset,
|
|
@@ -7841,13 +7828,13 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7841
7828
|
})
|
|
7842
7829
|
}),
|
|
7843
7830
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7844
|
-
className:
|
|
7831
|
+
className: 'ds-l-md-col--12',
|
|
7845
7832
|
children: Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3b6ca952e79f0695$export$2e2bcd8739ae039), {
|
|
7846
7833
|
resource: resource,
|
|
7847
7834
|
id: distribution.identifier,
|
|
7848
7835
|
customColumns: customColumns,
|
|
7849
7836
|
setOffset: resource.setOffset
|
|
7850
|
-
}) :
|
|
7837
|
+
}) : ''
|
|
7851
7838
|
}),
|
|
7852
7839
|
Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {
|
|
7853
7840
|
value: {
|
|
@@ -7858,7 +7845,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7858
7845
|
customColumns: (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution_array[distIndex].identifier])
|
|
7859
7846
|
},
|
|
7860
7847
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
7861
|
-
className:
|
|
7848
|
+
className: 'ds-l-md-col--12',
|
|
7862
7849
|
children: [
|
|
7863
7850
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $af099c546cb226c7$export$2e2bcd8739ae039), {
|
|
7864
7851
|
includeDensity: true,
|
|
@@ -7880,14 +7867,14 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7880
7867
|
]
|
|
7881
7868
|
})
|
|
7882
7869
|
}) : /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
7883
|
-
className:
|
|
7870
|
+
className: 'ds-l-md-col--12',
|
|
7884
7871
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
7885
7872
|
role: "status",
|
|
7886
7873
|
"aria-valuetext": "Resource loading"
|
|
7887
7874
|
})
|
|
7888
7875
|
}),
|
|
7889
7876
|
dataset.identifier && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
7890
|
-
className:
|
|
7877
|
+
className: 'ds-l-md-col--12',
|
|
7891
7878
|
ref: apiDocs,
|
|
7892
7879
|
children: [
|
|
7893
7880
|
/*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
|
|
@@ -7896,7 +7883,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7896
7883
|
}),
|
|
7897
7884
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
|
|
7898
7885
|
url: `${rootUrl}/metastore/schemas/dataset/items/${dataset.identifier}/docs?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)({}, ACA))}`,
|
|
7899
|
-
docExpansion:
|
|
7886
|
+
docExpansion: 'list',
|
|
7900
7887
|
defaultModelsExpandDepth: -1
|
|
7901
7888
|
})
|
|
7902
7889
|
]
|
|
@@ -7915,7 +7902,7 @@ const $f61ecf9f84951a61$var$FilteredResource = ({ id: id, dist_id: dist_id, loca
|
|
|
7915
7902
|
const [ready, setReady] = (0, $hgUW1$useState)(false);
|
|
7916
7903
|
const [error, setError] = (0, $hgUW1$useState)(false);
|
|
7917
7904
|
const { dataset: dataset } = (0, $b4aa9c66f2e86959$export$2e2bcd8739ae039)(id, rootUrl);
|
|
7918
|
-
const distIndex = dist_id ===
|
|
7905
|
+
const distIndex = dist_id === 'data' ? 0 : dist_id;
|
|
7919
7906
|
(0, $hgUW1$useEffect)(()=>{
|
|
7920
7907
|
if (dataset.error) setError(true);
|
|
7921
7908
|
if (dataset.distribution && dataset.distribution.length) {
|