@rxap/forms 18.0.4 → 18.1.0-dev.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 (29) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esm2022/index.mjs +2 -1
  3. package/esm2022/lib/directives/form-control-error.directive.mjs +3 -3
  4. package/esm2022/lib/directives/form-control-mark-dirty.directive.mjs +3 -3
  5. package/esm2022/lib/directives/form-control-mark-pristine.directive.mjs +3 -3
  6. package/esm2022/lib/directives/form-control-mark-touched.directive.mjs +3 -3
  7. package/esm2022/lib/directives/form-control-mark-untouched.directive.mjs +3 -3
  8. package/esm2022/lib/directives/form-control-name.directive.mjs +3 -3
  9. package/esm2022/lib/directives/form-group-name.directive.mjs +3 -3
  10. package/esm2022/lib/directives/form-loaded.directive.mjs +3 -3
  11. package/esm2022/lib/directives/form-loading-error.directive.mjs +3 -3
  12. package/esm2022/lib/directives/form-loading.directive.mjs +3 -3
  13. package/esm2022/lib/directives/form-submit-failed.directive.mjs +3 -3
  14. package/esm2022/lib/directives/form-submit-invalid.directive.mjs +3 -3
  15. package/esm2022/lib/directives/form-submit-successful.directive.mjs +3 -3
  16. package/esm2022/lib/directives/form-submit.directive.mjs +3 -3
  17. package/esm2022/lib/directives/form-submitting.directive.mjs +3 -3
  18. package/esm2022/lib/directives/form.directive.mjs +7 -6
  19. package/esm2022/lib/directives/forms.module.mjs +4 -4
  20. package/esm2022/lib/directives/models.mjs +1 -1
  21. package/esm2022/lib/directives/parent-control-container.directive.mjs +3 -3
  22. package/esm2022/lib/utilities.mjs +36 -0
  23. package/fesm2022/rxap-forms.mjs +93 -58
  24. package/fesm2022/rxap-forms.mjs.map +1 -1
  25. package/index.d.ts +1 -0
  26. package/lib/directives/form.directive.d.ts +2 -1
  27. package/lib/directives/models.d.ts +5 -5
  28. package/lib/utilities.d.ts +4 -0
  29. package/package.json +27 -27
@@ -2,15 +2,15 @@ import { Directive } from '@angular/core';
2
2
  import { ControlContainer } from '@angular/forms';
3
3
  import * as i0 from "@angular/core";
4
4
  export class ParentControlContainerDirective {
5
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
6
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: ParentControlContainerDirective, isStandalone: true, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
5
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
6
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: ParentControlContainerDirective, isStandalone: true, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
7
7
  {
8
8
  provide: ControlContainer,
9
9
  useExisting: ControlContainer,
10
10
  },
11
11
  ], ngImport: i0 }); }
12
12
  }
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
14
14
  type: Directive,
