@ngx-formly/core 8.0.0 → 10.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 (56) hide show
  1. package/README.md +46 -19
  2. package/fesm2022/ngx-formly-core-json-schema.mjs +8 -6
  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-select.mjs +10 -10
  6. package/fesm2022/ngx-formly-core-testing.mjs +3 -3
  7. package/fesm2022/ngx-formly-core.mjs +194 -94
  8. package/fesm2022/ngx-formly-core.mjs.map +1 -1
  9. package/package.json +9 -8
  10. package/{json-schema/formly-json-schema.service.d.ts → types/ngx-formly-core-json-schema.d.ts} +11 -3
  11. package/types/ngx-formly-core-preset.d.ts +13 -0
  12. package/{select/select-options.pipe.d.ts → types/ngx-formly-core-select.d.ts} +17 -7
  13. package/{testing/component-factory.d.ts → types/ngx-formly-core-testing.d.ts} +7 -5
  14. package/types/ngx-formly-core.d.ts +745 -0
  15. package/index.d.ts +0 -5
  16. package/json-schema/index.d.ts +0 -5
  17. package/json-schema/public_api.d.ts +0 -1
  18. package/lib/components/formly.field.d.ts +0 -47
  19. package/lib/components/formly.form.d.ts +0 -50
  20. package/lib/components/formly.template.d.ts +0 -19
  21. package/lib/core.config.d.ts +0 -11
  22. package/lib/core.d.ts +0 -20
  23. package/lib/core.module.d.ts +0 -25
  24. package/lib/extensions/core/core.d.ts +0 -14
  25. package/lib/extensions/field-expression/field-expression.d.ts +0 -4
  26. package/lib/extensions/field-expression/utils.d.ts +0 -4
  27. package/lib/extensions/field-expression-legacy/field-expression.d.ts +0 -16
  28. package/lib/extensions/field-expression-legacy/utils.d.ts +0 -5
  29. package/lib/extensions/field-form/field-form.d.ts +0 -11
  30. package/lib/extensions/field-form/utils.d.ts +0 -7
  31. package/lib/extensions/field-validation/field-validation.d.ts +0 -11
  32. package/lib/models/config.d.ts +0 -90
  33. package/lib/models/fieldconfig.cache.d.ts +0 -50
  34. package/lib/models/fieldconfig.d.ts +0 -243
  35. package/lib/models/index.d.ts +0 -3
  36. package/lib/services/formly.builder.d.ts +0 -18
  37. package/lib/services/formly.config.d.ts +0 -56
  38. package/lib/templates/field-array.type.d.ts +0 -22
  39. package/lib/templates/field-template.type.d.ts +0 -12
  40. package/lib/templates/field.type.d.ts +0 -30
  41. package/lib/templates/field.wrapper.d.ts +0 -12
  42. package/lib/templates/formly.attributes.d.ts +0 -55
  43. package/lib/templates/formly.group.d.ts +0 -7
  44. package/lib/templates/formly.validation-message.d.ts +0 -23
  45. package/lib/utils.d.ts +0 -47
  46. package/preset/index.d.ts +0 -5
  47. package/preset/preset-substitution.extension.d.ts +0 -13
  48. package/preset/preset.config.d.ts +0 -2
  49. package/preset/preset.module.d.ts +0 -7
  50. package/preset/public_api.d.ts +0 -2
  51. package/public_api.d.ts +0 -1
  52. package/select/index.d.ts +0 -5
  53. package/select/public_api.d.ts +0 -2
  54. package/select/select.module.d.ts +0 -7
  55. package/testing/index.d.ts +0 -5
  56. package/testing/public_api.d.ts +0 -1
package/package.json CHANGED
@@ -1,42 +1,43 @@
1
1
  {
2
2
  "name": "@ngx-formly/core",
3
- "version": "8.0.0",
3
+ "version": "10.0.0",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "tslib": "^2.0.0"
7
7
  },
8
8
  "peerDependencies": {
9
- "@angular/forms": ">=19.0.0",
9
+ "@angular/forms": ">=21.0.0",
10
10
  "rxjs": "^6.5.3 || ^7.0.0"
11
11
  },
