@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/json-schema/index.d.ts
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
|
|
5
|
+
interface FormlyJsonschemaOptions {
|
|
6
|
+
/**
|
|
7
|
+
* allows to intercept the mapping, taking the already mapped
|
|
8
|
+
* formly field and the original JSONSchema source from which it
|
|
9
|
+
* was mapped.
|
|
10
|
+
*/
|
|
11
|
+
map?: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => FormlyFieldConfig;
|
|
12
|
+
}
|
|
13
|
+
declare class FormlyJsonschema {
|
|
14
|
+
toFieldConfig(schema: JSONSchema7, options?: FormlyJsonschemaOptions): FormlyFieldConfig;
|
|
15
|
+
private _toFieldConfig;
|
|
16
|
+
private resolveSchema;
|
|
17
|
+
private resolveAllOf;
|
|
18
|
+
private resolveMultiSchema;
|
|
19
|
+
private createMultiSchemaField;
|
|
20
|
+
private ensureMultiSchemaField;
|
|
21
|
+
private getSchemaField;
|
|
22
|
+
private isRecursiveMultiSchema;
|
|
23
|
+
private getDefinition;
|
|
24
|
+
private resolveDefinition;
|
|
25
|
+
private resolveDependencies;
|
|
26
|
+
private extractIfCondition;
|
|
27
|
+
private resolveIfThenElse;
|
|
28
|
+
private resolveConditionalSchema;
|
|
29
|
+
private guessSchemaType;
|
|
30
|
+
private addValidator;
|
|
31
|
+
private isEnum;
|
|
32
|
+
private toEnumOptions;
|
|
33
|
+
private isFieldValid;
|
|
34
|
+
private mergeFields;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyJsonschema, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormlyJsonschema>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { FormlyJsonschema };
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngx-formly/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2.0.0"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@angular/forms": ">=
|
|
9
|
+
"@angular/forms": ">=20.0.0",
|
|
10
10
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "fesm2022/ngx-formly-core.mjs",
|
package/preset/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Provider } from '@angular/core';
|
|
3
|
+
import * as i1 from '@ngx-formly/core';
|
|
4
|
+
|
|
5
|
+
declare class FormlyPresetModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyPresetModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlyPresetModule, never, [typeof i1.FormlyModule], never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormlyPresetModule>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare function provideFormlyPreset(): Provider;
|
|
12
|
+
|
|
13
|
+
export { FormlyPresetModule, provideFormlyPreset };
|
package/select/index.d.ts
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { PipeTransform, OnDestroy } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { FormlyFieldProps, FormlyFieldConfig } from '@ngx-formly/core';
|
|
5
|
+
|
|
6
|
+
interface FormlySelectOption {
|
|
7
|
+
label: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
value?: any;
|
|
10
|
+
group?: FormlySelectOption[];
|
|
11
|
+
}
|
|
12
|
+
interface FormlyFieldSelectProps extends FormlyFieldProps {
|
|
13
|
+
groupProp?: string | ((option: any) => string);
|
|
14
|
+
labelProp?: string | ((option: any) => string);
|
|
15
|
+
valueProp?: string | ((option: any) => any);
|
|
16
|
+
disabledProp?: string | ((option: any) => boolean);
|
|
17
|
+
mapProp?: (option: any) => FormlySelectOption;
|
|
18
|
+
}
|
|
19
|
+
declare class FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
|
|
20
|
+
private _subscription;
|
|
21
|
+
private _options;
|
|
22
|
+
transform(options: any, field?: FormlyFieldConfig): Observable<FormlySelectOption[]>;
|
|
23
|
+
ngOnDestroy(): void;
|
|
24
|
+
private transformOptions;
|
|
25
|
+
private transformOption;
|
|
26
|
+
private transformSelectProps;
|
|
27
|
+
private dispose;
|
|
28
|
+
private observableOf;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlySelectOptionsPipe, never>;
|
|
30
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<FormlySelectOptionsPipe, "formlySelectOptions", true>;
|
|
31
|
+
}
|
|
32
|
+
declare class LegacyFormlySelectOptionsPipe extends FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlySelectOptionsPipe, never>;
|
|
34
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<LegacyFormlySelectOptionsPipe, "formlySelectOptions", false>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class FormlySelectModule {
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlySelectModule, never>;
|
|
39
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlySelectModule, [typeof LegacyFormlySelectOptionsPipe], never, [typeof LegacyFormlySelectOptionsPipe]>;
|
|
40
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormlySelectModule>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { FormlySelectModule, FormlySelectOptionsPipe, LegacyFormlySelectOptionsPipe };
|
|
44
|
+
export type { FormlyFieldSelectProps, FormlySelectOption };
|
package/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
import { NgModule, DebugElement } from '@angular/core';
|
|
3
|
+
import { ConfigOption, FormlyFieldConfig } from '@ngx-formly/core';
|
|
4
|
+
|
|
5
|
+
interface IComponentOptions<T> extends NgModule {
|
|
6
|
+
template?: string;
|
|
7
|
+
inputs?: T;
|
|
8
|
+
config?: ConfigOption;
|
|
9
|
+
detectChanges?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface IFormlyDebugElement<E> extends DebugElement {
|
|
12
|
+
readonly nativeElement: E;
|
|
13
|
+
}
|
|
14
|
+
declare function createComponent<T>({ template, inputs, config, detectChanges, imports, declarations, providers, }: IComponentOptions<T>): T & {
|
|
15
|
+
fixture: ComponentFixture<T>;
|
|
16
|
+
detectChanges: (checkNoChanges?: boolean) => void;
|
|
17
|
+
setInputs: (inputs: Partial<T>) => void;
|
|
18
|
+
query: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>;
|
|
19
|
+
queryAll: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>[];
|
|
20
|
+
};
|
|
21
|
+
declare function createFieldComponent(field: FormlyFieldConfig, config?: IComponentOptions<{
|
|
22
|
+
field: FormlyFieldConfig;
|
|
23
|
+
}>): {
|
|
24
|
+
field: FormlyFieldConfig;
|
|
25
|
+
} & {
|
|
26
|
+
fixture: ComponentFixture<{
|
|
27
|
+
field: FormlyFieldConfig;
|
|
28
|
+
}>;
|
|
29
|
+
detectChanges: (checkNoChanges?: boolean) => void;
|
|
30
|
+
setInputs: (inputs: Partial<{
|
|
31
|
+
field: FormlyFieldConfig;
|
|
32
|
+
}>) => void;
|
|
33
|
+
query: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>;
|
|
34
|
+
queryAll: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>[];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { createComponent, createFieldComponent };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FormlyFieldConfig } from '@ngx-formly/core';
|
|
2
|
-
import { JSONSchema7 } from 'json-schema';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export interface FormlyJsonschemaOptions {
|
|
5
|
-
/**
|
|
6
|
-
* allows to intercept the mapping, taking the already mapped
|
|
7
|
-
* formly field and the original JSONSchema source from which it
|
|
8
|
-
* was mapped.
|
|
9
|
-
*/
|
|
10
|
-
map?: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => FormlyFieldConfig;
|
|
11
|
-
}
|
|
12
|
-
export declare class FormlyJsonschema {
|
|
13
|
-
toFieldConfig(schema: JSONSchema7, options?: FormlyJsonschemaOptions): FormlyFieldConfig;
|
|
14
|
-
private _toFieldConfig;
|
|
15
|
-
private resolveSchema;
|
|
16
|
-
private resolveAllOf;
|
|
17
|
-
private resolveMultiSchema;
|
|
18
|
-
private createMultiSchemaField;
|
|
19
|
-
private ensureMultiSchemaField;
|
|
20
|
-
private getSchemaField;
|
|
21
|
-
private isRecursiveMultiSchema;
|
|
22
|
-
private getDefinition;
|
|
23
|
-
private resolveDefinition;
|
|
24
|
-
private resolveDependencies;
|
|
25
|
-
private extractIfCondition;
|
|
26
|
-
private resolveIfThenElse;
|
|
27
|
-
private resolveConditionalSchema;
|
|
28
|
-
private guessSchemaType;
|
|
29
|
-
private addValidator;
|
|
30
|
-
private isEnum;
|
|
31
|
-
private toEnumOptions;
|
|
32
|
-
private isFieldValid;
|
|
33
|
-
private mergeFields;
|
|
34
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyJsonschema, never>;
|
|
35
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<FormlyJsonschema>;
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FormlyJsonschema } from './formly-json-schema.service';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ViewContainerRef, SimpleChanges, DoCheck, OnInit, OnChanges, OnDestroy, AfterContentInit, AfterViewInit, Renderer2, ElementRef, Injector } from '@angular/core';
|
|
2
|
-
import { FormlyConfig } from '../services/formly.config';
|
|
3
|
-
import { FormlyFieldConfig, FormlyFieldConfigCache } from '../models';
|
|
4
|
-
import { FormlyFieldTemplates } from './formly.template';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* The `<formly-field>` component is used to render the UI widget (layout + type) of a given `field`.
|
|
8
|
-
*/
|
|
9
|
-
export declare class FormlyField implements DoCheck, OnInit, OnChanges, AfterContentInit, AfterViewInit, OnDestroy {
|
|
10
|
-
private config;
|
|
11
|
-
private renderer;
|
|
12
|
-
private _elementRef;
|
|
13
|
-
private hostContainerRef;
|
|
14
|
-
private injector;
|
|
15
|
-
private form;
|
|
16
|
-
/** The field config. */
|
|
17
|
-
field: FormlyFieldConfig;
|
|
18
|
-
viewContainerRef: ViewContainerRef;
|
|
19
|
-
private hostObservers;
|
|
20
|
-
private componentRefs;
|
|
21
|
-
private hooksObservers;
|
|
22
|
-
private detectFieldBuild;
|
|
23
|
-
private get containerRef();
|
|
24
|
-
private get elementRef();
|
|
25
|
-
valueChangesUnsubscribe: () => void;
|
|
26
|
-
constructor(config: FormlyConfig, renderer: Renderer2, _elementRef: ElementRef, hostContainerRef: ViewContainerRef, injector: Injector, form: FormlyFieldTemplates);
|
|
27
|
-
ngAfterContentInit(): void;
|
|
28
|
-
ngAfterViewInit(): void;
|
|
29
|
-
ngDoCheck(): void;
|
|
30
|
-
ngOnInit(): void;
|
|
31
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
32
|
-
ngOnDestroy(): void;
|
|
33
|
-
private renderField;
|
|
34
|
-
private triggerHook;
|
|
35
|
-
attachLocalField(field?: FormlyFieldConfigCache, previousField?: FormlyFieldConfigCache): void;
|
|
36
|
-
private createFieldInjector;
|
|
37
|
-
private attachComponentRef;
|
|
38
|
-
private render;
|
|
39
|
-
private resetRefs;
|
|
40
|
-
private fieldChanges;
|
|
41
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyField, [null, null, null, null, null, { optional: true; }]>;
|
|
42
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyField, "formly-field", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
|
|
43
|
-
}
|
|
44
|
-
export declare class LegacyFormlyField extends FormlyField {
|
|
45
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyField, never>;
|
|
46
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyField, "formly-field", never, {}, {}, never, never, false, never>;
|
|
47
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { DoCheck, OnChanges, SimpleChanges, EventEmitter, OnDestroy, NgZone, QueryList } from '@angular/core';
|
|
2
|
-
import { UntypedFormGroup, UntypedFormArray } from '@angular/forms';
|
|
3
|
-
import { FormlyFieldConfig, FormlyFormOptions, FormlyFieldConfigCache } from '../models';
|
|
4
|
-
import { FormlyFormBuilder } from '../services/formly.builder';
|
|
5
|
-
import { FormlyConfig } from '../services/formly.config';
|
|
6
|
-
import { FormlyFieldTemplates, FormlyTemplate } from './formly.template';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* The `<form-form>` component is the main container of the form,
|
|
10
|
-
* which takes care of managing the form state
|
|
11
|
-
* and delegates the rendering of each field to `<formly-field>` component.
|
|
12
|
-
*/
|
|
13
|
-
export declare class FormlyForm implements DoCheck, OnChanges, OnDestroy {
|
|
14
|
-
private builder;
|
|
15
|
-
private config;
|
|
16
|
-
private ngZone;
|
|
17
|
-
protected fieldTemplates: FormlyFieldTemplates;
|
|
18
|
-
/** The form instance which allow to track model value and validation status. */
|
|
19
|
-
set form(form: UntypedFormGroup | UntypedFormArray);
|
|
20
|
-
get form(): UntypedFormGroup | UntypedFormArray;
|
|
21
|
-
/** The model to be represented by the form. */
|
|
22
|
-
set model(model: any);
|
|
23
|
-
get model(): any;
|
|
24
|
-
/** The field configurations for building the form. */
|
|
25
|
-
set fields(fieldGroup: FormlyFieldConfig[]);
|
|
26
|
-
get fields(): FormlyFieldConfig[];
|
|
27
|
-
/** Options for the form. */
|
|
28
|
-
set options(options: FormlyFormOptions);
|
|
29
|
-
get options(): FormlyFormOptions;
|
|
30
|
-
/** Event that is emitted when the model value is changed */
|
|
31
|
-
modelChange: EventEmitter<any>;
|
|
32
|
-
set templates(templates: QueryList<FormlyTemplate>);
|
|
33
|
-
field: FormlyFieldConfigCache;
|
|
34
|
-
private _modelChangeValue;
|
|
35
|
-
private valueChangesUnsubscribe;
|
|
36
|
-
constructor(builder: FormlyFormBuilder, config: FormlyConfig, ngZone: NgZone, fieldTemplates: FormlyFieldTemplates);
|
|
37
|
-
ngDoCheck(): void;
|
|
38
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
39
|
-
ngOnDestroy(): void;
|
|
40
|
-
private checkExpressionChange;
|
|
41
|
-
private valueChanges;
|
|
42
|
-
private setField;
|
|
43
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyForm, never>;
|
|
44
|
-
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>;
|
|
45
|
-
}
|
|
46
|
-
export declare class LegacyFormlyForm extends FormlyForm {
|
|
47
|
-
set templates(templates: QueryList<FormlyTemplate>);
|
|
48
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyForm, never>;
|
|
49
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyForm, "formly-form", never, {}, {}, ["templates"], never, false, never>;
|
|
50
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { OnChanges, QueryList, TemplateRef } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class FormlyTemplate implements OnChanges {
|
|
4
|
-
ref: TemplateRef<any>;
|
|
5
|
-
name: string;
|
|
6
|
-
constructor(ref: TemplateRef<any>);
|
|
7
|
-
ngOnChanges(): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyTemplate, never>;
|
|
9
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<FormlyTemplate, "[formlyTemplate]", never, { "name": { "alias": "formlyTemplate"; "required": false; }; }, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
11
|
-
export declare class LegacyFormlyTemplate extends FormlyTemplate {
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyTemplate, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<LegacyFormlyTemplate, "[formlyTemplate]", never, {}, {}, never, never, false, never>;
|
|
14
|
-
}
|
|
15
|
-
export declare class FormlyFieldTemplates {
|
|
16
|
-
templates: QueryList<FormlyTemplate>;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldTemplates, never>;
|
|
18
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<FormlyFieldTemplates>;
|
|
19
|
-
}
|
package/lib/core.config.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
-
import { ConfigOption } from './models';
|
|
3
|
-
import { FormlyConfig } from './services/formly.config';
|
|
4
|
-
/**
|
|
5
|
-
* An InjectionToken for registering additional formly config options (types, wrappers ...).
|
|
6
|
-
*/
|
|
7
|
-
export declare const FORMLY_CONFIG: InjectionToken<ConfigOption[]>;
|
|
8
|
-
export declare function withDefaultConfig(config: FormlyConfig): ConfigOption;
|
|
9
|
-
export declare function withFormlyFieldExpression(): ConfigOption;
|
|
10
|
-
export declare const provideFormlyCore: (configs?: ConfigOption | ConfigOption[]) => Provider;
|
|
11
|
-
export declare const provideFormlyConfig: (configs?: ConfigOption | ConfigOption[]) => Provider;
|
package/lib/core.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export { provideFormlyCore, provideFormlyConfig, FORMLY_CONFIG, withFormlyFieldExpression } from './core.config';
|
|
2
|
-
export { LegacyFormlyForm, FormlyForm } from './components/formly.form';
|
|
3
|
-
export { FormlyFieldConfig, FormlyTemplateOptions, FormlyFormOptions, FormlyFieldProps, ConfigOption, FormlyExtension, FormlyFieldConfigPresetProvider, FormlyAttributeEvent, ValidationMessageOption, } from './models';
|
|
4
|
-
export { LegacyFormlyField, FormlyField } from './components/formly.field';
|
|
5
|
-
export { LegacyFormlyAttributes, FormlyAttributes } from './templates/formly.attributes';
|
|
6
|
-
export { FormlyGroup as ɵFormlyGroup } from './templates/formly.group';
|
|
7
|
-
export { FormlyTemplate, LegacyFormlyTemplate as ɵFormlyTemplate } from './components/formly.template';
|
|
8
|
-
export { LegacyFormlyValidationMessage, FormlyValidationMessage } from './templates/formly.validation-message';
|
|
9
|
-
export { FormlyConfig } from './services/formly.config';
|
|
10
|
-
export { FormlyFormBuilder } from './services/formly.builder';
|
|
11
|
-
export { FieldType, FieldTypeConfig, FieldGroupTypeConfig } from './templates/field.type';
|
|
12
|
-
export { FieldArrayType, FieldArrayTypeConfig } from './templates/field-array.type';
|
|
13
|
-
export { FieldWrapper } from './templates/field.wrapper';
|
|
14
|
-
export { FormlyModule } from './core.module';
|
|
15
|
-
export { defineHiddenProp as ɵdefineHiddenProp } from './utils';
|
|
16
|
-
export { reverseDeepMerge as ɵreverseDeepMerge } from './utils';
|
|
17
|
-
export { getFieldValue as ɵgetFieldValue } from './utils';
|
|
18
|
-
export { clone as ɵclone } from './utils';
|
|
19
|
-
export { observe as ɵobserve } from './utils';
|
|
20
|
-
export { hasKey as ɵhasKey } from './utils';
|
package/lib/core.module.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { ConfigOption } from './models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./components/formly.template";
|
|
5
|
-
import * as i2 from "./components/formly.form";
|
|
6
|
-
import * as i3 from "./components/formly.field";
|
|
7
|
-
import * as i4 from "./templates/formly.attributes";
|
|
8
|
-
import * as i5 from "./templates/formly.validation-message";
|
|
9
|
-
import * as i6 from "./templates/formly.group";
|
|
10
|
-
import * as i7 from "./templates/field-template.type";
|
|
11
|
-
import * as i8 from "@angular/common";
|
|
12
|
-
/**
|
|
13
|
-
* Registers Formly components and configuration for NgModule-based applications.
|
|
14
|
-
*
|
|
15
|
-
* `forRoot()` provides the shared `FormlyConfig` at the application root, while
|
|
16
|
-
* `forChild()` adds feature configuration using the inherited service. This follows
|
|
17
|
-
* Angular's [root/child module registration convention](https://frontendatlas.com/angular/trivia/angular-forroot-forchild).
|
|
18
|
-
*/
|
|
19
|
-
export declare class FormlyModule {
|
|
20
|
-
static forRoot(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
|
|
21
|
-
static forChild(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyModule, never>;
|
|
23
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlyModule, [typeof i1.LegacyFormlyTemplate, typeof i2.LegacyFormlyForm, typeof i3.LegacyFormlyField, typeof i4.LegacyFormlyAttributes, typeof i5.LegacyFormlyValidationMessage, typeof i6.FormlyGroup, typeof i7.FormlyTemplateType], [typeof i8.CommonModule], [typeof i1.LegacyFormlyTemplate, typeof i2.LegacyFormlyForm, typeof i3.LegacyFormlyField, typeof i4.LegacyFormlyAttributes, typeof i5.LegacyFormlyValidationMessage, typeof i6.FormlyGroup]>;
|
|
24
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<FormlyModule>;
|
|
25
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FormlyConfig } from '../../services/formly.config';
|
|
2
|
-
import { FormlyFieldConfigCache, FormlyExtension } from '../../models';
|
|
3
|
-
export declare class CoreExtension implements FormlyExtension {
|
|
4
|
-
private config;
|
|
5
|
-
private formId;
|
|
6
|
-
constructor(config: FormlyConfig);
|
|
7
|
-
prePopulate(field: FormlyFieldConfigCache): void;
|
|
8
|
-
onPopulate(field: FormlyFieldConfigCache): void;
|
|
9
|
-
postPopulate(field: FormlyFieldConfigCache): void;
|
|
10
|
-
private initFieldProps;
|
|
11
|
-
private initRootOptions;
|
|
12
|
-
private initFieldOptions;
|
|
13
|
-
private getFieldComponentInstance;
|
|
14
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FieldExpressionExtension as FieldExpressionLegacyExtension } from '../field-expression-legacy/field-expression';
|
|
2
|
-
export declare class FieldExpressionExtension extends FieldExpressionLegacyExtension {
|
|
3
|
-
protected _evalStringExpression(expression: string, argNames: string[]): any;
|
|
4
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FormlyFieldConfigCache } from '../../models';
|
|
2
|
-
import { FormlyExtension } from '../../models';
|
|
3
|
-
export declare class FieldExpressionExtension implements FormlyExtension {
|
|
4
|
-
onPopulate(field: FormlyFieldConfigCache): void;
|
|
5
|
-
postPopulate(field: FormlyFieldConfigCache): void;
|
|
6
|
-
protected parseExpressions(field: FormlyFieldConfigCache, path: string, expr: any): {
|
|
7
|
-
callback: (ignoreCache?: boolean) => boolean;
|
|
8
|
-
};
|
|
9
|
-
protected _evalStringExpression(expression: string, argNames: string[]): any;
|
|
10
|
-
private checkExpressions;
|
|
11
|
-
private changeDisabledState;
|
|
12
|
-
private changeHideState;
|
|
13
|
-
private evalExpr;
|
|
14
|
-
private emitExpressionChanges;
|
|
15
|
-
private _evalExpressionPath;
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FormlyExtension, FormlyFieldConfigCache } from '../../models';
|
|
2
|
-
export declare class FieldFormExtension implements FormlyExtension {
|
|
3
|
-
private root;
|
|
4
|
-
prePopulate(field: FormlyFieldConfigCache): void;
|
|
5
|
-
onPopulate(field: FormlyFieldConfigCache): void;
|
|
6
|
-
postPopulate(field: FormlyFieldConfigCache): void;
|
|
7
|
-
private addFormControl;
|
|
8
|
-
private setValidators;
|
|
9
|
-
private hasValidators;
|
|
10
|
-
private mergeValidators;
|
|
11
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AbstractControl } from '@angular/forms';
|
|
2
|
-
import { FormlyFieldConfigCache } from '../../models';
|
|
3
|
-
export declare function unregisterControl(field: FormlyFieldConfigCache, emitEvent?: boolean): void;
|
|
4
|
-
export declare function findControl(field: FormlyFieldConfigCache): AbstractControl;
|
|
5
|
-
export declare function registerControl(field: FormlyFieldConfigCache, control?: FormlyFieldConfigCache['formControl'], emitEvent?: boolean): void;
|
|
6
|
-
export declare function updateValidity(c: AbstractControl, onlySelf?: boolean): void;
|
|
7
|
-
export declare function clearControl(form: FormlyFieldConfigCache['formControl']): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FormlyConfig } from '../../services/formly.config';
|
|
2
|
-
import { FormlyExtension, FormlyFieldConfigCache } from '../../models';
|
|
3
|
-
export declare class FieldValidationExtension implements FormlyExtension {
|
|
4
|
-
private config;
|
|
5
|
-
constructor(config: FormlyConfig);
|
|
6
|
-
onPopulate(field: FormlyFieldConfigCache): void;
|
|
7
|
-
private initFieldValidation;
|
|
8
|
-
private getPredefinedFieldValidation;
|
|
9
|
-
private wrapNgValidatorFn;
|
|
10
|
-
private handleResult;
|
|
11
|
-
}
|
package/lib/models/config.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Type } from '@angular/core';
|
|
2
|
-
import { ValidationErrors, AbstractControl } from '@angular/forms';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { FormlyFieldConfig } from './fieldconfig';
|
|
5
|
-
import { FieldType } from './../templates/field.type';
|
|
6
|
-
import { FieldWrapper } from '../templates/field.wrapper';
|
|
7
|
-
export interface FormlyExtension<F extends FormlyFieldConfig = FormlyFieldConfig> {
|
|
8
|
-
priority?: number;
|
|
9
|
-
prePopulate?(field: F): void;
|
|
10
|
-
onPopulate?(field: F): void;
|
|
11
|
-
postPopulate?(field: F): void;
|
|
12
|
-
}
|
|
13
|
-
export interface TypeOption {
|
|
14
|
-
name: string;
|
|
15
|
-
component?: Type<FieldType>;
|
|
16
|
-
wrappers?: string[];
|
|
17
|
-
extends?: string;
|
|
18
|
-
defaultOptions?: FormlyFieldConfig;
|
|
19
|
-
}
|
|
20
|
-
export interface WrapperOption {
|
|
21
|
-
name: string;
|
|
22
|
-
component: Type<FieldWrapper>;
|
|
23
|
-
types?: string[];
|
|
24
|
-
}
|
|
25
|
-
export type FieldValidatorFn = (c: AbstractControl, field: FormlyFieldConfig, options?: {
|
|
26
|
-
[id: string]: any;
|
|
27
|
-
}) => ValidationErrors | null;
|
|
28
|
-
export interface ValidatorOption {
|
|
29
|
-
name: string;
|
|
30
|
-
validation: FieldValidatorFn;
|
|
31
|
-
options?: {
|
|
32
|
-
[id: string]: any;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface ExtensionOption {
|
|
36
|
-
name: string;
|
|
37
|
-
extension: FormlyExtension;
|
|
38
|
-
priority?: number;
|
|
39
|
-
}
|
|
40
|
-
export interface ValidationMessageOption {
|
|
41
|
-
name: string;
|
|
42
|
-
message: string | ((error: any, field: FormlyFieldConfig) => string | Observable<string>);
|
|
43
|
-
}
|
|
44
|
-
export interface PresetOption {
|
|
45
|
-
name: string;
|
|
46
|
-
config: FormlyFieldConfig | FormlyFieldConfigPresetProvider;
|
|
47
|
-
}
|
|
48
|
-
export interface FormlyFieldConfigPresetProvider {
|
|
49
|
-
getConfiguration: () => FormlyFieldConfig;
|
|
50
|
-
}
|
|
51
|
-
export interface ConfigOption {
|
|
52
|
-
types?: TypeOption[];
|
|
53
|
-
wrappers?: WrapperOption[];
|
|
54
|
-
validators?: ValidatorOption[];
|
|
55
|
-
extensions?: ExtensionOption[];
|
|
56
|
-
validationMessages?: ValidationMessageOption[];
|
|
57
|
-
extras?: {
|
|
58
|
-
immutable?: boolean;
|
|
59
|
-
showError?: (field: FieldType) => boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Defines the option which formly rely on to check field expression properties.
|
|
62
|
-
* - `modelChange`: perform a check when the value of the form control changes.
|
|
63
|
-
* - `changeDetectionCheck`: triggers an immediate check when `ngDoCheck` is called.
|
|
64
|
-
*
|
|
65
|
-
* Defaults to `modelChange`.
|
|
66
|
-
*/
|
|
67
|
-
checkExpressionOn?: 'modelChange' | 'changeDetectionCheck';
|
|
68
|
-
/**
|
|
69
|
-
* Whether to lazily render field components or not when marked as hidden.
|
|
70
|
-
* - `true`: lazily render field components.
|
|
71
|
-
* - `false`: render field components and use CSS to control their visibility.
|
|
72
|
-
*
|
|
73
|
-
* Defaults to `true`.
|
|
74
|
-
*/
|
|
75
|
-
lazyRender?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* When `true`, reset the value of a hidden field.
|
|
78
|
-
*
|
|
79
|
-
* Defaults to `true`.
|
|
80
|
-
*/
|
|
81
|
-
resetFieldOnHide?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Whether to render fields inside <formly-field> component or not.
|
|
84
|
-
*
|
|
85
|
-
* Defaults to `true`.
|
|
86
|
-
*/
|
|
87
|
-
renderFormlyFieldElement?: boolean;
|
|
88
|
-
};
|
|
89
|
-
presets?: PresetOption[];
|
|
90
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ComponentRef, ElementRef, EmbeddedViewRef, Injector, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { AsyncValidatorFn, ValidatorFn, UntypedFormArray, UntypedFormGroup, AbstractControl } from '@angular/forms';
|
|
3
|
-
import { Observable, Subscription } from 'rxjs';
|
|
4
|
-
import { FieldType } from '../templates/field.type';
|
|
5
|
-
import { FormlyExtension } from './config';
|
|
6
|
-
import { FormlyFieldConfig, FormlyFormOptions } from './fieldconfig';
|
|
7
|
-
export interface FormlyFieldConfigCache extends FormlyFieldConfig {
|
|
8
|
-
form?: UntypedFormGroup | UntypedFormArray;
|
|
9
|
-
model?: any;
|
|
10
|
-
formControl?: AbstractControl & {
|
|
11
|
-
_fields?: FormlyFieldConfigCache[];
|
|
12
|
-
_childrenErrors?: {
|
|
13
|
-
[id: string]: () => void;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
parent?: FormlyFieldConfigCache;
|
|
17
|
-
options?: FormlyFormOptionsCache;
|
|
18
|
-
shareFormControl?: boolean;
|
|
19
|
-
index?: number;
|
|
20
|
-
_localFields?: FormlyFieldConfigCache[];
|
|
21
|
-
_elementRefs?: ElementRef[];
|
|
22
|
-
_expressions?: {
|
|
23
|
-
[property: string]: {
|
|
24
|
-
callback?: (ingoreCache: boolean) => boolean;
|
|
25
|
-
paths?: string[];
|
|
26
|
-
subscription?: Subscription | null;
|
|
27
|
-
value$?: Observable<any>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
_hide?: boolean;
|
|
31
|
-
_validators?: ValidatorFn[];
|
|
32
|
-
_asyncValidators?: AsyncValidatorFn[];
|
|
33
|
-
_componentRefs?: (ComponentRef<FieldType> | EmbeddedViewRef<FieldType>)[];
|
|
34
|
-
_proxyInstance?: FormlyExtension;
|
|
35
|
-
_keyPath?: {
|
|
36
|
-
key: FormlyFieldConfig['key'];
|
|
37
|
-
path: string[];
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export interface FormlyFormOptionsCache extends FormlyFormOptions {
|
|
41
|
-
checkExpressions?: (field: FormlyFieldConfig, ingoreCache?: boolean) => void;
|
|
42
|
-
_viewContainerRef?: ViewContainerRef;
|
|
43
|
-
_injector?: Injector;
|
|
44
|
-
_hiddenFieldsForCheck?: {
|
|
45
|
-
field: FormlyFieldConfigCache;
|
|
46
|
-
default?: boolean;
|
|
47
|
-
}[];
|
|
48
|
-
_initialModel?: any;
|
|
49
|
-
_detectChanges?: (field: FormlyFieldConfig) => void;
|
|
50
|
-
}
|