@civicactions/cmsds-open-data-components 3.10.0-alpha.2 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./main.css";
2
2
  import {jsx as $hgUW1$jsx, jsxs as $hgUW1$jsxs, Fragment as $hgUW1$Fragment} from "react/jsx-runtime";
3
- import {Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, Button as $hgUW1$Button, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Spinner as $hgUW1$Spinner, Alert as $hgUW1$Alert, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Dropdown as $hgUW1$Dropdown, Choice as $hgUW1$Choice, Pagination as $hgUW1$Pagination, Table as $hgUW1$Table, TableHead as $hgUW1$TableHead, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableBody as $hgUW1$TableBody, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
3
+ import {Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, Button as $hgUW1$Button, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Spinner as $hgUW1$Spinner, Alert as $hgUW1$Alert, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Choice as $hgUW1$Choice, Dropdown as $hgUW1$Dropdown, Pagination as $hgUW1$Pagination, Badge as $hgUW1$Badge, Table as $hgUW1$Table, TableHead as $hgUW1$TableHead, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableBody as $hgUW1$TableBody, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel} from "@cmsgov/design-system";
4
4
  import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, useContext as $hgUW1$useContext, useMemo as $hgUW1$useMemo, useCallback as $hgUW1$useCallback} from "react";
5
5
  import {NavLink as $hgUW1$NavLink, Link as $hgUW1$Link, useNavigate as $hgUW1$useNavigate, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams} from "react-router-dom";
6
6
  import $hgUW1$qs from "qs";
@@ -595,6 +595,7 @@ const $fea9297ba4dd394c$var$HeaderSearch = (props)=>{
595
595
  }),
596
596
  modalSearch && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
597
597
  className: "dc-c-search-dialog",
598
+ isOpen: modalSearch,
598
599
  onExit: ()=>setModalSearch(false),
599
600
  heading: `${headingText}`,
600
601
  actions: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
@@ -1306,6 +1307,7 @@ const $b61856b23f5f58a2$var$LargeFileDialog = (props)=>{
1306
1307
  }),
1307
1308
  modalOpen && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
1308
1309
  onExit: ()=>setModalOpen(false),
1310
+ isOpen: modalOpen,
1309
1311
  heading: "Notice: Large File Size",
1310
1312
  actions: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
1311
1313
  children: [
@@ -1731,6 +1733,47 @@ var $52c6454cae137465$export$2e2bcd8739ae039 = $52c6454cae137465$var$DatasetSear
1731
1733
 
1732
1734
 
1733
1735
 
1736
+ const $e011250e8a3bd5e5$var$SearchFacets = (props)=>{
1737
+ const { facets: facets, title: title, onClickFunction: onClickFunction, selectedFacets: selectedFacets = [] } = props;
1738
+ const filteredFacets = facets.filter((f)=>{
1739
+ return Number(f.total) > 0 || selectedFacets.findIndex((i)=>i === f.name) !== -1;
1740
+ });
1741
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
1742
+ className: "dkan-dataset-search--facet-container ds-u-margin-bottom--4",
1743
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
1744
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
1745
+ contentClassName: "ds-u-padding-left--1 ds-u-padding-right--0",
1746
+ heading: title,
1747
+ defaultOpen: true,
1748
+ children: !filteredFacets.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
1749
+ className: "ds-text-heading--md",
1750
+ children: "No matching facets found."
1751
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
1752
+ children: filteredFacets.map((f)=>{
1753
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
1754
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
1755
+ className: "ds-u-margin-y--1",
1756
+ checked: selectedFacets.findIndex((s)=>s === f.name) > -1 ? true : false,
1757
+ name: `facet_theme_${f.name}`,
1758
+ type: "checkbox",
1759
+ label: `${f.name} (${f.total})`,
1760
+ value: f.name,
1761
+ onClick: ()=>onClickFunction(f.type, f.name)
1762
+ })
1763
+ }, f.name);
1764
+ })
1765
+ })
1766
+ })
1767
+ })
1768
+ });
1769
+ };
1770
+ var $e011250e8a3bd5e5$export$2e2bcd8739ae039 = $e011250e8a3bd5e5$var$SearchFacets;
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+
1734
1777
 
1735
1778
 
1736
1779
  const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
@@ -2348,67 +2391,6 @@ var $23763e27eda0e8d7$export$2e2bcd8739ae039 = $23763e27eda0e8d7$var$FixedSizeTH
2348
2391
 
2349
2392
 
2350
2393
 
2351
- const $43a30d745a7bbc86$var$DataTableContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
2352
- id: null
2353
- });
2354
- var $43a30d745a7bbc86$export$2e2bcd8739ae039 = $43a30d745a7bbc86$var$DataTableContext;
2355
-
2356
-
2357
-
2358
-
2359
-
2360
- // Create a defaults object for reusability
2361
- const $ee0d4d4f34048447$var$DataTableActionsContextDefaults = {
2362
- columnOrder: [],
2363
- setColumnOrder: ()=>{},
2364
- columnVisibility: {},
2365
- setColumnVisibility: ()=>{},
2366
- page: 1,
2367
- setPage: ()=>{},
2368
- tableDensity: "normal",
2369
- setTableDensity: ()=>{}
2370
- };
2371
- const $ee0d4d4f34048447$export$f814ea079e65d8fe = /*#__PURE__*/ (0, $hgUW1$createContext)($ee0d4d4f34048447$var$DataTableActionsContextDefaults);
2372
- // Define our reusable provider component
2373
- const $ee0d4d4f34048447$var$DataTableActionsProvider = ({ children: children })=>{
2374
- // Set up all of the state
2375
- const { id: id, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
2376
- // a wrapper component to keep column state synced between full screen and regular modes
2377
- const localStorageData = id ? JSON.parse(localStorage.getItem(id)) : null;
2378
- const [page, setPage] = (0, $hgUW1$useState)(1);
2379
- const [columnOrder, setColumnOrder] = (0, $hgUW1$useState)(()=>{
2380
- if (datasetTableControls && localStorageData) return localStorageData.tableColumnOrder;
2381
- else return [];
2382
- });
2383
- const [columnVisibility, setColumnVisibility] = (0, $hgUW1$useState)(()=>{
2384
- if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
2385
- else return {};
2386
- });
2387
- const [tableDensity, setTableDensity] = (0, $hgUW1$useState)("normal");
2388
- const providerValue = {
2389
- columnOrder: columnOrder,
2390
- setColumnOrder: setColumnOrder,
2391
- columnVisibility: columnVisibility,
2392
- setColumnVisibility: setColumnVisibility,
2393
- page: page,
2394
- setPage: setPage,
2395
- tableDensity: tableDensity,
2396
- setTableDensity: setTableDensity
2397
- };
2398
- return /*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
2399
- value: providerValue,
2400
- children: children
2401
- });
2402
- };
2403
- const $ee0d4d4f34048447$export$67f91330d613e8f4 = ({ children: children, value: value = $ee0d4d4f34048447$var$DataTableActionsContextDefaults })=>/*#__PURE__*/ (0, $hgUW1$jsx)($ee0d4d4f34048447$export$f814ea079e65d8fe.Provider, {
2404
- value: value,
2405
- children: children
2406
- });
2407
- var $ee0d4d4f34048447$export$2e2bcd8739ae039 = $ee0d4d4f34048447$var$DataTableActionsProvider;
2408
-
2409
-
2410
-
2411
-
2412
2394
 
2413
2395
 
2414
2396
 
@@ -2478,6 +2460,10 @@ var $5fe94aeb50e0798b$export$2e2bcd8739ae039 = $5fe94aeb50e0798b$var$Card;
2478
2460
 
2479
2461
 
2480
2462
 
2463
+ const $ebda441784d176a5$var$ManageColumnsContext = /*#__PURE__*/ (0, $hgUW1$createContext)({});
2464
+ var $ebda441784d176a5$export$2e2bcd8739ae039 = $ebda441784d176a5$var$ManageColumnsContext;
2465
+
2466
+
2481
2467
 
2482
2468
  class $5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor extends (0, $hgUW1$KeyboardSensor) {
2483
2469
  // Custom function to exclude checkbox from keyboard dragging
@@ -2515,10 +2501,8 @@ class $5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor extends (0, $hgUW1$Poin
2515
2501
  }
2516
2502
  ];
2517
2503
  }
2518
- const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder })=>{
2519
- const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, setColumnVisibility: setColumnVisibility, columnVisibility: contextColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
2520
- const columnVisibility = contextColumnVisibility || {};
2521
- const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
2504
+ const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, modalOpen: modalOpen, setModalOpen: setModalOpen })=>{
2505
+ const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ebda441784d176a5$export$2e2bcd8739ae039));
2522
2506
  // maintain card state separately from table state - only sync states when the Save button is pressed
2523
2507
  const [cards, setCards] = (0, $hgUW1$useState)(columns.map((c)=>{
2524
2508
  return {
@@ -2575,164 +2559,137 @@ const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, default
2575
2559
  };
2576
2560
  }));
2577
2561
  };
2578
- const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
2579
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2580
- className: "dkan-manage-columns-wrapper",
2581
- children: [
2582
- /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
2583
- "aria-label": "Manage columns - Opens in a dialog",
2584
- 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",
2585
- onClick: ()=>{
2586
- setModalOpen(true);
2587
- },
2562
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2563
+ className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
2564
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
2565
+ heading: "Manage columns",
2566
+ isOpen: modalOpen,
2567
+ onExit: ()=>{
2568
+ setModalOpen(false);
2569
+ resetCards();
2570
+ },
2571
+ className: "dkan-manage-columns-dialog",
2572
+ actions: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2573
+ 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",
2588
2574
  children: [
2589
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2590
- className: "fa fa-columns ds-u-margin-right--1"
2591
- }),
2592
- /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2593
- children: [
2594
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2595
- className: "ds-u-display--none ds-u-lg-display--inline-block",
2596
- children: "Manage Columns"
2597
- }),
2598
- hiddenColumns ? ` (${hiddenColumns})` : ""
2599
- ]
2600
- })
2601
- ]
2602
- }),
2603
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2604
- className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
2605
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
2606
- heading: "Manage columns",
2607
- isOpen: modalOpen,
2608
- onExit: ()=>{
2609
- setModalOpen(false);
2610
- resetCards();
2611
- },
2612
- className: "dkan-manage-columns-dialog",
2613
- actions: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2614
- 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",
2575
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2576
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0",
2615
2577
  children: [
2616
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2617
- className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0",
2618
- children: [
2619
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2620
- variation: "solid",
2621
- className: "ds-l-col--6 ds-l-sm-col--auto",
2622
- onClick: ()=>{
2623
- setModalOpen(false);
2624
- // update table state
2625
- // Visibility
2626
- // This code is building a new columnVisibility state object from the card state and doing a single setState on the table
2627
- // vs doing a setState on every changed column individually
2628
- const newColumnVisibility = Object.fromEntries(cards.map((c)=>Object.values(c)));
2629
- setColumnVisibility(newColumnVisibility);
2630
- // Card order
2631
- const newCardOrder = cards.map((c)=>{
2632
- return c.id;
2633
- });
2634
- setColumnOrder(newCardOrder);
2635
- // save to localStorage
2636
- const localStorageData = {
2637
- tableColumnOrder: newCardOrder,
2638
- tableColumnVisibility: newColumnVisibility
2639
- };
2640
- localStorage.setItem(id, JSON.stringify(localStorageData));
2641
- },
2642
- children: "Save"
2643
- }),
2644
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2645
- variation: "ghost",
2646
- className: "ds-l-col--6 ds-l-sm-col--auto",
2647
- onClick: ()=>{
2648
- setModalOpen(false);
2649
- resetCards();
2650
- },
2651
- children: "Cancel"
2652
- })
2653
- ]
2578
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2579
+ variation: "solid",
2580
+ className: "ds-l-col--6 ds-l-sm-col--auto",
2581
+ onClick: ()=>{
2582
+ setModalOpen(false);
2583
+ // update table state
2584
+ // Visibility
2585
+ // This code is building a new columnVisibility state object from the card state and doing a single setState on the table
2586
+ // vs doing a setState on every changed column individually
2587
+ const newColumnVisibility = Object.fromEntries(cards.map((c)=>Object.values(c)));
2588
+ setColumnVisibility(newColumnVisibility);
2589
+ // Card order
2590
+ const newCardOrder = cards.map((c)=>{
2591
+ return c.id;
2592
+ });
2593
+ setColumnOrder(newCardOrder);
2594
+ // save to localStorage
2595
+ const localStorageData = {
2596
+ tableColumnOrder: newCardOrder,
2597
+ tableColumnVisibility: newColumnVisibility
2598
+ };
2599
+ localStorage.setItem(id, JSON.stringify(localStorageData));
2600
+ },
2601
+ children: "Save"
2654
2602
  }),