12
12
  "module": "fesm2022/ngx-formly-core.mjs",
13
- "typings": "index.d.ts",
13
+ "typings": "types/ngx-formly-core.d.ts",
14
14
  "exports": {
15
15
  "./package.json": {
16
16
  "default": "./package.json"
17
17
  },
18
18
  ".": {
19
- "types": "./index.d.ts",
19
+ "types": "./types/ngx-formly-core.d.ts",
20
20
  "default": "./fesm2022/ngx-formly-core.mjs"
21
21
  },
22
22
  "./json-schema": {
23
- "types": "./json-schema/index.d.ts",
23
+ "types": "./types/ngx-formly-core-json-schema.d.ts",
24
24
  "default": "./fesm2022/ngx-formly-core-json-schema.mjs"
25
25
  },
26
26
  "./preset": {
27
- "types": "./preset/index.d.ts",
27
+ "types": "./types/ngx-formly-core-preset.d.ts",
28
28
  "default": "./fesm2022/ngx-formly-core-preset.mjs"
29
29
  },
30
30
  "./select": {
31
- "types": "./select/index.d.ts",
31
+ "types": "./types/ngx-formly-core-select.d.ts",
32
32
  "default": "./fesm2022/ngx-formly-core-select.mjs"
33
33
  },
34
34
  "./testing": {
35
- "types": "./testing/index.d.ts",
35
+ "types": "./types/ngx-formly-core-testing.d.ts",
36
36
  "default": "./fesm2022/ngx-formly-core-testing.mjs"
37
37
  }
38
38
  },
39
39
  "sideEffects": false,
40
+ "type": "module",
40
41
  "homepage": "https://github.com/ngx-formly/ngx-formly#readme",
41
42
  "description": "Formly is a dynamic (JSON powered) form library for Angular that bring unmatched maintainability to your application's forms.",
