@akanjs/ui 0.9.55 → 0.9.57
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/Data/CardList.d.ts +3 -3
- package/Data/TableList.d.ts +4 -4
- package/Field.d.ts +11 -12
- package/Model/Remove.d.ts +3 -1
- package/Select.d.ts +2 -2
- package/Signal/Arg.d.ts +14 -11
- package/Signal/Doc.d.ts +8 -1
- package/Signal/GraphQL.d.ts +13 -16
- package/Signal/Message.d.ts +12 -15
- package/Signal/PubSub.d.ts +13 -15
- package/Signal/Response.d.ts +3 -5
- package/Signal/RestApi.d.ts +17 -20
- package/Signal/WebSocket.d.ts +1 -1
- package/System/CSR.d.ts +2 -2
- package/System/Common.d.ts +2 -25
- package/System/SSR.d.ts +2 -2
- package/Table.d.ts +2 -2
- package/cjs/Data/Insight.js +1 -1
- package/cjs/Data/Item.js +1 -1
- package/cjs/Data/ListContainer.js +5 -5
- package/cjs/Data/TableList.js +2 -5
- package/cjs/Field.js +11 -9
- package/cjs/Model/EditModal.js +1 -1
- package/cjs/Model/Remove.js +6 -11
- package/cjs/Model/ViewEditModal.js +14 -1
- package/cjs/Select.js +1 -1
- package/cjs/Signal/Arg.js +22 -22
- package/cjs/Signal/Doc.js +18 -27
- package/cjs/Signal/GraphQL.js +37 -52
- package/cjs/Signal/Message.js +25 -53
- package/cjs/Signal/Object.js +4 -12
- package/cjs/Signal/PubSub.js +20 -54
- package/cjs/Signal/Response.js +2 -2
- package/cjs/Signal/RestApi.js +63 -79
- package/cjs/Signal/WebSocket.js +14 -15
- package/cjs/System/CSR.js +5 -10
- package/cjs/System/Common.js +6 -6
- package/cjs/System/SSR.js +5 -10
- package/esm/Data/Insight.js +1 -1
- package/esm/Data/Item.js +1 -1
- package/esm/Data/ListContainer.js +5 -5
- package/esm/Data/TableList.js +2 -5
- package/esm/Field.js +12 -10
- package/esm/Model/EditModal.js +1 -1
- package/esm/Model/Remove.js +7 -12
- package/esm/Model/ViewEditModal.js +15 -2
- package/esm/Select.js +2 -2
- package/esm/Signal/Arg.js +24 -24
- package/esm/Signal/Doc.js +17 -26
- package/esm/Signal/GraphQL.js +39 -62
- package/esm/Signal/Message.js +27 -55
- package/esm/Signal/Object.js +4 -12
- package/esm/Signal/PubSub.js +22 -56
- package/esm/Signal/Response.js +2 -2
- package/esm/Signal/RestApi.js +66 -90
- package/esm/Signal/WebSocket.js +14 -15
- package/esm/System/CSR.js +5 -10
- package/esm/System/Common.js +6 -6
- package/esm/System/SSR.js +5 -10
- package/package.json +1 -1
package/cjs/Signal/RestApi.js
CHANGED
|
@@ -43,55 +43,67 @@ var import_Copy = require("../Copy");
|
|
|
43
43
|
var import__ = require(".");
|
|
44
44
|
var import_Arg = __toESM(require("./Arg"));
|
|
45
45
|
var import_Response = __toESM(require("./Response"));
|
|
46
|
+
const getControllerPath = (gqlKey, gqlMeta) => {
|
|
47
|
+
return gqlMeta.signalOption?.path ?? [
|
|
48
|
+
gqlMeta.signalOption?.name ?? gqlKey,
|
|
49
|
+
...gqlMeta.args.filter((argMeta) => argMeta.type === "Param").map((argMeta) => `:${argMeta.name}`)
|
|
50
|
+
].join("/");
|
|
51
|
+
};
|
|
46
52
|
function RestApi() {
|
|
47
53
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {});
|
|
48
54
|
}
|
|
49
|
-
const RestApiEndpoints = ({ refName, endpoints, openAll, httpUri }) => {
|
|
50
|
-
const
|
|
51
|
-
|
|
55
|
+
const RestApiEndpoints = ({ refName, prefix, endpoints, openAll, httpUri }) => {
|
|
56
|
+
const signals = global.signals;
|
|
57
|
+
const signal = signals.find((signal2) => signal2.refName === refName);
|
|
58
|
+
if (!signal)
|
|
52
59
|
return null;
|
|
53
60
|
const tryRoles = import_store.st.use.tryRoles();
|
|
54
|
-
const gqlInfos =
|
|
55
|
-
|
|
56
|
-
[]
|
|
57
|
-
).filter(({ key }) => !endpoints || endpoints.includes(key)).sort((a, b) => a.key > b.key ? 1 : -1).filter(({ gqlMeta }) => gqlMeta.signalOption.onlyFor !== "graphql").filter(({ gqlMeta }) => {
|
|
58
|
-
if (gqlMeta.type === "Pubsub" || gqlMeta.type === "Message")
|
|
61
|
+
const gqlInfos = Object.entries(signal.endpoint).filter(([key, gqlMeta]) => !endpoints || endpoints.includes(key)).sort(([keyA], [keyB]) => keyA > keyB ? 1 : -1).filter(([key, gqlMeta]) => gqlMeta.signalOption?.onlyFor !== "graphql").filter(([key, gqlMeta]) => {
|
|
62
|
+
if (gqlMeta.type === "pubsub" || gqlMeta.type === "message")
|
|
59
63
|
return false;
|
|
60
|
-
if (gqlMeta.guards
|
|
64
|
+
if (gqlMeta.signalOption?.guards?.includes("Public") && tryRoles.includes("Public"))
|
|
61
65
|
return true;
|
|
62
|
-
if ((gqlMeta.guards
|
|
66
|
+
if ((gqlMeta.signalOption?.guards?.includes("User") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("User"))
|
|
63
67
|
return true;
|
|
64
|
-
if ((gqlMeta.guards
|
|
68
|
+
if ((gqlMeta.signalOption?.guards?.includes("Admin") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("Admin"))
|
|
65
69
|
return true;
|
|
66
|
-
if (gqlMeta.guards
|
|
70
|
+
if ((gqlMeta.signalOption?.guards?.includes("SuperAdmin") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("SuperAdmin"))
|
|
67
71
|
return true;
|
|
68
72
|
return false;
|
|
69
73
|
});
|
|
70
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: gqlInfos.map((
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: gqlInfos.map(([gqlKey, gqlMeta], idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
RestApiEndpoint,
|
|
76
|
+
{
|
|
77
|
+
prefix,
|
|
78
|
+
refName,
|
|
79
|
+
gqlKey,
|
|
80
|
+
gqlMeta,
|
|
81
|
+
open: openAll,
|
|
82
|
+
httpUri
|
|
83
|
+
},
|
|
84
|
+
idx
|
|
85
|
+
)) });
|
|
71
86
|
};
|
|
72
87
|
RestApi.Endpoints = RestApiEndpoints;
|
|
73
|
-
const RestApiEndpoint = ({
|
|
88
|
+
const RestApiEndpoint = ({ refName, prefix, gqlKey, gqlMeta, open, httpUri }) => {
|
|
74
89
|
const { l } = (0, import_client.usePage)();
|
|
75
|
-
const sigMeta = (0, import_signal.getSigMeta)(sigRef);
|
|
76
90
|
const [viewStatus, setViewStatus] = (0, import_react.useState)("doc");
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
const prefix = (0, import_signal.getControllerPrefix)(sigMeta);
|
|
83
|
-
const path = (0, import_signal.getControllerPath)(gqlMeta, paramArgMetas);
|
|
91
|
+
const queryArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Query");
|
|
92
|
+
const paramArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Param");
|
|
93
|
+
const bodyArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Body");
|
|
94
|
+
const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
|
|
95
|
+
const path = getControllerPath(gqlKey, gqlMeta);
|
|
84
96
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "collapse-arrow bg-base-300 collapse my-1", children: [
|
|
85
97
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", checked: open }),
|
|
86
98
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "collapse-title", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
87
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `btn btn-xs w-16 ${gqlMeta.type === "
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `btn btn-xs w-16 ${gqlMeta.type === "query" ? "btn-success" : "btn-accent"}`, children: gqlMeta.type === "query" ? "GET" : "POST" }),
|
|
88
100
|
prefix ? `/${prefix}` : "",
|
|
89
101
|
"/",
|
|
90
102
|
path,
|
|
91
103
|
" ",
|
|
92
104
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-lg", children: [
|
|
93
105
|
"(",
|
|
94
|
-
l.
|
|
106
|
+
l._(`${refName}.signal.${gqlKey}`),
|
|
95
107
|
")"
|
|
96
108
|
] })
|
|
97
109
|
] }) }),
|
|
@@ -99,9 +111,9 @@ const RestApiEndpoint = ({ sigRef, gqlMeta, open, httpUri }) => {
|
|
|
99
111
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 text-lg", children: [
|
|
100
112
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Description" }),
|
|
101
113
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("hr", { className: "my-2 border-[0.1px] border-gray-400" }),
|
|
102
|
-
gqlMeta.guards
|
|
114
|
+
gqlMeta.signalOption?.guards?.some((guard) => guard !== "None") ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 pb-3 pl-3 text-base font-normal", children: [
|
|
103
115
|
"- Guards:",
|
|
104
|
-
gqlMeta.guards.map((guard) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
gqlMeta.signalOption.guards.map((guard) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
117
|
"span",
|
|
106
118
|
{
|
|
107
119
|
className: `badge ${guard === "Public" ? "badge-success" : guard === "SuperAdmin" ? "badge-error" : guard === "Admin" ? "badge-error" : guard === "User" ? "badge-accent" : guard === "Owner" ? "badge-accent" : guard === "Every" ? "badge-warning" : ""}`,
|
|
@@ -112,7 +124,7 @@ const RestApiEndpoint = ({ sigRef, gqlMeta, open, httpUri }) => {
|
|
|
112
124
|
] }) : null,
|
|
113
125
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pb-3 pl-3 text-base font-normal", children: [
|
|
114
126
|
"- ",
|
|
115
|
-
l.
|
|
127
|
+
l._(`${refName}.signal.${gqlKey}.desc`)
|
|
116
128
|
] })
|
|
117
129
|
] }),
|
|
118
130
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "my-4 flex w-full gap-5 px-5", children: [
|
|
@@ -143,87 +155,57 @@ const RestApiEndpoint = ({ sigRef, gqlMeta, open, httpUri }) => {
|
|
|
143
155
|
}
|
|
144
156
|
)
|
|
145
157
|
] }),
|
|
146
|
-
viewStatus === "doc" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
147
|
-
RestApiInterface,
|
|
148
|
-
{
|
|
149
|
-
sigRef,
|
|
150
|
-
gqlMeta,
|
|
151
|
-
queryArgMetas,
|
|
152
|
-
paramArgMetas,
|
|
153
|
-
bodyArgMetas,
|
|
154
|
-
uploadArgMetas
|
|
155
|
-
}
|
|
156
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
-
RestApiTry,
|
|
158
|
-
{
|
|
159
|
-
sigRef,
|
|
160
|
-
gqlMeta,
|
|
161
|
-
queryArgMetas,
|
|
162
|
-
paramArgMetas,
|
|
163
|
-
bodyArgMetas,
|
|
164
|
-
uploadArgMetas,
|
|
165
|
-
httpUri
|
|
166
|
-
}
|
|
167
|
-
)
|
|
158
|
+
viewStatus === "doc" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RestApiInterface, { refName, gqlKey, gqlMeta }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RestApiTry, { refName, gqlKey, gqlMeta, httpUri })
|
|
168
159
|
] })
|
|
169
160
|
] });
|
|
170
161
|
};
|
|
171
162
|
RestApi.Endpoint = RestApiEndpoint;
|
|
172
|
-
const RestApiInterface = ({
|
|
173
|
-
|
|
174
|
-
gqlMeta,
|
|
175
|
-
queryArgMetas,
|
|
176
|
-
paramArgMetas,
|
|
177
|
-
bodyArgMetas,
|
|
178
|
-
uploadArgMetas
|
|
179
|
-
}) => {
|
|
180
|
-
const sigMeta = (0, import_signal.getSigMeta)(sigRef);
|
|
181
|
-
const [returnRef, arrDepth] = (0, import_base.getNonArrayModel)(gqlMeta.returns());
|
|
163
|
+
const RestApiInterface = ({ refName, gqlKey, gqlMeta }) => {
|
|
164
|
+
const returnRef = import_constant.constantInfo.getModelRef(gqlMeta.returns.refName, gqlMeta.returns.modelType);
|
|
182
165
|
const isReturnModelType = !(0, import_base.isGqlScalar)(returnRef);
|
|
166
|
+
const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
|
|
167
|
+
const paramArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Param");
|
|
168
|
+
const queryArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Query");
|
|
169
|
+
const bodyArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Body");
|
|
183
170
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-full flex-col gap-4", children: [
|
|
184
171
|
uploadArgMetas.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
185
172
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Form data upload" }),
|
|
186
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, {
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, { refName, gqlKey, argMetas: uploadArgMetas }) })
|
|
187
174
|
] }) : null,
|
|
188
175
|
paramArgMetas.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
189
176
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Parameters" }),
|
|
190
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, {
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, { refName, gqlKey, argMetas: paramArgMetas }) })
|
|
191
178
|
] }) : null,
|
|
192
179
|
queryArgMetas.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
193
180
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Query" }),
|
|
194
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, {
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, { refName, gqlKey, argMetas: queryArgMetas }) })
|
|
195
182
|
] }) : null,
|
|
196
183
|
bodyArgMetas.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
197
184
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Body" }),
|
|
198
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, {
|
|
185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 overflow-x-auto rounded-md p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Arg.default.Table, { refName, gqlKey, argMetas: bodyArgMetas }) })
|
|
199
186
|
] }) : null,
|
|
200
187
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-full flex-col gap-2 rounded-md font-normal md:flex-row", children: [
|
|
201
188
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full md:w-1/2", children: [
|
|
202
189
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Response Type" }),
|
|
203
190
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bg-base-100 max-h-[500px] overflow-auto rounded-md p-4 md:h-[500px]", children: [
|
|
204
191
|
"Returns: ",
|
|
205
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Signal.Object.Type, { objRef: returnRef, arrDepth }),
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Signal.Object.Type, { objRef: returnRef, arrDepth: gqlMeta.returns.arrDepth }),
|
|
206
193
|
isReturnModelType ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Signal.Object.Detail, { objRef: returnRef }) : null
|
|
207
194
|
] })
|
|
208
195
|
] }),
|
|
209
196
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full md:w-1/2", children: [
|
|
210
197
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-extrabold", children: "Response Example" }),
|
|
211
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Response.default.Example, {
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Response.default.Example, { gqlMeta })
|
|
212
199
|
] })
|
|
213
200
|
] }) })
|
|
214
201
|
] });
|
|
215
202
|
};
|
|
216
203
|
RestApi.Interface = RestApiInterface;
|
|
217
|
-
const RestApiTry = ({
|
|
218
|
-
|
|
219
|
-
gqlMeta
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
bodyArgMetas,
|
|
223
|
-
uploadArgMetas,
|
|
224
|
-
httpUri = import_base.baseClientEnv.serverHttpUri
|
|
225
|
-
}) => {
|
|
226
|
-
const sigMeta = (0, import_signal.getSigMeta)(sigRef);
|
|
204
|
+
const RestApiTry = ({ prefix, refName, gqlKey, gqlMeta, httpUri = import_base.baseClientEnv.serverHttpUri }) => {
|
|
205
|
+
const queryArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Query");
|
|
206
|
+
const paramArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Param");
|
|
207
|
+
const bodyArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Body");
|
|
208
|
+
const uploadArgMetas = gqlMeta.args.filter((argMeta) => argMeta.type === "Upload");
|
|
227
209
|
const tryJwt = import_store.st.use.tryJwt();
|
|
228
210
|
const paramExample = (0, import_react.useMemo)(() => (0, import_signal.getExampleData)(paramArgMetas, "restapi"), []);
|
|
229
211
|
const queryExample = (0, import_react.useMemo)(() => (0, import_signal.getExampleData)(queryArgMetas, "restapi"), []);
|
|
@@ -236,16 +218,15 @@ const RestApiTry = ({
|
|
|
236
218
|
status: "idle",
|
|
237
219
|
data: null
|
|
238
220
|
});
|
|
239
|
-
const method = gqlMeta.type === "
|
|
240
|
-
const
|
|
241
|
-
const path = (0, import_signal.getControllerPath)(gqlMeta, paramArgMetas);
|
|
221
|
+
const method = gqlMeta.type === "query" ? "GET" : "POST";
|
|
222
|
+
const path = getControllerPath(gqlKey, gqlMeta);
|
|
242
223
|
const queryString = new URLSearchParams(
|
|
243
224
|
Object.fromEntries(
|
|
244
225
|
queryArgMetas.map((argMeta) => {
|
|
245
226
|
const value = queryRequest[argMeta.name];
|
|
246
227
|
if (value === void 0 || value === null || value === "" || Array.isArray(value) && value.length === 0)
|
|
247
228
|
return null;
|
|
248
|
-
const
|
|
229
|
+
const argRef = import_constant.constantInfo.getModelRef(argMeta.refName, argMeta.modelType);
|
|
249
230
|
if ((0, import_constant.getGqlTypeStr)(argRef) === "JSON")
|
|
250
231
|
return [argMeta.name, btoa(value)];
|
|
251
232
|
return [argMeta.name, value];
|
|
@@ -303,6 +284,7 @@ const RestApiTry = ({
|
|
|
303
284
|
uploadArgMetas.map((argMeta) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
304
285
|
import_Arg.default.FormData,
|
|
305
286
|
{
|
|
287
|
+
gqlKey,
|
|
306
288
|
argMeta,
|
|
307
289
|
value: uploadRequest[argMeta.name],
|
|
308
290
|
onChange: (fileList) => {
|
|
@@ -317,6 +299,7 @@ const RestApiTry = ({
|
|
|
317
299
|
paramArgMetas.map((argMeta, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
318
300
|
import_Arg.default.Param,
|
|
319
301
|
{
|
|
302
|
+
gqlKey,
|
|
320
303
|
argMeta,
|
|
321
304
|
value: paramRequest[argMeta.name],
|
|
322
305
|
onChange: (value) => {
|
|
@@ -331,6 +314,7 @@ const RestApiTry = ({
|
|
|
331
314
|
queryArgMetas.map((argMeta, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
332
315
|
import_Arg.default.Query,
|
|
333
316
|
{
|
|
317
|
+
gqlKey,
|
|
334
318
|
argMeta,
|
|
335
319
|
value: queryRequest[argMeta.name] ?? "",
|
|
336
320
|
onChange: (value) => {
|
package/cjs/Signal/WebSocket.js
CHANGED
|
@@ -32,7 +32,6 @@ __export(WebSocket_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(WebSocket_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
-
var import_signal = require("@akanjs/signal");
|
|
36
35
|
var import_store = require("@akanjs/store");
|
|
37
36
|
var import_Message = __toESM(require("./Message"));
|
|
38
37
|
var import_PubSub = __toESM(require("./PubSub"));
|
|
@@ -40,29 +39,29 @@ function WebSocket() {
|
|
|
40
39
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {});
|
|
41
40
|
}
|
|
42
41
|
const WebSocketEndpoints = ({ refName, openAll }) => {
|
|
43
|
-
const
|
|
42
|
+
const signals = global.signals;
|
|
43
|
+
const signal = signals.find((signal2) => signal2.refName === refName);
|
|
44
|
+
if (!signal)
|
|
45
|
+
return null;
|
|
44
46
|
const tryRoles = import_store.st.use.tryRoles();
|
|
45
|
-
const gqlInfos =
|
|
46
|
-
|
|
47
|
-
[]
|
|
48
|
-
).sort((a, b) => a.key > b.key ? 1 : -1).filter(({ gqlMeta }) => gqlMeta.signalOption.onlyFor !== "restapi").filter(({ gqlMeta }) => {
|
|
49
|
-
if (gqlMeta.type === "Query" || gqlMeta.type === "Mutation")
|
|
47
|
+
const gqlInfos = Object.entries(signal.endpoint).sort(([keyA], [keyB]) => keyA > keyB ? 1 : -1).filter(([key, gqlMeta]) => gqlMeta.signalOption?.onlyFor !== "restapi").filter(([key, gqlMeta]) => {
|
|
48
|
+
if (gqlMeta.type === "pubsub" || gqlMeta.type === "message")
|
|
50
49
|
return false;
|
|
51
|
-
if (gqlMeta.guards
|
|
50
|
+
if (gqlMeta.signalOption?.guards?.includes("Public") && tryRoles.includes("Public"))
|
|
52
51
|
return true;
|
|
53
|
-
if ((gqlMeta.guards
|
|
52
|
+
if ((gqlMeta.signalOption?.guards?.includes("User") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("User"))
|
|
54
53
|
return true;
|
|
55
|
-
if ((gqlMeta.guards
|
|
54
|
+
if ((gqlMeta.signalOption?.guards?.includes("Admin") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("Admin"))
|
|
56
55
|
return true;
|
|
57
|
-
if (gqlMeta.guards
|
|
56
|
+
if ((gqlMeta.signalOption?.guards?.includes("SuperAdmin") || gqlMeta.signalOption?.guards?.includes("Every")) && tryRoles.includes("SuperAdmin"))
|
|
58
57
|
return true;
|
|
59
58
|
return false;
|
|
60
59
|
});
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: gqlInfos.map((
|
|
62
|
-
if (gqlMeta.type === "
|
|
63
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_PubSub.default.Endpoint, {
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: gqlInfos.map(([gqlKey, gqlMeta], idx) => {
|
|
61
|
+
if (gqlMeta.type === "pubsub") {
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_PubSub.default.Endpoint, { refName, gqlKey, gqlMeta, open: openAll }, idx);
|
|
64
63
|
} else {
|
|
65
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Message.default.Endpoint, {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Message.default.Endpoint, { refName, gqlKey, gqlMeta, open: openAll }, idx);
|
|
66
65
|
}
|
|
67
66
|
}) });
|
|
68
67
|
};
|
package/cjs/System/CSR.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(CSR_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(CSR_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_base = require("@akanjs/base");
|
|
26
27
|
var import_client = require("@akanjs/client");
|
|
27
28
|
var import_next = require("@akanjs/next");
|
|
28
29
|
var import_store = require("@akanjs/store");
|
|
@@ -49,10 +50,7 @@ const CSRProvider = ({
|
|
|
49
50
|
fonts,
|
|
50
51
|
layoutStyle = "web",
|
|
51
52
|
reconnect,
|
|
52
|
-
of
|
|
53
|
-
fetchPing,
|
|
54
|
-
fetchMe,
|
|
55
|
-
fetchSelf
|
|
53
|
+
of
|
|
56
54
|
}) => {
|
|
57
55
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
56
|
import_Load.Load.Page,
|
|
@@ -60,9 +58,10 @@ const CSRProvider = ({
|
|
|
60
58
|
of,
|
|
61
59
|
loader: async () => {
|
|
62
60
|
const { lang } = await params;
|
|
63
|
-
|
|
61
|
+
const fetch = import_base.baseClientEnv.side === "server" && import_base.baseClientEnv.operationMode === "local" ? global.builtFetch : global.fetch;
|
|
62
|
+
return { lang, fetch };
|
|
64
63
|
},
|
|
65
|
-
render: ({ lang }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
64
|
+
render: ({ lang, fetch }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
66
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Client.Client.Wrapper, { theme, lang, reconnect, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
66
|
CSRWrapper,
|
|
68
67
|
{
|
|
@@ -80,10 +79,6 @@ const CSRProvider = ({
|
|
|
80
79
|
import_Common.Common.Wrapper,
|
|
81
80
|
{
|
|
82
81
|
fetch,
|
|
83
|
-
environment: env.environment,
|
|
84
|
-
fetchPing,
|
|
85
|
-
fetchMe,
|
|
86
|
-
fetchSelf,
|
|
87
82
|
render: ({ mePromise, selfPromise }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
88
83
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Client.Client.Inner, {}),
|
|
89
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CSRInner, {}),
|
package/cjs/System/Common.js
CHANGED
|
@@ -22,20 +22,20 @@ __export(Common_exports, {
|
|
|
22
22
|
module.exports = __toCommonJS(Common_exports);
|
|
23
23
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
24
|
var import_ko = require("dayjs/locale/ko");
|
|
25
|
+
var import_base = require("@akanjs/base");
|
|
25
26
|
var import_client = require("@akanjs/client");
|
|
26
27
|
var import_Load = require("../Load");
|
|
27
28
|
const Common = () => {
|
|
28
29
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
29
30
|
};
|
|
30
31
|
const CommonWrapper = ({
|
|
31
|
-
fetch,
|
|
32
|
-
|
|
33
|
-
render,
|
|
34
|
-
fetchPing,
|
|
35
|
-
fetchMe = (props, option) => fetch.me?.(props, option),
|
|
36
|
-
fetchSelf = (props, option) => fetch.getSelf?.(props, option)
|
|
32
|
+
fetch = import_base.baseClientEnv.side === "server" && import_base.baseClientEnv.operationMode === "local" ? global.builtFetch : global.fetch,
|
|
33
|
+
render
|
|
37
34
|
}) => {
|
|
38
35
|
const account = (0, import_client.getAccount)();
|
|
36
|
+
const fetchPing = (option) => fetch.ping(option);
|
|
37
|
+
const fetchMe = (props, option) => fetch.me?.(props, option);
|
|
38
|
+
const fetchSelf = (props, option) => fetch.getSelf?.(props, option);
|
|
39
39
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
40
|
import_Load.Load.Page,
|
|
41
41
|
{
|
package/cjs/System/SSR.js
CHANGED
|
@@ -22,6 +22,7 @@ __export(SSR_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(SSR_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_base = require("@akanjs/base");
|
|
25
26
|
var import_client = require("@akanjs/client");
|
|
26
27
|
var import_react = require("react");
|
|
27
28
|
var import_Load = require("../Load");
|
|
@@ -43,10 +44,7 @@ const SSRProvider = ({
|
|
|
43
44
|
fonts,
|
|
44
45
|
layoutStyle = "web",
|
|
45
46
|
reconnect,
|
|
46
|
-
of
|
|
47
|
-
fetchPing,
|
|
48
|
-
fetchMe,
|
|
49
|
-
fetchSelf
|
|
47
|
+
of
|
|
50
48
|
}) => {
|
|
51
49
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
50
|
import_Load.Load.Page,
|
|
@@ -56,16 +54,13 @@ const SSRProvider = ({
|
|
|
56
54
|
const { lang } = await params;
|
|
57
55
|
if (!import_client.router.isInitialized)
|
|
58
56
|
import_client.router.init({ type: "next", side: "server", lang, prefix });
|
|
59
|
-
|
|
57
|
+
const fetch = import_base.baseClientEnv.side === "server" && import_base.baseClientEnv.operationMode === "local" ? global.builtFetch : global.fetch;
|
|
58
|
+
return { lang, fetch };
|
|
60
59
|
},
|
|
61
|
-
render: ({ lang }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
render: ({ lang, fetch }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
61
|
import_Common.Common.Wrapper,
|
|
63
62
|
{
|
|
64
63
|
fetch,
|
|
65
|
-
environment: env.environment,
|
|
66
|
-
fetchPing,
|
|
67
|
-
fetchMe,
|
|
68
|
-
fetchSelf,
|
|
69
64
|
render: ({ mePromise, selfPromise }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
65
|
SSRWrapper,
|
|
71
66
|
{
|
package/esm/Data/Insight.js
CHANGED
|
@@ -12,7 +12,7 @@ function Insight({
|
|
|
12
12
|
const refName = st.slice[sliceName].refName;
|
|
13
13
|
return /* @__PURE__ */ jsx("div", { className: clsx("stats my-2 flex w-full flex-wrap justify-center py-2 shadow-sm", className), children: /* @__PURE__ */ jsx("div", { className: "stats", children: columns?.map(
|
|
14
14
|
(column, idx) => insight[column] !== void 0 && /* @__PURE__ */ jsxs("div", { className: "stat mx-1 flex items-center rounded-none", children: [
|
|
15
|
-
/* @__PURE__ */ jsx("div", { className: "stat-title", children: l.
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: "stat-title", children: l._(`${refName}.${column}`) }),
|
|
16
16
|
/* @__PURE__ */ jsx("div", { className: "stat-value text-xl", children: insight[column].toLocaleString() })
|
|
17
17
|
] }, idx)
|
|
18
18
|
) }) });
|
package/esm/Data/Item.js
CHANGED
|
@@ -70,7 +70,7 @@ function Item({
|
|
|
70
70
|
return !["id", "status", "createdAt"].includes(key);
|
|
71
71
|
}).map((column, idx) => {
|
|
72
72
|
const key = typeof column === "string" ? column : column.key;
|
|
73
|
-
const title2 = typeof column !== "string" && column.title ? column.title : l.
|
|
73
|
+
const title2 = typeof column !== "string" && column.title ? column.title : l._(`${sliceName}.${key}`);
|
|
74
74
|
const render = convToAntdColumn(column).render ?? ((v, m, i) => JSON.stringify(v, null, 2));
|
|
75
75
|
const modelKeyLength = model[key]?.length;
|
|
76
76
|
if (convToAntdColumn(column).render) {
|
|
@@ -79,7 +79,7 @@ function ListContainer({
|
|
|
79
79
|
useEffect(() => {
|
|
80
80
|
void storeDo[namesOfSlice.initModel]();
|
|
81
81
|
}, []);
|
|
82
|
-
const RenderTitle = renderTitle ?? ((model) => `${l(`${refName}.modelName`)} - ${model.id ? model.id : "New"}`);
|
|
82
|
+
const RenderTitle = renderTitle ?? ((model) => `${l._(`${refName}.modelName`)} - ${model.id ? model.id : "New"}`);
|
|
83
83
|
const ModelDashboard = () => {
|
|
84
84
|
const summary = storeUse.summary();
|
|
85
85
|
const summaryLoading = storeUse.summaryLoading();
|
|
@@ -107,11 +107,11 @@ function ListContainer({
|
|
|
107
107
|
onClick: () => {
|
|
108
108
|
const header = columns.map((column) => {
|
|
109
109
|
if (typeof column === "string")
|
|
110
|
-
return l.
|
|
110
|
+
return l._(`${sliceName}.${column}`);
|
|
111
111
|
else if (column.title)
|
|
112
112
|
return column.title;
|
|
113
113
|
else
|
|
114
|
-
return l.
|
|
114
|
+
return l._(`${sliceName}.${column.key}`);
|
|
115
115
|
}).join(" ");
|
|
116
116
|
const body = modelList.map((model) => {
|
|
117
117
|
const line = columns.map((column) => {
|
|
@@ -170,7 +170,7 @@ ${body}`], { type: "text/csv;charset=utf-8" });
|
|
|
170
170
|
{
|
|
171
171
|
value: sortOfModel,
|
|
172
172
|
options: fetch[names.modelSortKeys]?.map((sortKey) => ({
|
|
173
|
-
label: l.
|
|
173
|
+
label: l._(`${refName}.${sortKey}`),
|
|
174
174
|
value: sortKey
|
|
175
175
|
})) ?? [],
|
|
176
176
|
onChange: (sortKey) => void storeDo[namesOfSlice.setSortOfModel](sortKey)
|
|
@@ -181,7 +181,7 @@ ${body}`], { type: "text/csv;charset=utf-8" });
|
|
|
181
181
|
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex flex-wrap justify-between", children: [
|
|
182
182
|
/* @__PURE__ */ jsxs("div", { className: "flex pb-1", children: [
|
|
183
183
|
/* @__PURE__ */ jsxs("p", { className: "prose text-lg", children: [
|
|
184
|
-
title ?? l.
|
|
184
|
+
title ?? l._(`${sliceName}.modelName`),
|
|
185
185
|
"(",
|
|
186
186
|
modelInsight.count,
|
|
187
187
|
")"
|
package/esm/Data/TableList.js
CHANGED
|
@@ -51,10 +51,7 @@ function TableList({
|
|
|
51
51
|
const cols = useMemo(() => {
|
|
52
52
|
const firstCol = {
|
|
53
53
|
...convToAntdColumn(columns[0]),
|
|
54
|
-
title: typeof columns[0] !== "string" && columns[0].title ? columns[0].title : l.
|
|
55
|
-
sliceName,
|
|
56
|
-
typeof columns[0] === "string" ? columns[0] : columns[0].key
|
|
57
|
-
)
|
|
54
|
+
title: typeof columns[0] !== "string" && columns[0].title ? columns[0].title : l._(`${sliceName}.${typeof columns[0] === "string" ? columns[0] : columns[0].key}`)
|
|
58
55
|
};
|
|
59
56
|
return [
|
|
60
57
|
{
|
|
@@ -74,7 +71,7 @@ function TableList({
|
|
|
74
71
|
},
|
|
75
72
|
...columns.slice(1).map((col) => ({
|
|
76
73
|
...convToAntdColumn(col),
|
|
77
|
-
title: typeof col !== "string" && col.title ? col.title : l.
|
|
74
|
+
title: typeof col !== "string" && col.title ? col.title : l._(`${sliceName}.${typeof col === "string" ? col : col.key}`)
|
|
78
75
|
})),
|
|
79
76
|
...actions ? [
|
|
80
77
|
{
|
package/esm/Field.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { dayjs,
|
|
3
|
+
import { dayjs, isEnum } from "@akanjs/base";
|
|
4
4
|
import { clsx, usePage } from "@akanjs/client";
|
|
5
5
|
import { capitalize, formatPhone, isPhoneNumber, lowerlize } from "@akanjs/common";
|
|
6
6
|
import { st } from "@akanjs/store";
|
|
@@ -282,7 +282,7 @@ const ToggleSelect = ({
|
|
|
282
282
|
btnClassName
|
|
283
283
|
}) => {
|
|
284
284
|
const { l } = usePage();
|
|
285
|
-
const
|
|
285
|
+
const isEnumValue = isEnum(items);
|
|
286
286
|
return /* @__PURE__ */ jsxs("div", { className: clsx("flex flex-col", className), children: [
|
|
287
287
|
label ? /* @__PURE__ */ jsx(Label, { className: labelClassName, nullable, label, desc }) : null,
|
|
288
288
|
/* @__PURE__ */ jsx(
|
|
@@ -291,10 +291,10 @@ const ToggleSelect = ({
|
|
|
291
291
|
className: "mt-2",
|
|
292
292
|
nullable: !!nullable,
|
|
293
293
|
btnClassName,
|
|
294
|
-
items: model && field ? (
|
|
295
|
-
label: l.
|
|
294
|
+
items: model && field ? (isEnumValue ? items.values : items).map((item) => ({
|
|
295
|
+
label: l._(`${items.refName}.${item}`),
|
|
296
296
|
value: item
|
|
297
|
-
})) :
|
|
297
|
+
})) : isEnumValue ? items.values : items,
|
|
298
298
|
value,
|
|
299
299
|
onChange: (value2, idx) => {
|
|
300
300
|
onChange(value2);
|
|
@@ -324,17 +324,17 @@ const MultiToggleSelect = ({
|
|
|
324
324
|
disabled
|
|
325
325
|
}) => {
|
|
326
326
|
const { l } = usePage();
|
|
327
|
-
const
|
|
327
|
+
const isEnumValue = isEnum(items);
|
|
328
328
|
return /* @__PURE__ */ jsxs("div", { className: clsx("flex flex-col", className), children: [
|
|
329
329
|
label ? /* @__PURE__ */ jsx(Label, { className: labelClassName, nullable: !!minlength, label, desc }) : null,
|
|
330
330
|
/* @__PURE__ */ jsx(
|
|
331
331
|
UtilToggleSelect.Multi,
|
|
332
332
|
{
|
|
333
333
|
nullable: !minlength,
|
|
334
|
-
items: model && field ? (
|
|
335
|
-
label: l.
|
|
334
|
+
items: model && field ? (isEnumValue ? items.values : items).map((item) => ({
|
|
335
|
+
label: l._(`${items.refName}.${item}`),
|
|
336
336
|
value: item
|
|
337
|
-
})) :
|
|
337
|
+
})) : isEnumValue ? items.values : items,
|
|
338
338
|
value,
|
|
339
339
|
onChange: (values) => {
|
|
340
340
|
onChange(values);
|
|
@@ -1152,7 +1152,9 @@ const Children = ({
|
|
|
1152
1152
|
return renderSelected(model);
|
|
1153
1153
|
},
|
|
1154
1154
|
onChange: (modelIds) => {
|
|
1155
|
-
onChange(
|
|
1155
|
+
onChange(
|
|
1156
|
+
modelIds.map((id) => modelList.get(id)).filter((model) => model !== void 0)
|
|
1157
|
+
);
|
|
1156
1158
|
},
|
|
1157
1159
|
onSearch
|
|
1158
1160
|
}
|
package/esm/Model/EditModal.js
CHANGED
|
@@ -177,7 +177,7 @@ function EditModal({
|
|
|
177
177
|
children: [
|
|
178
178
|
modelFormId ? /* @__PURE__ */ jsx(AiOutlineSave, {}) : /* @__PURE__ */ jsx(AiOutlinePlus, {}),
|
|
179
179
|
l(modelFormId ? "base.updateModel" : "base.createModel", {
|
|
180
|
-
model: l.
|
|
180
|
+
model: l._(`${names.model}.modelName`)
|
|
181
181
|
})
|
|
182
182
|
]
|
|
183
183
|
}
|
package/esm/Model/Remove.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { clsx, msg, router, usePage } from "@akanjs/client";
|
|
4
4
|
import { capitalize } from "@akanjs/common";
|
|
5
5
|
import { st } from "@akanjs/store";
|
|
6
6
|
import { useMemo, useState } from "react";
|
|
7
|
-
import { AiOutlineDelete } from "react-icons/ai";
|
|
8
7
|
import { Button } from "../Button";
|
|
9
8
|
import { Modal } from "../Modal";
|
|
10
|
-
function Remove({ className, name, modelId, sliceName, modal, redirect }) {
|
|
9
|
+
function Remove({ className, name, modelId, sliceName, modal, redirect, children }) {
|
|
11
10
|
const { l } = usePage();
|
|
12
11
|
const [modalOpen, setModalOpen] = useState(false);
|
|
13
12
|
const storeDo = st.do;
|
|
@@ -19,20 +18,16 @@ function Remove({ className, name, modelId, sliceName, modal, redirect }) {
|
|
|
19
18
|
}),
|
|
20
19
|
[]
|
|
21
20
|
);
|
|
22
|
-
return /* @__PURE__ */ jsxs(
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
"
|
|
21
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
25
24
|
{
|
|
26
|
-
className: clsx("
|
|
25
|
+
className: clsx("cursor-pointer", className),
|
|
27
26
|
onClick: (e) => {
|
|
28
27
|
e.stopPropagation();
|
|
29
28
|
setModalOpen(true);
|
|
30
29
|
},
|
|
31
|
-
children
|
|
32
|
-
/* @__PURE__ */ jsx(AiOutlineDelete, {}),
|
|
33
|
-
" ",
|
|
34
|
-
l("base.remove")
|
|
35
|
-
]
|
|
30
|
+
children
|
|
36
31
|
}
|
|
37
32
|
),
|
|
38
33
|
/* @__PURE__ */ jsx(
|