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

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
@@ -2,7 +2,7 @@ import "./main.css";
2
2
  import {jsx as $hgUW1$jsx, jsxs as $hgUW1$jsxs, Fragment as $hgUW1$Fragment} from "react/jsx-runtime";
3
3
  import {Accordion as $hgUW1$Accordion, AccordionItem as $hgUW1$AccordionItem, Button as $hgUW1$Button, CloseIconThin as $hgUW1$CloseIconThin, ArrowIcon as $hgUW1$ArrowIcon, Spinner as $hgUW1$Spinner, Alert as $hgUW1$Alert, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Dropdown as $hgUW1$Dropdown, Choice as $hgUW1$Choice, Pagination as $hgUW1$Pagination, Table as $hgUW1$Table, TableHead as $hgUW1$TableHead, TableRow as $hgUW1$TableRow, TableCell as $hgUW1$TableCell, TableBody as $hgUW1$TableBody, Tabs as $hgUW1$Tabs, TabPanel as $hgUW1$TabPanel, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
4
4
  import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useRef as $hgUW1$useRef, useEffect as $hgUW1$useEffect, useContext as $hgUW1$useContext, useMemo as $hgUW1$useMemo, useCallback as $hgUW1$useCallback} from "react";
5
- import {NavLink as $hgUW1$NavLink, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams, Link as $hgUW1$Link, useNavigate as $hgUW1$useNavigate} from "react-router-dom";
5
+ import {NavLink as $hgUW1$NavLink, Link as $hgUW1$Link, useNavigate as $hgUW1$useNavigate, useLocation as $hgUW1$useLocation, useSearchParams as $hgUW1$useSearchParams} from "react-router-dom";
6
6
  import $hgUW1$qs from "qs";
7
7
  import $hgUW1$axios from "axios";
8
8
  import {useQuery as $hgUW1$useQuery, QueryClient as $hgUW1$QueryClient, QueryClientProvider as $hgUW1$QueryClientProvider} from "@tanstack/react-query";
@@ -275,7 +275,6 @@ var $11500a65bd7d9cf1$export$2e2bcd8739ae039 = $11500a65bd7d9cf1$var$HeaderConte
275
275
 
276
276
 
277
277
 
278
-
279
278
  const $61ff88fb3f6ee2c8$var$queryClient = new (0, $hgUW1$QueryClient)({
280
279
  defaultOptions: {
281
280
  queries: {
@@ -299,44 +298,25 @@ var $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 = $61ff88fb3f6ee2c8$var$withQueryPr
299
298
 
300
299
 
301
300
 
302
-
303
301
  const $4808982eba3feb88$var$DatasetListSubmenuItem = (props)=>{
304
- const desktop = (0, $hgUW1$useMediaQuery)({
305
- minWidth: 1024
306
- });
307
- const { title: title, identifier: identifier, paginationEnabled: paginationEnabled, dataDictionaryLinks: dataDictionaryLinks } = props;
308
- let linkContainerClasses = "ds-u-margin-bottom--2";
309
- if (dataDictionaryLinks) linkContainerClasses += " ds-l-col--6 ds-u-padding-right--0";
310
- else linkContainerClasses += " ds-l-col--auto ds-u-padding-left--0";
311
- let linkClasses = "ds-u-display--block ds-u-text-align--left";
312
- if (desktop) {
313
- linkContainerClasses = "ds-u-padding-x--0";
314
- linkClasses += " ds-l-col--4 ds-l-md-col--auto";
315
- }
302
+ const { title: title, identifier: identifier, linkClasses: linkClasses } = props;
316
303
  return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
317
- className: "dc-c-list-item ds-u-padding-top--4",
318
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
319
- className: `dc-c-searchlist-item ${paginationEnabled ? "ds-u-border-top--1" : "ds-u-border-bottom--1 ds-u-padding-bottom--3"}`,
320
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
321
- className: "ds-l-row ds-u-align-items--start",
322
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
323
- "aria-describedby": `dataset-${identifier}-updated-date`,
324
- to: `/dataset/${identifier}`,
325
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("h2", {
326
- className: "ds-l-col--12 ds-text-heading--md",
327
- children: title
328
- })
329
- })
304
+ className: "dc-c-list-item",
305
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$NavLink), {
306
+ className: `ds-u-display-flex ds-u-align-items--center ds-u-text-align--left ${linkClasses}`,
307
+ to: `/dataset/${identifier}`,
308
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
309
+ className: "ds-text-heading--md ds-u-margin-left--0",
310
+ children: title
330
311
  })
331
312
  })
332
- });
313
+ }, identifier);
333
314
  };
334
315
  var $4808982eba3feb88$export$2e2bcd8739ae039 = $4808982eba3feb88$var$DatasetListSubmenuItem;
335
316
 
336
317
 
337
318
 
338
319
 
