@ngx-formly/core 7.1.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.
Files changed (102) hide show
  1. package/README.md +26 -9
  2. package/fesm2022/ngx-formly-core-json-schema.mjs +159 -39
  3. package/fesm2022/ngx-formly-core-json-schema.mjs.map +1 -1
  4. package/fesm2022/ngx-formly-core-preset.mjs +4 -4
  5. package/fesm2022/ngx-formly-core-preset.mjs.map +1 -1
  6. package/fesm2022/ngx-formly-core-select.mjs +28 -21
  7. package/fesm2022/ngx-formly-core-select.mjs.map +1 -1
  8. package/fesm2022/ngx-formly-core-testing.mjs +3 -3
  9. package/fesm2022/ngx-formly-core-testing.mjs.map +1 -1
  10. package/fesm2022/ngx-formly-core.mjs +181 -89
  11. package/fesm2022/ngx-formly-core.mjs.map +1 -1
  12. package/index.d.ts +738 -3
  13. package/json-schema/index.d.ts +39 -5
  14. package/package.json +2 -12
  15. package/preset/index.d.ts +13 -5
  16. package/select/index.d.ts +44 -5
  17. package/testing/index.d.ts +37 -5
  18. package/esm2022/json-schema/formly-json-schema.service.mjs +0 -728
  19. package/esm2022/json-schema/ngx-formly-core-json-schema.mjs +0 -5
  20. package/esm2022/json-schema/public_api.mjs +0 -2
  21. package/esm2022/lib/components/formly.field.mjs +0 -292
  22. package/esm2022/lib/components/formly.form.mjs +0 -171
  23. package/esm2022/lib/components/formly.template.mjs +0 -36
  24. package/esm2022/lib/core.config.mjs +0 -66
  25. package/esm2022/lib/core.mjs +0 -20
  26. package/esm2022/lib/core.module.mjs +0 -74
  27. package/esm2022/lib/extensions/core/core.mjs +0 -144
  28. package/esm2022/lib/extensions/field-expression/field-expression.mjs +0 -8
  29. package/esm2022/lib/extensions/field-expression/utils.mjs +0 -459
  30. package/esm2022/lib/extensions/field-expression-legacy/field-expression.mjs +0 -249
  31. package/esm2022/lib/extensions/field-expression-legacy/utils.mjs +0 -20
  32. package/esm2022/lib/extensions/field-form/field-form.mjs +0 -141
  33. package/esm2022/lib/extensions/field-form/utils.mjs +0 -100
  34. package/esm2022/lib/extensions/field-validation/field-validation.mjs +0 -135
  35. package/esm2022/lib/models/config.mjs +0 -2
  36. package/esm2022/lib/models/fieldconfig.cache.mjs +0 -2
  37. package/esm2022/lib/models/fieldconfig.mjs +0 -2
  38. package/esm2022/lib/models/index.mjs +0 -4
  39. package/esm2022/lib/services/formly.builder.mjs +0 -98
  40. package/esm2022/lib/services/formly.config.mjs +0 -236
  41. package/esm2022/lib/templates/field-array.type.mjs +0 -84
  42. package/esm2022/lib/templates/field-template.type.mjs +0 -34
  43. package/esm2022/lib/templates/field.type.mjs +0 -57
  44. package/esm2022/lib/templates/field.wrapper.mjs +0 -21
  45. package/esm2022/lib/templates/formly.attributes.mjs +0 -201
  46. package/esm2022/lib/templates/formly.group.mjs +0 -31
  47. package/esm2022/lib/templates/formly.validation-message.mjs +0 -84
  48. package/esm2022/lib/utils.mjs +0 -313
  49. package/esm2022/ngx-formly-core.mjs +0 -5
  50. package/esm2022/preset/ngx-formly-core-preset.mjs +0 -5
  51. package/esm2022/preset/preset-substitution.extension.mjs +0 -30
  52. package/esm2022/preset/preset.config.mjs +0 -11
  53. package/esm2022/preset/preset.module.mjs +0 -18
  54. package/esm2022/preset/public_api.mjs +0 -3
  55. package/esm2022/public_api.mjs +0 -5
  56. package/esm2022/select/ngx-formly-core-select.mjs +0 -5
  57. package/esm2022/select/public_api.mjs +0 -3
  58. package/esm2022/select/select-options.pipe.mjs +0 -108
  59. package/esm2022/select/select.module.mjs +0 -16
  60. package/esm2022/testing/component-factory.mjs +0 -86
  61. package/esm2022/testing/ngx-formly-core-testing.mjs +0 -5
  62. package/esm2022/testing/public_api.mjs +0 -2
  63. package/json-schema/formly-json-schema.service.d.ts +0 -31
  64. package/json-schema/public_api.d.ts +0 -1
  65. package/lib/components/formly.field.d.ts +0 -44
  66. package/lib/components/formly.form.d.ts +0 -50
  67. package/lib/components/formly.template.d.ts +0 -19
  68. package/lib/core.config.d.ts +0 -11
  69. package/lib/core.d.ts +0 -20
  70. package/lib/core.module.d.ts +0 -18
  71. package/lib/extensions/core/core.d.ts +0 -14
  72. package/lib/extensions/field-expression/field-expression.d.ts +0 -4
  73. package/lib/extensions/field-expression/utils.d.ts +0 -4
  74. package/lib/extensions/field-expression-legacy/field-expression.d.ts +0 -16
  75. package/lib/extensions/field-expression-legacy/utils.d.ts +0 -5
  76. package/lib/extensions/field-form/field-form.d.ts +0 -11
  77. package/lib/extensions/field-form/utils.d.ts +0 -7
  78. package/lib/extensions/field-validation/field-validation.d.ts +0 -11
  79. package/lib/models/config.d.ts +0 -90
  80. package/lib/models/fieldconfig.cache.d.ts +0 -50
  81. package/lib/models/fieldconfig.d.ts +0 -243
  82. package/lib/models/index.d.ts +0 -3
  83. package/lib/services/formly.builder.d.ts +0 -18
  84. package/lib/services/formly.config.d.ts +0 -56
  85. package/lib/templates/field-array.type.d.ts +0 -22
  86. package/lib/templates/field-template.type.d.ts +0 -12
  87. package/lib/templates/field.type.d.ts +0 -30
  88. package/lib/templates/field.wrapper.d.ts +0 -12
  89. package/lib/templates/formly.attributes.d.ts +0 -52
  90. package/lib/templates/formly.group.d.ts +0 -7
  91. package/lib/templates/formly.validation-message.d.ts +0 -23
  92. package/lib/utils.d.ts +0 -47
  93. package/preset/preset-substitution.extension.d.ts +0 -13
  94. package/preset/preset.config.d.ts +0 -2
  95. package/preset/preset.module.d.ts +0 -7
  96. package/preset/public_api.d.ts +0 -2
  97. package/public_api.d.ts +0 -1
  98. package/select/public_api.d.ts +0 -2
  99. package/select/select-options.pipe.d.ts +0 -33
  100. package/select/select.module.d.ts +0 -7
  101. package/testing/component-factory.d.ts +0 -35
  102. package/testing/public_api.d.ts +0 -1