2655
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2656
- 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",
2657
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2658
- variation: "ghost",
2659
- className: "ds-l-col--6 ds-l-sm-col--auto",
2660
- onClick: ()=>{
2661
- // reset to default column order and set all cards to visible
2662
- // do not save this to the table state until the "Save" button is clicked
2663
- setCards(defaultColumnOrder.map((column)=>{
2664
- const card = cards.filter((c)=>c.id === column)[0];
2665
- return {
2666
- ...card,
2667
- visible: true
2668
- };
2669
- }));
2670
- },
2671
- children: "Reset Columns"
2672
- })
2603
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2604
+ variation: "ghost",
2605
+ className: "ds-l-col--6 ds-l-sm-col--auto",
2606
+ onClick: ()=>{
2607
+ setModalOpen(false);
2608
+ resetCards();
2609
+ },
2610
+ children: "Cancel"
2673
2611
  })
2674
2612
  ]
2675
2613
  }),
2676
- children: [
2677
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2678
- id: "reorder-help",
2679
- className: "ds-u-padding-x--3",
2680
- 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."
2681
- }),
2682
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
2683
- checked: cardHiddenColumns === 0,
2684
- type: "checkbox",
2685
- onChange: ()=>{
2686
- setCards(cards.map((c)=>{
2614
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2615
+ 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",
2616
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2617
+ variation: "ghost",
2618
+ className: "ds-l-col--6 ds-l-sm-col--auto",
2619
+ onClick: ()=>{
2620
+ // reset to default column order and set all cards to visible
2621
+ // do not save this to the table state until the "Save" button is clicked
2622
+ setCards(defaultColumnOrder.map((column)=>{
2623
+ const card = cards.filter((c)=>c.id === column)[0];
2687
2624
  return {
2688
- ...c,
2689
- visible: cardHiddenColumns !== 0
2625
+ ...card,
2626
+ visible: true
2690
2627
  };
2691
2628
  }));
2692
2629
  },
2693
- className: "ds-u-padding-x--3",
2694
- name: "",
2695
- value: "",
2696
- label: "Select all",
2697
- hint: cardHiddenColumns && cardHiddenColumns + " columns hidden"
2698
- }),
2699
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2700
- 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",
2701
- children: [
2702
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2703
- children: "Display column"
2704
- }),
2705
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2706
- children: "Reorder"
2707
- })
2708
- ]
2630
+ children: "Reset Columns"
2631
+ })
2632
+ })
2633
+ ]
2634
+ }),
2635
+ children: [
2636
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2637
+ id: "reorder-help",
2638
+ className: "ds-u-padding-x--3",
2639
+ 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."
2640
+ }),
2641
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
2642
+ checked: cardHiddenColumns === 0,
2643
+ type: "checkbox",
2644
+ onChange: ()=>{
2645
+ setCards(cards.map((c)=>{
2646
+ return {
2647
+ ...c,
2648
+ visible: cardHiddenColumns !== 0
2649
+ };
2650
+ }));
2651
+ },
2652
+ className: "ds-u-padding-x--3",
2653
+ name: "",
2654
+ value: "",
2655
+ label: "Select all",
2656
+ hint: cardHiddenColumns && cardHiddenColumns + " columns hidden"
2657
+ }),
2658
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2659
+ 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",
2660
+ children: [
2661
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2662
+ children: "Display column"
2709
2663
  }),
2710
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$DndContext), {
2711
- collisionDetection: (0, $hgUW1$closestCenter),
2712
- modifiers: [
2713
- (0, $hgUW1$restrictToVerticalAxis)
2714
- ],
2715
- sensors: sensors,
2716
- onDragEnd: handleDragEnd,
2717
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$SortableContext), {
2718
- items: cardOrder,
2719
- strategy: (0, $hgUW1$verticalListSortingStrategy),
2720
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
2721
- className: "dkan-manage-columns-list",
2722
- children: cards.map((card)=>{
2723
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5fe94aeb50e0798b$export$2e2bcd8739ae039), {
2724
- id: card.id,
2725
- visible: card.visible,
2726
- updateVisibility: updateVisibility
2727
- }, card.id);
2728
- })
2729
- })
2730
- })
2664
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2665
+ children: "Reorder"
2731
2666
  })
2732
2667
  ]
2668
+ }),
2669
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$DndContext), {
2670
+ collisionDetection: (0, $hgUW1$closestCenter),
2671
+ modifiers: [
2672
+ (0, $hgUW1$restrictToVerticalAxis)
2673
+ ],
2674
+ sensors: sensors,
2675
+ onDragEnd: handleDragEnd,
2676
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$SortableContext), {
2677
+ items: cardOrder,
2678
+ strategy: (0, $hgUW1$verticalListSortingStrategy),
2679
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
2680
+ className: "dkan-manage-columns-list",
2681
+ children: cards.map((card)=>{
2682
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5fe94aeb50e0798b$export$2e2bcd8739ae039), {
2683
+ id: card.id,
2684
+ visible: card.visible,
2685
+ updateVisibility: updateVisibility
2686
+ }, card.id);
2687
+ })
2688
+ })
2689
+ })
2733
2690
  })
2734
- })
2735
- ]
2691
+ ]
2692
+ })
2736
2693
  });
2737
2694
  };
2738
2695
  var $5d9e2ce238d53d29$export$2e2bcd8739ae039 = $5d9e2ce238d53d29$var$ManageColumns;
@@ -2751,119 +2708,140 @@ var $5d9e2ce238d53d29$export$2e2bcd8739ae039 = $5d9e2ce238d53d29$var$ManageColum
2751
2708
 
2752
2709
 
2753
2710
 