339
-
340
320
  function $6d5c0212e738499b$export$34e95918366a058e(params, ACA) {
341
321
  if (ACA) params = Object.assign(params, {
342
322
  ACA: ACA,
@@ -346,136 +326,36 @@ function $6d5c0212e738499b$export$34e95918366a058e(params, ACA) {
346
326
  }
347
327
 
348
328
 
349
- function $eff7d34c30f5a0fc$export$959638e8dca60ce6(facets) {
350
- let facetObj = {};
351
- if (facets) {
352
- facets.forEach((f)=>{
353
- if (facetObj[f.type]) facetObj[f.type] = [
354
- ...facetObj[f.type],
355
- f
356
- ];
357
- else facetObj[f.type] = [
358
- f
359
- ];
360
- });
361
- // sort facets descending by int value, put non int last
362
- if (facetObj.keyword) facetObj.keyword.sort((a, b)=>{
363
- if (Number(a.name) && Number(b.name)) return Number(b.name) - Number(a.name);
364
- });
365
- return facetObj;
366
- }
367
- }
368
- function $eff7d34c30f5a0fc$export$60ec7cc1d341a524(searchParams, defaultSortOptions) {
369
- const params = (0, $hgUW1$qs).parse(searchParams, {
370
- ignoreQueryPrefix: true
371
- });
372
- let themes = params.theme;
373
- let keywords = params.keyword;
374
- return {
375
- page: params.page,
376
- sort: !params.sort ? defaultSortOptions.defaultSort : params.sort,
377
- sortOrder: !params.sortOrder ? defaultSortOptions.defaultOrder : params.sortOrder,
378
- fulltext: params.fulltext,
379
- selectedFacets: {
380
- theme: themes ? themes : [],
381
- keyword: keywords ? keywords : []
382
- }
383
- };
384
- }
385
- async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, ACA) {
386
- const { fulltext: fulltext, selectedFacets: selectedFacets, sort: sort, sortOrder: sortOrder, page: page, pageSize: pageSize } = options;
387
- let params = {
388
- fulltext: fulltext ? fulltext : undefined,
389
- ...selectedFacets,
390
- sort: sort ? sort : undefined,
391
- ["sort-order"]: sortOrder ? sortOrder : undefined,
392
- page: page !== 1 ? page : undefined,
393
- ["page-size"]: pageSize !== 10 ? pageSize : undefined
394
- };
395
- return await (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
396
- arrayFormat: "comma",
397
- encode: false
398
- })}`);
399
- }
400
-
401
-
402
-
403
329
 
404
330
  const $844981eac9b63865$export$eccc29c8d0ff408 = (0, $hgUW1$createContext)({
405
331
  ACA: undefined
406
332
  });
407
333
 
408
334
 
409
- const $9384a736d4d6f425$var$DatasetListSubmenu = (props)=>{
410
- const { rootUrl: rootUrl, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 3, defaultSort: defaultSort = {
411
- defaultSort: "modified",
412
- defaultOrder: "desc"
413
- }, dataDictionaryLinks: dataDictionaryLinks = false } = props;
335
+ const $10bc3aae21fc1572$var$DatasetListSubmenu = ({ rootUrl: rootUrl, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 4, defaultSort: defaultSort = {
336
+ defaultSort: "modified",
337
+ defaultOrder: "desc"
338
+ }, subLinkClasses: subLinkClasses })=>{
414
339
  const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
415
- const defaultSortBy = "";
416
- const defaultSortOrder = "";
417
- const defaultPage = 1;
418
- const location = (0, $hgUW1$useLocation)();
419
- const transformedParams = (0, $eff7d34c30f5a0fc$export$60ec7cc1d341a524)(location.search, defaultSort);
420
340
  const [currentResultNumbers, setCurrentResultNumbers] = (0, $hgUW1$useState)({
421
341
  total: 0,
422
342
  startingNumber: 0,
423
343
  endingNumber: 0
424
344
  });
425
345
  const [noResults, setNoResults] = (0, $hgUW1$useState)(false);
426
- const [announcementText, setAnnouncementText] = (0, $hgUW1$useState)("");
427
- let [searchParams, setSearchParams] = (0, $hgUW1$useSearchParams)();
428
346
  const [totalItems, setTotalItems] = (0, $hgUW1$useState)(0);
429
- const [page, setPage] = (0, $hgUW1$useState)(transformedParams.page ? transformedParams.page : defaultPage);
430
- const [sort, setSort] = (0, $hgUW1$useState)(transformedParams.sort ? transformedParams.sort : defaultSort ? defaultSort.defaultSort : defaultSortBy);
431
- const [sortOrder, setSortOrder] = (0, $hgUW1$useState)(transformedParams.sortOrder ? transformedParams.sortOrder : defaultSort ? defaultSort.defaultOrder : defaultSortOrder);
432
347
  const pageSize = defaultPageSize;
433
348
  (0, $hgUW1$useEffect)(()=>{
434
- // Update browser URL with current search params
435
- const params = buildSearchParams(true);
436
- const url = new URL(window.location.href);
437
- window.history.pushState({}, "", `${url.origin}${url.pathname}${params}`);
438
- const baseNumber = Number(totalItems) > 0 ? 1 : 0;
439
- const startingNumber = baseNumber + (Number(pageSize) * Number(page) - Number(pageSize));
440
- const endingNumber = Number(pageSize) * Number(page);
441
- setCurrentResultNumbers({
442
- total: Number(totalItems),
443
- startingNumber: Number(totalItems) >= startingNumber ? startingNumber : 0,
444
- endingNumber: Number(totalItems) < endingNumber ? Number(totalItems) : endingNumber
445
- });
446
- setTimeout(()=>{
447
- setAnnouncementText(`Showing ${startingNumber} to ${endingNumber} of ${totalItems} datasets`);
448
- }, 100);
449
349
  if (totalItems <= 0 && currentResultNumbers !== null) setNoResults(true);
450
350
  else setNoResults(false);
451
351
  }, [
452
352
  totalItems,
453
- pageSize,
454
- page
455
- ]);
456
- (0, $hgUW1$useEffect)(()=>{
457
- var params = buildSearchParams(true);
458
- if (params !== location.search) setSearchParams(params);
459
- }, [
460
- page,
461
- sort,
462
- sortOrder
353
+ pageSize
463
354
  ]);
464
- function buildSearchParams(includePage) {
465
- let newParams = {};
466
- if (Number(page) !== 1 && includePage) newParams.page = page;
467
- if (sort !== defaultSort.defaultSort) newParams.sort = sort;
468
- if (sortOrder !== defaultSort.defaultOrder) newParams.sortOrder = sortOrder;
469
- return (0, $hgUW1$qs).stringify(newParams, {
470
- addQueryPrefix: includePage,
471
- encode: true
472
- });
473
- }
474
355
  let params = {
475
- sort: sort ? sort : undefined,
476
- ["sort-order"]: sortOrder ? sortOrder : undefined,
477
- page: page !== 1 ? page : undefined,
478
- ["page-size"]: pageSize !== 10 ? pageSize : undefined
356
+ sort: defaultSort.defaultSort,
357
+ ["sort-order"]: defaultSort.defaultOrder,
358
+ ["page-size"]: defaultPageSize
479
359
  };
480
360
  const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
481
361
  queryKey: [
@@ -489,79 +369,97 @@ const $9384a736d4d6f425$var$DatasetListSubmenu = (props)=>{
489
369
  })}`);
490
370
  }
491
371
  });
