@ngx-formly/core 8.0.0 → 9.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 +26 -19
- package/fesm2022/ngx-formly-core-json-schema.mjs +3 -3
- package/fesm2022/ngx-formly-core-preset.mjs +4 -4
- package/fesm2022/ngx-formly-core-select.mjs +10 -10
- package/fesm2022/ngx-formly-core-testing.mjs +3 -3
- package/fesm2022/ngx-formly-core.mjs +111 -75
- package/fesm2022/ngx-formly-core.mjs.map +1 -1
- package/index.d.ts +738 -3
- package/json-schema/index.d.ts +39 -5
- package/package.json +2 -2
- package/preset/index.d.ts +13 -5
- package/select/index.d.ts +44 -5
- package/testing/index.d.ts +37 -5
- package/json-schema/formly-json-schema.service.d.ts +0 -36
- package/json-schema/public_api.d.ts +0 -1
- package/lib/components/formly.field.d.ts +0 -47
- package/lib/components/formly.form.d.ts +0 -50
- package/lib/components/formly.template.d.ts +0 -19
- package/lib/core.config.d.ts +0 -11
- package/lib/core.d.ts +0 -20
- package/lib/core.module.d.ts +0 -25
- package/lib/extensions/core/core.d.ts +0 -14
- package/lib/extensions/field-expression/field-expression.d.ts +0 -4
- package/lib/extensions/field-expression/utils.d.ts +0 -4
- package/lib/extensions/field-expression-legacy/field-expression.d.ts +0 -16
- package/lib/extensions/field-expression-legacy/utils.d.ts +0 -5
- package/lib/extensions/field-form/field-form.d.ts +0 -11
- package/lib/extensions/field-form/utils.d.ts +0 -7
- package/lib/extensions/field-validation/field-validation.d.ts +0 -11
- package/lib/models/config.d.ts +0 -90
- package/lib/models/fieldconfig.cache.d.ts +0 -50
- package/lib/models/fieldconfig.d.ts +0 -243
- package/lib/models/index.d.ts +0 -3
- package/lib/services/formly.builder.d.ts +0 -18
- package/lib/services/formly.config.d.ts +0 -56
- package/lib/templates/field-array.type.d.ts +0 -22
- package/lib/templates/field-template.type.d.ts +0 -12
- package/lib/templates/field.type.d.ts +0 -30
- package/lib/templates/field.wrapper.d.ts +0 -12
- package/lib/templates/formly.attributes.d.ts +0 -55
- package/lib/templates/formly.group.d.ts +0 -7
- package/lib/templates/formly.validation-message.d.ts +0 -23
- package/lib/utils.d.ts +0 -47
- package/preset/preset-substitution.extension.d.ts +0 -13
- package/preset/preset.config.d.ts +0 -2
- package/preset/preset.module.d.ts +0 -7
- package/preset/public_api.d.ts +0 -2
- package/public_api.d.ts +0 -1
- package/select/public_api.d.ts +0 -2
- package/select/select-options.pipe.d.ts +0 -34
- package/select/select.module.d.ts +0 -7
- package/testing/component-factory.d.ts +0 -35
- package/testing/public_api.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,740 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { QueryList, ViewContainerRef, Type, Injector, ElementRef, ComponentRef, EmbeddedViewRef, InjectionToken, Provider, OnChanges, TemplateRef, DoCheck, OnDestroy, EventEmitter, NgZone, SimpleChanges, OnInit, AfterContentInit, AfterViewInit, Renderer2, ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import * as _angular_forms from '@angular/forms';
|
|
4
|
+
import { NgControl, UntypedFormGroup, UntypedFormControl, AbstractControl, ValidatorFn, AsyncValidatorFn, FormGroupDirective, UntypedFormArray, ValidationErrors } from '@angular/forms';
|
|
5
|
+
import * as rxjs from 'rxjs';
|
|
6
|
+
import { Observable, Subject, Subscription } from 'rxjs';
|
|
7
|
+
import * as _ngx_formly_core from '@ngx-formly/core';
|
|
8
|
+
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
9
|
+
import * as i8 from '@angular/common';
|
|
10
|
+
|
|
11
|
+
interface FieldTypeConfig<T = FormlyFieldConfig['props']> extends FormlyFieldConfig<T> {
|
|
12
|
+
formControl: UntypedFormControl;
|
|
13
|
+
props: NonNullable<T>;
|
|
14
|
+
}
|
|
15
|
+
interface FieldGroupTypeConfig<T = FormlyFieldConfig['props']> extends FormlyFieldConfig<T> {
|
|
16
|
+
formControl: UntypedFormGroup;
|
|
17
|
+
props: NonNullable<T>;
|
|
18
|
+
}
|
|
19
|
+
declare abstract class FieldType<F extends FormlyFieldConfig = FormlyFieldConfig> {
|
|
20
|
+
set _formlyControls(controls: QueryList<NgControl>);
|
|
21
|
+
field: F;
|
|
22
|
+
defaultOptions?: Partial<F>;
|
|
23
|
+
get model(): any;
|
|
24
|
+
get form(): UntypedFormGroup | _angular_forms.UntypedFormArray;
|
|
25
|
+
get options(): _ngx_formly_core.FormlyFormOptions;
|
|
26
|
+
get key(): string | number | (string | number)[];
|
|
27
|
+
get formControl(): NonNullable<F["formControl"]>;
|
|
28
|
+
get props(): NonNullable<F["props"]>;
|
|
29
|
+
/** @deprecated Use `props` instead. */
|
|
30
|
+
get to(): NonNullable<F["props"]>;
|
|
31
|
+
get showError(): boolean;
|
|
32
|
+
get id(): string;
|
|
33
|
+
get formState(): any;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldType<any>, never>;
|
|
35
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FieldType<any>, never, never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
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
|
+
}
|
|
45
|
+
|
|
46
|
+
type FieldExpression<T = any> = string | ((field: FormlyFieldConfig) => T) | Observable<T>;
|
|
47
|
+
type FieldExpressions = {
|
|
48
|
+
[property: string]: FieldExpression;
|
|
49
|
+
} & {
|
|
50
|
+
className?: FieldExpression<string>;
|
|
51
|
+
hide?: FieldExpression<boolean>;
|
|
52
|
+
'props.disabled'?: FieldExpression<boolean>;
|
|
53
|
+
'props.required'?: FieldExpression<boolean>;
|
|
54
|
+
};
|
|
55
|
+
interface FormlyFieldConfig<Props = FormlyFieldProps & {
|
|
56
|
+
[additionalProperties: string]: any;
|
|
57
|
+
}> {
|
|
58
|
+
/**
|
|
59
|
+
* The key that relates to the model. This will link the field value to the model
|
|
60
|
+
*/
|
|
61
|
+
key?: string | number | (string | number)[];
|
|
62
|
+
/**
|
|
63
|
+
* This should be a formly-field type added either by you or a plugin. More information over at Creating Formly Fields.
|
|
64
|
+
*/
|
|
65
|
+
type?: string | Type<FieldType>;
|
|
66
|
+
/**
|
|
67
|
+
* 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`.
|
|
68
|
+
*/
|
|
69
|
+
defaultValue?: any;
|
|
70
|
+
/**
|
|
71
|
+
* This allows you to specify the `id` of your field. Note, the `id` is generated if not set.
|
|
72
|
+
*/
|
|
73
|
+
id?: string;
|
|
74
|
+
/**
|
|
75
|
+
* 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.
|
|
76
|
+
*/
|
|
77
|
+
name?: string;
|
|
78
|
+
/**
|
|
79
|
+
* 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.
|
|
80
|
+
*/
|
|
81
|
+
props?: Props;
|
|
82
|
+
/** @deprecated Use `props` instead. */
|
|
83
|
+
templateOptions?: FormlyTemplateOptions;
|
|
84
|
+
/**
|
|
85
|
+
* An object with a few useful properties
|
|
86
|
+
* - `validation.messages`: A map of message names that will be displayed when the field has errors.
|
|
87
|
+
* - `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.
|
|
88
|
+
*/
|
|
89
|
+
validation?: {
|
|
90
|
+
messages?: {
|
|
91
|
+
[messageProperties: string]: ValidationMessageOption['message'];
|
|
92
|
+
} & {
|
|
93
|
+
/** @deprecated use `minLength` */
|
|
94
|
+
minlength?: ValidationMessageOption['message'];
|
|
95
|
+
/** @deprecated use `maxLength` */
|
|
96
|
+
maxlength?: ValidationMessageOption['message'];
|
|
97
|
+
};
|
|
98
|
+
show?: boolean;
|
|
99
|
+
[additionalProperties: string]: any;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Used to set validation rules for a particular field.
|
|
103
|
+
* Should be an object of key - value pairs. The value can either be an expression to evaluate or a function to run.
|
|
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 {
|
|
211
|
+
[additionalProperties: string]: any;
|
|
212
|
+
}
|
|
213
|
+
interface FormlyFieldProps {
|
|
214
|
+
type?: string;
|
|
215
|
+
label?: string;
|
|
216
|
+
placeholder?: string;
|
|
217
|
+
disabled?: boolean;
|
|
218
|
+
options?: any[] | Observable<any[]>;
|
|
219
|
+
rows?: number;
|
|
220
|
+
cols?: number;
|
|
221
|
+
description?: string;
|
|
222
|
+
hidden?: boolean;
|
|
223
|
+
max?: number;
|
|
224
|
+
min?: number;
|
|
225
|
+
minLength?: number;
|
|
226
|
+
/** @deprecated use `minLength` */
|
|
227
|
+
minlength?: number;
|
|
228
|
+
maxLength?: number;
|
|
229
|
+
/** @deprecated use `maxLength` */
|
|
230
|
+
maxlength?: number;
|
|
231
|
+
pattern?: string | RegExp;
|
|
232
|
+
required?: boolean;
|
|
233
|
+
tabindex?: number;
|
|
234
|
+
readonly?: boolean;
|
|
235
|
+
attributes?: {
|
|
236
|
+
[key: string]: string | number;
|
|
237
|
+
};
|
|
238
|
+
step?: number;
|
|
239
|
+
focus?: FormlyAttributeEvent;
|
|
240
|
+
blur?: FormlyAttributeEvent;
|
|
241
|
+
keyup?: FormlyAttributeEvent;
|
|
242
|
+
keydown?: FormlyAttributeEvent;
|
|
243
|
+
click?: FormlyAttributeEvent;
|
|
244
|
+
change?: FormlyAttributeEvent;
|
|
245
|
+
keypress?: FormlyAttributeEvent;
|
|
246
|
+
wheel?: FormlyAttributeEvent;
|
|
247
|
+
}
|
|
248
|
+
type FormlyHookFn = (field: FormlyFieldConfig) => void;
|
|
249
|
+
interface FormlyHookConfig {
|
|
250
|
+
onInit?: FormlyHookFn | ((field: FormlyFieldConfig) => Observable<any>);
|
|
251
|
+
onChanges?: FormlyHookFn;
|
|
252
|
+
afterContentInit?: FormlyHookFn;
|
|
253
|
+
afterViewInit?: FormlyHookFn;
|
|
254
|
+
onDestroy?: FormlyHookFn;
|
|
255
|
+
}
|
|
256
|
+
interface FormlyFormOptions {
|
|
257
|
+
updateInitialValue?: (model?: any) => void;
|
|
258
|
+
resetModel?: (model?: any) => void;
|
|
259
|
+
formState?: any;
|
|
260
|
+
fieldChanges?: Subject<FormlyValueChangeEvent>;
|
|
261
|
+
showError?: (field: FieldType) => boolean;
|
|
262
|
+
build?: (field?: FormlyFieldConfig) => FormlyFieldConfig;
|
|
263
|
+
checkExpressions?: (field: FormlyFieldConfig) => void;
|
|
264
|
+
detectChanges?: (field: FormlyFieldConfig) => void;
|
|
265
|
+
parentForm?: FormGroupDirective | null;
|
|
266
|
+
}
|
|
267
|
+
interface FormlyValueChangeEvent {
|
|
268
|
+
field: FormlyFieldConfig;
|
|
269
|
+
type: string;
|
|
270
|
+
value: any;
|
|
271
|
+
[meta: string]: any;
|
|
272
|
+
}
|
|
273
|
+
interface FormlyValidation<T, R> {
|
|
274
|
+
validation?: (string | T)[] | any;
|
|
275
|
+
[key: string]: FormlyValidatorFn<R> | FormlyValidatorExpressionFn<R> | any;
|
|
276
|
+
}
|
|
277
|
+
type FormlyValidatorFn<T> = (control: AbstractControl, field: FormlyFieldConfig) => T;
|
|
278
|
+
interface FormlyValidatorExpressionFn<T> {
|
|
279
|
+
expression: FormlyValidatorFn<T>;
|
|
280
|
+
message: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface FormlyExtension<F extends FormlyFieldConfig = FormlyFieldConfig> {
|
|
284
|
+
priority?: number;
|
|
285
|
+
prePopulate?(field: F): void;
|
|
286
|
+
onPopulate?(field: F): void;
|
|
287
|
+
postPopulate?(field: F): void;
|
|
288
|
+
}
|
|
289
|
+
interface TypeOption {
|
|
290
|
+
name: string;
|
|
291
|
+
component?: Type<FieldType>;
|
|
292
|
+
wrappers?: string[];
|
|
293
|
+
extends?: string;
|
|
294
|
+
defaultOptions?: FormlyFieldConfig;
|
|
295
|
+
}
|
|
296
|
+
interface WrapperOption {
|
|
297
|
+
name: string;
|
|
298
|
+
component: Type<FieldWrapper>;
|
|
299
|
+
types?: string[];
|
|
300
|
+
}
|
|
301
|
+
type FieldValidatorFn = (c: AbstractControl, field: FormlyFieldConfig, options?: {
|
|
302
|
+
[id: string]: any;
|
|
303
|
+
}) => ValidationErrors | null;
|
|
304
|
+
interface ValidatorOption {
|
|
305
|
+
name: string;
|
|
306
|
+
validation: FieldValidatorFn;
|
|
307
|
+
options?: {
|
|
308
|
+
[id: string]: any;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
interface ExtensionOption {
|
|
312
|
+
name: string;
|
|
313
|
+
extension: FormlyExtension;
|
|
314
|
+
priority?: number;
|
|
315
|
+
}
|
|
316
|
+
interface ValidationMessageOption {
|
|
317
|
+
name: string;
|
|
318
|
+
message: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
|
|
319
|
+
}
|
|
320
|
+
interface PresetOption {
|
|
321
|
+
name: string;
|
|
322
|
+
config: FormlyFieldConfig | FormlyFieldConfigPresetProvider;
|
|
323
|
+
}
|
|
324
|
+
interface FormlyFieldConfigPresetProvider {
|
|
325
|
+
getConfiguration: () => FormlyFieldConfig;
|
|
326
|
+
}
|
|
327
|
+
interface ConfigOption {
|
|
328
|
+
types?: TypeOption[];
|
|
329
|
+
wrappers?: WrapperOption[];
|
|
330
|
+
validators?: ValidatorOption[];
|
|
331
|
+
extensions?: ExtensionOption[];
|
|
332
|
+
validationMessages?: ValidationMessageOption[];
|
|
333
|
+
extras?: {
|
|
334
|
+
immutable?: boolean;
|
|
335
|
+
showError?: (field: FieldType) => boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Defines the option which formly rely on to check field expression properties.
|
|
338
|
+
* - `modelChange`: perform a check when the value of the form control changes.
|
|
339
|
+
* - `changeDetectionCheck`: triggers an immediate check when `ngDoCheck` is called.
|
|
340
|
+
*
|
|
341
|
+
* Defaults to `modelChange`.
|
|
342
|
+
*/
|
|
343
|
+
checkExpressionOn?: 'modelChange' | 'changeDetectionCheck';
|
|
344
|
+
/**
|
|
345
|
+
* Whether to lazily render field components or not when marked as hidden.
|
|
346
|
+
* - `true`: lazily render field components.
|
|
347
|
+
* - `false`: render field components and use CSS to control their visibility.
|
|
348
|
+
*
|
|
349
|
+
* Defaults to `true`.
|
|
350
|
+
*/
|
|
351
|
+
lazyRender?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* When `true`, reset the value of a hidden field.
|
|
354
|
+
*
|
|
355
|
+
* Defaults to `true`.
|
|
356
|
+
*/
|
|
357
|
+
resetFieldOnHide?: boolean;
|
|
358
|
+
/**
|
|
359
|
+
* Whether to render fields inside <formly-field> component or not.
|
|
360
|
+
*
|
|
361
|
+
* Defaults to `true`.
|
|
362
|
+
*/
|
|
363
|
+
renderFormlyFieldElement?: boolean;
|
|
364
|
+
};
|
|
365
|
+
presets?: PresetOption[];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
interface FormlyFieldConfigCache extends FormlyFieldConfig {
|
|
369
|
+
form?: UntypedFormGroup | UntypedFormArray;
|
|
370
|
+
model?: any;
|
|
371
|
+
formControl?: AbstractControl & {
|
|
372
|
+
_fields?: FormlyFieldConfigCache[];
|
|
373
|
+
_childrenErrors?: {
|
|
374
|
+
[id: string]: () => void;
|
|
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
|
+
};
|
|
390
|
+
};
|
|
391
|
+
_hide?: boolean;
|
|
392
|
+
_validators?: ValidatorFn[];
|
|
393
|
+
_asyncValidators?: AsyncValidatorFn[];
|
|
394
|
+
_componentRefs?: (ComponentRef<FieldType> | EmbeddedViewRef<FieldType>)[];
|
|
395
|
+
_proxyInstance?: FormlyExtension;
|
|
396
|
+
_keyPath?: {
|
|
397
|
+
key: FormlyFieldConfig['key'];
|
|
398
|
+
path: string[];
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
interface FormlyFormOptionsCache extends FormlyFormOptions {
|
|
402
|
+
checkExpressions?: (field: FormlyFieldConfig, ingoreCache?: boolean) => void;
|
|
403
|
+
_viewContainerRef?: ViewContainerRef;
|
|
404
|
+
_injector?: Injector;
|
|
405
|
+
_hiddenFieldsForCheck?: {
|
|
406
|
+
field: FormlyFieldConfigCache;
|
|
407
|
+
default?: boolean;
|
|
408
|
+
emitEvent?: boolean;
|
|
409
|
+
}[];
|
|
410
|
+
_initialModel?: any;
|
|
411
|
+
_detectChanges?: (field: FormlyFieldConfig) => void;
|
|
412
|
+
}
|
|
413
|
+
|
|
1
414
|
/**
|
|
2
|
-
*
|
|
415
|
+
* Maintains list of formly config options. This can be used to register new field type.
|
|
3
416
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
417
|
+
declare class FormlyConfig {
|
|
418
|
+
types: {
|
|
419
|
+
[name: string]: TypeOption;
|
|
420
|
+
};
|
|
421
|
+
validators: {
|
|
422
|
+
[name: string]: ValidatorOption;
|
|
423
|
+
};
|
|
424
|
+
wrappers: {
|
|
425
|
+
[name: string]: WrapperOption;
|
|
426
|
+
};
|
|
427
|
+
messages: {
|
|
428
|
+
[name: string]: ValidationMessageOption['message'];
|
|
429
|
+
};
|
|
430
|
+
extras: NonNullable<ConfigOption['extras']>;
|
|
431
|
+
extensions: {
|
|
432
|
+
[name: string]: FormlyExtension;
|
|
433
|
+
};
|
|
434
|
+
presets: {
|
|
435
|
+
[name: string]: FormlyFieldConfig | FormlyFieldConfigPresetProvider;
|
|
436
|
+
};
|
|
437
|
+
private extensionsByPriority;
|
|
438
|
+
private componentRefs;
|
|
439
|
+
addConfig(config: ConfigOption | ConfigOption[]): void;
|
|
440
|
+
/**
|
|
441
|
+
* Allows you to specify a custom type which you can use in your field configuration.
|
|
442
|
+
* You can pass an object of options, or an array of objects of options.
|
|
443
|
+
*/
|
|
444
|
+
setType(options: TypeOption | TypeOption[]): void;
|
|
445
|
+
getType(name: FormlyFieldConfig['type'], throwIfNotFound?: boolean): TypeOption;
|
|
446
|
+
/** @ignore */
|
|
447
|
+
getMergedField(field?: FormlyFieldConfig): any;
|
|
448
|
+
/** @ignore @internal */
|
|
449
|
+
resolveFieldTypeRef(field?: FormlyFieldConfigCache): ComponentRef<FieldType>;
|
|
450
|
+
/** @ignore @internal */
|
|
451
|
+
clearRefs(): void;
|
|
452
|
+
setWrapper(options: WrapperOption): void;
|
|
453
|
+
getWrapper(name: string | Type<FieldWrapper>): WrapperOption;
|
|
454
|
+
/** @ignore */
|
|
455
|
+
setTypeWrapper(type: string, name: string): void;
|
|
456
|
+
setValidator(options: ValidatorOption): void;
|
|
457
|
+
getValidator(name: string): ValidatorOption;
|
|
458
|
+
addValidatorMessage(name: string, message: ValidationMessageOption['message']): void;
|
|
459
|
+
getValidatorMessage(name: string): string | ((error: any, field: FormlyFieldConfig) => string | rxjs.Observable<string>);
|
|
460
|
+
private setSortedExtensions;
|
|
461
|
+
private mergeExtendedType;
|
|
462
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyConfig, never>;
|
|
463
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormlyConfig>;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* An InjectionToken for registering additional formly config options (types, wrappers ...).
|
|
468
|
+
*/
|
|
469
|
+
declare const FORMLY_CONFIG: InjectionToken<ConfigOption[]>;
|
|
470
|
+
declare function withFormlyFieldExpression(): ConfigOption;
|
|
471
|
+
declare const provideFormlyCore: (configs?: ConfigOption | ConfigOption[]) => Provider;
|
|
472
|
+
declare const provideFormlyConfig: (configs?: ConfigOption | ConfigOption[]) => Provider;
|
|
473
|
+
|
|
474
|
+
declare class FormlyFormBuilder {
|
|
475
|
+
private config;
|
|
476
|
+
private injector;
|
|
477
|
+
private viewContainerRef;
|
|
478
|
+
private parentForm;
|
|
479
|
+
constructor(config: FormlyConfig, injector: Injector, viewContainerRef: ViewContainerRef, parentForm: FormGroupDirective, configs?: ConfigOption[]);
|
|
480
|
+
buildForm(form: UntypedFormGroup | UntypedFormArray, fieldGroup: FormlyFieldConfig[], model: any, options: FormlyFormOptions): void;
|
|
481
|
+
build(field: FormlyFieldConfig): void;
|
|
482
|
+
private _build;
|
|
483
|
+
private _setOptions;
|
|
484
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFormBuilder, [null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
485
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormlyFormBuilder>;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
declare class FormlyTemplate implements OnChanges {
|
|
489
|
+
ref: TemplateRef<any>;
|
|
490
|
+
name: string;
|
|
491
|
+
constructor(ref: TemplateRef<any>);
|
|
492
|
+
ngOnChanges(): void;
|
|
493
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyTemplate, never>;
|
|
494
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormlyTemplate, "[formlyTemplate]", never, { "name": { "alias": "formlyTemplate"; "required": false; }; }, {}, never, never, true, never>;
|
|
495
|
+
}
|
|
496
|
+
declare class LegacyFormlyTemplate extends FormlyTemplate {
|
|
497
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyTemplate, never>;
|
|
498
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LegacyFormlyTemplate, "[formlyTemplate]", never, {}, {}, never, never, false, never>;
|
|
499
|
+
}
|
|
500
|
+
declare class FormlyFieldTemplates {
|
|
501
|
+
templates: QueryList<FormlyTemplate>;
|
|
502
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldTemplates, never>;
|
|
503
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormlyFieldTemplates>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The `<form-form>` component is the main container of the form,
|
|
508
|
+
* which takes care of managing the form state
|
|
509
|
+
* and delegates the rendering of each field to `<formly-field>` component.
|
|
510
|
+
*/
|
|
511
|
+
declare class FormlyForm implements DoCheck, OnChanges, OnDestroy {
|
|
512
|
+
private builder;
|
|
513
|
+
private config;
|
|
514
|
+
private ngZone;
|
|
515
|
+
protected fieldTemplates: FormlyFieldTemplates;
|
|
516
|
+
/** The form instance which allow to track model value and validation status. */
|
|
517
|
+
set form(form: UntypedFormGroup | UntypedFormArray);
|
|
518
|
+
get form(): UntypedFormGroup | UntypedFormArray;
|
|
519
|
+
/** The model to be represented by the form. */
|
|
520
|
+
set model(model: any);
|
|
521
|
+
get model(): any;
|
|
522
|
+
/** The field configurations for building the form. */
|
|
523
|
+
set fields(fieldGroup: FormlyFieldConfig[]);
|
|
524
|
+
get fields(): FormlyFieldConfig[];
|
|
525
|
+
/** Options for the form. */
|
|
526
|
+
set options(options: FormlyFormOptions);
|
|
527
|
+
get options(): FormlyFormOptions;
|
|
528
|
+
/** Event that is emitted when the model value is changed */
|
|
529
|
+
modelChange: EventEmitter<any>;
|
|
530
|
+
set templates(templates: QueryList<FormlyTemplate>);
|
|
531
|
+
field: FormlyFieldConfigCache;
|
|
532
|
+
private _modelChangeValue;
|
|
533
|
+
private valueChangesUnsubscribe;
|
|
534
|
+
constructor(builder: FormlyFormBuilder, config: FormlyConfig, ngZone: NgZone, fieldTemplates: FormlyFieldTemplates);
|
|
535
|
+
ngDoCheck(): void;
|
|
536
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
537
|
+
ngOnDestroy(): void;
|
|
538
|
+
private checkExpressionChange;
|
|
539
|
+
private valueChanges;
|
|
540
|
+
private setField;
|
|
541
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyForm, never>;
|
|
542
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyForm, "formly-form", never, { "form": { "alias": "form"; "required": false; }; "model": { "alias": "model"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "modelChange": "modelChange"; }, ["templates"], never, true, never>;
|
|
543
|
+
}
|
|
544
|
+
declare class LegacyFormlyForm extends FormlyForm {
|
|
545
|
+
set templates(templates: QueryList<FormlyTemplate>);
|
|
546
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyForm, never>;
|
|
547
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyForm, "formly-form", never, {}, {}, ["templates"], never, false, never>;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* The `<formly-field>` component is used to render the UI widget (layout + type) of a given `field`.
|
|
552
|
+
*/
|
|
553
|
+
declare class FormlyField implements DoCheck, OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy {
|
|
554
|
+
private config;
|
|
555
|
+
private renderer;
|
|
556
|
+
private _elementRef;
|
|
557
|
+
private hostContainerRef;
|
|
558
|
+
private injector;
|
|
559
|
+
private form;
|
|
560
|
+
/** The field config. */
|
|
561
|
+
field: FormlyFieldConfig;
|
|
562
|
+
viewContainerRef: ViewContainerRef;
|
|
563
|
+
private hostObservers;
|
|
564
|
+
private componentRefs;
|
|
565
|
+
private hooksObservers;
|
|
566
|
+
private detectFieldBuild;
|
|
567
|
+
private get containerRef();
|
|
568
|
+
private get elementRef();
|
|
569
|
+
valueChangesUnsubscribe: () => void;
|
|
570
|
+
constructor(config: FormlyConfig, renderer: Renderer2, _elementRef: ElementRef, hostContainerRef: ViewContainerRef, injector: Injector, form: FormlyFieldTemplates);
|
|
571
|
+
ngAfterContentInit(): void;
|
|
572
|
+
ngAfterViewInit(): void;
|
|
573
|
+
ngDoCheck(): void;
|
|
574
|
+
ngOnInit(): void;
|
|
575
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
576
|
+
ngOnDestroy(): void;
|
|
577
|
+
private renderField;
|
|
578
|
+
private triggerHook;
|
|
579
|
+
attachLocalField(field?: FormlyFieldConfigCache, previousField?: FormlyFieldConfigCache): void;
|
|
580
|
+
private createFieldInjector;
|
|
581
|
+
private attachComponentRef;
|
|
582
|
+
private render;
|
|
583
|
+
private resetRefs;
|
|
584
|
+
private fieldChanges;
|
|
585
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyField, [null, null, null, null, null, { optional: true; }]>;
|
|
586
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyField, "formly-field", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
|
|
587
|
+
}
|
|
588
|
+
declare class LegacyFormlyField extends FormlyField {
|
|
589
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyField, never>;
|
|
590
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyField, "formly-field", never, {}, {}, never, never, false, never>;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Allow to link the `field` HTML attributes (`id`, `name` ...) and Event attributes (`focus`, `blur` ...) to an element in the DOM.
|
|
595
|
+
*/
|
|
596
|
+
declare class FormlyAttributes implements OnChanges, DoCheck, OnDestroy {
|
|
597
|
+
private renderer;
|
|
598
|
+
private elementRef;
|
|
599
|
+
private formlyField?;
|
|
600
|
+
/** The field config. */
|
|
601
|
+
field: FormlyFieldConfig;
|
|
602
|
+
id: string;
|
|
603
|
+
private document;
|
|
604
|
+
private uiAttributesCache;
|
|
605
|
+
private uiAttributes;
|
|
606
|
+
private focusObserver;
|
|
607
|
+
/**
|
|
608
|
+
* HostBinding doesn't register listeners conditionally which may produce some perf issues.
|
|
609
|
+
*
|
|
610
|
+
* Formly issue: https://github.com/ngx-formly/ngx-formly/issues/1991
|
|
611
|
+
*/
|
|
612
|
+
private uiEvents;
|
|
613
|
+
private get props();
|
|
614
|
+
private get fieldAttrElements();
|
|
615
|
+
constructor(renderer: Renderer2, elementRef: ElementRef, _document: any, formlyField?: FormlyField);
|
|
616
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
617
|
+
/**
|
|
618
|
+
* We need to re-evaluate all the attributes on every change detection cycle, because
|
|
619
|
+
* by using a HostBinding we run into certain edge cases. This means that whatever logic
|
|
620
|
+
* is in here has to be super lean or we risk seriously damaging or destroying the performance.
|
|
621
|
+
*
|
|
622
|
+
* Formly issue: https://github.com/ngx-formly/ngx-formly/issues/1317
|
|
623
|
+
* Material issue: https://github.com/angular/components/issues/14024
|
|
624
|
+
*/
|
|
625
|
+
ngDoCheck(): void;
|
|
626
|
+
ngOnDestroy(): void;
|
|
627
|
+
toggleFocus(value: boolean): void;
|
|
628
|
+
onFocus($event: any): void;
|
|
629
|
+
onBlur($event: any): void;
|
|
630
|
+
onHostChange($event: any): void;
|
|
631
|
+
onChange($event: any): void;
|
|
632
|
+
private attachElementRef;
|
|
633
|
+
private detachElementRef;
|
|
634
|
+
private getSafeAttributeValue;
|
|
635
|
+
private setAttribute;
|
|
636
|
+
private removeAttribute;
|
|
637
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyAttributes, [null, null, null, { optional: true; }]>;
|
|
638
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormlyAttributes, "[formlyAttributes]", never, { "field": { "alias": "formlyAttributes"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, {}, never, never, true, never>;
|
|
639
|
+
}
|
|
640
|
+
declare class LegacyFormlyAttributes extends FormlyAttributes {
|
|
641
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyAttributes, never>;
|
|
642
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LegacyFormlyAttributes, "[formlyAttributes]", never, {}, {}, never, never, false, never>;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/** @ignore */
|
|
646
|
+
declare class FormlyGroup extends FieldType<FieldGroupTypeConfig> {
|
|
647
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyGroup, never>;
|
|
648
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyGroup, "formly-group", never, {}, {}, never, ["*"], false, never>;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* The `<formly-validation-message>` component renders the error message of a given `field`.
|
|
653
|
+
*/
|
|
654
|
+
declare class FormlyValidationMessage implements OnChanges {
|
|
655
|
+
private config;
|
|
656
|
+
/** The field config. */
|
|
657
|
+
field: FormlyFieldConfig;
|
|
658
|
+
errorMessage$: Observable<string>;
|
|
659
|
+
constructor(config: FormlyConfig);
|
|
660
|
+
ngOnChanges(): void;
|
|
661
|
+
get errorMessage(): string | Observable<string>;
|
|
662
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyValidationMessage, never>;
|
|
663
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyValidationMessage, "formly-validation-message", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
|
|
664
|
+
}
|
|
665
|
+
declare class LegacyFormlyValidationMessage extends FormlyValidationMessage {
|
|
666
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyValidationMessage, never>;
|
|
667
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyValidationMessage, "formly-validation-message", never, {}, {}, never, never, false, never>;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
interface FieldArrayTypeConfig<T = FormlyFieldConfig['props']> extends FormlyFieldConfig<T> {
|
|
671
|
+
formControl: UntypedFormArray;
|
|
672
|
+
props: NonNullable<T>;
|
|
673
|
+
}
|
|
674
|
+
declare abstract class FieldArrayType<F extends FormlyFieldConfig = FieldArrayTypeConfig> extends FieldType<F> implements FormlyExtension<F> {
|
|
675
|
+
onPopulate(field: F): void;
|
|
676
|
+
add(i?: number, initialModel?: any, { markAsDirty }?: {
|
|
677
|
+
markAsDirty: boolean;
|
|
678
|
+
}): void;
|
|
679
|
+
remove(i: number, { markAsDirty }?: {
|
|
680
|
+
markAsDirty: boolean;
|
|
681
|
+
}): void;
|
|
682
|
+
private _build;
|
|
683
|
+
private updateArrayElementKey;
|
|
684
|
+
private markFieldForCheck;
|
|
685
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldArrayType<any>, never>;
|
|
686
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FieldArrayType<any>, never, never, {}, {}, never, never, true, never>;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/** @ignore */
|
|
690
|
+
declare class FormlyTemplateType extends FieldType {
|
|
691
|
+
private sanitizer;
|
|
692
|
+
get template(): SafeHtml;
|
|
693
|
+
private innerHtml;
|
|
694
|
+
constructor(sanitizer: DomSanitizer);
|
|
695
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyTemplateType, never>;
|
|
696
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyTemplateType, "formly-template", never, {}, {}, never, never, false, never>;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Registers Formly components and configuration for NgModule-based applications.
|
|
701
|
+
*
|
|
702
|
+
* `forRoot()` provides the shared `FormlyConfig` at the application root, while
|
|
703
|
+
* `forChild()` adds feature configuration using the inherited service. This follows
|
|
704
|
+
* Angular's [root/child module registration convention](https://frontendatlas.com/angular/trivia/angular-forroot-forchild).
|
|
705
|
+
*/
|
|
706
|
+
declare class FormlyModule {
|
|
707
|
+
static forRoot(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
|
|
708
|
+
static forChild(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
|
|
709
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyModule, never>;
|
|
710
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlyModule, [typeof LegacyFormlyTemplate, typeof LegacyFormlyForm, typeof LegacyFormlyField, typeof LegacyFormlyAttributes, typeof LegacyFormlyValidationMessage, typeof FormlyGroup, typeof FormlyTemplateType], [typeof i8.CommonModule], [typeof LegacyFormlyTemplate, typeof LegacyFormlyForm, typeof LegacyFormlyField, typeof LegacyFormlyAttributes, typeof LegacyFormlyValidationMessage, typeof FormlyGroup]>;
|
|
711
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormlyModule>;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
declare function hasKey(field: FormlyFieldConfig): boolean;
|
|
715
|
+
declare function getFieldValue(field: FormlyFieldConfig): any;
|
|
716
|
+
declare function reverseDeepMerge(dest: any, ...args: any[]): any;
|
|
717
|
+
declare function clone(value: any): any;
|
|
718
|
+
declare function defineHiddenProp(field: any, prop: string, defaultValue: any): void;
|
|
719
|
+
type IObserveFn<T> = (change: {
|
|
720
|
+
currentValue: T;
|
|
721
|
+
previousValue?: T;
|
|
722
|
+
firstChange: boolean;
|
|
723
|
+
}) => void;
|
|
724
|
+
interface IObserver<T> {
|
|
725
|
+
setValue: (value: T, emitEvent?: boolean) => void;
|
|
726
|
+
unsubscribe: () => void;
|
|
727
|
+
}
|
|
728
|
+
interface IObserveTarget<T> {
|
|
729
|
+
[prop: string]: any;
|
|
730
|
+
_observers?: {
|
|
731
|
+
[prop: string]: {
|
|
732
|
+
value: T;
|
|
733
|
+
onChange: IObserveFn<T>[];
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
declare function observe<T = any>(o: IObserveTarget<T>, paths: string[], setFn?: IObserveFn<T>): IObserver<T>;
|
|
738
|
+
|
|
739
|
+
export { FORMLY_CONFIG, FieldArrayType, FieldType, FieldWrapper, FormlyAttributes, FormlyConfig, FormlyField, FormlyForm, FormlyFormBuilder, FormlyModule, FormlyTemplate, FormlyValidationMessage, LegacyFormlyAttributes, LegacyFormlyField, LegacyFormlyForm, LegacyFormlyValidationMessage, provideFormlyConfig, provideFormlyCore, withFormlyFieldExpression, FormlyGroup as ɵFormlyGroup, LegacyFormlyTemplate as ɵFormlyTemplate, clone as ɵclone, defineHiddenProp as ɵdefineHiddenProp, getFieldValue as ɵgetFieldValue, hasKey as ɵhasKey, observe as ɵobserve, reverseDeepMerge as ɵreverseDeepMerge };
|
|
740
|
+
export type { ConfigOption, FieldArrayTypeConfig, FieldGroupTypeConfig, FieldTypeConfig, FormlyAttributeEvent, FormlyExtension, FormlyFieldConfig, FormlyFieldConfigPresetProvider, FormlyFieldProps, FormlyFormOptions, FormlyTemplateOptions, ValidationMessageOption };
|