@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
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngx-formly/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.1.0-rc.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": ">=22.0.0",
|
|
10
10
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "fesm2022/ngx-formly-core.mjs",
|
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import { FormlyFieldConfig } from
|
|
2
|
-
import { JSONSchema7 } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
|
|
1
|
+
import { FormlyFieldConfig } from "@ngx-formly/core";
|
|
2
|
+
import { JSONSchema7 } from "json-schema";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
5
4
|
interface FormlyJsonschemaOptions {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Leave required strings without a schema default undefined instead of defaulting to ''.
|
|
7
|
+
* Defaults to false. Explicit schema defaults and other types are unaffected.
|
|
8
|
+
*/
|
|
9
|
+
ignoreImplicitStringDefaults?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* allows to intercept the mapping, taking the already mapped
|
|
12
|
+
* formly field and the original JSONSchema source from which it
|
|
13
|
+
* was mapped.
|
|
14
|
+
*/
|
|
15
|
+
map?: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => FormlyFieldConfig;
|
|
17
16
|
}
|
|
18
|
-
declare class FormlyJsonschema {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
17
|
+
export declare class FormlyJsonschema {
|
|
18
|
+
toFieldConfig(schema: JSONSchema7, options?: FormlyJsonschemaOptions): FormlyFieldConfig;
|
|
19
|
+
private _toFieldConfig;
|
|
20
|
+
private resolveSchema;
|
|
21
|
+
private resolveAllOf;
|
|
22
|
+
private resolveMultiSchema;
|
|
23
|
+
private createMultiSchemaField;
|
|
24
|
+
private ensureMultiSchemaField;
|
|
25
|
+
private getSchemaField;
|
|
26
|
+
private isRecursiveMultiSchema;
|
|
27
|
+
private getDefinition;
|
|
28
|
+
private resolveDefinition;
|
|
29
|
+
private resolveDependencies;
|
|
30
|
+
private extractIfCondition;
|
|
31
|
+
private resolveIfThenElse;
|
|
32
|
+
private resolveConditionalSchema;
|
|
33
|
+
private guessSchemaType;
|
|
34
|
+
private addValidator;
|
|
35
|
+
private isEnum;
|
|
36
|
+
private toEnumOptions;
|
|
37
|
+
private isFieldValid;
|
|
38
|
+
private mergeFields;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyJsonschema, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
export { FormlyJsonschema };
|
|
42
|
+
export {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Provider } from
|
|
3
|
-
import * as i1 from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<FormlyPresetModule>;
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Provider } from "@angular/core";
|
|
3
|
+
import * as i1 from "@ngx-formly/core";
|
|
4
|
+
export declare class FormlyPresetModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyPresetModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlyPresetModule, never, [typeof i1.FormlyModule], never>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormlyPresetModule>;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
declare function provideFormlyPreset(): Provider;
|
|
12
|
-
|
|
13
|
-
export { FormlyPresetModule, provideFormlyPreset };
|
|
9
|
+
export declare function provideFormlyPreset(): Provider;
|
|
@@ -1,44 +1,39 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { Observable } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
group?: FormlySelectOption[];
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { OnDestroy, PipeTransform } from "@angular/core";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
4
|
+
import { FormlyFieldConfig, FormlyFieldProps } from "@ngx-formly/core";
|
|
5
|
+
export interface FormlySelectOption {
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
value?: any;
|
|
9
|
+
group?: FormlySelectOption[];
|
|
11
10
|
}
|
|
12
|
-
interface FormlyFieldSelectProps extends FormlyFieldProps {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export interface FormlyFieldSelectProps extends FormlyFieldProps {
|
|
12
|
+
groupProp?: string | ((option: any) => string);
|
|
13
|
+
labelProp?: string | ((option: any) => string);
|
|
14
|
+
valueProp?: string | ((option: any) => any);
|
|
15
|
+
disabledProp?: string | ((option: any) => boolean);
|
|
16
|
+
mapProp?: (option: any) => FormlySelectOption;
|
|
18
17
|
}
|
|
19
|
-
declare class FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
export declare class FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
|
|
19
|
+
private _subscription;
|
|
20
|
+
private _options;
|
|
21
|
+
transform(options: any, field?: FormlyFieldConfig): Observable<FormlySelectOption[]>;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
private transformOptions;
|
|
24
|
+
private transformOption;
|
|
25
|
+
private transformSelectProps;
|
|
26
|
+
private dispose;
|
|
27
|
+
private observableOf;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlySelectOptionsPipe, never>;
|
|
29
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<FormlySelectOptionsPipe, "formlySelectOptions", true>;
|
|
31
30
|
}
|
|
32
|
-
declare class LegacyFormlySelectOptionsPipe extends FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export declare class LegacyFormlySelectOptionsPipe extends FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlySelectOptionsPipe, never>;
|
|
33
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<LegacyFormlySelectOptionsPipe, "formlySelectOptions", false>;
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { FormlySelectModule, FormlySelectOptionsPipe, LegacyFormlySelectOptionsPipe };
|
|
44
|
-
export type { FormlyFieldSelectProps, FormlySelectOption };
|
|
35
|
+
export declare class FormlySelectModule {
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormlySelectModule, never>;
|
|
37
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormlySelectModule, [typeof LegacyFormlySelectOptionsPipe], never, [typeof LegacyFormlySelectOptionsPipe]>;
|
|
38
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormlySelectModule>;
|
|
39
|
+
}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import { ComponentFixture } from
|
|
2
|
-
import {
|
|
3
|
-
import { ConfigOption, FormlyFieldConfig } from
|
|
4
|
-
|
|
1
|
+
import { ComponentFixture } from "@angular/core/testing";
|
|
2
|
+
import { DebugElement, NgModule } from "@angular/core";
|
|
3
|
+
import { ConfigOption, FormlyFieldConfig } from "@ngx-formly/core";
|
|
5
4
|
interface IComponentOptions<T> extends NgModule {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
template?: string;
|
|
6
|
+
inputs?: T;
|
|
7
|
+
config?: ConfigOption;
|
|
8
|
+
detectChanges?: boolean;
|
|
10
9
|
}
|
|
11
10
|
interface IFormlyDebugElement<E> extends DebugElement {
|
|
12
|
-
|
|
11
|
+
readonly nativeElement: E;
|
|
13
12
|
}
|
|
14
|
-
declare function createComponent<T>({ template, inputs, config, detectChanges, imports, declarations, providers
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
export declare function createComponent<T>({ template, inputs, config, detectChanges, imports, declarations, providers }: IComponentOptions<T>): T & {
|
|
14
|
+
fixture: ComponentFixture<T>;
|
|
15
|
+
detectChanges: (checkNoChanges?: boolean) => void;
|
|
16
|
+
setInputs: (inputs: Partial<T>) => void;
|
|
17
|
+
query: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>;
|
|
18
|
+
queryAll: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>[];
|
|
20
19
|
};
|
|
21
|
-
declare function createFieldComponent(field: FormlyFieldConfig, config?: IComponentOptions<{
|
|
22
|
-
|
|
20
|
+
export declare function createFieldComponent(field: FormlyFieldConfig, config?: IComponentOptions<{
|
|
21
|
+
field: FormlyFieldConfig;
|
|
23
22
|
}>): {
|
|
24
|
-
|
|
23
|
+
field: FormlyFieldConfig;
|
|
25
24
|
} & {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
fixture: ComponentFixture<{
|
|
26
|
+
field: FormlyFieldConfig;
|
|
27
|
+
}>;
|
|
28
|
+
detectChanges: (checkNoChanges?: boolean) => void;
|
|
29
|
+
setInputs: (inputs: Partial<{
|
|
30
|
+
field: FormlyFieldConfig;
|
|
31
|
+
}>) => void;
|
|
32
|
+
query: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>;
|
|
33
|
+
queryAll: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>[];
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
export { createComponent, createFieldComponent };
|
|
35
|
+
export {};
|