2754
- function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
2755
- return columns.map((column)=>({
2756
- header: schema && schema.fields[column].description ? schema.fields[column].description : column,
2757
- accessor: column
2758
- }));
2759
- }
2760
- const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, closeFullScreenModal: closeFullScreenModal, showCopyLinkButton: showCopyLinkButton = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
2761
- const { id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
2762
- const { page: page, setPage: setPage, tableDensity: tableDensity } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
2763
- const defaultPageSize = 10;
2764
- const customColumnHeaders = (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution.identifier]);
2765
- const columns = customColumnHeaders ? customColumnHeaders : $a35cf16d1488f54e$export$1147582dfae658c6(resource.columns, resource.schema[id]);
2766
- const { limit: limit, setOffset: setOffset } = resource;
2767
- const pageSize = limit ? limit : defaultPageSize;
2768
- const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
2769
- conditions: resource.conditions
2770
- }, {
2771
- encode: true
2772
- })}&format=csv`;
2773
- if (Object.keys(resource).length && columns.length && resource.schema && Object.keys(distribution).length) return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
2774
- children: [
2775
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2776
- className: isModal ? "dkan-datatable-fullscreen-mode" : "",
2777
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
2778
- canResize: true,
2779
- columns: columns,
2780
- sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
2781
- tablePadding: tableDensity === "normal" ? "ds-u-padding-y--2" : tableDensity === "compact" ? "ds-u-padding-y--1" : "ds-u-padding-y--3",
2782
- loading: resource.loading,
2783
- isModal: isModal,
2784
- closeFullScreenModal: closeFullScreenModal,
2785
- downloadURL: downloadURL,
2786
- unfilteredDownloadURL: distribution.data.downloadURL,
2787
- setPage: setPage,
2788
- showCopyLinkButton: showCopyLinkButton,
2789
- showDownloadFilteredDataButton: showDownloadFilteredDataButton,
2790
- showDownloadFullDataButton: showDownloadFullDataButton,
2791
- showStoredQueryDownloadButton: showStoredQueryDownloadButton
2792
- })
2793
- }),
2794
- !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2795
- className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-u-md-justify-content--between ds-u-margin-top--2 ds-u-align-items--center",
2796
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
2797
- totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
2798
- currentPage: Number(page),
2799
- onPageChange: (evt, page)=>{
2800
- evt.preventDefault();
2801
- setOffset((page - 1) * limit);
2802
- setPage(page);
2803
- },
2804
- renderHref: (p)=>`?page=${p}`,
2805
- className: "ds-l-col--12 ds-u-padding-x--0"
2806
- })
2807
- })
2808
- ]
2809
- });
2810
- else return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
2811
- "aria-valuetext": "Dataset loading",
2812
- role: "status",
2813
- className: "ds-u-margin--3"
2814
- });
2815
- };
2816
- var $a35cf16d1488f54e$export$2e2bcd8739ae039 = $a35cf16d1488f54e$var$DatasetTable;
2817
2711
 
2818
2712
 
2819
- const $16bd41951b91f02d$var$FullScreenDataTable = ({ isModal: isModal, closeFullScreenModal: closeFullScreenModal })=>{
2820
- const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
2821
- if (isModal) return null;
2713
+ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, setPage: setPage, showCopyLinkButton: showCopyLinkButton = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
2714
+ const { limit: limit, offset: offset, count: count, conditions: conditions, setLimit: setLimit, setOffset: setOffset } = resource;
2715
+ const intCount = count ? count : 0;
2716
+ const rowOptions = [
2717
+ 10,
2718
+ 25,
2719
+ 50,
2720
+ 100
2721
+ ];
2822
2722
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2823
- className: "dkan-fullscreen-data-table-wrapper",
2723
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between",
2824
2724
  children: [
2825
- /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
2826
- "aria-label": isModal ? "Close Full Screen dialog" : "Full Screen mode - Opens in a dialog",
2827
- 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",
2828
- onClick: ()=>{
2829
- if (isModal) closeFullScreenModal();
2830
- else setModalOpen(true);
2831
- },
2725
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2726
+ className: "dc-c-resource-header--buttons ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-l-col--12 ds-u-margin-top--2 ds-u-padding-x--0",
2832
2727
  children: [
2833
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2834
- className: `fa ${isModal ? "fa-compress" : "fa-expand"} ds-u-margin-right--1`
2728
+ showCopyLinkButton && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2729
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-bottom--2",
2730
+ children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
2731
+ onOpen: ()=>{
2732
+ navigator.clipboard.writeText(window.location.href);
2733
+ },
2734
+ className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
2735
+ placement: "bottom",
2736
+ dialog: true,
2737
+ ariaLabel: "Copy link to filtered data",
2738
+ title: "Link copied to clipboard",
2739
+ "aria-disabled": !conditions || conditions.length === 0,
2740
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2741
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2742
+ children: [
2743
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2744
+ className: "fas fa-copy"
2745
+ }),
2746
+ " Copy link to filtered data"
2747
+ ]
2748
+ })
2749
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2750
+ "aria-disabled": true,
2751
+ "aria-label": "Copy link to filtered data",
2752
+ className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
2753
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2754
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2755
+ children: [
2756
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2757
+ className: "fas fa-copy"
2758
+ }),
2759
+ " Copy link to filtered data"
2760
+ ]
2761
+ })
2762
+ })
2835
2763
  }),
2836
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2837
- className: "ds-u-display--none ds-u-lg-display--inline-block",
2838
- children: isModal ? "Exit Full Screen" : "Full Screen"
2764
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2765
+ className: "ds-l-col--12 ds-l-md-col--auto ds-u-padding-x--0 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",
2766
+ children: [
2767
+ (showDownloadFilteredDataButton || showStoredQueryDownloadButton) && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2768
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-sm-margin-left--2 ds-u-margin-bottom--2",
2769
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2770
+ className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
2771
+ href: downloadURL,
2772
+ "aria-disabled": !conditions || conditions.length === 0,
2773
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2774
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2775
+ children: [
2776
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2777
+ className: "fas fa-file-csv"
2778
+ }),
2779
+ " ",
2780
+ showDownloadFilteredDataButton ? `Download filtered data (CSV)` : `Download stored query data (CSV)`
2781
+ ]
2782
+ })
2783
+ })
2784
+ }),
2785
+ showDownloadFullDataButton && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2786
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-sm-margin-left--2 ds-u-margin-bottom--2",
2787
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2788
+ className: "ds-u-text-align--center ds-u-font-weight--normal ds-u-font-size--base ds-u-margin-right--1 ds-u-display--inline-block ds-l-col--12",
2789
+ href: unfilteredDownloadURL,
2790
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2791
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2792
+ children: [
2793
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2794
+ className: "fas fa-file-csv"
2795
+ }),
2796
+ " Download full dataset (CSV)"
2797
+ ]
2798
+ })
2799
+ })
2800
+ })
2801
+ ]
2839
2802
  })
2840
2803
  ]
2841
2804
  }),
2842
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2843
- className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
2844
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
2845
- heading: "Dataset Explorer",
2846
- isOpen: modalOpen,
2847
- onExit: ()=>setModalOpen(false),
2848
- className: "dkan-full-screen-dataset-dialog",
2849
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
2850
- isModal: true,
2851
- closeFullScreenModal: ()=>setModalOpen(false)
2852
- })
2853
- })
2854
- })
2855
- ]
2856
- });
2857
- };
2858
- var $16bd41951b91f02d$export$2e2bcd8739ae039 = $16bd41951b91f02d$var$FullScreenDataTable;
2859
-
2860
-
2861
-
2862
-
2863
-
2864
-
2865
-
2866
-
2805
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2806
+ className: "ds-l-col--12 ds-u-display--flex ds-u-align-items--end ds-u-flex-direction--row-reverse ds-u-sm-flex-direction--row ds-u-padding-x--0 ds-u-margin-bottom--2 ds-u-flex-wrap--wrap",
2807
+ children: [
2808
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2809
+ className: "ds-l-col--12 ds-l-sm-col--8 ds-u-padding-x--0",
2810
+ children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
2811
+ totalRows: intCount,
2812
+ limit: limit,
2813
+ offset: offset
2814
+ })
2815
+ }),
2816
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2817
+ className: "ds-l-col--12 ds-l-sm-col--4 ds-u-display--flex ds-u-justify-content--end ds-u-padding-x--0",
2818
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2819
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2820
+ options: rowOptions.map((row)=>({
2821
+ label: row.toString(),
2822
+ value: row
2823
+ })),
2824
+ size: "medium",
2825
+ label: "Rows per page:",
2826
+ labelClassName: "ds-u-margin-top--0",
2827
+ name: "datatable_rows_per_page",
2828
+ onChange: (e)=>{
2829
+ setLimit(parseInt(e.target.value));
2830
+ setPage(1);
2831
+ setOffset(0);
2832
+ },
2833
+ value: limit.toString(),
2834
+ defaultValue: limit.toString()
2835
+ })
2836
+ })
2837
+ })
2838
+ ]
2839
+ })
2840
+ ]
2841
+ });
2842
+ };
2843
+ var $6380a4a580b24362$export$2e2bcd8739ae039 = $6380a4a580b24362$var$DataTableHeader;
2844
+
2867
2845
 
2868
2846
 
2869
2847
 
@@ -2874,18 +2852,94 @@ var $16bd41951b91f02d$export$2e2bcd8739ae039 = $16bd41951b91f02d$var$FullScreenD
2874
2852
 
2875
2853
 
2876
2854
 
2877
- function $eadd6431fddf4b6c$var$getStartDate(condition, schema, id) {
2855
+ const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions, schema: schema, customColumns: customColumns })=>{
2856
+ const { fields: fields } = schema;
2857
+ const prependedMessage = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
2858
+ children: "Data filters: "
2859
+ });
2860
+ if (!conditions || !conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
2861
+ className: "ds-u-margin-y--0",
2862
+ children: [
2863
+ prependedMessage,
2864
+ " none"
2865
+ ]
2866
+ });
2867
+ function formatValue(text, property) {
2868
+ if (customColumns && customColumns.length > 0) {
2869
+ let newValue = text;
2870
+ let customColumn = customColumns.find((c)=>c.accessor === property);
2871
+ if (customColumn && customColumn.cell) return customColumn.cell({
2872
+ value: text
2873
+ });
2874
+ return text;
2875
+ } else return text;
2876
+ }
2877
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2878
+ className: "dc-querybuilder-title",
2879
+ children: [
2880
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2881
+ className: "ds-u-margin-y--0",
2882
+ children: prependedMessage
2883
+ }),
2884
+ conditions.map((c)=>{
2885
+ const field = fields[c.property];
2886
+ const description = field && field.description ? field.description : c.property;
2887
+ const operator = (0, $7264a673914aa746$export$5f89a5ae87bc48e1).find((op)=>op.value === c.operator);
2888
+ const cleanedText = (0, $7264a673914aa746$export$6b5e57d20078142b)(c.value);
2889
+ const formattedText = formatValue(cleanedText, c.property);
2890
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2891
+ className: "ds-u-fill--background ds-u-padding--1 ds-u-margin-y--1 ds-u-display--inline-block ds-u-font-weight--semibold",
2892
+ children: [
2893
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2894
+ className: "ds-u-font-weight--bold",
2895
+ children: description
2896
+ }),
2897
+ " ",
2898
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2899
+ className: "ds-u-font-weight--normal",
2900
+ children: operator.label.toUpperCase()
2901
+ }),
2902
+ " ",
2903
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2904
+ className: "ds-u-color--success",
2905
+ children: formattedText
2906
+ })
2907
+ ]
2908
+ });
2909
+ }).reduce((prev, curr)=>[
2910
+ prev,
2911
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Badge), {
2912
+ className: "ds-u-margin-x--1",
2913
+ variation: "info",
2914
+ children: "AND"
2915
+ }),
2916
+ curr
2917
+ ])
2918
+ ]
2919
+ });
2920
+ };
2921
+ var $bef7bff2823feea2$export$2e2bcd8739ae039 = $bef7bff2823feea2$var$QueryTitle;
2922
+
2923
+
2924
+
2925
+
2926
+
2927
+
2928
+
2929
+
2930
+
2931
+ function $6369abf590ca298f$var$getStartDate(condition, schema, id) {
2878
2932
  if (schema[id].fields[condition.property].mysql_type === "date") {
2879
2933
  const newDate = new Date(condition.value.toString());
2880
2934
  if (newDate instanceof Date && !isNaN(newDate.getTime())) return newDate;
2881
2935
  }
2882
2936
  return new Date();
2883
2937
  }
2884
- const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema, className: className = "" })=>{
2938
+ const $6369abf590ca298f$var$QueryRow = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema })=>{
2885
2939
  const [operator, setOperator] = (0, $hgUW1$useState)(condition.operator);
2886
2940
  const [property, setProperty] = (0, $hgUW1$useState)(condition.property);
2887
2941
  const [value, setValue] = (0, $hgUW1$useState)(condition.value);
2888
- const [startDate, setStartDate] = (0, $hgUW1$react).useState($eadd6431fddf4b6c$var$getStartDate(condition, schema, id));
2942
+ const [startDate, setStartDate] = (0, $hgUW1$react).useState($6369abf590ca298f$var$getStartDate(condition, schema, id));
2889
2943
  const xl = (0, $hgUW1$useMediaQuery)({
2890
2944
  minWidth: 1280
2891
2945
  });
@@ -2922,95 +2976,102 @@ const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index:
2922
2976
  value
2923
2977
  ]);
2924
2978
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("fieldset", {
2925
- className: `dkan-filter-dataset-control ds-u-padding-x--2 ds-u-md-padding-x--3 ds-u-padding-y--1 ds-u-margin-top--05${className !== "" ? ` ${className}` : ""}`,
2979
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between ds-u-align-items--center ds-u-border--0",
2926
2980
  children: [
2927
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2928
- options: propertyOptions,
2929
- className: "ds-u-padding-x--0",
2930
- value: property,
2931
- label: "Column Name",
2932
- name: `${condition.key}_property`,
2933
- onChange: (e)=>setProperty(e.target.value)
2934
- }),
2935
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2936
- options: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[property].mysql_type),
2937
- className: "ds-u-padding-x--0",
2938
- value: operator,
2939
- label: "Condition",
2940
- name: `${condition.key}_operator`,
2941
- onChange: (e)=>setOperator(e.target.value)
2981
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2982
+ className: "ds-l-col--12 ds-l-md-col--8 ds-u-display--flex ds-u-justify-content--between ds-u-padding-x--0",
2983
+ children: [
2984
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2985
+ options: propertyOptions,
2986
+ className: "ds-l-col--8 ds-u-padding-left--0",
2987
+ value: property,
2988
+ label: "Column Name",
2989
+ name: `${condition.key}_property`,
2990
+ onChange: (e)=>setProperty(e.target.value)
2991
+ }),
2992
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2993
+ options: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[property].mysql_type),
2994
+ className: "ds-l-col--4 ds-u-padding-x--0",
2995
+ value: operator,
2996
+ label: "Operator",
2997
+ name: `${condition.key}_operator`,
2998
+ onChange: (e)=>setOperator(e.target.value)
2999
+ })
3000
+ ]
2942
3001
  }),
2943
- schema[id].fields[property].mysql_type === "date" ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3002
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3003
+ className: "ds-l-col--12 ds-l-md-col--4 ds-u-padding-x--0 ds-u-md-padding-left--2 ds-u-display--flex ds-u-justify-content--between",
2944
3004
  children: [
2945
- /*#__PURE__*/ (0, $hgUW1$jsx)("label", {
2946
- className: "ds-c-label",
2947
- htmlFor: `${condition.key}_date_value`,
2948
- id: `${condition.key}_date_value-label`,
3005
+ schema[id].fields[property].mysql_type === "date" ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3006
+ children: [
3007
+ /*#__PURE__*/ (0, $hgUW1$jsx)("label", {
3008
+ className: "ds-c-label",
3009
+ htmlFor: `${condition.key}_date_value`,
3010
+ id: `${condition.key}_date_value-label`,
3011
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3012
+ children: "Value"
3013
+ })
3014
+ }),
3015
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$reactdatepicker), {
3016
+ name: `${condition.key}_date_value`,
3017
+ selected: (0, $7264a673914aa746$export$e284ae5d89467c8f)(startDate),
3018
+ onChange: (date)=>{
3019
+ setStartDate(date);
3020
+ setValue(date.toJSON().slice(0, 10));
3021
+ },
3022
+ showMonthDropdown: true,
3023
+ showYearDropdown: true,
3024
+ dropdownMode: "select",
3025
+ className: "ds-c-field",
3026
+ withPortal: true
3027
+ })
3028
+ ]
3029
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
3030
+ className: "ds-l-col--11 ds-u-padding-x--0",
3031
+ label: "Value",
3032
+ name: `${condition.key}_value`,
3033
+ value: (0, $7264a673914aa746$export$6b5e57d20078142b)(value, operator),
3034
+ onChange: (e)=>setValue(e.target.value)
3035
+ }),
3036
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3037
+ variation: "ghost",
3038
+ size: "small",
3039
+ className: "ds-u-margin-top--6 ds-u-padding-right--0",
3040
+ "aria-label": "Delete filter",
3041
+ onClick: ()=>remove(index),
2949
3042
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2950
- children: "Value"
3043
+ className: "fas fa-trash"
2951
3044
  })
2952
- }),
2953
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$reactdatepicker), {
2954
- name: `${condition.key}_date_value`,
2955
- selected: (0, $7264a673914aa746$export$e284ae5d89467c8f)(startDate),
2956
- onChange: (date)=>{
2957
- setStartDate(date);
2958
- setValue(date.toJSON().slice(0, 10));
2959
- },
2960
- showMonthDropdown: true,
2961
- showYearDropdown: true,
2962
- dropdownMode: "select",
2963
- className: "ds-c-field",
2964
- withPortal: true
2965
3045
  })
2966
3046
  ]
2967
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
2968
- className: "ds-u-padding-x--0",
2969
- label: "Value",
2970
- name: `${condition.key}_value`,
2971
- value: (0, $7264a673914aa746$export$6b5e57d20078142b)(value, operator),
2972
- onChange: (e)=>setValue(e.target.value),
2973
- placeholder: "Enter value"
2974
- }),
2975
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2976
- variation: "ghost",
2977
- size: "small",
2978
- className: "dkan-delete-dataset-filter-button ds-u-padding-x--0 ds-u-margin-left--05 ds-u-md-margin-top--0 ds-u-border--1 ds-u-border--dark ds-u-color--black",
2979
- "aria-label": "Delete filter",
2980
- onClick: ()=>remove(index),
2981
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2982
- className: "far fa-trash"
2983
- })
2984
3047
  })
2985
3048
  ]
2986
3049
  });
2987
3050
  };
2988
- var $eadd6431fddf4b6c$export$2e2bcd8739ae039 = $eadd6431fddf4b6c$var$FilterItem;
2989
-
3051
+ var $6369abf590ca298f$export$2e2bcd8739ae039 = $6369abf590ca298f$var$QueryRow;
2990
3052
 
2991
3053
 
2992
3054
 
2993
3055
 
2994
3056
 
2995
3057
 
2996
- const $2eec38d4d0dbf714$var$ClearFiltersButton = ({ disabled: disabled = false, clearFiltersFn: clearFiltersFn, disableDefaultClasses: disableDefaultClasses = false, className: className = "" })=>{
3058
+ const $2eec38d4d0dbf714$var$ClearFiltersButton = ({ disabled: disabled = false, clearFiltersFn: clearFiltersFn })=>{
2997
3059
  const small = (0, $hgUW1$useMediaQuery)({
2998
3060
  minWidth: 0,
2999
3061
  maxWidth: 544
3000
3062
  });
3001
3063
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3002
3064
  disabled: disabled,
3003
- className: `dkan-clear-dataset-filters-button ${disableDefaultClasses ? "" : " ds-u-float--right ds-l-md-col--6 ds-l-col--5"}${className !== "" ? ` ${className}` : ""}`,
3065
+ className: "ds-u-float--right ds-l-md-col--6 ds-l-col--5",
3004
3066
  variation: small ? "ghost" : undefined,
3005
3067
  onClick: ()=>clearFiltersFn(),
3006
- children: "Reset"
3068
+ children: small ? "Clear all" : "Clear all filters"
3007
3069
  });
3008
3070
  };
3009
3071
  var $2eec38d4d0dbf714$export$2e2bcd8739ae039 = $2eec38d4d0dbf714$var$ClearFiltersButton;
3010
3072
 
3011
3073
 
3012
-
3013
- function $6f4318b1e14124e5$var$updateQueryForDatastore(condition) {
3074
+ function $ee4ad47aa483e5b5$var$updateQueryForDatastore(condition) {
3014
3075
  let cond = condition;
3015
3076
  delete cond.key;
3016
3077
  if (cond.operator === "=" || cond.operator === "<>") {
@@ -3028,19 +3089,12 @@ function $6f4318b1e14124e5$var$updateQueryForDatastore(condition) {
3028
3089
  if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
3029
3090
  return cond;
3030
3091
  }
3031
- const $6f4318b1e14124e5$var$FilterDataset = ()=>{
3032
- const { distribution: distribution, resource: resource, customColumns: customColumns = [] } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
3033
- const { setPage: setPage } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
3034
- if (!resource) return null;
3035
- const customColumnHeaders = (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution.identifier]);
3036
- const id = distribution.identifier;
3037
- const columns = customColumnHeaders ? customColumnHeaders : (0, $a35cf16d1488f54e$export$1147582dfae658c6)(resource.columns, resource.schema[id]);
3038
- const { conditions: conditions, schema: schema, setConditions: setConditions, setOffset: setOffset } = resource;
3092
+ const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, customColumns: customColumns, isModal: isModal = false, setPage: setPage, setOffset: setOffset })=>{
3093
+ const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
3039
3094
  const fields = Object.keys(schema[id].fields);
3040
3095
  const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
3041
- const [titleConditions, setTitleConditions] = (0, $hgUW1$useState)([]);
3096
+ const [titleConditions, setTitleConditions] = (0, $hgUW1$useState)([]); // Add use effect to load conditions on first load if needed
3042
3097
  const [conditionsChanged, setConditionsChanged] = (0, $hgUW1$useState)(false);
3043
- const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
3044
3098
  const syncConditions = ()=>{
3045
3099
  if (conditions && conditions.length) {
3046
3100
  const keyedConditions = conditions.map((oc)=>({
@@ -3075,7 +3129,7 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
3075
3129
  ]);
3076
3130
  };
3077
3131
  // Sync the UI with the actual data conditions whenever those change
3078
- (0, $hgUW1$useEffect)(()=>{
3132
+ (0, $hgUW1$react).useEffect(()=>{
3079
3133
  syncConditions();
3080
3134
  setTitleConditions(conditions);
3081
3135
  }, [
@@ -3101,37 +3155,21 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
3101
3155
  });
3102
3156
  window.history.pushState({}, "", `${url.origin}${url.pathname}${urlString}`);
3103
3157
  };
3104
- const submitConditions = ()=>{
3158
+ const submitConditions = (e)=>{
3105
3159
  // only update the data conditions when "Apply filters" is pressed
3160
+ e.preventDefault();
3106
3161
  const submitConditions = queryConditions.filter((oc)=>{
3107
3162
  if (oc.property) return oc;
3108
3163
  return false;
3109
3164
  }).map((oc)=>{
3110
3165
  let cond = Object.assign({}, oc);
3111
- return $6f4318b1e14124e5$var$updateQueryForDatastore(cond);
3112
- });
3113
- const completeConditions = conditionsReadyToSubmit(submitConditions);
3114
- if (completeConditions.length) {
3115
- setConditions(completeConditions);
3116
- setPage(1);
3117
- setOffset(0);
3118
- setConditionsChanged(false);
3119
- updateBrowserURL(completeConditions);
3120
- setModalOpen(false);
3121
- }
3122
- };
3123
- const conditionsReadyToSubmit = (conditions)=>{
3124
- const isEmpty = (val)=>{
3125
- if (typeof val === "string") return val.trim() === "";
3126
- if (Array.isArray(val)) return val.length === 0;
3127
- return true;
3128
- };
3129
- const completeConditions = conditions.filter((condition)=>{
3130
- if (condition) {
3131
- if (!isEmpty(condition.property) && !isEmpty(condition.operator) && !isEmpty(condition.value)) return condition;
3132
- }
3166
+ return $ee4ad47aa483e5b5$var$updateQueryForDatastore(cond);
3133
3167
  });
3134
- return completeConditions;
3168
+ setConditions(submitConditions);
3169
+ setPage(1);
3170
+ setOffset(0);
3171
+ setConditionsChanged(false);
3172
+ updateBrowserURL(submitConditions);
3135
3173
  };
3136
3174
  const updateCondition = (index, key, value)=>{
3137
3175
  let newConditions = [
@@ -3147,451 +3185,258 @@ const $6f4318b1e14124e5$var$FilterDataset = ()=>{
3147
3185
  newConditions.splice(index, 1);
3148
3186
  setQueryConditions(newConditions);
3149
3187
  setConditionsChanged(true);
3150
- if (newConditions.length === 0) {
3151
- setConditions([]);
3152
- updateBrowserURL([]);
3153
- }
3154
- };
3155
- const disableFilterSubmitButton = ()=>{
3156
- return !conditionsChanged || queryConditions.length === 0 || conditionsReadyToSubmit(queryConditions).length === 0;
3157
3188
  };
3158
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
3159
- children: Object.keys(resource).length && columns.length && resource.schema && Object.keys(distribution).length ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3160
- className: "dkan-filter-dataset-wrapper",
3161
- children: [
3162
- /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
3163
- "aria-label": "Filter dataset - Opens in a dialog",
3164
- 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",
3165
- onClick: ()=>{
3166
- setModalOpen(true);
3167
- },
3189
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3190
+ className: "dc-query-builder ds-u-margin-bottom--3",
3191
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3192
+ className: "ds-c-accordion ds-c-accordion--bordered",
3193
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
3194
+ heading: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $bef7bff2823feea2$export$2e2bcd8739ae039), {
3195
+ schema: schema[id],
3196
+ conditions: titleConditions,
3197
+ customColumns: customColumns
3198
+ }),
3199
+ defaultOpen: !isModal,
3200
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("form", {
3201
+ onSubmit: (e)=>submitConditions(e),
3168
3202
  children: [
3169
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3170
- className: "fa fa-filter ds-u-margin-right--1"
3203
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3204
+ children: queryConditions.map((qf, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $6369abf590ca298f$export$2e2bcd8739ae039), {
3205
+ id: id,
3206
+ schema: schema,
3207
+ condition: qf,
3208
+ index: index,
3209
+ propertyOptions: propertyOptions,
3210
+ update: updateCondition,
3211
+ remove: removeCondition
3212
+ }, qf.key))
3171
3213
  }),
3172
- /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3214
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3215
+ className: "dc-query-bulder--form-buttons ds-u-padding-x--2 ds-u-padding-top--0 ds-u-md-padding-top--2 ds-u-display--flex ds-u-flex-wrap--wrap",
3173
3216
  children: [
3174
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3175
- className: "ds-u-display--none ds-u-lg-display--inline-block",
3176
- children: conditions.length > 0 ? `Edit Filters` : "Filter Dataset"
3177
- }),
3178
- conditions.length > 0 && ` (${conditions.length})`
3179
- ]
3180
- })
3181
- ]
3182
- }),
3183
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3184
- className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
3185
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
3186
- heading: "Filter Dataset",
3187
- isOpen: modalOpen,
3188
- onExit: ()=>setModalOpen(false),
3189
- className: "dkan-filter-dataset-dialog",
3190
- ariaCloseLabel: "Close filter dataset dialog",
3191
- actions: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3192
- className: "ds-u-display--flex ds-u-justify-content--end ds-u-padding-x--2 ds-u-md-padding-x--3 ds-u-padding-y--2",
3193
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3194
- className: "ds-u-display--flex ",
3195
- children: [
3196
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2eec38d4d0dbf714$export$2e2bcd8739ae039), {
3197
- disabled: queryConditions.length === 0,
3198
- clearFiltersFn: ()=>{
3199
- setConditions([]);
3200
- updateBrowserURL([]);
3201
- },
3202
- disableDefaultClasses: true,
3203
- className: "ds-l-md-col--auto ds-l-col--auto ds-u-margin--right--0 ds-u-sm-margin-right--2"
3204
- }),
3205
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3206
- disabled: disableFilterSubmitButton(),
3207
- className: "dkan-apply-dataset-filters-button ds-u-float--right ds-l-md-col--auto ds-l-col--auto",
3208
- onClick: submitConditions,
3209
- variation: "solid",
3210
- children: `Apply ${conditionsReadyToSubmit(queryConditions).length || ""} filter${conditionsReadyToSubmit(queryConditions).length === 1 ? "" : "s"}`
3217
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3218
+ className: "ds-l-col--12 ds-l-md-col--4 ds-l-md-col--6 ds-u-padding-x--0 ds-u-margin-bottom--2 ds-u-md-margin-bottom--0",
3219
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3220
+ variation: "ghost",
3221
+ onClick: ()=>addCondition(null),
3222
+ className: "ds-u-padding-left--0",
3223
+ children: "+ Add filter"
3211
3224
  })
3212
- ]
3213
- })
3214
- }),
3215
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3216
- children: [
3217
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3218
- className: "ds-u-margin--0 ds-u-margin-top--1 ds-u-margin-bottom--2 ds-u-padding-x--2 ds-u-md-padding-x--3",
3219
- children: "Add filters to only display data that meets your criteria. Filtered results can be downloaded."
3220
3225
  }),
3221
3226
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3222
- className: "dkan-filter-dataset-controls-header ds-u-padding-x--2 ds-u-md-padding-x--3 ds-u-padding-y--1 ds-u-margin-top--05 ds-u-fill--gray-lightest",
3227
+ className: "ds-u-display--flex ds-u-justify-content--end ds-l-col--12 ds-l-md-col--6 ds-u-padding-x--0",
3223
3228
  children: [
3224
- /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
3225
- className: "ds-u-margin--0 ds-u-font-weight--bold ds-u-padding--0",
3226
- children: "Column Name"
3227
- }),
3228
- /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
3229
- className: "ds-u-margin--0 ds-u-font-weight--bold ds-u-padding--0",
3230
- children: "Condition"
3231
- }),
3232
- /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
3233
- className: "ds-u-margin--0 ds-u-font-weight--bold ds-u-padding--0",
3234
- children: "Value"
3229
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3230
+ disabled: !conditionsChanged,
3231
+ className: "ds-u-float--right ds-l-md-col--6 ds-u-margin--right--0 ds-u-sm-margin-right--2",
3232
+ type: "submit",
3233
+ variation: "solid",
3234
+ children: "Apply filters"
3235
3235
  }),
3236
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3237
- className: "dkan-filter-dataset-controls-header-gutter"
3236
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2eec38d4d0dbf714$export$2e2bcd8739ae039), {
3237
+ disabled: queryConditions.length === 0,
3238
+ clearFiltersFn: ()=>{
3239
+ setConditions([]);
3240
+ updateBrowserURL([]);
3241
+ }
3238
3242
  })
3239
3243
  ]
3240
- }),
3241
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3242
- className: "dkan-filter-dataset-form-container ds-u-display--flex ds-u-flex-direction--column ds-u-border-bottom--1",
3243
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3244
- className: "ds-u-padding-bottom--05",
3245
- children: [
3246
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3247
- className: "dkan-filter-dataset-controls",
3248
- children: queryConditions.map((qf, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $eadd6431fddf4b6c$export$2e2bcd8739ae039), {
3249
- id: id,
3250
- schema: schema,
3251
- condition: qf,
3252
- index: index,
3253
- propertyOptions: propertyOptions,
3254
- update: updateCondition,
3255
- remove: removeCondition,
3256
- className: index !== 0 ? "ds-u-border-top--1" : "ds-u-border--0"
3257
- }, qf.key))
3258
- }),
3259
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3260
- className: "ds-u-padding-x--2 ds-u-md-padding-x--3 ds-u-padding-y--1 ds-u-border-top--1 ds-u-margin-top--05",
3261
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3262
- onClick: ()=>addCondition(null),
3263
- className: "dkan-add-dataset-filter-button ds-l-col--12 ds-u-radius--pill ds-u-margin-top--05 ds-u-font-weight--normal",
3264
- children: "+ Add filter"
3265
- })
3266
- })
3267
- ]
3268
- })
3269
3244
  })
3270
3245
  ]
3271
3246
  })
3272
- })
3247
+ ]
3273
3248
  })
3274
- ]
3275
- }) : null
3276
- });
3277
- };
3278
- var $6f4318b1e14124e5$export$2e2bcd8739ae039 = $6f4318b1e14124e5$var$FilterDataset;
3279
-
3280
-
3281
-
3282
-
3283
-
3284
- const $c5b172e8d1a8197c$var$FliterChip = ({ iconClass: iconClass, text: text, onClick: onClick })=>{
3285
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
3286
- className: "dkan-filter-chip ds-u-display--flex ds-u-font-size--sm ds-u-align-items--center ds-u-padding-x--1 ds-u-padding-y--05 ds-u-margin--0 ds-u-margin-right--1 ds-u-margin-bottom--1",
3287
- onClick: onClick,
3288
- children: [
3289
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3290
- className: `${iconClass} ds-u-color--primary ds-u-margin-right--1`
3291
- }),
3292
- text,
3293
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3294
- className: "fa fa-xmark ds-u-font-size--sm ds-u-margin-left--1"
3295
3249
  })
3296
- ]
3250
+ })
3297
3251
  });
3298
3252
  };
3299
- var $c5b172e8d1a8197c$export$2e2bcd8739ae039 = $c5b172e8d1a8197c$var$FliterChip;
3300
-
3301
-
3253
+ var $ee4ad47aa483e5b5$export$2e2bcd8739ae039 = $ee4ad47aa483e5b5$var$QueryBuilder;
3302
3254
 
3303
3255
 
3304
3256
 
3257
+ const $43a30d745a7bbc86$var$DataTableContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
3258
+ id: null
3259
+ });
3260
+ var $43a30d745a7bbc86$export$2e2bcd8739ae039 = $43a30d745a7bbc86$var$DataTableContext;
3305
3261
 
3306
3262
 
3307
3263
 
3308
- const $dae856e97a09bcd6$var$DisplaySettings = ()=>{
3309
- const { resource: resource } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
3310
- const { setPage: setPage, tableDensity: tableDensity, setTableDensity: setTableDensity } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
3311
- const rowOptions = [
3312
- 10,
3313
- 25,
3314
- 50,
3315
- 100
3316
- ];
3317
- if (!resource) return null;
3318
- const { limit: limit, setLimit: setLimit, setOffset: setOffset } = resource;
3319
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3320
- className: "dkan-display-settings-wrapper",
3321
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
3322
- className: "dkan-filter-dataset-toolbar-button ds-u-display--flex ds-u-align-items--center ds-u-color--primary ds-u-border--0 ds-u-padding--0 ds-u-padding-x--2 ds-u-margin--0 ds-u-fill--transparent ds-u-font-size--sm",
3323
- activeClassName: "dkan-data-table-display-settings-tooltip-open",
3324
- dialog: true,
3325
- offset: [
3326
- 0,
3327
- 5
3328
- ],
3329
- placement: "bottom-start",
3330
- maxWidth: "350px",
3331
- "aria-label": "Display Settings",
3332
- title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3333
- className: "ds-u-display--flex ds-u-flex-direction--column",
3334
- children: [
3335
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3336
- className: "dkan-data-table-display-settings-row ds-u-padding-bottom--1",
3337
- children: [
3338
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3339
- className: "",
3340
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3341
- className: "ds-u-font-size--md ds-u-font-weight--normal",
3342
- children: "Row height"
3343
- })
3344
- }),
3345
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3346
- className: "ds-u-display--flex ds-u-align-items--start",
3347
- children: [
3348
- /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3349
- onClick: ()=>setTableDensity("expanded"),
3350
- "aria-label": "Row height, Expanded",
3351
- className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity === "expanded" ? "active ds-u-fill--primary-lightest" : ""}`,
3352
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3353
- className: "ds-u-display--block",
3354
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
3355
- className: "ds-u-display--block",
3356
- viewBox: "0 0 512 512",
3357
- xmlns: "http://www.w3.org/2000/svg",
3358
- "aria-hidden": "true",
3359
- focusable: "false",
3360
- height: "16",
3361
- role: "img",
3362
- width: "16",
3363
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
3364
- d: "M496,384 C504.836556,384 512,391.163444 512,400 L512,496 C512,504.836556 504.836556,512 496,512 L16,512 C7.163444,512 1.082166e-15,504.836556 0,496 L0,400 C-1.082166e-15,391.163444 7.163444,384 16,384 L496,384 Z M496,192 C504.836556,192 512,199.163444 512,208 L512,304 C512,312.836556 504.836556,320 496,320 L16,320 C7.163444,320 1.082166e-15,312.836556 0,304 L0,208 C-1.082166e-15,199.163444 7.163444,192 16,192 L496,192 Z M496,0 C504.836556,-1.623249e-15 512,7.163444 512,16 L512,112 C512,120.836556 504.836556,128 496,128 L16,128 C7.163444,128 1.082166e-15,120.836556 0,112 L0,16 C-1.082166e-15,7.163444 7.163444,1.623249e-15 16,0 L496,0 Z"
3365
- })
3366
- })
3367
- })
3368
- }),
3369
- /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3370
- onClick: ()=>setTableDensity("normal"),
3371
- "aria-label": "Row height, Normal",
3372
- className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity === "normal" ? "active ds-u-fill--primary-lightest" : ""}`,
3373
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3374
- className: "ds-u-display--block",
3375
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
3376
- className: "ds-u-display--block",
3377
- viewBox: "0 0 512 512",
3378
- xmlns: "http://www.w3.org/2000/svg",
3379
- "aria-hidden": "true",
3380
- focusable: "false",
3381
- height: "16",
3382
- role: "img",
3383
- width: "16",
3384
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
3385
- d: "M496,416 C504.836556,416 512,423.163444 512,432 L512,496 C512,504.836556 504.836556,512 496,512 L16,512 C7.163444,512 1.082166e-15,504.836556 0,496 L0,432 C-1.082166e-15,423.163444 7.163444,416 16,416 L496,416 Z M496,277 C504.836556,277 512,284.163444 512,293 L512,357 C512,365.836556 504.836556,373 496,373 L16,373 C7.163444,373 1.082166e-15,365.836556 0,357 L0,293 C-1.082166e-15,284.163444 7.163444,277 16,277 L496,277 Z M496,139 C504.836556,139 512,146.163444 512,155 L512,219 C512,227.836556 504.836556,235 496,235 L16,235 C7.163444,235 1.082166e-15,227.836556 0,219 L0,155 C-1.082166e-15,146.163444 7.163444,139 16,139 L496,139 Z M496,0 C504.836556,-1.623249e-15 512,7.163444 512,16 L512,80 C512,88.836556 504.836556,96 496,96 L16,96 C7.163444,96 1.082166e-15,88.836556 0,80 L0,16 C-1.082166e-15,7.163444 7.163444,1.623249e-15 16,0 L496,0 Z"
3386
- })
3387
- })
3388
- })
3389
- }),
3390
- /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3391
- onClick: ()=>setTableDensity("compact"),
3392
- "aria-label": "Row height, Compact",
3393
- className: `dkan-table-density-button ds-u-leading--reset ds-u-padding--1 ds-u-margin--0 ${tableDensity === "compact" ? "active ds-u-fill--primary-lightest " : ""}`,
3394
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3395
- className: "ds-u-display--block",
3396
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("svg", {
3397
- className: "ds-u-display--block",
3398
- viewBox: "0 0 512 512",
3399
- xmlns: "http://www.w3.org/2000/svg",
3400
- "aria-hidden": "true",
3401
- focusable: "false",
3402
- height: "16",
3403
- role: "img",
3404
- width: "16",
3405
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("path", {
3406
- d: "M496,448 C504.836556,448 512,455.163444 512,464 L512,496 C512,504.836556 504.836556,512 496,512 L16,512 C7.163444,512 1.082166e-15,504.836556 0,496 L0,464 C-1.082166e-15,455.163444 7.163444,448 16,448 L496,448 Z M496,336 C504.836556,336 512,343.163444 512,352 L512,384 C512,392.836556 504.836556,400 496,400 L16,400 C7.163444,400 1.082166e-15,392.836556 0,384 L0,352 C-1.082166e-15,343.163444 7.163444,336 16,336 L496,336 Z M496,224 C504.836556,224 512,231.163444 512,240 L512,272 C512,280.836556 504.836556,288 496,288 L16,288 C7.163444,288 1.082166e-15,280.836556 0,272 L0,240 C-1.082166e-15,231.163444 7.163444,224 16,224 L496,224 Z M496,112 C504.836556,112 512,119.163444 512,128 L512,160 C512,168.836556 504.836556,176 496,176 L16,176 C7.163444,176 1.082166e-15,168.836556 0,160 L0,128 C-1.082166e-15,119.163444 7.163444,112 16,112 L496,112 Z M496,0 C504.836556,-1.623249e-15 512,7.163444 512,16 L512,48 C512,56.836556 504.836556,64 496,64 L16,64 C7.163444,64 1.082166e-15,56.836556 0,48 L0,16 C-1.082166e-15,7.163444 7.163444,1.623249e-15 16,0 L496,0 Z"
3407
- })
3408
- })
3409
- })
3410
- })
3411
- ]
3412
- })
3413
- ]
3414
- }),
3415
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3416
- className: "dkan-data-table-display-settings-row ds-u-border-top--1 ds-u-padding-top--1",
3417
- children: [
3418
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3419
- className: "",
3420
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3421
- className: "ds-u-font-size--md ds-u-font-weight--normal",
3422
- children: "Rows per page"
3423
- })
3424
- }),
3425
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3426
- className: "",
3427
- options: rowOptions.map((row)=>({
3428
- label: row.toString(),
3429
- value: row
3430
- })),
3431
- size: "medium",
3432
- label: "Rows per page:",
3433
- labelClassName: "ds-u-margin-top--0 ds-u-font-size--md ds-u-font-weight--normal",
3434
- name: "datatable_rows_per_page",
3435
- onChange: (e)=>{
3436
- setLimit(parseInt(e.target.value));
3437
- setPage(1);
3438
- setOffset(0);
3439
- },
3440
- value: limit.toString(),
3441
- defaultValue: limit.toString()
3442
- })
3443
- ]
3444
- })
3445
- ]
3264
+ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
3265
+ return columns.map((column)=>({
3266
+ header: schema && schema.fields[column].description ? schema.fields[column].description : column,
3267
+ accessor: column
3268
+ }));
3269
+ }
3270
+ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, closeFullScreenModal: closeFullScreenModal, showQueryBuilder: showQueryBuilder = true, showCopyLinkButton: showCopyLinkButton = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
3271
+ const { id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
3272
+ const { page: page, setPage: setPage } = (0, $hgUW1$useContext)((0, $ebda441784d176a5$export$2e2bcd8739ae039));
3273
+ const defaultPageSize = 10;
3274
+ const customColumnHeaders = (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution.identifier]);
3275
+ const columns = customColumnHeaders ? customColumnHeaders : $a35cf16d1488f54e$export$1147582dfae658c6(resource.columns, resource.schema[id]);
3276
+ const { limit: limit, setOffset: setOffset } = resource;
3277
+ const pageSize = limit ? limit : defaultPageSize;
3278
+ const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
3279
+ conditions: resource.conditions
3280
+ }, {
3281
+ encode: true
3282
+ })}&format=csv`;
3283
+ if (Object.keys(resource).length && columns.length && resource.schema && Object.keys(distribution).length) return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3284
+ children: [
3285
+ showQueryBuilder && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee4ad47aa483e5b5$export$2e2bcd8739ae039), {
3286
+ resource: resource,
3287
+ id: distribution.identifier,
3288
+ customColumns: customColumnHeaders,
3289
+ isModal: isModal,
3290
+ setPage: setPage,
3291
+ setOffset: setOffset
3446
3292
  }),