42
43
  "repository": {
@@ -1,7 +1,13 @@
1
1
  import { FormlyFieldConfig } from '@ngx-formly/core';
2
2
  import { JSONSchema7 } from 'json-schema';
3
- import * as i0 from "@angular/core";
4
- export interface FormlyJsonschemaOptions {
3
+ import * as i0 from '@angular/core';
4
+
5
+ interface FormlyJsonschemaOptions {
6
+ /**
7
+ * Leave required strings without a schema default undefined instead of defaulting to ''.
8
+ * Defaults to false. Explicit schema defaults and other types are unaffected.
9
+ */
10
+ ignoreImplicitStringDefaults?: boolean;
5
11
  /**
6
12
  * allows to intercept the mapping, taking the already mapped
7
13
  * formly field and the original JSONSchema source from which it
@@ -9,7 +15,7 @@ export interface FormlyJsonschemaOptions {
9
15
  */
10
16
  map?: (mappedField: FormlyFieldConfig, mapSource: JSONSchema7) => FormlyFieldConfig;
11
17
  }
12
- export declare class FormlyJsonschema {
18
+ declare class FormlyJsonschema {
13
19
  toFieldConfig(schema: JSONSchema7, options?: FormlyJsonschemaOptions): FormlyFieldConfig;
14
20
  private _toFieldConfig;
15
21
  private resolveSchema;
@@ -34,3 +40,5 @@ export declare class FormlyJsonschema {
34
40
  static ɵfac: i0.ɵɵFactoryDeclaration<FormlyJsonschema, never>;
35
41
  static ɵprov: i0.ɵɵInjectableDeclaration<FormlyJsonschema>;
36
42
  }
43
+
44
+ export { FormlyJsonschema };
@@ -0,0 +1,13 @@
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 };
@@ -1,21 +1,22 @@
1
- import { OnDestroy, PipeTransform } from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
+ import { PipeTransform, OnDestroy } from '@angular/core';
2
3
  import { Observable } from 'rxjs';
3
- import { FormlyFieldConfig, FormlyFieldProps } from '@ngx-formly/core';
4
- import * as i0 from "@angular/core";
5
- export interface FormlySelectOption {
4
+ import { FormlyFieldProps, FormlyFieldConfig } from '@ngx-formly/core';
5
+
6
+ interface FormlySelectOption {
6
7
  label: string;
7
8
  disabled?: boolean;
8
9
  value?: any;
9
10
  group?: FormlySelectOption[];
10
11
  }
11
- export interface FormlyFieldSelectProps extends FormlyFieldProps {
12
+ interface FormlyFieldSelectProps extends FormlyFieldProps {
12
13
  groupProp?: string | ((option: any) => string);
13
14
  labelProp?: string | ((option: any) => string);
14
15
  valueProp?: string | ((option: any) => any);
15
16
  disabledProp?: string | ((option: any) => boolean);
16
17
  mapProp?: (option: any) => FormlySelectOption;
17
18
  }
18
- export declare class FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
19
+ declare class FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
19
20
  private _subscription;
20
21
  private _options;
21
22
  transform(options: any, field?: FormlyFieldConfig): Observable<FormlySelectOption[]>;
@@ -28,7 +29,16 @@ export declare class FormlySelectOptionsPipe implements PipeTransform, OnDestroy
28
29
  static ɵfac: i0.ɵɵFactoryDeclaration<FormlySelectOptionsPipe, never>;
29
30
  static ɵpipe: i0.ɵɵPipeDeclaration<FormlySelectOptionsPipe, "formlySelectOptions", true>;
30
31
  }
31
- export declare class LegacyFormlySelectOptionsPipe extends FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
32
+ declare class LegacyFormlySelectOptionsPipe extends FormlySelectOptionsPipe implements PipeTransform, OnDestroy {
32
33
  static ɵfac: i0.ɵɵFactoryDeclaration<LegacyFormlySelectOptionsPipe, never>;
33
34
  static ɵpipe: i0.ɵɵPipeDeclaration<LegacyFormlySelectOptionsPipe, "formlySelectOptions", false>;
34
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 };
@@ -1,6 +1,7 @@
1
1
  import { ComponentFixture } from '@angular/core/testing';
2
- import { DebugElement, NgModule } from '@angular/core';
3
- import { FormlyFieldConfig, ConfigOption } from '@ngx-formly/core';
2
+ import { NgModule, DebugElement } from '@angular/core';
3
+ import { ConfigOption, FormlyFieldConfig } from '@ngx-formly/core';
4
+
4
5
  interface IComponentOptions<T> extends NgModule {
5
6
  template?: string;
6
7
  inputs?: T;
@@ -10,14 +11,14 @@ interface IComponentOptions<T> extends NgModule {
10
11
  interface IFormlyDebugElement<E> extends DebugElement {
11
12
  readonly nativeElement: E;
12
13
  }
13
- export declare function createComponent<T>({ template, inputs, config, detectChanges, imports, declarations, providers, }: IComponentOptions<T>): T & {
14
+ declare function createComponent<T>({ template, inputs, config, detectChanges, imports, declarations, providers, }: IComponentOptions<T>): T & {
14
15
  fixture: ComponentFixture<T>;
15
16
  detectChanges: (checkNoChanges?: boolean) => void;
16
17
  setInputs: (inputs: Partial<T>) => void;
17
18
  query: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>;
18
19
  queryAll: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>[];
19
20
  };
20
- export declare function createFieldComponent(field: FormlyFieldConfig, config?: IComponentOptions<{
21
+ declare function createFieldComponent(field: FormlyFieldConfig, config?: IComponentOptions<{
21
22
  field: FormlyFieldConfig;
22
23
  }>): {
23
24
  field: FormlyFieldConfig;
@@ -32,4 +33,5 @@ export declare function createFieldComponent(field: FormlyFieldConfig, config?:
32
33
  query: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>;
33
34
  queryAll: <E extends Element = Element>(selector: string) => IFormlyDebugElement<E>[];
34
35
  };
35
- export {};
36
+
37
+ export { createComponent, createFieldComponent };