@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
@@ -1,18 +1,22 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Type, TemplateRef, ComponentRef, ChangeDetectorRef, ɵNoopNgZone as _NoopNgZone, VERSION, Input, ViewChildren, Directive, ChangeDetectionStrategy, Component, Injectable, Injector, ViewContainerRef, ViewChild, Optional, InjectionToken, inject, Inject, EventEmitter, ContentChildren, Output, NgModule } from '@angular/core';
2
+ import { Type, TemplateRef, ComponentRef, ChangeDetectorRef, ɵNoopNgZone as _NoopNgZone, VERSION, Input, ViewChildren, Directive, ChangeDetectionStrategy, Component, Injectable, Injector, ViewContainerRef, ViewChild, Optional, InjectionToken, inject, Inject, EventEmitter, DestroyRef, PendingTasks, ContentChildren, Output, DOCUMENT, NgModule } from '@angular/core';
3
3
  import { isObservable, Observable, Subject, of, merge } from 'rxjs';
4
4
  import * as i2 from '@angular/forms';
5
5
  import { AbstractControl, UntypedFormArray, UntypedFormGroup, FormControl, UntypedFormControl, Validators, NgControl } from '@angular/forms';
6
6
  import { tap, map, startWith, distinctUntilChanged, skip, debounceTime, filter, switchMap, take } from 'rxjs/operators';
7
7
  import * as i1 from '@angular/platform-browser';
8
8
  import * as i2$1 from '@angular/common';
9
- import { DOCUMENT, AsyncPipe, CommonModule } from '@angular/common';
9
+ import { AsyncPipe, CommonModule } from '@angular/common';
10
10
 
11
11
  function disableTreeValidityCall(form, callback) {
12
12
  const _updateTreeValidity = form._updateTreeValidity.bind(form);
13
13
  form._updateTreeValidity = () => { };
14
- callback();
15
- form._updateTreeValidity = _updateTreeValidity;
14
+ try {
15
+ callback();
16
+ }
17
+ finally {
18
+ form._updateTreeValidity = _updateTreeValidity;
19
+ }
16
20
  }
17
21
  function getFieldId(formId, field, index) {
18
22
  if (field.id) {
@@ -462,7 +466,13 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
462
466
  else if (expr instanceof Observable) {
463
467
  field._expressions[key] = {
464
468
  value$: expr.pipe(tap((v) => {
465
- this.evalExpr(field, key, v);
469
+ if (['props.disabled', 'templateOptions.disabled'].includes(key)) {
470
+ field._expressions[key].callback = this.parseExpressions(field, key, () => v).callback;
471
+ field._expressions[key].callback(true);
472
+ }
473
+ else {
474
+ this.evalExpr(field, key, v);
475
+ }
466
476
  field.options._detectChanges(field);
467
477
  })),
468
478
  };
@@ -490,22 +500,38 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
490
500
  return;
491
501
  }
492
502
  checkLocked = true;
493
- const fieldChanged = this.checkExpressions(f, ignoreCache);
494
- const options = field.options;
495
- options._hiddenFieldsForCheck
496
- .sort((f) => (f.field.hide ? -1 : 1))
497
- .forEach((f) => this.changeHideState(f.field, f.field.hide ?? f.default, !ignoreCache));
498
- options._hiddenFieldsForCheck = [];
499
- if (fieldChanged) {
500
- this.checkExpressions(field);
501
- }
502
- checkLocked = false;
503
+ try {
504
+ // ponytail: initial-tree budget; add an override if valid dynamic forms need more passes.
505
+ const maxPasses = Math.max(100, 2 * this.countFields(field));
506
+ const options = field.options;
507
+ // Rebuilds preserve supplied values, but defaults may need clearing after visibility changes.
508
+ const restoredDefaults = ignoreCache ? new Set() : undefined;
509
+ const fieldChanged = this.checkExpressions(f, ignoreCache) || options._hiddenFieldsForCheck.length > 0;
510
+ let passes = 0;
511
+ do {
512
+ if (passes++ === maxPasses) {
513
+ console.warn('[Formly] The form may be inconsistent. Check for circular hide expressions');
514
+ throw new Error(`[Formly Error] Expressions did not settle after ${maxPasses} passes.`);
515
+ }
516
+ options._hiddenFieldsForCheck
517
+ .sort((f) => (f.field.hide ? -1 : 1))
518
+ .forEach((f) => this.changeHideState(f.field, f.field.hide ?? f.default, !ignoreCache, f.emitEvent, restoredDefaults));
519
+ options._hiddenFieldsForCheck = [];
520
+ if (fieldChanged) {
521
+ this.checkExpressions(field);
522
+ }
523
+ } while (options._hiddenFieldsForCheck.length > 0);
524
+ }
525
+ finally {
526
+ checkLocked = false;
527
+ }
503
528
  };
504
529
  }
