gomtm 0.0.345 → 0.0.346
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.
|
@@ -32,9 +32,9 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
};
|
|
33
33
|
import { jsx } from "react/jsx-runtime";
|
|
34
34
|
import { toPlainMessage } from "@bufbuild/protobuf";
|
|
35
|
-
import { createContext, useContext, useRef } from "react";
|
|
35
|
+
import { Suspense, createContext, useContext, useRef } from "react";
|
|
36
36
|
import { createStore, useStore } from "zustand";
|
|
37
|
-
import {
|
|
37
|
+
import { useSuspenseQuery } from "../connectquery";
|
|
38
38
|
import { curdViewGet } from "../gomtmpb/mtm/sppb/mtm-MtmService_connectquery";
|
|
39
39
|
import { CurdView } from "../gomtmpb/mtm/sppb/mtm_pb";
|
|
40
40
|
import { CommonListViewV2 } from "./listview/CommonListViewV2";
|
|
@@ -67,9 +67,7 @@ function useCurdView(selector) {
|
|
|
67
67
|
}
|
|
68
68
|
const CurdViewView = (props) => {
|
|
69
69
|
const { name } = props;
|
|
70
|
-
const query =
|
|
71
|
-
name
|
|
72
|
-
});
|
|
70
|
+
const query = useSuspenseQuery(curdViewGet, { name });
|
|
73
71
|
if (!query.data) {
|
|
74
72
|
return null;
|
|
75
73
|
}
|
|
@@ -87,7 +85,7 @@ const CurdViewView = (props) => {
|
|
|
87
85
|
slugPath: "/post",
|
|
88
86
|
svc: curdViewData.svcName,
|
|
89
87
|
methodList: curdViewData.methodList,
|
|
90
|
-
children: /* @__PURE__ */ jsx(CommonListViewV2, {})
|
|
88
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "loading CommonListViewV2" }), children: /* @__PURE__ */ jsx(CommonListViewV2, {}) })
|
|
91
89
|
}
|
|
92
90
|
) }) });
|
|
93
91
|
}
|
|
@@ -1,10 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { Suspense } from "react";
|
|
23
|
+
import { MtmService } from "../../src/gomtmpb/mtm/sppb/mtm_connect";
|
|
24
|
+
import { PrefetchConnectInfiniteQuery, PrefetchConnectQuery } from "../components/SSR";
|
|
25
|
+
import { curdViewGet } from "../gomtmpb/mtm/sppb/mtm-MtmService_connectquery";
|
|
26
|
+
import { CurdViewGetReq } from "../gomtmpb/mtm/sppb/mtm_pb";
|
|
27
|
+
import { createMtmServiceClient } from "../mtmFetcher";
|
|
3
28
|
import { CurdViewView } from "./CurdView";
|
|
4
|
-
const CurdViewSS = (props) => {
|
|
29
|
+
const CurdViewSS = (props) => __async(void 0, null, function* () {
|
|
30
|
+
var _a, _b;
|
|
5
31
|
const { name } = props;
|
|
6
|
-
|
|
7
|
-
|
|
32
|
+
const client = createMtmServiceClient(MtmService);
|
|
33
|
+
const curdViewRes = yield client.curdViewGet(new CurdViewGetReq({
|
|
34
|
+
name
|
|
35
|
+
}));
|
|
36
|
+
if (curdViewRes.item.case == "error") {
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
38
|
+
"error ",
|
|
39
|
+
curdViewRes.item.value.message
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
const svc = ((_a = curdViewRes.item.value) == null ? void 0 : _a.svcName) || "";
|
|
43
|
+
const methodList = ((_b = curdViewRes.item.value) == null ? void 0 : _b.methodList) || "";
|
|
44
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
45
|
+
PrefetchConnectQuery,
|
|
46
|
+
{
|
|
47
|
+
svc: curdViewGet.service.typeName,
|
|
48
|
+
method: curdViewGet.name,
|
|
49
|
+
input: {
|
|
50
|
+
name
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */ jsx(
|
|
53
|
+
PrefetchConnectInfiniteQuery,
|
|
54
|
+
{
|
|
55
|
+
svc,
|
|
56
|
+
method: methodList,
|
|
57
|
+
input: {},
|
|
58
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "loading CurdViewView" }), children: /* @__PURE__ */ jsx(CurdViewView, { name }) })
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
) });
|
|
63
|
+
});
|
|
8
64
|
export {
|
|
9
65
|
CurdViewSS
|
|
10
66
|
};
|
|
@@ -6,7 +6,6 @@ import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
|
|
|
6
6
|
import { TooltipProvider } from "mtxuilib/ui/tooltip";
|
|
7
7
|
import { MtButton } from "mtxuilib/ui/ui-mt/Button";
|
|
8
8
|
import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
|
|
9
|
-
import { ThemeProvider } from "next-themes";
|
|
10
9
|
import { Suspense, lazy, useMemo, useState } from "react";
|
|
11
10
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
12
11
|
import { Toaster } from "sonner";
|
|
@@ -38,31 +37,22 @@ const LayoutBase = (props) => {
|
|
|
38
37
|
return LzFrontLayout;
|
|
39
38
|
}
|
|
40
39
|
}, [layout]);
|
|
41
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ jsx(ReactQueryDevtools, {}),
|
|
60
|
-
/* @__PURE__ */ jsx(Toaster, {}),
|
|
61
|
-
/* @__PURE__ */ jsx(TailwindIndicator, {}),
|
|
62
|
-
/* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(LayoutSwitchDlg, {}) })
|
|
63
|
-
] })
|
|
64
|
-
}
|
|
65
|
-
) });
|
|
40
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(TooltipProvider, { delayDuration: 0, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(LayoutComponent, { children }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
ProgressBar,
|
|
44
|
+
{
|
|
45
|
+
height: "4px",
|
|
46
|
+
color: "#4934eb",
|
|
47
|
+
options: { showSpinner: false },
|
|
48
|
+
shallowRouting: true
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(ReactQueryDevtools, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(Toaster, {}),
|
|
53
|
+
/* @__PURE__ */ jsx(TailwindIndicator, {}),
|
|
54
|
+
/* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(LayoutSwitchDlg, {}) })
|
|
55
|
+
] }) });
|
|
66
56
|
};
|
|
67
57
|
const LayoutSwitchDlg = () => {
|
|
68
58
|
const layout = useGomtm((x) => x.layout);
|