492
- if (data && data.data.total && totalItems != data.data.total) setTotalItems(data.data.total);
372
+ let submenuItemsCount = 0;
373
+ if (data) {
374
+ if (data.data.total && totalItems !== data.data.total) setTotalItems(data.data.total);
375
+ let resultsCount = Object.keys(data.data.results).length;
376
+ // For the submenu pager, If there are fewer than 4 dataset items, display the dataset item count, otherwise, show "Viewing 4..".
377
+ submenuItemsCount = resultsCount > defaultPageSize ? defaultPageSize : resultsCount;
378
+ }
493
379
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
494
380
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("section", {
495
- className: "ds-l-container",
496
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
497
- className: "ds-l-row ds-u-padding-top--4",
498
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
499
- className: "ds-l-col--12",
500
- children: isPending ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
501
- className: "ds-u-valign--middle",
502
- "aria-valuetext": "Dataset Search loading",
503
- role: "status"
504
- }) : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
381
+ className: " dkan-c-site-menu--sub-menu",
382
+ children: isPending ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
383
+ className: "ds-u-valign--middle",
384
+ "aria-valuetext": "Dataset Search loading",
385
+ role: "status"
386
+ }) : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
387
+ children: [
388
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("ol", {
389
+ className: "dc-dataset-search-list ds-u-padding--0 ds-u-margin-top--0 ds-u-lg-margin-top--2 ds-u-margin-bottom--2 ds-u-display--block",
390
+ "data-testid": "submenu-results-list",
505
391
  children: [
506
- /*#__PURE__*/ (0, $hgUW1$jsx)("h3", {
507
- children: "Test submenu list of new datasets."
392
+ noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
393
+ variation: "error",
394
+ heading: "No results found."
508
395
  }),
509
- /*#__PURE__*/ (0, $hgUW1$jsxs)("ol", {
510
- className: "dc-dataset-search-list ds-u-padding--0 ds-u-margin-top--0 ds-u-margin-bottom--4 ds-u-display--block",
511
- "data-testid": "results-list",
512
- children: [
513
- noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
514
- variation: "error",
515
- heading: "No results found."
516
- }),
517
- data && data.data.results ? Object.keys(data.data.results).map((key)=>{
518
- return data.data.results[key];
519
- }).map((item)=>{
520
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $4808982eba3feb88$export$2e2bcd8739ae039), {
521
- title: item.title,
522
- identifier: item.identifier,
523
- paginationEnabled: enablePagination,
524
- dataDictionaryLinks: dataDictionaryLinks
525
- }, item.identifier);
526
- }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
527
- variation: "error",
528
- heading: "Could not connect to the API."
529
- })
530
- ]
531
- }),
532
- /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
533
- className: "ds-u-display--flex ds-u-justify-content--between ds-u-align-items--end ds-u-flex-wrap--reverse ds-u-sm-flex-wrap--wrap",
534
- children: enablePagination && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
535
- className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--8",
396
+ data && data.data.results ? Object.keys(data.data.results).map((key)=>{
397
+ return data.data.results[key];
398
+ }).map((item)=>{
399
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $4808982eba3feb88$export$2e2bcd8739ae039), {
400
+ title: item.title,
401
+ identifier: item.identifier,
402
+ linkClasses: subLinkClasses
403
+ }, item.identifier);
404
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
405
+ variation: "error",
406
+ heading: "Could not connect to the API."
407
+ })
408
+ ]
409
+ }),
410
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
411
+ className: "ds-u-display--flex ds-u-justify-content--between ds-u-align-items--center ds-u-border-top--1 ds-u-padding-top--3 ds-u-padding-bottom--2 ds-u-margin-x--3 ds-u-lg-margin-x--0",
412
+ children: enablePagination && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
413
+ children: [
414
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
415
+ className: "",
536
416
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
537
- className: "ds-u-margin-y--0",
417
+ className: "ds-u-margin-y--0 ds-u-font-size--sm",
538
418
  "aria-hidden": "true",
539
- children: currentResultNumbers && data && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
419
+ children: data && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
540
420
  children: [
541
421
  "Viewing ",
542
- currentResultNumbers.endingNumber,
422
+ submenuItemsCount,
543
423
  " of ",
544
424
  data.data.total
545
425
  ]
546
426
  })
547
427
  })
428
+ }),
429
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
430
+ className: "",
431
+ children: data && data.data.total > 0 && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Link), {
432
+ className: "ds-u-padding--0 ds-c-button ds-c-button--ghost dkan-c-header--link",
433
+ to: `../whats-new`,
434
+ children: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
435
+ className: "ds-text-heading--md",
436
+ children: [
437
+ " ",
438
+ `View all ${data.data.total} entries`,
439
+ " "
440
+ ]
441
+ })
442
+ })
548
443
  })
549
- })
550
- ]
444
+ ]
445
+ })
551
446
  })
552
- })
447
+ ]
553
448
  })
554
449
  })
555
450
  });
556
451
  };
557
- var $9384a736d4d6f425$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($9384a736d4d6f425$var$DatasetListSubmenu);
452
+ var $10bc3aae21fc1572$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039)($10bc3aae21fc1572$var$DatasetListSubmenu);
453
+
558
454
 
559
455
 
560
456
 
561
457
 
562
458
 
563
- const $4f153ca537d853e5$var$SubMenuStaticItem = (submenuArray, subLinkClasses)=>// @todo: Move into a separate component
564
- submenuArray.map((s)=>{
459
+
460
+ const $6d0cf21faac6a2dd$var$SubMenuStaticList = ({ submenuArray: submenuArray, subLinkClasses: subLinkClasses, setIsExpanded: setIsExpanded })=>{
461
+ // Render a static list of submenu items as listed in the assets/menu.jsx file.
462
+ let submenuItems = submenuArray.map((s)=>{
565
463
  return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
566
464
  children: s.external || s.drupalPage ? /*#__PURE__*/ (0, $hgUW1$jsxs)("a", {
567
465
  href: s.url,
@@ -575,7 +473,7 @@ const $4f153ca537d853e5$var$SubMenuStaticItem = (submenuArray, subLinkClasses)=>
575
473
  }) : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$NavLink), {
576
474
  to: s.url,
577
475
  className: `ds-u-display-flex ds-u-align-items--center ${subLinkClasses}`,
578
- onClick: ()=>setIsExpanded(!isExpanded),
476
+ onClick: ()=>setIsExpanded((prev)=>!prev),
579
477
  children: [
580
478
  s.icon ?? null,
581
479
  /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
@@ -585,19 +483,16 @@ const $4f153ca537d853e5$var$SubMenuStaticItem = (submenuArray, subLinkClasses)=>
585
483
  })
586
484
  }, s.id);
587
485
  });
588
- const $4f153ca537d853e5$var$SubMenuDynamicList = ({ rootUrl: rootUrl, location: location })=>{
589
- // @todo: If we don't need subLinkClasses, call the DatasetListSubmenu component directly.
590
- return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $9384a736d4d6f425$export$2e2bcd8739ae039), {
591
- rootUrl: rootUrl,
592
- location: location,
593
- formClassName: "ds-u-display--flex ds-u-align-items--end ds-u-justify-content--between ds-u-margin-bottom--2",
594
- fulltextLabelClassName: "",
595
- fulltextPlaceholder: "",
596
- fulltextLabel: "Dataset submenu List"
486
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
487
+ className: `dkan-c-site-menu--sub-menu`,
488
+ children: submenuItems
597
489
  });
598
490
  };
491
+ var $6d0cf21faac6a2dd$export$2e2bcd8739ae039 = $6d0cf21faac6a2dd$var$SubMenuStaticList;
492
+
493
+
599
494
  const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, subLinkClasses: subLinkClasses, wrapLabel: wrapLabel = true })=>{
600
- const [isExpanded1, setIsExpanded1] = (0, $hgUW1$useState)(false);
495
+ const [isExpanded, setIsExpanded] = (0, $hgUW1$useState)(false);
601
496
  const headerContext = (0, $hgUW1$react).useContext((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039));
602
497
  const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
603
498
  children: link.label
@@ -607,10 +502,10 @@ const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, s
607
502
  let currentMenu = null;
608
503
  if (menu.current) currentMenu = menu.current;
609
504
  function handleClickOutside(event) {
610
- if (currentMenu && !currentMenu.contains(event.target)) setIsExpanded1(false);
505
+ if (currentMenu && !currentMenu.contains(event.target)) setIsExpanded(false);
611
506
  }
612
507
  function handleFocusOut(event) {
613
- if (currentMenu && !currentMenu.contains(event.relatedTarget)) setIsExpanded1(false);
508
+ if (currentMenu && !currentMenu.contains(event.relatedTarget)) setIsExpanded(false);
614
509
  }
615
510
  document.addEventListener("mousedown", handleClickOutside);
616
511
  currentMenu?.addEventListener("focusout", handleFocusOut);
@@ -619,15 +514,26 @@ const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, s
619
514
  if (currentMenu) currentMenu.removeEventListener("focusout", handleFocusOut);
620
515
  };
621
516
  }, [
622
- isExpanded1
517
+ isExpanded
623
518
  ]);
