@compill/admin 1.0.106 → 1.0.107
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/index.js +565 -511
- package/dist/index.mjs +2000 -0
- package/package.json +20 -21
- package/dist/index.cjs +0 -2054
- /package/dist/{index.d.cts → index.d.mts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,59 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@soperio/jsx-runtime');
|
|
4
|
+
var api = require('@compill/api');
|
|
5
|
+
var components = require('@compill/components');
|
|
6
|
+
var js = require('@mdi/js');
|
|
7
|
+
var ui = require('@valerya/ui');
|
|
8
|
+
var compat = require('es-toolkit/compat');
|
|
9
|
+
var Link = require('next/link');
|
|
10
|
+
var reactRouterDom = require('react-router-dom');
|
|
11
|
+
var React8 = require('react');
|
|
12
|
+
var adminApi = require('@compill/admin-api');
|
|
13
|
+
var formik = require('formik');
|
|
14
|
+
var reactToastify = require('react-toastify');
|
|
15
|
+
var reactHotkeysHook = require('react-hotkeys-hook');
|
|
16
|
+
var form = require('@compill/form');
|
|
17
|
+
var react = require('@soperio/react');
|
|
18
|
+
var formEditor = require('@compill/form-editor');
|
|
19
|
+
var editor = require('@compill/editor');
|
|
20
|
+
var reactDom = require('react-dom');
|
|
21
|
+
var router = require('next/router');
|
|
22
|
+
var table = require('@compill/table');
|
|
23
|
+
var esToolkit = require('es-toolkit');
|
|
24
|
+
var hooks = require('@compill/hooks');
|
|
25
|
+
var env = require('@compill/env');
|
|
26
|
+
var reactTable = require('@tanstack/react-table');
|
|
27
|
+
var reactQuery = require('@tanstack/react-query');
|
|
28
|
+
var Image = require('next/image');
|
|
29
|
+
var auth = require('@compill/auth');
|
|
30
|
+
|
|
31
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
32
|
+
|
|
33
|
+
var Link__default = /*#__PURE__*/_interopDefault(Link);
|
|
34
|
+
var React8__default = /*#__PURE__*/_interopDefault(React8);
|
|
35
|
+
var Image__default = /*#__PURE__*/_interopDefault(Image);
|
|
28
36
|
|
|
29
37
|
// src/lib/SectionTitle.tsx
|
|
30
38
|
function SectionTitle({ children, ...props }) {
|
|
31
|
-
return /* @__PURE__ */ jsx("h2", { textSize: "xl", fontWeight: "600", textColor: "slate-800", ...props, children });
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h2", { textSize: "xl", fontWeight: "600", textColor: "slate-800", ...props, children });
|
|
32
40
|
}
|
|
33
41
|
function Breadcrumbs({ breadcrumbs, ...props }) {
|
|
34
|
-
if (isArray(breadcrumbs)) {
|
|
35
|
-
return /* @__PURE__ */ jsx("div", { dflex: true, alignItems: "center", trait: "typo.h5", ...props, children: breadcrumbs.map((b, index) => /* @__PURE__ */ jsx(BreadcrumbItem, { breadcrumb: b, showSeparator: index > 0 }, index)) });
|
|
42
|
+
if (compat.isArray(breadcrumbs)) {
|
|
43
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { dflex: true, alignItems: "center", trait: "typo.h5", ...props, children: breadcrumbs.map((b, index) => /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { breadcrumb: b, showSeparator: index > 0 }, index)) });
|
|
36
44
|
}
|
|
37
|
-
return /* @__PURE__ */ jsx(QueryBreadcrumbs, { queryFn: breadcrumbs.queryFn, queryField: breadcrumbs.queryField, generate: breadcrumbs.generate });
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(QueryBreadcrumbs, { queryFn: breadcrumbs.queryFn, queryField: breadcrumbs.queryField, generate: breadcrumbs.generate });
|
|
38
46
|
}
|
|
39
47
|
function QueryBreadcrumbs({ queryFn, queryField, generate, ...props }) {
|
|
40
|
-
const params = useParams();
|
|
48
|
+
const params = reactRouterDom.useParams();
|
|
41
49
|
const id = queryField ? params[queryField] : void 0;
|
|
42
|
-
const { data, isLoading, isError } = useApiQuery([""], queryFn, id);
|
|
50
|
+
const { data, isLoading, isError } = api.useApiQuery([""], queryFn, id);
|
|
43
51
|
if (isLoading || isError) {
|
|
44
|
-
return /* @__PURE__ */ jsxs("div", { dflex: true, alignItems: "center", children: [
|
|
45
|
-
/* @__PURE__ */ jsx(Shimmer, { h: "8", w: "24" }),
|
|
46
|
-
/* @__PURE__ */ jsx(Icon, { path: mdiCircleSmall, mx: "1" }),
|
|
47
|
-
/* @__PURE__ */ jsx(Shimmer, { h: "8", w: "20" })
|
|
52
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, alignItems: "center", children: [
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(components.Shimmer, { h: "8", w: "24" }),
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiCircleSmall, mx: "1" }),
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx(components.Shimmer, { h: "8", w: "20" })
|
|
48
56
|
] });
|
|
49
57
|
}
|
|
50
58
|
const breadcrumbs = generate(data);
|
|
51
|
-
return /* @__PURE__ */ jsx("div", { dflex: true, alignItems: "center", trait: "typo.h5", ...props, children: breadcrumbs.map((b, index) => /* @__PURE__ */ jsx(BreadcrumbItem, { breadcrumb: b, showSeparator: index > 0 }, index)) });
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { dflex: true, alignItems: "center", trait: "typo.h5", ...props, children: breadcrumbs.map((b, index) => /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { breadcrumb: b, showSeparator: index > 0 }, index)) });
|
|
52
60
|
}
|
|
53
61
|
function BreadcrumbItem({ breadcrumb, showSeparator }) {
|
|
54
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
|
-
showSeparator && /* @__PURE__ */ jsx(Icon, { path: mdiCircleSmall, mx: "1" }),
|
|
56
|
-
/* @__PURE__ */ jsx(
|
|
62
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
63
|
+
showSeparator && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiCircleSmall, mx: "1" }),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(Link__default.default, { href: `/${breadcrumb.path || "#"}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
65
|
"span",
|
|
58
66
|
{
|
|
59
67
|
hover_textDecoration: breadcrumb.path ? "underline" : void 0,
|
|
@@ -64,27 +72,27 @@ function BreadcrumbItem({ breadcrumb, showSeparator }) {
|
|
|
64
72
|
] });
|
|
65
73
|
}
|
|
66
74
|
function DialogButton({ buildDialog, ...props }) {
|
|
67
|
-
const [showDialog, setShowDialog] =
|
|
68
|
-
const onShowDialog =
|
|
75
|
+
const [showDialog, setShowDialog] = React8__default.default.useState(false);
|
|
76
|
+
const onShowDialog = React8__default.default.useCallback((event) => {
|
|
69
77
|
event?.preventDefault();
|
|
70
78
|
event?.stopPropagation();
|
|
71
79
|
setShowDialog(true);
|
|
72
80
|
}, [setShowDialog]);
|
|
73
|
-
const onCloseDialog =
|
|
81
|
+
const onCloseDialog = React8__default.default.useCallback(() => {
|
|
74
82
|
setShowDialog(false);
|
|
75
83
|
}, [setShowDialog]);
|
|
76
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
|
-
/* @__PURE__ */ jsx(Button, { onClick: onShowDialog, ...props }),
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: onShowDialog, ...props }),
|
|
78
86
|
showDialog && buildDialog(onCloseDialog)
|
|
79
87
|
] });
|
|
80
88
|
}
|
|
81
89
|
function ButtonBar({ children, ...props }) {
|
|
82
|
-
return /* @__PURE__ */ jsx("div", { dflex: true, border: "1px", borderColor: "zinc-200", divideX: "1px", divideColor: "zinc-200", rounded: "lg", overflow: "hidden", ...props, children });
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { dflex: true, border: "1px", borderColor: "zinc-200", divideX: "1px", divideColor: "zinc-200", rounded: "lg", overflow: "hidden", ...props, children });
|
|
83
91
|
}
|
|
84
|
-
var ButtonBarButton =
|
|
92
|
+
var ButtonBarButton = React8__default.default.forwardRef(
|
|
85
93
|
function({ icon, children, ...props }, ref) {
|
|
86
|
-
return /* @__PURE__ */ jsxs(
|
|
87
|
-
Button,
|
|
94
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
95
|
+
ui.Button,
|
|
88
96
|
{
|
|
89
97
|
scheme: "dark",
|
|
90
98
|
size: "sm",
|
|
@@ -98,19 +106,19 @@ var ButtonBarButton = React8.forwardRef(
|
|
|
98
106
|
...props,
|
|
99
107
|
ref,
|
|
100
108
|
children: [
|
|
101
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon }),
|
|
109
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon }),
|
|
102
110
|
children
|
|
103
111
|
]
|
|
104
112
|
}
|
|
105
113
|
);
|
|
106
114
|
}
|
|
107
115
|
);
|
|
108
|
-
var ButtonBarSubmitButton =
|
|
116
|
+
var ButtonBarSubmitButton = React8__default.default.forwardRef(
|
|
109
117
|
function({ useDirty, disabled, icon, children, ...props }, ref) {
|
|
110
|
-
const { dirty, handleSubmit } = useFormikContext() ?? { dirty: false, handleSubmit: void 0};
|
|
111
|
-
const onSubmit =
|
|
112
|
-
return /* @__PURE__ */ jsxs(
|
|
113
|
-
Button,
|
|
118
|
+
const { dirty, handleSubmit } = formik.useFormikContext() ?? { dirty: false, handleSubmit: void 0};
|
|
119
|
+
const onSubmit = React8__default.default.useCallback(() => handleSubmit(), [handleSubmit]);
|
|
120
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
121
|
+
ui.Button,
|
|
114
122
|
{
|
|
115
123
|
scheme: "dark",
|
|
116
124
|
size: "sm",
|
|
@@ -126,7 +134,7 @@ var ButtonBarSubmitButton = React8.forwardRef(
|
|
|
126
134
|
...props,
|
|
127
135
|
ref,
|
|
128
136
|
children: [
|
|
129
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon }),
|
|
137
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon }),
|
|
130
138
|
children
|
|
131
139
|
]
|
|
132
140
|
}
|
|
@@ -134,7 +142,7 @@ var ButtonBarSubmitButton = React8.forwardRef(
|
|
|
134
142
|
}
|
|
135
143
|
);
|
|
136
144
|
function ButtonBarDialogButton({ icon, children, ...props }) {
|
|
137
|
-
return /* @__PURE__ */ jsxs(
|
|
145
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
138
146
|
DialogButton,
|
|
139
147
|
{
|
|
140
148
|
scheme: "dark",
|
|
@@ -148,112 +156,112 @@ function ButtonBarDialogButton({ icon, children, ...props }) {
|
|
|
148
156
|
gap: "2",
|
|
149
157
|
...props,
|
|
150
158
|
children: [
|
|
151
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon }),
|
|
159
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon }),
|
|
152
160
|
children
|
|
153
161
|
]
|
|
154
162
|
}
|
|
155
163
|
);
|
|
156
164
|
}
|
|
157
165
|
function InvalidateButton({ pathOrPermalink, ...props }) {
|
|
158
|
-
const api = INVALIDATE_API.new(pathOrPermalink);
|
|
159
|
-
const mutation = useApiMutation(api.invalidate, api.queryKey);
|
|
160
|
-
const invalidate = useMutate(mutation, { successMsg: "Page successfully invalidated" });
|
|
161
|
-
return /* @__PURE__ */ jsx(
|
|
166
|
+
const api$1 = adminApi.INVALIDATE_API.new(pathOrPermalink);
|
|
167
|
+
const mutation = api.useApiMutation(api$1.invalidate, api$1.queryKey);
|
|
168
|
+
const invalidate = api.useMutate(mutation, { successMsg: "Page successfully invalidated" });
|
|
169
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
162
170
|
ButtonBarButton,
|
|
163
171
|
{
|
|
164
172
|
title: "Regenerate",
|
|
165
173
|
disabled: mutation.isLoading,
|
|
166
174
|
onClick: invalidate,
|
|
167
|
-
icon: mdiDatabaseRefreshOutline,
|
|
175
|
+
icon: js.mdiDatabaseRefreshOutline,
|
|
168
176
|
...props
|
|
169
177
|
}
|
|
170
178
|
);
|
|
171
179
|
}
|
|
172
180
|
function NavigateButton({ path, ...props }) {
|
|
173
|
-
const navigate = useNavigate();
|
|
174
|
-
const handleClick =
|
|
181
|
+
const navigate = reactRouterDom.useNavigate();
|
|
182
|
+
const handleClick = React8__default.default.useCallback(() => {
|
|
175
183
|
navigate(path);
|
|
176
184
|
}, [navigate, path]);
|
|
177
|
-
return /* @__PURE__ */ jsx(Button, { type: "submit", scheme: "dark", variant: "glass", corners: "pill", w: "10", h: "10", onClick: handleClick, ...props, children: /* @__PURE__ */ jsx(Icon, { path: mdiPost }) });
|
|
185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { type: "submit", scheme: "dark", variant: "glass", corners: "pill", w: "10", h: "10", onClick: handleClick, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiPost }) });
|
|
178
186
|
}
|
|
179
187
|
function PublishButton({
|
|
180
188
|
status,
|
|
181
189
|
queryId,
|
|
182
|
-
api,
|
|
190
|
+
api: api$1,
|
|
183
191
|
...props
|
|
184
192
|
}) {
|
|
185
193
|
const isDraft = status == "draft";
|
|
186
|
-
const mutation = useInvalidateMutation(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, { networkMode: "always" });
|
|
187
|
-
const publish =
|
|
194
|
+
const mutation = api.useInvalidateMutation(isDraft ? api$1.publish : api$1.unpublish, api$1.queryKey, queryId, { networkMode: "always" });
|
|
195
|
+
const publish = React8__default.default.useCallback(() => {
|
|
188
196
|
mutation.reset();
|
|
189
|
-
mutation.mutateAsync(queryId).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch((error) => toast.error(`Error: ${error}`));
|
|
197
|
+
mutation.mutateAsync(queryId).then(() => reactToastify.toast.success(isDraft ? "Published!" : "Unpublished!")).catch((error) => reactToastify.toast.error(`Error: ${error}`));
|
|
190
198
|
}, [mutation, queryId]);
|
|
191
|
-
return /* @__PURE__ */ jsx(
|
|
199
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
192
200
|
ButtonBarButton,
|
|
193
201
|
{
|
|
194
202
|
disabled: mutation.isLoading,
|
|
195
203
|
onClick: publish,
|
|
196
|
-
icon: isDraft ? mdiEye : mdiEyeOff,
|
|
204
|
+
icon: isDraft ? js.mdiEye : js.mdiEyeOff,
|
|
197
205
|
...props,
|
|
198
206
|
children: isDraft ? "Publish" : "Switch to draft"
|
|
199
207
|
}
|
|
200
208
|
);
|
|
201
209
|
}
|
|
202
210
|
function UpdateButton({ ...props }) {
|
|
203
|
-
const { dirty, handleSubmit } = useFormikContext() ?? { dirty: false, handleSubmit: void 0};
|
|
204
|
-
useHotkeys("ctrl+s", () => {
|
|
211
|
+
const { dirty, handleSubmit } = formik.useFormikContext() ?? { dirty: false, handleSubmit: void 0};
|
|
212
|
+
reactHotkeysHook.useHotkeys("ctrl+s", () => {
|
|
205
213
|
if (dirty && !props.disabled) handleSubmit();
|
|
206
214
|
}, { preventDefault: true }, [dirty, props, handleSubmit]);
|
|
207
|
-
return /* @__PURE__ */ jsx(ButtonBarSubmitButton, { icon: mdiCloudUpload, ...props, children: "Update" });
|
|
215
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ButtonBarSubmitButton, { icon: js.mdiCloudUpload, ...props, children: "Update" });
|
|
208
216
|
}
|
|
209
217
|
function ViewButton({ label, path, icon, ...props }) {
|
|
210
|
-
const openPage =
|
|
218
|
+
const openPage = React8__default.default.useCallback(() => {
|
|
211
219
|
window.open(path, "_blank");
|
|
212
220
|
}, [path]);
|
|
213
|
-
return /* @__PURE__ */ jsx(
|
|
221
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
214
222
|
ButtonBarButton,
|
|
215
223
|
{
|
|
216
224
|
onClick: openPage,
|
|
217
225
|
dflex: true,
|
|
218
226
|
alignItems: "center",
|
|
219
227
|
gap: "2",
|
|
220
|
-
icon: icon || mdiOpenInNew,
|
|
228
|
+
icon: icon || js.mdiOpenInNew,
|
|
221
229
|
...props,
|
|
222
230
|
children: label
|
|
223
231
|
}
|
|
224
232
|
);
|
|
225
233
|
}
|
|
226
|
-
function OrderCell({ api, postId, order }) {
|
|
227
|
-
const mutationDown = useInvalidateMutation(api.moveDown, api.queryKey);
|
|
228
|
-
const mutationUp = useInvalidateMutation(api.moveUp, api.queryKey);
|
|
229
|
-
const moveDown =
|
|
234
|
+
function OrderCell({ api: api$1, postId, order }) {
|
|
235
|
+
const mutationDown = api.useInvalidateMutation(api$1.moveDown, api$1.queryKey);
|
|
236
|
+
const mutationUp = api.useInvalidateMutation(api$1.moveUp, api$1.queryKey);
|
|
237
|
+
const moveDown = React8__default.default.useCallback((e) => {
|
|
230
238
|
e.stopPropagation();
|
|
231
239
|
mutationDown.mutateAsync(postId).catch((error) => {
|
|
232
|
-
toast.error(`Error: ${error}`);
|
|
240
|
+
reactToastify.toast.error(`Error: ${error}`);
|
|
233
241
|
});
|
|
234
242
|
}, [mutationDown, postId]);
|
|
235
|
-
const moveUp =
|
|
243
|
+
const moveUp = React8__default.default.useCallback((e) => {
|
|
236
244
|
e.stopPropagation();
|
|
237
245
|
mutationUp.mutateAsync(postId).catch((error) => {
|
|
238
|
-
toast.error(`Error: ${error}`);
|
|
246
|
+
reactToastify.toast.error(`Error: ${error}`);
|
|
239
247
|
});
|
|
240
248
|
}, [mutationUp, postId]);
|
|
241
|
-
return /* @__PURE__ */ jsxs(FlexCenter, { placeContent: "start", numericFontVariant: "tabular-nums", children: [
|
|
249
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(components.FlexCenter, { placeContent: "start", numericFontVariant: "tabular-nums", children: [
|
|
242
250
|
order,
|
|
243
|
-
/* @__PURE__ */ jsx(Button, { ms: "3", variant: "borderless", scheme: "dark", onClick: moveUp, children: /* @__PURE__ */ jsx(Icon, { path: mdiArrowUpBoldBox }) }),
|
|
244
|
-
/* @__PURE__ */ jsx(Button, { variant: "borderless", scheme: "dark", onClick: moveDown, children: /* @__PURE__ */ jsx(Icon, { path: mdiArrowDownBoldBox }) })
|
|
251
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { ms: "3", variant: "borderless", scheme: "dark", onClick: moveUp, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiArrowUpBoldBox }) }),
|
|
252
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "borderless", scheme: "dark", onClick: moveDown, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiArrowDownBoldBox }) })
|
|
245
253
|
] });
|
|
246
254
|
}
|
|
247
255
|
function PageContainer({ children, ...props }) {
|
|
248
|
-
return /* @__PURE__ */ jsx(Container, { center: true, dflex: true, flexCol: true, gap: "8", ...props, children });
|
|
256
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Container, { center: true, dflex: true, flexCol: true, gap: "8", ...props, children });
|
|
249
257
|
}
|
|
250
258
|
function PageMain({ children, ...props }) {
|
|
251
|
-
return /* @__PURE__ */ jsx(Tile, { scheme: "light", p: "5", ...props, children });
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Tile, { scheme: "light", p: "5", ...props, children });
|
|
252
260
|
}
|
|
253
261
|
function PageContentEditor({ name, ...props }) {
|
|
254
|
-
const extensions = [ImageExtension];
|
|
255
|
-
return /* @__PURE__ */ jsx(PageMain, { h: "min", ...props, children: /* @__PURE__ */ jsx(
|
|
256
|
-
FormEditor,
|
|
262
|
+
const extensions = [editor.ImageExtension];
|
|
263
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageMain, { h: "min", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
264
|
+
formEditor.FormEditor,
|
|
257
265
|
{
|
|
258
266
|
minH: "128",
|
|
259
267
|
minW: "144",
|
|
@@ -264,73 +272,73 @@ function PageContentEditor({ name, ...props }) {
|
|
|
264
272
|
}
|
|
265
273
|
) });
|
|
266
274
|
}
|
|
267
|
-
function PageQueryStateContainerInner({ queryId, api, apiFn, loadingStyles, errorStyles, children, ...props }) {
|
|
268
|
-
const { data, isLoading, isError } = apiFn == "getAll" ? useApiQuery(api.queryKey, api.getAll, props.apiParams) : useApiQuery(api.queryKey, api.get, queryId);
|
|
269
|
-
const invalidate = useInvalidateQuery(api.queryKey, queryId);
|
|
275
|
+
function PageQueryStateContainerInner({ queryId, api: api$1, apiFn, loadingStyles, errorStyles, children, ...props }) {
|
|
276
|
+
const { data, isLoading, isError } = apiFn == "getAll" ? api.useApiQuery(api$1.queryKey, api$1.getAll, props.apiParams) : api.useApiQuery(api$1.queryKey, api$1.get, queryId);
|
|
277
|
+
const invalidate = api.useInvalidateQuery(api$1.queryKey, queryId);
|
|
270
278
|
if (isLoading)
|
|
271
|
-
return /* @__PURE__ */ jsx(QueryLoadingState, { w: "full", h: "100%", ...loadingStyles });
|
|
279
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components.QueryLoadingState, { w: "full", h: "100%", ...loadingStyles });
|
|
272
280
|
if (isError)
|
|
273
|
-
return /* @__PURE__ */ jsx(RetryOnError, { p: "0", onClick: invalidate, ...errorStyles });
|
|
274
|
-
return /* @__PURE__ */ jsx(PageContainer, { ...props, children: apiFn == "get" ? children(data) : children(data) });
|
|
281
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components.RetryOnError, { p: "0", onClick: invalidate, ...errorStyles });
|
|
282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageContainer, { ...props, children: apiFn == "get" ? children(data) : children(data) });
|
|
275
283
|
}
|
|
276
|
-
var PageQueryStateContainer =
|
|
284
|
+
var PageQueryStateContainer = React8__default.default.forwardRef(PageQueryStateContainerInner);
|
|
277
285
|
function PageSidebar({ children, ...props }) {
|
|
278
|
-
return /* @__PURE__ */ jsx("div", { w: "112", minW: "112", minH: "100%", gap: "8", dflex: true, flexCol: true, ...props, children });
|
|
286
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { w: "112", minW: "112", minH: "100%", gap: "8", dflex: true, flexCol: true, ...props, children });
|
|
279
287
|
}
|
|
280
288
|
function PageSectionTitle({ children, ...props }) {
|
|
281
|
-
return /* @__PURE__ */ jsx("div", { trait: "typo.h6", mb: "5", ...props, children });
|
|
289
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { trait: "typo.h6", mb: "5", ...props, children });
|
|
282
290
|
}
|
|
283
291
|
function PageSidebarSection({ title, children, ...props }) {
|
|
284
|
-
return /* @__PURE__ */ jsxs("div", { w: "full", ...props, children: [
|
|
285
|
-
title && /* @__PURE__ */ jsx(PageSectionTitle, { children: title }),
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { w: "full", ...props, children: [
|
|
293
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(PageSectionTitle, { children: title }),
|
|
286
294
|
children
|
|
287
295
|
] });
|
|
288
296
|
}
|
|
289
297
|
function PageTitle({ children, ...props }) {
|
|
290
|
-
return /* @__PURE__ */ jsx("div", { trait: "typo.h5", ...props, children });
|
|
298
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { trait: "typo.h5", ...props, children });
|
|
291
299
|
}
|
|
292
300
|
function PageTopBar({ title, breadcrumbs, children, ...props }) {
|
|
293
|
-
return /* @__PURE__ */ jsxs(FlexCenter, { gap: "3", minH: "9", ...props, children: [
|
|
294
|
-
title && /* @__PURE__ */ jsx(PageTitle, { children: title }),
|
|
295
|
-
breadcrumbs && /* @__PURE__ */ jsx(Breadcrumbs, { breadcrumbs }),
|
|
296
|
-
/* @__PURE__ */ jsx("div", { flexGrow: true }),
|
|
301
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(components.FlexCenter, { gap: "3", minH: "9", ...props, children: [
|
|
302
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(PageTitle, { children: title }),
|
|
303
|
+
breadcrumbs && /* @__PURE__ */ jsxRuntime.jsx(Breadcrumbs, { breadcrumbs }),
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { flexGrow: true }),
|
|
297
305
|
children
|
|
298
306
|
] });
|
|
299
307
|
}
|
|
300
|
-
var [CP, usePageTabbedTopBarContext] = createContext();
|
|
308
|
+
var [CP, usePageTabbedTopBarContext] = react.createContext();
|
|
301
309
|
function PageTabbedTopBarProvider({ children }) {
|
|
302
|
-
const [containerEl, setContainerEl] =
|
|
303
|
-
|
|
304
|
-
return /* @__PURE__ */ jsx(CP, { value: { containerEl, setContainerEl }, children });
|
|
310
|
+
const [containerEl, setContainerEl] = React8__default.default.useState(null);
|
|
311
|
+
React8__default.default.createRef();
|
|
312
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CP, { value: { containerEl, setContainerEl }, children });
|
|
305
313
|
}
|
|
306
314
|
function PageTabbedTopBar({ title, breadcrumbs, children, ...props }) {
|
|
307
|
-
const ref =
|
|
315
|
+
const ref = React8__default.default.createRef();
|
|
308
316
|
const { setContainerEl } = usePageTabbedTopBarContext();
|
|
309
|
-
const [isSet, setIsSet] =
|
|
310
|
-
|
|
317
|
+
const [isSet, setIsSet] = React8__default.default.useState(false);
|
|
318
|
+
React8__default.default.useEffect(() => {
|
|
311
319
|
if (!isSet && ref.current) {
|
|
312
320
|
setContainerEl(ref.current);
|
|
313
321
|
setIsSet(true);
|
|
314
322
|
}
|
|
315
323
|
return () => setContainerEl(null);
|
|
316
324
|
}, []);
|
|
317
|
-
return /* @__PURE__ */ jsx(FlexCenter, { gap: "3", minH: "9", ...props, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
318
|
-
title && /* @__PURE__ */ jsx(PageTitle, { children: title }),
|
|
319
|
-
breadcrumbs && /* @__PURE__ */ jsx(Breadcrumbs, { breadcrumbs }),
|
|
320
|
-
/* @__PURE__ */ jsx("div", { flexGrow: true }),
|
|
321
|
-
/* @__PURE__ */ jsx("div", { ref, dflex: true, flexRow: true, gap: "3" }),
|
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components.FlexCenter, { gap: "3", minH: "9", ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
326
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(PageTitle, { children: title }),
|
|
327
|
+
breadcrumbs && /* @__PURE__ */ jsxRuntime.jsx(Breadcrumbs, { breadcrumbs }),
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { flexGrow: true }),
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref, dflex: true, flexRow: true, gap: "3" }),
|
|
322
330
|
children
|
|
323
331
|
] }) });
|
|
324
332
|
}
|
|
325
333
|
function PageTopBarToolbar({ trackingRef, children }) {
|
|
326
334
|
const { containerEl } = usePageTabbedTopBarContext();
|
|
327
|
-
const [visible, setVisible] =
|
|
328
|
-
const portal =
|
|
335
|
+
const [visible, setVisible] = React8__default.default.useState(false);
|
|
336
|
+
const portal = React8__default.default.useMemo(() => {
|
|
329
337
|
const node = containerEl;
|
|
330
338
|
return node;
|
|
331
339
|
}, [containerEl]);
|
|
332
340
|
const host = containerEl ?? (typeof window !== "undefined" ? document.body : void 0);
|
|
333
|
-
|
|
341
|
+
React8__default.default.useLayoutEffect(() => {
|
|
334
342
|
if (!portal || !host)
|
|
335
343
|
return;
|
|
336
344
|
try {
|
|
@@ -347,10 +355,10 @@ function PageTopBarToolbar({ trackingRef, children }) {
|
|
|
347
355
|
}
|
|
348
356
|
};
|
|
349
357
|
}, [visible, portal, host]);
|
|
350
|
-
const callback =
|
|
358
|
+
const callback = React8__default.default.useCallback((entries) => {
|
|
351
359
|
setVisible(entries[0].isVisible);
|
|
352
360
|
}, [children]);
|
|
353
|
-
|
|
361
|
+
React8__default.default.useEffect(() => {
|
|
354
362
|
const opts = {
|
|
355
363
|
root: null,
|
|
356
364
|
rootMargin: "0px",
|
|
@@ -365,47 +373,47 @@ function PageTopBarToolbar({ trackingRef, children }) {
|
|
|
365
373
|
return () => observerScroll.disconnect();
|
|
366
374
|
}, [trackingRef, callback, children]);
|
|
367
375
|
if (host && portal)
|
|
368
|
-
return createPortal(children, portal);
|
|
376
|
+
return reactDom.createPortal(children, portal);
|
|
369
377
|
return null;
|
|
370
378
|
}
|
|
371
379
|
function ScreenTopBar({ tabbed, breadcrumbs, api, item, isLoading, buttonBar, trackingRef }) {
|
|
372
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
373
|
-
tabbed && /* @__PURE__ */ jsx(PageTopBarToolbar, { trackingRef, children: /* @__PURE__ */ jsx(Buttons, { api, item, isLoading, buttonBar }) }),
|
|
374
|
-
!tabbed && /* @__PURE__ */ jsx(PageTopBar, { breadcrumbs, children: /* @__PURE__ */ jsx(Buttons, { api, item, isLoading, buttonBar }) })
|
|
380
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
381
|
+
tabbed && /* @__PURE__ */ jsxRuntime.jsx(PageTopBarToolbar, { trackingRef, children: /* @__PURE__ */ jsxRuntime.jsx(Buttons, { api, item, isLoading, buttonBar }) }),
|
|
382
|
+
!tabbed && /* @__PURE__ */ jsxRuntime.jsx(PageTopBar, { breadcrumbs, children: /* @__PURE__ */ jsxRuntime.jsx(Buttons, { api, item, isLoading, buttonBar }) })
|
|
375
383
|
] });
|
|
376
384
|
}
|
|
377
385
|
function Buttons({ api, item, isLoading, buttonBar }) {
|
|
378
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
379
|
-
buttonBar && buttonBar.length > 0 && /* @__PURE__ */ jsx(ButtonBar, { children: buttonBar.map((button, index) => /* @__PURE__ */ jsxs(
|
|
380
|
-
button.type === "link" && /* @__PURE__ */ jsx(ViewButton, { label: button.label, path: button.path, icon: button.icon }),
|
|
381
|
-
button.type === "invalidate" && /* @__PURE__ */ jsx(InvalidateButton, { pathOrPermalink: button.pathOrPermalink }),
|
|
386
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
387
|
+
buttonBar && buttonBar.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ButtonBar, { children: buttonBar.map((button, index) => /* @__PURE__ */ jsxRuntime.jsxs(React8__default.default.Fragment, { children: [
|
|
388
|
+
button.type === "link" && /* @__PURE__ */ jsxRuntime.jsx(ViewButton, { label: button.label, path: button.path, icon: button.icon }),
|
|
389
|
+
button.type === "invalidate" && /* @__PURE__ */ jsxRuntime.jsx(InvalidateButton, { pathOrPermalink: button.pathOrPermalink }),
|
|
382
390
|
button.type == "custom" && button.render(item)
|
|
383
391
|
] }, index)) }),
|
|
384
|
-
/* @__PURE__ */ jsxs(ButtonBar, { children: [
|
|
385
|
-
api instanceof API && /* @__PURE__ */ jsx(PublishButton, { api, queryId: item.id, status: item.status, disabled: isLoading }),
|
|
386
|
-
/* @__PURE__ */ jsx(UpdateButton, { disabled: isLoading })
|
|
392
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ButtonBar, { children: [
|
|
393
|
+
api instanceof adminApi.API && /* @__PURE__ */ jsxRuntime.jsx(PublishButton, { api, queryId: item.id, status: item.status, disabled: isLoading }),
|
|
394
|
+
/* @__PURE__ */ jsxRuntime.jsx(UpdateButton, { disabled: isLoading })
|
|
387
395
|
] })
|
|
388
396
|
] });
|
|
389
397
|
}
|
|
390
398
|
function useQueryField(queryField, useNextRouter) {
|
|
391
399
|
if (useNextRouter) {
|
|
392
|
-
const router = useRouter();
|
|
393
|
-
return router.query[queryField];
|
|
400
|
+
const router$1 = router.useRouter();
|
|
401
|
+
return router$1.query[queryField];
|
|
394
402
|
}
|
|
395
|
-
const { [queryField]: id } = useParams();
|
|
403
|
+
const { [queryField]: id } = reactRouterDom.useParams();
|
|
396
404
|
return id;
|
|
397
405
|
}
|
|
398
406
|
function DetailsView({ queryField, api, useNextRouter, processInput, screen, tabbed, ...props }) {
|
|
399
407
|
const id = useQueryField(queryField, useNextRouter);
|
|
400
|
-
const ref =
|
|
401
|
-
return /* @__PURE__ */ jsx(PageQueryStateContainer, { api, apiFn: "get", queryId: id, ref, p: "5", ...props, children: (item) => /* @__PURE__ */ jsx(Internal, { item, screen, api, tabbed, processInput, containerRef: ref }) });
|
|
408
|
+
const ref = React8__default.default.useRef(null);
|
|
409
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageQueryStateContainer, { api, apiFn: "get", queryId: id, ref, p: "5", ...props, children: (item) => /* @__PURE__ */ jsxRuntime.jsx(Internal, { item, screen, api, tabbed, processInput, containerRef: ref }) });
|
|
402
410
|
}
|
|
403
|
-
function Internal({ item, screen, api, processInput, tabbed, containerRef }) {
|
|
404
|
-
const pScreen = runIfFn(screen, item);
|
|
411
|
+
function Internal({ item, screen, api: api$1, processInput, tabbed, containerRef }) {
|
|
412
|
+
const pScreen = react.runIfFn(screen, item);
|
|
405
413
|
const { breadcrumbs, schema, initialValues, header, sections, buttonBar, type, invalidateParentQueryKey, invalidatePage } = pScreen;
|
|
406
|
-
const mutation = useInvalidateParentMutation(api.update, invalidateParentQueryKey ?? api.queryKey, { networkMode: "always" });
|
|
407
|
-
const invalidatePageFn = useInvalidatePage(invalidatePage || "");
|
|
408
|
-
const save = useMutate(mutation, {
|
|
414
|
+
const mutation = api.useInvalidateParentMutation(api$1.update, invalidateParentQueryKey ?? api$1.queryKey, { networkMode: "always" });
|
|
415
|
+
const invalidatePageFn = adminApi.useInvalidatePage(invalidatePage || "");
|
|
416
|
+
const save = api.useMutate(mutation, {
|
|
409
417
|
processInput,
|
|
410
418
|
successMsg: (item2, values) => `${item2.title || item2.name} updated.`,
|
|
411
419
|
errorMsg: (error, item2) => `Error updating ${item2.title || item2.name}: ${error}`,
|
|
@@ -419,19 +427,19 @@ function Internal({ item, screen, api, processInput, tabbed, containerRef }) {
|
|
|
419
427
|
editorMaxW = "calc(1280px - 28rem)";
|
|
420
428
|
else if (type == "section")
|
|
421
429
|
editorMaxW = "calc(1280px - 22rem)";
|
|
422
|
-
return /* @__PURE__ */ jsxs(
|
|
423
|
-
FormProvider,
|
|
430
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
431
|
+
form.FormProvider,
|
|
424
432
|
{
|
|
425
|
-
initialValues: runIfFn(initialValues, item),
|
|
433
|
+
initialValues: react.runIfFn(initialValues, item),
|
|
426
434
|
validationSchema: schema,
|
|
427
435
|
onSubmit: save,
|
|
428
436
|
enableReinitialize: true,
|
|
429
437
|
children: [
|
|
430
|
-
/* @__PURE__ */ jsx(
|
|
438
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
431
439
|
ScreenTopBar,
|
|
432
440
|
{
|
|
433
441
|
tabbed,
|
|
434
|
-
api,
|
|
442
|
+
api: api$1,
|
|
435
443
|
breadcrumbs,
|
|
436
444
|
buttonBar,
|
|
437
445
|
item,
|
|
@@ -439,15 +447,15 @@ function Internal({ item, screen, api, processInput, tabbed, containerRef }) {
|
|
|
439
447
|
trackingRef: containerRef?.current
|
|
440
448
|
}
|
|
441
449
|
),
|
|
442
|
-
type == "form" && sections?.map((section, index) => /* @__PURE__ */ jsx(Section, { section, item }, index)),
|
|
443
|
-
(pScreen.type == "post" || pScreen.type == "section") && /* @__PURE__ */ jsx("div", { p: "5", bgColor: "slate-100", rounded: "lg", children: /* @__PURE__ */ jsxs(PageContainer, { w: editorMaxW ? "auto" : "full", size: "x2", id: "pagecontainer", children: [
|
|
450
|
+
type == "form" && sections?.map((section, index) => /* @__PURE__ */ jsxRuntime.jsx(Section, { section, item }, index)),
|
|
451
|
+
(pScreen.type == "post" || pScreen.type == "section") && /* @__PURE__ */ jsxRuntime.jsx("div", { p: "5", bgColor: "slate-100", rounded: "lg", children: /* @__PURE__ */ jsxRuntime.jsxs(PageContainer, { w: editorMaxW ? "auto" : "full", size: "x2", id: "pagecontainer", children: [
|
|
444
452
|
header,
|
|
445
|
-
/* @__PURE__ */ jsxs("div", { dflex: true, gap: "5", children: [
|
|
446
|
-
/* @__PURE__ */ jsxs("div", { dflex: true, flexCol: true, gap: "8", flexGrow: true, children: [
|
|
453
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, gap: "5", children: [
|
|
454
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, flexCol: true, gap: "8", flexGrow: true, children: [
|
|
447
455
|
pScreen.editor?.type != "textarea" && // TODO Find a way to make this editor shrink in width when resizing the window...
|
|
448
|
-
/* @__PURE__ */ jsx(PageContentEditor, { name: "content", maxW: editorMaxW, minW: "144", shadow: true, rounded: "lg" }),
|
|
449
|
-
pScreen.editor?.type == "textarea" && /* @__PURE__ */ jsx(
|
|
450
|
-
TextArea,
|
|
456
|
+
/* @__PURE__ */ jsxRuntime.jsx(PageContentEditor, { name: "content", maxW: editorMaxW, minW: "144", shadow: true, rounded: "lg" }),
|
|
457
|
+
pScreen.editor?.type == "textarea" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
458
|
+
form.TextArea,
|
|
451
459
|
{
|
|
452
460
|
name: pScreen.editor?.name,
|
|
453
461
|
maxW: editorMaxW,
|
|
@@ -464,7 +472,7 @@ function Internal({ item, screen, api, processInput, tabbed, containerRef }) {
|
|
|
464
472
|
),
|
|
465
473
|
pScreen.editorFooter
|
|
466
474
|
] }),
|
|
467
|
-
/* @__PURE__ */ jsx(PageSidebar, { children: sections?.map((section, index) => /* @__PURE__ */ jsx(Section, { section, item, cardStyle: true }, index)) })
|
|
475
|
+
/* @__PURE__ */ jsxRuntime.jsx(PageSidebar, { children: sections?.map((section, index) => /* @__PURE__ */ jsxRuntime.jsx(Section, { section, item, cardStyle: true }, index)) })
|
|
468
476
|
] })
|
|
469
477
|
] }) })
|
|
470
478
|
]
|
|
@@ -480,21 +488,21 @@ function Section({ section, item, cardStyle }) {
|
|
|
480
488
|
textSize: "sm",
|
|
481
489
|
shadow: true
|
|
482
490
|
} : {};
|
|
483
|
-
return /* @__PURE__ */ jsx(PageSidebarSection, { title: section.title, ...style, children: /* @__PURE__ */ jsx(FormRenderer, { form: runIfFn(section.form, item) }) });
|
|
491
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageSidebarSection, { title: section.title, ...style, children: /* @__PURE__ */ jsxRuntime.jsx(form.FormRenderer, { form: react.runIfFn(section.form, item) }) });
|
|
484
492
|
}
|
|
485
493
|
if (section.type === "custom")
|
|
486
|
-
return runIfFn(section.component, item);
|
|
494
|
+
return react.runIfFn(section.component, item);
|
|
487
495
|
return null;
|
|
488
496
|
}
|
|
489
497
|
function useApi(api, queryField) {
|
|
490
|
-
const params = useParams();
|
|
498
|
+
const params = reactRouterDom.useParams();
|
|
491
499
|
if (queryField === void 0)
|
|
492
500
|
return { id: void 0, api };
|
|
493
501
|
const { [queryField]: id } = params;
|
|
494
|
-
return { id, api: runIfFn(api, id) };
|
|
502
|
+
return { id, api: react.runIfFn(api, id) };
|
|
495
503
|
}
|
|
496
504
|
function QueryWrapper({
|
|
497
|
-
api,
|
|
505
|
+
api: api$1,
|
|
498
506
|
queryField,
|
|
499
507
|
fn,
|
|
500
508
|
transformFn,
|
|
@@ -502,9 +510,9 @@ function QueryWrapper({
|
|
|
502
510
|
tabbed,
|
|
503
511
|
...props
|
|
504
512
|
}) {
|
|
505
|
-
const { id, api: mApi } = useApi(api, queryField);
|
|
506
|
-
const { data } = useApiQuery(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, isFunction(api) ? void 0 : id);
|
|
507
|
-
const transformedData =
|
|
513
|
+
const { id, api: mApi } = useApi(api$1, queryField);
|
|
514
|
+
const { data } = api.useApiQuery(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, react.isFunction(api$1) ? void 0 : id);
|
|
515
|
+
const transformedData = React8__default.default.useMemo(() => {
|
|
508
516
|
if (data && (fn === "getTransformed" || fn === "getAllTransformed")) {
|
|
509
517
|
if (!transformFn)
|
|
510
518
|
console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${fn}`);
|
|
@@ -514,11 +522,11 @@ function QueryWrapper({
|
|
|
514
522
|
}, [data]);
|
|
515
523
|
if (!data)
|
|
516
524
|
return null;
|
|
517
|
-
return /* @__PURE__ */ jsx(ScreenRenderer, { config: config(transformedData), tabbed, ...props });
|
|
525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScreenRenderer, { config: config(transformedData), tabbed, ...props });
|
|
518
526
|
}
|
|
519
527
|
function TabbedView({ queryField, api, screen, ...props }) {
|
|
520
|
-
const { [queryField]: id } = useParams();
|
|
521
|
-
return /* @__PURE__ */ jsx(
|
|
528
|
+
const { [queryField]: id } = reactRouterDom.useParams();
|
|
529
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
522
530
|
PageQueryStateContainer,
|
|
523
531
|
{
|
|
524
532
|
queryId: id,
|
|
@@ -526,18 +534,18 @@ function TabbedView({ queryField, api, screen, ...props }) {
|
|
|
526
534
|
apiFn: "get",
|
|
527
535
|
p: "5",
|
|
528
536
|
children: (city) => {
|
|
529
|
-
const { breadcrumbs, tabs } = runIfFn(screen, city);
|
|
530
|
-
return /* @__PURE__ */ jsxs(PageTabbedTopBarProvider, { children: [
|
|
531
|
-
/* @__PURE__ */ jsx(PageTabbedTopBar, { breadcrumbs, mb: "-3" }),
|
|
532
|
-
/* @__PURE__ */ jsx(
|
|
533
|
-
TabContainer,
|
|
537
|
+
const { breadcrumbs, tabs } = react.runIfFn(screen, city);
|
|
538
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PageTabbedTopBarProvider, { children: [
|
|
539
|
+
/* @__PURE__ */ jsxRuntime.jsx(PageTabbedTopBar, { breadcrumbs, mb: "-3" }),
|
|
540
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
541
|
+
components.TabContainer,
|
|
534
542
|
{
|
|
535
543
|
tabs: tabs.map((tab) => tab.label),
|
|
536
544
|
saveKey: `tab-${id}`,
|
|
537
545
|
mt: "-3",
|
|
538
546
|
mb: "3",
|
|
539
547
|
id: "fff",
|
|
540
|
-
children: tabs.map((tab, index) => /* @__PURE__ */ jsx(TabView, { tab }, index))
|
|
548
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ jsxRuntime.jsx(TabView, { tab }, index))
|
|
541
549
|
}
|
|
542
550
|
)
|
|
543
551
|
] });
|
|
@@ -550,18 +558,18 @@ function TabView({ tab }) {
|
|
|
550
558
|
throw new Error(`Screen config for tabbed view: one of your tabs does not have a component or config declared: ${tab.label}`);
|
|
551
559
|
if (tab.component)
|
|
552
560
|
return tab.component();
|
|
553
|
-
return /* @__PURE__ */ jsx(ScreenRenderer, { config: tab.config, tabbed: true, p: "0" });
|
|
561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScreenRenderer, { config: tab.config, tabbed: true, p: "0" });
|
|
554
562
|
}
|
|
555
|
-
var [provider, useContext] = createContext();
|
|
563
|
+
var [provider, useContext] = react.createContext();
|
|
556
564
|
function getColId(column) {
|
|
557
565
|
return column.accessorKey ?? column.id;
|
|
558
566
|
}
|
|
559
567
|
function TableContainerContextProvider({ initialVisibleColumns, columns, children }) {
|
|
560
|
-
const [showFilters, setShowFilters] =
|
|
561
|
-
const [showMassActions, setShowMassActions] =
|
|
562
|
-
const [visibleColumnIds, setVisibleColumnIds] =
|
|
568
|
+
const [showFilters, setShowFilters] = React8__default.default.useState(false);
|
|
569
|
+
const [showMassActions, setShowMassActions] = React8__default.default.useState(false);
|
|
570
|
+
const [visibleColumnIds, setVisibleColumnIds] = React8__default.default.useState(initialVisibleColumns ?? columns?.map((col) => getColId(col)) ?? []);
|
|
563
571
|
const filteredColumns = columns?.filter((col) => visibleColumnIds.includes(getColId(col))) ?? [];
|
|
564
|
-
const toggleColumnVisibility =
|
|
572
|
+
const toggleColumnVisibility = React8__default.default.useCallback((id) => {
|
|
565
573
|
const index = visibleColumnIds.indexOf(id);
|
|
566
574
|
if (index > -1) {
|
|
567
575
|
const newIds = visibleColumnIds.concat();
|
|
@@ -571,7 +579,7 @@ function TableContainerContextProvider({ initialVisibleColumns, columns, childre
|
|
|
571
579
|
setVisibleColumnIds(visibleColumnIds.concat(id));
|
|
572
580
|
}
|
|
573
581
|
}, [visibleColumnIds, setVisibleColumnIds]);
|
|
574
|
-
const isColumnVisible =
|
|
582
|
+
const isColumnVisible = React8__default.default.useCallback((id) => {
|
|
575
583
|
return visibleColumnIds.includes(id);
|
|
576
584
|
}, [visibleColumnIds]);
|
|
577
585
|
const Provider = provider;
|
|
@@ -585,29 +593,29 @@ function TableContainerContextProvider({ initialVisibleColumns, columns, childre
|
|
|
585
593
|
toggleColumnVisibility,
|
|
586
594
|
isColumnVisible
|
|
587
595
|
};
|
|
588
|
-
return /* @__PURE__ */ jsx(Provider, { value, children });
|
|
596
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Provider, { value, children });
|
|
589
597
|
}
|
|
590
598
|
function TableContainer({ initialPageSize, initialVisibleColumns, columns, filtersMethod = "reactRouter", children, ...props }) {
|
|
591
|
-
return /* @__PURE__ */ jsx("div", { w: "full", dflex: true, flexCol: true, ...props, children: /* @__PURE__ */ jsx(TableContextProvider, { initialPageSize, filtersMethod, children: /* @__PURE__ */ jsx(TableContainerContextProvider, { columns, initialVisibleColumns, children }) }) });
|
|
599
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { w: "full", dflex: true, flexCol: true, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(table.TableContextProvider, { initialPageSize, filtersMethod, children: /* @__PURE__ */ jsxRuntime.jsx(TableContainerContextProvider, { columns, initialVisibleColumns, children }) }) });
|
|
592
600
|
}
|
|
593
601
|
function TableCreateButton({ icon, children, ...props }) {
|
|
594
|
-
return /* @__PURE__ */ jsxs(ButtonBarDialogButton, { ...props, children: [
|
|
595
|
-
/* @__PURE__ */ jsx(Icon, { path: icon ?? mdiPlusThick }),
|
|
602
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ButtonBarDialogButton, { ...props, children: [
|
|
603
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon ?? js.mdiPlusThick }),
|
|
596
604
|
children
|
|
597
605
|
] });
|
|
598
606
|
}
|
|
599
607
|
function TableFilterButton({ ...props }) {
|
|
600
|
-
return /* @__PURE__ */ jsxs(Popover, { side: "bottom-end", modal: true, children: [
|
|
601
|
-
/* @__PURE__ */ jsx(Button, { scheme: "dark", size: "sm", aspectRatio: "square", variant: "borderless", corners: "square", ...props, children: /* @__PURE__ */ jsx(Icon, { path: mdiFilter }) }),
|
|
602
|
-
/* @__PURE__ */ jsxs("div", { bgColor: "white", rounded: true, shadow: true, children: [
|
|
603
|
-
/* @__PURE__ */ jsx("div", { py: "3", hover_bgColor: "#ff0000", px: "5", hover_textColor: "white", children: "First Item" }),
|
|
604
|
-
/* @__PURE__ */ jsx("div", { py: "3", hover_bgColor: "#ff0000", px: "5", hover_textColor: "white", children: "Second Item" }),
|
|
605
|
-
/* @__PURE__ */ jsx("div", { py: "3", hover_bgColor: "#ff0000", px: "5", hover_textColor: "white", children: "Third Item" })
|
|
608
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { side: "bottom-end", modal: true, children: [
|
|
609
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { scheme: "dark", size: "sm", aspectRatio: "square", variant: "borderless", corners: "square", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiFilter }) }),
|
|
610
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { bgColor: "white", rounded: true, shadow: true, children: [
|
|
611
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { py: "3", hover_bgColor: "#ff0000", px: "5", hover_textColor: "white", children: "First Item" }),
|
|
612
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { py: "3", hover_bgColor: "#ff0000", px: "5", hover_textColor: "white", children: "Second Item" }),
|
|
613
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { py: "3", hover_bgColor: "#ff0000", px: "5", hover_textColor: "white", children: "Third Item" })
|
|
606
614
|
] })
|
|
607
615
|
] });
|
|
608
616
|
}
|
|
609
617
|
function TableTopBar({ title, breadcrumbs, children, ...props }) {
|
|
610
|
-
return /* @__PURE__ */ jsxs(
|
|
618
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
611
619
|
"div",
|
|
612
620
|
{
|
|
613
621
|
dflex: true,
|
|
@@ -617,53 +625,53 @@ function TableTopBar({ title, breadcrumbs, children, ...props }) {
|
|
|
617
625
|
p: "8",
|
|
618
626
|
...props,
|
|
619
627
|
children: [
|
|
620
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
621
|
-
title && /* @__PURE__ */ jsx("h2", { textSize: "x2", fontWeight: "600", textColor: "#3f4254", textTransform: "capitalize", children: title }),
|
|
622
|
-
breadcrumbs && /* @__PURE__ */ jsx(Breadcrumbs, { breadcrumbs })
|
|
628
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
629
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h2", { textSize: "x2", fontWeight: "600", textColor: "#3f4254", textTransform: "capitalize", children: title }),
|
|
630
|
+
breadcrumbs && /* @__PURE__ */ jsxRuntime.jsx(Breadcrumbs, { breadcrumbs })
|
|
623
631
|
] }),
|
|
624
|
-
/* @__PURE__ */ jsx("div", { flexGrow: true, children: "\xA0" }),
|
|
632
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { flexGrow: true, children: "\xA0" }),
|
|
625
633
|
children
|
|
626
634
|
]
|
|
627
635
|
}
|
|
628
636
|
);
|
|
629
637
|
}
|
|
630
|
-
function TableFilters({ form, initialValues, schema, processInput }) {
|
|
638
|
+
function TableFilters({ form: form$1, initialValues, schema, processInput }) {
|
|
631
639
|
const { showFilters } = useContext();
|
|
632
|
-
const { getFilters, setFilters } = useTableContext();
|
|
633
|
-
const handleSubmit =
|
|
640
|
+
const { getFilters, setFilters } = table.useTableContext();
|
|
641
|
+
const handleSubmit = React8__default.default.useCallback((values, actions) => {
|
|
634
642
|
const params = processInput?.(values) ?? values;
|
|
635
|
-
if (!isEqual(params, getFilters()))
|
|
643
|
+
if (!esToolkit.isEqual(params, getFilters()))
|
|
636
644
|
setFilters(params);
|
|
637
645
|
actions.setSubmitting(false);
|
|
638
646
|
}, [setFilters, processInput]);
|
|
639
|
-
const handleReset =
|
|
647
|
+
const handleReset = React8__default.default.useCallback((resetForm) => {
|
|
640
648
|
setFilters(initialValues);
|
|
641
649
|
resetForm();
|
|
642
650
|
}, [setFilters, initialValues]);
|
|
643
|
-
|
|
644
|
-
return /* @__PURE__ */ jsx(Collapse, { in: showFilters, style: { overflow: showFilters ? "initial" : "hidden" }, children: /* @__PURE__ */ jsx("div", { p: "8", borderT: "px", borderB: "px", borderColor: "slate-100", children: /* @__PURE__ */ jsx(
|
|
645
|
-
FormProvider,
|
|
651
|
+
React8__default.default.useEffect(() => setFilters(initialValues), []);
|
|
652
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Collapse, { in: showFilters, style: { overflow: showFilters ? "initial" : "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { p: "8", borderT: "px", borderB: "px", borderColor: "slate-100", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
653
|
+
form.FormProvider,
|
|
646
654
|
{
|
|
647
|
-
initialValues: mergeInitialFormValues(getFilters(), initialValues),
|
|
655
|
+
initialValues: form.mergeInitialFormValues(getFilters(), initialValues),
|
|
648
656
|
onSubmit: handleSubmit,
|
|
649
657
|
validationSchema: schema,
|
|
650
658
|
enableReinitialize: true,
|
|
651
|
-
children: (props) => /* @__PURE__ */ jsxs("div", { dflex: true, gap: "3", placeContent: "start", children: [
|
|
652
|
-
/* @__PURE__ */ jsx(FormRenderer, { flexRow: true, w: "auto", form }),
|
|
653
|
-
/* @__PURE__ */ jsx(Buttons2, { handleReset: () => handleReset(props.resetForm) })
|
|
659
|
+
children: (props) => /* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, gap: "3", placeContent: "start", children: [
|
|
660
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormRenderer, { flexRow: true, w: "auto", form: form$1 }),
|
|
661
|
+
/* @__PURE__ */ jsxRuntime.jsx(Buttons2, { handleReset: () => handleReset(props.resetForm) })
|
|
654
662
|
] })
|
|
655
663
|
}
|
|
656
664
|
) }) });
|
|
657
665
|
}
|
|
658
666
|
function Buttons2({ handleReset }) {
|
|
659
|
-
return /* @__PURE__ */ jsxs("div", { dflex: true, gap: "3", children: [
|
|
660
|
-
/* @__PURE__ */ jsxs("div", { dflex: true, flexCol: true, children: [
|
|
661
|
-
/* @__PURE__ */ jsx(FieldLabel, { name: "", label: "\xA0" }),
|
|
662
|
-
/* @__PURE__ */ jsx(SubmitButton, { children: "Filter" })
|
|
667
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, gap: "3", children: [
|
|
668
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, flexCol: true, children: [
|
|
669
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FieldLabel, { name: "", label: "\xA0" }),
|
|
670
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.SubmitButton, { children: "Filter" })
|
|
663
671
|
] }),
|
|
664
|
-
/* @__PURE__ */ jsxs("div", { dflex: true, flexCol: true, children: [
|
|
665
|
-
/* @__PURE__ */ jsx(FieldLabel, { name: "", label: "\xA0" }),
|
|
666
|
-
/* @__PURE__ */ jsx(Button, { scheme: "neutral", onClick: handleReset, children: "Reset" })
|
|
672
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, flexCol: true, children: [
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FieldLabel, { name: "", label: "\xA0" }),
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { scheme: "neutral", onClick: handleReset, children: "Reset" })
|
|
667
675
|
] })
|
|
668
676
|
] });
|
|
669
677
|
}
|
|
@@ -677,16 +685,16 @@ function ActionButton({
|
|
|
677
685
|
errorMsg,
|
|
678
686
|
invalidateParent
|
|
679
687
|
}) {
|
|
680
|
-
const mutation = invalidateParent ? useInvalidateParentMutation(queryFn, queryKey) : useApiMutation(queryFn, queryKey);
|
|
681
|
-
const mutate = useMutate(
|
|
688
|
+
const mutation = invalidateParent ? api.useInvalidateParentMutation(queryFn, queryKey) : api.useApiMutation(queryFn, queryKey);
|
|
689
|
+
const mutate = api.useMutate(
|
|
682
690
|
mutation,
|
|
683
691
|
{
|
|
684
692
|
successMsg,
|
|
685
693
|
errorMsg
|
|
686
694
|
}
|
|
687
695
|
);
|
|
688
|
-
return /* @__PURE__ */ jsxs(
|
|
689
|
-
Button,
|
|
696
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
697
|
+
ui.Button,
|
|
690
698
|
{
|
|
691
699
|
display: "flex",
|
|
692
700
|
alignItems: "center",
|
|
@@ -695,16 +703,16 @@ function ActionButton({
|
|
|
695
703
|
onClick: mutate,
|
|
696
704
|
disabled: mutation.isLoading,
|
|
697
705
|
children: [
|
|
698
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon }),
|
|
706
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon }),
|
|
699
707
|
label
|
|
700
708
|
]
|
|
701
709
|
}
|
|
702
710
|
);
|
|
703
711
|
}
|
|
704
712
|
function TableMassActions({ actions }) {
|
|
705
|
-
const { ids } = useTableContext();
|
|
713
|
+
const { ids } = table.useTableContext();
|
|
706
714
|
const showMassActions = ids && ids.length > 0;
|
|
707
|
-
return /* @__PURE__ */ jsx(Collapse, { in: showMassActions, style: { overflow: showMassActions ? "initial" : "hidden" }, children: /* @__PURE__ */ jsx("div", { dflex: true, gap: "3", flexWrap: true, alignItems: "center", px: "8", pt: "5", children: actions.map((action, index) => /* @__PURE__ */ jsx("div", { children: action.type == "button" && !action.showConfirmationDialog && /* @__PURE__ */ jsx(ActionButton, { label: action.label, queryFn: action.queryFn, queryKey: action.queryKey, buttonProps: action.buttonProps }) }, index)) }) });
|
|
715
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Collapse, { in: showMassActions, style: { overflow: showMassActions ? "initial" : "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { dflex: true, gap: "3", flexWrap: true, alignItems: "center", px: "8", pt: "5", children: actions.map((action, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: action.type == "button" && !action.showConfirmationDialog && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { label: action.label, queryFn: action.queryFn, queryKey: action.queryKey, buttonProps: action.buttonProps }) }, index)) }) });
|
|
708
716
|
}
|
|
709
717
|
var defaultErrorMsg = "Oops, something went wrong...";
|
|
710
718
|
function nonNullValues(data) {
|
|
@@ -720,7 +728,7 @@ function ItemEditDialog({
|
|
|
720
728
|
initialValues,
|
|
721
729
|
itemLabel,
|
|
722
730
|
queryId = "",
|
|
723
|
-
api,
|
|
731
|
+
api: api$1,
|
|
724
732
|
queryFetchOptions,
|
|
725
733
|
querySaveOptions,
|
|
726
734
|
onSuccess,
|
|
@@ -737,41 +745,41 @@ function ItemEditDialog({
|
|
|
737
745
|
saveLabel,
|
|
738
746
|
size = "lg",
|
|
739
747
|
title,
|
|
740
|
-
form,
|
|
748
|
+
form: form$1,
|
|
741
749
|
show,
|
|
742
750
|
onClose,
|
|
743
751
|
formikProps,
|
|
744
752
|
...props
|
|
745
753
|
}) {
|
|
746
|
-
const { isInitialLoading, isFetching, data, isError, error, refetch } = useApiQuery(api.queryKey, api.get, queryId, {
|
|
754
|
+
const { isInitialLoading, isFetching, data, isError, error, refetch } = api.useApiQuery(api$1.queryKey, api$1.get, queryId, {
|
|
747
755
|
enabled: !/*queryId == 0 || */
|
|
748
756
|
(queryId == "" || queryId == null || queryId == void 0),
|
|
749
757
|
// means than this query is only enabled if the id is defined
|
|
750
758
|
onError: onFetchError,
|
|
751
759
|
...queryFetchOptions
|
|
752
760
|
});
|
|
753
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.upsert, invalidateQueryKey ?? api.queryKey, querySaveOptions) : useApiMutation(api.upsert, api.queryKey, queryId, querySaveOptions);
|
|
754
|
-
const retry =
|
|
755
|
-
const saveItem =
|
|
761
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(api$1.upsert, invalidateQueryKey ?? api$1.queryKey, querySaveOptions) : api.useApiMutation(api$1.upsert, api$1.queryKey, queryId, querySaveOptions);
|
|
762
|
+
const retry = React8__default.default.useCallback(() => refetch(), [refetch]);
|
|
763
|
+
const saveItem = React8__default.default.useCallback(async (item, actions) => {
|
|
756
764
|
mutation.reset();
|
|
757
765
|
const formItem = formToQueryData ? formToQueryData(item) : { ...item };
|
|
758
766
|
await mutation.mutateAsync(formItem).then((response) => {
|
|
759
767
|
if (onSuccess)
|
|
760
768
|
onSuccess(formItem, response);
|
|
761
769
|
else
|
|
762
|
-
toast.success(`${title ? title(formItem) : formItem.name ?? formItem.title} ${queryId ? "saved" : "created"}`);
|
|
770
|
+
reactToastify.toast.success(`${title ? title(formItem) : formItem.name ?? formItem.title} ${queryId ? "saved" : "created"}`);
|
|
763
771
|
onClose?.();
|
|
764
772
|
}).catch((error2) => {
|
|
765
773
|
console.error("on error", error2);
|
|
766
774
|
if (onSaveError)
|
|
767
775
|
onSaveError(item);
|
|
768
776
|
else
|
|
769
|
-
toast.error(`Couldn't save ${title ? title(formItem) : formItem.name ?? formItem.title}`);
|
|
777
|
+
reactToastify.toast.error(`Couldn't save ${title ? title(formItem) : formItem.name ?? formItem.title}`);
|
|
770
778
|
actions.setSubmitting(false);
|
|
771
779
|
});
|
|
772
780
|
}, [mutation, formToQueryData, onSuccess, onSaveError, onClose]);
|
|
773
|
-
return /* @__PURE__ */ jsxs(
|
|
774
|
-
Modal,
|
|
781
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
782
|
+
ui.Modal,
|
|
775
783
|
{
|
|
776
784
|
size,
|
|
777
785
|
show,
|
|
@@ -780,28 +788,28 @@ function ItemEditDialog({
|
|
|
780
788
|
transition: true,
|
|
781
789
|
...props,
|
|
782
790
|
children: [
|
|
783
|
-
/* @__PURE__ */ jsxs(Modal.Header, { children: [
|
|
791
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Header, { children: [
|
|
784
792
|
!isInitialLoading && queryId && `Edit ${title ? title(data) : data?.["name"] ?? data?.["title"] ?? data?.["name"] ?? ""}`,
|
|
785
793
|
!queryId && `Create new ${itemLabel ?? "item"}`,
|
|
786
|
-
Array.isArray(form) && /* @__PURE__ */ jsx(Fragment, {})
|
|
794
|
+
Array.isArray(form$1) && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
787
795
|
] }),
|
|
788
|
-
isInitialLoading && /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(QueryLoadingState, { minW: "72" }) }),
|
|
789
|
-
isError && /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(RetryOnError, { label: `${fetchErrorMsg} ${error}`, onClick: retry }) }),
|
|
790
|
-
!isInitialLoading && !isError && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
791
|
-
Formik,
|
|
796
|
+
isInitialLoading && /* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(components.QueryLoadingState, { minW: "72" }) }),
|
|
797
|
+
isError && /* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(components.RetryOnError, { label: `${fetchErrorMsg} ${error}`, onClick: retry }) }),
|
|
798
|
+
!isInitialLoading && !isError && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
799
|
+
formik.Formik,
|
|
792
800
|
{
|
|
793
801
|
initialValues: fetchToFormData && queryId && data ? fetchToFormData(nonNullValues(data)) : nonNullValues(initialValues(data)) ?? {},
|
|
794
802
|
onSubmit: saveItem,
|
|
795
803
|
...formikProps,
|
|
796
|
-
children: ({ setFieldValue, dirty, handleSubmit, isValid, values }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
797
|
-
/* @__PURE__ */ jsx(Modal.Body, { pb: "6", children: /* @__PURE__ */ jsxs(Form, { children: [
|
|
798
|
-
|
|
799
|
-
Array.isArray(form) && /* @__PURE__ */ jsx(FormRenderer, { form }),
|
|
800
|
-
isFunction(form) && /* @__PURE__ */ jsx(FormRenderer, { form: form(data ?? values) })
|
|
804
|
+
children: ({ setFieldValue, dirty, handleSubmit, isValid, values }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
805
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Body, { pb: "6", children: /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
806
|
+
React8__default.default.isValidElement(form$1) && form$1,
|
|
807
|
+
Array.isArray(form$1) && /* @__PURE__ */ jsxRuntime.jsx(form.FormRenderer, { form: form$1 }),
|
|
808
|
+
react.isFunction(form$1) && /* @__PURE__ */ jsxRuntime.jsx(form.FormRenderer, { form: form$1(data ?? values) })
|
|
801
809
|
] }) }),
|
|
802
|
-
/* @__PURE__ */ jsxs(Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
803
|
-
/* @__PURE__ */ jsx(
|
|
804
|
-
Button,
|
|
810
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
811
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
812
|
+
ui.Button,
|
|
805
813
|
{
|
|
806
814
|
disabled: mutation.isLoading,
|
|
807
815
|
onClick: onClose,
|
|
@@ -810,8 +818,8 @@ function ItemEditDialog({
|
|
|
810
818
|
children: cancelLabel
|
|
811
819
|
}
|
|
812
820
|
),
|
|
813
|
-
/* @__PURE__ */ jsx(
|
|
814
|
-
Button,
|
|
821
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
822
|
+
ui.Button,
|
|
815
823
|
{
|
|
816
824
|
type: "submit",
|
|
817
825
|
disabled: !dirty || mutation.isLoading,
|
|
@@ -823,19 +831,19 @@ function ItemEditDialog({
|
|
|
823
831
|
] })
|
|
824
832
|
}
|
|
825
833
|
) }),
|
|
826
|
-
mutation.isLoading && /* @__PURE__ */ jsx(ModalLoadingOverlay, {})
|
|
834
|
+
mutation.isLoading && /* @__PURE__ */ jsxRuntime.jsx(components.ModalLoadingOverlay, {})
|
|
827
835
|
]
|
|
828
836
|
}
|
|
829
837
|
);
|
|
830
838
|
}
|
|
831
|
-
function QueryWrapperDialog({ api, fn, transformFn, config, onClose, queryId, invalidateQueryKey }) {
|
|
832
|
-
const { data, isFetching } = useApiQuery(
|
|
833
|
-
api.queryKey,
|
|
834
|
-
fn === "get" || fn === "getTransformed" ? api.get : api.getAll,
|
|
839
|
+
function QueryWrapperDialog({ api: api$1, fn, transformFn, config, onClose, queryId, invalidateQueryKey }) {
|
|
840
|
+
const { data, isFetching } = api.useApiQuery(
|
|
841
|
+
api$1.queryKey,
|
|
842
|
+
fn === "get" || fn === "getTransformed" ? api$1.get : api$1.getAll,
|
|
835
843
|
void 0,
|
|
836
844
|
{ retryOnMount: false, refetchOnMount: false, refetchOnWindowFocus: false }
|
|
837
845
|
);
|
|
838
|
-
const transformedData =
|
|
846
|
+
const transformedData = React8__default.default.useMemo(() => {
|
|
839
847
|
if (data && (fn === "getTransformed" || fn === "getAllTransformed")) {
|
|
840
848
|
if (!transformFn)
|
|
841
849
|
console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${fn}`);
|
|
@@ -845,10 +853,10 @@ function QueryWrapperDialog({ api, fn, transformFn, config, onClose, queryId, in
|
|
|
845
853
|
}, [data, fn, transformFn]);
|
|
846
854
|
if (isFetching)
|
|
847
855
|
return null;
|
|
848
|
-
return /* @__PURE__ */ jsx(ItemEditDialog, { ...config(transformedData), queryId, invalidateQueryKey, show: true, onClose });
|
|
856
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemEditDialog, { ...config(transformedData), queryId, invalidateQueryKey, show: true, onClose });
|
|
849
857
|
}
|
|
850
858
|
function MultiQueryWrapperDialog({ queries, config, onClose, queryId, invalidateQueryKey }) {
|
|
851
|
-
const { data, isFetching, isError } = useApiQueries(queries.map((q) => ({
|
|
859
|
+
const { data, isFetching, isError } = api.useApiQueries(queries.map((q) => ({
|
|
852
860
|
queryKey: q.api.queryKey,
|
|
853
861
|
queryFn: q.fn == "get" ? q.api.get : q.api.getAll,
|
|
854
862
|
queryOptions: {
|
|
@@ -856,25 +864,25 @@ function MultiQueryWrapperDialog({ queries, config, onClose, queryId, invalidate
|
|
|
856
864
|
staleTime: q.cache === false ? 0 : void 0
|
|
857
865
|
}
|
|
858
866
|
})));
|
|
859
|
-
const transformedData =
|
|
867
|
+
const transformedData = React8__default.default.useMemo(() => {
|
|
860
868
|
return data?.map((d, index) => queries[index]?.transformFn ? queries[index]?.transformFn?.(d) : d);
|
|
861
869
|
}, [data, queries]);
|
|
862
|
-
return /* @__PURE__ */ jsx(ItemEditDialog, { isPreloading: isFetching, ...config(...transformedData), queryId, invalidateQueryKey, show: true, onClose });
|
|
870
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemEditDialog, { isPreloading: isFetching, ...config(...transformedData), queryId, invalidateQueryKey, show: true, onClose });
|
|
863
871
|
}
|
|
864
872
|
function DialogRenderer({ config, onClose, invalidateQueryKey, queryId }) {
|
|
865
873
|
const { type, ...props } = config;
|
|
866
874
|
if (config.type === "dialog")
|
|
867
|
-
return /* @__PURE__ */ jsx(ItemEditDialog, { ...props, queryId, invalidateQueryKey, show: true, onClose });
|
|
875
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemEditDialog, { ...props, queryId, invalidateQueryKey, show: true, onClose });
|
|
868
876
|
if (config.type === "query")
|
|
869
|
-
return /* @__PURE__ */ jsx(QueryWrapperDialog, { ...props, queryId, invalidateQueryKey, onClose });
|
|
877
|
+
return /* @__PURE__ */ jsxRuntime.jsx(QueryWrapperDialog, { ...props, queryId, invalidateQueryKey, onClose });
|
|
870
878
|
if (config.type === "multiQuery")
|
|
871
|
-
return /* @__PURE__ */ jsx(MultiQueryWrapperDialog, { ...props, queryId, invalidateQueryKey, onClose });
|
|
879
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MultiQueryWrapperDialog, { ...props, queryId, invalidateQueryKey, onClose });
|
|
872
880
|
return null;
|
|
873
881
|
}
|
|
874
882
|
function RefreshButton({ queryKey }) {
|
|
875
|
-
const invalidate = useInvalidateQuery(queryKey);
|
|
876
|
-
useHotkeys("ctrl+r", () => invalidate(), { preventDefault: true }, [invalidate]);
|
|
877
|
-
return /* @__PURE__ */ jsx(ButtonBarButton, { scheme: "dark", size: "sm", aspectRatio: "square", variant: "borderless", onClick: invalidate, children: /* @__PURE__ */ jsx(Icon, { path: mdiRefresh }) });
|
|
883
|
+
const invalidate = api.useInvalidateQuery(queryKey);
|
|
884
|
+
reactHotkeysHook.useHotkeys("ctrl+r", () => invalidate(), { preventDefault: true }, [invalidate]);
|
|
885
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ButtonBarButton, { scheme: "dark", size: "sm", aspectRatio: "square", variant: "borderless", onClick: invalidate, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: js.mdiRefresh }) });
|
|
878
886
|
}
|
|
879
887
|
function ItemDeleteDialog({
|
|
880
888
|
title,
|
|
@@ -882,7 +890,7 @@ function ItemDeleteDialog({
|
|
|
882
890
|
closeActionButtonLabel = "Cancel",
|
|
883
891
|
itemLabel,
|
|
884
892
|
queryId = "",
|
|
885
|
-
api,
|
|
893
|
+
api: api$1,
|
|
886
894
|
apiFn,
|
|
887
895
|
invalidateQueriesOnSuccess = true,
|
|
888
896
|
invalidateQueryKey,
|
|
@@ -894,15 +902,15 @@ function ItemDeleteDialog({
|
|
|
894
902
|
onSuccess,
|
|
895
903
|
...props
|
|
896
904
|
}) {
|
|
897
|
-
const fn = apiFn ? api[apiFn] : api.delete;
|
|
898
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(fn, invalidateQueryKey ?? api.queryKey) : useApiMutation(fn, api.queryKey);
|
|
899
|
-
const mutate = useMutate(mutation, { onSuccess: () => {
|
|
905
|
+
const fn = apiFn ? api$1[apiFn] : api$1.delete;
|
|
906
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey ?? api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
|
|
907
|
+
const mutate = api.useMutate(mutation, { onSuccess: () => {
|
|
900
908
|
onClose?.();
|
|
901
909
|
onSuccess?.();
|
|
902
910
|
} });
|
|
903
|
-
const handleDelete =
|
|
904
|
-
return /* @__PURE__ */ jsxs(
|
|
905
|
-
Modal,
|
|
911
|
+
const handleDelete = React8__default.default.useCallback(() => mutate(queryId), [mutate, queryId]);
|
|
912
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
913
|
+
ui.Modal,
|
|
906
914
|
{
|
|
907
915
|
size,
|
|
908
916
|
show,
|
|
@@ -912,14 +920,14 @@ function ItemDeleteDialog({
|
|
|
912
920
|
transition: true,
|
|
913
921
|
...props,
|
|
914
922
|
children: [
|
|
915
|
-
/* @__PURE__ */ jsx(Modal.Header, { children: title || `Delete ${itemLabel}` }),
|
|
916
|
-
/* @__PURE__ */ jsxs(Modal.Body, { pb: "6", children: [
|
|
923
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Header, { children: title || `Delete ${itemLabel}` }),
|
|
924
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Body, { pb: "6", children: [
|
|
917
925
|
!msg && `Do you really want to delete ${itemLabel}?`,
|
|
918
|
-
msg && runIfFn(msg, itemLabel)
|
|
926
|
+
msg && react.runIfFn(msg, itemLabel)
|
|
919
927
|
] }),
|
|
920
|
-
/* @__PURE__ */ jsxs(Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
921
|
-
/* @__PURE__ */ jsx(
|
|
922
|
-
Button,
|
|
928
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
929
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
930
|
+
ui.Button,
|
|
923
931
|
{
|
|
924
932
|
disabled: mutation.isPending,
|
|
925
933
|
onClick: onClose,
|
|
@@ -929,37 +937,37 @@ function ItemDeleteDialog({
|
|
|
929
937
|
children: closeActionButtonLabel
|
|
930
938
|
}
|
|
931
939
|
),
|
|
932
|
-
/* @__PURE__ */ jsx(Button, { scheme: "danger", disabled: mutation.isPending, onClick: handleDelete, children: actionButtonLabel || "Delete" })
|
|
940
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { scheme: "danger", disabled: mutation.isPending, onClick: handleDelete, children: actionButtonLabel || "Delete" })
|
|
933
941
|
] }),
|
|
934
|
-
mutation.isPending && /* @__PURE__ */ jsx(ModalLoadingOverlay, {})
|
|
942
|
+
mutation.isPending && /* @__PURE__ */ jsxRuntime.jsx(components.ModalLoadingOverlay, {})
|
|
935
943
|
]
|
|
936
944
|
}
|
|
937
945
|
);
|
|
938
946
|
}
|
|
939
|
-
var [provider2, useContext2] = createContext();
|
|
947
|
+
var [provider2, useContext2] = react.createContext();
|
|
940
948
|
function TableViewProvider({ editView, deleteItem, queryKey, children }) {
|
|
941
|
-
const openLink = useOpenLink();
|
|
942
|
-
const navigate = useNavigate();
|
|
943
|
-
const [dialog, setDialog] =
|
|
944
|
-
const onCloseDialog =
|
|
945
|
-
const onAction =
|
|
949
|
+
const openLink = hooks.useOpenLink();
|
|
950
|
+
const navigate = reactRouterDom.useNavigate();
|
|
951
|
+
const [dialog, setDialog] = React8__default.default.useState(null);
|
|
952
|
+
const onCloseDialog = React8__default.default.useCallback(() => setDialog(null), [setDialog]);
|
|
953
|
+
const onAction = React8__default.default.useCallback((action, item) => {
|
|
946
954
|
switch (action.type) {
|
|
947
955
|
case "view": {
|
|
948
|
-
navigate(runIfFn(action.path, item));
|
|
956
|
+
navigate(react.runIfFn(action.path, item));
|
|
949
957
|
break;
|
|
950
958
|
}
|
|
951
959
|
case "link": {
|
|
952
|
-
openLink(`${AppEnv.websiteUrl()}/${runIfFn(action.path, item)}`);
|
|
960
|
+
openLink(`${env.AppEnv.websiteUrl()}/${react.runIfFn(action.path, item)}`);
|
|
953
961
|
break;
|
|
954
962
|
}
|
|
955
963
|
case "edit": {
|
|
956
|
-
const editConfig = runIfFn(editView, item);
|
|
964
|
+
const editConfig = react.runIfFn(editView, item);
|
|
957
965
|
if (editConfig) {
|
|
958
966
|
if (editConfig.type == "customDialog") {
|
|
959
967
|
setDialog(editConfig.render({ show: true, onClose: onCloseDialog }));
|
|
960
968
|
} else {
|
|
961
969
|
setDialog(
|
|
962
|
-
/* @__PURE__ */ jsx(
|
|
970
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
963
971
|
DialogRenderer,
|
|
964
972
|
{
|
|
965
973
|
onClose: onCloseDialog,
|
|
@@ -974,9 +982,9 @@ function TableViewProvider({ editView, deleteItem, queryKey, children }) {
|
|
|
974
982
|
break;
|
|
975
983
|
}
|
|
976
984
|
case "delete": {
|
|
977
|
-
const deleteConfig = runIfFn(deleteItem, item);
|
|
985
|
+
const deleteConfig = react.runIfFn(deleteItem, item);
|
|
978
986
|
setDialog(
|
|
979
|
-
/* @__PURE__ */ jsx(
|
|
987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
980
988
|
ItemDeleteDialog,
|
|
981
989
|
{
|
|
982
990
|
show: true,
|
|
@@ -985,7 +993,7 @@ function TableViewProvider({ editView, deleteItem, queryKey, children }) {
|
|
|
985
993
|
invalidateQueryKey: queryKey,
|
|
986
994
|
msg: item.msg,
|
|
987
995
|
...deleteConfig,
|
|
988
|
-
itemLabel: runIfFn(deleteConfig.itemLabel, item)
|
|
996
|
+
itemLabel: react.runIfFn(deleteConfig.itemLabel, item)
|
|
989
997
|
}
|
|
990
998
|
)
|
|
991
999
|
);
|
|
@@ -998,22 +1006,22 @@ function TableViewProvider({ editView, deleteItem, queryKey, children }) {
|
|
|
998
1006
|
dialog,
|
|
999
1007
|
onAction
|
|
1000
1008
|
};
|
|
1001
|
-
return /* @__PURE__ */ jsx(Provider, { value, children });
|
|
1009
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Provider, { value, children });
|
|
1002
1010
|
}
|
|
1003
|
-
function TableRowPublishPostButton({ id, api, status, invalidateQueryKey, ...props }) {
|
|
1011
|
+
function TableRowPublishPostButton({ id, api: api$1, status, invalidateQueryKey, ...props }) {
|
|
1004
1012
|
const isDraft = status == "draft";
|
|
1005
|
-
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey ?? api.queryKey, { networkMode: "always" });
|
|
1006
|
-
const publish =
|
|
1013
|
+
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey ?? api$1.queryKey, { networkMode: "always" });
|
|
1014
|
+
const publish = React8__default.default.useCallback((event) => {
|
|
1007
1015
|
event?.preventDefault();
|
|
1008
1016
|
event?.stopPropagation();
|
|
1009
1017
|
mutation.reset();
|
|
1010
|
-
mutation.mutateAsync(id).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch((error) => toast.error(`Error: ${error}`));
|
|
1018
|
+
mutation.mutateAsync(id).then(() => reactToastify.toast.success(isDraft ? "Published!" : "Unpublished!")).catch((error) => reactToastify.toast.error(`Error: ${error}`));
|
|
1011
1019
|
}, [mutation, id]);
|
|
1012
|
-
return /* @__PURE__ */ jsx(Button, { variant: "borderless", corners: "square", scheme: "dark", onClick: publish, ...props, children: /* @__PURE__ */ jsx(Icon, { path: isDraft ? mdiPublish : mdiPublishOff, size: "sm" }) });
|
|
1020
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "borderless", corners: "square", scheme: "dark", onClick: publish, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: isDraft ? js.mdiPublish : js.mdiPublishOff, size: "sm" }) });
|
|
1013
1021
|
}
|
|
1014
1022
|
function TableRowActionButton({ icon, children, ...props }) {
|
|
1015
|
-
return /* @__PURE__ */ jsxs(
|
|
1016
|
-
Button,
|
|
1023
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1024
|
+
ui.Button,
|
|
1017
1025
|
{
|
|
1018
1026
|
dflex: true,
|
|
1019
1027
|
alignContent: "center",
|
|
@@ -1027,7 +1035,7 @@ function TableRowActionButton({ icon, children, ...props }) {
|
|
|
1027
1035
|
gap: "2",
|
|
1028
1036
|
...props,
|
|
1029
1037
|
children: [
|
|
1030
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon, size: "sm" }),
|
|
1038
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon, size: "sm" }),
|
|
1031
1039
|
children
|
|
1032
1040
|
]
|
|
1033
1041
|
}
|
|
@@ -1035,21 +1043,21 @@ function TableRowActionButton({ icon, children, ...props }) {
|
|
|
1035
1043
|
}
|
|
1036
1044
|
function TableRowActionsView({ row, onAction, rowActions, api, queryKey }) {
|
|
1037
1045
|
const item = row.original;
|
|
1038
|
-
return /* @__PURE__ */ jsx("div", { dflex: true, w: "full", alignItems: "stretch", placeContent: "end", h: "full", children: runIfFn(rowActions, item)?.map(
|
|
1039
|
-
(action, index) => /* @__PURE__ */ jsxs(
|
|
1040
|
-
action.type === "publish" && /* @__PURE__ */ jsx(TableRowPublishPostButton, { id: item.id, api: action.api ?? api, status: item.status, invalidateQueryKey: queryKey }),
|
|
1041
|
-
action.type == "custom" && /* @__PURE__ */ jsx(Fragment, { children: action.component(item, queryKey, action.icon, action.label) }),
|
|
1042
|
-
!["publish", "custom"].includes(action.type) && /* @__PURE__ */ jsx(ActionButton2, { onClick: () => onAction(action, item), scheme: schemes[action.type], children: /* @__PURE__ */ jsx(Icon, { path: icons[action.type], size: "sm" }) })
|
|
1046
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { dflex: true, w: "full", alignItems: "stretch", placeContent: "end", h: "full", children: react.runIfFn(rowActions, item)?.map(
|
|
1047
|
+
(action, index) => /* @__PURE__ */ jsxRuntime.jsxs(React8__default.default.Fragment, { children: [
|
|
1048
|
+
action.type === "publish" && /* @__PURE__ */ jsxRuntime.jsx(TableRowPublishPostButton, { id: item.id, api: action.api ?? api, status: item.status, invalidateQueryKey: queryKey }),
|
|
1049
|
+
action.type == "custom" && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: action.component(item, queryKey, action.icon, action.label) }),
|
|
1050
|
+
!["publish", "custom"].includes(action.type) && /* @__PURE__ */ jsxRuntime.jsx(ActionButton2, { onClick: () => onAction(action, item), scheme: schemes[action.type], children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icons[action.type], size: "sm" }) })
|
|
1043
1051
|
] }, index)
|
|
1044
1052
|
) });
|
|
1045
1053
|
}
|
|
1046
1054
|
function ActionButton2({ onClick, ...props }) {
|
|
1047
|
-
const handleClick =
|
|
1055
|
+
const handleClick = React8__default.default.useCallback((event) => {
|
|
1048
1056
|
event?.preventDefault();
|
|
1049
1057
|
event?.stopPropagation();
|
|
1050
1058
|
onClick?.(event);
|
|
1051
1059
|
}, [onClick]);
|
|
1052
|
-
return /* @__PURE__ */ jsx(
|
|
1060
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1053
1061
|
TableRowActionButton,
|
|
1054
1062
|
{
|
|
1055
1063
|
onClick: handleClick,
|
|
@@ -1058,11 +1066,11 @@ function ActionButton2({ onClick, ...props }) {
|
|
|
1058
1066
|
);
|
|
1059
1067
|
}
|
|
1060
1068
|
var icons = {
|
|
1061
|
-
"link": mdiOpenInNew,
|
|
1062
|
-
"view": mdiEye,
|
|
1063
|
-
"edit": mdiPencil,
|
|
1064
|
-
"delete": mdiDelete,
|
|
1065
|
-
"publish": mdiDelete,
|
|
1069
|
+
"link": js.mdiOpenInNew,
|
|
1070
|
+
"view": js.mdiEye,
|
|
1071
|
+
"edit": js.mdiPencil,
|
|
1072
|
+
"delete": js.mdiDelete,
|
|
1073
|
+
"publish": js.mdiDelete,
|
|
1066
1074
|
"custom": ""
|
|
1067
1075
|
};
|
|
1068
1076
|
var schemes = {
|
|
@@ -1074,39 +1082,39 @@ var schemes = {
|
|
|
1074
1082
|
"custom": "dark"
|
|
1075
1083
|
};
|
|
1076
1084
|
function useTableProps(api, table, rowActions, queryParams) {
|
|
1077
|
-
const navigate = useNavigate();
|
|
1078
|
-
const nextRouter = useRouter();
|
|
1079
|
-
const openLink = useOpenLink();
|
|
1085
|
+
const navigate = reactRouterDom.useNavigate();
|
|
1086
|
+
const nextRouter = router.useRouter();
|
|
1087
|
+
const openLink = hooks.useOpenLink();
|
|
1080
1088
|
const { onAction } = useContext2();
|
|
1081
1089
|
const { onRowClick, columns: c, ...props } = table;
|
|
1082
|
-
const onRowClickHandler =
|
|
1083
|
-
const config = runIfFn(onRowClick, item);
|
|
1090
|
+
const onRowClickHandler = React8__default.default.useCallback((item) => {
|
|
1091
|
+
const config = react.runIfFn(onRowClick, item);
|
|
1084
1092
|
if (config) {
|
|
1085
1093
|
switch (config.type) {
|
|
1086
1094
|
case "navigate": {
|
|
1087
|
-
navigate(runIfFn(config.path, item) ?? "");
|
|
1095
|
+
navigate(react.runIfFn(config.path, item) ?? "");
|
|
1088
1096
|
break;
|
|
1089
1097
|
}
|
|
1090
1098
|
case "nextpush": {
|
|
1091
|
-
nextRouter.push(runIfFn(config.path, item));
|
|
1099
|
+
nextRouter.push(react.runIfFn(config.path, item));
|
|
1092
1100
|
break;
|
|
1093
1101
|
}
|
|
1094
1102
|
case "link": {
|
|
1095
|
-
openLink(`${AppEnv.websiteUrl()}/${runIfFn(config.path, item)}`);
|
|
1103
|
+
openLink(`${env.AppEnv.websiteUrl()}/${react.runIfFn(config.path, item)}`);
|
|
1096
1104
|
break;
|
|
1097
1105
|
}
|
|
1098
1106
|
}
|
|
1099
1107
|
}
|
|
1100
1108
|
}, [navigate, onRowClick]);
|
|
1101
|
-
const columns =
|
|
1109
|
+
const columns = React8__default.default.useMemo(() => {
|
|
1102
1110
|
const columns2 = table.columns.concat([]);
|
|
1103
1111
|
if (rowActions) {
|
|
1104
1112
|
columns2.push(
|
|
1105
|
-
createColumnHelper().display(
|
|
1113
|
+
reactTable.createColumnHelper().display(
|
|
1106
1114
|
{
|
|
1107
1115
|
id: "actions",
|
|
1108
1116
|
header: "Actions",
|
|
1109
|
-
cell: (props2) => /* @__PURE__ */ jsx(TableRowActionsView, { row: props2.row, onAction, rowActions, api, queryKey: api.queryKey })
|
|
1117
|
+
cell: (props2) => /* @__PURE__ */ jsxRuntime.jsx(TableRowActionsView, { row: props2.row, onAction, rowActions, api, queryKey: api.queryKey })
|
|
1110
1118
|
}
|
|
1111
1119
|
)
|
|
1112
1120
|
);
|
|
@@ -1122,7 +1130,7 @@ function useTableProps(api, table, rowActions, queryParams) {
|
|
|
1122
1130
|
return tableProps;
|
|
1123
1131
|
}
|
|
1124
1132
|
function useId(queryField) {
|
|
1125
|
-
const params = useParams();
|
|
1133
|
+
const params = reactRouterDom.useParams();
|
|
1126
1134
|
if (queryField === void 0)
|
|
1127
1135
|
return void 0;
|
|
1128
1136
|
const { [queryField]: id } = params;
|
|
@@ -1130,16 +1138,16 @@ function useId(queryField) {
|
|
|
1130
1138
|
}
|
|
1131
1139
|
function TableView({ queryField, title, subtitle, screen, ...props }) {
|
|
1132
1140
|
const id = useId(queryField);
|
|
1133
|
-
const _screen = runIfFn(screen, id);
|
|
1134
|
-
return /* @__PURE__ */ jsx(PageContainer, { bgColor: "white", ...props, children: /* @__PURE__ */ jsx(TableContainer, { columns: _screen.table.columns, initialVisibleColumns: _screen.table.initialVisibleColumns, filtersMethod: _screen.table.filtersMethod, children: /* @__PURE__ */ jsx(TT, { id, title, subtitle, screen: _screen }) }) });
|
|
1141
|
+
const _screen = react.runIfFn(screen, id);
|
|
1142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PageContainer, { bgColor: "white", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(TableContainer, { columns: _screen.table.columns, initialVisibleColumns: _screen.table.initialVisibleColumns, filtersMethod: _screen.table.filtersMethod, children: /* @__PURE__ */ jsxRuntime.jsx(TT, { id, title, subtitle, screen: _screen }) }) });
|
|
1135
1143
|
}
|
|
1136
1144
|
function TT({ id, title, subtitle, screen }) {
|
|
1137
|
-
const { setRowSelection } = useTableContext();
|
|
1138
|
-
const { api, table, filters, massActions, buttonBar, rowActions, createView, editView, deleteItem, breadcrumbs } = screen;
|
|
1139
|
-
const tableApi = runIfFn(api, id ?? "");
|
|
1140
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1141
|
-
/* @__PURE__ */ jsx(TableTopBar, { title, breadcrumbs, children: /* @__PURE__ */ jsx(TableButtonBar, { buttonBar, createView, editView, api: tableApi, queryKey: tableApi.queryKey, children: filters && /* @__PURE__ */ jsx(TableFilterButton, {}) }) }),
|
|
1142
|
-
filters && /* @__PURE__ */ jsx(
|
|
1145
|
+
const { setRowSelection } = table.useTableContext();
|
|
1146
|
+
const { api, table: table$1, filters, massActions, buttonBar, rowActions, createView, editView, deleteItem, breadcrumbs } = screen;
|
|
1147
|
+
const tableApi = react.runIfFn(api, id ?? "");
|
|
1148
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1149
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableTopBar, { title, breadcrumbs, children: /* @__PURE__ */ jsxRuntime.jsx(TableButtonBar, { buttonBar, createView, editView, api: tableApi, queryKey: tableApi.queryKey, children: filters && /* @__PURE__ */ jsxRuntime.jsx(TableFilterButton, {}) }) }),
|
|
1150
|
+
filters && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
1151
|
TableFilters,
|
|
1144
1152
|
{
|
|
1145
1153
|
form: filters.form,
|
|
@@ -1148,28 +1156,28 @@ function TT({ id, title, subtitle, screen }) {
|
|
|
1148
1156
|
processInput: filters.processInput
|
|
1149
1157
|
}
|
|
1150
1158
|
),
|
|
1151
|
-
massActions && /* @__PURE__ */ jsx(TableMassActions, { actions: massActions.items }),
|
|
1152
|
-
/* @__PURE__ */ jsxs(TableViewProvider, { queryKey: tableApi.queryKey, editView, deleteItem, children: [
|
|
1153
|
-
/* @__PURE__ */ jsx(TableWrapper, { table: { ...table, onSelectionChange: setRowSelection }, rowActions, api: tableApi, subtitle, queryParams: screen.queryParams }),
|
|
1154
|
-
/* @__PURE__ */ jsx(TableDialogManager, {})
|
|
1159
|
+
massActions && /* @__PURE__ */ jsxRuntime.jsx(TableMassActions, { actions: massActions.items }),
|
|
1160
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TableViewProvider, { queryKey: tableApi.queryKey, editView, deleteItem, children: [
|
|
1161
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableWrapper, { table: { ...table$1, onSelectionChange: setRowSelection }, rowActions, api: tableApi, subtitle, queryParams: screen.queryParams }),
|
|
1162
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableDialogManager, {})
|
|
1155
1163
|
] })
|
|
1156
1164
|
] });
|
|
1157
1165
|
}
|
|
1158
1166
|
function TableButtonBar({ buttonBar, queryKey, createView, editView, api, children }) {
|
|
1159
|
-
const createDialogFn =
|
|
1167
|
+
const createDialogFn = React8__default.default.useCallback((data) => {
|
|
1160
1168
|
return (onClose) => {
|
|
1161
|
-
const view = runIfFn(createView, data) ?? runIfFn(editView, null);
|
|
1169
|
+
const view = react.runIfFn(createView, data) ?? react.runIfFn(editView, null);
|
|
1162
1170
|
if (view.type == "customDialog")
|
|
1163
1171
|
return view.render({ show: true, onClose });
|
|
1164
1172
|
else
|
|
1165
|
-
return /* @__PURE__ */ jsx(DialogRenderer, { config: view, onClose, invalidateQueryKey: api.queryKey });
|
|
1173
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogRenderer, { config: view, onClose, invalidateQueryKey: api.queryKey });
|
|
1166
1174
|
};
|
|
1167
1175
|
}, [createView, editView, api]);
|
|
1168
|
-
return /* @__PURE__ */ jsxs(ButtonBar, { children: [
|
|
1169
|
-
/* @__PURE__ */ jsx(RefreshButton, { queryKey }),
|
|
1176
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ButtonBar, { children: [
|
|
1177
|
+
/* @__PURE__ */ jsxRuntime.jsx(RefreshButton, { queryKey }),
|
|
1170
1178
|
buttonBar && buttonBar.map(
|
|
1171
|
-
(button, index) => /* @__PURE__ */ jsxs(
|
|
1172
|
-
button.type === "create" && editView && /* @__PURE__ */ jsx(
|
|
1179
|
+
(button, index) => /* @__PURE__ */ jsxRuntime.jsxs(React8__default.default.Fragment, { children: [
|
|
1180
|
+
button.type === "create" && editView && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1173
1181
|
TableCreateButton,
|
|
1174
1182
|
{
|
|
1175
1183
|
buildDialog: createDialogFn(button.data),
|
|
@@ -1177,33 +1185,33 @@ function TableButtonBar({ buttonBar, queryKey, createView, editView, api, childr
|
|
|
1177
1185
|
children: button.label
|
|
1178
1186
|
}
|
|
1179
1187
|
),
|
|
1180
|
-
button.type === "invalidate" && /* @__PURE__ */ jsx(InvalidateButton, { pathOrPermalink: button.pathOrPermalink }),
|
|
1188
|
+
button.type === "invalidate" && /* @__PURE__ */ jsxRuntime.jsx(InvalidateButton, { pathOrPermalink: button.pathOrPermalink }),
|
|
1181
1189
|
button.type === "custom" && button.render()
|
|
1182
1190
|
] }, index)
|
|
1183
1191
|
),
|
|
1184
1192
|
children
|
|
1185
1193
|
] });
|
|
1186
1194
|
}
|
|
1187
|
-
function TableWrapper({ table, subtitle, rowActions, api, queryParams }) {
|
|
1188
|
-
const tableProps = useTableProps(api, table, rowActions, queryParams);
|
|
1189
|
-
const _subtitle =
|
|
1195
|
+
function TableWrapper({ table: table$1, subtitle, rowActions, api, queryParams }) {
|
|
1196
|
+
const tableProps = useTableProps(api, table$1, rowActions, queryParams);
|
|
1197
|
+
const _subtitle = React8__default.default.useMemo(() => {
|
|
1190
1198
|
if (!subtitle)
|
|
1191
1199
|
return void 0;
|
|
1192
1200
|
return (data) => {
|
|
1193
|
-
return /* @__PURE__ */ jsx("div", { textSize: "lg", textColor: "#475569", fontWeight: "600", children: isFunction(subtitle) ? subtitle(data) : subtitle });
|
|
1201
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { textSize: "lg", textColor: "#475569", fontWeight: "600", children: react.isFunction(subtitle) ? subtitle(data) : subtitle });
|
|
1194
1202
|
};
|
|
1195
1203
|
}, [subtitle]);
|
|
1196
|
-
return /* @__PURE__ */ jsx(Table, { ...tableProps, p: "8", title: _subtitle });
|
|
1204
|
+
return /* @__PURE__ */ jsxRuntime.jsx(table.Table, { ...tableProps, p: "8", title: _subtitle });
|
|
1197
1205
|
}
|
|
1198
1206
|
function TableDialogManager() {
|
|
1199
1207
|
const { dialog } = useContext2();
|
|
1200
1208
|
return dialog;
|
|
1201
1209
|
}
|
|
1202
1210
|
function useQueries(queries) {
|
|
1203
|
-
const params = useParams();
|
|
1204
|
-
const { data, isFetching, isError } = useApiQueries(queries.map((q) => {
|
|
1211
|
+
const params = reactRouterDom.useParams();
|
|
1212
|
+
const { data, isFetching, isError } = api.useApiQueries(queries.map((q) => {
|
|
1205
1213
|
if (!q.queryField) {
|
|
1206
|
-
const api2 = runIfFn(q.api);
|
|
1214
|
+
const api2 = react.runIfFn(q.api);
|
|
1207
1215
|
return {
|
|
1208
1216
|
queryKey: api2.queryKey,
|
|
1209
1217
|
queryFn: q.fn == "get" ? api2.get : api2.getAll,
|
|
@@ -1211,11 +1219,11 @@ function useQueries(queries) {
|
|
|
1211
1219
|
};
|
|
1212
1220
|
}
|
|
1213
1221
|
const id = params[q.queryField];
|
|
1214
|
-
const api = runIfFn(q.api, id);
|
|
1222
|
+
const api = react.runIfFn(q.api, id);
|
|
1215
1223
|
return {
|
|
1216
1224
|
queryKey: api.queryKey,
|
|
1217
1225
|
queryFn: q.fn == "get" ? api.get : api.getAll,
|
|
1218
|
-
queryParam: q.fn == "getAll" ? q.params : isFunction(q.api) ? void 0 : id
|
|
1226
|
+
queryParam: q.fn == "getAll" ? q.params : react.isFunction(q.api) ? void 0 : id
|
|
1219
1227
|
};
|
|
1220
1228
|
}));
|
|
1221
1229
|
let transformedData = void 0;
|
|
@@ -1225,17 +1233,17 @@ function useQueries(queries) {
|
|
|
1225
1233
|
return { data: transformedData, isFetching, isError };
|
|
1226
1234
|
}
|
|
1227
1235
|
function useInvalidate(queries) {
|
|
1228
|
-
const queryClient = useQueryClient();
|
|
1229
|
-
const params = useParams();
|
|
1230
|
-
const invalidate =
|
|
1236
|
+
const queryClient = reactQuery.useQueryClient();
|
|
1237
|
+
const params = reactRouterDom.useParams();
|
|
1238
|
+
const invalidate = React8__default.default.useCallback(
|
|
1231
1239
|
() => {
|
|
1232
1240
|
const queryKeys = [];
|
|
1233
1241
|
queries.forEach((q) => {
|
|
1234
|
-
if (!q.queryField || !isFunction(q.api)) {
|
|
1242
|
+
if (!q.queryField || !react.isFunction(q.api)) {
|
|
1235
1243
|
queryKeys.push(q.api.queryKey);
|
|
1236
1244
|
} else {
|
|
1237
1245
|
const id = params[q.queryField];
|
|
1238
|
-
const api = runIfFn(q.api, id);
|
|
1246
|
+
const api = react.runIfFn(q.api, id);
|
|
1239
1247
|
queryKeys.push(api.queryKey);
|
|
1240
1248
|
}
|
|
1241
1249
|
});
|
|
@@ -1254,29 +1262,29 @@ function MultiQueryWrapper({
|
|
|
1254
1262
|
const { data, isFetching, isError } = useQueries(queries);
|
|
1255
1263
|
const invalidate = useInvalidate(queries);
|
|
1256
1264
|
if (isFetching)
|
|
1257
|
-
return /* @__PURE__ */ jsx(QueryLoadingState, { w: "full", h: "100vh" });
|
|
1265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components.QueryLoadingState, { w: "full", h: "100vh" });
|
|
1258
1266
|
if (isError || !data)
|
|
1259
|
-
return /* @__PURE__ */ jsx(RetryOnError, { p: "0", w: "full", h: "100vh", onClick: invalidate });
|
|
1260
|
-
return /* @__PURE__ */ jsx(ScreenRenderer, { config: config(...data), tabbed, ...props });
|
|
1267
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components.RetryOnError, { p: "0", w: "full", h: "100vh", onClick: invalidate });
|
|
1268
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScreenRenderer, { config: config(...data), tabbed, ...props });
|
|
1261
1269
|
}
|
|
1262
1270
|
function ScreenRenderer({ config, tabbed, ...props }) {
|
|
1263
1271
|
if (config.type === "table")
|
|
1264
|
-
return /* @__PURE__ */ jsx(TableView, { ...config, ...props });
|
|
1272
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableView, { ...config, ...props });
|
|
1265
1273
|
if (config.type === "tabbed")
|
|
1266
|
-
return /* @__PURE__ */ jsx(TabbedView, { ...config, ...props });
|
|
1274
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabbedView, { ...config, ...props });
|
|
1267
1275
|
if (config.type === "details")
|
|
1268
|
-
return /* @__PURE__ */ jsx(DetailsView, { ...config, tabbed, ...props });
|
|
1276
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DetailsView, { ...config, tabbed, ...props });
|
|
1269
1277
|
if (config.type === "query")
|
|
1270
|
-
return /* @__PURE__ */ jsx(QueryWrapper, { ...config, tabbed, ...props });
|
|
1278
|
+
return /* @__PURE__ */ jsxRuntime.jsx(QueryWrapper, { ...config, tabbed, ...props });
|
|
1271
1279
|
if (config.type === "multiQuery")
|
|
1272
|
-
return /* @__PURE__ */ jsx(MultiQueryWrapper, { ...config, tabbed, ...props });
|
|
1273
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
1280
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MultiQueryWrapper, { ...config, tabbed, ...props });
|
|
1281
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1274
1282
|
}
|
|
1275
1283
|
function Content({ ...props }) {
|
|
1276
|
-
return /* @__PURE__ */ jsx("div", { w: "100%", h: "100%", overflowY: "auto", ...props, children: /* @__PURE__ */ jsx(Outlet, {}) });
|
|
1284
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { w: "100%", h: "100%", overflowY: "auto", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {}) });
|
|
1277
1285
|
}
|
|
1278
1286
|
function SelectedIndicator({ darkMode }) {
|
|
1279
|
-
return /* @__PURE__ */ jsx(
|
|
1287
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1280
1288
|
"div",
|
|
1281
1289
|
{
|
|
1282
1290
|
position: "absolute",
|
|
@@ -1290,8 +1298,8 @@ function SelectedIndicator({ darkMode }) {
|
|
|
1290
1298
|
);
|
|
1291
1299
|
}
|
|
1292
1300
|
function MenuButton({ depth, darkMode, icon, selected, children, ...props }) {
|
|
1293
|
-
return /* @__PURE__ */ jsxs(
|
|
1294
|
-
Button,
|
|
1301
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1302
|
+
ui.Button,
|
|
1295
1303
|
{
|
|
1296
1304
|
as: "li",
|
|
1297
1305
|
minH: "8",
|
|
@@ -1312,19 +1320,19 @@ function MenuButton({ depth, darkMode, icon, selected, children, ...props }) {
|
|
|
1312
1320
|
gap: "3",
|
|
1313
1321
|
...props,
|
|
1314
1322
|
children: [
|
|
1315
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon, opacity: selected ? "100" : "60" }),
|
|
1323
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon, opacity: selected ? "100" : "60" }),
|
|
1316
1324
|
children
|
|
1317
1325
|
]
|
|
1318
1326
|
}
|
|
1319
1327
|
);
|
|
1320
1328
|
}
|
|
1321
1329
|
function MenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
|
|
1322
|
-
const location = useLocation();
|
|
1330
|
+
const location = reactRouterDom.useLocation();
|
|
1323
1331
|
const selected = path == "/" ? location.pathname == "/" : location.pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
|
1324
|
-
const match = useMatch("/" + path) != null;
|
|
1325
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1326
|
-
/* @__PURE__ */ jsxs(Link
|
|
1327
|
-
/* @__PURE__ */ jsx(
|
|
1332
|
+
const match = reactRouterDom.useMatch("/" + path) != null;
|
|
1333
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1334
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: path, style: { position: "relative" }, children: [
|
|
1335
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1328
1336
|
MenuButton,
|
|
1329
1337
|
{
|
|
1330
1338
|
depth,
|
|
@@ -1334,9 +1342,9 @@ function MenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
|
|
|
1334
1342
|
...props
|
|
1335
1343
|
}
|
|
1336
1344
|
),
|
|
1337
|
-
match && /* @__PURE__ */ jsx(SelectedIndicator, { darkMode })
|
|
1345
|
+
match && /* @__PURE__ */ jsxRuntime.jsx(SelectedIndicator, { darkMode })
|
|
1338
1346
|
] }),
|
|
1339
|
-
subMenu?.map((item, index) => /* @__PURE__ */ jsx(
|
|
1347
|
+
subMenu?.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1340
1348
|
MenuItem,
|
|
1341
1349
|
{
|
|
1342
1350
|
icon: item.icon,
|
|
@@ -1351,12 +1359,12 @@ function MenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
|
|
|
1351
1359
|
] });
|
|
1352
1360
|
}
|
|
1353
1361
|
function NextMenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
|
|
1354
|
-
const { pathname } = useRouter();
|
|
1362
|
+
const { pathname } = router.useRouter();
|
|
1355
1363
|
const selected = path == "/" ? pathname == "/" : pathname.startsWith(path.startsWith("/") ? path : `/${path}`);
|
|
1356
1364
|
const match = path == "/" ? pathname == "/" : pathname == (path.startsWith("/") ? path : `/${path}`);
|
|
1357
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1358
|
-
/* @__PURE__ */ jsxs(
|
|
1359
|
-
/* @__PURE__ */ jsx(
|
|
1365
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1366
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Link__default.default, { href: path, style: { position: "relative" }, children: [
|
|
1367
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1360
1368
|
MenuButton,
|
|
1361
1369
|
{
|
|
1362
1370
|
depth,
|
|
@@ -1366,9 +1374,9 @@ function NextMenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
|
|
|
1366
1374
|
...props
|
|
1367
1375
|
}
|
|
1368
1376
|
),
|
|
1369
|
-
match && /* @__PURE__ */ jsx(SelectedIndicator, { darkMode })
|
|
1377
|
+
match && /* @__PURE__ */ jsxRuntime.jsx(SelectedIndicator, { darkMode })
|
|
1370
1378
|
] }),
|
|
1371
|
-
subMenu?.map((item, index) => /* @__PURE__ */ jsx(
|
|
1379
|
+
subMenu?.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
1380
|
NextMenuItem,
|
|
1373
1381
|
{
|
|
1374
1382
|
icon: item.icon,
|
|
@@ -1384,11 +1392,11 @@ function NextMenuItem({ icon, path, depth, darkMode, subMenu, ...props }) {
|
|
|
1384
1392
|
}
|
|
1385
1393
|
function Menu({ darkMode, config, useNextRouter, ...props }) {
|
|
1386
1394
|
const Comp = useNextRouter ? NextMenuItem : MenuItem;
|
|
1387
|
-
return /* @__PURE__ */ jsx("ul", { ...props, children: config.map((item, index) => {
|
|
1395
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { ...props, children: config.map((item, index) => {
|
|
1388
1396
|
if (item.type == "divider")
|
|
1389
|
-
return /* @__PURE__ */ jsx(Divider, { title: item.label }, index);
|
|
1397
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Divider, { title: item.label }, index);
|
|
1390
1398
|
if (item.type == "item") {
|
|
1391
|
-
return /* @__PURE__ */ jsx(
|
|
1399
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1392
1400
|
Comp,
|
|
1393
1401
|
{
|
|
1394
1402
|
icon: item.icon,
|
|
@@ -1404,7 +1412,7 @@ function Menu({ darkMode, config, useNextRouter, ...props }) {
|
|
|
1404
1412
|
}) });
|
|
1405
1413
|
}
|
|
1406
1414
|
function Divider({ title }) {
|
|
1407
|
-
return /* @__PURE__ */ jsx(
|
|
1415
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1408
1416
|
"div",
|
|
1409
1417
|
{
|
|
1410
1418
|
px: "2",
|
|
@@ -1420,12 +1428,12 @@ function Divider({ title }) {
|
|
|
1420
1428
|
);
|
|
1421
1429
|
}
|
|
1422
1430
|
function UserBlock({ color, darkMode, menuConfig, path }) {
|
|
1423
|
-
const { isLoading, user } = useSessionUser();
|
|
1424
|
-
const navigate = useNavigate();
|
|
1425
|
-
const handleClick =
|
|
1431
|
+
const { isLoading, user } = auth.useSessionUser();
|
|
1432
|
+
const navigate = reactRouterDom.useNavigate();
|
|
1433
|
+
const handleClick = React8__default.default.useCallback(() => navigate(path), [navigate, path]);
|
|
1426
1434
|
if (isLoading)
|
|
1427
1435
|
return null;
|
|
1428
|
-
return /* @__PURE__ */ jsxs(
|
|
1436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1429
1437
|
"div",
|
|
1430
1438
|
{
|
|
1431
1439
|
dflex: true,
|
|
@@ -1441,10 +1449,10 @@ function UserBlock({ color, darkMode, menuConfig, path }) {
|
|
|
1441
1449
|
textColor: darkMode ? "white" : "slate-800",
|
|
1442
1450
|
onClick: handleClick,
|
|
1443
1451
|
children: [
|
|
1444
|
-
/* @__PURE__ */ jsx(Avatar, { size: "sm", src: user?.media?.url ?? "", name: `${user?.firstname} ${user?.lastname}` }),
|
|
1445
|
-
/* @__PURE__ */ jsx("span", { flexGrow: true, ms: "2", children: `${capitalize(user?.firstname || user?.lastname || "")}` }),
|
|
1446
|
-
/* @__PURE__ */ jsx(
|
|
1447
|
-
IconButton,
|
|
1452
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Avatar, { size: "sm", src: user?.media?.url ?? "", name: `${user?.firstname} ${user?.lastname}` }),
|
|
1453
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { flexGrow: true, ms: "2", children: `${esToolkit.capitalize(user?.firstname || user?.lastname || "")}` }),
|
|
1454
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1455
|
+
ui.IconButton,
|
|
1448
1456
|
{
|
|
1449
1457
|
variant: "borderless",
|
|
1450
1458
|
corners: "pill",
|
|
@@ -1452,21 +1460,21 @@ function UserBlock({ color, darkMode, menuConfig, path }) {
|
|
|
1452
1460
|
textColor: darkMode ? "white" : "slate-800",
|
|
1453
1461
|
hover_textColor: darkMode ? "white" : "slate-800",
|
|
1454
1462
|
hover_bgColor: `${color}-${darkMode ? "900" : "200"}`,
|
|
1455
|
-
icon: mdiCog,
|
|
1463
|
+
icon: js.mdiCog,
|
|
1456
1464
|
onClick: handleClick
|
|
1457
1465
|
}
|
|
1458
1466
|
),
|
|
1459
|
-
/* @__PURE__ */ jsx(OverflowMenu, { color, darkMode, menuConfig })
|
|
1467
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowMenu, { color, darkMode, menuConfig })
|
|
1460
1468
|
]
|
|
1461
1469
|
}
|
|
1462
1470
|
);
|
|
1463
1471
|
}
|
|
1464
1472
|
function OverflowMenu({ color, darkMode, menuConfig }) {
|
|
1465
|
-
const [showPopup, setShowPopup] =
|
|
1466
|
-
const navigate = useNavigate();
|
|
1467
|
-
const logout = useSessionLogout(false);
|
|
1468
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
1469
|
-
Popup,
|
|
1473
|
+
const [showPopup, setShowPopup] = React8__default.default.useState(false);
|
|
1474
|
+
const navigate = reactRouterDom.useNavigate();
|
|
1475
|
+
const logout = auth.useSessionLogout(false);
|
|
1476
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1477
|
+
ui.Popup,
|
|
1470
1478
|
{
|
|
1471
1479
|
show: showPopup,
|
|
1472
1480
|
position: "relative",
|
|
@@ -1478,10 +1486,10 @@ function OverflowMenu({ color, darkMode, menuConfig }) {
|
|
|
1478
1486
|
},
|
|
1479
1487
|
onHide: () => setShowPopup(false),
|
|
1480
1488
|
children: [
|
|
1481
|
-
/* @__PURE__ */ jsx(
|
|
1482
|
-
IconButton,
|
|
1489
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1490
|
+
ui.IconButton,
|
|
1483
1491
|
{
|
|
1484
|
-
icon: mdiDotsVertical,
|
|
1492
|
+
icon: js.mdiDotsVertical,
|
|
1485
1493
|
variant: "borderless",
|
|
1486
1494
|
corners: "pill",
|
|
1487
1495
|
scheme: "dark",
|
|
@@ -1490,7 +1498,7 @@ function OverflowMenu({ color, darkMode, menuConfig }) {
|
|
|
1490
1498
|
hover_bgColor: `${color}-${darkMode ? "900" : "200"}`
|
|
1491
1499
|
}
|
|
1492
1500
|
),
|
|
1493
|
-
/* @__PURE__ */ jsxs(
|
|
1501
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1494
1502
|
"div",
|
|
1495
1503
|
{
|
|
1496
1504
|
bgColor: "white",
|
|
@@ -1506,11 +1514,11 @@ function OverflowMenu({ color, darkMode, menuConfig }) {
|
|
|
1506
1514
|
children: [
|
|
1507
1515
|
menuConfig && menuConfig.length > 0 && menuConfig.map((item, index) => {
|
|
1508
1516
|
if (item.type == "item") {
|
|
1509
|
-
return /* @__PURE__ */ jsx(MenuItem2, { icon: item.icon, onClick: () => navigate(item.path), children: item.label }, index);
|
|
1517
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuItem2, { icon: item.icon, onClick: () => navigate(item.path), children: item.label }, index);
|
|
1510
1518
|
}
|
|
1511
1519
|
return null;
|
|
1512
1520
|
}),
|
|
1513
|
-
/* @__PURE__ */ jsx(MenuItem2, { icon: mdiLogout, onClick: logout, children: "Logout" })
|
|
1521
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuItem2, { icon: js.mdiLogout, onClick: logout, children: "Logout" })
|
|
1514
1522
|
]
|
|
1515
1523
|
}
|
|
1516
1524
|
)
|
|
@@ -1519,13 +1527,13 @@ function OverflowMenu({ color, darkMode, menuConfig }) {
|
|
|
1519
1527
|
) });
|
|
1520
1528
|
}
|
|
1521
1529
|
function MenuItem2({ icon, onClick, children, ...props }) {
|
|
1522
|
-
const handleClick =
|
|
1530
|
+
const handleClick = React8__default.default.useCallback((e) => {
|
|
1523
1531
|
e.preventDefault();
|
|
1524
1532
|
e.stopPropagation();
|
|
1525
1533
|
onClick?.(e);
|
|
1526
1534
|
}, []);
|
|
1527
|
-
return /* @__PURE__ */ jsxs(
|
|
1528
|
-
Button,
|
|
1535
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1536
|
+
ui.Button,
|
|
1529
1537
|
{
|
|
1530
1538
|
variant: "borderless",
|
|
1531
1539
|
scheme: "dark",
|
|
@@ -1540,14 +1548,14 @@ function MenuItem2({ icon, onClick, children, ...props }) {
|
|
|
1540
1548
|
textColor: "slate-700",
|
|
1541
1549
|
...props,
|
|
1542
1550
|
children: [
|
|
1543
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon, size: "md" }),
|
|
1551
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon, size: "md" }),
|
|
1544
1552
|
children
|
|
1545
1553
|
]
|
|
1546
1554
|
}
|
|
1547
1555
|
);
|
|
1548
1556
|
}
|
|
1549
1557
|
function Sidebar({ show, logo, title, menuConfig, userMenuConfig, userSettingsPath, color, darkMode, ...props }) {
|
|
1550
|
-
return /* @__PURE__ */ jsxs(
|
|
1558
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1551
1559
|
"div",
|
|
1552
1560
|
{
|
|
1553
1561
|
dflex: true,
|
|
@@ -1559,8 +1567,8 @@ function Sidebar({ show, logo, title, menuConfig, userMenuConfig, userSettingsPa
|
|
|
1559
1567
|
textColor: darkMode ? "white" : "slate-800",
|
|
1560
1568
|
...props,
|
|
1561
1569
|
children: [
|
|
1562
|
-
/* @__PURE__ */ jsxs(
|
|
1563
|
-
FlexCenter,
|
|
1570
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1571
|
+
components.FlexCenter,
|
|
1564
1572
|
{
|
|
1565
1573
|
placeContent: "start",
|
|
1566
1574
|
p: "4",
|
|
@@ -1570,23 +1578,23 @@ function Sidebar({ show, logo, title, menuConfig, userMenuConfig, userSettingsPa
|
|
|
1570
1578
|
borderBColor: "slate-900",
|
|
1571
1579
|
borderOpacity: "5",
|
|
1572
1580
|
children: [
|
|
1573
|
-
logo ?? /* @__PURE__ */ jsx(Logo, { width: 40, height: 40, darkMode }),
|
|
1574
|
-
/* @__PURE__ */ jsx("h1", { textSize: "md", children: title || AppEnv.appName() })
|
|
1581
|
+
logo ?? /* @__PURE__ */ jsxRuntime.jsx(Logo, { width: 40, height: 40, darkMode }),
|
|
1582
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { textSize: "md", children: title || env.AppEnv.appName() })
|
|
1575
1583
|
]
|
|
1576
1584
|
}
|
|
1577
1585
|
),
|
|
1578
|
-
/* @__PURE__ */ jsx(Menu, { overflowY: "auto", flexGrow: "1", p: "4", darkMode, config: menuConfig }),
|
|
1579
|
-
/* @__PURE__ */ jsx("div", { p: "2", children: /* @__PURE__ */ jsx(UserBlock, { darkMode, color, menuConfig: userMenuConfig, path: userSettingsPath }) })
|
|
1586
|
+
/* @__PURE__ */ jsxRuntime.jsx(Menu, { overflowY: "auto", flexGrow: "1", p: "4", darkMode, config: menuConfig }),
|
|
1587
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { p: "2", children: /* @__PURE__ */ jsxRuntime.jsx(UserBlock, { darkMode, color, menuConfig: userMenuConfig, path: userSettingsPath }) })
|
|
1580
1588
|
]
|
|
1581
1589
|
}
|
|
1582
1590
|
);
|
|
1583
1591
|
}
|
|
1584
1592
|
function Logo({ width, height, darkMode, ...props }) {
|
|
1585
|
-
return /* @__PURE__ */ jsx("div", { ...props, children: /* @__PURE__ */ jsx(
|
|
1586
|
-
|
|
1593
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1594
|
+
Image__default.default,
|
|
1587
1595
|
{
|
|
1588
1596
|
src: `/logo_${darkMode ? "light" : "dark"}.png`,
|
|
1589
|
-
alt: AppEnv.appName() || "",
|
|
1597
|
+
alt: env.AppEnv.appName() || "",
|
|
1590
1598
|
width,
|
|
1591
1599
|
height,
|
|
1592
1600
|
priority: true,
|
|
@@ -1595,7 +1603,7 @@ function Logo({ width, height, darkMode, ...props }) {
|
|
|
1595
1603
|
) });
|
|
1596
1604
|
}
|
|
1597
1605
|
function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath, ...props }) {
|
|
1598
|
-
return /* @__PURE__ */ jsxs(
|
|
1606
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1599
1607
|
"div",
|
|
1600
1608
|
{
|
|
1601
1609
|
w: "full",
|
|
@@ -1605,7 +1613,7 @@ function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig,
|
|
|
1605
1613
|
bgColor: `${color}-${darkMode ? "900" : "100"}`,
|
|
1606
1614
|
...props,
|
|
1607
1615
|
children: [
|
|
1608
|
-
/* @__PURE__ */ jsx(
|
|
1616
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1609
1617
|
LeftPanel,
|
|
1610
1618
|
{
|
|
1611
1619
|
color,
|
|
@@ -1617,15 +1625,15 @@ function AdminLayout({ color, darkMode, logo, title, menuConfig, userMenuConfig,
|
|
|
1617
1625
|
userSettingsPath
|
|
1618
1626
|
}
|
|
1619
1627
|
),
|
|
1620
|
-
/* @__PURE__ */ jsx("div", { w: "screen", py: "2", pe: "2", children: /* @__PURE__ */ jsx(Content, { bgColor: "white", rounded: "lg", shadow: true }) })
|
|
1628
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { w: "screen", py: "2", pe: "2", children: /* @__PURE__ */ jsxRuntime.jsx(Content, { bgColor: "white", rounded: "lg", shadow: true }) })
|
|
1621
1629
|
]
|
|
1622
1630
|
}
|
|
1623
1631
|
);
|
|
1624
1632
|
}
|
|
1625
1633
|
function LeftPanel({ color, darkMode, logo, title, menuConfig, userMenuConfig, userSettingsPath }) {
|
|
1626
|
-
const [isOpen, __, toggle] = useBoolean(true);
|
|
1627
|
-
useHotkeys("ctrl+t", () => toggle(), [toggle]);
|
|
1628
|
-
return /* @__PURE__ */ jsxs(
|
|
1634
|
+
const [isOpen, __, toggle] = hooks.useBoolean(true);
|
|
1635
|
+
reactHotkeysHook.useHotkeys("ctrl+t", () => toggle(), [toggle]);
|
|
1636
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1629
1637
|
"div",
|
|
1630
1638
|
{
|
|
1631
1639
|
ms: isOpen ? "0" : "-14.5rem",
|
|
@@ -1633,7 +1641,7 @@ function LeftPanel({ color, darkMode, logo, title, menuConfig, userMenuConfig, u
|
|
|
1633
1641
|
duration: "500",
|
|
1634
1642
|
transform: true,
|
|
1635
1643
|
children: [
|
|
1636
|
-
/* @__PURE__ */ jsx(
|
|
1644
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1637
1645
|
Sidebar,
|
|
1638
1646
|
{
|
|
1639
1647
|
flexShrink: "0",
|
|
@@ -1646,10 +1654,10 @@ function LeftPanel({ color, darkMode, logo, title, menuConfig, userMenuConfig, u
|
|
|
1646
1654
|
userSettingsPath
|
|
1647
1655
|
}
|
|
1648
1656
|
),
|
|
1649
|
-
/* @__PURE__ */ jsx(
|
|
1650
|
-
IconButton,
|
|
1657
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1658
|
+
ui.IconButton,
|
|
1651
1659
|
{
|
|
1652
|
-
icon: mdiArrowLeft,
|
|
1660
|
+
icon: js.mdiArrowLeft,
|
|
1653
1661
|
transition: "all",
|
|
1654
1662
|
duration: "500",
|
|
1655
1663
|
transform: true,
|
|
@@ -1693,14 +1701,14 @@ function AttachDialog({
|
|
|
1693
1701
|
getItemName,
|
|
1694
1702
|
...props
|
|
1695
1703
|
}) {
|
|
1696
|
-
const queryClient = useQueryClient();
|
|
1697
|
-
const { data: attached, isInitialLoading: fetchLoading, isError: fetchError, refetch, error } = useApiQuery(queryKey, queryFetchFn);
|
|
1698
|
-
const { data, isInitialLoading: fetchAllLoading, isError: fetchAllError, refetch: refetchAll, error: errorAll } = useApiQuery(queryFetchAllKey, queryFetchAllFn);
|
|
1699
|
-
const [selectedResources, setSelectedResources] =
|
|
1704
|
+
const queryClient = reactQuery.useQueryClient();
|
|
1705
|
+
const { data: attached, isInitialLoading: fetchLoading, isError: fetchError, refetch, error } = api.useApiQuery(queryKey, queryFetchFn);
|
|
1706
|
+
const { data, isInitialLoading: fetchAllLoading, isError: fetchAllError, refetch: refetchAll, error: errorAll } = api.useApiQuery(queryFetchAllKey, queryFetchAllFn);
|
|
1707
|
+
const [selectedResources, setSelectedResources] = React8__default.default.useState([]);
|
|
1700
1708
|
const isLoading = fetchLoading || fetchAllLoading;
|
|
1701
1709
|
const isError = fetchError || fetchAllError;
|
|
1702
|
-
const mutation = useApiMutation(querySaveFn, queryKey, queryId);
|
|
1703
|
-
const handleClick =
|
|
1710
|
+
const mutation = api.useApiMutation(querySaveFn, queryKey, queryId);
|
|
1711
|
+
const handleClick = React8__default.default.useCallback((event) => {
|
|
1704
1712
|
const id = event?.currentTarget.dataset.id ?? "";
|
|
1705
1713
|
const arr = selectedResources.concat([]);
|
|
1706
1714
|
const i = selectedResources.indexOf(id);
|
|
@@ -1710,19 +1718,19 @@ function AttachDialog({
|
|
|
1710
1718
|
arr.push(id);
|
|
1711
1719
|
setSelectedResources(arr);
|
|
1712
1720
|
}, [selectedResources, setSelectedResources]);
|
|
1713
|
-
const retry =
|
|
1721
|
+
const retry = React8__default.default.useCallback(() => {
|
|
1714
1722
|
if (fetchError)
|
|
1715
1723
|
refetch();
|
|
1716
1724
|
if (fetchAllError)
|
|
1717
1725
|
refetchAll();
|
|
1718
1726
|
}, [refetch, refetchAll, fetchError, fetchAllError]);
|
|
1719
|
-
const saveItem =
|
|
1727
|
+
const saveItem = React8__default.default.useCallback(() => {
|
|
1720
1728
|
mutation.reset();
|
|
1721
1729
|
mutation.mutateAsync({ resources: selectedResources }).then((response) => {
|
|
1722
1730
|
if (onSuccess)
|
|
1723
1731
|
onSuccess(response);
|
|
1724
1732
|
else
|
|
1725
|
-
toast.success(`${itemLabel} saved`);
|
|
1733
|
+
reactToastify.toast.success(`${itemLabel} saved`);
|
|
1726
1734
|
if (invalidateQueriesOnSuccess)
|
|
1727
1735
|
queryClient.invalidateQueries({ queryKey });
|
|
1728
1736
|
onClose?.();
|
|
@@ -1731,10 +1739,10 @@ function AttachDialog({
|
|
|
1731
1739
|
if (onSaveError)
|
|
1732
1740
|
onSaveError();
|
|
1733
1741
|
else
|
|
1734
|
-
toast.error(`Error adding ${itemLabel}`);
|
|
1742
|
+
reactToastify.toast.error(`Error adding ${itemLabel}`);
|
|
1735
1743
|
});
|
|
1736
1744
|
}, [mutation, queryId, onSuccess, queryClient, onSaveError, onClose]);
|
|
1737
|
-
const resources =
|
|
1745
|
+
const resources = React8__default.default.useMemo(() => {
|
|
1738
1746
|
let r = [];
|
|
1739
1747
|
if (attached && data) {
|
|
1740
1748
|
r = [].concat(data);
|
|
@@ -1743,12 +1751,12 @@ function AttachDialog({
|
|
|
1743
1751
|
r = r.map((item) => {
|
|
1744
1752
|
return { ...item, name: getItemName(item) };
|
|
1745
1753
|
});
|
|
1746
|
-
r = sortBy(r, ["name"]);
|
|
1754
|
+
r = esToolkit.sortBy(r, ["name"]);
|
|
1747
1755
|
}
|
|
1748
1756
|
return r;
|
|
1749
1757
|
}, [attached, data]);
|
|
1750
|
-
return /* @__PURE__ */ jsxs(
|
|
1751
|
-
Modal,
|
|
1758
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1759
|
+
ui.Modal,
|
|
1752
1760
|
{
|
|
1753
1761
|
size,
|
|
1754
1762
|
show,
|
|
@@ -1757,11 +1765,11 @@ function AttachDialog({
|
|
|
1757
1765
|
transition: true,
|
|
1758
1766
|
...props,
|
|
1759
1767
|
children: [
|
|
1760
|
-
/* @__PURE__ */ jsx(Modal.Header, { children: `Add ${itemLabel}` }),
|
|
1761
|
-
isLoading && /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(QueryLoadingState, { minW: "72" }) }),
|
|
1762
|
-
isError && /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(RetryOnError, { label: `${fetchErrorMsg} ${error}`, onClick: retry }) }),
|
|
1763
|
-
!isLoading && !isError && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1764
|
-
/* @__PURE__ */ jsx(Modal.Body, { px: "0", pb: "6", maxH: "750px", overflow: "auto", children: /* @__PURE__ */ jsx("div", { dflex: true, flexCol: true, overflow: "auto", children: resources.map((item) => /* @__PURE__ */ jsx(
|
|
1768
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Header, { children: `Add ${itemLabel}` }),
|
|
1769
|
+
isLoading && /* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(components.QueryLoadingState, { minW: "72" }) }),
|
|
1770
|
+
isError && /* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsx(components.RetryOnError, { label: `${fetchErrorMsg} ${error}`, onClick: retry }) }),
|
|
1771
|
+
!isLoading && !isError && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1772
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Body, { px: "0", pb: "6", maxH: "750px", overflow: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { dflex: true, flexCol: true, overflow: "auto", children: resources.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1765
1773
|
ListItem,
|
|
1766
1774
|
{
|
|
1767
1775
|
label: item.name,
|
|
@@ -1772,9 +1780,9 @@ function AttachDialog({
|
|
|
1772
1780
|
},
|
|
1773
1781
|
item.id
|
|
1774
1782
|
)) }) }),
|
|
1775
|
-
/* @__PURE__ */ jsxs(Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
1776
|
-
/* @__PURE__ */ jsx(
|
|
1777
|
-
Button,
|
|
1783
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
1784
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1785
|
+
ui.Button,
|
|
1778
1786
|
{
|
|
1779
1787
|
disabled: mutation.isLoading,
|
|
1780
1788
|
onClick: onClose,
|
|
@@ -1783,8 +1791,8 @@ function AttachDialog({
|
|
|
1783
1791
|
children: cancelLabel
|
|
1784
1792
|
}
|
|
1785
1793
|
),
|
|
1786
|
-
/* @__PURE__ */ jsx(
|
|
1787
|
-
Button,
|
|
1794
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
|
+
ui.Button,
|
|
1788
1796
|
{
|
|
1789
1797
|
type: "submit",
|
|
1790
1798
|
disabled: selectedResources.length == 0 || mutation.isLoading,
|
|
@@ -1794,13 +1802,13 @@ function AttachDialog({
|
|
|
1794
1802
|
)
|
|
1795
1803
|
] })
|
|
1796
1804
|
] }),
|
|
1797
|
-
mutation.isLoading && /* @__PURE__ */ jsx(ModalLoadingOverlay, {})
|
|
1805
|
+
mutation.isLoading && /* @__PURE__ */ jsxRuntime.jsx(components.ModalLoadingOverlay, {})
|
|
1798
1806
|
]
|
|
1799
1807
|
}
|
|
1800
1808
|
);
|
|
1801
1809
|
}
|
|
1802
1810
|
function ListItem({ label, value, checked, ...props }) {
|
|
1803
|
-
return /* @__PURE__ */ jsxs(
|
|
1811
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1804
1812
|
"div",
|
|
1805
1813
|
{
|
|
1806
1814
|
dflex: true,
|
|
@@ -1811,8 +1819,8 @@ function ListItem({ label, value, checked, ...props }) {
|
|
|
1811
1819
|
cursor: "pointer",
|
|
1812
1820
|
...props,
|
|
1813
1821
|
children: [
|
|
1814
|
-
/* @__PURE__ */ jsx("span", { flexGrow: true, children: label }),
|
|
1815
|
-
/* @__PURE__ */ jsx(Checkbox, { name: `resources.${value}`, value, checked })
|
|
1822
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { flexGrow: true, children: label }),
|
|
1823
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Checkbox, { name: `resources.${value}`, value, checked })
|
|
1816
1824
|
]
|
|
1817
1825
|
}
|
|
1818
1826
|
);
|
|
@@ -1836,14 +1844,14 @@ function FormActionDialog({
|
|
|
1836
1844
|
saveLabel = "Send",
|
|
1837
1845
|
size = "lg",
|
|
1838
1846
|
title,
|
|
1839
|
-
form,
|
|
1847
|
+
form: form$1,
|
|
1840
1848
|
show,
|
|
1841
1849
|
onClose,
|
|
1842
1850
|
formikProps,
|
|
1843
1851
|
...props
|
|
1844
1852
|
}) {
|
|
1845
|
-
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(queryFn, queryKey, queryOptions) : useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
|
1846
|
-
const mutate = useMutate(mutation, {
|
|
1853
|
+
const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(queryFn, queryKey, queryOptions) : api.useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
|
1854
|
+
const mutate = api.useMutate(mutation, {
|
|
1847
1855
|
onSuccess,
|
|
1848
1856
|
successMsg,
|
|
1849
1857
|
showSuccessMsg,
|
|
@@ -1852,8 +1860,8 @@ function FormActionDialog({
|
|
|
1852
1860
|
showErrorMsg,
|
|
1853
1861
|
processInput
|
|
1854
1862
|
});
|
|
1855
|
-
return /* @__PURE__ */ jsxs(
|
|
1856
|
-
Modal,
|
|
1863
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1864
|
+
ui.Modal,
|
|
1857
1865
|
{
|
|
1858
1866
|
size,
|
|
1859
1867
|
show,
|
|
@@ -1862,21 +1870,21 @@ function FormActionDialog({
|
|
|
1862
1870
|
transition: true,
|
|
1863
1871
|
...props,
|
|
1864
1872
|
children: [
|
|
1865
|
-
/* @__PURE__ */ jsx(Modal.Header, { children: title }),
|
|
1866
|
-
/* @__PURE__ */ jsxs(
|
|
1867
|
-
FormProvider,
|
|
1873
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Modal.Header, { children: title }),
|
|
1874
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1875
|
+
form.FormProvider,
|
|
1868
1876
|
{
|
|
1869
1877
|
initialValues: initialValues ?? {},
|
|
1870
1878
|
onSubmit: mutate,
|
|
1871
1879
|
...formikProps,
|
|
1872
1880
|
children: [
|
|
1873
|
-
/* @__PURE__ */ jsxs(Modal.Body, { pb: "6", children: [
|
|
1874
|
-
|
|
1875
|
-
Array.isArray(form) && /* @__PURE__ */ jsx(FormRenderer, { form })
|
|
1881
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Body, { pb: "6", children: [
|
|
1882
|
+
React8__default.default.isValidElement(form$1) && form$1,
|
|
1883
|
+
Array.isArray(form$1) && /* @__PURE__ */ jsxRuntime.jsx(form.FormRenderer, { form: form$1 })
|
|
1876
1884
|
] }),
|
|
1877
|
-
/* @__PURE__ */ jsxs(Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
1878
|
-
/* @__PURE__ */ jsx(
|
|
1879
|
-
Button,
|
|
1885
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Modal.Footer, { dflex: true, placeContent: "end", spaceX: "3", children: [
|
|
1886
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1887
|
+
ui.Button,
|
|
1880
1888
|
{
|
|
1881
1889
|
disabled: mutation.isLoading,
|
|
1882
1890
|
onClick: onClose,
|
|
@@ -1885,24 +1893,24 @@ function FormActionDialog({
|
|
|
1885
1893
|
children: cancelLabel
|
|
1886
1894
|
}
|
|
1887
1895
|
),
|
|
1888
|
-
/* @__PURE__ */ jsx(SubmitButton, { disabled: mutation.isLoading, children: saveLabel })
|
|
1896
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.SubmitButton, { disabled: mutation.isLoading, children: saveLabel })
|
|
1889
1897
|
] })
|
|
1890
1898
|
]
|
|
1891
1899
|
}
|
|
1892
1900
|
),
|
|
1893
|
-
mutation.isLoading && /* @__PURE__ */ jsx(ModalLoadingOverlay, {})
|
|
1901
|
+
mutation.isLoading && /* @__PURE__ */ jsxRuntime.jsx(components.ModalLoadingOverlay, {})
|
|
1894
1902
|
]
|
|
1895
1903
|
}
|
|
1896
1904
|
);
|
|
1897
1905
|
}
|
|
1898
|
-
var PageStateContainer =
|
|
1899
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1900
|
-
loading && /* @__PURE__ */ jsx(QueryLoadingState, { w: "full", h: "100%" }),
|
|
1901
|
-
!loading && /* @__PURE__ */ jsx(Container, { ref, center: true, size: "x2", dflex: true, flexCol: true, gap: "8", ...props, children })
|
|
1906
|
+
var PageStateContainer = React8__default.default.forwardRef(({ loading = false, children, ...props }, ref) => {
|
|
1907
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1908
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx(components.QueryLoadingState, { w: "full", h: "100%" }),
|
|
1909
|
+
!loading && /* @__PURE__ */ jsxRuntime.jsx(ui.Container, { ref, center: true, size: "x2", dflex: true, flexCol: true, gap: "8", ...props, children })
|
|
1902
1910
|
] });
|
|
1903
1911
|
});
|
|
1904
1912
|
function PageSubSectionTitle({ children, ...props }) {
|
|
1905
|
-
return /* @__PURE__ */ jsx("div", { trait: "typo.h6", mb: "3", ...props, children });
|
|
1913
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { trait: "typo.h6", mb: "3", ...props, children });
|
|
1906
1914
|
}
|
|
1907
1915
|
var labels = {
|
|
1908
1916
|
draft: "Draft",
|
|
@@ -1921,27 +1929,27 @@ var schemes2 = {
|
|
|
1921
1929
|
rejected: "danger"
|
|
1922
1930
|
};
|
|
1923
1931
|
function StatusBadge({ status, ...props }) {
|
|
1924
|
-
return /* @__PURE__ */ jsx(Badge, { size: "sm", variant: "glass", whiteSpace: "nowrap", rounded: "full", px: "3", scheme: schemes2[status], ...props, children: labels[status] });
|
|
1932
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { size: "sm", variant: "glass", whiteSpace: "nowrap", rounded: "full", px: "3", scheme: schemes2[status], ...props, children: labels[status] });
|
|
1925
1933
|
}
|
|
1926
1934
|
function TableRowViewButton({ path, ...props }) {
|
|
1927
|
-
const openPage =
|
|
1935
|
+
const openPage = React8__default.default.useCallback((event) => {
|
|
1928
1936
|
event?.preventDefault();
|
|
1929
1937
|
event?.stopPropagation();
|
|
1930
|
-
window.open(`${AppEnv.websiteUrl()}/${path}`, "_blank");
|
|
1938
|
+
window.open(`${env.AppEnv.websiteUrl()}/${path}`, "_blank");
|
|
1931
1939
|
}, [path]);
|
|
1932
|
-
return /* @__PURE__ */ jsx(TableRowActionButton, { icon: mdiOpenInNew, onClick: openPage, ...props });
|
|
1940
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableRowActionButton, { icon: js.mdiOpenInNew, onClick: openPage, ...props });
|
|
1933
1941
|
}
|
|
1934
1942
|
function TableRowNavigateButton({ path, ...props }) {
|
|
1935
|
-
const navigate = useNavigate();
|
|
1936
|
-
const handleClick =
|
|
1943
|
+
const navigate = reactRouterDom.useNavigate();
|
|
1944
|
+
const handleClick = React8__default.default.useCallback((event) => {
|
|
1937
1945
|
event?.preventDefault();
|
|
1938
1946
|
event?.stopPropagation();
|
|
1939
1947
|
navigate(`${path}`);
|
|
1940
1948
|
}, [navigate, path]);
|
|
1941
|
-
return /* @__PURE__ */ jsx(TableRowActionButton, { icon: mdiEye, onClick: handleClick, ...props });
|
|
1949
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableRowActionButton, { icon: js.mdiEye, onClick: handleClick, ...props });
|
|
1942
1950
|
}
|
|
1943
1951
|
function TableRowActionDialogButton({ icon, children, ...props }) {
|
|
1944
|
-
return /* @__PURE__ */ jsxs(
|
|
1952
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1945
1953
|
DialogButton,
|
|
1946
1954
|
{
|
|
1947
1955
|
dflex: true,
|
|
@@ -1956,17 +1964,17 @@ function TableRowActionDialogButton({ icon, children, ...props }) {
|
|
|
1956
1964
|
gap: "2",
|
|
1957
1965
|
...props,
|
|
1958
1966
|
children: [
|
|
1959
|
-
icon && /* @__PURE__ */ jsx(Icon, { path: icon, size: "sm" }),
|
|
1967
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { path: icon, size: "sm" }),
|
|
1960
1968
|
children
|
|
1961
1969
|
]
|
|
1962
1970
|
}
|
|
1963
1971
|
);
|
|
1964
1972
|
}
|
|
1965
1973
|
function TableRowEditButton({ children, ...props }) {
|
|
1966
|
-
return /* @__PURE__ */ jsx(TableRowActionDialogButton, { icon: mdiPencil, ...props, children });
|
|
1974
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableRowActionDialogButton, { icon: js.mdiPencil, ...props, children });
|
|
1967
1975
|
}
|
|
1968
1976
|
function TableRowDeleteButton({ children, ...props }) {
|
|
1969
|
-
return /* @__PURE__ */ jsx(TableRowActionDialogButton, { icon: mdiDelete, ...props, children });
|
|
1977
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableRowActionDialogButton, { icon: js.mdiDelete, ...props, children });
|
|
1970
1978
|
}
|
|
1971
1979
|
function TableRowActionBar({
|
|
1972
1980
|
publishId,
|
|
@@ -1977,24 +1985,70 @@ function TableRowActionBar({
|
|
|
1977
1985
|
children,
|
|
1978
1986
|
...props
|
|
1979
1987
|
}) {
|
|
1980
|
-
return /* @__PURE__ */ jsxs("div", { dflex: true, spaceX: "1", placeContent: "end", ...props, children: [
|
|
1981
|
-
viewPath && /* @__PURE__ */ jsx(TableRowViewButton, { path: viewPath }),
|
|
1982
|
-
navigatePath && /* @__PURE__ */ jsx(TableRowNavigateButton, { path: navigatePath }),
|
|
1983
|
-
editDialog && /* @__PURE__ */ jsx(TableRowEditButton, { buildDialog: editDialog }),
|
|
1984
|
-
deleteDialog && /* @__PURE__ */ jsx(TableRowDeleteButton, { buildDialog: deleteDialog }),
|
|
1988
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { dflex: true, spaceX: "1", placeContent: "end", ...props, children: [
|
|
1989
|
+
viewPath && /* @__PURE__ */ jsxRuntime.jsx(TableRowViewButton, { path: viewPath }),
|
|
1990
|
+
navigatePath && /* @__PURE__ */ jsxRuntime.jsx(TableRowNavigateButton, { path: navigatePath }),
|
|
1991
|
+
editDialog && /* @__PURE__ */ jsxRuntime.jsx(TableRowEditButton, { buildDialog: editDialog }),
|
|
1992
|
+
deleteDialog && /* @__PURE__ */ jsxRuntime.jsx(TableRowDeleteButton, { buildDialog: deleteDialog }),
|
|
1985
1993
|
children
|
|
1986
1994
|
] });
|
|
1987
1995
|
}
|
|
1988
|
-
function TableRowPublishPostButton2({ id, api, status, invalidateQueryKey, ...props }) {
|
|
1996
|
+
function TableRowPublishPostButton2({ id, api: api$1, status, invalidateQueryKey, ...props }) {
|
|
1989
1997
|
const isDraft = status == "draft";
|
|
1990
|
-
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey ?? api.queryKey, { networkMode: "always" });
|
|
1991
|
-
const publish =
|
|
1998
|
+
const mutation = api.useInvalidateParentMutation(isDraft ? api$1.publish : api$1.unpublish, invalidateQueryKey ?? api$1.queryKey, { networkMode: "always" });
|
|
1999
|
+
const publish = React8__default.default.useCallback((event) => {
|
|
1992
2000
|
event?.preventDefault();
|
|
1993
2001
|
event?.stopPropagation();
|
|
1994
2002
|
mutation.reset();
|
|
1995
|
-
mutation.mutateAsync(id).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch((error) => toast.error(`Error: ${error}`));
|
|
2003
|
+
mutation.mutateAsync(id).then(() => reactToastify.toast.success(isDraft ? "Published!" : "Unpublished!")).catch((error) => reactToastify.toast.error(`Error: ${error}`));
|
|
1996
2004
|
}, [mutation, id]);
|
|
1997
|
-
return /* @__PURE__ */ jsx(TableRowActionButton, { icon: isDraft ? mdiPublish : mdiPublishOff, onClick: publish, ...props });
|
|
2005
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableRowActionButton, { icon: isDraft ? js.mdiPublish : js.mdiPublishOff, onClick: publish, ...props });
|
|
1998
2006
|
}
|
|
1999
2007
|
|
|
2000
|
-
|
|
2008
|
+
exports.AdminLayout = AdminLayout;
|
|
2009
|
+
exports.AttachDialog = AttachDialog;
|
|
2010
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
2011
|
+
exports.ButtonBar = ButtonBar;
|
|
2012
|
+
exports.ButtonBarButton = ButtonBarButton;
|
|
2013
|
+
exports.ButtonBarDialogButton = ButtonBarDialogButton;
|
|
2014
|
+
exports.ButtonBarSubmitButton = ButtonBarSubmitButton;
|
|
2015
|
+
exports.DialogButton = DialogButton;
|
|
2016
|
+
exports.FormActionDialog = FormActionDialog;
|
|
2017
|
+
exports.InvalidateButton = InvalidateButton;
|
|
2018
|
+
exports.ItemDeleteDialog = ItemDeleteDialog;
|
|
2019
|
+
exports.ItemEditDialog = ItemEditDialog;
|
|
2020
|
+
exports.Menu = Menu;
|
|
2021
|
+
exports.NavigateButton = NavigateButton;
|
|
2022
|
+
exports.OrderCell = OrderCell;
|
|
2023
|
+
exports.PageContainer = PageContainer;
|
|
2024
|
+
exports.PageContentEditor = PageContentEditor;
|
|
2025
|
+
exports.PageMain = PageMain;
|
|
2026
|
+
exports.PageQueryStateContainer = PageQueryStateContainer;
|
|
2027
|
+
exports.PageSectionTitle = PageSectionTitle;
|
|
2028
|
+
exports.PageSidebar = PageSidebar;
|
|
2029
|
+
exports.PageSidebarSection = PageSidebarSection;
|
|
2030
|
+
exports.PageStateContainer = PageStateContainer;
|
|
2031
|
+
exports.PageSubSectionTitle = PageSubSectionTitle;
|
|
2032
|
+
exports.PageTabbedTopBar = PageTabbedTopBar;
|
|
2033
|
+
exports.PageTabbedTopBarProvider = PageTabbedTopBarProvider;
|
|
2034
|
+
exports.PageTitle = PageTitle;
|
|
2035
|
+
exports.PageTopBar = PageTopBar;
|
|
2036
|
+
exports.PageTopBarToolbar = PageTopBarToolbar;
|
|
2037
|
+
exports.PublishButton = PublishButton;
|
|
2038
|
+
exports.ScreenRenderer = ScreenRenderer;
|
|
2039
|
+
exports.SectionTitle = SectionTitle;
|
|
2040
|
+
exports.StatusBadge = StatusBadge;
|
|
2041
|
+
exports.TableContainer = TableContainer;
|
|
2042
|
+
exports.TableCreateButton = TableCreateButton;
|
|
2043
|
+
exports.TableFilterButton = TableFilterButton;
|
|
2044
|
+
exports.TableRowActionBar = TableRowActionBar;
|
|
2045
|
+
exports.TableRowActionButton = TableRowActionButton;
|
|
2046
|
+
exports.TableRowActionDialogButton = TableRowActionDialogButton;
|
|
2047
|
+
exports.TableRowDeleteButton = TableRowDeleteButton;
|
|
2048
|
+
exports.TableRowEditButton = TableRowEditButton;
|
|
2049
|
+
exports.TableRowNavigateButton = TableRowNavigateButton;
|
|
2050
|
+
exports.TableRowPublishPostButton = TableRowPublishPostButton2;
|
|
2051
|
+
exports.TableRowViewButton = TableRowViewButton;
|
|
2052
|
+
exports.TableTopBar = TableTopBar;
|
|
2053
|
+
exports.UpdateButton = UpdateButton;
|
|
2054
|
+
exports.ViewButton = ViewButton;
|