gomtm 0.0.271 → 0.0.272

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.
@@ -39,13 +39,14 @@ var __async = (__this, __arguments, generator) => {
39
39
  });
40
40
  };
41
41
  import { jsx, jsxs } from "react/jsx-runtime";
42
+ import { debounce } from "lodash";
42
43
  import { Icons } from "mtxuilib/icons/icons";
43
44
  import { cn } from "mtxuilib/lib/utils";
44
45
  import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
45
46
  import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "mtxuilib/ui/dropdown-menu";
46
47
  import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "mtxuilib/ui/pagination";
47
48
  import { MtButton } from "mtxuilib/ui/ui-mt/Button";
48
- import { Suspense, createContext, useContext, useMemo, useState } from "react";
49
+ import { Suspense, createContext, useCallback, useContext, useMemo, useState } from "react";
49
50
  import { MtUnaryCallErrorView } from "../components/MtUnaryCallErrorView";
50
51
  import { useMutation, useSuspenseInfiniteQuery } from "../connectquery";
51
52
  import { useMtmApp } from "../providers/GomtmProvider";
@@ -63,13 +64,16 @@ function ListViewProvider(props) {
63
64
  const [activateItem, setActivateItem] = useState(void 0);
64
65
  const [openEdit, setOpenEdit] = useState(false);
65
66
  const [openDebug, setOpenDebug] = useState(false);
66
- const [_params, setParams] = useState(mtapp.globalSearchParams);
67
+ const [_params, _setParams] = useState(mtapp.globalSearchParams);
67
68
  const params = useMemo(() => {
68
69
  var _a;
69
70
  return {
70
71
  q: (_a = mtapp.globalSearchParams) == null ? void 0 : _a.q
71
72
  };
72
73
  }, [mtapp.globalSearchParams]);
74
+ const setParams = useCallback(debounce((values) => {
75
+ _setParams(values);
76
+ }, 300), [_setParams]);
73
77
  return /* @__PURE__ */ jsx(commonListViewContext.Provider, { value: {
74
78
  methodList,
75
79
  slugPath,
@@ -111,7 +111,7 @@ const gomtmFetcher = (initGlobal) => {
111
111
  }, (initGlobal == null ? void 0 : initGlobal.cookieStr) && { "Cookie": initGlobal == null ? void 0 : initGlobal.cookieStr })
112
112
  });
113
113
  let fetcher = fetch;
114
- req.enableCache = false;
114
+ req.enableCache = true;
115
115
  if (req.enableCache) {
116
116
  fetcher = fetchMiddleWithCache(fetch);
117
117
  }