@civicactions/cmsds-open-data-components 4.0.17 → 4.0.18
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 +1093 -1053
- 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
|
|
|
@@ -2397,29 +2397,6 @@ var $c068004d499082cc$export$2e2bcd8739ae039 = $c068004d499082cc$var$DatasetList
|
|
|
2397
2397
|
|
|
2398
2398
|
|
|
2399
2399
|
|
|
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
2400
|
const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className = 'data-table-results' })=>{
|
|
2424
2401
|
const numTotalRows = totalRows;
|
|
2425
2402
|
if (numTotalRows === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
@@ -2469,428 +2446,420 @@ var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePa
|
|
|
2469
2446
|
|
|
2470
2447
|
|
|
2471
2448
|
|
|
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
2449
|
|
|
2506
2450
|
|
|
2507
2451
|
|
|
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
2452
|
|
|
2537
2453
|
|
|
2538
2454
|
|
|
2539
2455
|
|
|
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
|
-
]
|
|
2456
|
+
const $5fe94aeb50e0798b$var$Card = ({ id: id, visible: visible, updateVisibility: updateVisibility })=>{
|
|
2457
|
+
const { attributes: attributes, listeners: listeners, setNodeRef: setNodeRef, transform: transform, transition: transition, isDragging: isDragging } = (0, $hgUW1$useSortable)({
|
|
2458
|
+
id: id
|
|
2563
2459
|
});
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2460
|
+
const style = {
|
|
2461
|
+
transform: (0, $hgUW1$CSS).Transform.toString(transform),
|
|
2462
|
+
transition: transition,
|
|
2463
|
+
opacity: isDragging ? 0.7 : 1,
|
|
2464
|
+
zIndex: isDragging ? 1 : 0,
|
|
2465
|
+
position: 'relative',
|
|
2466
|
+
background: 'white',
|
|
2467
|
+
touchAction: 'none'
|
|
2468
|
+
};
|
|
2469
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
|
|
2470
|
+
className: "ds-u-display--flex ds-u-justify-content--between ds-u-border-bottom--1",
|
|
2471
|
+
ref: setNodeRef,
|
|
2472
|
+
style: style,
|
|
2473
|
+
...listeners,
|
|
2474
|
+
...attributes,
|
|
2475
|
+
tabIndex: -1,
|
|
2476
|
+
onPointerUp: (e)=>{
|
|
2477
|
+
// Small hack to get around a chrome / webkit rendering bug = force chrome to repaint the checkbox
|
|
2478
|
+
// For whatever reason the way dnd-kit handles events doesn't work well with chrome
|
|
2479
|
+
// Without this code checkboxes can end up visually out of sync with app state until a repaint is forced
|
|
2480
|
+
// this code forces the repaint without user interaction
|
|
2481
|
+
const target = e.target;
|
|
2482
|
+
if (isDragging && target.tagName.toLowerCase() === "label") setTimeout(()=>{
|
|
2483
|
+
target.parentNode.querySelector('input').checked = visible;
|
|
2484
|
+
}, 1);
|
|
2485
|
+
},
|
|
2576
2486
|
children: [
|
|
2577
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
2578
|
-
|
|
2487
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
|
|
2488
|
+
type: "checkbox",
|
|
2489
|
+
label: id,
|
|
2490
|
+
name: id + "_visibility",
|
|
2491
|
+
checked: visible,
|
|
2492
|
+
className: "ds-l-col--10 ds-u-margin-top--0 ds-u-margin-y--1 ds-u-padding-x--3",
|
|
2493
|
+
labelClassName: "dc-truncate",
|
|
2494
|
+
value: "",
|
|
2495
|
+
onChange: ()=>{
|
|
2496
|
+
updateVisibility(id, !visible);
|
|
2497
|
+
}
|
|
2579
2498
|
}),
|
|
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"
|
|
2499
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("button", {
|
|
2500
|
+
className: `ds-l-col--2 dkan-manage-columns-reorder-button ${isDragging && 'grabbed'}`,
|
|
2501
|
+
"aria-label": `Reorder ${id} column`,
|
|
2502
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2503
|
+
className: "fa fa-sort"
|
|
2589
2504
|
})
|
|
2590
2505
|
})
|
|
2591
2506
|
]
|
|
2592
2507
|
});
|
|
2593
|
-
|
|
2508
|
+
};
|
|
2509
|
+
var $5fe94aeb50e0798b$export$2e2bcd8739ae039 = $5fe94aeb50e0798b$var$Card;
|
|
2594
2510
|
|
|
2595
2511
|
|
|
2596
2512
|
|
|
2597
2513
|
|
|
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
2514
|
|
|
2515
|
+
const $43a30d745a7bbc86$var$DataTableContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
|
|
2516
|
+
id: null
|
|
2517
|
+
});
|
|
2518
|
+
var $43a30d745a7bbc86$export$2e2bcd8739ae039 = $43a30d745a7bbc86$var$DataTableContext;
|
|
2625
2519
|
|
|
2626
2520
|
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2521
|
+
// Create a defaults object for reusability
|
|
2522
|
+
const $ee0d4d4f34048447$var$DataTableActionsContextDefaults = {
|
|
2523
|
+
columnOrder: [],
|
|
2524
|
+
setColumnOrder: ()=>{},
|
|
2525
|
+
columnVisibility: {},
|
|
2526
|
+
setColumnVisibility: ()=>{},
|
|
2527
|
+
page: 1,
|
|
2528
|
+
setPage: ()=>{},
|
|
2529
|
+
tableDensity: 'normal',
|
|
2530
|
+
setTableDensity: ()=>{}
|
|
2531
|
+
};
|
|
2532
|
+
const $ee0d4d4f34048447$export$f814ea079e65d8fe = /*#__PURE__*/ (0, $hgUW1$createContext)($ee0d4d4f34048447$var$DataTableActionsContextDefaults);
|
|
2533
|
+
// Define our reusable provider component
|
|
2534
|
+
const $ee0d4d4f34048447$var$DataTableActionsProvider = ({ children: children })=>{
|
|
2535
|
+
// Set up all of the state
|
|
2536
|
+
const { id: id, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
2537
|
+
// a wrapper component to keep column state synced between full screen and regular modes
|
|
2538
|
+
const localStorageData = id ? JSON.parse(localStorage.getItem(id)) : null;
|
|
2539
|
+
const [page, setPage] = (0, $hgUW1$useState)(1);
|
|
2540
|
+
const [columnOrder, setColumnOrder] = (0, $hgUW1$useState)(()=>{
|
|
2541
|
+
if (datasetTableControls && localStorageData) return localStorageData.tableColumnOrder;
|
|
2542
|
+
else return [];
|
|
2631
2543
|
});
|
|
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
|
-
})
|
|
2544
|
+
const [columnVisibility, setColumnVisibility] = (0, $hgUW1$useState)(()=>{
|
|
2545
|
+
if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
|
|
2546
|
+
else return {};
|
|
2547
|
+
});
|
|
2548
|
+
const [tableDensity, setTableDensity] = (0, $hgUW1$useState)('normal');
|
|
2549
|
+
const providerValue = {
|
|
2550
|
+
columnOrder: columnOrder,
|
|
2551
|
+
setColumnOrder: setColumnOrder,
|
|
2552
|
+
columnVisibility: columnVisibility,
|
|
2553
|
+
setColumnVisibility: setColumnVisibility,
|
|
2554
|
+
page: page,
|
|
2555
|
+
setPage: setPage,
|
|
2556
|
+
tableDensity: tableDensity,
|
|
2557
|
+
setTableDensity: setTableDensity
|
|
2558
|
+
};
|
|
2559
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
|
|
2560
|
+
value: providerValue,
|
|
2561
|
+
children: children
|
|
2717
2562
|
});
|
|
2718
2563
|
};
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2564
|
+
const $ee0d4d4f34048447$export$67f91330d613e8f4 = ({ children: children, value: value = $ee0d4d4f34048447$var$DataTableActionsContextDefaults })=>/*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
|
|
2565
|
+
value: value,
|
|
2566
|
+
children: children
|
|
2567
|
+
});
|
|
2568
|
+
var $ee0d4d4f34048447$export$2e2bcd8739ae039 = $ee0d4d4f34048447$var$DataTableActionsProvider;
|
|
2722
2569
|
|
|
2723
2570
|
|
|
2724
2571
|
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2572
|
+
/**
|
|
2573
|
+
* Workaround for CMS Design System nested dialog issue.
|
|
2574
|
+
* When a nested dialog closes, the design system removes scroll lock
|
|
2575
|
+
* even if a parent dialog is still open. This restores it.
|
|
2576
|
+
*/ function $15650910340b2c71$export$73fce4ded5ef1c2() {
|
|
2577
|
+
setTimeout(()=>{
|
|
2578
|
+
if (document.querySelector('.dkan-fullscreen-data-table-wrapper .ds-c-dialog-wrap.open')) {
|
|
2579
|
+
document.body.classList.add('ds--dialog-open');
|
|
2580
|
+
document.body.style.setProperty('--body_top--dialog-open', '-0px');
|
|
2581
|
+
}
|
|
2582
|
+
}, 0);
|
|
2734
2583
|
}
|
|
2735
2584
|
|
|
2736
2585
|
|
|
2737
|
-
|
|
2738
|
-
//
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2586
|
+
class $5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor extends (0, $hgUW1$KeyboardSensor) {
|
|
2587
|
+
// Custom function to exclude checkbox from keyboard dragging
|
|
2588
|
+
static activators = [
|
|
2589
|
+
{
|
|
2590
|
+
eventName: 'onKeyDown',
|
|
2591
|
+
handler: ({ nativeEvent: event })=>{
|
|
2592
|
+
// prevent scrolling the list
|
|
2593
|
+
const isCheckbox = [
|
|
2594
|
+
"input",
|
|
2595
|
+
"checkbox"
|
|
2596
|
+
].indexOf(event.target.tagName.toLowerCase()) !== -1;
|
|
2597
|
+
if (event.key === " " && !isCheckbox) event.preventDefault();
|
|
2598
|
+
// only activate on a space or return press
|
|
2599
|
+
if ([
|
|
2600
|
+
" ",
|
|
2601
|
+
"Enter"
|
|
2602
|
+
].indexOf(event.key) === -1) return false;
|
|
2603
|
+
if (!isCheckbox) return true;
|
|
2604
|
+
return false;
|
|
2605
|
+
}
|
|
2756
2606
|
}
|
|
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
|
|
2607
|
+
];
|
|
2821
2608
|
}
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
label: 'Is Empty',
|
|
2826
|
-
value: 'is_empty'
|
|
2827
|
-
},
|
|
2609
|
+
class $5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor extends (0, $hgUW1$PointerSensor) {
|
|
2610
|
+
// Custom function to stop accidental checkbox clicks on pointer activation
|
|
2611
|
+
static activators = [
|
|
2828
2612
|
{
|
|
2829
|
-
|
|
2830
|
-
|
|
2613
|
+
eventName: 'onPointerDown',
|
|
2614
|
+
handler: ({ nativeEvent: event })=>{
|
|
2615
|
+
if (event.target.tagName.toLowerCase() === "input") return false;
|
|
2616
|
+
if (event.target.tagName.toLowerCase() === "label") event.target.blur();
|
|
2617
|
+
return true;
|
|
2618
|
+
}
|
|
2831
2619
|
}
|
|
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
|
-
}
|
|
2620
|
+
];
|
|
2893
2621
|
}
|
|
2622
|
+
const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder })=>{
|
|
2623
|
+
const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, setColumnVisibility: setColumnVisibility, columnVisibility: contextColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
2624
|
+
const columnVisibility = contextColumnVisibility || {};
|
|
2625
|
+
const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
|
|
2626
|
+
// maintain card state separately from table state - only sync states when the Save button is pressed
|
|
2627
|
+
const [cards, setCards] = (0, $hgUW1$useState)(columns.map((c)=>{
|
|
2628
|
+
return {
|
|
2629
|
+
id: c.id,
|
|
2630
|
+
visible: c.getIsVisible()
|
|
2631
|
+
};
|
|
2632
|
+
}));
|
|
2633
|
+
const cardOrder = (0, $hgUW1$useMemo)(()=>cards.map(({ id: id })=>id), [
|
|
2634
|
+
cards
|
|
2635
|
+
]);
|
|
2636
|
+
// keep state in sync
|
|
2637
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
2638
|
+
if (columnOrder?.length) setCards(columnOrder.map((c)=>{
|
|
2639
|
+
const column = columns.filter((col)=>col.id === c)[0];
|
|
2640
|
+
return {
|
|
2641
|
+
id: column.id,
|
|
2642
|
+
visible: column.getIsVisible()
|
|
2643
|
+
};
|
|
2644
|
+
}));
|
|
2645
|
+
}, [
|
|
2646
|
+
columnOrder
|
|
2647
|
+
]);
|
|
2648
|
+
// Update cards state when columnVisibility changes
|
|
2649
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
2650
|
+
setCards((prevCards)=>prevCards.map((card)=>({
|
|
2651
|
+
...card,
|
|
2652
|
+
visible: columnVisibility[card.id] !== false
|
|
2653
|
+
})));
|
|
2654
|
+
}, [
|
|
2655
|
+
columnVisibility
|
|
2656
|
+
]);
|
|
2657
|
+
const sensors = (0, $hgUW1$useSensors)((0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor, {
|
|
2658
|
+
activationConstraint: {
|
|
2659
|
+
distance: 5
|
|
2660
|
+
}
|
|
2661
|
+
}), (0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor, {
|
|
2662
|
+
coordinateGetter: (0, $hgUW1$sortableKeyboardCoordinates)
|
|
2663
|
+
}));
|
|
2664
|
+
const cardHiddenColumns = cards.filter((c)=>c.visible === false).length;
|
|
2665
|
+
const updateVisibility = (0, $hgUW1$useCallback)((id, newVisibility)=>{
|
|
2666
|
+
setCards(cards.map((card)=>{
|
|
2667
|
+
if (card.id === id) return {
|
|
2668
|
+
...card,
|
|
2669
|
+
visible: newVisibility
|
|
2670
|
+
};
|
|
2671
|
+
return card;
|
|
2672
|
+
}));
|
|
2673
|
+
});
|
|
2674
|
+
function handleDragEnd(e) {
|
|
2675
|
+
const { active: active, over: over } = e;
|
|
2676
|
+
if (active.id !== over.id) {
|
|
2677
|
+
const oldIndex = cardOrder.indexOf(active.id);
|
|
2678
|
+
const newIndex = cardOrder.indexOf(over.id);
|
|
2679
|
+
let newCards = (0, $hgUW1$arrayMove)(cards, oldIndex, newIndex);
|
|
2680
|
+
setCards(newCards);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
const resetCards = ()=>{
|
|
2684
|
+
setCards(columns.map((c)=>{
|
|
2685
|
+
return {
|
|
2686
|
+
id: c.id,
|
|
2687
|
+
visible: c.getIsVisible()
|
|
2688
|
+
};
|
|
2689
|
+
}));
|
|
2690
|
+
};
|
|
2691
|
+
const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
|
|
2692
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2693
|
+
className: "dkan-manage-columns-wrapper",
|
|
2694
|
+
children: [
|
|
2695
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
|
|
2696
|
+
"aria-haspopup": "dialog",
|
|
2697
|
+
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",
|
|
2698
|
+
onClick: ()=>{
|
|
2699
|
+
setModalOpen(true);
|
|
2700
|
+
},
|
|
2701
|
+
children: [
|
|
2702
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
2703
|
+
className: "fa fa-columns ds-u-margin-right--1"
|
|
2704
|
+
}),
|
|
2705
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
2706
|
+
children: [
|
|
2707
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2708
|
+
className: "dkan-dataset-toolbar-button-label",
|
|
2709
|
+
children: "Manage Columns"
|
|
2710
|
+
}),
|
|
2711
|
+
hiddenColumns ? ` (${hiddenColumns})` : ''
|
|
2712
|
+
]
|
|
2713
|
+
})
|
|
2714
|
+
]
|
|
2715
|
+
}),
|
|
2716
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2717
|
+
className: `ds-c-dialog-wrap${modalOpen ? ' open' : ''}`,
|
|
2718
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
|
|
2719
|
+
heading: "Manage columns",
|
|
2720
|
+
isOpen: modalOpen,
|
|
2721
|
+
ariaCloseLabel: "Close dialog",
|
|
2722
|
+
onExit: ()=>{
|
|
2723
|
+
setModalOpen(false);
|
|
2724
|
+
resetCards();
|
|
2725
|
+
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
2726
|
+
},
|
|
2727
|
+
className: "dkan-manage-columns-dialog",
|
|
2728
|
+
actions: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2729
|
+
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",
|
|
2730
|
+
children: [
|
|
2731
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2732
|
+
className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0",
|
|
2733
|
+
children: [
|
|
2734
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2735
|
+
variation: "solid",
|
|
2736
|
+
className: "ds-l-col--6 ds-l-sm-col--auto",
|
|
2737
|
+
onClick: ()=>{
|
|
2738
|
+
setModalOpen(false);
|
|
2739
|
+
// update table state
|
|
2740
|
+
// Visibility
|
|
2741
|
+
// This code is building a new columnVisibility state object from the card state and doing a single setState on the table
|
|
2742
|
+
// vs doing a setState on every changed column individually
|
|
2743
|
+
const newColumnVisibility = Object.fromEntries(cards.map((c)=>Object.values(c)));
|
|
2744
|
+
setColumnVisibility(newColumnVisibility);
|
|
2745
|
+
// Card order
|
|
2746
|
+
const newCardOrder = cards.map((c)=>{
|
|
2747
|
+
return c.id;
|
|
2748
|
+
});
|
|
2749
|
+
setColumnOrder(newCardOrder);
|
|
2750
|
+
// save to localStorage
|
|
2751
|
+
const localStorageData = {
|
|
2752
|
+
tableColumnOrder: newCardOrder,
|
|
2753
|
+
tableColumnVisibility: newColumnVisibility
|
|
2754
|
+
};
|
|
2755
|
+
localStorage.setItem(id, JSON.stringify(localStorageData));
|
|
2756
|
+
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
2757
|
+
},
|
|
2758
|
+
children: "Save"
|
|
2759
|
+
}),
|
|
2760
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2761
|
+
variation: "ghost",
|
|
2762
|
+
className: "ds-l-col--6 ds-l-sm-col--auto",
|
|
2763
|
+
onClick: ()=>{
|
|
2764
|
+
setModalOpen(false);
|
|
2765
|
+
resetCards();
|
|
2766
|
+
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
2767
|
+
},
|
|
2768
|
+
children: "Cancel"
|
|
2769
|
+
})
|
|
2770
|
+
]
|
|
2771
|
+
}),
|
|
2772
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
2773
|
+
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",
|
|
2774
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
2775
|
+
variation: "ghost",
|
|
2776
|
+
className: "ds-l-col--6 ds-l-sm-col--auto",
|
|
2777
|
+
onClick: ()=>{
|
|
2778
|
+
// reset to default column order and set all cards to visible
|
|
2779
|
+
// do not save this to the table state until the "Save" button is clicked
|
|
2780
|
+
setCards(defaultColumnOrder.map((column)=>{
|
|
2781
|
+
const card = cards.filter((c)=>c.id === column)[0];
|
|
2782
|
+
return {
|
|
2783
|
+
...card,
|
|
2784
|
+
visible: true
|
|
2785
|
+
};
|
|
2786
|
+
}));
|
|
2787
|
+
},
|
|
2788
|
+
children: "Reset Columns"
|
|
2789
|
+
})
|
|
2790
|
+
})
|
|
2791
|
+
]
|
|
2792
|
+
}),
|
|
2793
|
+
children: [
|
|
2794
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
2795
|
+
id: "reorder-help",
|
|
2796
|
+
className: "ds-u-padding-x--3",
|
|
2797
|
+
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."
|
|
2798
|
+
}),
|
|
2799
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
|
|
2800
|
+
checked: cardHiddenColumns === 0,
|
|
2801
|
+
type: "checkbox",
|
|
2802
|
+
onChange: ()=>{
|
|
2803
|
+
setCards(cards.map((c)=>{
|
|
2804
|
+
return {
|
|
2805
|
+
...c,
|
|
2806
|
+
visible: cardHiddenColumns !== 0
|
|
2807
|
+
};
|
|
2808
|
+
}));
|
|
2809
|
+
},
|
|
2810
|
+
className: "ds-u-padding-x--3",
|
|
2811
|
+
name: "",
|
|
2812
|
+
value: "",
|
|
2813
|
+
label: "Select all",
|
|
2814
|
+
hint: cardHiddenColumns && cardHiddenColumns + " columns hidden"
|
|
2815
|
+
}),
|
|
2816
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
2817
|
+
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",
|
|
2818
|
+
children: [
|
|
2819
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2820
|
+
children: "Display column"
|
|
2821
|
+
}),
|
|
2822
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
2823
|
+
children: "Reorder"
|
|
2824
|
+
})
|
|
2825
|
+
]
|
|
2826
|
+
}),
|
|
2827
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$DndContext), {
|
|
2828
|
+
collisionDetection: (0, $hgUW1$closestCenter),
|
|
2829
|
+
modifiers: [
|
|
2830
|
+
(0, $hgUW1$restrictToVerticalAxis)
|
|
2831
|
+
],
|
|
2832
|
+
sensors: sensors,
|
|
2833
|
+
onDragEnd: handleDragEnd,
|
|
2834
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$SortableContext), {
|
|
2835
|
+
items: cardOrder,
|
|
2836
|
+
strategy: (0, $hgUW1$verticalListSortingStrategy),
|
|
2837
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
|
|
2838
|
+
className: "dkan-manage-columns-list",
|
|
2839
|
+
children: cards.map((card)=>{
|
|
2840
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5fe94aeb50e0798b$export$2e2bcd8739ae039), {
|
|
2841
|
+
id: card.id,
|
|
2842
|
+
visible: card.visible,
|
|
2843
|
+
updateVisibility: updateVisibility
|
|
2844
|
+
}, card.id);
|
|
2845
|
+
})
|
|
2846
|
+
})
|
|
2847
|
+
})
|
|
2848
|
+
})
|
|
2849
|
+
]
|
|
2850
|
+
})
|
|
2851
|
+
})
|
|
2852
|
+
]
|
|
2853
|
+
});
|
|
2854
|
+
};
|
|
2855
|
+
var $5d9e2ce238d53d29$export$2e2bcd8739ae039 = $5d9e2ce238d53d29$var$ManageColumns;
|
|
2856
|
+
|
|
2857
|
+
|
|
2858
|
+
|
|
2859
|
+
|
|
2860
|
+
|
|
2861
|
+
|
|
2862
|
+
|
|
2894
2863
|
|
|
2895
2864
|
|
|
2896
2865
|
|
|
@@ -3033,432 +3002,443 @@ var $23763e27eda0e8d7$export$2e2bcd8739ae039 = $23763e27eda0e8d7$var$FixedSizeTH
|
|
|
3033
3002
|
|
|
3034
3003
|
|
|
3035
3004
|
|
|
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
3005
|
|
|
3101
3006
|
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
const
|
|
3111
|
-
|
|
3112
|
-
|
|
3007
|
+
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 })=>{
|
|
3008
|
+
const { id: id, resource: resource, datasetTableControls: datasetTableControls, dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
3009
|
+
const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
3010
|
+
const { conditions: conditions } = resource;
|
|
3011
|
+
const data = resource.values;
|
|
3012
|
+
const [sorting, setSorting] = (0, $hgUW1$useState)([]);
|
|
3013
|
+
const dataTableWrapperElement = (0, $hgUW1$useRef)(null);
|
|
3014
|
+
const columnHelper = (0, $hgUW1$createColumnHelper)();
|
|
3015
|
+
const table_columns = columns.map((col)=>{
|
|
3016
|
+
if (col.cell) return columnHelper.accessor(col.accessor, {
|
|
3017
|
+
header: col.header,
|
|
3018
|
+
cell: col.cell
|
|
3019
|
+
});
|
|
3020
|
+
return columnHelper.accessor(col.accessor, {
|
|
3021
|
+
header: col.header
|
|
3022
|
+
});
|
|
3113
3023
|
});
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3024
|
+
const [highlightRow, setHighlightRow] = (0, $hgUW1$useState)(null);
|
|
3025
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3026
|
+
if (columnOrder && !columnOrder.length) setColumnOrder(table_columns.map((c)=>c.accessorKey));
|
|
3027
|
+
}, [
|
|
3028
|
+
columnOrder
|
|
3029
|
+
]);
|
|
3030
|
+
const sortElement = (isSorted, onClickFn)=>{
|
|
3031
|
+
if (isSorted === 'asc') return 'dc-c-sort--asc';
|
|
3032
|
+
if (isSorted === 'desc') return 'dc-c-sort--desc';
|
|
3033
|
+
return 'dc-c-sort--default';
|
|
3122
3034
|
};
|
|
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);
|
|
3035
|
+
const filters = [];
|
|
3036
|
+
const table = (0, $hgUW1$useReactTable)({
|
|
3037
|
+
data: data,
|
|
3038
|
+
columns: table_columns,
|
|
3039
|
+
manualSorting: true,
|
|
3040
|
+
state: {
|
|
3041
|
+
columnOrder: columnOrder,
|
|
3042
|
+
columnVisibility: columnVisibility,
|
|
3043
|
+
sorting: sorting
|
|
3139
3044
|
},
|
|
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
|
-
]
|
|
3045
|
+
columnResizeMode: 'onChange',
|
|
3046
|
+
onSortingChange: setSorting,
|
|
3047
|
+
onColumnOrderChange: setColumnOrder,
|
|
3048
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
3049
|
+
getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
|
|
3050
|
+
getSortedRowModel: (0, $hgUW1$getSortedRowModel)(),
|
|
3051
|
+
debugTable: false
|
|
3161
3052
|
});
|
|
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
3053
|
(0, $hgUW1$useEffect)(()=>{
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
return {
|
|
3237
|
-
id: column.id,
|
|
3238
|
-
visible: column.getIsVisible()
|
|
3239
|
-
};
|
|
3240
|
-
}));
|
|
3054
|
+
const normalizedSort = sortTransform ? sortTransform(sorting) : filters;
|
|
3055
|
+
resource.setSort(normalizedSort);
|
|
3241
3056
|
}, [
|
|
3242
|
-
|
|
3057
|
+
sorting
|
|
3243
3058
|
]);
|
|
3244
|
-
|
|
3059
|
+
const defaultColumnOrder = (0, $hgUW1$useMemo)(()=>table_columns.map((column)=>column.accessorKey), []);
|
|
3060
|
+
const tableWrapperWidth = ()=>{
|
|
3061
|
+
if (dataTableWrapperElement.current) return dataTableWrapperElement.current.offsetWidth;
|
|
3062
|
+
return 'auto';
|
|
3063
|
+
};
|
|
3245
3064
|
(0, $hgUW1$useEffect)(()=>{
|
|
3246
|
-
|
|
3247
|
-
...card,
|
|
3248
|
-
visible: columnVisibility[card.id] !== false
|
|
3249
|
-
})));
|
|
3065
|
+
setHighlightRow(null);
|
|
3250
3066
|
}, [
|
|
3251
|
-
|
|
3067
|
+
data
|
|
3252
3068
|
]);
|
|
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",
|
|
3069
|
+
return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
3290
3070
|
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
|
-
},
|
|
3071
|
+
showDataTableToolbar && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
3297
3072
|
children: [
|
|
3298
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("
|
|
3299
|
-
className: "
|
|
3073
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3074
|
+
className: "ds-u-margin-bottom--3",
|
|
3075
|
+
children: showDownloadFullDataButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3076
|
+
className: "ds-c-button ds-c-button--solid ds-l-col--12 ds-l-md-col--auto",
|
|
3077
|
+
href: unfilteredDownloadURL,
|
|
3078
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3079
|
+
className: "ds-u-font-weight--bold ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
|
|
3080
|
+
children: [
|
|
3081
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3082
|
+
className: "fas fa-file-csv"
|
|
3083
|
+
}),
|
|
3084
|
+
" Download full dataset (CSV)"
|
|
3085
|
+
]
|
|
3086
|
+
})
|
|
3087
|
+
})
|
|
3300
3088
|
}),
|
|
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",
|
|
3089
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $85f8ff1ff89899c7$export$2e2bcd8739ae039), {
|
|
3090
|
+
id: id,
|
|
3091
|
+
columns: table.getAllLeafColumns(),
|
|
3092
|
+
defaultColumnOrder: defaultColumnOrder,
|
|
3093
|
+
isModal: isModal,
|
|
3094
|
+
resource: resource,
|
|
3095
|
+
datasetTableControls: datasetTableControls,
|
|
3096
|
+
columnVisibility: columnVisibility,
|
|
3097
|
+
setColumnVisibility: setColumnVisibility,
|
|
3098
|
+
showTableResults: showTableResults,
|
|
3099
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
3100
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
3101
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
3102
|
+
showFullScreenButton: showFullScreenButton,
|
|
3103
|
+
showInfoShareContainer: showInfoShareContainer
|
|
3104
|
+
}),
|
|
3105
|
+
showInfoShareContainer && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3106
|
+
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
3107
|
children: [
|
|
3327
3108
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3328
|
-
className: "
|
|
3109
|
+
className: "dkan-data-table-info-container ds-u-padding-right--0 ds-u-md-padding-right--4",
|
|
3329
3110
|
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"
|
|
3111
|
+
dataDictionaryBanner && !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3112
|
+
className: "ds-u-margin-bottom--3",
|
|
3113
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
3114
|
+
children: 'Click on the "Data Dictionary" tab above for full column definitions'
|
|
3115
|
+
})
|
|
3355
3116
|
}),
|
|
3356
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
onClick: ()=>{
|
|
3360
|
-
setModalOpen(false);
|
|
3361
|
-
resetCards();
|
|
3362
|
-
(0, $15650910340b2c71$export$73fce4ded5ef1c2)();
|
|
3363
|
-
},
|
|
3364
|
-
children: "Cancel"
|
|
3117
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("p", {
|
|
3118
|
+
className: "ds-u-margin--0",
|
|
3119
|
+
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
3120
|
})
|
|
3366
3121
|
]
|
|
3367
3122
|
}),
|
|
3368
3123
|
/*#__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
|
-
|
|
3124
|
+
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",
|
|
3125
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
3126
|
+
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",
|
|
3127
|
+
activeClassName: "dkan-data-table-share-tooltip-open",
|
|
3128
|
+
dialog: true,
|
|
3129
|
+
offset: [
|
|
3130
|
+
0,
|
|
3131
|
+
5
|
|
3132
|
+
],
|
|
3133
|
+
"aria-haspopup": "dialog",
|
|
3134
|
+
placement: "bottom-start",
|
|
3135
|
+
maxWidth: "320px",
|
|
3136
|
+
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3137
|
+
className: "dc-c-resource-header--buttons ds-u-display--flex ds-u-flex-direction--column ds-l-col--12 ds-u-padding-x--0",
|
|
3138
|
+
children: [
|
|
3139
|
+
showCopyLinkButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
|
|
3140
|
+
children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
|
|
3141
|
+
onOpen: ()=>{
|
|
3142
|
+
navigator.clipboard.writeText(window.location.href);
|
|
3143
|
+
},
|
|
3144
|
+
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",
|
|
3145
|
+
placement: "bottom",
|
|
3146
|
+
dialog: true,
|
|
3147
|
+
ariaLabel: "Copy link to filtered data",
|
|
3148
|
+
title: "Link copied to clipboard",
|
|
3149
|
+
"aria-disabled": !conditions || conditions.length === 0,
|
|
3150
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3151
|
+
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
|
|
3152
|
+
children: [
|
|
3153
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3154
|
+
className: "fas fa-copy"
|
|
3155
|
+
}),
|
|
3156
|
+
" Copy link to filtered data"
|
|
3157
|
+
]
|
|
3158
|
+
})
|
|
3159
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3160
|
+
"aria-disabled": true,
|
|
3161
|
+
"aria-label": "Copy link to filtered data",
|
|
3162
|
+
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",
|
|
3163
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3164
|
+
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
|
|
3165
|
+
children: [
|
|
3166
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3167
|
+
className: "fas fa-copy"
|
|
3168
|
+
}),
|
|
3169
|
+
" Copy link to filtered data"
|
|
3170
|
+
]
|
|
3171
|
+
})
|
|
3172
|
+
})
|
|
3173
|
+
}),
|
|
3174
|
+
(showDownloadFilteredDataButton || showStoredQueryDownloadButton) && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3175
|
+
className: "ds-l-col--12 ds-u-padding-x--0 ds-u-margin-x--0",
|
|
3176
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
|
|
3177
|
+
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",
|
|
3178
|
+
href: conditions && conditions.length ? downloadURL : null,
|
|
3179
|
+
"aria-disabled": !conditions || conditions.length === 0,
|
|
3180
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
|
|
3181
|
+
className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
|
|
3182
|
+
children: [
|
|
3183
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3184
|
+
className: "fas fa-file-csv"
|
|
3185
|
+
}),
|
|
3186
|
+
" ",
|
|
3187
|
+
showDownloadFilteredDataButton ? `Download filtered data (CSV)` : `Download stored query data (CSV)`
|
|
3188
|
+
]
|
|
3189
|
+
})
|
|
3190
|
+
})
|
|
3191
|
+
})
|
|
3192
|
+
]
|
|
3193
|
+
}),
|
|
3194
|
+
children: [
|
|
3195
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3196
|
+
className: "far fa-share-alt"
|
|
3197
|
+
}),
|
|
3198
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
3199
|
+
className: "ds-u-margin-x--05",
|
|
3200
|
+
children: "Share"
|
|
3201
|
+
}),
|
|
3202
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3203
|
+
className: "fa fa-chevron-down"
|
|
3204
|
+
}),
|
|
3205
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("i", {
|
|
3206
|
+
className: "fa fa-chevron-up"
|
|
3207
|
+
})
|
|
3208
|
+
]
|
|
3385
3209
|
})
|
|
3386
3210
|
})
|
|
3387
3211
|
]
|
|
3388
|
-
})
|
|
3212
|
+
})
|
|
3213
|
+
]
|
|
3214
|
+
}),
|
|
3215
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
3216
|
+
className: `dc-c-datatable-wrapper ds-u-border-x--1 ds-u-border-bottom--1${showInfoShareContainer ? '' : ' ds-u-margin-top--3'}`,
|
|
3217
|
+
tabIndex: 0,
|
|
3218
|
+
ref: dataTableWrapperElement,
|
|
3219
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("table", {
|
|
3220
|
+
style: {
|
|
3221
|
+
width: canResize ? table.getCenterTotalSize() : "100%",
|
|
3222
|
+
minWidth: tableWrapperWidth()
|
|
3223
|
+
},
|
|
3224
|
+
className: "dc-c-datatable",
|
|
3389
3225
|
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
|
-
]
|
|
3226
|
+
canResize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $96d341d082bffec5$export$2e2bcd8739ae039), {
|
|
3227
|
+
table: table,
|
|
3228
|
+
sortElement: sortElement
|
|
3229
|
+
}) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $23763e27eda0e8d7$export$2e2bcd8739ae039), {
|
|
3230
|
+
table: table,
|
|
3231
|
+
sortElement: sortElement
|
|
3422
3232
|
}),
|
|
3423
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
}
|
|
3233
|
+
loading ? /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {}) : /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {
|
|
3234
|
+
children: table.getRowModel().rows.map((row, index)=>{
|
|
3235
|
+
const even = (index + 1) % 2 === 0;
|
|
3236
|
+
const highlight = highlightRow === row.id;
|
|
3237
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
|
|
3238
|
+
className: `${highlight ? "dc-c-datatable--highlight-row" : even && "dc-c-datatable--even-row"}`,
|
|
3239
|
+
onClick: ()=>setHighlightRow(row.id),
|
|
3240
|
+
children: row.getVisibleCells().map((cell)=>{
|
|
3241
|
+
let classList = "dc-truncate ds-u-padding-x--1";
|
|
3242
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("td", {
|
|
3243
|
+
key: cell.id,
|
|
3244
|
+
style: {
|
|
3245
|
+
maxWidth: cell.column.getSize()
|
|
3246
|
+
},
|
|
3247
|
+
className: `${classList} ${tablePadding}`,
|
|
3248
|
+
title: cell.getValue(),
|
|
3249
|
+
children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
|
|
3250
|
+
});
|
|
3441
3251
|
})
|
|
3442
|
-
})
|
|
3252
|
+
}, row.id);
|
|
3443
3253
|
})
|
|
3444
3254
|
})
|
|
3445
3255
|
]
|
|
3446
3256
|
})
|
|
3257
|
+
}),
|
|
3258
|
+
loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
|
|
3259
|
+
"aria-valuetext": "Dataset loading",
|
|
3260
|
+
role: "status",
|
|
3261
|
+
className: "ds-u-margin--3"
|
|
3262
|
+
}),
|
|
3263
|
+
!loading && table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
|
|
3264
|
+
variation: "warn",
|
|
3265
|
+
children: "No results found for the current filters"
|
|
3447
3266
|
})
|
|
3448
3267
|
]
|
|
3449
3268
|
});
|
|
3450
3269
|
};
|
|
3451
|
-
var $
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3270
|
+
var $d98f94c79ddf4e0e$export$2e2bcd8739ae039 = $d98f94c79ddf4e0e$var$DataTable;
|
|
3458
3271
|
|
|
3459
3272
|
|
|
3273
|
+
function $aa4450dcbeef3ac0$export$385a5aba38cc3325(sortArray) {
|
|
3274
|
+
let newQuery = [];
|
|
3275
|
+
sortArray.forEach((s)=>{
|
|
3276
|
+
return newQuery.push({
|
|
3277
|
+
property: s.id,
|
|
3278
|
+
order: s.desc ? 'desc' : 'asc'
|
|
3279
|
+
});
|
|
3280
|
+
});
|
|
3281
|
+
return newQuery;
|
|
3282
|
+
}
|
|
3460
3283
|
|
|
3461
3284
|
|
|
3285
|
+
// Example custom column headers, where only effective date has an ! at the end
|
|
3286
|
+
// [
|
|
3287
|
+
// {schema: 'date', cell: ({ value }) => localeDate(value),},
|
|
3288
|
+
// {accessor: 'effective_date',cell: ({ value }) => localeDate(value) + '!',},
|
|
3289
|
+
// ]
|
|
3290
|
+
function $7264a673914aa746$export$8049e8f40a9bdfb8(customHeaders, columns, schema) {
|
|
3291
|
+
return columns.map((column)=>{
|
|
3292
|
+
const customAccessorIndex = customHeaders.findIndex((header)=>header.accessor === column);
|
|
3293
|
+
const customSchemaIndex = customHeaders.findIndex((header)=>header.schema === schema.fields[column].mysql_type);
|
|
3294
|
+
let newColumn = {};
|
|
3295
|
+
// If specific accessor is passed, this will override a general mysql_type Cell rewrite.
|
|
3296
|
+
if (customAccessorIndex > -1) {
|
|
3297
|
+
newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
|
|
3298
|
+
newColumn.accessor = column;
|
|
3299
|
+
newColumn.cell = customHeaders[customAccessorIndex].cell;
|
|
3300
|
+
} else {
|
|
3301
|
+
newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
|
|
3302
|
+
newColumn.accessor = column;
|
|
3303
|
+
if (customSchemaIndex > -1) newColumn.cell = customHeaders[customSchemaIndex].cell;
|
|
3304
|
+
}
|
|
3305
|
+
return newColumn;
|
|
3306
|
+
});
|
|
3307
|
+
}
|
|
3308
|
+
function $7264a673914aa746$export$e284ae5d89467c8f(date) {
|
|
3309
|
+
if (!date) return date;
|
|
3310
|
+
date = new Date(date);
|
|
3311
|
+
date = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
3312
|
+
return date;
|
|
3313
|
+
}
|
|
3314
|
+
function $7264a673914aa746$export$6b5e57d20078142b(value, operator) {
|
|
3315
|
+
let newValue = value;
|
|
3316
|
+
if (Array.isArray(newValue)) newValue = newValue.join(',');
|
|
3317
|
+
// return newValue.replace(/(^\%+|\%+$)/gm, '');
|
|
3318
|
+
return newValue;
|
|
3319
|
+
}
|
|
3320
|
+
const $7264a673914aa746$export$5f89a5ae87bc48e1 = [
|
|
3321
|
+
{
|
|
3322
|
+
label: 'Is',
|
|
3323
|
+
value: '='
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
label: 'Starts With',
|
|
3327
|
+
value: 'starts with'
|
|
3328
|
+
},
|
|
3329
|
+
{
|
|
3330
|
+
label: 'Contains',
|
|
3331
|
+
value: 'contains'
|
|
3332
|
+
},
|
|
3333
|
+
{
|
|
3334
|
+
label: 'Is Not',
|
|
3335
|
+
value: '<>'
|
|
3336
|
+
},
|
|
3337
|
+
{
|
|
3338
|
+
label: 'Or',
|
|
3339
|
+
value: 'in'
|
|
3340
|
+
},
|
|
3341
|
+
{
|
|
3342
|
+
label: 'Is',
|
|
3343
|
+
value: '='
|
|
3344
|
+
},
|
|
3345
|
+
{
|
|
3346
|
+
label: 'Is Not',
|
|
3347
|
+
value: '<>'
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
label: 'Greater Than',
|
|
3351
|
+
value: '>'
|
|
3352
|
+
},
|
|
3353
|
+
{
|
|
3354
|
+
label: 'Less Than',
|
|
3355
|
+
value: '<'
|
|
3356
|
+
},
|
|
3357
|
+
{
|
|
3358
|
+
label: 'Is Empty',
|
|
3359
|
+
value: 'is_empty'
|
|
3360
|
+
},
|
|
3361
|
+
{
|
|
3362
|
+
label: 'Not Empty',
|
|
3363
|
+
value: 'not_empty'
|
|
3364
|
+
}
|
|
3365
|
+
];
|
|
3366
|
+
function $7264a673914aa746$export$d243819c3ad678fb(operatorValue) {
|
|
3367
|
+
const operator = $7264a673914aa746$export$5f89a5ae87bc48e1.find((op)=>op.value === operatorValue);
|
|
3368
|
+
return operator ? operator.label : operatorValue; // Return original value if not found
|
|
3369
|
+
}
|
|
3370
|
+
function $7264a673914aa746$export$2b9377795161999(type, enableEmptyFilters = false) {
|
|
3371
|
+
const emptyOptions = enableEmptyFilters ? [
|
|
3372
|
+
{
|
|
3373
|
+
label: 'Is Empty',
|
|
3374
|
+
value: 'is_empty'
|
|
3375
|
+
},
|
|
3376
|
+
{
|
|
3377
|
+
label: 'Not Empty',
|
|
3378
|
+
value: 'not_empty'
|
|
3379
|
+
}
|
|
3380
|
+
] : [];
|
|
3381
|
+
switch(type){
|
|
3382
|
+
case 'text':
|
|
3383
|
+
case 'string':
|
|
3384
|
+
return [
|
|
3385
|
+
{
|
|
3386
|
+
label: 'Is',
|
|
3387
|
+
value: '='
|
|
3388
|
+
},
|
|
3389
|
+
{
|
|
3390
|
+
label: 'Starts With',
|
|
3391
|
+
value: 'starts with'
|
|
3392
|
+
},
|
|
3393
|
+
{
|
|
3394
|
+
label: 'Contains',
|
|
3395
|
+
value: 'contains'
|
|
3396
|
+
},
|
|
3397
|
+
{
|
|
3398
|
+
label: 'Is Not',
|
|
3399
|
+
value: '<>'
|
|
3400
|
+
},
|
|
3401
|
+
{
|
|
3402
|
+
label: 'Or',
|
|
3403
|
+
value: 'in'
|
|
3404
|
+
},
|
|
3405
|
+
...emptyOptions
|
|
3406
|
+
];
|
|
3407
|
+
case 'date':
|
|
3408
|
+
return [
|
|
3409
|
+
{
|
|
3410
|
+
label: 'Is',
|
|
3411
|
+
value: '='
|
|
3412
|
+
},
|
|
3413
|
+
{
|
|
3414
|
+
label: 'Is Not',
|
|
3415
|
+
value: '<>'
|
|
3416
|
+
},
|
|
3417
|
+
{
|
|
3418
|
+
label: 'Greater Than',
|
|
3419
|
+
value: '>'
|
|
3420
|
+
},
|
|
3421
|
+
{
|
|
3422
|
+
label: 'Less Than',
|
|
3423
|
+
value: '<'
|
|
3424
|
+
},
|
|
3425
|
+
...emptyOptions
|
|
3426
|
+
];
|
|
3427
|
+
default:
|
|
3428
|
+
// These 2 should be safe for all data types
|
|
3429
|
+
return [
|
|
3430
|
+
{
|
|
3431
|
+
label: 'Is',
|
|
3432
|
+
value: '='
|
|
3433
|
+
},
|
|
3434
|
+
{
|
|
3435
|
+
label: 'Is Not',
|
|
3436
|
+
value: '<>'
|
|
3437
|
+
},
|
|
3438
|
+
...emptyOptions
|
|
3439
|
+
];
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3462
3442
|
|
|
3463
3443
|
|
|
3464
3444
|
|
|
@@ -3470,12 +3450,13 @@ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
|
|
|
3470
3450
|
accessor: column
|
|
3471
3451
|
}));
|
|
3472
3452
|
}
|
|
3473
|
-
const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopyLinkButton: showCopyLinkButton = true, showDataTableToolbar: showDataTableToolbar = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
|
|
3453
|
+
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
3454
|
const { id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
3475
3455
|
const { page: page, setPage: setPage, tableDensity: tableDensity } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
3476
3456
|
const defaultPageSize = 10;
|
|
3477
|
-
const
|
|
3478
|
-
const
|
|
3457
|
+
const schema = resource?.schema?.[distribution?.identifier] ?? resource?.schema?.[id];
|
|
3458
|
+
const isFullColumnDef = Array.isArray(customColumns) && customColumns.some((column)=>column && 'header' in column);
|
|
3459
|
+
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
3460
|
const { limit: limit, setOffset: setOffset } = resource;
|
|
3480
3461
|
const pageSize = limit ? limit : defaultPageSize;
|
|
3481
3462
|
const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
|
|
@@ -3501,7 +3482,13 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopy
|
|
|
3501
3482
|
showDataTableToolbar: showDataTableToolbar,
|
|
3502
3483
|
showDownloadFilteredDataButton: showDownloadFilteredDataButton,
|
|
3503
3484
|
showDownloadFullDataButton: showDownloadFullDataButton,
|
|
3504
|
-
showStoredQueryDownloadButton: showStoredQueryDownloadButton
|
|
3485
|
+
showStoredQueryDownloadButton: showStoredQueryDownloadButton,
|
|
3486
|
+
showTableResults: showTableResults,
|
|
3487
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
3488
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
3489
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
3490
|
+
showFullScreenButton: showFullScreenButton,
|
|
3491
|
+
showInfoShareContainer: showInfoShareContainer
|
|
3505
3492
|
})
|
|
3506
3493
|
}),
|
|
3507
3494
|
!resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
@@ -3537,7 +3524,7 @@ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, showCopy
|
|
|
3537
3524
|
var $a35cf16d1488f54e$export$2e2bcd8739ae039 = $a35cf16d1488f54e$var$DatasetTable;
|
|
3538
3525
|
|
|
3539
3526
|
|
|
3540
|
-
const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal })=>{
|
|
3527
|
+
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
3528
|
const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(isModal);
|
|
3542
3529
|
if (isModal) return null;
|
|
3543
3530
|
return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
@@ -3569,7 +3556,13 @@ const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal })=>{
|
|
|
3569
3556
|
ariaCloseLabel: "Close dialog",
|
|
3570
3557
|
className: "dkan-full-screen-dataset-dialog",
|
|
3571
3558
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
|
|
3572
|
-
isModal: true
|
|
3559
|
+
isModal: true,
|
|
3560
|
+
showTableResults: showTableResults,
|
|
3561
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
3562
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
3563
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
3564
|
+
showFullScreenButton: showFullScreenButton,
|
|
3565
|
+
showInfoShareContainer: showInfoShareContainer
|
|
3573
3566
|
})
|
|
3574
3567
|
})
|
|
3575
3568
|
})
|
|
@@ -4084,6 +4077,10 @@ const $dae856e97a09bcd6$var$DisplaySettings = ()=>{
|
|
|
4084
4077
|
placement: "bottom-start",
|
|
4085
4078
|
maxWidth: "350px",
|
|
4086
4079
|
"aria-haspopup": "dialog",
|
|
4080
|
+
// @ts-ignore
|
|
4081
|
+
// 'strategy' is not a valid prop for Tooltip but it does get passed on to Popper.js which tells
|
|
4082
|
+
// it to position the tooltip relative to the viewport instead of the dialog’s containing block
|
|
4083
|
+
strategy: "fixed",
|
|
4087
4084
|
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4088
4085
|
className: "ds-u-display--flex ds-u-flex-direction--column",
|
|
4089
4086
|
children: [
|
|
@@ -4232,8 +4229,8 @@ const $85f8ff1ff89899c7$var$updateBrowserURL = (newConditions)=>{
|
|
|
4232
4229
|
});
|
|
4233
4230
|
window.history.pushState({}, '', `${url.origin}${url.pathname}${urlString}`);
|
|
4234
4231
|
};
|
|
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;
|
|
4232
|
+
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 })=>{
|
|
4233
|
+
const { limit: limit, offset: offset, count: count, conditions: conditions = [], setConditions: setConditions } = resource;
|
|
4237
4234
|
const intCount = count ? count : 0;
|
|
4238
4235
|
const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
|
|
4239
4236
|
const resetColumnVisibility = ()=>{
|
|
@@ -4265,9 +4262,9 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
4265
4262
|
role: "region",
|
|
4266
4263
|
"aria-label": "toolbar",
|
|
4267
4264
|
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4268
|
-
className:
|
|
4265
|
+
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
4266
|
children: [
|
|
4270
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4267
|
+
showTableResults && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4271
4268
|
className: "ds-u-padding-x--2",
|
|
4272
4269
|
children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
4273
4270
|
totalRows: intCount,
|
|
@@ -4279,22 +4276,28 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
4279
4276
|
datasetTableControls && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4280
4277
|
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
4278
|
children: [
|
|
4282
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $6f4318b1e14124e5$export$2e2bcd8739ae039), {}),
|
|
4283
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
|
|
4279
|
+
showFilterDatasetButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6f4318b1e14124e5$export$2e2bcd8739ae039), {}),
|
|
4280
|
+
showManageColumnsButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
|
|
4284
4281
|
id: id,
|
|
4285
4282
|
columns: columns,
|
|
4286
4283
|
defaultColumnOrder: defaultColumnOrder
|
|
4287
4284
|
}),
|
|
4288
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $dae856e97a09bcd6$export$2e2bcd8739ae039), {}),
|
|
4289
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
|
|
4290
|
-
isModal: isModal
|
|
4285
|
+
showDisplaySettingsButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $dae856e97a09bcd6$export$2e2bcd8739ae039), {}),
|
|
4286
|
+
showFullScreenButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
|
|
4287
|
+
isModal: isModal,
|
|
4288
|
+
showTableResults: showTableResults,
|
|
4289
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
4290
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
4291
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
4292
|
+
showFullScreenButton: showFullScreenButton,
|
|
4293
|
+
showInfoShareContainer: showInfoShareContainer
|
|
4291
4294
|
})
|
|
4292
4295
|
]
|
|
4293
4296
|
})
|
|
4294
4297
|
]
|
|
4295
4298
|
})
|
|
4296
4299
|
}),
|
|
4297
|
-
Array.isArray(conditions) && (conditions.length > 0 || hiddenColumns > 0) && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4300
|
+
(showFilterDatasetButton || showManageColumnsButton) && Array.isArray(conditions) && (conditions.length > 0 || hiddenColumns > 0) && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4298
4301
|
className: "ds-u-fill--white ds-u-padding-x--0 ds-u-md-padding-x--2 ds-u-padding-top--2",
|
|
4299
4302
|
children: [
|
|
4300
4303
|
/*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
|
|
@@ -4345,264 +4348,292 @@ const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, co
|
|
|
4345
4348
|
var $85f8ff1ff89899c7$export$2e2bcd8739ae039 = $85f8ff1ff89899c7$var$DataTableToolbar;
|
|
4346
4349
|
|
|
4347
4350
|
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4351
|
+
|
|
4352
|
+
|
|
4353
|
+
|
|
4354
|
+
|
|
4355
|
+
|
|
4356
|
+
|
|
4357
|
+
|
|
4358
|
+
|
|
4359
|
+
const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
|
|
4360
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4361
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
|
|
4362
|
+
url: endpoint,
|
|
4363
|
+
plugins: [
|
|
4364
|
+
(0, $hgUW1$SpanOpenAPIVersion),
|
|
4365
|
+
(0, $hgUW1$SpanVersionStamp)
|
|
4366
|
+
]
|
|
4367
|
+
})
|
|
4364
4368
|
});
|
|
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
|
-
|
|
4369
|
+
};
|
|
4370
|
+
var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
|
|
4371
|
+
|
|
4372
|
+
|
|
4373
|
+
|
|
4374
|
+
|
|
4375
|
+
|
|
4376
|
+
|
|
4377
|
+
|
|
4378
|
+
|
|
4379
|
+
|
|
4380
|
+
|
|
4381
|
+
|
|
4382
|
+
const $1e012d1e3b534af0$var$DataTableDensity = ({ setTablePadding: setTablePadding, tablePadding: tablePadding })=>{
|
|
4383
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4384
|
+
className: "ds-u-display--flex",
|
|
4385
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
4386
|
+
options: [
|
|
4387
|
+
{
|
|
4388
|
+
label: 'Tight',
|
|
4389
|
+
value: 'ds-u-padding-y--0'
|
|
4390
|
+
},
|
|
4391
|
+
{
|
|
4392
|
+
label: 'Normal',
|
|
4393
|
+
value: 'ds-u-padding-y--1'
|
|
4394
|
+
},
|
|
4395
|
+
{
|
|
4396
|
+
label: 'Expanded',
|
|
4397
|
+
value: 'ds-u-padding-y--2'
|
|
4398
|
+
}
|
|
4399
|
+
],
|
|
4400
|
+
label: "Display density:",
|
|
4401
|
+
labelClassName: "ds-u-margin-top--0",
|
|
4402
|
+
name: "datatable_display_density",
|
|
4403
|
+
onChange: (e)=>setTablePadding(e.target.value),
|
|
4404
|
+
defaultValue: tablePadding
|
|
4405
|
+
})
|
|
4393
4406
|
});
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4407
|
+
};
|
|
4408
|
+
$1e012d1e3b534af0$var$DataTableDensity.propTypes = {
|
|
4409
|
+
setTablePadding: (0, $hgUW1$proptypes).func.isRequired
|
|
4410
|
+
};
|
|
4411
|
+
var $1e012d1e3b534af0$export$2e2bcd8739ae039 = $1e012d1e3b534af0$var$DataTableDensity;
|
|
4412
|
+
|
|
4413
|
+
|
|
4414
|
+
|
|
4415
|
+
|
|
4416
|
+
|
|
4417
|
+
|
|
4418
|
+
const $7848c69a021266f7$var$DataTableRowChanger = ({ limit: limit, rowOptions: rowOptions = [
|
|
4419
|
+
10,
|
|
4420
|
+
25,
|
|
4421
|
+
50,
|
|
4422
|
+
100
|
|
4423
|
+
], setLimit: setLimit })=>{
|
|
4424
|
+
const rowOptionsFormatted = rowOptions.map((row)=>({
|
|
4425
|
+
label: row.toString(),
|
|
4426
|
+
value: row.toString()
|
|
4427
|
+
}));
|
|
4428
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4429
|
+
className: "ds-u-display--flex",
|
|
4430
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
|
|
4431
|
+
options: rowOptionsFormatted,
|
|
4432
|
+
label: "Rows per page:",
|
|
4433
|
+
labelClassName: "ds-u-margin-top--0",
|
|
4434
|
+
name: "datatable_rows_per_page",
|
|
4435
|
+
onChange: (e)=>setLimit(e.target.value),
|
|
4436
|
+
defaultValue: limit.toString()
|
|
4437
|
+
})
|
|
4438
|
+
});
|
|
4439
|
+
};
|
|
4440
|
+
$7848c69a021266f7$var$DataTableRowChanger.propTypes = {
|
|
4441
|
+
rowOptions: (0, $hgUW1$proptypes).arrayOf((0, $hgUW1$proptypes).number),
|
|
4442
|
+
setLimit: (0, $hgUW1$proptypes).func.isRequired,
|
|
4443
|
+
limit: (0, $hgUW1$proptypes).number
|
|
4444
|
+
};
|
|
4445
|
+
var $7848c69a021266f7$export$2e2bcd8739ae039 = $7848c69a021266f7$var$DataTableRowChanger;
|
|
4446
|
+
|
|
4447
|
+
|
|
4448
|
+
|
|
4449
|
+
|
|
4450
|
+
const $e973bc477cdc2dc7$var$DownloadIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
4451
|
+
width: "15px",
|
|
4452
|
+
height: "15px",
|
|
4453
|
+
viewBox: "0 0 384 512",
|
|
4454
|
+
version: "1.1",
|
|
4455
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4456
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4411
4457
|
children: [
|
|
4412
|
-
|
|
4458
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
4459
|
+
children: "Download Icon"
|
|
4460
|
+
}),
|
|
4461
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
4462
|
+
stroke: "none",
|
|
4463
|
+
strokeWidth: "1",
|
|
4464
|
+
fill: "none",
|
|
4465
|
+
fillRule: "evenodd",
|
|
4466
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
4467
|
+
fill: "#112E51",
|
|
4468
|
+
fillRule: "nonzero",
|
|
4469
|
+
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"
|
|
4470
|
+
})
|
|
4471
|
+
})
|
|
4472
|
+
]
|
|
4473
|
+
});
|
|
4474
|
+
var $e973bc477cdc2dc7$export$2e2bcd8739ae039 = $e973bc477cdc2dc7$var$DownloadIcon;
|
|
4475
|
+
|
|
4476
|
+
|
|
4477
|
+
|
|
4478
|
+
|
|
4479
|
+
const $7ec5423a30aa3f61$var$CopyIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
4480
|
+
width: "15px",
|
|
4481
|
+
height: "15px",
|
|
4482
|
+
viewBox: "0 0 512 512",
|
|
4483
|
+
version: "1.1",
|
|
4484
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4485
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4486
|
+
children: [
|
|
4487
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
4488
|
+
children: "Copy Icon"
|
|
4489
|
+
}),
|
|
4490
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
4491
|
+
stroke: "none",
|
|
4492
|
+
strokeWidth: "1",
|
|
4493
|
+
fill: "none",
|
|
4494
|
+
fillRule: "evenodd",
|
|
4495
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
4496
|
+
fill: "#112E51",
|
|
4497
|
+
fillRule: "nonzero",
|
|
4498
|
+
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"
|
|
4499
|
+
})
|
|
4500
|
+
})
|
|
4501
|
+
]
|
|
4502
|
+
});
|
|
4503
|
+
var $7ec5423a30aa3f61$export$2e2bcd8739ae039 = $7ec5423a30aa3f61$var$CopyIcon;
|
|
4504
|
+
|
|
4505
|
+
|
|
4506
|
+
|
|
4507
|
+
|
|
4508
|
+
const $ec9e1550b0b034d0$var$SettingsIcon = ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("svg", {
|
|
4509
|
+
width: "15px",
|
|
4510
|
+
height: "15px",
|
|
4511
|
+
// viewBox="0 0 15 15"
|
|
4512
|
+
viewBox: "0 0 512 512",
|
|
4513
|
+
version: "1.1",
|
|
4514
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4515
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4516
|
+
children: [
|
|
4517
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("title", {
|
|
4518
|
+
children: "Settings Icon"
|
|
4519
|
+
}),
|
|
4520
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)("g", {
|
|
4521
|
+
stroke: "none",
|
|
4522
|
+
strokeWidth: "1",
|
|
4523
|
+
fill: "none",
|
|
4524
|
+
fillRule: "evenodd",
|
|
4525
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
|
|
4526
|
+
fill: "#112E51",
|
|
4527
|
+
fillRule: "nonzero",
|
|
4528
|
+
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"
|
|
4529
|
+
})
|
|
4530
|
+
})
|
|
4531
|
+
]
|
|
4532
|
+
});
|
|
4533
|
+
var $ec9e1550b0b034d0$export$2e2bcd8739ae039 = $ec9e1550b0b034d0$var$SettingsIcon;
|
|
4534
|
+
|
|
4535
|
+
|
|
4536
|
+
|
|
4537
|
+
const $af099c546cb226c7$var$ResourceHeader = ({ setTablePadding: setTablePadding, includeDensity: includeDensity, includeDownload: includeDownload, resource: resource, tablePadding: tablePadding, downloadUrl: downloadUrl })=>{
|
|
4538
|
+
const md = (0, $hgUW1$useMediaQuery)({
|
|
4539
|
+
minWidth: 0,
|
|
4540
|
+
maxWidth: 768
|
|
4541
|
+
});
|
|
4542
|
+
const { limit: limit, offset: offset, count: count, setLimit: setLimit, setOffset: setOffset } = resource;
|
|
4543
|
+
const intCount = count ? parseInt(count) : 0;
|
|
4544
|
+
return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4545
|
+
className: "dc-c-resource-header",
|
|
4546
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4547
|
+
className: "ds-l-row ds-u-align-items--center",
|
|
4548
|
+
children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4549
|
+
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
4550
|
children: [
|
|
4414
4551
|
/*#__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
|
-
})
|
|
4552
|
+
className: "ds-u-font-weight--bold",
|
|
4553
|
+
children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
|
|
4554
|
+
totalRows: parseInt(intCount),
|
|
4555
|
+
limit: parseInt(limit),
|
|
4556
|
+
offset: parseInt(offset)
|
|
4428
4557
|
})
|
|
4429
4558
|
}),
|
|
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
4559
|
/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4441
|
-
className: "
|
|
4560
|
+
className: "dc-c-resource-header--buttons",
|
|
4442
4561
|
children: [
|
|
4443
|
-
/*#__PURE__*/ (0, $hgUW1$jsxs)(
|
|
4444
|
-
className: "dkan-data-table-info-container ds-u-padding-right--0 ds-u-md-padding-right--4",
|
|
4562
|
+
includeDownload && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
|
|
4445
4563
|
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",
|
|
4564
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
|
|
4565
|
+
size: "small",
|
|
4566
|
+
className: "ds-u-text-align--left ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1",
|
|
4567
|
+
href: downloadUrl,
|
|
4473
4568
|
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
|
-
})
|
|
4569
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $e973bc477cdc2dc7$export$2e2bcd8739ae039), {}),
|
|
4570
|
+
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4571
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
4572
|
+
children: "Download filtered data (CSV)"
|
|
4526
4573
|
})
|
|
4527
4574
|
]
|
|
4528
4575
|
}),
|
|
4576
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
4577
|
+
onOpen: ()=>{
|
|
4578
|
+
navigator.clipboard.writeText(window.location.href);
|
|
4579
|
+
},
|
|
4580
|
+
className: "ds-c-button ds-c-button--small ds-u-text-align--left ds-u-margin-right--1 display-settings-font",
|
|
4581
|
+
placement: "bottom",
|
|
4582
|
+
dialog: true,
|
|
4583
|
+
ariaLabel: "Copy link to filtered data",
|
|
4584
|
+
title: "Link copied to clipboard",
|
|
4585
|
+
children: [
|
|
4586
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $7ec5423a30aa3f61$export$2e2bcd8739ae039), {}),
|
|
4587
|
+
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4588
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
4589
|
+
children: "Copy link to filtered data"
|
|
4590
|
+
})
|
|
4591
|
+
]
|
|
4592
|
+
})
|
|
4593
|
+
]
|
|
4594
|
+
}),
|
|
4595
|
+
/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
|
|
4596
|
+
className: "ds-c-button ds-c-button--small ds-u-text-align--left display-settings-font",
|
|
4597
|
+
placement: "bottom",
|
|
4598
|
+
dialog: true,
|
|
4599
|
+
ariaLabel: "Display settings",
|
|
4600
|
+
title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
4601
|
+
className: "dc-c-display-settings",
|
|
4529
4602
|
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"
|
|
4603
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $7848c69a021266f7$export$2e2bcd8739ae039), {
|
|
4604
|
+
limit: Number(limit),
|
|
4605
|
+
setLimit: setLimit,
|
|
4606
|
+
setOffset: setOffset
|
|
4539
4607
|
}),
|
|
4540
|
-
/*#__PURE__*/ (0, $hgUW1$jsx)(
|
|
4541
|
-
|
|
4608
|
+
includeDensity && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $1e012d1e3b534af0$export$2e2bcd8739ae039), {
|
|
4609
|
+
setTablePadding: setTablePadding,
|
|
4610
|
+
tablePadding: tablePadding
|
|
4542
4611
|
})
|
|
4543
4612
|
]
|
|
4544
|
-
})
|
|
4613
|
+
}),
|
|
4614
|
+
children: [
|
|
4615
|
+
/*#__PURE__*/ (0, $hgUW1$jsx)((0, $ec9e1550b0b034d0$export$2e2bcd8739ae039), {}),
|
|
4616
|
+
!md && /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
|
|
4617
|
+
className: "ds-u-font-weight--semibold ds-u-margin-left--1",
|
|
4618
|
+
children: "Display settings"
|
|
4619
|
+
})
|
|
4620
|
+
]
|
|
4545
4621
|
})
|
|
4546
4622
|
]
|
|
4547
4623
|
})
|
|
4548
4624
|
]
|
|
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
4625
|
})
|
|
4602
|
-
|
|
4626
|
+
})
|
|
4603
4627
|
});
|
|
4604
4628
|
};
|
|
4605
|
-
var $
|
|
4629
|
+
var $af099c546cb226c7$export$2e2bcd8739ae039 = $af099c546cb226c7$var$ResourceHeader;
|
|
4630
|
+
|
|
4631
|
+
|
|
4632
|
+
|
|
4633
|
+
|
|
4634
|
+
|
|
4635
|
+
|
|
4636
|
+
|
|
4606
4637
|
|
|
4607
4638
|
|
|
4608
4639
|
|
|
@@ -4625,21 +4656,30 @@ function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header, a
|
|
|
4625
4656
|
value: filterValue || ''
|
|
4626
4657
|
});
|
|
4627
4658
|
}
|
|
4628
|
-
const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, canResize: canResize = true })=>{
|
|
4659
|
+
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
4660
|
const { resource: resource, customColumns: customColumns } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
|
|
4661
|
+
const { tableDensity: tableDensity } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
|
|
4630
4662
|
const customColumnHeaders = customColumns ? (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[id]) : null;
|
|
4631
4663
|
const columns = customColumnHeaders ? customColumnHeaders : $626282d9a03c51d5$export$1147582dfae658c6(resource.columns, resource.schema[id]);
|
|
4632
4664
|
if (Object.keys(resource).length && columns.length && resource.schema) return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
|
|
4633
4665
|
id: "resource-preview",
|
|
4634
|
-
className: "ds-u-overflow--auto
|
|
4666
|
+
className: "ds-u-overflow--auto",
|
|
4635
4667
|
children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
|
|
4636
4668
|
canResize: canResize,
|
|
4637
4669
|
columns: customColumns ? customColumns : $626282d9a03c51d5$export$1147582dfae658c6(resource.columns, resource.schema[id]),
|
|
4638
4670
|
sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
|
|
4639
|
-
tablePadding: tablePadding,
|
|
4671
|
+
tablePadding: typeof tablePadding === 'function' ? tablePadding(tableDensity) : tablePadding,
|
|
4640
4672
|
loading: resource.loading,
|
|
4641
4673
|
className: "dc-c-datatable",
|
|
4642
|
-
customColumnFilter: $626282d9a03c51d5$var$DefaultColumnFilter
|
|
4674
|
+
customColumnFilter: $626282d9a03c51d5$var$DefaultColumnFilter,
|
|
4675
|
+
showDataTableToolbar: showDataTableToolbar,
|
|
4676
|
+
showInfoShareContainer: showInfoShareContainer,
|
|
4677
|
+
showTableResults: showTableResults,
|
|
4678
|
+
showFilterDatasetButton: showFilterDatasetButton,
|
|
4679
|
+
showManageColumnsButton: showManageColumnsButton,
|
|
4680
|
+
showDisplaySettingsButton: showDisplaySettingsButton,
|
|
4681
|
+
showFullScreenButton: showFullScreenButton,
|
|
4682
|
+
isModal: false
|
|
4643
4683
|
})
|
|
4644
4684
|
});
|
|
4645
4685
|
else return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {});
|
|
@@ -8287,5 +8327,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
|
|
|
8287
8327
|
|
|
8288
8328
|
|
|
8289
8329
|
|
|
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};
|
|
8330
|
+
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
8331
|
//# sourceMappingURL=main.js.map
|