624
519
  let submenuBlock;
625
520
  if (link.submenu) {
626
- if (Array.isArray(link.submenu)) submenuBlock = $4f153ca537d853e5$var$SubMenuStaticItem(link.submenu, subLinkClasses);
627
- else if (/*#__PURE__*/ (0, $hgUW1$react).isValidElement(link.submenu)) submenuBlock = $4f153ca537d853e5$var$SubMenuDynamicList(link.submenu, subLinkClasses);
521
+ if (Array.isArray(link.submenu)) submenuBlock = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6d0cf21faac6a2dd$export$2e2bcd8739ae039), {
522
+ submenuArray: link.submenu,
523
+ subLinkClasses: subLinkClasses,
524
+ setIsExpanded: setIsExpanded
525
+ });
526
+ else if (/*#__PURE__*/ (0, $hgUW1$react).isValidElement(link.submenu)) {
527
+ const { rootUrl: rootUrl, location: location } = link.submenu.props;
528
+ submenuBlock = /*#__PURE__*/ (0, $hgUW1$jsx)((0, $10bc3aae21fc1572$export$2e2bcd8739ae039), {
529
+ location: location,
530
+ rootUrl: rootUrl,
531
+ subLinkClasses: subLinkClasses
532
+ });
533
+ }
628
534
  }
629
535
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("li", {
630
- className: `dkan-c-nav-submenu has-submenu${isExpanded1 ? " open" : ""}`,
536
+ className: `dkan-c-nav-submenu has-submenu${isExpanded ? " open" : ""}`,
631
537
  ref: menu,
632
538
  children: [
633
539
  /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Button), {
@@ -635,23 +541,20 @@ const $4f153ca537d853e5$var$SubMenu = ({ link: link, linkClasses: linkClasses, s
635
541
  onDark: headerContext.onDark,
636
542
  className: `${linkClasses}`,
637
543
  "aria-haspopup": "true",
638
- "aria-expanded": isExpanded1,
544
+ "aria-expanded": isExpanded,
639
545
  onClick: (e)=>{
640
546
  e.preventDefault();
641
- setIsExpanded1(!isExpanded1);
547
+ setIsExpanded(!isExpanded);
642
548
  },
643
549
  children: [
644
550
  innerHtml,
645
551
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$ArrowIcon), {
646
552
  className: "ds-u-margin-left--1",
647
- direction: isExpanded1 ? "down" : "right"
553
+ direction: isExpanded ? "down" : "right"
648
554
  })
649
555
  ]
650
556
  }),
651
- /*#__PURE__*/ (0, $hgUW1$jsx)("ul", {
652
- className: "dkan-c-site-menu--sub-menu",
653
- children: submenuBlock
654
- })
557
+ submenuBlock
655
558
  ]
656
559
  });
657
560
  };
@@ -1207,6 +1110,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
1207
1110
  version: "1.1",
1208
1111
  xmlns: "http://www.w3.org/2000/svg",
1209
1112
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1113
+ "aria-hidden": "true",
1210
1114
  children: [
1211
1115
  /*#__PURE__*/ (0, $hgUW1$jsx)("title", {
1212
1116
  children: "Overview Icon"
@@ -1249,6 +1153,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
1249
1153
  version: "1.1",
1250
1154
  xmlns: "http://www.w3.org/2000/svg",
1251
1155
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1156
+ "aria-hidden": "true",
1252
1157
  children: [
1253
1158
  /*#__PURE__*/ (0, $hgUW1$jsx)("title", {
1254
1159
  children: "Data Table Icon"
@@ -1281,6 +1186,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
1281
1186
  version: "1.1",
1282
1187
  xmlns: "http://www.w3.org/2000/svg",
1283
1188
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1189
+ "aria-hidden": "true",
1284
1190
  children: [
1285
1191
  /*#__PURE__*/ (0, $hgUW1$jsx)("title", {
1286
1192
  children: "API Icon"
@@ -1313,6 +1219,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
1313
1219
  version: "1.1",
1314
1220
  xmlns: "http://www.w3.org/2000/svg",
1315
1221
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1222
+ "aria-hidden": "true",
1316
1223
  children: [
1317
1224
  /*#__PURE__*/ (0, $hgUW1$jsx)("title", {
1318
1225
  children: "Download Icon"
@@ -1342,6 +1249,7 @@ const $b38839fd67928f42$var$SearchItemIcon = (props)=>{
1342
1249
  version: "1.1",
1343
1250
  xmlns: "http://www.w3.org/2000/svg",
1344
1251
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1252
+ "aria-hidden": "true",
1345
1253
  children: [
1346
1254
  /*#__PURE__*/ (0, $hgUW1$jsx)("title", {
1347
1255
  children: "Data Dictionary Icon"
@@ -1564,11 +1472,29 @@ const $20de4fedf33d4f9a$var$DatasetDate = (props)=>{
1564
1472
  var $20de4fedf33d4f9a$export$2e2bcd8739ae039 = $20de4fedf33d4f9a$var$DatasetDate;
1565
1473
 
1566
1474
 
1475
+ function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
1476
+ if (dist && dist.data) {
1477
+ if (dist.data.format) return dist.data.format.toLowerCase();
1478
+ if (dist.data.mediaType) {
1479
+ const mediaType = dist.data.mediaType.split("/");
1480
+ if (mediaType.length && mediaType[1]) return mediaType[1].toLowerCase();
1481
+ }
1482
+ if (dist.data["%Ref:downloadURL"].length && dist.data["%Ref:downloadURL"][0].data) {
1483
+ if (dist.data["%Ref:downloadURL"][0].data.mimeType) {
1484
+ const mimeType = dist.data["%Ref:downloadURL"][0].data.mimeType.split("/");
1485
+ if (mimeType.length && mimeType[1]) return mimeType[1].toLowerCase();
1486
+ }
1487
+ }
1488
+ }
1489
+ return "";
1490
+ }
1491
+
1492
+
1567
1493
  const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
1568
1494
  const desktop = (0, $hgUW1$useMediaQuery)({
1569
1495
  minWidth: 1024
1570
1496
  });
1571
- const { title: title, modified: modified, description: description, downloadUrl: downloadUrl, largeFile: largeFile = false, paginationEnabled: paginationEnabled, dataDictionaryLinks: dataDictionaryLinks, identifier: identifier, refresh: refresh, released: released, showDateDetails: showDateDetails = false, showTopics: showTopics = false, theme: theme, topicSlugs: topicSlugs } = props;
1497
+ const { title: title, modified: modified, description: description, downloadUrl: downloadUrl, largeFile: largeFile = false, paginationEnabled: paginationEnabled, dataDictionaryLinks: dataDictionaryLinks, identifier: identifier, refresh: refresh, released: released, showDateDetails: showDateDetails = false, showTopics: showTopics = false, theme: theme, topicSlugs: topicSlugs, distribution: distribution } = props;
1572
1498
  const location = (0, $hgUW1$useLocation)();
1573
1499
  let linkContainerClasses = "ds-u-margin-bottom--2";
1574
1500
  if (dataDictionaryLinks) linkContainerClasses += " ds-l-col--6 ds-u-padding-right--0";
@@ -1607,6 +1533,66 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
1607
1533
  refresh: refresh
1608
1534
  };
1609
1535
  const url = `/dataset/${identifier}`;
1536
+ const DataTableLink = ()=>{
1537
+ if ((0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv") return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Link), {
1538
+ to: `${url}#data-table`,
1539
+ children: [
1540
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $b38839fd67928f42$export$2e2bcd8739ae039), {
1541
+ id: "data-table"
1542
+ }),
1543
+ "Data Table"
1544
+ ]
1545
+ });
1546
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
1547
+ className: "dkan-disabled-link",
1548
+ component: "a",
1549
+ offset: [
1550
+ 0,
1551
+ 5
1552
+ ],
1553
+ title: "There is no Data Table associated with this dataset. Data Tables will only display for CSV files.",
1554
+ "aria-disabled": "true",
1555
+ children: [
1556
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $b38839fd67928f42$export$2e2bcd8739ae039), {
1557
+ id: "data-table"
1558
+ }),
1559
+ "Data Table"
1560
+ ]
1561
+ });
1562
+ };
1563
+ const dataDictionaryExists = ()=>{
1564
+ if (distribution && "data" in distribution) {
1565
+ if ("describedBy" in distribution.data && "describedByType" in distribution.data) return distribution.data.describedByType === "application/vnd.tableschema+json";
1566
+ }
1567
+ return false;
1568
+ };
1569
+ const DataDictionaryLink = ()=>{
1570
+ if (dataDictionaryExists()) return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Link), {
1571
+ to: `${url}#data-dictionary`,
1572
+ children: [
1573
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $b38839fd67928f42$export$2e2bcd8739ae039), {
1574
+ id: "data-dictionary"
1575
+ }),
1576
+ "Data Dictionary"
1577
+ ]
1578
+ });
1579
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Tooltip), {
1580
+ className: "dkan-disabled-link",
1581
+ component: "a",
1582
+ offset: [
1583
+ 0,
1584
+ 5
1585
+ ],
1586
+ title: "There is no Data Dictionary associated with this dataset.",
1587
+ "aria-disabled": "true",
1588
+ children: [
1589
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $b38839fd67928f42$export$2e2bcd8739ae039), {
1590
+ id: "data-dictionary"
1591
+ }),
1592
+ "Data Dictionary"
1593
+ ]
1594
+ });
1595
+ };
1610
1596
  return /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
1611
1597
  className: "dc-c-search-list-item ds-u-padding-top--3",
1612
1598
  children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
@@ -1688,16 +1674,8 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
1688
1674
  /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
1689
1675
  className: linkContainerClasses,
1690
1676
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
1691
- className: linkClasses,
1692
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Link), {
1693
- to: `${url}#data-table`,
1694
- children: [
1695
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $b38839fd67928f42$export$2e2bcd8739ae039), {
1696
- id: "data-table"
1697
- }),
1698
- "Data Table"
1699
- ]
1700
- })
1677
+ className: `${linkClasses}${(0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ? "" : " dkan-disabled-link-wrapper"}`,
1678
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)(DataTableLink, {})
1701
1679
  })
