gomtm 0.0.252 → 0.0.253

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.
@@ -17,15 +17,17 @@ export declare const useListView: () => {
17
17
  methodCreate?: MethodUnaryDescriptor<any, any> | undefined;
18
18
  slugPath?: string | undefined;
19
19
  activateItem?: any;
20
- openEdit?: boolean | undefined;
21
- openDebug?: boolean | undefined;
20
+ params?: any;
22
21
  openRemove?: boolean | undefined;
23
22
  setOpenRemove?: Dispatch<SetStateAction<boolean>> | undefined;
24
23
  openCreate?: boolean | undefined;
25
24
  setOpenCreate?: Dispatch<SetStateAction<boolean>> | undefined;
26
25
  setActivateItem?: Dispatch<any> | undefined;
26
+ openEdit?: boolean | undefined;
27
27
  setOpenEdit?: Dispatch<SetStateAction<boolean>> | undefined;
28
+ openDebug?: boolean | undefined;
28
29
  setOpenDebug?: Dispatch<SetStateAction<boolean>> | undefined;
30
+ setParams?: Dispatch<any> | undefined;
29
31
  };
30
32
  export declare function CommonListView<I extends Message<I>, O extends Message<O>>(): import("react").JSX.Element | null;
31
33
  export declare const ListViewActions: () => import("react").JSX.Element;
@@ -37,7 +37,6 @@ var __async = (__this, __arguments, generator) => {
37
37
  };
38
38
  import { jsx, jsxs } from "react/jsx-runtime";
39
39
  import { atom } from "jotai";
40
- import { ScopeAtomsHydrator } from "mtxlib/jotai/jotai-helper";
41
40
  import { Icons } from "mtxuilib/icons/icons";
42
41
  import { cn } from "mtxuilib/lib/utils";
43
42
  import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
@@ -47,8 +46,8 @@ import { MtButton } from "mtxuilib/ui/ui-mt/Button";
47
46
  import { Suspense, createContext, useContext, useState } from "react";
48
47
  import { MtUnaryCallErrorView } from "../components/MtUnaryCallErrorView";
49
48
  import { useMutation, useSuspenseInfiniteQuery } from "../connectquery";
50
- import CurdCreatePanel, { CurdCreatePanelTriggerButton, openCurdCreatePanelAtom } from "./create/CurdCreatePanel";
51
- import { DlgCurdDebugInfo, DlgCurdDebugInfoTriggerButton, openDlgCurdDebugInfoAtom } from "./dlg/DlgCurdDebugInfo";
49
+ import CurdCreatePanel, { CurdCreatePanelTriggerButton } from "./create/CurdCreatePanel";
50
+ import { DlgCurdDebugInfo, DlgCurdDebugInfoTriggerButton } from "./dlg/DlgCurdDebugInfo";
52
51
  import CurdEditPanel, { CurdEditPanelTriggerButton } from "./edit/CurdEditPanel";
53
52
  import { ListItemView } from "./list-item/ListItem";
54
53
  import { ListLayout } from "./list-item/ListLayout";
@@ -70,6 +69,7 @@ function CommonListViewProvider(props) {
70
69
  const [activateItem, setActivateItem] = useState(void 0);
71
70
  const [openEdit, setOpenEdit] = useState(false);
72
71
  const [openDebug, setOpenDebug] = useState(false);
72
+ const [params, setParams] = useState(void 0);
73
73
  return /* @__PURE__ */ jsx(commonListViewContext.Provider, { value: {
74
74
  methodList,
75
75
  slugPath,
@@ -84,11 +84,10 @@ function CommonListViewProvider(props) {
84
84
  openEdit,
85
85
  setOpenEdit,
86
86
  openDebug,
87
- setOpenDebug
88
- }, children: /* @__PURE__ */ jsx(ScopeAtomsHydrator, { atomValues: [
89
- [openDlgCurdDebugInfoAtom, false],
90
- [openCurdCreatePanelAtom, false]
91
- ], children }) });
87
+ setOpenDebug,
88
+ params,
89
+ setParams
90
+ }, children });
92
91
  }
93
92
  const useListView = () => {
94
93
  const ctx = useContext(commonListViewContext);
@@ -1,6 +1,3 @@
1
1
  /// <reference types="react" />
2
- export declare const openCurdCreatePanelAtom: import("jotai").PrimitiveAtom<boolean> & {
3
- init: boolean;
4
- };
5
2
  export default function CurdCreatePanel(): import("react").JSX.Element;
6
3
  export declare const CurdCreatePanelTriggerButton: () => import("react").JSX.Element;
@@ -1,23 +1,21 @@
1
1
  "use client";
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
- import { atom, useAtom } from "jotai";
4
3
  import { useMtRouter } from "mtxuilib/hooks/use-router";
5
4
  import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
6
5
  import { MtButton } from "mtxuilib/ui/ui-mt/Button";
7
- const openCurdCreatePanelAtom = atom(false);
6
+ import { useListView } from "../CommonListViewV2";
8
7
  function CurdCreatePanel() {
9
8
  const router = useMtRouter();
10
- const [openCurdCreatePanel, setOpenCurdCreatePanel] = useAtom(openCurdCreatePanelAtom);
11
- return /* @__PURE__ */ jsx(Dialog, { open: openCurdCreatePanel, onOpenChange: setOpenCurdCreatePanel, children: /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogTitle, { children: " Create " }) }) });
9
+ const listView = useListView();
10
+ return /* @__PURE__ */ jsx(Dialog, { open: listView.openCreate, onOpenChange: listView.setOpenCreate, children: /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogTitle, { children: " Create " }) }) });
12
11
  }
13
12
  const CurdCreatePanelTriggerButton = () => {
14
- const [openCurdCreatePanel, setOpenCurdCreatePanel] = useAtom(openCurdCreatePanelAtom);
13
+ const listView = useListView();
15
14
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(MtButton, { onClick: () => {
16
- setOpenCurdCreatePanel(true);
15
+ listView.setOpenCreate(true);
17
16
  }, children: "OpenCreatePanel" }) });
18
17
  };
19
18
  export {
20
19
  CurdCreatePanelTriggerButton,
21
- CurdCreatePanel as default,
22
- openCurdCreatePanelAtom
20
+ CurdCreatePanel as default
23
21
  };