505
530
  }
506
531
  parseExpressions(field, path, expr) {
532
+ const isDisabledExpression = ['props.disabled', 'templateOptions.disabled'].includes(path);
507
533
  let parentExpression;
508
- if (field.parent && ['hide', 'props.disabled'].includes(path)) {
534
+ if (field.parent && (path === 'hide' || isDisabledExpression)) {
509
535
  const rootValue = (f) => {
510
536
  return path === 'hide' ? f.hide : f.props.disabled;
511
537
  };
@@ -527,6 +553,8 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
527
553
  try {
528
554
  const exprValue = evalExpression(parentExpression ? (...args) => parentExpression(field) || expr(...args) : expr, { field }, [field.model, field.options.formState, field, ignoreCache]);
529
555
  if (ignoreCache ||
556
+ (isDisabledExpression &&
557
+ (field.props.disabled !== !!exprValue || (exprValue && hasKey(field) && field.formControl?.enabled))) ||
530
558
  (currentValue !== exprValue &&
531
559
  (!isObject(exprValue) ||
532
560
  isObservable(exprValue) ||
@@ -547,15 +575,29 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
547
575
  _evalStringExpression(expression, argNames) {
548
576
  return evalStringExpressionLegacy(expression, argNames);
549
577
  }
578
+ countFields(field) {
579
+ return field ? 1 + (field.fieldGroup?.reduce((count, f) => count + this.countFields(f), 0) ?? 0) : 0;
580
+ }
550
581
  checkExpressions(field, ignoreCache = false) {
551
582
  if (!field) {
552
583
  return false;
553
584
  }
554
585
  let fieldChanged = false;
555
586
  if (field._expressions) {
587
+ const hide = field.hide;
556
588
  for (const key of Object.keys(field._expressions)) {
557
589
  field._expressions[key].callback?.(ignoreCache) && (fieldChanged = true);
558
590
  }
591
+ if (ignoreCache && field._expressions.hide && hide === false && field.hide === false) {
592
+ let parent = field.parent;
593
+ while (parent && !parent.hide) {
594
+ parent = parent.parent;
595
+ }
596
+ if (!parent) {
597
+ // Restore defaults after rebuilding without reporting a visibility change.
598
+ field.options._hiddenFieldsForCheck.push({ field, emitEvent: false });
599
+ }
600
+ }
559
601
  }
560
602
  field.fieldGroup?.forEach((f) => this.checkExpressions(f, ignoreCache) && (fieldChanged = true));
561
603
  return fieldChanged;
@@ -570,11 +612,12 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
570
612
  field.props.disabled = value;
571
613
  }
572
614
  }
573
- changeHideState(field, hide, resetOnHide) {
615
+ changeHideState(field, hide, resetOnHide, emitEvent = true, restoredDefaults) {
616
+ hide = field.hide || hide;
574
617
  if (field.fieldGroup) {
575
618
  field.fieldGroup
576
619
  .filter((f) => f && !f._expressions.hide)
577
- .forEach((f) => this.changeHideState(f, hide, resetOnHide));
620
+ .forEach((f) => this.changeHideState(f, hide, resetOnHide, emitEvent, restoredDefaults));
578
621
  }
579
622
  if (field.formControl && hasKey(field)) {
580
623
  defineHiddenProp(field, '_hide', !!(hide || field.hide));
@@ -584,8 +627,9 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
584
627
  }
585
628
  if (hide === true && (!c._fields || c._fields.every((f) => !!f._hide))) {
586
629
  unregisterControl(field, true);
587
- if (resetOnHide && field.resetOnHide) {
630
+ if ((resetOnHide || restoredDefaults?.has(c)) && field.resetOnHide) {
588
631
  assignFieldValue(field, undefined);
632
+ restoredDefaults?.delete(c);
589
633
  field.formControl.reset({ value: undefined, disabled: field.formControl.disabled });
590
634
  field.options.fieldChanges.next({ value: undefined, field, type: 'valueChanges' });
591
635
  if (field.fieldGroup && field.formControl instanceof UntypedFormArray) {
@@ -596,6 +640,7 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
596
640
  else if (hide === false) {
597
641
  if (field.resetOnHide && !isUndefined(field.defaultValue) && isUndefined(getFieldValue(field))) {
598
642
  assignFieldValue(field, field.defaultValue);
643
+ restoredDefaults?.add(c);
599
644
  }
600
645
  registerControl(field, undefined, true);
601
646
  if (field.resetOnHide && field.fieldArray && field.fieldGroup?.length !== field.model?.length) {
@@ -603,7 +648,7 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
603
648
  }
604
649
  }
605
650
  }
606
- if (field.options.fieldChanges) {
651
+ if (emitEvent && field.options.fieldChanges) {
607
652
  field.options.fieldChanges.next({ field, type: 'hidden', value: hide });
608
653
  }
609
654
  }
@@ -634,6 +679,10 @@ let FieldExpressionExtension$1 = class FieldExpressionExtension {
634
679
  throw error;
635
680
  }
636
681
  if (['templateOptions.disabled', 'props.disabled'].includes(prop) && hasKey(field)) {
682
+ // Angular enables descendants without updating a group's disabled property.
683
+ if (value && field.formControl?.enabled) {
684
+ field.formControl.disable();
685
+ }
637
686
  this.changeDisabledState(field, value);
638
687
  }
639
688
  }
@@ -686,6 +735,7 @@ var TokenType;
686
735
  (function (TokenType) {
687
736
  TokenType["IDENTIFIER"] = "IDENTIFIER";
688
737
  TokenType["DOT"] = "DOT";
738
+ TokenType["OPTIONAL_DOT"] = "OPTIONAL_DOT";
689
739
  TokenType["BRACKET_OPEN"] = "BRACKET_OPEN";
690
740
  TokenType["BRACKET_CLOSE"] = "BRACKET_CLOSE";
691
741
  TokenType["STRING"] = "STRING";
@@ -748,6 +798,10 @@ class Tokenizer {
748
798
  tokens.push({ type: TokenType.PAREN_CLOSE, value: ')' });
749
799
  this.pos++;
750
800
  }
801
+ else if (char === '?' && this.peek() === '.') {
802
+ tokens.push({ type: TokenType.OPTIONAL_DOT, value: '?.' });
803
+ this.pos += 2;
804
+ }
751
805
  else if (char === '?') {
752
806
  tokens.push({ type: TokenType.TERNARY_QUESTION, value: '?' });
753
807
  this.pos++;
@@ -924,6 +978,7 @@ class ExpressionParser {
924
978
  }
925
979
  parse() {
926
980
  const expr = this.parseTernary();
981
+ this.consume(TokenType.EOF);
927
982
  return (context) => expr(context);
928
983
  }
929
984
  parseTernary() {
@@ -1064,9 +1119,17 @@ class ExpressionParser {
1064
1119
  // Read first identifier
1065
1120
  path.push(this.consume(TokenType.IDENTIFIER).value);
1066
1121
  // Read rest of path (dots and brackets)
1067
- while (this.current().type === TokenType.DOT || this.current().type === TokenType.BRACKET_OPEN) {
1068
- if (this.current().type === TokenType.DOT) {
1069
- this.consume(TokenType.DOT);
1122
+ while (this.current().type === TokenType.DOT ||
1123
+ this.current().type === TokenType.OPTIONAL_DOT ||
1124
+ this.current().type === TokenType.BRACKET_OPEN) {
1125
+ const optional = this.current().type === TokenType.OPTIONAL_DOT;
1126
+ if (optional) {
1127
+ this.consume(TokenType.OPTIONAL_DOT);
1128
+ }
1129
+ if (this.current().type === TokenType.DOT || (optional && this.current().type !== TokenType.BRACKET_OPEN)) {
1130
+ if (!optional) {
1131
+ this.consume(TokenType.DOT);
1132
+ }
1070
1133
  path.push(this.consume(TokenType.IDENTIFIER).value);
1071
1134
  }
1072
1135
  else {
@@ -1594,10 +1657,10 @@ class FieldType {
1594
1657
  get formState() {
1595
1658
  return this.options?.formState || {};
1596
1659
  }
1597
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FieldType, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1598
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: FieldType, isStandalone: true, inputs: { field: "field" }, viewQueries: [{ propertyName: "_formlyControls", predicate: NgControl, descendants: true }], ngImport: i0 }); }
1660
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldType, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1661
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: FieldType, isStandalone: true, inputs: { field: "field" }, viewQueries: [{ propertyName: "_formlyControls", predicate: NgControl, descendants: true }], ngImport: i0 }); }
1599
1662
  }
1600
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FieldType, decorators: [{
1663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldType, decorators: [{
1601
1664
  type: Directive
1602
1665
  }], propDecorators: { _formlyControls: [{
1603
1666
  type: ViewChildren,
@@ -1624,10 +1687,10 @@ class FormlyTemplateType extends FieldType {
1624
1687
  this.sanitizer = sanitizer;
1625
1688
  this.innerHtml = {};
1626
1689
  }
1627
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyTemplateType, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
1628
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FormlyTemplateType, isStandalone: false, selector: "formly-template", usesInheritance: true, ngImport: i0, template: `<div [innerHtml]="template"></div>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1690
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyTemplateType, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
1691
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: FormlyTemplateType, isStandalone: false, selector: "formly-template", usesInheritance: true, ngImport: i0, template: `<div [innerHtml]="template"></div>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1629
1692
  }
1630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyTemplateType, decorators: [{
1693
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyTemplateType, decorators: [{
1631
1694
  type: Component,
1632
1695
  args: [{
1633
1696
  selector: 'formly-template',
@@ -1862,10 +1925,10 @@ class FormlyConfig {
1862
1925
  this.types[name].wrappers = extendedType.wrappers;
1863
1926
  }
1864
1927
  }
1865
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1866
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyConfig, providedIn: 'root' }); }
1928
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1929
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyConfig, providedIn: 'root' }); }
1867
1930
  }
1868
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyConfig, decorators: [{
1931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyConfig, decorators: [{
1869
1932
  type: Injectable,
1870
1933
  args: [{ providedIn: 'root' }]
1871
1934
  }] });
@@ -1877,10 +1940,10 @@ class FormlyTemplate {
1877
1940
  ngOnChanges() {
1878
1941
  this.name = this.name || 'formly-group';
1879
1942
  }
1880
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyTemplate, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1881
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: FormlyTemplate, isStandalone: true, selector: "[formlyTemplate]", inputs: { name: ["formlyTemplate", "name"] }, usesOnChanges: true, ngImport: i0 }); }
1943
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyTemplate, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1944
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: FormlyTemplate, isStandalone: true, selector: "[formlyTemplate]", inputs: { name: ["formlyTemplate", "name"] }, usesOnChanges: true, ngImport: i0 }); }
1882
1945
  }
1883
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyTemplate, decorators: [{
1946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyTemplate, decorators: [{
1884
1947
  type: Directive,
1885
1948
  args: [{ selector: '[formlyTemplate]', standalone: true }]
1886
1949
  }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { name: [{
@@ -1888,19 +1951,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
1888
1951
  args: ['formlyTemplate']
1889
1952
  }] } });
1890
1953
  class LegacyFormlyTemplate extends FormlyTemplate {
1891
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyTemplate, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
1892
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: LegacyFormlyTemplate, isStandalone: false, selector: "[formlyTemplate]", usesInheritance: true, ngImport: i0 }); }
1954
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyTemplate, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
1955
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: LegacyFormlyTemplate, isStandalone: false, selector: "[formlyTemplate]", usesInheritance: true, ngImport: i0 }); }
1893
1956
  }
1894
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyTemplate, decorators: [{
1957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyTemplate, decorators: [{
1895
1958
  type: Directive,
1896
1959
  args: [{ selector: '[formlyTemplate]', standalone: false }]
1897
1960
  }] });
1898
1961
  // workarround for https://github.com/angular/angular/issues/43227#issuecomment-904173738
1899
1962
  class FormlyFieldTemplates {
1900
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyFieldTemplates, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1901
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyFieldTemplates }); }
1963
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldTemplates, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1964
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldTemplates }); }
1902
1965
  }