3447
- children: [
3448
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3449
- className: "far fa-sliders-h ds-u-margin-right--1"
3450
- }),
3451
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3452
- className: "ds-u-display--none ds-u-lg-display--inline-block",
3453
- children: "Display Settings"
3454
- }),
3455
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3456
- className: "fa fa-chevron-down ds-u-margin-left--1 ds-u-font-weight--bold"
3457
- }),
3458
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3459
- className: "fa fa-chevron-up ds-u-margin-left--1 ds-u-font-weight--bold"
3293
+ dataDictionaryBanner && !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3294
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
3295
+ children: 'Click on the "Data Dictionary" tab above for full column definitions'
3296
+ })
3297
+ }),
3298
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6380a4a580b24362$export$2e2bcd8739ae039), {
3299
+ resource: resource,
3300
+ downloadURL: downloadURL,
3301
+ unfilteredDownloadURL: distribution.data.downloadURL,
3302
+ setPage: setPage,
3303
+ showCopyLinkButton: showCopyLinkButton,
3304
+ showDownloadFilteredDataButton: showDownloadFilteredDataButton,
3305
+ showDownloadFullDataButton: showDownloadFullDataButton,
3306
+ showStoredQueryDownloadButton: showStoredQueryDownloadButton
3307
+ }),
3308
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3309
+ className: `ds-u-border-x--1 ds-u-border-bottom--1 ${isModal && "dkan-datatable-fullscreen-mode"}`,
3310
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
3311
+ canResize: true,
3312
+ columns: columns,
3313
+ sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
3314
+ tablePadding: "ds-u-padding-y--2",
3315
+ loading: resource.loading,
3316
+ isModal: isModal,
3317
+ closeFullScreenModal: closeFullScreenModal
3318
+ })
3319
+ }),
3320
+ !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3321
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-u-md-justify-content--between ds-u-margin-top--2 ds-u-align-items--center",
3322
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
3323
+ totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
3324
+ currentPage: Number(page),
3325
+ onPageChange: (evt, page)=>{
3326
+ evt.preventDefault();
3327
+ setOffset((page - 1) * limit);
3328
+ setPage(page);
3329
+ },
3330
+ renderHref: (p)=>`?page=${p}`,
3331
+ className: "ds-l-col--12 ds-u-padding-x--0"
3460
3332
  })
