@nice2dev/ui-tools 1.0.10
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 +36 -0
- package/dist/access-control.d.ts +726 -0
- package/dist/access-control.d.ts.map +1 -0
- package/dist/accessibility-i18n.d.ts +1017 -0
- package/dist/accessibility-i18n.d.ts.map +1 -0
- package/dist/ai-assistant.d.ts +263 -0
- package/dist/ai-assistant.d.ts.map +1 -0
- package/dist/ai-playgrounds.d.ts +842 -0
- package/dist/ai-playgrounds.d.ts.map +1 -0
- package/dist/alerting-incidents.d.ts +558 -0
- package/dist/alerting-incidents.d.ts.map +1 -0
- package/dist/api-designer.d.ts +1568 -0
- package/dist/api-designer.d.ts.map +1 -0
- package/dist/api-testing.d.ts +1146 -0
- package/dist/api-testing.d.ts.map +1 -0
- package/dist/apm-profiling.d.ts +656 -0
- package/dist/apm-profiling.d.ts.map +1 -0
- package/dist/artifacts.d.ts +421 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/audit-compliance.d.ts +752 -0
- package/dist/audit-compliance.d.ts.map +1 -0
- package/dist/certificates.d.ts +256 -0
- package/dist/certificates.d.ts.map +1 -0
- package/dist/chart-builder.d.ts +1404 -0
- package/dist/chart-builder.d.ts.map +1 -0
- package/dist/cloud-instances.d.ts +169 -0
- package/dist/cloud-instances.d.ts.map +1 -0
- package/dist/config-management.d.ts +350 -0
- package/dist/config-management.d.ts.map +1 -0
- package/dist/containers.d.ts +256 -0
- package/dist/containers.d.ts.map +1 -0
- package/dist/dashboard-designer.d.ts +1238 -0
- package/dist/dashboard-designer.d.ts.map +1 -0
- package/dist/data-management.d.ts +496 -0
- package/dist/data-management.d.ts.map +1 -0
- package/dist/data-pipeline.d.ts +1105 -0
- package/dist/data-pipeline.d.ts.map +1 -0
- package/dist/data-warehouse.d.ts +1097 -0
- package/dist/data-warehouse.d.ts.map +1 -0
- package/dist/dataset-management.d.ts +782 -0
- package/dist/dataset-management.d.ts.map +1 -0
- package/dist/db-adapters.d.ts +704 -0
- package/dist/db-adapters.d.ts.map +1 -0
- package/dist/db-admin.d.ts +699 -0
- package/dist/db-admin.d.ts.map +1 -0
- package/dist/db-designer.d.ts +366 -0
- package/dist/db-designer.d.ts.map +1 -0
- package/dist/debugger.d.ts +356 -0
- package/dist/debugger.d.ts.map +1 -0
- package/dist/device-management.d.ts +871 -0
- package/dist/device-management.d.ts.map +1 -0
- package/dist/distributed-tracing.d.ts +427 -0
- package/dist/distributed-tracing.d.ts.map +1 -0
- package/dist/dns-management.d.ts +215 -0
- package/dist/dns-management.d.ts.map +1 -0
- package/dist/download-manager.d.ts +271 -0
- package/dist/download-manager.d.ts.map +1 -0
- package/dist/download-torrent.d.ts +1062 -0
- package/dist/download-torrent.d.ts.map +1 -0
- package/dist/edge-computing.d.ts +720 -0
- package/dist/edge-computing.d.ts.map +1 -0
- package/dist/education.d.ts +1135 -0
- package/dist/education.d.ts.map +1 -0
- package/dist/email-template.d.ts +1141 -0
- package/dist/email-template.d.ts.map +1 -0
- package/dist/erp-enterprise.d.ts +1270 -0
- package/dist/erp-enterprise.d.ts.map +1 -0
- package/dist/form-builder.d.ts +1117 -0
- package/dist/form-builder.d.ts.map +1 -0
- package/dist/game-engine-advanced.d.ts +1049 -0
- package/dist/game-engine-advanced.d.ts.map +1 -0
- package/dist/git.d.ts +415 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/hardware-integration.d.ts +966 -0
- package/dist/hardware-integration.d.ts.map +1 -0
- package/dist/iac.d.ts +318 -0
- package/dist/iac.d.ts.map +1 -0
- package/dist/icon-tools.d.ts +1023 -0
- package/dist/icon-tools.d.ts.map +1 -0
- package/dist/ide.d.ts +322 -0
- package/dist/ide.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1887 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integration-platform.d.ts +857 -0
- package/dist/integration-platform.d.ts.map +1 -0
- package/dist/kubernetes.d.ts +278 -0
- package/dist/kubernetes.d.ts.map +1 -0
- package/dist/life-management.d.ts +1132 -0
- package/dist/life-management.d.ts.map +1 -0
- package/dist/log-management.d.ts +473 -0
- package/dist/log-management.d.ts.map +1 -0
- package/dist/mathematics.d.ts +870 -0
- package/dist/mathematics.d.ts.map +1 -0
- package/dist/message-queue.d.ts +1006 -0
- package/dist/message-queue.d.ts.map +1 -0
- package/dist/metrics-dashboard.d.ts +596 -0
- package/dist/metrics-dashboard.d.ts.map +1 -0
- package/dist/mobile-components.d.ts +766 -0
- package/dist/mobile-components.d.ts.map +1 -0
- package/dist/model-deployment.d.ts +787 -0
- package/dist/model-deployment.d.ts.map +1 -0
- package/dist/model-registry.d.ts +740 -0
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/model-training.d.ts +706 -0
- package/dist/model-training.d.ts.map +1 -0
- package/dist/network-config.d.ts +334 -0
- package/dist/network-config.d.ts.map +1 -0
- package/dist/network-monitoring.d.ts +291 -0
- package/dist/network-monitoring.d.ts.map +1 -0
- package/dist/pdf-tools.d.ts +1003 -0
- package/dist/pdf-tools.d.ts.map +1 -0
- package/dist/pipelines.d.ts +250 -0
- package/dist/pipelines.d.ts.map +1 -0
- package/dist/remote-desktop.d.ts +207 -0
- package/dist/remote-desktop.d.ts.map +1 -0
- package/dist/report-designer.d.ts +1153 -0
- package/dist/report-designer.d.ts.map +1 -0
- package/dist/scada-industrial.d.ts +848 -0
- package/dist/scada-industrial.d.ts.map +1 -0
- package/dist/scientific-research.d.ts +1149 -0
- package/dist/scientific-research.d.ts.map +1 -0
- package/dist/secret-management.d.ts +617 -0
- package/dist/secret-management.d.ts.map +1 -0
- package/dist/security-scanning.d.ts +714 -0
- package/dist/security-scanning.d.ts.map +1 -0
- package/dist/self-service-analytics.d.ts +1208 -0
- package/dist/self-service-analytics.d.ts.map +1 -0
- package/dist/sensor-dashboard.d.ts +845 -0
- package/dist/sensor-dashboard.d.ts.map +1 -0
- package/dist/server-management.d.ts +331 -0
- package/dist/server-management.d.ts.map +1 -0
- package/dist/smart-home.d.ts +861 -0
- package/dist/smart-home.d.ts.map +1 -0
- package/dist/spreadsheet.d.ts +1043 -0
- package/dist/spreadsheet.d.ts.map +1 -0
- package/dist/sql-editor.d.ts +402 -0
- package/dist/sql-editor.d.ts.map +1 -0
- package/dist/terminal.d.ts +245 -0
- package/dist/terminal.d.ts.map +1 -0
- package/dist/testing-qa.d.ts +1013 -0
- package/dist/testing-qa.d.ts.map +1 -0
- package/dist/torrent-client.d.ts +298 -0
- package/dist/torrent-client.d.ts.map +1 -0
- package/dist/traceless.d.ts +759 -0
- package/dist/traceless.d.ts.map +1 -0
- package/dist/virtual-machines.d.ts +199 -0
- package/dist/virtual-machines.d.ts.map +1 -0
- package/dist/visual-scripting.d.ts +381 -0
- package/dist/visual-scripting.d.ts.map +1 -0
- package/dist/word-processor.d.ts +1124 -0
- package/dist/word-processor.d.ts.map +1 -0
- package/dist/workspace.d.ts +333 -0
- package/dist/workspace.d.ts.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,1117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file form-builder.ts
|
|
3
|
+
* @module @nice2dev/ui-tools
|
|
4
|
+
* @description PRO-14.4 — Form Builder
|
|
5
|
+
*
|
|
6
|
+
* Types for drag-drop form builder: field types, validation rules,
|
|
7
|
+
* conditional logic, multi-page forms, calculations, e-signatures, analytics.
|
|
8
|
+
*/
|
|
9
|
+
/** Form field type */
|
|
10
|
+
export type FormFieldType = 'text' | 'textarea' | 'number' | 'email' | 'phone' | 'url' | 'password' | 'date' | 'time' | 'datetime' | 'dateRange' | 'select' | 'multiSelect' | 'radio' | 'checkbox' | 'checkboxGroup' | 'switch' | 'slider' | 'rating' | 'file' | 'image' | 'signature' | 'address' | 'name' | 'currency' | 'percentage' | 'color' | 'hidden' | 'heading' | 'paragraph' | 'divider' | 'spacer' | 'html' | 'captcha' | 'repeater' | 'matrix' | 'table' | 'calculation' | 'lookup' | 'payment' | 'appointment';
|
|
11
|
+
/** Field value type */
|
|
12
|
+
export type FormFieldValue = string | number | boolean | Date | string[] | number[] | FormFileValue | FormFileValue[] | FormSignatureValue | FormAddressValue | FormNameValue | FormRepeaterValue | FormMatrixValue | FormPaymentValue | null | undefined;
|
|
13
|
+
/** Form builder configuration */
|
|
14
|
+
export interface FormBuilderConfig {
|
|
15
|
+
/** Initial form definition */
|
|
16
|
+
form?: FormDefinition;
|
|
17
|
+
/** Available field types */
|
|
18
|
+
fieldTypes?: FormFieldType[];
|
|
19
|
+
/** Custom field types */
|
|
20
|
+
customFieldTypes?: CustomFieldType[];
|
|
21
|
+
/** Theme */
|
|
22
|
+
theme?: FormBuilderTheme;
|
|
23
|
+
/** Locale */
|
|
24
|
+
locale?: string;
|
|
25
|
+
/** Enable preview */
|
|
26
|
+
preview?: boolean;
|
|
27
|
+
/** Enable undo/redo */
|
|
28
|
+
undoRedo?: boolean;
|
|
29
|
+
/** Enable collaboration */
|
|
30
|
+
collaboration?: boolean;
|
|
31
|
+
/** Validation mode */
|
|
32
|
+
validationMode?: 'onChange' | 'onBlur' | 'onSubmit';
|
|
33
|
+
/** Show field IDs */
|
|
34
|
+
showFieldIds?: boolean;
|
|
35
|
+
/** Show CSS classes */
|
|
36
|
+
showCssClasses?: boolean;
|
|
37
|
+
/** Allow HTML in labels */
|
|
38
|
+
allowHtmlLabels?: boolean;
|
|
39
|
+
/** Max fields */
|
|
40
|
+
maxFields?: number;
|
|
41
|
+
/** Max pages */
|
|
42
|
+
maxPages?: number;
|
|
43
|
+
/** Toolbar configuration */
|
|
44
|
+
toolbar?: FormBuilderToolbar;
|
|
45
|
+
/** Sidebar configuration */
|
|
46
|
+
sidebar?: FormBuilderSidebar;
|
|
47
|
+
}
|
|
48
|
+
/** Custom field type */
|
|
49
|
+
export interface CustomFieldType {
|
|
50
|
+
type: string;
|
|
51
|
+
label: string;
|
|
52
|
+
icon?: string;
|
|
53
|
+
category?: string;
|
|
54
|
+
defaultConfig: Partial<FormField>;
|
|
55
|
+
component?: string;
|
|
56
|
+
validator?: (value: FormFieldValue, field: FormField) => ValidationResult;
|
|
57
|
+
}
|
|
58
|
+
/** Form builder theme */
|
|
59
|
+
export interface FormBuilderTheme {
|
|
60
|
+
name?: string;
|
|
61
|
+
primary?: string;
|
|
62
|
+
secondary?: string;
|
|
63
|
+
background?: string;
|
|
64
|
+
surface?: string;
|
|
65
|
+
text?: string;
|
|
66
|
+
border?: string;
|
|
67
|
+
error?: string;
|
|
68
|
+
success?: string;
|
|
69
|
+
warning?: string;
|
|
70
|
+
borderRadius?: number;
|
|
71
|
+
spacing?: number;
|
|
72
|
+
fontFamily?: string;
|
|
73
|
+
fontSize?: number;
|
|
74
|
+
}
|
|
75
|
+
/** Form builder toolbar */
|
|
76
|
+
export interface FormBuilderToolbar {
|
|
77
|
+
visible?: boolean;
|
|
78
|
+
position?: 'top' | 'bottom';
|
|
79
|
+
items?: FormBuilderToolbarItem[];
|
|
80
|
+
}
|
|
81
|
+
/** Toolbar item */
|
|
82
|
+
export type FormBuilderToolbarItem = 'undo' | 'redo' | 'preview' | 'save' | 'export' | 'import' | 'settings' | 'clear' | 'separator';
|
|
83
|
+
/** Form builder sidebar */
|
|
84
|
+
export interface FormBuilderSidebar {
|
|
85
|
+
visible?: boolean;
|
|
86
|
+
position?: 'left' | 'right';
|
|
87
|
+
width?: number;
|
|
88
|
+
tabs?: ('fields' | 'properties' | 'style' | 'logic' | 'settings')[];
|
|
89
|
+
}
|
|
90
|
+
/** Form definition */
|
|
91
|
+
export interface FormDefinition {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
description?: string;
|
|
95
|
+
version?: string;
|
|
96
|
+
pages: FormPage[];
|
|
97
|
+
settings?: FormSettings;
|
|
98
|
+
theme?: FormTheme;
|
|
99
|
+
logic?: FormLogic;
|
|
100
|
+
calculations?: FormCalculation[];
|
|
101
|
+
validations?: FormValidation[];
|
|
102
|
+
actions?: FormAction[];
|
|
103
|
+
variables?: FormVariable[];
|
|
104
|
+
metadata?: FormMetadata;
|
|
105
|
+
}
|
|
106
|
+
/** Form page */
|
|
107
|
+
export interface FormPage {
|
|
108
|
+
id: string;
|
|
109
|
+
title?: string;
|
|
110
|
+
description?: string;
|
|
111
|
+
fields: FormField[];
|
|
112
|
+
layout?: FormLayout;
|
|
113
|
+
conditions?: FormCondition[];
|
|
114
|
+
submitOnPage?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** Form layout */
|
|
117
|
+
export interface FormLayout {
|
|
118
|
+
type: 'vertical' | 'horizontal' | 'grid' | 'custom';
|
|
119
|
+
columns?: number;
|
|
120
|
+
gap?: number;
|
|
121
|
+
responsive?: ResponsiveLayout;
|
|
122
|
+
}
|
|
123
|
+
/** Responsive layout */
|
|
124
|
+
export interface ResponsiveLayout {
|
|
125
|
+
breakpoints?: {
|
|
126
|
+
[key: string]: number;
|
|
127
|
+
};
|
|
128
|
+
layouts?: {
|
|
129
|
+
[key: string]: FormLayout;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Form settings */
|
|
133
|
+
export interface FormSettings {
|
|
134
|
+
submitUrl?: string;
|
|
135
|
+
submitMethod?: 'POST' | 'PUT' | 'PATCH';
|
|
136
|
+
submitHeaders?: Record<string, string>;
|
|
137
|
+
submitFormat?: 'json' | 'formData' | 'urlEncoded';
|
|
138
|
+
successMessage?: string;
|
|
139
|
+
errorMessage?: string;
|
|
140
|
+
redirectUrl?: string;
|
|
141
|
+
redirectDelay?: number;
|
|
142
|
+
saveProgress?: boolean;
|
|
143
|
+
autoSaveInterval?: number;
|
|
144
|
+
showProgressBar?: boolean;
|
|
145
|
+
showPageNumbers?: boolean;
|
|
146
|
+
showRequiredIndicator?: boolean;
|
|
147
|
+
requiredIndicator?: string;
|
|
148
|
+
showLabels?: boolean;
|
|
149
|
+
labelPosition?: 'top' | 'left' | 'inline' | 'floating';
|
|
150
|
+
labelWidth?: number;
|
|
151
|
+
allowPreviousPage?: boolean;
|
|
152
|
+
confirmNavigation?: boolean;
|
|
153
|
+
showNavigation?: boolean;
|
|
154
|
+
prevButtonText?: string;
|
|
155
|
+
nextButtonText?: string;
|
|
156
|
+
submitButtonText?: string;
|
|
157
|
+
validateOnBlur?: boolean;
|
|
158
|
+
validateOnChange?: boolean;
|
|
159
|
+
validateOnSubmit?: boolean;
|
|
160
|
+
scrollToFirstError?: boolean;
|
|
161
|
+
focusFirstError?: boolean;
|
|
162
|
+
honeypot?: boolean;
|
|
163
|
+
captcha?: CaptchaConfig;
|
|
164
|
+
fileTypeRestrictions?: string[];
|
|
165
|
+
maxFileSize?: number;
|
|
166
|
+
startDate?: Date;
|
|
167
|
+
endDate?: Date;
|
|
168
|
+
maxSubmissions?: number;
|
|
169
|
+
requireAuth?: boolean;
|
|
170
|
+
allowMultipleSubmissions?: boolean;
|
|
171
|
+
editablePeriod?: number;
|
|
172
|
+
notifications?: FormNotification[];
|
|
173
|
+
trackAnalytics?: boolean;
|
|
174
|
+
trackTiming?: boolean;
|
|
175
|
+
trackAbandonment?: boolean;
|
|
176
|
+
}
|
|
177
|
+
/** Captcha configuration */
|
|
178
|
+
export interface CaptchaConfig {
|
|
179
|
+
type: 'recaptcha-v2' | 'recaptcha-v3' | 'hcaptcha' | 'turnstile' | 'custom';
|
|
180
|
+
siteKey: string;
|
|
181
|
+
theme?: 'light' | 'dark';
|
|
182
|
+
size?: 'normal' | 'compact' | 'invisible';
|
|
183
|
+
action?: string;
|
|
184
|
+
threshold?: number;
|
|
185
|
+
}
|
|
186
|
+
/** Form notification */
|
|
187
|
+
export interface FormNotification {
|
|
188
|
+
id: string;
|
|
189
|
+
type: 'email' | 'webhook' | 'sms' | 'push';
|
|
190
|
+
trigger: 'submit' | 'complete' | 'abandon' | 'error' | 'schedule';
|
|
191
|
+
recipients?: NotificationRecipient[];
|
|
192
|
+
template?: NotificationTemplate;
|
|
193
|
+
conditions?: FormCondition[];
|
|
194
|
+
enabled?: boolean;
|
|
195
|
+
}
|
|
196
|
+
/** Notification recipient */
|
|
197
|
+
export interface NotificationRecipient {
|
|
198
|
+
type: 'static' | 'field' | 'admin' | 'submitter';
|
|
199
|
+
value: string;
|
|
200
|
+
}
|
|
201
|
+
/** Notification template */
|
|
202
|
+
export interface NotificationTemplate {
|
|
203
|
+
subject?: string;
|
|
204
|
+
body: string;
|
|
205
|
+
format?: 'text' | 'html';
|
|
206
|
+
attachments?: NotificationAttachment[];
|
|
207
|
+
}
|
|
208
|
+
/** Notification attachment */
|
|
209
|
+
export interface NotificationAttachment {
|
|
210
|
+
type: 'submission' | 'file' | 'pdf' | 'static';
|
|
211
|
+
source?: string;
|
|
212
|
+
filename?: string;
|
|
213
|
+
}
|
|
214
|
+
/** Form theme */
|
|
215
|
+
export interface FormTheme {
|
|
216
|
+
preset?: string;
|
|
217
|
+
colors?: FormColors;
|
|
218
|
+
typography?: FormTypography;
|
|
219
|
+
spacing?: FormSpacing;
|
|
220
|
+
borders?: FormBorders;
|
|
221
|
+
shadows?: FormShadows;
|
|
222
|
+
custom?: Record<string, string>;
|
|
223
|
+
}
|
|
224
|
+
/** Form colors */
|
|
225
|
+
export interface FormColors {
|
|
226
|
+
primary?: string;
|
|
227
|
+
secondary?: string;
|
|
228
|
+
background?: string;
|
|
229
|
+
surface?: string;
|
|
230
|
+
text?: string;
|
|
231
|
+
textSecondary?: string;
|
|
232
|
+
label?: string;
|
|
233
|
+
placeholder?: string;
|
|
234
|
+
border?: string;
|
|
235
|
+
borderFocus?: string;
|
|
236
|
+
error?: string;
|
|
237
|
+
errorBackground?: string;
|
|
238
|
+
success?: string;
|
|
239
|
+
warning?: string;
|
|
240
|
+
disabled?: string;
|
|
241
|
+
link?: string;
|
|
242
|
+
}
|
|
243
|
+
/** Form typography */
|
|
244
|
+
export interface FormTypography {
|
|
245
|
+
fontFamily?: string;
|
|
246
|
+
fontSize?: number;
|
|
247
|
+
fontSizeLabel?: number;
|
|
248
|
+
fontSizeHelper?: number;
|
|
249
|
+
fontSizeError?: number;
|
|
250
|
+
fontWeight?: number;
|
|
251
|
+
fontWeightLabel?: number;
|
|
252
|
+
lineHeight?: number;
|
|
253
|
+
}
|
|
254
|
+
/** Form spacing */
|
|
255
|
+
export interface FormSpacing {
|
|
256
|
+
fieldGap?: number;
|
|
257
|
+
sectionGap?: number;
|
|
258
|
+
labelGap?: number;
|
|
259
|
+
inputPadding?: number;
|
|
260
|
+
pageGap?: number;
|
|
261
|
+
}
|
|
262
|
+
/** Form borders */
|
|
263
|
+
export interface FormBorders {
|
|
264
|
+
radius?: number;
|
|
265
|
+
width?: number;
|
|
266
|
+
style?: string;
|
|
267
|
+
focusWidth?: number;
|
|
268
|
+
}
|
|
269
|
+
/** Form shadows */
|
|
270
|
+
export interface FormShadows {
|
|
271
|
+
input?: string;
|
|
272
|
+
inputFocus?: string;
|
|
273
|
+
card?: string;
|
|
274
|
+
button?: string;
|
|
275
|
+
}
|
|
276
|
+
/** Form metadata */
|
|
277
|
+
export interface FormMetadata {
|
|
278
|
+
created?: Date;
|
|
279
|
+
createdBy?: string;
|
|
280
|
+
modified?: Date;
|
|
281
|
+
modifiedBy?: string;
|
|
282
|
+
published?: boolean;
|
|
283
|
+
publishedDate?: Date;
|
|
284
|
+
status?: 'draft' | 'published' | 'archived';
|
|
285
|
+
tags?: string[];
|
|
286
|
+
category?: string;
|
|
287
|
+
analytics?: FormAnalyticsMetadata;
|
|
288
|
+
}
|
|
289
|
+
/** Form analytics metadata */
|
|
290
|
+
export interface FormAnalyticsMetadata {
|
|
291
|
+
totalViews?: number;
|
|
292
|
+
totalSubmissions?: number;
|
|
293
|
+
conversionRate?: number;
|
|
294
|
+
averageCompletionTime?: number;
|
|
295
|
+
abandonmentRate?: number;
|
|
296
|
+
}
|
|
297
|
+
/** Form field */
|
|
298
|
+
export interface FormField {
|
|
299
|
+
id: string;
|
|
300
|
+
type: FormFieldType;
|
|
301
|
+
name: string;
|
|
302
|
+
label?: string;
|
|
303
|
+
placeholder?: string;
|
|
304
|
+
helperText?: string;
|
|
305
|
+
tooltip?: string;
|
|
306
|
+
defaultValue?: FormFieldValue;
|
|
307
|
+
required?: boolean;
|
|
308
|
+
disabled?: boolean;
|
|
309
|
+
readOnly?: boolean;
|
|
310
|
+
hidden?: boolean;
|
|
311
|
+
validations?: FieldValidation[];
|
|
312
|
+
conditions?: FieldCondition[];
|
|
313
|
+
properties?: FieldProperties;
|
|
314
|
+
layout?: FieldLayout;
|
|
315
|
+
style?: FieldStyle;
|
|
316
|
+
permissions?: FieldPermissions;
|
|
317
|
+
data?: FieldData;
|
|
318
|
+
}
|
|
319
|
+
/** Field properties */
|
|
320
|
+
export interface FieldProperties {
|
|
321
|
+
minLength?: number;
|
|
322
|
+
maxLength?: number;
|
|
323
|
+
pattern?: string;
|
|
324
|
+
patternMessage?: string;
|
|
325
|
+
mask?: string;
|
|
326
|
+
maskChar?: string;
|
|
327
|
+
prefix?: string;
|
|
328
|
+
suffix?: string;
|
|
329
|
+
min?: number;
|
|
330
|
+
max?: number;
|
|
331
|
+
step?: number;
|
|
332
|
+
precision?: number;
|
|
333
|
+
format?: string;
|
|
334
|
+
minDate?: Date | string;
|
|
335
|
+
maxDate?: Date | string;
|
|
336
|
+
dateFormat?: string;
|
|
337
|
+
timeFormat?: string;
|
|
338
|
+
timezone?: string;
|
|
339
|
+
disabledDates?: (Date | string)[];
|
|
340
|
+
disabledDays?: number[];
|
|
341
|
+
showCalendar?: boolean;
|
|
342
|
+
showTime?: boolean;
|
|
343
|
+
options?: FieldOption[];
|
|
344
|
+
optionsSource?: OptionSource;
|
|
345
|
+
searchable?: boolean;
|
|
346
|
+
clearable?: boolean;
|
|
347
|
+
creatable?: boolean;
|
|
348
|
+
multiple?: boolean;
|
|
349
|
+
maxSelections?: number;
|
|
350
|
+
displayFormat?: string;
|
|
351
|
+
accept?: string;
|
|
352
|
+
maxFileSize?: number;
|
|
353
|
+
maxFiles?: number;
|
|
354
|
+
minFiles?: number;
|
|
355
|
+
allowedExtensions?: string[];
|
|
356
|
+
camera?: boolean;
|
|
357
|
+
crop?: ImageCropConfig;
|
|
358
|
+
resize?: ImageResizeConfig;
|
|
359
|
+
marks?: SliderMark[];
|
|
360
|
+
range?: boolean;
|
|
361
|
+
vertical?: boolean;
|
|
362
|
+
ratingMax?: number;
|
|
363
|
+
ratingIcons?: {
|
|
364
|
+
full: string;
|
|
365
|
+
half?: string;
|
|
366
|
+
empty: string;
|
|
367
|
+
};
|
|
368
|
+
allowHalf?: boolean;
|
|
369
|
+
addressType?: 'full' | 'simple' | 'international';
|
|
370
|
+
googleMapsKey?: string;
|
|
371
|
+
autocomplete?: boolean;
|
|
372
|
+
showMap?: boolean;
|
|
373
|
+
signatureType?: 'draw' | 'type' | 'upload' | 'all';
|
|
374
|
+
signatureWidth?: number;
|
|
375
|
+
signatureHeight?: number;
|
|
376
|
+
penColor?: string;
|
|
377
|
+
penWidth?: number;
|
|
378
|
+
signatureFonts?: string[];
|
|
379
|
+
minItems?: number;
|
|
380
|
+
maxItems?: number;
|
|
381
|
+
itemTemplate?: FormField[];
|
|
382
|
+
addButtonText?: string;
|
|
383
|
+
removeButtonText?: string;
|
|
384
|
+
sortable?: boolean;
|
|
385
|
+
rows?: MatrixRow[];
|
|
386
|
+
columns?: MatrixColumn[];
|
|
387
|
+
cellType?: 'radio' | 'checkbox' | 'text' | 'number' | 'select';
|
|
388
|
+
formula?: string;
|
|
389
|
+
variables?: string[];
|
|
390
|
+
outputFormat?: string;
|
|
391
|
+
lookupSource?: LookupSource;
|
|
392
|
+
lookupField?: string;
|
|
393
|
+
lookupDisplay?: string;
|
|
394
|
+
paymentProvider?: PaymentProvider;
|
|
395
|
+
amount?: number | string;
|
|
396
|
+
currency?: string;
|
|
397
|
+
description?: string;
|
|
398
|
+
appointmentDuration?: number;
|
|
399
|
+
appointmentBuffer?: number;
|
|
400
|
+
availableSlots?: AvailableSlot[];
|
|
401
|
+
timezoneSelection?: boolean;
|
|
402
|
+
content?: string;
|
|
403
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
404
|
+
custom?: Record<string, unknown>;
|
|
405
|
+
}
|
|
406
|
+
/** Field option */
|
|
407
|
+
export interface FieldOption {
|
|
408
|
+
value: string | number;
|
|
409
|
+
label: string;
|
|
410
|
+
disabled?: boolean;
|
|
411
|
+
group?: string;
|
|
412
|
+
description?: string;
|
|
413
|
+
icon?: string;
|
|
414
|
+
color?: string;
|
|
415
|
+
}
|
|
416
|
+
/** Option source */
|
|
417
|
+
export interface OptionSource {
|
|
418
|
+
type: 'static' | 'api' | 'field' | 'function';
|
|
419
|
+
url?: string;
|
|
420
|
+
method?: 'GET' | 'POST';
|
|
421
|
+
headers?: Record<string, string>;
|
|
422
|
+
params?: Record<string, string>;
|
|
423
|
+
body?: unknown;
|
|
424
|
+
fieldId?: string;
|
|
425
|
+
valuePath?: string;
|
|
426
|
+
labelPath?: string;
|
|
427
|
+
transform?: string;
|
|
428
|
+
cache?: boolean;
|
|
429
|
+
cacheTime?: number;
|
|
430
|
+
dependsOn?: string[];
|
|
431
|
+
}
|
|
432
|
+
/** Image crop configuration */
|
|
433
|
+
export interface ImageCropConfig {
|
|
434
|
+
enabled: boolean;
|
|
435
|
+
aspectRatio?: number;
|
|
436
|
+
minWidth?: number;
|
|
437
|
+
minHeight?: number;
|
|
438
|
+
maxWidth?: number;
|
|
439
|
+
maxHeight?: number;
|
|
440
|
+
circular?: boolean;
|
|
441
|
+
}
|
|
442
|
+
/** Image resize configuration */
|
|
443
|
+
export interface ImageResizeConfig {
|
|
444
|
+
enabled: boolean;
|
|
445
|
+
maxWidth?: number;
|
|
446
|
+
maxHeight?: number;
|
|
447
|
+
quality?: number;
|
|
448
|
+
format?: 'jpeg' | 'png' | 'webp';
|
|
449
|
+
}
|
|
450
|
+
/** Slider mark */
|
|
451
|
+
export interface SliderMark {
|
|
452
|
+
value: number;
|
|
453
|
+
label?: string;
|
|
454
|
+
}
|
|
455
|
+
/** Matrix row */
|
|
456
|
+
export interface MatrixRow {
|
|
457
|
+
id: string;
|
|
458
|
+
label: string;
|
|
459
|
+
required?: boolean;
|
|
460
|
+
}
|
|
461
|
+
/** Matrix column */
|
|
462
|
+
export interface MatrixColumn {
|
|
463
|
+
id: string;
|
|
464
|
+
label: string;
|
|
465
|
+
value: string | number;
|
|
466
|
+
}
|
|
467
|
+
/** Lookup source */
|
|
468
|
+
export interface LookupSource {
|
|
469
|
+
type: 'api' | 'database' | 'static';
|
|
470
|
+
url?: string;
|
|
471
|
+
table?: string;
|
|
472
|
+
data?: Record<string, unknown>[];
|
|
473
|
+
searchFields?: string[];
|
|
474
|
+
minChars?: number;
|
|
475
|
+
debounce?: number;
|
|
476
|
+
}
|
|
477
|
+
/** Payment provider */
|
|
478
|
+
export interface PaymentProvider {
|
|
479
|
+
type: 'stripe' | 'paypal' | 'square' | 'braintree' | 'custom';
|
|
480
|
+
publicKey?: string;
|
|
481
|
+
environment?: 'sandbox' | 'production';
|
|
482
|
+
methods?: ('card' | 'bank' | 'wallet')[];
|
|
483
|
+
}
|
|
484
|
+
/** Available slot */
|
|
485
|
+
export interface AvailableSlot {
|
|
486
|
+
dayOfWeek?: number;
|
|
487
|
+
date?: string;
|
|
488
|
+
startTime: string;
|
|
489
|
+
endTime: string;
|
|
490
|
+
capacity?: number;
|
|
491
|
+
}
|
|
492
|
+
/** Field layout */
|
|
493
|
+
export interface FieldLayout {
|
|
494
|
+
column?: number;
|
|
495
|
+
columnSpan?: number;
|
|
496
|
+
row?: number;
|
|
497
|
+
rowSpan?: number;
|
|
498
|
+
order?: number;
|
|
499
|
+
width?: string | number;
|
|
500
|
+
minWidth?: string | number;
|
|
501
|
+
maxWidth?: string | number;
|
|
502
|
+
responsive?: ResponsiveFieldLayout;
|
|
503
|
+
}
|
|
504
|
+
/** Responsive field layout */
|
|
505
|
+
export interface ResponsiveFieldLayout {
|
|
506
|
+
sm?: Partial<FieldLayout>;
|
|
507
|
+
md?: Partial<FieldLayout>;
|
|
508
|
+
lg?: Partial<FieldLayout>;
|
|
509
|
+
xl?: Partial<FieldLayout>;
|
|
510
|
+
}
|
|
511
|
+
/** Field style */
|
|
512
|
+
export interface FieldStyle {
|
|
513
|
+
className?: string;
|
|
514
|
+
labelClassName?: string;
|
|
515
|
+
inputClassName?: string;
|
|
516
|
+
helperClassName?: string;
|
|
517
|
+
errorClassName?: string;
|
|
518
|
+
wrapperStyle?: Record<string, string>;
|
|
519
|
+
labelStyle?: Record<string, string>;
|
|
520
|
+
inputStyle?: Record<string, string>;
|
|
521
|
+
customCss?: string;
|
|
522
|
+
}
|
|
523
|
+
/** Field permissions */
|
|
524
|
+
export interface FieldPermissions {
|
|
525
|
+
view?: string[];
|
|
526
|
+
edit?: string[];
|
|
527
|
+
required?: string[];
|
|
528
|
+
}
|
|
529
|
+
/** Field data */
|
|
530
|
+
export interface FieldData {
|
|
531
|
+
attributes?: Record<string, string>;
|
|
532
|
+
dataset?: Record<string, string>;
|
|
533
|
+
autofill?: string;
|
|
534
|
+
autocomplete?: string;
|
|
535
|
+
}
|
|
536
|
+
/** File value */
|
|
537
|
+
export interface FormFileValue {
|
|
538
|
+
id?: string;
|
|
539
|
+
name: string;
|
|
540
|
+
size: number;
|
|
541
|
+
type: string;
|
|
542
|
+
url?: string;
|
|
543
|
+
preview?: string;
|
|
544
|
+
data?: string | ArrayBuffer;
|
|
545
|
+
status?: 'pending' | 'uploading' | 'completed' | 'error';
|
|
546
|
+
progress?: number;
|
|
547
|
+
error?: string;
|
|
548
|
+
}
|
|
549
|
+
/** Signature value */
|
|
550
|
+
export interface FormSignatureValue {
|
|
551
|
+
type: 'draw' | 'type' | 'upload';
|
|
552
|
+
data?: string;
|
|
553
|
+
text?: string;
|
|
554
|
+
font?: string;
|
|
555
|
+
timestamp?: Date;
|
|
556
|
+
ip?: string;
|
|
557
|
+
}
|
|
558
|
+
/** Address value */
|
|
559
|
+
export interface FormAddressValue {
|
|
560
|
+
street1?: string;
|
|
561
|
+
street2?: string;
|
|
562
|
+
city?: string;
|
|
563
|
+
state?: string;
|
|
564
|
+
postalCode?: string;
|
|
565
|
+
country?: string;
|
|
566
|
+
formatted?: string;
|
|
567
|
+
latitude?: number;
|
|
568
|
+
longitude?: number;
|
|
569
|
+
}
|
|
570
|
+
/** Name value */
|
|
571
|
+
export interface FormNameValue {
|
|
572
|
+
prefix?: string;
|
|
573
|
+
firstName?: string;
|
|
574
|
+
middleName?: string;
|
|
575
|
+
lastName?: string;
|
|
576
|
+
suffix?: string;
|
|
577
|
+
formatted?: string;
|
|
578
|
+
}
|
|
579
|
+
/** Repeater value - uses unknown to avoid circular reference */
|
|
580
|
+
export type FormRepeaterValue = Record<string, unknown>[];
|
|
581
|
+
/** Matrix value - uses unknown to avoid circular reference */
|
|
582
|
+
export type FormMatrixValue = Record<string, Record<string, unknown>>;
|
|
583
|
+
/** Payment value */
|
|
584
|
+
export interface FormPaymentValue {
|
|
585
|
+
transactionId?: string;
|
|
586
|
+
status?: 'pending' | 'processing' | 'completed' | 'failed' | 'refunded';
|
|
587
|
+
amount?: number;
|
|
588
|
+
currency?: string;
|
|
589
|
+
method?: string;
|
|
590
|
+
last4?: string;
|
|
591
|
+
brand?: string;
|
|
592
|
+
receipt?: string;
|
|
593
|
+
error?: string;
|
|
594
|
+
}
|
|
595
|
+
/** Field validation */
|
|
596
|
+
export interface FieldValidation {
|
|
597
|
+
id: string;
|
|
598
|
+
type: ValidationType;
|
|
599
|
+
message?: string;
|
|
600
|
+
params?: ValidationParams;
|
|
601
|
+
condition?: FormCondition;
|
|
602
|
+
}
|
|
603
|
+
/** Validation type */
|
|
604
|
+
export type ValidationType = 'required' | 'email' | 'url' | 'phone' | 'minLength' | 'maxLength' | 'min' | 'max' | 'pattern' | 'matches' | 'custom' | 'date' | 'dateRange' | 'time' | 'number' | 'integer' | 'decimal' | 'creditCard' | 'postalCode' | 'ssn' | 'ipAddress' | 'alphanumeric' | 'alpha' | 'numeric' | 'fileType' | 'fileSize' | 'imageSize' | 'uniqueInRepater' | 'asyncValidator';
|
|
605
|
+
/** Validation params */
|
|
606
|
+
export interface ValidationParams {
|
|
607
|
+
value?: unknown;
|
|
608
|
+
min?: number;
|
|
609
|
+
max?: number;
|
|
610
|
+
pattern?: string;
|
|
611
|
+
flags?: string;
|
|
612
|
+
field?: string;
|
|
613
|
+
types?: string[];
|
|
614
|
+
allowedValues?: unknown[];
|
|
615
|
+
url?: string;
|
|
616
|
+
method?: string;
|
|
617
|
+
custom?: (value: FormFieldValue, field: FormField, form: FormDefinition) => boolean | Promise<boolean>;
|
|
618
|
+
}
|
|
619
|
+
/** Form validation */
|
|
620
|
+
export interface FormValidation {
|
|
621
|
+
id: string;
|
|
622
|
+
type: 'cross-field' | 'page' | 'form';
|
|
623
|
+
fields?: string[];
|
|
624
|
+
rule: ValidationRule;
|
|
625
|
+
message: string;
|
|
626
|
+
}
|
|
627
|
+
/** Validation rule */
|
|
628
|
+
export interface ValidationRule {
|
|
629
|
+
type: 'comparison' | 'expression' | 'custom';
|
|
630
|
+
operator?: ComparisonOperator;
|
|
631
|
+
field1?: string;
|
|
632
|
+
field2?: string;
|
|
633
|
+
value?: unknown;
|
|
634
|
+
expression?: string;
|
|
635
|
+
custom?: (values: Record<string, FormFieldValue>) => boolean | Promise<boolean>;
|
|
636
|
+
}
|
|
637
|
+
/** Comparison operator */
|
|
638
|
+
export type ComparisonOperator = 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'matches' | 'isEmpty' | 'isNotEmpty';
|
|
639
|
+
/** Validation result */
|
|
640
|
+
export interface ValidationResult {
|
|
641
|
+
valid: boolean;
|
|
642
|
+
errors?: ValidationError[];
|
|
643
|
+
}
|
|
644
|
+
/** Validation error */
|
|
645
|
+
export interface ValidationError {
|
|
646
|
+
fieldId: string;
|
|
647
|
+
message: string;
|
|
648
|
+
type: ValidationType | string;
|
|
649
|
+
params?: Record<string, unknown>;
|
|
650
|
+
}
|
|
651
|
+
/** Form logic */
|
|
652
|
+
export interface FormLogic {
|
|
653
|
+
rules: LogicRule[];
|
|
654
|
+
executeOn?: 'change' | 'blur' | 'both';
|
|
655
|
+
}
|
|
656
|
+
/** Logic rule */
|
|
657
|
+
export interface LogicRule {
|
|
658
|
+
id: string;
|
|
659
|
+
name?: string;
|
|
660
|
+
conditions: FormCondition[];
|
|
661
|
+
conditionLogic?: 'and' | 'or';
|
|
662
|
+
actions: LogicAction[];
|
|
663
|
+
enabled?: boolean;
|
|
664
|
+
priority?: number;
|
|
665
|
+
}
|
|
666
|
+
/** Form condition */
|
|
667
|
+
export interface FormCondition {
|
|
668
|
+
field: string;
|
|
669
|
+
operator: ConditionOperator;
|
|
670
|
+
value?: unknown;
|
|
671
|
+
values?: unknown[];
|
|
672
|
+
}
|
|
673
|
+
/** Condition operator */
|
|
674
|
+
export type ConditionOperator = 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'isEmpty' | 'isNotEmpty' | 'isChecked' | 'isNotChecked' | 'isValid' | 'isInvalid' | 'changed' | 'in' | 'notIn' | 'between' | 'regex';
|
|
675
|
+
/** Field condition */
|
|
676
|
+
export interface FieldCondition {
|
|
677
|
+
action: 'show' | 'hide' | 'enable' | 'disable' | 'require' | 'unrequire';
|
|
678
|
+
conditions: FormCondition[];
|
|
679
|
+
conditionLogic?: 'and' | 'or';
|
|
680
|
+
}
|
|
681
|
+
/** Logic action */
|
|
682
|
+
export interface LogicAction {
|
|
683
|
+
type: LogicActionType;
|
|
684
|
+
target?: string;
|
|
685
|
+
targets?: string[];
|
|
686
|
+
value?: unknown;
|
|
687
|
+
params?: Record<string, unknown>;
|
|
688
|
+
}
|
|
689
|
+
/** Logic action type */
|
|
690
|
+
export type LogicActionType = 'show' | 'hide' | 'enable' | 'disable' | 'require' | 'unrequire' | 'setValue' | 'clearValue' | 'setOptions' | 'addOption' | 'removeOption' | 'setValidation' | 'removeValidation' | 'setProperty' | 'goToPage' | 'submit' | 'reset' | 'triggerEvent' | 'runScript' | 'callApi';
|
|
691
|
+
/** Form calculation */
|
|
692
|
+
export interface FormCalculation {
|
|
693
|
+
id: string;
|
|
694
|
+
name?: string;
|
|
695
|
+
targetField: string;
|
|
696
|
+
formula: string;
|
|
697
|
+
variables?: CalculationVariable[];
|
|
698
|
+
trigger?: 'change' | 'blur' | 'manual';
|
|
699
|
+
format?: CalculationFormat;
|
|
700
|
+
conditions?: FormCondition[];
|
|
701
|
+
enabled?: boolean;
|
|
702
|
+
}
|
|
703
|
+
/** Calculation variable */
|
|
704
|
+
export interface CalculationVariable {
|
|
705
|
+
name: string;
|
|
706
|
+
field?: string;
|
|
707
|
+
value?: unknown;
|
|
708
|
+
type?: 'field' | 'constant' | 'function';
|
|
709
|
+
}
|
|
710
|
+
/** Calculation format */
|
|
711
|
+
export interface CalculationFormat {
|
|
712
|
+
type: 'number' | 'currency' | 'percentage' | 'date' | 'custom';
|
|
713
|
+
decimals?: number;
|
|
714
|
+
currency?: string;
|
|
715
|
+
locale?: string;
|
|
716
|
+
pattern?: string;
|
|
717
|
+
}
|
|
718
|
+
/** Form action */
|
|
719
|
+
export interface FormAction {
|
|
720
|
+
id: string;
|
|
721
|
+
name?: string;
|
|
722
|
+
trigger: ActionTrigger;
|
|
723
|
+
action: ActionConfig;
|
|
724
|
+
conditions?: FormCondition[];
|
|
725
|
+
enabled?: boolean;
|
|
726
|
+
}
|
|
727
|
+
/** Action trigger */
|
|
728
|
+
export interface ActionTrigger {
|
|
729
|
+
type: 'submit' | 'pageChange' | 'fieldChange' | 'click' | 'timer' | 'custom';
|
|
730
|
+
field?: string;
|
|
731
|
+
page?: number;
|
|
732
|
+
delay?: number;
|
|
733
|
+
event?: string;
|
|
734
|
+
}
|
|
735
|
+
/** Action config */
|
|
736
|
+
export interface ActionConfig {
|
|
737
|
+
type: ActionType;
|
|
738
|
+
params?: ActionParams;
|
|
739
|
+
}
|
|
740
|
+
/** Action type */
|
|
741
|
+
export type ActionType = 'submitForm' | 'saveProgress' | 'redirect' | 'showMessage' | 'showModal' | 'closeModal' | 'callApi' | 'downloadFile' | 'printForm' | 'email' | 'runScript' | 'triggerWebhook' | 'analytics' | 'custom';
|
|
742
|
+
/** Action params */
|
|
743
|
+
export interface ActionParams {
|
|
744
|
+
url?: string;
|
|
745
|
+
method?: string;
|
|
746
|
+
headers?: Record<string, string>;
|
|
747
|
+
body?: unknown;
|
|
748
|
+
message?: string;
|
|
749
|
+
messageType?: 'success' | 'error' | 'warning' | 'info';
|
|
750
|
+
modalId?: string;
|
|
751
|
+
script?: string;
|
|
752
|
+
filename?: string;
|
|
753
|
+
eventName?: string;
|
|
754
|
+
eventData?: Record<string, unknown>;
|
|
755
|
+
delay?: number;
|
|
756
|
+
}
|
|
757
|
+
/** Form variable */
|
|
758
|
+
export interface FormVariable {
|
|
759
|
+
name: string;
|
|
760
|
+
source: VariableSource;
|
|
761
|
+
defaultValue?: unknown;
|
|
762
|
+
transform?: VariableTransform;
|
|
763
|
+
}
|
|
764
|
+
/** Variable source */
|
|
765
|
+
export type VariableSource = {
|
|
766
|
+
type: 'constant';
|
|
767
|
+
value: unknown;
|
|
768
|
+
} | {
|
|
769
|
+
type: 'queryParam';
|
|
770
|
+
param: string;
|
|
771
|
+
} | {
|
|
772
|
+
type: 'cookie';
|
|
773
|
+
name: string;
|
|
774
|
+
} | {
|
|
775
|
+
type: 'localStorage';
|
|
776
|
+
key: string;
|
|
777
|
+
} | {
|
|
778
|
+
type: 'sessionStorage';
|
|
779
|
+
key: string;
|
|
780
|
+
} | {
|
|
781
|
+
type: 'userData';
|
|
782
|
+
property: string;
|
|
783
|
+
} | {
|
|
784
|
+
type: 'api';
|
|
785
|
+
url: string;
|
|
786
|
+
path?: string;
|
|
787
|
+
} | {
|
|
788
|
+
type: 'date';
|
|
789
|
+
format?: string;
|
|
790
|
+
} | {
|
|
791
|
+
type: 'random';
|
|
792
|
+
valueType: 'uuid' | 'number' | 'string';
|
|
793
|
+
options?: unknown;
|
|
794
|
+
} | {
|
|
795
|
+
type: 'custom';
|
|
796
|
+
function: string;
|
|
797
|
+
};
|
|
798
|
+
/** Variable transform */
|
|
799
|
+
export interface VariableTransform {
|
|
800
|
+
type: 'uppercase' | 'lowercase' | 'trim' | 'replace' | 'format' | 'custom';
|
|
801
|
+
params?: Record<string, unknown>;
|
|
802
|
+
}
|
|
803
|
+
/** Form submission */
|
|
804
|
+
export interface FormSubmission {
|
|
805
|
+
id: string;
|
|
806
|
+
formId: string;
|
|
807
|
+
formVersion?: string;
|
|
808
|
+
values: Record<string, FormFieldValue>;
|
|
809
|
+
files?: FormFileSubmission[];
|
|
810
|
+
metadata: SubmissionMetadata;
|
|
811
|
+
status: SubmissionStatus;
|
|
812
|
+
payment?: FormPaymentValue;
|
|
813
|
+
signature?: FormSignatureValue;
|
|
814
|
+
}
|
|
815
|
+
/** File submission */
|
|
816
|
+
export interface FormFileSubmission {
|
|
817
|
+
fieldId: string;
|
|
818
|
+
files: FormFileValue[];
|
|
819
|
+
}
|
|
820
|
+
/** Submission metadata */
|
|
821
|
+
export interface SubmissionMetadata {
|
|
822
|
+
submittedAt: Date;
|
|
823
|
+
updatedAt?: Date;
|
|
824
|
+
ip?: string;
|
|
825
|
+
userAgent?: string;
|
|
826
|
+
referrer?: string;
|
|
827
|
+
userId?: string;
|
|
828
|
+
sessionId?: string;
|
|
829
|
+
startTime?: Date;
|
|
830
|
+
completionTime?: number;
|
|
831
|
+
pages?: PageSubmissionMetadata[];
|
|
832
|
+
abandonedAt?: Date;
|
|
833
|
+
geolocation?: GeolocationData;
|
|
834
|
+
device?: DeviceData;
|
|
835
|
+
}
|
|
836
|
+
/** Page submission metadata */
|
|
837
|
+
export interface PageSubmissionMetadata {
|
|
838
|
+
pageId: string;
|
|
839
|
+
startTime: Date;
|
|
840
|
+
endTime?: Date;
|
|
841
|
+
timeSpent: number;
|
|
842
|
+
validationErrors?: number;
|
|
843
|
+
}
|
|
844
|
+
/** Geolocation data */
|
|
845
|
+
export interface GeolocationData {
|
|
846
|
+
country?: string;
|
|
847
|
+
region?: string;
|
|
848
|
+
city?: string;
|
|
849
|
+
postalCode?: string;
|
|
850
|
+
latitude?: number;
|
|
851
|
+
longitude?: number;
|
|
852
|
+
timezone?: string;
|
|
853
|
+
}
|
|
854
|
+
/** Device data */
|
|
855
|
+
export interface DeviceData {
|
|
856
|
+
type?: 'desktop' | 'tablet' | 'mobile';
|
|
857
|
+
browser?: string;
|
|
858
|
+
browserVersion?: string;
|
|
859
|
+
os?: string;
|
|
860
|
+
osVersion?: string;
|
|
861
|
+
screenWidth?: number;
|
|
862
|
+
screenHeight?: number;
|
|
863
|
+
}
|
|
864
|
+
/** Submission status */
|
|
865
|
+
export type SubmissionStatus = 'draft' | 'pending' | 'submitted' | 'processing' | 'completed' | 'failed' | 'abandoned' | 'spam';
|
|
866
|
+
/** Form analytics */
|
|
867
|
+
export interface FormAnalytics {
|
|
868
|
+
formId: string;
|
|
869
|
+
period: AnalyticsPeriod;
|
|
870
|
+
summary: AnalyticsSummary;
|
|
871
|
+
pageAnalytics: PageAnalytics[];
|
|
872
|
+
fieldAnalytics: FieldAnalytics[];
|
|
873
|
+
conversionFunnel: ConversionFunnel;
|
|
874
|
+
abandonmentAnalysis: AbandonmentAnalysis;
|
|
875
|
+
timeAnalysis: TimeAnalysis;
|
|
876
|
+
deviceAnalysis: DeviceAnalysis;
|
|
877
|
+
geographicAnalysis: GeographicAnalysis;
|
|
878
|
+
}
|
|
879
|
+
/** Analytics period */
|
|
880
|
+
export interface AnalyticsPeriod {
|
|
881
|
+
start: Date;
|
|
882
|
+
end: Date;
|
|
883
|
+
granularity: 'hour' | 'day' | 'week' | 'month';
|
|
884
|
+
}
|
|
885
|
+
/** Analytics summary */
|
|
886
|
+
export interface AnalyticsSummary {
|
|
887
|
+
totalViews: number;
|
|
888
|
+
uniqueViews: number;
|
|
889
|
+
totalStarts: number;
|
|
890
|
+
totalSubmissions: number;
|
|
891
|
+
conversionRate: number;
|
|
892
|
+
completionRate: number;
|
|
893
|
+
averageCompletionTime: number;
|
|
894
|
+
medianCompletionTime: number;
|
|
895
|
+
abandonmentRate: number;
|
|
896
|
+
returningUsers: number;
|
|
897
|
+
validationErrorRate: number;
|
|
898
|
+
trend: TrendData[];
|
|
899
|
+
}
|
|
900
|
+
/** Trend data */
|
|
901
|
+
export interface TrendData {
|
|
902
|
+
date: Date;
|
|
903
|
+
views: number;
|
|
904
|
+
starts: number;
|
|
905
|
+
submissions: number;
|
|
906
|
+
}
|
|
907
|
+
/** Page analytics */
|
|
908
|
+
export interface PageAnalytics {
|
|
909
|
+
pageId: string;
|
|
910
|
+
pageNumber: number;
|
|
911
|
+
views: number;
|
|
912
|
+
completions: number;
|
|
913
|
+
dropoffs: number;
|
|
914
|
+
averageTime: number;
|
|
915
|
+
validationErrors: number;
|
|
916
|
+
mostTriggeredErrors: {
|
|
917
|
+
fieldId: string;
|
|
918
|
+
count: number;
|
|
919
|
+
}[];
|
|
920
|
+
}
|
|
921
|
+
/** Field analytics */
|
|
922
|
+
export interface FieldAnalytics {
|
|
923
|
+
fieldId: string;
|
|
924
|
+
fieldType: FormFieldType;
|
|
925
|
+
interactionCount: number;
|
|
926
|
+
completionRate: number;
|
|
927
|
+
averageTime: number;
|
|
928
|
+
validationErrors: number;
|
|
929
|
+
emptySubmissions: number;
|
|
930
|
+
valueDistribution?: {
|
|
931
|
+
value: string;
|
|
932
|
+
count: number;
|
|
933
|
+
}[];
|
|
934
|
+
correctionRate: number;
|
|
935
|
+
}
|
|
936
|
+
/** Conversion funnel */
|
|
937
|
+
export interface ConversionFunnel {
|
|
938
|
+
stages: FunnelStage[];
|
|
939
|
+
overallConversion: number;
|
|
940
|
+
biggestDropoff: {
|
|
941
|
+
from: string;
|
|
942
|
+
to: string;
|
|
943
|
+
rate: number;
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
/** Funnel stage */
|
|
947
|
+
export interface FunnelStage {
|
|
948
|
+
id: string;
|
|
949
|
+
name: string;
|
|
950
|
+
count: number;
|
|
951
|
+
percentage: number;
|
|
952
|
+
dropoffRate: number;
|
|
953
|
+
}
|
|
954
|
+
/** Abandonment analysis */
|
|
955
|
+
export interface AbandonmentAnalysis {
|
|
956
|
+
totalAbandoned: number;
|
|
957
|
+
abandonmentRate: number;
|
|
958
|
+
byPage: {
|
|
959
|
+
pageId: string;
|
|
960
|
+
count: number;
|
|
961
|
+
percentage: number;
|
|
962
|
+
}[];
|
|
963
|
+
byField: {
|
|
964
|
+
fieldId: string;
|
|
965
|
+
count: number;
|
|
966
|
+
percentage: number;
|
|
967
|
+
}[];
|
|
968
|
+
averageTimeBeforeAbandonment: number;
|
|
969
|
+
commonLastInteraction: {
|
|
970
|
+
elementId: string;
|
|
971
|
+
count: number;
|
|
972
|
+
}[];
|
|
973
|
+
}
|
|
974
|
+
/** Time analysis */
|
|
975
|
+
export interface TimeAnalysis {
|
|
976
|
+
byHour: {
|
|
977
|
+
hour: number;
|
|
978
|
+
submissions: number;
|
|
979
|
+
}[];
|
|
980
|
+
byDayOfWeek: {
|
|
981
|
+
day: number;
|
|
982
|
+
submissions: number;
|
|
983
|
+
}[];
|
|
984
|
+
peakTimes: {
|
|
985
|
+
start: string;
|
|
986
|
+
end: string;
|
|
987
|
+
submissions: number;
|
|
988
|
+
}[];
|
|
989
|
+
}
|
|
990
|
+
/** Device analysis */
|
|
991
|
+
export interface DeviceAnalysis {
|
|
992
|
+
byDevice: {
|
|
993
|
+
device: string;
|
|
994
|
+
count: number;
|
|
995
|
+
percentage: number;
|
|
996
|
+
}[];
|
|
997
|
+
byBrowser: {
|
|
998
|
+
browser: string;
|
|
999
|
+
count: number;
|
|
1000
|
+
percentage: number;
|
|
1001
|
+
}[];
|
|
1002
|
+
byOS: {
|
|
1003
|
+
os: string;
|
|
1004
|
+
count: number;
|
|
1005
|
+
percentage: number;
|
|
1006
|
+
}[];
|
|
1007
|
+
conversionByDevice: {
|
|
1008
|
+
device: string;
|
|
1009
|
+
rate: number;
|
|
1010
|
+
}[];
|
|
1011
|
+
}
|
|
1012
|
+
/** Geographic analysis */
|
|
1013
|
+
export interface GeographicAnalysis {
|
|
1014
|
+
byCountry: {
|
|
1015
|
+
country: string;
|
|
1016
|
+
count: number;
|
|
1017
|
+
percentage: number;
|
|
1018
|
+
}[];
|
|
1019
|
+
byRegion: {
|
|
1020
|
+
region: string;
|
|
1021
|
+
count: number;
|
|
1022
|
+
percentage: number;
|
|
1023
|
+
}[];
|
|
1024
|
+
topCities: {
|
|
1025
|
+
city: string;
|
|
1026
|
+
count: number;
|
|
1027
|
+
}[];
|
|
1028
|
+
}
|
|
1029
|
+
/** Form export format */
|
|
1030
|
+
export type FormExportFormat = 'json' | 'yaml' | 'xml' | 'html' | 'pdf';
|
|
1031
|
+
/** Form export options */
|
|
1032
|
+
export interface FormExportOptions {
|
|
1033
|
+
format: FormExportFormat;
|
|
1034
|
+
includeSubmissions?: boolean;
|
|
1035
|
+
includeAnalytics?: boolean;
|
|
1036
|
+
includeTheme?: boolean;
|
|
1037
|
+
prettyPrint?: boolean;
|
|
1038
|
+
}
|
|
1039
|
+
/** Submission export format */
|
|
1040
|
+
export type SubmissionExportFormat = 'csv' | 'xlsx' | 'json' | 'pdf';
|
|
1041
|
+
/** Submission export options */
|
|
1042
|
+
export interface SubmissionExportOptions {
|
|
1043
|
+
format: SubmissionExportFormat;
|
|
1044
|
+
fields?: string[];
|
|
1045
|
+
dateFormat?: string;
|
|
1046
|
+
includeMetadata?: boolean;
|
|
1047
|
+
includeFiles?: boolean;
|
|
1048
|
+
filters?: SubmissionFilter[];
|
|
1049
|
+
sortBy?: string;
|
|
1050
|
+
sortOrder?: 'asc' | 'desc';
|
|
1051
|
+
}
|
|
1052
|
+
/** Submission filter */
|
|
1053
|
+
export interface SubmissionFilter {
|
|
1054
|
+
field: string;
|
|
1055
|
+
operator: ComparisonOperator;
|
|
1056
|
+
value: unknown;
|
|
1057
|
+
}
|
|
1058
|
+
/** Embed configuration */
|
|
1059
|
+
export interface FormEmbedConfig {
|
|
1060
|
+
type: 'inline' | 'popup' | 'slide' | 'fullpage';
|
|
1061
|
+
container?: string;
|
|
1062
|
+
width?: string | number;
|
|
1063
|
+
height?: string | number;
|
|
1064
|
+
trigger?: EmbedTrigger;
|
|
1065
|
+
animation?: EmbedAnimation;
|
|
1066
|
+
overlay?: boolean;
|
|
1067
|
+
closeOnOverlayClick?: boolean;
|
|
1068
|
+
closeButton?: boolean;
|
|
1069
|
+
responsive?: boolean;
|
|
1070
|
+
callbacks?: EmbedCallbacks;
|
|
1071
|
+
}
|
|
1072
|
+
/** Embed trigger */
|
|
1073
|
+
export interface EmbedTrigger {
|
|
1074
|
+
type: 'click' | 'scroll' | 'exit' | 'time' | 'manual';
|
|
1075
|
+
selector?: string;
|
|
1076
|
+
scrollPercent?: number;
|
|
1077
|
+
delay?: number;
|
|
1078
|
+
}
|
|
1079
|
+
/** Embed animation */
|
|
1080
|
+
export interface EmbedAnimation {
|
|
1081
|
+
type: 'fade' | 'slide' | 'zoom' | 'none';
|
|
1082
|
+
direction?: 'left' | 'right' | 'top' | 'bottom';
|
|
1083
|
+
duration?: number;
|
|
1084
|
+
}
|
|
1085
|
+
/** Embed callbacks */
|
|
1086
|
+
export interface EmbedCallbacks {
|
|
1087
|
+
onOpen?: () => void;
|
|
1088
|
+
onClose?: () => void;
|
|
1089
|
+
onSubmit?: (data: FormSubmission) => void;
|
|
1090
|
+
onError?: (error: Error) => void;
|
|
1091
|
+
onPageChange?: (page: number) => void;
|
|
1092
|
+
onFieldChange?: (fieldId: string, value: FormFieldValue) => void;
|
|
1093
|
+
}
|
|
1094
|
+
/** Form access control */
|
|
1095
|
+
export interface FormAccessControl {
|
|
1096
|
+
public?: boolean;
|
|
1097
|
+
requireAuth?: boolean;
|
|
1098
|
+
allowedRoles?: string[];
|
|
1099
|
+
allowedUsers?: string[];
|
|
1100
|
+
deniedUsers?: string[];
|
|
1101
|
+
password?: string;
|
|
1102
|
+
ipWhitelist?: string[];
|
|
1103
|
+
ipBlacklist?: string[];
|
|
1104
|
+
refererWhitelist?: string[];
|
|
1105
|
+
domainWhitelist?: string[];
|
|
1106
|
+
}
|
|
1107
|
+
/** Submission access control */
|
|
1108
|
+
export interface SubmissionAccessControl {
|
|
1109
|
+
viewOwn?: boolean;
|
|
1110
|
+
viewAll?: boolean;
|
|
1111
|
+
editOwn?: boolean;
|
|
1112
|
+
editAll?: boolean;
|
|
1113
|
+
deleteOwn?: boolean;
|
|
1114
|
+
deleteAll?: boolean;
|
|
1115
|
+
export?: boolean;
|
|
1116
|
+
}
|
|
1117
|
+
//# sourceMappingURL=form-builder.d.ts.map
|