@webtypen/webframez-core 0.3.69 → 0.3.70
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 +19 -0
- package/dist/DataBuilder/DataBuilder.d.ts +40 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -570,6 +570,25 @@ builder.registerType({
|
|
|
570
570
|
});
|
|
571
571
|
```
|
|
572
572
|
|
|
573
|
+
Forms may group their complete layout in tabs. Tab fields still address the same
|
|
574
|
+
root data object; tabs only change presentation. `appearance: "plain"` avoids an
|
|
575
|
+
additional card around a full-form tab layout.
|
|
576
|
+
|
|
577
|
+
```ts
|
|
578
|
+
forms: {
|
|
579
|
+
main: {
|
|
580
|
+
fields: [{
|
|
581
|
+
type: "tabs",
|
|
582
|
+
appearance: "plain",
|
|
583
|
+
tabs: [
|
|
584
|
+
{ key: "general", title: "General", icon: "settings", fields: [{ field: "email" }] },
|
|
585
|
+
{ key: "defaults", title: "Defaults", icon: "database", fields: [{ field: "default_values" }] }
|
|
586
|
+
]
|
|
587
|
+
}]
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
```
|
|
591
|
+
|
|
573
592
|
`option` fields can use static `options: [{ value, label }]` or a client-side
|
|
574
593
|
`optionsMapping`. The mapping can be a single object or an array of objects with
|
|
575
594
|
`{ from: string; value: string; label: string; valuePrefix?: string; labelPrefix?: string }`. Multiple
|
|
@@ -29,14 +29,52 @@ export type DataBuilderOptionMapping = {
|
|
|
29
29
|
labelPrefix?: string;
|
|
30
30
|
};
|
|
31
31
|
export type DataBuilderOptionsMapping = DataBuilderOptionMapping | DataBuilderOptionMapping[];
|
|
32
|
+
export type DataBuilderFormFieldDefinition = {
|
|
33
|
+
field: string;
|
|
34
|
+
width?: string | number;
|
|
35
|
+
placement?: "content" | "actions";
|
|
36
|
+
hidden?: string | boolean;
|
|
37
|
+
disabled?: string | boolean;
|
|
38
|
+
fields?: DataBuilderFormDefinition[];
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
};
|
|
41
|
+
export type DataBuilderFormTabDefinition = {
|
|
42
|
+
key: string;
|
|
43
|
+
title: string;
|
|
44
|
+
icon?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
fields: DataBuilderFormDefinition[];
|
|
47
|
+
};
|
|
48
|
+
export type DataBuilderFormTabsDefinition = {
|
|
49
|
+
type: "tabs";
|
|
50
|
+
label?: string;
|
|
51
|
+
width?: string | number;
|
|
52
|
+
appearance?: "card" | "plain";
|
|
53
|
+
tabs: DataBuilderFormTabDefinition[];
|
|
54
|
+
};
|
|
55
|
+
export type DataBuilderFormLayoutDefinition = {
|
|
56
|
+
type: string;
|
|
57
|
+
width?: string | number;
|
|
58
|
+
children?: DataBuilderFormDefinition[];
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
};
|
|
61
|
+
export type DataBuilderFormDefinition = DataBuilderFormFieldDefinition | DataBuilderFormTabsDefinition | DataBuilderFormLayoutDefinition;
|
|
62
|
+
export type DataBuilderForm = {
|
|
63
|
+
fields: DataBuilderFormDefinition[] | ((req: Request) => DataBuilderFormDefinition[] | Promise<DataBuilderFormDefinition[]>);
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
};
|
|
32
66
|
export type DataBuilderType = {
|
|
33
67
|
key: string;
|
|
34
68
|
singular: string;
|
|
35
69
|
plural: string;
|
|
36
70
|
schema: DataBuilderSchema;
|
|
37
71
|
forms?: {
|
|
38
|
-
[key: string]:
|
|
39
|
-
}
|
|
72
|
+
[key: string]: DataBuilderForm;
|
|
73
|
+
} | ((req: Request) => {
|
|
74
|
+
[key: string]: DataBuilderForm;
|
|
75
|
+
} | Promise<{
|
|
76
|
+
[key: string]: DataBuilderForm;
|
|
77
|
+
}>);
|
|
40
78
|
unmapped?: boolean;
|
|
41
79
|
};
|
|
42
80
|
export type DataBuilderFieldType = {
|
package/package.json
CHANGED