-
Notifications
You must be signed in to change notification settings - Fork 18
/
components.d.ts
97 lines (91 loc) · 2.48 KB
/
components.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { EventEmitter } from '@angular/core';
import { FormGroup } from '@angular/forms';
export declare class ControlGroupService {
create(questions: Question[]): any;
}
export declare class CustomValidators {
static match(key: string): (control: any) => {
'match': {
'currentValue': any;
'requiredValue': any;
'mustMatchField': string;
};
};
}
export interface EasyFormData {
questions: Question[];
settings: Settings;
classes: Classes;
}
export interface Question {
type: 'text' | 'password' | 'number' | 'dropdown' | 'radio' | 'checkbox' | 'textarea';
key: string;
label?: string;
placeholder?: string;
value?: string | number | Array<string>;
order?: number;
emitChanges?: boolean;
options?: Array<{
value: string | number;
name: string;
disabled: boolean;
}>;
classes?: {
wrapper?: string;
label?: string | Array<string>;
question?: string | Array<string>;
error?: string | Array<string>;
};
validation?: Validation | Array<Validation>;
}
export interface Settings {
submitButton: boolean;
submitButtonText: string;
submitButtonExtraValidation: boolean;
singleErrorMessage: boolean;
showValidation: boolean;
errorOnDirty: boolean;
}
export interface Classes {
form: string | Array<string>;
submit: string | Array<string>;
}
export interface Validation {
type: 'required' | 'minLength' | 'maxLength' | 'patter' | 'custom' | 'match';
value?: any;
message?: string;
}
export declare class EasyFormsComponent {
private _controlGroup;
easyFormData: EasyFormData;
onSubmit: EventEmitter<any>;
onChanges: EventEmitter<any>;
comp: any;
private _data;
private _form;
private _matches;
constructor(_controlGroup: ControlGroupService);
submit(): void;
onQuestionValueChange(event: any): void;
sortQuestions(): void;
private _setSettings(settings);
}
export declare class EasyFormsModule {
}
export declare class QuestionComponent {
toSet: string;
info: any;
valueChange: EventEmitter<any>;
question: Question;
form: FormGroup;
private checkboxIsRequired;
private settings;
showErrorMsg: boolean;
errors(): any;
setRadio(option: any): void;
setCheckbox(option: any): void;
chackboxValueChange(): void;
onValueChange(event: any): void;
isSelectActive(option: any): boolean;
private _setError(item, errors);
}