15
15
  args: [{
16
16
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -0,0 +1,36 @@
1
+ import { runInInjectionContext, } from '@angular/core';
2
+ import { isPromise } from '@rxap/utilities';
3
+ // TODO : create a @rxap/ngx-utilities package and move this function there
4
+ export function ToMethodWithInjectionContext(call, injector, metadata = { id: 'to-method' }) {
5
+ return {
6
+ call: (parameters, ...args) => new Promise((resolve, reject) => {
7
+ if (!injector) {
8
+ throw new Error('The injector is not defined. Can not run the method in the injection context.');
9
+ }
10
+ runInInjectionContext(injector, () => {
11
+ try {
12
+ const result = call(parameters, ...args);
13
+ if (isPromise(result)) {
14
+ result.then(resolve).catch(reject);
15
+ }
16
+ else {
17
+ resolve(result);
18
+ }
19
+ }
20
+ catch (e) {
21
+ reject(e);
22
+ }
23
+ });
24
+ }),
25
+ metadata
26
+ };
27
+ }
28
+ export function ToMethodWithInjectionContextFactory(call, metadata = { id: 'to-method' }) {
29
+ return (injector) => {
30
+ if (!injector) {
31
+ throw new Error('The injector is not defined. Ensure the factory is used in conjunction with deps: [ INJECTOR ]');
32
+ }
33
+ return ToMethodWithInjectionContext(call, injector, metadata);
34
+ };
35
+ }
36
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbGl0aWVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9mb3Jtcy9zcmMvbGliL3V0aWxpdGllcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBRUwscUJBQXFCLEdBQ3RCLE1BQU0sZUFBZSxDQUFDO0FBRXZCLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUU1QywyRUFBMkU7QUFFM0UsTUFBTSxVQUFVLDRCQUE0QixDQUMxQyxJQUdzQyxFQUN0QyxRQUFrQixFQUNsQixXQUFnQixFQUFFLEVBQUUsRUFBRSxXQUFXLEVBQUU7SUFFbkMsT0FBTztRQUNMLElBQUksRUFBRSxDQUFDLFVBQVUsRUFBRSxHQUFHLElBQUksRUFBRSxFQUFFLENBQUMsSUFBSSxPQUFPLENBQWEsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUU7WUFDekUsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO2dCQUNkLE1BQU0sSUFBSSxLQUFLLENBQUMsK0VBQStFLENBQUMsQ0FBQztZQUNuRyxDQUFDO1lBQ0QscU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bmN0aW9uIHdpdGggZGVwczogWyBJTkpFQ1RPUiBdJyk7XG4gICAgfVxuICAgIHJldHVybiBUb01ldGhvZFdpdGhJbmplY3Rpb25Db250ZXh0PFJldHVyblR5cGUsIFBhcmFtZXRlciwgTWV0aG9kVHlwZT4oXG4gICAgICBjYWxsLCBpbmplY3RvciwgbWV0YWRhdGEpO1xuICB9O1xufVxuIl19
@@ -1,6 +1,6 @@
1
1
  import { isEmail, isIP, isMobilePhone, isPort, isURL, isUUID } from '@rxap/validator';
2
2
  import * as i0 from '@angular/core';
3
- import { Directive, Host, SkipSelf, Input, HostListener, forwardRef, Optional, Self, Inject, InjectionToken, isDevMode, Injector, EventEmitter, ChangeDetectorRef, Output, HostBinding, TemplateRef, ViewContainerRef, NgModule } from '@angular/core';
3
+ import { Directive, Host, SkipSelf, Input, HostListener, forwardRef, Optional, Self, Inject, InjectionToken, isDevMode, Injector, input, EventEmitter, ChangeDetectorRef, Output, HostBinding, TemplateRef, ViewContainerRef, NgModule, runInInjectionContext } from '@angular/core';
4
4
  import * as i1 from '@angular/forms';
5
5
  import { FormControlName, NG_VALIDATORS, NG_ASYNC_VALIDATORS, NG_VALUE_ACCESSOR, NgControl, FormGroupName, ControlContainer, UntypedFormArray, AbstractControl, UntypedFormGroup, UntypedFormControl, Validators, FormGroupDirective } from '@angular/forms';
6
6
  import { startWith, filter, tap, map, distinctUntilChanged, debounceTime, take } from 'rxjs/operators';
@@ -438,10 +438,10 @@ class FormControlErrorDirective {
438
438
  ngOnDestroy() {
439
439
  this.subscription?.unsubscribe();
440
440
  }
441
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlErrorDirective, deps: [{ token: i0.TemplateRef }, { token: i1.ControlContainer, host: true, skipSelf: true }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
442
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormControlErrorDirective, isStandalone: true, selector: "[rxapFormControlError]", inputs: { name: ["rxapFormControlErrorFrom", "name"], errorKey: ["rxapFormControlErrorIf", "errorKey"] }, ngImport: i0 }); }
441
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlErrorDirective, deps: [{ token: i0.TemplateRef }, { token: i1.ControlContainer, host: true, skipSelf: true }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
442
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormControlErrorDirective, isStandalone: true, selector: "[rxapFormControlError]", inputs: { name: ["rxapFormControlErrorFrom", "name"], errorKey: ["rxapFormControlErrorIf", "errorKey"] }, ngImport: i0 }); }
443
443
  }