1702
1680
  }),
1703
1681
  /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
@@ -1718,16 +1696,8 @@ const $52c6454cae137465$var$DatasetSearchListItem = (props)=>{
1718
1696
  dataDictionaryLinks ? /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
1719
1697
  className: linkContainerClasses,
1720
1698
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
1721
- className: linkClasses,
1722
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Link), {
1723
- to: `${url}#data-dictionary`,
1724
- children: [
1725
- /*#__PURE__*/ (0, $hgUW1$jsx)((0, $b38839fd67928f42$export$2e2bcd8739ae039), {
1726
- id: "data-dictionary"
1727
- }),
1728
- "Data Dictionary"
1729
- ]
1730
- })
1699
+ className: `${linkClasses}${dataDictionaryExists() ? "" : " dkan-disabled-link-wrapper"}`,
1700
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)(DataDictionaryLink, {})
1731
1701
  })
1732
1702
  }) : "",
1733
1703
  /*#__PURE__*/ (0, $hgUW1$jsx)("li", {
@@ -1762,6 +1732,7 @@ var $52c6454cae137465$export$2e2bcd8739ae039 = $52c6454cae137465$var$DatasetSear
1762
1732
 
1763
1733
 
1764
1734
 
1735
+
1765
1736
  const $789279954d8eff7f$var$ApiDocumentation = ({ endpoint: endpoint })=>{
1766
1737
  return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
1767
1738
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$swaggeruireact), {
@@ -2247,6 +2218,7 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
2247
2218
  style: {
2248
2219
  width: header.getSize()
2249
2220
  },
2221
+ title: typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "",
2250
2222
  className: "ds-u-border-y--2 ds-u-padding--2 ds-u-border--dark ds-u-font-weight--bold",
2251
2223
  children: [
2252
2224
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
@@ -2254,7 +2226,6 @@ const $64a351d3fd8413c3$var$HeaderResizeElement = ({ table: table, header: heade
2254
2226
  children: [
2255
2227
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
2256
2228
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
2257
- title: typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : "",
2258
2229
  children: header.isPlaceholder ? null : (0, $hgUW1$flexRender)(header.column.columnDef.header, header.getContext())
2259
2230
  })
2260
2231
  }),
@@ -4379,6 +4350,61 @@ var $5723016a5461c1ca$export$2e2bcd8739ae039 = $5723016a5461c1ca$var$PageHeader;
4379
4350
 
4380
4351
 
4381
4352
 
4353
+ function $eff7d34c30f5a0fc$export$959638e8dca60ce6(facets) {
4354
+ let facetObj = {};
4355
+ if (facets) {
4356
+ facets.forEach((f)=>{
4357
+ if (facetObj[f.type]) facetObj[f.type] = [
4358
+ ...facetObj[f.type],
4359
+ f
4360
+ ];
4361
+ else facetObj[f.type] = [
4362
+ f
4363
+ ];
4364
+ });
4365
+ // sort facets descending by int value, put non int last
4366
+ if (facetObj.keyword) facetObj.keyword.sort((a, b)=>{
4367
+ if (Number(a.name) && Number(b.name)) return Number(b.name) - Number(a.name);
4368
+ });
4369
+ return facetObj;
4370
+ }
4371
+ }
4372
+ function $eff7d34c30f5a0fc$export$60ec7cc1d341a524(searchParams, defaultSortOptions) {
4373
+ const params = (0, $hgUW1$qs).parse(searchParams, {
4374
+ ignoreQueryPrefix: true
4375
+ });
4376
+ let themes = params.theme;
4377
+ let keywords = params.keyword;
4378
+ return {
4379
+ page: params.page,
4380
+ sort: !params.sort ? defaultSortOptions.defaultSort : params.sort,
4381
+ sortOrder: !params.sortOrder ? defaultSortOptions.defaultOrder : params.sortOrder,
4382
+ fulltext: params.fulltext,
4383
+ selectedFacets: {
4384
+ theme: themes ? themes : [],
4385
+ keyword: keywords ? keywords : []
4386
+ }
4387
+ };
4388
+ }
4389
+ async function $eff7d34c30f5a0fc$export$2d2256cb46e92ff7(rootUrl, options, ACA) {
4390
+ const { fulltext: fulltext, selectedFacets: selectedFacets, sort: sort, sortOrder: sortOrder, page: page, pageSize: pageSize } = options;
4391
+ let params = {
4392
+ fulltext: fulltext ? fulltext : undefined,
4393
+ ...selectedFacets,
4394
+ sort: sort ? sort : undefined,
4395
+ ["sort-order"]: sortOrder ? sortOrder : undefined,
4396
+ page: page !== 1 ? page : undefined,
4397
+ ["page-size"]: pageSize !== 10 ? pageSize : undefined
4398
+ };
4399
+ return await (0, $hgUW1$axios).get(`${rootUrl}/search/?${(0, $hgUW1$qs).stringify((0, $6d5c0212e738499b$export$34e95918366a058e)(params, ACA), {
4400
+ arrayFormat: "comma",
4401
+ encode: false
4402
+ })}`);
4403
+ }
4404
+
4405
+
4406
+
4407
+
4382
4408
 
4383
4409
  const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
4384
4410
  const { rootUrl: rootUrl, enableSort: enableSort = true, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort = {
@@ -4728,7 +4754,8 @@ const $e873081a6e8f024e$var$DatasetSearch = (props)=>{
4728
4754
  downloadUrl: showDownloadIcon ? getDownloadUrl(item) : null,
4729
4755
  largeFile: showLargeFile,
4730
4756
  paginationEnabled: enablePagination,
4731
- dataDictionaryLinks: dataDictionaryLinks
4757
+ dataDictionaryLinks: dataDictionaryLinks,
4758
+ distribution: "%Ref:distribution" in item ? item["%Ref:distribution"][0] : {}
4732
4759
  }, item.identifier);
4733
4760
  }) : /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
4734
4761
  variation: "error",
@@ -4779,11 +4806,10 @@ var $e873081a6e8f024e$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
4779
4806
 
4780
4807
 
4781
4808
 
4782
- const $550bcc185f420ff5$var$DatasetList = (props)=>{
4783
- const { rootUrl: rootUrl, enableSort: enableSort = true, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort = {
4784
- defaultSort: "modified",
4785
- defaultOrder: "desc"
4786
- }, pageTitle: pageTitle = "What's New ", showLargeFileWarning: showLargeFileWarning = false, introText: introText = "", dataDictionaryLinks: dataDictionaryLinks = false } = props;
4809
+ const $550bcc185f420ff5$var$DatasetList = ({ rootUrl: rootUrl, enableSort: enableSort = true, enablePagination: enablePagination = true, defaultPageSize: defaultPageSize = 10, defaultSort: defaultSort = {
4810
+ defaultSort: "modified",
4811
+ defaultOrder: "desc"
4812
+ }, pageTitle: pageTitle = "What's New ", showLargeFileWarning: showLargeFileWarning = false, introText: introText = "", dataDictionaryLinks: dataDictionaryLinks = false })=>{
4787
4813
  const { ACA: ACA } = (0, $hgUW1$useContext)((0, $844981eac9b63865$export$eccc29c8d0ff408));
4788
4814
  const sortOptions = [
4789
4815
  {
@@ -4915,29 +4941,26 @@ const $550bcc185f420ff5$var$DatasetList = (props)=>{
4915
4941
  children: [
4916
4942
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4917
4943
  className: "ds-l-row",
4918
- children: /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4944
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4919
4945
  className: "ds-l-col--12",
4920
- children: [
4921
- introText ? introText : null,
4922
- showLargeFileWarning && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4923
- className: "ds-l-row ds-u-margin-bottom--2 ds-u-margin-top--4",
4924
- children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4925
- className: "ds-l-md-col--12",
4926
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
4927
- bordered: true,
4928
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
4929
- contentClassName: "downloading-datasets",
4930
- heading: "Please read before downloading datasets",
4931
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3b2d31a9c6cd2284$export$2e2bcd8739ae039), {})
4932
- })
4946
+ children: showLargeFileWarning && /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4947
+ className: "ds-l-row ds-u-margin-bottom--2 ds-u-margin-top--4",
4948
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4949
+ className: "ds-l-md-col--12",
4950
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Accordion), {
4951
+ bordered: true,
4952
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$AccordionItem), {
4953
+ contentClassName: "downloading-datasets",
4954
+ heading: "Please read before downloading datasets",
4955
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3b2d31a9c6cd2284$export$2e2bcd8739ae039), {})
4933
4956
  })
4934
4957
  })
