@civicactions/cmsds-open-data-components 4.0.5 → 4.0.6-oe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +0 -4
- package/dist/main.css.map +1 -1
- package/dist/main.js +213 -223
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
2
|
import {jsx as $hgUW1$jsx, jsxs as $hgUW1$jsxs, Fragment as $hgUW1$Fragment} from "react/jsx-runtime";
|
|
3
|
-
import {Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, Button as $hgUW1$Button, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Spinner as $hgUW1$Spinner, Alert as $hgUW1$Alert, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Choice as $hgUW1$Choice, Dropdown as $hgUW1$Dropdown, Pagination as $hgUW1$Pagination, Table as $hgUW1$Table, TableHead as $hgUW1$TableHead, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableBody as $hgUW1$TableBody, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel,
|
|
3
|
+
import {Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, Button as $hgUW1$Button, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Spinner as $hgUW1$Spinner, Alert as $hgUW1$Alert, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Choice as $hgUW1$Choice, Dropdown as $hgUW1$Dropdown, Pagination as $hgUW1$Pagination, Table as $hgUW1$Table, TableHead as $hgUW1$TableHead, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableBody as $hgUW1$TableBody, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
|
|
4
4
|
import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, useContext as $hgUW1$useContext, useMemo as $hgUW1$useMemo, useCallback as $hgUW1$useCallback} from "react";
|
|
5
5
|
import {NavLink as $hgUW1$NavLink, Link as $hgUW1$Link, useNavigate as $hgUW1$useNavigate, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams} from "react-router-dom";
|
|
6
6
|
import $hgUW1$qs from "qs";
|
|
@@ -2258,15 +2258,19 @@ function $7264a673914aa746$export$2b9377795161999(type) {
|
|
|
2258
2258
|
|
|
2259
2259
|
|
|
2260
2260
|
|
|
2261
|
-
const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: header, sortElement: sortElement,
|
|
2261
|
+
const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: header, sortElement: sortElement, id: id })=>{
|
|
2262
2262
|
const [columnResizing, setColumnResizing] = (0, $hgUW1$useState)("");
|
|
2263
|
+
// Fix for JSX in Data Dictionary Title header cell
|
|
2264
|
+
const ariaLabel = header.id === "titleResizable" ? "Title" : header.column.columnDef.header;
|
|
2263
2265
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("th", {
|
|
2264
2266
|
key: header.id,
|
|
2265
2267
|
style: {
|
|
2266
2268
|
width: header.getSize()
|
|
2267
2269
|
},
|
|
2270
|
+
id: id,
|
|
2268
2271
|
title: typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "",
|
|
2269
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() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none",
|
|
2270
2274
|
children: [
|
|
2271
2275
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2272
2276
|
className: "ds-u-display--flex",
|
|
@@ -2279,7 +2283,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2279
2283
|
sortElement && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
2280
2284
|
onClick: header.column.getToggleSortingHandler(),
|
|
2281
2285
|
className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : "",
|
|
2282
|
-
"aria-label": `${
|
|
2286
|
+
"aria-label": `${ariaLabel} sort order`
|
|
2283
2287
|
})
|
|
2284
2288
|
]
|
|
2285
2289
|
}),
|
|
@@ -2287,7 +2291,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2287
2291
|
onMouseDown: header.getResizeHandler(),
|
|
2288
2292
|
onTouchStart: header.getResizeHandler(),
|
|
2289
2293
|
className: `dc-c-resize-handle ds-u-focus-visible ${header.column.getIsResizing() || header.column.id == columnResizing ? "isResizing" : ""}`,
|
|
2290
|
-
"aria-label": `Resize ${
|
|
2294
|
+
"aria-label": `Resize ${ariaLabel} column`,
|
|
2291
2295
|
onKeyDown: (e)=>{
|
|
2292
2296
|
const columnSizingObject = table.getState().columnSizing;
|
|
2293
2297
|
switch(e.key){
|
|
@@ -2295,21 +2299,13 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2295
2299
|
case " ":
|
|
2296
2300
|
e.preventDefault();
|
|
2297
2301
|
e.stopPropagation();
|
|
2298
|
-
if (columnResizing)
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
} else {
|
|
2303
|
-
// start resizing
|
|
2304
|
-
setColumnResizing(header.column.id);
|
|
2305
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} grabbed.`);
|
|
2306
|
-
}
|
|
2302
|
+
if (columnResizing) // end resizing
|
|
2303
|
+
setColumnResizing("");
|
|
2304
|
+
else // start resizing
|
|
2305
|
+
setColumnResizing(header.column.id);
|
|
2307
2306
|
break;
|
|
2308
2307
|
case "Escape":
|
|
2309
|
-
if (columnResizing)
|
|
2310
|
-
setColumnResizing("");
|
|
2311
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} dropped.`);
|
|
2312
|
-
}
|
|
2308
|
+
if (columnResizing) setColumnResizing("");
|
|
2313
2309
|
break;
|
|
2314
2310
|
case "ArrowRight":
|
|
2315
2311
|
e.preventDefault();
|
|
@@ -2317,7 +2313,6 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2317
2313
|
if (columnResizing) {
|
|
2318
2314
|
columnSizingObject[header.column.id] = header.getSize() + 10;
|
|
2319
2315
|
table.setColumnSizing(columnSizingObject);
|
|
2320
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
|
|
2321
2316
|
}
|
|
2322
2317
|
break;
|
|
2323
2318
|
case "ArrowLeft":
|
|
@@ -2326,7 +2321,6 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2326
2321
|
if (columnResizing) {
|
|
2327
2322
|
columnSizingObject[header.column.id] = header.getSize() - 10;
|
|
2328
2323
|
table.setColumnSizing(columnSizingObject);
|
|
2329
|
-
setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
|
|
2330
2324
|
}
|
|
2331
2325
|
break;
|
|
2332
2326
|
}
|
|
@@ -2341,7 +2335,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
|
|
|
2341
2335
|
var $64a351d3fd8413c3$export$2e2bcd8739ae039 = $64a351d3fd8413c3$var$HeaderResizeElement;
|
|
2342
2336
|
|
|
2343
2337
|
|
|
2344
|
-
const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement = null
|
|
2338
|
+
const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement = null })=>{
|
|
2345
2339
|
return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
|
|
2346
2340
|
className: "dc-thead--truncated dc-thead--resizeable",
|
|
2347
2341
|
children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
@@ -2349,8 +2343,7 @@ const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElem
|
|
|
2349
2343
|
children: headerGroup.headers.map((header)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
|
|
2350
2344
|
table: table,
|
|
2351
2345
|
header: header,
|
|
2352
|
-
sortElement: sortElement
|
|
2353
|
-
setAriaLiveFeedback: setAriaLiveFeedback
|
|
2346
|
+
sortElement: sortElement
|
|
2354
2347
|
}, header.id + "_dataTableResize"))
|
|
2355
2348
|
}, headerGroup.id))
|
|
2356
2349
|
});
|
|
@@ -2373,6 +2366,7 @@ const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table, sortElement: sortE
|
|
|
2373
2366
|
},
|
|
2374
2367
|
title: header.column.columnDef.header,
|
|
2375
2368
|
className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
|
|
2369
|
+
"aria-sort": header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none",
|
|
2376
2370
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2377
2371
|
onClick: header.column.getToggleSortingHandler(),
|
|
2378
2372
|
className: "ds-u-display--flex",
|
|
@@ -3662,7 +3656,6 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3662
3656
|
const { conditions: conditions } = resource;
|
|
3663
3657
|
const data = resource.values;
|
|
3664
3658
|
const [sorting, setSorting] = (0, $hgUW1$useState)([]);
|
|
3665
|
-
const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
|
|
3666
3659
|
const dataTableWrapperElement = (0, $hgUW1$useRef)(null);
|
|
3667
3660
|
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
3668
3661
|
const table_columns = columns.map((col)=>{
|
|
@@ -3858,57 +3851,48 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
|
|
|
3858
3851
|
})
|
|
3859
3852
|
]
|
|
3860
3853
|
}),
|
|
3861
|
-
/*#__PURE__*/ (0, $hgUW1$
|
|
3854
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3862
3855
|
className: "dc-c-datatable-wrapper ds-u-border-x--1 ds-u-border-bottom--1",
|
|
3863
3856
|
tabIndex: 0,
|
|
3864
3857
|
ref: dataTableWrapperElement,
|
|
3865
|
-
children:
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
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
|
-
}, row.id);
|
|
3901
|
-
})
|
|
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);
|
|
3902
3892
|
})
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
className: "sr-only",
|
|
3907
|
-
"aria-live": "assertive",
|
|
3908
|
-
"aria-atomic": "true",
|
|
3909
|
-
children: ariaLiveFeedback
|
|
3910
|
-
})
|
|
3911
|
-
]
|
|
3893
|
+
})
|
|
3894
|
+
]
|
|
3895
|
+
})
|
|
3912
3896
|
}),
|
|
3913
3897
|
loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
3914
3898
|
"aria-valuetext": "Dataset loading",
|
|
@@ -4539,42 +4523,6 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4539
4523
|
window.history.pushState({}, "", `${url.origin}${url.pathname}${urlString}`);
|
|
4540
4524
|
}
|
|
4541
4525
|
const pageSize = defaultPageSize;
|
|
4542
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4543
|
-
const baseNumber = Number(totalItems) > 0 ? 1 : 0;
|
|
4544
|
-
const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
|
|
4545
|
-
const endingNumber = Number(pageSize) * Number(page);
|
|
4546
|
-
setCurrentResultNumbers({
|
|
4547
|
-
total: Number(totalItems),
|
|
4548
|
-
startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
|
|
4549
|
-
endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
|
|
4550
|
-
});
|
|
4551
|
-
setTimeout(()=>{
|
|
4552
|
-
setAnnouncementText(`Showing ${startingNumber} to ${endingNumber} of ${totalItems} datasets`);
|
|
4553
|
-
}, 100);
|
|
4554
|
-
if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
|
|
4555
|
-
else setNoResults(false);
|
|
4556
|
-
}, [
|
|
4557
|
-
totalItems,
|
|
4558
|
-
pageSize,
|
|
4559
|
-
page
|
|
4560
|
-
]);
|
|
4561
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4562
|
-
if (page !== 1 && (transformedParams.fulltext !== fulltext || transformedParams.selectedFacets !== selectedFacets)) setPage(1);
|
|
4563
|
-
}, [
|
|
4564
|
-
fulltext,
|
|
4565
|
-
selectedFacets
|
|
4566
|
-
]);
|
|
4567
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4568
|
-
if (totalItems !== null && totalItems !== undefined && totalItems > 0) {
|
|
4569
|
-
var params = buildSearchParams(true);
|
|
4570
|
-
if (params !== location.search) setSearchParams(params);
|
|
4571
|
-
}
|
|
4572
|
-
}, [
|
|
4573
|
-
page,
|
|
4574
|
-
sort,
|
|
4575
|
-
sortOrder,
|
|
4576
|
-
totalItems
|
|
4577
|
-
]);
|
|
4578
4526
|
function resetFilters() {
|
|
4579
4527
|
setFullText(defaultFulltext);
|
|
4580
4528
|
setFilterText(defaultFulltext);
|
|
@@ -4622,6 +4570,50 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4622
4570
|
theme: null,
|
|
4623
4571
|
keyword: null
|
|
4624
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
|
+
]);
|
|
4625
4617
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4626
4618
|
children: [
|
|
4627
4619
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $5723016a5461c1ca$export$2e2bcd8739ae039), {
|
|
@@ -4630,6 +4622,15 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4630
4622
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("section", {
|
|
4631
4623
|
className: "ds-l-container",
|
|
4632
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
|
+
}),
|
|
4633
4634
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4634
4635
|
className: "ds-l-row",
|
|
4635
4636
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -4714,34 +4715,23 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4714
4715
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4715
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",
|
|
4716
4717
|
children: [
|
|
4717
|
-
enablePagination && /*#__PURE__*/ (0, $hgUW1$
|
|
4718
|
+
enablePagination && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4718
4719
|
className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--8 ds-u-sm-padding-left--0",
|
|
4719
|
-
children:
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
" datasets"
|
|
4733
|
-
]
|
|
4734
|
-
})
|
|
4735
|
-
}),
|
|
4736
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4737
|
-
className: "ds-u-visibility--screen-reader",
|
|
4738
|
-
role: "status",
|
|
4739
|
-
"aria-live": "assertive",
|
|
4740
|
-
"aria-atomic": "true",
|
|
4741
|
-
"data-testid": "currentResults",
|
|
4742
|
-
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
|
+
]
|
|
4743
4733
|
})
|
|
4744
|
-
|
|
4734
|
+
})
|
|
4745
4735
|
}),
|
|
4746
4736
|
enableSort && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4747
4737
|
className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--4 ds-u-sm-padding-right--0",
|
|
@@ -4762,6 +4752,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4762
4752
|
children: [
|
|
4763
4753
|
noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
4764
4754
|
variation: "error",
|
|
4755
|
+
role: "region",
|
|
4765
4756
|
heading: "No results found."
|
|
4766
4757
|
}),
|
|
4767
4758
|
data && data.data.results ? Object.keys(data.data.results).map((key)=>{
|
|
@@ -4789,6 +4780,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
4789
4780
|
}, item.identifier);
|
|
4790
4781
|
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
4791
4782
|
variation: "error",
|
|
4783
|
+
role: "region",
|
|
4792
4784
|
heading: "Could not connect to the API."
|
|
4793
4785
|
})
|
|
4794
4786
|
]
|
|
@@ -4901,37 +4893,6 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4901
4893
|
}
|
|
4902
4894
|
};
|
|
4903
4895
|
const pageSize = defaultPageSize;
|
|
4904
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4905
|
-
// Update browser URL with current search params
|
|
4906
|
-
const params = buildSearchParams(true);
|
|
4907
|
-
const url = new URL(window.location.href);
|
|
4908
|
-
window.history.pushState({}, "", `${url.origin}${url.pathname}${params}`);
|
|
4909
|
-
const baseNumber = Number(totalItems) > 0 ? 1 : 0;
|
|
4910
|
-
const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
|
|
4911
|
-
const endingNumber = Number(pageSize) * Number(page);
|
|
4912
|
-
setCurrentResultNumbers({
|
|
4913
|
-
total: Number(totalItems),
|
|
4914
|
-
startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
|
|
4915
|
-
endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
|
|
4916
|
-
});
|
|
4917
|
-
setTimeout(()=>{
|
|
4918
|
-
setAnnouncementText(`Showing ${startingNumber} to ${endingNumber} of ${totalItems} datasets`);
|
|
4919
|
-
}, 100);
|
|
4920
|
-
if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
|
|
4921
|
-
else setNoResults(false);
|
|
4922
|
-
}, [
|
|
4923
|
-
totalItems,
|
|
4924
|
-
pageSize,
|
|
4925
|
-
page
|
|
4926
|
-
]);
|
|
4927
|
-
(0, $hgUW1$useEffect)(()=>{
|
|
4928
|
-
var params = buildSearchParams(true);
|
|
4929
|
-
if (params !== location.search) setSearchParams(params);
|
|
4930
|
-
}, [
|
|
4931
|
-
page,
|
|
4932
|
-
sort,
|
|
4933
|
-
sortOrder
|
|
4934
|
-
]);
|
|
4935
4896
|
function buildSearchParams(includePage) {
|
|
4936
4897
|
let newParams = {};
|
|
4937
4898
|
if (Number(page) !== 1 && includePage) newParams.page = page;
|
|
@@ -4961,6 +4922,45 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4961
4922
|
}
|
|
4962
4923
|
});
|
|
4963
4924
|
if (data && data.data.total && totalItems != data.data.total) setTotalItems(data.data.total);
|
|
4925
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4926
|
+
// Update browser URL with current search params
|
|
4927
|
+
const params = buildSearchParams(true);
|
|
4928
|
+
const url = new URL(window.location.href);
|
|
4929
|
+
window.history.pushState({}, "", `${url.origin}${url.pathname}${params}`);
|
|
4930
|
+
const baseNumber = Number(totalItems) > 0 ? 1 : 0;
|
|
4931
|
+
const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
|
|
4932
|
+
const endingNumber = Number(pageSize) * Number(page);
|
|
4933
|
+
setCurrentResultNumbers({
|
|
4934
|
+
total: Number(totalItems),
|
|
4935
|
+
startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
|
|
4936
|
+
endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
|
|
4937
|
+
});
|
|
4938
|
+
if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
|
|
4939
|
+
else setNoResults(false);
|
|
4940
|
+
}, [
|
|
4941
|
+
totalItems,
|
|
4942
|
+
pageSize,
|
|
4943
|
+
page
|
|
4944
|
+
]);
|
|
4945
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
4946
|
+
var params = buildSearchParams(true);
|
|
4947
|
+
if (params !== location.search) setSearchParams(params);
|
|
4948
|
+
}, [
|
|
4949
|
+
page,
|
|
4950
|
+
sort,
|
|
4951
|
+
sortOrder
|
|
4952
|
+
]);
|
|
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
|
+
]);
|
|
4964
4964
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4965
4965
|
children: [
|
|
4966
4966
|
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $5723016a5461c1ca$export$2e2bcd8739ae039), {
|
|
@@ -4969,6 +4969,15 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
4969
4969
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("section", {
|
|
4970
4970
|
className: "ds-l-container",
|
|
4971
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
|
+
}),
|
|
4972
4981
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4973
4982
|
className: "ds-l-row",
|
|
4974
4983
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -5009,33 +5018,22 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5009
5018
|
className: "ds-u-margin-bottom--3",
|
|
5010
5019
|
children: introText ? introText : null
|
|
5011
5020
|
}),
|
|
5012
|
-
enablePagination && /*#__PURE__*/ (0, $hgUW1$
|
|
5013
|
-
children:
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
" datasets"
|
|
5027
|
-
]
|
|
5028
|
-
})
|
|
5029
|
-
}),
|
|
5030
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
5031
|
-
className: "ds-u-visibility--screen-reader",
|
|
5032
|
-
role: "status",
|
|
5033
|
-
"aria-live": "assertive",
|
|
5034
|
-
"aria-atomic": "true",
|
|
5035
|
-
"data-testid": "currentResults",
|
|
5036
|
-
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
|
+
]
|
|
5037
5035
|
})
|
|
5038
|
-
|
|
5036
|
+
})
|
|
5039
5037
|
})
|
|
5040
5038
|
]
|
|
5041
5039
|
}),
|
|
@@ -5058,6 +5056,7 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5058
5056
|
children: [
|
|
5059
5057
|
noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
5060
5058
|
variation: "error",
|
|
5059
|
+
role: "region",
|
|
5061
5060
|
heading: "No results found."
|
|
5062
5061
|
}),
|
|
5063
5062
|
data && data.data.results ? Object.keys(data.data.results).map((key)=>{
|
|
@@ -5072,6 +5071,7 @@ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enabl
|
|
|
5072
5071
|
}, item.identifier);
|
|
5073
5072
|
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
5074
5073
|
variation: "error",
|
|
5074
|
+
role: "region",
|
|
5075
5075
|
heading: "Could not connect to the API."
|
|
5076
5076
|
})
|
|
5077
5077
|
]
|
|
@@ -5188,6 +5188,11 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
5188
5188
|
const [schema, setSchema] = (0, $hgUW1$useState)({});
|
|
5189
5189
|
// const [joins, setJoins] = useState()
|
|
5190
5190
|
const [properties, setProperties] = (0, $hgUW1$useState)(options.properties ? options.properties : undefined);
|
|
5191
|
+
// Check drupalSettings for datastore_query_api
|
|
5192
|
+
const useDatasetAPI = typeof window !== "undefined" && window.drupalSettings?.datastore_query_api === true;
|
|
5193
|
+
const datasetID = additionalParams.datasetID;
|
|
5194
|
+
// Remove datasetID from params to avoid sending it to the API
|
|
5195
|
+
const { datasetID: _, ...restAdditionalParams } = additionalParams;
|
|
5191
5196
|
let params = {
|
|
5192
5197
|
keys: keys,
|
|
5193
5198
|
limit: limit,
|
|
@@ -5196,7 +5201,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
5196
5201
|
sorts: sort,
|
|
5197
5202
|
properties: properties,
|
|
5198
5203
|
groupings: groupings,
|
|
5199
|
-
...
|
|
5204
|
+
...restAdditionalParams
|
|
5200
5205
|
};
|
|
5201
5206
|
params = (0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA);
|
|
5202
5207
|
const paramsString = Object.keys(params).length ? `${(0, $hgUW1$qs).stringify(params)}` : "";
|
|
@@ -5205,13 +5210,15 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
5205
5210
|
if (!requireConditions) enabled = true;
|
|
5206
5211
|
if (conditions && conditions.length) enabled = true;
|
|
5207
5212
|
}
|
|
5213
|
+
// Change whether distribution API or dataset API is used based on option
|
|
5214
|
+
const queryID = useDatasetAPI && datasetID ? `${datasetID}/0` : id;
|
|
5208
5215
|
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
5209
5216
|
queryKey: [
|
|
5210
5217
|
"datastore" + id + paramsString
|
|
5211
5218
|
],
|
|
5212
5219
|
queryFn: ()=>{
|
|
5213
5220
|
setCount(null);
|
|
5214
|
-
return fetch(`${rootUrl}/datastore/query/${
|
|
5221
|
+
return fetch(`${rootUrl}/datastore/query/${queryID}?${paramsString}`).then((res)=>res.json());
|
|
5215
5222
|
},
|
|
5216
5223
|
enabled: enabled
|
|
5217
5224
|
});
|
|
@@ -5225,7 +5232,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
5225
5232
|
count: true,
|
|
5226
5233
|
schema: true
|
|
5227
5234
|
};
|
|
5228
|
-
return fetch(`${rootUrl}/datastore/query/${
|
|
5235
|
+
return fetch(`${rootUrl}/datastore/query/${queryID}?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(unfilteredParams, ACA))}`).then((res)=>res.json());
|
|
5229
5236
|
}
|
|
5230
5237
|
});
|
|
5231
5238
|
(0, $hgUW1$useEffect)(()=>{
|
|
@@ -5827,7 +5834,6 @@ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
|
|
|
5827
5834
|
|
|
5828
5835
|
const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns, tableData: tableData, pageSize: pageSize, columnFilters: columnFilters })=>{
|
|
5829
5836
|
const [sorting, setSorting] = (0, $hgUW1$useState)([]);
|
|
5830
|
-
const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
|
|
5831
5837
|
const mobile = (0, $hgUW1$useMediaQuery)({
|
|
5832
5838
|
minWidth: 0,
|
|
5833
5839
|
maxWidth: 544
|
|
@@ -5940,8 +5946,8 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5940
5946
|
return header.id === "titleResizable" ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
|
|
5941
5947
|
table: table,
|
|
5942
5948
|
header: header,
|
|
5943
|
-
|
|
5944
|
-
|
|
5949
|
+
sortElement: sortElement,
|
|
5950
|
+
id: "dataDictionary_" + header.id
|
|
5945
5951
|
}, header.id + "_resize") : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableCell), {
|
|
5946
5952
|
key: header.id,
|
|
5947
5953
|
className: `ds-u-border-y--2 ds-u-border--dark ds-u-border-x--0`,
|
|
@@ -5979,12 +5985,6 @@ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns,
|
|
|
5979
5985
|
})
|
|
5980
5986
|
]
|
|
5981
5987
|
}),
|
|
5982
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
5983
|
-
className: "sr-only",
|
|
5984
|
-
"aria-live": "assertive",
|
|
5985
|
-
"aria-atomic": "true",
|
|
5986
|
-
children: ariaLiveFeedback
|
|
5987
|
-
}),
|
|
5988
5988
|
table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
5989
5989
|
variation: "warn",
|
|
5990
5990
|
children: "No results found for the current filters"
|
|
@@ -6294,7 +6294,7 @@ const $2bd73bb95b0c04ed$var$DatasetDescription = ({ distribution: distribution,
|
|
|
6294
6294
|
if (distribution.data && distribution.data.description) newDescription = distribution.data.description;
|
|
6295
6295
|
else if (dataset.description) newDescription = dataset.description;
|
|
6296
6296
|
}
|
|
6297
|
-
if (
|
|
6297
|
+
if (description !== newDescription && updateAriaLive) updateAriaLive(newDescription);
|
|
6298
6298
|
setDescription(newDescription);
|
|
6299
6299
|
}, [
|
|
6300
6300
|
resource,
|
|
@@ -6306,11 +6306,9 @@ const $2bd73bb95b0c04ed$var$DatasetDescription = ({ distribution: distribution,
|
|
|
6306
6306
|
className: "ds-u-measure--wide ds-u-margin-bottom--7",
|
|
6307
6307
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
6308
6308
|
className: "ds-u-margin-top--0 dc-c-metadata-description",
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
}
|
|
6313
|
-
}) : description
|
|
6309
|
+
dangerouslySetInnerHTML: {
|
|
6310
|
+
__html: (0, $hgUW1$dompurify).sanitize(description)
|
|
6311
|
+
}
|
|
6314
6312
|
})
|
|
6315
6313
|
});
|
|
6316
6314
|
};
|
|
@@ -6357,6 +6355,8 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6357
6355
|
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)("", rootUrl, {
|
|
6358
6356
|
...options,
|
|
6359
6357
|
limit: defaultPageSize
|
|
6358
|
+
}, {
|
|
6359
|
+
datasetID: id // pass datasetID into additional params to enable dataset API option in useDatastore
|
|
6360
6360
|
});
|
|
6361
6361
|
const siteWideDataDictionary = dataDictionaryUrl ? $a0f13962e513caa1$var$getDataDictionary(rootUrl + dataDictionaryUrl).dataDictionary : null;
|
|
6362
6362
|
// compare schema fields with siteWideDataDictionary to display commonalities for now
|
|
@@ -6422,7 +6422,6 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
|
|
|
6422
6422
|
window.location.hash
|
|
6423
6423
|
]);
|
|
6424
6424
|
const displayDataDictionaryTab = distribution.data && distribution.data.describedBy && distribution.data.describedByType === "application/vnd.tableschema+json" || datasetSitewideDictionary && datasetSitewideDictionary.length > 0;
|
|
6425
|
-
const formatType = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution);
|
|
6426
6425
|
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
6427
6426
|
children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
|
|
6428
6427
|
content: notFoundContent,
|
|
@@ -6694,21 +6693,15 @@ var $b9af6ce5e2c06331$export$2e2bcd8739ae039 = $b9af6ce5e2c06331$var$Header;
|
|
|
6694
6693
|
|
|
6695
6694
|
|
|
6696
6695
|
|
|
6697
|
-
|
|
6698
6696
|
const $24918217e48ac525$var$NavLink = ({ link: link, className: className = null, wrapLabel: wrapLabel = false, clickHandler: clickHandler })=>{
|
|
6699
6697
|
const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
6700
6698
|
children: link.label
|
|
6701
6699
|
}) : link.label;
|
|
6702
|
-
return /*#__PURE__*/ (0, $hgUW1$
|
|
6700
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
|
|
6703
6701
|
className: ({ isActive: isActive })=>isActive ? `dc-c-active-link ${className}` : `${className}`,
|
|
6704
6702
|
to: link.url,
|
|
6705
6703
|
onClick: clickHandler ? clickHandler : undefined,
|
|
6706
|
-
children:
|
|
6707
|
-
innerHtml,
|
|
6708
|
-
link?.target === "_blank" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ExternalLinkIcon), {
|
|
6709
|
-
className: "ds-u-margin-left--05 ds-c-external-link-icon"
|
|
6710
|
-
})
|
|
6711
|
-
]
|
|
6704
|
+
children: innerHtml
|
|
6712
6705
|
});
|
|
6713
6706
|
// }
|
|
6714
6707
|
};
|
|
@@ -7098,15 +7091,10 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = tru
|
|
|
7098
7091
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
7099
7092
|
className: "ds-u-padding--0 ds-u-display--flex ds-u-lg-flex-direction--row ds-u-flex-direction--column",
|
|
7100
7093
|
children: footerUtilityLinks.map((link)=>/*#__PURE__*/ (0, $hgUW1$jsx)("li", {
|
|
7101
|
-
children: /*#__PURE__*/ (0, $hgUW1$
|
|
7094
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("a", {
|
|
7102
7095
|
href: link.url,
|
|
7103
7096
|
className: "ds-u-margin-right--2",
|
|
7104
|
-
children:
|
|
7105
|
-
link.label,
|
|
7106
|
-
link?.target === "_blank" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ExternalLinkIcon), {
|
|
7107
|
-
className: "ds-u-margin-left--05 ds-c-external-link-icon"
|
|
7108
|
-
})
|
|
7109
|
-
]
|
|
7097
|
+
children: link.label
|
|
7110
7098
|
})
|
|
7111
7099
|
}, link.id))
|
|
7112
7100
|
})
|
|
@@ -7765,6 +7753,8 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
|
|
|
7765
7753
|
const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)("", rootUrl, {
|
|
7766
7754
|
...options,
|
|
7767
7755
|
limit: 25
|
|
7756
|
+
}, {
|
|
7757
|
+
datasetID: id
|
|
7768
7758
|
});
|
|
7769
7759
|
(0, $hgUW1$useEffect)(()=>{
|
|
7770
7760
|
if (distribution.identifier) resource.setResource(distribution.identifier);
|