df-ae-forms-package 1.0.0
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 +458 -0
- package/dist/ComponentActionFeatures.d.ts +19 -0
- package/dist/ComponentActionFeatures.d.ts.map +1 -0
- package/dist/DfFormPreview.d.ts +24 -0
- package/dist/DfFormPreview.d.ts.map +1 -0
- package/dist/ThresholdAlert.d.ts +15 -0
- package/dist/ThresholdAlert.d.ts.map +1 -0
- package/dist/components/ComponentSubmissionActions.d.ts +9 -0
- package/dist/components/ComponentSubmissionActions.d.ts.map +1 -0
- package/dist/components/RaiseIssueModal.d.ts +24 -0
- package/dist/components/RaiseIssueModal.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-checkbox/DfFormCheckbox.d.ts +22 -0
- package/dist/df-form-controls/df-form-checkbox/DfFormCheckbox.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-checkbox/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-checkbox/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-comments/DfFormComments.d.ts +12 -0
- package/dist/df-form-controls/df-form-comments/DfFormComments.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-comments/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-comments/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-date-time/DfFormDateTime.d.ts +21 -0
- package/dist/df-form-controls/df-form-date-time/DfFormDateTime.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-date-time/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-date-time/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-error-msg/DfFormErrorMsg.d.ts +5 -0
- package/dist/df-form-controls/df-form-error-msg/DfFormErrorMsg.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-error-msg/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-error-msg/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-file-upload/DfFormFileUpload.d.ts +33 -0
- package/dist/df-form-controls/df-form-file-upload/DfFormFileUpload.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-file-upload/example.d.ts +8 -0
- package/dist/df-form-controls/df-form-file-upload/example.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-file-upload/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-file-upload/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-grid/df-form-grid.d.ts +41 -0
- package/dist/df-form-controls/df-form-grid/df-form-grid.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-heading/DfFormHeading.d.ts +12 -0
- package/dist/df-form-controls/df-form-heading/DfFormHeading.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-heading/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-heading/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-input/DfFormInput.d.ts +25 -0
- package/dist/df-form-controls/df-form-input/DfFormInput.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-input/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-input/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-instruction/DfFormInstruction.d.ts +13 -0
- package/dist/df-form-controls/df-form-instruction/DfFormInstruction.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-instruction/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-instruction/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-location/DfFormLocation.d.ts +31 -0
- package/dist/df-form-controls/df-form-location/DfFormLocation.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-location/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-location/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-preview-interfaces.d.ts +389 -0
- package/dist/df-form-controls/df-form-preview-interfaces.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-radio/DfFormRadio.d.ts +22 -0
- package/dist/df-form-controls/df-form-radio/DfFormRadio.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-radio/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-radio/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-section/df-form-section.d.ts +35 -0
- package/dist/df-form-controls/df-form-section/df-form-section.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-segment/DfFormSegment.d.ts +23 -0
- package/dist/df-form-controls/df-form-segment/DfFormSegment.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-segment/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-segment/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-select/DfFormSelect.d.ts +22 -0
- package/dist/df-form-controls/df-form-select/DfFormSelect.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-select/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-select/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-signature/DfFormSignature.d.ts +21 -0
- package/dist/df-form-controls/df-form-signature/DfFormSignature.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-signature/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-signature/index.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-table/df-form-table.d.ts +43 -0
- package/dist/df-form-controls/df-form-table/df-form-table.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-textarea/DfFormTextarea.d.ts +21 -0
- package/dist/df-form-controls/df-form-textarea/DfFormTextarea.d.ts.map +1 -0
- package/dist/df-form-controls/df-form-textarea/index.d.ts +3 -0
- package/dist/df-form-controls/df-form-textarea/index.d.ts.map +1 -0
- package/dist/index.css +11 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +943 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +11 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/services/conditionalLogicService.d.ts +47 -0
- package/dist/services/conditionalLogicService.d.ts.map +1 -0
- package/dist/services/toast.service.d.ts +27 -0
- package/dist/services/toast.service.d.ts.map +1 -0
- package/dist/types/form-builder-schema.model.d.ts +75 -0
- package/dist/types/form-builder-schema.model.d.ts.map +1 -0
- package/package.json +88 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,943 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ICondition {
|
|
4
|
+
id: string;
|
|
5
|
+
when: string;
|
|
6
|
+
operator: 'equals' | 'notEquals' | 'isEmpty' | 'isNotEmpty' | 'contains' | 'notContains' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual';
|
|
7
|
+
value: string | number | boolean;
|
|
8
|
+
}
|
|
9
|
+
interface IConditionalLogic {
|
|
10
|
+
action: 'show' | 'hide' | 'always';
|
|
11
|
+
when: 'all' | 'any';
|
|
12
|
+
conditions: ICondition[];
|
|
13
|
+
}
|
|
14
|
+
interface IFormControlChange {
|
|
15
|
+
id: string;
|
|
16
|
+
value: any;
|
|
17
|
+
isValid?: boolean;
|
|
18
|
+
errors?: Record<string, any>;
|
|
19
|
+
comments?: string;
|
|
20
|
+
}
|
|
21
|
+
interface IFormValidationErrors {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
type TInputComponentType = 'text' | 'number' | 'email' | 'password' | 'url' | 'tel';
|
|
25
|
+
interface IBaseFormComponent {
|
|
26
|
+
id: string;
|
|
27
|
+
_id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
category: string;
|
|
30
|
+
basic: {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
defaultValue: string;
|
|
34
|
+
placeholder: string;
|
|
35
|
+
options: any[];
|
|
36
|
+
description?: string;
|
|
37
|
+
collapsed?: boolean;
|
|
38
|
+
showLabel?: boolean;
|
|
39
|
+
};
|
|
40
|
+
validation: {
|
|
41
|
+
required: boolean;
|
|
42
|
+
readonly: boolean;
|
|
43
|
+
customValidationMessage: string;
|
|
44
|
+
minLength?: number;
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
min?: number;
|
|
47
|
+
max?: number;
|
|
48
|
+
pattern?: string;
|
|
49
|
+
customValidation?: string;
|
|
50
|
+
minDate?: string;
|
|
51
|
+
maxDate?: string;
|
|
52
|
+
};
|
|
53
|
+
styles: {
|
|
54
|
+
labelAlignment: 'left' | 'top';
|
|
55
|
+
width?: number;
|
|
56
|
+
height?: number;
|
|
57
|
+
minWidth?: number;
|
|
58
|
+
maxWidth?: number;
|
|
59
|
+
minHeight?: number;
|
|
60
|
+
maxHeight?: number;
|
|
61
|
+
column?: number;
|
|
62
|
+
fontSize?: string;
|
|
63
|
+
color?: string;
|
|
64
|
+
backgroundColor?: string;
|
|
65
|
+
borderColor?: string;
|
|
66
|
+
borderWidth?: string;
|
|
67
|
+
borderRadius?: string;
|
|
68
|
+
padding?: string;
|
|
69
|
+
margin?: string;
|
|
70
|
+
};
|
|
71
|
+
position: number;
|
|
72
|
+
options: any[];
|
|
73
|
+
conditional: IConditionalLogic;
|
|
74
|
+
}
|
|
75
|
+
interface ITextInputComponent extends IBaseFormComponent {
|
|
76
|
+
name: 'text-input';
|
|
77
|
+
validation: IBaseFormComponent['validation'] & {
|
|
78
|
+
minLength?: number;
|
|
79
|
+
maxLength?: number;
|
|
80
|
+
pattern?: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
interface INumberInputComponent extends IBaseFormComponent {
|
|
84
|
+
name: 'number-input';
|
|
85
|
+
validation: IBaseFormComponent['validation'] & {
|
|
86
|
+
min?: number;
|
|
87
|
+
max?: number;
|
|
88
|
+
step?: number;
|
|
89
|
+
lowerLimit?: number;
|
|
90
|
+
upperLimit?: number;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
interface IEmailInputComponent extends IBaseFormComponent {
|
|
94
|
+
name: 'email-input';
|
|
95
|
+
validation: IBaseFormComponent['validation'] & {
|
|
96
|
+
pattern?: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
interface ITextareaComponent extends IBaseFormComponent {
|
|
100
|
+
name: 'textarea';
|
|
101
|
+
validation: IBaseFormComponent['validation'] & {
|
|
102
|
+
minLength?: number;
|
|
103
|
+
maxLength?: number;
|
|
104
|
+
rows?: number;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
interface ISelectComponent extends IBaseFormComponent {
|
|
108
|
+
name: 'select';
|
|
109
|
+
options: Array<{
|
|
110
|
+
label: string;
|
|
111
|
+
value: string;
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
validation: IBaseFormComponent['validation'] & {
|
|
115
|
+
multiple?: boolean;
|
|
116
|
+
};
|
|
117
|
+
basic: IBaseFormComponent['basic'] & {
|
|
118
|
+
comments?: string;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
interface IRadioComponent extends IBaseFormComponent {
|
|
122
|
+
name: 'radio';
|
|
123
|
+
options: Array<{
|
|
124
|
+
label: string;
|
|
125
|
+
value: string;
|
|
126
|
+
disabled?: boolean;
|
|
127
|
+
}>;
|
|
128
|
+
validation: IBaseFormComponent['validation'];
|
|
129
|
+
basic: IBaseFormComponent['basic'] & {
|
|
130
|
+
inlineLayout?: boolean;
|
|
131
|
+
comments?: string;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
interface ICheckboxComponent extends IBaseFormComponent {
|
|
135
|
+
name: 'checkbox';
|
|
136
|
+
options: Array<{
|
|
137
|
+
label: string;
|
|
138
|
+
value: string;
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
}>;
|
|
141
|
+
validation: IBaseFormComponent['validation'] & {
|
|
142
|
+
multiple?: boolean;
|
|
143
|
+
};
|
|
144
|
+
basic: IBaseFormComponent['basic'] & {
|
|
145
|
+
inlineLayout?: boolean;
|
|
146
|
+
comments?: string;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
interface ISegmentComponent extends IBaseFormComponent {
|
|
150
|
+
name: 'segment';
|
|
151
|
+
options: Array<{
|
|
152
|
+
label: string;
|
|
153
|
+
value: string;
|
|
154
|
+
disabled?: boolean;
|
|
155
|
+
}>;
|
|
156
|
+
validation: IBaseFormComponent['validation'];
|
|
157
|
+
basic: IBaseFormComponent['basic'] & {
|
|
158
|
+
inlineLayout?: boolean;
|
|
159
|
+
comments?: string;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
interface IDateComponent extends IBaseFormComponent {
|
|
163
|
+
name: 'date';
|
|
164
|
+
validation: IBaseFormComponent['validation'] & {
|
|
165
|
+
minDate?: string;
|
|
166
|
+
maxDate?: string;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
interface IDatePickerComponent extends IBaseFormComponent {
|
|
170
|
+
name: 'date-picker';
|
|
171
|
+
validation: IBaseFormComponent['validation'] & {
|
|
172
|
+
minDate?: string;
|
|
173
|
+
maxDate?: string;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
interface IDateTimePickerComponent extends IBaseFormComponent {
|
|
177
|
+
name: 'datetime-picker';
|
|
178
|
+
validation: IBaseFormComponent['validation'] & {
|
|
179
|
+
minDate?: string;
|
|
180
|
+
maxDate?: string;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
interface IFileComponent extends IBaseFormComponent {
|
|
184
|
+
name: 'file';
|
|
185
|
+
validation: IBaseFormComponent['validation'] & {
|
|
186
|
+
accept?: string;
|
|
187
|
+
maxSize?: number;
|
|
188
|
+
multiple?: boolean;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
interface IFileUploadComponent extends IBaseFormComponent {
|
|
192
|
+
name: 'file-upload';
|
|
193
|
+
validation: IBaseFormComponent['validation'] & {
|
|
194
|
+
accept?: string;
|
|
195
|
+
maxSize?: number;
|
|
196
|
+
multiple?: boolean;
|
|
197
|
+
maxFiles?: number;
|
|
198
|
+
allowedTypes?: string[];
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
interface ILocationComponent extends IBaseFormComponent {
|
|
202
|
+
name: 'location';
|
|
203
|
+
validation: IBaseFormComponent['validation'] & {
|
|
204
|
+
enableHighAccuracy?: boolean;
|
|
205
|
+
timeout?: number;
|
|
206
|
+
maximumAge?: number;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
interface IHeadingComponent extends Omit<IBaseFormComponent, 'basic' | 'styles'> {
|
|
210
|
+
name: 'heading';
|
|
211
|
+
basic: {
|
|
212
|
+
label: string;
|
|
213
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
214
|
+
};
|
|
215
|
+
styles?: {
|
|
216
|
+
fontSize?: string;
|
|
217
|
+
color?: string;
|
|
218
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
interface IDividerComponent extends Omit<IBaseFormComponent, 'styles'> {
|
|
222
|
+
name: 'divider';
|
|
223
|
+
styles?: {
|
|
224
|
+
color?: string;
|
|
225
|
+
thickness?: string;
|
|
226
|
+
style?: 'solid' | 'dashed' | 'dotted';
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
interface IInstructionComponent extends Omit<IBaseFormComponent, 'basic' | 'validation'> {
|
|
230
|
+
name: 'instructions';
|
|
231
|
+
basic: {
|
|
232
|
+
label?: string;
|
|
233
|
+
instructions: string[];
|
|
234
|
+
value?: string;
|
|
235
|
+
defaultValue?: string;
|
|
236
|
+
placeholder?: string;
|
|
237
|
+
options?: any[];
|
|
238
|
+
description?: string;
|
|
239
|
+
collapsed?: boolean;
|
|
240
|
+
showLabel?: boolean;
|
|
241
|
+
};
|
|
242
|
+
validation: IBaseFormComponent['validation'] & {
|
|
243
|
+
listStyle?: 'none' | 'numbers' | 'bullets' | 'alpha';
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
interface ISignatureComponent extends IBaseFormComponent {
|
|
247
|
+
name: 'signature';
|
|
248
|
+
validation: IBaseFormComponent['validation'] & {
|
|
249
|
+
required?: boolean;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
interface ISectionComponent extends Omit<IBaseFormComponent, 'basic' | 'styles'> {
|
|
253
|
+
name: 'section';
|
|
254
|
+
basic: {
|
|
255
|
+
label: string;
|
|
256
|
+
description: string;
|
|
257
|
+
collapsed: boolean;
|
|
258
|
+
};
|
|
259
|
+
children: FormComponentType[];
|
|
260
|
+
styles: IBaseFormComponent['styles'] & {
|
|
261
|
+
backgroundColor: string;
|
|
262
|
+
borderColor: string;
|
|
263
|
+
borderWidth: string;
|
|
264
|
+
borderRadius: string;
|
|
265
|
+
padding: string;
|
|
266
|
+
margin: string;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
interface ITableComponent extends Omit<IBaseFormComponent, 'basic' | 'styles'> {
|
|
270
|
+
name: 'table';
|
|
271
|
+
basic: {
|
|
272
|
+
label: string;
|
|
273
|
+
description: string;
|
|
274
|
+
rows: number;
|
|
275
|
+
columns: number;
|
|
276
|
+
};
|
|
277
|
+
table: {
|
|
278
|
+
rows: number;
|
|
279
|
+
columns: number;
|
|
280
|
+
displayAsTable: boolean;
|
|
281
|
+
columnNames: string;
|
|
282
|
+
showColumns: boolean;
|
|
283
|
+
};
|
|
284
|
+
cells: TableCell[][];
|
|
285
|
+
styles: IBaseFormComponent['styles'] & {
|
|
286
|
+
backgroundColor: string;
|
|
287
|
+
borderColor: string;
|
|
288
|
+
borderWidth: string;
|
|
289
|
+
borderRadius: string;
|
|
290
|
+
padding: string;
|
|
291
|
+
margin: string;
|
|
292
|
+
headerBackgroundColor?: string;
|
|
293
|
+
headerTextColor?: string;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
interface IDataGridComponent extends Omit<IBaseFormComponent, 'basic' | 'styles'> {
|
|
297
|
+
name: 'datagrid';
|
|
298
|
+
basic: {
|
|
299
|
+
label: string;
|
|
300
|
+
description: string;
|
|
301
|
+
collapsed?: boolean;
|
|
302
|
+
};
|
|
303
|
+
datagrid: {
|
|
304
|
+
maxEntries: number;
|
|
305
|
+
minEntries: number;
|
|
306
|
+
allowAddRemoveEntries: boolean;
|
|
307
|
+
addAnotherText: string;
|
|
308
|
+
removeText: string;
|
|
309
|
+
displayAsGrid: boolean;
|
|
310
|
+
};
|
|
311
|
+
templateComponents: FormComponentType[];
|
|
312
|
+
entries: DataGridEntry[];
|
|
313
|
+
styles: IBaseFormComponent['styles'] & {
|
|
314
|
+
backgroundColor: string;
|
|
315
|
+
borderColor: string;
|
|
316
|
+
borderWidth: string;
|
|
317
|
+
borderRadius: string;
|
|
318
|
+
padding: string;
|
|
319
|
+
margin: string;
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
interface DataGridEntry {
|
|
323
|
+
id: string;
|
|
324
|
+
index: number;
|
|
325
|
+
components: FormComponentType[];
|
|
326
|
+
styles?: {
|
|
327
|
+
backgroundColor?: string;
|
|
328
|
+
borderColor?: string;
|
|
329
|
+
padding?: string;
|
|
330
|
+
minHeight?: string;
|
|
331
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
interface TableCell {
|
|
335
|
+
id: string;
|
|
336
|
+
row: number;
|
|
337
|
+
column: number;
|
|
338
|
+
components: FormComponentType[];
|
|
339
|
+
styles?: {
|
|
340
|
+
backgroundColor?: string;
|
|
341
|
+
borderColor?: string;
|
|
342
|
+
padding?: string;
|
|
343
|
+
minHeight?: string;
|
|
344
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
type FormComponentType = ITextInputComponent | INumberInputComponent | IEmailInputComponent | ITextareaComponent | ISelectComponent | IRadioComponent | ICheckboxComponent | ISegmentComponent | IDateComponent | IDatePickerComponent | IDateTimePickerComponent | IFileComponent | IFileUploadComponent | ILocationComponent | IHeadingComponent | IDividerComponent | IInstructionComponent | ISignatureComponent | ISectionComponent | ITableComponent | IDataGridComponent;
|
|
348
|
+
interface FormComponentProps {
|
|
349
|
+
id: string;
|
|
350
|
+
properties: FormComponentType;
|
|
351
|
+
validationErrors?: IFormValidationErrors;
|
|
352
|
+
formValue?: any;
|
|
353
|
+
inputType?: TInputComponentType;
|
|
354
|
+
readonly?: boolean;
|
|
355
|
+
disabled?: boolean;
|
|
356
|
+
touchedFields?: Record<string, boolean>;
|
|
357
|
+
formSubmitted?: boolean;
|
|
358
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
359
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
360
|
+
onBlur?: () => void;
|
|
361
|
+
onFocus?: () => void;
|
|
362
|
+
onSelect?: () => void;
|
|
363
|
+
isSelected?: boolean;
|
|
364
|
+
className?: string;
|
|
365
|
+
hideLabel?: boolean;
|
|
366
|
+
}
|
|
367
|
+
interface ErrorMessageProps {
|
|
368
|
+
validationErrors: IFormValidationErrors;
|
|
369
|
+
fieldId: string;
|
|
370
|
+
control?: any;
|
|
371
|
+
inputType?: TInputComponentType;
|
|
372
|
+
touchedFields: Record<string, boolean>;
|
|
373
|
+
formSubmitted: boolean;
|
|
374
|
+
properties: FormComponentType;
|
|
375
|
+
localValidation?: {
|
|
376
|
+
isValid: boolean;
|
|
377
|
+
errors: Record<string, any>;
|
|
378
|
+
};
|
|
379
|
+
isTouched?: boolean;
|
|
380
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
381
|
+
}
|
|
382
|
+
interface ValidationRule {
|
|
383
|
+
type: 'required' | 'minLength' | 'maxLength' | 'min' | 'max' | 'lowerLimit' | 'upperLimit' | 'pattern' | 'email' | 'custom';
|
|
384
|
+
value?: any;
|
|
385
|
+
message?: string;
|
|
386
|
+
}
|
|
387
|
+
interface ValidationResult {
|
|
388
|
+
isValid: boolean;
|
|
389
|
+
errors: Record<string, string>;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
type DeviceType = 'desktop' | 'tablet' | 'mobile';
|
|
393
|
+
interface DfFormPreviewProps {
|
|
394
|
+
formComponents: FormComponentType[];
|
|
395
|
+
formData?: any;
|
|
396
|
+
currentDevice?: DeviceType;
|
|
397
|
+
isPreviewMode?: boolean;
|
|
398
|
+
initialFormData?: FormComponentType[];
|
|
399
|
+
onSubmit?: (formData: FormComponentType[]) => void;
|
|
400
|
+
onFormDataChange?: (formData: FormComponentType[]) => void;
|
|
401
|
+
formTitle?: string;
|
|
402
|
+
formDescription?: string;
|
|
403
|
+
formTemplateId?: string;
|
|
404
|
+
onComponentSelect?: (component: FormComponentType) => void;
|
|
405
|
+
onComponentDelete?: (component: FormComponentType, event: React.MouseEvent) => void;
|
|
406
|
+
onComponentEdit?: (component: FormComponentType) => void;
|
|
407
|
+
onComponentUpdate?: (componentId: string, updates: Partial<FormComponentType>) => void;
|
|
408
|
+
selectedComponent?: FormComponentType | null;
|
|
409
|
+
}
|
|
410
|
+
declare const DfFormPreview: React.FC<DfFormPreviewProps>;
|
|
411
|
+
|
|
412
|
+
interface DfFormInputProps {
|
|
413
|
+
id: string;
|
|
414
|
+
properties: ITextInputComponent | INumberInputComponent | IEmailInputComponent;
|
|
415
|
+
validationErrors?: IFormValidationErrors;
|
|
416
|
+
formValue?: string;
|
|
417
|
+
inputType?: TInputComponentType;
|
|
418
|
+
readonly?: boolean;
|
|
419
|
+
disabled?: boolean;
|
|
420
|
+
touchedFields?: Record<string, boolean>;
|
|
421
|
+
formSubmitted?: boolean;
|
|
422
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
423
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
424
|
+
onBlur?: () => void;
|
|
425
|
+
onFocus?: () => void;
|
|
426
|
+
className?: string;
|
|
427
|
+
hideLabel?: boolean;
|
|
428
|
+
formTemplateId?: string;
|
|
429
|
+
onThresholdIssueRaised?: (conditionId: string) => void;
|
|
430
|
+
raisedThresholdIssues?: Set<string>;
|
|
431
|
+
}
|
|
432
|
+
declare const DfFormInput: React.FC<DfFormInputProps>;
|
|
433
|
+
|
|
434
|
+
interface DfFormTextareaProps {
|
|
435
|
+
id: string;
|
|
436
|
+
properties: ITextareaComponent;
|
|
437
|
+
validationErrors?: IFormValidationErrors;
|
|
438
|
+
formValue?: string;
|
|
439
|
+
readonly?: boolean;
|
|
440
|
+
disabled?: boolean;
|
|
441
|
+
touchedFields?: Record<string, boolean>;
|
|
442
|
+
formSubmitted?: boolean;
|
|
443
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
444
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
445
|
+
onBlur?: () => void;
|
|
446
|
+
onFocus?: () => void;
|
|
447
|
+
className?: string;
|
|
448
|
+
hideLabel?: boolean;
|
|
449
|
+
}
|
|
450
|
+
declare const DfFormTextarea: React.FC<DfFormTextareaProps>;
|
|
451
|
+
|
|
452
|
+
interface DfFormSelectProps {
|
|
453
|
+
id: string;
|
|
454
|
+
properties: ISelectComponent;
|
|
455
|
+
validationErrors?: IFormValidationErrors;
|
|
456
|
+
formValue?: string | string[];
|
|
457
|
+
readonly?: boolean;
|
|
458
|
+
disabled?: boolean;
|
|
459
|
+
touchedFields?: Record<string, boolean>;
|
|
460
|
+
formSubmitted?: boolean;
|
|
461
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
462
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
463
|
+
onBlur?: () => void;
|
|
464
|
+
onFocus?: () => void;
|
|
465
|
+
className?: string;
|
|
466
|
+
hideLabel?: boolean;
|
|
467
|
+
showCommentsInPreview?: boolean;
|
|
468
|
+
}
|
|
469
|
+
declare const DfFormSelect: React.FC<DfFormSelectProps>;
|
|
470
|
+
|
|
471
|
+
interface DfFormCheckboxProps {
|
|
472
|
+
id: string;
|
|
473
|
+
properties: ICheckboxComponent;
|
|
474
|
+
validationErrors?: IFormValidationErrors;
|
|
475
|
+
formValue?: string[];
|
|
476
|
+
readonly?: boolean;
|
|
477
|
+
disabled?: boolean;
|
|
478
|
+
touchedFields?: Record<string, boolean>;
|
|
479
|
+
formSubmitted?: boolean;
|
|
480
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
481
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
482
|
+
onBlur?: () => void;
|
|
483
|
+
onFocus?: () => void;
|
|
484
|
+
className?: string;
|
|
485
|
+
hideLabel?: boolean;
|
|
486
|
+
showCommentsInPreview?: boolean;
|
|
487
|
+
}
|
|
488
|
+
declare const DfFormCheckbox: React.FC<DfFormCheckboxProps>;
|
|
489
|
+
|
|
490
|
+
interface DfFormRadioProps {
|
|
491
|
+
id: string;
|
|
492
|
+
properties: IRadioComponent;
|
|
493
|
+
validationErrors?: IFormValidationErrors;
|
|
494
|
+
formValue?: string;
|
|
495
|
+
readonly?: boolean;
|
|
496
|
+
disabled?: boolean;
|
|
497
|
+
touchedFields?: Record<string, boolean>;
|
|
498
|
+
formSubmitted?: boolean;
|
|
499
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
500
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
501
|
+
onBlur?: () => void;
|
|
502
|
+
onFocus?: () => void;
|
|
503
|
+
className?: string;
|
|
504
|
+
hideLabel?: boolean;
|
|
505
|
+
showCommentsInPreview?: boolean;
|
|
506
|
+
}
|
|
507
|
+
declare const DfFormRadio: React.FC<DfFormRadioProps>;
|
|
508
|
+
|
|
509
|
+
interface DfFormSegmentProps {
|
|
510
|
+
id: string;
|
|
511
|
+
properties: ISegmentComponent;
|
|
512
|
+
validationErrors?: IFormValidationErrors;
|
|
513
|
+
formValue?: string;
|
|
514
|
+
readonly?: boolean;
|
|
515
|
+
disabled?: boolean;
|
|
516
|
+
touchedFields?: Record<string, boolean>;
|
|
517
|
+
formSubmitted?: boolean;
|
|
518
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
519
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
520
|
+
onBlur?: () => void;
|
|
521
|
+
onFocus?: () => void;
|
|
522
|
+
className?: string;
|
|
523
|
+
hideLabel?: boolean;
|
|
524
|
+
showCommentsInPreview?: boolean;
|
|
525
|
+
}
|
|
526
|
+
declare const DfFormSegment: React.FC<DfFormSegmentProps>;
|
|
527
|
+
|
|
528
|
+
interface DfFormDateTimeProps {
|
|
529
|
+
id: string;
|
|
530
|
+
properties: IDateComponent;
|
|
531
|
+
validationErrors?: IFormValidationErrors;
|
|
532
|
+
formValue?: string;
|
|
533
|
+
readonly?: boolean;
|
|
534
|
+
disabled?: boolean;
|
|
535
|
+
touchedFields?: Record<string, boolean>;
|
|
536
|
+
formSubmitted?: boolean;
|
|
537
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
538
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
539
|
+
onBlur?: () => void;
|
|
540
|
+
onFocus?: () => void;
|
|
541
|
+
className?: string;
|
|
542
|
+
hideLabel?: boolean;
|
|
543
|
+
}
|
|
544
|
+
declare const DfFormDateTime: React.FC<DfFormDateTimeProps>;
|
|
545
|
+
|
|
546
|
+
interface DfFormSignatureProps {
|
|
547
|
+
id: string;
|
|
548
|
+
properties: ISignatureComponent;
|
|
549
|
+
validationErrors?: IFormValidationErrors;
|
|
550
|
+
formValue?: string;
|
|
551
|
+
readonly?: boolean;
|
|
552
|
+
disabled?: boolean;
|
|
553
|
+
touchedFields?: Record<string, boolean>;
|
|
554
|
+
formSubmitted?: boolean;
|
|
555
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
556
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
557
|
+
onBlur?: () => void;
|
|
558
|
+
onFocus?: () => void;
|
|
559
|
+
className?: string;
|
|
560
|
+
hideLabel?: boolean;
|
|
561
|
+
}
|
|
562
|
+
declare const DfFormSignature: React.FC<DfFormSignatureProps>;
|
|
563
|
+
|
|
564
|
+
interface IFileDataObject {
|
|
565
|
+
name?: string;
|
|
566
|
+
fileName?: string;
|
|
567
|
+
type?: string;
|
|
568
|
+
fileType?: string;
|
|
569
|
+
mimeType?: string;
|
|
570
|
+
size?: number;
|
|
571
|
+
fileSize?: number;
|
|
572
|
+
url?: string;
|
|
573
|
+
path?: string;
|
|
574
|
+
data?: string;
|
|
575
|
+
}
|
|
576
|
+
interface DfFormFileUploadProps {
|
|
577
|
+
id: string;
|
|
578
|
+
properties: IFileUploadComponent;
|
|
579
|
+
validationErrors?: IFormValidationErrors;
|
|
580
|
+
formValue?: File[] | FileList | IFileDataObject[] | string[] | null;
|
|
581
|
+
readonly?: boolean;
|
|
582
|
+
disabled?: boolean;
|
|
583
|
+
touchedFields?: Record<string, boolean>;
|
|
584
|
+
formSubmitted?: boolean;
|
|
585
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
586
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
587
|
+
onBlur?: () => void;
|
|
588
|
+
onFocus?: () => void;
|
|
589
|
+
className?: string;
|
|
590
|
+
hideLabel?: boolean;
|
|
591
|
+
}
|
|
592
|
+
declare const DfFormFileUpload: React.FC<DfFormFileUploadProps>;
|
|
593
|
+
|
|
594
|
+
interface DfFormLocationProps {
|
|
595
|
+
id: string;
|
|
596
|
+
properties: ILocationComponent;
|
|
597
|
+
validationErrors?: IFormValidationErrors;
|
|
598
|
+
formValue?: ILocationData | null;
|
|
599
|
+
readonly?: boolean;
|
|
600
|
+
disabled?: boolean;
|
|
601
|
+
touchedFields?: Record<string, boolean>;
|
|
602
|
+
formSubmitted?: boolean;
|
|
603
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
604
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
605
|
+
onBlur?: () => void;
|
|
606
|
+
onFocus?: () => void;
|
|
607
|
+
className?: string;
|
|
608
|
+
hideLabel?: boolean;
|
|
609
|
+
}
|
|
610
|
+
interface ILocationData {
|
|
611
|
+
latitude: number;
|
|
612
|
+
longitude: number;
|
|
613
|
+
accuracy?: number;
|
|
614
|
+
timestamp?: number;
|
|
615
|
+
address?: string;
|
|
616
|
+
placeName?: string;
|
|
617
|
+
city?: string;
|
|
618
|
+
country?: string;
|
|
619
|
+
}
|
|
620
|
+
declare const DfFormLocation: React.FC<DfFormLocationProps>;
|
|
621
|
+
|
|
622
|
+
interface DfFormHeadingProps {
|
|
623
|
+
id: string;
|
|
624
|
+
properties: IHeadingComponent;
|
|
625
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
626
|
+
className?: string;
|
|
627
|
+
hideLabel?: boolean;
|
|
628
|
+
}
|
|
629
|
+
declare const DfFormHeading: React.FC<DfFormHeadingProps>;
|
|
630
|
+
|
|
631
|
+
interface DfFormInstructionProps {
|
|
632
|
+
id: string;
|
|
633
|
+
properties: IInstructionComponent;
|
|
634
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
635
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
636
|
+
className?: string;
|
|
637
|
+
hideLabel?: boolean;
|
|
638
|
+
}
|
|
639
|
+
declare const DfFormInstruction: React.FC<DfFormInstructionProps>;
|
|
640
|
+
|
|
641
|
+
declare const DfFormErrorMsg: React.FC<ErrorMessageProps>;
|
|
642
|
+
|
|
643
|
+
interface DfFormCommentsProps {
|
|
644
|
+
comment?: string;
|
|
645
|
+
onSave?: (comment: string) => void;
|
|
646
|
+
placeholder?: string;
|
|
647
|
+
className?: string;
|
|
648
|
+
disabled?: boolean;
|
|
649
|
+
}
|
|
650
|
+
declare const DfFormComments: React.FC<DfFormCommentsProps>;
|
|
651
|
+
|
|
652
|
+
interface DfFormSectionProps {
|
|
653
|
+
id: string;
|
|
654
|
+
properties: ISectionComponent;
|
|
655
|
+
validationErrors?: Record<string, any>;
|
|
656
|
+
formValue?: any;
|
|
657
|
+
formData?: Record<string, any>;
|
|
658
|
+
readonly?: boolean;
|
|
659
|
+
disabled?: boolean;
|
|
660
|
+
touchedFields?: Record<string, boolean>;
|
|
661
|
+
formSubmitted?: boolean;
|
|
662
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
663
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
664
|
+
onBlur?: () => void;
|
|
665
|
+
onFocus?: () => void;
|
|
666
|
+
onSelect?: () => void;
|
|
667
|
+
isSelected?: boolean;
|
|
668
|
+
className?: string;
|
|
669
|
+
onSectionSelect?: (section: ISectionComponent) => void;
|
|
670
|
+
onSectionDelete?: (sectionId: string) => void;
|
|
671
|
+
onChildrenChange?: (children: FormComponentType[]) => void;
|
|
672
|
+
onChildSelect?: (child: FormComponentType) => void;
|
|
673
|
+
onChildDelete?: (childId: string) => void;
|
|
674
|
+
selectedChild?: FormComponentType | null;
|
|
675
|
+
renderFormComponent?: (field: FormComponentType) => React.ReactNode;
|
|
676
|
+
formTemplateId?: string;
|
|
677
|
+
onThresholdActionCompletion?: (conditionId: string, action: 'notes' | 'attachments' | 'email', completed: boolean) => void;
|
|
678
|
+
onThresholdIssueRaised?: (conditionId: string) => void;
|
|
679
|
+
onNotesChange?: (componentId: string, notes: string) => void;
|
|
680
|
+
onAttachmentChange?: (componentId: string, attachments: File[] | null) => void;
|
|
681
|
+
}
|
|
682
|
+
declare const DfFormSection: React.FC<DfFormSectionProps>;
|
|
683
|
+
|
|
684
|
+
interface DfFormDataGridProps {
|
|
685
|
+
id: string;
|
|
686
|
+
properties: IDataGridComponent;
|
|
687
|
+
validationErrors?: Record<string, any>;
|
|
688
|
+
formValue?: any;
|
|
689
|
+
formData?: Record<string, any>;
|
|
690
|
+
readonly?: boolean;
|
|
691
|
+
disabled?: boolean;
|
|
692
|
+
touchedFields?: Record<string, boolean>;
|
|
693
|
+
formSubmitted?: boolean;
|
|
694
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
695
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
696
|
+
onBlur?: () => void;
|
|
697
|
+
onFocus?: () => void;
|
|
698
|
+
onSelect?: () => void;
|
|
699
|
+
isSelected?: boolean;
|
|
700
|
+
className?: string;
|
|
701
|
+
onDataGridSelect?: (dataGrid: IDataGridComponent) => void;
|
|
702
|
+
onDataGridDelete?: (dataGridId: string) => void;
|
|
703
|
+
onEntryChange?: (entryIndex: number, components: FormComponentType[]) => void;
|
|
704
|
+
onComponentSelect?: (component: FormComponentType) => void;
|
|
705
|
+
onComponentDelete?: (component: FormComponentType, event: React.MouseEvent) => void;
|
|
706
|
+
onComponentEdit?: (component: FormComponentType) => void;
|
|
707
|
+
onComponentUpdate?: (componentId: string, updates: Partial<FormComponentType>) => void;
|
|
708
|
+
selectedComponent?: FormComponentType | null;
|
|
709
|
+
renderFormComponent?: (field: FormComponentType, hideLabel?: boolean) => React.ReactNode;
|
|
710
|
+
onDataGridUpdate?: (dataGridId: string, updates: Partial<IDataGridComponent>) => void;
|
|
711
|
+
onEntryAdd?: () => void;
|
|
712
|
+
onEntryRemove?: (entryIndex: number) => void;
|
|
713
|
+
formTemplateId?: string;
|
|
714
|
+
onThresholdActionCompletion?: (conditionId: string, action: 'notes' | 'attachments' | 'email', completed: boolean) => void;
|
|
715
|
+
onThresholdIssueRaised?: (conditionId: string) => void;
|
|
716
|
+
onNotesChange?: (componentId: string, notes: string) => void;
|
|
717
|
+
onAttachmentChange?: (componentId: string, attachments: File[] | null) => void;
|
|
718
|
+
}
|
|
719
|
+
declare const DfFormDataGrid: React.FC<DfFormDataGridProps>;
|
|
720
|
+
|
|
721
|
+
interface DfFormTableProps {
|
|
722
|
+
id: string;
|
|
723
|
+
properties: ITableComponent;
|
|
724
|
+
validationErrors?: Record<string, any>;
|
|
725
|
+
formValue?: any;
|
|
726
|
+
formData?: Record<string, any>;
|
|
727
|
+
readonly?: boolean;
|
|
728
|
+
disabled?: boolean;
|
|
729
|
+
touchedFields?: Record<string, boolean>;
|
|
730
|
+
formSubmitted?: boolean;
|
|
731
|
+
mode?: 'edit' | 'preview' | 'test';
|
|
732
|
+
onValueChange?: (change: IFormControlChange) => void;
|
|
733
|
+
onBlur?: () => void;
|
|
734
|
+
onFocus?: () => void;
|
|
735
|
+
onSelect?: () => void;
|
|
736
|
+
isSelected?: boolean;
|
|
737
|
+
className?: string;
|
|
738
|
+
onTableSelect?: (table: ITableComponent) => void;
|
|
739
|
+
onTableDelete?: (tableId: string) => void;
|
|
740
|
+
onCellChange?: (row: number, column: number, components: FormComponentType[]) => void;
|
|
741
|
+
onComponentSelect?: (component: FormComponentType) => void;
|
|
742
|
+
onComponentDelete?: (componentId: string) => void;
|
|
743
|
+
onComponentEdit?: (component: FormComponentType) => void;
|
|
744
|
+
selectedComponent?: FormComponentType | null;
|
|
745
|
+
renderFormComponent?: (field: FormComponentType) => React.ReactNode;
|
|
746
|
+
onTableUpdate?: (tableId: string, updates: Partial<ITableComponent>) => void;
|
|
747
|
+
onCellAdd?: (row: number, column: number) => void;
|
|
748
|
+
onCellRemove?: (row: number, column: number) => void;
|
|
749
|
+
onRowAdd?: () => void;
|
|
750
|
+
onRowRemove?: (rowIndex: number) => void;
|
|
751
|
+
onColumnAdd?: () => void;
|
|
752
|
+
onColumnRemove?: (columnIndex: number) => void;
|
|
753
|
+
formTemplateId?: string;
|
|
754
|
+
onThresholdActionCompletion?: (conditionId: string, action: 'notes' | 'attachments' | 'email', completed: boolean) => void;
|
|
755
|
+
onNotesChange?: (componentId: string, notes: string) => void;
|
|
756
|
+
onAttachmentChange?: (componentId: string, attachments: File[] | null) => void;
|
|
757
|
+
}
|
|
758
|
+
declare const DfFormTable: React.FC<DfFormTableProps>;
|
|
759
|
+
|
|
760
|
+
interface IComponentActionFeaturesProps {
|
|
761
|
+
component: FormComponentType;
|
|
762
|
+
mode: 'edit' | 'preview' | 'test';
|
|
763
|
+
formTemplateId?: string;
|
|
764
|
+
formValue?: any;
|
|
765
|
+
onNotesChange?: (notes: string) => void;
|
|
766
|
+
onAttachmentChange?: (files: File[] | null) => void;
|
|
767
|
+
notes?: string;
|
|
768
|
+
attachments?: File[] | null;
|
|
769
|
+
onThresholdActionCompletion?: (conditionId: string, action: 'notes' | 'attachments' | 'email', completed: boolean) => void;
|
|
770
|
+
onThresholdIssueRaised?: (conditionId: string) => void;
|
|
771
|
+
onBasicPropertyActionCompletion?: (action: 'notes' | 'attachments' | 'email' | 'issue', completed: boolean) => void;
|
|
772
|
+
}
|
|
773
|
+
declare const ComponentActionFeatures: React.FC<IComponentActionFeaturesProps>;
|
|
774
|
+
|
|
775
|
+
interface IComponentSubmissionActionsProps {
|
|
776
|
+
component: FormComponentType;
|
|
777
|
+
}
|
|
778
|
+
declare const ComponentSubmissionActions: React.FC<IComponentSubmissionActionsProps>;
|
|
779
|
+
|
|
780
|
+
interface IThresholdAlertProps {
|
|
781
|
+
component: any;
|
|
782
|
+
condition: any;
|
|
783
|
+
currentValue: string | number;
|
|
784
|
+
thresholdValue: string | number;
|
|
785
|
+
formTemplateId?: string;
|
|
786
|
+
onDismiss?: () => void;
|
|
787
|
+
onIssueRaised?: (conditionId: string) => void;
|
|
788
|
+
isIssueRaised?: boolean;
|
|
789
|
+
}
|
|
790
|
+
declare const ThresholdAlert: React.FC<IThresholdAlertProps>;
|
|
791
|
+
|
|
792
|
+
interface IRaiseIssueModalProps {
|
|
793
|
+
isOpen: boolean;
|
|
794
|
+
onClose: () => void;
|
|
795
|
+
onSuccess?: (createdIssue?: any) => void;
|
|
796
|
+
component?: FormComponentType;
|
|
797
|
+
formTemplateId?: string;
|
|
798
|
+
formInstanceId?: string;
|
|
799
|
+
notes?: string;
|
|
800
|
+
attachments?: File[] | null;
|
|
801
|
+
issue?: any | null;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* RaiseIssueModal - Stub implementation for package
|
|
805
|
+
*
|
|
806
|
+
* This is a stub component that can be replaced by the consuming application
|
|
807
|
+
* with their own implementation that integrates with their issue management system.
|
|
808
|
+
*
|
|
809
|
+
* For now, it simply calls onSuccess when the user "raises" an issue.
|
|
810
|
+
*/
|
|
811
|
+
declare const RaiseIssueModal: React.FC<IRaiseIssueModalProps>;
|
|
812
|
+
|
|
813
|
+
interface IAvailableComponent {
|
|
814
|
+
id: string;
|
|
815
|
+
label: string;
|
|
816
|
+
type: string;
|
|
817
|
+
key: string;
|
|
818
|
+
}
|
|
819
|
+
interface IConditionalEvaluationResult {
|
|
820
|
+
shouldShow: boolean;
|
|
821
|
+
evaluatedConditions: Array<{
|
|
822
|
+
condition: ICondition;
|
|
823
|
+
result: boolean;
|
|
824
|
+
componentValue: any;
|
|
825
|
+
}>;
|
|
826
|
+
}
|
|
827
|
+
declare class ConditionalLogicService {
|
|
828
|
+
private static instance;
|
|
829
|
+
private constructor();
|
|
830
|
+
static getInstance(): ConditionalLogicService;
|
|
831
|
+
getAvailableComponentsForConditional(formSchema: FormComponentType[], excludeComponentId?: string): IAvailableComponent[];
|
|
832
|
+
getApplicableOperators(componentType: string): string[];
|
|
833
|
+
validateConditionalLogic(conditional: IConditionalLogic, formSchema: FormComponentType[]): {
|
|
834
|
+
isValid: boolean;
|
|
835
|
+
errors: string[];
|
|
836
|
+
};
|
|
837
|
+
evaluateConditionalLogic(conditional: IConditionalLogic, formSchema: FormComponentType[], formValues: Record<string, any>): IConditionalEvaluationResult;
|
|
838
|
+
private getComponentValue;
|
|
839
|
+
private evaluateCondition;
|
|
840
|
+
private evaluateCheckboxCondition;
|
|
841
|
+
private isCheckboxChecked;
|
|
842
|
+
private determineFinalResult;
|
|
843
|
+
private isEqual;
|
|
844
|
+
private isEmpty;
|
|
845
|
+
private contains;
|
|
846
|
+
private isGreaterThan;
|
|
847
|
+
private isLessThan;
|
|
848
|
+
private isGreaterThanOrEqual;
|
|
849
|
+
private isLessThanOrEqual;
|
|
850
|
+
private isValidConditionValue;
|
|
851
|
+
createDefaultConditionalLogic(): IConditionalLogic;
|
|
852
|
+
getOperatorDisplayText(operator: string): string;
|
|
853
|
+
getActionDisplayText(action: string): string;
|
|
854
|
+
getConditionalLogicSummary(conditional: IConditionalLogic, formSchema: FormComponentType[]): string;
|
|
855
|
+
private formatConditionValue;
|
|
856
|
+
}
|
|
857
|
+
declare const conditionalLogicService: ConditionalLogicService;
|
|
858
|
+
|
|
859
|
+
interface IToast {
|
|
860
|
+
id: string;
|
|
861
|
+
message: string;
|
|
862
|
+
type: 'success' | 'danger' | 'warning' | 'info';
|
|
863
|
+
duration?: number;
|
|
864
|
+
}
|
|
865
|
+
declare class ToastService {
|
|
866
|
+
private toasts;
|
|
867
|
+
private listeners;
|
|
868
|
+
private defaultDuration;
|
|
869
|
+
private timeouts;
|
|
870
|
+
private generateId;
|
|
871
|
+
private notifyListeners;
|
|
872
|
+
private addToast;
|
|
873
|
+
removeToast(id: string): void;
|
|
874
|
+
showSuccess(message: string, duration?: number): void;
|
|
875
|
+
showError(message: string, duration?: number): void;
|
|
876
|
+
showWarning(message: string, duration?: number): void;
|
|
877
|
+
showInfo(message: string, duration?: number): void;
|
|
878
|
+
show(message: string, type?: 'success' | 'danger' | 'warning' | 'info', duration?: number): void;
|
|
879
|
+
clearAll(): void;
|
|
880
|
+
subscribe(listener: (toasts: IToast[]) => void): () => void;
|
|
881
|
+
getToasts(): IToast[];
|
|
882
|
+
}
|
|
883
|
+
declare const toastService: ToastService;
|
|
884
|
+
|
|
885
|
+
type TComponentCategory = 'Basic' | 'Advanced' | 'Layout' | 'Custom';
|
|
886
|
+
type TBasicComponentName = 'text-input' | 'number-input' | 'email-input' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'segment' | 'date-picker' | 'datetime-picker' | 'info' | 'signature' | 'heading' | 'instructions' | 'section' | 'table' | 'datagrid' | 'file' | 'location';
|
|
887
|
+
type TComponentName = TBasicComponentName;
|
|
888
|
+
declare enum ELabelAlignment {
|
|
889
|
+
Top = "top",
|
|
890
|
+
Left = "left"
|
|
891
|
+
}
|
|
892
|
+
interface IOption {
|
|
893
|
+
label: string;
|
|
894
|
+
value: string;
|
|
895
|
+
selected?: boolean;
|
|
896
|
+
enableNotes?: boolean;
|
|
897
|
+
enableAttachment?: boolean;
|
|
898
|
+
enableRaiseIssue?: boolean;
|
|
899
|
+
enableSendEmail?: boolean;
|
|
900
|
+
color?: string;
|
|
901
|
+
backgroundColor?: string;
|
|
902
|
+
icon?: string;
|
|
903
|
+
}
|
|
904
|
+
type TCheckboxValue = string | string[];
|
|
905
|
+
interface IBaseProps {
|
|
906
|
+
label: string;
|
|
907
|
+
value: string;
|
|
908
|
+
defaultValue: string | number;
|
|
909
|
+
placeholder?: string;
|
|
910
|
+
options?: any[];
|
|
911
|
+
description?: string;
|
|
912
|
+
collapsed?: boolean;
|
|
913
|
+
valid?: boolean;
|
|
914
|
+
enableNotes?: boolean;
|
|
915
|
+
enableAttachment?: boolean;
|
|
916
|
+
enableRaiseIssue?: boolean;
|
|
917
|
+
enableSendEmail?: boolean;
|
|
918
|
+
}
|
|
919
|
+
interface IBaseValidationProps {
|
|
920
|
+
required: boolean;
|
|
921
|
+
customValidationMessage: string;
|
|
922
|
+
readonly: boolean;
|
|
923
|
+
}
|
|
924
|
+
interface IBaseStyleProps {
|
|
925
|
+
labelAlignment: ELabelAlignment;
|
|
926
|
+
width?: number;
|
|
927
|
+
height?: number;
|
|
928
|
+
minWidth?: number;
|
|
929
|
+
maxWidth?: number;
|
|
930
|
+
minHeight?: number;
|
|
931
|
+
maxHeight?: number;
|
|
932
|
+
column?: number;
|
|
933
|
+
backgroundColor?: string;
|
|
934
|
+
borderColor?: string;
|
|
935
|
+
borderWidth?: string;
|
|
936
|
+
borderRadius?: string;
|
|
937
|
+
padding?: string;
|
|
938
|
+
margin?: string;
|
|
939
|
+
}
|
|
940
|
+
type TFormComponent = FormComponentType;
|
|
941
|
+
|
|
942
|
+
export { ComponentActionFeatures, ComponentSubmissionActions, DfFormCheckbox, DfFormComments, DfFormDataGrid, DfFormDateTime, DfFormErrorMsg, DfFormFileUpload, DfFormHeading, DfFormInput, DfFormInstruction, DfFormLocation, DfFormPreview, DfFormRadio, DfFormSection, DfFormSegment, DfFormSelect, DfFormSignature, DfFormTable, DfFormTextarea, ELabelAlignment, RaiseIssueModal, ThresholdAlert, conditionalLogicService, toastService };
|
|
943
|
+
export type { DataGridEntry, DeviceType, DfFormPreviewProps, ErrorMessageProps, FormComponentProps, FormComponentType, IAvailableComponent, IBaseFormComponent, IBaseProps, IBaseStyleProps, IBaseValidationProps, ICheckboxComponent, ICondition, IConditionalEvaluationResult, IConditionalLogic, IDataGridComponent, IDateComponent, IDatePickerComponent, IDateTimePickerComponent, IDividerComponent, IEmailInputComponent, IFileComponent, IFileUploadComponent, IFormControlChange, IFormValidationErrors, IHeadingComponent, IInstructionComponent, ILocationComponent, INumberInputComponent, IOption, IRadioComponent, ISectionComponent, ISegmentComponent, ISelectComponent, ISignatureComponent, ITableComponent, ITextInputComponent, ITextareaComponent, IToast, TBasicComponentName, TCheckboxValue, TComponentCategory, TComponentName, TFormComponent, TInputComponentType, TableCell, ValidationResult, ValidationRule };
|