@cosmicdrift/kumiko-types 0.384.0 → 0.386.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/db-connection.d.ts +2 -2
- package/dist/handlers.d.ts +3 -1
- package/dist/handlers.js +13 -1
- package/dist/screen-action-form.d.ts +302 -0
- package/dist/screen-action-form.js +1 -0
- package/dist/screen-custom-config.d.ts +122 -0
- package/dist/screen-custom-config.js +1 -0
- package/dist/screen-dashboard.d.ts +348 -0
- package/dist/screen-dashboard.js +10 -0
- package/dist/screen-entity-edit.d.ts +493 -0
- package/dist/screen-entity-edit.js +8 -0
- package/dist/screen-entity-list.d.ts +427 -0
- package/dist/screen-entity-list.js +1 -0
- package/dist/screen-projection.d.ts +217 -0
- package/dist/screen-projection.js +1 -0
- package/dist/screen.d.ts +15 -1877
- package/dist/screen.js +2 -18
- package/dist/where-clause-types.d.ts +1 -0
- package/package.json +1 -1
- package/src/changes.json +12 -0
package/dist/screen.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { NavIconKey } from "./nav-icon.ts";
|
|
2
|
+
import type { ActionFormScreenDefinition, SecretMintScreenDefinition } from "./screen-action-form.ts";
|
|
3
|
+
import type { ConfigEditScreenDefinition, CustomScreenDefinition, SecretsEditScreenDefinition } from "./screen-custom-config.ts";
|
|
4
|
+
import type { DashboardScreenDefinition } from "./screen-dashboard.ts";
|
|
5
|
+
import type { EntityEditScreenDefinition } from "./screen-entity-edit.ts";
|
|
6
|
+
import type { EntityListScreenDefinition } from "./screen-entity-list.ts";
|
|
7
|
+
import type { ProjectionDetailScreenDefinition, ProjectionListScreenDefinition } from "./screen-projection.ts";
|
|
5
8
|
export type { FieldIconKey } from "./field-icon.ts";
|
|
6
9
|
export type PlatformComponent = {
|
|
7
10
|
readonly react?: unknown;
|
|
@@ -79,1879 +82,6 @@ export type FormatSpec = {
|
|
|
79
82
|
}[keyof FieldFormatRegistry];
|
|
80
83
|
export type FieldRenderer = PlatformComponent | string | FormatSpec;
|
|
81
84
|
export type { FieldCondition } from "./fields.ts";
|
|
82
|
-
export type ListColumnSpec = string | {
|
|
83
|
-
readonly field: string;
|
|
84
|
-
readonly renderer?: FieldRenderer;
|
|
85
|
-
/** Optional header, overriding the default
|
|
86
|
-
* `<feature>:entity:<entity>:field:<field>` i18n convention. Resolved
|
|
87
|
-
* through `translate` like any header — an i18n key, or a plain literal
|
|
88
|
-
* shown verbatim if it isn't a key. Also the way to declare a *virtual*
|
|
89
|
-
* column whose `field` is NOT an entity field — a presentational column
|
|
90
|
-
* drawn entirely by a `columnRenderer` component that reads the `row`
|
|
91
|
-
* (e.g. a tag-chips cell), not a stored value. Such a column needs a
|
|
92
|
-
* label; without one it is rejected at boot as an unknown field. `field`
|
|
93
|
-
* is then just a stable column key (pick any unique slug). */
|
|
94
|
-
readonly label?: string;
|
|
95
|
-
/** Marks a column on a query-backed list (projectionList, relatedList,
|
|
96
|
-
* dashboard list, expandableRow) as drawn by a renderer rather than read
|
|
97
|
-
* from a row field. Without it, a query that declares an `outputSchema`
|
|
98
|
-
* must return `field`; a `label` alone does not exempt the column, since
|
|
99
|
-
* nearly every column carries one. */
|
|
100
|
-
readonly virtual?: boolean;
|
|
101
|
-
/** Marks this column as a reference lookup instead of a plain value —
|
|
102
|
-
* for projectionList/relatedList columns, which have no
|
|
103
|
-
* `EntityDefinition` to carry a real `reference` field type. Same
|
|
104
|
-
* target convention as `parseRefTarget`: an entity name (same
|
|
105
|
-
* feature) or `feature:entity` (cross-feature). Ignored on
|
|
106
|
-
* `entityList` columns, where the field's own declared type always
|
|
107
|
-
* wins. */
|
|
108
|
-
readonly refEntity?: string;
|
|
109
|
-
/** Row field on the referenced entity shown as the label (default
|
|
110
|
-
* "id"). Only meaningful together with `refEntity`. */
|
|
111
|
-
readonly refLabelField?: string;
|
|
112
|
-
/** Marks this column as sortable via a clickable header — for
|
|
113
|
-
* relatedList columns, which have no `EntityDefinition` field to carry
|
|
114
|
-
* `sortable` on. Ignored on `entityList` columns, where the entity
|
|
115
|
-
* field's own `sortable` flag wins. */
|
|
116
|
-
readonly sortable?: boolean;
|
|
117
|
-
/** Value type of a relatedList column, which has no `EntityDefinition`
|
|
118
|
-
* field to derive it from. Numeric types right-align the column and its
|
|
119
|
-
* header with tabular figures, like an entityList column of that field
|
|
120
|
-
* type. Ignored on entityList columns, where the field's own type wins. */
|
|
121
|
-
readonly valueType?: "number" | "decimal" | "bigInt" | "money";
|
|
122
|
-
/** Leaves the column out of the compact card layout used below the
|
|
123
|
-
* `md` breakpoint (tables keep it). For columns that only make sense
|
|
124
|
-
* next to the others, like a sort key. */
|
|
125
|
-
readonly hideOnNarrow?: boolean;
|
|
126
|
-
/** Dashboard list panels only. "bar": field holds a 0..1 fraction, drawn
|
|
127
|
-
* as bar + percent. "badge": field holds a label, drawn as a pill whose
|
|
128
|
-
* tone comes from `badgeToneField`. "datetime": field holds an ISO string or
|
|
129
|
-
* epoch ms, shown in the user's locale and time zone. Other list renderers
|
|
130
|
-
* ignore it. */
|
|
131
|
-
readonly display?: ListColumnDisplay;
|
|
132
|
-
/** Row field naming the badge tone; only with `display: "badge"`. */
|
|
133
|
-
readonly badgeToneField?: string;
|
|
134
|
-
};
|
|
135
|
-
export type ListColumnDisplay = "bar" | "badge" | "datetime";
|
|
136
|
-
export type ListBadgeTone = "positive" | "warn" | "negative" | "neutral";
|
|
137
|
-
export type ListPaginationMode = "pages" | "infinite" | false;
|
|
138
|
-
export type ListSortDir = "asc" | "desc";
|
|
139
|
-
export type ListSortSpec = {
|
|
140
|
-
readonly field: string;
|
|
141
|
-
readonly dir: ListSortDir;
|
|
142
|
-
};
|
|
143
|
-
export type ScreenFilterOp = "eq" | "ne" | "lt" | "gt" | "lte" | "gte" | "in";
|
|
144
|
-
export type ScreenFilter = {
|
|
145
|
-
readonly field: string;
|
|
146
|
-
readonly op: ScreenFilterOp;
|
|
147
|
-
readonly value: unknown;
|
|
148
|
-
};
|
|
149
|
-
/** Declarative row-field extractor — JSON-safe (no function prop, survives
|
|
150
|
-
* GET /api/schema / buildAppSchema).
|
|
151
|
-
*
|
|
152
|
-
* `pick`: extracts fields 1:1. `{ pick: ["id", "version"] }` → `{ id: row.id, version: row.version }`
|
|
153
|
-
* `map`: renames fields. `{ map: { incidentId: "id" } }` → `{ incidentId: row.id }`
|
|
154
|
-
*
|
|
155
|
-
* Limitation: computed/templated values can't be expressed this way —
|
|
156
|
-
* that logic belongs server-side in the write handler. */
|
|
157
|
-
export type RowFieldExtractor = {
|
|
158
|
-
readonly pick: readonly string[];
|
|
159
|
-
} | {
|
|
160
|
-
readonly map: Readonly<Record<string, string>>;
|
|
161
|
-
};
|
|
162
|
-
/** How a row action renders inline in the row-action column. `"button"` is a
|
|
163
|
-
* bordered button (its colour follows the action's `style`), `"link"` a text
|
|
164
|
-
* link, `"icon"` an icon-only button (needs a resolved icon, falls back to
|
|
165
|
-
* `"link"` without one). `"responsive"` is a `"button"` with icon and label
|
|
166
|
-
* from tablet width up and an icon-only button below it, the label staying the
|
|
167
|
-
* accessible name (needs a resolved icon, falls back to `"button"` without
|
|
168
|
-
* one). Unset: the renderer decides (primary action as link, the rest in the
|
|
169
|
-
* kebab menu). */
|
|
170
|
-
export type RowActionDisplay = "button" | "link" | "icon" | "responsive";
|
|
171
|
-
/** Row-action column layout. `"adaptive"` (default): primary action as link,
|
|
172
|
-
* the rest in a kebab menu — except actions with an explicit `display`, which
|
|
173
|
-
* stay inline. `"inline"`: every action inline, no kebab. */
|
|
174
|
-
export type RowActionMode = "adaptive" | "inline";
|
|
175
|
-
export type RowAction = RowActionWriteHandler | RowActionNavigate | RowActionDrawer | RowActionClientAction;
|
|
176
|
-
export type RowActionWriteHandler = {
|
|
177
|
-
/** Default für RowActions ohne explizit gesetzten `kind` —
|
|
178
|
-
* Backwards-kompatible Form. Kann auch explizit gesetzt werden. */
|
|
179
|
-
readonly kind?: "writeHandler";
|
|
180
|
-
/** Stable id pro Screen — kebab-case, eindeutig im Action-Set. */
|
|
181
|
-
readonly id: string;
|
|
182
|
-
/** Anzeige-Text (i18n-Key). */
|
|
183
|
-
readonly label: string;
|
|
184
|
-
/** Qualified-Name des Server-Handlers, z.B.
|
|
185
|
-
* "publicstatus:write:maintenance:start". Wird via useDispatcher
|
|
186
|
-
* dispatcht. */
|
|
187
|
-
readonly handler: string;
|
|
188
|
-
/** Deklarativer Payload pro Row. Default = `{ id: row.id }`.
|
|
189
|
-
* `pick` extrahiert Felder gleichen Namens; `map` benennt um. */
|
|
190
|
-
readonly payload?: RowFieldExtractor;
|
|
191
|
-
/** i18n-Key für die Confirm-Dialog-Description. Wenn gesetzt, öffnet
|
|
192
|
-
* ein Modal vor der Ausführung — der User muss explizit bestätigen.
|
|
193
|
-
* Zusammen mit `style: "danger"` ist das die Standard-Sicherheits-
|
|
194
|
-
* Garde für destruktive Aktionen. */
|
|
195
|
-
readonly confirm?: string;
|
|
196
|
-
/** i18n-Key für den Confirm-Button-Text im Dialog. Default = `label`
|
|
197
|
-
* (also "Delete" → "Delete"-Button im Confirm). Setzen wenn die
|
|
198
|
-
* Action einen langen Namen hat ("Mark Subscription as Cancelled")
|
|
199
|
-
* und der Button kürzer sein soll ("Cancel Subscription"). */
|
|
200
|
-
readonly confirmLabel?: string;
|
|
201
|
-
/** Conditional Visibility pro Row. */
|
|
202
|
-
readonly visible?: FieldCondition;
|
|
203
|
-
/** Visual-Style. "danger" rendert rot + erzwingt einen Confirm-
|
|
204
|
-
* Dialog (auch ohne expliziten `confirm`-Key). */
|
|
205
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
206
|
-
/** Overrides the id-based default icon (see ACTION_ICON_BY_ID in
|
|
207
|
-
* kumiko-renderer) — closed IconKey vocabulary into the ICONS registry
|
|
208
|
-
* (renderer/web), analogous to EditFieldSpec.icon. */
|
|
209
|
-
readonly icon?: IconKey;
|
|
210
|
-
/** Inline render form in the row-action column — see `RowActionDisplay`. */
|
|
211
|
-
readonly display?: RowActionDisplay;
|
|
212
|
-
/** Where to go after the write succeeded instead of staying on the shown
|
|
213
|
-
* record. Same forms as entityEdit `redirect`. Honored on record actions
|
|
214
|
-
* (projectionDetail header/section actions, entityEdit header/section
|
|
215
|
-
* actions); a valid `returnTo` wins under the same rule as
|
|
216
|
-
* entityEdit.redirect. Not used by list row actions. Without it, an action
|
|
217
|
-
* deleting the shown record (`<feature>:write:<entity>:delete` with that
|
|
218
|
-
* record's id) leaves to `returnTo`/the list; any other action refetches. */
|
|
219
|
-
readonly redirect?: string | ActionFormRedirect;
|
|
220
|
-
};
|
|
221
|
-
export type RowActionNavigateBase = {
|
|
222
|
-
readonly kind: "navigate";
|
|
223
|
-
readonly id: string;
|
|
224
|
-
readonly label: string;
|
|
225
|
-
/** Feldname dessen Wert als entityId in den URL-Pfad eingebettet wird
|
|
226
|
-
* (`/<workspace>/<screen>/<entityId>`). entityEdit liest die Id
|
|
227
|
-
* AUSSCHLIESSLICH aus dem Pfad. Default: "id" wenn der Ziel-Screen ein
|
|
228
|
-
* entityEdit ist ODER wenn `entity` (statt `screen`) gesetzt ist. */
|
|
229
|
-
readonly entityId?: string;
|
|
230
|
-
/** Declarative URL search params extracted from the clicked row.
|
|
231
|
-
* Both actionForm and entityEdit-create targets read `params` as
|
|
232
|
-
* initial values (pre-filling the form). entityEdit-update does
|
|
233
|
-
* not — the existing record's values take precedence.
|
|
234
|
-
* `pick` extracts fields of the same name; `map` renames them. */
|
|
235
|
-
readonly params?: RowFieldExtractor;
|
|
236
|
-
/** Section id of the tab to activate on the target projectionDetail
|
|
237
|
-
* (layout.mode "tabs"); merged into the navigate search params next to
|
|
238
|
-
* returnTo. Boot validator checks the id exists on the target. */
|
|
239
|
-
readonly tab?: string;
|
|
240
|
-
/** Conditional Visibility pro Row. */
|
|
241
|
-
readonly visible?: FieldCondition;
|
|
242
|
-
/** Visual style only — unlike the writeHandler variants, "danger" does not
|
|
243
|
-
* force a confirm dialog here: the target form is the confirmation. */
|
|
244
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
245
|
-
/** Wenn true, löst ein Klick auf die ganze Zeile (nicht nur das Aktionsmenü)
|
|
246
|
-
* diese navigate-Action aus. Max. eine pro Liste (Boot-Validator prüft). Nur
|
|
247
|
-
* auf navigate — ein Row-Klick darf keinen (evtl. destruktiven, unbestätigten)
|
|
248
|
-
* Write auslösen, daher nicht auf writeHandler-Actions. */
|
|
249
|
-
readonly rowClick?: boolean;
|
|
250
|
-
/** Overrides the id-based default icon (see ACTION_ICON_BY_ID in
|
|
251
|
-
* kumiko-renderer) — closed IconKey vocabulary into the ICONS registry
|
|
252
|
-
* (renderer/web), analogous to EditFieldSpec.icon. */
|
|
253
|
-
readonly icon?: IconKey;
|
|
254
|
-
/** Inline render form in the row-action column — see `RowActionDisplay`. */
|
|
255
|
-
readonly display?: RowActionDisplay;
|
|
256
|
-
};
|
|
257
|
-
/** Exactly one of `screen` / `entity` — mutual exclusivity is type-enforced
|
|
258
|
-
* (boot validator still rejects both/neither for untyped schemas). */
|
|
259
|
-
export type RowActionNavigate = RowActionNavigateBase & ({
|
|
260
|
-
/** Screen-id (kurz, unqualified). Boot-Validator prüft Existenz im
|
|
261
|
-
* selben Feature. */
|
|
262
|
-
readonly screen: string;
|
|
263
|
-
readonly entity?: never;
|
|
264
|
-
} | {
|
|
265
|
-
/** Entity-Name statt Screen-Id (fw#2228) — löst zur Boot-Zeit auf den
|
|
266
|
-
* Screen auf, der `detailFor: "<entity>"` deklariert (siehe ObjectTarget/
|
|
267
|
-
* resolveTarget in @cosmicdrift/kumiko-renderer's nav.tsx). */
|
|
268
|
-
readonly entity: string;
|
|
269
|
-
readonly screen?: never;
|
|
270
|
-
});
|
|
271
|
-
export type RowActionDrawer = {
|
|
272
|
-
readonly kind: "drawer";
|
|
273
|
-
readonly id: string;
|
|
274
|
-
readonly label: string;
|
|
275
|
-
/** Short, unqualified id of an `actionForm` screen in the same feature.
|
|
276
|
-
* Boot validator rejects a missing screen and a screen whose `type`
|
|
277
|
-
* isn't `actionForm` — same check as ToolbarAction's drawer variant
|
|
278
|
-
* (see docs/plans/bundled-features-screen-standardisierung.md §2.6c). */
|
|
279
|
-
readonly screen: string;
|
|
280
|
-
/** Declarative prefill extracted from the clicked row. `pick` extracts
|
|
281
|
-
* fields of the same name; `map` renames them. */
|
|
282
|
-
readonly params?: RowFieldExtractor;
|
|
283
|
-
/** Per-row conditional visibility. */
|
|
284
|
-
readonly visible?: FieldCondition;
|
|
285
|
-
/** Visual style only — unlike the writeHandler variants, "danger" does not
|
|
286
|
-
* force a confirm dialog here: the target form is the confirmation. */
|
|
287
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
288
|
-
/** Overrides the id-based default icon (see ACTION_ICON_BY_ID in
|
|
289
|
-
* kumiko-renderer) — closed IconKey vocabulary into the ICONS registry
|
|
290
|
-
* (renderer/web), analogous to EditFieldSpec.icon. */
|
|
291
|
-
readonly icon?: IconKey;
|
|
292
|
-
/** Inline render form in the row-action column — see `RowActionDisplay`. */
|
|
293
|
-
readonly display?: RowActionDisplay;
|
|
294
|
-
/** Drawer heading (i18n key) instead of the action `label`. `{name}`
|
|
295
|
-
* placeholders resolve from the drawer prefill (`params`), formatted for
|
|
296
|
-
* display like `ActionFormScreenDefinition.summary`. */
|
|
297
|
-
readonly title?: string;
|
|
298
|
-
/** Line under the drawer heading (i18n key or a bare `{name}` template),
|
|
299
|
-
* resolved like `title`. */
|
|
300
|
-
readonly subtitle?: string;
|
|
301
|
-
/** Clicking the row opens this drawer with that row's `params`. At most one
|
|
302
|
-
* `rowClick` action (navigate or drawer) per list; rejected on
|
|
303
|
-
* projectionDetail header actions, like navigate's. */
|
|
304
|
-
readonly rowClick?: boolean;
|
|
305
|
-
};
|
|
306
|
-
export type RowActionClientAction = {
|
|
307
|
-
readonly kind: "clientAction";
|
|
308
|
-
readonly id: string;
|
|
309
|
-
readonly label: string;
|
|
310
|
-
/** Registered client handler name, `<feature>:<kebab>`, e.g.
|
|
311
|
-
* "auth-email-password:request-password-reset". Resolved when the action is
|
|
312
|
-
* triggered; a name no client feature registered shows an error toast. */
|
|
313
|
-
readonly action: string;
|
|
314
|
-
/** Payload handed to the handler, picked from the row (or the shown record).
|
|
315
|
-
* Default `{ id: row.id }`, like a writeHandler. */
|
|
316
|
-
readonly payload?: RowFieldExtractor;
|
|
317
|
-
/** i18n key for the confirm dialog description. */
|
|
318
|
-
readonly confirm?: string;
|
|
319
|
-
/** i18n key for the confirm button, default `label`. */
|
|
320
|
-
readonly confirmLabel?: string;
|
|
321
|
-
/** Conditional visibility per row. */
|
|
322
|
-
readonly visible?: FieldCondition;
|
|
323
|
-
/** Visual style. "danger" forces a confirm dialog, like a writeHandler. */
|
|
324
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
325
|
-
/** Overrides the id-based default icon, see `RowActionWriteHandler.icon`. */
|
|
326
|
-
readonly icon?: IconKey;
|
|
327
|
-
/** Inline render form in the row-action column — see `RowActionDisplay`. */
|
|
328
|
-
readonly display?: RowActionDisplay;
|
|
329
|
-
/** i18n key of the toast shown after the handler reported `{ ok: true }`
|
|
330
|
-
* (default `kumiko.clientAction.success`). */
|
|
331
|
-
readonly successMessage?: string;
|
|
332
|
-
};
|
|
333
|
-
export type ToolbarAction = {
|
|
334
|
-
readonly kind: "navigate";
|
|
335
|
-
readonly id: string;
|
|
336
|
-
readonly label: string;
|
|
337
|
-
/** Screen-id (kurz, unqualified) zu dem navigiert wird. */
|
|
338
|
-
readonly screen: string;
|
|
339
|
-
/** Section id of the tab to activate on the target projectionDetail
|
|
340
|
-
* (layout.mode "tabs"); merged into the navigate search params next to
|
|
341
|
-
* returnTo. Boot validator checks the id exists on the target. */
|
|
342
|
-
readonly tab?: string;
|
|
343
|
-
/** Visual style only — unlike the writeHandler variant, "danger" does
|
|
344
|
-
* not force a confirm dialog here: the target form is the
|
|
345
|
-
* confirmation. */
|
|
346
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
347
|
-
} | {
|
|
348
|
-
readonly kind: "writeHandler";
|
|
349
|
-
readonly id: string;
|
|
350
|
-
readonly label: string;
|
|
351
|
-
readonly handler: string;
|
|
352
|
-
/** Statischer Payload ohne row-Context. Default = `{}`. */
|
|
353
|
-
readonly payload?: Record<string, unknown>;
|
|
354
|
-
/** i18n-Key für Confirm-Dialog-Description. Wenn gesetzt UND/ODER
|
|
355
|
-
* style="danger": Modal vor der Ausführung. */
|
|
356
|
-
readonly confirm?: string;
|
|
357
|
-
/** i18n-Key für Confirm-Button-Text im Dialog. Default = `label`. */
|
|
358
|
-
readonly confirmLabel?: string;
|
|
359
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
360
|
-
} | {
|
|
361
|
-
readonly kind: "drawer";
|
|
362
|
-
readonly id: string;
|
|
363
|
-
readonly label: string;
|
|
364
|
-
/** Short, unqualified id of an `actionForm` screen in the same
|
|
365
|
-
* feature. Boot validator rejects a missing screen and a screen
|
|
366
|
-
* whose `type` isn't `actionForm` — the caller decides full-page
|
|
367
|
-
* vs. drawer, not the form (see docs/plans/bundled-features-screen-
|
|
368
|
-
* standardisierung.md §2.6c). */
|
|
369
|
-
readonly screen: string;
|
|
370
|
-
/** Visual style only — unlike the writeHandler variant, "danger" does
|
|
371
|
-
* not force a confirm dialog here: the target form is the
|
|
372
|
-
* confirmation. */
|
|
373
|
-
readonly style?: "primary" | "secondary" | "danger";
|
|
374
|
-
/** Drawer heading (i18n key) instead of `label`. */
|
|
375
|
-
readonly title?: string;
|
|
376
|
-
/** Line under the drawer heading (i18n key). */
|
|
377
|
-
readonly subtitle?: string;
|
|
378
|
-
};
|
|
379
|
-
export type RelatedListToolbarAction = (Extract<ToolbarAction, {
|
|
380
|
-
readonly kind: "navigate";
|
|
381
|
-
}> & {
|
|
382
|
-
/** Conditional visibility, evaluated against the relatedList's parent
|
|
383
|
-
* record (the "Akte"). */
|
|
384
|
-
readonly visible?: FieldCondition;
|
|
385
|
-
/** Declarative URL search params extracted from the parent record,
|
|
386
|
-
* prefilling the target screen. Replaces the implicit
|
|
387
|
-
* `{ [parentParam]: parentId }` default when set. */
|
|
388
|
-
readonly params?: RowFieldExtractor;
|
|
389
|
-
}) | (Extract<ToolbarAction, {
|
|
390
|
-
readonly kind: "writeHandler";
|
|
391
|
-
}> & {
|
|
392
|
-
readonly visible?: FieldCondition;
|
|
393
|
-
}) | (Extract<ToolbarAction, {
|
|
394
|
-
readonly kind: "drawer";
|
|
395
|
-
}> & {
|
|
396
|
-
readonly visible?: FieldCondition;
|
|
397
|
-
});
|
|
398
|
-
/** Expandable area of an `entityList` row: a relatedList of the row's record.
|
|
399
|
-
* `id` (tab id) and `countField` (tab badge) have no meaning outside a tabs
|
|
400
|
-
* layout and are therefore omitted. `kind` stays the discriminator so further
|
|
401
|
-
* expansion kinds can be added without a breaking change. */
|
|
402
|
-
export type EntityListExpandableRow = Omit<EditRelatedListSection, "id" | "countField">;
|
|
403
|
-
/** An extra choice on a facet next to the field's own options: a named
|
|
404
|
-
* bundle of values ("Running" = several statuses) or "no filter" (`values:
|
|
405
|
-
* []`, e.g. "All"). Chips only. */
|
|
406
|
-
export type EntityListFacetExtraOption = {
|
|
407
|
-
readonly id: string;
|
|
408
|
-
/** i18n key. */
|
|
409
|
-
readonly label: string;
|
|
410
|
-
/** Option values this choice selects; `[]` selects nothing, i.e. no filter. */
|
|
411
|
-
readonly values: readonly string[];
|
|
412
|
-
/** Where the chip sits relative to the field's own options. Default "start". */
|
|
413
|
-
readonly position?: "start" | "end";
|
|
414
|
-
};
|
|
415
|
-
export type EntityListFacetConfig = {
|
|
416
|
-
/** `"select"` (default): dropdown with checkboxes. `"chips"`: one toggle
|
|
417
|
-
* chip per option, single choice. */
|
|
418
|
-
readonly display?: "select" | "chips";
|
|
419
|
-
/** Chips show how many rows each option matches (other facets and the
|
|
420
|
-
* search apply). Counts come from the list query itself, one `limit: 1`
|
|
421
|
-
* count request per chip. */
|
|
422
|
-
readonly showCounts?: boolean;
|
|
423
|
-
/** Chips with zero matching rows are not shown. Needs counts; implies
|
|
424
|
-
* `showCounts`'s requests even when the number itself is not shown. */
|
|
425
|
-
readonly hideEmpty?: boolean;
|
|
426
|
-
readonly extraOptions?: readonly EntityListFacetExtraOption[];
|
|
427
|
-
};
|
|
428
|
-
export type EntityListScreenDefinition = {
|
|
429
|
-
readonly id: string;
|
|
430
|
-
readonly type: "entityList";
|
|
431
|
-
/** Default true: the screen fills the shell content height, its body scrolls
|
|
432
|
-
* inside and the pager / action bar stays pinned. `false` restores page
|
|
433
|
-
* scroll (table grows with its rows, pager below the last row, form footer
|
|
434
|
-
* in the flow). */
|
|
435
|
-
readonly fillHeight?: boolean;
|
|
436
|
-
readonly nav?: ScreenNavSugar;
|
|
437
|
-
readonly detailFor?: string;
|
|
438
|
-
readonly description?: string;
|
|
439
|
-
readonly agent?: AgentScreenHints;
|
|
440
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
441
|
-
* app); exempts it from the nav-area boot check. */
|
|
442
|
-
readonly dormant?: boolean;
|
|
443
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
444
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
445
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
446
|
-
readonly fallback?: string;
|
|
447
|
-
readonly entity: string;
|
|
448
|
-
/** Short screen id (same feature) the create button opens instead of the entity's default edit screen. */
|
|
449
|
-
readonly createScreen?: string;
|
|
450
|
-
/** Set by the role projection when `createScreen` is not reachable for the role: the renderer then shows no create button instead of falling back to the entity's edit screen. Not for app authors. */
|
|
451
|
-
readonly createUnavailable?: boolean;
|
|
452
|
-
/** `false` hides this list's "+ New" button (and the empty-state create CTA) while the entity's edit screen keeps its create branch for other entry points, e.g. a prefilled action. Default `true`. */
|
|
453
|
-
readonly allowCreate?: boolean;
|
|
454
|
-
readonly columns: readonly ListColumnSpec[];
|
|
455
|
-
readonly rowRenderer?: PlatformComponent;
|
|
456
|
-
readonly cardRenderer?: PlatformComponent;
|
|
457
|
-
/** Per-row actions, rendered as an actions column on the right.
|
|
458
|
-
* Adaptive (default, see `rowActionMode`): the primary action as a link,
|
|
459
|
-
* the rest in the kebab menu; actions with an explicit `display` stay
|
|
460
|
-
* inline. Array order is UI order. */
|
|
461
|
-
readonly rowActions?: readonly RowAction[];
|
|
462
|
-
/** Layout of the row-action column — see `RowActionMode`. */
|
|
463
|
-
readonly rowActionMode?: RowActionMode;
|
|
464
|
-
/** Toolbar-Aktionen (List-Header). "Open Incident", "Schedule Maintenance"
|
|
465
|
-
* etc. — neben "+ Neu" wenn vorhanden. Reihenfolge im Array = UI-
|
|
466
|
-
* Reihenfolge, primary-style links. */
|
|
467
|
-
readonly toolbarActions?: readonly ToolbarAction[];
|
|
468
|
-
/** Expandable area under each row: a relatedList of the row's record
|
|
469
|
-
* (parentId = the row's `id`). Rows get a toggle button; several rows can
|
|
470
|
-
* be open at once. Its own row actions run against the sub-list rows, and
|
|
471
|
-
* a successful write also reloads this list. */
|
|
472
|
-
readonly expandableRow?: EntityListExpandableRow;
|
|
473
|
-
/** Server-side Filter, fest am Screen — drei Buckets derselben
|
|
474
|
-
* Entity ohne Custom-Pages (z.B. "Upcoming" / "Active" / "Past"
|
|
475
|
-
* Maintenance). User-side q-Search läuft AUF dem gefilterten Set
|
|
476
|
-
* oben drauf. Boot-Validator pinst dass field in der Entity existiert. */
|
|
477
|
-
readonly filter?: ScreenFilter;
|
|
478
|
-
readonly pagination?: ListPaginationMode;
|
|
479
|
-
readonly pageSize?: number;
|
|
480
|
-
readonly defaultSort?: ListSortSpec;
|
|
481
|
-
/** Initial facet selection, per filterable field: option values (string
|
|
482
|
-
* facets) or a boolean. Applies only while the URL carries no value for
|
|
483
|
-
* that field, so a link or the user's own choice wins; picking "no filter"
|
|
484
|
-
* (an `extraOptions` entry with `values: []`, or clearing the facet) is
|
|
485
|
-
* remembered in the URL and is not overridden again. */
|
|
486
|
-
readonly defaultFilters?: Readonly<Record<string, readonly string[] | boolean>>;
|
|
487
|
-
/** Per-facet display options for the entity's `filterable` fields, keyed by
|
|
488
|
-
* field name. `false` hides the facet's control (its filter stays usable
|
|
489
|
-
* through `defaultFilters` and the URL). Fields without an entry keep the
|
|
490
|
-
* default dropdown. */
|
|
491
|
-
readonly facets?: Readonly<Record<string, EntityListFacetConfig | false>>;
|
|
492
|
-
/** Replaces the default empty-list title/hint; the create button stays when the list can create. */
|
|
493
|
-
readonly emptyState?: ListEmptyStateSpec;
|
|
494
|
-
/** i18n key for the primary create button label (default `kumiko.actions.create`). */
|
|
495
|
-
readonly createLabel?: string;
|
|
496
|
-
/** i18n key for the search field placeholder (default `kumiko.list.search-placeholder`). */
|
|
497
|
-
readonly searchPlaceholder?: string;
|
|
498
|
-
readonly searchable?: boolean;
|
|
499
|
-
readonly slots?: ScreenSlots;
|
|
500
|
-
readonly access?: AccessRule;
|
|
501
|
-
};
|
|
502
|
-
export type ListFacetSpec = {
|
|
503
|
-
readonly field: string;
|
|
504
|
-
readonly type: "select";
|
|
505
|
-
readonly label: string;
|
|
506
|
-
readonly options: readonly {
|
|
507
|
-
readonly value: string;
|
|
508
|
-
readonly label: string;
|
|
509
|
-
}[];
|
|
510
|
-
} | {
|
|
511
|
-
readonly field: string;
|
|
512
|
-
readonly type: "boolean";
|
|
513
|
-
readonly label: string;
|
|
514
|
-
readonly trueLabel: string;
|
|
515
|
-
readonly falseLabel: string;
|
|
516
|
-
} | {
|
|
517
|
-
readonly field: string;
|
|
518
|
-
readonly type: "reference";
|
|
519
|
-
readonly label: string;
|
|
520
|
-
/** Entity name (same feature) or `feature:entity` (cross-feature), same
|
|
521
|
-
* convention as `ListColumnSpec.refEntity`. Options load at render time. */
|
|
522
|
-
readonly entity: string;
|
|
523
|
-
/** Row field on the referenced entity shown as the option label
|
|
524
|
-
* (default "id"). */
|
|
525
|
-
readonly labelField?: string;
|
|
526
|
-
} | {
|
|
527
|
-
/** Declarative only — the date field the range narrows. It is NOT sent
|
|
528
|
-
* to the server (the bounds go under `params`); it namespaces the
|
|
529
|
-
* facet's URL keys and tells a reading agent which column this list
|
|
530
|
-
* is time-rangeable on. */
|
|
531
|
-
readonly field: string;
|
|
532
|
-
readonly type: "dateRange";
|
|
533
|
-
readonly label: string;
|
|
534
|
-
/** Query-payload keys the chosen bounds are sent under as ISO instants.
|
|
535
|
-
* Explicit rather than a `from`/`to` convention — a query is free to
|
|
536
|
-
* name its time bounds anything, and the boot-validator checks these
|
|
537
|
-
* keys against the handler's Zod schema. */
|
|
538
|
-
readonly params: {
|
|
539
|
-
readonly from: string;
|
|
540
|
-
readonly to: string;
|
|
541
|
-
};
|
|
542
|
-
};
|
|
543
|
-
export type ProjectionListScreenDefinition = {
|
|
544
|
-
readonly id: string;
|
|
545
|
-
readonly type: "projectionList";
|
|
546
|
-
/** Default true: the screen fills the shell content height, its body scrolls
|
|
547
|
-
* inside and the pager / action bar stays pinned. `false` restores page
|
|
548
|
-
* scroll (table grows with its rows, pager below the last row, form footer
|
|
549
|
-
* in the flow). */
|
|
550
|
-
readonly fillHeight?: boolean;
|
|
551
|
-
readonly nav?: ScreenNavSugar;
|
|
552
|
-
readonly detailFor?: string;
|
|
553
|
-
readonly description?: string;
|
|
554
|
-
readonly agent?: AgentScreenHints;
|
|
555
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
556
|
-
* app); exempts it from the nav-area boot check. */
|
|
557
|
-
readonly dormant?: boolean;
|
|
558
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
559
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
560
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
561
|
-
readonly fallback?: string;
|
|
562
|
-
readonly query: string;
|
|
563
|
-
readonly columns: readonly ListColumnSpec[];
|
|
564
|
-
readonly rowRenderer?: PlatformComponent;
|
|
565
|
-
readonly cardRenderer?: PlatformComponent;
|
|
566
|
-
readonly rowActions?: readonly RowAction[];
|
|
567
|
-
/** Layout of the row-action column — see `RowActionMode`. */
|
|
568
|
-
readonly rowActionMode?: RowActionMode;
|
|
569
|
-
readonly toolbarActions?: readonly ToolbarAction[];
|
|
570
|
-
readonly pagination?: ListPaginationMode;
|
|
571
|
-
readonly pageSize?: number;
|
|
572
|
-
readonly defaultSort?: ListSortSpec;
|
|
573
|
-
/** Replaces the default empty-list title/hint; the create button stays when the list can create. */
|
|
574
|
-
readonly emptyState?: ListEmptyStateSpec;
|
|
575
|
-
/** i18n key for the primary create button label (default `kumiko.actions.create`). */
|
|
576
|
-
readonly createLabel?: string;
|
|
577
|
-
/** i18n key for the search field placeholder (default `kumiko.list.search-placeholder`). */
|
|
578
|
-
readonly searchPlaceholder?: string;
|
|
579
|
-
readonly searchable?: boolean;
|
|
580
|
-
/** Derived by buildAppSchema from the query handler's Zod schema (`sort`
|
|
581
|
-
* param present). Same type serves author and wire schema (no separate
|
|
582
|
-
* client-facing screen type exists), so this stays structurally
|
|
583
|
-
* writable — validateProjectionListScreens rejects any hand-authored
|
|
584
|
-
* value at boot (fw#2165). */
|
|
585
|
-
readonly sortable?: boolean;
|
|
586
|
-
/** Derived by buildAppSchema from the query handler's Zod schema (`cursor`
|
|
587
|
-
* or `offset` param present). See `sortable` doc for why this is
|
|
588
|
-
* boot-enforced rather than type-enforced. */
|
|
589
|
-
readonly paginated?: boolean;
|
|
590
|
-
/** Server-side filter, fixed on the screen — see `ScreenFilter` doc above
|
|
591
|
-
* (entityList). Field existence can't be checked without an entity; the
|
|
592
|
-
* boot-validator only checks structure (`op:"in"` ⇒ array value). */
|
|
593
|
-
readonly filter?: ScreenFilter;
|
|
594
|
-
/** User-toggleable facet dropdowns — see `ListFacetSpec` doc. `field`
|
|
595
|
-
* must be a declared column, except for `type: "reference"`: it filters
|
|
596
|
-
* by id through the bound query's `filters` and needs a registered
|
|
597
|
-
* `entity` instead. The bound query handler must accept `filters` in its
|
|
598
|
-
* Zod schema — the boot-validator checks both. A
|
|
599
|
-
* "dateRange" facet instead needs its two `params` keys in that schema;
|
|
600
|
-
* it sends no `filters` entry. */
|
|
601
|
-
readonly facets?: readonly ListFacetSpec[];
|
|
602
|
-
readonly slots?: ScreenSlots;
|
|
603
|
-
readonly access?: AccessRule;
|
|
604
|
-
};
|
|
605
|
-
export type RecordHeaderSubtitlePart = string | {
|
|
606
|
-
readonly field: string;
|
|
607
|
-
readonly navigate?: MetricNavigate;
|
|
608
|
-
};
|
|
609
|
-
export type RecordHeaderSpec = {
|
|
610
|
-
readonly title: string;
|
|
611
|
-
/** Field name, or several parts (field name or `{ field, navigate }`)
|
|
612
|
-
* joined by a separator; parts with an empty value are dropped. */
|
|
613
|
-
readonly subtitle?: string | readonly RecordHeaderSubtitlePart[];
|
|
614
|
-
readonly status?: string;
|
|
615
|
-
/** Record field holding an absolute http(s) URL. When present and the
|
|
616
|
-
* field's value is such a URL, the subtitle renders as an external link
|
|
617
|
-
* (`target="_blank"`) instead of plain text. Only valid with the string
|
|
618
|
-
* form of `subtitle`. */
|
|
619
|
-
readonly subtitleHref?: string;
|
|
620
|
-
/** Record field whose value selects the `statusTones` entry, for a badge text that
|
|
621
|
-
* carries more than the state (e.g. "Terminated on 31.03.2027"). Defaults to `status`. */
|
|
622
|
-
readonly statusToneField?: string;
|
|
623
|
-
/** Badge tone per `statusToneField` value (default: the `status` value); unlisted values fall back to the value heuristic. */
|
|
624
|
-
readonly statusTones?: {
|
|
625
|
-
readonly [statusValue: string]: SelectOptionTone;
|
|
626
|
-
};
|
|
627
|
-
};
|
|
628
|
-
export type MetricNavigate = {
|
|
629
|
-
readonly screen?: string;
|
|
630
|
-
readonly entity?: string;
|
|
631
|
-
readonly entityId?: string;
|
|
632
|
-
readonly params?: RowFieldExtractor;
|
|
633
|
-
/** Section id of the tab to activate at the destination. Alone (no
|
|
634
|
-
* `screen`/`entity`), it activates that tab on the current record
|
|
635
|
-
* instead of navigating away. */
|
|
636
|
-
readonly tab?: string;
|
|
637
|
-
};
|
|
638
|
-
export type MetricSpec = {
|
|
639
|
-
readonly field: string;
|
|
640
|
-
readonly label: string;
|
|
641
|
-
readonly navigate?: MetricNavigate;
|
|
642
|
-
};
|
|
643
|
-
export type ProjectionDetailScreenDefinition = {
|
|
644
|
-
readonly id: string;
|
|
645
|
-
readonly type: "projectionDetail";
|
|
646
|
-
/** Default true: the screen fills the shell content height, its body scrolls
|
|
647
|
-
* inside and the pager / action bar stays pinned. `false` restores page
|
|
648
|
-
* scroll (table grows with its rows, pager below the last row, form footer
|
|
649
|
-
* in the flow). */
|
|
650
|
-
readonly fillHeight?: boolean;
|
|
651
|
-
readonly nav?: ScreenNavSugar;
|
|
652
|
-
readonly detailFor?: string;
|
|
653
|
-
readonly description?: string;
|
|
654
|
-
readonly agent?: AgentScreenHints;
|
|
655
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
656
|
-
* app); exempts it from the nav-area boot check. */
|
|
657
|
-
readonly dormant?: boolean;
|
|
658
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
659
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
660
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
661
|
-
readonly fallback?: string;
|
|
662
|
-
readonly query: string;
|
|
663
|
-
/** Query output field whose value titles the page header (breadcrumb) when no `header` is set. */
|
|
664
|
-
readonly recordTitleField?: string;
|
|
665
|
-
/** Query-payload key for the row-id. Default "id". */
|
|
666
|
-
readonly idParam?: string;
|
|
667
|
-
/** The server determines the shown row from the caller's session/context
|
|
668
|
-
* instead of a row id in the path — a self-service screen ("my profile",
|
|
669
|
-
* "my data") that has no row to link to (unlike `EntityEditScreenDefinition.
|
|
670
|
-
* singleton`, which still resolves via `<entity>:list` limit 1; here the
|
|
671
|
-
* query itself owns the row selection, e.g. `user:query:user:me`). The
|
|
672
|
-
* query is called WITHOUT the `idParam` key — there is no id to send, so
|
|
673
|
-
* the boot-validator rejects declaring `idParam` alongside this flag
|
|
674
|
-
* instead of letting one silently win. Stricter than an id-addressed
|
|
675
|
-
* screen, not looser: the server picks the row, so no client-supplied id
|
|
676
|
-
* can reach the query — a stray id on the path is ignored, never
|
|
677
|
-
* forwarded. */
|
|
678
|
-
readonly singleton?: boolean;
|
|
679
|
-
readonly layout: EditLayout;
|
|
680
|
-
/** Optionaler per-Field-Label-i18n-Key (Field-Name → Key), analog zu
|
|
681
|
-
* entityEdit.fieldLabels. Die Pseudo-Entity `__projection-detail__` hat
|
|
682
|
-
* keinen natürlichen Field-Namespace — fehlt ein Eintrag, gilt die
|
|
683
|
-
* Konvention `<feature>:entity:__projection-detail__:field:<name>`. */
|
|
684
|
-
readonly fieldLabels?: Readonly<Record<string, string>>;
|
|
685
|
-
/** Record header above the layout — title/subtitle/status name columns
|
|
686
|
-
* in the query row (not literals). Rendered only when set. */
|
|
687
|
-
readonly header?: RecordHeaderSpec;
|
|
688
|
-
/** Metric band above the layout — column names in the query row, each with its own i18n `label`.
|
|
689
|
-
* Rendered only when set. */
|
|
690
|
-
readonly metrics?: readonly MetricSpec[];
|
|
691
|
-
/** Parent list screen (kurze id) für eine "Zurück"-Navigation. */
|
|
692
|
-
readonly listScreenId?: string;
|
|
693
|
-
readonly slots?: ScreenSlots;
|
|
694
|
-
readonly access?: AccessRule;
|
|
695
|
-
/** Header action buttons. Reuses `RowAction` — the screen's single
|
|
696
|
-
* displayed record stands in for the "row", so `pick`/`map`, `visible`,
|
|
697
|
-
* `confirm`/`confirmLabel` and `style` keep their meaning unchanged.
|
|
698
|
-
* `rowClick` has no target here (there is no row to click) and is
|
|
699
|
-
* rejected by the boot-validator. */
|
|
700
|
-
readonly actions?: readonly RowAction[];
|
|
701
|
-
/** Id of the action that stays the visible header button when the actions
|
|
702
|
-
* collapse into a menu (and the one that keeps the phone icon slot when it
|
|
703
|
-
* has an icon and no confirm). An `actions` id or `"edit"` (the default edit
|
|
704
|
-
* action); default precedence is `edit`, then `style: "primary"`, then the
|
|
705
|
-
* first action. */
|
|
706
|
-
readonly primaryAction?: string;
|
|
707
|
-
/** How head fields render. Default "text" — plain text instead of a
|
|
708
|
-
* disabled Input, since every field on this screen type is forced
|
|
709
|
-
* readOnly anyway (there is no write path, see the shim doc above).
|
|
710
|
-
* Set "form" to opt back into the disabled-Input look (fw#2245). */
|
|
711
|
-
readonly valueDisplay?: "form" | "text";
|
|
712
|
-
};
|
|
713
|
-
/** Text a query handler can send untranslated: the renderer translates it. */
|
|
714
|
-
export type DashboardI18nText = {
|
|
715
|
-
readonly i18nKey: string;
|
|
716
|
-
readonly i18nParams?: Readonly<Record<string, DashboardTextParam>>;
|
|
717
|
-
};
|
|
718
|
-
/** Minor units (like Money fields), formatted with the user locale. */
|
|
719
|
-
export type DashboardMoneyParam = {
|
|
720
|
-
readonly kind: "money";
|
|
721
|
-
readonly amountMinor: number;
|
|
722
|
-
readonly currency: string;
|
|
723
|
-
};
|
|
724
|
-
/** Epoch ms, rendered as a medium date in the user time zone. */
|
|
725
|
-
export type DashboardDateParam = {
|
|
726
|
-
readonly kind: "date";
|
|
727
|
-
readonly atMs: number;
|
|
728
|
-
};
|
|
729
|
-
/** Epoch ms, rendered relative to now ("5 minutes ago", "in 30 seconds") in the
|
|
730
|
-
* user locale; the text keeps ticking while it is on screen. */
|
|
731
|
-
export type DashboardRelativeTimeParam = {
|
|
732
|
-
readonly kind: "relativeTime";
|
|
733
|
-
readonly atMs: number;
|
|
734
|
-
};
|
|
735
|
-
/** Nested DashboardI18nText params resolve first (e.g. a duration "{years} {months}"
|
|
736
|
-
* with one plural key each); numbers stay raw so plural rules can read `count`. */
|
|
737
|
-
export type DashboardTextParam = string | number | DashboardI18nText | DashboardMoneyParam | DashboardDateParam | DashboardRelativeTimeParam;
|
|
738
|
-
/** Plain string is displayed as-is; DashboardI18nText is translated by the renderer. */
|
|
739
|
-
export type DashboardText = string | DashboardI18nText;
|
|
740
|
-
/** Chart/stat values are minor units, formatted with the user locale. */
|
|
741
|
-
export type DashboardCurrencyFormat = {
|
|
742
|
-
readonly kind: "currency";
|
|
743
|
-
readonly currency: string;
|
|
744
|
-
/** Defaults to the currency's own decimals. */
|
|
745
|
-
readonly fractionDigits?: number;
|
|
746
|
-
};
|
|
747
|
-
/** The stat value is an epoch ms timestamp, shown relative to now and kept current. */
|
|
748
|
-
export type DashboardRelativeTimeFormat = {
|
|
749
|
-
readonly kind: "relativeTime";
|
|
750
|
-
};
|
|
751
|
-
/** Stat panels take both formats; chart panels only the currency one. */
|
|
752
|
-
export type DashboardValueFormat = DashboardCurrencyFormat | DashboardRelativeTimeFormat;
|
|
753
|
-
export type DashboardPanelQueryOptions = {
|
|
754
|
-
/** Static, author-set query parameters merged on top of the screen's
|
|
755
|
-
* dynamic filterParams — lets a panel pin a value (e.g. a status facet)
|
|
756
|
-
* the screen-wide filter doesn't cover, without needing its own query.
|
|
757
|
-
* The panel wins over the screen filter and the time range. */
|
|
758
|
-
readonly params?: Readonly<Record<string, unknown>>;
|
|
759
|
-
/** The screen `filter` value is NOT merged into this panel's query (a tenant
|
|
760
|
-
* picker must not hit sources without a tenant column). The screen
|
|
761
|
-
* `timeRange` still is. */
|
|
762
|
-
readonly ignoreScreenFilter?: boolean;
|
|
763
|
-
};
|
|
764
|
-
export type DashboardPanelGate = {
|
|
765
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
766
|
-
};
|
|
767
|
-
export type DashboardPanelSpan = "half" | "full";
|
|
768
|
-
export type DashboardPanelEmptyState = {
|
|
769
|
-
readonly span?: DashboardPanelSpan;
|
|
770
|
-
readonly emptyLabel?: string;
|
|
771
|
-
/** Second line under `emptyLabel`. */
|
|
772
|
-
readonly emptyHint?: string;
|
|
773
|
-
};
|
|
774
|
-
export declare const DASHBOARD_STAT_TONES: readonly ["default", "positive", "ok", "warn", "negative"];
|
|
775
|
-
export type DashboardStatTone = (typeof DASHBOARD_STAT_TONES)[number];
|
|
776
|
-
export type DashboardStatPanel = DashboardPanelQueryOptions & DashboardPanelGate & {
|
|
777
|
-
readonly kind: "stat";
|
|
778
|
-
/** Stable id: kebab-case, unique within the panel set. */
|
|
779
|
-
readonly id: string;
|
|
780
|
-
/** Display text (i18n key). */
|
|
781
|
-
readonly label: string;
|
|
782
|
-
readonly query: string;
|
|
783
|
-
readonly valueField: string;
|
|
784
|
-
readonly subField?: string;
|
|
785
|
-
readonly toneField?: string;
|
|
786
|
-
/** Formats a numeric value as currency (minor units) or, with `relativeTime`, as
|
|
787
|
-
* a ticking "5 minutes ago" from epoch ms; ignored for string values. The sparkline is not formatted. */
|
|
788
|
-
readonly valueFormat?: DashboardValueFormat;
|
|
789
|
-
/** Fixed tone when `toneField` is unset or yields none; not applied while the value is 0. */
|
|
790
|
-
readonly tone?: DashboardStatTone;
|
|
791
|
-
/** Record field holding `{ atMs, value | null }[]` (MetricResult.points),
|
|
792
|
-
* drawn as a sparkline next to the value. */
|
|
793
|
-
readonly sparklineField?: string;
|
|
794
|
-
/** Delta chip (e.g. "↓23 %") next to the label. It renders only when BOTH
|
|
795
|
-
* fields are set AND the query handler returns them; otherwise the tile
|
|
796
|
-
* looks as it does without a delta. `deltaToneField` falls back to
|
|
797
|
-
* `toneField`/"default" when unset. */
|
|
798
|
-
readonly deltaField?: string;
|
|
799
|
-
readonly deltaDirectionField?: string;
|
|
800
|
-
readonly deltaToneField?: string;
|
|
801
|
-
/** Static icon next to the label. Unlike value/sub/delta it does not vary
|
|
802
|
-
* per query result; it is an author decision like the panel itself.
|
|
803
|
-
* Resolved through the same extensionSectionComponents registry as custom
|
|
804
|
-
* panels; the registered component usually ignores
|
|
805
|
-
* entityName/entityId/filterParams (a plain icon has no entity context). */
|
|
806
|
-
readonly icon?: PlatformComponent;
|
|
807
|
-
/** Static CSS color value (e.g. "var(--color-debt)") for the icon chip,
|
|
808
|
-
* passed straight to the tile without a registry lookup. Applies ONLY when
|
|
809
|
-
* `icon` is set (StatCard renders the chip only together with an icon);
|
|
810
|
-
* without an icon the value is silently dropped. Without `accentColor` the
|
|
811
|
-
* chip follows the tone, including a `toneField` value delivered per result.
|
|
812
|
-
* An accent that should change with the result (e.g. by sign) goes through
|
|
813
|
-
* `toneField`; leave `accentColor` unset then. */
|
|
814
|
-
readonly accentColor?: string;
|
|
815
|
-
};
|
|
816
|
-
export type DashboardChartKind = "timeseries" | "stacked-bars" | "segment-bars" | "stacked-area";
|
|
817
|
-
export type DashboardChartTone = "positive" | "negative" | "active" | "neutral";
|
|
818
|
-
/** Look of the markers whose `kind` matches: a dashed guide line through the
|
|
819
|
-
* plot plus a colored pin. `color` (raw CSS color) wins over `tone`. */
|
|
820
|
-
export type DashboardChartMarkerKind = {
|
|
821
|
-
readonly tone?: DashboardChartTone;
|
|
822
|
-
readonly color?: string;
|
|
823
|
-
/** i18n key; with `markerLegend: "legend"` the chart legend lists the markers of this kind under it. */
|
|
824
|
-
readonly label?: string;
|
|
825
|
-
};
|
|
826
|
-
/** One option of a stacked-area range switch. Without `months` the option
|
|
827
|
-
* shows every bucket; with it, a window of that many months anchored at
|
|
828
|
-
* `todayMs` (or the last bucket). `label` is an i18n key. */
|
|
829
|
-
export type DashboardChartRangeOption = {
|
|
830
|
-
readonly value: string;
|
|
831
|
-
readonly label: string;
|
|
832
|
-
readonly months?: number;
|
|
833
|
-
};
|
|
834
|
-
export type DashboardChartRanges = {
|
|
835
|
-
readonly options: readonly DashboardChartRangeOption[];
|
|
836
|
-
readonly default: string;
|
|
837
|
-
};
|
|
838
|
-
export type DashboardChartPanel = DashboardPanelQueryOptions & DashboardPanelEmptyState & DashboardPanelGate & {
|
|
839
|
-
readonly kind: "chart";
|
|
840
|
-
readonly id: string;
|
|
841
|
-
readonly label: string;
|
|
842
|
-
readonly chart: DashboardChartKind;
|
|
843
|
-
readonly query: string;
|
|
844
|
-
/** i18n key under the title, e.g. "7 days, by creation day". */
|
|
845
|
-
readonly subtitle?: string;
|
|
846
|
-
/** Series/segment/line key -> tone; unmapped keys fall back to a palette. */
|
|
847
|
-
readonly seriesTones?: Readonly<Record<string, DashboardChartTone>>;
|
|
848
|
-
/** Series/segment/line key -> raw CSS color (e.g. "var(--color-debt)"); wins over `seriesTones`. */
|
|
849
|
-
readonly seriesColors?: Readonly<Record<string, string>>;
|
|
850
|
-
/** Formats values as currency (minor units): y ticks, legend totals and tooltips on
|
|
851
|
-
* stacked-bars/segment-bars/stacked-area, only the y ticks on timeseries. */
|
|
852
|
-
readonly valueFormat?: DashboardCurrencyFormat;
|
|
853
|
-
/** i18n key of a unit label. Only for chart "timeseries": shown once above the y ticks instead of on every tick. */
|
|
854
|
-
readonly unit?: string;
|
|
855
|
-
/** Only for chart "stacked-area": fixed width per bucket, plot scrolls horizontally. */
|
|
856
|
-
readonly scrollable?: boolean;
|
|
857
|
-
/** Only for chart "stacked-area": marker `kind` -> look. Markers without a
|
|
858
|
-
* declared kind keep the neutral numbered pin. */
|
|
859
|
-
readonly markerKinds?: Readonly<Record<string, DashboardChartMarkerKind>>;
|
|
860
|
-
/** Only for chart "stacked-area": false hides the per-series sums in the
|
|
861
|
-
* legend (they mean nothing for balances). Default true. */
|
|
862
|
-
readonly legendTotals?: boolean;
|
|
863
|
-
/** Only for chart "stacked-area": range switch in the panel header. */
|
|
864
|
-
readonly ranges?: DashboardChartRanges;
|
|
865
|
-
/** Only for chart "stacked-area": scrubber under the plot to drag the visible window; starts at today. */
|
|
866
|
-
readonly brush?: boolean;
|
|
867
|
-
/** Only for chart "stacked-area": date format of axis and marker labels.
|
|
868
|
-
* Default automatic: day and month below 18 visible months, month and year above. */
|
|
869
|
-
readonly dateFormat?: "day" | "month";
|
|
870
|
-
/** Only for chart "stacked-area": window the uncontrolled chart starts in.
|
|
871
|
-
* "from-today" starts at today even when `ranges.default` is set. Default "default-range". */
|
|
872
|
-
readonly initialWindow?: "default-range" | "from-today";
|
|
873
|
-
/** Only for chart "stacked-area": "legend" drops the numbered marker list; pins become
|
|
874
|
-
* plain dots with a tooltip and the legend lists marker kinds (see `markerKinds[].label`). Default "list". */
|
|
875
|
-
readonly markerLegend?: "list" | "legend";
|
|
876
|
-
/** Only for chart "stacked-area": true writes each marker label vertically next to its guide line on wide panels; narrow panels keep the pins. Default false. */
|
|
877
|
-
readonly markerLabels?: boolean;
|
|
878
|
-
};
|
|
879
|
-
export type DashboardListPanel = DashboardPanelQueryOptions & DashboardPanelEmptyState & DashboardPanelGate & {
|
|
880
|
-
readonly kind: "list";
|
|
881
|
-
readonly id: string;
|
|
882
|
-
readonly label: string;
|
|
883
|
-
readonly query: string;
|
|
884
|
-
readonly columns: readonly ListColumnSpec[];
|
|
885
|
-
};
|
|
886
|
-
export type DashboardStatGroupPanel = DashboardPanelGate & {
|
|
887
|
-
readonly kind: "stat-group";
|
|
888
|
-
readonly id: string;
|
|
889
|
-
readonly label?: string;
|
|
890
|
-
/** i18n key, a line under `label`; the boot validator requires `label`. */
|
|
891
|
-
readonly subtitle?: string;
|
|
892
|
-
readonly span?: DashboardPanelSpan;
|
|
893
|
-
readonly stats: readonly DashboardStatPanel[];
|
|
894
|
-
};
|
|
895
|
-
export type DashboardFeedPanel = DashboardPanelQueryOptions & DashboardPanelEmptyState & DashboardPanelGate & {
|
|
896
|
-
readonly kind: "feed";
|
|
897
|
-
readonly id: string;
|
|
898
|
-
readonly label: string;
|
|
899
|
-
readonly query: string;
|
|
900
|
-
};
|
|
901
|
-
export type DashboardProgressTone = "default" | "danger";
|
|
902
|
-
export type DashboardProgressListPanel = DashboardPanelQueryOptions & DashboardPanelEmptyState & DashboardPanelGate & {
|
|
903
|
-
readonly kind: "progress-list";
|
|
904
|
-
readonly id: string;
|
|
905
|
-
readonly label: string;
|
|
906
|
-
readonly query: string;
|
|
907
|
-
};
|
|
908
|
-
export type DashboardCustomPanel = {
|
|
909
|
-
readonly kind: "custom";
|
|
910
|
-
readonly id: string;
|
|
911
|
-
readonly component: PlatformComponent;
|
|
912
|
-
};
|
|
913
|
-
export type DashboardTextBlock = {
|
|
914
|
-
readonly kind: "heading";
|
|
915
|
-
readonly text: string;
|
|
916
|
-
} | {
|
|
917
|
-
readonly kind: "paragraph";
|
|
918
|
-
readonly text: string;
|
|
919
|
-
/** Default "muted", like body copy inside panels. */
|
|
920
|
-
readonly emphasis?: "muted" | "strong";
|
|
921
|
-
} | {
|
|
922
|
-
readonly kind: "list";
|
|
923
|
-
readonly items: readonly string[];
|
|
924
|
-
} | {
|
|
925
|
-
readonly kind: "code";
|
|
926
|
-
readonly code: string;
|
|
927
|
-
} | {
|
|
928
|
-
readonly kind: "hint";
|
|
929
|
-
readonly text: string;
|
|
930
|
-
} | {
|
|
931
|
-
readonly kind: "link";
|
|
932
|
-
/** Link label (i18n key). */
|
|
933
|
-
readonly text: string;
|
|
934
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>`. */
|
|
935
|
-
readonly screen: string;
|
|
936
|
-
/** Show the link only to users holding one of these roles. Display
|
|
937
|
-
* gate only: the target screen's own `access` stays the enforcement. */
|
|
938
|
-
readonly roles?: readonly string[];
|
|
939
|
-
};
|
|
940
|
-
export type DashboardTextPanel = DashboardPanelGate & {
|
|
941
|
-
readonly kind: "text";
|
|
942
|
-
readonly id: string;
|
|
943
|
-
/** Panel title (i18n key). */
|
|
944
|
-
readonly label?: string;
|
|
945
|
-
readonly span?: DashboardPanelSpan;
|
|
946
|
-
readonly blocks: readonly DashboardTextBlock[];
|
|
947
|
-
};
|
|
948
|
-
export type DashboardPanelVisibility = {
|
|
949
|
-
readonly query: string;
|
|
950
|
-
readonly field: string;
|
|
951
|
-
readonly eq: string | number | boolean | null;
|
|
952
|
-
};
|
|
953
|
-
export type DashboardScreenPanel = {
|
|
954
|
-
readonly kind: "screen";
|
|
955
|
-
readonly id: string;
|
|
956
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>`. */
|
|
957
|
-
readonly screen: string;
|
|
958
|
-
readonly label?: string;
|
|
959
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
960
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` embedded in this
|
|
961
|
-
* panel's place when `visibleWhen` is unmet or its query fails (nothing while it loads).
|
|
962
|
-
* Needs `visibleWhen`; the target must not have a `visibleWhen` of its own. */
|
|
963
|
-
readonly fallback?: string;
|
|
964
|
-
/** Render the embedded form without its own card frame and padding, aligned to
|
|
965
|
-
* the dashboard's page grid like a standalone settings screen. Default false
|
|
966
|
-
* (framed card); set for panels whose body is a settings-list form, where a
|
|
967
|
-
* card inside the page would double the inset. */
|
|
968
|
-
readonly chromeless?: boolean;
|
|
969
|
-
};
|
|
970
|
-
export type DashboardPanelDefinition = DashboardStatPanel | DashboardStatGroupPanel | DashboardChartPanel | DashboardListPanel | DashboardFeedPanel | DashboardProgressListPanel | DashboardTextPanel | DashboardCustomPanel | DashboardScreenPanel;
|
|
971
|
-
export type DashboardFilterDefinition = {
|
|
972
|
-
readonly id: string;
|
|
973
|
-
readonly label: string;
|
|
974
|
-
readonly kind: "select";
|
|
975
|
-
readonly placeholder?: string;
|
|
976
|
-
/** i18n-Key für den "(alle)"-Eintrag. */
|
|
977
|
-
readonly allLabel?: string;
|
|
978
|
-
readonly options?: readonly {
|
|
979
|
-
readonly value: string;
|
|
980
|
-
readonly label: string;
|
|
981
|
-
}[];
|
|
982
|
-
/** Query-Result-Contract: `{ rows: { value: string; label: string }[] }`. */
|
|
983
|
-
readonly optionsQuery?: string;
|
|
984
|
-
};
|
|
985
|
-
export type DashboardTimeRangeDefinition = {
|
|
986
|
-
readonly id: string;
|
|
987
|
-
/** `label` is an i18n key. */
|
|
988
|
-
readonly options: readonly {
|
|
989
|
-
readonly value: string;
|
|
990
|
-
readonly label: string;
|
|
991
|
-
}[];
|
|
992
|
-
readonly default: string;
|
|
993
|
-
};
|
|
994
|
-
export type DashboardScopeDefinition = {
|
|
995
|
-
readonly badge: string;
|
|
996
|
-
readonly notice?: string;
|
|
997
|
-
};
|
|
998
|
-
/** Minimum polling interval of `DashboardScreenDefinition.refresh`; shorter values are rejected
|
|
999
|
-
* at boot (`seconds`) or raised at runtime (`field`). */
|
|
1000
|
-
export declare const DASHBOARD_MIN_REFRESH_SECONDS = 5;
|
|
1001
|
-
export type DashboardRecordBinding = {
|
|
1002
|
-
/** URL search param carrying the record id. Without it the dashboard shows a
|
|
1003
|
-
* hint instead of its panels and runs no query. */
|
|
1004
|
-
readonly param: string;
|
|
1005
|
-
/** Key of the id in each panel query payload. Default: `param`. */
|
|
1006
|
-
readonly payloadKey?: string;
|
|
1007
|
-
/** Optional query for the record row (QN). It receives `{ [payloadKey]: id }`
|
|
1008
|
-
* and returns a flat row; `actions` take that row as their input and
|
|
1009
|
-
* `refresh.field` and `titleField` read from it. */
|
|
1010
|
-
readonly query?: string;
|
|
1011
|
-
/** Field of the record row shown as the page title. Needs `query`. */
|
|
1012
|
-
readonly titleField?: string;
|
|
1013
|
-
};
|
|
1014
|
-
/** Polling of the record and all panel queries, never faster than
|
|
1015
|
-
* DASHBOARD_MIN_REFRESH_SECONDS. `field` reads the seconds from the record row
|
|
1016
|
-
* (needs `record.query`), so a monitor can be polled at its own check interval. */
|
|
1017
|
-
export type DashboardRefresh = {
|
|
1018
|
-
readonly seconds: number;
|
|
1019
|
-
} | {
|
|
1020
|
-
readonly field: string;
|
|
1021
|
-
};
|
|
1022
|
-
export type DashboardScreenDefinition = {
|
|
1023
|
-
readonly id: string;
|
|
1024
|
-
readonly type: "dashboard";
|
|
1025
|
-
readonly nav?: ScreenNavSugar;
|
|
1026
|
-
readonly detailFor?: string;
|
|
1027
|
-
readonly description?: string;
|
|
1028
|
-
readonly agent?: AgentScreenHints;
|
|
1029
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
1030
|
-
* app); exempts it from the nav-area boot check. */
|
|
1031
|
-
readonly dormant?: boolean;
|
|
1032
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1033
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1034
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1035
|
-
readonly fallback?: string;
|
|
1036
|
-
readonly panels: readonly DashboardPanelDefinition[];
|
|
1037
|
-
/** Binds the dashboard to one record via a URL search param, see DashboardRecordBinding. */
|
|
1038
|
-
readonly record?: DashboardRecordBinding;
|
|
1039
|
-
/** Header actions on the bound record (writeHandler, navigate, clientAction).
|
|
1040
|
-
* The row is the `record.query` row, or `{ id, [payloadKey]: id }` without a
|
|
1041
|
-
* query. After a success the record and all panels refetch. Needs `record`;
|
|
1042
|
-
* no drawer, redirect or rowClick. */
|
|
1043
|
-
readonly actions?: readonly RowAction[];
|
|
1044
|
-
readonly refresh?: DashboardRefresh;
|
|
1045
|
-
readonly filter?: DashboardFilterDefinition;
|
|
1046
|
-
/** Segmented control in the toolbar; the value lives in URL search param
|
|
1047
|
-
* `id` and is merged into EVERY panel query (also ignoreScreenFilter ones). */
|
|
1048
|
-
readonly timeRange?: DashboardTimeRangeDefinition;
|
|
1049
|
-
/** Marks the screen as spanning more than the caller's own scope. */
|
|
1050
|
-
readonly scope?: DashboardScopeDefinition;
|
|
1051
|
-
/** Show the "Updated at" timestamp in the toolbar. Default true; turn off for
|
|
1052
|
-
* dashboards that host forms rather than live metrics, where a load time
|
|
1053
|
-
* next to the form reads as stale data. */
|
|
1054
|
-
readonly showUpdatedAt?: boolean;
|
|
1055
|
-
readonly slots?: ScreenSlots;
|
|
1056
|
-
readonly access?: AccessRule;
|
|
1057
|
-
};
|
|
1058
|
-
export type EditFieldSpec = string | {
|
|
1059
|
-
readonly field: string;
|
|
1060
|
-
readonly span?: number;
|
|
1061
|
-
readonly visible?: FieldCondition;
|
|
1062
|
-
readonly readOnly?: FieldCondition;
|
|
1063
|
-
readonly required?: FieldCondition;
|
|
1064
|
-
readonly renderer?: FieldRenderer;
|
|
1065
|
-
/** `false` keeps the field out of the submitted payload — for values
|
|
1066
|
-
* that are shown or prefilled for display only (a label, a counter)
|
|
1067
|
-
* and that the write handler's schema does not accept. Validation and
|
|
1068
|
-
* rendering are unchanged. */
|
|
1069
|
-
readonly submit?: false;
|
|
1070
|
-
/** Prefix icon on the input — closed FieldIconKey vocabulary into
|
|
1071
|
-
* the FIELD_ICONS registry (renderer/web), analogous to
|
|
1072
|
-
* `ScreenNavSugar.icon` / NavIconKey. Only takes effect for
|
|
1073
|
-
* single-line `type: "text"` and `"number"` — a `text` field with
|
|
1074
|
-
* `multiline` routes to a textarea (no icon slot), and other input
|
|
1075
|
-
* kinds (select, combobox, date, …) silently ignore the key. */
|
|
1076
|
-
readonly icon?: FieldIconKey;
|
|
1077
|
-
/** Input placeholder (i18n key, falls back to the literal). Only for
|
|
1078
|
-
* single-line text, number and textarea inputs; other kinds ignore it. */
|
|
1079
|
-
readonly placeholder?: string;
|
|
1080
|
-
/** Static text shown before the input (i18n key, falls back to the
|
|
1081
|
-
* literal), or `{ field }` for the current form value of another field
|
|
1082
|
-
* (a hidden field carrying e.g. a base domain). Only for single-line
|
|
1083
|
-
* text and number inputs; other kinds ignore it. */
|
|
1084
|
-
readonly prefix?: FieldAffix;
|
|
1085
|
-
/** Same as `prefix`, shown after the input. */
|
|
1086
|
-
readonly suffix?: FieldAffix;
|
|
1087
|
-
/** Button beside the input that runs a query and writes one scalar of
|
|
1088
|
-
* its result into this field. Also offered on a readOnly field, where
|
|
1089
|
-
* the value can only come from the suggestion. Only for single-line
|
|
1090
|
-
* text and number inputs; other kinds ignore it. */
|
|
1091
|
-
readonly fillAction?: FieldFillAction;
|
|
1092
|
-
/** Marks this field as a reference lookup instead of a plain value —
|
|
1093
|
-
* for projectionDetail fields, which have no `EntityDefinition` to
|
|
1094
|
-
* carry a real `reference` field type. Same target convention as
|
|
1095
|
-
* `parseRefTarget` (and `ListColumnSpec.refEntity`): an entity name
|
|
1096
|
-
* (same feature) or `feature:entity` (cross-feature). Ignored on
|
|
1097
|
-
* `entityEdit` fields, where the field's own declared type always
|
|
1098
|
-
* wins. */
|
|
1099
|
-
readonly refEntity?: string;
|
|
1100
|
-
/** Row field on the referenced entity shown as the label (default
|
|
1101
|
-
* "id"). Only meaningful together with `refEntity`. */
|
|
1102
|
-
readonly refLabelField?: string;
|
|
1103
|
-
/** Embedded-list fields only (`createEmbeddedListField`). */
|
|
1104
|
-
readonly embeddedList?: EmbeddedListEditSpec;
|
|
1105
|
-
/** Fills an empty value when the create form opens; the update form and
|
|
1106
|
-
* values from URL params or a handoff are never touched. Unlike a
|
|
1107
|
-
* field `default`, it is not applied server-side. */
|
|
1108
|
-
readonly prefill?: EditFieldPrefill;
|
|
1109
|
-
};
|
|
1110
|
-
export type FieldAffix = string | {
|
|
1111
|
-
readonly field: string;
|
|
1112
|
-
};
|
|
1113
|
-
export type FieldFillAction = {
|
|
1114
|
-
/** i18n key (falls back to the literal) of the button label. */
|
|
1115
|
-
readonly label: string;
|
|
1116
|
-
/** Qualified query name, run with the current form values picked by `params`. */
|
|
1117
|
-
readonly query: string;
|
|
1118
|
-
/** Key in the query result written into the field; the value must be a
|
|
1119
|
-
* string or a number, anything else counts as a failed fill. */
|
|
1120
|
-
readonly field: string;
|
|
1121
|
-
/** Form fields sent as the query payload (none: an empty payload). */
|
|
1122
|
-
readonly params?: RowFieldExtractor;
|
|
1123
|
-
};
|
|
1124
|
-
export type EmbeddedListEditSpec = {
|
|
1125
|
-
/** Sub-fields shown as read-only cells; every other cell stays editable. */
|
|
1126
|
-
readonly readOnlyCells?: readonly string[];
|
|
1127
|
-
/** `true` keeps the rows as they are: no add, remove, duplicate, move or
|
|
1128
|
-
* paste-appended rows. Cells stay editable (unless in `readOnlyCells`). */
|
|
1129
|
-
readonly fixedRows?: boolean;
|
|
1130
|
-
};
|
|
1131
|
-
export type EditFieldPrefill = {
|
|
1132
|
-
readonly kind: "today";
|
|
1133
|
-
} | {
|
|
1134
|
-
readonly kind: "currentUser";
|
|
1135
|
-
readonly property: "displayName" | "email" | "id";
|
|
1136
|
-
};
|
|
1137
|
-
export type EditSectionSpec = EditFieldsSection | EditExtensionSection | EditRelatedListSection | EditWriteFormSection;
|
|
1138
|
-
type EditFieldsSectionBase = {
|
|
1139
|
-
/** Kebab-case tab id, used as the `?tab=` value. Required by the
|
|
1140
|
-
* boot-validator when the enclosing `EditLayout.mode` is "tabs". */
|
|
1141
|
-
readonly id?: string;
|
|
1142
|
-
readonly kind?: "fields";
|
|
1143
|
-
/** Optional. Ohne Titel rendert die Section nur ihre Felder (keine h3-
|
|
1144
|
-
* Überschrift) — für flache Forms (Card-Titel + Felder direkt, ein
|
|
1145
|
-
* einzelner Abschnitt) wie bei den meisten shadcn-Form-Mustern. */
|
|
1146
|
-
readonly title?: string;
|
|
1147
|
-
/** Optional help text under the block heading (i18n key or raw string,
|
|
1148
|
-
* like `title`) — makes a form usable without training instead of
|
|
1149
|
-
* falling back to custom JSX for help text. Renders through the same
|
|
1150
|
-
* `subtitle` slot as `FormProps.subtitle`. Works without `title` too
|
|
1151
|
-
* (subtitle-only section). */
|
|
1152
|
-
readonly description?: string;
|
|
1153
|
-
readonly columns?: number;
|
|
1154
|
-
/** Rendered left of the section title, `text-muted-foreground` — closed
|
|
1155
|
-
* IconKey vocabulary into the ICONS registry (renderer/web), analogous
|
|
1156
|
-
* to EditFieldSpec.icon. No title → no icon, and no heuristic derives
|
|
1157
|
-
* one from the title (titles are free i18n strings). */
|
|
1158
|
-
readonly icon?: IconKey;
|
|
1159
|
-
/** Record field rendered as a count badge in the tab label when the
|
|
1160
|
-
* enclosing `EditLayout.mode` is "tabs" (e.g. an open-items counter).
|
|
1161
|
-
* Ignored outside tabs mode or when the field's value is not a finite
|
|
1162
|
-
* number. */
|
|
1163
|
-
readonly countField?: string;
|
|
1164
|
-
/** Short line (i18n key) under this step's title in the wizard step rail
|
|
1165
|
-
* and in the "up next" box. Wizard layouts only; unlike `description` it
|
|
1166
|
-
* is not shown inside the step. */
|
|
1167
|
-
readonly subtitle?: string;
|
|
1168
|
-
/** Rendered top-right in the section's Card title row — same
|
|
1169
|
-
* navigate/drawer/writeHandler dispatch as `ProjectionDetailScreenDefinition.actions`,
|
|
1170
|
-
* evaluated against the same record. Every action must resolve an icon
|
|
1171
|
-
* (declared or id-derived); the boot-validator rejects one that doesn't. */
|
|
1172
|
-
readonly actions?: readonly RowAction[];
|
|
1173
|
-
};
|
|
1174
|
-
export type EditFieldGroup = {
|
|
1175
|
-
readonly title: string;
|
|
1176
|
-
readonly fields: readonly EditFieldSpec[];
|
|
1177
|
-
/** Default 2. */
|
|
1178
|
-
readonly columns?: number;
|
|
1179
|
-
};
|
|
1180
|
-
/** Either a flat `fields` grid or titled `groups` cards, never both: the groups branch has no
|
|
1181
|
-
* `fields` key, so a raw `.fields` read on a section does not compile — use `sectionFieldSpecs`. */
|
|
1182
|
-
export type EditFieldsSection = EditFieldsSectionBase & ({
|
|
1183
|
-
readonly fields: readonly EditFieldSpec[];
|
|
1184
|
-
} | {
|
|
1185
|
-
/** Splits the section into multiple titled cards instead of one flat grid; fields named
|
|
1186
|
-
* here still need to exist. */
|
|
1187
|
-
readonly groups: readonly EditFieldGroup[];
|
|
1188
|
-
});
|
|
1189
|
-
export type EditExtensionSection = {
|
|
1190
|
-
/** Kebab-case tab id, used as the `?tab=` value. Required by the
|
|
1191
|
-
* boot-validator when the enclosing `EditLayout.mode` is "tabs". */
|
|
1192
|
-
readonly id?: string;
|
|
1193
|
-
readonly kind: "extension";
|
|
1194
|
-
readonly title: string;
|
|
1195
|
-
readonly component: PlatformComponent;
|
|
1196
|
-
/** When true, the extension registers via `useExtensionFormSubmit` and the
|
|
1197
|
-
* surrounding form's Save button should activate for its dirty state.
|
|
1198
|
-
* Omit/false for extensions that persist through their own dispatcher
|
|
1199
|
-
* writes (e.g. notes-history NotesSection) — otherwise a read-only form
|
|
1200
|
-
* shows a Save button that does nothing (fw#2359). */
|
|
1201
|
-
readonly contributesToFormSubmit?: boolean;
|
|
1202
|
-
/** Overrides the host-derived entity name passed to the mounted component.
|
|
1203
|
-
* Required on `projectionDetail` (which has no real entity — the host
|
|
1204
|
-
* value there is an internal placeholder) so a self-persisting extension
|
|
1205
|
-
* like NotesSection filters/writes against the right domain entity. Takes
|
|
1206
|
-
* precedence over the host value on every screen type. */
|
|
1207
|
-
readonly entityName?: string;
|
|
1208
|
-
/** Record field rendered as a count badge in the tab label when the
|
|
1209
|
-
* enclosing `EditLayout.mode` is "tabs" (e.g. an open-items counter).
|
|
1210
|
-
* Ignored outside tabs mode or when the field's value is not a finite
|
|
1211
|
-
* number. */
|
|
1212
|
-
readonly countField?: string;
|
|
1213
|
-
/** Rendered top-right in the section's Card title row — same
|
|
1214
|
-
* navigate/drawer/writeHandler dispatch as `ProjectionDetailScreenDefinition.actions`,
|
|
1215
|
-
* evaluated against the same record. Every action must resolve an icon
|
|
1216
|
-
* (declared or id-derived); the boot-validator rejects one that doesn't. */
|
|
1217
|
-
readonly actions?: readonly RowAction[];
|
|
1218
|
-
};
|
|
1219
|
-
/** Rows are grouped by `field` in order of first appearance. Every group gets
|
|
1220
|
-
* a collapsible header. */
|
|
1221
|
-
export type RelatedListGroupBy = {
|
|
1222
|
-
readonly field: string;
|
|
1223
|
-
/** Groups whose field value equals this start collapsed; the others start open. */
|
|
1224
|
-
readonly collapsedWhen?: string | number | boolean | null;
|
|
1225
|
-
/** i18n key of the group header. Placeholders: `{count}` rows in the group,
|
|
1226
|
-
* `{value}` the group's field value, `{lastDate}` the group's latest
|
|
1227
|
-
* `dateField` value as a locale date. A group with neither `label` nor an
|
|
1228
|
-
* entry in `labels` renders its rows without a header and never collapses. */
|
|
1229
|
-
readonly label?: string;
|
|
1230
|
-
/** Header i18n key per group value (as string), overriding `label`. */
|
|
1231
|
-
readonly labels?: Readonly<Record<string, string>>;
|
|
1232
|
-
/** Row field (ISO date or timestamp) behind `{lastDate}`. */
|
|
1233
|
-
readonly dateField?: string;
|
|
1234
|
-
};
|
|
1235
|
-
/** Group key of a field value; `collapsedWhen` and row values both go through it. */
|
|
1236
|
-
export declare function relatedListGroupKey(value: unknown): string;
|
|
1237
|
-
export declare function relatedListGroupHeaderLabel(groupBy: RelatedListGroupBy, groupKey: string): string | undefined;
|
|
1238
|
-
/** Row tint rule: rows where the `FieldCondition` (`{ field, eq }`, `{ field,
|
|
1239
|
-
* in }` …) holds get the tone. `bad` renders red. */
|
|
1240
|
-
export type RelatedListRowTone = Exclude<FieldCondition, boolean> & {
|
|
1241
|
-
readonly tone: SelectOptionTone;
|
|
1242
|
-
};
|
|
1243
|
-
/** Replacement for the default "no rows" box of a list. `title`/`description`
|
|
1244
|
-
* are i18n keys. `action` is a record action evaluated against an empty
|
|
1245
|
-
* record on list screens (the parent record on a relatedList); its icon must
|
|
1246
|
-
* resolve, same as `ProjectionDetailScreenDefinition.actions`. A narrowed list
|
|
1247
|
-
* (search term or changed filters) shows the neutral "no matches" text instead. */
|
|
1248
|
-
export type ListEmptyStateSpec = {
|
|
1249
|
-
readonly title: string;
|
|
1250
|
-
readonly description?: string;
|
|
1251
|
-
readonly action?: RowAction;
|
|
1252
|
-
};
|
|
1253
|
-
export type EditRelatedListSection = {
|
|
1254
|
-
/** Kebab-case tab id, used as the `?tab=` value. Required by the
|
|
1255
|
-
* boot-validator when the enclosing `EditLayout.mode` is "tabs". */
|
|
1256
|
-
readonly id?: string;
|
|
1257
|
-
readonly kind: "relatedList";
|
|
1258
|
-
readonly title: string;
|
|
1259
|
-
/** Fully qualified query QN. Same paged envelope as projectionList.query:
|
|
1260
|
-
* `{ rows, nextCursor, total? }`. */
|
|
1261
|
-
readonly query: string;
|
|
1262
|
-
/** Query-payload key the parent record's id is passed under. Default "id". */
|
|
1263
|
-
readonly parentParam?: string;
|
|
1264
|
-
/** Server-side WHERE clause pinning this section to the parent record —
|
|
1265
|
-
* sent as `payload.filter: { field, op: "eq", value: parentId }`, kept
|
|
1266
|
-
* out of the user-facet `filters` array so it can't be cleared by facet
|
|
1267
|
-
* interaction. Lets a tab reuse the generic `<entity>:list` query instead
|
|
1268
|
-
* of a bespoke child-rows handler. Mutually exclusive with `parentParam`
|
|
1269
|
-
* (the boot-validator rejects both). `field` must be a real field on the
|
|
1270
|
-
* entity behind `query`, and that query's Zod schema must accept
|
|
1271
|
-
* `filter` (same requirement `filter`/`facets` already have). The filter is
|
|
1272
|
-
* client-supplied: any caller may omit it, so the bound query must authorize
|
|
1273
|
-
* the ENTIRE row set it can return, not just the parent's children. */
|
|
1274
|
-
readonly parentFilter?: {
|
|
1275
|
-
readonly field: string;
|
|
1276
|
-
};
|
|
1277
|
-
readonly columns: readonly ListColumnSpec[];
|
|
1278
|
-
/** Entity the query's rows belong to: an entity name (same feature) or
|
|
1279
|
-
* `feature:entity`. Columns that name one of its fields render like an
|
|
1280
|
-
* entityList column of that field (select as a status badge with the
|
|
1281
|
-
* translated option label, dates locale-formatted, default header from the
|
|
1282
|
-
* field's label key). The column's own `sortable` still decides the
|
|
1283
|
-
* header sort. Without it every column renders as plain text. */
|
|
1284
|
-
readonly entity?: string;
|
|
1285
|
-
/** i18n key for the one-line hint at the left of the tab toolbar. */
|
|
1286
|
-
readonly description?: string;
|
|
1287
|
-
/** i18n key holding plural forms for the footer count ("1 Position",
|
|
1288
|
-
* "3 Positionen"). Omitted: generic "entries" wording. */
|
|
1289
|
-
readonly itemNoun?: string;
|
|
1290
|
-
readonly pageSize?: number;
|
|
1291
|
-
/** Initial sort on mount, applied client-side over the already-loaded rows
|
|
1292
|
-
* (this section has no pager; if the fetch is truncated, `nextCursor !== null`,
|
|
1293
|
-
* the section shows a hint banner that the sort covers only the loaded rows).
|
|
1294
|
-
* `field` must name a column with `sortable: true` — boot-validator pins
|
|
1295
|
-
* that, same as `entityList.defaultSort`. */
|
|
1296
|
-
readonly defaultSort?: ListSortSpec;
|
|
1297
|
-
/** Renders a search box whose debounced term rides along as
|
|
1298
|
-
* `payload.search` on this section's own query. Opt-in, unlike
|
|
1299
|
-
* `projectionList.searchable` (derived from the bound query's schema): a
|
|
1300
|
-
* relatedList query is an ordinary child-rows handler, so a `search`
|
|
1301
|
-
* parameter in its schema is not by itself a statement that this section
|
|
1302
|
-
* should offer search. The boot-validator rejects `true` when the query's
|
|
1303
|
-
* Zod schema has no `search` parameter. */
|
|
1304
|
-
readonly searchable?: boolean;
|
|
1305
|
-
/** User-toggleable facet dropdowns — same explicit-label `ListFacetSpec` as
|
|
1306
|
-
* `projectionList.facets` (a relatedList has no entity to derive filterable
|
|
1307
|
-
* fields from). `field` must be a declared column, except for
|
|
1308
|
-
* `type: "reference"`: it filters by id through the bound query's
|
|
1309
|
-
* `filters` and needs a registered `entity` instead. The bound query
|
|
1310
|
-
* handler must accept `filters` in its Zod schema — the boot-validator
|
|
1311
|
-
* checks both. Selected values ride along as `payload.filters`. */
|
|
1312
|
-
readonly facets?: readonly ListFacetSpec[];
|
|
1313
|
-
/** Row click opens the target entity's detail screen via ObjectTarget —
|
|
1314
|
-
* the `detailFor` lookup owns the entity→screen mapping, so no screenId
|
|
1315
|
-
* is named here. `idColumn` names the row key holding that id (default
|
|
1316
|
-
* "id"). Omit `rowClick` for a non-interactive list. */
|
|
1317
|
-
readonly rowClick?: {
|
|
1318
|
-
readonly entity: string;
|
|
1319
|
-
readonly idColumn?: string;
|
|
1320
|
-
};
|
|
1321
|
-
/** Per-row actions — same type and dispatch semantics as `entityList`/
|
|
1322
|
-
* `projectionList`'s `rowActions` (writeHandler dispatch with a
|
|
1323
|
-
* declarative `payload` extractor, or navigate). A successful
|
|
1324
|
-
* writeHandler action re-runs this section's own query, same as a
|
|
1325
|
-
* projectionList row action re-running its list query. */
|
|
1326
|
-
readonly rowActions?: readonly RowAction[];
|
|
1327
|
-
/** Layout of the row-action column — see `RowActionMode`. */
|
|
1328
|
-
readonly rowActionMode?: RowActionMode;
|
|
1329
|
-
/** Groups rows by the value of a field under collapsible group headers. */
|
|
1330
|
-
readonly groupBy?: RelatedListGroupBy;
|
|
1331
|
-
/** Tints rows whose field matches — a declarative rule, not a function, so
|
|
1332
|
-
* the screen definition stays serializable. */
|
|
1333
|
-
readonly rowTone?: RelatedListRowTone;
|
|
1334
|
-
/** Toolbar actions above the table — same type and dispatch semantics as
|
|
1335
|
-
* `entityList`/`projectionList`'s `toolbarActions` ("+ Anlegen" etc.),
|
|
1336
|
-
* plus `visible`/`params` evaluated against the parent record (see
|
|
1337
|
-
* RelatedListToolbarAction). */
|
|
1338
|
-
readonly toolbarActions?: readonly RelatedListToolbarAction[];
|
|
1339
|
-
/** Record field rendered as a count badge in the tab label when the
|
|
1340
|
-
* enclosing `EditLayout.mode` is "tabs" (e.g. an open-items counter).
|
|
1341
|
-
* Ignored outside tabs mode or when the field's value is not a finite
|
|
1342
|
-
* number. */
|
|
1343
|
-
readonly countField?: string;
|
|
1344
|
-
/** Rendered top-right in the section's Card title row — same
|
|
1345
|
-
* navigate/drawer/writeHandler dispatch as `ProjectionDetailScreenDefinition.actions`,
|
|
1346
|
-
* evaluated against the parent record. Every action must resolve an icon
|
|
1347
|
-
* (declared or id-derived); the boot-validator rejects one that doesn't.
|
|
1348
|
-
* Distinct from `toolbarActions` (rendered inside the DataTable toolbar) —
|
|
1349
|
-
* this is the Card-level title-row action. */
|
|
1350
|
-
readonly actions?: readonly RowAction[];
|
|
1351
|
-
/** Rendered inside the section's Card in place of the table when this
|
|
1352
|
-
* section's query returns zero rows. Omitted: the DataTable default
|
|
1353
|
-
* ("kumiko.list.no-entries") applies. `action`'s icon must resolve, same
|
|
1354
|
-
* as `actions` above. */
|
|
1355
|
-
readonly emptyState?: ListEmptyStateSpec;
|
|
1356
|
-
};
|
|
1357
|
-
export type EditWriteFormSection = {
|
|
1358
|
-
/** Kebab-case tab id, used as the `?tab=` value. Required by the
|
|
1359
|
-
* boot-validator when the enclosing `EditLayout.mode` is "tabs". */
|
|
1360
|
-
readonly id?: string;
|
|
1361
|
-
readonly kind: "writeForm";
|
|
1362
|
-
readonly title?: string;
|
|
1363
|
-
readonly description?: string;
|
|
1364
|
-
readonly columns?: number;
|
|
1365
|
-
readonly icon?: IconKey;
|
|
1366
|
-
/** Field-type map for this section's own form — same shape as
|
|
1367
|
-
* `ActionFormScreenDefinition.fields`. */
|
|
1368
|
-
readonly fieldDefs: Readonly<Record<string, FieldDefinition>>;
|
|
1369
|
-
/** Rendered fields, in order — same shape as `EditFieldsSection.fields`.
|
|
1370
|
-
* Every referenced field must have an entry in `fieldDefs`. */
|
|
1371
|
-
readonly fields: readonly EditFieldSpec[];
|
|
1372
|
-
/** Write-handler QN dispatched on submit. The submitted values (not a
|
|
1373
|
-
* diff) land 1:1 as payload, same as `ActionFormScreenDefinition.handler`.
|
|
1374
|
-
* The payload carries only this section's own fields — no parent/record
|
|
1375
|
-
* id is injected automatically. To thread the host record's id through,
|
|
1376
|
-
* declare it in `fieldDefs` with `visible: false` on its `fields` entry:
|
|
1377
|
-
* it gets prefilled from the loaded record like any other field and rides
|
|
1378
|
-
* along in the submit payload without being shown in the form. */
|
|
1379
|
-
readonly handler: string;
|
|
1380
|
-
/** i18n-key for the submit button. Default: "kumiko.actions.save". */
|
|
1381
|
-
readonly submitLabel?: string;
|
|
1382
|
-
/** Rendered top-right in the section's Card title row — same
|
|
1383
|
-
* navigate/drawer/writeHandler dispatch as `ProjectionDetailScreenDefinition.actions`,
|
|
1384
|
-
* evaluated against the same record. Every action must resolve an icon
|
|
1385
|
-
* (declared or id-derived); the boot-validator rejects one that doesn't. */
|
|
1386
|
-
readonly actions?: readonly RowAction[];
|
|
1387
|
-
};
|
|
1388
|
-
export type FormWidth = "3xl" | "4xl" | "full";
|
|
1389
|
-
export type EditLayout = {
|
|
1390
|
-
readonly sections: readonly EditSectionSpec[];
|
|
1391
|
-
/** Default "4xl" (a centered column, narrower than list chrome), unless
|
|
1392
|
-
* the app overrides it via `createKumikoApp({ screenWidth })`. Override
|
|
1393
|
-
* per-screen to "3xl" for a narrower column or "full" to match list
|
|
1394
|
-
* chrome. */
|
|
1395
|
-
readonly width?: FormWidth;
|
|
1396
|
-
/** Default "single". "wizard" renders one section per step (with
|
|
1397
|
-
* progress + per-step validation) instead of all sections at once —
|
|
1398
|
-
* boot-validator requires >= 2 sections, each with a title, when set.
|
|
1399
|
-
* "tabs" renders one section per tab (projectionDetail only — the
|
|
1400
|
-
* boot-validator rejects it on entityEdit, see the check for the reason);
|
|
1401
|
-
* requires >= 2 sections, each with a title and an `id`. */
|
|
1402
|
-
readonly mode?: "single" | "wizard" | "tabs";
|
|
1403
|
-
/** "settings-list" lays each section out as a band with a title column on
|
|
1404
|
-
* the left and one hairline-separated row per field (label + help left,
|
|
1405
|
-
* control right) — the familiar settings pattern, for screens that are a
|
|
1406
|
-
* list of independent preferences rather than one record form. Default
|
|
1407
|
-
* "form" keeps the grid of cells. */
|
|
1408
|
-
readonly variant?: "form" | "settings-list";
|
|
1409
|
-
/** Persists in-progress wizard state as a resumable draft instead of
|
|
1410
|
-
* discarding it on navigation away. */
|
|
1411
|
-
readonly draft?: boolean;
|
|
1412
|
-
/** Wizard layouts only. `upNext: true` adds an "up next" box to the step
|
|
1413
|
-
* rail with the following step's title and `subtitle`; the last step
|
|
1414
|
-
* shows none. */
|
|
1415
|
-
readonly wizard?: {
|
|
1416
|
-
readonly aside?: {
|
|
1417
|
-
readonly upNext: true;
|
|
1418
|
-
};
|
|
1419
|
-
};
|
|
1420
|
-
};
|
|
1421
|
-
export type EntityWriteExcludedFields = {
|
|
1422
|
-
readonly create?: readonly string[];
|
|
1423
|
-
readonly update?: readonly string[];
|
|
1424
|
-
};
|
|
1425
|
-
export type EntityEditScreenDefinition = {
|
|
1426
|
-
readonly id: string;
|
|
1427
|
-
readonly type: "entityEdit";
|
|
1428
|
-
/** Default true: the screen fills the shell content height, its body scrolls
|
|
1429
|
-
* inside and the pager / action bar stays pinned. `false` restores page
|
|
1430
|
-
* scroll (table grows with its rows, pager below the last row, form footer
|
|
1431
|
-
* in the flow). */
|
|
1432
|
-
readonly fillHeight?: boolean;
|
|
1433
|
-
readonly nav?: ScreenNavSugar;
|
|
1434
|
-
readonly detailFor?: string;
|
|
1435
|
-
readonly description?: string;
|
|
1436
|
-
readonly agent?: AgentScreenHints;
|
|
1437
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
1438
|
-
* app); exempts it from the nav-area boot check. */
|
|
1439
|
-
readonly dormant?: boolean;
|
|
1440
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1441
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1442
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1443
|
-
readonly fallback?: string;
|
|
1444
|
-
/** Derived by buildAppSchema from the navigate `params` targeting this
|
|
1445
|
-
* screen — the only URL query keys the create form prefills. An authored
|
|
1446
|
-
* value is overwritten. */
|
|
1447
|
-
readonly urlPrefillFields?: readonly string[];
|
|
1448
|
-
/** Derived by buildAppSchema from the entity's create/update write handlers
|
|
1449
|
-
* (`excludeFields`): create hides these fields, update shows them read-only.
|
|
1450
|
-
* An authored value is overwritten. */
|
|
1451
|
-
readonly writeExcludedFields?: EntityWriteExcludedFields;
|
|
1452
|
-
readonly entity: string;
|
|
1453
|
-
/** Entity field whose value names the loaded record in the header breadcrumb (edit mode only). */
|
|
1454
|
-
readonly recordTitleField?: string;
|
|
1455
|
-
/** Screen title (i18n key) with `{field}` placeholders filled from the
|
|
1456
|
-
* current form values, so the title follows what the user types (create
|
|
1457
|
-
* wizard: "Add {make} {model}"). Falls back to the plain title while the
|
|
1458
|
-
* placeholders are still empty. */
|
|
1459
|
-
readonly titleTemplate?: string;
|
|
1460
|
-
/** Shows a saved record read-only while the condition holds for the loaded
|
|
1461
|
-
* record (not for unsaved form values): all fields disabled, no save, discard
|
|
1462
|
-
* or delete button; record `actions` stay. The title uses
|
|
1463
|
-
* `screen:<id>.view.title`, then `screen:<id>.title`. Never applies to create.
|
|
1464
|
-
* The entity's `lockedWhen` always applies as well; set this only to add a
|
|
1465
|
-
* UI-only condition (either one shows the view).
|
|
1466
|
-
* UI only: the update handler still has to enforce access. */
|
|
1467
|
-
readonly readOnly?: FieldCondition;
|
|
1468
|
-
readonly layout: EditLayout;
|
|
1469
|
-
/** Optionaler i18n-Key (oder Roh-String) für den Submit-Button. Default
|
|
1470
|
-
* `kumiko.actions.save`. Lässt den Auto-Edit-Screen domain-spezifische
|
|
1471
|
-
* CTAs zeigen ("Save Address", "Create item") statt generisch "Speichern". */
|
|
1472
|
-
readonly submitLabel?: string;
|
|
1473
|
-
/** Default true. `false` für Entities deren Create über einen eigenen
|
|
1474
|
-
* Lifecycle-Write läuft (z.B. incident:open mit Event-Stream + Joins)
|
|
1475
|
-
* statt über `<entity>:create`: unterdrückt den automatischen
|
|
1476
|
-
* „+ Neu"-Button auf entityList-Screens dieser Entity und rendert den
|
|
1477
|
-
* Create-Branch (Aufruf ohne entityId) als Fehler statt eines Forms,
|
|
1478
|
-
* dessen Submit gegen einen nicht registrierten Handler liefe. */
|
|
1479
|
-
readonly allowCreate?: boolean;
|
|
1480
|
-
/** Default true. `false` wenn kein `<entity>:delete`-Handler existiert
|
|
1481
|
-
* (History-/Audit-Erhalt): unterdrückt den Löschen-Button im
|
|
1482
|
-
* Update-Form. */
|
|
1483
|
-
readonly allowDelete?: boolean;
|
|
1484
|
-
/** Default false. `true` for singleton entities (exactly one record per
|
|
1485
|
-
* tenant: organization, settings, tenant profile). A call without an
|
|
1486
|
-
* `entityId` first resolves the existing record via `<entity>:list`
|
|
1487
|
-
* (limit 1) and renders the update branch with prefill on a hit,
|
|
1488
|
-
* instead of blindly creating another one. The create branch only
|
|
1489
|
-
* fires when the table is empty (and `allowCreate: false` still
|
|
1490
|
-
* applies there). */
|
|
1491
|
-
readonly singleton?: boolean;
|
|
1492
|
-
/** Navigate to this screen ID after a successful save (create or update).
|
|
1493
|
-
* Either a same-feature short screen-ID, or a fully-qualified
|
|
1494
|
-
* cross-feature screen QN (`<feature>:screen:<id>`) — the nav-router
|
|
1495
|
-
* resolves both against the schema; boot-validator checks the target
|
|
1496
|
-
* resolves to a registered screen. Overrides the default post-save
|
|
1497
|
-
* target (the entity's list screen); delete is unaffected and still
|
|
1498
|
-
* always navigates to the list. A cross-feature QN hard-couples this
|
|
1499
|
-
* feature to the target at boot time — an app that doesn't mount the
|
|
1500
|
-
* target feature fails the boot-validator; only use this form in a
|
|
1501
|
-
* reusable feature when the target feature is guaranteed to be
|
|
1502
|
-
* mounted alongside it.
|
|
1503
|
-
*
|
|
1504
|
-
* The object form additionally names the success-payload field the
|
|
1505
|
-
* navigation id comes from (`ActionFormRedirect.idFrom`) — needed when
|
|
1506
|
-
* the edited record is a child and the target screen is the parent's
|
|
1507
|
-
* detail screen. Update falls back to the loaded record when the
|
|
1508
|
-
* success payload doesn't carry that field flatly; create falls back
|
|
1509
|
-
* to the submitted form values. */
|
|
1510
|
-
readonly redirect?: string | ActionFormRedirect;
|
|
1511
|
-
/** Parent list screen (short id) for breadcrumb + nav highlighting when
|
|
1512
|
-
* this screen has no nav entry of its own. Same field/semantics as on
|
|
1513
|
-
* `custom`/`projectionDetail`; an explicit value here wins over the
|
|
1514
|
-
* entity-list heuristic (rowAction target / same-entity entityList). */
|
|
1515
|
-
readonly listScreenId?: string;
|
|
1516
|
-
/** Optionaler per-Field-Label-i18n-Key (Field-Name → Key), überschreibt
|
|
1517
|
-
* die Default-Konvention `<feature>:entity:<entity>:field:<name>`.
|
|
1518
|
-
* Primär für configEdit: dessen Pseudo-Entity `__config-edit__` hat
|
|
1519
|
-
* keinen natürlichen Field-Namespace — der Settings-Hub injiziert hier
|
|
1520
|
-
* das `mask.title`-Label des Config-Keys. Fehlt ein Eintrag, gilt die
|
|
1521
|
-
* Konvention. */
|
|
1522
|
-
readonly fieldLabels?: Readonly<Record<string, string>>;
|
|
1523
|
-
/** Record actions. Reuses `RowAction` — analogous to
|
|
1524
|
-
* `ProjectionDetailScreenDefinition.actions` (the loaded record stands
|
|
1525
|
-
* in for the "row"). `rowClick` has no target here and is rejected by
|
|
1526
|
-
* the boot-validator, same as on projectionDetail. Not rendered in
|
|
1527
|
-
* create mode — every action targets an existing record, which the
|
|
1528
|
-
* create branch doesn't have yet. By default an action renders with the
|
|
1529
|
-
* secondary form actions (footer, next to copy-link/delete/cancel);
|
|
1530
|
-
* `placement: "menu"` moves it into the header "…" menu, ahead of
|
|
1531
|
-
* copy-link/delete. Without a header menu (drawer, card form, shell
|
|
1532
|
-
* without a header slot) a "menu" action falls back to inline. */
|
|
1533
|
-
readonly actions?: readonly EntityEditAction[];
|
|
1534
|
-
readonly slots?: ScreenSlots;
|
|
1535
|
-
readonly access?: AccessRule;
|
|
1536
|
-
};
|
|
1537
|
-
export type EntityEditActionPlacement = "inline" | "menu";
|
|
1538
|
-
export type EntityEditAction = RowAction & {
|
|
1539
|
-
readonly placement?: EntityEditActionPlacement;
|
|
1540
|
-
};
|
|
1541
|
-
/** A form field computed from other fields of the same form. `listSum` adds one
|
|
1542
|
-
* numeric cell over all rows of an embedded list field; its `whenEmpty`
|
|
1543
|
-
* fallback applies while the list has no rows (it must not be a `listSum`). */
|
|
1544
|
-
export type FormFieldDerivation = {
|
|
1545
|
-
readonly op: "sum" | "subtract" | "multiply" | "percent";
|
|
1546
|
-
readonly from: readonly string[];
|
|
1547
|
-
} | {
|
|
1548
|
-
readonly op: "listSum";
|
|
1549
|
-
readonly list: string;
|
|
1550
|
-
readonly cell: string;
|
|
1551
|
-
readonly whenEmpty?: FormFieldDerivationWithoutList;
|
|
1552
|
-
};
|
|
1553
|
-
export type FormFieldDerivationWithoutList = Extract<FormFieldDerivation, {
|
|
1554
|
-
from: unknown;
|
|
1555
|
-
}>;
|
|
1556
|
-
export type ActionFormScreenDefinition = {
|
|
1557
|
-
readonly id: string;
|
|
1558
|
-
readonly type: "actionForm";
|
|
1559
|
-
/** Default true: the screen fills the shell content height, its body scrolls
|
|
1560
|
-
* inside and the pager / action bar stays pinned. `false` restores page
|
|
1561
|
-
* scroll (table grows with its rows, pager below the last row, form footer
|
|
1562
|
-
* in the flow). */
|
|
1563
|
-
readonly fillHeight?: boolean;
|
|
1564
|
-
readonly nav?: ScreenNavSugar;
|
|
1565
|
-
readonly detailFor?: string;
|
|
1566
|
-
readonly description?: string;
|
|
1567
|
-
readonly agent?: AgentScreenHints;
|
|
1568
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
1569
|
-
* app); exempts it from the nav-area boot check. */
|
|
1570
|
-
readonly dormant?: boolean;
|
|
1571
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1572
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1573
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1574
|
-
readonly fallback?: string;
|
|
1575
|
-
/** Derived by buildAppSchema — see EntityEditScreenDefinition.urlPrefillFields. */
|
|
1576
|
-
readonly urlPrefillFields?: readonly string[];
|
|
1577
|
-
/** Derived by buildAppSchema from the `excludedFields` of the called `handler`; the form
|
|
1578
|
-
* shows these fields read-only, not required and never in the payload. An authored value is overwritten. */
|
|
1579
|
-
readonly writeExcludedFields?: readonly string[];
|
|
1580
|
-
/** Submit is enabled without edits: values seeded from navigate `params` count as the
|
|
1581
|
-
* user's intent. Every required field the layout hides with `visible: false` must hold a
|
|
1582
|
-
* value, otherwise submit stays disabled (boot-checked against navigate `params`). */
|
|
1583
|
-
readonly submitPrefilled?: boolean;
|
|
1584
|
-
/** Write-Handler-QN der bei Submit gerufen wird. Form-Object landet
|
|
1585
|
-
* 1:1 als payload — Handler-Schema (Zod) validiert weiter. */
|
|
1586
|
-
readonly handler: string;
|
|
1587
|
-
/** Form-Shape: Field-Map pro Name. Nutzt dieselben FieldDefinitions
|
|
1588
|
-
* wie Entity-Felder. Mindestens ein Feld erforderlich (Boot-
|
|
1589
|
-
* Validator).
|
|
1590
|
-
*
|
|
1591
|
-
* A `money` field here must name its own currency source: this screen
|
|
1592
|
-
* has no entity whose `defaultCurrency` it could inherit (fw#2839). */
|
|
1593
|
-
readonly fields: Readonly<Record<string, FormFieldDefinition>>;
|
|
1594
|
-
/** Fields computed from other fields, shown read-only and recomputed on every
|
|
1595
|
-
* change. A `listSum` over an empty list without `whenEmpty` leaves the field
|
|
1596
|
-
* a normal input, and then the client value counts. Otherwise the client value
|
|
1597
|
-
* is never trusted: the handler must wrap its schema with
|
|
1598
|
-
* `withFormDerivations(schema, screen)`, which the boot validator enforces.
|
|
1599
|
-
* A field read only as `whenEmpty` operand is read-only while every such list has rows. */
|
|
1600
|
-
readonly derive?: Readonly<Record<string, FormFieldDerivation>>;
|
|
1601
|
-
/** Layout analog zu EntityEditScreen: sections mit fields aus dem
|
|
1602
|
-
* fields-Map oben. */
|
|
1603
|
-
readonly layout: EditLayout;
|
|
1604
|
-
/** Per-field label i18n key override, same type/semantics as
|
|
1605
|
-
* `EntityEditScreenDefinition.fieldLabels`. Falls back to the convention when absent. */
|
|
1606
|
-
readonly fieldLabels?: Readonly<Record<string, string>>;
|
|
1607
|
-
/** i18n-key für den Submit-Button. Default: i18n-Default des
|
|
1608
|
-
* Renderers (typischerweise "actions.submit"). */
|
|
1609
|
-
readonly submitLabel?: string;
|
|
1610
|
-
/** Extra buttons in the form footer next to the submit button. A click
|
|
1611
|
-
* applies `patch` to the form values, then submits the form (same
|
|
1612
|
-
* validation, same handler) — e.g. a "Mark as posted" button that sets
|
|
1613
|
-
* `posted: true`. The patched field need not be rendered by the layout.
|
|
1614
|
-
* Order in the array = order in the footer, before the submit button. */
|
|
1615
|
-
readonly footerActions?: readonly ActionFormFooterAction[];
|
|
1616
|
-
/** Context box above the fields (i18n keys). `{name}` placeholders resolve from the
|
|
1617
|
-
* drawer prefill (`params` of the opening row action), formatted for display. */
|
|
1618
|
-
readonly summary?: {
|
|
1619
|
-
readonly title: string;
|
|
1620
|
-
readonly subtitle?: string;
|
|
1621
|
-
};
|
|
1622
|
-
/** Visual style of the submit button. "danger" renders it red — for a form
|
|
1623
|
-
* whose handler is destructive (terminate, revoke, delete), so the warning
|
|
1624
|
-
* isn't lost on the way from the calling screen to this one. Default "primary". */
|
|
1625
|
-
readonly submitStyle?: "primary" | "danger";
|
|
1626
|
-
/** i18n key of a confirmation shown above the form after a successful submit
|
|
1627
|
-
* when the screen stays put (no `redirect`, not drawer-hosted). `{field}`
|
|
1628
|
-
* placeholders resolve from the submitted values; a `reference` field shows
|
|
1629
|
-
* the chosen record's label (its `labelField`), not the id — so a
|
|
1630
|
-
* cross-tenant admin form can name the record it just changed. */
|
|
1631
|
-
readonly successMessage?: string;
|
|
1632
|
-
/** Navigate to this screen ID after a successful submit: either a short
|
|
1633
|
-
* ID (e.g. "item-list" — same feature, the nav-router resolves to the
|
|
1634
|
-
* full path) or a fully-qualified cross-feature QN
|
|
1635
|
-
* (`<feature>:screen:<id>`). If not set, the user stays on the form
|
|
1636
|
-
* screen. Boot-validator checks that the target resolves to a
|
|
1637
|
-
* registered screen. A cross-feature QN hard-couples this feature to
|
|
1638
|
-
* the target at boot time — an app that doesn't mount the target
|
|
1639
|
-
* feature fails the boot-validator; only use this form in a reusable
|
|
1640
|
-
* feature when the target feature is guaranteed to be mounted
|
|
1641
|
-
* alongside it.
|
|
1642
|
-
*
|
|
1643
|
-
* The object form additionally names the success-payload field the
|
|
1644
|
-
* navigation id comes from (`ActionFormRedirect.idFrom`) — needed when
|
|
1645
|
-
* the handler creates a child record but the target screen is the
|
|
1646
|
-
* parent's detail screen (fw#2670). */
|
|
1647
|
-
readonly redirect?: string | ActionFormRedirect;
|
|
1648
|
-
/** Links shown in the success box after a successful submit while the
|
|
1649
|
-
* screen stays put. Targets resolve like `redirect` (the id comes from the
|
|
1650
|
-
* handler's success payload); a link without a string id is hidden.
|
|
1651
|
-
* Mutually exclusive with `redirect`. */
|
|
1652
|
-
readonly successLinks?: readonly ActionFormSuccessLink[];
|
|
1653
|
-
/** Key figures from the handler's success payload, shown in the success box
|
|
1654
|
-
* while the screen stays put (e.g. charged/skipped/failed of a batch run).
|
|
1655
|
-
* Mutually exclusive with `redirect`. */
|
|
1656
|
-
readonly successFacts?: readonly ActionFormSuccessFact[];
|
|
1657
|
-
/** Reset the form to its initial values after a successful submit (prefill
|
|
1658
|
-
* kept, typed values cleared). Only applies while the screen stays put,
|
|
1659
|
-
* i.e. without `redirect`. */
|
|
1660
|
-
readonly resetOnSuccess?: boolean;
|
|
1661
|
-
/** Load the initial values from a query. The record id comes from the route
|
|
1662
|
-
* (or the drawer row id) and is sent as `{ [idParam]: id }`; the result,
|
|
1663
|
-
* picked to `fields`, becomes the initial values. Turns URL prefill off:
|
|
1664
|
-
* search params never reach the form. */
|
|
1665
|
-
readonly load?: ActionFormLoad;
|
|
1666
|
-
/** Target of the Cancel button. Default: `redirect` (historical
|
|
1667
|
-
* behavior — Cancel and the submit-redirect then land in the same
|
|
1668
|
-
* place). `false` = no Cancel button; correct for single-action
|
|
1669
|
-
* screens with no discardable state (e.g. "Send test mail"), where
|
|
1670
|
-
* Cancel would just be a second path to the same target. Accepts the
|
|
1671
|
-
* same string targets as `redirect` (short ID or cross-feature QN);
|
|
1672
|
-
* boot-validator checks it. A cross-feature QN hard-couples this
|
|
1673
|
-
* feature to the target at boot time — an app that doesn't mount the
|
|
1674
|
-
* target feature fails the boot-validator; only use this form in a
|
|
1675
|
-
* reusable feature when the target feature is guaranteed to be
|
|
1676
|
-
* mounted alongside it. */
|
|
1677
|
-
readonly cancelTarget?: string | false;
|
|
1678
|
-
/** Parent list screen (short id) for breadcrumb + nav highlighting when
|
|
1679
|
-
* this screen has no nav entry of its own. Same field/semantics as on
|
|
1680
|
-
* `custom`/`projectionDetail`/`entityEdit`; an explicit value here wins
|
|
1681
|
-
* over the rowAction heuristic. */
|
|
1682
|
-
readonly listScreenId?: string;
|
|
1683
|
-
readonly slots?: ScreenSlots;
|
|
1684
|
-
readonly access?: AccessRule;
|
|
1685
|
-
};
|
|
1686
|
-
export type ActionFormFooterAction = {
|
|
1687
|
-
/** Stable id (kebab-case), used for the test id. */
|
|
1688
|
-
readonly id: string;
|
|
1689
|
-
/** i18n key. */
|
|
1690
|
-
readonly label: string;
|
|
1691
|
-
readonly icon?: IconKey;
|
|
1692
|
-
/** Button style. Default "secondary". */
|
|
1693
|
-
readonly variant?: "primary" | "secondary" | "danger";
|
|
1694
|
-
/** Form values set before the submit. JSON-safe literals only. */
|
|
1695
|
-
readonly patch: Readonly<Record<string, string | number | boolean | null>>;
|
|
1696
|
-
};
|
|
1697
|
-
/** Redirect target plus the success-payload field carrying the navigation
|
|
1698
|
-
* id. The write-handler reports the id of what it wrote (`data.id`); when
|
|
1699
|
-
* that record is a child and the target screen shows its parent, the
|
|
1700
|
-
* parent id has to be read from a different field instead of forcing the
|
|
1701
|
-
* handler to misreport its own result (fw#2670). */
|
|
1702
|
-
export type ActionFormRedirect = {
|
|
1703
|
-
/** Same target forms as the string `redirect`: short screen ID
|
|
1704
|
-
* (same-feature) or a fully-qualified cross-feature screen QN. */
|
|
1705
|
-
readonly screen: string;
|
|
1706
|
-
/** Flat field name in the handler's success payload, e.g. "leaseId".
|
|
1707
|
-
* Only used when the target screen type carries an id (`entityEdit`,
|
|
1708
|
-
* `projectionDetail`); a non-string or missing value navigates without
|
|
1709
|
-
* an id, same as a payload without `id` does today. */
|
|
1710
|
-
readonly idFrom: string;
|
|
1711
|
-
/** Section id to open on the target `projectionDetail` with `layout.mode:
|
|
1712
|
-
* "tabs"` (the `tab` search param, same as `ToolbarAction` navigate `tab`).
|
|
1713
|
-
* Boot rejects other targets and unknown section ids. */
|
|
1714
|
-
readonly tab?: string;
|
|
1715
|
-
};
|
|
1716
|
-
export type ActionFormLoad = {
|
|
1717
|
-
/** Query QN that returns the record. */
|
|
1718
|
-
readonly query: string;
|
|
1719
|
-
/** Payload key carrying the record id (default "id"). */
|
|
1720
|
-
readonly idParam?: string;
|
|
1721
|
-
/** The query picks the row from the caller's tenant/session context, so the
|
|
1722
|
-
* form loads without a record id and the query is called WITHOUT `idParam`
|
|
1723
|
-
* (same semantics as `ProjectionDetailScreenDefinition.singleton`). Boot
|
|
1724
|
-
* rejects declaring `idParam` alongside it. */
|
|
1725
|
-
readonly singleton?: boolean;
|
|
1726
|
-
};
|
|
1727
|
-
/** One key figure of the success box, read from the handler's success payload. */
|
|
1728
|
-
export type ActionFormSuccessFact = {
|
|
1729
|
-
/** Flat field name in the handler's success payload. A number or string is
|
|
1730
|
-
* shown as one value, an array a comma-separated list (numbers, strings and
|
|
1731
|
-
* `{ label }` objects). A missing field hides the fact. */
|
|
1732
|
-
readonly field: string;
|
|
1733
|
-
/** Label (i18n key). */
|
|
1734
|
-
readonly label: string;
|
|
1735
|
-
};
|
|
1736
|
-
/** A redirect target rendered as a link in the success box. */
|
|
1737
|
-
export type ActionFormSuccessLink = Omit<ActionFormRedirect, "idFrom"> & {
|
|
1738
|
-
/** Success-payload field carrying the navigation id. Required for a record
|
|
1739
|
-
* target (`entityEdit`, `projectionDetail`); omit it for a list, dashboard
|
|
1740
|
-
* or form target, which opens without an id. */
|
|
1741
|
-
readonly idFrom?: string;
|
|
1742
|
-
/** Link text (i18n key). */
|
|
1743
|
-
readonly label: string;
|
|
1744
|
-
};
|
|
1745
|
-
/** Author-declared field shown once after a mint-form submit — API token,
|
|
1746
|
-
* recovery codes, similar one-time secrets. */
|
|
1747
|
-
export type SecretRevealField = {
|
|
1748
|
-
/** Flat field name in the handler's success payload. */
|
|
1749
|
-
readonly field: string;
|
|
1750
|
-
/** i18n key for this value's label. */
|
|
1751
|
-
readonly label: string;
|
|
1752
|
-
/** "code" (default) renders one monospaced value; "list" renders a
|
|
1753
|
-
* string-array payload one value per line (recovery codes); "qr" renders
|
|
1754
|
-
* the value as a scannable QR code (otpauth://-style enrollment URI) —
|
|
1755
|
-
* platforms without a QR-capable SecretReveal primitive fall back to the
|
|
1756
|
-
* monospaced text display. */
|
|
1757
|
-
readonly display?: "code" | "list" | "qr";
|
|
1758
|
-
/** Default true — offer a copy-to-clipboard control next to the value. */
|
|
1759
|
-
readonly copyable?: boolean;
|
|
1760
|
-
};
|
|
1761
|
-
/** Post-reveal proof-of-receipt step. A mint whose effect is only armed once
|
|
1762
|
-
* the user proves they received the secret (TOTP enrollment: scan the code,
|
|
1763
|
-
* then enter one) declares it here — the reveal card renders this form in
|
|
1764
|
-
* place of the bare acknowledge button. */
|
|
1765
|
-
export type SecretMintConfirmStep = {
|
|
1766
|
-
/** Write-handler QN dispatched when the confirm form is submitted. */
|
|
1767
|
-
readonly handler: string;
|
|
1768
|
-
readonly fields: Readonly<Record<string, FormFieldDefinition>>;
|
|
1769
|
-
readonly layout: EditLayout;
|
|
1770
|
-
/** Mint success-payload fields merged into the confirm payload (e.g. a
|
|
1771
|
-
* short-lived setup token). Held in component state only — never rendered,
|
|
1772
|
-
* never in the URL, a query cache, nav or a persisted draft. */
|
|
1773
|
-
readonly carry?: readonly string[];
|
|
1774
|
-
readonly submitLabel?: string;
|
|
1775
|
-
/** i18n key for the banner shown after a successful confirm when the screen
|
|
1776
|
-
* declares no `redirect`. Default "kumiko.secretMint.done". */
|
|
1777
|
-
readonly doneMessage?: string;
|
|
1778
|
-
};
|
|
1779
|
-
export type SecretReveal = {
|
|
1780
|
-
readonly fields: readonly SecretRevealField[];
|
|
1781
|
-
/** i18n key. Default "kumiko.secretMint.title". */
|
|
1782
|
-
readonly title?: string;
|
|
1783
|
-
/** i18n key for the "this is the only time you see it" warning.
|
|
1784
|
-
* Default "kumiko.secretMint.warning". */
|
|
1785
|
-
readonly warning?: string;
|
|
1786
|
-
/** i18n key for the acknowledge button. Default "kumiko.secretMint.confirm". */
|
|
1787
|
-
readonly confirmLabel?: string;
|
|
1788
|
-
/** i18n key for a checkbox on the reveal card ("I have saved my recovery
|
|
1789
|
-
* codes"). While unchecked, the confirm step's submit or the acknowledge
|
|
1790
|
-
* button stays disabled. The tick is UI-only and never part of a payload. */
|
|
1791
|
-
readonly acknowledge?: string;
|
|
1792
|
-
};
|
|
1793
|
-
/** Mint form → one-time reveal → explicit confirm. The secret (API token,
|
|
1794
|
-
* recovery codes) lives only in the write-handler's own success payload —
|
|
1795
|
-
* no stored value backs it, so no query can redisplay it later. That gap
|
|
1796
|
-
* is why this needs its own screen type instead of a flag on `actionForm`,
|
|
1797
|
-
* which discards the success payload after extracting the navigation id. */
|
|
1798
|
-
export type SecretMintScreenDefinition = {
|
|
1799
|
-
readonly id: string;
|
|
1800
|
-
readonly type: "secretMint";
|
|
1801
|
-
readonly nav?: ScreenNavSugar;
|
|
1802
|
-
readonly detailFor?: string;
|
|
1803
|
-
readonly description?: string;
|
|
1804
|
-
readonly agent?: AgentScreenHints;
|
|
1805
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
1806
|
-
* app); exempts it from the nav-area boot check. */
|
|
1807
|
-
readonly dormant?: boolean;
|
|
1808
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1809
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1810
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1811
|
-
readonly fallback?: string;
|
|
1812
|
-
/** Derived by buildAppSchema — see EntityEditScreenDefinition.urlPrefillFields. */
|
|
1813
|
-
readonly urlPrefillFields?: readonly string[];
|
|
1814
|
-
/** Submit is enabled without edits: values seeded from navigate `params` count as the
|
|
1815
|
-
* user's intent. Every required field the layout hides with `visible: false` must hold a
|
|
1816
|
-
* value, otherwise submit stays disabled (boot-checked against navigate `params`). */
|
|
1817
|
-
readonly submitPrefilled?: boolean;
|
|
1818
|
-
/** Write-handler QN dispatched on submit. */
|
|
1819
|
-
readonly handler: string;
|
|
1820
|
-
readonly fields: Readonly<Record<string, FormFieldDefinition>>;
|
|
1821
|
-
readonly layout: EditLayout;
|
|
1822
|
-
/** Navigate here after the reveal is confirmed. Short id (same-feature) or
|
|
1823
|
-
* a fully-qualified cross-feature screen QN — no result-id navigation
|
|
1824
|
-
* form exists here (unlike `ActionFormScreenDefinition.redirect`), since
|
|
1825
|
-
* the confirmed screen carries no entity id to thread through. */
|
|
1826
|
-
readonly redirect?: string;
|
|
1827
|
-
readonly cancelTarget?: string | false;
|
|
1828
|
-
readonly listScreenId?: string;
|
|
1829
|
-
readonly access?: AccessRule;
|
|
1830
|
-
readonly reveal: SecretReveal;
|
|
1831
|
-
/** i18n-key for the mint button. Default: renderer's own default. */
|
|
1832
|
-
readonly submitLabel?: string;
|
|
1833
|
-
/** Proof-of-receipt step rendered on the reveal card in place of the bare
|
|
1834
|
-
* acknowledge button — see `SecretMintConfirmStep` doc. */
|
|
1835
|
-
readonly confirm?: SecretMintConfirmStep;
|
|
1836
|
-
};
|
|
1837
|
-
export type CustomScreenRoute = {
|
|
1838
|
-
readonly path: string;
|
|
1839
|
-
readonly component: PlatformComponent;
|
|
1840
|
-
};
|
|
1841
|
-
export type CustomScreenDefinition = {
|
|
1842
|
-
readonly id: string;
|
|
1843
|
-
readonly type: "custom";
|
|
1844
|
-
readonly nav?: ScreenNavSugar;
|
|
1845
|
-
readonly detailFor?: string;
|
|
1846
|
-
readonly description?: string;
|
|
1847
|
-
readonly agent?: AgentScreenHints;
|
|
1848
|
-
readonly renderer: PlatformComponent;
|
|
1849
|
-
readonly routes?: readonly CustomScreenRoute[];
|
|
1850
|
-
/** Parent list screen for breadcrumb when this detail is not in nav. */
|
|
1851
|
-
readonly listScreenId?: string;
|
|
1852
|
-
readonly access?: AccessRule;
|
|
1853
|
-
/** This screen is registered without a self-owned `r.nav()` entry by
|
|
1854
|
-
* design — an app opts in by navving it explicitly (e.g. a settings-area
|
|
1855
|
-
* self-service screen). `createKumikoApp`'s boot diagnostic
|
|
1856
|
-
* (kumiko-framework#2025) skips dormant screens instead of flagging
|
|
1857
|
-
* every consumer that doesn't mount the client plugin as a false
|
|
1858
|
-
* positive (kumiko-framework#2034). Only set this on screens the
|
|
1859
|
-
* feature itself never navs — a screen the feature DOES nav still needs
|
|
1860
|
-
* its client plugin mounted by every consumer, and should keep
|
|
1861
|
-
* triggering the diagnostic if it's missing. Also gates the
|
|
1862
|
-
* boot-validator's nav-area check, same as `dormant` on other screens. */
|
|
1863
|
-
readonly dormant?: boolean;
|
|
1864
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1865
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1866
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1867
|
-
readonly fallback?: string;
|
|
1868
|
-
};
|
|
1869
|
-
export type ConfigEditScreenDefinition = {
|
|
1870
|
-
readonly id: string;
|
|
1871
|
-
readonly type: "configEdit";
|
|
1872
|
-
/** Default true: the form fills the shell content height with a pinned
|
|
1873
|
-
* footer. `false` restores the card layout with the footer in the flow. */
|
|
1874
|
-
readonly fillHeight?: boolean;
|
|
1875
|
-
readonly nav?: ScreenNavSugar;
|
|
1876
|
-
readonly detailFor?: string;
|
|
1877
|
-
readonly description?: string;
|
|
1878
|
-
readonly agent?: AgentScreenHints;
|
|
1879
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
1880
|
-
* app); exempts it from the nav-area boot check. */
|
|
1881
|
-
readonly dormant?: boolean;
|
|
1882
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1883
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1884
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1885
|
-
readonly fallback?: string;
|
|
1886
|
-
/** scope für config:write:set Calls. Muss zur Scope-Deklaration der
|
|
1887
|
-
* in `configKeys` referenzierten Keys passen — Boot-Validator
|
|
1888
|
-
* prüft das gegen die Registry. */
|
|
1889
|
-
readonly scope: "tenant" | "system" | "user";
|
|
1890
|
-
/** Map: form-field-name (kurz, wie im Layout referenziert) → voll-
|
|
1891
|
-
* qualifizierter Config-Key (`<feature>:config:<short>`). Boot-
|
|
1892
|
-
* Validator prüft dass jeder qualifizierte Key in der Registry
|
|
1893
|
-
* bekannt ist. */
|
|
1894
|
-
readonly configKeys: Readonly<Record<string, string>>;
|
|
1895
|
-
/** Field name → qualified secret key (`<feature>:secret:<short>`), tenant scope only.
|
|
1896
|
-
* Such a field is a writeOnly text field with no `configKeys` entry; the same save
|
|
1897
|
-
* writes it through secrets:write:set (or secrets:write:delete on removal). */
|
|
1898
|
-
readonly secretKeys?: Readonly<Record<string, string>>;
|
|
1899
|
-
/** Form-Shape pro Field-Name. Selbe FieldDefinitions wie auf
|
|
1900
|
-
* Entities/ActionForm. Field-Names matchen die Keys in `configKeys`
|
|
1901
|
-
* — Boot-Validator pinnt das. */
|
|
1902
|
-
readonly fields: Readonly<Record<string, FieldDefinition>>;
|
|
1903
|
-
/** Layout: Sections mit Field-Refs. Identisch zu entityEdit/
|
|
1904
|
-
* actionForm. */
|
|
1905
|
-
readonly layout: EditLayout;
|
|
1906
|
-
/** Optionaler per-Field-Label-i18n-Key (Field-Name → Key). Der
|
|
1907
|
-
* Settings-Hub setzt hier `mask.title` des jeweiligen Config-Keys,
|
|
1908
|
-
* damit das am Key deklarierte Label am generierten Feld erscheint —
|
|
1909
|
-
* ohne es unter der `__config-edit__`-Konvention zu duplizieren.
|
|
1910
|
-
* Fehlt ein Eintrag, gilt die Konvention. */
|
|
1911
|
-
readonly fieldLabels?: Readonly<Record<string, string>>;
|
|
1912
|
-
/** Per-field help text i18n key (Field-Name → Key), from `mask.description`. */
|
|
1913
|
-
readonly fieldDescriptions?: Readonly<Record<string, string>>;
|
|
1914
|
-
/** Field names whose config key declares `required: true` — drives the
|
|
1915
|
-
* "Not set. Required." origin line, not form validation. */
|
|
1916
|
-
readonly requiredFields?: readonly string[];
|
|
1917
|
-
/** i18n-key für den Submit-Button. Default: "kumiko.actions.save". */
|
|
1918
|
-
readonly submitLabel?: string;
|
|
1919
|
-
readonly slots?: ScreenSlots;
|
|
1920
|
-
readonly access?: AccessRule;
|
|
1921
|
-
};
|
|
1922
|
-
export type SecretsEditSection = {
|
|
1923
|
-
readonly title?: string;
|
|
1924
|
-
readonly fields: readonly string[];
|
|
1925
|
-
};
|
|
1926
|
-
export type SecretsEditScreenDefinition = {
|
|
1927
|
-
readonly id: string;
|
|
1928
|
-
readonly type: "secretsEdit";
|
|
1929
|
-
readonly nav?: ScreenNavSugar;
|
|
1930
|
-
readonly detailFor?: string;
|
|
1931
|
-
readonly description?: string;
|
|
1932
|
-
readonly agent?: AgentScreenHints;
|
|
1933
|
-
/** Screen has no nav entry by design (opened via link or navved by the
|
|
1934
|
-
* app); exempts it from the nav-area boot check. */
|
|
1935
|
-
readonly dormant?: boolean;
|
|
1936
|
-
/** UI-only gate, also on direct URL access; handlers still enforce access. Unmet or failed renders `fallback`. */
|
|
1937
|
-
readonly visibleWhen?: DashboardPanelVisibility;
|
|
1938
|
-
/** Same-feature short id or cross-feature QN `<feature>:screen:<id>` shown when `visibleWhen` is unmet (default: standard notice). */
|
|
1939
|
-
readonly fallback?: string;
|
|
1940
|
-
/** field id -> qualified secret name (`<feature>:secret:<kebab>`). */
|
|
1941
|
-
readonly secretKeys: Readonly<Record<string, string>>;
|
|
1942
|
-
/** field id -> i18n key for the label. */
|
|
1943
|
-
readonly fieldLabels: Readonly<Record<string, string>>;
|
|
1944
|
-
/** field id -> i18n key for the hint, only where the declaration carries one. */
|
|
1945
|
-
readonly fieldHints?: Readonly<Record<string, string>>;
|
|
1946
|
-
/** field ids whose declaration set `required: true`. */
|
|
1947
|
-
readonly requiredFields?: readonly string[];
|
|
1948
|
-
/** field id -> write access derived from the key's `writeRoles`. The screen
|
|
1949
|
-
* hides fields the viewer fails; UI only, the secrets write gate stays
|
|
1950
|
-
* authoritative. */
|
|
1951
|
-
readonly fieldAccess?: Readonly<Record<string, AccessRule>>;
|
|
1952
|
-
readonly sections: readonly SecretsEditSection[];
|
|
1953
|
-
readonly access?: AccessRule;
|
|
1954
|
-
};
|
|
1955
85
|
export type ScreenSlots = {
|
|
1956
86
|
readonly header?: PlatformComponent;
|
|
1957
87
|
/** entityEdit / actionForm: rendered on the right of the form title, same row. */
|
|
@@ -1977,3 +107,11 @@ export type ScreenNavSugar = {
|
|
|
1977
107
|
readonly order?: number;
|
|
1978
108
|
};
|
|
1979
109
|
export type ScreenDefinition = EntityListScreenDefinition | ProjectionListScreenDefinition | ProjectionDetailScreenDefinition | DashboardScreenDefinition | EntityEditScreenDefinition | ActionFormScreenDefinition | ConfigEditScreenDefinition | SecretsEditScreenDefinition | SecretMintScreenDefinition | CustomScreenDefinition;
|
|
110
|
+
export type { ActionFormFooterAction, ActionFormLoad, ActionFormRedirect, ActionFormScreenDefinition, ActionFormSuccessFact, ActionFormSuccessLink, FormFieldDerivation, FormFieldDerivationWithoutList, SecretMintConfirmStep, SecretMintScreenDefinition, SecretReveal, SecretRevealField, } from "./screen-action-form.ts";
|
|
111
|
+
export type { ConfigEditScreenDefinition, CustomScreenDefinition, CustomScreenRoute, SecretsEditScreenDefinition, SecretsEditSection, } from "./screen-custom-config.ts";
|
|
112
|
+
export type { DashboardChartKind, DashboardChartMarkerKind, DashboardChartPanel, DashboardChartRangeOption, DashboardChartRanges, DashboardChartTone, DashboardCurrencyFormat, DashboardCustomPanel, DashboardDateParam, DashboardFeedPanel, DashboardFilterDefinition, DashboardI18nText, DashboardListPanel, DashboardMoneyParam, DashboardPanelDefinition, DashboardPanelEmptyState, DashboardPanelGate, DashboardPanelQueryOptions, DashboardPanelSpan, DashboardPanelVisibility, DashboardProgressListPanel, DashboardProgressTone, DashboardRecordBinding, DashboardRefresh, DashboardRelativeTimeFormat, DashboardRelativeTimeParam, DashboardScopeDefinition, DashboardScreenDefinition, DashboardScreenPanel, DashboardStatGroupPanel, DashboardStatPanel, DashboardStatTone, DashboardText, DashboardTextBlock, DashboardTextPanel, DashboardTextParam, DashboardTimeRangeDefinition, DashboardValueFormat, } from "./screen-dashboard.ts";
|
|
113
|
+
export { DASHBOARD_MIN_REFRESH_SECONDS, DASHBOARD_STAT_TONES } from "./screen-dashboard.ts";
|
|
114
|
+
export type { EditExtensionSection, EditFieldGroup, EditFieldPrefill, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditActionPlacement, EntityEditScreenDefinition, EntityWriteExcludedFields, FieldAffix, FieldFillAction, FormWidth, ListEmptyStateSpec, RelatedListGroupBy, RelatedListRowTone, } from "./screen-entity-edit.ts";
|
|
115
|
+
export { relatedListGroupHeaderLabel, relatedListGroupKey } from "./screen-entity-edit.ts";
|
|
116
|
+
export type { EntityListExpandableRow, EntityListFacetConfig, EntityListFacetExtraOption, EntityListScreenDefinition, ListBadgeTone, ListColumnDisplay, ListColumnSpec, ListPaginationMode, ListSortDir, ListSortSpec, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionNavigateBase, RowActionWriteHandler, RowFieldExtractor, ScreenFilter, ScreenFilterOp, ToolbarAction, } from "./screen-entity-list.ts";
|
|
117
|
+
export type { ListFacetSpec, MetricNavigate, MetricSpec, ProjectionDetailScreenDefinition, ProjectionListScreenDefinition, RecordHeaderSpec, RecordHeaderSubtitlePart, } from "./screen-projection.ts";
|