@civicactions/cmsds-open-data-components 3.6.0-rc.1 → 3.6.0-rc.3

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,8 +1,8 @@
1
1
  import "./main.css";
2
2
  import {jsxs as $hgUW1$jsxs, jsx as $hgUW1$jsx, Fragment as $hgUW1$Fragment} from "react/jsx-runtime";
3
- import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, useMemo as $hgUW1$useMemo} from "react";
3
+ import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, useMemo as $hgUW1$useMemo, useContext as $hgUW1$useContext, useCallback as $hgUW1$useCallback} from "react";
4
4
  import {NavLink as $hgUW1$NavLink, useNavigate as $hgUW1$useNavigate, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams, Link as $hgUW1$Link} from "react-router-dom";
5
- import {Button as $hgUW1$Button, Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Choice as $hgUW1$Choice, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Tooltip as $hgUW1$Tooltip, Badge as $hgUW1$Badge, Table as $hgUW1$Table, TableBody as $hgUW1$TableBody, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableHead as $hgUW1$TableHead, TooltipIcon as $hgUW1$TooltipIcon} from "@cmsgov/design-system";
5
+ import {Button as $hgUW1$Button, Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Choice as $hgUW1$Choice, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Table as $hgUW1$Table, TableBody as $hgUW1$TableBody, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableHead as $hgUW1$TableHead, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
6
6
  import {useMediaQuery as $hgUW1$useMediaQuery} from "react-responsive";
7
7
  import $hgUW1$qs from "qs";
8
8
  import $hgUW1$swaggeruireact from "swagger-ui-react";
@@ -12,7 +12,11 @@ import {useQuery as $hgUW1$useQuery, QueryClient as $hgUW1$QueryClient, QueryCli
12
12
  import $hgUW1$dompurify from "dompurify";
13
13
  import $hgUW1$lodashtruncate from "lodash.truncate";
14
14
  import $hgUW1$proptypes from "prop-types";
15
- import {createColumnHelper as $hgUW1$createColumnHelper, useReactTable as $hgUW1$useReactTable, getCoreRowModel as $hgUW1$getCoreRowModel, getSortedRowModel as $hgUW1$getSortedRowModel, flexRender as $hgUW1$flexRender, getFilteredRowModel as $hgUW1$getFilteredRowModel, getPaginationRowModel as $hgUW1$getPaginationRowModel} from "@tanstack/react-table";
15
+ import {createColumnHelper as $hgUW1$createColumnHelper, useReactTable as $hgUW1$useReactTable, getCoreRowModel as $hgUW1$getCoreRowModel, getFilteredRowModel as $hgUW1$getFilteredRowModel, getPaginationRowModel as $hgUW1$getPaginationRowModel, getSortedRowModel as $hgUW1$getSortedRowModel, flexRender as $hgUW1$flexRender} from "@tanstack/react-table";
16
+ import {KeyboardSensor as $hgUW1$KeyboardSensor, PointerSensor as $hgUW1$PointerSensor, useSensors as $hgUW1$useSensors, useSensor as $hgUW1$useSensor, DndContext as $hgUW1$DndContext, closestCenter as $hgUW1$closestCenter} from "@dnd-kit/core";
17
+ import {sortableKeyboardCoordinates as $hgUW1$sortableKeyboardCoordinates, arrayMove as $hgUW1$arrayMove, SortableContext as $hgUW1$SortableContext, verticalListSortingStrategy as $hgUW1$verticalListSortingStrategy, useSortable as $hgUW1$useSortable} from "@dnd-kit/sortable";
18
+ import {restrictToVerticalAxis as $hgUW1$restrictToVerticalAxis} from "@dnd-kit/modifiers";
19
+ import {CSS as $hgUW1$CSS} from "@dnd-kit/utilities";
16
20
  import $hgUW1$reactdatepicker from "react-datepicker";
17
21
  import "react-datepicker/dist/react-datepicker.css";
18
22
  import {usePopper as $hgUW1$usePopper} from "react-popper";
@@ -676,7 +680,7 @@ var $b0968edc60d7d3a4$export$2e2bcd8739ae039 = $b0968edc60d7d3a4$var$SidebarPage
676
680
 
677
681
 
678
682
 
679
- const $c96c4b9ef7203c1f$var$APIPage = ({ hideAuth: hideAuth, additionalParams: additionalParams, rootUrl: rootUrl })=>{
683
+ const $c96c4b9ef7203c1f$var$APIPage = ({ hideAuth: hideAuth = true, additionalParams: additionalParams, rootUrl: rootUrl })=>{
680
684
  const hasACA = additionalParams && additionalParams.ACA ? true : false;
681
685
  let params = {
682
686
  authentication: hideAuth ? false : undefined,
@@ -694,9 +698,6 @@ const $c96c4b9ef7203c1f$var$APIPage = ({ hideAuth: hideAuth, additionalParams: a
694
698
  })
695
699
  });
696
700
  };
697
- $c96c4b9ef7203c1f$var$APIPage.defaultProps = {
698
- hideAuth: true
699
- };
700
701
  var $c96c4b9ef7203c1f$export$2e2bcd8739ae039 = $c96c4b9ef7203c1f$var$APIPage;
701
702
 
702
703
 
@@ -759,7 +760,13 @@ var $026cb986f9fea2b1$export$2e2bcd8739ae039 = $026cb986f9fea2b1$var$PageNotFoun
759
760
 
760
761
 
761
762
 
762
- const $61ff88fb3f6ee2c8$var$queryClient = new (0, $hgUW1$QueryClient)();
763
+ const $61ff88fb3f6ee2c8$var$queryClient = new (0, $hgUW1$QueryClient)({
764
+ defaultOptions: {
765
+ queries: {
766
+ refetchOnWindowFocus: false
767
+ }
768
+ }
769
+ });
763
770
  const $61ff88fb3f6ee2c8$var$withQueryProvider = (WrappedComponent)=>(props)=>{
764
771
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$QueryClientProvider), {
765
772
  client: $61ff88fb3f6ee2c8$var$queryClient,
@@ -1009,7 +1016,12 @@ var $b38839fd67928f42$export$2e2bcd8739ae039 = $b38839fd67928f42$var$SearchItemI
1009
1016
 
1010
1017
 
1011
1018
 
1012
- const $bd76a91923d7e8a7$var$TransformedDate = ({ date: date, options: options })=>{
1019
+ const $bd76a91923d7e8a7$var$TransformedDate = ({ date: date, options: options = {
1020
+ year: "numeric",
1021
+ month: "long",
1022
+ day: "numeric",
1023
+ timeZone: "UTC"
1024
+ } })=>{
1013
1025
  const rawDate = new Date(date);
1014
1026
  let modifiedDate = "";
1015
1027
  if (rawDate) modifiedDate = rawDate.toLocaleDateString("en-US", options);
@@ -1017,14 +1029,6 @@ const $bd76a91923d7e8a7$var$TransformedDate = ({ date: date, options: options })
1017
1029
  children: modifiedDate
1018
1030
  });
1019
1031
  };
1020
- $bd76a91923d7e8a7$var$TransformedDate.defaultProps = {
1021
- options: {
1022
- year: "numeric",
1023
- month: "long",
1024
- day: "numeric",
1025
- timeZone: "UTC"
1026
- }
1027
- };
1028
1032
  var $bd76a91923d7e8a7$export$2e2bcd8739ae039 = $bd76a91923d7e8a7$var$TransformedDate;
1029
1033
 
1030
1034
 
@@ -1363,7 +1367,10 @@ async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, addit
1363
1367
 
1364
1368
 
1365
1369
  const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
1366
- const { rootUrl: rootUrl, surveyLink: surveyLink, additionalParams: additionalParams, enableSort: enableSort, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort, pageTitle: pageTitle, filterTitle: filterTitle, showLargeFileWarning: showLargeFileWarning, largeFileThemes: largeFileThemes, introText: introText, showDownloadIcon: showDownloadIcon, altMobileSearchButton: altMobileSearchButton } = props;
1370
+ const { rootUrl: rootUrl, surveyLink: surveyLink, additionalParams: additionalParams, enableSort: enableSort = true, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort = {
1371
+ defaultSort: "modified",
1372
+ defaultOrder: "desc"
1373
+ }, pageTitle: pageTitle = "Dataset Explorer", filterTitle: filterTitle = "Tags", showLargeFileWarning: showLargeFileWarning = false, largeFileThemes: largeFileThemes, introText: introText = "", showDownloadIcon: showDownloadIcon = false, altMobileSearchButton: altMobileSearchButton } = props;
1367
1374
  const sortOptions = [
1368
1375
  {
1369
1376
  label: "Newest",
@@ -1467,7 +1474,7 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
1467
1474
  page
1468
1475
  ]);
1469
1476
  (0, $hgUW1$useEffect)(()=>{
1470
- setPage(1);
1477
+ if (page !== 1 && (transformedParams.fulltext !== fulltext || transformedParams.selectedFacets !== selectedFacets)) setPage(1);
1471
1478
  }, [
1472
1479
  fulltext,
1473
1480
  selectedFacets
@@ -1709,40 +1716,6 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
1709
1716
  ]
1710
1717
  });
1711
1718
  };
1712
- $e873081a6e8f024e$var$DatasetSearch.defaultProps = {
1713
- pageTitle: "Dataset Explorer",
1714
- introText: "",
1715
- fulltextLabel: "Search term",
1716
- fulltextLabelClassName: "ds-u-visibility--screen-reader",
1717
- fulltextPlaceholder: "Search datasets",
1718
- filterTitle: "Tags",
1719
- formClassName: "ds-u-display--flex ds-u-justify-content--between ds-u-margin-bottom--2",
1720
- enableSort: true,
1721
- sortOptions: [
1722
- {
1723
- label: "Newest",
1724
- value: "newest"
1725
- },
1726
- {
1727
- label: "Oldest",
1728
- value: "oldest"
1729
- },
1730
- {
1731
- label: "Title A-Z",
1732
- value: "titleAZ"
1733
- },
1734
- {
1735
- label: "Title Z-A",
1736
- value: "titleZA"
1737
- }
1738
- ],
1739
- defaultSort: {
1740
- defaultSort: "modified",
1741
- defaultOrder: "desc"
1742
- },
1743
- showLargeFileWarning: false,
1744
- showDownloadIcon: false
1745
- };
1746
1719
  var $e873081a6e8f024e$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($e873081a6e8f024e$var$DatasetSearch);
1747
1720
 
1748
1721
 
@@ -2128,395 +2101,329 @@ const $6da0396069e23175$export$bc27cf7ecf44639d = {
2128
2101
 
2129
2102
 
2130
2103
 
2131
-
2132
-
2133
-
2134
-
2135
-
2136
- const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: header, sortElement: sortElement, setAriaLiveFeedback: setAriaLiveFeedback })=>{
2137
- const [columnResizing, setColumnResizing] = (0, $hgUW1$useState)("");
2138
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("th", {
2139
- key: header.id,
2140
- style: {
2141
- width: header.getSize()
2142
- },
2143
- className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
2104
+ function $5644ebd2c3dbfd7b$export$eea3a12df15499ca(metadataMapping, datasetInfo) {
2105
+ const rows = [];
2106
+ Object.keys(metadataMapping).forEach((d)=>{
2107
+ if (!datasetInfo[d]) return null;
2108
+ else rows.push(...metadataMapping[d](datasetInfo[d]));
2109
+ });
2110
+ return rows;
2111
+ }
2112
+ const $5644ebd2c3dbfd7b$var$DatasetAdditionalInformation = ({ datasetInfo: datasetInfo, id: id, metadataMapping: metadataMapping })=>{
2113
+ const rows = $5644ebd2c3dbfd7b$export$eea3a12df15499ca(metadataMapping, datasetInfo);
2114
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2115
+ className: "dc-c-additional-info-table ds-u-margin-bottom--6",
2144
2116
  children: [
2145
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2146
- className: "ds-u-display--flex",
2117
+ /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
2118
+ className: "ds-text-heading--2xl ds-u-margin-y--3",
2119
+ children: "Additional Information"
2120
+ }),
2121
+ /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
2122
+ compact: true,
2123
+ striped: true,
2147
2124
  children: [
2148
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2149
- style: {
2150
- maxWidth: header.getSize() - 16
2151
- },
2152
- title: header.column.columnDef.header,
2153
- children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
2125
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableHead), {
2126
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
2127
+ children: [
2128
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2129
+ children: "Field"
2130
+ }),
2131
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2132
+ children: "Value"
2133
+ })
2134
+ ]
2135
+ })
2154
2136
  }),
2155
- sortElement && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
2156
- onClick: header.column.getToggleSortingHandler(),
2157
- className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : "",
2158
- "aria-label": `${header.column.columnDef.header} sort order`
2137
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableBody), {
2138
+ children: rows.map((r)=>/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
2139
+ children: [
2140
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2141
+ children: r.label
2142
+ }),
2143
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2144
+ className: "ds-u-word-break-anywhere",
2145
+ children: r.value
2146
+ })
2147
+ ]
2148
+ }, `${r.label}_${id}`))
2159
2149
  })
2160
2150
  ]
2161
- }),
2162
- /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
2163
- onMouseDown: header.getResizeHandler(),
2164
- onTouchStart: header.getResizeHandler(),
2165
- className: `dc-c-resize-handle ds-u-focus-visible ${header.column.getIsResizing() || header.column.id == columnResizing ? "isResizing" : ""}`,
2166
- "aria-label": `Resize ${header.column.columnDef.header} column`,
2167
- onKeyDown: (e)=>{
2168
- const columnSizingObject = table.getState().columnSizing;
2169
- switch(e.key){
2170
- case "Enter":
2171
- case " ":
2172
- e.preventDefault();
2173
- e.stopPropagation();
2174
- if (columnResizing) {
2175
- // end resizing
2176
- setColumnResizing("");
2177
- setAriaLiveFeedback(`${header.column.columnDef.header} dropped.`);
2178
- } else {
2179
- // start resizing
2180
- setColumnResizing(header.column.id);
2181
- setAriaLiveFeedback(`${header.column.columnDef.header} grabbed.`);
2182
- }
2183
- break;
2184
- case "Escape":
2185
- if (columnResizing) {
2186
- setColumnResizing("");
2187
- setAriaLiveFeedback(`${header.column.columnDef.header} dropped.`);
2188
- }
2189
- break;
2190
- case "ArrowRight":
2191
- e.preventDefault();
2192
- e.stopPropagation();
2193
- if (columnResizing) {
2194
- columnSizingObject[header.column.id] = header.getSize() + 10;
2195
- table.setColumnSizing(columnSizingObject);
2196
- setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
2197
- }
2198
- break;
2199
- case "ArrowLeft":
2200
- e.preventDefault();
2201
- e.stopPropagation();
2202
- if (columnResizing) {
2203
- columnSizingObject[header.column.id] = header.getSize() - 10;
2204
- table.setColumnSizing(columnSizingObject);
2205
- setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
2206
- }
2207
- break;
2208
- }
2209
- },
2210
- onBlur: ()=>{
2211
- setColumnResizing("");
2212
- }
2213
2151
  })
2214
2152
  ]
2215
2153
  });
2216
2154
  };
2217
- var $64a351d3fd8413c3$export$2e2bcd8739ae039 = $64a351d3fd8413c3$var$HeaderResizeElement;
2155
+ var $5644ebd2c3dbfd7b$export$2e2bcd8739ae039 = $5644ebd2c3dbfd7b$var$DatasetAdditionalInformation;
2218
2156
 
2219
2157
 
2220
- const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement = null, setAriaLiveFeedback: setAriaLiveFeedback })=>{
2221
- return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
2222
- className: "dc-thead--truncated dc-thead--resizeable",
2223
- children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
2224
- className: "dc-c-sticky-header",
2225
- children: headerGroup.headers.map((header)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
2226
- table: table,
2227
- header: header,
2228
- sortElement: sortElement,
2229
- setAriaLiveFeedback: setAriaLiveFeedback
2230
- }, header.id + "_dataTableResize"))
2231
- }, headerGroup.id))
2232
- });
2233
- };
2234
- var $96d341d082bffec5$export$2e2bcd8739ae039 = $96d341d082bffec5$var$TruncatedResizeableTHead;
2235
2158
 
2236
2159
 
2237
2160
 
2238
2161
 
2239
2162
 
2240
- const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table, sortElement: sortElement })=>{
2241
- return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
2242
- className: "dc-thead--fixed-size",
2243
- children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
2244
- children: headerGroup.headers.map((header)=>{
2245
- return /*#__PURE__*/ (0, $hgUW1$jsx)("th", {
2246
- key: header.id,
2247
- style: {
2248
- width: header.getSize()
2249
- },
2250
- title: header.column.columnDef.header,
2251
- className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
2163
+
2164
+
2165
+ const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
2166
+ const { count: count, columns: columns } = resource;
2167
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2168
+ className: "dc-c-resource-info-table ds-l-col--12 ds-u-padding-left--0 ds-u-margin-y--2",
2169
+ children: [
2170
+ /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
2171
+ className: "ds-u-font-size--base ds-text-heading--xl ds-text-heading--xl",
2172
+ children: "About this Resource"
2173
+ }),
2174
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2175
+ className: "ds-u-display--flex ds-u-text-align--center ds-u-justify-content--center ds-u-md-justify-content--start",
2176
+ children: [
2177
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2178
+ className: "ds-u-fill--gray-lightest ds-u-radius ds-u-margin-right--1 ds-u-padding--2",
2179
+ children: [
2180
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2181
+ className: "ds-u-padding-top--05",
2182
+ children: "Rows"
2183
+ }),
2184
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2185
+ className: "ds-u-font-weight--bold",
2186
+ children: count ? count.toLocaleString() : ""
2187
+ })
2188
+ ]
2189
+ }),
2190
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2191
+ className: "ds-u-fill--gray-lightest ds-u-radius ds-u-margin-right--1 ds-u-padding--2",
2252
2192
  children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2253
- onClick: header.column.getToggleSortingHandler(),
2254
- className: "ds-u-display--flex",
2255
2193
  children: [
2256
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2257
- children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
2194
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2195
+ className: "ds-u-padding-top--05",
2196
+ children: "Columns"
2258
2197
  }),
2259
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2260
- className: header.column.getCanSort() ? `cursor-pointer select-none ${sortElement(header.column.getIsSorted())}` : ""
2198
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2199
+ className: "ds-u-font-weight--bold",
2200
+ children: columns.length.toLocaleString()
2261
2201
  })
2262
2202
  ]
2263
2203
  })
2264
- });
2265
- })
2266
- }, headerGroup.id))
2204
+ })
2205
+ ]
2206
+ })
2207
+ ]
2267
2208
  });
2268
2209
  };
2269
- var $23763e27eda0e8d7$export$2e2bcd8739ae039 = $23763e27eda0e8d7$var$FixedSizeTHead;
2210
+ var $0958733ee130fc44$export$2e2bcd8739ae039 = $0958733ee130fc44$var$ResourceInformation;
2270
2211
 
2271
2212
 
2213
+ function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
2214
+ if (dist && dist.data) {
2215
+ if (dist.data.format) return dist.data.format.toLowerCase();
2216
+ if (dist.data.mediaType) {
2217
+ const mediaType = dist.data.mediaType.split("/");
2218
+ if (mediaType.length && mediaType[1]) return mediaType[1].toLowerCase();
2219
+ }
2220
+ if (dist.data["%Ref:downloadURL"].length && dist.data["%Ref:downloadURL"][0].data) {
2221
+ if (dist.data["%Ref:downloadURL"][0].data.mimeType) {
2222
+ const mimeType = dist.data["%Ref:downloadURL"][0].data.mimeType.split("/");
2223
+ if (mimeType.length && mimeType[1]) return mimeType[1].toLowerCase();
2224
+ }
2225
+ }
2226
+ }
2227
+ return "";
2228
+ }
2272
2229
 
2273
- const $d98f94c79ddf4e0e$var$DataTable = ({ data: data, columns: columns, setSort: setSort, sortTransform: sortTransform, tablePadding: tablePadding, canResize: canResize, loading: loading = false })=>{
2274
- const [sorting, setSorting] = (0, $hgUW1$react).useState([]);
2275
- const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
2276
- const columnHelper = (0, $hgUW1$createColumnHelper)();
2277
- const table_columns = columns.map((col)=>{
2278
- if (col.cell) return columnHelper.accessor(col.accessor, {
2279
- header: col.header,
2280
- cell: col.cell
2281
- });
2282
- return columnHelper.accessor(col.accessor, {
2283
- header: col.header
2284
- });
2230
+
2231
+
2232
+ const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource: resource, title: title })=>{
2233
+ const sm = (0, $hgUW1$useMediaQuery)({
2234
+ minWidth: 0,
2235
+ maxWidth: 767
2285
2236
  });
2286
- const sortElement = (isSorted, onClickFn)=>{
2287
- if (isSorted === "asc") return "dc-c-sort--asc";
2288
- if (isSorted === "desc") return "dc-c-sort--desc";
2289
- return "dc-c-sort--default";
2290
- };
2291
- const filters = [];
2292
- const table = (0, $hgUW1$useReactTable)({
2293
- data: data,
2294
- columns: table_columns,
2295
- manualSorting: true,
2296
- state: {
2297
- sorting: sorting
2298
- },
2299
- columnResizeMode: "onChange",
2300
- onSortingChange: setSorting,
2301
- getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
2302
- getSortedRowModel: (0, $hgUW1$getSortedRowModel)(),
2303
- debugTable: false
2237
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2238
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap",
2239
+ children: [
2240
+ /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
2241
+ className: "ds-l-col--12 ds-u-padding-left--0 ds-text-heading--2xl",
2242
+ children: "Resources"
2243
+ }),
2244
+ distributions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
2245
+ className: "ds-c-list ds-c-list--bare dc-c-resource-full-width",
2246
+ children: distributions.map((dist)=>{
2247
+ const fileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(dist);
2248
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
2249
+ className: `ds-u-display--flex ds-u-flex-wrap--wrap ${fileFormat !== "csv" && "ds-u-margin-bottom--2"}`,
2250
+ children: [
2251
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2252
+ className: "ds-u-font-weight--bold ds-u-font-size--lg ds-l-col--12 ds-l-md-col--6 ds-u-padding-left--0 ds-u-align-items--center ds-u-display--flex",
2253
+ children: [
2254
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2255
+ className: "fa ds-u-color--primary ds-u-padding-right--1 ds-u-font-size--3xl fa-file-" + (fileFormat == "xlsx" ? "xls" : fileFormat)
2256
+ }),
2257
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
2258
+ className: "ds-u-margin-top--0",
2259
+ children: [
2260
+ dist.data.title ? dist.data.title : title,
2261
+ " (" + fileFormat.toUpperCase() + ")"
2262
+ ]
2263
+ })
2264
+ ]
2265
+ }),
2266
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2267
+ className: "ds-l-col--12 ds-l-md-col--6 ds-u-text-align--center ds-u-md-text-align--right ds-u-margin-top--2 ds-u-md-margin-top--0",
2268
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
2269
+ href: dist.data.downloadURL,
2270
+ style: {
2271
+ order: sm ? "1" : "0",
2272
+ width: sm ? "100%" : "auto"
2273
+ },
2274
+ "aria-label": `Download ${dist.data.title || title} ${fileFormat}`,
2275
+ className: "ds-c-button",
2276
+ children: [
2277
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2278
+ className: "fa fa-file-download ds-u-color--primary ds-u-padding-right--1"
2279
+ }),
2280
+ "Download"
2281
+ ]
2282
+ })
2283
+ }),
2284
+ dist.data.description && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2285
+ className: "ds-u-measure--wide ds-u-margin-bottom--7",
2286
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2287
+ className: "dc-c-metadata-description ds-u-margin--0",
2288
+ dangerouslySetInnerHTML: {
2289
+ __html: (0, $hgUW1$dompurify).sanitize(dist.data.description)
2290
+ }
2291
+ })
2292
+ }),
2293
+ fileFormat === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $0958733ee130fc44$export$2e2bcd8739ae039), {
2294
+ resource: resource
2295
+ })
2296
+ ]
2297
+ }, dist.identifier);
2298
+ })
2299
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2300
+ className: "ds-u-margin-bottom--2",
2301
+ children: "No resources have been added to this dataset."
2302
+ })
2303
+ ]
2304
2304
  });