4935
4958
  })
4936
- ]
4959
+ })
4937
4960
  })
4938
4961
  }),
4939
4962
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4940
- className: "ds-l-row ds-u-padding-top--4",
4963
+ className: "ds-l-row",
4941
4964
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4942
4965
  className: "ds-l-col--12",
4943
4966
  children: isPending ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Spinner), {
@@ -4949,32 +4972,40 @@ const $550bcc185f420ff5$var$DatasetList = (props)=>{
4949
4972
  /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4950
4973
  className: "ds-u-display--flex ds-u-justify-content--between ds-u-align-items--end ds-u-flex-wrap--reverse ds-u-sm-flex-wrap--wrap",
4951
4974
  children: [
4952
- enablePagination && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4975
+ /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4953
4976
  className: "ds-l-col--12 ds-l-sm-col--6 ds-l-md-col--8 ds-u-sm-padding-left--0",
4954
4977
  children: [
4955
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4956
- className: "ds-u-margin-y--0",
4957
- "aria-hidden": "true",
4958
- children: currentResultNumbers && data && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
4959
- children: [
4960
- "Showing ",
4961
- currentResultNumbers.startingNumber,
4962
- " -",
4963
- " ",
4964
- currentResultNumbers.endingNumber,
4965
- " of ",
4966
- data.data.total,
4967
- " datasets"
4968
- ]
4969
- })
4978
+ /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4979
+ className: "ds-u-margin-bottom--3",
4980
+ children: introText ? introText : null
4970
4981
  }),
4971
- /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4972
- className: "ds-u-visibility--screen-reader",
4973
- role: "status",
4974
- "aria-live": "assertive",
4975
- "aria-atomic": "true",
4976
- "data-testid": "currentResults",
4977
- children: announcementText
4982
+ enablePagination && /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
4983
+ children: [
4984
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
4985
+ className: "ds-u-margin-y--0",
4986
+ "aria-hidden": "true",
4987
+ children: currentResultNumbers && data && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$Fragment), {
4988
+ children: [
4989
+ "Showing ",
4990
+ currentResultNumbers.startingNumber,
4991
+ " -",
4992
+ " ",
4993
+ currentResultNumbers.endingNumber,
4994
+ " of ",
4995
+ data.data.total,
4996
+ " datasets"
4997
+ ]
4998
+ })
4999
+ }),
5000
+ /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
5001
+ className: "ds-u-visibility--screen-reader",
5002
+ role: "status",
5003
+ "aria-live": "assertive",
5004
+ "aria-atomic": "true",
5005
+ "data-testid": "currentResults",
5006
+ children: announcementText
5007
+ })
5008
+ ]
4978
5009
  })
