gomtm 0.0.290 → 0.0.291

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.
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Message } from "@bufbuild/protobuf";
3
2
  export declare const LzListViewLayoutDemo: import("react").LazyExoticComponent<typeof import("./listview-layouts/listviewlayout-demo").default>;
4
3
  export declare const LzListViewLayoutDefault: import("react").LazyExoticComponent<typeof import("./listview-layouts/default").default>;
5
- export declare function CommonListView<I extends Message<I>, O extends Message<O>>(): import("react").JSX.Element | null;
4
+ export declare function CommonListView(): import("react").JSX.Element | null;
6
5
  export declare const ListViewActions: () => import("react").JSX.Element;
@@ -46,7 +46,6 @@ function CommonListView() {
46
46
  const svc = useListview((x) => x.svc);
47
47
  const methodList = useListview((x) => x.methodList);
48
48
  const paramList = useListview((x) => x.paramsList);
49
- const backendUrl = useListview((x) => x.backendUrl);
50
49
  const listQuery = useGomtmSuspenseInfiniteQuery(svc, methodList, paramList);
51
50
  if (!(listQuery == null ? void 0 : listQuery.data)) {
52
51
  return null;
@@ -70,7 +69,7 @@ function CommonListView() {
70
69
  })
71
70
  }
72
71
  ),
73
- /* @__PURE__ */ jsx(Pagination, { children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
72
+ listQuery.data.pages && !!listQuery.data.pages.length && /* @__PURE__ */ jsx(Pagination, { children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
74
73
  /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationPrevious, { href: "#" }) }),
75
74
  /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationLink, { href: "#", children: "1" }) }),
76
75
  /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationLink, { href: "#", isActive: true, children: "2" }) }),
@@ -36,27 +36,24 @@ const PageSearchCmd = () => {
36
36
  const setSearchParams = useGomtm((x) => x.setGlobalSearchParams);
37
37
  const form = useForm();
38
38
  return /* @__PURE__ */ jsxs(MtForm, __spreadProps(__spreadValues({}, form), { children: [
39
- /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(() => {
40
- }), children: [
41
- /* @__PURE__ */ jsx("pre", { children: JSON.stringify(globalSearchParams, null, 2) }),
42
- /* @__PURE__ */ jsxs("div", { className: "relative ml-auto flex-1 md:grow-0", children: [
43
- /* @__PURE__ */ jsx(Search, { className: "text-muted-foreground absolute left-2.5 top-2.5 h-4 w-4" }),
44
- /* @__PURE__ */ jsx(
45
- Input,
46
- {
47
- type: "search",
48
- placeholder: "Search...",
49
- className: "bg-background w-full rounded-lg pl-8 md:w-[200px] lg:w-[336px]",
50
- defaultValue: globalSearchParams == null ? void 0 : globalSearchParams.q,
51
- onChange: (e) => {
52
- setSearchParams({
53
- q: e.target.value
54
- });
55
- }
39
+ /* @__PURE__ */ jsx("form", { onSubmit: form.handleSubmit(() => {
40
+ }), children: /* @__PURE__ */ jsxs("div", { className: "relative ml-auto flex-1 md:grow-0", children: [
41
+ /* @__PURE__ */ jsx(Search, { className: "text-muted-foreground absolute left-2.5 top-2.5 h-4 w-4" }),
42
+ /* @__PURE__ */ jsx(
43
+ Input,
44
+ {
45
+ type: "search",
46
+ placeholder: "Search...",
47
+ className: "bg-background w-full rounded-lg pl-8 md:w-[200px] lg:w-[336px]",
48
+ defaultValue: globalSearchParams == null ? void 0 : globalSearchParams.q,
49
+ onChange: (e) => {
50
+ setSearchParams({
51
+ q: e.target.value
52
+ });
56
53
  }
57
- )
58
- ] })
59
- ] }),
54
+ }
55
+ )
56
+ ] }) }),
60
57
  /* @__PURE__ */ jsxs(CommandDialog, { open, onOpenChange: setOpen, children: [
61
58
  /* @__PURE__ */ jsx(CommandInput, { placeholder: "Type a command or search...", onValueChange: (s) => {
62
59
  setOpen(false);
@@ -52,7 +52,10 @@ const createGomtmAppStore = (initProps) => {
52
52
  setLoading: (loading) => set({ loading }),
53
53
  setDebug: (debug) => set((state) => __spreadProps(__spreadValues({}, state), { configState: __spreadProps(__spreadValues({}, state.configState), { debug }) })),
54
54
  setLayout: (layout) => set((state) => __spreadProps(__spreadValues({}, state), { configState: __spreadProps(__spreadValues({}, state.configState), { layout }) })),
55
- setGlobalSearchParams: (globalSearchParams) => set({ globalSearchParams }),
55
+ setGlobalSearchParams: (globalSearchParams) => {
56
+ console.log("setGlobalSearchParams", globalSearchParams);
57
+ return set({ globalSearchParams });
58
+ },
56
59
  openDebug: false,
57
60
  setOpenDebug: (openDebug) => set({ openDebug })
58
61
  }));