3461
- ]
3462
- })
3333
+ })
3334
+ ]
3335
+ });
3336
+ else return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
3337
+ "aria-valuetext": "Dataset loading",
3338
+ role: "status",
3339
+ className: "ds-u-margin--3"
3463
3340
  });
3464
3341
  };
3465
- var $dae856e97a09bcd6$export$2e2bcd8739ae039 = $dae856e97a09bcd6$var$DisplaySettings;
3466
-
3342
+ var $a35cf16d1488f54e$export$2e2bcd8739ae039 = $a35cf16d1488f54e$var$DatasetTable;
3467
3343
 
3468
3344
 
3469
- const $85f8ff1ff89899c7$var$updateBrowserURL = (newConditions)=>{
3470
- const url = new URL(window.location.href);
3471
- const urlString = (0, $hgUW1$qs).stringify({
3472
- conditions: newConditions
3473
- }, {
3474
- encodeValuesOnly: true,
3475
- addQueryPrefix: true
3345
+ const $16bd41951b91f02d$var$FullScreenDataTable = ({ modalOpen: modalOpen, setModalOpen: setModalOpen })=>{
3346
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3347
+ className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
3348
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
3349
+ heading: "Dataset Explorer",
3350
+ isOpen: modalOpen,
3351
+ onExit: ()=>setModalOpen(false),
3352
+ className: "dkan-full-screen-dataset-dialog",
3353
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
3354
+ isModal: true,
3355
+ closeFullScreenModal: ()=>setModalOpen(false)
3356
+ })
3357
+ })
3476
3358
  });