2305
- (0, $hgUW1$react).useEffect(()=>{
2306
- const normalizedSort = sortTransform ? sortTransform(sorting) : filters;
2307
- setSort(normalizedSort);
2308
- }, [
2309
- sorting
2310
- ]);
2305
+ };
2306
+ var $7357cc0f79f9c514$export$2e2bcd8739ae039 = $7357cc0f79f9c514$var$Resource;
2307
+
2308
+
2309
+ const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset, resource: resource, distributions: distributions, metadataMapping: metadataMapping })=>{
2310
+ const md = (0, $hgUW1$useMediaQuery)({
2311
+ minWidth: 0,
2312
+ maxWidth: 768
2313
+ });
2314
+ const rows = (0, $5644ebd2c3dbfd7b$export$eea3a12df15499ca)(metadataMapping, dataset);
2311
2315
  return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
2312
2316
  children: [
2317
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $7357cc0f79f9c514$export$2e2bcd8739ae039), {
2318
+ distributions: distributions,
2319
+ resource: resource,
2320
+ title: dataset.title
2321
+ }),
2313
2322
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2314
- className: "dc-c-datatable-wrapper",
2315
- tabIndex: 0,
2323
+ className: "dc-c-additional-info-table ds-u-margin-bottom--6 ds-u-padding-left--0 ds-l-lg-col--7 ds-l-md-col--9 ds-l-col--12",
2316
2324
  children: [
2317
- /*#__PURE__*/ (0, $hgUW1$jsxs)("table", {
2318
- style: {
2319
- width: canResize ? table.getCenterTotalSize() : "100%"
2320
- },
2321
- className: "dc-c-datatable",
2325
+ /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
2326
+ className: "ds-text-heading--2xl ds-text-heading--2xl",
2327
+ children: "Additional Information"
2328
+ }),
2329
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Table), {
2330
+ compact: true,
2331
+ stackable: true,
2332
+ stackableBreakpoint: "md",
2333
+ warningDisabled: true,
2334
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableBody), {
2335
+ children: rows.map((r)=>/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
2336
+ children: [
2337
+ md ? "" : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2338
+ component: "th",
2339
+ className: "ds-u-font-weight--bold",
2340
+ children: r.label
2341
+ }),
2342
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2343
+ stackedTitle: r.label,
2344
+ children: r.value
2345
+ })
2346
+ ]
2347
+ }, `${r.label}_${dataset.identifier}`))
2348
+ })
2349
+ })
2350
+ ]
2351
+ })
2352
+ ]
2353
+ });
2354
+ };
2355
+ var $364dc44850cd8f7f$export$2e2bcd8739ae039 = $364dc44850cd8f7f$var$DatasetOverview;
2356
+
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+
2365
+ const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
2366
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2367
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
2368
+ url: endpoint
2369
+ })
2370
+ });
2371
+ };
2372
+ var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
2373
+
2374
+
2375
+ const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id, rootUrl: rootUrl, apiUrl: apiUrl, additionalParams: additionalParams })=>{
2376
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
2377
+ children: [
2378
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2379
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap",
2380
+ children: [
2381
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2382
+ className: "ds-l-col--12 ds-l-md-col--9 ds-u-padding-left--0",
2322
2383
  children: [
2323
- canResize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $96d341d082bffec5$export$2e2bcd8739ae039), {
2324
- table: table,
2325
- sortElement: sortElement,
2326
- setAriaLiveFeedback: setAriaLiveFeedback
2327
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $23763e27eda0e8d7$export$2e2bcd8739ae039), {
2328
- table: table,
2329
- sortElement: sortElement
2384
+ /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
2385
+ className: "ds-text-heading--2xl",
2386
+ children: "Try the API"
2330
2387
  }),
2331
- loading ? /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {}) : /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {
2332
- children: table.getRowModel().rows.map((row, index)=>{
2333
- const even = (index + 1) % 2 === 0;
2334
- return /*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
2335
- className: `${even ? "dc-c-datatable--even-row" : ""}`,
2336
- children: row.getVisibleCells().map((cell)=>{
2337
- let classList = "dc-truncate ds-u-padding-x--1";
2338
- return /*#__PURE__*/ (0, $hgUW1$jsx)("td", {
2339
- key: cell.id,
2340
- style: {
2341
- maxWidth: cell.column.getSize()
2342
- },
2343
- className: `${classList} ${tablePadding}`,
2344
- title: cell.getValue(),
2345
- children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
2346
- });
2347
- })
2348
- }, row.id);
2349
- })
2388
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2389
+ children: "The Open Data API (ODA) provides programmatic access to this dataset including the ability to filter, query, and aggregate data."
2350
2390
  })
2351
2391
  ]
2352
2392
  }),
2353
2393
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2354
- className: "sr-only",
2355
- "aria-live": "assertive",
2356
- "aria-atomic": "true",
2357
- children: ariaLiveFeedback
2394
+ className: "ds-l-col--12 ds-l-md-col--3 ds-u-font-weight--bold ds-u-margin-top--2 ds-u-padding-left--0 ds-u-md-padding-left--2",
2395
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
2396
+ href: apiUrl,
2397
+ children: [
2398
+ "View API",
2399
+ " ",
2400
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2401
+ style: {
2402
+ whiteSpace: "nowrap"
2403
+ },
2404
+ children: [
2405
+ "specification ",
2406
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2407
+ className: "fa fa-arrow-right ds-u-font-weight--bold"
2408
+ })
2409
+ ]
2410
+ })
2411
+ ]
2412
+ })
2358
2413
  })
2359
2414
  ]
2360
2415
  }),
2361
- loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
2362
- "aria-valuetext": "Dataset loading",
2363
- role: "status",
2364
- className: "ds-u-margin--3"
2365
- }),
2366
- !loading && table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
2367
- variation: "warn",
2368
- children: "No results found for the current filters"
2416
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $789279954d8eff7f$export$2e2bcd8739ae039), {
2417
+ endpoint: `${rootUrl}/metastore/schemas/dataset/items/${id}/docs${additionalParams && additionalParams.ACA ? "?ACA=" + additionalParams.ACA + "&redirect=false" : ""}`
2369
2418
  })
2370
2419
  ]
2371
2420
  });
2372
2421
  };
2373
- var $d98f94c79ddf4e0e$export$2e2bcd8739ae039 = $d98f94c79ddf4e0e$var$DataTable;
2422
+ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
2374
2423
 
2375
2424
 
2376
- function $aa4450dcbeef3ac0$export$385a5aba38cc3325(sortArray) {
2377
- let newQuery = [];
2378
- sortArray.forEach((s)=>{
2379
- return newQuery.push({
2380
- property: s.id,
2381
- order: s.desc ? "desc" : "asc"
2382
- });
2383
- });
2384
- return newQuery;
2385
- }
2386
2425
 
2387
2426
 
2388
- // Example custom column headers, where only effective date has an ! at the end
2389
- // [
2390
- // {schema: 'date', cell: ({ value }) => localeDate(value),},
2391
- // {accessor: 'effective_date',cell: ({ value }) => localeDate(value) + '!',},
2392
- // ]
2393
- function $7264a673914aa746$export$8049e8f40a9bdfb8(customHeaders, columns, schema) {
2394
- return columns.map((column)=>{
2395
- const customAccessorIndex = customHeaders.findIndex((header)=>header.accessor === column);
2396
- const customSchemaIndex = customHeaders.findIndex((header)=>header.schema === schema.fields[column].mysql_type);
2397
- let newColumn = {};
2398
- // If specific accessor is passed, this will override a general mysql_type Cell rewrite.
2399
- if (customAccessorIndex > -1) {
2400
- newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
2401
- newColumn.accessor = column;
2402
- newColumn.cell = customHeaders[customAccessorIndex].cell;
2403
- } else {
2404
- newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
2405
- newColumn.accessor = column;
2406
- if (customSchemaIndex > -1) newColumn.cell = customHeaders[customSchemaIndex].cell;
2407
- }
2408
- return newColumn;
2409
- });
2410
- }
2411
- function $7264a673914aa746$export$e284ae5d89467c8f(date) {
2412
- if (!date) return date;
2413
- date = new Date(date);
2414
- date = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
2415
- return date;
2416
- }
2417
- function $7264a673914aa746$export$6b5e57d20078142b(value, operator) {
2418
- let newValue = value;
2419
- if (Array.isArray(newValue)) newValue = newValue.join(",");
2420
- // return newValue.replace(/(^\%+|\%+$)/gm, '');
2421
- return newValue;
2422
- }
2423
- const $7264a673914aa746$export$5f89a5ae87bc48e1 = [
2424
- {
2425
- label: "Is",
2426
- value: "="
2427
- },
2428
- {
2429
- label: "Starts With",
2430
- value: "starts with"
2431
- },
2432
- {
2433
- label: "Contains",
2434
- value: "contains"
2435
- },
2436
- {
2437
- label: "Is Not",
2438
- value: "<>"
2439
- },
2440
- {
2441
- label: "Or",
2442
- value: "in"
2443
- },
2444
- {
2445
- label: "Is",
2446
- value: "="
2447
- },
2448
- {
2449
- label: "Is Not",
2450
- value: "<>"
2451
- },
2452
- {
2453
- label: "Greater Than",
2454
- value: ">"
2455
- },
2456
- {
2457
- label: "Less Than",
2458
- value: "<"
2459
- }
2460
- ];
2461
- function $7264a673914aa746$export$2b9377795161999(type) {
2462
- switch(type){
2463
- case "text":
2464
- case "string":
2465
- return [
2466
- {
2467
- label: "Is",
2468
- value: "="
2469
- },
2470
- {
2471
- label: "Starts With",
2472
- value: "starts with"
2473
- },
2474
- {
2475
- label: "Contains",
2476
- value: "contains"
2477
- },
2478
- {
2479
- label: "Is Not",
2480
- value: "<>"
2481
- },
2482
- {
2483
- label: "Or",
2484
- value: "in"
2485
- }
2486
- ];
2487
- case "date":
2488
- return [
2489
- {
2490
- label: "Is",
2491
- value: "="
2492
- },
2493
- {
2494
- label: "Is Not",
2495
- value: "<>"
2496
- },
2497
- {
2498
- label: "Greater Than",
2499
- value: ">"
2500
- },
2501
- {
2502
- label: "Less Than",
2503
- value: "<"
2504
- }
2505
- ];
2506
- default:
2507
- // These 2 should be safe for all data types
2508
- return [
2509
- {
2510
- label: "Is",
2511
- value: "="
2512
- },
2513
- {
2514
- label: "Is Not",
2515
- value: "<>"
2516
- }
2517
- ];
2518
- }
2519
- }
2520
2427
 
2521
2428
 
2522
2429
 
@@ -2525,406 +2432,307 @@ function $7264a673914aa746$export$2b9377795161999(type) {
2525
2432
 
2526
2433
 
2527
2434
 
2528
- const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className })=>{
2529
- const numTotalRows = totalRows;
2530
- if (numTotalRows === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2531
- className: className,
2532
- children: `0 - 0 of 0 rows`
2533
- });
2534
- const ofTotal = ()=>{
2535
- if (limit >= numTotalRows) return numTotalRows;
2536
- if (limit + offset >= numTotalRows) return numTotalRows;
2537
- if (offset === 0) return limit;
2538
- return offset + limit;
2539
- };
2540
- const page = offset / limit;
2541
- const startTotal = ()=>page * limit + 1;
2542
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
2543
- className: className,
2544
- children: [
2545
- "Displaying",
2546
- " ",
2547
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2548
- className: "ds-u-font-weight--bold",
2549
- children: `${startTotal().toLocaleString()} - ${ofTotal().toLocaleString()}`
2550
- }),
2551
- " ",
2552
- "of ",
2553
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2554
- className: "ds-u-font-weight--bold",
2555
- children: `${numTotalRows.toLocaleString()}`
2556
- }),
2557
- " ",
2558
- "results"
2559
- ]
2560
- });
2561
- };
2562
- $2ed0091f7e32d1e6$var$DataTablePageResults.defaultProps = {
2563
- className: "data-table-results"
2564
- };
2565
- $2ed0091f7e32d1e6$var$DataTablePageResults.propTypes = {
2566
- className: (0, $hgUW1$proptypes).string,
2567
- totalRows: (0, $hgUW1$proptypes).number.isRequired,
2568
- limit: (0, $hgUW1$proptypes).number.isRequired,
2569
- offset: (0, $hgUW1$proptypes).number.isRequired
2570
- };
2571
- var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePageResults;
2572
2435
 
2573
2436
 
2574
2437
 
2575
2438
 
2576
2439
 
2577
- const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, jsonUrl: jsonUrl, setPage: setPage })=>{
2578
- const { limit: limit, offset: offset, count: count, conditions: conditions, setLimit: setLimit, setOffset: setOffset } = resource;
2579
- const intCount = count ? count : 0;
2580
- const rowOptions = [
2581
- 10,
2582
- 25,
2583
- 50,
2584
- 100
2585
- ];
2586
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2587
- className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between",
2440
+
2441
+
2442
+ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: header, sortElement: sortElement, setAriaLiveFeedback: setAriaLiveFeedback })=>{
2443
+ const [columnResizing, setColumnResizing] = (0, $hgUW1$useState)("");
2444
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("th", {
2445
+ key: header.id,
2446
+ style: {
2447
+ width: header.getSize()
2448
+ },
2449
+ className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
2588
2450
  children: [
2589
2451
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2590
- 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",
2452
+ className: "ds-u-display--flex",
2591
2453
  children: [
2592
2454
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2593
- className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-bottom--2",
2594
- children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
2595
- onOpen: ()=>{
2596
- navigator.clipboard.writeText(window.location.href);
2597
- },
2598
- className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
2599
- placement: "bottom",
2600
- dialog: true,
2601
- ariaLabel: "Copy link to filtered data",
2602
- title: "Link copied to clipboard",
2603
- "aria-disabled": !conditions || conditions.length === 0,
2604
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2605
- className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2606
- children: [
2607
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2608
- className: "fas fa-copy"
2609
- }),
2610
- " Copy link to filtered data"
2611
- ]
2612
- })
2613
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2614
- "aria-disabled": true,
2615
- "aria-label": "Copy link to filtered data",
2616
- className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
2617
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2618
- className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2619
- children: [
2620
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2621
- className: "fas fa-copy"
2622
- }),
2623
- " Copy link to filtered data"
2624
- ]
2625
- })
2455
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2456
+ title: typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "",
2457
+ children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
2626
2458
  })
2627
2459
  }),
2628
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2629
- 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",
2630
- children: [
2631
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2632
- 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",
2633
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2634
- 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",
2635
- href: downloadURL,
2636
- "aria-disabled": !conditions || conditions.length === 0,
2637
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2638
- className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2639
- children: [
2640
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2641
- className: "fas fa-file-csv"
2642
- }),
2643
- " Download filtered data (CSV)"
2644
- ]
2645
- })
2646
- })
2647
- }),
2648
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2649
- 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",
2650
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2651
- 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",
2652
- href: unfilteredDownloadURL,
2653
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2654
- className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2655
- children: [
2656
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2657
- className: "fas fa-file-csv"
2658
- }),
2659
- " Download full dataset (CSV)"
2660
- ]
2661
- })
2662
- })
2663
- })
2664
- ]
2665
- }),
2666
- jsonUrl && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2667
- className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-left--2 ds-u-margin-top--2 ds-u-sm-margin-top--0",
2668
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2669
- 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",
2670
- href: jsonUrl,
2671
- "aria-label": "Export to .JSON",
2672
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2673
- className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
2674
- children: [
2675
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2676
- className: "fas fa-file-code"
2677
- }),
2678
- " Export to JSON"
2679
- ]
2680
- })
2681
- })
2460
+ sortElement && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
2461
+ onClick: header.column.getToggleSortingHandler(),
2462
+ className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : "",
2463
+ "aria-label": `${header.column.columnDef.header} sort order`
2682
2464
  })
2683
2465
  ]
2684
2466
  }),
2685
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2686
- 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",
2687
- children: [
2688
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2689
- className: "ds-l-col--12 ds-l-sm-col--8 ds-u-padding-x--0",
2690
- children: !resource.loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
2691
- totalRows: intCount,
2692
- limit: limit,
2693
- offset: offset
2694
- })
2695
- }),
2696
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2697
- className: "ds-l-col--12 ds-l-sm-col--4 ds-u-display--flex ds-u-justify-content--end ds-u-padding-x--0",
2698
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2699
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2700
- options: rowOptions.map((row)=>({
2701
- label: row.toString(),
2702
- value: row
2703
- })),
2704
- size: "medium",
2705
- label: "Rows per page:",
2706
- labelClassName: "ds-u-margin-top--0",
2707
- name: "datatable_rows_per_page",
2708
- onChange: (e)=>{
2709
- setLimit(parseInt(e.target.value));
2710
- setPage(1);
2711
- setOffset(0);
2712
- },
2713
- defaultValue: limit.toString()
2714
- })
2715
- })
2716
- })
2717
- ]
2467
+ /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
2468
+ onMouseDown: header.getResizeHandler(),
2469
+ onTouchStart: header.getResizeHandler(),
2470
+ className: `dc-c-resize-handle ds-u-focus-visible ${header.column.getIsResizing() || header.column.id == columnResizing ? "isResizing" : ""}`,
2471
+ "aria-label": `Resize ${header.column.columnDef.header} column`,
2472
+ onKeyDown: (e)=>{
2473
+ const columnSizingObject = table.getState().columnSizing;
2474
+ switch(e.key){
2475
+ case "Enter":
2476
+ case " ":
2477
+ e.preventDefault();
2478
+ e.stopPropagation();
2479
+ if (columnResizing) {
2480
+ // end resizing
2481
+ setColumnResizing("");
2482
+ setAriaLiveFeedback(`${header.column.columnDef.header} dropped.`);
2483
+ } else {
2484
+ // start resizing
2485
+ setColumnResizing(header.column.id);
2486
+ setAriaLiveFeedback(`${header.column.columnDef.header} grabbed.`);
2487
+ }
2488
+ break;
2489
+ case "Escape":
2490
+ if (columnResizing) {
2491
+ setColumnResizing("");
2492
+ setAriaLiveFeedback(`${header.column.columnDef.header} dropped.`);
2493
+ }
2494
+ break;
2495
+ case "ArrowRight":
2496
+ e.preventDefault();
2497
+ e.stopPropagation();
2498
+ if (columnResizing) {
2499
+ columnSizingObject[header.column.id] = header.getSize() + 10;
2500
+ table.setColumnSizing(columnSizingObject);
2501
+ setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
2502
+ }
2503
+ break;
2504
+ case "ArrowLeft":
2505
+ e.preventDefault();
2506
+ e.stopPropagation();
2507
+ if (columnResizing) {
2508
+ columnSizingObject[header.column.id] = header.getSize() - 10;
2509
+ table.setColumnSizing(columnSizingObject);
2510
+ setAriaLiveFeedback(`${header.column.columnDef.header} has been resized. The new width is ${header.getSize()} pixels.`);
2511
+ }
2512
+ break;
2513
+ }
2514
+ },
2515
+ onBlur: ()=>{
2516
+ setColumnResizing("");
2517
+ }
2718
2518
  })
2719
2519
  ]
2720
2520
  });
2721
2521
  };
2722
- var $6380a4a580b24362$export$2e2bcd8739ae039 = $6380a4a580b24362$var$DataTableHeader;
2723
-
2724
-
2725
-
2726
-
2727
-
2728
-
2729
-
2730
-
2731
-
2522
+ var $64a351d3fd8413c3$export$2e2bcd8739ae039 = $64a351d3fd8413c3$var$HeaderResizeElement;
2732
2523
 
2733
2524
 
2734
2525
 