4979
5010
  ]
4980
5011
  }),
@@ -4993,7 +5024,7 @@ const $550bcc185f420ff5$var$DatasetList = (props)=>{
4993
5024
  }),
4994
5025
  /*#__PURE__*/ (0, $hgUW1$jsxs)("ol", {
4995
5026
  className: "dc-dataset-search-list ds-u-padding--0 ds-u-margin-top--0 ds-u-margin-bottom--4 ds-u-display--block",
4996
- "data-testid": "results-list",
5027
+ "data-testid": "datasetlist-results-list",
4997
5028
  children: [
4998
5029
  noResults && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Alert), {
4999
5030
  variation: "error",
@@ -5055,7 +5086,6 @@ var $550bcc185f420ff5$export$2e2bcd8739ae039 = (0, $61ff88fb3f6ee2c8$export$2e2b
5055
5086
 
5056
5087
 
5057
5088
 
5058
-
5059
5089
  const $b4aa9c66f2e86959$var$useMetastoreDataset = (datasetId, rootAPIUrl)=>{
5060
5090
  const [dataset, setDataset] = (0, $hgUW1$useState)({
5061
5091
  title: "",
@@ -5507,23 +5537,6 @@ const $0958733ee130fc44$var$ResourceInformation = ({ resource: resource })=>{
5507
5537
  var $0958733ee130fc44$export$2e2bcd8739ae039 = $0958733ee130fc44$var$ResourceInformation;
5508
5538
 
5509
5539
 
5510
- function $f764661366bd9e1b$export$ee48b7e0e4eb536e(dist) {
5511
- if (dist && dist.data) {
5512
- if (dist.data.format) return dist.data.format.toLowerCase();
5513
- if (dist.data.mediaType) {
5514
- const mediaType = dist.data.mediaType.split("/");
5515
- if (mediaType.length && mediaType[1]) return mediaType[1].toLowerCase();
5516
- }
5517
- if (dist.data["%Ref:downloadURL"].length && dist.data["%Ref:downloadURL"][0].data) {
5518
- if (dist.data["%Ref:downloadURL"][0].data.mimeType) {
5519
- const mimeType = dist.data["%Ref:downloadURL"][0].data.mimeType.split("/");
5520
- if (mimeType.length && mimeType[1]) return mimeType[1].toLowerCase();
5521
- }
5522
- }
5523
- }
5524
- return "";
5525
- }
5526
-
5527
5540
 
5528
5541
 
5529
5542
  const $7357cc0f79f9c514$var$Resource = ({ distributions: distributions, resource: resource, title: title })=>{
@@ -6358,6 +6371,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
6358
6371
  window.location.hash
6359
6372
  ]);
6360
6373
  const displayDataDictionaryTab = distribution.data && distribution.data.describedBy && distribution.data.describedByType === "application/vnd.tableschema+json" || datasetSitewideDictionary && datasetSitewideDictionary.length > 0;
6374
+ const formatType = (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution);
6361
6375
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Fragment), {
6362
6376
  children: dataset.error ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $026cb986f9fea2b1$export$2e2bcd8739ae039), {
6363
6377
  content: notFoundContent,
@@ -6409,7 +6423,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
6409
6423
  },
6410
6424
  selectedId: selectedTab,
6411
6425
  children: [
6412
- (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
6426
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
6413
6427
  id: "data-table",
6414
6428
  tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
6415
6429
  className: "ds-u-color--primary",
@@ -6421,7 +6435,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
6421
6435
  ]
6422
6436
  }),
6423
6437
  className: borderlessTabs ? "ds-u-border--0 ds-u-padding-x--0" : "",
6424
- children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {
6438
+ children: (0, $f764661366bd9e1b$export$ee48b7e0e4eb536e)(distribution) === "csv" ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $43a30d745a7bbc86$export$2e2bcd8739ae039).Provider, {
6425
6439
  value: {
6426
6440
  id: id,
6427
6441
  resource: resource,
@@ -6432,6 +6446,8 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
6432
6446
  datasetTableControls: !disableTableControls
6433
6447
  },
6434
6448
  children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $39bc4d98030a5599$export$2e2bcd8739ae039), {})
6449
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
6450
+ children: "There is no Data Table associated with this dataset. Data Tables will only display for CSV files."
6435
6451
  })
6436
6452
  }),
6437
6453
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
@@ -6453,7 +6469,7 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
6453
6469
  metadataMapping: metadataMapping
6454
6470
  })
6455
6471
  }),
6456
- !hideDataDictionary && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$TabPanel), {
6472
+ !hideDataDictionary && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
6457
6473
  id: "data-dictionary",
6458
6474
  tab: /*#__PURE__*/ (0, $hgUW1$jsxs)("span", {
6459
6475
  className: "ds-u-color--primary",
@@ -6465,17 +6481,14 @@ const $a0f13962e513caa1$var$Dataset = ({ id: id, rootUrl: rootUrl, customColumns
6465
6481
  ]
6466
6482
  }),
6467
6483
  className: borderlessTabs ? "ds-u-border--0 ds-u-padding-x--0" : "",
6468
- children: [
6469
- displayDataDictionaryTab && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6012b86ffcaf3f71$export$2e2bcd8739ae039), {
6470
- datasetSitewideDictionary: datasetSitewideDictionary,
6471
- datasetDictionaryEndpoint: distribution.data.describedBy,
6472
- title: "Data Dictionary",
6473
- csvDownload: dataDictionaryCSV
6474
- }),
6475
- !displayDataDictionaryTab && /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
6476
- children: "There is no Data Dictionary associated with this dataset."
6477
- })
6478
- ]
6484
+ children: displayDataDictionaryTab ? /*#__PURE__*/ (0, $hgUW1$jsx)((0, $6012b86ffcaf3f71$export$2e2bcd8739ae039), {
6485
+ datasetSitewideDictionary: datasetSitewideDictionary,
6486
+ datasetDictionaryEndpoint: distribution.data.describedBy,
6487
+ title: "Data Dictionary",
6488
+ csvDownload: dataDictionaryCSV
6489
+ }) : /*#__PURE__*/ (0, $hgUW1$jsx)("p", {
6490
+ children: "There is no Data Dictionary associated with this dataset."
6491
+ })
6479
6492
  }),
