gomtm 0.0.316 → 0.0.318
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/esm/curd/list-item/PostCardListItem.js +0 -1
- package/dist/esm/curd/listview/ListViewProvider.js +7 -62
- package/dist/esm/curd/listview/ListViewRender.js +67 -2
- package/dist/esm/curd/listview/MtListView.js +10 -20
- package/dist/esm/ly/dash5/header.js +2 -1
- package/dist/esm/ly/front-layout/header.js +0 -1
- package/dist/esm/ly/front-layout/index.js +0 -1
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -80,7 +80,6 @@ const PostCardItemActions = (props) => {
|
|
|
80
80
|
children: "create"
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${slugPath}/create`, children: "create" }),
|
|
84
83
|
/* @__PURE__ */ jsx(DropdownMenuItemLink, { href: `${slugPath}/edit/${id}`, children: "edit" }),
|
|
85
84
|
/* @__PURE__ */ jsx(
|
|
86
85
|
DropdownMenuItem,
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var __async = (__this, __arguments, generator) => {
|
|
3
|
-
return new Promise((resolve, reject) => {
|
|
4
|
-
var fulfilled = (value) => {
|
|
5
|
-
try {
|
|
6
|
-
step(generator.next(value));
|
|
7
|
-
} catch (e) {
|
|
8
|
-
reject(e);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
var rejected = (value) => {
|
|
12
|
-
try {
|
|
13
|
-
step(generator.throw(value));
|
|
14
|
-
} catch (e) {
|
|
15
|
-
reject(e);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
3
|
import { Icons } from "mtxuilib/icons/icons";
|
|
24
4
|
import { cn } from "mtxuilib/lib/utils";
|
|
@@ -30,9 +10,9 @@ import { Suspense, lazy, useMemo, useState } from "react";
|
|
|
30
10
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
31
11
|
import { MtmErrorView } from "../../components/MtmErrorView";
|
|
32
12
|
import { HOTKEY_Listview_Switchlayout } from "../../consts";
|
|
33
|
-
import {
|
|
34
|
-
import
|
|
35
|
-
import
|
|
13
|
+
import { useGomtmSuspenseInfiniteQuery } from "../../gomtmQuery";
|
|
14
|
+
import { CurdCreatePanelTriggerButton } from "../create/CurdCreatePanel";
|
|
15
|
+
import { CurdEditPanelTriggerButton } from "../edit/CurdEditPanel";
|
|
36
16
|
import { ListItemView } from "../list-item/ListItem";
|
|
37
17
|
import { ListLayout } from "../list-item/ListLayout";
|
|
38
18
|
import { useListview } from "./list-store";
|
|
@@ -80,51 +60,16 @@ function CommonListView() {
|
|
|
80
60
|
/* @__PURE__ */ jsx("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ jsx(ListViewActions, {}) })
|
|
81
61
|
] });
|
|
82
62
|
}
|
|
83
|
-
const PanelRemove = () => {
|
|
84
|
-
const svc = useListview((x) => x.svc);
|
|
85
|
-
const openRemove = useListview((x) => x.openRemove);
|
|
86
|
-
const setOpenRemove = useListview((x) => x.setOpenRemove);
|
|
87
|
-
const methodDelete = useListview((x) => x.methodDelete);
|
|
88
|
-
const mutation = useGomtmMutation(svc, methodDelete);
|
|
89
|
-
const activateItem = useListview((x) => x.activateItem);
|
|
90
|
-
return /* @__PURE__ */ jsx(Dialog, { open: openRemove, onOpenChange: setOpenRemove, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
91
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: "remove item" }),
|
|
92
|
-
/* @__PURE__ */ jsx(MtButton, { onClick: () => __async(void 0, null, function* () {
|
|
93
|
-
yield mutation.mutateAsync({
|
|
94
|
-
id: activateItem == null ? void 0 : activateItem.id
|
|
95
|
-
});
|
|
96
|
-
setOpenRemove(false);
|
|
97
|
-
}), children: "ok" })
|
|
98
|
-
] }) });
|
|
99
|
-
};
|
|
100
|
-
const PanelCreate = () => {
|
|
101
|
-
const svc = useListview((x) => x.svc);
|
|
102
|
-
const openCreate = useListview((x) => x.openCreate);
|
|
103
|
-
const setOpenCreate = useListview((x) => x.setOpenCreate);
|
|
104
|
-
const methodDelete = useListview((x) => x.methodDelete);
|
|
105
|
-
return /* @__PURE__ */ jsx(Dialog, { open: openCreate, onOpenChange: setOpenCreate, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
106
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: "TODO create item Dlg" }),
|
|
107
|
-
/* @__PURE__ */ jsx(MtButton, { onClick: () => __async(void 0, null, function* () {
|
|
108
|
-
setOpenCreate(false);
|
|
109
|
-
}), children: "ok" })
|
|
110
|
-
] }) });
|
|
111
|
-
};
|
|
112
63
|
const ListViewActions = () => {
|
|
113
64
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
114
65
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(MtButton, { variant: "ghost", className: "m-0 flex h-10 w-10 items-center justify-center border p-0 shadow-sm backdrop-blur", children: /* @__PURE__ */ jsx(Icons.ellipsis, {}) }) }),
|
|
115
66
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { className: "w-56", children: [
|
|
116
67
|
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Edit" }),
|
|
117
68
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
118
|
-
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
/* @__PURE__ */ jsx(
|
|
121
|
-
|
|
122
|
-
/* @__PURE__ */ jsx(CurdEditPanel, {}),
|
|
123
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-yellow-100 p-2", children: [
|
|
124
|
-
/* @__PURE__ */ jsx(CurdEditPanelTriggerButton, {}),
|
|
125
|
-
/* @__PURE__ */ jsx(CurdCreatePanelTriggerButton, {})
|
|
126
|
-
] })
|
|
127
|
-
] }) }) }),
|
|
69
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsxs("div", { className: "bg-yellow-100 p-2", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(CurdEditPanelTriggerButton, {}),
|
|
71
|
+
/* @__PURE__ */ jsx(CurdCreatePanelTriggerButton, {})
|
|
72
|
+
] }) }) }) }),
|
|
128
73
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
129
74
|
] })
|
|
130
75
|
] });
|
|
@@ -1,9 +1,74 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
var __async = (__this, __arguments, generator) => {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
var fulfilled = (value) => {
|
|
5
|
+
try {
|
|
6
|
+
step(generator.next(value));
|
|
7
|
+
} catch (e) {
|
|
8
|
+
reject(e);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var rejected = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
step(generator.throw(value));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
reject(e);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
19
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
23
|
import { CommonListView } from "./ListViewProvider";
|
|
24
|
+
import { Dialog, DialogContent, DialogTitle } from "mtxuilib/ui/dialog";
|
|
25
|
+
import { MtButton } from "mtxuilib/ui/ui-mt/Button";
|
|
26
|
+
import { Suspense } from "react";
|
|
27
|
+
import { useGomtmMutation } from "../../gomtmQuery";
|
|
28
|
+
import { useListview } from "./list-store";
|
|
29
|
+
import CurdCreatePanel from "../create/CurdCreatePanel";
|
|
30
|
+
import CurdEditPanel from "../edit/CurdEditPanel";
|
|
4
31
|
const ListViewRender = (props) => {
|
|
5
32
|
const { children } = props;
|
|
6
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(CommonListView, {}),
|
|
35
|
+
/* @__PURE__ */ jsxs(Suspense, { children: [
|
|
36
|
+
"\u5F39\u6846\u7F16\u8F91",
|
|
37
|
+
/* @__PURE__ */ jsx(PanelCreate, {}),
|
|
38
|
+
/* @__PURE__ */ jsx(PanelRemove, {}),
|
|
39
|
+
/* @__PURE__ */ jsx(CurdCreatePanel, {}),
|
|
40
|
+
/* @__PURE__ */ jsx(CurdEditPanel, {})
|
|
41
|
+
] })
|
|
42
|
+
] });
|
|
43
|
+
};
|
|
44
|
+
const PanelRemove = () => {
|
|
45
|
+
const svc = useListview((x) => x.svc);
|
|
46
|
+
const openRemove = useListview((x) => x.openRemove);
|
|
47
|
+
const setOpenRemove = useListview((x) => x.setOpenRemove);
|
|
48
|
+
const methodDelete = useListview((x) => x.methodDelete);
|
|
49
|
+
const mutation = useGomtmMutation(svc, methodDelete);
|
|
50
|
+
const activateItem = useListview((x) => x.activateItem);
|
|
51
|
+
return /* @__PURE__ */ jsx(Dialog, { open: openRemove, onOpenChange: setOpenRemove, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "remove item" }),
|
|
53
|
+
/* @__PURE__ */ jsx(MtButton, { onClick: () => __async(void 0, null, function* () {
|
|
54
|
+
yield mutation.mutateAsync({
|
|
55
|
+
id: activateItem == null ? void 0 : activateItem.id
|
|
56
|
+
});
|
|
57
|
+
setOpenRemove(false);
|
|
58
|
+
}), children: "ok" })
|
|
59
|
+
] }) });
|
|
60
|
+
};
|
|
61
|
+
const PanelCreate = () => {
|
|
62
|
+
const svc = useListview((x) => x.svc);
|
|
63
|
+
const openCreate = useListview((x) => x.openCreate);
|
|
64
|
+
const setOpenCreate = useListview((x) => x.setOpenCreate);
|
|
65
|
+
const methodDelete = useListview((x) => x.methodDelete);
|
|
66
|
+
return /* @__PURE__ */ jsx(Dialog, { open: openCreate, onOpenChange: setOpenCreate, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
67
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "TODO create item Dlg" }),
|
|
68
|
+
/* @__PURE__ */ jsx(MtButton, { onClick: () => __async(void 0, null, function* () {
|
|
69
|
+
setOpenCreate(false);
|
|
70
|
+
}), children: "ok" })
|
|
71
|
+
] }) });
|
|
7
72
|
};
|
|
8
73
|
export {
|
|
9
74
|
ListViewRender
|
|
@@ -31,29 +31,19 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
};
|
|
32
32
|
import { jsx } from "react/jsx-runtime";
|
|
33
33
|
import { PrefetchConnectInfiniteQuery } from "../../components/SSR";
|
|
34
|
-
import { siteList } from "../../gomtmpb/mtm/sppb/mtm-MtmService_connectquery";
|
|
35
|
-
import { ListViewStoreProvider } from "./list-store";
|
|
36
34
|
import { ListViewRender } from "./ListViewRender";
|
|
35
|
+
import { ListViewStoreProvider } from "./list-store";
|
|
37
36
|
function MtListView(props) {
|
|
38
37
|
const _a = props, { children } = _a, etc = __objRest(_a, ["children"]);
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
svc:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
svc: siteList.service.typeName,
|
|
50
|
-
method: siteList.name,
|
|
51
|
-
input: etc.paramsList,
|
|
52
|
-
children: /* @__PURE__ */ jsx(ListViewRender, { children })
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
})
|
|
56
|
-
);
|
|
38
|
+
return /* @__PURE__ */ jsx(ListViewStoreProvider, __spreadProps(__spreadValues({}, etc), { children: /* @__PURE__ */ jsx(
|
|
39
|
+
PrefetchConnectInfiniteQuery,
|
|
40
|
+
{
|
|
41
|
+
svc: etc.svc,
|
|
42
|
+
method: etc.methodList,
|
|
43
|
+
input: etc.paramsList,
|
|
44
|
+
children: /* @__PURE__ */ jsx(ListViewRender, { children })
|
|
45
|
+
}
|
|
46
|
+
) }));
|
|
57
47
|
}
|
|
58
48
|
export {
|
|
59
49
|
MtListView as default
|
|
@@ -16,6 +16,7 @@ import { Button } from "mtxuilib/ui/button";
|
|
|
16
16
|
import { Input } from "mtxuilib/ui/input";
|
|
17
17
|
import { Sheet, SheetContent, SheetTrigger } from "mtxuilib/ui/sheet";
|
|
18
18
|
import Link from "next/link";
|
|
19
|
+
import { Suspense } from "react";
|
|
19
20
|
import UserAvatorMenus from "../UserAvatorMenus";
|
|
20
21
|
const Header = () => {
|
|
21
22
|
return /* @__PURE__ */ jsxs("header", { className: cn(
|
|
@@ -115,7 +116,7 @@ const Header = () => {
|
|
|
115
116
|
}
|
|
116
117
|
)
|
|
117
118
|
] }),
|
|
118
|
-
/* @__PURE__ */ jsx(UserAvatorMenus, {})
|
|
119
|
+
/* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(UserAvatorMenus, {}) })
|
|
119
120
|
] });
|
|
120
121
|
};
|
|
121
122
|
export {
|