@questpie/admin 3.0.9 → 3.1.0
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/augmentation.d.mts +39 -0
- package/dist/client/builder/types/field-types.d.mts +10 -14
- package/dist/client/components/fields/relation-picker.mjs +2 -2
- package/dist/client/components/fields/relation-select.mjs +3 -3
- package/dist/client/hooks/use-reactive-prop.mjs +308 -0
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/collection/field-renderer.mjs +59 -134
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/login-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/server/augmentation/form-layout.d.mts +48 -4
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/augmentation.d.mts +1 -1
- package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +64 -64
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/session.d.mts +38 -38
- package/dist/server/modules/admin/collections/user.d.mts +32 -32
- package/dist/server/modules/admin/collections/verification.d.mts +32 -32
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +13 -11
- package/dist/server/modules/admin/routes/reactive.mjs +75 -11
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +23 -23
- package/package.json +3 -3
|
@@ -6,12 +6,19 @@ import { Skeleton } from "../../components/ui/skeleton.mjs";
|
|
|
6
6
|
import { scopeDependencies, trackDependencies } from "../../utils/dependency-tracker.mjs";
|
|
7
7
|
import { buildComponentProps, getFieldContext, getFieldOptions, getFullFieldName } from "./field-context.mjs";
|
|
8
8
|
import { useFieldHooks } from "../../hooks/use-field-hooks.mjs";
|
|
9
|
+
import { useReactiveProps } from "../../hooks/use-reactive-prop.mjs";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
10
|
-
import "react";
|
|
11
|
+
import * as React from "react";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
13
14
|
|
|
14
15
|
//#region src/client/views/collection/field-renderer.tsx
|
|
16
|
+
/**
|
|
17
|
+
* FieldRenderer Component
|
|
18
|
+
*
|
|
19
|
+
* Renders a single form field using FieldDefinition.
|
|
20
|
+
* Shared between AutoFormFields and BlockEditor.
|
|
21
|
+
*/
|
|
15
22
|
function renderConfigError(message) {
|
|
16
23
|
return /* @__PURE__ */ jsx("div", {
|
|
17
24
|
className: "border-destructive/40 bg-destructive/5 text-destructive rounded border p-3 text-sm",
|
|
@@ -88,23 +95,19 @@ function computeDynamicDependencyPaths({ fieldOptions, form, fieldPrefix }) {
|
|
|
88
95
|
/**
|
|
89
96
|
* Render field using FieldDefinition.field.component
|
|
90
97
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
98
|
+
* The caller has already merged field-instance options + layout `extraProps`
|
|
99
|
+
* + base props (label/value/onChange/…) into `componentProps` and resolved
|
|
100
|
+
* any `ReactivePropPlaceholder`s via `useReactiveProps`. The component just
|
|
101
|
+
* receives the final flat record.
|
|
94
102
|
*/
|
|
95
103
|
function renderDefinitionComponent({ context, componentProps, blocks }) {
|
|
96
104
|
const Component = context.component;
|
|
97
105
|
if (!Component) return null;
|
|
98
|
-
const options = stripFieldUiOptions(getFieldOptions(context.fieldDef));
|
|
99
106
|
if (context.type === "blocks" && blocks) return /* @__PURE__ */ jsx(Component, {
|
|
100
107
|
...componentProps,
|
|
101
|
-
...options,
|
|
102
108
|
blocks
|
|
103
109
|
});
|
|
104
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
105
|
-
...componentProps,
|
|
106
|
-
...options
|
|
107
|
-
});
|
|
110
|
+
return /* @__PURE__ */ jsx(Component, { ...componentProps });
|
|
108
111
|
}
|
|
109
112
|
/**
|
|
110
113
|
* Render embedded collection field
|
|
@@ -115,15 +118,13 @@ function renderDefinitionComponent({ context, componentProps, blocks }) {
|
|
|
115
118
|
*/
|
|
116
119
|
function renderEmbeddedField({ context, registry, allCollectionsConfig, componentProps, renderEmbeddedFields }) {
|
|
117
120
|
if (context.type !== "embedded") return null;
|
|
118
|
-
const
|
|
119
|
-
const embeddedCollection = options.collection;
|
|
121
|
+
const embeddedCollection = componentProps.collection;
|
|
120
122
|
if (!embeddedCollection) return renderConfigError(`Missing collection for embedded field "${context.fieldName}".`);
|
|
121
123
|
const embeddedCollectionConfig = allCollectionsConfig?.[embeddedCollection];
|
|
122
124
|
const EmbeddedComponent = context.component || registry?.fields?.embedded;
|
|
123
125
|
if (!EmbeddedComponent) return renderConfigError(`No component found for embedded field "${context.fieldName}".`);
|
|
124
126
|
return /* @__PURE__ */ jsx(EmbeddedComponent, {
|
|
125
127
|
...componentProps,
|
|
126
|
-
...options,
|
|
127
128
|
value: context.fieldValue || [],
|
|
128
129
|
collection: embeddedCollection,
|
|
129
130
|
renderFields: (index) => renderEmbeddedFields?.({
|
|
@@ -142,90 +143,38 @@ function renderEmbeddedField({ context, registry, allCollectionsConfig, componen
|
|
|
142
143
|
* 2. FieldDefinition.field.component (registry-first approach)
|
|
143
144
|
* 3. Error message if no component registered
|
|
144
145
|
*/
|
|
145
|
-
function FieldRenderer(
|
|
146
|
-
const $ = c(31);
|
|
147
|
-
const { fieldName, fieldDef, collection, mode: t1, registry, fieldPrefix, allCollectionsConfig, renderEmbeddedFields, className, entityMeta: entityMetaProp, extraProps } = t0;
|
|
148
|
-
const mode = t1 === void 0 ? "collection" : t1;
|
|
146
|
+
function FieldRenderer({ fieldName, fieldDef, collection, mode = "collection", registry, fieldPrefix, allCollectionsConfig, renderEmbeddedFields, className, entityMeta: entityMetaProp, extraProps }) {
|
|
149
147
|
const form = useFormContext();
|
|
150
148
|
const { locale } = useScopedLocale();
|
|
151
149
|
const resolveText = useResolveText();
|
|
152
150
|
const { data: adminConfig } = useAdminConfig();
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
fieldOptions,
|
|
172
|
-
form,
|
|
173
|
-
fieldPrefix
|
|
174
|
-
});
|
|
175
|
-
$[5] = fieldOptions;
|
|
176
|
-
$[6] = fieldPrefix;
|
|
177
|
-
$[7] = form;
|
|
178
|
-
$[8] = t4;
|
|
179
|
-
} else t4 = $[8];
|
|
180
|
-
const dynamicDependencyPaths = t4;
|
|
181
|
-
let t5;
|
|
182
|
-
if ($[9] !== dynamicDependencyPaths || $[10] !== fullFieldName) {
|
|
183
|
-
t5 = new Set([fullFieldName, ...dynamicDependencyPaths]);
|
|
184
|
-
$[9] = dynamicDependencyPaths;
|
|
185
|
-
$[10] = fullFieldName;
|
|
186
|
-
$[11] = t5;
|
|
187
|
-
} else t5 = $[11];
|
|
188
|
-
let t6;
|
|
189
|
-
if ($[12] !== t5) {
|
|
190
|
-
t6 = [...t5];
|
|
191
|
-
$[12] = t5;
|
|
192
|
-
$[13] = t6;
|
|
193
|
-
} else t6 = $[13];
|
|
194
|
-
const t7 = t6;
|
|
195
|
-
let t8;
|
|
196
|
-
if ($[14] !== form.control || $[15] !== t7) {
|
|
197
|
-
t8 = {
|
|
198
|
-
control: form.control,
|
|
199
|
-
name: t7
|
|
200
|
-
};
|
|
201
|
-
$[14] = form.control;
|
|
202
|
-
$[15] = t7;
|
|
203
|
-
$[16] = t8;
|
|
204
|
-
} else t8 = $[16];
|
|
205
|
-
const watchedDependencyValues = useWatch(t8);
|
|
151
|
+
const fullFieldName = getFullFieldName(fieldName, fieldPrefix);
|
|
152
|
+
const fieldOptions = React.useMemo(() => getFieldOptions(fieldDef), [fieldDef]);
|
|
153
|
+
const dynamicDependencyPaths = React.useMemo(() => computeDynamicDependencyPaths({
|
|
154
|
+
fieldOptions,
|
|
155
|
+
form,
|
|
156
|
+
fieldPrefix
|
|
157
|
+
}), [
|
|
158
|
+
fieldOptions,
|
|
159
|
+
form,
|
|
160
|
+
fieldPrefix
|
|
161
|
+
]);
|
|
162
|
+
const watchNames = React.useMemo(() => {
|
|
163
|
+
return [...new Set([fullFieldName, ...dynamicDependencyPaths])];
|
|
164
|
+
}, [fullFieldName, dynamicDependencyPaths]);
|
|
165
|
+
const watchedDependencyValues = useWatch({
|
|
166
|
+
control: form.control,
|
|
167
|
+
name: watchNames
|
|
168
|
+
});
|
|
206
169
|
const watchedFieldValue = Array.isArray(watchedDependencyValues) ? watchedDependencyValues[0] : watchedDependencyValues;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
} else t10$2 = $[18];
|
|
216
|
-
t9 = t10$2;
|
|
217
|
-
break bb0;
|
|
218
|
-
}
|
|
219
|
-
let t10$1;
|
|
220
|
-
if ($[19] !== fieldPrefix || $[20] !== form) {
|
|
221
|
-
t10$1 = form.getValues(fieldPrefix) ?? {};
|
|
222
|
-
$[19] = fieldPrefix;
|
|
223
|
-
$[20] = form;
|
|
224
|
-
$[21] = t10$1;
|
|
225
|
-
} else t10$1 = $[21];
|
|
226
|
-
t9 = t10$1;
|
|
227
|
-
}
|
|
228
|
-
const formValues = t9;
|
|
170
|
+
const formValues = React.useMemo(() => {
|
|
171
|
+
if (!fieldPrefix) return form.getValues() ?? {};
|
|
172
|
+
return form.getValues(fieldPrefix) ?? {};
|
|
173
|
+
}, [
|
|
174
|
+
form,
|
|
175
|
+
fieldPrefix,
|
|
176
|
+
watchedDependencyValues
|
|
177
|
+
]);
|
|
229
178
|
const context = getFieldContext({
|
|
230
179
|
fieldName,
|
|
231
180
|
fieldDef,
|
|
@@ -249,21 +198,22 @@ function FieldRenderer(t0) {
|
|
|
249
198
|
staticOptions: context.options
|
|
250
199
|
});
|
|
251
200
|
if (context.isHidden) return null;
|
|
252
|
-
if (!fieldDef) {
|
|
253
|
-
const t10$1 = `Field "${fieldName}" not found in ${mode === "global" ? "global" : "collection"} "${collection}" config.`;
|
|
254
|
-
let t11;
|
|
255
|
-
if ($[22] !== t10$1) {
|
|
256
|
-
t11 = renderConfigError(t10$1);
|
|
257
|
-
$[22] = t10$1;
|
|
258
|
-
$[23] = t11;
|
|
259
|
-
} else t11 = $[23];
|
|
260
|
-
return t11;
|
|
261
|
-
}
|
|
201
|
+
if (!fieldDef) return renderConfigError(`Field "${fieldName}" not found in ${mode === "global" ? "global" : "collection"} "${collection}" config.`);
|
|
262
202
|
const resolvedOptions = hookOptions ?? context.options;
|
|
263
203
|
const rawComponentProps = buildComponentProps(context);
|
|
204
|
+
const { props: resolvedFieldProps } = useReactiveProps({
|
|
205
|
+
entity: collection,
|
|
206
|
+
entityType: mode,
|
|
207
|
+
field: fullFieldName,
|
|
208
|
+
props: React.useMemo(() => ({
|
|
209
|
+
...stripFieldUiOptions(getFieldOptions(fieldDef)),
|
|
210
|
+
...extraProps ?? {}
|
|
211
|
+
}), [fieldDef, extraProps])
|
|
212
|
+
});
|
|
264
213
|
const fieldValue = isComputed ? computedValue : watchedFieldValue === void 0 ? rawComponentProps.value : watchedFieldValue;
|
|
265
214
|
const componentProps = {
|
|
266
215
|
...rawComponentProps,
|
|
216
|
+
...resolvedFieldProps,
|
|
267
217
|
value: fieldValue,
|
|
268
218
|
onChange: handleChange,
|
|
269
219
|
options: resolvedOptions,
|
|
@@ -271,8 +221,7 @@ function FieldRenderer(t0) {
|
|
|
271
221
|
readOnly: rawComponentProps.readOnly || isComputed,
|
|
272
222
|
label: resolveText(rawComponentProps.label, "", formValues),
|
|
273
223
|
description: resolveText(rawComponentProps.description, "", formValues),
|
|
274
|
-
placeholder: resolveText(rawComponentProps.placeholder, "", formValues)
|
|
275
|
-
...extraProps ?? {}
|
|
224
|
+
placeholder: resolveText(rawComponentProps.placeholder, "", formValues)
|
|
276
225
|
};
|
|
277
226
|
let content = null;
|
|
278
227
|
if (context.type === "embedded") content = renderEmbeddedField({
|
|
@@ -294,36 +243,12 @@ function FieldRenderer(t0) {
|
|
|
294
243
|
componentProps,
|
|
295
244
|
blocks: adminConfig?.blocks
|
|
296
245
|
});
|
|
297
|
-
if (!content) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
$[25] = t11;
|
|
304
|
-
} else t11 = $[25];
|
|
305
|
-
content = t11;
|
|
306
|
-
}
|
|
307
|
-
if (className) {
|
|
308
|
-
let t10$1;
|
|
309
|
-
if ($[26] !== className || $[27] !== content) {
|
|
310
|
-
t10$1 = /* @__PURE__ */ jsx("div", {
|
|
311
|
-
className,
|
|
312
|
-
children: content
|
|
313
|
-
});
|
|
314
|
-
$[26] = className;
|
|
315
|
-
$[27] = content;
|
|
316
|
-
$[28] = t10$1;
|
|
317
|
-
} else t10$1 = $[28];
|
|
318
|
-
return t10$1;
|
|
319
|
-
}
|
|
320
|
-
let t10;
|
|
321
|
-
if ($[29] !== content) {
|
|
322
|
-
t10 = /* @__PURE__ */ jsx(Fragment, { children: content });
|
|
323
|
-
$[29] = content;
|
|
324
|
-
$[30] = t10;
|
|
325
|
-
} else t10 = $[30];
|
|
326
|
-
return t10;
|
|
246
|
+
if (!content) content = renderConfigError(`No component registered for field type "${context.type}" (field: "${context.fieldName}").`);
|
|
247
|
+
if (className) return /* @__PURE__ */ jsx("div", {
|
|
248
|
+
className,
|
|
249
|
+
children: content
|
|
250
|
+
});
|
|
251
|
+
return /* @__PURE__ */ jsx(Fragment, { children: content });
|
|
327
252
|
}
|
|
328
253
|
|
|
329
254
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/accept-invite-page.d.ts
|
|
5
5
|
|
|
@@ -61,6 +61,6 @@ declare function AcceptInvitePage({
|
|
|
61
61
|
redirectTo,
|
|
62
62
|
loginPath,
|
|
63
63
|
minPasswordLength
|
|
64
|
-
}: AcceptInvitePageProps):
|
|
64
|
+
}: AcceptInvitePageProps): react_jsx_runtime9.JSX.Element;
|
|
65
65
|
//#endregion
|
|
66
66
|
export { AcceptInvitePage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/client/views/pages/dashboard-page.d.ts
|
|
4
4
|
|
|
@@ -38,6 +38,6 @@ declare function DashboardPage({
|
|
|
38
38
|
title,
|
|
39
39
|
description,
|
|
40
40
|
className
|
|
41
|
-
}: DashboardPageProps):
|
|
41
|
+
}: DashboardPageProps): react_jsx_runtime7.JSX.Element;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { DashboardPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/forgot-password-page.d.ts
|
|
5
5
|
|
|
@@ -51,6 +51,6 @@ declare function ForgotPasswordPage({
|
|
|
51
51
|
logo,
|
|
52
52
|
loginPath,
|
|
53
53
|
resetPasswordRedirectUrl
|
|
54
|
-
}: ForgotPasswordPageProps):
|
|
54
|
+
}: ForgotPasswordPageProps): react_jsx_runtime8.JSX.Element;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { ForgotPasswordPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/invite-page.d.ts
|
|
5
5
|
|
|
@@ -65,6 +65,6 @@ declare function InvitePage({
|
|
|
65
65
|
defaultRole,
|
|
66
66
|
showMessage,
|
|
67
67
|
onSuccess
|
|
68
|
-
}: InvitePageProps):
|
|
68
|
+
}: InvitePageProps): react_jsx_runtime10.JSX.Element;
|
|
69
69
|
//#endregion
|
|
70
70
|
export { InvitePage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/login-page.d.ts
|
|
5
5
|
|
|
@@ -64,6 +64,6 @@ declare function LoginPage({
|
|
|
64
64
|
signUpPath,
|
|
65
65
|
showForgotPassword,
|
|
66
66
|
showSignUp
|
|
67
|
-
}: LoginPageProps):
|
|
67
|
+
}: LoginPageProps): react_jsx_runtime11.JSX.Element;
|
|
68
68
|
//#endregion
|
|
69
69
|
export { LoginPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/views/pages/reset-password-page.d.ts
|
|
5
5
|
|
|
@@ -58,6 +58,6 @@ declare function ResetPasswordPage({
|
|
|
58
58
|
loginPath,
|
|
59
59
|
minPasswordLength,
|
|
60
60
|
getToken
|
|
61
|
-
}: ResetPasswordPageProps):
|
|
61
|
+
}: ResetPasswordPageProps): react_jsx_runtime12.JSX.Element;
|
|
62
62
|
//#endregion
|
|
63
63
|
export { ResetPasswordPage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/rich-text/rich-text-renderer.d.ts
|
|
4
4
|
/**
|
|
@@ -98,6 +98,6 @@ declare function RichTextRenderer({
|
|
|
98
98
|
content,
|
|
99
99
|
styles: customStyles,
|
|
100
100
|
className
|
|
101
|
-
}: RichTextRendererProps):
|
|
101
|
+
}: RichTextRendererProps): react_jsx_runtime20.JSX.Element | null;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { RichTextRenderer, RichTextStyles, TipTapDoc, TipTapNode };
|
|
@@ -219,6 +219,20 @@ interface FormTabsLayout {
|
|
|
219
219
|
type: "tabs";
|
|
220
220
|
tabs: FormTabConfig[];
|
|
221
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* Per-prop value type for `FormFieldLayoutItem.props` — accepts JSON, a
|
|
224
|
+
* handler function, or a `{ handler, deps?, debounce? }` config.
|
|
225
|
+
*
|
|
226
|
+
* Functions / config objects are resolved server-side via the
|
|
227
|
+
* `/admin/reactive` `prop` endpoint; static JSON is shipped through
|
|
228
|
+
* introspection unchanged. See `FormFieldLayoutItem.props` for the
|
|
229
|
+
* full description.
|
|
230
|
+
*/
|
|
231
|
+
type FormReactivePropValue<TData = any> = unknown | ((ctx: FormReactiveContext<TData>) => unknown | Promise<unknown>) | {
|
|
232
|
+
handler: (ctx: FormReactiveContext<TData>) => unknown | Promise<unknown>;
|
|
233
|
+
deps?: string[] | ((ctx: FormReactiveContext<TData>) => any[]);
|
|
234
|
+
debounce?: number;
|
|
235
|
+
};
|
|
222
236
|
/**
|
|
223
237
|
* Field entry with optional reactive form behavior.
|
|
224
238
|
*/
|
|
@@ -233,12 +247,42 @@ interface FormFieldLayoutItem<TData = any> {
|
|
|
233
247
|
* Extra props forwarded to the field component (escape hatch for
|
|
234
248
|
* component-specific config like relation `filter`).
|
|
235
249
|
*
|
|
236
|
-
*
|
|
250
|
+
* Each prop value can be:
|
|
251
|
+
* - **Static JSON** (string, number, boolean, array, object) — passed
|
|
252
|
+
* through introspection unchanged and given to the field component
|
|
253
|
+
* as-is. Use this when the value doesn't depend on form state.
|
|
254
|
+
* - **A function** `(ctx) => T` — stays on the server. Introspection
|
|
255
|
+
* emits a `ReactivePropPlaceholder` in its place; the client resolves
|
|
256
|
+
* the value via `/admin/reactive` (type `"prop"`) whenever the
|
|
257
|
+
* tracked dependencies change.
|
|
258
|
+
* - **A `{ handler, deps?, debounce? }` config** — same as a function
|
|
259
|
+
* but with explicit dependency control + debouncing.
|
|
260
|
+
*
|
|
261
|
+
* @example Static
|
|
262
|
+
* ```ts
|
|
263
|
+
* { field: f.counselorId, props: { filter: { role: "admin" } } }
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* @example Reactive (deps inferred from handler)
|
|
267
|
+
* ```ts
|
|
268
|
+
* { field: f.author, props: { filter: ({ data }) => ({ team: data.team }) } }
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* @example Reactive with explicit deps + debounce
|
|
237
272
|
* ```ts
|
|
238
|
-
* {
|
|
273
|
+
* {
|
|
274
|
+
* field: f.author,
|
|
275
|
+
* props: {
|
|
276
|
+
* filter: {
|
|
277
|
+
* handler: ({ data }) => ({ team: data.team }),
|
|
278
|
+
* deps: ["team"],
|
|
279
|
+
* debounce: 200,
|
|
280
|
+
* },
|
|
281
|
+
* },
|
|
282
|
+
* }
|
|
239
283
|
* ```
|
|
240
284
|
*/
|
|
241
|
-
props?: Record<string,
|
|
285
|
+
props?: Record<string, FormReactivePropValue<TData>>;
|
|
242
286
|
}
|
|
243
287
|
/**
|
|
244
288
|
* Field layout item - union of field reference or layout container.
|
|
@@ -331,4 +375,4 @@ interface AdminGlobalConfig {
|
|
|
331
375
|
audit?: boolean;
|
|
332
376
|
}
|
|
333
377
|
//#endregion
|
|
334
|
-
export { AdminBlockConfig, AdminCollectionConfig, AdminGlobalConfig, BlockCategoryConfig, FieldLayoutItem, FormFieldLayoutItem, FormReactiveConfig, FormReactiveContext, FormSectionLayout, FormSidebarConfig, FormTabConfig, FormTabsLayout, FormViewConfig, ListViewConfig, PreviewConfig };
|
|
378
|
+
export { AdminBlockConfig, AdminCollectionConfig, AdminGlobalConfig, BlockCategoryConfig, FieldLayoutItem, FormFieldLayoutItem, FormReactiveConfig, FormReactiveContext, FormReactivePropValue, FormSectionLayout, FormSidebarConfig, FormTabConfig, FormTabsLayout, FormViewConfig, ListViewConfig, PreviewConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActionReference, AdminLocaleConfig, ComponentReference, ComponentType, ComponentTypeRegistry } from "./common.mjs";
|
|
2
|
-
import { AdminBlockConfig, AdminCollectionConfig, AdminGlobalConfig, BlockCategoryConfig, FieldLayoutItem, FormFieldLayoutItem, FormReactiveConfig, FormReactiveContext, FormSectionLayout, FormSidebarConfig, FormTabConfig, FormTabsLayout, FormViewConfig, ListViewConfig, PreviewConfig } from "./form-layout.mjs";
|
|
2
|
+
import { AdminBlockConfig, AdminCollectionConfig, AdminGlobalConfig, BlockCategoryConfig, FieldLayoutItem, FormFieldLayoutItem, FormReactiveConfig, FormReactiveContext, FormReactivePropValue, FormSectionLayout, FormSidebarConfig, FormTabConfig, FormTabsLayout, FormViewConfig, ListViewConfig, PreviewConfig } from "./form-layout.mjs";
|
|
3
3
|
import { AdminConfigContext, ComponentDefinition, ComponentFactory, EditViewDefinition, EditViewFactory, FilterViewsByKind, FormViewConfigContext, ListViewConfigContext, ListViewDefinition, ListViewFactory, ViewDefinition, ViewKind, ViewKindRegistry } from "./views.mjs";
|
|
4
4
|
import { BrandLogo, DashboardActionFactory, DashboardActionProxy, DashboardCallback, DashboardCallbackContext, DashboardConfigContext, DashboardContribution, DashboardItemDef, DashboardProxy, DashboardSectionDef, ServerBrandingConfig, ServerChartWidget, ServerCustomWidget, ServerDashboardAction, ServerDashboardConfig, ServerDashboardItem, ServerDashboardSection, ServerDashboardTab, ServerDashboardTabs, ServerDashboardWidget, ServerProgressWidget, ServerQuickAction, ServerQuickActionsWidget, ServerRecentItemsWidget, ServerStatsWidget, ServerTableWidget, ServerTimelineWidget, ServerValueWidget, WidgetAccessRule, WidgetFetchContext } from "./dashboard.mjs";
|
|
5
5
|
import { ServerSidebarCollectionItem, ServerSidebarConfig, ServerSidebarDividerItem, ServerSidebarGlobalItem, ServerSidebarItem, ServerSidebarLinkItem, ServerSidebarPageItem, ServerSidebarSection, SidebarCallback, SidebarCallbackContext, SidebarConfigContext, SidebarContribution, SidebarItemDef, SidebarProxy, SidebarSectionDef } from "./sidebar.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActionReference, AdminLocaleConfig, ComponentReference, ComponentType, ComponentTypeRegistry } from "./augmentation/common.mjs";
|
|
2
|
-
import { AdminBlockConfig, AdminCollectionConfig, AdminGlobalConfig, BlockCategoryConfig, FieldLayoutItem, FormFieldLayoutItem, FormReactiveConfig, FormReactiveContext, FormSectionLayout, FormSidebarConfig, FormTabConfig, FormTabsLayout, FormViewConfig, ListViewConfig, PreviewConfig } from "./augmentation/form-layout.mjs";
|
|
2
|
+
import { AdminBlockConfig, AdminCollectionConfig, AdminGlobalConfig, BlockCategoryConfig, FieldLayoutItem, FormFieldLayoutItem, FormReactiveConfig, FormReactiveContext, FormReactivePropValue, FormSectionLayout, FormSidebarConfig, FormTabConfig, FormTabsLayout, FormViewConfig, ListViewConfig, PreviewConfig } from "./augmentation/form-layout.mjs";
|
|
3
3
|
import { AdminConfigContext, ComponentDefinition, ComponentFactory, EditViewDefinition, EditViewFactory, FilterViewsByKind, FormViewConfigContext, ListViewConfigContext, ListViewDefinition, ListViewFactory, ViewDefinition, ViewKind, ViewKindRegistry } from "./augmentation/views.mjs";
|
|
4
4
|
import { BrandLogo, DashboardActionFactory, DashboardActionProxy, DashboardCallback, DashboardCallbackContext, DashboardConfigContext, DashboardContribution, DashboardItemDef, DashboardProxy, DashboardSectionDef, ServerBrandingConfig, ServerChartWidget, ServerCustomWidget, ServerDashboardAction, ServerDashboardConfig, ServerDashboardItem, ServerDashboardSection, ServerDashboardTab, ServerDashboardTabs, ServerDashboardWidget, ServerProgressWidget, ServerQuickAction, ServerQuickActionsWidget, ServerRecentItemsWidget, ServerStatsWidget, ServerTableWidget, ServerTimelineWidget, ServerValueWidget, WidgetAccessRule, WidgetFetchContext } from "./augmentation/dashboard.mjs";
|
|
5
5
|
import { ServerSidebarCollectionItem, ServerSidebarConfig, ServerSidebarDividerItem, ServerSidebarGlobalItem, ServerSidebarItem, ServerSidebarLinkItem, ServerSidebarPageItem, ServerSidebarSection, SidebarCallback, SidebarCallbackContext, SidebarConfigContext, SidebarContribution, SidebarItemDef, SidebarProxy, SidebarSectionDef } from "./augmentation/sidebar.mjs";
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as questpie_shared27 from "questpie/shared";
|
|
2
|
+
import * as questpie224 from "questpie";
|
|
3
3
|
import * as questpie_src_server_modules_core_fields_email_js5 from "questpie/src/server/modules/core/fields/email.js";
|
|
4
4
|
import * as questpie_src_server_modules_core_fields_json_js5 from "questpie/src/server/modules/core/fields/json.js";
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
5
|
+
import * as drizzle_orm_pg_core52 from "drizzle-orm/pg-core";
|
|
6
|
+
import * as drizzle_orm27 from "drizzle-orm";
|
|
7
7
|
|
|
8
8
|
//#region src/server/modules/admin/collections/admin-locks.d.ts
|
|
9
|
-
declare const _default:
|
|
10
|
-
readonly text: typeof
|
|
11
|
-
readonly textarea: typeof
|
|
9
|
+
declare const _default: questpie224.CollectionBuilder<questpie_shared27.Override<questpie224.EmptyCollectionState<"admin_locks", undefined, {
|
|
10
|
+
readonly text: typeof questpie224.text;
|
|
11
|
+
readonly textarea: typeof questpie224.textarea;
|
|
12
12
|
readonly email: typeof questpie_src_server_modules_core_fields_email_js5.email;
|
|
13
|
-
readonly url: typeof
|
|
14
|
-
readonly number: typeof
|
|
15
|
-
readonly boolean: typeof
|
|
16
|
-
readonly date: typeof
|
|
17
|
-
readonly datetime: typeof
|
|
18
|
-
readonly time: typeof
|
|
19
|
-
readonly select: typeof
|
|
20
|
-
readonly upload: typeof
|
|
21
|
-
readonly relation: typeof
|
|
22
|
-
readonly object: typeof
|
|
13
|
+
readonly url: typeof questpie224.url;
|
|
14
|
+
readonly number: typeof questpie224.number;
|
|
15
|
+
readonly boolean: typeof questpie224.boolean;
|
|
16
|
+
readonly date: typeof questpie224.date;
|
|
17
|
+
readonly datetime: typeof questpie224.datetime;
|
|
18
|
+
readonly time: typeof questpie224.time;
|
|
19
|
+
readonly select: typeof questpie224.select;
|
|
20
|
+
readonly upload: typeof questpie224.upload;
|
|
21
|
+
readonly relation: typeof questpie224.relation;
|
|
22
|
+
readonly object: typeof questpie224.object;
|
|
23
23
|
readonly json: typeof questpie_src_server_modules_core_fields_json_js5.json;
|
|
24
|
-
readonly from: typeof
|
|
24
|
+
readonly from: typeof questpie224.from;
|
|
25
25
|
}>, {
|
|
26
26
|
name: "admin_locks";
|
|
27
27
|
fields: Record<string, any> & {
|
|
28
|
-
readonly resourceType:
|
|
29
|
-
readonly resource:
|
|
30
|
-
readonly resourceId:
|
|
31
|
-
readonly user:
|
|
32
|
-
readonly sessionId:
|
|
33
|
-
readonly expiresAt:
|
|
28
|
+
readonly resourceType: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
29
|
+
readonly resource: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
30
|
+
readonly resourceId: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
31
|
+
readonly user: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
32
|
+
readonly sessionId: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
33
|
+
readonly expiresAt: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgDateStringBuilder>;
|
|
34
34
|
};
|
|
35
35
|
virtuals: undefined;
|
|
36
|
-
relations: Record<string,
|
|
36
|
+
relations: Record<string, questpie224.RelationConfig>;
|
|
37
37
|
indexes: Record<string, any>;
|
|
38
38
|
title: undefined;
|
|
39
|
-
options:
|
|
39
|
+
options: questpie224.CollectionOptions & {
|
|
40
40
|
timestamps: true;
|
|
41
41
|
};
|
|
42
42
|
hooks: Record<string, any>;
|
|
43
43
|
access: Record<string, any>;
|
|
44
44
|
searchable: undefined;
|
|
45
45
|
fieldDefinitions: {
|
|
46
|
-
readonly resourceType:
|
|
46
|
+
readonly resourceType: questpie224.FieldWithMethods<Omit<questpie224.SelectFieldState, "notNull" | "column"> & {
|
|
47
47
|
notNull: true;
|
|
48
|
-
column:
|
|
48
|
+
column: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
49
49
|
} & {
|
|
50
|
-
label:
|
|
51
|
-
},
|
|
52
|
-
readonly resource:
|
|
50
|
+
label: questpie_shared27.I18nText;
|
|
51
|
+
}, questpie224.SelectFieldMethods>;
|
|
52
|
+
readonly resource: questpie224.FieldWithMethods<Omit<questpie224.TextFieldState, "notNull" | "column"> & {
|
|
53
53
|
notNull: true;
|
|
54
|
-
column:
|
|
54
|
+
column: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
55
55
|
} & {
|
|
56
|
-
label:
|
|
57
|
-
},
|
|
58
|
-
readonly resourceId:
|
|
56
|
+
label: questpie_shared27.I18nText;
|
|
57
|
+
}, questpie224.TextFieldMethods>;
|
|
58
|
+
readonly resourceId: questpie224.FieldWithMethods<Omit<questpie224.TextFieldState, "notNull" | "column"> & {
|
|
59
59
|
notNull: true;
|
|
60
|
-
column:
|
|
60
|
+
column: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
61
61
|
} & {
|
|
62
|
-
label:
|
|
63
|
-
},
|
|
64
|
-
readonly user:
|
|
62
|
+
label: questpie_shared27.I18nText;
|
|
63
|
+
}, questpie224.TextFieldMethods>;
|
|
64
|
+
readonly user: questpie224.FieldWithMethods<Omit<questpie224.RelationFieldState<"user">, "notNull" | "column"> & {
|
|
65
65
|
notNull: true;
|
|
66
|
-
column:
|
|
66
|
+
column: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
67
67
|
} & {
|
|
68
|
-
label:
|
|
69
|
-
},
|
|
70
|
-
readonly sessionId:
|
|
68
|
+
label: questpie_shared27.I18nText;
|
|
69
|
+
}, questpie224.RelationFieldMethods>;
|
|
70
|
+
readonly sessionId: questpie224.FieldWithMethods<Omit<questpie224.TextFieldState, "notNull" | "column"> & {
|
|
71
71
|
notNull: true;
|
|
72
|
-
column:
|
|
72
|
+
column: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgVarcharBuilder<[string, ...string[]]>>;
|
|
73
73
|
} & {
|
|
74
|
-
label:
|
|
75
|
-
},
|
|
76
|
-
readonly expiresAt:
|
|
74
|
+
label: questpie_shared27.I18nText;
|
|
75
|
+
}, questpie224.TextFieldMethods>;
|
|
76
|
+
readonly expiresAt: questpie224.FieldWithMethods<Omit<questpie224.DateFieldState, "notNull" | "column"> & {
|
|
77
77
|
notNull: true;
|
|
78
|
-
column:
|
|
78
|
+
column: drizzle_orm27.NotNull<drizzle_orm_pg_core52.PgDateStringBuilder>;
|
|
79
79
|
} & {
|
|
80
|
-
label:
|
|
81
|
-
},
|
|
80
|
+
label: questpie_shared27.I18nText;
|
|
81
|
+
}, questpie224.DateFieldMethods>;
|
|
82
82
|
};
|
|
83
83
|
upload: undefined;
|
|
84
84
|
output: {};
|