6480
6493
  distribution && distribution.data && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$TabPanel), {
6481
6494
  id: "api",
@@ -8041,5 +8054,5 @@ var $90fb213ab8eeb2e7$export$2e2bcd8739ae039 = $90fb213ab8eeb2e7$var$useScrollTo
8041
8054
 
8042
8055
 
8043
8056
 
8044
- export {$e49d4387bed21287$export$2e2bcd8739ae039 as ApiRowLimitNotice, $a8accc31bf9e0bda$export$2e2bcd8739ae039 as CMSTopNav, $c49454ea7d1c4579$export$2e2bcd8739ae039 as ErrorBoundary, $046ded0064bd0a3d$export$2e2bcd8739ae039 as FAQAccordion, $b939b31651e82908$export$2e2bcd8739ae039 as HeaderNav, $1555e1cb3eb7b3e3$export$2e2bcd8739ae039 as HeaderNavIconLink, $fea9297ba4dd394c$export$2e2bcd8739ae039 as HeaderSearch, $9a8892c5ac150556$export$2e2bcd8739ae039 as HeaderSiteTitle, $3c72c298c3a7f21f$export$2e2bcd8739ae039 as HeaderTagline, $403833a4b442d5df$export$2e2bcd8739ae039 as MobileMenuButton, $f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $953b286f7778640e$export$2e2bcd8739ae039 as SidebarNavigation, $b0968edc60d7d3a4$export$2e2bcd8739ae039 as SidebarPage, $4f153ca537d853e5$export$2e2bcd8739ae039 as SubMenu, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $c068004d499082cc$export$2e2bcd8739ae039 as DatasetListItem, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $17711e94d2ce0ee4$export$2e2bcd8739ae039 as DatasetDateItem, $20de4fedf33d4f9a$export$2e2bcd8739ae039 as DatasetDate, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $bdb071ea3a6d3466$export$2e2bcd8739ae039 as SearchInput, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $550bcc185f420ff5$export$2e2bcd8739ae039 as DatasetList, $9384a736d4d6f425$export$2e2bcd8739ae039 as DatasetListSubmenu, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $b9af6ce5e2c06331$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $8b67b7ee3fcfb629$export$2e2bcd8739ae039 as StoredQueryPage, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $43a30d745a7bbc86$export$2e2bcd8739ae039 as DataTableContext, $ee0d4d4f34048447$export$2e2bcd8739ae039 as DataTableActionsProvider, $844981eac9b63865$export$eccc29c8d0ff408 as ACAContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6d5c0212e738499b$export$34e95918366a058e as acaToParams, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping};
8057
+ export {$e49d4387bed21287$export$2e2bcd8739ae039 as ApiRowLimitNotice, $a8accc31bf9e0bda$export$2e2bcd8739ae039 as CMSTopNav, $c49454ea7d1c4579$export$2e2bcd8739ae039 as ErrorBoundary, $046ded0064bd0a3d$export$2e2bcd8739ae039 as FAQAccordion, $b939b31651e82908$export$2e2bcd8739ae039 as HeaderNav, $1555e1cb3eb7b3e3$export$2e2bcd8739ae039 as HeaderNavIconLink, $fea9297ba4dd394c$export$2e2bcd8739ae039 as HeaderSearch, $9a8892c5ac150556$export$2e2bcd8739ae039 as HeaderSiteTitle, $3c72c298c3a7f21f$export$2e2bcd8739ae039 as HeaderTagline, $403833a4b442d5df$export$2e2bcd8739ae039 as MobileMenuButton, $f57121650539d8c5$export$2e2bcd8739ae039 as NavBar, $953b286f7778640e$export$2e2bcd8739ae039 as SidebarNavigation, $b0968edc60d7d3a4$export$2e2bcd8739ae039 as SidebarPage, $4f153ca537d853e5$export$2e2bcd8739ae039 as SubMenu, $59a079354baa335c$export$2e2bcd8739ae039 as Hero, $c068004d499082cc$export$2e2bcd8739ae039 as DatasetListItem, $52c6454cae137465$export$2e2bcd8739ae039 as DatasetSearchListItem, $17711e94d2ce0ee4$export$2e2bcd8739ae039 as DatasetDateItem, $20de4fedf33d4f9a$export$2e2bcd8739ae039 as DatasetDate, $10bc3aae21fc1572$export$2e2bcd8739ae039 as DatasetListSubmenu, $789279954d8eff7f$export$2e2bcd8739ae039 as ApiDocumentation, $af099c546cb226c7$export$2e2bcd8739ae039 as ResourceHeader, $626282d9a03c51d5$export$2e2bcd8739ae039 as ResourcePreview, $072291d44ce1834a$export$2e2bcd8739ae039 as ResourceFooter, $ec3e23baa005dc03$export$2e2bcd8739ae039 as Breadcrumb, $bd76a91923d7e8a7$export$2e2bcd8739ae039 as TransformedDate, $d98f94c79ddf4e0e$export$2e2bcd8739ae039 as DataTable, $bdb071ea3a6d3466$export$2e2bcd8739ae039 as SearchInput, $5644ebd2c3dbfd7b$export$eea3a12df15499ca as buildRows, $2ed0091f7e32d1e6$export$2e2bcd8739ae039 as DataTablePageResults, $1a2bf34e2a8f6b80$export$59a943b34a82e690 as truncateText, $c96c4b9ef7203c1f$export$2e2bcd8739ae039 as APIPage, $026cb986f9fea2b1$export$2e2bcd8739ae039 as PageNotFound, $e873081a6e8f024e$export$2e2bcd8739ae039 as DatasetSearch, $550bcc185f420ff5$export$2e2bcd8739ae039 as DatasetList, $a0f13962e513caa1$export$2e2bcd8739ae039 as Dataset, $a35cf16d1488f54e$export$2e2bcd8739ae039 as DatasetTable, $b9af6ce5e2c06331$export$2e2bcd8739ae039 as Header, $a6df0aa147323304$export$2e2bcd8739ae039 as Footer, $669d2782ec2e2250$export$2e2bcd8739ae039 as SpecsAndLimits, $8b67b7ee3fcfb629$export$2e2bcd8739ae039 as StoredQueryPage, $f61ecf9f84951a61$export$2e2bcd8739ae039 as FilteredResource, $bef7bff2823feea2$export$2e2bcd8739ae039 as QueryTitle, $7264a673914aa746$export$2b9377795161999 as buildOperatorOptions, $7264a673914aa746$export$e284ae5d89467c8f as convertUTCToLocalDate, $7264a673914aa746$export$6b5e57d20078142b as cleanText, $7264a673914aa746$export$8049e8f40a9bdfb8 as buildCustomColHeaders, $11500a65bd7d9cf1$export$2e2bcd8739ae039 as HeaderContext, $43a30d745a7bbc86$export$2e2bcd8739ae039 as DataTableContext, $ee0d4d4f34048447$export$2e2bcd8739ae039 as DataTableActionsProvider, $844981eac9b63865$export$eccc29c8d0ff408 as ACAContext, $efc410f5f7ac5ef3$export$2e2bcd8739ae039 as useSearchAPI, $1d3d480a9cfaabe0$export$2e2bcd8739ae039 as useDatastore, $aa4450dcbeef3ac0$export$385a5aba38cc3325 as transformTableSortToQuerySort, $eb7821d186b1a389$export$2e2bcd8739ae039 as useAddLoginLink, $90fb213ab8eeb2e7$export$2e2bcd8739ae039 as useScrollToTop, $b4aa9c66f2e86959$export$2e2bcd8739ae039 as useMetastoreDataset, $61ff88fb3f6ee2c8$export$2e2bcd8739ae039 as withQueryProvider, $6d5c0212e738499b$export$34e95918366a058e as acaToParams, $6da0396069e23175$export$bc27cf7ecf44639d as defaultMetadataMapping};
8045
8058
  //# sourceMappingURL=main.js.map