1903
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyFieldTemplates, decorators: [{
1966
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldTemplates, decorators: [{
1904
1967
  type: Injectable
1905
1968
  }] });
1906
1969
 
@@ -2188,10 +2251,10 @@ class FormlyField {
2188
2251
  templateFieldsSubs.forEach((unsubscribe) => unsubscribe());
2189
2252
  };
2190
2253
  }
2191
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyField, deps: [{ token: FormlyConfig }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.Injector }, { token: FormlyFieldTemplates, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
2192
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FormlyField, isStandalone: true, selector: "formly-field", inputs: { field: "field" }, viewQueries: [{ propertyName: "viewContainerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true, styles: [":host:empty{display:none}\n"] }); }
2254
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyField, deps: [{ token: FormlyConfig }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.Injector }, { token: FormlyFieldTemplates, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
2255
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: FormlyField, isStandalone: true, selector: "formly-field", inputs: { field: "field" }, viewQueries: [{ propertyName: "viewContainerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true, styles: [":host:empty{display:none}\n"] }); }
2193
2256
  }
2194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyField, decorators: [{
2257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyField, decorators: [{
2195
2258
  type: Component,
2196
2259
  args: [{ selector: 'formly-field', template: '<ng-template #container></ng-template>', standalone: true, styles: [":host:empty{display:none}\n"] }]
2197
2260
  }], ctorParameters: () => [{ type: FormlyConfig }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.Injector }, { type: FormlyFieldTemplates, decorators: [{
@@ -2203,25 +2266,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
2203
2266
  args: ['container', { read: ViewContainerRef, static: true }]
2204
2267
  }] } });
2205
2268
  class LegacyFormlyField extends FormlyField {
2206
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyField, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2207
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: LegacyFormlyField, isStandalone: false, selector: "formly-field", usesInheritance: true, ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true, styles: [":host:empty{display:none}\n"] }); }
2269
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyField, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2270
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: LegacyFormlyField, isStandalone: false, selector: "formly-field", usesInheritance: true, ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true, styles: [":host:empty{display:none}\n"] }); }
2208
2271
  }
