@webtypen/webframez-core 0.3.58 → 0.3.60
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/README.md +28 -3
- package/dist/DataBuilder/DataBuilder.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -474,6 +474,23 @@ builder.registerType({
|
|
|
474
474
|
target: {
|
|
475
475
|
type: "option",
|
|
476
476
|
optionsMapping: { from: "default_values", value: "key", label: "name" }
|
|
477
|
+
},
|
|
478
|
+
mixed_target: {
|
|
479
|
+
type: "option",
|
|
480
|
+
optionsMapping: [
|
|
481
|
+
{ from: "default_values", value: "key", label: "name", valuePrefix: "@defaults.", labelPrefix: "Standard: " },
|
|
482
|
+
{ from: "features_targets", value: "key", label: "name", labelPrefix: "Ziel: " },
|
|
483
|
+
{ from: "@parent.attributes", value: "key", label: "name" }
|
|
484
|
+
]
|
|
485
|
+
},
|
|
486
|
+
licenses: {
|
|
487
|
+
type: "array",
|
|
488
|
+
toggable: true,
|
|
489
|
+
previewLabel: "{{ name }}",
|
|
490
|
+
schema: {
|
|
491
|
+
key: { type: "string", required: true },
|
|
492
|
+
name: { type: "string", required: true }
|
|
493
|
+
}
|
|
477
494
|
}
|
|
478
495
|
}
|
|
479
496
|
}
|
|
@@ -481,9 +498,17 @@ builder.registerType({
|
|
|
481
498
|
```
|
|
482
499
|
|
|
483
500
|
`option` fields can use static `options: [{ value, label }]` or a client-side
|
|
484
|
-
`optionsMapping
|
|
485
|
-
|
|
486
|
-
|
|
501
|
+
`optionsMapping`. The mapping can be a single object or an array of objects with
|
|
502
|
+
`{ from: string; value: string; label: string; valuePrefix?: string; labelPrefix?: string }`. Multiple
|
|
503
|
+
mapping entries are aggregated in order. `@parent.<field>` source paths resolve
|
|
504
|
+
schema-aware to the closest parent schema context defining `<field>`, for example
|
|
505
|
+
`features_groups[].licenses[].adds[].key` with `@parent.attributes` resolves to
|
|
506
|
+
`features_groups[].attributes`.
|
|
507
|
+
|
|
508
|
+
Array fields can set `toggable: true` to let the frontend collapse entries. Use
|
|
509
|
+
`previewLabel` with the same template syntax to render a label in the entry title
|
|
510
|
+
row. `toggable` and `previewLabel` may be defined on the schema field or the form
|
|
511
|
+
layout entry; form layout options override schema options.
|
|
487
512
|
|
|
488
513
|
You can also use:
|
|
489
514
|
- `registerModelType(...)`
|
|
@@ -22,7 +22,10 @@ export type DataBuilderOptionMapping = {
|
|
|
22
22
|
from: string;
|
|
23
23
|
value: string;
|
|
24
24
|
label: string;
|
|
25
|
+
valuePrefix?: string;
|
|
26
|
+
labelPrefix?: string;
|
|
25
27
|
};
|
|
28
|
+
export type DataBuilderOptionsMapping = DataBuilderOptionMapping | DataBuilderOptionMapping[];
|
|
26
29
|
export type DataBuilderType = {
|
|
27
30
|
key: string;
|
|
28
31
|
singular: string;
|
package/package.json
CHANGED