@trii/types 2.10.658 → 2.10.659
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.
|
@@ -48,5 +48,71 @@ export declare class FormConfig {
|
|
|
48
48
|
color?: string | '';
|
|
49
49
|
successMessage?: string | '';
|
|
50
50
|
errorMessage?: string | '';
|
|
51
|
-
items
|
|
51
|
+
items?: FormItem[];
|
|
52
|
+
schema?: FormSchema;
|
|
53
|
+
}
|
|
54
|
+
export interface FormSchema {
|
|
55
|
+
title: string;
|
|
56
|
+
description: string;
|
|
57
|
+
status: "draft" | "published";
|
|
58
|
+
draftRevision: number;
|
|
59
|
+
publishedRevision: number;
|
|
60
|
+
sections: FormSection[];
|
|
61
|
+
theme?: FormTheme;
|
|
62
|
+
confirmation?: FormConfirmation;
|
|
63
|
+
}
|
|
64
|
+
export interface FormSection {
|
|
65
|
+
id: string;
|
|
66
|
+
title: string;
|
|
67
|
+
description: string;
|
|
68
|
+
fields: FormField[];
|
|
69
|
+
defaultNext?: FormDestination;
|
|
70
|
+
}
|
|
71
|
+
export interface FormField {
|
|
72
|
+
id: string;
|
|
73
|
+
type: "short" | "long" | "single" | "multi" | "select" | "scale" | "email" | "date" | "time" | "file";
|
|
74
|
+
label: string;
|
|
75
|
+
required: boolean;
|
|
76
|
+
options?: FormOption[];
|
|
77
|
+
scale?: FormScale;
|
|
78
|
+
fileValidation?: FormFileValidation;
|
|
79
|
+
}
|
|
80
|
+
export interface FormOption {
|
|
81
|
+
id: string;
|
|
82
|
+
label: string;
|
|
83
|
+
next?: FormDestination;
|
|
84
|
+
}
|
|
85
|
+
export interface FormDestination {
|
|
86
|
+
action: "next" | "submit" | "goToSection";
|
|
87
|
+
sectionId?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface FormScale {
|
|
90
|
+
min: number;
|
|
91
|
+
minLabel: string;
|
|
92
|
+
max: number;
|
|
93
|
+
maxLabel: string;
|
|
94
|
+
style: "circle" | "star";
|
|
95
|
+
}
|
|
96
|
+
export interface FormFileValidation {
|
|
97
|
+
allowedExtensions: string[];
|
|
98
|
+
maxSizeMb: number;
|
|
99
|
+
maxFiles: number;
|
|
100
|
+
}
|
|
101
|
+
export interface FormTheme {
|
|
102
|
+
primaryColor: string;
|
|
103
|
+
backgroundColor: string;
|
|
104
|
+
cardColor: string;
|
|
105
|
+
textColor: string;
|
|
106
|
+
backgroundImage?: FormBackgroundImage;
|
|
107
|
+
}
|
|
108
|
+
export interface FormBackgroundImage {
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
url?: string;
|
|
111
|
+
fit: "cover" | "contain" | "stretch";
|
|
112
|
+
position: string;
|
|
113
|
+
overlayOpacity: number;
|
|
114
|
+
}
|
|
115
|
+
export interface FormConfirmation {
|
|
116
|
+
title: string;
|
|
117
|
+
message: string;
|
|
52
118
|
}
|