@ngx-formly/core 10.0.1 → 11.1.0-rc.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 +103 -173
- package/fesm2022/ngx-formly-core-json-schema.mjs +670 -842
- package/fesm2022/ngx-formly-core-json-schema.mjs.map +1 -1
- package/fesm2022/ngx-formly-core-preset.mjs +76 -57
- package/fesm2022/ngx-formly-core-preset.mjs.map +1 -1
- package/fesm2022/ngx-formly-core-select.mjs +192 -134
- package/fesm2022/ngx-formly-core-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-core-testing.mjs +112 -87
- package/fesm2022/ngx-formly-core-testing.mjs.map +1 -1
- package/fesm2022/ngx-formly-core.mjs +3560 -3031
- package/fesm2022/ngx-formly-core.mjs.map +1 -1
- package/package.json +2 -2
- package/types/ngx-formly-core-json-schema.d.ts +39 -41
- package/types/ngx-formly-core-preset.d.ts +8 -12
- package/types/ngx-formly-core-select.d.ts +35 -40
- package/types/ngx-formly-core-testing.d.ts +27 -29
- package/types/ngx-formly-core.d.ts +764 -659
|
@@ -1,706 +1,794 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface
|
|
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
|
-
declare abstract class FieldWrapper<F extends FormlyFieldConfig = FormlyFieldConfig> extends FieldType<F> {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { AfterContentInit, AfterViewInit, ComponentRef, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, InjectionToken, Injector, ModuleWithProviders, NgZone, OnChanges, OnDestroy, OnInit, PipeTransform, Provider, QueryList, Renderer2, SimpleChanges, TemplateRef, Type, ViewContainerRef, ɵNoopNgZone } from "@angular/core";
|
|
3
|
+
import { AbstractControl, AsyncValidatorFn, FormGroupDirective, NgControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup, ValidationErrors, ValidatorFn } from "@angular/forms";
|
|
4
|
+
import { Observable, Subject, Subscription } from "rxjs";
|
|
5
|
+
import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
|
|
6
|
+
import * as i8 from "@angular/common";
|
|
7
|
+
export interface FieldTypeConfig<T = FormlyFieldConfig['props']> extends FormlyFieldConfig<T> {
|
|
8
|
+
formControl: UntypedFormControl;
|
|
9
|
+
props: NonNullable<T>;
|
|
10
|
+
}
|
|
11
|
+
export interface FieldGroupTypeConfig<T = FormlyFieldConfig['props']> extends FormlyFieldConfig<T> {
|
|
12
|
+
formControl: UntypedFormGroup;
|
|
13
|
+
props: NonNullable<T>;
|
|
14
|
+
}
|
|
15
|
+
export declare abstract class FieldType<F extends FormlyFieldConfig = FormlyFieldConfig> {
|
|
16
|
+
set _formlyControls(controls: QueryList<NgControl>);
|
|
17
|
+
field: F;
|
|
18
|
+
defaultOptions?: Partial<F>;
|
|
19
|
+
get model(): any;
|
|
20
|
+
get form(): UntypedFormGroup | import("@angular/forms").UntypedFormArray;
|
|
21
|
+
get options(): import("@ngx-formly/core").FormlyFormOptions;
|
|
22
|
+
get key(): string | number | (string | number)[];
|
|
23
|
+
get formControl(): NonNullable<F["formControl"]>;
|
|
24
|
+
get props(): NonNullable<F["props"]>;
|
|
25
|
+
/** @deprecated Use `props` instead. */
|
|
26
|
+
get to(): NonNullable<F["props"]>;
|
|
27
|
+
get showError(): boolean;
|
|
28
|
+
get id(): string;
|
|
29
|
+
get formState(): any;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldType<any>, never>;
|
|
31
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FieldType<any>, never, never, {
|
|
32
|
+
"field": {
|
|
33
|
+
"alias": "field";
|
|
34
|
+
"required": false;
|
|
35
|
+
};
|
|
36
|
+
}, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
export declare abstract class FieldWrapper<F extends FormlyFieldConfig = FormlyFieldConfig> extends FieldType<F> {
|
|
39
|
+
set _formlyControls(_: QueryList<NgControl>);
|
|
40
|
+
fieldComponent: ViewContainerRef;
|
|
41
|
+
set _staticContent(content: ViewContainerRef);
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldWrapper<any>, never>;
|
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FieldWrapper<any>, never, never, {}, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
46
45
|
type FieldExpression<T = any> = string | ((field: FormlyFieldConfig) => T) | Observable<T>;
|
|
47
46
|
type FieldExpressions = {
|
|
48
|
-
|
|
47
|
+
[property: string]: FieldExpression;
|
|
49
48
|
} & {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
className?: FieldExpression<string>;
|
|
50
|
+
hide?: FieldExpression<boolean>;
|
|
51
|
+
'props.disabled'?: FieldExpression<boolean>;
|
|
52
|
+
'props.required'?: FieldExpression<boolean>;
|
|
54
53
|
};
|
|
55
|
-
interface FormlyFieldConfig<Props = FormlyFieldProps & {
|
|
56
|
-
|
|
54
|
+
export interface FormlyFieldConfig<Props = FormlyFieldProps & {
|
|
55
|
+
[additionalProperties: string]: any;
|
|
57
56
|
}> {
|
|
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
|
-
};
|
|
98
|
-
show?: boolean;
|
|
99
|
-
[additionalProperties: string]: any;
|
|
57
|
+
/**
|
|
58
|
+
* The key that relates to the model. This will link the field value to the model
|
|
59
|
+
*/
|
|
60
|
+
key?: string | number | (string | number)[];
|
|
61
|
+
/**
|
|
62
|
+
* This should be a formly-field type added either by you or a plugin. More information over at Creating Formly Fields.
|
|
63
|
+
*/
|
|
64
|
+
type?: string | Type<FieldType>;
|
|
65
|
+
/**
|
|
66
|
+
* Use `defaultValue` to initialize it the model. If this is provided and the value of the model at compile-time is undefined, then the value of the model will be assigned to `defaultValue`.
|
|
67
|
+
*/
|
|
68
|
+
defaultValue?: any;
|
|
69
|
+
/**
|
|
70
|
+
* This allows you to specify the `id` of your field. Note, the `id` is generated if not set.
|
|
71
|
+
*/
|
|
72
|
+
id?: string;
|
|
73
|
+
/**
|
|
74
|
+
* If you wish, you can specify a specific `name` for your field. This is useful if you're posting the form to a server using techniques of yester-year.
|
|
75
|
+
*/
|
|
76
|
+
name?: string;
|
|
77
|
+
/**
|
|
78
|
+
* This is reserved for the templates. Any template-specific options go in here. Look at your specific template implementation to know the options required for this.
|
|
79
|
+
*/
|
|
80
|
+
props?: Props;
|
|
81
|
+
/** @deprecated Use `props` instead. */
|
|
82
|
+
templateOptions?: FormlyTemplateOptions;
|
|
83
|
+
/**
|
|
84
|
+
* An object with a few useful properties
|
|
85
|
+
* - `validation.messages`: A map of message names that will be displayed when the field has errors.
|
|
86
|
+
* - `validation.show`: A boolean you as the developer can set to force displaying errors whatever the state of field. This is useful when you're trying to call the user's attention to some fields for some reason.
|
|
87
|
+
*/
|
|
88
|
+
validation?: {
|
|
89
|
+
messages?: {
|
|
90
|
+
[messageProperties: string]: ValidationMessageOption['message'];
|
|
91
|
+
} & {
|
|
92
|
+
/** @deprecated use `minLength` */
|
|
93
|
+
minlength?: ValidationMessageOption['message'];
|
|
94
|
+
/** @deprecated use `maxLength` */
|
|
95
|
+
maxlength?: ValidationMessageOption['message'];
|
|
100
96
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
* Each should return a boolean value, returning true when the field is valid. See Validation for more information.
|
|
105
|
-
*/
|
|
106
|
-
validators?: FormlyValidation<ValidatorFn, boolean>;
|
|
107
|
-
/**
|
|
108
|
-
* Use this one for anything that needs to validate asynchronously.
|
|
109
|
-
* Pretty much exactly the same as the validators api, except it must be a function that returns a promise.
|
|
110
|
-
*/
|
|
111
|
-
asyncValidators?: FormlyValidation<AsyncValidatorFn, Promise<boolean> | Observable<boolean>>;
|
|
112
|
-
/**
|
|
113
|
-
* Can be set instead of `type` to render custom html content.
|
|
114
|
-
*/
|
|
115
|
-
template?: string;
|
|
116
|
-
/**
|
|
117
|
-
* It is expected to be the name of the wrappers.
|
|
118
|
-
* The formly field template will be wrapped by the first wrapper, then the second, then the third, etc.
|
|
119
|
-
* You can also specify these as part of a type (which is the recommended approach).
|
|
120
|
-
*/
|
|
121
|
-
wrappers?: (string | Type<FieldWrapper>)[];
|
|
122
|
-
/**
|
|
123
|
-
* Whether to hide the field. Defaults to false. If you wish this to be conditional use `expressions: { hide: ... }`
|
|
124
|
-
*/
|
|
125
|
-
hide?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Whether to reset the value on hide or not. Defaults to `true`.
|
|
128
|
-
*/
|
|
129
|
-
resetOnHide?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Conditionally hiding Field based on values from other Fields
|
|
132
|
-
* @deprecated use `expressions: { hide: ... }`
|
|
133
|
-
*/
|
|
134
|
-
hideExpression?: boolean | string | ((model: any, formState: any, field?: FormlyFieldConfig) => boolean);
|
|
135
|
-
/**
|
|
136
|
-
* An object where the key is a property to be set on the main field config and the value is an expression used to assign that property.
|
|
137
|
-
* @deprecated use `expressions`
|
|
138
|
-
*/
|
|
139
|
-
expressionProperties?: {
|
|
140
|
-
[property: string]: string | ((model: any, formState: any, field?: FormlyFieldConfig) => any) | Observable<any>;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* An object where the key is a property to be set on the main field config and the value is an expression used to assign that property.
|
|
144
|
-
*/
|
|
145
|
-
expressions?: FieldExpressions;
|
|
146
|
-
/**
|
|
147
|
-
* You can specify your own class that will be applied to the `formly-field` component.
|
|
148
|
-
*/
|
|
149
|
-
className?: string;
|
|
150
|
-
/**
|
|
151
|
-
* Specify your own class that will be applied to the `formly-group` component.
|
|
152
|
-
*/
|
|
153
|
-
fieldGroupClassName?: string;
|
|
154
|
-
/**
|
|
155
|
-
* A field group is a way to group fields together, making advanced layout very simple.
|
|
156
|
-
* It can also be used to group fields that are associated with the same model (useful if it's different than the model for the rest of the fields).
|
|
157
|
-
*/
|
|
158
|
-
fieldGroup?: FormlyFieldConfig[];
|
|
159
|
-
fieldArray?: FormlyFieldConfig | ((field: FormlyFieldConfig) => FormlyFieldConfig);
|
|
160
|
-
/**
|
|
161
|
-
* Whether to focus or blur the element field. Defaults to false. If you wish this to be conditional use `expressions`
|
|
162
|
-
*/
|
|
163
|
-
focus?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* An object with a few useful properties to control the model changes
|
|
166
|
-
* - `debounce`: integer value which contains the debounce model update value in milliseconds. A value of 0 triggers an immediate update.
|
|
167
|
-
* - `updateOn`: string event value that instructs when the control should be updated
|
|
168
|
-
*/
|
|
169
|
-
modelOptions?: {
|
|
170
|
-
debounce?: {
|
|
171
|
-
default: number;
|
|
172
|
-
};
|
|
173
|
-
updateOn?: 'change' | 'blur' | 'submit';
|
|
174
|
-
};
|
|
175
|
-
hooks?: FormlyHookConfig;
|
|
176
|
-
/**
|
|
177
|
-
* Array of functions to execute, as a pipeline, whenever the model updates, usually via user input.
|
|
178
|
-
*/
|
|
179
|
-
parsers?: ((value: any) => any)[];
|
|
180
|
-
/**
|
|
181
|
-
* Returns child field by key name
|
|
182
|
-
*/
|
|
183
|
-
get?: (key: FormlyFieldConfig['key']) => FormlyFieldConfig;
|
|
184
|
-
/**
|
|
185
|
-
* The model that stores all the data, where the model[key] is the value of the field
|
|
186
|
-
*/
|
|
187
|
-
readonly model?: any;
|
|
188
|
-
/**
|
|
189
|
-
* The parent field.
|
|
190
|
-
*/
|
|
191
|
-
readonly parent?: FormlyFieldConfig;
|
|
192
|
-
/**
|
|
193
|
-
* The form options.
|
|
194
|
-
*/
|
|
195
|
-
readonly options?: FormlyFormOptions;
|
|
196
|
-
/**
|
|
197
|
-
* The parent form.
|
|
198
|
-
*/
|
|
199
|
-
readonly form?: UntypedFormGroup | UntypedFormArray;
|
|
200
|
-
/**
|
|
201
|
-
* This is the [FormControl](https://angular.io/api/forms/FormControl) for the field.
|
|
202
|
-
* It provides you more control like running validators, calculating status, and resetting state.
|
|
203
|
-
*/
|
|
204
|
-
readonly formControl?: AbstractControl;
|
|
205
|
-
/** @deprecated */
|
|
206
|
-
optionsTypes?: string[];
|
|
207
|
-
}
|
|
208
|
-
type FormlyAttributeEvent = (field: FormlyFieldConfig, event?: any) => void;
|
|
209
|
-
/** @deprecated */
|
|
210
|
-
interface FormlyTemplateOptions extends FormlyFieldProps {
|
|
97
|
+
show?: boolean;
|
|
98
|
+
/** Display all configured error messages for this field. Defaults to false. */
|
|
99
|
+
showAllErrors?: boolean;
|
|
211
100
|
[additionalProperties: string]: any;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Used to set validation rules for a particular field.
|
|
104
|
+
* Should be an object of key - value pairs. The value can be a function or an object with an `expression` function or string.
|
|
105
|
+
* String expressions can access `control`, `field`, `model`, and `formState`.
|
|
106
|
+
* Each should return a boolean value, returning true when the field is valid. See Validation for more information.
|
|
107
|
+
*/
|
|
108
|
+
validators?: FormlyValidation<ValidatorFn, boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* Use this one for anything that needs to validate asynchronously.
|
|
111
|
+
* Pretty much exactly the same as the validators api, except it must be a function that returns a promise.
|
|
112
|
+
*/
|
|
113
|
+
asyncValidators?: FormlyValidation<AsyncValidatorFn, Promise<boolean> | Observable<boolean>>;
|
|
114
|
+
/**
|
|
115
|
+
* Can be set instead of `type` to render custom html content.
|
|
116
|
+
*/
|
|
117
|
+
template?: string;
|
|
118
|
+
/**
|
|
119
|
+
* It is expected to be the name of the wrappers.
|
|
120
|
+
* The formly field template will be wrapped by the first wrapper, then the second, then the third, etc.
|
|
121
|
+
* You can also specify these as part of a type (which is the recommended approach).
|
|
122
|
+
*/
|
|
123
|
+
wrappers?: (string | Type<FieldWrapper>)[];
|
|
124
|
+
/**
|
|
125
|
+
* Whether to hide the field. Defaults to false. If you wish this to be conditional use `expressions: { hide: ... }`
|
|
126
|
+
*/
|
|
127
|
+
hide?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether to reset the value on hide or not. Defaults to `true`.
|
|
130
|
+
*/
|
|
131
|
+
resetOnHide?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether fields at the same model path share a control. Defaults to `true`.
|
|
134
|
+
* Set to `false` on each mutually exclusive alternative to isolate parsers and validators.
|
|
135
|
+
*/
|
|
136
|
+
shareFormControl?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Conditionally hiding Field based on values from other Fields
|
|
139
|
+
* @deprecated use `expressions: { hide: ... }`
|
|
140
|
+
*/
|
|
141
|
+
hideExpression?: boolean | string | ((model: any, formState: any, field?: FormlyFieldConfig) => boolean);
|
|
142
|
+
/**
|
|
143
|
+
* An object where the key is a property to be set on the main field config and the value is an expression used to assign that property.
|
|
144
|
+
* @deprecated use `expressions`
|
|
145
|
+
*/
|
|
146
|
+
expressionProperties?: {
|
|
147
|
+
[property: string]: string | ((model: any, formState: any, field?: FormlyFieldConfig) => any) | Observable<any>;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* An object where the key is a property to be set on the main field config and the value is an expression used to assign that property.
|
|
151
|
+
*/
|
|
152
|
+
expressions?: FieldExpressions;
|
|
153
|
+
/**
|
|
154
|
+
* You can specify your own class that will be applied to the `formly-field` component.
|
|
155
|
+
*/
|
|
156
|
+
className?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Specify your own class that will be applied to the `formly-group` component.
|
|
159
|
+
*/
|
|
160
|
+
fieldGroupClassName?: string;
|
|
161
|
+
/**
|
|
162
|
+
* A field group is a way to group fields together, making advanced layout very simple.
|
|
163
|
+
* It can also be used to group fields that are associated with the same model (useful if it's different than the model for the rest of the fields).
|
|
164
|
+
*/
|
|
165
|
+
fieldGroup?: FormlyFieldConfig[];
|
|
166
|
+
fieldArray?: FormlyFieldConfig | ((field: FormlyFieldConfig) => FormlyFieldConfig);
|
|
167
|
+
/**
|
|
168
|
+
* Whether to focus or blur the element field. Defaults to false. If you wish this to be conditional use `expressions`
|
|
169
|
+
*/
|
|
170
|
+
focus?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* An object with a few useful properties to control the model changes
|
|
173
|
+
* - `debounce`: integer value which contains the debounce model update value in milliseconds. A value of 0 triggers an immediate update.
|
|
174
|
+
* - `updateOn`: string event value that instructs when the control should be updated
|
|
175
|
+
*/
|
|
176
|
+
modelOptions?: {
|
|
177
|
+
debounce?: {
|
|
178
|
+
default: number;
|
|
237
179
|
};
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
180
|
+
updateOn?: 'change' | 'blur' | 'submit';
|
|
181
|
+
};
|
|
182
|
+
hooks?: FormlyHookConfig;
|
|
183
|
+
/**
|
|
184
|
+
* Array of functions to execute, as a pipeline, whenever the model updates, usually via user input.
|
|
185
|
+
*/
|
|
186
|
+
parsers?: ((value: any) => any)[];
|
|
187
|
+
/**
|
|
188
|
+
* Returns child field by key name
|
|
189
|
+
*/
|
|
190
|
+
get?: (key: FormlyFieldConfig['key']) => FormlyFieldConfig;
|
|
191
|
+
/**
|
|
192
|
+
* The model that stores all the data, where the model[key] is the value of the field
|
|
193
|
+
*/
|
|
194
|
+
readonly model?: any;
|
|
195
|
+
/**
|
|
196
|
+
* The parent field.
|
|
197
|
+
*/
|
|
198
|
+
readonly parent?: FormlyFieldConfig;
|
|
199
|
+
/**
|
|
200
|
+
* The form options.
|
|
201
|
+
*/
|
|
202
|
+
readonly options?: FormlyFormOptions;
|
|
203
|
+
/**
|
|
204
|
+
* The parent form.
|
|
205
|
+
*/
|
|
206
|
+
readonly form?: UntypedFormGroup | UntypedFormArray;
|
|
207
|
+
/**
|
|
208
|
+
* This is the [FormControl](https://angular.io/api/forms/FormControl) for the field.
|
|
209
|
+
* It provides you more control like running validators, calculating status, and resetting state.
|
|
210
|
+
*/
|
|
211
|
+
readonly formControl?: AbstractControl;
|
|
212
|
+
/** @deprecated */
|
|
213
|
+
optionsTypes?: string[];
|
|
214
|
+
}
|
|
215
|
+
export type FormlyAttributeEvent = (field: FormlyFieldConfig, event?: any) => void;
|
|
216
|
+
/** @deprecated */
|
|
217
|
+
export interface FormlyTemplateOptions extends FormlyFieldProps {
|
|
218
|
+
[additionalProperties: string]: any;
|
|
219
|
+
}
|
|
220
|
+
export interface FormlyFieldProps {
|
|
221
|
+
type?: string;
|
|
222
|
+
label?: string;
|
|
223
|
+
/** Render label and description strings as sanitized HTML in web UI adapters. Defaults to false. */
|
|
224
|
+
allowHtml?: boolean;
|
|
225
|
+
placeholder?: string;
|
|
226
|
+
disabled?: boolean;
|
|
227
|
+
options?: any[] | Observable<any[]>;
|
|
228
|
+
rows?: number;
|
|
229
|
+
cols?: number;
|
|
230
|
+
description?: string;
|
|
231
|
+
hidden?: boolean;
|
|
232
|
+
max?: number;
|
|
233
|
+
min?: number;
|
|
234
|
+
minLength?: number;
|
|
235
|
+
/** @deprecated use `minLength` */
|
|
236
|
+
minlength?: number;
|
|
237
|
+
maxLength?: number;
|
|
238
|
+
/** @deprecated use `maxLength` */
|
|
239
|
+
maxlength?: number;
|
|
240
|
+
pattern?: string | RegExp;
|
|
241
|
+
required?: boolean;
|
|
242
|
+
/** Keep array fields and their state at fixed indices. Defaults to false; enabled for JSON Schema tuples. */
|
|
243
|
+
trackByIndex?: boolean;
|
|
244
|
+
tabindex?: number;
|
|
245
|
+
readonly?: boolean;
|
|
246
|
+
attributes?: {
|
|
247
|
+
[key: string]: string | number;
|
|
248
|
+
};
|
|
249
|
+
/** Numeric increment from `min` or zero. Use `any` to disable step validation. */
|
|
250
|
+
step?: number | 'any';
|
|
251
|
+
focus?: FormlyAttributeEvent;
|
|
252
|
+
blur?: FormlyAttributeEvent;
|
|
253
|
+
keyup?: FormlyAttributeEvent;
|
|
254
|
+
keydown?: FormlyAttributeEvent;
|
|
255
|
+
click?: FormlyAttributeEvent;
|
|
256
|
+
change?: FormlyAttributeEvent;
|
|
257
|
+
keypress?: FormlyAttributeEvent;
|
|
258
|
+
wheel?: FormlyAttributeEvent;
|
|
247
259
|
}
|
|
248
260
|
type FormlyHookFn = (field: FormlyFieldConfig) => void;
|
|
249
261
|
interface FormlyHookConfig {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
interface FormlyFormOptions {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
interface FormlyValueChangeEvent {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
262
|
+
onInit?: FormlyHookFn | ((field: FormlyFieldConfig) => Observable<any>);
|
|
263
|
+
onChanges?: FormlyHookFn;
|
|
264
|
+
afterContentInit?: FormlyHookFn;
|
|
265
|
+
afterViewInit?: FormlyHookFn;
|
|
266
|
+
onDestroy?: FormlyHookFn;
|
|
267
|
+
}
|
|
268
|
+
export interface FormlyFormOptions {
|
|
269
|
+
updateInitialValue?: (model?: any) => void;
|
|
270
|
+
resetModel?: (model?: any) => void;
|
|
271
|
+
formState?: any;
|
|
272
|
+
fieldChanges?: Subject<FormlyValueChangeEvent>;
|
|
273
|
+
showError?: (field: FieldType) => boolean;
|
|
274
|
+
build?: (field?: FormlyFieldConfig) => FormlyFieldConfig;
|
|
275
|
+
checkExpressions?: (field: FormlyFieldConfig) => void;
|
|
276
|
+
detectChanges?: (field: FormlyFieldConfig) => void;
|
|
277
|
+
parentForm?: FormGroupDirective | null;
|
|
278
|
+
}
|
|
279
|
+
export interface FormlyValueChangeEvent {
|
|
280
|
+
field: FormlyFieldConfig;
|
|
281
|
+
type: string;
|
|
282
|
+
value: any;
|
|
283
|
+
[meta: string]: any;
|
|
272
284
|
}
|
|
273
285
|
interface FormlyValidation<T, R> {
|
|
274
|
-
|
|
275
|
-
|
|
286
|
+
validation?: (string | T)[] | any;
|
|
287
|
+
[key: string]: FormlyValidatorFn<R> | FormlyValidatorExpressionFn<R> | any;
|
|
276
288
|
}
|
|
277
289
|
type FormlyValidatorFn<T> = (control: AbstractControl, field: FormlyFieldConfig) => T;
|
|
278
290
|
interface FormlyValidatorExpressionFn<T> {
|
|
279
|
-
|
|
280
|
-
|
|
291
|
+
expression: string | FormlyValidatorFn<T>;
|
|
292
|
+
message: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
|
|
281
293
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
postPopulate?(field: F): void;
|
|
294
|
+
export interface FormlyExtension<F extends FormlyFieldConfig = FormlyFieldConfig> {
|
|
295
|
+
priority?: number;
|
|
296
|
+
prePopulate?(field: F): void;
|
|
297
|
+
onPopulate?(field: F): void;
|
|
298
|
+
postPopulate?(field: F): void;
|
|
288
299
|
}
|
|
289
300
|
interface TypeOption {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
301
|
+
name: string;
|
|
302
|
+
component?: Type<FieldType>;
|
|
303
|
+
wrappers?: string[];
|
|
304
|
+
extends?: string;
|
|
305
|
+
defaultOptions?: FormlyFieldConfig;
|
|
295
306
|
}
|
|
296
307
|
interface WrapperOption {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
308
|
+
name: string;
|
|
309
|
+
component: Type<FieldWrapper>;
|
|
310
|
+
types?: string[];
|
|
300
311
|
}
|
|
301
312
|
type FieldValidatorFn = (c: AbstractControl, field: FormlyFieldConfig, options?: {
|
|
302
|
-
|
|
313
|
+
[id: string]: any;
|
|
303
314
|
}) => ValidationErrors | null;
|
|
304
315
|
interface ValidatorOption {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
316
|
+
name: string;
|
|
317
|
+
validation: FieldValidatorFn;
|
|
318
|
+
options?: {
|
|
319
|
+
[id: string]: any;
|
|
320
|
+
};
|
|
310
321
|
}
|
|
311
322
|
interface ExtensionOption {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
323
|
+
name: string;
|
|
324
|
+
extension: FormlyExtension;
|
|
325
|
+
priority?: number;
|
|
315
326
|
}
|
|
316
|
-
interface ValidationMessageOption {
|
|
317
|
-
|
|
318
|
-
|
|
327
|
+
export interface ValidationMessageOption {
|
|
328
|
+
name: string;
|
|
329
|
+
message: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
|
|
319
330
|
}
|
|
320
331
|
interface PresetOption {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
interface FormlyFieldConfigPresetProvider {
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
interface ConfigOption {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
332
|
+
name: string;
|
|
333
|
+
config: FormlyFieldConfig | FormlyFieldConfigPresetProvider;
|
|
334
|
+
}
|
|
335
|
+
export interface FormlyFieldConfigPresetProvider {
|
|
336
|
+
getConfiguration: () => FormlyFieldConfig;
|
|
337
|
+
}
|
|
338
|
+
export interface ConfigOption {
|
|
339
|
+
types?: TypeOption[];
|
|
340
|
+
wrappers?: WrapperOption[];
|
|
341
|
+
validators?: ValidatorOption[];
|
|
342
|
+
extensions?: ExtensionOption[];
|
|
343
|
+
validationMessages?: ValidationMessageOption[];
|
|
344
|
+
extras?: {
|
|
345
|
+
immutable?: boolean;
|
|
346
|
+
showError?: (field: FieldType) => boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Defines the option which formly rely on to check field expression properties.
|
|
349
|
+
* - `modelChange`: perform a check when the value of the form control changes.
|
|
350
|
+
* - `changeDetectionCheck`: triggers an immediate check when `ngDoCheck` is called.
|
|
351
|
+
*
|
|
352
|
+
* Defaults to `modelChange`.
|
|
353
|
+
*/
|
|
354
|
+
checkExpressionOn?: 'modelChange' | 'changeDetectionCheck';
|
|
355
|
+
/**
|
|
356
|
+
* Whether to lazily render field components or not when marked as hidden.
|
|
357
|
+
* - `true`: lazily render field components.
|
|
358
|
+
* - `false`: render field components and use CSS to control their visibility.
|
|
359
|
+
*
|
|
360
|
+
* Defaults to `true`.
|
|
361
|
+
*/
|
|
362
|
+
lazyRender?: boolean;
|
|
363
|
+
/**
|
|
364
|
+
* When `true`, reset the value of a hidden field.
|
|
365
|
+
*
|
|
366
|
+
* Defaults to `true`.
|
|
367
|
+
*/
|
|
368
|
+
resetFieldOnHide?: boolean;
|
|
369
|
+
/**
|
|
370
|
+
* Whether to render fields inside <formly-field> component or not.
|
|
371
|
+
*
|
|
372
|
+
* Defaults to `true`.
|
|
373
|
+
*/
|
|
374
|
+
renderFormlyFieldElement?: boolean;
|
|
375
|
+
};
|
|
376
|
+
presets?: PresetOption[];
|
|
366
377
|
}
|
|
367
|
-
|
|
368
378
|
interface FormlyFieldConfigCache extends FormlyFieldConfig {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
};
|
|
376
|
-
};
|
|
377
|
-
parent?: FormlyFieldConfigCache;
|
|
378
|
-
options?: FormlyFormOptionsCache;
|
|
379
|
-
shareFormControl?: boolean;
|
|
380
|
-
index?: number;
|
|
381
|
-
_localFields?: FormlyFieldConfigCache[];
|
|
382
|
-
_elementRefs?: ElementRef[];
|
|
383
|
-
_expressions?: {
|
|
384
|
-
[property: string]: {
|
|
385
|
-
callback?: (ingoreCache: boolean) => boolean;
|
|
386
|
-
paths?: string[];
|
|
387
|
-
subscription?: Subscription | null;
|
|
388
|
-
value$?: Observable<any>;
|
|
389
|
-
};
|
|
379
|
+
form?: UntypedFormGroup | UntypedFormArray;
|
|
380
|
+
model?: any;
|
|
381
|
+
formControl?: AbstractControl & {
|
|
382
|
+
_fields?: FormlyFieldConfigCache[];
|
|
383
|
+
_childrenErrors?: {
|
|
384
|
+
[id: string]: () => void;
|
|
390
385
|
};
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
386
|
+
};
|
|
387
|
+
parent?: FormlyFieldConfigCache;
|
|
388
|
+
options?: FormlyFormOptionsCache;
|
|
389
|
+
_controlActive?: boolean;
|
|
390
|
+
index?: number;
|
|
391
|
+
_localFields?: FormlyFieldConfigCache[];
|
|
392
|
+
_elementRefs?: ElementRef[];
|
|
393
|
+
_expressions?: {
|
|
394
|
+
[property: string]: {
|
|
395
|
+
callback?: (ingoreCache: boolean) => boolean;
|
|
396
|
+
paths?: string[];
|
|
397
|
+
subscription?: Subscription | null;
|
|
398
|
+
value$?: Observable<any>;
|
|
399
399
|
};
|
|
400
|
+
};
|
|
401
|
+
_hide?: boolean;
|
|
402
|
+
_validators?: ValidatorFn[];
|
|
403
|
+
_asyncValidators?: AsyncValidatorFn[];
|
|
404
|
+
_componentRefs?: (ComponentRef<FieldType> | EmbeddedViewRef<FieldType>)[];
|
|
405
|
+
_proxyInstance?: FormlyExtension;
|
|
406
|
+
_keyPath?: {
|
|
407
|
+
key: FormlyFieldConfig['key'];
|
|
408
|
+
path: string[];
|
|
409
|
+
};
|
|
400
410
|
}
|
|
401
411
|
interface FormlyFormOptionsCache extends FormlyFormOptions {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
checkExpressions?: (field: FormlyFieldConfig, ingoreCache?: boolean) => void;
|
|
413
|
+
_viewContainerRef?: ViewContainerRef;
|
|
414
|
+
_injector?: Injector;
|
|
415
|
+
_hiddenFieldsForCheck?: {
|
|
416
|
+
field: FormlyFieldConfigCache;
|
|
417
|
+
default?: boolean;
|
|
418
|
+
emitEvent?: boolean;
|
|
419
|
+
}[];
|
|
420
|
+
_initialModel?: any;
|
|
421
|
+
_formControlsForCheck?: Set<FormlyFieldConfigCache>;
|
|
422
|
+
_detectChanges?: (field: FormlyFieldConfig) => void;
|
|
423
|
+
_afterBuild?: Set<() => void>;
|
|
424
|
+
}
|
|
414
425
|
/**
|
|
415
426
|
* Maintains list of formly config options. This can be used to register new field type.
|
|
416
427
|
*/
|
|
417
|
-
declare class FormlyConfig {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
428
|
+
export declare class FormlyConfig {
|
|
429
|
+
types: {
|
|
430
|
+
[name: string]: TypeOption;
|
|
431
|
+
};
|
|
432
|
+
validators: {
|
|
433
|
+
[name: string]: ValidatorOption;
|
|
434
|
+
};
|
|
435
|
+
wrappers: {
|
|
436
|
+
[name: string]: WrapperOption;
|
|
437
|
+
};
|
|
438
|
+
messages: {
|
|
439
|
+
[name: string]: ValidationMessageOption['message'];
|
|
440
|
+
};
|
|
441
|
+
extras: NonNullable<ConfigOption['extras']>;
|
|
442
|
+
extensions: {
|
|
443
|
+
[name: string]: FormlyExtension;
|
|
444
|
+
};
|
|
445
|
+
presets: {
|
|
446
|
+
[name: string]: FormlyFieldConfig | FormlyFieldConfigPresetProvider;
|
|
447
|
+
};
|
|
448
|
+
private extensionsByPriority;
|
|
449
|
+
private componentRefs;
|
|
450
|
+
addConfig(config: ConfigOption | ConfigOption[]): void;
|
|
451
|
+
/**
|
|
452
|
+
* Allows you to specify a custom type which you can use in your field configuration.
|
|
453
|
+
* You can pass an object of options, or an array of objects of options.
|
|
454
|
+
*/
|
|
455
|
+
setType(options: TypeOption | TypeOption[]): void;
|
|
456
|
+
getType(name: FormlyFieldConfig['type'], throwIfNotFound?: boolean): TypeOption;
|
|
457
|
+
/** @ignore */
|
|
458
|
+
getMergedField(field?: FormlyFieldConfig): any;
|
|
459
|
+
/** @ignore @internal */
|
|
460
|
+
resolveFieldTypeRef(field?: FormlyFieldConfigCache): ComponentRef<FieldType>;
|
|
461
|
+
/** @ignore @internal */
|
|
462
|
+
clearRefs(): void;
|
|
463
|
+
setWrapper(options: WrapperOption): void;
|
|
464
|
+
getWrapper(name: string | Type<FieldWrapper>): WrapperOption;
|
|
465
|
+
/** @ignore */
|
|
466
|
+
setTypeWrapper(type: string, name: string): void;
|
|
467
|
+
setValidator(options: ValidatorOption): void;
|
|
468
|
+
getValidator(name: string): ValidatorOption;
|
|
469
|
+
addValidatorMessage(name: string, message: ValidationMessageOption['message']): void;
|
|
470
|
+
getValidatorMessage(name: string): string | ((error: any, field: FormlyFieldConfig) => string | import("rxjs").Observable<string>);
|
|
471
|
+
private setSortedExtensions;
|
|
472
|
+
private mergeExtendedType;
|
|
473
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyConfig, never>;
|
|
474
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
475
|
+
}
|
|
466
476
|
/**
|
|
467
477
|
* An InjectionToken for registering additional formly config options (types, wrappers ...).
|
|
468
478
|
*/
|
|
469
|
-
declare const FORMLY_CONFIG: InjectionToken<ConfigOption[]>;
|
|
470
|
-
declare function
|
|
471
|
-
declare
|
|
472
|
-
declare const
|
|
473
|
-
|
|
474
|
-
declare class FormlyFormBuilder {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
479
|
+
export declare const FORMLY_CONFIG: InjectionToken<ConfigOption[]>;
|
|
480
|
+
declare function withDefaultConfig(config: FormlyConfig): ConfigOption;
|
|
481
|
+
export declare function withFormlyFieldExpression(): ConfigOption;
|
|
482
|
+
export declare const provideFormlyCore: (configs?: ConfigOption | ConfigOption[]) => Provider;
|
|
483
|
+
export declare const provideFormlyConfig: (configs?: ConfigOption | ConfigOption[]) => Provider;
|
|
484
|
+
export declare class FormlyFormBuilder {
|
|
485
|
+
private config;
|
|
486
|
+
private injector;
|
|
487
|
+
private viewContainerRef;
|
|
488
|
+
private parentForm;
|
|
489
|
+
private readonly initializedForms;
|
|
490
|
+
constructor(config: FormlyConfig, injector: Injector, viewContainerRef: ViewContainerRef, parentForm: FormGroupDirective, configs?: ConfigOption[]);
|
|
491
|
+
buildForm(form: UntypedFormGroup | UntypedFormArray, fieldGroup: FormlyFieldConfig[], model: any, options: FormlyFormOptions): void;
|
|
492
|
+
build(field: FormlyFieldConfig): void;
|
|
493
|
+
private _build;
|
|
494
|
+
private _setOptions;
|
|
495
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFormBuilder, [null, null, {
|
|
496
|
+
optional: true;
|
|
497
|
+
}, {
|
|
498
|
+
optional: true;
|
|
499
|
+
}, {
|
|
500
|
+
optional: true;
|
|
501
|
+
}]>;
|
|
502
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
503
|
+
}
|
|
504
|
+
export declare class FormlyTemplate implements OnChanges {
|
|
505
|
+
ref: TemplateRef<any>;
|
|
506
|
+
name: string;
|
|
507
|
+
constructor(ref: TemplateRef<any>);
|
|
508
|
+
ngOnChanges(): void;
|
|
509
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyTemplate, never>;
|
|
510
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormlyTemplate, "[formlyTemplate]", never, {
|
|
511
|
+
"name": {
|
|
512
|
+
"alias": "formlyTemplate";
|
|
513
|
+
"required": false;
|
|
514
|
+
};
|
|
515
|
+
}, {}, never, never, true, never>;
|
|
496
516
|
}
|
|
497
517
|
declare class LegacyFormlyTemplate extends FormlyTemplate {
|
|
498
|
-
|
|
499
|
-
|
|
518
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyTemplate, never>;
|
|
519
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LegacyFormlyTemplate, "[formlyTemplate]", never, {}, {}, never, never, false, never>;
|
|
500
520
|
}
|
|
501
521
|
declare class FormlyFieldTemplates {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
522
|
+
templates: QueryList<FormlyTemplate>;
|
|
523
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldTemplates, never>;
|
|
524
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
505
525
|
}
|
|
506
|
-
|
|
507
526
|
/**
|
|
508
527
|
* The `<form-form>` component is the main container of the form,
|
|
509
528
|
* which takes care of managing the form state
|
|
510
529
|
* and delegates the rendering of each field to `<formly-field>` component.
|
|
511
530
|
*/
|
|
512
|
-
declare class FormlyForm implements DoCheck, OnChanges, OnDestroy {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
531
|
+
export declare class FormlyForm implements DoCheck, OnChanges, OnDestroy {
|
|
532
|
+
private builder;
|
|
533
|
+
private config;
|
|
534
|
+
private ngZone;
|
|
535
|
+
protected fieldTemplates: FormlyFieldTemplates;
|
|
536
|
+
/** The form instance which allow to track model value and validation status. */
|
|
537
|
+
set form(form: UntypedFormGroup | UntypedFormArray);
|
|
538
|
+
get form(): UntypedFormGroup | UntypedFormArray;
|
|
539
|
+
/**
|
|
540
|
+
* The model to be represented by the form.
|
|
541
|
+
* The form sets a `WritableSignal` to a copy of the model after each change.
|
|
542
|
+
*/
|
|
543
|
+
set model(model: any);
|
|
544
|
+
get model(): any;
|
|
545
|
+
/** The field configurations for building the form. */
|
|
546
|
+
set fields(fieldGroup: FormlyFieldConfig[]);
|
|
547
|
+
get fields(): FormlyFieldConfig[];
|
|
548
|
+
/** Options for the form. */
|
|
549
|
+
set options(options: FormlyFormOptions);
|
|
550
|
+
get options(): FormlyFormOptions;
|
|
551
|
+
/** Event that is emitted when the model value is changed */
|
|
552
|
+
modelChange: EventEmitter<any>;
|
|
553
|
+
/** Emits a build event asynchronously when the fields or form input changes. */
|
|
554
|
+
fieldChange: EventEmitter<FormlyValueChangeEvent>;
|
|
555
|
+
set templates(templates: QueryList<FormlyTemplate>);
|
|
556
|
+
field: FormlyFieldConfigCache;
|
|
557
|
+
private readonly destroyRef;
|
|
558
|
+
private readonly pendingTasks;
|
|
559
|
+
private readonly injector;
|
|
560
|
+
private _modelChangeValue;
|
|
561
|
+
private modelSignal?;
|
|
562
|
+
private modelSignalValue;
|
|
563
|
+
private modelSignalEffect?;
|
|
564
|
+
private valueChangesUnsubscribe;
|
|
565
|
+
private readonly afterBuild;
|
|
566
|
+
constructor(builder: FormlyFormBuilder, config: FormlyConfig, ngZone: NgZone, fieldTemplates: FormlyFieldTemplates);
|
|
567
|
+
ngDoCheck(): void;
|
|
568
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
569
|
+
ngOnDestroy(): void;
|
|
570
|
+
private checkExpressionChange;
|
|
571
|
+
private valueChanges;
|
|
572
|
+
private setField;
|
|
573
|
+
private build;
|
|
574
|
+
private bindModelSignal;
|
|
575
|
+
private syncModelSignal;
|
|
576
|
+
private useSignalValue;
|
|
577
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyForm, never>;
|
|
578
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyForm, "formly-form", never, {
|
|
579
|
+
"form": {
|
|
580
|
+
"alias": "form";
|
|
581
|
+
"required": false;
|
|
582
|
+
};
|
|
583
|
+
"model": {
|
|
584
|
+
"alias": "model";
|
|
585
|
+
"required": false;
|
|
586
|
+
};
|
|
587
|
+
"fields": {
|
|
588
|
+
"alias": "fields";
|
|
589
|
+
"required": false;
|
|
590
|
+
};
|
|
591
|
+
"options": {
|
|
592
|
+
"alias": "options";
|
|
593
|
+
"required": false;
|
|
594
|
+
};
|
|
595
|
+
}, {
|
|
596
|
+
"modelChange": "modelChange";
|
|
597
|
+
"fieldChange": "fieldChange";
|
|
598
|
+
}, ["templates"], never, true, never>;
|
|
599
|
+
}
|
|
600
|
+
export declare class LegacyFormlyForm extends FormlyForm {
|
|
601
|
+
set templates(templates: QueryList<FormlyTemplate>);
|
|
602
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyForm, never>;
|
|
603
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyForm, "formly-form", never, {}, {}, ["templates"], never, false, never>;
|
|
604
|
+
}
|
|
555
605
|
/**
|
|
556
606
|
* The `<formly-field>` component is used to render the UI widget (layout + type) of a given `field`.
|
|
557
607
|
*/
|
|
558
|
-
declare class FormlyField implements DoCheck, OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
608
|
+
export declare class FormlyField implements DoCheck, OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy {
|
|
609
|
+
private config;
|
|
610
|
+
private renderer;
|
|
611
|
+
private _elementRef;
|
|
612
|
+
private hostContainerRef;
|
|
613
|
+
private injector;
|
|
614
|
+
private form;
|
|
615
|
+
/** The field config. */
|
|
616
|
+
field: FormlyFieldConfig;
|
|
617
|
+
viewContainerRef: ViewContainerRef;
|
|
618
|
+
private hostObservers;
|
|
619
|
+
private componentRefs;
|
|
620
|
+
private hooksObservers;
|
|
621
|
+
private detectFieldBuild;
|
|
622
|
+
private get containerRef();
|
|
623
|
+
private get elementRef();
|
|
624
|
+
valueChangesUnsubscribe: () => void;
|
|
625
|
+
constructor(config: FormlyConfig, renderer: Renderer2, _elementRef: ElementRef, hostContainerRef: ViewContainerRef, injector: Injector, form: FormlyFieldTemplates);
|
|
626
|
+
ngAfterContentInit(): void;
|
|
627
|
+
ngAfterViewInit(): void;
|
|
628
|
+
ngDoCheck(): void;
|
|
629
|
+
ngOnInit(): void;
|
|
630
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
631
|
+
ngOnDestroy(): void;
|
|
632
|
+
private renderField;
|
|
633
|
+
private triggerHook;
|
|
634
|
+
attachLocalField(field?: FormlyFieldConfigCache, previousField?: FormlyFieldConfigCache): void;
|
|
635
|
+
private createFieldInjector;
|
|
636
|
+
private attachComponentRef;
|
|
637
|
+
private render;
|
|
638
|
+
private resetRefs;
|
|
639
|
+
private fieldChanges;
|
|
640
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyField, [null, null, null, null, null, {
|
|
641
|
+
optional: true;
|
|
642
|
+
}]>;
|
|
643
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyField, "formly-field", never, {
|
|
644
|
+
"field": {
|
|
645
|
+
"alias": "field";
|
|
646
|
+
"required": false;
|
|
647
|
+
};
|
|
648
|
+
}, {}, never, never, true, never>;
|
|
649
|
+
}
|
|
650
|
+
export declare class LegacyFormlyField extends FormlyField {
|
|
651
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyField, never>;
|
|
652
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyField, "formly-field", never, {}, {}, never, never, false, never>;
|
|
653
|
+
}
|
|
598
654
|
/**
|
|
599
655
|
* Allow to link the `field` HTML attributes (`id`, `name` ...) and Event attributes (`focus`, `blur` ...) to an element in the DOM.
|
|
600
656
|
*/
|
|
601
|
-
declare class FormlyAttributes implements OnChanges, DoCheck, OnDestroy {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
657
|
+
export declare class FormlyAttributes implements OnChanges, DoCheck, OnDestroy {
|
|
658
|
+
private renderer;
|
|
659
|
+
private elementRef;
|
|
660
|
+
private formlyField?;
|
|
661
|
+
/** The field config. */
|
|
662
|
+
field: FormlyFieldConfig;
|
|
663
|
+
id: string;
|
|
664
|
+
private document;
|
|
665
|
+
private uiAttributesCache;
|
|
666
|
+
private uiAttributes;
|
|
667
|
+
private focusObserver;
|
|
668
|
+
/**
|
|
669
|
+
* HostBinding doesn't register listeners conditionally which may produce some perf issues.
|
|
670
|
+
*
|
|
671
|
+
* Formly issue: https://github.com/ngx-formly/ngx-formly/issues/1991
|
|
672
|
+
*/
|
|
673
|
+
private uiEvents;
|
|
674
|
+
private get props();
|
|
675
|
+
private get fieldAttrElements();
|
|
676
|
+
constructor(renderer: Renderer2, elementRef: ElementRef, _document: any, formlyField?: FormlyField);
|
|
677
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
678
|
+
/**
|
|
679
|
+
* We need to re-evaluate all the attributes on every change detection cycle, because
|
|
680
|
+
* by using a HostBinding we run into certain edge cases. This means that whatever logic
|
|
681
|
+
* is in here has to be super lean or we risk seriously damaging or destroying the performance.
|
|
682
|
+
*
|
|
683
|
+
* Formly issue: https://github.com/ngx-formly/ngx-formly/issues/1317
|
|
684
|
+
* Material issue: https://github.com/angular/components/issues/14024
|
|
685
|
+
*/
|
|
686
|
+
ngDoCheck(): void;
|
|
687
|
+
ngOnDestroy(): void;
|
|
688
|
+
toggleFocus(value: boolean): void;
|
|
689
|
+
onFocus($event: any): void;
|
|
690
|
+
onBlur($event: any): void;
|
|
691
|
+
onHostChange($event: any): void;
|
|
692
|
+
onChange($event: any): void;
|
|
693
|
+
private attachElementRef;
|
|
694
|
+
private detachElementRef;
|
|
695
|
+
private getSafeAttributeValue;
|
|
696
|
+
private setAttribute;
|
|
697
|
+
private removeAttribute;
|
|
698
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyAttributes, [null, null, null, {
|
|
699
|
+
optional: true;
|
|
700
|
+
}]>;
|
|
701
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormlyAttributes, "[formlyAttributes]", never, {
|
|
702
|
+
"field": {
|
|
703
|
+
"alias": "formlyAttributes";
|
|
704
|
+
"required": false;
|
|
705
|
+
};
|
|
706
|
+
"id": {
|
|
707
|
+
"alias": "id";
|
|
708
|
+
"required": false;
|
|
709
|
+
};
|
|
710
|
+
}, {}, never, never, true, never>;
|
|
711
|
+
}
|
|
712
|
+
export declare class LegacyFormlyAttributes extends FormlyAttributes {
|
|
713
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyAttributes, never>;
|
|
714
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LegacyFormlyAttributes, "[formlyAttributes]", never, {}, {}, never, never, false, never>;
|
|
715
|
+
}
|
|
650
716
|
/** @ignore */
|
|
651
717
|
declare class FormlyGroup extends FieldType<FieldGroupTypeConfig> {
|
|
652
|
-
|
|
653
|
-
|
|
718
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyGroup, never>;
|
|
719
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyGroup, "formly-group", never, {}, {}, never, ["*"], false, never>;
|
|
654
720
|
}
|
|
655
|
-
|
|
656
721
|
/**
|
|
657
722
|
* The `<formly-validation-message>` component renders the error message of a given `field`.
|
|
723
|
+
* @deprecated Use the `validationMessages` pipe to render validation messages.
|
|
658
724
|
*/
|
|
659
|
-
declare class FormlyValidationMessage implements OnChanges {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
725
|
+
export declare class FormlyValidationMessage implements OnChanges {
|
|
726
|
+
private config;
|
|
727
|
+
/** The field config. */
|
|
728
|
+
field: FormlyFieldConfig;
|
|
729
|
+
errorMessage$: Observable<string>;
|
|
730
|
+
constructor(config: FormlyConfig);
|
|
731
|
+
ngOnChanges(): void;
|
|
732
|
+
get errorMessage(): string | Observable<string>;
|
|
733
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyValidationMessage, never>;
|
|
734
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyValidationMessage, "formly-validation-message", never, {
|
|
735
|
+
"field": {
|
|
736
|
+
"alias": "field";
|
|
737
|
+
"required": false;
|
|
738
|
+
};
|
|
739
|
+
}, {}, never, never, true, never>;
|
|
740
|
+
}
|
|
741
|
+
/** @deprecated Use the `validationMessages` pipe to render validation messages. */
|
|
742
|
+
export declare class LegacyFormlyValidationMessage extends FormlyValidationMessage {
|
|
743
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyValidationMessage, never>;
|
|
744
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyValidationMessage, "formly-validation-message", never, {}, {}, never, never, false, never>;
|
|
745
|
+
}
|
|
746
|
+
export interface FormlyValidationMessageEntry {
|
|
747
|
+
/** The visible field associated with the error. */
|
|
748
|
+
field: FormlyFieldConfig;
|
|
749
|
+
/** The key in the control's errors object. */
|
|
750
|
+
error: string;
|
|
751
|
+
/** The resolved, nonempty validation message. */
|
|
752
|
+
message: string;
|
|
753
|
+
}
|
|
754
|
+
/** Collects configured messages from built fields, independently of touched or submitted state. */
|
|
755
|
+
export declare class FormlyValidationMessagesPipe implements PipeTransform {
|
|
756
|
+
private config;
|
|
757
|
+
constructor(config: FormlyConfig);
|
|
758
|
+
transform(fields: FormlyFieldConfig | readonly FormlyFieldConfig[] | null | undefined): Observable<FormlyValidationMessageEntry[]>;
|
|
759
|
+
private getFields;
|
|
760
|
+
private isVisible;
|
|
761
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyValidationMessagesPipe, never>;
|
|
762
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<FormlyValidationMessagesPipe, "validationMessages", true>;
|
|
763
|
+
}
|
|
764
|
+
export interface FieldArrayTypeConfig<T = FormlyFieldConfig['props']> extends FormlyFieldConfig<T> {
|
|
765
|
+
formControl: UntypedFormArray;
|
|
766
|
+
props: NonNullable<T>;
|
|
767
|
+
}
|
|
768
|
+
export declare abstract class FieldArrayType<F extends FormlyFieldConfig = FieldArrayTypeConfig> extends FieldType<F> implements FormlyExtension<F> {
|
|
769
|
+
onPopulate(field: F): void;
|
|
770
|
+
add(i?: number, initialModel?: any, { markAsDirty }?: {
|
|
771
|
+
markAsDirty: boolean;
|
|
772
|
+
}): void;
|
|
773
|
+
remove(i: number, { markAsDirty }?: {
|
|
774
|
+
markAsDirty: boolean;
|
|
775
|
+
}): void;
|
|
776
|
+
private _build;
|
|
777
|
+
private detachFixedFields;
|
|
778
|
+
private addArrayElement;
|
|
779
|
+
private updateArrayElementKey;
|
|
780
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldArrayType<any>, never>;
|
|
781
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FieldArrayType<any>, never, never, {}, {}, never, never, true, never>;
|
|
782
|
+
}
|
|
694
783
|
/** @ignore */
|
|
695
784
|
declare class FormlyTemplateType extends FieldType {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
}
|
|
703
|
-
|
|
785
|
+
private sanitizer;
|
|
786
|
+
get template(): SafeHtml;
|
|
787
|
+
private innerHtml;
|
|
788
|
+
constructor(sanitizer: DomSanitizer);
|
|
789
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyTemplateType, never>;
|
|
790
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyTemplateType, "formly-template", never, {}, {}, never, never, false, never>;
|
|
791
|
+
}
|
|
704
792
|
/**
|
|
705
793
|
* Registers Formly components and configuration for NgModule-based applications.
|
|
706
794
|
*
|
|
@@ -708,38 +796,55 @@ declare class FormlyTemplateType extends FieldType {
|
|
|
708
796
|
* `forChild()` adds feature configuration using the inherited service. This follows
|
|
709
797
|
* Angular's [root/child module registration convention](https://frontendatlas.com/angular/trivia/angular-forroot-forchild).
|
|
710
798
|
*/
|
|
711
|
-
declare class FormlyModule {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
718
|
-
|
|
799
|
+
export declare class FormlyModule {
|
|
800
|
+
static forRoot(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
|
|
801
|
+
static forChild(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
|
|
802
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyModule, never>;
|
|
803
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlyModule, [typeof LegacyFormlyTemplate, typeof LegacyFormlyForm, typeof LegacyFormlyField, typeof LegacyFormlyAttributes, typeof LegacyFormlyValidationMessage, typeof FormlyGroup, typeof FormlyTemplateType], [typeof i8.CommonModule, typeof FormlyValidationMessagesPipe], [typeof FormlyValidationMessagesPipe, typeof LegacyFormlyTemplate, typeof LegacyFormlyForm, typeof LegacyFormlyField, typeof LegacyFormlyAttributes, typeof LegacyFormlyValidationMessage, typeof FormlyGroup]>;
|
|
804
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormlyModule>;
|
|
805
|
+
}
|
|
806
|
+
declare function disableTreeValidityCall(form: any, callback: () => void): void;
|
|
807
|
+
declare function getFieldId(formId: string, field: FormlyFieldConfig, index: string | number): string;
|
|
719
808
|
declare function hasKey(field: FormlyFieldConfig): boolean;
|
|
809
|
+
declare function getKeyPath(field: FormlyFieldConfigCache): string[];
|
|
810
|
+
declare const FORMLY_VALIDATORS: string[];
|
|
811
|
+
declare function assignFieldValue(field: FormlyFieldConfigCache, value: any): void;
|
|
812
|
+
declare function assignModelValue(model: any, paths: string[], value: any): void;
|
|
720
813
|
declare function getFieldValue(field: FormlyFieldConfig): any;
|
|
721
814
|
declare function reverseDeepMerge(dest: any, ...args: any[]): any;
|
|
815
|
+
declare function isNil(value: any): boolean;
|
|
816
|
+
declare function isUndefined(value: any): boolean;
|
|
817
|
+
declare function isBlankString(value: any): boolean;
|
|
818
|
+
declare function isFunction(value: any): boolean;
|
|
819
|
+
declare function objAndSameType(obj1: any, obj2: any): boolean;
|
|
820
|
+
declare function isObject(x: any): boolean;
|
|
821
|
+
declare function isPromise(obj: any): obj is Promise<any>;
|
|
722
822
|
declare function clone(value: any): any;
|
|
823
|
+
declare function isEqualValue(a: any, b: any): boolean;
|
|
723
824
|
declare function defineHiddenProp(field: any, prop: string, defaultValue: any): void;
|
|
724
825
|
type IObserveFn<T> = (change: {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
826
|
+
currentValue: T;
|
|
827
|
+
previousValue?: T;
|
|
828
|
+
firstChange: boolean;
|
|
728
829
|
}) => void;
|
|
729
830
|
interface IObserver<T> {
|
|
730
|
-
|
|
731
|
-
|
|
831
|
+
setValue: (value: T, emitEvent?: boolean) => void;
|
|
832
|
+
unsubscribe: () => void;
|
|
732
833
|
}
|
|
733
834
|
interface IObserveTarget<T> {
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
};
|
|
835
|
+
[prop: string]: any;
|
|
836
|
+
_observers?: {
|
|
837
|
+
[prop: string]: {
|
|
838
|
+
value: T;
|
|
839
|
+
onChange: IObserveFn<T>[];
|
|
740
840
|
};
|
|
841
|
+
};
|
|
741
842
|
}
|
|
843
|
+
declare function observeDeep<T = any>(source: IObserveTarget<T>, paths: string[], setFn: () => void): () => void;
|
|
742
844
|
declare function observe<T = any>(o: IObserveTarget<T>, paths: string[], setFn?: IObserveFn<T>): IObserver<T>;
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
845
|
+
declare function getField(f: FormlyFieldConfig, key: FormlyFieldConfig['key']): FormlyFieldConfig;
|
|
846
|
+
declare function markFieldForCheck(field: FormlyFieldConfigCache): void;
|
|
847
|
+
declare function isNoopNgZone(ngZone: NgZone): ngZone is ɵNoopNgZone;
|
|
848
|
+
declare function isHiddenField(field: FormlyFieldConfig): boolean;
|
|
849
|
+
declare function isSignalRequired(): boolean;
|
|
850
|
+
export { FormlyGroup as ɵFormlyGroup, LegacyFormlyTemplate as ɵFormlyTemplate, clone as ɵclone, defineHiddenProp as ɵdefineHiddenProp, getFieldValue as ɵgetFieldValue, hasKey as ɵhasKey, observe as ɵobserve, reverseDeepMerge as ɵreverseDeepMerge };
|