3477
- window.history.pushState({}, "", `${url.origin}${url.pathname}${urlString}`);
3478
3359
  };
3479
- const $85f8ff1ff89899c7$var$DataTableToolbar = ({ resource: resource, id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, isModal: isModal, closeFullScreenModal: closeFullScreenModal, datasetTableControls: datasetTableControls, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility })=>{
3480
- const { limit: limit, offset: offset, count: count, conditions: conditions, setConditions: setConditions } = resource;
3481
- const intCount = count ? count : 0;
3482
- const hiddenColumns = Object.keys(columnVisibility).filter((key)=>columnVisibility[key] === false).length;
3483
- const resetColumnVisibility = ()=>{
3484
- const columns = {
3485
- ...columnVisibility
3486
- };
3487
- for(let key in columns)if (columns[key] === false) columns[key] = true;
3488
- setColumnVisibility(columns);
3489
- // save to localStorage
3490
- const currentLocalStorage = JSON.parse(localStorage.getItem(id));
3491
- const updatedLocalStorageData = {
3492
- ...currentLocalStorage,
3493
- tableColumnVisibility: columns
3494
- };
3495
- localStorage.setItem(id, JSON.stringify(updatedLocalStorageData));
3496
- };
3497
- const removeCondition = (index)=>{
3498
- // just removes the condition from the UI - "Apply Filters" must be clicked to change the data model
3499
- let updatedConditions = JSON.parse(JSON.stringify(conditions));
3500
- updatedConditions.splice(index, 1);
3501
- setConditions(updatedConditions);
3502
- $85f8ff1ff89899c7$var$updateBrowserURL(updatedConditions);
3503
- };
3504
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3505
- className: "ds-u-margin-top--2",
3360
+ var $16bd41951b91f02d$export$2e2bcd8739ae039 = $16bd41951b91f02d$var$FullScreenDataTable;
3361
+
3362
+
3363
+ const $71b4324f265dec16$var$DataTableControls = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, isModal: isModal, closeFullScreenModal: closeFullScreenModal })=>{
3364
+ const [manageColumnsModalOpen, setManageColumnsModalOpen] = (0, $hgUW1$useState)(false);
3365
+ const [fullScreenModalOpen, setFullScreenModalOpen] = (0, $hgUW1$useState)(false);
3366
+ const hiddenColumns = columns.filter((c)=>c.getIsVisible() === false).length;
3367
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3506
3368
  children: [
3507
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3508
- className: "dkan-filter-dataset-toolbar ds-u-fill--white ds-u-border--1",
3509
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3510
- className: "ds-l-col--12 ds-u-display--flex ds-u-justify-content--between ds-u-align-items--center ds-u-flex-wrap--wrap ds-u-padding-x--0 ds-u-padding-y--2",
3511
- children: [
3512
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3513
- className: "ds-u-padding-x--2",
3514
- children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
3515
- totalRows: intCount,
3516
- limit: limit,
3517
- offset: offset,
3518
- className: "data-table-results ds-u-margin--0 ds-u-font-size--sm ds-u-padding-y--0 ds-u-md-padding-y--1 ds-u-padding-bottom--2 ds-u-md-padding-bottom--0"
3519
- })
3520
- }),
3521
- datasetTableControls && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3522
- 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",
3369
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3370
+ className: "ds-u-border-top--1 ds-u-fill--gray-lightest ds-u-display--flex ds-u-justify-content--between",
3371
+ children: [
3372
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3373
+ children: hiddenColumns > 0 && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Alert), {
3374
+ variation: "warn",
3523
3375
  children: [
3524
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6f4318b1e14124e5$export$2e2bcd8739ae039), {}),
3525
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
3526
- id: id,
3527
- columns: columns,
3528
- defaultColumnOrder: defaultColumnOrder
3529
- }),
3530
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $dae856e97a09bcd6$export$2e2bcd8739ae039), {}),
3531
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
3532
- isModal: isModal,
3533
- closeFullScreenModal: closeFullScreenModal
3534
- })
3376
+ hiddenColumns,
3377
+ " Columns Hidden"
3535
3378
  ]