2735
- const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions, schema: schema, customColumns: customColumns })=>{
2736
- const { fields: fields } = schema;
2737
- const prependedMessage = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
2738
- children: "Data filters: "
2739
- });
2740
- if (!conditions || !conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
2741
- className: "ds-u-margin-y--0",
2742
- children: [
2743
- prependedMessage,
2744
- " none"
2745
- ]
2746
- });
2747
- function formatValue(text, property) {
2748
- if (customColumns && customColumns.length > 0) {
2749
- let newValue = text;
2750
- let customColumn = customColumns.find((c)=>c.accessor === property);
2751
- if (customColumn && customColumn.cell) return customColumn.cell({
2752
- value: text
2753
- });
2754
- return text;
2755
- } else return text;
2756
- }
2757
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2758
- className: "dc-querybuilder-title",
2759
- children: [
2760
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
2761
- className: "ds-u-margin-y--0",
2762
- children: prependedMessage
2763
- }),
2764
- conditions.map((c)=>{
2765
- const field = fields[c.property];
2766
- const description = field && field.description ? field.description : c.property;
2767
- const operator = (0, $7264a673914aa746$export$5f89a5ae87bc48e1).find((op)=>op.value === c.operator);
2768
- const cleanedText = (0, $7264a673914aa746$export$6b5e57d20078142b)(c.value);
2769
- const formattedText = formatValue(cleanedText, c.property);
2770
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
2771
- className: "ds-u-fill--background ds-u-padding--1 ds-u-margin-y--1 ds-u-display--inline-block ds-u-font-weight--semibold",
2772
- children: [
2773
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2774
- className: "ds-u-font-weight--bold",
2775
- children: description
2776
- }),
2777
- " ",
2778
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2779
- className: "ds-u-font-weight--normal",
2780
- children: operator.label.toUpperCase()
2781
- }),
2782
- " ",
2783
- /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2784
- className: "ds-u-color--success",
2785
- children: formattedText
2786
- })
2787
- ]
2788
- });
2789
- }).reduce((prev, curr)=>[
2790
- prev,
2791
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Badge), {
2792
- className: "ds-u-margin-x--1",
2793
- variation: "info",
2794
- children: "AND"
2795
- }),
2796
- curr
2797
- ])
2798
- ]
2526
+ const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns, tableData: tableData, pageSize: pageSize, columnFilters: columnFilters })=>{
2527
+ const [sorting, setSorting] = (0, $hgUW1$useState)([]);
2528
+ const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
2529
+ const mobile = (0, $hgUW1$useMediaQuery)({
2530
+ minWidth: 0,
2531
+ maxWidth: 544
2799
2532
  });
2800
- };
2801
- var $bef7bff2823feea2$export$2e2bcd8739ae039 = $bef7bff2823feea2$var$QueryTitle;
2802
-
2803
-
2804
-
2805
-
2806
-
2807
-
2808
-
2809
-
2810
- function $6369abf590ca298f$var$getStartDate(condition, schema, id) {
2811
- if (schema[id].fields[condition.property].mysql_type === "date") {
2812
- const newDate = new Date(condition.value.toString());
2813
- if (newDate instanceof Date && !isNaN(newDate.getTime())) return newDate;
2814
- }
2815
- return new Date();
2816
- }
2817
- const $6369abf590ca298f$var$QueryRow = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema })=>{
2818
- const [operator, setOperator] = (0, $hgUW1$useState)(condition.operator);
2819
- const [property, setProperty] = (0, $hgUW1$useState)(condition.property);
2820
- const [value, setValue] = (0, $hgUW1$useState)(condition.value);
2821
- const [startDate, setStartDate] = (0, $hgUW1$react).useState($6369abf590ca298f$var$getStartDate(condition, schema, id));
2822
- (0, $hgUW1$useEffect)(()=>{
2823
- if (property !== condition.property) {
2824
- if (property) update(index, "property", property);
2825
- else update(index, "property", "");
2826
- if (schema[id].fields[condition.property].mysql_type === "date") {
2827
- if (!value) setValue(startDate.toJSON().slice(0, 10));
2533
+ const sortElement = (isSorted)=>{
2534
+ if (isSorted === "asc") return "dc-c-sort--asc";
2535
+ if (isSorted === "desc") return "dc-c-sort--desc";
2536
+ return "dc-c-sort--default";
2537
+ };
2538
+ const table = (0, $hgUW1$useReactTable)({
2539
+ data: tableData,
2540
+ columns: tableColumns,
2541
+ columnResizeMode: "onChange",
2542
+ getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
2543
+ getFilteredRowModel: (0, $hgUW1$getFilteredRowModel)(),
2544
+ getPaginationRowModel: (0, $hgUW1$getPaginationRowModel)(),
2545
+ getSortedRowModel: (0, $hgUW1$getSortedRowModel)(),
2546
+ onSortingChange: setSorting,
2547
+ initialState: {
2548
+ pagination: {
2549
+ pageSize: pageSize,
2550
+ pageIndex: 0
2828
2551
  }
2552
+ },
2553
+ state: {
2554
+ sorting: sorting,
2555
+ columnFilters: columnFilters
2829
2556
  }
2830
- }, [
2831
- property,
2832
- value,
2833
- startDate,
2834
- schema,
2835
- id,
2836
- condition
2837
- ]);
2838
- (0, $hgUW1$useEffect)(()=>{
2839
- if (operator !== condition.operator) {
2840
- if (operator) update(index, "operator", operator);
2841
- else update(index, "operator", "");
2842
- }
2843
- }, [
2844
- operator
2845
- ]);
2846
- (0, $hgUW1$useEffect)(()=>{
2847
- if (value !== condition.value) {
2848
- if (value) update(index, "value", value);
2849
- else update(index, "value", "");
2557
+ });
2558
+ const sortOptions = [
2559
+ {
2560
+ value: "default",
2561
+ label: "No Sort"
2562
+ },
2563
+ {
2564
+ value: "titleasc",
2565
+ label: "Title A-Z"
2566
+ },
2567
+ {
2568
+ value: "titledesc",
2569
+ label: "Title Z-A"
2570
+ },
2571
+ {
2572
+ value: "typeasc",
2573
+ label: "Type A-Z"
2574
+ },
2575
+ {
2576
+ value: "typedesc",
2577
+ label: "Type Z-A"
2850
2578
  }
2851
- }, [
2852
- value
2853
- ]);
2854
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("fieldset", {
2855
- className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between ds-u-align-items--center ds-u-border--0",
2579
+ ];
2580
+ const sortStatesLookup = {
2581
+ default: [],
2582
+ titleasc: [
2583
+ {
2584
+ id: "titleResizable",
2585
+ desc: false
2586
+ }
2587
+ ],
2588
+ titledesc: [
2589
+ {
2590
+ id: "titleResizable",
2591
+ desc: true
2592
+ }
2593
+ ],
2594
+ typeasc: [
2595
+ {
2596
+ id: "type",
2597
+ desc: false
2598
+ }
2599
+ ],
2600
+ typedesc: [
2601
+ {
2602
+ id: "type",
2603
+ desc: true
2604
+ }
2605
+ ]
2606
+ };
2607
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2856
2608
  children: [
2857
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2858
- className: "ds-l-col--12 ds-l-md-col--8 ds-u-display--flex ds-u-justify-content--between ds-u-padding-x--0",
2859
- children: [
2860
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2861
- options: propertyOptions,
2862
- className: "ds-l-col--8 ds-u-padding-left--0",
2863
- value: property,
2864
- label: "Column Name",
2865
- name: `${condition.key}_property`,
2866
- onChange: (e)=>setProperty(e.target.value)
2609
+ mobile && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2610
+ className: "ds-u-margin-bottom--3 ds-l-col--12 ds-l-sm-col--6",
2611
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2612
+ labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
2613
+ options: sortOptions,
2614
+ label: "Sort",
2615
+ value: Object.keys(sortStatesLookup).find((key)=>{
2616
+ return JSON.stringify(sortStatesLookup[key]) == JSON.stringify(sorting);
2867
2617
  }),
2868
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2869
- options: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[property].mysql_type),
2870
- className: "ds-l-col--4 ds-u-padding-x--0",
2871
- value: operator,
2872
- label: "Operator",
2873
- name: `${condition.key}_operator`,
2874
- onChange: (e)=>setOperator(e.target.value)
2875
- })
2876
- ]
2618
+ name: "dc-data-dictionary-type",
2619
+ onChange: (e)=>{
2620
+ setSorting(sortStatesLookup[e.target.value]);
2621
+ }
2622
+ })
2877
2623
  }),
2878
2624
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2879
- 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",
2625
+ className: "dc-c-datadictionary-table",
2880
2626
  children: [
2881
- schema[id].fields[property].mysql_type === "date" ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2627
+ /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
2628
+ className: "dc-c-datatable",
2629
+ style: {
2630
+ width: "100%"
2631
+ },
2632
+ stackable: true,
2882
2633
  children: [
2883
- /*#__PURE__*/ (0, $hgUW1$jsx)("label", {
2884
- className: "ds-c-label",
2885
- htmlFor: `${condition.key}_date_value`,
2886
- id: `${condition.key}_date_value-label`,
2887
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2888
- children: "Value"
2889
- })
2634
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableHead), {
2635
+ className: "dc-thead--truncated dc-thead--resizeable",
2636
+ children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableRow), {
2637
+ children: headerGroup.headers.map((header)=>{
2638
+ return header.id === "titleResizable" ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
2639
+ table: table,
2640
+ header: header,
2641
+ setAriaLiveFeedback: setAriaLiveFeedback,
2642
+ sortElement: sortElement
2643
+ }, header.id + "_resize") : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableCell), {
2644
+ key: header.id,
2645
+ className: `ds-u-border-y--2 ds-u-border--dark ds-u-border-x--0`,
2646
+ id: "dataDictionary_" + header.id,
2647
+ children: [
2648
+ (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext()),
2649
+ header.id === "type" && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
2650
+ onClick: header.column.getToggleSortingHandler(),
2651
+ className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : "",
2652
+ "aria-label": `${header.column.columnDef.header} sort order`
2653
+ })
2654
+ ]
2655
+ });
2656
+ })
2657
+ }, "header" + headerGroup.id))
2890
2658
  }),
2891
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$reactdatepicker), {
2892
- name: `${condition.key}_date_value`,
2893
- selected: (0, $7264a673914aa746$export$e284ae5d89467c8f)(startDate),
2894
- onChange: (date)=>{
2895
- setStartDate(date);
2896
- setValue(date.toJSON().slice(0, 10));
2897
- },
2898
- showMonthDropdown: true,
2899
- showYearDropdown: true,
2900
- dropdownMode: "select",
2901
- className: "ds-c-field",
2902
- withPortal: true
2659
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableBody), {
2660
+ children: table.getRowModel().rows.map((row, index)=>{
2661
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableRow), {
2662
+ children: row.getVisibleCells().map((cell)=>{
2663
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
2664
+ key: cell.id,
2665
+ style: {
2666
+ maxWidth: mobile ? "100%" : cell.column.getSize(),
2667
+ whiteSpace: cell.column.id === "description" ? "pre-wrap" : "normal"
2668
+ },
2669
+ className: `${cell.column.id === "titleResizable" ? "ds-u-word-break" : ""}`,
2670
+ headers: "dataDictionary_" + cell.column.id,
2671
+ stackedTitle: cell.column.id === "titleResizable" ? "Title" : cell.column.columnDef.header,
2672
+ children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
2673
+ });
2674
+ })
2675
+ }, index + JSON.stringify(row));
2676
+ })
2903
2677
  })
2904
2678
  ]
2905
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
2906
- className: "ds-l-col--11 ds-u-padding-x--0",
2907
- label: "Value",
2908
- name: `${condition.key}_value`,
2909
- value: (0, $7264a673914aa746$export$6b5e57d20078142b)(value, operator),
2910
- onChange: (e)=>setValue(e.target.value)
2911
2679
  }),
2912
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
2913
- variation: "ghost",
2914
- size: "small",
2915
- className: "ds-u-margin-top--6 ds-u-padding-right--0",
2916
- "aria-label": "Delete filter",
2917
- onClick: ()=>remove(index),
2918
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2919
- className: "fas fa-trash"
2920
- })
2680
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2681
+ className: "sr-only",
2682
+ "aria-live": "assertive",
2683
+ "aria-atomic": "true",
2684
+ children: ariaLiveFeedback
2685
+ }),
2686
+ table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
2687
+ variation: "warn",
2688
+ children: "No results found for the current filters"
2921
2689
  })
2922
2690
  ]
2923
- })
2691
+ }),
2692
+ table.getRowCount() > pageSize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
2693
+ totalPages: table.getPageCount(),
2694
+ currentPage: table.getState().pagination.pageIndex + 1,
2695
+ onPageChange: (evt, page)=>{
2696
+ evt.preventDefault();
2697
+ table.setPageIndex(page - 1);
2698
+ },
2699
+ renderHref: (page)=>`/page=${page}`
2700
+ }) : ""
2924
2701
  ]
2925
2702
  });
2926
2703
  };
2927
- var $6369abf590ca298f$export$2e2bcd8739ae039 = $6369abf590ca298f$var$QueryRow;
2704
+ var $6765a74df807d015$export$2e2bcd8739ae039 = $6765a74df807d015$var$DataDictionaryTable;
2705
+
2706
+
2707
+ const $a24829b27758fe6c$var$SitewideDataDictionaryTable = ({ datasetDictionary: datasetDictionary, pageSize: pageSize })=>{
2708
+ const columnHelper = (0, $hgUW1$createColumnHelper)();
2709
+ const tableColumns = [
2710
+ columnHelper.accessor("name", {
2711
+ header: "Name"
2712
+ }),
2713
+ columnHelper.accessor("title", {
2714
+ header: "Title"
2715
+ }),
2716
+ columnHelper.accessor("type", {
2717
+ header: "Type"
2718
+ }),
2719
+ columnHelper.accessor("format", {
2720
+ header: "Format"
2721
+ })
2722
+ ];
2723
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6765a74df807d015$export$2e2bcd8739ae039), {
2724
+ tableColumns: tableColumns,
2725
+ tableData: datasetDictionary,
2726
+ pageSize: pageSize
2727
+ });
2728
+ };
2729
+ var $a24829b27758fe6c$export$2e2bcd8739ae039 = $a24829b27758fe6c$var$SitewideDataDictionaryTable;
2730
+
2731
+
2732
+
2733
+
2734
+
2735
+
2928
2736
 
2929
2737
 
2930
2738
 
@@ -2947,321 +2755,291 @@ const $2eec38d4d0dbf714$var$ClearFiltersButton = ({ disabled: disabled = false,
2947
2755
  var $2eec38d4d0dbf714$export$2e2bcd8739ae039 = $2eec38d4d0dbf714$var$ClearFiltersButton;
2948
2756
 
2949
2757
 
2950
- function $ee4ad47aa483e5b5$var$updateQueryForDatastore(condition) {
2951
- let cond = condition;
2952
- delete cond.key;
2953
- if (cond.operator === "=" || cond.operator === "<>") {
2954
- if (Array.isArray(cond.value)) cond.value = cond.value.join();
2955
- cond.value = cond.value.replace(/(^\%+|\%+$)/gm, "");
2956
- }
2957
- if (cond.operator.toLowerCase() === "like") {
2958
- if (Array.isArray(cond.value)) cond.value = cond.value.join();
2959
- const cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm, "");
2960
- cond.value = `%${cleanedValue}%`;
2961
- }
2962
- if (cond.operator.toLowerCase() === "in") {
2963
- if (!Array.isArray(cond.value)) cond.value = cond.value.split(",");
2964
- }
2965
- if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
2966
- return cond;
2967
- }
2968
- const $ee4ad47aa483e5b5$var$QueryBuilder = (props)=>{
2969
- const { resource: resource, id: id, includeSearchParams: includeSearchParams, customColumns: customColumns } = props;
2970
- const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
2971
- const fields = Object.keys(schema[id].fields);
2972
- const [conditionsCleared, setConditionsCleared] = (0, $hgUW1$useState)(false);
2973
- const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
2974
- const [titleConditions, setTitleConditions] = (0, $hgUW1$useState)([]); // Add use effect to load conditions on first load if needed
2975
- const [conditionsChanged, setConditionsChanged] = (0, $hgUW1$useState)(false);
2976
- const small = (0, $hgUW1$useMediaQuery)({
2977
- minWidth: 0,
2978
- maxWidth: 544
2979
- });
2980
- const addCondition = (condition)=>{
2981
- if (Array.isArray(condition)) {
2982
- const keyedConditions = condition.map((oc)=>({
2983
- ...oc,
2984
- key: Date.now().toString() + oc.value + oc.property
2985
- }));
2986
- setQueryConditions(keyedConditions);
2987
- } else setQueryConditions([
2988
- ...queryConditions,
2758
+ const $a6e312940f7003ef$var$DatasetDictionaryTable = ({ datasetDictionary: datasetDictionary, pageSize: pageSize })=>{
2759
+ const [titleFilter, setTitleFilter] = (0, $hgUW1$useState)("");
2760
+ const [typeFilter, setTypeFilter] = (0, $hgUW1$useState)("all");
2761
+ const columnFilters = (0, $hgUW1$useMemo)(()=>[
2989
2762
  {
2990
- property: fields[0],
2991
- value: "",
2992
- operator: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[fields[0]].mysql_type)[0].value,
2993
- key: Date.now().toString()
2763
+ id: "titleResizable",
2764
+ value: titleFilter
2765
+ },
2766
+ {
2767
+ id: "type",
2768
+ value: typeFilter === "all" ? "" : typeFilter
2994
2769
  }
2995
- ]);
2996
- };
2997
- (0, $hgUW1$react).useEffect(()=>{
2998
- if (conditions && conditions.length) addCondition(conditions);
2999
- else addCondition(null);
3000
- setTitleConditions(conditions);
3001
- }, []);
3002
- (0, $hgUW1$react).useEffect(()=>{
3003
- if (conditionsCleared) {
3004
- submitConditions(new Event("submit"));
3005
- setConditionsCleared(false);
3006
- }
3007
- }, [
3008
- conditionsCleared
2770
+ ], [
2771
+ titleFilter,
2772
+ typeFilter
3009
2773
  ]);
3010
- const propertyOptions = fields.map((f)=>{
3011
- if (schema[id].fields[f].description) return {
3012
- label: schema[id].fields[f].description,
3013
- value: f
3014
- };
2774
+ const tableData = datasetDictionary.map((item)=>{
3015
2775
  return {
3016
- label: f,
3017
- value: f
2776
+ titleResizable: item.title,
2777
+ description: item.description,
2778
+ type: item.type
3018
2779
  };
3019
2780
  });
3020
- const submitConditions = (e)=>{
3021
- e.preventDefault();
3022
- const submitConditions = queryConditions.filter((oc)=>{
3023
- if (oc.property) return oc;
3024
- return false;
3025
- }).map((oc)=>{
3026
- let cond = Object.assign({}, oc);
3027
- return $ee4ad47aa483e5b5$var$updateQueryForDatastore(cond);
3028
- });
3029
- setConditions(submitConditions);
3030
- setTitleConditions(queryConditions.map((oc)=>Object.assign({}, oc)));
3031
- setConditionsChanged(false);
3032
- if (includeSearchParams) {
3033
- const url = new URL(window.location.href);
3034
- const urlString = (0, $hgUW1$qs).stringify({
3035
- conditions: submitConditions
3036
- }, {
3037
- encodeValuesOnly: true,
3038
- addQueryPrefix: true
3039
- });
3040
- window.history.pushState({}, "", `${url.origin}${url.pathname}${urlString}`);
3041
- }
3042
- };
3043
- const updateCondition = (index, key, value)=>{
3044
- let newConditions = [
3045
- ...queryConditions
3046
- ];
3047
- newConditions[index][key] = value;
3048
- setQueryConditions(newConditions);
3049
- setConditionsChanged(true);
3050
- };
3051
- const removeCondition = (index)=>{
3052
- let newConditions = queryConditions.map((oc)=>Object.assign({}, oc));
3053
- newConditions.splice(index, 1);
3054
- setQueryConditions(newConditions);
3055
- setConditionsChanged(true);
3056
- setConditionsCleared(true);
3057
- };
3058
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3059
- className: "dc-query-builder ds-u-margin-bottom--3",
3060
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3061
- className: "ds-c-accordion ds-c-accordion--bordered",
3062
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
3063
- heading: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $bef7bff2823feea2$export$2e2bcd8739ae039), {
3064
- schema: schema[id],
3065
- conditions: titleConditions,
3066
- customColumns: customColumns
3067
- }),
3068
- defaultOpen: true,
3069
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("form", {
3070
- onSubmit: (e)=>submitConditions(e),
2781
+ const columnHelper = (0, $hgUW1$createColumnHelper)();
2782
+ const tableColumns = [
2783
+ columnHelper.accessor("titleResizable", {
2784
+ header: ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2785
+ className: "dc-c-tooltip-width-override",
3071
2786
  children: [
3072
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3073
- children: queryConditions.map((qf, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $6369abf590ca298f$export$2e2bcd8739ae039), {
3074
- id: id,
3075
- schema: schema,
3076
- condition: qf,
3077
- index: index,
3078
- propertyOptions: propertyOptions,
3079
- update: updateCondition,
3080
- remove: removeCondition
3081
- }, qf.key))
3082
- }),
3083
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3084
- 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",
2787
+ "Title",
2788
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
2789
+ title: "Title represents the column headers of the data file",
2790
+ // @ts-ignore
2791
+ style: {
2792
+ border: "none",
2793
+ background: "none"
2794
+ },
2795
+ maxWidth: "400px",
2796
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TooltipIcon), {})
2797
+ })
2798
+ ]
2799
+ }),
2800
+ size: 300
2801
+ }),
2802
+ columnHelper.accessor("description", {
2803
+ header: "Description",
2804
+ minSize: 600
2805
+ }),
2806
+ columnHelper.accessor("type", {
2807
+ header: "Type",
2808
+ size: 150,
2809
+ enableResizing: false
2810
+ })
2811
+ ];
2812
+ const typeOptions = [
2813
+ {
2814
+ value: "all",
2815
+ label: "All Types"
2816
+ },
2817
+ {
2818
+ value: "string",
2819
+ label: "String"
2820
+ },
2821
+ {
2822
+ value: "date",
2823
+ label: "Date"
2824
+ },
2825
+ {
2826
+ value: "datetime",
2827
+ label: "Datetime"
2828
+ },
2829
+ {
2830
+ value: "year",
2831
+ label: "Year"
2832
+ },
2833
+ {
2834
+ value: "integer",
2835
+ label: "Integer"
2836
+ },
2837
+ {
2838
+ value: "number",
2839
+ label: "Number"
2840
+ },
2841
+ {
2842
+ value: "boolean",
2843
+ label: "Boolean"
2844
+ }
2845
+ ];
2846
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
2847
+ children: [
2848
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2849
+ className: "dc-query-builder ds-u-margin-bottom--3",
2850
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2851
+ className: "ds-c-accordion ds-c-accordion--bordered",
2852
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
2853
+ heading: "Data Dictionary Filters",
2854
+ defaultOpen: true,
2855
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2856
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap",
3085
2857
  children: [
2858
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
2859
+ className: "ds-l-col--12 ds-l-sm-col--6",
2860
+ labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
2861
+ label: "Title",
2862
+ value: titleFilter,
2863
+ name: "dc-data-dictionary-title",
2864
+ onChange: (e)=>setTitleFilter(e.target.value)
2865
+ }),
3086
2866
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3087
- 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",
3088
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3089
- variation: "ghost",
3090
- onClick: ()=>addCondition(null),
3091
- className: "ds-u-padding-left--0",
3092
- children: "+ Add filter"
2867
+ className: "ds-l-col--12 ds-l-sm-col--6",
2868
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
2869
+ labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
2870
+ options: typeOptions,
2871
+ label: "Type",
2872
+ value: typeFilter,
2873
+ name: "dc-data-dictionary-type",
2874
+ onChange: (e)=>setTypeFilter(e.target.value)
3093
2875
  })
3094
2876
  }),
