@civicactions/cmsds-open-data-components 4.0.17 → 4.0.19-alpha.0
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 +217 -217
- package/dist/main.css.map +1 -1
- package/dist/main.js +1099 -1054
- package/dist/main.js.map +1 -1
- package/dist/types.d.ts +60 -26
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -9,17 +9,17 @@ import {useQuery as $hgUW1$useQuery, QueryClient as $hgUW1$QueryClient, QueryCli
|
|
|
9
9
|
import {useMediaQuery as $hgUW1$useMediaQuery} from "react-responsive";
|
|
10
10
|
import $hgUW1$dompurify from "dompurify";
|
|
11
11
|
import $hgUW1$lodashtruncate from "lodash.truncate";
|
|
12
|
-
import $hgUW1$swaggeruireact from "swagger-ui-react";
|
|
13
|
-
import {SpanOpenAPIVersion as $hgUW1$SpanOpenAPIVersion, SpanVersionStamp as $hgUW1$SpanVersionStamp} from "@civicactions/swagger-ui-layout";
|
|
14
|
-
import "swagger-ui-react/swagger-ui.css";
|
|
15
12
|
import $hgUW1$proptypes from "prop-types";
|
|
16
|
-
import {createColumnHelper as $hgUW1$createColumnHelper, useReactTable as $hgUW1$useReactTable, getCoreRowModel as $hgUW1$getCoreRowModel, getSortedRowModel as $hgUW1$getSortedRowModel, flexRender as $hgUW1$flexRender, getFilteredRowModel as $hgUW1$getFilteredRowModel, getPaginationRowModel as $hgUW1$getPaginationRowModel} from "@tanstack/react-table";
|
|
17
13
|
import {KeyboardSensor as $hgUW1$KeyboardSensor, PointerSensor as $hgUW1$PointerSensor, useSensors as $hgUW1$useSensors, useSensor as $hgUW1$useSensor, DndContext as $hgUW1$DndContext, closestCenter as $hgUW1$closestCenter} from "@dnd-kit/core";
|
|
18
14
|
import {sortableKeyboardCoordinates as $hgUW1$sortableKeyboardCoordinates, arrayMove as $hgUW1$arrayMove, SortableContext as $hgUW1$SortableContext, verticalListSortingStrategy as $hgUW1$verticalListSortingStrategy, useSortable as $hgUW1$useSortable} from "@dnd-kit/sortable";
|
|
19
15
|
import {restrictToVerticalAxis as $hgUW1$restrictToVerticalAxis} from "@dnd-kit/modifiers";
|
|
20
16
|
import {CSS as $hgUW1$CSS} from "@dnd-kit/utilities";
|
|
17
|
+
import {createColumnHelper as $hgUW1$createColumnHelper, useReactTable as $hgUW1$useReactTable, getCoreRowModel as $hgUW1$getCoreRowModel, getSortedRowModel as $hgUW1$getSortedRowModel, flexRender as $hgUW1$flexRender, getFilteredRowModel as $hgUW1$getFilteredRowModel, getPaginationRowModel as $hgUW1$getPaginationRowModel} from "@tanstack/react-table";
|
|
21
18
|
import $hgUW1$reactdatepicker from "react-datepicker";
|
|
22
19
|
import "react-datepicker/dist/react-datepicker.css";
|
|
20
|
+
import $hgUW1$swaggeruireact from "swagger-ui-react";
|
|
21
|
+
import {SpanOpenAPIVersion as $hgUW1$SpanOpenAPIVersion, SpanVersionStamp as $hgUW1$SpanVersionStamp} from "@civicactions/swagger-ui-layout";
|
|
22
|
+
import "swagger-ui-react/swagger-ui.css";
|
|
23
23
|
|
|
24
24
|
// Components
|
|
25
25
|
|
|
@@ -1509,7 +1509,12 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
|
|
|
1509
1509
|
};
|
|
1510
1510
|
function updateSelectedFacets(key, value) {
|
|
1511
1511
|
const newFacets = {
|
|
1512
|
-
|
|
1512
|
+
theme: [
|
|
1513
|
+
...selectedFacets.theme
|
|
1514
|
+
],
|
|
1515
|
+
keyword: [
|
|
1516
|
+
...selectedFacets.keyword
|
|
1517
|
+
]
|
|
1513
1518
|
};
|
|
1514
1519
|
if (key === 'theme') {
|
|
1515
1520
|
const existingFacet = newFacets.theme.findIndex((s)=>s === value);
|
|
@@ -2397,29 +2402,6 @@ var $c068004d499082cc$export$2e2bcd8739ae039 = $c068004d499082cc$var$DatasetList
|
|
|
2397
2402
|
|
|
2398
2403
|
|
|
2399
2404
|
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
2403
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2404
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
|
|
2405
|
-
url: endpoint,
|
|
2406
|
-
plugins: [
|
|
2407
|
-
(0, $hgUW1$SpanOpenAPIVersion),
|
|
2408
|
-
(0, $hgUW1$SpanVersionStamp)
|
|
2409
|
-
]
|
|
2410
|
-
})
|
|
2411
|
-
});
|
|
2412
|
-
};
|
|
2413
|
-
var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
2405
|
const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className = 'data-table-results' })=>{
|
|
2424
2406
|
const numTotalRows = totalRows;
|
|
2425
2407
|
if (numTotalRows === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
@@ -2469,428 +2451,420 @@ var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePa
|
|
|
2469
2451
|
|
|
2470
2452
|
|
|
2471
2453
|
|
|
2472
|
-
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding, tablePadding: tablePadding })=>{
|
|
2473
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2474
|
-
className: "ds-u-display--flex",
|
|
2475
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
2476
|
-
options: [
|
|
2477
|
-
{
|
|
2478
|
-
label: 'Tight',
|
|
2479
|
-
value: 'ds-u-padding-y--0'
|
|
2480
|
-
},
|
|
2481
|
-
{
|
|
2482
|
-
label: 'Normal',
|
|
2483
|
-
value: 'ds-u-padding-y--1'
|
|
2484
|
-
},
|
|
2485
|
-
{
|
|
2486
|
-
label: 'Expanded',
|
|
2487
|
-
value: 'ds-u-padding-y--2'
|
|
2488
|
-
}
|
|
2489
|
-
],
|
|
2490
|
-
label: "Display density:",
|
|
2491
|
-
labelClassName: "ds-u-margin-top--0",
|
|
2492
|
-
name: "datatable_display_density",
|
|
2493
|
-
onChange: (e)=>setTablePadding(e.target.value),
|
|
2494
|
-
defaultValue: tablePadding
|
|
2495
|
-
})
|
|
2496
|
-
});
|
|
2497
|
-
};
|
|
2498
|
-
$1e012d1e3b534af0$var$DataTableDensity.propTypes = {
|
|
2499
|
-
setTablePadding: (0, $hgUW1$proptypes).func.isRequired
|
|
2500
|
-
};
|
|
2501
|
-
var $1e012d1e3b534af0$export$2e2bcd8739ae039 = $1e012d1e3b534af0$var$DataTableDensity;
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
2454
|
|
|
2506
2455
|
|
|
2507
2456
|
|
|
2508
|
-
const $7848c69a021266f7$var$DataTableRowChanger = ({ limit: limit, rowOptions: rowOptions = [
|
|
2509
|
-
10,
|
|
2510
|
-
25,
|
|
2511
|
-
50,
|
|
2512
|
-
100
|
|
2513
|
-
], setLimit: setLimit })=>{
|
|
2514
|
-
const rowOptionsFormatted = rowOptions.map((row)=>({
|
|
2515
|
-
label: row.toString(),
|
|
2516
|
-
value: row.toString()
|
|
2517
|
-
}));
|
|
2518
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2519
|
-
className: "ds-u-display--flex",
|
|
2520
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
2521
|
-
options: rowOptionsFormatted,
|
|
2522
|
-
label: "Rows per page:",
|
|
2523
|
-
labelClassName: "ds-u-margin-top--0",
|
|
2524
|
-
name: "datatable_rows_per_page",
|
|
2525
|
-
onChange: (e)=>setLimit(e.target.value),
|
|
2526
|
-
defaultValue: limit.toString()
|
|
2527
|
-
})
|
|
2528
|
-
});
|
|
2529
|
-
};
|
|
2530
|
-
$7848c69a021266f7$var$DataTableRowChanger.propTypes = {
|
|
2531
|
-
rowOptions: (0, $hgUW1$proptypes).arrayOf((0, $hgUW1$proptypes).number),
|
|
2532
|
-
setLimit: (0, $hgUW1$proptypes).func.isRequired,
|
|
2533
|
-
limit: (0, $hgUW1$proptypes).number
|
|
2534
|
-
};
|
|
2535
|
-
var $7848c69a021266f7$export$2e2bcd8739ae039 = $7848c69a021266f7$var$DataTableRowChanger;
|
|
2536
2457
|
|
|
2537
2458
|
|
|
2538
2459
|
|
|
2539
2460
|
|
|
2540
|
-
const $
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
viewBox: "0 0 384 512",
|
|
2544
|
-
version: "1.1",
|
|
2545
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2546
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
2547
|
-
children: [
|
|
2548
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
2549
|
-
children: "Download Icon"
|
|
2550
|
-
}),
|
|
2551
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
2552
|
-
stroke: "none",
|
|
2553
|
-
strokeWidth: "1",
|
|
2554
|
-
fill: "none",
|
|
2555
|
-
fillRule: "evenodd",
|
|
2556
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
2557
|
-
fill: "#112E51",
|
|
2558
|
-
fillRule: "nonzero",
|
|
2559
|
-
d: "M384 128h-128V0L384 128zM256 160H384v304c0 26.51-21.49 48-48 48h-288C21.49 512 0 490.5 0 464v-416C0 21.49 21.49 0 48 0H224l.0039 128C224 145.7 238.3 160 256 160zM255 295L216 334.1V232c0-13.25-10.75-24-24-24S168 218.8 168 232v102.1L128.1 295C124.3 290.3 118.2 288 112 288S99.72 290.3 95.03 295c-9.375 9.375-9.375 24.56 0 33.94l80 80c9.375 9.375 24.56 9.375 33.94 0l80-80c9.375-9.375 9.375-24.56 0-33.94S264.4 285.7 255 295z"
|
|
2560
|
-
})
|
|
2561
|
-
})
|
|
2562
|
-
]
|
|
2461
|
+
const $5fe94aeb50e0798b$var$Card = ({ id: id, visible: visible, updateVisibility: updateVisibility })=>{
|
|
2462
|
+
const { attributes: attributes, listeners: listeners, setNodeRef: setNodeRef, transform: transform, transition: transition, isDragging: isDragging } = (0, $hgUW1$useSortable)({
|
|
2463
|
+
id: id
|
|
2563
2464
|
});
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2465
|
+
const style = {
|
|
2466
|
+
transform: (0, $hgUW1$CSS).Transform.toString(transform),
|
|
2467
|
+
transition: transition,
|
|
2468
|
+
opacity: isDragging ? 0.7 : 1,
|
|
2469
|
+
zIndex: isDragging ? 1 : 0,
|
|
2470
|
+
position: 'relative',
|
|
2471
|
+
background: 'white',
|
|
2472
|
+
touchAction: 'none'
|
|
2473
|
+
};
|
|
2474
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
2475
|
+
className: "ds-u-display--flex ds-u-justify-content--between ds-u-border-bottom--1",
|
|
2476
|
+
ref: setNodeRef,
|
|
2477
|
+
style: style,
|
|
2478
|
+
...listeners,
|
|
2479
|
+
...attributes,
|
|
2480
|
+
tabIndex: -1,
|
|
2481
|
+
onPointerUp: (e)=>{
|
|
2482
|
+
// Small hack to get around a chrome / webkit rendering bug = force chrome to repaint the checkbox
|
|
2483
|
+
// For whatever reason the way dnd-kit handles events doesn't work well with chrome
|
|
2484
|
+
// Without this code checkboxes can end up visually out of sync with app state until a repaint is forced
|
|
2485
|
+
// this code forces the repaint without user interaction
|
|
2486
|
+
const target = e.target;
|
|
2487
|
+
if (isDragging && target.tagName.toLowerCase() === "label") setTimeout(()=>{
|
|
2488
|
+
target.parentNode.querySelector('input').checked = visible;
|
|
2489
|
+
}, 1);
|
|
2490
|
+
},
|
|
2576
2491
|
children: [
|
|
2577
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
2578
|
-
|
|
2492
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
|
|
2493
|
+
type: "checkbox",
|
|
2494
|
+
label: id,
|
|
2495
|
+
name: id + "_visibility",
|
|
2496
|
+
checked: visible,
|
|
2497
|
+
className: "ds-l-col--10 ds-u-margin-top--0 ds-u-margin-y--1 ds-u-padding-x--3",
|
|
2498
|
+
labelClassName: "dc-truncate",
|
|
2499
|
+
value: "",
|
|
2500
|
+
onChange: ()=>{
|
|
2501
|
+
updateVisibility(id, !visible);
|
|
2502
|
+
}
|
|
2579
2503
|
}),
|
|
2580
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
2586
|
-
fill: "#112E51",
|
|
2587
|
-
fillRule: "nonzero",
|
|
2588
|
-
d: "M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"
|
|
2504
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
2505
|
+
className: `ds-l-col--2 dkan-manage-columns-reorder-button ${isDragging && 'grabbed'}`,
|
|
2506
|
+
"aria-label": `Reorder ${id} column`,
|
|
2507
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2508
|
+
className: "fa fa-sort"
|
|
2589
2509
|
})
|
|
2590
2510
|
})
|
|
2591
2511
|
]
|
|
2592
2512
|
});
|
|
2593
|
-
|
|
2513
|
+
};
|
|
2514
|
+
var $5fe94aeb50e0798b$export$2e2bcd8739ae039 = $5fe94aeb50e0798b$var$Card;
|
|
2594
2515
|
|
|
2595
2516
|
|
|
2596
2517
|
|
|
2597
2518
|
|
|
2598
|
-
const $ec9e1550b0b034d0$var$SettingsIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
2599
|
-
width: "15px",
|
|
2600
|
-
height: "15px",
|
|
2601
|
-
// viewBox="0 0 15 15"
|
|
2602
|
-
viewBox: "0 0 512 512",
|
|
2603
|
-
version: "1.1",
|
|
2604
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2605
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
2606
|
-
children: [
|
|
2607
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
2608
|
-
children: "Settings Icon"
|
|
2609
|
-
}),
|
|
2610
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
2611
|
-
stroke: "none",
|
|
2612
|
-
strokeWidth: "1",
|
|
2613
|
-
fill: "none",
|
|
2614
|
-
fillRule: "evenodd",
|
|
2615
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
2616
|
-
fill: "#112E51",
|
|
2617
|
-
fillRule: "nonzero",
|
|
2618
|
-
d: "M495.9 166.6C499.2 175.2 496.4 184.9 489.6 191.2L446.3 230.6C447.4 238.9 448 247.4 448 256C448 264.6 447.4 273.1 446.3 281.4L489.6 320.8C496.4 327.1 499.2 336.8 495.9 345.4C491.5 357.3 486.2 368.8 480.2 379.7L475.5 387.8C468.9 398.8 461.5 409.2 453.4 419.1C447.4 426.2 437.7 428.7 428.9 425.9L373.2 408.1C359.8 418.4 344.1 427 329.2 433.6L316.7 490.7C314.7 499.7 307.7 506.1 298.5 508.5C284.7 510.8 270.5 512 255.1 512C241.5 512 227.3 510.8 213.5 508.5C204.3 506.1 197.3 499.7 195.3 490.7L182.8 433.6C167 427 152.2 418.4 138.8 408.1L83.14 425.9C74.3 428.7 64.55 426.2 58.63 419.1C50.52 409.2 43.12 398.8 36.52 387.8L31.84 379.7C25.77 368.8 20.49 357.3 16.06 345.4C12.82 336.8 15.55 327.1 22.41 320.8L65.67 281.4C64.57 273.1 64 264.6 64 256C64 247.4 64.57 238.9 65.67 230.6L22.41 191.2C15.55 184.9 12.82 175.3 16.06 166.6C20.49 154.7 25.78 143.2 31.84 132.3L36.51 124.2C43.12 113.2 50.52 102.8 58.63 92.95C64.55 85.8 74.3 83.32 83.14 86.14L138.8 103.9C152.2 93.56 167 84.96 182.8 78.43L195.3 21.33C197.3 12.25 204.3 5.04 213.5 3.51C227.3 1.201 241.5 0 256 0C270.5 0 284.7 1.201 298.5 3.51C307.7 5.04 314.7 12.25 316.7 21.33L329.2 78.43C344.1 84.96 359.8 93.56 373.2 103.9L428.9 86.14C437.7 83.32 447.4 85.8 453.4 92.95C461.5 102.8 468.9 113.2 475.5 124.2L480.2 132.3C486.2 143.2 491.5 154.7 495.9 166.6V166.6zM256 336C300.2 336 336 300.2 336 255.1C336 211.8 300.2 175.1 256 175.1C211.8 175.1 176 211.8 176 255.1C176 300.2 211.8 336 256 336z"
|
|
2619
|
-
})
|
|
2620
|
-
})
|
|
2621
|
-
]
|
|
2622
|
-
});
|
|
2623
|
-
var $ec9e1550b0b034d0$export$2e2bcd8739ae039 = $ec9e1550b0b034d0$var$SettingsIcon;
|
|
2624
2519
|
|
|
2520
|
+
const $43a30d745a7bbc86$var$DataTableContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
|
|
2521
|
+
id: null
|
|
2522
|
+
});
|
|
2523
|
+
var $43a30d745a7bbc86$export$2e2bcd8739ae039 = $43a30d745a7bbc86$var$DataTableContext;
|
|
2625
2524
|
|
|
2626
2525
|
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2526
|
+
// Create a defaults object for reusability
|
|
2527
|
+
const $ee0d4d4f34048447$var$DataTableActionsContextDefaults = {
|
|
2528
|
+
columnOrder: [],
|
|
2529
|
+
setColumnOrder: ()=>{},
|
|
2530
|
+
columnVisibility: {},
|
|
2531
|
+
setColumnVisibility: ()=>{},
|
|
2532
|
+
page: 1,
|
|
2533
|
+
setPage: ()=>{},
|
|
2534
|
+
tableDensity: 'normal',
|
|
2535
|
+
setTableDensity: ()=>{}
|
|
2536
|
+
};
|
|
2537
|
+
const $ee0d4d4f34048447$export$f814ea079e65d8fe = /*#__PURE__*/ (0, $hgUW1$createContext)($ee0d4d4f34048447$var$DataTableActionsContextDefaults);
|
|
2538
|
+
// Define our reusable provider component
|
|
2539
|
+
const $ee0d4d4f34048447$var$DataTableActionsProvider = ({ children: children })=>{
|
|
2540
|
+
// Set up all of the state
|
|
2541
|
+
const { id: id, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
2542
|
+
// a wrapper component to keep column state synced between full screen and regular modes
|
|
2543
|
+
const localStorageData = id ? JSON.parse(localStorage.getItem(id)) : null;
|
|
2544
|
+
const [page, setPage] = (0, $hgUW1$useState)(1);
|
|
2545
|
+
const [columnOrder, setColumnOrder] = (0, $hgUW1$useState)(()=>{
|
|
2546
|
+
if (datasetTableControls && localStorageData) return localStorageData.tableColumnOrder;
|
|
2547
|
+
else return [];
|
|
2631
2548
|
});
|
|
2632
|
-
const
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
className: "dc-c-resource-header--buttons",
|
|
2651
|
-
children: [
|
|
2652
|
-
includeDownload && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
2653
|
-
children: [
|
|
2654
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
|
|
2655
|
-
size: "small",
|
|
2656
|
-
className: "ds-u-text-align--left ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1",
|
|
2657
|
-
href: downloadUrl,
|
|
2658
|
-
children: [
|
|
2659
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e973bc477cdc2dc7$export$2e2bcd8739ae039), {}),
|
|
2660
|
-
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2661
|
-
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
2662
|
-
children: "Download filtered data (CSV)"
|
|
2663
|
-
})
|
|
2664
|
-
]
|
|
2665
|
-
}),
|
|
2666
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
2667
|
-
onOpen: ()=>{
|
|
2668
|
-
navigator.clipboard.writeText(window.location.href);
|
|
2669
|
-
},
|
|
2670
|
-
className: "ds-c-button ds-c-button--small ds-u-text-align--left ds-u-margin-right--1 display-settings-font",
|
|
2671
|
-
placement: "bottom",
|
|
2672
|
-
dialog: true,
|
|
2673
|
-
ariaLabel: "Copy link to filtered data",
|
|
2674
|
-
title: "Link copied to clipboard",
|
|
2675
|
-
children: [
|
|
2676
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $7ec5423a30aa3f61$export$2e2bcd8739ae039), {}),
|
|
2677
|
-
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2678
|
-
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
2679
|
-
children: "Copy link to filtered data"
|
|
2680
|
-
})
|
|
2681
|
-
]
|
|
2682
|
-
})
|
|
2683
|
-
]
|
|
2684
|
-
}),
|
|
2685
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
2686
|
-
className: "ds-c-button ds-c-button--small ds-u-text-align--left display-settings-font",
|
|
2687
|
-
placement: "bottom",
|
|
2688
|
-
dialog: true,
|
|
2689
|
-
ariaLabel: "Display settings",
|
|
2690
|
-
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2691
|
-
className: "dc-c-display-settings",
|
|
2692
|
-
children: [
|
|
2693
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $7848c69a021266f7$export$2e2bcd8739ae039), {
|
|
2694
|
-
limit: Number(limit),
|
|
2695
|
-
setLimit: setLimit,
|
|
2696
|
-
setOffset: setOffset
|
|
2697
|
-
}),
|
|
2698
|
-
includeDensity && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $1e012d1e3b534af0$export$2e2bcd8739ae039), {
|
|
2699
|
-
setTablePadding: setTablePadding,
|
|
2700
|
-
tablePadding: tablePadding
|
|
2701
|
-
})
|
|
2702
|
-
]
|
|
2703
|
-
}),
|
|
2704
|
-
children: [
|
|
2705
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $ec9e1550b0b034d0$export$2e2bcd8739ae039), {}),
|
|
2706
|
-
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2707
|
-
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
2708
|
-
children: "Display settings"
|
|
2709
|
-
})
|
|
2710
|
-
]
|
|
2711
|
-
})
|
|
2712
|
-
]
|
|
2713
|
-
})
|
|
2714
|
-
]
|
|
2715
|
-
})
|
|
2716
|
-
})
|
|
2549
|
+
const [columnVisibility, setColumnVisibility] = (0, $hgUW1$useState)(()=>{
|
|
2550
|
+
if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
|
|
2551
|
+
else return {};
|
|
2552
|
+
});
|
|
2553
|
+
const [tableDensity, setTableDensity] = (0, $hgUW1$useState)('normal');
|
|
2554
|
+
const providerValue = {
|
|
2555
|
+
columnOrder: columnOrder,
|
|
2556
|
+
setColumnOrder: setColumnOrder,
|
|
2557
|
+
columnVisibility: columnVisibility,
|
|
2558
|
+
setColumnVisibility: setColumnVisibility,
|
|
2559
|
+
page: page,
|
|
2560
|
+
setPage: setPage,
|
|
2561
|
+
tableDensity: tableDensity,
|
|
2562
|
+
setTableDensity: setTableDensity
|
|
2563
|
+
};
|
|
2564
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
|
|
2565
|
+
value: providerValue,
|
|
2566
|
+
children: children
|
|
2717
2567
|
});
|
|
2718
2568
|
};
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2569
|
+
const $ee0d4d4f34048447$export$67f91330d613e8f4 = ({ children: children, value: value = $ee0d4d4f34048447$var$DataTableActionsContextDefaults })=>/*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
|
|
2570
|
+
value: value,
|
|
2571
|
+
children: children
|
|
2572
|
+
});
|
|
2573
|
+
var $ee0d4d4f34048447$export$2e2bcd8739ae039 = $ee0d4d4f34048447$var$DataTableActionsProvider;
|
|
2722
2574
|
|
|
2723
2575
|
|
|
2724
2576
|
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2577
|
+
/**
|
|
2578
|
+
* Workaround for CMS Design System nested dialog issue.
|
|
2579
|
+
* When a nested dialog closes, the design system removes scroll lock
|
|
2580
|
+
* even if a parent dialog is still open. This restores it.
|
|
2581
|
+
*/ function $15650910340b2c71$export$73fce4ded5ef1c2() {
|
|
2582
|
+
setTimeout(()=>{
|
|
2583
|
+
if (document.querySelector('.dkan-fullscreen-data-table-wrapper .ds-c-dialog-wrap.open')) {
|
|
2584
|
+
document.body.classList.add('ds--dialog-open');
|
|
2585
|
+
document.body.style.setProperty('--body_top--dialog-open', '-0px');
|
|
2586
|
+
}
|
|
2587
|
+
}, 0);
|
|
2734
2588
|
}
|
|
2735
2589
|
|
|
2736
2590
|
|
|
2737
|
-
|
|
2738
|
-
//
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2591
|
+
class $5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor extends (0, $hgUW1$KeyboardSensor) {
|
|
2592
|
+
// Custom function to exclude checkbox from keyboard dragging
|
|
2593
|
+
static activators = [
|
|
2594
|
+
{
|
|
2595
|
+
eventName: 'onKeyDown',
|
|
2596
|
+
handler: ({ nativeEvent: event })=>{
|
|
2597
|
+
// prevent scrolling the list
|
|
2598
|
+
const isCheckbox = [
|
|
2599
|
+
"input",
|
|
2600
|
+
"checkbox"
|
|
2601
|
+
].indexOf(event.target.tagName.toLowerCase()) !== -1;
|
|
2602
|
+
if (event.key === " " && !isCheckbox) event.preventDefault();
|
|
2603
|
+
// only activate on a space or return press
|
|
2604
|
+
if ([
|
|
2605
|
+
" ",
|
|
2606
|
+
"Enter"
|
|
2607
|
+
].indexOf(event.key) === -1) return false;
|
|
2608
|
+
if (!isCheckbox) return true;
|
|
2609
|
+
return false;
|
|
2610
|
+
}
|
|
2756
2611
|
}
|
|
2757
|
-
|
|
2758
|
-
});
|
|
2759
|
-
}
|
|
2760
|
-
function $7264a673914aa746$export$e284ae5d89467c8f(date) {
|
|
2761
|
-
if (!date) return date;
|
|
2762
|
-
date = new Date(date);
|
|
2763
|
-
date = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
2764
|
-
return date;
|
|
2765
|
-
}
|
|
2766
|
-
function $7264a673914aa746$export$6b5e57d20078142b(value, operator) {
|
|
2767
|
-
let newValue = value;
|
|
2768
|
-
if (Array.isArray(newValue)) newValue = newValue.join(',');
|
|
2769
|
-
// return newValue.replace(/(^\%+|\%+$)/gm, '');
|
|
2770
|
-
return newValue;
|
|
2771
|
-
}
|
|
2772
|
-
const $7264a673914aa746$export$5f89a5ae87bc48e1 = [
|
|
2773
|
-
{
|
|
2774
|
-
label: 'Is',
|
|
2775
|
-
value: '='
|
|
2776
|
-
},
|
|
2777
|
-
{
|
|
2778
|
-
label: 'Starts With',
|
|
2779
|
-
value: 'starts with'
|
|
2780
|
-
},
|
|
2781
|
-
{
|
|
2782
|
-
label: 'Contains',
|
|
2783
|
-
value: 'contains'
|
|
2784
|
-
},
|
|
2785
|
-
{
|
|
2786
|
-
label: 'Is Not',
|
|
2787
|
-
value: '<>'
|
|
2788
|
-
},
|
|
2789
|
-
{
|
|
2790
|
-
label: 'Or',
|
|
2791
|
-
value: 'in'
|
|
2792
|
-
},
|
|
2793
|
-
{
|
|
2794
|
-
label: 'Is',
|
|
2795
|
-
value: '='
|
|
2796
|
-
},
|
|
2797
|
-
{
|
|
2798
|
-
label: 'Is Not',
|
|
2799
|
-
value: '<>'
|
|
2800
|
-
},
|
|
2801
|
-
{
|
|
2802
|
-
label: 'Greater Than',
|
|
2803
|
-
value: '>'
|
|
2804
|
-
},
|
|
2805
|
-
{
|
|
2806
|
-
label: 'Less Than',
|
|
2807
|
-
value: '<'
|
|
2808
|
-
},
|
|
2809
|
-
{
|
|
2810
|
-
label: 'Is Empty',
|
|
2811
|
-
value: 'is_empty'
|
|
2812
|
-
},
|
|
2813
|
-
{
|
|
2814
|
-
label: 'Not Empty',
|
|
2815
|
-
value: 'not_empty'
|
|
2816
|
-
}
|
|
2817
|
-
];
|
|
2818
|
-
function $7264a673914aa746$export$d243819c3ad678fb(operatorValue) {
|
|
2819
|
-
const operator = $7264a673914aa746$export$5f89a5ae87bc48e1.find((op)=>op.value === operatorValue);
|
|
2820
|
-
return operator ? operator.label : operatorValue; // Return original value if not found
|
|
2612
|
+
];
|
|
2821
2613
|
}
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
label: 'Is Empty',
|
|
2826
|
-
value: 'is_empty'
|
|
2827
|
-
},
|
|
2614
|
+
class $5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor extends (0, $hgUW1$PointerSensor) {
|
|
2615
|
+
// Custom function to stop accidental checkbox clicks on pointer activation
|
|
2616
|
+
static activators = [
|
|
2828
2617
|
{
|
|
2829
|
-
|
|
2830
|
-
|
|
2618
|
+
eventName: 'onPointerDown',
|
|
2619
|
+
handler: ({ nativeEvent: event })=>{
|
|
2620
|
+
if (event.target.tagName.toLowerCase() === "input") return false;
|
|
2621
|
+
if (event.target.tagName.toLowerCase() === "label") event.target.blur();
|
|
2622
|
+
return true;
|
|
2623
|
+
}
|
|
2831
2624
|
}
|
|
2832
|
-
]
|
|
2833
|
-
switch(type){
|
|
2834
|
-
case 'text':
|
|
2835
|
-
case 'string':
|
|
2836
|
-
return [
|
|
2837
|
-
{
|
|
2838
|
-
label: 'Is',
|
|
2839
|
-
value: '='
|
|
2840
|
-
},
|
|
2841
|
-
{
|
|
2842
|
-
label: 'Starts With',
|
|
2843
|
-
value: 'starts with'
|
|
2844
|
-
},
|
|
2845
|
-
{
|
|
2846
|
-
label: 'Contains',
|
|
2847
|
-
value: 'contains'
|
|
2848
|
-
},
|
|
2849
|
-
{
|
|
2850
|
-
label: 'Is Not',
|
|
2851
|
-
value: '<>'
|
|
2852
|
-
},
|
|
2853
|
-
{
|
|
2854
|
-
label: 'Or',
|
|
2855
|
-
value: 'in'
|
|
2856
|
-
},
|
|
2857
|
-
...emptyOptions
|
|
2858
|
-
];
|
|
2859
|
-
case 'date':
|
|
2860
|
-
return [
|
|
2861
|
-
{
|
|
2862
|
-
label: 'Is',
|
|
2863
|
-
value: '='
|
|
2864
|
-
},
|
|
2865
|
-
{
|
|
2866
|
-
label: 'Is Not',
|
|
2867
|
-
value: '<>'
|
|
2868
|
-
},
|
|
2869
|
-
{
|
|
2870
|
-
label: 'Greater Than',
|
|
2871
|
-
value: '>'
|
|
2872
|
-
},
|
|
2873
|
-
{
|
|
2874
|
-
label: 'Less Than',
|
|
2875
|
-
value: '<'
|
|
2876
|
-
},
|
|
2877
|
-
...emptyOptions
|
|
2878
|
-
];
|
|
2879
|
-
default:
|
|
2880
|
-
// These 2 should be safe for all data types
|
|
2881
|
-
return [
|
|
2882
|
-
{
|
|
2883
|
-
label: 'Is',
|
|
2884
|
-
value: '='
|
|
2885
|
-
},
|
|
2886
|
-
{
|
|
2887
|
-
label: 'Is Not',
|
|
2888
|
-
value: '<>'
|
|
2889
|
-
},
|
|
2890
|
-
...emptyOptions
|
|
2891
|
-
];
|
|
2892
|
-
}
|
|
2625
|
+
];
|
|
2893
2626
|
}
|
|
2627
|
+
const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder })=>{
|
|
2628
|
+
const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, setColumnVisibility: setColumnVisibility, columnVisibility: contextColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
2629
|
+
const columnVisibility = contextColumnVisibility || {};
|
|
2630
|
+
const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
|
|
2631
|
+
// maintain card state separately from table state - only sync states when the Save button is pressed
|
|
2632
|
+
const [cards, setCards] = (0, $hgUW1$useState)(columns.map((c)=>{
|
|
2633
|
+
return {
|
|
2634
|
+
id: c.id,
|
|
2635
|
+
visible: c.getIsVisible()
|
|
2636
|
+
};
|
|
2637
|
+
}));
|
|
2638
|
+
const cardOrder = (0, $hgUW1$useMemo)(()=>cards.map(({ id: id })=>id), [
|
|
2639
|
+
cards
|
|
2640
|
+
]);
|
|
2641
|
+
// keep state in sync
|
|
2642
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
2643
|
+
if (columnOrder?.length) setCards(columnOrder.map((c)=>{
|
|
2644
|
+
const column = columns.filter((col)=>col.id === c)[0];
|
|
2645
|
+
return {
|
|
2646
|
+
id: column.id,
|
|
2647
|
+
visible: column.getIsVisible()
|
|
2648
|
+
};
|
|
2649
|
+
}));
|
|
2650
|
+
}, [
|
|
2651
|
+
columnOrder
|
|
2652
|
+
]);
|
|
2653
|
+
// Update cards state when columnVisibility changes
|
|
2654
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
2655
|
+
setCards((prevCards)=>prevCards.map((card)=>({
|
|
2656
|
+
...card,
|
|
2657
|
+
visible: columnVisibility[card.id] !== false
|
|
2658
|
+
})));
|
|
2659
|
+
}, [
|
|
2660
|
+
columnVisibility
|
|
2661
|
+
]);
|
|
2662
|
+
const sensors = (0, $hgUW1$useSensors)((0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor, {
|
|
2663
|
+
activationConstraint: {
|
|
2664
|
+
distance: 5
|
|
2665
|
+
}
|
|
2666
|
+
}), (0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor, {
|
|
2667
|
+
coordinateGetter: (0, $hgUW1$sortableKeyboardCoordinates)
|
|
2668
|
+
}));
|
|
2669
|
+
const cardHiddenColumns = cards.filter((c)=>c.visible === false).length;
|
|
2670
|
+
const updateVisibility = (0, $hgUW1$useCallback)((id, newVisibility)=>{
|
|
2671
|
+
setCards(cards.map((card)=>{
|
|
2672
|
+
if (card.id === id) return {
|
|
2673
|
+
...card,
|
|
2674
|
+
visible: newVisibility
|
|
2675
|
+
};
|
|
2676
|
+
return card;
|
|
2677
|
+
}));
|
|
2678
|
+
});
|
|
2679
|
+
function handleDragEnd(e) {
|
|
2680
|
+
const { active: active, over: over } = e;
|
|
2681
|
+
if (active.id !== over.id) {
|
|
2682
|
+
const oldIndex = cardOrder.indexOf(active.id);
|
|
2683
|
+
const newIndex = cardOrder.indexOf(over.id);
|
|
2684
|
+
let newCards = (0, $hgUW1$arrayMove)(cards, oldIndex, newIndex);
|
|
2685
|
+
setCards(newCards);
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
const resetCards = ()=>{
|
|
2689
|
+
setCards(columns.map((c)=>{
|
|
2690
|
+
return {
|
|
2691
|
+
id: c.id,
|
|
2692
|
+
visible: c.getIsVisible()
|
|
2693
|
+
};
|
|
2694
|
+
}));
|
|
2695
|
+
};
|
|
2696
|
+
const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
|
|
2697
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2698
|
+
className: "dkan-manage-columns-wrapper",
|
|
2699
|
+
children: [
|
|
2700
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
|
|
2701
|
+
"aria-haspopup": "dialog",
|
|
2702
|
+
className: "dkan-filter-dataset-toolbar-button ds-u-color--primary ds-u-text-decoration--underline ds-u-font-size--sm ds-u-padding-x--2 ds-u-margin--0 ds-u-border--0 ds-u-fill--transparent",
|
|
2703
|
+
onClick: ()=>{
|
|
2704
|
+
setModalOpen(true);
|
|
2705
|
+
},
|
|
2706
|
+
children: [
|
|
2707
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2708
|
+
className: "fa fa-columns ds-u-margin-right--1"
|
|
2709
|
+
}),
|
|
2710
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2711
|
+
children: [
|
|
2712
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2713
|
+
className: "dkan-dataset-toolbar-button-label",
|
|
2714
|
+
children: "Manage Columns"
|
|
2715
|
+
}),
|
|
2716
|
+
hiddenColumns ? ` (${hiddenColumns})` : ''
|
|
2717
|
+
]
|
|
2718
|
+
})
|
|
2719
|
+
]
|
|
2720
|
+
}),
|
|
2721
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2722
|
+
className: `ds-c-dialog-wrap${modalOpen ? ' open' : ''}`,
|
|
2723
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
|
|
2724
|
+
heading: "Manage columns",
|
|
2725
|
+
isOpen: modalOpen,
|
|
2726
|
+
ariaCloseLabel: "Close dialog",
|
|
2727
|
+
onExit: ()=>{
|
|
2728
|
+
setModalOpen(false);
|
|
2729
|
+
resetCards();
|
|
2730
|
+
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
2731
|
+
},
|
|
2732
|
+
className: "dkan-manage-columns-dialog",
|
|
2733
|
+
actions: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2734
|
+
className: "ds-u-display--flex ds-u-justify-content--between ds-u-flex-wrap--wrap ds-u-padding-x--3 ds-u-padding-bottom--1 ds-u-sm-padding-bottom--3",
|
|
2735
|
+
children: [
|
|
2736
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2737
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0",
|
|
2738
|
+
children: [
|
|
2739
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2740
|
+
variation: "solid",
|
|
2741
|
+
className: "ds-l-col--6 ds-l-sm-col--auto",
|
|
2742
|
+
onClick: ()=>{
|
|
2743
|
+
setModalOpen(false);
|
|
2744
|
+
// update table state
|
|
2745
|
+
// Visibility
|
|
2746
|
+
// This code is building a new columnVisibility state object from the card state and doing a single setState on the table
|
|
2747
|
+
// vs doing a setState on every changed column individually
|
|
2748
|
+
const newColumnVisibility = Object.fromEntries(cards.map((c)=>Object.values(c)));
|
|
2749
|
+
setColumnVisibility(newColumnVisibility);
|
|
2750
|
+
// Card order
|
|
2751
|
+
const newCardOrder = cards.map((c)=>{
|
|
2752
|
+
return c.id;
|
|
2753
|
+
});
|
|
2754
|
+
setColumnOrder(newCardOrder);
|
|
2755
|
+
// save to localStorage
|
|
2756
|
+
const localStorageData = {
|
|
2757
|
+
tableColumnOrder: newCardOrder,
|
|
2758
|
+
tableColumnVisibility: newColumnVisibility
|
|
2759
|
+
};
|
|
2760
|
+
localStorage.setItem(id, JSON.stringify(localStorageData));
|
|
2761
|
+
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
2762
|
+
},
|
|
2763
|
+
children: "Save"
|
|
2764
|
+
}),
|
|
2765
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2766
|
+
variation: "ghost",
|
|
2767
|
+
className: "ds-l-col--6 ds-l-sm-col--auto",
|
|
2768
|
+
onClick: ()=>{
|
|
2769
|
+
setModalOpen(false);
|
|
2770
|
+
resetCards();
|
|
2771
|
+
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
2772
|
+
},
|
|
2773
|
+
children: "Cancel"
|
|
2774
|
+
})
|
|
2775
|
+
]
|
|
2776
|
+
}),
|
|
2777
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2778
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-padding-top--1 ds-u-sm-padding-y--0",
|
|
2779
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2780
|
+
variation: "ghost",
|
|
2781
|
+
className: "ds-l-col--6 ds-l-sm-col--auto",
|
|
2782
|
+
onClick: ()=>{
|
|
2783
|
+
// reset to default column order and set all cards to visible
|
|
2784
|
+
// do not save this to the table state until the "Save" button is clicked
|
|
2785
|
+
setCards(defaultColumnOrder.map((column)=>{
|
|
2786
|
+
const card = cards.filter((c)=>c.id === column)[0];
|
|
2787
|
+
return {
|
|
2788
|
+
...card,
|
|
2789
|
+
visible: true
|
|
2790
|
+
};
|
|
2791
|
+
}));
|
|
2792
|
+
},
|
|
2793
|
+
children: "Reset Columns"
|
|
2794
|
+
})
|
|
2795
|
+
})
|
|
2796
|
+
]
|
|
2797
|
+
}),
|
|
2798
|
+
children: [
|
|
2799
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
2800
|
+
id: "reorder-help",
|
|
2801
|
+
className: "ds-u-padding-x--3",
|
|
2802
|
+
children: "Activate the reorder button and use the arrow keys to reorder the list or use your mouse to drag/reorder. Press escape to cancel the reordering."
|
|
2803
|
+
}),
|
|
2804
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
|
|
2805
|
+
checked: cardHiddenColumns === 0,
|
|
2806
|
+
type: "checkbox",
|
|
2807
|
+
onChange: ()=>{
|
|
2808
|
+
setCards(cards.map((c)=>{
|
|
2809
|
+
return {
|
|
2810
|
+
...c,
|
|
2811
|
+
visible: cardHiddenColumns !== 0
|
|
2812
|
+
};
|
|
2813
|
+
}));
|
|
2814
|
+
},
|
|
2815
|
+
className: "ds-u-padding-x--3",
|
|
2816
|
+
name: "",
|
|
2817
|
+
value: "",
|
|
2818
|
+
label: "Select all",
|
|
2819
|
+
hint: cardHiddenColumns && cardHiddenColumns + " columns hidden"
|
|
2820
|
+
}),
|
|
2821
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2822
|
+
className: "ds-u-display--flex ds-u-justify-content--between ds-u-font-weight--bold ds-u-padding-y--2 ds-u-padding-x--3 ds-u-border-y--1 ds-u-margin-top--2",
|
|
2823
|
+
children: [
|
|
2824
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2825
|
+
children: "Display column"
|
|
2826
|
+
}),
|
|
2827
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2828
|
+
children: "Reorder"
|
|
2829
|
+
})
|
|
2830
|
+
]
|
|
2831
|
+
}),
|
|
2832
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$DndContext), {
|
|
2833
|
+
collisionDetection: (0, $hgUW1$closestCenter),
|
|
2834
|
+
modifiers: [
|
|
2835
|
+
(0, $hgUW1$restrictToVerticalAxis)
|
|
2836
|
+
],
|
|
2837
|
+
sensors: sensors,
|
|
2838
|
+
onDragEnd: handleDragEnd,
|
|
2839
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$SortableContext), {
|
|
2840
|
+
items: cardOrder,
|
|
2841
|
+
strategy: (0, $hgUW1$verticalListSortingStrategy),
|
|
2842
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
2843
|
+
className: "dkan-manage-columns-list",
|
|
2844
|
+
children: cards.map((card)=>{
|
|
2845
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5fe94aeb50e0798b$export$2e2bcd8739ae039), {
|
|
2846
|
+
id: card.id,
|
|
2847
|
+
visible: card.visible,
|
|
2848
|
+
updateVisibility: updateVisibility
|
|
2849
|
+
}, card.id);
|
|
2850
|
+
})
|
|
2851
|
+
})
|
|
2852
|
+
})
|
|
2853
|
+
})
|
|
2854
|
+
]
|
|
2855
|
+
})
|
|
2856
|
+
})
|
|
2857
|
+
]
|
|
2858
|
+
});
|
|
2859
|
+
};
|
|
2860
|
+
var $5d9e2ce238d53d29$export$2e2bcd8739ae039 = $5d9e2ce238d53d29$var$ManageColumns;
|
|
2861
|
+
|
|
2862
|
+
|
|
2863
|
+
|
|
2864
|
+
|
|
2865
|
+
|
|
2866
|
+
|
|
2867
|
+
|
|
2894
2868
|
|
|
2895
2869
|
|
|
2896
2870
|
|
|
@@ -3033,432 +3007,443 @@ var $23763e27eda0e8d7$export$2e2bcd8739ae039 = $23763e27eda0e8d7$var$FixedSizeTH
|
|
|
3033
3007
|
|
|
3034
3008
|
|
|
3035
3009
|
|
|
3036
|
-
const $43a30d745a7bbc86$var$DataTableContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
|
|
3037
|
-
id: null
|
|
3038
|
-
});
|
|
3039
|
-
var $43a30d745a7bbc86$export$2e2bcd8739ae039 = $43a30d745a7bbc86$var$DataTableContext;
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
// Create a defaults object for reusability
|
|
3046
|
-
const $ee0d4d4f34048447$var$DataTableActionsContextDefaults = {
|
|
3047
|
-
columnOrder: [],
|
|
3048
|
-
setColumnOrder: ()=>{},
|
|
3049
|
-
columnVisibility: {},
|
|
3050
|
-
setColumnVisibility: ()=>{},
|
|
3051
|
-
page: 1,
|
|
3052
|
-
setPage: ()=>{},
|
|
3053
|
-
tableDensity: 'normal',
|
|
3054
|
-
setTableDensity: ()=>{}
|
|
3055
|
-
};
|
|
3056
|
-
const $ee0d4d4f34048447$export$f814ea079e65d8fe = /*#__PURE__*/ (0, $hgUW1$createContext)($ee0d4d4f34048447$var$DataTableActionsContextDefaults);
|
|
3057
|
-
// Define our reusable provider component
|
|
3058
|
-
const $ee0d4d4f34048447$var$DataTableActionsProvider = ({ children: children })=>{
|
|
3059
|
-
// Set up all of the state
|
|
3060
|
-
const { id: id, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
3061
|
-
// a wrapper component to keep column state synced between full screen and regular modes
|
|
3062
|
-
const localStorageData = id ? JSON.parse(localStorage.getItem(id)) : null;
|
|
3063
|
-
const [page, setPage] = (0, $hgUW1$useState)(1);
|
|
3064
|
-
const [columnOrder, setColumnOrder] = (0, $hgUW1$useState)(()=>{
|
|
3065
|
-
if (datasetTableControls && localStorageData) return localStorageData.tableColumnOrder;
|
|
3066
|
-
else return [];
|
|
3067
|
-
});
|
|
3068
|
-
const [columnVisibility, setColumnVisibility] = (0, $hgUW1$useState)(()=>{
|
|
3069
|
-
if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
|
|
3070
|
-
else return {};
|
|
3071
|
-
});
|
|
3072
|
-
const [tableDensity, setTableDensity] = (0, $hgUW1$useState)('normal');
|
|
3073
|
-
const providerValue = {
|
|
3074
|
-
columnOrder: columnOrder,
|
|
3075
|
-
setColumnOrder: setColumnOrder,
|
|
3076
|
-
columnVisibility: columnVisibility,
|
|
3077
|
-
setColumnVisibility: setColumnVisibility,
|
|
3078
|
-
page: page,
|
|
3079
|
-
setPage: setPage,
|
|
3080
|
-
tableDensity: tableDensity,
|
|
3081
|
-
setTableDensity: setTableDensity
|
|
3082
|
-
};
|
|
3083
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
|
|
3084
|
-
value: providerValue,
|
|
3085
|
-
children: children
|
|
3086
|
-
});
|
|
3087
|
-
};
|
|
3088
|
-
const $ee0d4d4f34048447$export$67f91330d613e8f4 = ({ children: children, value: value = $ee0d4d4f34048447$var$DataTableActionsContextDefaults })=>/*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
|
|
3089
|
-
value: value,
|
|
3090
|
-
children: children
|
|
3091
|
-
});
|
|
3092
|
-
var $ee0d4d4f34048447$export$2e2bcd8739ae039 = $ee0d4d4f34048447$var$DataTableActionsProvider;
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
3010
|
|
|
3101
3011
|
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3112
|
-
|
|
3012
|
+
const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sortTransform, tablePadding: tablePadding, canResize: canResize, loading: loading = false, isModal: isModal, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, setPage: setPage, showCopyLinkButton: showCopyLinkButton, showDataTableToolbar: showDataTableToolbar, showDownloadFilteredDataButton: showDownloadFilteredDataButton, showDownloadFullDataButton: showDownloadFullDataButton, showStoredQueryDownloadButton: showStoredQueryDownloadButton, showInfoShareContainer: showInfoShareContainer = true, showTableResults: showTableResults = true, showFilterDatasetButton: showFilterDatasetButton = true, showManageColumnsButton: showManageColumnsButton = true, showDisplaySettingsButton: showDisplaySettingsButton = true, showFullScreenButton: showFullScreenButton = true })=>{
|
|
3013
|
+
const { id: id, resource: resource, datasetTableControls: datasetTableControls, dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
3014
|
+
const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
3015
|
+
const { conditions: conditions } = resource;
|
|
3016
|
+
const data = resource.values;
|
|
3017
|
+
const [sorting, setSorting] = (0, $hgUW1$useState)([]);
|
|
3018
|
+
const dataTableWrapperElement = (0, $hgUW1$useRef)(null);
|
|
3019
|
+
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
3020
|
+
const table_columns = columns.map((col)=>{
|
|
3021
|
+
if (col.cell) return columnHelper.accessor(col.accessor, {
|
|
3022
|
+
header: col.header,
|
|
3023
|
+
cell: col.cell
|
|
3024
|
+
});
|
|
3025
|
+
return columnHelper.accessor(col.accessor, {
|
|
3026
|
+
header: col.header
|
|
3027
|
+
});
|
|
3113
3028
|
});
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3029
|
+
const [highlightRow, setHighlightRow] = (0, $hgUW1$useState)(null);
|
|
3030
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3031
|
+
if (columnOrder && !columnOrder.length) setColumnOrder(table_columns.map((c)=>c.accessorKey));
|
|
3032
|
+
}, [
|
|
3033
|
+
columnOrder
|
|
3034
|
+
]);
|
|
3035
|
+
const sortElement = (isSorted, onClickFn)=>{
|
|
3036
|
+
if (isSorted === 'asc') return 'dc-c-sort--asc';
|
|
3037
|
+
if (isSorted === 'desc') return 'dc-c-sort--desc';
|
|
3038
|
+
return 'dc-c-sort--default';
|
|
3122
3039
|
};
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
// For whatever reason the way dnd-kit handles events doesn't work well with chrome
|
|
3133
|
-
// Without this code checkboxes can end up visually out of sync with app state until a repaint is forced
|
|
3134
|
-
// this code forces the repaint without user interaction
|
|
3135
|
-
const target = e.target;
|
|
3136
|
-
if (isDragging && target.tagName.toLowerCase() === "label") setTimeout(()=>{
|
|
3137
|
-
target.parentNode.querySelector('input').checked = visible;
|
|
3138
|
-
}, 1);
|
|
3040
|
+
const filters = [];
|
|
3041
|
+
const table = (0, $hgUW1$useReactTable)({
|
|
3042
|
+
data: data,
|
|
3043
|
+
columns: table_columns,
|
|
3044
|
+
manualSorting: true,
|
|
3045
|
+
state: {
|
|
3046
|
+
columnOrder: columnOrder,
|
|
3047
|
+
columnVisibility: columnVisibility,
|
|
3048
|
+
sorting: sorting
|
|
3139
3049
|
},
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
labelClassName: "dc-truncate",
|
|
3148
|
-
value: "",
|
|
3149
|
-
onChange: ()=>{
|
|
3150
|
-
updateVisibility(id, !visible);
|
|
3151
|
-
}
|
|
3152
|
-
}),
|
|
3153
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
3154
|
-
className: `ds-l-col--2 dkan-manage-columns-reorder-button ${isDragging && 'grabbed'}`,
|
|
3155
|
-
"aria-label": `Reorder ${id} column`,
|
|
3156
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
3157
|
-
className: "fa fa-sort"
|
|
3158
|
-
})
|
|
3159
|
-
})
|
|
3160
|
-
]
|
|
3050
|
+
columnResizeMode: 'onChange',
|
|
3051
|
+
onSortingChange: setSorting,
|
|
3052
|
+
onColumnOrderChange: setColumnOrder,
|
|
3053
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
3054
|
+
getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
|
|
3055
|
+
getSortedRowModel: (0, $hgUW1$getSortedRowModel)(),
|
|
3056
|
+
debugTable: false
|
|
3161
3057
|
});
|
|
3162
|
-
};
|
|
3163
|
-
var $5fe94aeb50e0798b$export$2e2bcd8739ae039 = $5fe94aeb50e0798b$var$Card;
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
/**
|
|
3169
|
-
* Workaround for CMS Design System nested dialog issue.
|
|
3170
|
-
* When a nested dialog closes, the design system removes scroll lock
|
|
3171
|
-
* even if a parent dialog is still open. This restores it.
|
|
3172
|
-
*/ function $15650910340b2c71$export$73fce4ded5ef1c2() {
|
|
3173
|
-
setTimeout(()=>{
|
|
3174
|
-
if (document.querySelector('.dkan-fullscreen-data-table-wrapper .ds-c-dialog-wrap.open')) {
|
|
3175
|
-
document.body.classList.add('ds--dialog-open');
|
|
3176
|
-
document.body.style.setProperty('--body_top--dialog-open', '-0px');
|
|
3177
|
-
}
|
|
3178
|
-
}, 0);
|
|
3179
|
-
}
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
class $5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor extends (0, $hgUW1$KeyboardSensor) {
|
|
3183
|
-
// Custom function to exclude checkbox from keyboard dragging
|
|
3184
|
-
static activators = [
|
|
3185
|
-
{
|
|
3186
|
-
eventName: 'onKeyDown',
|
|
3187
|
-
handler: ({ nativeEvent: event })=>{
|
|
3188
|
-
// prevent scrolling the list
|
|
3189
|
-
const isCheckbox = [
|
|
3190
|
-
"input",
|
|
3191
|
-
"checkbox"
|
|
3192
|
-
].indexOf(event.target.tagName.toLowerCase()) !== -1;
|
|
3193
|
-
if (event.key === " " && !isCheckbox) event.preventDefault();
|
|
3194
|
-
// only activate on a space or return press
|
|
3195
|
-
if ([
|
|
3196
|
-
" ",
|
|
3197
|
-
"Enter"
|
|
3198
|
-
].indexOf(event.key) === -1) return false;
|
|
3199
|
-
if (!isCheckbox) return true;
|
|
3200
|
-
return false;
|
|
3201
|
-
}
|
|
3202
|
-
}
|
|
3203
|
-
];
|
|
3204
|
-
}
|
|
3205
|
-
class $5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor extends (0, $hgUW1$PointerSensor) {
|
|
3206
|
-
// Custom function to stop accidental checkbox clicks on pointer activation
|
|
3207
|
-
static activators = [
|
|
3208
|
-
{
|
|
3209
|
-
eventName: 'onPointerDown',
|
|
3210
|
-
handler: ({ nativeEvent: event })=>{
|
|
3211
|
-
if (event.target.tagName.toLowerCase() === "input") return false;
|
|
3212
|
-
if (event.target.tagName.toLowerCase() === "label") event.target.blur();
|
|
3213
|
-
return true;
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
];
|
|
3217
|
-
}
|
|
3218
|
-
const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder })=>{
|
|
3219
|
-
const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, setColumnVisibility: setColumnVisibility, columnVisibility: contextColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
3220
|
-
const columnVisibility = contextColumnVisibility || {};
|
|
3221
|
-
const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
|
|
3222
|
-
// maintain card state separately from table state - only sync states when the Save button is pressed
|
|
3223
|
-
const [cards, setCards] = (0, $hgUW1$useState)(columns.map((c)=>{
|
|
3224
|
-
return {
|
|
3225
|
-
id: c.id,
|
|
3226
|
-
visible: c.getIsVisible()
|
|
3227
|
-
};
|
|
3228
|
-
}));
|
|
3229
|
-
const cardOrder = (0, $hgUW1$useMemo)(()=>cards.map(({ id: id })=>id), [
|
|
3230
|
-
cards
|
|
3231
|
-
]);
|
|
3232
|
-
// keep state in sync
|
|
3233
3058
|
(0, $hgUW1$useEffect)(()=>{
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
return {
|
|
3237
|
-
id: column.id,
|
|
3238
|
-
visible: column.getIsVisible()
|
|
3239
|
-
};
|
|
3240
|
-
}));
|
|
3059
|
+
const normalizedSort = sortTransform ? sortTransform(sorting) : filters;
|
|
3060
|
+
resource.setSort(normalizedSort);
|
|
3241
3061
|
}, [
|
|
3242
|
-
|
|
3062
|
+
sorting
|
|
3243
3063
|
]);
|
|
3244
|
-
|
|
3064
|
+
const defaultColumnOrder = (0, $hgUW1$useMemo)(()=>table_columns.map((column)=>column.accessorKey), []);
|
|
3065
|
+
const tableWrapperWidth = ()=>{
|
|
3066
|
+
if (dataTableWrapperElement.current) return dataTableWrapperElement.current.offsetWidth;
|
|
3067
|
+
return 'auto';
|
|
3068
|
+
};
|
|
3245
3069
|
(0, $hgUW1$useEffect)(()=>{
|
|
3246
|
-
|
|
3247
|
-
...card,
|
|
3248
|
-
visible: columnVisibility[card.id] !== false
|
|
3249
|
-
})));
|
|
3070
|
+
setHighlightRow(null);
|
|
3250
3071
|
}, [
|
|
3251
|
-
|
|
3072
|
+
data
|
|
3252
3073
|
]);
|
|
3253
|
-
|
|
3254
|
-
activationConstraint: {
|
|
3255
|
-
distance: 5
|
|
3256
|
-
}
|
|
3257
|
-
}), (0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor, {
|
|
3258
|
-
coordinateGetter: (0, $hgUW1$sortableKeyboardCoordinates)
|
|
3259
|
-
}));
|
|
3260
|
-
const cardHiddenColumns = cards.filter((c)=>c.visible === false).length;
|
|
3261
|
-
const updateVisibility = (0, $hgUW1$useCallback)((id, newVisibility)=>{
|
|
3262
|
-
setCards(cards.map((card)=>{
|
|
3263
|
-
if (card.id === id) return {
|
|
3264
|
-
...card,
|
|
3265
|
-
visible: newVisibility
|
|
3266
|
-
};
|
|
3267
|
-
return card;
|
|
3268
|
-
}));
|
|
3269
|
-
});
|
|
3270
|
-
function handleDragEnd(e) {
|
|
3271
|
-
const { active: active, over: over } = e;
|
|
3272
|
-
if (active.id !== over.id) {
|
|
3273
|
-
const oldIndex = cardOrder.indexOf(active.id);
|
|
3274
|
-
const newIndex = cardOrder.indexOf(over.id);
|
|
3275
|
-
let newCards = (0, $hgUW1$arrayMove)(cards, oldIndex, newIndex);
|
|
3276
|
-
setCards(newCards);
|
|
3277
|
-
}
|
|
3278
|
-
}
|
|
3279
|
-
const resetCards = ()=>{
|
|
3280
|
-
setCards(columns.map((c)=>{
|
|
3281
|
-
return {
|
|
3282
|
-
id: c.id,
|
|
3283
|
-
visible: c.getIsVisible()
|
|
3284
|
-
};
|
|
3285
|
-
}));
|
|
3286
|
-
};
|
|
3287
|
-
const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
|
|
3288
|
-
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3289
|
-
className: "dkan-manage-columns-wrapper",
|
|
3074
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
3290
3075
|
children: [
|
|
3291
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)(
|
|
3292
|
-
"aria-haspopup": "dialog",
|
|
3293
|
-
className: "dkan-filter-dataset-toolbar-button ds-u-color--primary ds-u-text-decoration--underline ds-u-font-size--sm ds-u-padding-x--2 ds-u-margin--0 ds-u-border--0 ds-u-fill--transparent",
|
|
3294
|
-
onClick: ()=>{
|
|
3295
|
-
setModalOpen(true);
|
|
3296
|
-
},
|
|
3076
|
+
showDataTableToolbar && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
3297
3077
|
children: [
|
|
3298
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("
|
|
3299
|
-
className: "
|
|
3078
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3079
|
+
className: "ds-u-margin-bottom--3",
|
|
3080
|
+
children: showDownloadFullDataButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3081
|
+
className: "ds-c-button ds-c-button--solid ds-l-col--12 ds-l-md-col--auto",
|
|
3082
|
+
href: unfilteredDownloadURL,
|
|
3083
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3084
|
+
className: "ds-u-font-weight--bold ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
|
|
3085
|
+
children: [
|
|
3086
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3087
|
+
className: "fas fa-file-csv"
|
|
3088
|
+
}),
|
|
3089
|
+
" Download full dataset (CSV)"
|
|
3090
|
+
]
|
|
3091
|
+
})
|
|
3092
|
+
})
|
|
3300
3093
|
}),
|
|
3301
|
-
/*#__PURE__*/ (0, $hgUW1$
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
setModalOpen(false);
|
|
3320
|
-
resetCards();
|
|
3321
|
-
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
3322
|
-
},
|
|
3323
|
-
className: "dkan-manage-columns-dialog",
|
|
3324
|
-
actions: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3325
|
-
className: "ds-u-display--flex ds-u-justify-content--between ds-u-flex-wrap--wrap ds-u-padding-x--3 ds-u-padding-bottom--1 ds-u-sm-padding-bottom--3",
|
|
3094
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $85f8ff1ff89899c7$export$2e2bcd8739ae039), {
|
|
3095
|
+
id: id,
|
|
3096
|
+
columns: table.getAllLeafColumns(),
|
|
3097
|
+
defaultColumnOrder: defaultColumnOrder,
|
|
3098
|
+
isModal: isModal,
|
|
3099
|
+
resource: resource,
|
|
3100
|
+
datasetTableControls: datasetTableControls,
|
|
3101
|
+
columnVisibility: columnVisibility,
|
|
3102
|
+
setColumnVisibility: setColumnVisibility,
|
|
3103
|
+
showTableResults: showTableResults,
|
|
3104
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
3105
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
3106
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
3107
|
+
showFullScreenButton: showFullScreenButton,
|
|
3108
|
+
showInfoShareContainer: showInfoShareContainer
|
|
3109
|
+
}),
|
|
3110
|
+
showInfoShareContainer && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3111
|
+
className: "ds-u-display--flex ds-l-col--12 ds-l-md-col--11 ds-u-justify-content--between ds-u-padding--0 ds-u-margin-y--2 ds-u-md-margin-y--3 ds-u-flex-direction--column ds-u-md-flex-direction--row",
|
|
3326
3112
|
children: [
|
|
3327
3113
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3328
|
-
className: "
|
|
3114
|
+
className: "dkan-data-table-info-container ds-u-padding-right--0 ds-u-md-padding-right--4",
|
|
3329
3115
|
children: [
|
|
3330
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
// update table state
|
|
3336
|
-
// Visibility
|
|
3337
|
-
// This code is building a new columnVisibility state object from the card state and doing a single setState on the table
|
|
3338
|
-
// vs doing a setState on every changed column individually
|
|
3339
|
-
const newColumnVisibility = Object.fromEntries(cards.map((c)=>Object.values(c)));
|
|
3340
|
-
setColumnVisibility(newColumnVisibility);
|
|
3341
|
-
// Card order
|
|
3342
|
-
const newCardOrder = cards.map((c)=>{
|
|
3343
|
-
return c.id;
|
|
3344
|
-
});
|
|
3345
|
-
setColumnOrder(newCardOrder);
|
|
3346
|
-
// save to localStorage
|
|
3347
|
-
const localStorageData = {
|
|
3348
|
-
tableColumnOrder: newCardOrder,
|
|
3349
|
-
tableColumnVisibility: newColumnVisibility
|
|
3350
|
-
};
|
|
3351
|
-
localStorage.setItem(id, JSON.stringify(localStorageData));
|
|
3352
|
-
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
3353
|
-
},
|
|
3354
|
-
children: "Save"
|
|
3116
|
+
dataDictionaryBanner && !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3117
|
+
className: "ds-u-margin-bottom--3",
|
|
3118
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
3119
|
+
children: 'Click on the "Data Dictionary" tab above for full column definitions'
|
|
3120
|
+
})
|
|
3355
3121
|
}),
|
|
3356
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
onClick: ()=>{
|
|
3360
|
-
setModalOpen(false);
|
|
3361
|
-
resetCards();
|
|
3362
|
-
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
3363
|
-
},
|
|
3364
|
-
children: "Cancel"
|
|
3122
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
3123
|
+
className: "ds-u-margin--0",
|
|
3124
|
+
children: "Activate the column resize button and use the right and left arrow keys to resize a column or use your mouse to drag/resize. Press escape to cancel the resizing."
|
|
3365
3125
|
})
|
|
3366
3126
|
]
|
|
3367
3127
|
}),
|
|
3368
3128
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3369
|
-
className: "
|
|
3370
|
-
children: /*#__PURE__*/ (0, $hgUW1$
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3129
|
+
className: "dkan-data-table-share-container ds-l-col--auto ds-u-padding--0 ds-u-margin-bottom--2 ds-u-md-margin-bottom--0",
|
|
3130
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
3131
|
+
className: "ds-c-button ds-c-button--solid dkan-data-table-share-button ds-u-display--flex ds-u-align-items--center ds-u-padding-x--3 ds-u-padding-y--1 ds-u-font-weight--bold ds-l-col--12 ds-l-md-col--auto ds-u-justify-content--center",
|
|
3132
|
+
activeClassName: "dkan-data-table-share-tooltip-open",
|
|
3133
|
+
dialog: true,
|
|
3134
|
+
offset: [
|
|
3135
|
+
0,
|
|
3136
|
+
5
|
|
3137
|
+
],
|
|
3138
|
+
"aria-haspopup": "dialog",
|
|
3139
|
+
placement: "bottom-start",
|
|
3140
|
+
maxWidth: "320px",
|
|
3141
|
+
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3142
|
+
className: "dc-c-resource-header--buttons ds-u-display--flex ds-u-flex-direction--column ds-l-col--12 ds-u-padding-x--0",
|
|
3143
|
+
children: [
|
|
3144
|
+
showCopyLinkButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
3145
|
+
children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
|
|
3146
|
+
onOpen: ()=>{
|
|
3147
|
+
navigator.clipboard.writeText(window.location.href);
|
|
3148
|
+
},
|
|
3149
|
+
className: "ds-c-button ds-u-text-align--center ds-l-col--12 ds-u-padding-x--2 ds-u-margin-x--0 ds-u-margin-bottom--1",
|
|
3150
|
+
placement: "bottom",
|
|
3151
|
+
dialog: true,
|
|
3152
|
+
ariaLabel: "Copy link to filtered data",
|
|
3153
|
+
title: "Link copied to clipboard",
|
|
3154
|
+
"aria-disabled": !conditions || conditions.length === 0,
|
|
3155
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3156
|
+
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
|
|
3157
|
+
children: [
|
|
3158
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3159
|
+
className: "fas fa-copy"
|
|
3160
|
+
}),
|
|
3161
|
+
" Copy link to filtered data"
|
|
3162
|
+
]
|
|
3163
|
+
})
|
|
3164
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3165
|
+
"aria-disabled": true,
|
|
3166
|
+
"aria-label": "Copy link to filtered data",
|
|
3167
|
+
className: "ds-c-button ds-u-text-align--center ds-l-col--12 ds-u-padding-x--2 ds-u-margin-x--0 ds-u-margin-bottom--1",
|
|
3168
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3169
|
+
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
|
|
3170
|
+
children: [
|
|
3171
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3172
|
+
className: "fas fa-copy"
|
|
3173
|
+
}),
|
|
3174
|
+
" Copy link to filtered data"
|
|
3175
|
+
]
|
|
3176
|
+
})
|
|
3177
|
+
})
|
|
3178
|
+
}),
|
|
3179
|
+
(showDownloadFilteredDataButton || showStoredQueryDownloadButton) && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3180
|
+
className: "ds-l-col--12 ds-u-padding-x--0 ds-u-margin-x--0",
|
|
3181
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3182
|
+
className: "ds-u-text-align--center ds-u-display--inline-block ds-l-col--12 ds-u-padding-x--2 ds-u-margin-x--0 ds-u-margin-bottom--1",
|
|
3183
|
+
href: conditions && conditions.length ? downloadURL : null,
|
|
3184
|
+
"aria-disabled": !conditions || conditions.length === 0,
|
|
3185
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3186
|
+
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
|
|
3187
|
+
children: [
|
|
3188
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3189
|
+
className: "fas fa-file-csv"
|
|
3190
|
+
}),
|
|
3191
|
+
" ",
|
|
3192
|
+
showDownloadFilteredDataButton ? `Download filtered data (CSV)` : `Download stored query data (CSV)`
|
|
3193
|
+
]
|
|
3194
|
+
})
|
|
3195
|
+
})
|
|
3196
|
+
})
|
|
3197
|
+
]
|
|
3198
|
+
}),
|
|
3199
|
+
children: [
|
|
3200
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3201
|
+
className: "far fa-share-alt"
|
|
3202
|
+
}),
|
|
3203
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
3204
|
+
className: "ds-u-margin-x--05",
|
|
3205
|
+
children: "Share"
|
|
3206
|
+
}),
|
|
3207
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3208
|
+
className: "fa fa-chevron-down"
|
|
3209
|
+
}),
|
|
3210
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3211
|
+
className: "fa fa-chevron-up"
|
|
3212
|
+
})
|
|
3213
|
+
]
|
|
3385
3214
|
})
|
|
3386
3215
|
})
|
|
3387
3216
|
]
|
|
3388
|
-
})
|
|
3217
|
+
})
|
|
3218
|
+
]
|
|
3219
|
+
}),
|
|
3220
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3221
|
+
className: `dc-c-datatable-wrapper ds-u-border-x--1 ds-u-border-bottom--1${showInfoShareContainer ? '' : ' ds-u-margin-top--3'}`,
|
|
3222
|
+
tabIndex: 0,
|
|
3223
|
+
ref: dataTableWrapperElement,
|
|
3224
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("table", {
|
|
3225
|
+
style: {
|
|
3226
|
+
width: canResize ? table.getCenterTotalSize() : "100%",
|
|
3227
|
+
minWidth: tableWrapperWidth()
|
|
3228
|
+
},
|
|
3229
|
+
className: "dc-c-datatable",
|
|
3389
3230
|
children: [
|
|
3390
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
checked: cardHiddenColumns === 0,
|
|
3397
|
-
type: "checkbox",
|
|
3398
|
-
onChange: ()=>{
|
|
3399
|
-
setCards(cards.map((c)=>{
|
|
3400
|
-
return {
|
|
3401
|
-
...c,
|
|
3402
|
-
visible: cardHiddenColumns !== 0
|
|
3403
|
-
};
|
|
3404
|
-
}));
|
|
3405
|
-
},
|
|
3406
|
-
className: "ds-u-padding-x--3",
|
|
3407
|
-
name: "",
|
|
3408
|
-
value: "",
|
|
3409
|
-
label: "Select all",
|
|
3410
|
-
hint: cardHiddenColumns && cardHiddenColumns + " columns hidden"
|
|
3411
|
-
}),
|
|
3412
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3413
|
-
className: "ds-u-display--flex ds-u-justify-content--between ds-u-font-weight--bold ds-u-padding-y--2 ds-u-padding-x--3 ds-u-border-y--1 ds-u-margin-top--2",
|
|
3414
|
-
children: [
|
|
3415
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
3416
|
-
children: "Display column"
|
|
3417
|
-
}),
|
|
3418
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
3419
|
-
children: "Reorder"
|
|
3420
|
-
})
|
|
3421
|
-
]
|
|
3231
|
+
canResize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $96d341d082bffec5$export$2e2bcd8739ae039), {
|
|
3232
|
+
table: table,
|
|
3233
|
+
sortElement: sortElement
|
|
3234
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $23763e27eda0e8d7$export$2e2bcd8739ae039), {
|
|
3235
|
+
table: table,
|
|
3236
|
+
sortElement: sortElement
|
|
3422
3237
|
}),
|
|
3423
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
}
|
|
3238
|
+
loading ? /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {}) : /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {
|
|
3239
|
+
children: table.getRowModel().rows.map((row, index)=>{
|
|
3240
|
+
const even = (index + 1) % 2 === 0;
|
|
3241
|
+
const highlight = highlightRow === row.id;
|
|
3242
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
3243
|
+
className: `${highlight ? "dc-c-datatable--highlight-row" : even && "dc-c-datatable--even-row"}`,
|
|
3244
|
+
onClick: ()=>setHighlightRow(row.id),
|
|
3245
|
+
children: row.getVisibleCells().map((cell)=>{
|
|
3246
|
+
let classList = "dc-truncate ds-u-padding-x--1";
|
|
3247
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("td", {
|
|
3248
|
+
key: cell.id,
|
|
3249
|
+
style: {
|
|
3250
|
+
maxWidth: cell.column.getSize()
|
|
3251
|
+
},
|
|
3252
|
+
className: `${classList} ${tablePadding}`,
|
|
3253
|
+
title: cell.getValue(),
|
|
3254
|
+
children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
3255
|
+
});
|
|
3441
3256
|
})
|
|
3442
|
-
})
|
|
3257
|
+
}, row.id);
|
|
3443
3258
|
})
|
|
3444
3259
|
})
|
|
3445
3260
|
]
|
|
3446
3261
|
})
|
|
3262
|
+
}),
|
|
3263
|
+
loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
3264
|
+
"aria-valuetext": "Dataset loading",
|
|
3265
|
+
role: "status",
|
|
3266
|
+
className: "ds-u-margin--3"
|
|
3267
|
+
}),
|
|
3268
|
+
!loading && table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
3269
|
+
variation: "warn",
|
|
3270
|
+
children: "No results found for the current filters"
|
|
3447
3271
|
})
|
|
3448
3272
|
]
|
|
3449
3273
|
});
|
|
3450
3274
|
};
|
|
3451
|
-
var $
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3275
|
+
var $d98f94c79ddf4e0e$export$2e2bcd8739ae039 = $d98f94c79ddf4e0e$var$DataTable;
|
|
3458
3276
|
|
|
3459
3277
|
|
|
3278
|
+
function $aa4450dcbeef3ac0$export$385a5aba38cc3325(sortArray) {
|
|
3279
|
+
let newQuery = [];
|
|
3280
|
+
sortArray.forEach((s)=>{
|
|
3281
|
+
return newQuery.push({
|
|
3282
|
+
property: s.id,
|
|
3283
|
+
order: s.desc ? 'desc' : 'asc'
|
|
3284
|
+
});
|
|
3285
|
+
});
|
|
3286
|
+
return newQuery;
|
|
3287
|
+
}
|
|
3460
3288
|
|
|
3461
3289
|
|
|
3290
|
+
// Example custom column headers, where only effective date has an ! at the end
|
|
3291
|
+
// [
|
|
3292
|
+
// {schema: 'date', cell: ({ value }) => localeDate(value),},
|
|
3293
|
+
// {accessor: 'effective_date',cell: ({ value }) => localeDate(value) + '!',},
|
|
3294
|
+
// ]
|
|
3295
|
+
function $7264a673914aa746$export$8049e8f40a9bdfb8(customHeaders, columns, schema) {
|
|
3296
|
+
return columns.map((column)=>{
|
|
3297
|
+
const customAccessorIndex = customHeaders.findIndex((header)=>header.accessor === column);
|
|
3298
|
+
const customSchemaIndex = customHeaders.findIndex((header)=>header.schema === schema.fields[column].mysql_type);
|
|
3299
|
+
let newColumn = {};
|
|
3300
|
+
// If specific accessor is passed, this will override a general mysql_type Cell rewrite.
|
|
3301
|
+
if (customAccessorIndex > -1) {
|
|
3302
|
+
newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
|
|
3303
|
+
newColumn.accessor = column;
|
|
3304
|
+
newColumn.cell = customHeaders[customAccessorIndex].cell;
|
|
3305
|
+
} else {
|
|
3306
|
+
newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
|
|
3307
|
+
newColumn.accessor = column;
|
|
3308
|
+
if (customSchemaIndex > -1) newColumn.cell = customHeaders[customSchemaIndex].cell;
|
|
3309
|
+
}
|
|
3310
|
+
return newColumn;
|
|
3311
|
+
});
|
|
3312
|
+
}
|
|
3313
|
+
function $7264a673914aa746$export$e284ae5d89467c8f(date) {
|
|
3314
|
+
if (!date) return date;
|
|
3315
|
+
date = new Date(date);
|
|
3316
|
+
date = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
3317
|
+
return date;
|
|
3318
|
+
}
|
|
3319
|
+
function $7264a673914aa746$export$6b5e57d20078142b(value, operator) {
|
|
3320
|
+
let newValue = value;
|
|
3321
|
+
if (Array.isArray(newValue)) newValue = newValue.join(',');
|
|
3322
|
+
// return newValue.replace(/(^\%+|\%+$)/gm, '');
|
|
3323
|
+
return newValue;
|
|
3324
|
+
}
|
|
3325
|
+
const $7264a673914aa746$export$5f89a5ae87bc48e1 = [
|
|
3326
|
+
{
|
|
3327
|
+
label: 'Is',
|
|
3328
|
+
value: '='
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
label: 'Starts With',
|
|
3332
|
+
value: 'starts with'
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
label: 'Contains',
|
|
3336
|
+
value: 'contains'
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
label: 'Is Not',
|
|
3340
|
+
value: '<>'
|
|
3341
|
+
},
|
|
3342
|
+
{
|
|
3343
|
+
label: 'Or',
|
|
3344
|
+
value: 'in'
|
|
3345
|
+
},
|
|
3346
|
+
{
|
|
3347
|
+
label: 'Is',
|
|
3348
|
+
value: '='
|
|
3349
|
+
},
|
|
3350
|
+
{
|
|
3351
|
+
label: 'Is Not',
|
|
3352
|
+
value: '<>'
|
|
3353
|
+
},
|
|
3354
|
+
{
|
|
3355
|
+
label: 'Greater Than',
|
|
3356
|
+
value: '>'
|
|
3357
|
+
},
|
|
3358
|
+
{
|
|
3359
|
+
label: 'Less Than',
|
|
3360
|
+
value: '<'
|
|
3361
|
+
},
|
|
3362
|
+
{
|
|
3363
|
+
label: 'Is Empty',
|
|
3364
|
+
value: 'is_empty'
|
|
3365
|
+
},
|
|
3366
|
+
{
|
|
3367
|
+
label: 'Not Empty',
|
|
3368
|
+
value: 'not_empty'
|
|
3369
|
+
}
|
|
3370
|
+
];
|
|
3371
|
+
function $7264a673914aa746$export$d243819c3ad678fb(operatorValue) {
|
|
3372
|
+
const operator = $7264a673914aa746$export$5f89a5ae87bc48e1.find((op)=>op.value === operatorValue);
|
|
3373
|
+
return operator ? operator.label : operatorValue; // Return original value if not found
|
|
3374
|
+
}
|
|
3375
|
+
function $7264a673914aa746$export$2b9377795161999(type, enableEmptyFilters = false) {
|
|
3376
|
+
const emptyOptions = enableEmptyFilters ? [
|
|
3377
|
+
{
|
|
3378
|
+
label: 'Is Empty',
|
|
3379
|
+
value: 'is_empty'
|
|
3380
|
+
},
|
|
3381
|
+
{
|
|
3382
|
+
label: 'Not Empty',
|
|
3383
|
+
value: 'not_empty'
|
|
3384
|
+
}
|
|
3385
|
+
] : [];
|
|
3386
|
+
switch(type){
|
|
3387
|
+
case 'text':
|
|
3388
|
+
case 'string':
|
|
3389
|
+
return [
|
|
3390
|
+
{
|
|
3391
|
+
label: 'Is',
|
|
3392
|
+
value: '='
|
|
3393
|
+
},
|
|
3394
|
+
{
|
|
3395
|
+
label: 'Starts With',
|
|
3396
|
+
value: 'starts with'
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
label: 'Contains',
|
|
3400
|
+
value: 'contains'
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
label: 'Is Not',
|
|
3404
|
+
value: '<>'
|
|
3405
|
+
},
|
|
3406
|
+
{
|
|
3407
|
+
label: 'Or',
|
|
3408
|
+
value: 'in'
|
|
3409
|
+
},
|
|
3410
|
+
...emptyOptions
|
|
3411
|
+
];
|
|
3412
|
+
case 'date':
|
|
3413
|
+
return [
|
|
3414
|
+
{
|
|
3415
|
+
label: 'Is',
|
|
3416
|
+
value: '='
|
|
3417
|
+
},
|
|
3418
|
+
{
|
|
3419
|
+
label: 'Is Not',
|
|
3420
|
+
value: '<>'
|
|
3421
|
+
},
|
|
3422
|
+
{
|
|
3423
|
+
label: 'Greater Than',
|
|
3424
|
+
value: '>'
|
|
3425
|
+
},
|
|
3426
|
+
{
|
|
3427
|
+
label: 'Less Than',
|
|
3428
|
+
value: '<'
|
|
3429
|
+
},
|
|
3430
|
+
...emptyOptions
|
|
3431
|
+
];
|
|
3432
|
+
default:
|
|
3433
|
+
// These 2 should be safe for all data types
|
|
3434
|
+
return [
|
|
3435
|
+
{
|
|
3436
|
+
label: 'Is',
|
|
3437
|
+
value: '='
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
label: 'Is Not',
|
|
3441
|
+
value: '<>'
|
|
3442
|
+
},
|
|
3443
|
+
...emptyOptions
|
|
3444
|
+
];
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3462
3447
|
|
|
3463
3448
|
|
|
3464
3449
|
|
|
@@ -3470,12 +3455,13 @@ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
|
|
|
3470
3455
|
accessor: column
|
|
3471
3456
|
}));
|
|
3472
3457
|
}
|
|
3473
|
-
const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopyLinkButton: showCopyLinkButton = true, showDataTableToolbar: showDataTableToolbar = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
|
|
3458
|
+
const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopyLinkButton: showCopyLinkButton = true, showDataTableToolbar: showDataTableToolbar = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false, showTableResults: showTableResults = true, showFilterDatasetButton: showFilterDatasetButton = true, showManageColumnsButton: showManageColumnsButton = true, showDisplaySettingsButton: showDisplaySettingsButton = true, showFullScreenButton: showFullScreenButton = true, showInfoShareContainer: showInfoShareContainer = true })=>{
|
|
3474
3459
|
const { id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
3475
3460
|
const { page: page, setPage: setPage, tableDensity: tableDensity } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
3476
3461
|
const defaultPageSize = 10;
|
|
3477
|
-
const
|
|
3478
|
-
const
|
|
3462
|
+
const schema = resource?.schema?.[distribution?.identifier] ?? resource?.schema?.[id];
|
|
3463
|
+
const isFullColumnDef = Array.isArray(customColumns) && customColumns.some((column)=>column && 'header' in column);
|
|
3464
|
+
const columns = isFullColumnDef ? customColumns : schema && Array.isArray(resource?.columns) ? (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, schema) : $a35cf16d1488f54e$export$1147582dfae658c6(resource.columns, resource.schema[id]);
|
|
3479
3465
|
const { limit: limit, setOffset: setOffset } = resource;
|
|
3480
3466
|
const pageSize = limit ? limit : defaultPageSize;
|
|
3481
3467
|
const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
|
|
@@ -3501,7 +3487,13 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopy
|
|
|
3501
3487
|
showDataTableToolbar: showDataTableToolbar,
|
|
3502
3488
|
showDownloadFilteredDataButton: showDownloadFilteredDataButton,
|
|
3503
3489
|
showDownloadFullDataButton: showDownloadFullDataButton,
|
|
3504
|
-
showStoredQueryDownloadButton: showStoredQueryDownloadButton
|
|
3490
|
+
showStoredQueryDownloadButton: showStoredQueryDownloadButton,
|
|
3491
|
+
showTableResults: showTableResults,
|
|
3492
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
3493
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
3494
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
3495
|
+
showFullScreenButton: showFullScreenButton,
|
|
3496
|
+
showInfoShareContainer: showInfoShareContainer
|
|
3505
3497
|
})
|
|
3506
3498
|
}),
|
|
3507
3499
|
!resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -3537,7 +3529,7 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopy
|
|
|
3537
3529
|
var $a35cf16d1488f54e$export$2e2bcd8739ae039 = $a35cf16d1488f54e$var$DatasetTable;
|
|
3538
3530
|
|
|
3539
3531
|
|
|
3540
|
-
const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal })=>{
|
|
3532
|
+
const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal, showTableResults: showTableResults = true, showFilterDatasetButton: showFilterDatasetButton = true, showManageColumnsButton: showManageColumnsButton = true, showDisplaySettingsButton: showDisplaySettingsButton = true, showFullScreenButton: showFullScreenButton = true, showInfoShareContainer: showInfoShareContainer = true })=>{
|
|
3541
3533
|
const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(isModal);
|
|
3542
3534
|
if (isModal) return null;
|
|
3543
3535
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -3569,7 +3561,13 @@ const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal })=>{
|
|
|
3569
3561
|
ariaCloseLabel: "Close dialog",
|
|
3570
3562
|
className: "dkan-full-screen-dataset-dialog",
|
|
3571
3563
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
|
|
3572
|
-
isModal: true
|
|
3564
|
+
isModal: true,
|
|
3565
|
+
showTableResults: showTableResults,
|
|
3566
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
3567
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
3568
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
3569
|
+
showFullScreenButton: showFullScreenButton,
|
|
3570
|
+
showInfoShareContainer: showInfoShareContainer
|
|
3573
3571
|
})
|
|
3574
3572
|
})
|
|
3575
3573
|
})
|
|
@@ -4084,6 +4082,10 @@ const $dae856e97a09bcd6$var$DisplaySettings = ()=>{
|
|
|
4084
4082
|
placement: "bottom-start",
|
|
4085
4083
|
maxWidth: "350px",
|
|
4086
4084
|
"aria-haspopup": "dialog",
|
|
4085
|
+
// @ts-ignore
|
|
4086
|
+
// 'strategy' is not a valid prop for Tooltip but it does get passed on to Popper.js which tells
|
|
4087
|
+
// it to position the tooltip relative to the viewport instead of the dialog’s containing block
|
|
4088
|
+
strategy: "fixed",
|
|
4087
4089
|
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4088
4090
|
className: "ds-u-display--flex ds-u-flex-direction--column",
|
|
4089
4091
|
children: [
|
|
@@ -4232,8 +4234,8 @@ const $85f8ff1ff89899c7$var$updateBrowserURL = (newConditions)=>{
|
|
|
4232
4234
|
});
|
|
4233
4235
|
window.history.pushState({}, '', `${url.origin}${url.pathname}${urlString}`);
|
|
4234
4236
|
};
|
|
4235
|
-
const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, isModal: isModal, datasetTableControls: datasetTableControls, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility })=>{
|
|
4236
|
-
const { limit: limit, offset: offset, count: count, conditions: conditions, setConditions: setConditions } = resource;
|
|
4237
|
+
const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, isModal: isModal, datasetTableControls: datasetTableControls, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility, showTableResults: showTableResults = true, showFilterDatasetButton: showFilterDatasetButton = true, showManageColumnsButton: showManageColumnsButton = true, showDisplaySettingsButton: showDisplaySettingsButton = true, showFullScreenButton: showFullScreenButton = true, showInfoShareContainer: showInfoShareContainer = true })=>{
|
|
4238
|
+
const { limit: limit, offset: offset, count: count, conditions: conditions = [], setConditions: setConditions } = resource;
|
|
4237
4239
|
const intCount = count ? count : 0;
|
|
4238
4240
|
const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
|
|
4239
4241
|
const resetColumnVisibility = ()=>{
|
|
@@ -4265,9 +4267,9 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
4265
4267
|
role: "region",
|
|
4266
4268
|
"aria-label": "toolbar",
|
|
4267
4269
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4268
|
-
className:
|
|
4270
|
+
className: `ds-l-col--12 ds-u-display--flex ds-u-align-items--center ds-u-flex-wrap--wrap ds-u-padding-x--0 ds-u-padding-y--2${showTableResults ? ' ds-u-justify-content--between' : ' ds-u-justify-content--end'}`,
|
|
4269
4271
|
children: [
|
|
4270
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4272
|
+
showTableResults && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4271
4273
|
className: "ds-u-padding-x--2",
|
|
4272
4274
|
children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
4273
4275
|
totalRows: intCount,
|
|
@@ -4279,22 +4281,28 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
4279
4281
|
datasetTableControls && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4280
4282
|
className: "dkan-data-table-toolbar-controls ds-u-display--flex ds-u-flex-wrap--wrap ds-u-align-items--center ds-l-md-col--auto ds-l-col--12 ds-u-padding-x--2 ds-u-padding-top--2 ds-u-md-padding-top--0",
|
|
4281
4283
|
children: [
|
|
4282
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $6f4318b1e14124e5$export$2e2bcd8739ae039), {}),
|
|
4283
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
|
|
4284
|
+
showFilterDatasetButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6f4318b1e14124e5$export$2e2bcd8739ae039), {}),
|
|
4285
|
+
showManageColumnsButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
|
|
4284
4286
|
id: id,
|
|
4285
4287
|
columns: columns,
|
|
4286
4288
|
defaultColumnOrder: defaultColumnOrder
|
|
4287
4289
|
}),
|
|
4288
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $dae856e97a09bcd6$export$2e2bcd8739ae039), {}),
|
|
4289
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
|
|
4290
|
-
isModal: isModal
|
|
4290
|
+
showDisplaySettingsButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $dae856e97a09bcd6$export$2e2bcd8739ae039), {}),
|
|
4291
|
+
showFullScreenButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
|
|
4292
|
+
isModal: isModal,
|
|
4293
|
+
showTableResults: showTableResults,
|
|
4294
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
4295
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
4296
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
4297
|
+
showFullScreenButton: showFullScreenButton,
|
|
4298
|
+
showInfoShareContainer: showInfoShareContainer
|
|
4291
4299
|
})
|
|
4292
4300
|
]
|
|
4293
4301
|
})
|
|
4294
4302
|
]
|
|
4295
4303
|
})
|
|
4296
4304
|
}),
|
|
4297
|
-
Array.isArray(conditions) && (conditions.length > 0 || hiddenColumns > 0) && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4305
|
+
(showFilterDatasetButton || showManageColumnsButton) && Array.isArray(conditions) && (conditions.length > 0 || hiddenColumns > 0) && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4298
4306
|
className: "ds-u-fill--white ds-u-padding-x--0 ds-u-md-padding-x--2 ds-u-padding-top--2",
|
|
4299
4307
|
children: [
|
|
4300
4308
|
/*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
|
|
@@ -4345,264 +4353,292 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
4345
4353
|
var $85f8ff1ff89899c7$export$2e2bcd8739ae039 = $85f8ff1ff89899c7$var$DataTableToolbar;
|
|
4346
4354
|
|
|
4347
4355
|
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4356
|
+
|
|
4357
|
+
|
|
4358
|
+
|
|
4359
|
+
|
|
4360
|
+
|
|
4361
|
+
|
|
4362
|
+
|
|
4363
|
+
|
|
4364
|
+
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
4365
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4366
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
|
|
4367
|
+
url: endpoint,
|
|
4368
|
+
plugins: [
|
|
4369
|
+
(0, $hgUW1$SpanOpenAPIVersion),
|
|
4370
|
+
(0, $hgUW1$SpanVersionStamp)
|
|
4371
|
+
]
|
|
4372
|
+
})
|
|
4364
4373
|
});
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4374
|
+
};
|
|
4375
|
+
var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
|
|
4376
|
+
|
|
4377
|
+
|
|
4378
|
+
|
|
4379
|
+
|
|
4380
|
+
|
|
4381
|
+
|
|
4382
|
+
|
|
4383
|
+
|
|
4384
|
+
|
|
4385
|
+
|
|
4386
|
+
|
|
4387
|
+
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding, tablePadding: tablePadding })=>{
|
|
4388
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4389
|
+
className: "ds-u-display--flex",
|
|
4390
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
4391
|
+
options: [
|
|
4392
|
+
{
|
|
4393
|
+
label: 'Tight',
|
|
4394
|
+
value: 'ds-u-padding-y--0'
|
|
4395
|
+
},
|
|
4396
|
+
{
|
|
4397
|
+
label: 'Normal',
|
|
4398
|
+
value: 'ds-u-padding-y--1'
|
|
4399
|
+
},
|
|
4400
|
+
{
|
|
4401
|
+
label: 'Expanded',
|
|
4402
|
+
value: 'ds-u-padding-y--2'
|
|
4403
|
+
}
|
|
4404
|
+
],
|
|
4405
|
+
label: "Display density:",
|
|
4406
|
+
labelClassName: "ds-u-margin-top--0",
|
|
4407
|
+
name: "datatable_display_density",
|
|
4408
|
+
onChange: (e)=>setTablePadding(e.target.value),
|
|
4409
|
+
defaultValue: tablePadding
|
|
4410
|
+
})
|
|
4393
4411
|
});
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4412
|
+
};
|
|
4413
|
+
$1e012d1e3b534af0$var$DataTableDensity.propTypes = {
|
|
4414
|
+
setTablePadding: (0, $hgUW1$proptypes).func.isRequired
|
|
4415
|
+
};
|
|
4416
|
+
var $1e012d1e3b534af0$export$2e2bcd8739ae039 = $1e012d1e3b534af0$var$DataTableDensity;
|
|
4417
|
+
|
|
4418
|
+
|
|
4419
|
+
|
|
4420
|
+
|
|
4421
|
+
|
|
4422
|
+
|
|
4423
|
+
const $7848c69a021266f7$var$DataTableRowChanger = ({ limit: limit, rowOptions: rowOptions = [
|
|
4424
|
+
10,
|
|
4425
|
+
25,
|
|
4426
|
+
50,
|
|
4427
|
+
100
|
|
4428
|
+
], setLimit: setLimit })=>{
|
|
4429
|
+
const rowOptionsFormatted = rowOptions.map((row)=>({
|
|
4430
|
+
label: row.toString(),
|
|
4431
|
+
value: row.toString()
|
|
4432
|
+
}));
|
|
4433
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4434
|
+
className: "ds-u-display--flex",
|
|
4435
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
4436
|
+
options: rowOptionsFormatted,
|
|
4437
|
+
label: "Rows per page:",
|
|
4438
|
+
labelClassName: "ds-u-margin-top--0",
|
|
4439
|
+
name: "datatable_rows_per_page",
|
|
4440
|
+
onChange: (e)=>setLimit(e.target.value),
|
|
4441
|
+
defaultValue: limit.toString()
|
|
4442
|
+
})
|
|
4443
|
+
});
|
|
4444
|
+
};
|
|
4445
|
+
$7848c69a021266f7$var$DataTableRowChanger.propTypes = {
|
|
4446
|
+
rowOptions: (0, $hgUW1$proptypes).arrayOf((0, $hgUW1$proptypes).number),
|
|
4447
|
+
setLimit: (0, $hgUW1$proptypes).func.isRequired,
|
|
4448
|
+
limit: (0, $hgUW1$proptypes).number
|
|
4449
|
+
};
|
|
4450
|
+
var $7848c69a021266f7$export$2e2bcd8739ae039 = $7848c69a021266f7$var$DataTableRowChanger;
|
|
4451
|
+
|
|
4452
|
+
|
|
4453
|
+
|
|
4454
|
+
|
|
4455
|
+
const $e973bc477cdc2dc7$var$DownloadIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
4456
|
+
width: "15px",
|
|
4457
|
+
height: "15px",
|
|
4458
|
+
viewBox: "0 0 384 512",
|
|
4459
|
+
version: "1.1",
|
|
4460
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4461
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4411
4462
|
children: [
|
|
4412
|
-
|
|
4463
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
4464
|
+
children: "Download Icon"
|
|
4465
|
+
}),
|
|
4466
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
4467
|
+
stroke: "none",
|
|
4468
|
+
strokeWidth: "1",
|
|
4469
|
+
fill: "none",
|
|
4470
|
+
fillRule: "evenodd",
|
|
4471
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
4472
|
+
fill: "#112E51",
|
|
4473
|
+
fillRule: "nonzero",
|
|
4474
|
+
d: "M384 128h-128V0L384 128zM256 160H384v304c0 26.51-21.49 48-48 48h-288C21.49 512 0 490.5 0 464v-416C0 21.49 21.49 0 48 0H224l.0039 128C224 145.7 238.3 160 256 160zM255 295L216 334.1V232c0-13.25-10.75-24-24-24S168 218.8 168 232v102.1L128.1 295C124.3 290.3 118.2 288 112 288S99.72 290.3 95.03 295c-9.375 9.375-9.375 24.56 0 33.94l80 80c9.375 9.375 24.56 9.375 33.94 0l80-80c9.375-9.375 9.375-24.56 0-33.94S264.4 285.7 255 295z"
|
|
4475
|
+
})
|
|
4476
|
+
})
|
|
4477
|
+
]
|
|
4478
|
+
});
|
|
4479
|
+
var $e973bc477cdc2dc7$export$2e2bcd8739ae039 = $e973bc477cdc2dc7$var$DownloadIcon;
|
|
4480
|
+
|
|
4481
|
+
|
|
4482
|
+
|
|
4483
|
+
|
|
4484
|
+
const $7ec5423a30aa3f61$var$CopyIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
4485
|
+
width: "15px",
|
|
4486
|
+
height: "15px",
|
|
4487
|
+
viewBox: "0 0 512 512",
|
|
4488
|
+
version: "1.1",
|
|
4489
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4490
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4491
|
+
children: [
|
|
4492
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
4493
|
+
children: "Copy Icon"
|
|
4494
|
+
}),
|
|
4495
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
4496
|
+
stroke: "none",
|
|
4497
|
+
strokeWidth: "1",
|
|
4498
|
+
fill: "none",
|
|
4499
|
+
fillRule: "evenodd",
|
|
4500
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
4501
|
+
fill: "#112E51",
|
|
4502
|
+
fillRule: "nonzero",
|
|
4503
|
+
d: "M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"
|
|
4504
|
+
})
|
|
4505
|
+
})
|
|
4506
|
+
]
|
|
4507
|
+
});
|
|
4508
|
+
var $7ec5423a30aa3f61$export$2e2bcd8739ae039 = $7ec5423a30aa3f61$var$CopyIcon;
|
|
4509
|
+
|
|
4510
|
+
|
|
4511
|
+
|
|
4512
|
+
|
|
4513
|
+
const $ec9e1550b0b034d0$var$SettingsIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
4514
|
+
width: "15px",
|
|
4515
|
+
height: "15px",
|
|
4516
|
+
// viewBox="0 0 15 15"
|
|
4517
|
+
viewBox: "0 0 512 512",
|
|
4518
|
+
version: "1.1",
|
|
4519
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4520
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4521
|
+
children: [
|
|
4522
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
4523
|
+
children: "Settings Icon"
|
|
4524
|
+
}),
|
|
4525
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
4526
|
+
stroke: "none",
|
|
4527
|
+
strokeWidth: "1",
|
|
4528
|
+
fill: "none",
|
|
4529
|
+
fillRule: "evenodd",
|
|
4530
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
4531
|
+
fill: "#112E51",
|
|
4532
|
+
fillRule: "nonzero",
|
|
4533
|
+
d: "M495.9 166.6C499.2 175.2 496.4 184.9 489.6 191.2L446.3 230.6C447.4 238.9 448 247.4 448 256C448 264.6 447.4 273.1 446.3 281.4L489.6 320.8C496.4 327.1 499.2 336.8 495.9 345.4C491.5 357.3 486.2 368.8 480.2 379.7L475.5 387.8C468.9 398.8 461.5 409.2 453.4 419.1C447.4 426.2 437.7 428.7 428.9 425.9L373.2 408.1C359.8 418.4 344.1 427 329.2 433.6L316.7 490.7C314.7 499.7 307.7 506.1 298.5 508.5C284.7 510.8 270.5 512 255.1 512C241.5 512 227.3 510.8 213.5 508.5C204.3 506.1 197.3 499.7 195.3 490.7L182.8 433.6C167 427 152.2 418.4 138.8 408.1L83.14 425.9C74.3 428.7 64.55 426.2 58.63 419.1C50.52 409.2 43.12 398.8 36.52 387.8L31.84 379.7C25.77 368.8 20.49 357.3 16.06 345.4C12.82 336.8 15.55 327.1 22.41 320.8L65.67 281.4C64.57 273.1 64 264.6 64 256C64 247.4 64.57 238.9 65.67 230.6L22.41 191.2C15.55 184.9 12.82 175.3 16.06 166.6C20.49 154.7 25.78 143.2 31.84 132.3L36.51 124.2C43.12 113.2 50.52 102.8 58.63 92.95C64.55 85.8 74.3 83.32 83.14 86.14L138.8 103.9C152.2 93.56 167 84.96 182.8 78.43L195.3 21.33C197.3 12.25 204.3 5.04 213.5 3.51C227.3 1.201 241.5 0 256 0C270.5 0 284.7 1.201 298.5 3.51C307.7 5.04 314.7 12.25 316.7 21.33L329.2 78.43C344.1 84.96 359.8 93.56 373.2 103.9L428.9 86.14C437.7 83.32 447.4 85.8 453.4 92.95C461.5 102.8 468.9 113.2 475.5 124.2L480.2 132.3C486.2 143.2 491.5 154.7 495.9 166.6V166.6zM256 336C300.2 336 336 300.2 336 255.1C336 211.8 300.2 175.1 256 175.1C211.8 175.1 176 211.8 176 255.1C176 300.2 211.8 336 256 336z"
|
|
4534
|
+
})
|
|
4535
|
+
})
|
|
4536
|
+
]
|
|
4537
|
+
});
|
|
4538
|
+
var $ec9e1550b0b034d0$export$2e2bcd8739ae039 = $ec9e1550b0b034d0$var$SettingsIcon;
|
|
4539
|
+
|
|
4540
|
+
|
|
4541
|
+
|
|
4542
|
+
const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding, includeDensity: includeDensity, includeDownload: includeDownload, resource: resource, tablePadding: tablePadding, downloadUrl: downloadUrl })=>{
|
|
4543
|
+
const md = (0, $hgUW1$useMediaQuery)({
|
|
4544
|
+
minWidth: 0,
|
|
4545
|
+
maxWidth: 768
|
|
4546
|
+
});
|
|
4547
|
+
const { limit: limit, offset: offset, count: count, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
4548
|
+
const intCount = count ? parseInt(count) : 0;
|
|
4549
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4550
|
+
className: "dc-c-resource-header",
|
|
4551
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4552
|
+
className: "ds-l-row ds-u-align-items--center",
|
|
4553
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4554
|
+
className: "ds-l-col--12 ds-u-display--flex ds-u-justify-content--between ds-u-align-items--center ds-u-margin-bottom--2",
|
|
4413
4555
|
children: [
|
|
4414
4556
|
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4415
|
-
className: "ds-u-
|
|
4416
|
-
children:
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
className: "ds-u-font-weight--bold ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
|
|
4421
|
-
children: [
|
|
4422
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
4423
|
-
className: "fas fa-file-csv"
|
|
4424
|
-
}),
|
|
4425
|
-
" Download full dataset (CSV)"
|
|
4426
|
-
]
|
|
4427
|
-
})
|
|
4557
|
+
className: "ds-u-font-weight--bold",
|
|
4558
|
+
children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
4559
|
+
totalRows: parseInt(intCount),
|
|
4560
|
+
limit: parseInt(limit),
|
|
4561
|
+
offset: parseInt(offset)
|
|
4428
4562
|
})
|
|
4429
4563
|
}),
|
|
4430
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $85f8ff1ff89899c7$export$2e2bcd8739ae039), {
|
|
4431
|
-
id: id,
|
|
4432
|
-
columns: table.getAllLeafColumns(),
|
|
4433
|
-
defaultColumnOrder: defaultColumnOrder,
|
|
4434
|
-
isModal: isModal,
|
|
4435
|
-
resource: resource,
|
|
4436
|
-
datasetTableControls: datasetTableControls,
|
|
4437
|
-
columnVisibility: columnVisibility,
|
|
4438
|
-
setColumnVisibility: setColumnVisibility
|
|
4439
|
-
}),
|
|
4440
4564
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4441
|
-
className: "
|
|
4565
|
+
className: "dc-c-resource-header--buttons",
|
|
4442
4566
|
children: [
|
|
4443
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)(
|
|
4444
|
-
className: "dkan-data-table-info-container ds-u-padding-right--0 ds-u-md-padding-right--4",
|
|
4567
|
+
includeDownload && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4445
4568
|
children: [
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
})
|
|
4451
|
-
}),
|
|
4452
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
4453
|
-
className: "ds-u-margin--0",
|
|
4454
|
-
children: "Activate the column resize button and use the right and left arrow keys to resize a column or use your mouse to drag/resize. Press escape to cancel the resizing."
|
|
4455
|
-
})
|
|
4456
|
-
]
|
|
4457
|
-
}),
|
|
4458
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4459
|
-
className: "dkan-data-table-share-container ds-l-col--auto ds-u-padding--0 ds-u-margin-bottom--2 ds-u-md-margin-bottom--0",
|
|
4460
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
4461
|
-
className: "ds-c-button ds-c-button--solid dkan-data-table-share-button ds-u-display--flex ds-u-align-items--center ds-u-padding-x--3 ds-u-padding-y--1 ds-u-font-weight--bold ds-l-col--12 ds-l-md-col--auto ds-u-justify-content--center",
|
|
4462
|
-
activeClassName: "dkan-data-table-share-tooltip-open",
|
|
4463
|
-
dialog: true,
|
|
4464
|
-
offset: [
|
|
4465
|
-
0,
|
|
4466
|
-
5
|
|
4467
|
-
],
|
|
4468
|
-
"aria-haspopup": "dialog",
|
|
4469
|
-
placement: "bottom-start",
|
|
4470
|
-
maxWidth: "320px",
|
|
4471
|
-
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4472
|
-
className: "dc-c-resource-header--buttons ds-u-display--flex ds-u-flex-direction--column ds-l-col--12 ds-u-padding-x--0",
|
|
4569
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
|
|
4570
|
+
size: "small",
|
|
4571
|
+
className: "ds-u-text-align--left ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1",
|
|
4572
|
+
href: downloadUrl,
|
|
4473
4573
|
children: [
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
},
|
|
4479
|
-
className: "ds-c-button ds-u-text-align--center ds-l-col--12 ds-u-padding-x--2 ds-u-margin-x--0 ds-u-margin-bottom--1",
|
|
4480
|
-
placement: "bottom",
|
|
4481
|
-
dialog: true,
|
|
4482
|
-
ariaLabel: "Copy link to filtered data",
|
|
4483
|
-
title: "Link copied to clipboard",
|
|
4484
|
-
"aria-disabled": !conditions || conditions.length === 0,
|
|
4485
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
4486
|
-
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
|
|
4487
|
-
children: [
|
|
4488
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
4489
|
-
className: "fas fa-copy"
|
|
4490
|
-
}),
|
|
4491
|
-
" Copy link to filtered data"
|
|
4492
|
-
]
|
|
4493
|
-
})
|
|
4494
|
-
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
4495
|
-
"aria-disabled": true,
|
|
4496
|
-
"aria-label": "Copy link to filtered data",
|
|
4497
|
-
className: "ds-c-button ds-u-text-align--center ds-l-col--12 ds-u-padding-x--2 ds-u-margin-x--0 ds-u-margin-bottom--1",
|
|
4498
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
4499
|
-
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
|
|
4500
|
-
children: [
|
|
4501
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
4502
|
-
className: "fas fa-copy"
|
|
4503
|
-
}),
|
|
4504
|
-
" Copy link to filtered data"
|
|
4505
|
-
]
|
|
4506
|
-
})
|
|
4507
|
-
})
|
|
4508
|
-
}),
|
|
4509
|
-
(showDownloadFilteredDataButton || showStoredQueryDownloadButton) && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4510
|
-
className: "ds-l-col--12 ds-u-padding-x--0 ds-u-margin-x--0",
|
|
4511
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
4512
|
-
className: "ds-u-text-align--center ds-u-display--inline-block ds-l-col--12 ds-u-padding-x--2 ds-u-margin-x--0 ds-u-margin-bottom--1",
|
|
4513
|
-
href: conditions && conditions.length ? downloadURL : null,
|
|
4514
|
-
"aria-disabled": !conditions || conditions.length === 0,
|
|
4515
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
4516
|
-
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
|
|
4517
|
-
children: [
|
|
4518
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
4519
|
-
className: "fas fa-file-csv"
|
|
4520
|
-
}),
|
|
4521
|
-
" ",
|
|
4522
|
-
showDownloadFilteredDataButton ? `Download filtered data (CSV)` : `Download stored query data (CSV)`
|
|
4523
|
-
]
|
|
4524
|
-
})
|
|
4525
|
-
})
|
|
4574
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e973bc477cdc2dc7$export$2e2bcd8739ae039), {}),
|
|
4575
|
+
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4576
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
4577
|
+
children: "Download filtered data (CSV)"
|
|
4526
4578
|
})
|
|
4527
4579
|
]
|
|
4528
4580
|
}),
|
|
4581
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
4582
|
+
onOpen: ()=>{
|
|
4583
|
+
navigator.clipboard.writeText(window.location.href);
|
|
4584
|
+
},
|
|
4585
|
+
className: "ds-c-button ds-c-button--small ds-u-text-align--left ds-u-margin-right--1 display-settings-font",
|
|
4586
|
+
placement: "bottom",
|
|
4587
|
+
dialog: true,
|
|
4588
|
+
ariaLabel: "Copy link to filtered data",
|
|
4589
|
+
title: "Link copied to clipboard",
|
|
4590
|
+
children: [
|
|
4591
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $7ec5423a30aa3f61$export$2e2bcd8739ae039), {}),
|
|
4592
|
+
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4593
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
4594
|
+
children: "Copy link to filtered data"
|
|
4595
|
+
})
|
|
4596
|
+
]
|
|
4597
|
+
})
|
|
4598
|
+
]
|
|
4599
|
+
}),
|
|
4600
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
4601
|
+
className: "ds-c-button ds-c-button--small ds-u-text-align--left display-settings-font",
|
|
4602
|
+
placement: "bottom",
|
|
4603
|
+
dialog: true,
|
|
4604
|
+
ariaLabel: "Display settings",
|
|
4605
|
+
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4606
|
+
className: "dc-c-display-settings",
|
|
4529
4607
|
children: [
|
|
4530
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
className: "ds-u-margin-x--05",
|
|
4535
|
-
children: "Share"
|
|
4536
|
-
}),
|
|
4537
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
4538
|
-
className: "fa fa-chevron-down"
|
|
4608
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $7848c69a021266f7$export$2e2bcd8739ae039), {
|
|
4609
|
+
limit: Number(limit),
|
|
4610
|
+
setLimit: setLimit,
|
|
4611
|
+
setOffset: setOffset
|
|
4539
4612
|
}),
|
|
4540
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
4541
|
-
|
|
4613
|
+
includeDensity && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $1e012d1e3b534af0$export$2e2bcd8739ae039), {
|
|
4614
|
+
setTablePadding: setTablePadding,
|
|
4615
|
+
tablePadding: tablePadding
|
|
4542
4616
|
})
|
|
4543
4617
|
]
|
|
4544
|
-
})
|
|
4618
|
+
}),
|
|
4619
|
+
children: [
|
|
4620
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $ec9e1550b0b034d0$export$2e2bcd8739ae039), {}),
|
|
4621
|
+
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4622
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
4623
|
+
children: "Display settings"
|
|
4624
|
+
})
|
|
4625
|
+
]
|
|
4545
4626
|
})
|
|
4546
4627
|
]
|
|
4547
4628
|
})
|
|
4548
4629
|
]
|
|
4549
|
-
}),
|
|
4550
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4551
|
-
className: "dc-c-datatable-wrapper ds-u-border-x--1 ds-u-border-bottom--1",
|
|
4552
|
-
tabIndex: 0,
|
|
4553
|
-
ref: dataTableWrapperElement,
|
|
4554
|
-
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("table", {
|
|
4555
|
-
style: {
|
|
4556
|
-
width: canResize ? table.getCenterTotalSize() : "100%",
|
|
4557
|
-
minWidth: tableWrapperWidth()
|
|
4558
|
-
},
|
|
4559
|
-
className: "dc-c-datatable",
|
|
4560
|
-
children: [
|
|
4561
|
-
canResize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $96d341d082bffec5$export$2e2bcd8739ae039), {
|
|
4562
|
-
table: table,
|
|
4563
|
-
sortElement: sortElement
|
|
4564
|
-
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $23763e27eda0e8d7$export$2e2bcd8739ae039), {
|
|
4565
|
-
table: table,
|
|
4566
|
-
sortElement: sortElement
|
|
4567
|
-
}),
|
|
4568
|
-
loading ? /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {}) : /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {
|
|
4569
|
-
children: table.getRowModel().rows.map((row, index)=>{
|
|
4570
|
-
const even = (index + 1) % 2 === 0;
|
|
4571
|
-
const highlight = highlightRow === row.id;
|
|
4572
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
4573
|
-
className: `${highlight ? "dc-c-datatable--highlight-row" : even && "dc-c-datatable--even-row"}`,
|
|
4574
|
-
onClick: ()=>setHighlightRow(row.id),
|
|
4575
|
-
children: row.getVisibleCells().map((cell)=>{
|
|
4576
|
-
let classList = "dc-truncate ds-u-padding-x--1";
|
|
4577
|
-
return /*#__PURE__*/ (0, $hgUW1$jsx)("td", {
|
|
4578
|
-
key: cell.id,
|
|
4579
|
-
style: {
|
|
4580
|
-
maxWidth: cell.column.getSize()
|
|
4581
|
-
},
|
|
4582
|
-
className: `${classList} ${tablePadding}`,
|
|
4583
|
-
title: cell.getValue(),
|
|
4584
|
-
children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
4585
|
-
});
|
|
4586
|
-
})
|
|
4587
|
-
}, row.id);
|
|
4588
|
-
})
|
|
4589
|
-
})
|
|
4590
|
-
]
|
|
4591
|
-
})
|
|
4592
|
-
}),
|
|
4593
|
-
loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
4594
|
-
"aria-valuetext": "Dataset loading",
|
|
4595
|
-
role: "status",
|
|
4596
|
-
className: "ds-u-margin--3"
|
|
4597
|
-
}),
|
|
4598
|
-
!loading && table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
4599
|
-
variation: "warn",
|
|
4600
|
-
children: "No results found for the current filters"
|
|
4601
4630
|
})
|
|
4602
|
-
|
|
4631
|
+
})
|
|
4603
4632
|
});
|
|
4604
4633
|
};
|
|
4605
|
-
var $
|
|
4634
|
+
var $af099c546cb226c7$export$2e2bcd8739ae039 = $af099c546cb226c7$var$ResourceHeader;
|
|
4635
|
+
|
|
4636
|
+
|
|
4637
|
+
|
|
4638
|
+
|
|
4639
|
+
|
|
4640
|
+
|
|
4641
|
+
|
|
4606
4642
|
|
|
4607
4643
|
|
|
4608
4644
|
|
|
@@ -4625,21 +4661,30 @@ function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header, a
|
|
|
4625
4661
|
value: filterValue || ''
|
|
4626
4662
|
});
|
|
4627
4663
|
}
|
|
4628
|
-
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, canResize: canResize = true })=>{
|
|
4664
|
+
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, canResize: canResize = true, showDataTableToolbar: showDataTableToolbar = false, showInfoShareContainer: showInfoShareContainer = true, showTableResults: showTableResults = true, showFilterDatasetButton: showFilterDatasetButton = true, showManageColumnsButton: showManageColumnsButton = true, showDisplaySettingsButton: showDisplaySettingsButton = true, showFullScreenButton: showFullScreenButton = true })=>{
|
|
4629
4665
|
const { resource: resource, customColumns: customColumns } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
4666
|
+
const { tableDensity: tableDensity } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
4630
4667
|
const customColumnHeaders = customColumns ? (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[id]) : null;
|
|
4631
4668
|
const columns = customColumnHeaders ? customColumnHeaders : $626282d9a03c51d5$export$1147582dfae658c6(resource.columns, resource.schema[id]);
|
|
4632
4669
|
if (Object.keys(resource).length && columns.length && resource.schema) return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4633
4670
|
id: "resource-preview",
|
|
4634
|
-
className: "ds-u-overflow--auto
|
|
4671
|
+
className: "ds-u-overflow--auto",
|
|
4635
4672
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
|
|
4636
4673
|
canResize: canResize,
|
|
4637
4674
|
columns: customColumns ? customColumns : $626282d9a03c51d5$export$1147582dfae658c6(resource.columns, resource.schema[id]),
|
|
4638
4675
|
sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
|
|
4639
|
-
tablePadding: tablePadding,
|
|
4676
|
+
tablePadding: typeof tablePadding === 'function' ? tablePadding(tableDensity) : tablePadding,
|
|
4640
4677
|
loading: resource.loading,
|
|
4641
4678
|
className: "dc-c-datatable",
|
|
4642
|
-
customColumnFilter: $626282d9a03c51d5$var$DefaultColumnFilter
|
|
4679
|
+
customColumnFilter: $626282d9a03c51d5$var$DefaultColumnFilter,
|
|
4680
|
+
showDataTableToolbar: showDataTableToolbar,
|
|
4681
|
+
showInfoShareContainer: showInfoShareContainer,
|
|
4682
|
+
showTableResults: showTableResults,
|
|
4683
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
4684
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
4685
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
4686
|
+
showFullScreenButton: showFullScreenButton,
|
|
4687
|
+
isModal: false
|
|
4643
4688
|
})
|
|
4644
4689
|
});
|
|
4645
4690
|
else return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {});
|
|
@@ -8287,5 +8332,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
|
|
|
8287
8332
|
|
|
8288
8333
|
|
|
8289
8334
|
|
|
8290
|
-
export {$e49d4387bed21287$export$2e2bcd8739ae039 as ApiRowLimitNotice, $a8accc31bf9e0bda$export$2e2bcd8739ae039 as CMSTopNav, $c49454ea7d1c4579$export$2e2bcd8739ae039 as ErrorBoundary, $046ded0064bd0a3d$export$2e2bcd8739ae039 as FAQAccordion, $b939b31651e82908$export$2e2bcd8739ae039 as HeaderNav, $1555e1cb3eb7b3e3$export$2e2bcd8739ae039 as HeaderNavIconLink, $fea9297ba4dd394c$export$2e2bcd8739ae039 as HeaderSearch, $9a8892c5ac150556$export$2e2bcd8739ae039 as HeaderSiteTitle, $3c72c298c3a7f21f$export$2e2bcd8739ae039 as HeaderTagline, $403833a4b442d5df$export$2e2bcd8739ae039 as MobileMenuButton, $f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $953b286f7778640e$export$2e2bcd8739ae039 as SidebarNavigation, $b0968edc60d7d3a4$export$2e2bcd8739ae039 as SidebarPage, $4f153ca537d853e5$export$2e2bcd8739ae039 as SubMenu, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $c068004d499082cc$export$2e2bcd8739ae039 as DatasetListItem, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $17711e94d2ce0ee4$export$2e2bcd8739ae039 as DatasetDateItem, $20de4fedf33d4f9a$export$2e2bcd8739ae039 as DatasetDate, $10bc3aae21fc1572$export$2e2bcd8739ae039 as DatasetListSubmenu, $e011250e8a3bd5e5$export$2e2bcd8739ae039 as DatasetSearchFacets, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $bdb071ea3a6d3466$export$2e2bcd8739ae039 as SearchInput, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $550bcc185f420ff5$export$2e2bcd8739ae039 as DatasetList, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $b9af6ce5e2c06331$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $8b67b7ee3fcfb629$export$2e2bcd8739ae039 as StoredQueryPage, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $43a30d745a7bbc86$export$2e2bcd8739ae039 as DataTableContext, $ee0d4d4f34048447$export$2e2bcd8739ae039 as DataTableActionsProvider, $844981eac9b63865$export$eccc29c8d0ff408 as ACAContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6d5c0212e738499b$export$34e95918366a058e as acaToParams, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping};
|
|
8335
|
+
export {$e49d4387bed21287$export$2e2bcd8739ae039 as ApiRowLimitNotice, $a8accc31bf9e0bda$export$2e2bcd8739ae039 as CMSTopNav, $c49454ea7d1c4579$export$2e2bcd8739ae039 as ErrorBoundary, $046ded0064bd0a3d$export$2e2bcd8739ae039 as FAQAccordion, $b939b31651e82908$export$2e2bcd8739ae039 as HeaderNav, $1555e1cb3eb7b3e3$export$2e2bcd8739ae039 as HeaderNavIconLink, $fea9297ba4dd394c$export$2e2bcd8739ae039 as HeaderSearch, $9a8892c5ac150556$export$2e2bcd8739ae039 as HeaderSiteTitle, $3c72c298c3a7f21f$export$2e2bcd8739ae039 as HeaderTagline, $403833a4b442d5df$export$2e2bcd8739ae039 as MobileMenuButton, $f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $953b286f7778640e$export$2e2bcd8739ae039 as SidebarNavigation, $b0968edc60d7d3a4$export$2e2bcd8739ae039 as SidebarPage, $4f153ca537d853e5$export$2e2bcd8739ae039 as SubMenu, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $c068004d499082cc$export$2e2bcd8739ae039 as DatasetListItem, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $17711e94d2ce0ee4$export$2e2bcd8739ae039 as DatasetDateItem, $20de4fedf33d4f9a$export$2e2bcd8739ae039 as DatasetDate, $85f8ff1ff89899c7$export$2e2bcd8739ae039 as DataTableToolbar, $10bc3aae21fc1572$export$2e2bcd8739ae039 as DatasetListSubmenu, $e011250e8a3bd5e5$export$2e2bcd8739ae039 as DatasetSearchFacets, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $bdb071ea3a6d3466$export$2e2bcd8739ae039 as SearchInput, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $550bcc185f420ff5$export$2e2bcd8739ae039 as DatasetList, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $b9af6ce5e2c06331$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $8b67b7ee3fcfb629$export$2e2bcd8739ae039 as StoredQueryPage, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $43a30d745a7bbc86$export$2e2bcd8739ae039 as DataTableContext, $ee0d4d4f34048447$export$2e2bcd8739ae039 as DataTableActionsProvider, $844981eac9b63865$export$eccc29c8d0ff408 as ACAContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6d5c0212e738499b$export$34e95918366a058e as acaToParams, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping};
|
|
8291
8336
|
//# sourceMappingURL=main.js.map
|