@cosmicdrift/kumiko-types 0.202.0 → 0.204.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/package.json +1 -1
- package/src/screen.ts +49 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.204.0",
|
|
4
4
|
"description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
package/src/screen.ts
CHANGED
|
@@ -323,6 +323,16 @@ export type ProjectionListScreenDefinition = {
|
|
|
323
323
|
readonly pageSize?: number;
|
|
324
324
|
readonly defaultSort?: ListSortSpec;
|
|
325
325
|
readonly searchable?: boolean;
|
|
326
|
+
/** Derived by buildAppSchema from the query handler's Zod schema (`sort`
|
|
327
|
+
* param present). Same type serves author and wire schema (no separate
|
|
328
|
+
* client-facing screen type exists), so this stays structurally
|
|
329
|
+
* writable — validateProjectionListScreens rejects any hand-authored
|
|
330
|
+
* value at boot (fw#2165). */
|
|
331
|
+
readonly sortable?: boolean;
|
|
332
|
+
/** Derived by buildAppSchema from the query handler's Zod schema (`cursor`
|
|
333
|
+
* or `offset` param present). See `sortable` doc for why this is
|
|
334
|
+
* boot-enforced rather than type-enforced. */
|
|
335
|
+
readonly paginated?: boolean;
|
|
326
336
|
readonly slots?: ScreenSlots;
|
|
327
337
|
readonly access?: AccessRule;
|
|
328
338
|
};
|
|
@@ -341,7 +351,9 @@ export type ProjectionListScreenDefinition = {
|
|
|
341
351
|
// (e.g. jobs' `detailQuery` expects `runId`) — this lets the primitive bind
|
|
342
352
|
// to it without forcing a handler rename. Extension sections aren't
|
|
343
353
|
// supported (no entity for them to persist against); the boot-validator
|
|
344
|
-
// rejects them.
|
|
354
|
+
// rejects them. `relatedList` sections ARE supported — they run their own
|
|
355
|
+
// query against the displayed record's id, independent of the entity gap
|
|
356
|
+
// above (fw#2166).
|
|
345
357
|
export type ProjectionDetailScreenDefinition = {
|
|
346
358
|
readonly id: string;
|
|
347
359
|
readonly type: "projectionDetail";
|
|
@@ -358,6 +370,12 @@ export type ProjectionDetailScreenDefinition = {
|
|
|
358
370
|
readonly listScreenId?: string;
|
|
359
371
|
readonly slots?: ScreenSlots;
|
|
360
372
|
readonly access?: AccessRule;
|
|
373
|
+
/** Header action buttons. Reuses `RowAction` — the screen's single
|
|
374
|
+
* displayed record stands in for the "row", so `pick`/`map`, `visible`,
|
|
375
|
+
* `confirm`/`confirmLabel` and `style` keep their meaning unchanged.
|
|
376
|
+
* `rowClick` has no target here (there is no row to click) and is
|
|
377
|
+
* rejected by the boot-validator. */
|
|
378
|
+
readonly actions?: readonly RowAction[];
|
|
361
379
|
};
|
|
362
380
|
|
|
363
381
|
// --- dashboard ---
|
|
@@ -526,13 +544,15 @@ export type EditFieldSpec =
|
|
|
526
544
|
readonly icon?: string;
|
|
527
545
|
};
|
|
528
546
|
|
|
529
|
-
// A section is
|
|
530
|
-
//
|
|
531
|
-
//
|
|
532
|
-
// side by name (same `__component` marker as
|
|
533
|
-
// renderers) and receives the host entity name +
|
|
534
|
-
// (e.g. custom-fields) can load and persist its
|
|
535
|
-
|
|
547
|
+
// A section is a normal field-grid (default — `kind` omitted keeps every
|
|
548
|
+
// existing screen-def working), an extension slot that mounts a feature-
|
|
549
|
+
// provided component, or a related-list of other records. The extension
|
|
550
|
+
// component is resolved client-side by name (same `__component` marker as
|
|
551
|
+
// custom screens / column renderers) and receives the host entity name +
|
|
552
|
+
// id, so a bundled feature (e.g. custom-fields) can load and persist its
|
|
553
|
+
// own data inside the form. `relatedList` runs its own query instead —
|
|
554
|
+
// see `EditRelatedListSection`.
|
|
555
|
+
export type EditSectionSpec = EditFieldsSection | EditExtensionSection | EditRelatedListSection;
|
|
536
556
|
|
|
537
557
|
export type EditFieldsSection = {
|
|
538
558
|
readonly kind?: "fields";
|
|
@@ -556,6 +576,27 @@ export type EditExtensionSection = {
|
|
|
556
576
|
readonly component: PlatformComponent;
|
|
557
577
|
};
|
|
558
578
|
|
|
579
|
+
// Read-only list of related records, driven by its own query — for a
|
|
580
|
+
// projectionDetail screen showing e.g. a tenant's payments below the
|
|
581
|
+
// tenant's own fields. Only supported on projectionDetail (fw#2166); the
|
|
582
|
+
// boot-validator rejects it on entityEdit/configEdit/actionForm.
|
|
583
|
+
export type EditRelatedListSection = {
|
|
584
|
+
readonly kind: "relatedList";
|
|
585
|
+
readonly title: string;
|
|
586
|
+
/** Fully qualified query QN. Same paged envelope as projectionList.query:
|
|
587
|
+
* `{ rows, nextCursor, total? }`. */
|
|
588
|
+
readonly query: string;
|
|
589
|
+
/** Query-payload key the parent record's id is passed under. Default "id". */
|
|
590
|
+
readonly parentParam?: string;
|
|
591
|
+
readonly columns: readonly ListColumnSpec[];
|
|
592
|
+
readonly pageSize?: number;
|
|
593
|
+
/** Row click opens the target entity's detail screen via ObjectTarget —
|
|
594
|
+
* the `detailFor` lookup owns the entity→screen mapping, so no screenId
|
|
595
|
+
* is named here. `idColumn` names the row key holding that id (default
|
|
596
|
+
* "id"). Omit `rowClick` for a non-interactive list. */
|
|
597
|
+
readonly rowClick?: { readonly entity: string; readonly idColumn?: string };
|
|
598
|
+
};
|
|
599
|
+
|
|
559
600
|
// Max width of the form container (see FormScreenShell in renderer-web).
|
|
560
601
|
export type FormWidth = "sm" | "3xl" | "4xl" | "full";
|
|
561
602
|
|