3095
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3096
- className: "ds-u-display--flex ds-u-justify-content--end ds-l-col--12 ds-l-md-col--6 ds-u-padding-x--0",
3097
- children: [
3098
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3099
- disabled: !conditionsChanged,
3100
- className: "ds-u-float--right ds-l-md-col--6 ds-u-margin--right--0 ds-u-sm-margin-right--2",
3101
- type: "submit",
3102
- variation: "solid",
3103
- children: "Apply filters"
3104
- }),
3105
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2eec38d4d0dbf714$export$2e2bcd8739ae039), {
3106
- disabled: queryConditions.length === 0,
2877
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2878
+ className: "ds-u-float--right ds-u-padding-y--2 ds-l-col--12 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",
2879
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2880
+ className: "ds-u-display--flex ds-u-justify-content--end ds-l-col--12 ds-l-md-col--6 ds-u-padding-x--0",
2881
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2eec38d4d0dbf714$export$2e2bcd8739ae039), {
3107
2882
  clearFiltersFn: ()=>{
3108
- setQueryConditions([]);
3109
- setTitleConditions([]);
3110
- setConditionsCleared(true);
2883
+ setTitleFilter("");
2884
+ setTypeFilter("all");
3111
2885
  }
3112
2886
  })
3113
- ]
2887
+ })
3114
2888
  })
3115
2889
  ]
3116
2890
  })