3536
3379
  })
3537
- ]
3538
- })
3539
- }),
3540
- (conditions.length > 0 || hiddenColumns > 0) && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3541
- className: "ds-u-fill--white ds-u-padding-x--0 ds-u-md-padding-x--2 ds-u-padding-top--2",
3542
- children: [
3543
- /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
3544
- className: "ds-u-margin--0 ds-u-margin-bottom--2 ds-u-font-size--lg ds-u-font-weight--bold",
3545
- children: "Selected filters"
3546
3380
  }),
3547
3381
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3548
- className: "ds-u-display--flex ds-u-justify-content--between ds-u-md-align-items--end ds-u-flex-direction--column ds-u-md-flex-direction--row",
3549
3382
  children: [
3550
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3551
- className: "ds-u-display--flex ds-u-padding-right--0 ds-u-md-padding-right--4 ds-u-flex-wrap--wrap",
3383
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
3384
+ "aria-label": "Manage columns - Opens in a dialog",
3385
+ className: "ds-c-button ds-c-button--ghost ds-u-margin-y--1",
3386
+ onClick: ()=>{
3387
+ setManageColumnsModalOpen(true);
3388
+ },
3552
3389
  children: [
3553
- conditions.length > 0 ? conditions.map((condition, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $c5b172e8d1a8197c$export$2e2bcd8739ae039), {
3554
- iconClass: "far fa-filter",
3555
- text: `"${condition.property}" ${condition.operator} ${condition.value}`,
3556
- onClick: ()=>{
3557
- removeCondition(index);
3558
- }
3559
- }, index)) : null,
3560
- hiddenColumns > 0 ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $c5b172e8d1a8197c$export$2e2bcd8739ae039), {
3561
- iconClass: "fa fa-columns",
3562
- text: `${hiddenColumns} Column${hiddenColumns === 1 ? "" : "s"} Hidden`,
3563
- onClick: ()=>{
3564
- resetColumnVisibility();
3565
- }
3566
- }) : null
3390
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3391
+ className: "far fa-cog ds-u-margin-right--1"
3392
+ }),
3393
+ "Manage Columns"
3567
3394
  ]
3568
3395
  }),
3569
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3570
- className: "ds-l-col--auto ds-u-padding--0 ds-u-display--flex ds-u-justify-content--end",
3571
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3572
- className: "dkan-clear-all-filters-button ds-u-color--primary ds-u-font-size--md ds-u-font-weight--bold ds-u-border--0 ds-u-padding--0 ds-u-margin--0 ds-u-fill--transparent ds-u-text-decoration--underline ds-u-margin-bottom--1",
3573
- onClick: ()=>{
3574
- setConditions([]);
3575
- $85f8ff1ff89899c7$var$updateBrowserURL([]);
3576
- resetColumnVisibility();
3577
- },
3578
- children: "Clear all filters"
3579
- })
3396
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
3397
+ "aria-label": isModal ? "Close Full Screen dialog" : "Full Screen mode - Opens in a dialog",
3398
+ className: "ds-c-button ds-c-button--ghost ds-u-margin-y--1",
3399
+ onClick: ()=>{
3400
+ if (isModal) closeFullScreenModal();
3401
+ else setFullScreenModalOpen(true);
3402
+ },
3403
+ children: [
3404
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3405
+ className: `fa ${isModal ? "fa-compress" : "fa-expand"} ds-u-margin-right--1`
3406
+ }),
3407
+ isModal ? "Exit Full Screen" : "Full Screen"
3408
+ ]
3580
3409
  })
3581
3410
  ]
3582
3411
  })
3583
3412
  ]
3413
+ }),
3414
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3415
+ children: [
3416
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
3417
+ id: id,
3418
+ columns: columns,
3419
+ defaultColumnOrder: defaultColumnOrder,
3420
+ modalOpen: manageColumnsModalOpen,
3421
+ setModalOpen: setManageColumnsModalOpen
3422
+ }),
3423
+ !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
3424
+ modalOpen: fullScreenModalOpen,
3425
+ setModalOpen: setFullScreenModalOpen
3426
+ })
3427
+ ]
3584
3428
  })
3585
3429
  ]
3586
3430
  });
3587
3431
  };
3588
- var $85f8ff1ff89899c7$export$2e2bcd8739ae039 = $85f8ff1ff89899c7$var$DataTableToolbar;
3432
+ var $71b4324f265dec16$export$2e2bcd8739ae039 = $71b4324f265dec16$var$DataTableControls;
3433
+
3434
+
3589
3435
 
3590
3436
 
3591
- const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sortTransform, tablePadding: tablePadding, canResize: canResize, loading: loading = false, isModal: isModal, closeFullScreenModal: closeFullScreenModal, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, setPage: setPage, showCopyLinkButton: showCopyLinkButton, showDownloadFilteredDataButton: showDownloadFilteredDataButton, showDownloadFullDataButton: showDownloadFullDataButton, showStoredQueryDownloadButton: showStoredQueryDownloadButton })=>{
3592
- const { id: id, resource: resource, datasetTableControls: datasetTableControls, dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
3593
- const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ee0d4d4f34048447$export$f814ea079e65d8fe));
3594
- const { conditions: conditions } = resource;
3437
+ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sortTransform, tablePadding: tablePadding, canResize: canResize, loading: loading = false, isModal: isModal, closeFullScreenModal: closeFullScreenModal })=>{
3438
+ const { id: id, resource: resource, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
3439
+ const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ebda441784d176a5$export$2e2bcd8739ae039));
3595
3440
  const data = resource.values;
3596
3441
  const [sorting, setSorting] = (0, $hgUW1$useState)([]);
3597
3442
  const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
@@ -3653,142 +3498,17 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
3653
3498
  ]);
3654
3499
  return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3655
3500
  children: [
3656
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3657
- className: "ds-u-margin-bottom--3",
3658
- children: showDownloadFullDataButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3659
- className: "dkan-data-table-download-full-dataset-button ds-u-fill--primary ds-u-color--white ds-u-text-align--center ds-u-padding-x--3 ds-u-margin-x--0 ds-u-margin-y--0",
3660
- href: unfilteredDownloadURL,
3661
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3662
- className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
3663
- children: [
3664
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3665
- className: "fas fa-file-csv"
3666
- }),
3667
- " Download full dataset (CSV)"
3668
- ]
3669
- })
3501
+ datasetTableControls && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3502
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $71b4324f265dec16$export$2e2bcd8739ae039), {
3503
+ id: id,
3504
+ columns: table.getAllLeafColumns(),
3505
+ defaultColumnOrder: defaultColumnOrder,
3506
+ isModal: isModal,
3507
+ closeFullScreenModal: closeFullScreenModal
3670
3508
  })
3671
3509
  }),