@@ -1,86 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
- import { Component } from '@angular/core';
3
- import { FormlyModule, FormlyFormBuilder } from '@ngx-formly/core';
4
- import { ReactiveFormsModule } from '@angular/forms';
5
- import { By } from '@angular/platform-browser';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "@ngx-formly/core";
8
- function setInputs(fixture, inputs, detectChanges = true) {
9
- Object.keys(inputs).forEach((input) => {
10
- fixture.componentInstance[input] = inputs[input];
11
- });
12
- if (detectChanges !== false) {
13
- fixture.detectChanges();
14
- }
15
- }
16
- export function createComponent({ template, inputs, config, detectChanges, imports, declarations, providers, }) {
17
- TestBed.configureTestingModule({
18
- declarations: [TestComponent, ...(declarations || [])],
19
- imports: [ReactiveFormsModule, FormlyModule.forRoot(config), ...(imports || [])],
20
- providers: providers || [],
21
- teardown: { destroyAfterEach: false },
22
- }).overrideComponent(TestComponent, {
23
- set: {
24
- template,
25
- inputs: Object.keys(inputs),
26
- },
27
- });
28
- const fixture = TestBed.createComponent(TestComponent);
29
- Object.keys(inputs).forEach((input) => {
30
- fixture.componentInstance[input] = inputs[input];
31
- });
32
- setInputs(fixture, inputs, detectChanges);
33
- const utils = {
34
- fixture,
35
- detectChanges: () => fixture.detectChanges(),
36
- setInputs: (props) => setInputs(fixture, props),
37
- query: (selector) => fixture.debugElement.query(By.css(selector)),
38
- queryAll: (selector) => fixture.debugElement.queryAll(By.css(selector)),
39
- };
40
- Object.keys(inputs).forEach((input) => {
41
- Object.defineProperty(utils, input, {
42
- get: () => fixture.componentInstance[input],
43
- });
44
- });
45
- return utils;
46
- }
47
- export function createFieldComponent(field, config = {}) {
48
- const model = field?.model || {};
49
- const options = field?.options || {};
50
- delete field?.model;
51
- delete field?.options;
52
- const utils = createComponent({
53
- template: '<formly-field [field]="field"></formly-field>',
54
- inputs: { field },
55
- ...config,
56
- detectChanges: false,
57
- });
58
- const builder = utils.fixture.componentRef.instance.builder;
59
- builder.build({ model, options, fieldGroup: [field] });
60
- utils.detectChanges();
61
- const setInputs = utils.setInputs;
62
- utils.setInputs = (props) => {
63
- if (props.field) {
64
- builder.build(props.field);
65
- }
66
- setInputs(props);
67
- };
68
- return utils;
69
- }
70
- class TestComponent {
71
- constructor(builder) {
72
- this.builder = builder;
73
- }
74
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TestComponent, deps: [{ token: i1.FormlyFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
75
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TestComponent, selector: "formly-test-component", providers: [FormlyFormBuilder], ngImport: i0, template: '', isInline: true }); }
76
- }
77
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TestComponent, decorators: [{
78
- type: Component,
79
- args: [{
80
- selector: 'formly-test-component',
81
- template: '',
82
- providers: [FormlyFormBuilder],
83
- standalone: false,
84
- }]
85
- }], ctorParameters: () => [{ type: i1.FormlyFormBuilder }] });
86
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LWZhY3RvcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29yZS90ZXN0aW5nL3NyYy9jb21wb25lbnQtZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFvQixNQUFNLHVCQUF1QixDQUFDO0FBQ2xFLE9BQU8sRUFBRSxTQUFTLEVBQTBCLE1BQU0sZUFBZSxDQUFDO0FBQ2xFLE9BQU8sRUFBRSxZQUFZLEVBQUUsaUJBQWlCLEVBQW1DLE1BQU0sa0JBQWtCLENBQUM7QUFDcEcsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDckQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLDJCQUEyQixDQUFDOzs7QUFFL0MsU0FBUyxTQUFTLENBQUksT0FBNEIsRUFBRSxNQUFTLEVBQUUsYUFBYSxHQUFHLElBQUk7SUFD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3JlYXRlQ29tcG9uZW50PHsgZmllbGQ6IEZvcm1seUZpZWxkQ29uZmlnIH0+KHtcbiAgICB0ZW1wbGF0ZTogJzxmb3JtbHktZmllbGQgW2ZpZWxkXT1cImZpZWxkXCI+PC9mb3JtbHktZmllbGQ+JyxcbiAgICBpbnB1dHM6IHsgZmllbGQgfSxcbiAgICAuLi5jb25maWcsXG4gICAgZGV0ZWN0Q2hhbmdlczogZmFsc2UsXG4gIH0pO1xuICBjb25zdCBidWlsZGVyID0gKHV0aWxzLmZpeHR1cmUuY29tcG9uZW50UmVmLmluc3RhbmNlIGFzIGFueSkuYnVpbGRlcjtcbiAgYnVpbGRlci5idWlsZCh7IG1vZGVsLCBvcHRpb25zLCBmaWVsZEdyb3VwOiBbZmllbGRdIH0pO1xuICB1dGlscy5kZXRlY3RDaGFuZ2VzKCk7XG5cbiAgY29uc3Qgc2V0SW5wdXRzID0gdXRpbHMuc2V0SW5wdXRzO1xuICB1dGlscy5zZXRJbnB1dHMgPSAocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZmllbGQpIHtcbiAgICAgIGJ1aWxkZXIuYnVpbGQocHJvcHMuZmllbGQpO1xuICAgIH1cblxuICAgIHNldElucHV0cyhwcm9wcyk7XG4gIH07XG5cbiAgcmV0dXJuIHV0aWxzO1xufVxuXG5AQ29tcG9uZW50KHtcbiAgc2VsZWN0b3I6ICdmb3JtbHktdGVzdC1jb21wb25lbnQnLFxuICB0ZW1wbGF0ZTogJycsXG4gIHByb3ZpZGVyczogW0Zvcm1seUZvcm1CdWlsZGVyXSxcbiAgc3RhbmRhbG9uZTogZmFsc2UsXG59KVxuY2xhc3MgVGVzdENvbXBvbmVudCB7XG4gIGNvbnN0cnVjdG9yKHB1YmxpYyBidWlsZGVyPzogRm9ybWx5Rm9ybUJ1aWxkZXIpIHt9XG59XG4iXX0=
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZvcm1seS1jb3JlLXRlc3RpbmcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29yZS90ZXN0aW5nL3NyYy9uZ3gtZm9ybWx5LWNvcmUtdGVzdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
@@ -1,2 +0,0 @@
1
- export * from './component-factory';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb3JlL3Rlc3Rpbmcvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxxQkFBcUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50LWZhY3RvcnknO1xuIl19
@@ -1,31 +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 resolveDefinition;
19
- private resolveDependencies;
20
- private extractIfCondition;
21
- private resolveIfThenElse;
22
- private resolveConditionalSchema;
23
- private guessSchemaType;
24
- private addValidator;
25
- private isEnum;
26
- private toEnumOptions;
27
- private isFieldValid;
28
- private mergeFields;
29
- static ɵfac: i0.ɵɵFactoryDeclaration<FormlyJsonschema, never>;
30
- static ɵprov: i0.ɵɵInjectableDeclaration<FormlyJsonschema>;
31
- }
@@ -1 +0,0 @@
1
- export { FormlyJsonschema } from './formly-json-schema.service';
@@ -1,44 +0,0 @@
1
- import { ViewContainerRef, SimpleChanges, DoCheck, OnInit, OnChanges, OnDestroy, AfterContentInit, AfterViewInit, Renderer2, ElementRef } from '@angular/core';
2
- import { FormlyConfig } from '../services/formly.config';
3
- import { FormlyFieldConfig } 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 form;
15
- /** The field config. */
16
- field: FormlyFieldConfig;
17
- viewContainerRef: ViewContainerRef;
18
- private hostObservers;
19
- private componentRefs;
20
- private hooksObservers;
21
- private detectFieldBuild;
22
- private get containerRef();
23
- private get elementRef();
24
- valueChangesUnsubscribe: () => void;
25
- constructor(config: FormlyConfig, renderer: Renderer2, _elementRef: ElementRef, hostContainerRef: ViewContainerRef, form: FormlyFieldTemplates);
26
- ngAfterContentInit(): void;
27
- ngAfterViewInit(): void;
28
- ngDoCheck(): void;
29
- ngOnInit(): void;
30
- ngOnChanges(changes: SimpleChanges): void;
31
- ngOnDestroy(): void;
32
- private renderField;
33
- private triggerHook;
34
- private attachComponentRef;
35
- private render;
36
- private resetRefs;
37
- private fieldChanges;
38
- static ɵfac: i0.ɵɵFactoryDeclaration<FormlyField, [null, null, null, null, { optional: true; }]>;
39
- static ɵcmp: i0.ɵɵComponentDeclaration<FormlyField, "formly-field", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
40
- }
41
- export declare class LegacyFormlyField extends FormlyField {
42
- static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlyField, never>;
43
- static ɵcmp: i0.ɵɵComponentDeclaration<LegacyFormlyField, "formly-field", never, {}, {}, never, never, false, never>;
44
- }
@@ -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
- }
@@ -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, } 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';
@@ -1,18 +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
- export declare class FormlyModule {
13
- static forRoot(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
14
- static forChild(config?: ConfigOption): ModuleWithProviders<FormlyModule>;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<FormlyModule, never>;
16
- 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]>;
17
- static ɵinj: i0.ɵɵInjectorDeclaration<FormlyModule>;
18
- }
@@ -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,4 +0,0 @@
1
- /**
2
- * Uses CSP-safe implementation
3
- */
4
- export declare function parseExpression(expression: string, argNames: string[]): any;
@@ -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,5 +0,0 @@
1
- /**
2
- * Legacy implementation
3
- */
4
- export declare function evalStringExpressionLegacy(expression: string, argNames: string[]): any;
5
- export declare function evalExpression(expression: string | ((...value: any[]) => any) | boolean, thisArg: any, argVal: any[]): any;
@@ -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
- }
@@ -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
- }