3117
- ]
3118
- })
3119
- })
3120
- })
3121
- });
3122
- };
3123
- $ee4ad47aa483e5b5$var$QueryBuilder.defaultProps = {
3124
- includeSearchParams: true
3125
- };
3126
- var $ee4ad47aa483e5b5$export$2e2bcd8739ae039 = $ee4ad47aa483e5b5$var$QueryBuilder;
3127
-
3128
-
3129
- function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
3130
- return columns.map((column)=>({
3131
- header: schema && schema.fields[column].description ? schema.fields[column].description : column,
3132
- accessor: column
3133
- }));
3134
- }
3135
- const $a35cf16d1488f54e$var$DatasetTable = ({ id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], jsonUrl: jsonUrl, dataDictionaryBanner: dataDictionaryBanner })=>{
3136
- const defaultPage = 1;
3137
- const defaultPageSize = 10;
3138
- const [page, setPage] = (0, $hgUW1$useState)(defaultPage);
3139
- const customColumnHeaders = (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution.identifier]);
3140
- const columns = customColumnHeaders ? customColumnHeaders : $a35cf16d1488f54e$export$1147582dfae658c6(resource.columns, resource.schema[id]);
3141
- const { limit: limit, setLimit: setLimit, setOffset: setOffset } = resource;
3142
- const pageSize = limit ? limit : defaultPageSize;
3143
- const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
3144
- conditions: resource.conditions
3145
- }, {
3146
- encode: true
3147
- })}&format=csv`;
3148
- if (Object.keys(resource).length && columns.length && resource.schema && Object.keys(distribution).length) return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3149
- children: [
3150
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee4ad47aa483e5b5$export$2e2bcd8739ae039), {
3151
- resource: resource,
3152
- id: distribution.identifier,
3153
- customColumns: customColumnHeaders
3154
- }),
3155
- dataDictionaryBanner && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3156
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
3157
- children: 'Click on the "Data Dictionary" tab above for full column definitions'
3158
- })
3159
- }),
3160
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6380a4a580b24362$export$2e2bcd8739ae039), {
3161
- resource: resource,
3162
- downloadURL: downloadURL,
3163
- unfilteredDownloadURL: distribution.data.downloadURL,
3164
- jsonUrl: jsonUrl,
3165
- setPage: setPage
3166
- }),
3167
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3168
- className: "ds-u-border-x--1 ds-u-border-bottom--1",
3169
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
3170
- data: resource.values,
3171
- canResize: true,
3172
- columns: columns,
3173
- setSort: resource.setSort,
3174
- sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
3175
- tablePadding: "ds-u-padding-y--2",
3176
- loading: resource.loading
2891
+ })
3177
2892
  })
3178
2893
  }),
3179
- !resource.loading && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3180
- 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",
3181
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
3182
- totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
3183
- currentPage: page,
3184
- onPageChange: (evt, page)=>{
3185
- evt.preventDefault();
3186
- setOffset((page - 1) * limit);
3187
- setPage(page);
3188
- },
3189
- renderHref: (page)=>{
3190
- return "";
3191
- },
3192
- className: "ds-l-col--12 ds-u-padding-x--0"
3193
- })
2894
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6765a74df807d015$export$2e2bcd8739ae039), {
2895
+ tableColumns: tableColumns,
2896
+ tableData: tableData,
2897
+ pageSize: pageSize,
2898
+ columnFilters: columnFilters
3194
2899
  })
3195
2900
  ]
3196
2901
  });
3197
- else return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
3198
- "aria-valuetext": "Dataset loading",
3199
- role: "status",
3200
- className: "ds-u-margin--3"
3201
- });
3202
2902
  };
3203
- var $a35cf16d1488f54e$export$2e2bcd8739ae039 = $a35cf16d1488f54e$var$DatasetTable;
3204
-
3205
-
3206
-
3207
-
3208
-
3209
-
2903
+ var $a6e312940f7003ef$export$2e2bcd8739ae039 = $a6e312940f7003ef$var$DatasetDictionaryTable;
3210
2904
 
3211
2905
 
3212
2906
 
3213
- function $5644ebd2c3dbfd7b$export$eea3a12df15499ca(metadataMapping, datasetInfo) {
3214
- const rows = [];
3215
- Object.keys(metadataMapping).forEach((d)=>{
3216
- if (!datasetInfo[d]) return null;
3217
- else rows.push(...metadataMapping[d](datasetInfo[d]));
2907
+ const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionaryEndpoint: datasetDictionaryEndpoint, datasetSitewideDictionary: datasetSitewideDictionary, title: title, pageSize: pageSize = 20, additionalParams: additionalParams, csvDownload: csvDownload })=>{
2908
+ const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
2909
+ queryKey: [
2910
+ "dictionary" + datasetDictionaryEndpoint
2911
+ ],
2912
+ queryFn: ()=>{
2913
+ return (0, $hgUW1$axios).get(`${datasetDictionaryEndpoint}?${(0, $hgUW1$qs).stringify(additionalParams, {
2914
+ arrayFormat: "comma",
2915
+ encode: false
2916
+ })}`).then((res)=>res.data).catch((error)=>console.error(error));
2917
+ },
2918
+ enabled: datasetDictionaryEndpoint !== undefined
3218
2919
  });
3219
- return rows;
3220
- }
3221
- const $5644ebd2c3dbfd7b$var$DatasetAdditionalInformation = ({ datasetInfo: datasetInfo, id: id, metadataMapping: metadataMapping })=>{
3222
- const rows = $5644ebd2c3dbfd7b$export$eea3a12df15499ca(metadataMapping, datasetInfo);
2920
+ const datasetDictionary = data && data.data && data.data.fields && data.data.fields.length ? data.data.fields : null;
3223
2921
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3224
- className: "dc-c-additional-info-table ds-u-margin-bottom--6",
2922
+ "data-testid": "dataset-dictionary-tab",
3225
2923
  children: [
3226
2924
  /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
3227
2925
  className: "ds-text-heading--2xl ds-u-margin-y--3",
3228
- children: "Additional Information"
2926
+ children: title
3229
2927
  }),
3230
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
3231
- compact: true,
3232
- striped: true,
2928
+ datasetDictionary && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3233
2929
  children: [
3234
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableHead), {
3235
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
3236
- children: [
3237
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3238
- children: "Field"
3239
- }),
3240
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3241
- children: "Value"
3242
- })
3243
- ]
3244
- })
3245
- }),
3246
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableBody), {
3247
- children: rows.map((r)=>/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
2930
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
2931
+ className: "ds-u-margin-bottom--1 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",
2932
+ children: [
2933
+ /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
2934
+ className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--4",
2935
+ onClick: ()=>window.open(datasetDictionaryEndpoint),
2936
+ type: "button",
3248
2937
  children: [
3249
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3250
- children: r.label
2938
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2939
+ className: "fa fa-file-download ds-u-color--primary ds-u-padding-right--1"
3251
2940
  }),
3252
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3253
- className: "ds-u-word-break-anywhere",
3254
- children: r.value
3255
- })
2941
+ " View Dictionary JSON"
3256
2942
  ]
3257
- }, `${r.label}_${id}`))
2943
+ }),
2944
+ csvDownload && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2945
+ className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--4 ds-u-margin-top--2 ds-u-sm-margin-top--0 ds-u-padding--0 ds-u-sm-padding-left--2",
2946
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
2947
+ href: datasetDictionaryEndpoint + "/csv",
2948
+ className: "ds-c-button",
2949
+ style: {
2950
+ width: "100%"
2951
+ },
2952
+ children: [
2953
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
2954
+ className: "fa fa-file-download ds-u-color--primary ds-u-padding-right--1"
2955
+ }),
2956
+ "Download Dictionary CSV"
2957
+ ]
2958
+ })
2959
+ })
2960
+ ]
2961
+ }),
2962
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a6e312940f7003ef$export$2e2bcd8739ae039), {
2963
+ datasetDictionary: datasetDictionary,
2964
+ pageSize: pageSize
3258
2965
  })
3259
2966
  ]
2967
+ }),
2968
+ datasetSitewideDictionary && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a24829b27758fe6c$export$2e2bcd8739ae039), {
2969
+ datasetDictionary: datasetSitewideDictionary,
2970
+ pageSize: pageSize
3260
2971
  })
3261
2972
  ]
3262
2973
  });
3263
2974
  };
3264
- var $5644ebd2c3dbfd7b$export$2e2bcd8739ae039 = $5644ebd2c3dbfd7b$var$DatasetAdditionalInformation;
2975
+ var $6012b86ffcaf3f71$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($6012b86ffcaf3f71$var$DataDictionary);
2976
+
2977
+
2978
+
2979
+
2980
+
2981
+
2982
+
2983
+
2984
+
2985
+
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+
2992
+
2993
+ const $96d341d082bffec5$var$TruncatedResizeableTHead = ({ table: table, sortElement: sortElement = null, setAriaLiveFeedback: setAriaLiveFeedback })=>{
2994
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
2995
+ className: "dc-thead--truncated dc-thead--resizeable",
2996
+ children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
2997
+ className: "dc-c-sticky-header",
2998
+ children: headerGroup.headers.map((header)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
2999
+ table: table,
3000
+ header: header,
3001
+ sortElement: sortElement,
3002
+ setAriaLiveFeedback: setAriaLiveFeedback
3003
+ }, header.id + "_dataTableResize"))
3004
+ }, headerGroup.id))
3005
+ });
3006
+ };
3007
+ var $96d341d082bffec5$export$2e2bcd8739ae039 = $96d341d082bffec5$var$TruncatedResizeableTHead;
3008
+
3009
+
3010
+
3011
+
3012
+
3013
+ const $23763e27eda0e8d7$var$FixedSizeTHead = ({ table: table, sortElement: sortElement })=>{
3014
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("thead", {
3015
+ className: "dc-thead--fixed-size",
3016
+ children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
3017
+ children: headerGroup.headers.map((header)=>{
3018
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("th", {
3019
+ key: header.id,
3020
+ style: {
3021
+ width: header.getSize()
3022
+ },
3023
+ title: header.column.columnDef.header,
3024
+ className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
3025
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3026
+ onClick: header.column.getToggleSortingHandler(),
3027
+ className: "ds-u-display--flex",
3028
+ children: [
3029
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3030
+ children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
3031
+ }),
3032
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3033
+ className: header.column.getCanSort() ? `cursor-pointer select-none ${sortElement(header.column.getIsSorted())}` : ""
3034
+ })
3035
+ ]
3036
+ })
3037
+ });
3038
+ })
3039
+ }, headerGroup.id))
3040
+ });
3041
+ };
3042
+ var $23763e27eda0e8d7$export$2e2bcd8739ae039 = $23763e27eda0e8d7$var$FixedSizeTHead;
3265
3043
 
3266
3044
 
3267
3045
 
@@ -3271,198 +3049,692 @@ var $5644ebd2c3dbfd7b$export$2e2bcd8739ae039 = $5644ebd2c3dbfd7b$var$DatasetAddi
3271
3049
 
3272
3050
 
3273
3051
 
3274
- const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
3275
- const { count: count, columns: columns } = resource;
3276
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3277
- className: "dc-c-resource-info-table ds-l-col--12 ds-u-padding-left--0 ds-u-margin-y--2",
3052
+
3053
+
3054
+
3055
+
3056
+
3057
+
3058
+
3059
+
3060
+ const $5fe94aeb50e0798b$var$Card = ({ id: id, visible: visible, updateVisibility: updateVisibility })=>{
3061
+ const { attributes: attributes, listeners: listeners, setNodeRef: setNodeRef, transform: transform, transition: transition, isDragging: isDragging } = (0, $hgUW1$useSortable)({
3062
+ id: id
3063
+ });
3064
+ const style = {
3065
+ transform: (0, $hgUW1$CSS).Transform.toString(transform),
3066
+ transition: transition,
3067
+ opacity: isDragging ? 0.7 : 1,
3068
+ zIndex: isDragging ? 1 : 0,
3069
+ position: "relative",
3070
+ background: "white",
3071
+ touchAction: "none"
3072
+ };
3073
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
3074
+ className: "ds-u-display--flex ds-u-justify-content--between ds-u-border-bottom--1",
3075
+ ref: setNodeRef,
3076
+ style: style,
3077
+ ...listeners,
3078
+ ...attributes,
3079
+ onPointerUp: (e)=>{
3080
+ // Small hack to get around a chrome / webkit rendering bug = force chrome to repaint the checkbox
3081
+ // For whatever reason the way dnd-kit handles events doesn't work well with chrome
3082
+ // Without this code checkboxes can end up visually out of sync with app state until a repaint is forced
3083
+ // this code forces the repaint without user interaction
3084
+ const target = e.target;
3085
+ if (isDragging && target.tagName.toLowerCase() === "label") setTimeout(()=>{
3086
+ target.parentNode.querySelector("input").checked = visible;
3087
+ }, 1);
3088
+ },
3278
3089
  children: [
3279
- /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
3280
- className: "ds-u-font-size--base ds-text-heading--xl ds-text-heading--xl",
3281
- children: "About this Resource"
3090
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
3091
+ type: "checkbox",
3092
+ label: id,
3093
+ name: id + "_visibility",
3094
+ checked: visible,
3095
+ className: "ds-l-col--10 ds-u-margin-top--0 ds-u-margin-y--1 ds-u-padding-x--3",
3096
+ labelClassName: "dc-truncate",
3097
+ value: "",
3098
+ onChange: ()=>{
3099
+ updateVisibility(id, !visible);
3100
+ }
3282
3101
  }),
3283
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3284
- className: "ds-u-display--flex ds-u-text-align--center ds-u-justify-content--center ds-u-md-justify-content--start",
3102
+ /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3103
+ className: `ds-l-col--2 dkan-manage-columns-reorder-button ${isDragging && "grabbed"}`,
3104
+ "aria-label": `Reorder ${id} column`,
3105
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3106
+ className: "fa fa-sort"
3107
+ })
3108
+ })
3109
+ ]
3110
+ });
3111
+ };
3112
+ var $5fe94aeb50e0798b$export$2e2bcd8739ae039 = $5fe94aeb50e0798b$var$Card;
3113
+
3114
+
3115
+
3116
+ const $ebda441784d176a5$var$ManageColumnsContext = /*#__PURE__*/ (0, $hgUW1$createContext)({});
3117
+ var $ebda441784d176a5$export$2e2bcd8739ae039 = $ebda441784d176a5$var$ManageColumnsContext;
3118
+
3119
+
3120
+
3121
+ class $5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor extends (0, $hgUW1$KeyboardSensor) {
3122
+ // Custom function to exclude checkbox from keyboard dragging
3123
+ static activators = [
3124
+ {
3125
+ eventName: "onKeyDown",
3126
+ handler: ({ nativeEvent: event })=>{
3127
+ // prevent scrolling the list
3128
+ const isCheckbox = [
3129
+ "input",
3130
+ "checkbox"
3131
+ ].indexOf(event.target.tagName.toLowerCase()) !== -1;
3132
+ if (event.key === " " && !isCheckbox) event.preventDefault();
3133
+ // only activate on a space or return press
3134
+ if ([
3135
+ " ",
3136
+ "Enter"
3137
+ ].indexOf(event.key) === -1) return false;
3138
+ if (!isCheckbox) return true;
3139
+ return false;
3140
+ }
3141
+ }
3142
+ ];
3143
+ }
3144
+ class $5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor extends (0, $hgUW1$PointerSensor) {
3145
+ // Custom function to stop accidental checkbox clicks on pointer activation
3146
+ static activators = [
3147
+ {
3148
+ eventName: "onPointerDown",
3149
+ handler: ({ nativeEvent: event })=>{
3150
+ if (event.target.tagName.toLowerCase() === "input") return false;
3151
+ if (event.target.tagName.toLowerCase() === "label") event.target.blur();
3152
+ return true;
3153
+ }
3154
+ }
3155
+ ];
3156
+ }
3157
+ const $5d9e2ce238d53d29$var$ManageColumns = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, modalOpen: modalOpen, setModalOpen: setModalOpen })=>{
3158
+ const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ebda441784d176a5$export$2e2bcd8739ae039));
3159
+ // maintain card state separately from table state - only sync states when the Save button is pressed
3160
+ const [cards, setCards] = (0, $hgUW1$useState)(columns.map((c)=>{
3161
+ return {
3162
+ id: c.id,
3163
+ visible: c.getIsVisible()
3164
+ };
3165
+ }));
3166
+ const cardOrder = (0, $hgUW1$useMemo)(()=>cards.map(({ id: id })=>id), [
3167
+ cards
3168
+ ]);
3169
+ // keep state in sync
3170
+ (0, $hgUW1$useEffect)(()=>{
3171
+ if (columnOrder.length) setCards(columnOrder.map((c)=>{
3172
+ const column = columns.filter((col)=>col.id === c)[0];
3173
+ return {
3174
+ id: column.id,
3175
+ visible: column.getIsVisible()
3176
+ };
3177
+ }));
3178
+ }, [
3179
+ columnOrder
3180
+ ]);
3181
+ const sensors = (0, $hgUW1$useSensors)((0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxPointerSensor, {
3182
+ activationConstraint: {
3183
+ distance: 5
3184
+ }
3185
+ }), (0, $hgUW1$useSensor)($5d9e2ce238d53d29$var$ExcludeCheckboxKeyboardSensor, {
3186
+ coordinateGetter: (0, $hgUW1$sortableKeyboardCoordinates)
3187
+ }));
3188
+ const cardHiddenColumns = cards.filter((c)=>c.visible === false).length;
3189
+ const updateVisibility = (0, $hgUW1$useCallback)((id, newVisibility)=>{
3190
+ setCards(cards.map((card)=>{
3191
+ if (card.id === id) return {
3192
+ ...card,
3193
+ visible: newVisibility
3194
+ };
3195
+ return card;
3196
+ }));
3197
+ });
3198
+ function handleDragEnd(e) {
3199
+ const { active: active, over: over } = e;
3200
+ if (active.id !== over.id) {
3201
+ const oldIndex = cardOrder.indexOf(active.id);
3202
+ const newIndex = cardOrder.indexOf(over.id);
3203
+ let newCards = (0, $hgUW1$arrayMove)(cards, oldIndex, newIndex);
3204
+ setCards(newCards);
3205
+ }
3206
+ }
3207
+ const resetCards = ()=>{
3208
+ setCards(columns.map((c)=>{
3209
+ return {
3210
+ id: c.id,
3211
+ visible: c.getIsVisible()
3212
+ };
3213
+ }));
3214
+ };
3215
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3216
+ className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
3217
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Dialog), {
3218
+ heading: "Manage columns",
3219
+ isOpen: modalOpen,
3220
+ onExit: ()=>{
3221
+ setModalOpen(false);
3222
+ resetCards();
3223
+ },
3224
+ className: "dkan-manage-columns-dialog",
3225
+ actions: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3226
+ 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",
3285
3227
  children: [
3286
3228
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3287
- className: "ds-u-fill--gray-lightest ds-u-radius ds-u-margin-right--1 ds-u-padding--2",
3229
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0",
3288
3230
  children: [
3289
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3290
- className: "ds-u-padding-top--05",
3291
- children: "Rows"
3231
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3232
+ variation: "solid",
3233
+ className: "ds-l-col--6 ds-l-sm-col--auto",
3234
+ onClick: ()=>{
3235
+ setModalOpen(false);
3236
+ // update table state
3237
+ // Visibility
3238
+ // This code is building a new columnVisibility state object from the card state and doing a single setState on the table
3239
+ // vs doing a setState on every changed column individually
3240
+ const newColumnVisibility = Object.fromEntries(cards.map((c)=>Object.values(c)));
3241
+ setColumnVisibility(newColumnVisibility);
3242
+ // Card order
3243
+ const newCardOrder = cards.map((c)=>{
3244
+ return c.id;
3245
+ });
3246
+ setColumnOrder(newCardOrder);
3247
+ // save to localStorage
3248
+ const localStorageData = {
3249
+ tableColumnOrder: newCardOrder,
3250
+ tableColumnVisibility: newColumnVisibility
3251
+ };
3252
+ localStorage.setItem(id, JSON.stringify(localStorageData));
3253
+ },
3254
+ children: "Save"
3292
3255
  }),
3293
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3294
- className: "ds-u-font-weight--bold",
3295
- children: count ? count.toLocaleString() : ""
3256
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3257
+ variation: "ghost",
3258
+ className: "ds-l-col--6 ds-l-sm-col--auto",
3259
+ onClick: ()=>{
3260
+ setModalOpen(false);
3261
+ resetCards();
3262
+ },
3263
+ children: "Cancel"
3296
3264
  })
3297
3265
  ]
3298
3266
  }),
3299
3267
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3300
- className: "ds-u-fill--gray-lightest ds-u-radius ds-u-margin-right--1 ds-u-padding--2",
3301
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3302
- children: [
3303
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3304
- className: "ds-u-padding-top--05",
3305
- children: "Columns"
3306
- }),
3307
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3308
- className: "ds-u-font-weight--bold",
3309
- children: columns.length.toLocaleString()
3310
- })
3311
- ]
3268
+ 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",
3269
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3270
+ variation: "ghost",
3271
+ className: "ds-l-col--6 ds-l-sm-col--auto",
3272
+ onClick: ()=>{
3273
+ // reset to default column order and set all cards to visible
3274
+ // do not save this to the table state until the "Save" button is clicked
3275
+ setCards(defaultColumnOrder.map((column)=>{
3276
+ const card = cards.filter((c)=>c.id === column)[0];
3277
+ return {
3278
+ ...card,
3279
+ visible: true
3280
+ };
3281
+ }));
3282
+ },
3283
+ children: "Reset Columns"
3312
3284
  })
3313
3285
  })
3314
3286
  ]
3315
- })
3316
- ]
3287
+ }),
3288
+ children: [
3289
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3290
+ id: "reorder-help",
3291
+ className: "ds-u-padding-x--3",
3292
+ 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."
3293
+ }),
3294
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Choice), {
3295
+ checked: cardHiddenColumns === 0,
3296
+ type: "checkbox",
3297
+ onChange: ()=>{
3298
+ setCards(cards.map((c)=>{
3299
+ return {
3300
+ ...c,
3301
+ visible: cardHiddenColumns !== 0
3302
+ };
3303
+ }));
3304
+ },
3305
+ className: "ds-u-padding-x--3",
3306
+ name: "",
3307
+ value: "",
3308
+ label: "Select all",
3309
+ hint: cardHiddenColumns && cardHiddenColumns + " columns hidden"
3310
+ }),
3311
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3312
+ 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",
3313
+ children: [
3314
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3315
+ children: "Display column"
3316
+ }),
3317
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3318
+ children: "Reorder"
3319
+ })
3320
+ ]
3321
+ }),
3322
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$DndContext), {
3323
+ collisionDetection: (0, $hgUW1$closestCenter),
3324
+ modifiers: [
3325
+ (0, $hgUW1$restrictToVerticalAxis)
3326
+ ],
3327
+ sensors: sensors,
3328
+ onDragEnd: handleDragEnd,
3329
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$SortableContext), {
3330
+ items: cardOrder,
3331
+ strategy: (0, $hgUW1$verticalListSortingStrategy),
3332
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
3333
+ className: "dkan-manage-columns-list",
3334
+ children: cards.map((card)=>{
3335
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5fe94aeb50e0798b$export$2e2bcd8739ae039), {
3336
+ id: card.id,
3337
+ visible: card.visible,
3338
+ updateVisibility: updateVisibility
3339
+ }, card.id);
3340
+ })
3341
+ })
3342
+ })
3343
+ })
3344
+ ]
3345
+ })
3317
3346
  });
3318
3347
  };
3319
- var $0958733ee130fc44$export$2e2bcd8739ae039 = $0958733ee130fc44$var$ResourceInformation;
3348
+ var $5d9e2ce238d53d29$export$2e2bcd8739ae039 = $5d9e2ce238d53d29$var$ManageColumns;
3320
3349
 
3321
3350
 
3322
- function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
3323
- if (dist && dist.data) {
3324
- if (dist.data.format) return dist.data.format.toLowerCase();
3325
- if (dist.data.mediaType) {
3326
- const mediaType = dist.data.mediaType.split("/");
3327
- if (mediaType.length && mediaType[1]) return mediaType[1].toLowerCase();
3328
- }
3329
- if (dist.data["%Ref:downloadURL"].length && dist.data["%Ref:downloadURL"][0].data) {
3330
- if (dist.data["%Ref:downloadURL"][0].data.mimeType) {
3331
- const mimeType = dist.data["%Ref:downloadURL"][0].data.mimeType.split("/");
3332
- if (mimeType.length && mimeType[1]) return mimeType[1].toLowerCase();
3333
- }
3334
- }
3335
- }
3336
- return "";
3337
- }
3338
3351
 
3339
3352
 
3340
3353
 
3341
- const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource: resource, title: title })=>{
3342
- const sm = (0, $hgUW1$useMediaQuery)({
3343
- minWidth: 0,
3344
- maxWidth: 767
3354
+
3355
+
3356
+ const $16bd41951b91f02d$var$FullScreenDataTable = ({ modalOpen: modalOpen, setModalOpen: setModalOpen })=>{
3357
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3358
+ className: `ds-c-dialog-wrap${modalOpen ? " open" : ""}`,
3359
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dialog), {
3360
+ heading: "Dataset Explorer",
3361
+ isOpen: modalOpen,
3362
+ onExit: ()=>setModalOpen(false),
3363
+ className: "dkan-full-screen-dataset-dialog",
3364
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
3365
+ isModal: true,
3366
+ closeFullScreenModal: ()=>setModalOpen(false)
3367
+ })
3368
+ })
3345
3369
  });
3346
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3347
- className: "ds-u-display--flex ds-u-flex-wrap--wrap",
3370
+ };
3371
+ var $16bd41951b91f02d$export$2e2bcd8739ae039 = $16bd41951b91f02d$var$FullScreenDataTable;
3372
+
3373
+
3374
+ const $71b4324f265dec16$var$DataTableControls = ({ id: id, columns: columns, defaultColumnOrder: defaultColumnOrder, isModal: isModal, closeFullScreenModal: closeFullScreenModal })=>{
3375
+ const [manageColumnsModalOpen, setManageColumnsModalOpen] = (0, $hgUW1$useState)(false);
3376
+ const [fullScreenModalOpen, setFullScreenModalOpen] = (0, $hgUW1$useState)(false);
3377
+ const hiddenColumns = columns.filter((c)=>c.getIsVisible() === false).length;
3378
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3348
3379
  children: [
3349
- /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
3350
- className: "ds-l-col--12 ds-u-padding-left--0 ds-text-heading--2xl",
3351
- children: "Resources"
3352
- }),
3353
- distributions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
3354
- className: "ds-c-list ds-c-list--bare dc-c-resource-full-width",
3355
- children: distributions.map((dist)=>{
3356
- const fileFormat = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(dist);
3357
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
3358
- className: `ds-u-display--flex ds-u-flex-wrap--wrap ${fileFormat !== "csv" && "ds-u-margin-bottom--2"}`,
3380
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3381
+ className: "ds-u-border-top--1 ds-u-fill--gray-lightest ds-u-display--flex ds-u-justify-content--between",
3382
+ children: [
3383
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3384
+ children: hiddenColumns > 0 && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Alert), {
3385
+ variation: "warn",
3386
+ children: [
3387
+ hiddenColumns,
3388
+ " Columns Hidden"
3389
+ ]
3390
+ })
3391
+ }),
3392
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3359
3393
  children: [
3360
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3361
- className: "ds-u-font-weight--bold ds-u-font-size--lg ds-l-col--12 ds-l-md-col--6 ds-u-padding-left--0 ds-u-align-items--center ds-u-display--flex",
3394
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
3395
+ "aria-label": "Manage columns - Opens in a dialog",
3396
+ className: "ds-c-button ds-c-button--ghost ds-u-margin-y--1",
3397
+ onClick: ()=>{
3398
+ setManageColumnsModalOpen(true);
3399
+ },
3362
3400
  children: [
3363
3401
  /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3364
- className: "fa ds-u-color--primary ds-u-padding-right--1 ds-u-font-size--3xl fa-file-" + (fileFormat == "xlsx" ? "xls" : fileFormat)
3402
+ className: "far fa-cog ds-u-margin-right--1"
3365
3403
  }),
3366
- /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
3367
- className: "ds-u-margin-top--0",
3368
- children: [
3369
- dist.data.title ? dist.data.title : title,
3370
- " (" + fileFormat.toUpperCase() + ")"
3371
- ]
3372
- })
3404
+ "Manage Columns"
3373
3405
  ]
3374
3406
  }),
3375
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3376
- className: "ds-l-col--12 ds-l-md-col--6 ds-u-text-align--center ds-u-md-text-align--right ds-u-margin-top--2 ds-u-md-margin-top--0",
3377
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
3378
- href: dist.data.downloadURL,
3379
- style: {
3380
- order: sm ? "1" : "0",
3381
- width: sm ? "100%" : "auto"
3382
- },
3383
- "aria-label": `Download ${dist.data.title || title} ${fileFormat}`,
3384
- className: "ds-c-button",
3385
- children: [
3386
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3387
- className: "fa fa-file-download ds-u-color--primary ds-u-padding-right--1"
3388
- }),
3389
- "Download"
3390
- ]
3391
- })
3392
- }),
3393
- dist.data.description && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3394
- className: "ds-u-measure--wide ds-u-margin-bottom--7",
3395
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3396
- className: "dc-c-metadata-description ds-u-margin--0",
3397
- dangerouslySetInnerHTML: {
3398
- __html: (0, $hgUW1$dompurify).sanitize(dist.data.description)
3399
- }
3400
- })
3401
- }),
3402
- fileFormat === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $0958733ee130fc44$export$2e2bcd8739ae039), {
3403
- resource: resource
3407
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("button", {
3408
+ "aria-label": isModal ? "Close Full Screen dialog" : "Full Screen mode - Opens in a dialog",
3409
+ className: "ds-c-button ds-c-button--ghost ds-u-margin-y--1",
3410
+ onClick: ()=>{
3411
+ if (isModal) closeFullScreenModal();
3412
+ else setFullScreenModalOpen(true);
3413
+ },
3414
+ children: [
3415
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3416
+ className: `fa ${isModal ? "fa-compress" : "fa-expand"} ds-u-margin-right--1`
3417
+ }),
3418
+ isModal ? "Exit Full Screen" : "Full Screen"
3419
+ ]
3404
3420
  })
3405
3421
  ]
3406
- }, dist.identifier);
3407
- })
3408
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3409
- className: "ds-u-margin-bottom--2",
3410
- children: "No resources have been added to this dataset."
3422
+ })
3423
+ ]
3424
+ }),
3425
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3426
+ children: [
3427
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $5d9e2ce238d53d29$export$2e2bcd8739ae039), {
3428
+ id: id,
3429
+ columns: columns,
3430
+ defaultColumnOrder: defaultColumnOrder,
3431
+ modalOpen: manageColumnsModalOpen,
3432
+ setModalOpen: setManageColumnsModalOpen
3433
+ }),
3434
+ !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $16bd41951b91f02d$export$2e2bcd8739ae039), {
3435
+ modalOpen: fullScreenModalOpen,
3436
+ setModalOpen: setFullScreenModalOpen
3437
+ })
3438
+ ]
3411
3439
  })
3412
3440
  ]
3413
3441
  });
3414
3442
  };
3415
- var $7357cc0f79f9c514$export$2e2bcd8739ae039 = $7357cc0f79f9c514$var$Resource;
3443
+ var $71b4324f265dec16$export$2e2bcd8739ae039 = $71b4324f265dec16$var$DataTableControls;
3416
3444
 
3417
3445
 
3418
- const $364dc44850cd8f7f$var$DatasetOverview = ({ dataset: dataset, resource: resource, distributions: distributions, metadataMapping: metadataMapping })=>{
3419
- const md = (0, $hgUW1$useMediaQuery)({
3420
- minWidth: 0,
3421
- maxWidth: 768
3446
+
3447
+ const $43a30d745a7bbc86$var$DataTableContext = /*#__PURE__*/ (0, $hgUW1$createContext)({
3448
+ id: null
3449
+ });
3450
+ var $43a30d745a7bbc86$export$2e2bcd8739ae039 = $43a30d745a7bbc86$var$DataTableContext;
3451
+
3452
+
3453
+
3454
+ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sortTransform, tablePadding: tablePadding, canResize: canResize, loading: loading = false, isModal: isModal, closeFullScreenModal: closeFullScreenModal })=>{
3455
+ const { id: id, resource: resource, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
3456
+ const { columnOrder: columnOrder, setColumnOrder: setColumnOrder, columnVisibility: columnVisibility, setColumnVisibility: setColumnVisibility } = (0, $hgUW1$useContext)((0, $ebda441784d176a5$export$2e2bcd8739ae039));
3457
+ const data = resource.values;
3458
+ const [sorting, setSorting] = (0, $hgUW1$useState)([]);
3459
+ const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
3460
+ const dataTableWrapperElement = (0, $hgUW1$useRef)(null);
3461
+ const columnHelper = (0, $hgUW1$createColumnHelper)();
3462
+ const table_columns = columns.map((col)=>{
3463
+ if (col.cell) return columnHelper.accessor(col.accessor, {
3464
+ header: col.header,
3465
+ cell: col.cell
3466
+ });
3467
+ return columnHelper.accessor(col.accessor, {
3468
+ header: col.header
3469
+ });
3470
+ });
3471
+ const [highlightRow, setHighlightRow] = (0, $hgUW1$useState)(null);
3472
+ (0, $hgUW1$useEffect)(()=>{
3473
+ if (!columnOrder.length) setColumnOrder(table_columns.map((c)=>c.accessorKey));
3474
+ }, [
3475
+ columnOrder
3476
+ ]);
3477
+ const sortElement = (isSorted, onClickFn)=>{
3478
+ if (isSorted === "asc") return "dc-c-sort--asc";
3479
+ if (isSorted === "desc") return "dc-c-sort--desc";
3480
+ return "dc-c-sort--default";
3481
+ };
3482
+ const filters = [];
3483
+ const table = (0, $hgUW1$useReactTable)({
3484
+ data: data,
3485
+ columns: table_columns,
3486
+ manualSorting: true,
3487
+ state: {
3488
+ columnOrder: columnOrder,
3489
+ columnVisibility: columnVisibility,
3490
+ sorting: sorting
3491
+ },
3492
+ columnResizeMode: "onChange",
3493
+ onSortingChange: setSorting,
3494
+ onColumnOrderChange: setColumnOrder,
3495
+ onColumnVisibilityChange: setColumnVisibility,
3496
+ getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
3497
+ getSortedRowModel: (0, $hgUW1$getSortedRowModel)(),
3498
+ debugTable: false
3422
3499
  });
3423
- const rows = (0, $5644ebd2c3dbfd7b$export$eea3a12df15499ca)(metadataMapping, dataset);
3500
+ (0, $hgUW1$useEffect)(()=>{
3501
+ const normalizedSort = sortTransform ? sortTransform(sorting) : filters;
3502
+ resource.setSort(normalizedSort);
3503
+ }, [
3504
+ sorting
3505
+ ]);
3506
+ const defaultColumnOrder = (0, $hgUW1$useMemo)(()=>table_columns.map((column)=>column.accessorKey), []);
3507
+ const tableWrapperWidth = ()=>{
3508
+ if (dataTableWrapperElement.current) return dataTableWrapperElement.current.offsetWidth;
3509
+ return "auto";
3510
+ };
3511
+ (0, $hgUW1$useEffect)(()=>{
3512
+ setHighlightRow(null);
3513
+ }, [
3514
+ data
3515
+ ]);
3424
3516
  return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3425
3517
  children: [
3426
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $7357cc0f79f9c514$export$2e2bcd8739ae039), {
3427
- distributions: distributions,
3428
- resource: resource,
3429
- title: dataset.title
3518
+ datasetTableControls && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3519
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $71b4324f265dec16$export$2e2bcd8739ae039), {
3520
+ id: id,
3521
+ columns: table.getAllLeafColumns(),
3522
+ defaultColumnOrder: defaultColumnOrder,
3523
+ isModal: isModal,
3524
+ closeFullScreenModal: closeFullScreenModal
3525
+ })
3430
3526
  }),
3431
3527
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3432
- className: "dc-c-additional-info-table ds-u-margin-bottom--6 ds-u-padding-left--0 ds-l-lg-col--7 ds-l-md-col--9 ds-l-col--12",
3528
+ className: "dc-c-datatable-wrapper",
3529
+ tabIndex: 0,
3530
+ ref: dataTableWrapperElement,
3433
3531
  children: [
3434
- /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
3435
- className: "ds-text-heading--2xl ds-text-heading--2xl",
3436
- children: "Additional Information"
3437
- }),
3438
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Table), {
3439
- compact: true,
3440
- stackable: true,
3441
- stackableBreakpoint: "md",
3442
- warningDisabled: true,
3443
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableBody), {
3444
- children: rows.map((r)=>/*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableRow), {
3445
- children: [
3446
- md ? "" : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3447
- component: "th",
3448
- className: "ds-u-font-weight--bold",
3449
- children: r.label
3450
- }),
3451
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3452
- stackedTitle: r.label,
3453
- children: r.value
3532
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("table", {
3533
+ style: {
3534
+ width: canResize ? table.getCenterTotalSize() : "100%",
3535
+ minWidth: tableWrapperWidth()
3536
+ },
3537
+ className: "dc-c-datatable",
3538
+ children: [
3539
+ canResize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $96d341d082bffec5$export$2e2bcd8739ae039), {
3540
+ table: table,
3541
+ sortElement: sortElement,
3542
+ setAriaLiveFeedback: setAriaLiveFeedback
3543
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $23763e27eda0e8d7$export$2e2bcd8739ae039), {
3544
+ table: table,
3545
+ sortElement: sortElement
3546
+ }),
3547
+ loading ? /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {}) : /*#__PURE__*/ (0, $hgUW1$jsx)("tbody", {
3548
+ children: table.getRowModel().rows.map((row, index)=>{
3549
+ const even = (index + 1) % 2 === 0;
3550
+ const highlight = highlightRow === row.id;
3551
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("tr", {
3552
+ className: `${highlight ? "dc-c-datatable--highlight-row" : even && "dc-c-datatable--even-row"}`,
3553
+ onClick: ()=>setHighlightRow(row.id),
3554
+ children: row.getVisibleCells().map((cell)=>{
3555
+ let classList = "dc-truncate ds-u-padding-x--1";
3556
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("td", {
3557
+ key: cell.id,
3558
+ style: {
3559
+ maxWidth: cell.column.getSize()
3560
+ },
3561
+ className: `${classList} ${tablePadding}`,
3562
+ title: cell.getValue(),
3563
+ children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
3564
+ });
3454
3565
  })
3455
- ]
3456
- }, `${r.label}_${dataset.identifier}`))
3457
- })
3566
+ }, row.id);
3567
+ })
3568
+ })
3569
+ ]
3570
+ }),
3571
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3572
+ className: "sr-only",
3573
+ "aria-live": "assertive",
3574
+ "aria-atomic": "true",
3575
+ children: ariaLiveFeedback
3458
3576
  })
3459
3577
  ]
3578
+ }),
3579
+ loading && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
3580
+ "aria-valuetext": "Dataset loading",
3581
+ role: "status",
3582
+ className: "ds-u-margin--3"
3583
+ }),
3584
+ !loading && table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
3585
+ variation: "warn",
3586
+ children: "No results found for the current filters"
3460
3587
  })
3461
3588
  ]
3462
3589
  });
3463
3590
  };
3464
- var $364dc44850cd8f7f$export$2e2bcd8739ae039 = $364dc44850cd8f7f$var$DatasetOverview;
3591
+ var $d98f94c79ddf4e0e$export$2e2bcd8739ae039 = $d98f94c79ddf4e0e$var$DataTable;
3592
+
3465
3593
 
3594
+ function $aa4450dcbeef3ac0$export$385a5aba38cc3325(sortArray) {
3595
+ let newQuery = [];
3596
+ sortArray.forEach((s)=>{
3597
+ return newQuery.push({
3598
+ property: s.id,
3599
+ order: s.desc ? "desc" : "asc"
3600
+ });
3601
+ });
3602
+ return newQuery;
3603
+ }
3604
+
3605
+
3606
+ // Example custom column headers, where only effective date has an ! at the end
3607
+ // [
3608
+ // {schema: 'date', cell: ({ value }) => localeDate(value),},
3609
+ // {accessor: 'effective_date',cell: ({ value }) => localeDate(value) + '!',},
3610
+ // ]
3611
+ function $7264a673914aa746$export$8049e8f40a9bdfb8(customHeaders, columns, schema) {
3612
+ return columns.map((column)=>{
3613
+ const customAccessorIndex = customHeaders.findIndex((header)=>header.accessor === column);
3614
+ const customSchemaIndex = customHeaders.findIndex((header)=>header.schema === schema.fields[column].mysql_type);
3615
+ let newColumn = {};
3616
+ // If specific accessor is passed, this will override a general mysql_type Cell rewrite.
3617
+ if (customAccessorIndex > -1) {
3618
+ newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
3619
+ newColumn.accessor = column;
3620
+ newColumn.cell = customHeaders[customAccessorIndex].cell;
3621
+ } else {
3622
+ newColumn.header = schema && schema.fields[column].description ? schema.fields[column].description : column;
3623
+ newColumn.accessor = column;
3624
+ if (customSchemaIndex > -1) newColumn.cell = customHeaders[customSchemaIndex].cell;
3625
+ }
3626
+ return newColumn;
3627
+ });
3628
+ }
3629
+ function $7264a673914aa746$export$e284ae5d89467c8f(date) {
3630
+ if (!date) return date;
3631
+ date = new Date(date);
3632
+ date = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
3633
+ return date;
3634
+ }
3635
+ function $7264a673914aa746$export$6b5e57d20078142b(value, operator) {
3636
+ let newValue = value;
3637
+ if (Array.isArray(newValue)) newValue = newValue.join(",");
3638
+ // return newValue.replace(/(^\%+|\%+$)/gm, '');
3639
+ return newValue;
3640
+ }
3641
+ const $7264a673914aa746$export$5f89a5ae87bc48e1 = [
3642
+ {
3643
+ label: "Is",
3644
+ value: "="
3645
+ },
3646
+ {
3647
+ label: "Starts With",
3648
+ value: "starts with"
3649
+ },
3650
+ {
3651
+ label: "Contains",
3652
+ value: "contains"
3653
+ },
3654
+ {
3655
+ label: "Is Not",
3656
+ value: "<>"
3657
+ },
3658
+ {
3659
+ label: "Or",
3660
+ value: "in"
3661
+ },
3662
+ {
3663
+ label: "Is",
3664
+ value: "="
3665
+ },
3666
+ {
3667
+ label: "Is Not",
3668
+ value: "<>"
3669
+ },
3670
+ {
3671
+ label: "Greater Than",
3672
+ value: ">"
3673
+ },
3674
+ {
3675
+ label: "Less Than",
3676
+ value: "<"
3677
+ }
3678
+ ];
3679
+ function $7264a673914aa746$export$2b9377795161999(type) {
3680
+ switch(type){
3681
+ case "text":
3682
+ case "string":
3683
+ return [
3684
+ {
3685
+ label: "Is",
3686
+ value: "="
3687
+ },
3688
+ {
3689
+ label: "Starts With",
3690
+ value: "starts with"
3691
+ },
3692
+ {
3693
+ label: "Contains",
3694
+ value: "contains"
3695
+ },
3696
+ {
3697
+ label: "Is Not",
3698
+ value: "<>"
3699
+ },
3700
+ {
3701
+ label: "Or",
3702
+ value: "in"
3703
+ }
3704
+ ];
3705
+ case "date":
3706
+ return [
3707
+ {
3708
+ label: "Is",
3709
+ value: "="
3710
+ },
3711
+ {
3712
+ label: "Is Not",
3713
+ value: "<>"
3714
+ },
3715
+ {
3716
+ label: "Greater Than",
3717
+ value: ">"
3718
+ },
3719
+ {
3720
+ label: "Less Than",
3721
+ value: "<"
3722
+ }
3723
+ ];
3724
+ default:
3725
+ // These 2 should be safe for all data types
3726
+ return [
3727
+ {
3728
+ label: "Is",
3729
+ value: "="
3730
+ },
3731
+ {
3732
+ label: "Is Not",
3733
+ value: "<>"
3734
+ }
3735
+ ];
3736
+ }
3737
+ }
3466
3738
 
3467
3739
 
3468
3740
 
@@ -3471,64 +3743,182 @@ var $364dc44850cd8f7f$export$2e2bcd8739ae039 = $364dc44850cd8f7f$var$DatasetOver
3471
3743
 
3472
3744
 
3473
3745
 
3474
- const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
3475
- return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3476
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
3477
- url: endpoint
3478
- })
3746
+ const $2ed0091f7e32d1e6$var$DataTablePageResults = ({ totalRows: totalRows, limit: limit, offset: offset, className: className = "data-table-results" })=>{
3747
+ const numTotalRows = totalRows;
3748
+ if (numTotalRows === 0) return /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3749
+ className: className,
3750
+ children: `0 - 0 of 0 rows`
3751
+ });
3752
+ const ofTotal = ()=>{
3753
+ if (limit >= numTotalRows) return numTotalRows;
3754
+ if (limit + offset >= numTotalRows) return numTotalRows;
3755
+ if (offset === 0) return limit;
3756
+ return offset + limit;
3757
+ };
3758
+ const page = offset / limit;
3759
+ const startTotal = ()=>page * limit + 1;
3760
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
3761
+ className: className,
3762
+ children: [
3763
+ "Displaying",
3764
+ " ",
3765
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3766
+ className: "ds-u-font-weight--bold",
3767
+ children: `${startTotal().toLocaleString()} - ${ofTotal().toLocaleString()}`
3768
+ }),
3769
+ " ",
3770
+ "of ",
3771
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3772
+ className: "ds-u-font-weight--bold",
3773
+ children: `${numTotalRows.toLocaleString()}`
3774
+ }),
3775
+ " ",
3776
+ "results"
3777
+ ]
3479
3778
  });
3480
3779
  };
3481
- var $789279954d8eff7f$export$2e2bcd8739ae039 = $789279954d8eff7f$var$ApiDocumentation;
3780
+ $2ed0091f7e32d1e6$var$DataTablePageResults.propTypes = {
3781
+ className: (0, $hgUW1$proptypes).string,
3782
+ totalRows: (0, $hgUW1$proptypes).number.isRequired,
3783
+ limit: (0, $hgUW1$proptypes).number.isRequired,
3784
+ offset: (0, $hgUW1$proptypes).number.isRequired
3785
+ };
3786
+ var $2ed0091f7e32d1e6$export$2e2bcd8739ae039 = $2ed0091f7e32d1e6$var$DataTablePageResults;
3482
3787
 
3483
3788
 
3484
- const $cf6eaefd6b928de3$var$DatasetAPI = ({ id: id, rootUrl: rootUrl, apiUrl: apiUrl, additionalParams: additionalParams })=>{
3485
- return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3789
+
3790
+
3791
+
3792
+ const $6380a4a580b24362$var$DataTableHeader = ({ resource: resource, downloadURL: downloadURL, unfilteredDownloadURL: unfilteredDownloadURL, setPage: setPage })=>{
3793
+ const { limit: limit, offset: offset, count: count, conditions: conditions, setLimit: setLimit, setOffset: setOffset } = resource;
3794
+ const intCount = count ? count : 0;
3795
+ const rowOptions = [
3796
+ 10,
3797
+ 25,
3798
+ 50,
3799
+ 100
3800
+ ];
3801
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3802
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between",
3486
3803
  children: [
3487
3804
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3488
- className: "ds-u-display--flex ds-u-flex-wrap--wrap",
3805
+ 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",
3489
3806
  children: [
3807
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3808
+ className: "ds-l-col--12 ds-l-sm-col--auto ds-u-padding-x--0 ds-u-margin-bottom--2",
3809
+ children: conditions && conditions.length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
3810
+ onOpen: ()=>{
3811
+ navigator.clipboard.writeText(window.location.href);
3812
+ },
3813
+ className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
3814
+ placement: "bottom",
3815
+ dialog: true,
3816
+ ariaLabel: "Copy link to filtered data",
3817
+ title: "Link copied to clipboard",
3818
+ "aria-disabled": !conditions || conditions.length === 0,
3819
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3820
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
3821
+ children: [
3822
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3823
+ className: "fas fa-copy"
3824
+ }),
3825
+ " Copy link to filtered data"
3826
+ ]
3827
+ })
3828
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3829
+ "aria-disabled": true,
3830
+ "aria-label": "Copy link to filtered data",
3831
+ className: "ds-c-button ds-u-text-align--center ds-u-display--inline-block ds-l-col--12",
3832
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3833
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
3834
+ children: [
3835
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3836
+ className: "fas fa-copy"
3837
+ }),
3838
+ " Copy link to filtered data"
3839
+ ]
3840
+ })
3841
+ })
3842
+ }),
3490
3843
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3491
- className: "ds-l-col--12 ds-l-md-col--9 ds-u-padding-left--0",
3844
+ 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",
3492
3845
  children: [
3493
- /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
3494
- className: "ds-text-heading--2xl",
3495
- children: "Try the API"
3846
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3847
+ 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",
3848
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3849
+ 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",
3850
+ href: downloadURL,
3851
+ "aria-disabled": !conditions || conditions.length === 0,
3852
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3853
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
3854
+ children: [
3855
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3856
+ className: "fas fa-file-csv"
3857
+ }),
3858
+ " Download filtered data (CSV)"
3859
+ ]
3860
+ })
3861
+ })
3496
3862
  }),
3497
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3498
- children: "The Open Data API (ODA) provides programmatic access to this dataset including the ability to filter, query, and aggregate data."
3863
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3864
+ 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",
3865
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
3866
+ 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",
3867
+ href: unfilteredDownloadURL,
3868
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3869
+ className: "ds-u-font-weight--semibold ds-u-margin-left--1 ds-u-padding--0",
3870
+ children: [
3871
+ /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3872
+ className: "fas fa-file-csv"
3873
+ }),
3874
+ " Download full dataset (CSV)"
3875
+ ]
3876
+ })
3877
+ })
3499
3878
  })
3500
3879
  ]
3880
+ })
3881
+ ]
3882
+ }),
3883
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3884
+ 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",
3885
+ children: [
3886
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3887
+ className: "ds-l-col--12 ds-l-sm-col--8 ds-u-padding-x--0",
3888
+ children: !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2ed0091f7e32d1e6$export$2e2bcd8739ae039), {
3889
+ totalRows: intCount,
3890
+ limit: limit,
3891
+ offset: offset
3892
+ })
3501
3893
  }),
3502
3894
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3503
- className: "ds-l-col--12 ds-l-md-col--3 ds-u-font-weight--bold ds-u-margin-top--2 ds-u-padding-left--0 ds-u-md-padding-left--2",
3504
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
3505
- href: apiUrl,
3506
- children: [
3507
- "View API",
3508
- " ",
3509
- /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3510
- style: {
3511
- whiteSpace: "nowrap"
3512
- },
3513
- children: [
3514
- "specification ",
3515
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3516
- className: "fa fa-arrow-right ds-u-font-weight--bold"
3517
- })
3518
- ]
3519
- })
3520
- ]
3895
+ className: "ds-l-col--12 ds-l-sm-col--4 ds-u-display--flex ds-u-justify-content--end ds-u-padding-x--0",
3896
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3897
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3898
+ options: rowOptions.map((row)=>({
3899
+ label: row.toString(),
3900
+ value: row
3901
+ })),
3902
+ size: "medium",
3903
+ label: "Rows per page:",
3904
+ labelClassName: "ds-u-margin-top--0",
3905
+ name: "datatable_rows_per_page",
3906
+ onChange: (e)=>{
3907
+ setLimit(parseInt(e.target.value));
3908
+ setPage(1);
3909
+ setOffset(0);
3910
+ },
3911
+ value: limit.toString(),
3912
+ defaultValue: limit.toString()
3913
+ })
3521
3914
  })
3522
3915
  })
3523
3916
  ]
3524
- }),
3525
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $789279954d8eff7f$export$2e2bcd8739ae039), {
3526
- endpoint: `${rootUrl}/metastore/schemas/dataset/items/${id}/docs${additionalParams && additionalParams.ACA ? "?ACA=" + additionalParams.ACA + "&redirect=false" : ""}`
3527
3917
  })
3528
3918
  ]
3529
3919
  });
3530
3920
  };
3531
- var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
3921
+ var $6380a4a580b24362$export$2e2bcd8739ae039 = $6380a4a580b24362$var$DataTableHeader;
3532
3922
 
3533
3923
 
3534
3924
 
@@ -3540,6 +3930,75 @@ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
3540
3930
 
3541
3931
 
3542
3932
 
3933
+ const $bef7bff2823feea2$var$QueryTitle = ({ conditions: conditions, schema: schema, customColumns: customColumns })=>{
3934
+ const { fields: fields } = schema;
3935
+ const prependedMessage = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
3936
+ children: "Data filters: "
3937
+ });
3938
+ if (!conditions || !conditions.length) return /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
3939
+ className: "ds-u-margin-y--0",
3940
+ children: [
3941
+ prependedMessage,
3942
+ " none"
3943
+ ]
3944
+ });
3945
+ function formatValue(text, property) {
3946
+ if (customColumns && customColumns.length > 0) {
3947
+ let newValue = text;
3948
+ let customColumn = customColumns.find((c)=>c.accessor === property);
3949
+ if (customColumn && customColumn.cell) return customColumn.cell({
3950
+ value: text
3951
+ });
3952
+ return text;
3953
+ } else return text;
3954
+ }
3955
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3956
+ className: "dc-querybuilder-title",
3957
+ children: [
3958
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
3959
+ className: "ds-u-margin-y--0",
3960
+ children: prependedMessage
3961
+ }),
3962
+ conditions.map((c)=>{
3963
+ const field = fields[c.property];
3964
+ const description = field && field.description ? field.description : c.property;
3965
+ const operator = (0, $7264a673914aa746$export$5f89a5ae87bc48e1).find((op)=>op.value === c.operator);
3966
+ const cleanedText = (0, $7264a673914aa746$export$6b5e57d20078142b)(c.value);
3967
+ const formattedText = formatValue(cleanedText, c.property);
3968
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
3969
+ className: "ds-u-fill--background ds-u-padding--1 ds-u-margin-y--1 ds-u-display--inline-block ds-u-font-weight--semibold",
3970
+ children: [
3971
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3972
+ className: "ds-u-font-weight--bold",
3973
+ children: description
3974
+ }),
3975
+ " ",
3976
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3977
+ className: "ds-u-font-weight--normal",
3978
+ children: operator.label.toUpperCase()
3979
+ }),
3980
+ " ",
3981
+ /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
3982
+ className: "ds-u-color--success",
3983
+ children: formattedText
3984
+ })
3985
+ ]
3986
+ });
3987
+ }).reduce((prev, curr)=>[
3988
+ prev,
3989
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Badge), {
3990
+ className: "ds-u-margin-x--1",
3991
+ variation: "info",
3992
+ children: "AND"
3993
+ }),
3994
+ curr
3995
+ ])
3996
+ ]
3997
+ });
3998
+ };
3999
+ var $bef7bff2823feea2$export$2e2bcd8739ae039 = $bef7bff2823feea2$var$QueryTitle;
4000
+
4001
+
3543
4002
 
3544
4003
 
3545
4004
 
@@ -3547,441 +4006,419 @@ var $cf6eaefd6b928de3$export$2e2bcd8739ae039 = $cf6eaefd6b928de3$var$DatasetAPI;
3547
4006
 
3548
4007
 
3549
4008
 
3550
- const $6765a74df807d015$var$DataDictionaryTable = ({ tableColumns: tableColumns, tableData: tableData, pageSize: pageSize, columnFilters: columnFilters })=>{
3551
- const [sorting, setSorting] = (0, $hgUW1$useState)([]);
3552
- const [ariaLiveFeedback, setAriaLiveFeedback] = (0, $hgUW1$useState)("");
3553
- const mobile = (0, $hgUW1$useMediaQuery)({
3554
- minWidth: 0,
3555
- maxWidth: 544
4009
+ function $6369abf590ca298f$var$getStartDate(condition, schema, id) {
4010
+ if (schema[id].fields[condition.property].mysql_type === "date") {
4011
+ const newDate = new Date(condition.value.toString());
4012
+ if (newDate instanceof Date && !isNaN(newDate.getTime())) return newDate;
4013
+ }
4014
+ return new Date();
4015
+ }
4016
+ const $6369abf590ca298f$var$QueryRow = ({ id: id, condition: condition, index: index, update: update, remove: remove, propertyOptions: propertyOptions, schema: schema })=>{
4017
+ const [operator, setOperator] = (0, $hgUW1$useState)(condition.operator);
4018
+ const [property, setProperty] = (0, $hgUW1$useState)(condition.property);
4019
+ const [value, setValue] = (0, $hgUW1$useState)(condition.value);
4020
+ const [startDate, setStartDate] = (0, $hgUW1$react).useState($6369abf590ca298f$var$getStartDate(condition, schema, id));
4021
+ const xl = (0, $hgUW1$useMediaQuery)({
4022
+ minWidth: 1280
3556
4023
  });
3557
- const sortElement = (isSorted)=>{
3558
- if (isSorted === "asc") return "dc-c-sort--asc";
3559
- if (isSorted === "desc") return "dc-c-sort--desc";
3560
- return "dc-c-sort--default";
3561
- };
3562
- const table = (0, $hgUW1$useReactTable)({
3563
- data: tableData,
3564
- columns: tableColumns,
3565
- columnResizeMode: "onChange",
3566
- getCoreRowModel: (0, $hgUW1$getCoreRowModel)(),
3567
- getFilteredRowModel: (0, $hgUW1$getFilteredRowModel)(),
3568
- getPaginationRowModel: (0, $hgUW1$getPaginationRowModel)(),
3569
- getSortedRowModel: (0, $hgUW1$getSortedRowModel)(),
3570
- onSortingChange: setSorting,
3571
- initialState: {
3572
- pagination: {
3573
- pageSize: pageSize,
3574
- pageIndex: 0
4024
+ (0, $hgUW1$useEffect)(()=>{
4025
+ if (property !== condition.property) {
4026
+ if (property) update(index, "property", property);
4027
+ else update(index, "property", "");
4028
+ if (schema[id].fields[condition.property].mysql_type === "date") {
4029
+ if (!value) setValue(startDate.toJSON().slice(0, 10));
3575
4030
  }
3576
- },
3577
- state: {
3578
- sorting: sorting,
3579
- columnFilters: columnFilters
3580
4031
  }
3581
- });
3582
- const sortOptions = [
3583
- {
3584
- value: "default",
3585
- label: "No Sort"
3586
- },
3587
- {
3588
- value: "titleasc",
3589
- label: "Title A-Z"
3590
- },
3591
- {
3592
- value: "titledesc",
3593
- label: "Title Z-A"
3594
- },
3595
- {
3596
- value: "typeasc",
3597
- label: "Type A-Z"
3598
- },
3599
- {
3600
- value: "typedesc",
3601
- label: "Type Z-A"
4032
+ }, [
4033
+ property,
4034
+ value,
4035
+ startDate,
4036
+ schema,
4037
+ id,
4038
+ condition
4039
+ ]);
4040
+ (0, $hgUW1$useEffect)(()=>{
4041
+ if (operator !== condition.operator) {
4042
+ if (operator) update(index, "operator", operator);
4043
+ else update(index, "operator", "");
3602
4044
  }
3603
- ];
3604
- const sortStatesLookup = {
3605
- default: [],
3606
- titleasc: [
3607
- {
3608
- id: "titleResizable",
3609
- desc: false
3610
- }
3611
- ],
3612
- titledesc: [
3613
- {
3614
- id: "titleResizable",
3615
- desc: true
3616
- }
3617
- ],
3618
- typeasc: [
3619
- {
3620
- id: "type",
3621
- desc: false
3622
- }
3623
- ],
3624
- typedesc: [
3625
- {
3626
- id: "type",
3627
- desc: true
3628
- }
3629
- ]
3630
- };
3631
- return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4045
+ }, [
4046
+ operator
4047
+ ]);
4048
+ (0, $hgUW1$useEffect)(()=>{
4049
+ if (value !== condition.value) {
4050
+ if (value) update(index, "value", value);
4051
+ else update(index, "value", "");
4052
+ }
4053
+ }, [
4054
+ value
4055
+ ]);
4056
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)("fieldset", {
4057
+ className: "ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--between ds-u-align-items--center ds-u-border--0",
3632
4058
  children: [
3633
- mobile && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3634
- className: "ds-u-margin-bottom--3 ds-l-col--12 ds-l-sm-col--6",
3635
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3636
- labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
3637
- options: sortOptions,
3638
- label: "Sort",
3639
- value: Object.keys(sortStatesLookup).find((key)=>{
3640
- return JSON.stringify(sortStatesLookup[key]) == JSON.stringify(sorting);
4059
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4060
+ className: "ds-l-col--12 ds-l-md-col--8 ds-u-display--flex ds-u-justify-content--between ds-u-padding-x--0",
4061
+ children: [
4062
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
4063
+ options: propertyOptions,
4064
+ className: "ds-l-col--8 ds-u-padding-left--0",
4065
+ value: property,
4066
+ label: "Column Name",
4067
+ name: `${condition.key}_property`,
4068
+ onChange: (e)=>setProperty(e.target.value)
3641
4069
  }),
3642
- name: "dc-data-dictionary-type",
3643
- onChange: (e)=>{
3644
- setSorting(sortStatesLookup[e.target.value]);
3645
- }
3646
- })
4070
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
4071
+ options: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[property].mysql_type),
4072
+ className: "ds-l-col--4 ds-u-padding-x--0",
4073
+ value: operator,
4074
+ label: "Operator",
4075
+ name: `${condition.key}_operator`,
4076
+ onChange: (e)=>setOperator(e.target.value)
4077
+ })
4078
+ ]
3647
4079
  }),
3648
4080
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3649
- className: "dc-c-datadictionary-table",
4081
+ 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",
3650
4082
  children: [
3651
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Table), {
3652
- className: "dc-c-datatable",
3653
- style: {
3654
- width: "100%"
3655
- },
3656
- stackable: true,
4083
+ schema[id].fields[property].mysql_type === "date" ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3657
4084
  children: [
3658
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableHead), {
3659
- className: "dc-thead--truncated dc-thead--resizeable",
3660
- children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableRow), {
3661
- children: headerGroup.headers.map((header)=>{
3662
- return header.id === "titleResizable" ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $64a351d3fd8413c3$export$2e2bcd8739ae039), {
3663
- table: table,
3664
- header: header,
3665
- setAriaLiveFeedback: setAriaLiveFeedback,
3666
- sortElement: sortElement
3667
- }, header.id + "_resize") : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TableCell), {
3668
- key: header.id,
3669
- className: `ds-u-border-y--2 ds-u-border--dark ds-u-border-x--0`,
3670
- id: "dataDictionary_" + header.id,
3671
- children: [
3672
- (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext()),
3673
- header.id === "type" && /*#__PURE__*/ (0, $hgUW1$jsx)("button", {
3674
- onClick: header.column.getToggleSortingHandler(),
3675
- className: header.column.getCanSort() ? `cursor-pointer select-none ds-u-focus-visible ${sortElement(header.column.getIsSorted())}` : "",
3676
- "aria-label": `${header.column.columnDef.header} sort order`
3677
- })
3678
- ]
3679
- });
3680
- })
3681
- }, "header" + headerGroup.id))
3682
- }),
3683
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableBody), {
3684
- children: table.getRowModel().rows.map((row, index)=>{
3685
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableRow), {
3686
- children: row.getVisibleCells().map((cell)=>{
3687
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TableCell), {
3688
- key: cell.id,
3689
- style: {
3690
- maxWidth: mobile ? "100%" : cell.column.getSize(),
3691
- whiteSpace: cell.column.id === "description" ? "pre-wrap" : "normal"
3692
- },
3693
- className: `${cell.column.id === "titleResizable" ? "ds-u-word-break" : ""}`,
3694
- headers: "dataDictionary_" + cell.column.id,
3695
- stackedTitle: cell.column.id === "titleResizable" ? "Title" : cell.column.columnDef.header,
3696
- children: (0, $hgUW1$flexRender)(cell.column.columnDef.cell, cell.getContext())
3697
- });
3698
- })
3699
- }, index + JSON.stringify(row));
4085
+ /*#__PURE__*/ (0, $hgUW1$jsx)("label", {
4086
+ className: "ds-c-label",
4087
+ htmlFor: `${condition.key}_date_value`,
4088
+ id: `${condition.key}_date_value-label`,
4089
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4090
+ children: "Value"
3700
4091
  })
4092
+ }),
4093
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$reactdatepicker), {
4094
+ name: `${condition.key}_date_value`,
4095
+ selected: (0, $7264a673914aa746$export$e284ae5d89467c8f)(startDate),
4096
+ onChange: (date)=>{
4097
+ setStartDate(date);
4098
+ setValue(date.toJSON().slice(0, 10));
4099
+ },
4100
+ showMonthDropdown: true,
4101
+ showYearDropdown: true,
4102
+ dropdownMode: "select",
4103
+ className: "ds-c-field",
4104
+ withPortal: true
3701
4105
  })
3702
4106
  ]
4107
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
4108
+ className: "ds-l-col--11 ds-u-padding-x--0",
4109
+ label: "Value",
4110
+ name: `${condition.key}_value`,
4111
+ value: (0, $7264a673914aa746$export$6b5e57d20078142b)(value, operator),
4112
+ onChange: (e)=>setValue(e.target.value)
3703
4113
  }),
3704
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3705
- className: "sr-only",
3706
- "aria-live": "assertive",
3707
- "aria-atomic": "true",
3708
- children: ariaLiveFeedback
3709
- }),
3710
- table.getRowModel().rows.length === 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
3711
- variation: "warn",
3712
- children: "No results found for the current filters"
3713
- })
3714
- ]
3715
- }),
3716
- table.getRowCount() > pageSize ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
3717
- totalPages: table.getPageCount(),
3718
- currentPage: table.getState().pagination.pageIndex + 1,
3719
- onPageChange: (evt, page)=>{
3720
- evt.preventDefault();
3721
- table.setPageIndex(page - 1);
3722
- },
3723
- renderHref: (page)=>{
3724
- return "";
3725
- }
3726
- }) : ""
4114
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
4115
+ variation: "ghost",
4116
+ size: "small",
4117
+ className: "ds-u-margin-top--6 ds-u-padding-right--0",
4118
+ "aria-label": "Delete filter",
4119
+ onClick: ()=>remove(index),
4120
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4121
+ className: "fas fa-trash"
4122
+ })
4123
+ })
4124
+ ]
4125
+ })
3727
4126
  ]
3728
4127
  });
3729
4128
  };
3730
- var $6765a74df807d015$export$2e2bcd8739ae039 = $6765a74df807d015$var$DataDictionaryTable;
3731
-
3732
-
3733
- const $a24829b27758fe6c$var$SitewideDataDictionaryTable = ({ datasetDictionary: datasetDictionary, pageSize: pageSize })=>{
3734
- const columnHelper = (0, $hgUW1$createColumnHelper)();
3735
- const tableColumns = [
3736
- columnHelper.accessor("name", {
3737
- header: "Name"
3738
- }),
3739
- columnHelper.accessor("title", {
3740
- header: "Title"
3741
- }),
3742
- columnHelper.accessor("type", {
3743
- header: "Type"
3744
- }),
3745
- columnHelper.accessor("format", {
3746
- header: "Format"
3747
- })
3748
- ];
3749
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6765a74df807d015$export$2e2bcd8739ae039), {
3750
- tableColumns: tableColumns,
3751
- tableData: datasetDictionary,
3752
- pageSize: pageSize
3753
- });
3754
- };
3755
- var $a24829b27758fe6c$export$2e2bcd8739ae039 = $a24829b27758fe6c$var$SitewideDataDictionaryTable;
3756
-
3757
-
3758
-
3759
-
3760
-
3761
-
4129
+ var $6369abf590ca298f$export$2e2bcd8739ae039 = $6369abf590ca298f$var$QueryRow;
3762
4130
 
3763
4131
 
3764
4132
 
3765
- const $a6e312940f7003ef$var$DatasetDictionaryTable = ({ datasetDictionary: datasetDictionary, pageSize: pageSize })=>{
3766
- const [titleFilter, setTitleFilter] = (0, $hgUW1$useState)("");
3767
- const [typeFilter, setTypeFilter] = (0, $hgUW1$useState)("all");
3768
- const columnFilters = (0, $hgUW1$useMemo)(()=>[
4133
+ function $ee4ad47aa483e5b5$var$updateQueryForDatastore(condition) {
4134
+ let cond = condition;
4135
+ delete cond.key;
4136
+ if (cond.operator === "=" || cond.operator === "<>") {
4137
+ if (Array.isArray(cond.value)) cond.value = cond.value.join();
4138
+ cond.value = cond.value.replace(/(^\%+|\%+$)/gm, "");
4139
+ }
4140
+ if (cond.operator.toLowerCase() === "like") {
4141
+ if (Array.isArray(cond.value)) cond.value = cond.value.join();
4142
+ const cleanedValue = cond.value.replace(/(^\%+|\%+$)/gm, "");
4143
+ cond.value = `%${cleanedValue}%`;
4144
+ }
4145
+ if (cond.operator.toLowerCase() === "in") {
4146
+ if (!Array.isArray(cond.value)) cond.value = cond.value.split(",");
4147
+ }
4148
+ if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
4149
+ return cond;
4150
+ }
4151
+ const $ee4ad47aa483e5b5$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams = true, customColumns: customColumns, isModal: isModal = false })=>{
4152
+ const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
4153
+ const fields = Object.keys(schema[id].fields);
4154
+ const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
4155
+ const [titleConditions, setTitleConditions] = (0, $hgUW1$useState)([]); // Add use effect to load conditions on first load if needed
4156
+ const [conditionsChanged, setConditionsChanged] = (0, $hgUW1$useState)(false);
4157
+ const syncConditions = ()=>{
4158
+ if (conditions && conditions.length) {
4159
+ const keyedConditions = conditions.map((oc)=>({
4160
+ ...oc,
4161
+ key: Date.now().toString() + oc.value + oc.property
4162
+ }));
4163
+ setQueryConditions(keyedConditions);
4164
+ } else setQueryConditions([
3769
4165
  {
3770
- id: "titleResizable",
3771
- value: titleFilter
3772
- },
4166
+ property: fields[0],
4167
+ value: "",
4168
+ operator: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[fields[0]].mysql_type)[0].value,
4169
+ key: Date.now().toString()
4170
+ }
4171
+ ]);
4172
+ };
4173
+ const addCondition = (condition)=>{
4174
+ if (Array.isArray(condition)) {
4175
+ const keyedConditions = condition.map((oc)=>({
4176
+ ...oc,
4177
+ key: Date.now().toString() + oc.value + oc.property
4178
+ }));
4179
+ setQueryConditions(keyedConditions);
4180
+ } else setQueryConditions([
4181
+ ...queryConditions,
3773
4182
  {
3774
- id: "type",
3775
- value: typeFilter === "all" ? "" : typeFilter
4183
+ property: fields[0],
4184
+ value: "",
4185
+ operator: (0, $7264a673914aa746$export$2b9377795161999)(schema[id].fields[fields[0]].mysql_type)[0].value,
4186
+ key: Date.now().toString()
3776
4187
  }
3777
- ], [
3778
- titleFilter,
3779
- typeFilter
4188
+ ]);
4189
+ };
4190
+ // Sync the UI with the actual data conditions whenever those change
4191
+ (0, $hgUW1$react).useEffect(()=>{
4192
+ syncConditions();
4193
+ setTitleConditions(conditions);
4194
+ }, [
4195
+ conditions
3780
4196
  ]);
3781
- const tableData = datasetDictionary.map((item)=>{
4197
+ const propertyOptions = fields.map((f)=>{
4198
+ if (schema[id].fields[f].description) return {
4199
+ label: schema[id].fields[f].description,
4200
+ value: f
4201
+ };
3782
4202
  return {
3783
- titleResizable: item.title,
3784
- description: item.description,
3785
- type: item.type
4203
+ label: f,
4204
+ value: f
3786
4205
  };
3787
4206
  });
3788
- const columnHelper = (0, $hgUW1$createColumnHelper)();
3789
- const tableColumns = [
3790
- columnHelper.accessor("titleResizable", {
3791
- header: ()=>/*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3792
- className: "dc-c-tooltip-width-override",
3793
- children: [
3794
- "Title",
3795
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Tooltip), {
3796
- title: "Title represents the column headers of the data file",
3797
- // @ts-ignore
3798
- style: {
3799
- border: "none",
3800
- background: "none"
3801
- },
3802
- maxWidth: "400px",
3803
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TooltipIcon), {})
3804
- })
3805
- ]
3806
- }),
3807
- size: 300
3808
- }),
3809
- columnHelper.accessor("description", {
3810
- header: "Description",
3811
- minSize: 600
3812
- }),
3813
- columnHelper.accessor("type", {
3814
- header: "Type",
3815
- size: 150,
3816
- enableResizing: false
3817
- })
3818
- ];
3819
- const typeOptions = [
3820
- {
3821
- value: "all",
3822
- label: "All Types"
3823
- },
3824
- {
3825
- value: "string",
3826
- label: "String"
3827
- },
3828
- {
3829
- value: "date",
3830
- label: "Date"
3831
- },
3832
- {
3833
- value: "datetime",
3834
- label: "Datetime"
3835
- },
3836
- {
3837
- value: "year",
3838
- label: "Year"
3839
- },
3840
- {
3841
- value: "integer",
3842
- label: "Integer"
3843
- },
3844
- {
3845
- value: "number",
3846
- label: "Number"
3847
- },
3848
- {
3849
- value: "boolean",
3850
- label: "Boolean"
4207
+ const updateBrowserURL = (newConditions)=>{
4208
+ if (includeSearchParams) {
4209
+ const url = new URL(window.location.href);
4210
+ const urlString = (0, $hgUW1$qs).stringify({
4211
+ conditions: newConditions
4212
+ }, {
4213
+ encodeValuesOnly: true,
4214
+ addQueryPrefix: true
4215
+ });
4216
+ window.history.pushState({}, "", `${url.origin}${url.pathname}${urlString}`);
3851
4217
  }
3852
- ];
3853
- return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3854
- children: [
3855
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3856
- className: "dc-query-builder ds-u-margin-bottom--3",
3857
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3858
- className: "ds-c-accordion ds-c-accordion--bordered",
3859
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
3860
- heading: "Data Dictionary Filters",
3861
- defaultOpen: true,
3862
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3863
- className: "ds-u-display--flex ds-u-flex-wrap--wrap",
3864
- children: [
3865
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TextField), {
3866
- className: "ds-l-col--12 ds-l-sm-col--6",
3867
- labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
3868
- label: "Title",
3869
- value: titleFilter,
3870
- name: "dc-data-dictionary-title",
3871
- onChange: (e)=>setTitleFilter(e.target.value)
3872
- }),
4218
+ };
4219
+ const submitConditions = (e)=>{
4220
+ // only update the data conditions when "Apply filters" is pressed
4221
+ e.preventDefault();
4222
+ const submitConditions = queryConditions.filter((oc)=>{
4223
+ if (oc.property) return oc;
4224
+ return false;
4225
+ }).map((oc)=>{
4226
+ let cond = Object.assign({}, oc);
4227
+ return $ee4ad47aa483e5b5$var$updateQueryForDatastore(cond);
4228
+ });
4229
+ setConditions(submitConditions);
4230
+ setConditionsChanged(false);
4231
+ updateBrowserURL(submitConditions);
4232
+ };
4233
+ const updateCondition = (index, key, value)=>{
4234
+ let newConditions = [
4235
+ ...queryConditions
4236
+ ];
4237
+ newConditions[index][key] = value;
4238
+ setQueryConditions(newConditions);
4239
+ setConditionsChanged(true);
4240
+ };
4241
+ const removeCondition = (index)=>{
4242
+ // just removes the condition from the UI - "Apply Filters" must be clicked to change the data model
4243
+ let newConditions = queryConditions.map((oc)=>Object.assign({}, oc));
4244
+ newConditions.splice(index, 1);
4245
+ setQueryConditions(newConditions);
4246
+ setConditionsChanged(true);
4247
+ };
4248
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4249
+ className: "dc-query-builder ds-u-margin-bottom--3",
4250
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4251
+ className: "ds-c-accordion ds-c-accordion--bordered",
4252
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
4253
+ heading: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $bef7bff2823feea2$export$2e2bcd8739ae039), {
4254
+ schema: schema[id],
4255
+ conditions: titleConditions,
4256
+ customColumns: customColumns
4257
+ }),
4258
+ defaultOpen: !isModal,
4259
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("form", {
4260
+ onSubmit: (e)=>submitConditions(e),
4261
+ children: [
4262
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4263
+ children: queryConditions.map((qf, index)=>/*#__PURE__*/ (0, $hgUW1$jsx)((0, $6369abf590ca298f$export$2e2bcd8739ae039), {
4264
+ id: id,
4265
+ schema: schema,
4266
+ condition: qf,
4267
+ index: index,
4268
+ propertyOptions: propertyOptions,
4269
+ update: updateCondition,
4270
+ remove: removeCondition
4271
+ }, qf.key))
4272
+ }),
4273
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4274
+ 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",
4275
+ children: [
3873
4276
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3874
- className: "ds-l-col--12 ds-l-sm-col--6",
3875
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Dropdown), {
3876
- labelClassName: "ds-u-margin-top--1 ds-u-sm-margin-top--0",
3877
- options: typeOptions,
3878
- label: "Type",
3879
- value: typeFilter,
3880
- name: "dc-data-dictionary-type",
3881
- onChange: (e)=>setTypeFilter(e.target.value)
4277
+ 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",
4278
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
4279
+ variation: "ghost",
4280
+ onClick: ()=>addCondition(null),
4281
+ className: "ds-u-padding-left--0",
4282
+ children: "+ Add filter"
3882
4283
  })
3883
4284
  }),
3884
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3885
- className: "ds-u-float--right ds-u-padding-y--2 ds-l-col--12 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",
3886
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3887
- className: "ds-u-display--flex ds-u-justify-content--end ds-l-col--12 ds-l-md-col--6 ds-u-padding-x--0",
3888
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2eec38d4d0dbf714$export$2e2bcd8739ae039), {
4285
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4286
+ className: "ds-u-display--flex ds-u-justify-content--end ds-l-col--12 ds-l-md-col--6 ds-u-padding-x--0",
4287
+ children: [
4288
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
4289
+ disabled: !conditionsChanged,
4290
+ className: "ds-u-float--right ds-l-md-col--6 ds-u-margin--right--0 ds-u-sm-margin-right--2",
4291
+ type: "submit",
4292
+ variation: "solid",
4293
+ children: "Apply filters"
4294
+ }),
4295
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $2eec38d4d0dbf714$export$2e2bcd8739ae039), {
4296
+ disabled: queryConditions.length === 0,
3889
4297
  clearFiltersFn: ()=>{
3890
- setTitleFilter("");
3891
- setTypeFilter("all");
4298
+ setConditions([]);
4299
+ updateBrowserURL([]);
3892
4300
  }
3893
4301
  })
3894
- })
4302
+ ]
3895
4303
  })
3896
4304
  ]
3897
4305
  })
3898
- })
4306
+ ]
3899
4307
  })
3900
- }),
3901
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6765a74df807d015$export$2e2bcd8739ae039), {
3902
- tableColumns: tableColumns,
3903
- tableData: tableData,
3904
- pageSize: pageSize,
3905
- columnFilters: columnFilters
3906
4308
  })
3907
- ]
4309
+ })
3908
4310
  });
3909
4311
  };
3910
- var $a6e312940f7003ef$export$2e2bcd8739ae039 = $a6e312940f7003ef$var$DatasetDictionaryTable;
4312
+ var $ee4ad47aa483e5b5$export$2e2bcd8739ae039 = $ee4ad47aa483e5b5$var$QueryBuilder;
3911
4313
 
3912
4314
 
3913
4315
 
3914
- const $6012b86ffcaf3f71$var$DataDictionary = ({ datasetDictionaryEndpoint: datasetDictionaryEndpoint, datasetSitewideDictionary: datasetSitewideDictionary, title: title, pageSize: pageSize = 20, additionalParams: additionalParams, csvDownload: csvDownload })=>{
3915
- const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
3916
- queryKey: [
3917
- "dictionary" + datasetDictionaryEndpoint
3918
- ],
3919
- queryFn: ()=>{
3920
- return (0, $hgUW1$axios).get(`${datasetDictionaryEndpoint}?${(0, $hgUW1$qs).stringify(additionalParams, {
3921
- arrayFormat: "comma",
3922
- encode: false
3923
- })}`).then((res)=>res.data).catch((error)=>console.error(error));
3924
- },
3925
- enabled: datasetDictionaryEndpoint !== undefined
3926
- });
3927
- const datasetDictionary = data && data.data && data.data.fields && data.data.fields.length ? data.data.fields : null;
3928
- return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
4316
+
4317
+ function $a35cf16d1488f54e$export$1147582dfae658c6(columns, schema) {
4318
+ return columns.map((column)=>({
4319
+ header: schema && schema.fields[column].description ? schema.fields[column].description : column,
4320
+ accessor: column
4321
+ }));
4322
+ }
4323
+ const $a35cf16d1488f54e$var$DatasetTable = ({ isModal: isModal = false, closeFullScreenModal: closeFullScreenModal })=>{
4324
+ const { id: id, distribution: distribution, resource: resource, rootUrl: rootUrl, customColumns: customColumns = [], dataDictionaryBanner: dataDictionaryBanner } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
4325
+ const { page: page, setPage: setPage } = (0, $hgUW1$useContext)((0, $ebda441784d176a5$export$2e2bcd8739ae039));
4326
+ const defaultPageSize = 10;
4327
+ const customColumnHeaders = (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution.identifier]);
4328
+ const columns = customColumnHeaders ? customColumnHeaders : $a35cf16d1488f54e$export$1147582dfae658c6(resource.columns, resource.schema[id]);
4329
+ const { limit: limit, setOffset: setOffset } = resource;
4330
+ const pageSize = limit ? limit : defaultPageSize;
4331
+ const downloadURL = `${rootUrl}/datastore/query/${id}/0/download?${(0, $hgUW1$qs).stringify({
4332
+ conditions: resource.conditions
4333
+ }, {
4334
+ encode: true
4335
+ })}&format=csv`;
4336
+ if (Object.keys(resource).length && columns.length && resource.schema && Object.keys(distribution).length) return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3929
4337
  children: [
3930
- /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
3931
- className: "ds-text-heading--2xl ds-u-margin-y--3",
3932
- children: title
4338
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ee4ad47aa483e5b5$export$2e2bcd8739ae039), {
4339
+ resource: resource,
4340
+ id: distribution.identifier,
4341
+ customColumns: customColumnHeaders,
4342
+ isModal: isModal
3933
4343
  }),
3934
- datasetDictionary && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
3935
- children: [
3936
- /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3937
- className: "ds-u-margin-bottom--1 ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end",
3938
- children: [
3939
- /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
3940
- className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--4",
3941
- onClick: ()=>window.open(datasetDictionaryEndpoint),
3942
- type: "button",
3943
- children: [
3944
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3945
- className: "fa fa-file-download ds-u-color--primary ds-u-padding-right--1"
3946
- }),
3947
- " View Dictionary JSON"
3948
- ]
3949
- }),
3950
- csvDownload && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3951
- className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--4 ds-u-margin-top--2 ds-u-sm-margin-top--0 ds-u-padding--0 ds-u-sm-padding-left--2",
3952
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
3953
- href: datasetDictionaryEndpoint + "/csv",
3954
- className: "ds-c-button",
3955
- style: {
3956
- width: "100%"
3957
- },
3958
- children: [
3959
- /*#__PURE__*/ (0, $hgUW1$jsx)("i", {
3960
- className: "fa fa-file-download ds-u-color--primary ds-u-padding-right--1"
3961
- }),
3962
- "Download Dictionary CSV"
3963
- ]
3964
- })
3965
- })
3966
- ]
3967
- }),
3968
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a6e312940f7003ef$export$2e2bcd8739ae039), {
3969
- datasetDictionary: datasetDictionary,
3970
- pageSize: pageSize
3971
- })
3972
- ]
4344
+ dataDictionaryBanner && !isModal && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4345
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
4346
+ children: 'Click on the "Data Dictionary" tab above for full column definitions'
4347
+ })
3973
4348
  }),
3974
- datasetSitewideDictionary && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a24829b27758fe6c$export$2e2bcd8739ae039), {
3975
- datasetDictionary: datasetSitewideDictionary,
3976
- pageSize: pageSize
4349
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6380a4a580b24362$export$2e2bcd8739ae039), {
4350
+ resource: resource,
4351
+ downloadURL: downloadURL,
4352
+ unfilteredDownloadURL: distribution.data.downloadURL,
4353
+ setPage: setPage
4354
+ }),
4355
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4356
+ className: `ds-u-border-x--1 ds-u-border-bottom--1 ${isModal && "dkan-datatable-fullscreen-mode"}`,
4357
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
4358
+ canResize: true,
4359
+ columns: columns,
4360
+ sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
4361
+ tablePadding: "ds-u-padding-y--2",
4362
+ loading: resource.loading,
4363
+ isModal: isModal,
4364
+ closeFullScreenModal: closeFullScreenModal
4365
+ })
4366
+ }),
4367
+ !resource.loading && resource.count !== null && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4368
+ 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",
4369
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Pagination), {
4370
+ totalPages: Math.ceil(resource.count ? resource.count / pageSize : 1),
4371
+ currentPage: Number(page),
4372
+ onPageChange: (evt, page)=>{
4373
+ evt.preventDefault();
4374
+ setOffset((page - 1) * limit);
4375
+ setPage(page);
4376
+ },
4377
+ renderHref: (p)=>`?page=${p}`,
4378
+ className: "ds-l-col--12 ds-u-padding-x--0"
4379
+ })
3977
4380
  })
3978
4381
  ]
3979
4382
  });
4383
+ else return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
4384
+ "aria-valuetext": "Dataset loading",
4385
+ role: "status",
4386
+ className: "ds-u-margin--3"
4387
+ });
3980
4388
  };
3981
- var $6012b86ffcaf3f71$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($6012b86ffcaf3f71$var$DataDictionary);
4389
+ var $a35cf16d1488f54e$export$2e2bcd8739ae039 = $a35cf16d1488f54e$var$DatasetTable;
4390
+
3982
4391
 
3983
4392
 
3984
4393
 
4394
+ const $39bc4d98030a5599$var$DataTableStateWrapper = ()=>{
4395
+ const { id: id, datasetTableControls: datasetTableControls } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
4396
+ // a wrapper component to keep column state synced between full screen and regular modes
4397
+ const localStorageData = id ? JSON.parse(localStorage.getItem(id)) : null;
4398
+ const defaultPage = 1;
4399
+ const [page, setPage] = (0, $hgUW1$useState)(defaultPage);
4400
+ const [columnOrder, setColumnOrder] = (0, $hgUW1$useState)(()=>{
4401
+ if (datasetTableControls && localStorageData) return localStorageData.tableColumnOrder;
4402
+ else return [];
4403
+ });
4404
+ const [columnVisibility, setColumnVisibility] = (0, $hgUW1$useState)(()=>{
4405
+ if (datasetTableControls && localStorageData) return localStorageData.tableColumnVisibility;
4406
+ else return {};
4407
+ });
4408
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $ebda441784d176a5$export$2e2bcd8739ae039).Provider, {
4409
+ value: {
4410
+ columnOrder: columnOrder,
4411
+ setColumnOrder: setColumnOrder,
4412
+ columnVisibility: columnVisibility,
4413
+ setColumnVisibility: setColumnVisibility,
4414
+ page: page,
4415
+ setPage: setPage
4416
+ },
4417
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {})
4418
+ });
4419
+ };
4420
+ var $39bc4d98030a5599$export$2e2bcd8739ae039 = $39bc4d98030a5599$var$DataTableStateWrapper;
4421
+
3985
4422
 
3986
4423
 
3987
4424
  const $a0f13962e513caa1$var$getDataDictionary = (dataDictionaryUrl, additionalParams)=>{
@@ -4001,7 +4438,7 @@ const $a0f13962e513caa1$var$getDataDictionary = (dataDictionaryUrl, additionalPa
4001
4438
  dataDictionaryLoading: isPending
4002
4439
  };
4003
4440
  };
4004
- const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false })=>{
4441
+ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalParams: additionalParams, customColumns: customColumns, setDatasetTitle: setDatasetTitle, customMetadataMapping: customMetadataMapping, apiPageUrl: apiPageUrl = "/api", dataDictionaryUrl: dataDictionaryUrl, borderlessTabs: borderlessTabs = false, defaultPageSize: defaultPageSize = 25, dataDictionaryCSV: dataDictionaryCSV = false, dataDictionaryBanner: dataDictionaryBanner = false, disableTableControls: disableTableControls = false })=>{
4005
4442
  const options = location.search ? {
4006
4443
  ...(0, $hgUW1$qs).parse(location.search, {
4007
4444
  ignoreQueryPrefix: true
@@ -4104,7 +4541,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
4104
4541
  })
4105
4542
  }),
4106
4543
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4107
- className: "ds-l-md-col--12 ds-u-color--gray ds-u-margin-y--1 ds-u-text-align--right",
4544
+ className: "ds-l-md-col--12 ds-u-margin-y--1 ds-u-text-align--right",
4108
4545
  children: /*#__PURE__*/ (0, $hgUW1$jsxs)("p", {
4109
4546
  className: "ds-u-margin--0",
4110
4547
  children: [
@@ -4151,13 +4588,17 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
4151
4588
  ]
4152
4589
  }),
4153
4590
  className: borderlessTabs ? "ds-u-border--0 ds-u-padding-x--0" : "",
4154
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $a35cf16d1488f54e$export$2e2bcd8739ae039), {
4155
- id: id,
4156
- distribution: distribution,
4157
- resource: resource,
4158
- rootUrl: rootUrl,
4159
- customColumns: customColumns,
4160
- dataDictionaryBanner: dataDictionaryBanner && displayDataDictionaryTab
4591
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {
4592
+ value: {
4593
+ id: id,
4594
+ resource: resource,
4595
+ distribution: distribution,
4596
+ rootUrl: rootUrl,
4597
+ customColumns: customColumns,
4598
+ dataDictionaryBanner: dataDictionaryBanner && displayDataDictionaryTab,
4599
+ datasetTableControls: !disableTableControls
4600
+ },
4601
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $39bc4d98030a5599$export$2e2bcd8739ae039), {})
4161
4602
  })
4162
4603
  }),
4163
4604
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
@@ -4179,7 +4620,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
4179
4620
  metadataMapping: metadataMapping
4180
4621
  })
4181
4622
  }),
4182
- displayDataDictionaryTab && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
4623
+ /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TabPanel), {
4183
4624
  id: "data-dictionary",
4184
4625
  tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
4185
4626
  className: "ds-u-color--primary",
@@ -4191,13 +4632,18 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, additionalPar
4191
4632
  ]
4192
4633
  }),
4193
4634
  className: borderlessTabs ? "ds-u-border--0 ds-u-padding-x--0" : "",
4194
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6012b86ffcaf3f71$export$2e2bcd8739ae039), {
4195
- datasetSitewideDictionary: datasetSitewideDictionary,
4196
- datasetDictionaryEndpoint: distribution.data.describedBy,
4197
- title: "Data Dictionary",
4198
- additionalParams: additionalParams,
4199
- csvDownload: dataDictionaryCSV
4200
- })
4635
+ children: [
4636
+ displayDataDictionaryTab && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6012b86ffcaf3f71$export$2e2bcd8739ae039), {
4637
+ datasetSitewideDictionary: datasetSitewideDictionary,
4638
+ datasetDictionaryEndpoint: distribution.data.describedBy,
4639
+ title: "Data Dictionary",
4640
+ additionalParams: additionalParams,
4641
+ csvDownload: dataDictionaryCSV
4642
+ }),
4643
+ !displayDataDictionaryTab && /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4644
+ children: "There is no Data Dictionary associated with this dataset."
4645
+ })
4646
+ ]
4201
4647
  }),
4202
4648
  distribution && distribution.data && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
4203
4649
  id: "api",
@@ -4351,8 +4797,7 @@ var $b9af6ce5e2c06331$export$2e2bcd8739ae039 = $b9af6ce5e2c06331$var$Header;
4351
4797
 
4352
4798
 
4353
4799
 
4354
-
4355
- const $24918217e48ac525$var$NavLink = ({ link: link, className: className, wrapLabel: wrapLabel, clickHandler: clickHandler })=>{
4800
+ const $24918217e48ac525$var$NavLink = ({ link: link, className: className = null, wrapLabel: wrapLabel = false, clickHandler: clickHandler })=>{
4356
4801
  const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
4357
4802
  children: link.label
4358
4803
  }) : link.label;
@@ -4364,25 +4809,20 @@ const $24918217e48ac525$var$NavLink = ({ link: link, className: className, wrapL
4364
4809
  });
4365
4810
  // }
4366
4811
  };
4367
- $24918217e48ac525$var$NavLink.defaultProps = {
4368
- wrapLabel: false,
4369
- className: null
4370
- };
4371
- $24918217e48ac525$var$NavLink.propTypes = {
4372
- link: (0, $hgUW1$proptypes).shape({
4373
- url: (0, $hgUW1$proptypes).string,
4374
- label: (0, $hgUW1$proptypes).string,
4375
- nonReactLink: (0, $hgUW1$proptypes).bool
4376
- }).isRequired,
4377
- className: (0, $hgUW1$proptypes).string,
4378
- /**
4379
- * Will wrap the link label in a span for help with styling.
4380
- */ wrapLabel: (0, $hgUW1$proptypes).bool
4381
- };
4382
4812
  var $24918217e48ac525$export$2e2bcd8739ae039 = $24918217e48ac525$var$NavLink;
4383
4813
 
4384
4814
 
4385
- const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail, emailTitle: emailTitle, emailBody: emailBody, emailLink: emailLink, emailButton: emailButton, socialMediaLinks: socialMediaLinks, hhsLogo: hhsLogo, cmsLogo: cmsLogo, trademarkContent: trademarkContent })=>{
4815
+ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail = true, emailTitle: emailTitle = "Get Email Updates", emailBody: emailBody = "Sign up to get the latest information from CMS by choosing the topics and frequency of emails that are best for you.", emailLink: emailLink = "", emailButton: emailButton = "Sign up for email updates", socialMediaLinks: socialMediaLinks = null, hhsLogo: hhsLogo, cmsLogo: cmsLogo, trademarkContent: trademarkContent = /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4816
+ children: [
4817
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4818
+ children: "A federal government website managed and paid for by the U.S. Centers for Medicare & Medicaid Services."
4819
+ }),
4820
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4821
+ className: "ds-u-padding-bottom--2",
4822
+ children: "7500 Security Boulevard, Baltimore, MD 21244"
4823
+ })
4824
+ ]
4825
+ }) })=>{
4386
4826
  const { footerOpenDataToolLinks: footerOpenDataToolLinks, footerAdditionalResourcesLinks: footerAdditionalResourcesLinks, footerUtilityLinks: footerUtilityLinks } = links;
4387
4827
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("footer", {
4388
4828
  className: "dc-c-footer",
@@ -4768,25 +5208,6 @@ const $a6df0aa147323304$var$Footer = ({ links: links, showEmail: showEmail, emai
4768
5208
  ]
4769
5209
  });
4770
5210
  };
4771
- $a6df0aa147323304$var$Footer.defaultProps = {
4772
- showEmail: true,
4773
- emailTitle: "Get Email Updates",
4774
- emailBody: "Sign up to get the latest information from CMS by choosing the topics and frequency of emails that are best for you.",
4775
- emailLink: "",
4776
- emailButton: "Sign up for email updates",
4777
- socialMediaLinks: null,
4778
- trademarkContent: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4779
- children: [
4780
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4781
- children: "A federal government website managed and paid for by the U.S. Centers for Medicare & Medicaid Services."
4782
- }),
4783
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4784
- className: "ds-u-padding-bottom--2",
4785
- children: "7500 Security Boulevard, Baltimore, MD 21244"
4786
- })
4787
- ]
4788
- })
4789
- };
4790
5211
  $a6df0aa147323304$var$Footer.propTypes = {
4791
5212
  showEmail: (0, $hgUW1$proptypes).bool,
4792
5213
  emailTitle: (0, $hgUW1$proptypes).string,
@@ -4956,7 +5377,7 @@ const $c7bf75f7e8a68780$export$7850f4d545d994c6 = [
4956
5377
 
4957
5378
 
4958
5379
  const $669d2782ec2e2250$var$SpecsAndLimits = (props)=>{
4959
- const { documentationList: documentationList, children: children } = props;
5380
+ const { documentationList: documentationList = (0, $c7bf75f7e8a68780$export$7850f4d545d994c6), children: children } = props;
4960
5381
  const defaultContent = /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4961
5382
  children: "Some datasets are extremely large and may be difficult to download and/or cause computer performance issues. The Centers for Medicare and Medicaid Services (CMS) recommends using WinZip, WinRAR, or 7-Zip for file decompression."
4962
5383
  });
@@ -5008,18 +5429,14 @@ const $669d2782ec2e2250$var$SpecsAndLimits = (props)=>{
5008
5429
  })
5009
5430
  });
5010
5431
  };
5011
- $669d2782ec2e2250$var$SpecsAndLimits.defaultProps = {
5012
- documentationList: (0, $c7bf75f7e8a68780$export$7850f4d545d994c6),
5013
- content: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
5014
- children: "Some datasets are extremely large and may be difficult to download and/or cause computer performance issues. The Centers for Medicare and Medicaid Services (CMS) recommends using WinZip, WinRAR, or 7-Zip for file decompression."
5015
- })
5016
- };
5017
5432
  var $669d2782ec2e2250$export$2e2bcd8739ae039 = $669d2782ec2e2250$var$SpecsAndLimits;
5018
5433
 
5019
5434
 
5020
5435
 
5021
5436
 
5022
5437
 
5438
+
5439
+
5023
5440
  const $efc410f5f7ac5ef3$var$useSearchAPI = (rootUrl, initialSearchParams = {}, additionalParams = {})=>{
5024
5441
  const defaultSort = "";
5025
5442
  const defaultFulltext = "";
@@ -5122,7 +5539,7 @@ var $efc410f5f7ac5ef3$export$2e2bcd8739ae039 = $efc410f5f7ac5ef3$var$useSearchAP
5122
5539
 
5123
5540
 
5124
5541
 
5125
- const $59a079354baa335c$var$Hero = ({ title: title, description: description, searchUrl: searchUrl, searchKey: searchKey, textfieldLabel: textfieldLabel, searchButtonText: searchButtonText })=>{
5542
+ const $59a079354baa335c$var$Hero = ({ title: title, description: description, searchUrl: searchUrl = "datasets", searchKey: searchKey = "fulltext", textfieldLabel: textfieldLabel = "Search for a dataset", searchButtonText: searchButtonText = "Search" })=>{
5126
5543
  const navigate = (0, $hgUW1$useNavigate)();
5127
5544
  const [searchValue, setSearchValue] = (0, $hgUW1$react).useState("");
5128
5545
  function submitHero(e) {
@@ -5196,12 +5613,6 @@ const $59a079354baa335c$var$Hero = ({ title: title, description: description, se
5196
5613
  })
5197
5614
  });
5198
5615
  };
5199
- $59a079354baa335c$var$Hero.defaultProps = {
5200
- searchKey: "fulltext",
5201
- searchUrl: "datasets",
5202
- textfieldLabel: "Search for a dataset",
5203
- searchButtonText: "Search"
5204
- };
5205
5616
  var $59a079354baa335c$export$2e2bcd8739ae039 = $59a079354baa335c$var$Hero;
5206
5617
 
5207
5618
 
@@ -5253,22 +5664,13 @@ var $1e012d1e3b534af0$export$2e2bcd8739ae039 = $1e012d1e3b534af0$var$DataTableDe
5253
5664
 
5254
5665
 
5255
5666
 
5256
- const $e71aee394fdad8bd$var$ManageColumns = ()=>{
5257
- const [modalOpen, setModalOpen] = (0, $hgUW1$useState)(false);
5258
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Button), {
5259
- onClick: ()=>setModalOpen(!modalOpen),
5260
- children: "Manage Columns"
5261
- });
5262
- };
5263
- var $e71aee394fdad8bd$export$2e2bcd8739ae039 = $e71aee394fdad8bd$var$ManageColumns;
5264
-
5265
-
5266
5667
 
5267
-
5268
-
5269
-
5270
- const $7848c69a021266f7$var$DataTableRowChanger = (props)=>{
5271
- const { limit: limit, rowOptions: rowOptions, setLimit: setLimit } = props;
5668
+ const $7848c69a021266f7$var$DataTableRowChanger = ({ limit: limit, rowOptions: rowOptions = [
5669
+ 10,
5670
+ 25,
5671
+ 50,
5672
+ 100
5673
+ ], setLimit: setLimit })=>{
5272
5674
  const rowOptionsFormatted = rowOptions.map((row)=>({
5273
5675
  label: row.toString(),
5274
5676
  value: row.toString()
@@ -5285,14 +5687,6 @@ const $7848c69a021266f7$var$DataTableRowChanger = (props)=>{
5285
5687
  })
5286
5688
  });
5287
5689
  };
5288
- $7848c69a021266f7$var$DataTableRowChanger.defaultProps = {
5289
- rowOptions: [
5290
- 10,
5291
- 25,
5292
- 50,
5293
- 100
5294
- ]
5295
- };
5296
5690
  $7848c69a021266f7$var$DataTableRowChanger.propTypes = {
5297
5691
  rowOptions: (0, $hgUW1$proptypes).arrayOf((0, $hgUW1$proptypes).number),
5298
5692
  setLimit: (0, $hgUW1$proptypes).func.isRequired,
@@ -5518,6 +5912,7 @@ var $af099c546cb226c7$export$2e2bcd8739ae039 = $af099c546cb226c7$var$ResourceHea
5518
5912
 
5519
5913
 
5520
5914
 
5915
+
5521
5916
  function $626282d9a03c51d5$export$1147582dfae658c6(columns, schema) {
5522
5917
  return columns.map((column)=>({
5523
5918
  header: schema && schema.fields[column].description ? schema.fields[column].description : column,
@@ -5535,49 +5930,21 @@ function $626282d9a03c51d5$var$DefaultColumnFilter({ column: { Header: Header, a
5535
5930
  value: filterValue || ""
5536
5931
  });
5537
5932
  }
5538
- const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, options: options, resource: resource, defaultSort: defaultSort, customColumns: customColumns, canResize: canResize })=>{
5933
+ const $626282d9a03c51d5$var$ResourcePreview = ({ tablePadding: tablePadding, id: id, canResize: canResize = true })=>{
5934
+ const { resource: resource, customColumns: customColumns } = (0, $hgUW1$useContext)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039));
5539
5935
  return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5540
5936
  id: "resource-preview",
5541
5937
  className: "ds-u-overflow--auto ds-u-border-x--1 ds-u-border-bottom--1",
5542
5938
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $d98f94c79ddf4e0e$export$2e2bcd8739ae039), {
5543
- data: resource.values,
5544
5939
  canResize: canResize,
5545
- sortDefaults: defaultSort,
5546
5940
  columns: customColumns ? customColumns : $626282d9a03c51d5$export$1147582dfae658c6(resource.columns, resource.schema[id]),
5547
- setSort: resource.setSort,
5548
5941
  sortTransform: (0, $aa4450dcbeef3ac0$export$385a5aba38cc3325),
5549
5942
  tablePadding: tablePadding,
5550
5943
  className: "dc-c-datatable",
5551
- customColumnFilter: $626282d9a03c51d5$var$DefaultColumnFilter,
5552
- options: options,
5553
- CustomLoadingComponent: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5554
- className: "ds-u-display--flex ds-u-padding--3",
5555
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
5556
- className: "ds-u-valign--middle",
5557
- role: "status",
5558
- "aria-valuetext": "Datatable loading"
5559
- })
5560
- }),
5561
- CustomNoResults: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
5562
- className: "ds-u-display--flex ds-u-padding--3",
5563
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
5564
- children: "No results returned."
5565
- })
5566
- })
5944
+ customColumnFilter: $626282d9a03c51d5$var$DefaultColumnFilter
5567
5945
  })
5568
5946
  });
5569
5947
  };
5570
- $626282d9a03c51d5$var$ResourcePreview.defaultProps = {
5571
- options: {
5572
- layout: "flex",
5573
- columnFilter: false,
5574
- columnSort: true,
5575
- columnResize: true
5576
- },
5577
- truncateCellHeader: true,
5578
- defaultSort: [],
5579
- canResize: true
5580
- };
5581
5948
  var $626282d9a03c51d5$export$2e2bcd8739ae039 = $626282d9a03c51d5$var$ResourcePreview;
5582
5949
 
5583
5950
 
@@ -5811,7 +6178,7 @@ function $3b6ca952e79f0695$var$updateQueryForDatastore(condition) {
5811
6178
  if (Array.isArray(cond.value)) cond.value = cond.value.map((v)=>v.trim().replace(/(^\%+|\%+$)/gm, ""));
5812
6179
  return cond;
5813
6180
  }
5814
- const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams, customColumns: customColumns })=>{
6181
+ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, includeSearchParams: includeSearchParams = true, customColumns: customColumns })=>{
5815
6182
  const { conditions: conditions, schema: schema, setConditions: setConditions } = resource;
5816
6183
  const fields = Object.keys(schema[id].fields);
5817
6184
  const [queryConditions, setQueryConditions] = (0, $hgUW1$useState)([]);
@@ -5932,9 +6299,6 @@ const $3b6ca952e79f0695$var$QueryBuilder = ({ resource: resource, id: id, includ
5932
6299
  })
5933
6300
  });
5934
6301
  };
5935
- $3b6ca952e79f0695$var$QueryBuilder.defaultProps = {
5936
- includeSearchParams: true
5937
- };
5938
6302
  var $3b6ca952e79f0695$export$2e2bcd8739ae039 = $3b6ca952e79f0695$var$QueryBuilder;
5939
6303
 
5940
6304
 
@@ -5961,15 +6325,14 @@ var $de780c924c98fa31$export$2e2bcd8739ae039 = $de780c924c98fa31$var$FilteredRes
5961
6325
 
5962
6326
 
5963
6327
 
6328
+
6329
+
5964
6330
  const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset, distIndex: distIndex, location: location, additionalParams: additionalParams, customColumns: customColumns, columnSettings: columnSettings, columnWidths: columnWidths, customTitle: customTitle, rootUrl: rootUrl })=>{
5965
- const navigate = (0, $hgUW1$useNavigate)();
5966
6331
  const [tablePadding, setTablePadding] = (0, $hgUW1$react).useState("ds-u-padding-y--1");
5967
6332
  let apiDocs = (0, $hgUW1$useRef)();
5968
- const [filtersOpen, setFiltersOpen] = (0, $hgUW1$react).useState(false);
5969
6333
  let distribution = {};
5970
6334
  let distribution_array = dataset.distribution ? dataset.distribution : [];
5971
6335
  if (distribution_array.length) distribution = distribution_array.find((dist)=>dist.identifier === distribution_array[distIndex].identifier);
5972
- let buttonRef = null;
5973
6336
  const options = location.search ? {
5974
6337
  ...(0, $hgUW1$qs).parse(location.search, {
5975
6338
  ignoreQueryPrefix: true
@@ -5977,7 +6340,6 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
5977
6340
  } : {
5978
6341
  conditions: []
5979
6342
  };
5980
- let conditions = options.conditions.length ? options.conditions : [];
5981
6343
  const resource = (0, $1d3d480a9cfaabe0$export$2e2bcd8739ae039)("", rootUrl, {
5982
6344
  ...options,
5983
6345
  limit: 25
@@ -6036,7 +6398,7 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
6036
6398
  dataset: dataset
6037
6399
  })
6038
6400
  }),
6039
- resource.columns && Object.keys(resource.schema).length && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
6401
+ Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
6040
6402
  className: "ds-l-md-col--12",
6041
6403
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3b6ca952e79f0695$export$2e2bcd8739ae039), {
6042
6404
  resource: resource,
@@ -6044,36 +6406,49 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
6044
6406
  customColumns: customColumns
6045
6407
  })
6046
6408
  }),
6047
- resource.columns && Object.keys(resource.schema).length ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
6048
- className: "ds-l-md-col--12",
6049
- children: [
6050
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $af099c546cb226c7$export$2e2bcd8739ae039), {
6051
- includeDensity: true,
6052
- setTablePadding: setTablePadding,
6053
- distribution: distribution,
6054
- resource: resource,
6055
- downloadUrl: downloadUrl,
6056
- tablePadding: tablePadding,
6057
- includeDownload: true
6058
- }),
6059
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $626282d9a03c51d5$export$2e2bcd8739ae039), {
6060
- id: distribution.identifier,
6061
- tablePadding: tablePadding,
6062
- resource: resource,
6063
- customColumns: (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution_array[distIndex].identifier]),
6064
- columnSettings: columnSettings,
6065
- options: {
6066
- layout: "flex",
6067
- columnFilter: false,
6068
- columnSort: true,
6069
- columnResize: true
6070
- },
6071
- columnWidths: columnWidths
6072
- }),
6073
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $072291d44ce1834a$export$2e2bcd8739ae039), {
6074
- resource: resource
6075
- })
6076
- ]
6409
+ Object.keys(resource).length && resource.columns && Object.keys(resource.schema).length ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {
6410
+ value: {
6411
+ id: id,
6412
+ resource: resource,
6413
+ distribution: distribution,
6414
+ rootUrl: rootUrl,
6415
+ customColumns: (0, $7264a673914aa746$export$8049e8f40a9bdfb8)(customColumns, resource.columns, resource.schema[distribution_array[distIndex].identifier])
6416
+ },
6417
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
6418
+ className: "ds-l-md-col--12",
6419
+ children: [
6420
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $af099c546cb226c7$export$2e2bcd8739ae039), {
6421
+ includeDensity: true,
6422
+ setTablePadding: setTablePadding,
6423
+ distribution: distribution,
6424
+ resource: resource,
6425
+ downloadUrl: downloadUrl,
6426
+ tablePadding: tablePadding,
6427
+ includeDownload: true
6428
+ }),
6429
+ /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $ebda441784d176a5$export$2e2bcd8739ae039).Provider, {
6430
+ value: {
6431
+ columnOrder: [],
6432
+ setColumnOrder: ()=>{},
6433
+ columnVisibility: {},
6434
+ setColumnVisibility: ()=>{},
6435
+ page: 1,
6436
+ setPage: ()=>{}
6437
+ },
6438
+ children: [
6439
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $626282d9a03c51d5$export$2e2bcd8739ae039), {
6440
+ id: distribution.identifier,
6441
+ tablePadding: tablePadding,
6442
+ columnSettings: columnSettings,
6443
+ columnWidths: columnWidths
6444
+ }),
6445
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $072291d44ce1834a$export$2e2bcd8739ae039), {
6446
+ resource: resource
6447
+ })
6448
+ ]
6449
+ })
6450
+ ]
6451
+ })
6077
6452
  }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
6078
6453
  role: "status",
6079
6454
  "aria-valuetext": "Resource loading"
@@ -6098,9 +6473,6 @@ const $dd6eb2b30d7ad75d$var$FilteredResourceBody = ({ id: id, dataset: dataset,
6098
6473
  })
6099
6474
  });
6100
6475
  };
6101
- $dd6eb2b30d7ad75d$var$FilteredResourceBody.defaultProps = {
6102
- apiDocPage: "/api"
6103
- };
6104
6476
  var $dd6eb2b30d7ad75d$export$2e2bcd8739ae039 = $dd6eb2b30d7ad75d$var$FilteredResourceBody;
6105
6477
 
6106
6478
 
@@ -6222,5 +6594,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
6222
6594
 
6223
6595
 
6224
6596
 
6225
- export {$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, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $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, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $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, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $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, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText};
6597
+ export {$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, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $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, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $43a30d745a7bbc86$export$2e2bcd8739ae039 as DataTableContext, $ebda441784d176a5$export$2e2bcd8739ae039 as ManageColumnsContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $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, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $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, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText};
6226
6598
  //# sourceMappingURL=main.js.map