@webtypen/webframez-core 0.3.58 → 0.3.59

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 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." },
482
+ { from: "features_targets", value: "key", label: "name" },
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,15 @@ builder.registerType({
481
498
  ```
482
499
 
483
500
  `option` fields can use static `options: [{ value, label }]` or a client-side
484
- `optionsMapping: { from: string; value: string; label: string }`. The mapping is
485
- resolved by the DataBuilder frontend against the current form data, so changes in
486
- the referenced array appear in selects without a backend reload.
501
+ `optionsMapping`. The mapping can be a single object or an array of objects with
502
+ `{ from: string; value: string; label: string; valuePrefix?: string }`. Multiple
503
+ mapping entries are aggregated in order, and `@parent...` source paths resolve
504
+ against the nearest outer array entry in the current form data.
505
+
506
+ Array fields can set `toggable: true` to let the frontend collapse entries. Use
507
+ `previewLabel` with the same template syntax to render a label in the entry title
508
+ row. `toggable` and `previewLabel` may be defined on the schema field or the form
509
+ layout entry; form layout options override schema options.
487
510
 
488
511
  You can also use:
489
512
  - `registerModelType(...)`
@@ -22,7 +22,9 @@ export type DataBuilderOptionMapping = {
22
22
  from: string;
23
23
  value: string;
24
24
  label: string;
25
+ valuePrefix?: string;
25
26
  };
27
+ export type DataBuilderOptionsMapping = DataBuilderOptionMapping | DataBuilderOptionMapping[];
26
28
  export type DataBuilderType = {
27
29
  key: string;
28
30
  singular: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.3.58",
3
+ "version": "0.3.59",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",