@civicactions/cmsds-open-data-components 4.1.7 → 4.1.8-alpha.1

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 {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, Dialog as $hgUW1$Dialog, TextField as $hgUW1$TextField, Spinner as $hgUW1$Spinner, Dropdown as $hgUW1$Dropdown, Alert as $hgUW1$Alert, Pagination as $hgUW1$Pagination, Tooltip as $hgUW1$Tooltip, TooltipIcon as $hgUW1$TooltipIcon, Choice as $hgUW1$Choice, 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, ExternalLinkIcon as $hgUW1$ExternalLinkIcon, Badge as $hgUW1$Badge} from "@cmsgov/design-system";
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, useNavigate as $hgUW1$useNavigate, useSearchParams as $hgUW1$useSearchParams, useLocation as $hgUW1$useLocation, Link as $hgUW1$Link} from "react-router-dom";
4
+ import $hgUW1$react, {createContext as $hgUW1$createContext, useState as $hgUW1$useState, useEffect as $hgUW1$useEffect, useRef as $hgUW1$useRef, useContext as $hgUW1$useContext, useMemo as $hgUW1$useMemo, useCallback as $hgUW1$useCallback} from "react";
5
+ import {NavLink as $hgUW1$NavLink, useLocation as $hgUW1$useLocation, useNavigate as $hgUW1$useNavigate, useSearchParams as $hgUW1$useSearchParams, Link as $hgUW1$Link} 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";
@@ -270,6 +270,7 @@ var $11500a65bd7d9cf1$export$2e2bcd8739ae039 = $11500a65bd7d9cf1$var$HeaderConte
270
270
 
271
271
 
272
272
 
273
+
273
274
  const $6d0cf21faac6a2dd$var$SubMenuStaticList = ({ submenuArray: submenuArray, subLinkClasses: subLinkClasses, setIsExpanded: setIsExpanded })=>{
274
275
  // Render a static list of submenu items as listed in the assets/menu.jsx file.
275
276
  let submenuItems = submenuArray.map((s)=>{
@@ -286,7 +287,7 @@ const $6d0cf21faac6a2dd$var$SubMenuStaticList = ({ submenuArray: submenuArray, s
286
287
  }) : /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $hgUW1$NavLink), {
287
288
  to: s.url,
288
289
  className: `ds-u-display-flex ds-u-align-items--center ${subLinkClasses}`,
289
- onClick: ()=>setIsExpanded((prev)=>!prev),
290
+ onClick: ()=>setIsExpanded(false),
290
291
  children: [
291
292
  s.icon ?? null,
292
293
  /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
@@ -307,6 +308,12 @@ var $6d0cf21faac6a2dd$export$2e2bcd8739ae039 = $6d0cf21faac6a2dd$var$SubMenuStat
307
308
  const $669b51f08325b4e3$var$SubMenu = ({ link: link, linkClasses: linkClasses, subLinkClasses: subLinkClasses, wrapLabel: wrapLabel = true })=>{
308
309
  const [isExpanded, setIsExpanded] = (0, $hgUW1$useState)(false);
309
310
  const headerContext = (0, $hgUW1$react).useContext((0, $11500a65bd7d9cf1$export$2e2bcd8739ae039));
311
+ const location = (0, $hgUW1$useLocation)();
312
+ (0, $hgUW1$useEffect)(()=>{
313
+ setIsExpanded(false);
314
+ }, [
315
+ location
316
+ ]);
310
317
  const innerHtml = wrapLabel ? /*#__PURE__*/ (0, $hgUW1$jsx)("span", {
311
318
  children: link.label
312
319
  }) : link.label;
@@ -1699,8 +1706,10 @@ const $fea9297ba4dd394c$var$HeaderSearch = (props)=>{
1699
1706
  if (window) {
1700
1707
  if ((0, $e873081a6e8f024e$export$1040147c129fdde9)(modalSearchTerm)) {
1701
1708
  setInvalidSearch(false);
1702
- if (window.location.pathname !== '/datasets') navigate(`/datasets?fulltext=${modalSearchTerm}`);
1703
- else {
1709
+ if (window.location.pathname !== '/datasets') {
1710
+ navigate(`/datasets?fulltext=${modalSearchTerm}`);
1711
+ setModalSearch(false);
1712
+ } else {
1704
1713
  window.location.search = `fulltext=${modalSearchTerm}`;
1705
1714
  setModalSearch(false);
1706
1715
  }