444
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlErrorDirective, decorators: [{
444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlErrorDirective, decorators: [{
445
445
  type: Directive,
446
446
  args: [{
447
447
  selector: '[rxapFormControlError]',
@@ -478,10 +478,10 @@ class FormControlMarkDirtyDirective {
478
478
  control?.markAsDirty();
479
479
  }
480
480
  }
481
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkDirtyDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
482
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormControlMarkDirtyDirective, isStandalone: true, selector: "[rxapFormControlMarkDirty]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
481
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkDirtyDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
482
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormControlMarkDirtyDirective, isStandalone: true, selector: "[rxapFormControlMarkDirty]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
483
483
  }
484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkDirtyDirective, decorators: [{
484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkDirtyDirective, decorators: [{
485
485
  type: Directive,
486
486
  args: [{
487
487
  selector: '[rxapFormControlMarkDirty]',
@@ -505,10 +505,10 @@ class FormControlMarkPristineDirective {
505
505
  control?.markAsPristine();
506
506
  }
507
507
  }
508
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkPristineDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
509
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormControlMarkPristineDirective, isStandalone: true, selector: "[rxapFormControlMarkPristine]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
508
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkPristineDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
509
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormControlMarkPristineDirective, isStandalone: true, selector: "[rxapFormControlMarkPristine]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
510
510
  }
511
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkPristineDirective, decorators: [{
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkPristineDirective, decorators: [{
512
512
  type: Directive,
513
513
  args: [{
514
514
  selector: '[rxapFormControlMarkPristine]',
@@ -526,10 +526,10 @@ class FormControlMarkTouchedDirective {
526
526
  onClick() {
527
527
  this.parent.control?.markAllAsTouched();
528
528
  }
529
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkTouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
530
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormControlMarkTouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkTouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkTouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
530
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormControlMarkTouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkTouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
531
531
  }
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkTouchedDirective, decorators: [{
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkTouchedDirective, decorators: [{
533
533
  type: Directive,
534
534
  args: [{
535
535
  selector: '[rxapFormControlMarkTouched]',
@@ -553,10 +553,10 @@ class FormControlMarkUntouchedDirective {
553
553
  control?.markAsUntouched();
554
554
  }
555
555
  }
556
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkUntouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
557
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormControlMarkUntouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkUntouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
556
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkUntouchedDirective, deps: [{ token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Directive }); }
557
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormControlMarkUntouchedDirective, isStandalone: true, selector: "[rxapFormControlMarkUntouched]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
558
558
  }
559
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlMarkUntouchedDirective, decorators: [{
559
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlMarkUntouchedDirective, decorators: [{
560
560
  type: Directive,
561
561
  args: [{
562
562
  selector: '[rxapFormControlMarkUntouched]',
@@ -577,15 +577,15 @@ class FormControlNameDirective extends FormControlName {
577
577
  constructor(parent, validators, asyncValidators, valueAccessors) {
578
578
  super(parent, validators, asyncValidators, valueAccessors, null);
579
579
  }
580
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: NG_VALUE_ACCESSOR, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
581
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormControlNameDirective, isStandalone: true, selector: "[rxapFormControlName]", inputs: { name: ["rxapFormControlName", "name"] }, providers: [
580
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }, { token: NG_VALUE_ACCESSOR, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
581
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormControlNameDirective, isStandalone: true, selector: "[rxapFormControlName]", inputs: { name: ["rxapFormControlName", "name"] }, providers: [
582
582
  {
583
583
  provide: NgControl,
584
584
  useExisting: forwardRef(() => FormControlNameDirective),
585
585
  },
586
586
  ], exportAs: ["rxapFormControl"], usesInheritance: true, ngImport: i0 }); }
587
587
  }
588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormControlNameDirective, decorators: [{
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormControlNameDirective, decorators: [{
589
589
  type: Directive,
590
590
  args: [{
591
591
  selector: '[rxapFormControlName]',
@@ -642,15 +642,15 @@ class FormGroupNameDirective extends FormGroupName {
642
642
  constructor(parent, validators, asyncValidators) {
643
643
  super(parent, validators, asyncValidators);
644
644
  }
645
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormGroupNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
646
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormGroupNameDirective, isStandalone: true, selector: "[rxapFormGroupName]", inputs: { name: ["rxapFormGroupName", "name"] }, providers: [
645
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormGroupNameDirective, deps: [{ token: i1.ControlContainer, optional: true, skipSelf: true }, { token: NG_VALIDATORS, optional: true, self: true }, { token: NG_ASYNC_VALIDATORS, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
646
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormGroupNameDirective, isStandalone: true, selector: "[rxapFormGroupName]", inputs: { name: ["rxapFormGroupName", "name"] }, providers: [
647
647
  {
648
648
  provide: ControlContainer,
649
649
  useExisting: forwardRef(() => FormGroupNameDirective),
650
650
  },
651
651
  ], exportAs: ["rxapFormGroup"], usesInheritance: true, ngImport: i0 }); }
652
652
  }
653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormGroupNameDirective, decorators: [{
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormGroupNameDirective, decorators: [{
654
654
  type: Directive,
655
655
  args: [{
656
656
  selector: '[rxapFormGroupName]',
@@ -1823,6 +1823,7 @@ class FormDirective extends FormGroupDirective {
1823
1823
  this.submitSuccessfulMethod = submitSuccessfulMethod;
1824
1824
  this.formDefinitionBuilder = formDefinitionBuilder;
1825
1825
  this.loadingIndicatorService = loadingIndicatorService;
1826
+ this.context = input({});
1826
1827
  /**
1827
1828
  * Emits when the submit method is executed without errors. The result of the
1828
1829
  * submit method is passed as event object.
@@ -2054,7 +2055,7 @@ class FormDirective extends FormGroupDirective {
2054
2055
  this.submitting$.enable();
2055
2056
  this.submitError$.next(null);
2056
2057
  try {
2057
- const resultOrPromise = this.submitMethod.call(value);
2058
+ const resultOrPromise = this.submitMethod.call(value, this.context());
2058
2059
  if (isPromise(resultOrPromise)) {
2059
2060
  resultOrPromise
2060
2061
  .then((result) => {
@@ -2123,8 +2124,8 @@ class FormDirective extends FormGroupDirective {
2123
2124
  this._formDefinition.ngOnDestroy();
2124
2125
  }
2125
2126
  }
2126
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormDirective, deps: [{ token: ChangeDetectorRef }, { token: RXAP_FORM_DEFINITION, optional: true }, { token: RXAP_FORM_SUBMIT_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_DEFINITION_BUILDER, optional: true, skipSelf: true }, { token: LoadingIndicatorService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2127
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormDirective, isStandalone: true, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: { initial: "initial", useFormDefinition: ["rxapForm", "useFormDefinition"], submitMethod: "submitMethod" }, outputs: { ngSubmit: "ngSubmit", rxapSubmit: "rxapSubmit", invalidSubmit: "invalidSubmit", submitSuccessful$: "submitSuccessful" }, host: { listeners: { "reset": "onReset()" }, properties: { "class.rxap-submitting": "this.submitting", "class.rxap-submit-error": "this.submitError", "class.rxap-loading": "this.loading", "class.rxap-loaded": "this.loaded", "class.rxap-loading-error": "this.loadingError" } }, providers: [
2127
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormDirective, deps: [{ token: ChangeDetectorRef }, { token: RXAP_FORM_DEFINITION, optional: true }, { token: RXAP_FORM_SUBMIT_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_LOAD_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_FAILED_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, optional: true, skipSelf: true }, { token: RXAP_FORM_DEFINITION_BUILDER, optional: true, skipSelf: true }, { token: LoadingIndicatorService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2128
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.0.6", type: FormDirective, isStandalone: true, selector: "form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]", inputs: { initial: { classPropertyName: "initial", publicName: "initial", isSignal: false, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null }, useFormDefinition: { classPropertyName: "useFormDefinition", publicName: "rxapForm", isSignal: false, isRequired: false, transformFunction: null }, submitMethod: { classPropertyName: "submitMethod", publicName: "submitMethod", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { ngSubmit: "ngSubmit", rxapSubmit: "rxapSubmit", invalidSubmit: "invalidSubmit", submitSuccessful$: "submitSuccessful" }, host: { listeners: { "reset": "onReset()" }, properties: { "class.rxap-submitting": "this.submitting", "class.rxap-submit-error": "this.submitError", "class.rxap-loading": "this.loading", "class.rxap-loaded": "this.loaded", "class.rxap-loading-error": "this.loadingError" } }, providers: [
2128
2129
  {
2129
2130
  provide: ControlContainer,
2130
2131
  // ignore coverage
@@ -2168,7 +2169,7 @@ class FormDirective extends FormGroupDirective {
2168
2169
  // endregion
2169
2170
  ], exportAs: ["rxapForm"], usesInheritance: true, usesOnChanges: true, ngImport: i0 }); }
2170
2171
  }
2171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormDirective, decorators: [{
2172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormDirective, decorators: [{
2172
2173
  type: Directive,
2173
2174
  args: [{
2174
2175
  selector: 'form[rxapForm]:not([formGroup]):not([ngForm]),rxap-form,form[rxapForm]',
@@ -2332,10 +2333,10 @@ class FormLoadedDirective {
2332
2333
  ngOnDestroy() {
2333
2334
  this.subscription?.unsubscribe();
2334
2335
  }
2335
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormLoadedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2336
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormLoadedDirective, isStandalone: true, selector: "[rxapFormLoaded]", ngImport: i0 }); }
2336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormLoadedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2337
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormLoadedDirective, isStandalone: true, selector: "[rxapFormLoaded]", ngImport: i0 }); }
2337
2338
  }
2338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormLoadedDirective, decorators: [{
2339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormLoadedDirective, decorators: [{
2339
2340
  type: Directive,
2340
2341
  args: [{
2341
2342
  selector: '[rxapFormLoaded]',
@@ -2369,10 +2370,10 @@ class FormLoadingErrorDirective {
2369
2370
  ngOnDestroy() {
2370
2371
  this.subscription?.unsubscribe();
2371
2372
  }
2372
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormLoadingErrorDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2373
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormLoadingErrorDirective, isStandalone: true, selector: "[rxapFormLoadingError]", ngImport: i0 }); }
2373
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormLoadingErrorDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2374
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormLoadingErrorDirective, isStandalone: true, selector: "[rxapFormLoadingError]", ngImport: i0 }); }
2374
2375
  }
2375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormLoadingErrorDirective, decorators: [{
2376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormLoadingErrorDirective, decorators: [{
2376
2377
  type: Directive,
2377
2378
  args: [{
2378
2379
  selector: '[rxapFormLoadingError]',
@@ -2406,10 +2407,10 @@ class FormLoadingDirective {
2406
2407
  ngOnDestroy() {
2407
2408
  this.subscription?.unsubscribe();
2408
2409
  }
2409
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormLoadingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2410
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormLoadingDirective, isStandalone: true, selector: "[rxapFormLoading]", ngImport: i0 }); }
2410
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormLoadingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2411
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormLoadingDirective, isStandalone: true, selector: "[rxapFormLoading]", ngImport: i0 }); }
2411
2412
  }
2412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormLoadingDirective, decorators: [{
2413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormLoadingDirective, decorators: [{
2413
2414
  type: Directive,
2414
2415
  args: [{
2415
2416
  selector: '[rxapFormLoading]',
@@ -2443,10 +2444,10 @@ class FormSubmitFailedDirective {
2443
2444
  ngOnDestroy() {
2444
2445
  this.subscription?.unsubscribe();
2445
2446
  }
2446
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitFailedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2447
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormSubmitFailedDirective, isStandalone: true, selector: "[rxapFormSubmitFailed]", ngImport: i0 }); }
2447
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitFailedDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2448
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormSubmitFailedDirective, isStandalone: true, selector: "[rxapFormSubmitFailed]", ngImport: i0 }); }
2448
2449
  }
2449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitFailedDirective, decorators: [{
2450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitFailedDirective, decorators: [{
2450
2451
  type: Directive,
2451
2452
  args: [{
2452
2453
  selector: '[rxapFormSubmitFailed]',
@@ -2478,10 +2479,10 @@ class FormSubmitInvalidDirective {
2478
2479
  ngOnDestroy() {
2479
2480
  this.subscription?.unsubscribe();
2480
2481
  }
2481
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitInvalidDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2482
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormSubmitInvalidDirective, isStandalone: true, selector: "[rxapFormSubmitInvalid]", ngImport: i0 }); }
2482
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitInvalidDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2483
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormSubmitInvalidDirective, isStandalone: true, selector: "[rxapFormSubmitInvalid]", ngImport: i0 }); }
2483
2484
  }
2484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitInvalidDirective, decorators: [{
2485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitInvalidDirective, decorators: [{
2485
2486
  type: Directive,
2486
2487
  args: [{
2487
2488
  selector: '[rxapFormSubmitInvalid]',
@@ -2513,10 +2514,10 @@ class FormSubmitSuccessfulDirective {
2513
2514
  ngOnDestroy() {
2514
2515
  this.subscription?.unsubscribe();
2515
2516
  }
2516
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitSuccessfulDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2517
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormSubmitSuccessfulDirective, isStandalone: true, selector: "[rxapFormSubmitSuccessful]", ngImport: i0 }); }
2517
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitSuccessfulDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2518
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormSubmitSuccessfulDirective, isStandalone: true, selector: "[rxapFormSubmitSuccessful]", ngImport: i0 }); }
2518
2519
  }
2519
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitSuccessfulDirective, decorators: [{
2520
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitSuccessfulDirective, decorators: [{
2520
2521
  type: Directive,
2521
2522
  args: [{
2522
2523
  selector: '[rxapFormSubmitSuccessful]',
@@ -2568,10 +2569,10 @@ class FormSubmitDirective extends ConfirmClick {
2568
2569
  ngOnDestroy() {
2569
2570
  this.subscription?.unsubscribe();
2570
2571
  }
2571
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitDirective, deps: [{ token: FormDirective }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2572
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormSubmitDirective, isStandalone: true, selector: "[rxapFormSubmit]", inputs: { type: "type", resetAfterSubmit: "resetAfterSubmit", navigateAfterSubmit: "navigateAfterSubmit" }, outputs: { afterSubmit: "afterSubmit" }, host: { listeners: { "click": "onClick()", "confirmed": "onConfirm()" }, properties: { "type": "this.type" } }, usesInheritance: true, ngImport: i0 }); }
2572
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitDirective, deps: [{ token: FormDirective }, { token: Router, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2573
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormSubmitDirective, isStandalone: true, selector: "[rxapFormSubmit]", inputs: { type: "type", resetAfterSubmit: "resetAfterSubmit", navigateAfterSubmit: "navigateAfterSubmit" }, outputs: { afterSubmit: "afterSubmit" }, host: { listeners: { "click": "onClick()", "confirmed": "onConfirm()" }, properties: { "type": "this.type" } }, usesInheritance: true, ngImport: i0 }); }
2573
2574
  }
2574
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmitDirective, decorators: [{
2575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmitDirective, decorators: [{
2575
2576
  type: Directive,
2576
2577
  args: [{
2577
2578
  selector: '[rxapFormSubmit]',
@@ -2620,10 +2621,10 @@ class FormSubmittingDirective {
2620
2621
  ngOnDestroy() {
2621
2622
  this.subscription?.unsubscribe();
2622
2623
  }
2623
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmittingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2624
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FormSubmittingDirective, isStandalone: true, selector: "[rxapFormSubmitting]", ngImport: i0 }); }
2624
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmittingDirective, deps: [{ token: FormDirective }, { token: TemplateRef }, { token: ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2625
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: FormSubmittingDirective, isStandalone: true, selector: "[rxapFormSubmitting]", ngImport: i0 }); }
2625
2626
  }
2626
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FormSubmittingDirective, decorators: [{
2627
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: FormSubmittingDirective, decorators: [{
2627
2628
  type: Directive,
2628
2629
  args: [{
2629
2630
  selector: '[rxapFormSubmitting]',
@@ -2641,15 +2642,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
2641
2642
  }] }] });
2642
2643
 
2643
2644
  class ParentControlContainerDirective {
2644
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2645
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: ParentControlContainerDirective, isStandalone: true, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
2645
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ParentControlContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2646
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.6", type: ParentControlContainerDirective, isStandalone: true, selector: "[formControlName][parentControlContainer],[formControlGroup][parentControlContainer]", providers: [
2646
2647
  {
2647
2648
  provide: ControlContainer,
2648
2649
  useExisting: ControlContainer,
2649
2650
  },
2650
2651
  ], ngImport: i0 }); }
2651
2652
  }
2652
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
2653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: ParentControlContainerDirective, decorators: [{
2653
2654
  type: Directive,
2654
2655
  args: [{
2655
2656
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -2665,8 +2666,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImpor
2665
2666
  }] });
2666
2667
 
2667
2668
  class RxapFormsModule {
2668
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: RxapFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2669
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.1", ngImport: i0, type: RxapFormsModule, imports: [FormDirective,
2669
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: RxapFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2670
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.6", ngImport: i0, type: RxapFormsModule, imports: [FormDirective,
2670
2671
  FormSubmitFailedDirective,
2671
2672
  FormLoadingDirective,
2672
2673
  FormSubmittingDirective,
@@ -2699,9 +2700,9 @@ class RxapFormsModule {
2699
2700
  ParentControlContainerDirective,
2700
2701
  FormSubmitSuccessfulDirective,
2701
2702
  FormSubmitInvalidDirective] }); }
2702
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: RxapFormsModule }); }
2703
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: RxapFormsModule }); }
2703
2704
  }
2704
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: RxapFormsModule, decorators: [{
2705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: RxapFormsModule, decorators: [{
2705
2706
  type: NgModule,
2706
2707
  args: [{
2707
2708
  imports: [
@@ -2848,6 +2849,40 @@ class ControlValueAccessor {
2848
2849
  const RXAP_FORM_INITIAL_STATE = new InjectionToken('rxap/forms/initial-state');
2849
2850
  const RXAP_FORM_CONTEXT = new InjectionToken('rxap/forms/context');
2850
2851
 
2852
+ // TODO : create a @rxap/ngx-utilities package and move this function there
2853
+ function ToMethodWithInjectionContext(call, injector, metadata = { id: 'to-method' }) {
2854
+ return {
2855
+ call: (parameters, ...args) => new Promise((resolve, reject) => {
2856
+ if (!injector) {
2857
+ throw new Error('The injector is not defined. Can not run the method in the injection context.');
2858
+ }
2859
+ runInInjectionContext(injector, () => {
2860
+ try {
2861
+ const result = call(parameters, ...args);
2862
+ if (isPromise(result)) {
2863
+ result.then(resolve).catch(reject);
2864
+ }
2865
+ else {
2866
+ resolve(result);
2867
+ }
2868
+ }
2869
+ catch (e) {
2870
+ reject(e);
2871
+ }
2872
+ });
2873
+ }),
2874
+ metadata
2875
+ };
2876
+ }
2877
+ function ToMethodWithInjectionContextFactory(call, metadata = { id: 'to-method' }) {
2878
+ return (injector) => {
2879
+ if (!injector) {
2880
+ throw new Error('The injector is not defined. Ensure the factory is used in conjunction with deps: [ INJECTOR ]');
2881
+ }
2882
+ return ToMethodWithInjectionContext(call, injector, metadata);
2883
+ };
2884
+ }
2885
+
2851
2886
  // region validators
2852
2887
  // endregion
2853
2888
 
@@ -2855,5 +2890,5 @@ const RXAP_FORM_CONTEXT = new InjectionToken('rxap/forms/context');
2855
2890
  * Generated bundle index. Do not edit.
2856
2891
  */
2857
2892
 
2858
- export { ControlAsyncValidator, ControlChange, ControlSetValue, ControlValidator, ControlValueAccessor, FormArrayControlManager, FormControlErrorDirective, FormControlMarkDirtyDirective, FormControlMarkPristineDirective, FormControlMarkTouchedDirective, FormControlMarkUntouchedDirective, FormControlNameDirective, FormDirective, FormGroupNameDirective, FormLoadedDirective, FormLoadingDirective, FormLoadingErrorDirective, FormSubmitDirective, FormSubmitFailedDirective, FormSubmitInvalidDirective, FormSubmitSuccessfulDirective, FormSubmittingDirective, IsArray, IsBoolean, IsComplex, IsDate, IsEmail, IsEnum, IsIP, IsInt, IsNumber, IsObject, IsPhoneNumber, IsPort, IsString, IsUUID, IsUrl, MetadataKeys, ParentControlContainerDirective, RXAP_FORM_CONTEXT, RXAP_FORM_DEFINITION, RXAP_FORM_DEFINITION_BUILDER, RXAP_FORM_INITIAL_STATE, RXAP_FORM_LOAD_FAILED_METHOD, RXAP_FORM_LOAD_METHOD, RXAP_FORM_LOAD_SUCCESSFUL_METHOD, RXAP_FORM_SUBMIT_FAILED_METHOD, RXAP_FORM_SUBMIT_METHOD, RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, RxapForm, RxapFormArray, RxapFormBuilder, RxapFormControl, RxapFormGroup, RxapFormsModule, RxapValidators, ToFormMethod, ToFormSubmitMethod, UseFormArrayControl, UseFormArrayGroup, UseFormControl, UseFormGroup, _IsNumber, controlDisabled$, controlDisabledWhile, controlEnabled$, controlEnabledWhile, controlErrorChanges$, controlReadonly$, controlStatusChanges$, controlValueChanges$, disableControl, enableControl, hasErrorAndDirty, hasErrorAndTouched, isNumber, markAllDirty, markAllPristine, markAllUntouched, mergeControlValidators, selectControlValue$, validateControlOn };
2893
+ export { ControlAsyncValidator, ControlChange, ControlSetValue, ControlValidator, ControlValueAccessor, FormArrayControlManager, FormControlErrorDirective, FormControlMarkDirtyDirective, FormControlMarkPristineDirective, FormControlMarkTouchedDirective, FormControlMarkUntouchedDirective, FormControlNameDirective, FormDirective, FormGroupNameDirective, FormLoadedDirective, FormLoadingDirective, FormLoadingErrorDirective, FormSubmitDirective, FormSubmitFailedDirective, FormSubmitInvalidDirective, FormSubmitSuccessfulDirective, FormSubmittingDirective, IsArray, IsBoolean, IsComplex, IsDate, IsEmail, IsEnum, IsIP, IsInt, IsNumber, IsObject, IsPhoneNumber, IsPort, IsString, IsUUID, IsUrl, MetadataKeys, ParentControlContainerDirective, RXAP_FORM_CONTEXT, RXAP_FORM_DEFINITION, RXAP_FORM_DEFINITION_BUILDER, RXAP_FORM_INITIAL_STATE, RXAP_FORM_LOAD_FAILED_METHOD, RXAP_FORM_LOAD_METHOD, RXAP_FORM_LOAD_SUCCESSFUL_METHOD, RXAP_FORM_SUBMIT_FAILED_METHOD, RXAP_FORM_SUBMIT_METHOD, RXAP_FORM_SUBMIT_SUCCESSFUL_METHOD, RxapForm, RxapFormArray, RxapFormBuilder, RxapFormControl, RxapFormGroup, RxapFormsModule, RxapValidators, ToFormMethod, ToFormSubmitMethod, ToMethodWithInjectionContext, ToMethodWithInjectionContextFactory, UseFormArrayControl, UseFormArrayGroup, UseFormControl, UseFormGroup, _IsNumber, controlDisabled$, controlDisabledWhile, controlEnabled$, controlEnabledWhile, controlErrorChanges$, controlReadonly$, controlStatusChanges$, controlValueChanges$, disableControl, enableControl, hasErrorAndDirty, hasErrorAndTouched, isNumber, markAllDirty, markAllPristine, markAllUntouched, mergeControlValidators, selectControlValue$, validateControlOn };
2859
2894
  //# sourceMappingURL=rxap-forms.mjs.map