@cosmicdrift/kumiko-types 0.239.0 → 0.241.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 +67 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.241.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
|
@@ -72,6 +72,8 @@ export interface FieldFormatRegistry {
|
|
|
72
72
|
// Prefer fieldOptionLabelKeyPrefix() from @cosmicdrift/kumiko-headless
|
|
73
73
|
// over hand-typed prefix strings.
|
|
74
74
|
enumOption: { readonly keyPrefix: string };
|
|
75
|
+
/** JSON-safe structured value rendered as indented text. */
|
|
76
|
+
json: { readonly indent?: number };
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
// Discriminated union derived from the registry — one variant per key.
|
|
@@ -481,6 +483,18 @@ export type ProjectionDetailScreenDefinition = {
|
|
|
481
483
|
readonly query: string;
|
|
482
484
|
/** Query-payload key for the row-id. Default "id". */
|
|
483
485
|
readonly idParam?: string;
|
|
486
|
+
/** The server determines the shown row from the caller's session/context
|
|
487
|
+
* instead of a row id in the path — a self-service screen ("my profile",
|
|
488
|
+
* "my data") that has no row to link to (unlike `EntityEditScreenDefinition.
|
|
489
|
+
* singleton`, which still resolves via `<entity>:list` limit 1; here the
|
|
490
|
+
* query itself owns the row selection, e.g. `user:query:user:me`). The
|
|
491
|
+
* query is called WITHOUT the `idParam` key — there is no id to send, so
|
|
492
|
+
* the boot-validator rejects declaring `idParam` alongside this flag
|
|
493
|
+
* instead of letting one silently win. Stricter than an id-addressed
|
|
494
|
+
* screen, not looser: the server picks the row, so no client-supplied id
|
|
495
|
+
* can reach the query — a stray id on the path is ignored, never
|
|
496
|
+
* forwarded. */
|
|
497
|
+
readonly singleton?: boolean;
|
|
484
498
|
readonly layout: EditLayout;
|
|
485
499
|
/** Optionaler per-Field-Label-i18n-Key (Field-Name → Key), analog zu
|
|
486
500
|
* entityEdit.fieldLabels. Die Pseudo-Entity `__projection-detail__` hat
|
|
@@ -529,6 +543,10 @@ export type DashboardStatPanel = {
|
|
|
529
543
|
/** Anzeige-Text (i18n-Key). */
|
|
530
544
|
readonly label: string;
|
|
531
545
|
readonly query: string;
|
|
546
|
+
/** Static, author-set query parameters merged on top of the screen's
|
|
547
|
+
* dynamic filterParams — lets a panel pin a value (e.g. a status facet)
|
|
548
|
+
* the screen-wide filter doesn't cover, without needing its own query. */
|
|
549
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
532
550
|
readonly valueField: string;
|
|
533
551
|
readonly subField?: string;
|
|
534
552
|
readonly toneField?: string;
|
|
@@ -697,7 +715,11 @@ export type EditFieldSpec =
|
|
|
697
715
|
// id, so a bundled feature (e.g. custom-fields) can load and persist its
|
|
698
716
|
// own data inside the form. `relatedList` runs its own query instead —
|
|
699
717
|
// see `EditRelatedListSection`.
|
|
700
|
-
export type EditSectionSpec =
|
|
718
|
+
export type EditSectionSpec =
|
|
719
|
+
| EditFieldsSection
|
|
720
|
+
| EditExtensionSection
|
|
721
|
+
| EditRelatedListSection
|
|
722
|
+
| EditWriteFormSection;
|
|
701
723
|
|
|
702
724
|
export type EditFieldsSection = {
|
|
703
725
|
/** Kebab-case tab id, used as the `?tab=` value. Required by the
|
|
@@ -766,6 +788,50 @@ export type EditRelatedListSection = {
|
|
|
766
788
|
* is named here. `idColumn` names the row key holding that id (default
|
|
767
789
|
* "id"). Omit `rowClick` for a non-interactive list. */
|
|
768
790
|
readonly rowClick?: { readonly entity: string; readonly idColumn?: string };
|
|
791
|
+
/** Per-row actions — same type and dispatch semantics as `entityList`/
|
|
792
|
+
* `projectionList`'s `rowActions` (writeHandler dispatch with a
|
|
793
|
+
* declarative `payload` extractor, or navigate). A successful
|
|
794
|
+
* writeHandler action re-runs this section's own query, same as a
|
|
795
|
+
* projectionList row action re-running its list query. */
|
|
796
|
+
readonly rowActions?: readonly RowAction[];
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
// A declarative, self-persisting form section for `projectionDetail`
|
|
800
|
+
// (fw editable-detail-screens). Unlike the plain `fields` section — which
|
|
801
|
+
// projectionDetail forces read-only, see the type's own doc — this section's
|
|
802
|
+
// fields ARE editable and submit through their own write-handler, entirely
|
|
803
|
+
// independent of the (nonexistent) outer form submit. Modeled on
|
|
804
|
+
// `ActionFormScreenDefinition`: `fieldDefs` carries the field-type map (a
|
|
805
|
+
// projectionDetail's synthesized display entity has no real field types to
|
|
806
|
+
// draw on), `fields` the rendered order/overrides, same as
|
|
807
|
+
// `EditFieldsSection.fields`. Only supported on projectionDetail — the
|
|
808
|
+
// boot-validator rejects it on entityEdit/configEdit/actionForm, same as
|
|
809
|
+
// `relatedList`.
|
|
810
|
+
export type EditWriteFormSection = {
|
|
811
|
+
/** Kebab-case tab id, used as the `?tab=` value. Required by the
|
|
812
|
+
* boot-validator when the enclosing `EditLayout.mode` is "tabs". */
|
|
813
|
+
readonly id?: string;
|
|
814
|
+
readonly kind: "writeForm";
|
|
815
|
+
readonly title?: string;
|
|
816
|
+
readonly description?: string;
|
|
817
|
+
readonly columns?: number;
|
|
818
|
+
readonly icon?: IconKey;
|
|
819
|
+
/** Field-type map for this section's own form — same shape as
|
|
820
|
+
* `ActionFormScreenDefinition.fields`. */
|
|
821
|
+
readonly fieldDefs: Readonly<Record<string, FieldDefinition>>;
|
|
822
|
+
/** Rendered fields, in order — same shape as `EditFieldsSection.fields`.
|
|
823
|
+
* Every referenced field must have an entry in `fieldDefs`. */
|
|
824
|
+
readonly fields: readonly EditFieldSpec[];
|
|
825
|
+
/** Write-handler QN dispatched on submit. The submitted values (not a
|
|
826
|
+
* diff) land 1:1 as payload, same as `ActionFormScreenDefinition.handler`.
|
|
827
|
+
* The payload carries only this section's own fields — no parent/record
|
|
828
|
+
* id is injected automatically. To thread the host record's id through,
|
|
829
|
+
* declare it in `fieldDefs` with `visible: false` on its `fields` entry:
|
|
830
|
+
* it gets prefilled from the loaded record like any other field and rides
|
|
831
|
+
* along in the submit payload without being shown in the form. */
|
|
832
|
+
readonly handler: string;
|
|
833
|
+
/** i18n-key for the submit button. Default: "kumiko.actions.save". */
|
|
834
|
+
readonly submitLabel?: string;
|
|
769
835
|
};
|
|
770
836
|
|
|
771
837
|
// Max width of the form container (see FormScreenShell in renderer-web).
|