2209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyField, decorators: [{
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyField, decorators: [{
2210
2273
  type: Component,
2211
2274
  args: [{ selector: 'formly-field', template: '<ng-template #container></ng-template>', standalone: false, styles: [":host:empty{display:none}\n"] }]
2212
2275
  }] });
2213
2276
 
2214
2277
  /** @ignore */
2215
2278
  class FormlyGroup extends FieldType {
2216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyGroup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: FormlyGroup, isStandalone: false, selector: "formly-group", host: { properties: { "class": "field.fieldGroupClassName || \"\"" } }, usesInheritance: true, ngImport: i0, template: `
2279
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyGroup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2280
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FormlyGroup, isStandalone: false, selector: "formly-group", host: { properties: { "class": "field.fieldGroupClassName || \"\"" } }, usesInheritance: true, ngImport: i0, template: `
2218
2281
  @for (f of field.fieldGroup; track $index) {
2219
2282
  <formly-field [field]="f"></formly-field>
2220
2283
  }
2221
2284
  <ng-content></ng-content>
2222
2285
  `, isInline: true, dependencies: [{ kind: "component", type: LegacyFormlyField, selector: "formly-field" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2223
2286
  }
2224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyGroup, decorators: [{
2287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyGroup, decorators: [{
2225
2288
  type: Component,
2226
2289
  args: [{
2227
2290
  selector: 'formly-group',
@@ -2304,6 +2367,7 @@ class FormlyFormBuilder {
2304
2367
  this.injector = injector;
2305
2368
  this.viewContainerRef = viewContainerRef;
2306
2369
  this.parentForm = parentForm;
2370
+ this.initializedForms = new WeakSet();
2307
2371
  if (configs) {
2308
2372
  configs.forEach((c) => config.addConfig(c));
2309
2373
  }
@@ -2318,21 +2382,43 @@ class FormlyFormBuilder {
2318
2382
  if (!field.parent) {
2319
2383
  this._setOptions(field);
2320
2384
  }
2321
- disableTreeValidityCall(field.form, () => {
2322
- this._build(field);
2323
- // TODO: add test for https://github.com/ngx-formly/ngx-formly/issues/3910
2324
- if (!field.parent || field.fieldArray) {
2325
- // detect changes early to avoid reset value by hidden fields
2326
- const options = field.options;
2327
- if (field.parent && isHiddenField(field)) {
2328
- // when hide is used in expression set defaul value will not be set until detect hide changes
2329
- // which causes default value not set on new item is added
2330
- options._hiddenFieldsForCheck?.push({ field, default: false });
2385
+ const firstBuild = !field.parent && !this.initializedForms.has(field.form);
2386
+ let lastEmittedStatus;
2387
+ const subscription = firstBuild
2388
+ ? field.form.statusChanges.subscribe((status) => (lastEmittedStatus = status))
2389
+ : undefined;
2390
+ if (firstBuild) {
2391
+ this.initializedForms.add(field.form);
2392
+ }
2393
+ try {
2394
+ disableTreeValidityCall(field.form, () => {
2395
+ this._build(field);
2396
+ // TODO: add test for https://github.com/ngx-formly/ngx-formly/issues/3910
2397
+ if (!field.parent || field.fieldArray) {
2398
+ // detect changes early to avoid reset value by hidden fields
2399
+ const options = field.options;
2400
+ if (field.parent && isHiddenField(field)) {
2401
+ // when hide is used in expression set defaul value will not be set until detect hide changes
2402
+ // which causes default value not set on new item is added
2403
+ options._hiddenFieldsForCheck?.push({ field, default: false });
2404
+ }
2405
+ options.checkExpressions?.(field, true);
2406
+ options._detectChanges?.(field);
2331
2407
  }
2332
- options.checkExpressions?.(field, true);
2333
- options._detectChanges?.(field);
2408
+ });
2409
+ }
2410
+ catch (error) {
2411
+ if (firstBuild) {
2412
+ this.initializedForms.delete(field.form);
2334
2413
  }
2335
- });
2414
+ throw error;
2415
+ }
2416
+ finally {
2417
+ subscription?.unsubscribe();
2418
+ }
2419
+ if (firstBuild && lastEmittedStatus !== field.form.status) {
2420
+ field.form.statusChanges.emit(field.form.status);
2421
+ }
2336
2422
  }
2337
2423
  _build(field) {
2338
2424
  if (!field) {
@@ -2372,10 +2458,10 @@ class FormlyFormBuilder {
2372
2458
  }
2373
2459
  }
2374
2460
  }
2375
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyFormBuilder, deps: [{ token: FormlyConfig }, { token: i0.Injector }, { token: i0.ViewContainerRef, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: FORMLY_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2376
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyFormBuilder, providedIn: 'root' }); }
2461
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFormBuilder, deps: [{ token: FormlyConfig }, { token: i0.Injector }, { token: i0.ViewContainerRef, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: FORMLY_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2462
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFormBuilder, providedIn: 'root' }); }
2377
2463
  }
2378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyFormBuilder, decorators: [{
2464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFormBuilder, decorators: [{
2379
2465
  type: Injectable,
2380
2466
  args: [{ providedIn: 'root' }]
2381
2467
  }], ctorParameters: () => [{ type: FormlyConfig }, { type: i0.Injector }, { type: i0.ViewContainerRef, decorators: [{
@@ -2436,7 +2522,11 @@ class FormlyForm {
2436
2522
  this.fieldTemplates = fieldTemplates;
2437
2523
  /** Event that is emitted when the model value is changed */
2438
2524
  this.modelChange = new EventEmitter();
2525
+ /** Emits a build event asynchronously when the fields or form input changes. */
2526
+ this.fieldChange = new EventEmitter();
2439
2527
  this.field = { type: 'formly-group' };
2528
+ this.destroyRef = inject(DestroyRef);
2529
+ this.pendingTasks = inject(PendingTasks);
2440
2530
  this._modelChangeValue = {};
2441
2531
  this.valueChangesUnsubscribe = () => { };
2442
2532
  }
@@ -2454,6 +2544,14 @@ class FormlyForm {
2454
2544
  this.builder.build(this.field);
2455
2545
  this.valueChangesUnsubscribe = this.valueChanges();
2456
2546
  }
2547
+ if (changes.fields || changes.form) {
2548
+ this.pendingTasks.run(async () => {
2549
+ await Promise.resolve();
2550
+ if (!this.destroyRef.destroyed) {
2551
+ this.fieldChange.emit({ field: this.field, type: 'build', value: this.form });
2552
+ }
2553
+ });
2554
+ }
2457
2555
  }
2458
2556
  ngOnDestroy() {
2459
2557
  this.valueChangesUnsubscribe();
@@ -2499,10 +2597,10 @@ class FormlyForm {
2499
2597
  Object.keys(field).forEach((p) => (this.field[p] = field[p]));
2500
2598
  }
2501
2599
  }
2502
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyForm, deps: [{ token: FormlyFormBuilder }, { token: FormlyConfig }, { token: i0.NgZone }, { token: FormlyFieldTemplates }], target: i0.ɵɵFactoryTarget.Component }); }
2503
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FormlyForm, isStandalone: true, selector: "formly-form", inputs: { form: "form", model: "model", fields: "fields", options: "options" }, outputs: { modelChange: "modelChange" }, providers: [FormlyFormBuilder, FormlyFieldTemplates], queries: [{ propertyName: "templates", predicate: FormlyTemplate }], usesOnChanges: true, ngImport: i0, template: '<formly-field [field]="field"></formly-field>', isInline: true, dependencies: [{ kind: "component", type: FormlyField, selector: "formly-field", inputs: ["field"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2600
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyForm, deps: [{ token: FormlyFormBuilder }, { token: FormlyConfig }, { token: i0.NgZone }, { token: FormlyFieldTemplates }], target: i0.ɵɵFactoryTarget.Component }); }
2601
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: FormlyForm, isStandalone: true, selector: "formly-form", inputs: { form: "form", model: "model", fields: "fields", options: "options" }, outputs: { modelChange: "modelChange", fieldChange: "fieldChange" }, providers: [FormlyFormBuilder, FormlyFieldTemplates], queries: [{ propertyName: "templates", predicate: FormlyTemplate }], usesOnChanges: true, ngImport: i0, template: '<formly-field [field]="field"></formly-field>', isInline: true, dependencies: [{ kind: "component", type: FormlyField, selector: "formly-field", inputs: ["field"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2504
2602
  }
2505
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyForm, decorators: [{
2603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyForm, decorators: [{
2506
2604
  type: Component,
2507
2605
  args: [{
2508
2606
  selector: 'formly-form',
@@ -2522,6 +2620,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
2522
2620
  type: Input
2523
2621
  }], modelChange: [{
2524
2622
  type: Output
2623
+ }], fieldChange: [{
2624
+ type: Output
2525
2625
  }], templates: [{
2526
2626
  type: ContentChildren,
2527
2627
  args: [FormlyTemplate]
@@ -2530,10 +2630,10 @@ class LegacyFormlyForm extends FormlyForm {
2530
2630
  set templates(templates) {
2531
2631
  this.fieldTemplates.templates = templates;
2532
2632
  }
2533
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyForm, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2534
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: LegacyFormlyForm, isStandalone: false, selector: "formly-form", providers: [FormlyFormBuilder, FormlyFieldTemplates], queries: [{ propertyName: "templates", predicate: LegacyFormlyTemplate }], usesInheritance: true, ngImport: i0, template: '<formly-field [field]="field"></formly-field>', isInline: true, dependencies: [{ kind: "component", type: LegacyFormlyField, selector: "formly-field" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2633
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyForm, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2634
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: LegacyFormlyForm, isStandalone: false, selector: "formly-form", providers: [FormlyFormBuilder, FormlyFieldTemplates], queries: [{ propertyName: "templates", predicate: LegacyFormlyTemplate }], usesInheritance: true, ngImport: i0, template: '<formly-field [field]="field"></formly-field>', isInline: true, dependencies: [{ kind: "component", type: LegacyFormlyField, selector: "formly-field" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2535
2635
  }
2536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyForm, decorators: [{
2636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyForm, decorators: [{
2537
2637
  type: Component,
2538
2638
  args: [{
2539
2639
  selector: 'formly-form',
@@ -2727,10 +2827,10 @@ class FormlyAttributes {
2727
2827
  removeAttribute(attr) {
2728
2828
  this.renderer.removeAttribute(this.elementRef.nativeElement, attr);
2729
2829
  }
2730
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyAttributes, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: DOCUMENT }, { token: FormlyField, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2731
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: FormlyAttributes, isStandalone: true, selector: "[formlyAttributes]", inputs: { field: ["formlyAttributes", "field"], id: "id" }, host: { listeners: { "change": "onHostChange($event)" } }, usesOnChanges: true, ngImport: i0 }); }
2830
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyAttributes, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: DOCUMENT }, { token: FormlyField, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2831
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: FormlyAttributes, isStandalone: true, selector: "[formlyAttributes]", inputs: { field: ["formlyAttributes", "field"], id: "id" }, host: { listeners: { "change": "onHostChange($event)" } }, usesOnChanges: true, ngImport: i0 }); }
2732
2832
  }
2733
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyAttributes, decorators: [{
2833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyAttributes, decorators: [{
2734
2834
  type: Directive,
2735
2835
  args: [{
2736
2836
  selector: '[formlyAttributes]',
@@ -2751,10 +2851,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
2751
2851
  type: Input
2752
2852
  }] } });
2753
2853
  class LegacyFormlyAttributes extends FormlyAttributes {
2754
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyAttributes, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
2755
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: LegacyFormlyAttributes, isStandalone: false, selector: "[formlyAttributes]", host: { listeners: { "change": "onHostChange($event)" } }, usesInheritance: true, ngImport: i0 }); }
2854
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyAttributes, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
2855
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: LegacyFormlyAttributes, isStandalone: false, selector: "[formlyAttributes]", host: { listeners: { "change": "onHostChange($event)" } }, usesInheritance: true, ngImport: i0 }); }
2756
2856
  }
2757
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyAttributes, decorators: [{
2857
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyAttributes, decorators: [{
2758
2858
  type: Directive,
2759
2859
  args: [{
2760
2860
  selector: '[formlyAttributes]',
@@ -2812,10 +2912,10 @@ class FormlyValidationMessage {
2812
2912
  }
2813
2913
  return undefined;
2814
2914
  }
2815
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyValidationMessage, deps: [{ token: FormlyConfig }], target: i0.ɵɵFactoryTarget.Component }); }
2816
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: FormlyValidationMessage, isStandalone: true, selector: "formly-validation-message", inputs: { field: "field" }, usesOnChanges: true, ngImport: i0, template: '{{ errorMessage$ | async }}', isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2915
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyValidationMessage, deps: [{ token: FormlyConfig }], target: i0.ɵɵFactoryTarget.Component }); }
2916
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: FormlyValidationMessage, isStandalone: true, selector: "formly-validation-message", inputs: { field: "field" }, usesOnChanges: true, ngImport: i0, template: '{{ errorMessage$ | async }}', isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2817
2917
  }
2818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyValidationMessage, decorators: [{
2918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyValidationMessage, decorators: [{
2819
2919
  type: Component,
2820
2920
  args: [{
2821
2921
  selector: 'formly-validation-message',
@@ -2828,10 +2928,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
2828
2928
  type: Input
2829
2929
  }] } });
2830
2930
  class LegacyFormlyValidationMessage extends FormlyValidationMessage {
2831
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyValidationMessage, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2832
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: LegacyFormlyValidationMessage, isStandalone: false, selector: "formly-validation-message", usesInheritance: true, ngImport: i0, template: '{{ errorMessage$ | async }}', isInline: true, dependencies: [{ kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2931
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyValidationMessage, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2932
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: LegacyFormlyValidationMessage, isStandalone: false, selector: "formly-validation-message", usesInheritance: true, ngImport: i0, template: '{{ errorMessage$ | async }}', isInline: true, dependencies: [{ kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2833
2933
  }
2834
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LegacyFormlyValidationMessage, decorators: [{
2934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LegacyFormlyValidationMessage, decorators: [{
2835
2935
  type: Component,
2836
2936
  args: [{
2837
2937
  selector: 'formly-validation-message',
@@ -2912,10 +3012,10 @@ class FieldArrayType extends FieldType {
2912
3012
  this.options._hiddenFieldsForCheck.push({ field: f });
2913
3013
  }
2914
3014
  }
2915
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FieldArrayType, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
2916
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: FieldArrayType, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
3015
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldArrayType, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3016
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: FieldArrayType, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
2917
3017
  }
2918
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FieldArrayType, decorators: [{
3018
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldArrayType, decorators: [{
2919
3019
  type: Directive
2920
3020
  }] });
2921
3021
 
@@ -2924,10 +3024,10 @@ class FieldWrapper extends FieldType {
2924
3024
  set _staticContent(content) {
2925
3025
  this.fieldComponent = content;
2926
3026
  }
2927
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FieldWrapper, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
2928
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: FieldWrapper, isStandalone: true, viewQueries: [{ propertyName: "fieldComponent", first: true, predicate: ["fieldComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "_staticContent", first: true, predicate: ["fieldComponent"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0 }); }
3027
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldWrapper, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3028
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: FieldWrapper, isStandalone: true, viewQueries: [{ propertyName: "fieldComponent", first: true, predicate: ["fieldComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "_staticContent", first: true, predicate: ["fieldComponent"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0 }); }
2929
3029
  }
2930
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FieldWrapper, decorators: [{
3030
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldWrapper, decorators: [{
2931
3031
  type: Directive
2932
3032
  }], propDecorators: { fieldComponent: [{
2933
3033
  type: ViewChild,
@@ -2966,8 +3066,8 @@ class FormlyModule {
2966
3066
  ],
2967
3067
  };
2968
3068
  }
2969
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2970
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.25", ngImport: i0, type: FormlyModule, declarations: [LegacyFormlyTemplate,
3069
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3070
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: FormlyModule, declarations: [LegacyFormlyTemplate,
2971
3071
  LegacyFormlyForm,
2972
3072
  LegacyFormlyField,
2973
3073
  LegacyFormlyAttributes,
@@ -2979,9 +3079,9 @@ class FormlyModule {
2979
3079
  LegacyFormlyAttributes,
2980
3080
  LegacyFormlyValidationMessage,
2981
3081
  FormlyGroup] }); }
2982
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyModule, imports: [CommonModule] }); }
3082
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyModule, imports: [CommonModule] }); }
2983
3083
  }
2984
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FormlyModule, decorators: [{
3084
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyModule, decorators: [{
2985
3085
  type: NgModule,
2986
3086
  args: [{
2987
3087
  declarations: [