3672
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $85f8ff1ff89899c7$export$2e2bcd8739ae039), {
3673
- id: id,
3674
- columns: table.getAllLeafColumns(),
3675
- defaultColumnOrder: defaultColumnOrder,
3676
- isModal: isModal,
3677
- closeFullScreenModal: closeFullScreenModal,
3678
- resource: resource,
3679
- datasetTableControls: datasetTableControls,
3680
- columnVisibility: columnVisibility,
3681
- setColumnVisibility: setColumnVisibility
3682
- }),
3683
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3684
- 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",
3685
- children: [
3686
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3687
- className: "dkan-data-table-info-container ds-u-padding-right--0 ds-u-md-padding-right--4",
3688
- children: [
3689
- dataDictionaryBanner && !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3690
- className: "ds-u-margin-bottom--3",
3691
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
3692
- children: 'Click on the "Data Dictionary" tab above for full column definitions'
3693
- })
3694
- }),
3695
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3696
- className: "ds-u-margin--0",
3697
- 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."
3698
- })
3699
- ]
3700
- }),
3701
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3702
- 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",
3703
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
3704
- className: "dkan-data-table-share-button ds-u-display--flex ds-u-align-items--center ds-u-fill--primary ds-u-radius--pill ds-u-color--white ds-u-border--0 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",
3705
- activeClassName: "dkan-data-table-share-tooltip-open",
3706
- dialog: true,
3707
- offset: [
3708
- 0,
3709
- 5
3710
- ],
3711
- placement: "bottom-start",
3712
- maxWidth: "320px",
3713
- title: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3714
- className: "dc-c-resource-header--buttons ds-u-display--flex ds-u-flex-direction--column ds-l-col--12 ds-u-padding-x--0",
3715
- children: [
3716
- showCopyLinkButton && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
3717
- children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
3718
- onOpen: ()=>{
3719
- navigator.clipboard.writeText(window.location.href);
3720
- },
3721
- className: "dkan-data-table-download-button 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",
3722
- placement: "bottom",
3723
- dialog: true,
3724
- ariaLabel: "Copy link to filtered data",
3725
- title: "Link copied to clipboard",
3726
- "aria-disabled": !conditions || conditions.length === 0,
3727
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3728
- className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-margin-x--0 ds-u-padding--0",
3729
- children: [
3730
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3731
- className: "fas fa-copy"
3732
- }),
3733
- " Copy link to filtered data"
3734
- ]
3735
- })
3736
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3737
- "aria-disabled": true,
3738
- "aria-label": "Copy link to filtered data",
3739
- className: "dkan-data-table-download-button 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",
3740
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3741
- className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
3742
- children: [
3743
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3744
- className: "fas fa-copy"
3745
- }),
3746
- " Copy link to filtered data"
3747
- ]
3748
- })
3749
- })
3750
- }),
3751
- (showDownloadFilteredDataButton || showStoredQueryDownloadButton) && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3752
- className: "ds-l-col--12 ds-u-padding-x--0 ds-u-margin-x--0",
3753
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3754
- className: "dkan-data-table-download-button 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",
3755
- href: downloadURL,
3756
- "aria-disabled": !conditions || conditions.length === 0,
3757
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3758
- className: "ds-u-font-weight--normal ds-u-font-size--md ds-u-padding--0",
3759
- children: [
3760
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3761
- className: "fas fa-file-csv"
3762
- }),
3763
- " ",
3764
- showDownloadFilteredDataButton ? `Download filtered data (CSV)` : `Download stored query data (CSV)`
3765
- ]
3766
- })
3767
- })
3768
- })
3769
- ]
3770
- }),
3771
- children: [
3772
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3773
- className: "far fa-share-alt"
3774
- }),
3775
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3776
- className: "ds-u-margin-x--05",
3777
- children: "Share"
3778
- }),
3779
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3780
- className: "fa fa-chevron-down"
3781
- }),
3782
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3783
- className: "fa fa-chevron-up"
3784
- })
3785
- ]
3786
- })
3787
- })
3788
- ]
3789
- }),
3790
3510
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3791
- className: "dc-c-datatable-wrapper ds-u-border-x--1 ds-u-border-bottom--1",
3511
+ className: "dc-c-datatable-wrapper",
3792
3512
  tabIndex: 0,
3793
3513
  ref: dataTableWrapperElement,
3794
3514
  children: [
@@ -4218,46 +3938,6 @@ var $026cb986f9fea2b1$export$2e2bcd8739ae039 = $026cb986f9fea2b1$var$PageNotFoun
4218
3938
 
4219
3939
 
4220
3940
 
4221
-
4222
- const $e011250e8a3bd5e5$var$SearchFacets = (props)=>{
4223
- const { facets: facets, title: title, onClickFunction: onClickFunction, selectedFacets: selectedFacets = [] } = props;
4224
- const filteredFacets = facets.filter((f)=>{
4225
- return Number(f.total) > 0 || selectedFacets.findIndex((i)=>i === f.name) !== -1;
4226
- });
4227
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4228
- className: "dkan-dataset-search--facet-container ds-u-margin-bottom--4",
4229
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
4230
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
4231
- contentClassName: "ds-u-padding-left--1 ds-u-padding-right--0",
4232
- heading: title,
4233
- defaultOpen: true,
4234
- children: !filteredFacets.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4235
- className: "ds-text-heading--md",
4236
- children: "No matching facets found."
4237
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
4238
- children: filteredFacets.map((f)=>{
4239
- return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
4240
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
4241
- className: "ds-u-margin-y--1",
4242
- checked: selectedFacets.findIndex((s)=>s === f.name) > -1 ? true : false,
4243
- name: `facet_theme_${f.name}`,
4244
- type: "checkbox",
4245
- label: `${f.name} (${f.total})`,
4246
- value: f.name,
4247
- onClick: ()=>onClickFunction(f.type, f.name)
4248
- })
4249
- }, f.name);
4250
- })
4251
- })
4252
- })
4253
- })
4254
- });
4255
- };
4256
- var $e011250e8a3bd5e5$export$2e2bcd8739ae039 = $e011250e8a3bd5e5$var$SearchFacets;
4257
-
4258
-
4259
-
4260
-
4261
3941
  const $3b2d31a9c6cd2284$var$LargeFileInfo = (props)=>/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4262
3942
  className: props.className,
4263
3943
  children: [
@@ -6218,9 +5898,32 @@ var $6012b86ffcaf3f71$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
6218
5898
 
6219
5899
 
6220
5900
 
6221
- const $39bc4d98030a5599$var$DataTableStateWrapper = ({ showCopyLinkButton: showCopyLinkButton = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
6222
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee0d4d4f34048447$export$2e2bcd8739ae039), {
5901
+
5902
+ const $39bc4d98030a5599$var$DataTableStateWrapper = ({ showQueryBuilder: showQueryBuilder = true, showCopyLinkButton: showCopyLinkButton = true, showDownloadFilteredDataButton: showDownloadFilteredDataButton = true, showDownloadFullDataButton: showDownloadFullDataButton = true, showStoredQueryDownloadButton: showStoredQueryDownloadButton = false })=>{
5903
+ const { id: id, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
5904
+ // a wrapper component to keep column state synced between full screen and regular modes
5905
+ const localStorageData = id ? JSON.parse(localStorage.getItem(id)) : null;
5906
+ const defaultPage = 1;
5907
+ const [page, setPage] = (0, $hgUW1$useState)(defaultPage);
5908
+ const [columnOrder, setColumnOrder] = (0, $hgUW1$useState)(()=>{
5909
+ if (datasetTableControls && localStorageData) return localStorageData.tableColumnOrder;
5910
+ else return [];
5911
+ });
5912
+ const [columnVisibility, setColumnVisibility] = (0, $hgUW1$useState)(()=>{
5913
+ if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
5914
+ else return {};
5915
+ });
5916
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ebda441784d176a5$export$2e2bcd8739ae039).Provider, {
5917
+ value: {
5918
+ columnOrder: columnOrder,
5919
+ setColumnOrder: setColumnOrder,
5920
+ columnVisibility: columnVisibility,
5921
+ setColumnVisibility: setColumnVisibility,
5922
+ page: page,
5923
+ setPage: setPage
5924
+ },
6223
5925
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
5926
+ showQueryBuilder: showQueryBuilder,
6224
5927
  showCopyLinkButton: showCopyLinkButton,
6225
5928
  showDownloadFilteredDataButton: showDownloadFilteredDataButton,
6226
5929
  showDownloadFullDataButton: showDownloadFullDataButton,
@@ -7318,6 +7021,7 @@ function $8b67b7ee3fcfb629$export$2e2bcd8739ae039({ id: id, rootUrl: rootUrl, cu
7318
7021
  datasetTableControls: !disableTableControls
7319
7022
  },
7320
7023
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $39bc4d98030a5599$export$2e2bcd8739ae039), {
7024
+ showQueryBuilder: false,
7321
7025
  showCopyLinkButton: false,
7322
7026
  showDownloadFilteredDataButton: false,
7323
7027
  showDownloadFullDataButton: false,
@@ -7467,78 +7171,6 @@ var $374c4669b044ddf8$export$2e2bcd8739ae039 = $374c4669b044ddf8$var$QueryRow;
7467
7171
 
7468
7172
 
7469
7173
 
7470
-
7471
- const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions, schema: schema, customColumns: customColumns })=>{
7472
- const { fields: fields } = schema;
7473
- const prependedMessage = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
7474
- children: "Data filters: "
7475
- });
7476
- if (!conditions || !conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
7477
- className: "ds-u-margin-y--0",
7478
- children: [
7479
- prependedMessage,
7480
- " none"
7481
- ]
7482
- });
7483
- function formatValue(text, property) {
7484
- if (customColumns && customColumns.length > 0) {
7485
- let newValue = text;
7486
- let customColumn = customColumns.find((c)=>c.accessor === property);
7487
- if (customColumn && customColumn.cell) return customColumn.cell({
7488
- value: text
7489
- });
7490
- return text;
7491
- } else return text;
7492
- }
7493
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
7494
- className: "dc-querybuilder-title",
7495
- children: [
7496
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
7497
- className: "ds-u-margin-y--0",
7498
- children: prependedMessage
7499
- }),
7500
- conditions.map((c)=>{
7501
- const field = fields[c.property];
7502
- const description = field && field.description ? field.description : c.property;
7503
- const operator = (0, $7264a673914aa746$export$5f89a5ae87bc48e1).find((op)=>op.value === c.operator);
7504
- const cleanedText = (0, $7264a673914aa746$export$6b5e57d20078142b)(c.value);
7505
- const formattedText = formatValue(cleanedText, c.property);
7506
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
7507
- className: "ds-u-fill--background ds-u-padding--1 ds-u-margin-y--1 ds-u-display--inline-block ds-u-font-weight--semibold",
7508
- children: [
7509
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
7510
- className: "ds-u-font-weight--bold",
7511
- children: description
7512
- }),
7513
- " ",
7514
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
7515
- className: "ds-u-font-weight--normal",
7516
- children: operator.label.toUpperCase()
7517
- }),
7518
- " ",
7519
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
7520
- className: "ds-u-color--success",
7521
- children: formattedText
7522
- })
7523
- ]
7524
- });
7525
- }).reduce((prev, curr)=>[
7526
- prev,
7527
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Badge), {
7528
- className: "ds-u-margin-x--1",
7529
- variation: "info",
7530
- children: "AND"
7531
- }),
7532
- curr
7533
- ])
7534
- ]
7535
- });
7536
- };
7537
- var $bef7bff2823feea2$export$2e2bcd8739ae039 = $bef7bff2823feea2$var$QueryTitle;
7538
-
7539
-
7540
-
7541
-
7542
7174
  function $3b6ca952e79f0695$var$updateQueryForDatastore(condition) {
7543
7175
  let cond = condition;
7544
7176
  delete cond.key;
@@ -8054,5 +7686,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
8054
7686
 
8055
7687
 
8056
7688
 
8057
- 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, $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};
7689
+ 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, $ebda441784d176a5$export$2e2bcd8739ae039 as ManageColumnsContext, $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};
8058
7690
  //# sourceMappingURL=main.js.map